import{b as o,s as R,g as k,a as v}from"./index.73bf34f9.js";const p=v();let n=d(grid);O();_();j();function E(){closeDialogs(".stable");const e=o("templateInput");S(e.value),n=d(n),$("#heightmapSelection").dialog({title:"Select Heightmap",resizable:!1,position:{my:"center",at:"center",of:"svg"},buttons:{Cancel:function(){$(this).dialog("close")},Select:function(){const t=g();applyOption(e,t,u(t)),lock("template"),$(this).dialog("close")},"New Map":function(){const t=g();applyOption(e,t,u(t)),lock("template");const i=q();regeneratePrompt({seed:i,graph:n}),$(this).dialog("close")}}})}function O(){const e=document.createElement("style");e.textContent=` div.dialog > div.heightmap-selection { width: 70vw; height: 70vh; } .heightmap-selection_container { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); grid-gap: 6px; } @media (max-width: 600px) { .heightmap-selection_container { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); grid-gap: 4px; } } @media (min-width: 2000px) { .heightmap-selection_container { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); grid-gap: 8px; } } .heightmap-selection_options { display: grid; grid-template-columns: 2fr 1fr; } .heightmap-selection_options > div:first-child { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; justify-self: start; justify-items: start; } @media (max-width: 600px) { .heightmap-selection_options { grid-template-columns: 3fr 1fr; } .heightmap-selection_options > div:first-child { display: block; } } .heightmap-selection_options > div:last-child { justify-self: end; } .heightmap-selection article { padding: 4px; border-radius: 8px; transition: all 0.1s ease-in-out; filter: drop-shadow(1px 1px 4px #999); } .heightmap-selection article:hover { background-color: #ddd; filter: drop-shadow(1px 1px 8px #999); cursor: pointer; } .heightmap-selection article.selected { background-color: #ccc; outline: 1px solid var(--dark-solid); filter: drop-shadow(1px 1px 8px #999); } .heightmap-selection article > div { display: flex; justify-content: space-between; padding: 2px 1px; } .heightmap-selection article > img { width: 100%; aspect-ratio: ${graphWidth}/${graphHeight}; border-radius: 8px; object-fit: fill; } .heightmap-selection article .regeneratePreview { outline: 1px solid #bbb; padding: 1px 3px; border-radius: 4px; transition: all 0.1s ease-in-out; } .heightmap-selection article .regeneratePreview:hover { outline: 1px solid #666; } .heightmap-selection article .regeneratePreview:active { outline: 1px solid #333; color: #000; transform: rotate(45deg); } `,document.head.appendChild(e)}function _(){const e=`