Files
misode.github.io/assets/index.dc4f43f8.js
2022-03-16 01:40:56 +00:00

3 lines
133 KiB
JavaScript

var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,s=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,i=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&s(e,n,t[n]);if(o)for(var n of o(t))a.call(t,n)&&s(e,n,t[n]);return e},l=(e,o)=>t(e,n(o));import{y as c,a as d,r as u,l as h,g as m,b as p,s as f,c as v,d as g,e as w,f as _,j as y,h as b,i as x,k,m as C,q as M,A,F as I,n as z,o as j,p as E,C as $,t as O,I as S,u as L,v as P,w as D,x as V,_ as N,X as T,z as B,B as H,D as R,E as F,G,H as J,J as W,K as U,L as Y,M as q,N as Z,O as X,P as K,Z as Q,Q as ee,R as te,S as ne,T as oe,U as re,V as ae,W as se,Y as ie,$ as le,a0 as ce,a1 as de}from"./vendor.ae3ccf68.js";var ue;function he({type:e,id:t}){return c((()=>{var e;null==(e=document.getElementById("ad-placeholder"))||e.remove(),"ethicalads"in window&&ethicalads.load()}),[]),d("div",{"data-ea-publisher":"misode-github-io","data-ea-type":e,class:"ad dark flat",id:t})}function me({icon:e,label:t,active:n,class:o,tooltip:r,tooltipLoc:a,onClick:s}){return d("div",{class:`btn${n?" active":""}${o?` ${o}`:""}${r?` tooltipped tip-${null!=a?a:"sw"}`:""}`,onClick:s,"aria-label":r},e&&Re[e],t&&d("span",null,t))}!function(e){const t="Site",n="Generator";function o(e,t,n){ga("send","event",e,t,n)}function r(e,t){ga("set",`dimension${e}`,t)}e.pageview=function(e){ga("set","page",e),ga("send","pageview")},e.setLanguage=function(e){r(4,e),o(t,"set-language",e)},e.setTheme=function(e){r(1,e),o(t,"set-theme",e)},e.setVersion=function(e){r(3,e),o(n,"set-version",e)},e.setPreview=function(e){r(5,e),o(n,"set-preview",e)},e.setGenerator=function(e){r(6,e)},e.setPrefersColorScheme=function(e){r(7,e)},e.generatorEvent=function(e,t){o(n,e,t)}}(ue||(ue={}));var pe=JSON.parse('{"languages":[{"code":"de","name":"Deutsch"},{"code":"en","name":"English"},{"code":"es","name":"Español"},{"code":"fr","name":"Français"},{"code":"it","name":"Italiano"},{"code":"ja","name":"日本語"},{"code":"pl","name":"Polski"},{"code":"pt","name":"Português"},{"code":"ru","name":"Русский"},{"code":"sk","name":"Slovenčina","schemas":false},{"code":"zh-cn","name":"简体中文"},{"code":"zh-tw","name":"正體中文"}],"versions":[{"id":"1.15","ref":"1.15.2"},{"id":"1.16","ref":"1.16.5"},{"id":"1.17","ref":"1.17.1"},{"id":"1.18","ref":"1.18.1"},{"id":"1.18.2","dynamic":true}],"generators":[{"id":"loot_table","url":"loot-table","path":"loot_tables","schema":"loot_table"},{"id":"predicate","url":"predicate","path":"predicates","schema":"predicate"},{"id":"item_modifier","url":"item-modifier","path":"item_modifiers","schema":"item_modifier","minVersion":"1.17"},{"id":"advancement","url":"advancement","path":"advancements","schema":"advancement"},{"id":"recipe","url":"recipe","path":"recipes","schema":"recipe"},{"id":"dimension","url":"dimension","schema":"dimension","category":"worldgen","minVersion":"1.16"},{"id":"dimension_type","url":"dimension-type","schema":"dimension_type","category":"worldgen","minVersion":"1.16"},{"id":"world","url":"world","schema":"world_settings","category":"worldgen","minVersion":"1.16"},{"id":"worldgen/biome","url":"worldgen/biome","category":"worldgen","schema":"biome","minVersion":"1.16"},{"id":"worldgen/configured_carver","url":"worldgen/carver","category":"worldgen","schema":"configured_carver","minVersion":"1.16"},{"id":"worldgen/configured_feature","url":"worldgen/feature","category":"worldgen","schema":"configured_feature","minVersion":"1.16"},{"id":"worldgen/density_function","url":"worldgen/density-function","category":"worldgen","schema":"density_function","minVersion":"1.18.2"},{"id":"worldgen/placed_feature","url":"worldgen/placed-feature","category":"worldgen","schema":"placed_feature","minVersion":"1.18"},{"id":"worldgen/noise","url":"worldgen/noise","category":"worldgen","schema":"noise_parameters","minVersion":"1.18"},{"id":"worldgen/noise_settings","url":"worldgen/noise-settings","category":"worldgen","schema":"noise_settings","minVersion":"1.16"},{"id":"worldgen/configured_structure_feature","url":"worldgen/structure-feature","category":"worldgen","schema":"configured_structure_feature","minVersion":"1.16"},{"id":"worldgen/structure_set","url":"worldgen/structure-set","category":"worldgen","schema":"structure_set","minVersion":"1.18.2"},{"id":"worldgen/configured_surface_builder","url":"worldgen/surface-builder","category":"worldgen","schema":"configured_surface_builder","minVersion":"1.16","maxVersion":"1.17"},{"id":"worldgen/processor_list","url":"worldgen/processor-list","category":"worldgen","schema":"processor_list","minVersion":"1.16"},{"id":"worldgen/template_pool","url":"worldgen/template-pool","category":"worldgen","schema":"template_pool","minVersion":"1.16"},{"id":"block_definition","url":"assets/blockstate","path":"blockstates","category":"assets","schema":"block_definition"},{"id":"model","url":"assets/model","path":"models","category":"assets","schema":"model"}]}');function fe(e){return"object"==typeof e&&null!==e}const ve=e=>("0"+e.toString(16)).substr(-2);function ge(e=12){var t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t,ve).join("")}function we(){return BigInt(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))}function _e(e){const t=Math.floor(4294967296*Math.random())-2147483648,n=e.get(new h.Path(["dimensions"]));e.set(new h.Path(["seed"]),t,!0),"object"==typeof n&&null!==n&&Object.keys(n).forEach((n=>{e.set(new h.Path(["dimensions",n,"generator","seed"]),t,!0),e.set(new h.Path(["dimensions",n,"generator","biome_source","seed"]),t,!0)})),e.set(new h.Path(["generator","seed"]),t,!0),e.set(new h.Path(["generator","biome_source","seed"]),t)}function ye(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(31,t)+e.charCodeAt(n)|0;return t}function be(e){return`/${e}/`.replaceAll("//","/")}function xe(e){const t=e.indexOf("?");return t>=0&&(e=e.slice(0,t)),be(e)}function ke(e){const t=xe(e).replace(/^\//,"").replace(/\/$/,"");return pe.generators.find((e=>e.url===t))}function Ce(e){const t=e.indexOf("?");return t>=0?(e=e.slice(t+1),new Map(e.split("&").map((e=>{const t=e.indexOf("=");return-1===t?[e,"true"]:[decodeURIComponent(e.slice(0,t)),decodeURIComponent(e.slice(t+1))]})))):new Map}function Me(e,t){const n=m(),o=Ce(n);Object.entries(e).forEach((([e,t])=>{void 0===t?o.delete(e):o.set(e,t)}));const r=Array.from(o).map((([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`));p(`${t?be(t):xe(n)}${0===r.length?"":`?${r.join("&")}`}`,!0)}function Ae(e){const t=Math.abs(ye(e));return[t%256,(t>>8)%256,(t>>16)%256]}function Ie(e){return e*e}function ze(e,t,n){return Math.max(e,Math.min(t,n))}function je(e,t,n){return n<0?e:n>1?t:Ee(n,e,t)}function Ee(e,t,n){return t+e*(n-t)}function $e(e){return e instanceof Error?e.message:`${e}`}const Oe=u();function Se(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let n,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=0;o<n;o++)if(!Se(e[o],t[o]))return!1;return!0}if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const r=Object.keys(e);if(n=r.length,n!==Object.keys(t).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(t,r[o]))return!1;for(o=n;0!=o--;){const n=r[o];if(!Se(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}class Le{constructor(){this.forward=new Map,this.backward=new Map}set(e,t){this.forward.set(e,t),this.backward.set(t,e)}getA(e){return this.backward.get(e)}getB(e){return this.forward.get(e)}getOrPut(e,t){const n=this.forward.get(e);return void 0===n?(this.set(e,t),t):n}}function Pe({icon:e,label:t,large:n,larger:o,doSelect:r,value:a,placeholder:s,dataList:i,onChange:l}){const u=void 0===l?()=>{}:e=>{const t=e.target.value;null==l||l(t)},h=f(null);c((()=>{r&&h.current&&h.current.select()}),[r]);const m=i&&ge();return d("div",{class:`btn btn-input ${n?"large-input":""} ${o?"larger-input":""}`,onClick:e=>e.stopPropagation()},e&&Re[e],t&&d("span",null,t),d("input",{ref:h,type:"text",value:a,onChange:u,placeholder:s,list:m}),i&&d("datalist",{id:m},i.map((e=>d("option",{value:e})))))}function De({cooldown:e,invert:t,initial:n}={}){const[o,r]=v(n),a=f(void 0);return[o,()=>{r(!t),void 0!==a.current&&clearTimeout(a.current),a.current=setTimeout((()=>{r(!!t)}),null!=e?e:2e3)}]}function Ve({size:e,draw:t,onDrag:n,onHover:o,onLeave:r},a){const s=f(null),i=f(),l=f(),d=f([0,0]),u=f(!1);c((()=>{const e=e=>{i.current=[e.offsetX,e.offsetY]},t=e=>{if(void 0===i.current){const t=e.offsetX/s.current.clientWidth,n=e.offsetY/s.current.clientHeight;return void(null==o||o(t,n))}if(!n)return;const t=e.offsetX-i.current[0],r=e.offsetY-i.current[1];0===t&&0===r||(d.current=[d.current[0]+t,d.current[1]+r],u.current||(cancelAnimationFrame(l.current),l.current=requestAnimationFrame((async()=>{u.current=!0;const e=d.current[0]/s.current.clientWidth,t=d.current[1]/s.current.clientHeight;d.current=[0,0],await(null==n?void 0:n(e,t)),u.current=!1})))),i.current=[e.offsetX,e.offsetY]},a=()=>{i.current=void 0},c=()=>{null==r||r()};return s.current.addEventListener("mousedown",e),s.current.addEventListener("mousemove",t),s.current.addEventListener("mouseleave",c),document.body.addEventListener("mouseup",a),()=>{var n,o,r;null==(n=s.current)||n.removeEventListener("mousedown",e),null==(o=s.current)||o.removeEventListener("mousemove",t),null==(r=s.current)||r.removeEventListener("mouseleave",c),document.body.removeEventListener("mouseup",a)}}),[...null!=a?a:[],s.current]);const h=f(),m=f(0);return h.current=async()=>{const n=s.current.getContext("2d"),o=e();s.current.width=o[0],s.current.height=o[1];const r=n.getImageData(0,0,o[0],o[1]),a=m.current+=1;try{await t(r)}catch(i){throw i}a===m.current&&n.putImageData(r,0,0)},{canvas:s,redraw:h.current}}function Ne(){const[e,t]=v(!1),n=()=>{t(!1)};return c((()=>(e&&(document.body.addEventListener("click",n),document.body.addEventListener("contextmenu",n)),()=>{document.body.removeEventListener("click",n),document.body.removeEventListener("contextmenu",n)})),[e]),[e,()=>t(!0)]}function Te(e){const[t,n]=v(matchMedia(e).matches),o=e=>{n(e.matches)};return c((()=>{const t=matchMedia(e);return t.addEventListener("change",o),()=>{t.removeEventListener("change",o)}}),[e]),t}function Be(e,t){const n={invalidated(){e&&t(e)}};c((()=>(null==e||e.addListener(n),()=>{null==e||e.removeListener(n)})),[e])}function He(e){const{icon:t,label:n,relative:o,tooltip:r,tooltipLoc:a,children:s}=e,[c,u]=Ne();return d("div",i({class:"btn-menu"+(!1===o?" no-relative":"")},e),d(me,l(i({},{icon:t,label:n,tooltip:r,tooltipLoc:a}),{onClick:u})),c&&d("div",{class:"btn-group"},s))}const Re={alert:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8.22 1.754a.25.25 0 00-.44 0L1.698 13.132a.25.25 0 00.22.368h12.164a.25.25 0 00.22-.368L8.22 1.754zm-1.763-.707c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0114.082 15H1.918a1.75 1.75 0 01-1.543-2.575L6.457 1.047zM9 11a1 1 0 11-2 0 1 1 0 012 0zm-.25-5.25a.75.75 0 00-1.5 0v2.5a.75.75 0 001.5 0v-2.5z"})),archive:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.75 2.5a.25.25 0 00-.25.25v1.5c0 .138.112.25.25.25h12.5a.25.25 0 00.25-.25v-1.5a.25.25 0 00-.25-.25H1.75zM0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v1.5A1.75 1.75 0 0114.25 6H1.75A1.75 1.75 0 010 4.25v-1.5zM1.75 7a.75.75 0 01.75.75v5.5c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25v-5.5a.75.75 0 111.5 0v5.5A1.75 1.75 0 0113.25 15H2.75A1.75 1.75 0 011 13.25v-5.5A.75.75 0 011.75 7zm4.5 1a.75.75 0 000 1.5h3.5a.75.75 0 100-1.5h-3.5z"})),arrow_left:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M7.78 12.53a.75.75 0 01-1.06 0L2.47 8.28a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 1.06L4.81 7h7.44a.75.75 0 010 1.5H4.81l2.97 2.97a.75.75 0 010 1.06z"})),arrow_right:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8.22 2.97a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06l2.97-2.97H3.75a.75.75 0 010-1.5h7.44L8.22 4.03a.75.75 0 010-1.06z"})),check:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"})),chevron_down:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M12.78 6.22a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06 0L3.22 7.28a.75.75 0 011.06-1.06L8 9.94l3.72-3.72a.75.75 0 011.06 0z"})),chevron_right:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M6.22 3.22a.75.75 0 011.06 0l4.25 4.25a.75.75 0 010 1.06l-4.25 4.25a.75.75 0 01-1.06-1.06L9.94 8 6.22 4.28a.75.75 0 010-1.06z"})),chevron_up:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M3.22 9.78a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 0l4.25 4.25a.75.75 0 01-1.06 1.06L8 6.06 4.28 9.78a.75.75 0 01-1.06 0z"})),clippy:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M5.75 1a.75.75 0 00-.75.75v3c0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75v-3a.75.75 0 00-.75-.75h-4.5zm.75 3V2.5h3V4h-3zm-2.874-.467a.75.75 0 00-.752-1.298A1.75 1.75 0 002 3.75v9.5c0 .966.784 1.75 1.75 1.75h8.5A1.75 1.75 0 0014 13.25v-9.5a1.75 1.75 0 00-.874-1.515.75.75 0 10-.752 1.298.25.25 0 01.126.217v9.5a.25.25 0 01-.25.25h-8.5a.25.25 0 01-.25-.25v-9.5a.25.25 0 01.126-.217z"})),code:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M4.72 3.22a.75.75 0 011.06 1.06L2.06 8l3.72 3.72a.75.75 0 11-1.06 1.06L.47 8.53a.75.75 0 010-1.06l4.25-4.25zm6.56 0a.75.75 0 10-1.06 1.06L13.94 8l-3.72 3.72a.75.75 0 101.06 1.06l4.25-4.25a.75.75 0 000-1.06l-4.25-4.25z"})),dash:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M2 8a.75.75 0 01.75-.75h10.5a.75.75 0 010 1.5H2.75A.75.75 0 012 8z"})),device_desktop:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.75 2.5h12.5a.25.25 0 01.25.25v7.5a.25.25 0 01-.25.25H1.75a.25.25 0 01-.25-.25v-7.5a.25.25 0 01.25-.25zM14.25 1H1.75A1.75 1.75 0 000 2.75v7.5C0 11.216.784 12 1.75 12h3.727c-.1 1.041-.52 1.872-1.292 2.757A.75.75 0 004.75 16h6.5a.75.75 0 00.565-1.243c-.772-.885-1.193-1.716-1.292-2.757h3.727A1.75 1.75 0 0016 10.25v-7.5A1.75 1.75 0 0014.25 1zM9.018 12H6.982a5.72 5.72 0 01-.765 2.5h3.566a5.72 5.72 0 01-.765-2.5z"})),dot_fill:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8z"})),download:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M7.47 10.78a.75.75 0 001.06 0l3.75-3.75a.75.75 0 00-1.06-1.06L8.75 8.44V1.75a.75.75 0 00-1.5 0v6.69L4.78 5.97a.75.75 0 00-1.06 1.06l3.75 3.75zM3.75 13a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5z"})),duplicate:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{d:"M10.5 3a.75.75 0 01.75.75v1h1a.75.75 0 010 1.5h-1v1a.75.75 0 01-1.5 0v-1h-1a.75.75 0 010-1.5h1v-1A.75.75 0 0110.5 3z"}),d("path",{"fill-rule":"evenodd",d:"M6.75 0A1.75 1.75 0 005 1.75v7.5c0 .966.784 1.75 1.75 1.75h7.5A1.75 1.75 0 0016 9.25v-7.5A1.75 1.75 0 0014.25 0h-7.5zM6.5 1.75a.25.25 0 01.25-.25h7.5a.25.25 0 01.25.25v7.5a.25.25 0 01-.25.25h-7.5a.25.25 0 01-.25-.25v-7.5z"}),d("path",{d:"M1.75 5A1.75 1.75 0 000 6.75v7.5C0 15.216.784 16 1.75 16h7.5A1.75 1.75 0 0011 14.25v-1.5a.75.75 0 00-1.5 0v1.5a.25.25 0 01-.25.25h-7.5a.25.25 0 01-.25-.25v-7.5a.25.25 0 01.25-.25h1.5a.75.75 0 000-1.5h-1.5z"})),eye:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.679 7.932c.412-.621 1.242-1.75 2.366-2.717C5.175 4.242 6.527 3.5 8 3.5c1.473 0 2.824.742 3.955 1.715 1.124.967 1.954 2.096 2.366 2.717a.119.119 0 010 .136c-.412.621-1.242 1.75-2.366 2.717C10.825 11.758 9.473 12.5 8 12.5c-1.473 0-2.824-.742-3.955-1.715C2.92 9.818 2.09 8.69 1.679 8.068a.119.119 0 010-.136zM8 2c-1.981 0-3.67.992-4.933 2.078C1.797 5.169.88 6.423.43 7.1a1.619 1.619 0 000 1.798c.45.678 1.367 1.932 2.637 3.024C4.329 13.008 6.019 14 8 14c1.981 0 3.67-.992 4.933-2.078 1.27-1.091 2.187-2.345 2.637-3.023a1.619 1.619 0 000-1.798c-.45-.678-1.367-1.932-2.637-3.023C11.671 2.992 9.981 2 8 2zm0 8a2 2 0 100-4 2 2 0 000 4z"})),eye_closed:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M.143 2.31a.75.75 0 011.047-.167l14.5 10.5a.75.75 0 11-.88 1.214l-2.248-1.628C11.346 13.19 9.792 14 8 14c-1.981 0-3.67-.992-4.933-2.078C1.797 10.832.88 9.577.43 8.9a1.618 1.618 0 010-1.797c.353-.533.995-1.42 1.868-2.305L.31 3.357A.75.75 0 01.143 2.31zm3.386 3.378a14.21 14.21 0 00-1.85 2.244.12.12 0 00-.022.068c0 .021.006.045.022.068.412.621 1.242 1.75 2.366 2.717C5.175 11.758 6.527 12.5 8 12.5c1.195 0 2.31-.488 3.29-1.191L9.063 9.695A2 2 0 016.058 7.52l-2.53-1.832zM8 3.5c-.516 0-1.017.09-1.499.251a.75.75 0 11-.473-1.423A6.23 6.23 0 018 2c1.981 0 3.67.992 4.933 2.078 1.27 1.091 2.187 2.345 2.637 3.023a1.619 1.619 0 010 1.798c-.11.166-.248.365-.41.587a.75.75 0 11-1.21-.887c.148-.201.272-.382.371-.53a.119.119 0 000-.137c-.412-.621-1.242-1.75-2.366-2.717C10.825 4.242 9.473 3.5 8 3.5z"})),file:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z"})),file_directory:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.75 1A1.75 1.75 0 000 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25v-8.5A1.75 1.75 0 0014.25 3h-6.5a.25.25 0 01-.2-.1l-.9-1.2c-.33-.44-.85-.7-1.4-.7h-3.5z"})),gear:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M7.429 1.525a6.593 6.593 0 011.142 0c.036.003.108.036.137.146l.289 1.105c.147.56.55.967.997 1.189.174.086.341.183.501.29.417.278.97.423 1.53.27l1.102-.303c.11-.03.175.016.195.046.219.31.41.641.573.989.014.031.022.11-.059.19l-.815.806c-.411.406-.562.957-.53 1.456a4.588 4.588 0 010 .582c-.032.499.119 1.05.53 1.456l.815.806c.08.08.073.159.059.19a6.494 6.494 0 01-.573.99c-.02.029-.086.074-.195.045l-1.103-.303c-.559-.153-1.112-.008-1.529.27-.16.107-.327.204-.5.29-.449.222-.851.628-.998 1.189l-.289 1.105c-.029.11-.101.143-.137.146a6.613 6.613 0 01-1.142 0c-.036-.003-.108-.037-.137-.146l-.289-1.105c-.147-.56-.55-.967-.997-1.189a4.502 4.502 0 01-.501-.29c-.417-.278-.97-.423-1.53-.27l-1.102.303c-.11.03-.175-.016-.195-.046a6.492 6.492 0 01-.573-.989c-.014-.031-.022-.11.059-.19l.815-.806c.411-.406.562-.957.53-1.456a4.587 4.587 0 010-.582c.032-.499-.119-1.05-.53-1.456l-.815-.806c-.08-.08-.073-.159-.059-.19a6.44 6.44 0 01.573-.99c.02-.029.086-.075.195-.045l1.103.303c.559.153 1.112.008 1.529-.27.16-.107.327-.204.5-.29.449-.222.851-.628.998-1.189l.289-1.105c.029-.11.101-.143.137-.146zM8 0c-.236 0-.47.01-.701.03-.743.065-1.29.615-1.458 1.261l-.29 1.106c-.017.066-.078.158-.211.224a5.994 5.994 0 00-.668.386c-.123.082-.233.09-.3.071L3.27 2.776c-.644-.177-1.392.02-1.82.63a7.977 7.977 0 00-.704 1.217c-.315.675-.111 1.422.363 1.891l.815.806c.05.048.098.147.088.294a6.084 6.084 0 000 .772c.01.147-.038.246-.088.294l-.815.806c-.474.469-.678 1.216-.363 1.891.2.428.436.835.704 1.218.428.609 1.176.806 1.82.63l1.103-.303c.066-.019.176-.011.299.071.213.143.436.272.668.386.133.066.194.158.212.224l.289 1.106c.169.646.715 1.196 1.458 1.26a8.094 8.094 0 001.402 0c.743-.064 1.29-.614 1.458-1.26l.29-1.106c.017-.066.078-.158.211-.224a5.98 5.98 0 00.668-.386c.123-.082.233-.09.3-.071l1.102.302c.644.177 1.392-.02 1.82-.63.268-.382.505-.789.704-1.217.315-.675.111-1.422-.364-1.891l-.814-.806c-.05-.048-.098-.147-.088-.294a6.1 6.1 0 000-.772c-.01-.147.039-.246.088-.294l.814-.806c.475-.469.679-1.216.364-1.891a7.992 7.992 0 00-.704-1.218c-.428-.609-1.176-.806-1.82-.63l-1.103.303c-.066.019-.176.011-.299-.071a5.991 5.991 0 00-.668-.386c-.133-.066-.194-.158-.212-.224L10.16 1.29C9.99.645 9.444.095 8.701.031A8.094 8.094 0 008 0zm1.5 8a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM11 8a3 3 0 11-6 0 3 3 0 016 0z"})),globe:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.543 7.25h2.733c.144-2.074.866-3.756 1.58-4.948.12-.197.237-.381.353-.552a6.506 6.506 0 00-4.666 5.5zm2.733 1.5H1.543a6.506 6.506 0 004.666 5.5 11.13 11.13 0 01-.352-.552c-.715-1.192-1.437-2.874-1.581-4.948zm1.504 0h4.44a9.637 9.637 0 01-1.363 4.177c-.306.51-.612.919-.857 1.215a9.978 9.978 0 01-.857-1.215A9.637 9.637 0 015.78 8.75zm4.44-1.5H5.78a9.637 9.637 0 011.363-4.177c.306-.51.612-.919.857-1.215.245.296.55.705.857 1.215A9.638 9.638 0 0110.22 7.25zm1.504 1.5c-.144 2.074-.866 3.756-1.58 4.948-.12.197-.237.381-.353.552a6.506 6.506 0 004.666-5.5h-2.733zm2.733-1.5h-2.733c-.144-2.074-.866-3.756-1.58-4.948a11.738 11.738 0 00-.353-.552 6.506 6.506 0 014.666 5.5zM8 0a8 8 0 100 16A8 8 0 008 0z"})),history:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z"})),info:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm6.5-.25A.75.75 0 017.25 7h1a.75.75 0 01.75.75v2.75h.25a.75.75 0 010 1.5h-2a.75.75 0 010-1.5h.25v-2h-.25a.75.75 0 01-.75-.75zM8 6a1 1 0 100-2 1 1 0 000 2z"})),issue_opened:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm9 3a1 1 0 11-2 0 1 1 0 012 0zm-.25-6.25a.75.75 0 00-1.5 0v3.5a.75.75 0 001.5 0v-3.5z"})),kebab_horizontal:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{d:"M8 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM1.5 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm13 0a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"})),link:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"})),link_external:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M10.604 1h4.146a.25.25 0 01.25.25v4.146a.25.25 0 01-.427.177L13.03 4.03 9.28 7.78a.75.75 0 01-1.06-1.06l3.75-3.75-1.543-1.543A.25.25 0 0110.604 1zM3.75 2A1.75 1.75 0 002 3.75v8.5c0 .966.784 1.75 1.75 1.75h8.5A1.75 1.75 0 0014 12.25v-3.5a.75.75 0 00-1.5 0v3.5a.25.25 0 01-.25.25h-8.5a.25.25 0 01-.25-.25v-8.5a.25.25 0 01.25-.25h3.5a.75.75 0 000-1.5h-3.5z"})),mark_github:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"})),moon:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M9.598 1.591a.75.75 0 01.785-.175 7 7 0 11-8.967 8.967.75.75 0 01.961-.96 5.5 5.5 0 007.046-7.046.75.75 0 01.175-.786zm1.616 1.945a7 7 0 01-7.678 7.678 5.5 5.5 0 107.678-7.678z"})),play:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zM6.379 5.227A.25.25 0 006 5.442v5.117a.25.25 0 00.379.214l4.264-2.559a.25.25 0 000-.428L6.379 5.227z"})),plus:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 2a.75.75 0 01.75.75v4.5h4.5a.75.75 0 010 1.5h-4.5v4.5a.75.75 0 01-1.5 0v-4.5h-4.5a.75.75 0 010-1.5h4.5v-4.5A.75.75 0 018 2z"})),plus_circle:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zm.75 4.75a.75.75 0 00-1.5 0v2.5h-2.5a.75.75 0 000 1.5h2.5v2.5a.75.75 0 001.5 0v-2.5h2.5a.75.75 0 000-1.5h-2.5v-2.5z"})),repo:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"})),search:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M11.5 7a4.499 4.499 0 11-8.998 0A4.499 4.499 0 0111.5 7zm-.82 4.74a6 6 0 111.06-1.06l3.04 3.04a.75.75 0 11-1.06 1.06l-3.04-3.04z"})),sort_asc:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M0 4.25a.75.75 0 01.75-.75h2.5a.75.75 0 010 1.5H.75A.75.75 0 010 4.25zm0 4a.75.75 0 01.75-.75h4.5a.75.75 0 010 1.5H.75A.75.75 0 010 8.25zm0 4a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5H.75a.75.75 0 01-.75-.75zm12.927-9.677a.25.25 0 00-.354 0l-3 3A.25.25 0 009.75 6H12v6.75a.75.75 0 001.5 0V6h2.25a.25.25 0 00.177-.427l-3-3z"})),sort_desc:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M0 4.25a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5H.75A.75.75 0 010 4.25zm0 4a.75.75 0 01.75-.75h4.5a.75.75 0 010 1.5H.75A.75.75 0 010 8.25zm0 4a.75.75 0 01.75-.75h2.5a.75.75 0 010 1.5H.75a.75.75 0 01-.75-.75z"}),d("path",{d:"M13.5 10h2.25a.25.25 0 01.177.427l-3 3a.25.25 0 01-.354 0l-3-3A.25.25 0 019.75 10H12V3.75a.75.75 0 011.5 0V10z"})),square:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M4 5.75C4 4.784 4.784 4 5.75 4h4.5c.966 0 1.75.784 1.75 1.75v4.5A1.75 1.75 0 0110.25 12h-4.5A1.75 1.75 0 014 10.25v-4.5zm1.75-.25a.25.25 0 00-.25.25v4.5c0 .138.112.25.25.25h4.5a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-4.5z"})),square_fill:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M5.75 4A1.75 1.75 0 004 5.75v4.5c0 .966.784 1.75 1.75 1.75h4.5A1.75 1.75 0 0012 10.25v-4.5A1.75 1.75 0 0010.25 4h-4.5z"})),stack:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M7.122.392a1.75 1.75 0 011.756 0l5.003 2.902c.83.481.83 1.68 0 2.162L8.878 8.358a1.75 1.75 0 01-1.756 0L2.119 5.456a1.25 1.25 0 010-2.162L7.122.392zM8.125 1.69a.25.25 0 00-.25 0l-4.63 2.685 4.63 2.685a.25.25 0 00.25 0l4.63-2.685-4.63-2.685zM1.601 7.789a.75.75 0 011.025-.273l5.249 3.044a.25.25 0 00.25 0l5.249-3.044a.75.75 0 01.752 1.298l-5.248 3.044a1.75 1.75 0 01-1.756 0L1.874 8.814A.75.75 0 011.6 7.789zm0 3.5a.75.75 0 011.025-.273l5.249 3.044a.25.25 0 00.25 0l5.249-3.044a.75.75 0 01.752 1.298l-5.248 3.044a1.75 1.75 0 01-1.756 0l-5.248-3.044a.75.75 0 01-.273-1.025z"})),sun:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 10.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zM8 12a4 4 0 100-8 4 4 0 000 8zM8 0a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0V.75A.75.75 0 018 0zm0 13a.75.75 0 01.75.75v1.5a.75.75 0 01-1.5 0v-1.5A.75.75 0 018 13zM2.343 2.343a.75.75 0 011.061 0l1.06 1.061a.75.75 0 01-1.06 1.06l-1.06-1.06a.75.75 0 010-1.06zm9.193 9.193a.75.75 0 011.06 0l1.061 1.06a.75.75 0 01-1.06 1.061l-1.061-1.06a.75.75 0 010-1.061zM16 8a.75.75 0 01-.75.75h-1.5a.75.75 0 010-1.5h1.5A.75.75 0 0116 8zM3 8a.75.75 0 01-.75.75H.75a.75.75 0 010-1.5h1.5A.75.75 0 013 8zm10.657-5.657a.75.75 0 010 1.061l-1.061 1.06a.75.75 0 11-1.06-1.06l1.06-1.06a.75.75 0 011.06 0zm-9.193 9.193a.75.75 0 010 1.06l-1.06 1.061a.75.75 0 11-1.061-1.06l1.06-1.061a.75.75 0 011.061 0z"})),sync:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8 2.5a5.487 5.487 0 00-4.131 1.869l1.204 1.204A.25.25 0 014.896 6H1.25A.25.25 0 011 5.75V2.104a.25.25 0 01.427-.177l1.38 1.38A7.001 7.001 0 0114.95 7.16a.75.75 0 11-1.49.178A5.501 5.501 0 008 2.5zM1.705 8.005a.75.75 0 01.834.656 5.501 5.501 0 009.592 2.97l-1.204-1.204a.25.25 0 01.177-.427h3.646a.25.25 0 01.25.25v3.646a.25.25 0 01-.427.177l-1.38-1.38A7.001 7.001 0 011.05 8.84a.75.75 0 01.656-.834z"})),tag:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M2.5 7.775V2.75a.25.25 0 01.25-.25h5.025a.25.25 0 01.177.073l6.25 6.25a.25.25 0 010 .354l-5.025 5.025a.25.25 0 01-.354 0l-6.25-6.25a.25.25 0 01-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 010 2.474l-5.026 5.026a1.75 1.75 0 01-2.474 0l-6.25-6.25A1.75 1.75 0 011 7.775zM6 5a1 1 0 100 2 1 1 0 000-2z"})),terminal:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0114.25 15H1.75A1.75 1.75 0 010 13.25V2.75zm1.75-.25a.25.25 0 00-.25.25v10.5c0 .138.112.25.25.25h12.5a.25.25 0 00.25-.25V2.75a.25.25 0 00-.25-.25H1.75zM7.25 8a.75.75 0 01-.22.53l-2.25 2.25a.75.75 0 11-1.06-1.06L5.44 8 3.72 6.28a.75.75 0 111.06-1.06l2.25 2.25c.141.14.22.331.22.53zm1.5 1.5a.75.75 0 000 1.5h3a.75.75 0 000-1.5h-3z"})),three_bars:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M1 2.75A.75.75 0 011.75 2h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 2.75zm0 5A.75.75 0 011.75 7h12.5a.75.75 0 110 1.5H1.75A.75.75 0 011 7.75zM1.75 12a.75.75 0 100 1.5h12.5a.75.75 0 100-1.5H1.75z"})),trashcan:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M6.5 1.75a.25.25 0 01.25-.25h2.5a.25.25 0 01.25.25V3h-3V1.75zm4.5 0V3h2.25a.75.75 0 010 1.5H2.75a.75.75 0 010-1.5H5V1.75C5 .784 5.784 0 6.75 0h2.5C10.216 0 11 .784 11 1.75zM4.496 6.675a.75.75 0 10-1.492.15l.66 6.6A1.75 1.75 0 005.405 15h5.19c.9 0 1.652-.681 1.741-1.576l.66-6.6a.75.75 0 00-1.492-.149l-.66 6.6a.25.25 0 01-.249.225h-5.19a.25.25 0 01-.249-.225l-.66-6.6z"})),unfold:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{d:"M8.177.677l2.896 2.896a.25.25 0 01-.177.427H8.75v1.25a.75.75 0 01-1.5 0V4H5.104a.25.25 0 01-.177-.427L7.823.677a.25.25 0 01.354 0zM7.25 10.75a.75.75 0 011.5 0V12h2.146a.25.25 0 01.177.427l-2.896 2.896a.25.25 0 01-.354 0l-2.896-2.896A.25.25 0 015.104 12H7.25v-1.25zm-5-2a.75.75 0 000-1.5h-.5a.75.75 0 000 1.5h.5zM6 8a.75.75 0 01-.75.75h-.5a.75.75 0 010-1.5h.5A.75.75 0 016 8zm2.25.75a.75.75 0 000-1.5h-.5a.75.75 0 000 1.5h.5zM12 8a.75.75 0 01-.75.75h-.5a.75.75 0 010-1.5h.5A.75.75 0 0112 8zm2.25.75a.75.75 0 000-1.5h-.5a.75.75 0 000 1.5h.5z"})),upload:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M8.53 1.22a.75.75 0 00-1.06 0L3.72 4.97a.75.75 0 001.06 1.06l2.47-2.47v6.69a.75.75 0 001.5 0V3.56l2.47 2.47a.75.75 0 101.06-1.06L8.53 1.22zM3.75 13a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5z"})),x:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"})),x_circle:d("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",width:"16",height:"16"},d("path",{"fill-rule":"evenodd",d:"M3.404 12.596a6.5 6.5 0 119.192-9.192 6.5 6.5 0 01-9.192 9.192zM2.344 2.343a8 8 0 1011.313 11.314A8 8 0 002.343 2.343zM6.03 4.97a.75.75 0 00-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 101.06 1.06L8 9.06l1.97 1.97a.75.75 0 101.06-1.06L9.06 8l1.97-1.97a.75.75 0 10-1.06-1.06L8 6.94 6.03 4.97z"}))};function Fe({error:e,onDismiss:t}){const[n,o]=v(!1),[r,a]=v(void 0);c((()=>{if(e instanceof Error){const t=e.stack.split("\n").map((e=>e.replace(/^(\s+)at (?:async )?(https?:.*)/,"$1at ($2)")));a(t.join("\n")),g.exports.mapStackTrace(t.join("\n"),(e=>{const t=e.map((e=>e.replace(/..\/..\/src\//,"src/"))).join("\n");a(t)}))}}),[e]);const s=w((()=>{let t="https://github.com/misode/misode.github.io/issues/new";return e instanceof Error?(t+=`?title=${encodeURIComponent(`${e.name}: ${e.message}`)}`,r&&(t+=`&body=${encodeURIComponent(`\`\`\`\n${e.name}: ${e.message}\n${r}\n\`\`\`\n`)}`)):t+=`?title=${encodeURIComponent(e.toString())}`,t}),[e,r]);return d("div",{class:"error"},t&&d("div",{class:"error-dismiss",onClick:t},Re.x),d("h3",null,e instanceof Error?e.message:e,r&&d("span",{onClick:()=>o(!n)},Re.info)),r&&n&&d("pre",null,r),d("p",null,"If you think this is a bug, you can report it ",d("a",{href:s,target:"_blank"},"on GitHub")))}function Ge({label:e,value:t,onChange:n}){const o=ge();return d("label",{class:"checkbox"},d("input",{id:o,type:"checkbox",checked:t,onClick:()=>n(!t)}),e)}function Je(e,t,n){const o=e=>{const o=e.onChange&&(t=>{var o;const r=t.target.value;null==(o=e.onChange)||o.call(e,n(r))}),r=e.onEnter&&(t=>{var o;if("Enter"===t.key){const r=t.target.value;null==(o=e.onEnter)||o.call(e,n(r))}});return d("input",i(i({},e),{type:t,onChange:o,onKeyDown:r}))};return o.displayName=e,o}const We=Je("TextInput","text",(e=>e)),Ue=Je("NumberInput","number",(e=>Number(e))),Ye=Je("RangeInput","range",(e=>Number(e)));function qe({values:e,onSelect:t,searchPlaceholder:n,noResults:o}){const[r,a]=v(""),s=w((()=>{var t;const n=r.trim().split(" ");return null!=(t=null==e?void 0:e.filter((e=>n.every((t=>e.includes(t))))))?t:[]}),[e,r]);return d(_,null,d(Pe,{icon:"search",large:!0,value:r,onChange:a,doSelect:1,placeholder:null!=n?n:"Search"}),d("div",{class:"result-list"},s.map((e=>d(me,{key:e,label:e,onClick:()=>null==t?void 0:t(e)}))),0===s.length&&d(me,{label:null!=o?o:"No results"})))}const Ze="https://raw.githubusercontent.com/misode/technical-changes/main";let Xe=null;async function Ke(){if(!Xe){const e=await(await fetch(`${Ze}/index.json`)).json();Xe=(await Promise.all(e.map(((e,t)=>async function(e,t){const n=await(await fetch(`${Ze}/${e.id}/index.json`)).json();return(await Promise.all(n.map(((n,o)=>async function(e,t,n,o){return function(e){return e.split("\n\n").map((e=>{const t=e.indexOf("|");return{tags:e.substring(0,t).trim().split(" "),content:e.slice(t+1).trim().replaceAll("->","→").replaceAll("\n...\n","\n\n")}}))}(await(await fetch(`${Ze}/${e.id}/${t.id}.md`)).text()).map((r=>i({version:t,group:e,order:1e3*n+o},r)))}(e,Qe(n),t,o))))).flat()}(Qe(e),t))))).flat().map((e=>l(i({},e),{tags:[e.group.id,...e.tags]})))}return Xe}function Qe(e){return"string"==typeof e?{id:e,article:e.match(/\d\dw\d\d[a-z]/)?"minecraft-snapshot-"+e:e.match(/\d+\.\d+(\.\d+)?-pre[0-9]+/)?"minecraft-"+e.replaceAll(".","-").replaceAll("pre","pre-release-"):null}:fe(e)?e:{id:"unknown",article:null}}["1.15","1.16","1.17"].forEach((e=>localStorage.removeItem(`cache_${e}`))),["mcdata_master","vanilla_datapack_summary"].forEach((e=>localStorage.removeItem(`cached_${e}`))),caches.delete("misode-v1");const et="https://raw.githubusercontent.com/misode/mcmeta";function tt(e,t){return`${et}/${e.dynamic?t:`${e.ref}-${t}`}`}async function nt(e){e.dynamic&&("1.18.2"!==localStorage.getItem("cached_latest_version")&&(await async function(e){try{const t=await caches.open("misode-v2");console.debug("[deleteMatching] Opened cache misode-v2");const n=[];for(const o of await t.keys())e(o.url)&&n.push(t.delete(o));console.debug(`[deleteMatching] Removing ${n.length} cache objects...`),await Promise.all(n)}catch(t){console.warn(`[deleteMatching] Failed to open cache misode-v2: ${$e(t)}`)}}((e=>e.startsWith(`${et}/summary/`)||e.startsWith(`${et}/data/`))),localStorage.setItem("cached_latest_version","1.18.2")),e.ref="1.18.2")}async function ot(e,t){console.debug(`[fetchRegistries] ${e.id}`);try{const n=await st(`${tt(e,"summary")}/registries/data.min.json`);for(const e in n)t.register(e,n[e].map((e=>"minecraft:"+e)))}catch(n){console.warn("Error occurred while fetching registries:",$e(n))}}async function rt(e,t){console.debug(`[fetchBlockStateMap] ${e.id}`);try{const n=await st(`${tt(e,"summary")}/blocks/data.min.json`);for(const e in n)t["minecraft:"+e]={properties:n[e][0],default:n[e][1]}}catch(n){console.warn("Error occurred while fetching block state map:",$e(n))}}async function at(e,t,n){console.debug(`[fetchPreset] ${e} ${t} ${n}`);const o=pe.versions.find((t=>t.id===e));try{const e=["blockstates","models"].includes(t)?"assets":"data",r=`${tt(o,e)}/${e}/minecraft/${t}/${n}.json`;return(await fetch(r)).json()}catch(r){throw new Error(`Error occurred while fetching ${t} preset ${n}: ${$e(r)}`)}}async function st(e,t=(e=>e)){try{const n=await caches.open("misode-v2");console.debug(`[getData] Opened cache misode-v2 ${e}`);const o=await n.match(e);if(o&&o.ok)return console.debug(`[getData] Retrieving cached data ${e}`),await o.json();console.debug(`[getData] fetching data ${e}`);const r=await fetch(e),a=t(await r.json());return await n.put(e,new Response(JSON.stringify(a))),a}catch(n){console.warn(`[getData] Failed to open cache misode-v2: ${$e(n)}`),console.debug(`[getData] fetching data ${e}`);const o=await fetch(e);return t(await o.json())}}const it=["1.15","1.16","1.17","1.18","1.18.2"],lt={},ct={},dt={1.15:y,1.16:b,1.17:x,1.18:k,"1.18.2":C};let ut,ht,mt,pt;async function ft(e){return lt[e]||(lt[e]=(async()=>{try{const t=dt[e].getCollections(),n={};await async function(e,t,n){const o=pe.versions.find((t=>t.id===e));o?(await nt(o),await Promise.all([ot(o,t),rt(o,n)])):console.error(`[fetchData] Unknown version ${o} in ${JSON.stringify(pe.versions)}`)}(e,t,n);const o=dt[e].getSchemas(t);return lt[e]={collections:t,schemas:o,blockStates:n},lt[e]}catch(t){throw new Error(`Cannot get version "${e}": ${$e(t)}`)}})()),lt[e]}function vt(e,t,n){const o=pe.versions.findIndex((t=>t.id===e)),r=t?pe.versions.findIndex((e=>e.id===t)):0,a=n?pe.versions.findIndex((e=>e.id===n)):pe.versions.length-1;return r<=o&&o<=a}const gt={},wt=function(e,t){if(!t)return e();if(void 0===pt){const e=document.createElement("link").relList;pt=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(t.map((e=>{if(e in gt)return;gt[e]=!0;const t=e.endsWith(".css"),n=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${n}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":pt,t||(o.as="script",o.crossOrigin=""),o.href=e,document.head.appendChild(o),t?new Promise(((e,t)=>{o.addEventListener("load",e),o.addEventListener("error",t)})):void 0}))).then((()=>e()))};var _t,yt,bt=JSON.parse('{"add":"Add","add_bottom":"Add to bottom","add_top":"Add to top","advancement":"Advancement","assets":"Assets","block_definition":"Blockstate","changelog.search":"Search changes","changelog.no_results":"No changes","collapse":"Collapse","collapse_all":"Hold %0% to collapse all","configure_layers":"Configure layers","copy":"Copy","copied":"Copied!","copy_context":"Copy context","dimension_type":"Dimension Type","dimension":"Dimension","disabled":"Disabled","download":"Download","duplicate":"Duplicate","enabled":"Enabled","entries_hidden":"%0% entries hidden","entries_hidden.more":"Show %0% more","entries_hidden.all":"Show all","expand":"Expand","expand_all":"Hold %0% to expand all","feature.decorated.decorators":"Decorators","feature.decorated.decorators.entry":"Decorator","follow_reference":"Follow reference","format.json":"JSON","format.yaml":"YAML","fields":"Fields","generate_new_seed":"Generate new seed","github":"GitHub","hide_output":"Hide output","hide_preview":"Hide preview","home":"Home","import":"Import","indentation.2_spaces":"2 spaces","indentation.4_spaces":"4 spaces","indentation.minified":"Minified","indentation.tabs":"Tabs","item_modifier":"Item Modifier","language":"Language","layer.biomes":"Biomes","layer.temperature":"Temperature","layer.humidity":"Humidity","layer.continentalness":"Continentalness","layer.erosion":"Erosion","layer.weirdness":"Weirdness","layer.offset":"Offset","layer.factor":"Factor","layer.jaggedness":"Jaggedness","highlighting":"Highlighting","loading":"Loading...","loot_table":"Loot Table","model":"Model","more":"More","move_down":"Move down","move_up":"Move up","not_found.description":"The page you were looking for does not exist.","no_presets":"No presets","output_settings":"Output settings","predicate":"Predicate","recipe":"Recipe","redo":"Redo","reset":"Reset","settings":"Settings","settings.fields.description":"Customize advanced field settings","settings.fields.path":"Context","settings.fields.name":"Name","share":"Share","theme":"Theme","theme.dark":"Dark","theme.light":"Light","theme.system":"System","title.changelog":"Technical Changelog","title.generator":"%0% Generator","title.generator_category":"%0% Generators","title.home":"Data Pack Generators","title.project":"%0% Project","title.sounds":"Sound Explorer","title.versions":"Versions Explorer","presets":"Presets","preview":"Visualize","preview.auto_scroll":"Auto scroll","preview.biome":"Biome","preview.scale":"Scale","preview.depth":"Depth","preview.factor":"Factor","preview.offset":"Offset","preview.peaks":"Peaks","preview.width":"Width","project.delete_file":"Delete file","project.go_to":"Go to project","project.new_file":"New file","project.no_files":"No files","project.search":"Search project","project.search_drafts":"Search drafts","project.unsaved_file":"Unsaved file","remove":"Remove","search":"Search","show_output":"Show output","show_preview":"Show preview","sounds.play":"Play","sounds.play_sound":"Play sound","sounds.play_all":"Play all","sounds.search":"Search sounds","sounds.download_function":"Download Mcfunction","sounds.delay":"Delay","sounds.pitch":"Pitch","sounds.volume":"Volume","sounds.copy_command":"Copy command","sounds.add_sound":"Add sound","sounds.remove_sound":"Remove sound","sounds.unknown_sound":"Unknown sound","sounds.loading_sound":"Loading sound","source_placeholder":"Paste raw %0% content here","switch_generator":"Switch generator","switch_version":"Switch version","terrain_settings":"Terrain settings","undo":"Undo","versions.search":"Search versions","versions.no_results":"No results","versions.all":"All versions","versions.previous":"Previous","versions.next":"Next","versions.released":"Released","versions.release_target":"Release target","versions.data_version":"Data version","versions.protocol_version":"Protocol version","versions.pack_format":"Pack format","versions.data_pack_format":"Data pack format","versions.resource_pack_format":"Resource pack format","versions.technical_changes":"Technical changes","versions.discussion":"Discussion","world":"World Settings","worldgen":"Worldgen","worldgen/biome":"Biome","worldgen/configured_carver":"Carver","worldgen/configured_feature":"Feature","worldgen/density_function":"Density Function","worldgen/placed_feature":"Placed Feature","worldgen/noise":"Noise","worldgen/noise_settings":"Noise Settings","worldgen/processor_list":"Processor List","worldgen/configured_structure_feature":"Structure Feature","worldgen/structure_set":"Structure Set","worldgen/configured_surface_builder":"Surface Builder","worldgen/template_pool":"Template Pool","zoom_in":"Zoom in","zoom_out":"Zoom out"}'),xt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:bt});(yt=_t||(_t={})).ID_LANGUAGE="language",yt.ID_THEME="theme",yt.ID_VERSION="schema_version",yt.ID_INDENT="indentation",yt.ID_FORMAT="output_format",yt.ID_HIGHLIGHTING="output_highlighting",yt.ID_SOUNDS_VERSION="minecraft_sounds_version",yt.ID_PROJECTS="misode_projects",yt.getLanguage=function(){var e;return null!=(e=localStorage.getItem(yt.ID_LANGUAGE))?e:"en"},yt.getTheme=function(){var e;return null!=(e=localStorage.getItem(yt.ID_THEME))?e:"dark"},yt.getVersion=function(){const e=localStorage.getItem(yt.ID_VERSION);return e&&it.includes(e)?e:"1.18.2"},yt.getIndent=function(){var e;return null!=(e=localStorage.getItem(yt.ID_INDENT))?e:"2_spaces"},yt.getFormat=function(){var e;return null!=(e=localStorage.getItem(yt.ID_FORMAT))?e:"json"},yt.getHighlighting=function(){return"false"!==localStorage.getItem(yt.ID_HIGHLIGHTING)},yt.getSoundsVersion=function(){var e;return null!=(e=localStorage.getItem(yt.ID_SOUNDS_VERSION))?e:"latest"},yt.getProjects=function(){const e=localStorage.getItem(yt.ID_PROJECTS);return e?JSON.parse(e):[jt]},yt.setLanguage=function(e){e&&localStorage.setItem(yt.ID_LANGUAGE,e)},yt.setTheme=function(e){e&&localStorage.setItem(yt.ID_THEME,e)},yt.setVersion=function(e){e&&localStorage.setItem(yt.ID_VERSION,e)},yt.setIndent=function(e){e&&localStorage.setItem(yt.ID_INDENT,e)},yt.setFormat=function(e){e&&localStorage.setItem(yt.ID_FORMAT,e)},yt.setHighlighting=function(e){void 0!==e&&localStorage.setItem(yt.ID_HIGHLIGHTING,e.toString())},yt.setSoundsVersion=function(e){e&&localStorage.setItem(yt.ID_SOUNDS_VERSION,e)},yt.setProjects=function(e){e&&localStorage.setItem(yt.ID_PROJECTS,JSON.stringify(e))};const kt=M({lang:"none",locale:e=>e,changeLanguage:()=>{}}),Ct={fallback:bt};function Mt(e,t,...n){var o,r,a,s,i;return function(e,t){return e.replace(/%\d+%/g,(e=>{const n=parseInt(e.slice(1,-1));return void 0!==(null==t?void 0:t[n])?t[n]:e}))}(null!=(i=null!=(s=null!=(a=null==(o=Ct[e])?void 0:o[t])?a:null==(r=Ct.en)?void 0:r[t])?s:Ct.fallback[t])?i:t,n)}async function At(e){if(Ct[e])return;const t=pe.languages.find((t=>t.code===e));if(!t)return;const n=await function(e){switch(e){case"../../locales/de.json":return wt((()=>import("./de.a269acce.js")),void 0);case"../../locales/en.json":return wt((()=>Promise.resolve().then((function(){return xt}))),void 0);case"../../locales/es.json":return wt((()=>import("./es.833a9774.js")),void 0);case"../../locales/fr.json":return wt((()=>import("./fr.f5531eea.js")),void 0);case"../../locales/it.json":return wt((()=>import("./it.fd9a8268.js")),void 0);case"../../locales/ja.json":return wt((()=>import("./ja.a8ff49be.js")),void 0);case"../../locales/pl.json":return wt((()=>import("./pl.3a9fb38c.js")),void 0);case"../../locales/pt.json":return wt((()=>import("./pt.1a04bd2d.js")),void 0);case"../../locales/ru.json":return wt((()=>import("./ru.578070fe.js")),void 0);case"../../locales/sk.json":return wt((()=>import("./sk.96bbf351.js")),void 0);case"../../locales/zh-cn.json":return wt((()=>import("./zh-cn.a421074a.js")),void 0);case"../../locales/zh-tw.json":return wt((()=>import("./zh-tw.298bd51e.js")),void 0);default:return Promise.reject(new Error("Unknown variable dynamic import: "+e))}}(`../../locales/${e}.json`),o=!1!==t.schemas&&await function(e){switch(e){case"../../../node_modules/@mcschema/locales/src/cs.json":return wt((()=>import("./cs.967a01eb.js")),void 0);case"../../../node_modules/@mcschema/locales/src/de.json":return wt((()=>import("./de.6c6a67f3.js")),void 0);case"../../../node_modules/@mcschema/locales/src/en.json":return wt((()=>import("./en.a3c526c1.js")),void 0);case"../../../node_modules/@mcschema/locales/src/es.json":return wt((()=>import("./es.c83d9c73.js")),void 0);case"../../../node_modules/@mcschema/locales/src/fr.json":return wt((()=>import("./fr.e316b1e2.js")),void 0);case"../../../node_modules/@mcschema/locales/src/it.json":return wt((()=>import("./it.7ff123cd.js")),void 0);case"../../../node_modules/@mcschema/locales/src/ja.json":return wt((()=>import("./ja.3170354d.js")),void 0);case"../../../node_modules/@mcschema/locales/src/pl.json":return wt((()=>import("./pl.ae1f6791.js")),void 0);case"../../../node_modules/@mcschema/locales/src/pt.json":return wt((()=>import("./pt.31e14993.js")),void 0);case"../../../node_modules/@mcschema/locales/src/ru.json":return wt((()=>import("./ru.cc3bc989.js")),void 0);case"../../../node_modules/@mcschema/locales/src/sk.json":return wt((()=>import("./sk.d4265232.js")),void 0);case"../../../node_modules/@mcschema/locales/src/zh-cn.json":return wt((()=>import("./zh-cn.4129665a.js")),void 0);case"../../../node_modules/@mcschema/locales/src/zh-tw.json":return wt((()=>import("./zh-tw.bdc36a24.js")),void 0);default:return Promise.reject(new Error("Unknown variable dynamic import: "+e))}}(`../../../node_modules/@mcschema/locales/src/${e}.json`);Ct[e]=i(i({},n.default),o.default)}function It(){return I(kt)}function zt({children:e}){const[t,n]=v("none"),o=A(((e,...n)=>Mt(t,e,...n)),[t]),r=A((async e=>{await At(e),ue.setLanguage(e),_t.setLanguage(e),n(e)}),[]);c((()=>{(async()=>{const e=_t.getLanguage();await Promise.all([At("en"),..."en"!==e?[At(e)]:[]]),n(e)})()}),[]);const a={lang:t,locale:o,changeLanguage:r};return d(kt.Provider,{value:a},e)}const jt={name:"Drafts",namespace:"draft",files:[]},Et=M({project:jt,changeProject:()=>{},updateProject:()=>{},updateFile:()=>!1,openFile:()=>{},closeFile:()=>{}});function $t(){return I(Et)}function Ot({children:e}){const[t,n]=v(_t.getProjects()),[o,r]=v(jt.name),a=w((()=>{var e;return null!=(e=t.find((e=>e.name===o)))?e:jt}),[t,o]),[s,c]=v(void 0),u=w((()=>{if(s)return a.files.find((e=>e.type===s[0]&&e.id===s[1]))}),[a,s]),h=A((e=>{_t.setProjects(e),n(e)}),[]),m=A((e=>{h(t.map((t=>t.name===o?i(i({},t),e):t)))}),[t,o]),f=A(((e,t,n)=>{var o;if(n.id){const r=n.id.includes(":")?n.id:`${a.namespace}:${n.id}`,s=a.files.some((t=>t.type===e&&t.id===r));if(t){if((null==u?void 0:u.id)===t&&t!==r&&s)return!1;m({files:a.files.map((o=>o.type===e&&o.id===t?l(i(i({},o),n),{id:r}):o))}),(null==u?void 0:u.id)===t&&c([e,r])}else{if(s)return!1;m({files:[...a.files,{type:e,id:r,data:null!=(o=n.data)?o:{}}]}),c([e,r])}}else m({files:a.files.filter((n=>n.type!==e||n.id!==t))});return!0}),[m,a,u]),g=A(((e,t)=>{const n=pe.generators.find((t=>t.id===e||t.path===e));if(!n)throw new Error(`Cannot find generator of type ${e}`);c([n.id,t]),p(be(n.url))}),[]),_=A((()=>{c(void 0)}),[]),y={project:a,file:u,changeProject:r,updateProject:m,updateFile:f,openFile:g,closeFile:_};return d(Et.Provider,{value:y},e)}function St(e){var t;const[n,o]=e.id.includes(":")?e.id.split(":"):["minecraft",e.id],r=pe.generators.find((t=>t.id===e.type));if(!r)throw new Error(`Cannot find generator of type ${e.type}`);return`data/${n}/${null!=(t=r.path)?t:r.id}/${o}`}const Lt=M({theme:"dark",actualTheme:"dark",changeTheme:()=>{}});function Pt(){return I(Lt)}function Dt({children:e}){const[t,n]=v(_t.getTheme()),o=Te("(prefers-color-scheme: light)"),r=Te("(prefers-color-scheme: dark)");c((()=>{document.documentElement.setAttribute("data-theme",t)}),[t]);const a=A((e=>{ue.setTheme(e),_t.setTheme(e),n(e)}),[]);c((()=>{ue.setPrefersColorScheme(o?"light":r?"dark":"none")}),[o,r]);const s={theme:t,actualTheme:"light"===t||"dark"!==t&&o?"light":"dark",changeTheme:a};return d(Lt.Provider,{value:s},e)}const Vt=M({title:"",changeTitle:()=>{}});function Nt(e,t){const n=I(Vt);return c((()=>{e&&n.changeTitle(e,t)}),[e,t]),n}function Tt({children:e}){const{locale:t}=It(),[n,o]=v(t("title.home")),r={title:n,changeTitle:A(((e,t)=>{null!=t||(t=pe.versions.map((e=>e.id)));const n=t.slice(t.length-3);document.title=`${e} Minecraft ${n.join(", ")}`,o(e)}),[])};return d(Vt.Provider,{value:r},e)}const Bt=M({version:"1.18.2",changeVersion:()=>{}});function Ht(){return I(Bt)}function Rt({children:e}){const[t,n]=v(_t.getVersion()),o=Ce(m()).get("version");c((()=>{it.includes(o)&&t!==o&&n(o)}),[t,o]);const r=A((e=>{Ce(m()).has("version")&&Me({version:e}),ue.setVersion(e),_t.setVersion(e),n(e)}),[]),a={version:t,changeVersion:r};return d(Bt.Provider,{value:a},e)}let Ft=!1;const Gt={temperature:[-1,1],humidity:[-1,1],continentalness:[-1.1,1],erosion:[-1,1],weirdness:[-1,1],offset:[-1,1],factor:[0,12],jaggedness:[0,1]};let Jt,Wt;async function Ut(e,t){const n=[e,t.octaves,`${t.seed}`,t.version];return Se(n,Jt)||(Jt=Oe(n),Wt=await async function(e,t){var n,o,r,a,s;switch(null==(n=null==e?void 0:e.type)?void 0:n.replace(/^minecraft:/,"")){case"fixed":return new P($.parse(e.biome));case"checkerboard":const n=(null!=(o=e.scale)?o:2)+2,i=null!=(a=null==(r=e.biomes)?void 0:r.length)?a:0;return{getBiome(t,o,r){var a;const s=(((t>>n)+(r>>n))%i+i)%i;return $.parse(null==(a=e.biomes)?void 0:a[s].node)}};case"multi_noise":switch(null==(s=e.preset)?void 0:s.replace(/^minecraft:/,"")){case"nether":e=vt(t.version,"1.18")?Xt:Zt;break;case"overworld":e=vt(t.version,"1.18")?await async function(){return(await at("1.18","dimension","overworld")).generator.biome_source}():e}if(e=h.DataModel.unwrapLists(e),vt(t.version,"1.18")){await async function(){Ft||(await D(V),Ft=!0,console.debug(`Loaded deepslate-rs from "${V}"`))}();const n=new Le,o=e=>"number"==typeof e?[e,e]:e,[r,a,s,i,l,c,d,u,h,m,p,f,v,g]=[[],[],[],[],[],[],[],[],[],[],[],[],[],[]];for(const t of e.biomes){const{temperature:e,humidity:w,continentalness:_,erosion:y,weirdness:b,depth:x,offset:k}=t.parameters;r.push(o(e)[0]),a.push(o(e)[1]),s.push(o(w)[0]),i.push(o(w)[1]),l.push(o(_)[0]),c.push(o(_)[1]),d.push(o(y)[0]),u.push(o(y)[1]),h.push(o(b)[0]),m.push(o(b)[1]),p.push(o(x)[0]),f.push(o(x)[1]),v.push(k),g.push(n.getOrPut(t.biome,Math.floor(2147483647*Math.random())))}const w=z(new Float64Array(r),new Float64Array(a),new Float64Array(s),new Float64Array(i),new Float64Array(l),new Float64Array(c),new Float64Array(d),new Float64Array(u),new Float64Array(h),new Float64Array(m),new Float64Array(p),new Float64Array(f),new Float64Array(v),new Int32Array(g)),_=j(t.seed,t.octaves.temperature.firstOctave,new Float64Array(t.octaves.temperature.amplitudes),t.octaves.humidity.firstOctave,new Float64Array(t.octaves.humidity.amplitudes),t.octaves.continentalness.firstOctave,new Float64Array(t.octaves.continentalness.amplitudes),t.octaves.erosion.firstOctave,new Float64Array(t.octaves.erosion.amplitudes),t.octaves.weirdness.firstOctave,new Float64Array(t.octaves.weirdness.amplitudes),t.octaves.shift.firstOctave,new Float64Array(t.octaves.shift.amplitudes));return{getBiome(e,t,o){var r;const a=E(w,_,e,e+1,1,t,t+1,1,o,o+1,1);return $.parse(null!=(r=n.getA(a[0]))?r:"unknown")},getBiomes:(e,t,o,r,a,s,i,l,c)=>[...E(w,_,e,t,o,r,a,s,i,l,c)].map((e=>{var t;return $.parse(null!=(t=n.getA(e))?t:"unknown")})),getClimate(e,t,n){const o=O(_,e,e+1,1,t,t+1,1,n,n+1,1),[r,a,s,i,l]=o.slice(0,5);return{temperature:r,humidity:a,continentalness:s,erosion:i,weirdness:l}},getClimates(e,t,n,o,r,a,s,i,l){const c=O(_,e,t,n,o,r,a,s,i,l),d=[];for(let u=0;u<c.length;u+=7){const[e,t,n,o,r]=c.slice(u,u+5);d.push({temperature:e,humidity:t,continentalness:n,erosion:o,weirdness:r})}return d}}}{const n=["altitude","temperature","humidity","weirdness"].map(((n,o)=>{var r;const a=e[`${n}_noise`];return a.firstOctave=ze(null!=(r=a.firstOctave)?r:-7,-100,-1),new S(new L(t.seed+BigInt(o)),a)}));return Array.isArray(e.biomes)&&0!==e.biomes.length?{getBiome(t,o,r){const a=n.map((e=>e.sample(t,r,0)));let s=1/0,i="";for(const{biome:n,parameters:l}of e.biomes){const e=Ie(l.altitude-a[0])+Ie(l.temperature-a[1])+Ie(l.humidity-a[2])+Ie(l.weirdness-a[3])+Ie(l.offset);e<s&&(s=e,i=n)}return $.parse(i)}}:new P($.create("unknown"))}}throw new Error("Unknown biome source")}(e,t)),{biomeSource:Wt}}function Yt(e,t){var n;if(!e)return[128,128,128];const o=null!=(n=t[e])?n:qt[e];return void 0===o?Ae(e):o}const qt={"minecraft:badlands":[217,69,21],"minecraft:badlands_plateau":[202,140,101],"minecraft:bamboo_jungle":[118,142,20],"minecraft:bamboo_jungle_hills":[59,71,10],"minecraft:basalt_deltas":[64,54,54],"minecraft:beach":[250,222,85],"minecraft:birch_forest":[48,116,68],"minecraft:birch_forest_hills":[31,95,50],"minecraft:cold_ocean":[32,32,112],"minecraft:crimson_forest":[221,8,8],"minecraft:dark_forest":[64,81,26],"minecraft:dark_forest_hills":[104,121,66],"minecraft:deep_cold_ocean":[32,32,56],"minecraft:deep_frozen_ocean":[64,64,144],"minecraft:deep_lukewarm_ocean":[0,0,64],"minecraft:deep_ocean":[0,0,48],"minecraft:deep_warm_ocean":[0,0,80],"minecraft:desert":[250,148,24],"minecraft:desert_hills":[210,95,18],"minecraft:desert_lakes":[255,188,64],"minecraft:end_barrens":[128,128,255],"minecraft:end_highlands":[128,128,255],"minecraft:end_midlands":[128,128,255],"minecraft:eroded_badlands":[255,109,61],"minecraft:flower_forest":[45,142,73],"minecraft:forest":[5,102,33],"minecraft:frozen_ocean":[112,112,214],"minecraft:frozen_river":[160,160,255],"minecraft:giant_spruce_taiga":[129,142,121],"minecraft:old_growth_spruce_taiga":[129,142,121],"minecraft:giant_spruce_taiga_hills":[109,119,102],"minecraft:giant_tree_taiga":[89,102,81],"minecraft:old_growth_pine_taiga":[89,102,81],"minecraft:giant_tree_taiga_hills":[69,79,62],"minecraft:gravelly_hills":[136,136,136],"minecraft:gravelly_mountains":[136,136,136],"minecraft:windswept_gravelly_hills":[136,136,136],"minecraft:ice_spikes":[180,220,220],"minecraft:jungle":[83,123,9],"minecraft:jungle_edge":[98,139,23],"minecraft:sparse_jungle":[98,139,23],"minecraft:jungle_hills":[44,66,5],"minecraft:lukewarm_ocean":[0,0,144],"minecraft:modified_badlands_plateau":[242,180,141],"minecraft:modified_gravelly_mountains":[120,152,120],"minecraft:modified_jungle":[123,163,49],"minecraft:modified_jungle_edge":[138,179,63],"minecraft:modified_wooded_badlands_plateau":[216,191,141],"minecraft:mountain_edge":[114,120,154],"minecraft:extreme_hills":[96,96,96],"minecraft:mountains":[96,96,96],"minecraft:windswept_hills":[96,96,96],"minecraft:mushroom_field_shore":[160,0,255],"minecraft:mushroom_fields":[255,0,255],"minecraft:nether_wastes":[191,59,59],"minecraft:ocean":[0,0,112],"minecraft:plains":[141,179,96],"minecraft:river":[0,0,255],"minecraft:savanna":[189,178,95],"minecraft:savanna_plateau":[167,157,100],"minecraft:shattered_savanna":[229,218,135],"minecraft:windswept_savanna":[229,218,135],"minecraft:shattered_savanna_plateau":[207,197,140],"minecraft:small_end_islands":[128,128,255],"minecraft:snowy_beach":[250,240,192],"minecraft:snowy_mountains":[160,160,160],"minecraft:snowy_taiga":[49,85,74],"minecraft:snowy_taiga_hills":[36,63,54],"minecraft:snowy_taiga_mountains":[89,125,114],"minecraft:snowy_tundra":[255,255,255],"minecraft:snowy_plains":[255,255,255],"minecraft:soul_sand_valley":[94,56,48],"minecraft:stone_shore":[162,162,132],"minecraft:stony_shore":[162,162,132],"minecraft:sunflower_plains":[181,219,136],"minecraft:swamp":[7,249,178],"minecraft:swamp_hills":[47,255,218],"minecraft:taiga":[11,102,89],"minecraft:taiga_hills":[22,57,51],"minecraft:taiga_mountains":[51,142,129],"minecraft:tall_birch_forest":[88,156,108],"minecraft:old_growth_birch_forest":[88,156,108],"minecraft:tall_birch_hills":[71,135,90],"minecraft:the_end":[128,128,255],"minecraft:the_void":[0,0,0],"minecraft:warm_ocean":[0,0,172],"minecraft:warped_forest":[73,144,123],"minecraft:wooded_badlands_plateau":[176,151,101],"minecraft:wooded_badlands":[176,151,101],"minecraft:wooded_hills":[34,85,28],"minecraft:wooded_mountains":[80,112,80],"minecraft:windswept_forest":[80,112,80],"minecraft:snowy_slopes":[140,195,222],"minecraft:lofty_peaks":[196,168,193],"minecraft:jagged_peaks":[196,168,193],"minecraft:snowcapped_peaks":[200,198,200],"minecraft:frozen_peaks":[200,198,200],"minecraft:stony_peaks":[82,92,103],"minecraft:grove":[150,150,189],"minecraft:meadow":[169,197,80],"minecraft:lush_caves":[112,255,79],"minecraft:dripstone_caves":[140,124,0]},Zt={type:"minecraft:multi_noise",seed:0,altitude_noise:{firstOctave:-7,amplitudes:[1,1]},temperature_noise:{firstOctave:-7,amplitudes:[1,1]},humidity_noise:{firstOctave:-7,amplitudes:[1,1]},weirdness_noise:{firstOctave:-7,amplitudes:[1,1]},biomes:[{biome:"minecraft:nether_wastes",parameters:{altitude:0,temperature:0,humidity:0,weirdness:0,offset:0}},{biome:"minecraft:soul_sand_valley",parameters:{altitude:0,temperature:0,humidity:-.5,weirdness:0,offset:0}},{biome:"minecraft:crimson_forest",parameters:{altitude:0,temperature:.4,humidity:0,weirdness:0,offset:0}},{biome:"minecraft:warped_forest",parameters:{altitude:0,temperature:0,humidity:.5,weirdness:0,offset:.375}},{biome:"minecraft:basalt_deltas",parameters:{altitude:0,temperature:-.5,humidity:0,weirdness:0,offset:.175}}]},Xt={type:"minecraft:multi_noise",biomes:[{biome:"minecraft:nether_wastes",parameters:{temperature:0,humidity:0,continentalness:0,erosion:0,depth:0,weirdness:0,offset:0}},{biome:"minecraft:soul_sand_valley",parameters:{temperature:0,humidity:-.5,continentalness:0,erosion:0,depth:0,weirdness:0,offset:0}},{biome:"minecraft:crimson_forest",parameters:{temperature:.4,humidity:0,continentalness:0,erosion:0,depth:0,weirdness:0,offset:0}},{biome:"minecraft:warped_forest",parameters:{temperature:0,humidity:.5,continentalness:0,erosion:0,depth:0,weirdness:0,offset:.375}},{biome:"minecraft:basalt_deltas",parameters:{temperature:-.5,humidity:0,continentalness:0,erosion:0,depth:0,weirdness:0,offset:.175}}]};const Kt=[50,50,51,51,52,52,53,54,56,57,57,58,58,59,60,60,60,59,59,59,60,61,61,62,63,63,64,64,64,65,65,66,66,65,65,66,66,67,67,67,68,69,71,73,74,76,79,80,81,81,82,83,83,82,82,81,81,80,80,80,81,81,82,82],Qt=[[255,77,54],[59,118,255],[91,207,25],[217,32,245],[255,209,41],[52,204,209]];function en(e,t,n){const o=new L(n.seed),r={placements:[],features:[],random:o,biomeInfoNoise:new N(o.fork(),0,[1]),seaLevel:63,version:n.version,nextFloat:()=>o.nextFloat(),nextInt:e=>o.nextInt(e),nextGaussian:()=>Math.sqrt(-2*Math.log(1-o.nextFloat()))*Math.cos(2*Math.PI*o.nextFloat()),sampleInt(e){return function(e,t){var n,o;if("number"==typeof e)return e;if(e.base)return null!=(o=e.base)?o:1+t.nextInt(1+(null!=(n=e.spread)?n:0));switch(tn(e.type)){case"constant":return e.value;case"uniform":return e.value.min_inclusive+t.nextInt(e.value.max_inclusive-e.value.min_inclusive+1);case"biased_to_bottom":return e.value.min_inclusive+t.nextInt(t.nextInt(e.value.max_inclusive-e.value.min_inclusive+1)+1);case"clamped":return ze(t.sampleInt(e.value.source),e.value.min_inclusive,e.value.max_inclusive);case"clamped_normal":const n=e.value.mean+t.nextGaussian()*e.value.deviation;return Math.floor(ze(e.value.min_inclusive,e.value.max_inclusive,n));case"weighted_list":const o=e.distribution.reduce(((e,t)=>e+t.weight),0);let r=t.nextInt(o);for(const a of e.distribution)if(r-=a.weight,r<0)return t.sampleInt(a.data);return 0}return 1}(e,this)}};for(let s=0;s<n.size[0]/16;s+=1)for(let t=0;t<n.size[2]/16;t+=1)vt(n.version,void 0,"1.17")?an([16*s,0,16*t],h.DataModel.unwrapLists(e),r):dn([16*s,0,16*t],h.DataModel.unwrapLists(e.placement),r);const a=t.data;t.data.fill(255);for(const[s,i]of r.placements){if(s[0]<0||s[1]<0||s[2]<0||s[0]>=n.size[0]||s[1]>=n.size[1]||s[2]>=n.size[2])continue;const e=s[2]*(4*t.width)+4*s[0],o=i<Qt.length?Qt[i]:Ae(r.features[i]);a[e]=ze(50,205,o[0]),a[e+1]=ze(50,205,o[1]),a[e+2]=ze(50,205,o[2]),a[e+3]=255}for(let s=0;s<n.size[0];s+=1)for(let e=0;e<n.size[2];e+=1){if((Math.floor(s/16)+Math.floor(e/16))%2==0)continue;const n=e*(4*t.width)+4*s;for(let e=0;e<3;e+=1)a[n+e]=.85*a[n+e]}}function tn(e){return e.startsWith("minecraft:")?e.slice(10):e}function nn(e,t){return[[e[0],t,e[2]]]}function on(e,t){if(!fe(e))throw new Error("Invalid vertical anchor");if(e.absolute)return e.absolute;if(e.above_bottom)return e.above_bottom;if(e.below_top)return 256-e.below_top;throw new Error("Invalid vertical anchor")}function rn(e,t){const n=t.features.indexOf(e);return-1!=n?n:(t.features.push(e),t.features.length-1)}function an(e,t,n){var o;if("string"==typeof t)return void n.placements.push([e,rn(t,n)]);const r=tn(null!=(o=null==t?void 0:t.type)?o:"no_op"),a=ln[r];a?a(t.config,e,n):n.placements.push([e,rn(JSON.stringify(t),n)])}function sn(e,t,n){var o;const r=tn(null!=(o=null==t?void 0:t.type)?o:"nope"),a=cn[r];return a?a(null==t?void 0:t.config,e,n):[e]}const ln={decorated:(e,t,n)=>{sn(t,null==e?void 0:e.decorator,n).forEach((t=>an(t,null==e?void 0:e.feature,n)))},random_boolean_selector:(e,t,n)=>{an(t,n.nextFloat()<.5?null==e?void 0:e.feature_true:null==e?void 0:e.feature_false,n)},random_selector:(e,t,n)=>{var o,r;for(const a of null!=(o=null==e?void 0:e.features)?o:[])if(n.nextFloat()<(null!=(r=null==a?void 0:a.chance)?r:0))return void an(t,a.feature,n);an(t,null==e?void 0:e.default,n)},simple_random_selector:(e,t,n)=>{var o,r,a;an(t,null==(a=null==e?void 0:e.features)?void 0:a[n.nextInt(null!=(r=null==(o=null==e?void 0:e.features)?void 0:o.length)?r:0)],n)}},cn={chance:(e,t,n)=>{var o;return n.nextFloat()<1/(null!=(o=null==e?void 0:e.chance)?o:1)?[t]:[]},count:(e,t,n)=>{var o;return new Array(n.sampleInt(null!=(o=null==e?void 0:e.count)?o:1)).fill(t)},count_extra:(e,t,n)=>{var o,r;let a=null!=(o=null==e?void 0:e.count)?o:1;return n.nextFloat()<e.extra_chance&&(a+=null!=(r=e.extra_count)?r:0),new Array(a).fill(t)},count_multilayer:(e,t,n)=>{var o;return new Array(n.sampleInt(null!=(o=null==e?void 0:e.count)?o:1)).fill(t).map((e=>[e[0]+n.nextInt(16),e[1],e[2]+n.nextInt(16)]))},count_noise:(e,t,n)=>{const o=n.biomeInfoNoise.sample(t[0]/200,0,t[2]/200)<e.noise_level?e.below_noise:e.above_noise;return new Array(o).fill(t)},count_noise_biased:(e,t,n)=>{var o;const r=Math.max(1,e.noise_factor),a=n.biomeInfoNoise.sample(t[0]/r,0,t[2]/r),s=Math.max(0,Math.ceil((a+(null!=(o=e.noise_offset)?o:0))*e.noise_to_count_ratio));return new Array(s).fill(t)},dark_oak_tree:(e,t,n)=>[...new Array(16)].map(((e,o)=>{const r=4*Math.floor(o/4)+1+n.nextInt(3)+t[0];return[r,Math.max(n.seaLevel,Kt[ze(0,63,r)]),4*Math.floor(o%4)+1+n.nextInt(3)+t[2]]})),decorated:(e,t,n)=>sn(t,null==e?void 0:e.outer,n).flatMap((t=>sn(t,null==e?void 0:e.inner,n))),depth_average:(e,t,n)=>{var o,r,a,s;return nn(t,n.nextInt(null!=(o=null==e?void 0:e.spread)?o:0)+n.nextInt(null!=(r=null==e?void 0:e.spread)?r:0)-(null!=(a=e.spread)?a:0)+(null!=(s=null==e?void 0:e.baseline)?s:0))},emerald_ore:(e,t,n)=>{const o=3+n.nextInt(6);return[...new Array(o)].map((()=>[t[0]+n.nextInt(16),4+n.nextInt(28),t[2]+n.nextInt(16)]))},fire:(e,t,n)=>{const o=1+n.nextInt(n.nextInt(n.sampleInt(null==e?void 0:e.count)));return[...new Array(o)].map((()=>[t[0]+n.nextInt(16),n.nextInt(128),t[2]+n.nextInt(16)]))},glowstone:(e,t,n)=>{const o=n.nextInt(1+n.nextInt(n.sampleInt(null==e?void 0:e.count)));return[...new Array(o)].map((()=>[t[0]+n.nextInt(16),n.nextInt(128),t[2]+n.nextInt(16)]))},heightmap:(e,t,n)=>nn(t,Math.max(n.seaLevel,Kt[ze(0,63,t[0])])),heightmap_spread_double:(e,t,n)=>{const o=Math.max(n.seaLevel,Kt[ze(0,63,t[0])]);return nn(t,n.nextInt(2*o))},heightmap_world_surface:(e,t,n)=>nn(t,Math.max(n.seaLevel,Kt[ze(0,63,t[0])])),iceberg:(e,t,n)=>[[t[0]+4+n.nextInt(8),t[1],t[2]+4+n.nextInt(8)]],lava_lake:(e,t,n)=>{var o,r;if(0===n.nextInt((null!=(o=e.chance)?o:1)/10)){const o=n.nextInt(n.nextInt(248)+8);if(o<n.seaLevel||0==n.nextInt((null!=(r=null==e?void 0:e.chance)?r:1)/8)){return[[n.nextInt(16)+t[0],o,n.nextInt(16)+t[2]]]}}return[]},nope:(e,t)=>[t],range:(e,t,n)=>{var o,r,a;return nn(t,n.nextInt((null!=(o=null==e?void 0:e.maximum)?o:1)-(null!=(r=null==e?void 0:e.top_offset)?r:0))+(null!=(a=null==e?void 0:e.bottom_offset)?a:0))},range_biased:(e,t,n)=>{var o,r,a;return nn(t,n.nextInt(n.nextInt((null!=(o=null==e?void 0:e.maximum)?o:1)-(null!=(r=null==e?void 0:e.top_offset)?r:0))+(null!=(a=null==e?void 0:e.bottom_offset)?a:0)))},range_very_biased:(e,t,n)=>{var o,r,a,s;return nn(t,n.nextInt(n.nextInt(n.nextInt((null!=(o=null==e?void 0:e.maximum)?o:1)-(null!=(r=null==e?void 0:e.top_offset)?r:0))+(null!=(a=null==e?void 0:e.bottom_offset)?a:0))+(null!=(s=null==e?void 0:e.bottom_offset)?s:0)))},spread_32_above:(e,t,n)=>nn(t,n.nextInt(t[1]+32)),top_solid_heightmap:(e,t)=>nn(t,Kt[ze(0,63,t[0])]),magma:(e,t,n)=>nn(t,n.nextInt(t[1]+32)),square:(e,t,n)=>[[t[0]+n.nextInt(16),t[1],t[2]+n.nextInt(16)]],surface_relative_threshold:(e,t)=>{var n,o;const r=Kt[ze(0,63,t[0])],a=r+(null!=(n=null==e?void 0:e.min_inclusive)?n:-1/0),s=r+(null!=(o=null==e?void 0:e.max_inclusive)?o:1/0);return t[1]<a||t[1]>s?[t]:[]},water_lake:(e,t,n)=>{var o;return 0===n.nextInt(null!=(o=e.chance)?o:1)?[[t[0]+n.nextInt(16),n.nextInt(256),t[2]+n.nextInt(16)]]:[]}};function dn(e,t,n){var o;let r=[e];for(const a of t){un[tn(null!=(o=null==a?void 0:a.type)?o:"nope")]&&(r=r.flatMap((e=>un[tn(a.type)](a,e,n))))}for(const a of r)n.placements.push([a,0])}const un={count:({count:e},t,n)=>new Array(n.sampleInt(null!=e?e:1)).fill(t),count_on_every_layer:({count:e},t,n)=>new Array(n.sampleInt(null!=e?e:1)).fill(t).map((e=>[e[0]+n.nextInt(16),e[1],e[2]+n.nextInt(16)])),environment_scan:({},e)=>[e],height_range:({height:e},t,n)=>nn(t,function(e,t){var n,o,r,a;if(!fe(e))throw new Error("Invalid height provider");if("string"!=typeof e.type)return on(e);switch(tn(e.type)){case"constant":return on(e.value);case"uniform":{const n=on(e.min_inclusive),o=on(e.max_inclusive);return n+t.nextInt(o-n+1)}case"biased_to_bottom":{const r=on(e.min_inclusive),a=on(e.max_inclusive),s=t.nextInt(a-r-(null!=(n=e.inner)?n:1)+1);return r+t.nextInt(s+(null!=(o=e.inner)?o:1))}case"very_biased_to_bottom":{const n=on(e.min_inclusive),o=on(e.max_inclusive),a=null!=(r=e.inner)?r:1,s=n+a+t.nextInt(o-n-a+1),i=n+t.nextInt(s-n);return n+t.nextInt(i-n+a)}case"trapezoid":{const n=on(e.min_inclusive),o=on(e.max_inclusive),r=null!=(a=e.plateau)?a:0;if(r>=o-n)return n+t.nextInt(o-n+1);const s=(o-n-r)/2,i=o-n-s;return n+t.nextInt(i+1)+t.nextInt(s+1)}default:throw new Error(`Invalid height provider ${e.type}`)}}(e,n)),heightmap:({},e,t)=>nn(e,Math.max(t.seaLevel,Kt[ze(0,63,e[0])])),in_square:({},e,t)=>[[e[0]+t.nextInt(16),e[1],e[2]+t.nextInt(16)]],noise_based_count:({noise_to_count_ratio:e,noise_factor:t,noise_offset:n},o,r)=>{const a=Math.max(1,t),s=r.biomeInfoNoise.sample(o[0]/a,0,o[2]/a),i=Math.max(0,Math.ceil((s+(null!=n?n:0))*e));return new Array(i).fill(o)},noise_threshold_count:({noise_level:e,below_noise:t,above_noise:n},o,r)=>{const a=r.biomeInfoNoise.sample(o[0]/200,0,o[2]/200);return new Array(a<e?t:n).fill(o)},random_offset:({xz_spread:e,y_spread:t},n,o)=>[[n[0]+o.sampleInt(e),n[1]+o.sampleInt(t),n[2]+o.sampleInt(e)]],rarity_filter:({chance:e},t,n)=>n.nextFloat()<1/(null!=e?e:1)?[t]:[]};class hn{constructor(e){this.settings={},this.chunkWidth=4,this.chunkHeight=4,this.chunkCountY=32,this.biomeDepth=.1,this.biomeScale=.2,this.noiseColumnCache=[],this.xOffset=0;const t=new L(e);this.minLimitPerlinNoise=new N(t,-15,[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.maxLimitPerlinNoise=new N(t,-15,[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.mainPerlinNoise=new N(t,-7,[1,1,1,1,1,1,1,1]),this.depthNoise=new N(t,-15,[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1])}reset(e,t,n,o,r){this.settings=e,this.chunkWidth=4*e.size_horizontal,this.chunkHeight=4*e.size_vertical,this.chunkCountY=Math.floor(e.height/this.chunkHeight),e.amplified&&t>0&&(t=1+2*t,n=1+4*n),this.biomeDepth=.265625*(.5*t-.125),this.biomeScale=96/(.9*n+.1),this.noiseColumnCache=Array(r).fill(null),this.xOffset=o}iterateNoiseColumn(e){const t=Array(this.chunkCountY*this.chunkHeight),n=Math.floor(e/this.chunkWidth),o=Math.floor(e%this.chunkWidth)/this.chunkWidth,r=this.fillNoiseColumn(n),a=this.fillNoiseColumn(n+1);for(let h=this.chunkCountY-1;h>=0;h-=1)for(let e=this.chunkHeight;e>=0;e-=1){const n=e/this.chunkHeight;t[h*this.chunkHeight+e]=(s=n,i=o,l=r[h],c=r[h+1],d=a[h],u=a[h+1],Ee(i,Ee(s,l,c),Ee(s,d,u)))}var s,i,l,c,d,u;return t}fillNoiseColumn(e){const t=this.noiseColumnCache[e-this.xOffset];if(t)return t;const n=Array(this.chunkCountY+1),o=684.412*this.settings.sampling.xz_scale,r=684.412*this.settings.sampling.y_scale,a=o/this.settings.sampling.xz_factor,s=r/this.settings.sampling.y_factor,i=this.settings.random_density_offset?this.getRandomDensity(e):0;for(let l=0;l<=this.chunkCountY;l+=1){let t=this.sampleAndClampNoise(e,l,this.mainPerlinNoise.getOctaveNoise(0).zo,o,r,a,s);const c=((1-2*l/this.chunkCountY+i)*this.settings.density_factor+this.settings.density_offset+this.biomeDepth)*this.biomeScale;t+=c*(c>0?4:1),this.settings.top_slide.size>0&&(t=je(this.settings.top_slide.target,t,(this.chunkCountY-l-this.settings.top_slide.offset)/this.settings.top_slide.size)),this.settings.bottom_slide.size>0&&(t=je(this.settings.bottom_slide.target,t,(l-this.settings.bottom_slide.offset)/this.settings.bottom_slide.size)),n[l]=t}return this.noiseColumnCache[e-this.xOffset]=n,n}getRandomDensity(e){const t=this.depthNoise.sample(200*e,10,this.depthNoise.getOctaveNoise(0).zo,1,0,!0),n=24.575625*(t<0?.3*-t:t)-2;return n<0?.009486607142857142*n:.006640625*Math.min(n,1)}sampleAndClampNoise(e,t,n,o,r,a,s){let i=0,l=0,c=0,d=1;for(let u=0;u<16;u+=1){const h=N.wrap(e*o*d),m=N.wrap(t*r*d),p=N.wrap(n*o*d),f=r*d,v=this.minLimitPerlinNoise.getOctaveNoise(u);v&&(i+=v.sample(h,m,p,f,t*f)/d);const g=this.maxLimitPerlinNoise.getOctaveNoise(u);if(g&&(l+=g.sample(h,m,p,f,t*f)/d),u<8){const o=this.mainPerlinNoise.getOctaveNoise(u);o&&(c+=o.sample(N.wrap(e*a*d),N.wrap(t*s*d),N.wrap(n*a*d),s*d,t*s*d)/d)}d/=2}return je(i/512,l/512,(c/10+1)/2)}}const mn={"minecraft:air":[150,160,170],"minecraft:water":[20,80,170],"minecraft:lava":[200,100,0],"minecraft:stone":[55,55,55],"minecraft:deepslate":[34,34,36],"minecraft:bedrock":[10,10,10],"minecraft:grass_block":[47,120,23],"minecraft:dirt":[64,40,8],"minecraft:gravel":[70,70,70],"minecraft:sand":[196,180,77],"minecraft:sandstone":[148,135,52],"minecraft:netherrack":[100,40,40],"minecraft:crimson_nylium":[144,22,22],"minecraft:warped_nylium":[28,115,113],"minecraft:basalt":[73,74,85],"minecraft:end_stone":[200,200,140]};let pn,fn,vn=[];const gn=new Map;async function wn(e,t,n){var o,r,a;if(vt(n.version,"1.18")){vt(n.version,"1.18.2")&&await bn(n.version);const{settings:r,generator:a}=function(e,t){const n=Y.fromJson(h.DataModel.unwrapLists(e)),o=[e,`${t.seed}`,t.biome];if(!Se(o,pn))if(pn=Oe(o),vn=[],vt(t.version,"1.18.2")){const e=new P($.create("unknown"));fn=new q(t.seed,e,n)}else{const e=new Q("unknown");fn=new Z(t.seed,e,n)}return{settings:n,generator:fn}}(e,n),s=new kn(-n.offset,n.width,r.noise.minY,r.noise.height);s.generate(a,n.biome);const i=t.data;for(let e=0;e<n.width;e+=1)for(let a=0;a<r.noise.height;a+=1){const l=4*e+4*(r.noise.height-a-1)*t.width,c=s.getBlockState([e-n.offset,a+r.noise.minY,0]),d=null!=(o=mn[c.getName().toString()])?o:[0,0,0];i[l]=d[0],i[l+1]=d[1],i[l+2]=d[2],i[l+3]=255}return}const s=new hn(n.seed);s.reset(e.noise,null!=(r=n.biomeDepth)?r:0,null!=(a=n.biomeScale)?a:0,n.offset,n.width);const i=t.data,l=4*t.width;for(let c=0;c<n.width;c+=1){const t=s.iterateNoiseColumn(c-n.offset).reverse();for(let n=0;n<e.noise.height;n+=1){const e=n*l+4*c,o=xn(t,n);i[e]=o,i[e+1]=o,i[e+2]=o,i[e+3]=255}}}async function _n(e,t,n){const{fn:o,settings:r}=await async function(e,t){await bn(t.version);const n=F.create(t.seed).forkPositional(),o=G.fromJson({min_y:-64,height:384,size_horizontal:1,size_vertical:2,sampling:{xz_scale:1,y_scale:1,xz_factor:80,y_factor:160},bottom_slide:{target:.1171875,size:3,offset:0},top_slide:{target:-.078125,size:2,offset:8},terrain_shaper:{offset:.044,factor:4,jaggedness:0}}),r=H.fromJson(e);return{fn:r.mapAll(new J.Visitor(n,o)),settings:o}}(e,n),a=Array(n.width*r.height);let s=1/0,i=-1/0;for(let c=0;c<n.width;c+=1)for(let e=0;e<r.height;e+=1){const t=c+(r.height-e-1)*n.width,l=o.compute(H.context(c-n.offset,e,0));s=Math.min(s,l),i=Math.max(i,l),a[t]=l}const l=t.data;for(let c=0;c<n.width*r.height;c+=1){const e=Math.floor(R(a[c],s,i,0,256));l[4*c]=e,l[4*c+1]=e,l[4*c+2]=e,l[4*c+3]=255}}const yn=[["worldgen/noise",K],["worldgen/density_function",H]];async function bn(e){var t;const n=null!=(t=gn.get(e))?t:new W(new $("misode","temp"));gn.has(e)||(await Promise.all(yn.map((([t,o])=>async function(e,t,n,o){const r=await async function(e,t){console.debug(`[fetchAllPresets] ${e} ${t}`);const n=pe.versions.find((t=>t.id===e));await nt(n);try{const e=await st(`${tt(n,"registries")}/${t}/data.min.json`);return new Map(await Promise.all(e.map((async e=>[e,await st(`${tt(n,"data")}/data/minecraft/${t}/${e}.json`)]))))}catch(o){throw new Error(`Error occurred while fetching all ${t} presets: ${$e(o)}`)}}(e,n),a=new W($.create(n));for(const[s,i]of r.entries())a.register($.parse(s),o.fromJson(i));t.register(a.key,a)}(e,n,t,o)))),gn.set(e,n)),U.DENSITY_FUNCTION.clear().assign(n.getOrThrow($.create("worldgen/density_function"))),U.NOISE.clear().assign(n.getOrThrow($.create("worldgen/noise")))}function xn(e,t){return e[t]>0?0:e[t+1]>0?150:255}class kn{constructor(e,t,n,o){this.minX=e,this.done=[],this.chunks=[...Array(Math.ceil(t/16)+1)].map(((t,r)=>{const a=(e>>4)+r,s=vn.find((e=>e.pos[0]===a));return s?(this.done[r]=!0,s):new X(n,o,T.create(a,0))}))}generate(e,t){this.chunks.forEach(((n,o)=>{this.done[o]||(e.fill(n,!0),e.buildSurface(n,t),this.done[o]=!0,vn.push(n))}))}getBlockState(e){const t=(e[0]>>4)-(this.minX>>4);return this.chunks[t].getBlockState(e)}}const Cn=["biomes","temperature","humidity","continentalness","erosion","weirdness"],Mn=({model:e,data:t,shown:n,version:o})=>{var r;const{locale:a}=It(),[s,l]=v(2),[u,m]=v(void 0),[p,g]=v(new Set(["biomes"])),y=f([0,0]),b=f(1),x=f(void 0),k=BigInt(e.get(new h.Path(["generator","seed"]))),C=w((()=>{if(n)return function(e){if("string"!=typeof e){e=Y.fromJson(h.DataModel.unwrapLists(e)).legacyRandomSource?"minecraft:nether":"minecraft:overworld"}switch(e.replace(/^minecraft:/,"")){case"overworld":case"amplified":return{temperature:{firstOctave:-9,amplitudes:[1.5,0,1,0,0,0]},humidity:{firstOctave:-7,amplitudes:[1,1,0,0,0,0]},continentalness:{firstOctave:-9,amplitudes:[1,1,2,2,2,1,1,1,1]},erosion:{firstOctave:-9,amplitudes:[1,1,0,1,1]},weirdness:{firstOctave:-7,amplitudes:[1,2,1,0,0,0]},shift:{firstOctave:-3,amplitudes:[1,1,1,0]}};case"end":case"floating_islands":return{temperature:{firstOctave:0,amplitudes:[0]},humidity:{firstOctave:0,amplitudes:[0]},continentalness:{firstOctave:0,amplitudes:[0]},erosion:{firstOctave:0,amplitudes:[0]},weirdness:{firstOctave:0,amplitudes:[0]},shift:{firstOctave:0,amplitudes:[0]}};default:return{temperature:{firstOctave:-7,amplitudes:[1,1]},humidity:{firstOctave:-7,amplitudes:[1,1]},continentalness:{firstOctave:-7,amplitudes:[1,1]},erosion:{firstOctave:-7,amplitudes:[1,1]},weirdness:{firstOctave:-7,amplitudes:[1,1]},shift:{firstOctave:0,amplitudes:[0]}}}}(e.get(new h.Path(["generator","settings"])))}),[n]),M=n?function(e,t){return JSON.stringify([e,t])}(t,C):"",A=null==(r=t.type)?void 0:r.replace(/^minecraft:/,""),{canvas:I,redraw:z}=Ve({size:()=>[200/b.current,200/b.current],async draw(e){const n={octaves:C,biomeColors:{},layers:p,offset:y.current,scale:s,seed:k,res:b.current,version:o};await async function(e,t,n){var o,r,a;const{biomeSource:s}=await Ut(e,n),i=t.data,l=-Math.round(n.offset[0])-100+n.res/2,c=-Math.round(n.offset[1])-100+n.res/2,d=4*t.width/n.res,u=4/n.res,h=[l*n.scale,(200+l)*n.scale,n.res*n.scale],m=[c*n.scale,(200+c)*n.scale,n.res*n.scale],p=n.layers.has("biomes")?null==(o=s.getBiomes)?void 0:o.call(s,...h,64,65,1,...m):void 0,f=[...n.layers].filter((e=>"biomes"!==e)),v=0===f.length||null==(r=s.getClimates)?void 0:r.call(s,...h,64,65,1,...m);for(let g=0;g<200;g+=n.res)for(let e=0;e<200;e+=n.res){const t=e*d+g*u,o=g/n.res*200/n.res+e/n.res,r=(g+l)*n.scale,h=(e+c)*n.scale;let m=[50,50,50];if(n.layers.has("biomes"))m=Yt((null!=(a=null==p?void 0:p[o])?a:s.getBiome(r,64,h)).toString(),n.biomeColors);else if(v&&f[0]){const e=v[o][f[0]],[t,n]=Gt[f[0]],r=(e-t)/(n-t)*256;m=[r,r,r]}i[t]=m[0],i[t+1]=m[1],i[t+2]=m[2],i[t+3]=255}}(t,e,n),4===b.current&&(clearTimeout(x.current),x.current=setTimeout((()=>{b.current=1,z()}),150))},async onDrag(e,t){y.current[0]=y.current[0]+200*e,y.current[1]=y.current[1]+200*t,clearTimeout(x.current),b.current="multi_noise"===A?4:1,z()},async onHover(e,n){const r={octaves:C,biomeColors:{},layers:p,offset:y.current,scale:s,seed:k,res:1,version:o},a=await async function(e,t,n,o){var r;const{biomeSource:a}=await Ut(e,o),[s,l]=function([e,t],n){return[(e-n.offset[0]-100+n.res/2)*n.scale,(t-n.offset[1]-100+n.res/2)*n.scale]}([t,n],o);return i({biome:a.getBiome(s,64,l).toString()},null==(r=a.getClimate)?void 0:r.call(a,s,64,l))}(t,Math.floor(200*e),Math.floor(200*n),r);m(a)},onLeave(){m(void 0)}},[M,s,k,p]);c((()=>{n&&(b.current="multi_noise"===A?4:1,z())}),[M,s,k,p,n]);const j=e=>{y.current[0]=y.current[0]*s/e,y.current[1]=y.current[1]*s/e,l(e)};return d(_,null,d("div",{class:"controls preview-controls"},u&&d(me,{label:u.biome,class:"no-pointer"}),"multi_noise"===A&&d(He,{icon:"stack",tooltip:a("configure_layers")},Cn.map((e=>{const t=p.has(e);return d(me,{label:a(`layer.${e}`),active:t,tooltip:a(t?"enabled":"disabled"),onClick:t=>{g(new Set([e])),t.stopPropagation()}})}))),("multi_noise"===A||"checkerboard"===A)&&d(_,null,d(me,{icon:"dash",tooltip:a("zoom_out"),onClick:()=>j(1.5*s)}),d(me,{icon:"plus",tooltip:a("zoom_in"),onClick:()=>j(s/1.5)})),"multi_noise"===A&&d(me,{icon:"sync",tooltip:a("generate_new_seed"),onClick:()=>_e(e)})),(null==u?void 0:u.temperature)&&d("div",{class:"controls secondary-controls"},d(me,{class:"no-pointer",label:Object.entries(u).filter((([e])=>"biome"!==e)).map((([e,t])=>`${e[0].toUpperCase()}: ${t.toFixed(2)}`)).join(" ")})),d("canvas",{ref:I,width:"200",height:"200"}))};const An=({data:e,version:t,shown:n})=>{const{locale:o}=It(),[r,a]=v(4),[s,i]=v(we()),{canvas:l,redraw:u}=Ve({size:()=>[16*r,16*r],async draw(n){en(e,n,{seed:s,version:t,size:[16*r,128,16*r]})}}),h=JSON.stringify(e);return c((()=>{n&&u()}),[h,r,s,n]),d(_,null,d("div",{class:"controls preview-controls"},d(me,{icon:"dash",tooltip:o("zoom_out"),onClick:()=>a(Math.min(16,r+1))}),d(me,{icon:"plus",tooltip:o("zoom_in"),onClick:()=>a(Math.max(1,r-1))}),d(me,{icon:"sync",tooltip:o("generate_new_seed"),onClick:()=>i(we())})),d("canvas",{ref:l,width:"64",height:"64"}))},In=({data:e,shown:t,version:n})=>{var o,r;const{locale:a}=It(),[s,i]=v(we()),[l,u]=v(!1),[h,m]=v(void 0),p=f(0),g=f(void 0),w=JSON.stringify([e]),y=null!=(r=null==(o=null==e?void 0:e.noise)?void 0:o.height)?r:256,{canvas:b,redraw:x}=Ve({size:()=>[y,y],async draw(t){const o={offset:p.current,width:t.width,seed:s,version:n};await _n(e,t,o)},async onDrag(e){p.current+=e*y,x()},async onHover(t,n){var o,r;const a=Math.floor(t*y-p.current),s=y-Math.max(1,Math.ceil(n*y))+(null!=(r=null==(o=null==e?void 0:e.noise)?void 0:o.min_y)?r:0);m(`X=${a} Y=${s}`)},onLeave(){m(void 0)}},[w,s]);return c((()=>{g.current&&clearInterval(g.current),t&&(x(),l&&(g.current=setInterval((()=>{p.current-=8,x()}),100)))}),[w,s,t,l]),d(_,null,d("div",{class:"controls preview-controls"},h&&d(me,{label:h,class:"no-pointer"}),d(He,{icon:"gear",tooltip:a("terrain_settings")},d(me,{icon:l?"square_fill":"square",label:a("preview.auto_scroll"),onClick:()=>u(!l)})),d(me,{icon:"sync",tooltip:a("generate_new_seed"),onClick:()=>i(we())})),d("canvas",{ref:b,width:y,height:y}))},zn=({data:e,shown:t,version:n})=>{const{locale:o}=It(),[r,a]=v(we()),[s,i]=v(2),l=f([0,0]),u=JSON.stringify([e]),{canvas:m,redraw:p}=Ve({size:()=>[256,256],async draw(t){const o={offset:l.current,scale:s,seed:r,version:n};!function(e,t,n){const o=new L(n.seed),r=K.fromJson(h.DataModel.unwrapLists(e)),a=new S(o,r),s=-n.offset[0]-100,i=-n.offset[1]-100,l=t.data;for(let c=0;c<256;c+=1)for(let e=0;e<256;e+=1){const t=4*c+4*e*256,o=(c+s)*n.scale,r=(e+i)*n.scale,d=128*(a.sample(o,r,0)+1);l[t]=d,l[t+1]=d,l[t+2]=d,l[t+3]=255}}(e,t,o)},async onDrag(e,t){l.current[0]=l.current[0]+256*e,l.current[1]=l.current[1]+256*t,p()}},[u,s,r]);c((()=>{t&&p()}),[u,s,r,t]);const g=e=>{l.current[0]=l.current[0]*s/e,l.current[1]=l.current[1]*s/e,i(e)};return d(_,null,d("div",{class:"controls preview-controls"},d(me,{icon:"dash",tooltip:o("zoom_out"),onClick:()=>g(1.5*s)}),d(me,{icon:"plus",tooltip:o("zoom_in"),onClick:()=>g(s/1.5)}),d(me,{icon:"sync",tooltip:o("generate_new_seed"),onClick:()=>a(we())})),d("canvas",{ref:m,width:"256",height:"256"}))},jn=({data:e,shown:t,version:n})=>{var o,r;const{locale:a}=It(),[s,i]=v(we()),[l,u]=v("minecraft:plains"),[h,m]=v(.2),[p,g]=v(.1),[y,b]=v(!1),[x,k]=v(void 0),C=f(0),M=f(void 0),A=JSON.stringify([e,h,p]),I=null!=(r=null==(o=null==e?void 0:e.noise)?void 0:o.height)?r:256,{canvas:z,redraw:j}=Ve({size:()=>[I,I],async draw(t){const o={biome:l,biomeDepth:p,biomeScale:h,offset:C.current,width:t.width,seed:s,version:n};await wn(e,t,o)},async onDrag(e){C.current+=e*I,j()},async onHover(t,n){var o,r;const a=Math.floor(t*I-C.current),s=I-Math.max(1,Math.ceil(n*I))+(null!=(r=null==(o=null==e?void 0:e.noise)?void 0:o.min_y)?r:0),i=function(e,t){const n=vn.find((t=>T.minBlockX(t.pos)<=e&&T.maxBlockX(t.pos)>=e));if(n)return n.getBlockState(B.create(e,t,0))}(a,s);k(i?`Y=${s} (${i.getName().path})`:`Y=${s}`)},onLeave(){k(void 0)}},[A,s]);c((()=>{M.current&&clearInterval(M.current),t&&(async()=>{try{await j(),y&&(M.current=setInterval((()=>{C.current-=8,j()}),100))}catch(e){throw e}})()}),[A,s,t,l,h,p,y]);const E=w((()=>{var e;return null!=(e=null==mt?void 0:mt.get("worldgen/biome"))?e:[]}),[n]);return d(_,null,d("div",{class:"controls preview-controls"},x&&d(me,{label:x,class:"no-pointer"}),d(He,{icon:"gear",tooltip:a("terrain_settings")},vt(n,void 0,"1.17")?d(_,null,d(Pe,{label:a("preview.scale"),value:`${h}`,onChange:e=>m(Number(e))}),d(Pe,{label:a("preview.depth"),value:`${p}`,onChange:e=>g(Number(e))})):d(Pe,{label:a("preview.biome"),value:l,onChange:u,dataList:E,larger:!0}),d(me,{icon:y?"square_fill":"square",label:a("preview.auto_scroll"),onClick:()=>b(!y)})),d(me,{icon:"sync",tooltip:a("generate_new_seed"),onClick:()=>i(we())})),d("canvas",{ref:z,width:I,height:I}))},En=["dimension","worldgen/density_function","worldgen/noise","worldgen/noise_settings","worldgen/configured_feature","worldgen/placed_feature"];function $n({model:e,version:t,id:n,shown:o}){var r;const[,a]=v(0);if(Be(e,(()=>{a((e=>e+1))})),!e)return d(_,null);if("dimension"===n&&(null==(r=e.get(new h.Path(["generator","type"])))?void 0:r.endsWith("noise"))){const n=e.get(new h.Path(["generator","biome_source"]));if(n)return d(Mn,i({},{model:e,version:t,shown:o,data:n}))}if("worldgen/density_function"===n){const n=e.get(new h.Path([]));if(n)return d(In,i({},{model:e,version:t,shown:o,data:n}))}if("worldgen/noise"===n){const n=e.get(new h.Path([]));if(n)return d(zn,i({},{model:e,version:t,shown:o,data:n}))}if("worldgen/noise_settings"===n){const n=e.get(new h.Path([]));if(n)return d(jn,i({},{model:e,version:t,shown:o,data:n}))}if("worldgen/placed_feature"===n||"worldgen/configured_feature"===n&&vt(t,"1.16","1.17")){const n=e.get(new h.Path([]));if(n)return d(An,i({},{model:e,version:t,shown:o,data:n}))}return d(_,null)}function On(e,t){return e.schema.hook(Sn,new h.ModelPath(e),e.data,{blockStates:t})}const Sn={base:({},e,t)=>t,choice({switchNode:e},t,n,o){return e.hook(this,t,n,o)},list({children:e},t,n,o){if(!Array.isArray(n))return n;const r=n.map(((n,r)=>e.hook(this,t.push(r),n.node,o)));for(const a of Object.getOwnPropertySymbols(n))r[a]=n[a];return r},map({children:e,config:t},n,o,r){var a,s;if(void 0===o)return;const i="block_state_map"===(null==(a=t.validation)?void 0:a.validator)?null==(s=r.blockStates)?void 0:s[h.relativePath(n,t.validation.params.id).get()]:null,l={};Object.keys(o).forEach((t=>{var a;i&&!Object.keys(null!=(a=i.properties)?a:{}).includes(t)||(l[t]=e.hook(this,n.push(t),o[t],r))}));for(const c of Object.getOwnPropertySymbols(o))l[c]=o[c];return l},object({getActiveFields:e},t,n,o){if(null==n||"object"!=typeof n)return n;const r={},a=e(t);Object.keys(a).filter((e=>a[e].enabled(t))).forEach((e=>{const s=a[e].hook(this,t.push(e),n[e],o);null!=s&&(r[e]=s)}));for(const s of Object.getOwnPropertySymbols(n))r[s]=n[s];return r}},Ln={"2_spaces":2,"4_spaces":4,tabs:"\t",minified:void 0},Pn={json:{parse:te.parse,stringify:(e,t)=>te.stringify(e,null,t)+"\n"},yaml:{parse:ne.load,stringify:(e,t)=>ne.dump(e,{flowLevel:void 0===t?0:-1,indent:"string"==typeof t?4:t})}};function Dn({name:e,model:t,blockStates:n,doCopy:o,doDownload:r,doImport:a,copySuccess:s,onError:i}){const{locale:l}=It(),[u,m]=v(_t.getIndent()),[p,g]=v(_t.getFormat()),[w,y]=v(_t.getHighlighting()),b=f(null),x=f(),k=f(),C=f(),M=f(),I=A(((e,t)=>{const n=On(e,t);return Pn[p].stringify(n,Ln[u])}),[u,p]);c((()=>{x.current=()=>{if(t&&n)try{const e=I(t,n);M.current.setValue(e)}catch(e){e instanceof Error?(e.message=`Error getting JSON output: ${e.message}`,i(e)):i(`Error getting JSON output: ${$e(e)}`),console.error(e),M.current.setValue("")}},k.current=()=>{const e=M.current.getValue();if(0!==e.length)try{const n=Pn[p].parse(e);null==t||t.reset(h.DataModel.wrapLists(n),!1)}catch(n){n instanceof Error?(n.message=`Error importing: ${n.message}`,i(n)):i(`Error importing: ${$e(n)}`),console.error(n)}}}),[t,n,u,p,w]),c((()=>{if(w){const e=ee.edit("editor");e.setOptions({fontSize:14,showFoldWidgets:!1,highlightSelectedWord:!1}),e.$blockScrolling=1/0,e.on("blur",(e=>k.current(e))),e.getSession().setMode("ace/mode/json"),M.current={getValue:()=>e.getSession().getValue(),setValue(t){e.getSession().setValue(t)},configure(t,n){e.setOption("useSoftTabs","tabs"!==t),e.setOption("tabSize","tabs"===t?4:Ln[t]),e.getSession().setMode(`ace/mode/${n}`)},select(){e.selectAll()}}}else M.current={getValue:()=>C.current.value,setValue(e){C.current.value=e},configure(){},select(){}}}),[w]),Be(t,(()=>{x.current()})),c((()=>{t&&x.current()}),[t]),c((()=>{M.current.configure(u,p),x.current()}),[u,p,w]),c((()=>{o&&t&&n&&navigator.clipboard.writeText(I(t,n)).then((()=>{s()}))}),[o]),c((()=>{if(r&&t&&n&&b.current){const o=encodeURIComponent(I(t,n));b.current.setAttribute("href",`data:text/json;charset=utf-8,${o}`),b.current.setAttribute("download",`${e}.${p}`),b.current.click()}}),[r]),c((()=>{a&&M.current&&(M.current.setValue(""),M.current.select())}),[a]);return d(_,null,d("div",{class:"controls source-controls"},d(He,{icon:"gear",tooltip:l("output_settings"),"data-cy":"source-controls"},Object.entries(Ln).map((([e])=>d(me,{label:l(`indentation.${e}`),active:u===e,onClick:()=>{return t=e,_t.setIndent(t),void m(t);var t}}))),d("hr",null),Object.keys(Pn).map((e=>d(me,{label:l(`format.${e}`),active:p===e,onClick:()=>{return t=e,_t.setFormat(t),void g(t);var t}}))),d("hr",null),d(me,{icon:w?"square_fill":"square",label:l("highlighting"),onClick:()=>{return e=!w,_t.setHighlighting(e),void y(e);var e}}))),w?d("pre",{id:"editor",class:"source"}):d("textarea",{ref:C,class:"source",spellcheck:!1,autocorrect:"off",onBlur:k.current}),d("a",{ref:b,style:"display: none;"}))}class Vn extends h.DataModel{constructor(e,t,n,o){super(e),this.mapper=t,this.getter=n,this.setter=o}map(e){return this.mapper(e)}get(e){return this.getter(e)}set(e,t,n){return this.setter(e,t,n)}}const Nn=["loot_table.type","loot_entry.type","function.function","condition.condition","criterion.trigger","recipe.type","dimension.generator.type","dimension.generator.biome_source.type","dimension.generator.biome_source.preset","carver.type","feature.type","decorator.type","feature.tree.minimum_size.type","block_state_provider.type","trunk_placer.type","foliage_placer.type","tree_decorator.type","int_provider.type","float_provider.type","height_provider.type","structure_feature.type","surface_builder.type","processor.processor_type","rule_test.predicate_type","pos_rule_test.predicate_type","template_element.element_type","block_placer.type","block_predicate.type","material_rule.type","material_condition.type","structure_placement.type","density_function.type"],Tn=["number_provider.type","score_provider.type","nbt_provider.type","int_provider.type","float_provider.type","height_provider.type"],Bn=["feature.config","decorator.config","int_provider.value","float_provider.value","block_state_provider.simple_state_provider.state","block_state_provider.rotated_block_provider.state","block_state_provider.weighted_state_provider.entries.entry.data","rule_test.block_state","structure_feature.config","surface_builder.config","template_pool.elements.entry.element","decorator.block_survives_filter.state","material_rule.block.result_state"],Hn=["loot_entry.type","function.function","condition.condition","criterion.trigger","dimension.generator.type","dimension.generator.biome_source.type","feature.type","decorator.type","block_state_provider.type","feature.tree.minimum_size.type","trunk_placer.type","foliage_placer.type","tree_decorator.type","block_placer.type","rule_test.predicate_type","processor.processor_type","template_element.element_type","nbt_operation.op","number_provider.value","score_provider.name","score_provider.target","nbt_provider.source","nbt_provider.target","generator_biome.biome","block_predicate.type","material_rule.type","material_condition.type","density_function.type"],Rn=["function.set_nbt.tag","advancement.display.icon.nbt","text_component_object.nbt","entity.nbt","block.nbt","item.nbt"],Fn=["generator_biome.parameters.temperature","generator_biome.parameters.humidity","generator_biome.parameters.continentalness","generator_biome.parameters.erosion","generator_biome.parameters.depth","generator_biome.parameters.weirdness","feature.end_spike.crystal_beam_target","feature.end_gateway.exit","decorator.block_filter.offset","block_predicate.matching_blocks.offset","block_predicate.matching_fluids.offset","model_element.from","model_element.to","model_element.rotation.origin","model_element.faces.uv","item_transform.rotation","item_transform.translation","item_transform.scale","generator_structure.random_spread.locate_offset"],Gn=["noise_settings.surface_rule","noise_settings.noise.terrain_shaper"],Jn=["density_function.argument","density_function.argument1","density_function.argument2","density_function.input","density_function.when_in_range","density_function.when_out_of_range"],Wn=new h.DataModel(h.MapNode(h.StringNode(),h.StringNode()),{historyMax:0});function Un({model:e,lang:t,version:n,blockStates:o}){var r;const a=new h.ModelPath(e),[s,i,l]=e.schema.hook(Yn,a,Oe(e.data),t,n,o,{});return(null==(r=null==i?void 0:i.props)?void 0:r.children.some((e=>e)))?d("div",{class:`node ${e.schema.type(a)}-node`,"data-category":e.schema.category(a)},d("div",{class:"node-header"},s,i),d("div",{class:"node-body"},l)):l}const Yn={base:()=>[null,null,null],boolean:(e,t,n,o,r,a,s)=>[null,d(Xn,i({},l(i({},e),{path:t,value:n,lang:o,version:r,states:a,ctx:s}))),null],choice({choices:e,config:t,switchNode:n},o,r,a,s,i,l){const c=n.activeCase(o,!0),u=(null==t?void 0:t.context)?new h.ModelPath(o.getModel(),new h.Path(o.getArray(),[t.context])):o,[m,p,f]=c.node.hook(this,u,r,a,s,i,l);if(1===e.length)return[m,p,f];const v=(null==t?void 0:t.choiceContext)?new h.Path([],[t.choiceContext]):(null==t?void 0:t.context)?new h.Path([],[t.context]):o,g=d("select",{value:c.type,onChange:n=>(n=>{var a;const s=null!=(a=e.find((e=>e.type===n)))?a:c,i=s.node.default(),l=s.change?s.change(h.DataModel.unwrapLists(r)):"feature"===t.choiceContext&&"minecraft:decorated"===(null==i?void 0:i.type)?i.config.feature:i;o.model.set(o,h.DataModel.wrapLists(l))})(n.target.value)},e.map((e=>d("option",{value:e.type},oo(a,v.contextPush(e.type))))));return[m,d(_,null,g,p),f]},list({children:e,config:t},n,o,r,a,s,c){const{expand:u,collapse:m,isToggled:p}=Zn(),[f,g]=v(50),w=n.getContext().join(".");if(Fn.includes(w)){return[d(_,null,[...Array(t.maxLength)].map(((e,t)=>d(ro,{lang:r,path:n.modelPush(t)}))),d("div",{class:"fixed-list"})),d(_,null,[...Array(t.maxLength)].map(((t,i)=>{var l;return e.hook(this,n.modelPush(i),null==(l=null==o?void 0:o[i])?void 0:l.node,r,a,s,c)[1]}))),null]}return[null,d("button",{class:"add tooltipped tip-se","aria-label":Mt(r,"add_top"),onClick:()=>{Array.isArray(o)||(o=[]);const t=h.DataModel.wrapLists(e.default());n.model.set(n,[{node:t,id:ge()},...o])}},Re.plus_circle),d(_,null,o&&Array.isArray(o)&&o.map((({node:t,id:h},v)=>{if(v===f)return d("div",{class:"node node-header"},d("label",null,Mt(r,"entries_hidden",""+(o.length-f))),d("button",{onClick:()=>g(Math.min(f+50,o.length))},Mt(r,"entries_hidden.more","50")),d("button",{onClick:()=>g(o.length)},Mt(r,"entries_hidden.all")));if(v>f)return null;const w=n.push(v).contextPush("entry"),_="object"===e.type(w),y=p(h);if(_&&(!1===y||void 0===y&&o.length>20))return d("div",{class:"node node-header","data-category":e.category(w)},d(ro,{lang:r,path:w,nested:!0}),d("button",{class:"toggle tooltipped tip-se","aria-label":`${Mt(r,"expand")}\n${Mt(r,"expand_all","Ctrl")}`,onClick:u(h)},Re.chevron_right),d("label",null,oo(r,w,`${v}`)),d(qn,{key:h,path:w,value:t,schema:e}));return d(eo,l(i({key:h,path:w,schema:e,value:t},{lang:r,version:a,states:s,actions:[{icon:"duplicate",label:"duplicate",onSelect:()=>{const e=[...n.get()];e.splice(v,0,{id:ge(),node:Oe(t)}),n.model.set(n,e)}}]}),{ctx:l(i({},c),{index:(0===v?1:0)+(v===o.length-1?2:0)})}),_&&d("button",{class:"toggle tooltipped tip-se","aria-label":`${Mt(r,"collapse")}\n${Mt(r,"collapse_all","Ctrl")}`,onClick:m(h)},Re.chevron_down),d("button",{class:"remove tooltipped tip-se","aria-label":Mt(r,"remove"),onClick:()=>w.set(void 0)},Re.trashcan),o.length>1&&d("div",{class:"node-move"},d("button",{class:"move tooltipped tip-se","aria-label":Mt(r,"move_up"),onClick:()=>{const e=[...n.get()];[e[v-1],e[v]]=[e[v],e[v-1]],n.model.set(n,e)},disabled:0===v},Re.chevron_up),d("button",{class:"move tooltipped tip-se","aria-label":Mt(r,"move_down"),onClick:()=>{const e=[...n.get()];[e[v+1],e[v]]=[e[v],e[v+1]],n.model.set(n,e)},disabled:v===o.length-1},Re.chevron_down)))})),o&&o.length>0&&o.length<=f&&d("div",{class:"node node-header"},d("button",{class:"add tooltipped tip-se","aria-label":Mt(r,"add_bottom"),onClick:()=>{Array.isArray(o)||(o=[]);const t=h.DataModel.wrapLists(e.default());n.model.set(n,[...o,{node:t,id:ge()}])}},Re.plus_circle)))]},map({children:e,keys:t,config:n},o,r,a,s,c,u){var m,p,f,v,g;const{expand:w,collapse:y,isToggled:b}=Zn(),x=new h.ModelPath(Wn,new h.Path([no(o.toString())])),k="block_state_map"===(null==(m=n.validation)?void 0:m.validator)?null==c?void 0:c[h.relativePath(o,n.validation.params.id).get()]:null,C=(null==k?void 0:k.properties)?h.StringNode(null,{enum:Object.keys(null!=(p=k.properties)?p:{})}):t;if(k&&"Properties"===o.last()){"object"!=typeof r&&(r={});const e=Object.entries(null!=(f=k.properties)?f:{}).map((([e,t])=>[e,h.StringNode(null,{enum:t})]));return Object.entries(null!=(v=k.properties)?v:{}).forEach((([e,t])=>{"string"!=typeof r[e]?o.model.errors.add(o.push(e),"error.expected_string"):t.includes(r[e])||o.model.errors.add(o.push(e),"error.invalid_enum_option",r[e])})),h.ObjectNode(Object.fromEntries(e)).hook(this,o,r,a,s,c,u)}return[null,d(_,null,C.hook(this,x,null!=(g=x.get())?g:"",a,s,c,u)[1],d("button",{class:"add tooltipped tip-se","aria-label":Mt(a,"add"),onClick:()=>{const t=x.get();o.model.set(o.push(t),h.DataModel.wrapLists(e.default()))}},Re.plus_circle)),d(_,null,"object"==typeof r&&Object.entries(r).map((([t,n])=>{var m,p,f,v;const g=o.modelPush(t),_="object"===e.type(g),x=b(t);if(_&&(!1===x||void 0===x&&r.length>20))return d("div",{class:"node node-header","data-category":e.category(g)},d(ro,{lang:a,path:g,nested:!0}),d("button",{class:"toggle tooltipped tip-se","aria-label":`${Mt(a,"expand")}\n${Mt(a,"expand_all","Ctrl")}`,onClick:w(t)},Re.chevron_right),d("label",null,t),d(qn,{key:t,path:g,value:n,schema:e}));const C=k?h.StringNode(null,{enum:null!=(p=null==(m=k.properties)?void 0:m[t])?p:[]}):e;(null==(f=null==k?void 0:k.properties)?void 0:f[t])&&"string"==typeof n&&!(null==(v=k.properties)?void 0:v[t].includes(n))&&o.model.errors.add(g,"error.invalid_enum_option",n);return d(eo,l(i({key:t,schema:C,path:g,value:n},{lang:a,version:s,states:c,ctx:u}),{label:t}),_&&d("button",{class:"toggle tooltipped tip-se","aria-label":`${Mt(a,"collapse")}\n${Mt(a,"collapse_all","Ctrl")}`,onClick:y(t)},Re.chevron_down),d("button",{class:"remove tooltipped tip-se","aria-label":Mt(a,"remove"),onClick:()=>g.set(void 0)},Re.trashcan))})))]},number:(e,t,n,o,r,a,s)=>[null,d(Kn,i({},l(i({},e),{path:t,value:n,lang:o,version:r,states:a,ctx:s}))),null],object({node:e,config:t,getActiveFields:n,getChildModelPath:o},r,a,s,c,u,m){var p;const{expand:f,collapse:v,isToggled:g}=Zn();if(0==r.getArray().length&&function(e,t){var n;return"feature"===e&&"decorated"===(null==(n=null==t?void 0:t.type)?void 0:n.replace(/^minecraft:/,""))&&fe(null==t?void 0:t.config)}(t.context,a)){const{wrapper:e,fields:t}=function(e,t,n){const o=[],r=io(n,o),a={type:e.type,config:h.ObjectNode({decorators:h.ListNode(ut),feature:ht},{context:"feature.decorated"})},s=h.ObjectNode(a,{context:"feature"}),i=new h.Path(["config","feature"]),l=new h.Path(["config","decorators"]),c=t.getModel(),d=new Vn(s,(e=>{if(e.startsWith(i))return new h.Path([...[...Array(o.length-1)].flatMap((()=>["config","feature"])),...e.modelArr]);if(e.startsWith(l)){if(2===e.modelArr.length)return new h.Path([]);const t=e.modelArr[2];if("number"==typeof t)return new h.Path([...[...Array(t)].flatMap((()=>["config","feature"])),"config","decorator",...e.modelArr.slice(3)])}return e}),(e=>{if(e.equals(l)){const e=[];return io(c.data,e),e}return c.get(d.map(e))}),((e,t,n)=>{if(e.startsWith(i)){const o=[];io(c.data,o);const r=new h.Path([...[...Array(o.length-1)].flatMap((()=>["config","feature"])),...e.modelArr]);return c.set(r,t,n)}if(e.startsWith(l)){const o=e.modelArr[2];if(2===e.modelArr.length){const e=d.get(i);return c.set(new h.Path,lo(e,t),n)}if("number"==typeof o){if(3===e.modelArr.length&&void 0===t){const e=d.get(i),t=[];io(c.data,t),t.splice(o,1);const r=lo(e,t);return c.set(new h.Path,r,n)}{const r=new h.Path([...[...Array(o)].flatMap((()=>["config","feature"])),"config","decorator",...e.modelArr.slice(3)]);return c.set(r,t,n)}}}c.set(e,t,n)}));return d.data={type:c.data.type,config:{decorators:o,feature:r}},d.errors=c.errors,{fields:a,wrapper:d}}(n(r),r,a);a=e.data,n=()=>t,o=(t,n)=>new h.ModelPath(e,new h.Path(t.getArray(),["feature"])).push(n)}let w=null,y=null;if(e.optional())if(void 0===a){const t=()=>r.set(h.DataModel.wrapLists(e.default()));y=d("button",{class:"collapse closed tooltipped tip-se","aria-label":Mt(s,"expand"),onClick:t},Re.plus_circle)}else{const e=()=>r.set(void 0);y=d("button",{class:"collapse open tooltipped tip-se","aria-label":Mt(s,"remove"),onClick:e},Re.trashcan)}const b=r.getContext().join(".");if(Jn.includes(b)||Gn.includes(b)){const e=g(""),t=Gn.includes(b)?e:!e;if(w=d(_,null,d("button",{class:"toggle tooltipped tip-se","aria-label":Mt(s,t?"collapse":"expand"),onClick:e?v(""):f("")},t?Re.chevron_down:Re.chevron_right)),!t)return[w,y,null]}const x="object"==typeof a&&null!==a&&(null==(p=e.default())?void 0:p.pools)?l(i({},m),{loot:null==a?void 0:a.type}):m,k=d(_,null,"object"==typeof a&&null!==a&&!(e.optional()&&void 0===a)&&Object.entries(n(r)).filter((([e,t])=>t.enabled(r))).map((([e,t])=>{const n=o(r,e),l=n.getContext().join(".");if(Tn.includes(l))return null;const[h,m,p]=t.hook(this,n,a[e],s,c,u,x),f="object"===t.type(n)&&Bn.includes(l),v=Hn.includes(l);return f||v?(w=d(_,null,w,d(ro,{lang:s,path:n}),d(ao,{lang:s,path:n}),h),y=d(_,null,y,m),f?p:null):d(eo,i({key:e,schema:t,path:n,value:a[e]},{lang:s,version:c,states:u,ctx:x}))})));return[w,y,k]},string:(e,t,n,o,r,a,s)=>[null,d(Qn,i({},l(i({},e),{path:t,value:n,lang:o,version:r,states:a,ctx:s}))),null]};function qn({path:e,value:t}){var n,o,r,a,s;switch(e.getContext().join(".")){case"loot_table.pools.entry":return d("label",null,null!=(o=null==(n=null==t?void 0:t.entries)?void 0:n.length)?o:0," entries");case"function.set_contents.entries.entry":case"loot_pool.entries.entry":return d("label",null,null!=(s=null==(r=null==t?void 0:t.name)?void 0:r.replace(/^minecraft:/,""))?s:null==(a=null==t?void 0:t.type)?void 0:a.replace(/^minecraft:/,""))}for(const i of Object.values(null!=t?t:{}))if("string"==typeof i)return d("label",null,i.replace(/^minecraft:/,""));return null}function Zn(){const[e,t]=v(new Map),[n,o]=v(void 0);return{expand:e=>n=>{n.ctrlKey?(t(new Map),o(!0)):t((t=>new Map(t.set(e,!0))))},collapse:e=>n=>{n.ctrlKey?(t(new Map),o(!1)):t((t=>new Map(t.set(e,!1))))},isToggled:t=>{var o;return e instanceof Map&&(null!=(o=e.get(t))?o:n)}}}function Xn({path:e,node:t,value:n,lang:o}){const r=o=>{e.model.set(e,t.optional()&&n===o?void 0:o)};return d(_,null,d("button",{class:!1===n?"selected":"",onClick:()=>r(!1)},Mt(o,"false")),d("button",{class:!0===n?"selected":"",onClick:()=>r(!0)},Mt(o,"true")))}function Kn({path:e,config:t,integer:n,value:o,lang:r}){var a;const s=t=>{const o=t.target.value,r=n?parseInt(o):parseFloat(o);e.model.set(e,r)};return d(_,null,d("input",{type:"text",value:null!=o?o:"",onBlur:s,onKeyDown:e=>{"Enter"===e.key&&s(e)}}),(null==t?void 0:t.color)&&d("input",{type:"color",value:"#"+(null!=(a=null==o?void 0:o.toString(16).padStart(6,"0"))?a:"000000"),onChange:t=>{const n=t.target.value,o=parseInt(n.slice(1),16);e.model.set(e,o)}}),["dimension.generator.seed","dimension.generator.biome_source.seed","world_settings.seed"].includes(e.getContext().join("."))&&d("button",{onClick:()=>_e(e.model),class:"tooltipped tip-se","aria-label":Mt(r,"generate_new_seed")},Re.sync))}function Qn({path:e,getValues:t,config:n,node:o,value:r,lang:a,version:s,states:i}){var l;const c=t=>{t.stopPropagation();const n=t.target.value;n!==r&&e.model.set(e,0===n.length?void 0:n)},u=t(),m=e.getContext().join("."),p=to(n)||"resource"!==(null==n?void 0:n.validator)||"string"!=typeof n.params.pool?void 0:n.params.pool;if(Rn.includes(m))return d("textarea",{value:null!=r?r:"",onBlur:c});if(to(n)&&!n.additional||Nn.includes(m)){let t=new h.Path([]);return to(n)&&"string"==typeof n.enum?t=t.contextPush(n.enum):p?t=t.contextPush(p):to(n)&&(t=e),d("select",{value:null!=r?r:"",onChange:c},o.optional()&&d("option",{value:""},Mt(a,"unset")),u.map((e=>d("option",{value:e},oo(a,t.contextPush(e.replace(/^minecraft:/,"")))))))}if(to(n)||"block_state_key"!==(null==n?void 0:n.validator)){const e=ge(),t=p?(e=>pe.generators.find((t=>t.id===e.replace(/^\$/,""))))(p):void 0;return d(_,null,d("input",{value:null!=r?r:"",onBlur:c,onKeyDown:e=>{"Enter"===e.key&&c(e)},list:u.length>0?e:""}),u.length>0&&d("datalist",{id:e},u.map((e=>d("option",{value:e})))),t&&u.includes(r)&&r.startsWith("minecraft:")&&d("a",{href:`/${t.url}/?version=${s}&preset=${r.replace(/^minecraft:/,"")}`,class:"tooltipped tip-se","aria-label":Mt(a,"follow_reference")},Re.link_external))}{const t=null==i?void 0:i[h.relativePath(e,n.params.id).get()],o=Object.keys(null!=(l=null==t?void 0:t.properties)?l:{});return d("select",{value:null!=r?r:"",onChange:c},o.map((e=>d("option",null,e))))}}const eo=oe((function({label:e,schema:t,path:n,value:o,lang:r,version:a,states:s,ctx:c,actions:u,children:h}){var m;const p=t.type(n),f=t.category(n),v=n.getContext().join("."),[g,w]=Ne(),_=l(i({},c),{depth:(null!=(m=c.depth)?m:0)+1});delete _.index;const[y,b,x]=t.hook(Yn,n,o,r,a,s,_);return d("div",{class:`node ${p}-node`,"data-category":f},d("div",{class:"node-header",onContextMenu:e=>{e.preventDefault(),w()}},d(ro,{lang:r,path:n}),d(ao,{lang:r,path:n}),h,y,d("label",null,null!=e?e:oo(r,n,`${n.last()}`),g&&d("div",{class:"node-menu"},null==u?void 0:u.map((e=>{var t;return d("div",{key:e.label,class:"menu-item"},d(me,{icon:e.icon,tooltip:Mt(r,e.label),tooltipLoc:"se",onClick:()=>e.onSelect()}),d("span",null,null!=(t=e.description)?t:Mt(r,e.label)))})),d("div",{class:"menu-item"},d(me,{icon:"clippy",tooltip:Mt(r,"copy_context"),tooltipLoc:"se",onClick:()=>navigator.clipboard.writeText(v)}),d("span",null,v)))),b),x&&d("div",{class:"node-body"},x))}),((e,t)=>e.schema===t.schema&&e.lang===t.lang&&e.path.equals(t.path)&&Se(e.ctx,t.ctx)&&Se(e.value,t.value)));function to(e){return!!(null==e?void 0:e.enum)}function no(e){var t,n=0;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n}function oo(e,t,...n){const o=t.getContext();for(let r=0;r<o.length;r+=1){const t=o.slice(r).join("."),a=Mt(e,t,...n);if(t!==a)return a}return o[o.length-1]}function ro({lang:e,path:t,nested:n}){var o;t.model instanceof Vn&&(t=t.model.map(t).withModel(t.model));const r=n?t.model.errors.getAll().filter((e=>e.path.startsWith(t))):t.model.errors.get(t,!0);if(0===r.length)return null;const a=Mt(e,r[0].error,...null!=(o=r[0].params)?o:[]);return so("node-error","issue_opened",a)}function ao({lang:e,path:t}){const n=t.contextPush("help").getContext().join("."),o=Mt(e,n);return o===n?null:so("node-help","info",o)}const so=(e,t,n)=>{const[o,r]=Ne();return d("div",{class:`node-icon ${e}${o?" show":""}`,onClick:r},Re[t],d("span",{class:"icon-popup"},n))};function io(e,t){var n,o;return"decorated"!==(null==(n=null==e?void 0:e.type)?void 0:n.replace(/^minecraft:/,""))?e:fe(null==e?void 0:e.config)?(t.push({id:t.length,node:e.config.decorator}),io(null!=(o=e.config.feature)?o:"",t)):e}function lo(e,t){return 0===t.length?e:{type:"minecraft:decorated",config:{decorator:t.shift().node,feature:lo(e,t)}}}function co({version:e,model:t,blockStates:n,onError:o}){const{lang:r}=It();if(!t||!n||"none"===r)return d(_,null);const[a]=re((e=>{o(`Error rendering the tree: ${e.message}`),console.error(e)}));if(a)return d(_,null);const[,s]=v(0);return Be(t,(()=>{s((e=>e+1))})),d("div",{class:"tree","data-cy":"tree"},d(Un,i({},{model:t,lang:r,version:e,blockStates:n})))}function uo({term:e}){const{actualTheme:t}=Pt(),n="light"===t?"-burn":"",o=`https://${location.host}/assets/giscus${n}.css`;return d(ae,{repo:"misode/misode.github.io",repoId:"MDEwOlJlcG9zaXRvcnkxOTIyNTQyMzA=",category:"Site",categoryId:"DIC_kwDOC3WRFs4COB8r",mapping:e?"specific":"pathname",term:e,reactionsEnabled:"1",emitMetadata:"0",inputPosition:"top",theme:o,lang:"en"})}const ho={system:"device_desktop",dark:"moon",light:"sun"};function mo(){const{lang:e,locale:t,changeLanguage:n}=It(),{theme:o,changeTheme:r}=Pt(),{version:a}=Ht(),{title:s}=Nt(),i=ke(m());return d("header",null,d("div",{class:"title"},d(se,{class:"home-link",href:"/","aria-label":t("home"),"data-cy":"home-link"},po.home),d("h1",null,s),i&&d(He,{icon:"chevron_down",tooltip:t("switch_generator"),"data-cy":"generator-switcher"},pe.generators.filter((e=>e.category===(null==i?void 0:i.category)&&vt(a,e.minVersion))).map((e=>d(me,{label:t(e.id),active:e.id===i.id,onClick:()=>p(be(e.url))}))))),d("nav",null,d("ul",null,d("li",{"data-cy":"language-switcher"},d(He,{icon:"globe",tooltip:t("language")},pe.languages.map((({code:t,name:o})=>d(me,{label:o,active:t===e,onClick:()=>n(t)}))))),d("li",{"data-cy":"theme-switcher"},d(He,{icon:ho[o],tooltip:t("theme")},Object.entries(ho).map((([e,n])=>d(me,{icon:n,label:t(`theme.${e}`),active:e===o,onClick:()=>r(e)}))))),d("li",{class:"dimmed"},d("a",{href:"https://github.com/misode/misode.github.io",target:"_blank",rel:"noreferrer",class:"tooltipped tip-sw","aria-label":t("github")},Re.mark_github)))))}const po={home:d("svg",{width:"32",height:"28",viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d("rect",{width:"26",height:"6",rx:"3",fill:"#7CB45C"}),d("rect",{x:"8",width:"18",height:"6",rx:"3",fill:"#4BA041"}),d("rect",{y:"11",width:"32",height:"6",rx:"3",fill:"#AAA8A8"}),d("rect",{x:"11",y:"11",width:"21",height:"6",rx:"3",fill:"#91908F"}),d("rect",{x:"11",y:"22",width:"21",height:"6",rx:"3",fill:"#70B5C3"}),d("rect",{x:"17",y:"22",width:"15",height:"6",rx:"3",fill:"#4D989B"})),report:d("svg",{width:"30",height:"36",viewBox:"0 0 30 36",xmlns:"http://www.w3.org/2000/svg"},d("path",{d:"M0 16C0 13.7909 1.79086 12 4 12V12C6.20914 12 8 13.7909 8 16V32C8 34.2091 6.20914 36 4 36V36C1.79086 36 0 34.2091 0 32V16Z",fill:"#6ACC5D"}),d("path",{d:"M11 4C11 1.79086 12.7909 0 15 0V0C17.2091 0 19 1.79086 19 4V32C19 34.2091 17.2091 36 15 36V36C12.7909 36 11 34.2091 11 32V4Z",fill:"#FF4C4C"}),d("path",{d:"M22 10C22 7.79086 23.7909 6 26 6V6C28.2091 6 30 7.79086 30 10V32C30 34.2091 28.2091 36 26 36V36C23.7909 36 22 34.2091 22 32V10Z",fill:"#E5B442"}),d("path",{d:"M0 23C0 20.7909 1.79086 19 4 19V19C6.20914 19 8 20.7909 8 23V32C8 34.2091 6.20914 36 4 36V36C1.79086 36 0 34.2091 0 32V23Z",fill:"#2BAD1D"}),d("path",{d:"M11 15C11 12.7909 12.7909 11 15 11V11C17.2091 11 19 12.7909 19 15V32C19 34.2091 17.2091 36 15 36V36C12.7909 36 11 34.2091 11 32V15Z",fill:"#C10B0B"}),d("path",{d:"M22 19C22 16.7909 23.7909 15 26 15V15C28.2091 15 30 16.7909 30 19V32C30 34.2091 28.2091 36 26 36V36C23.7909 36 22 34.2091 22 32V19Z",fill:"#CC8E00"})),sounds:d("svg",{width:"20",height:"20",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},d("circle",{cx:"10",cy:"10",r:"10",fill:"#451475"}),d("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.5 10C3.5 8.27609 4.18482 6.62279 5.40381 5.40381C6.62279 4.18482 8.27609 3.5 10 3.5C11.7239 3.5 13.3772 4.18482 14.5962 5.40381C15.8152 6.62279 16.5 8.27609 16.5 10C16.5 11.7239 15.8152 13.3772 14.5962 14.5962C13.3772 15.8152 11.7239 16.5 10 16.5C8.27609 16.5 6.62279 15.8152 5.40381 14.5962C4.18482 13.3772 3.5 11.7239 3.5 10V10ZM10 2C7.87827 2 5.84344 2.84285 4.34315 4.34315C2.84285 5.84344 2 7.87827 2 10C2 12.1217 2.84285 14.1566 4.34315 15.6569C5.84344 17.1571 7.87827 18 10 18C12.1217 18 14.1566 17.1571 15.6569 15.6569C17.1571 14.1566 18 12.1217 18 10C18 7.87827 17.1571 5.84344 15.6569 4.34315C14.1566 2.84285 12.1217 2 10 2V2ZM8.379 7.227C8.34101 7.20412 8.29762 7.19175 8.25327 7.19117C8.20892 7.19059 8.16522 7.20181 8.12664 7.2237C8.08807 7.24558 8.05601 7.27733 8.03375 7.3157C8.0115 7.35406 7.99985 7.39765 8 7.442V12.559C8.00003 12.6033 8.0118 12.6467 8.03413 12.685C8.05646 12.7232 8.08854 12.7548 8.12708 12.7765C8.16563 12.7983 8.20926 12.8095 8.25352 12.8088C8.29778 12.8082 8.34108 12.7958 8.379 12.773L12.643 10.214C12.6798 10.1917 12.7103 10.1604 12.7315 10.1229C12.7526 10.0854 12.7638 10.043 12.7638 10C12.7638 9.95695 12.7526 9.91463 12.7315 9.87714C12.7103 9.83965 12.6798 9.80825 12.643 9.786L8.379 7.227Z",fill:"#C5A5E6"}))};function fo({sounds:e,sound:t,delay:n,pitch:o,volume:r,onEdit:a,onDelete:s,delayedPlay:i}){const{locale:l}=It(),{version:u}=Ht(),[h,m]=v(!0),[p,g]=v(!1),[w,_]=v(!1),y=f([]),b=`playsound minecraft:${t} master @s ~ ~ ~ ${r} ${o}`;c((()=>{var n,a,s;const i=e[t];_(0===(null!=(a=null==(n=null==i?void 0:i.sounds)?void 0:n.length)?a:0)),y.current.forEach((e=>e.stop())),y.current=(null!=(s=null==i?void 0:i.sounds)?s:[]).map((e=>{const t="string"==typeof e?e:e.name,n=(a=u,s=t,`${tt(pe.versions.find((e=>e.id===a)),"assets")}/assets/minecraft/sounds/${s}.ogg`);var a,s;const i=new ie.Howl({src:[n],format:["ogg"],volume:r,rate:o});i.on("end",(()=>{g(!1)}));const l=()=>{h&&y.current.every((e=>"loaded"===e.state()))&&m(!1)};return"loaded"===i.state()?setTimeout((()=>l())):i.on("load",(()=>{l()})),i})),m(!0)}),[t,e]),c((()=>{y.current.forEach((e=>e.rate(o)))}),[o]),c((()=>{y.current.forEach((e=>e.volume(r)))}),[r]);const x=()=>{if(h||w)return;k();const e=Math.floor(Math.random()*y.current.length);y.current[e].play(),g(!0)},k=()=>{y.current.forEach((e=>e.stop()))};c((()=>{i&&setTimeout((()=>x()),50*n)}),[i]),c((()=>()=>k()),[]);const[C,M]=v(!1),A=f(void 0);return d("div",{class:`sound-config${h?" loading":p?" playing":""}${w?" invalid":""}`},d(me,{class:"play",icon:w?"alert":h?"sync":"play",label:l("sounds.play"),onClick:x,tooltip:l(w?"sounds.unknown_sound":h?"sounds.loading_sound":"sounds.play_sound"),tooltipLoc:"se"}),d(We,{class:"btn btn-input sound",list:"sound-list",spellcheck:!1,value:t,onChange:e=>a({sound:e})}),d("label",{class:"delay-label"},l("sounds.delay"),": "),d(Ue,{class:"btn btn-input delay",min:0,value:n,onChange:e=>a({delay:e})}),d("label",{class:"pitch-label"},l("sounds.pitch"),": "),d(Ye,{class:"pitch tooltipped tip-s",min:.5,max:2,step:.01,"aria-label":o.toFixed(2),style:`--x: ${100/1.5*(o-.5)}%`,value:o,onChange:e=>a({pitch:e})}),d("label",{class:"volume-label"},l("sounds.volume"),": "),d(Ye,{class:"volume tooltipped tip-s",min:0,max:1,step:.01,"aria-label":r.toFixed(2),style:`--x: ${100*r}%`,value:r,onChange:e=>a({volume:e})}),d(me,{class:"copy"+(C?" active":""),icon:C?"check":"terminal",label:l("copy"),tooltip:l(C?"copied":"sounds.copy_command"),onClick:()=>{navigator.clipboard.writeText(b),M(!0),void 0!==A.current&&clearTimeout(A.current),A.current=setTimeout((()=>{M(!1)}),2e3)}}),d(me,{class:"remove",icon:"trashcan",tooltip:l("sounds.remove_sound"),onClick:()=>{s(),k()}}))}function vo({title:e,desc:t,link:n,icon:o,children:r}){const a=d(_,null,d("div",{class:"tool-head"},o&&po[o],d("div",null,d("h3",null,e),d("p",null,t))),r&&d("div",{class:"tool-body"},r));return n?d("a",{class:"tool-card",href:n},a):d("div",{class:"tool-card"},a)}function go({entries:e,onSelect:t,indent:n}){const o=w((()=>{var t;const n={};for(const o of e){const e=o.indexOf("/");if(e>=0){const r=o.slice(0,e);(null!=(t=n[r])?t:n[r]=[]).push(o.slice(e+1))}}return Object.entries(n)}),e),r=w((()=>e.filter((e=>!e.includes("/")))),e),[a,s]=v(new Set);return d("div",{class:"tree-view",style:`--indent: ${null!=n?n:0};`},o.map((([e,o])=>d("div",null,d(wo,{icon:a.has(e)?"chevron_right":"chevron_down",key:e,label:e,onClick:()=>{return t=e,a.has(t)?a.delete(t):a.add(t),void s(new Set(a));var t}}),!a.has(e)&&d(go,{entries:o,onSelect:n=>t(`${e}/${n}`),indent:(null!=n?n:0)+1})))),r.map((e=>d(wo,{icon:"file",key:e,label:e,onClick:()=>t(e)}))))}function wo({icon:e,label:t,onClick:n}){return d("div",{class:"entry",onClick:n},Re[e],t)}function _o({change:e,activeTags:t,toggleTag:n}){return d("div",{class:"changelog-entry"},d("div",{class:"changelog-version"},d(yo,i({},e.version)),d(yo,i({},e.group))),d("div",{class:"changelog-tags"},e.tags.map((e=>d(bo,{label:e,onClick:n?()=>n(e):void 0,active:null==t?void 0:t.includes(e)})))),d("div",{class:"changelog-content",dangerouslySetInnerHTML:{__html:le(e.content)}}))}function yo({id:e,article:t}){return null===t?d("span",null,e):d("a",{href:`https://www.minecraft.net/en-us/article/${t}`,target:"_blank"},e)}function bo({label:e,active:t,onClick:n}){const o="breaking"===e?5:ye(e)%360;return d("div",{class:`changelog-tag${t?" active":""}${n?" clickable":""}`,style:`--tint: ${o}`,onClick:n},"breaking"===e&&Re.alert,e)}function xo({changes:e,defaultOrder:t}){const{locale:n}=It(),[o,r]=v(""),[a,s]=v([]),i=e=>{a.includes(e)?s(a.filter((t=>t!==e))):s([...a,e])},l=w((()=>{const t=o.split(" ").map((e=>e.trim().toLowerCase())).filter((e=>e.length>0));return 0===t.length&&0===a.length?e:null==e?void 0:e.filter((e=>{if(!a.every((t=>e.tags.includes(t))))return!1;const n=e.tags.join(" ")+" "+e.content.toLowerCase();return t.every((e=>e.startsWith("!")?1===e.length||!n.includes(e.slice(1)):n.includes(e)))}))}),[e,o,a]),[c,u]=v("desc"===t),h=w((()=>null==l?void 0:l.sort(((e,t)=>c?t.order-e.order:e.order-t.order))),[l,c]);return d(_,null,d("div",{class:"changelog-query"},d(We,{class:"btn btn-input changelog-search",list:"sound-list",placeholder:n("changelog.search"),value:o,onChange:r}),d(me,{icon:c?"sort_desc":"sort_asc",label:c?"Newest first":"Oldest first",onClick:()=>u(!c)})),a.length>0&&d("div",{class:"changelog-tags"},a.map((e=>d(bo,{label:e,onClick:()=>s(a.filter((t=>t!==e)))})))),d("div",{class:"changelog-list"},void 0===h?d("span",null,n("loading")):0===h.length?d("span",null,n("changelog.no_results")):h.map((e=>d(_o,{change:e,activeTags:a,toggleTag:i})))))}function ko({version:e}){const{locale:t}=It(),[n,o]=v("changelog"),[r,a]=v(void 0);c((()=>{Ke().then((e=>a(e.map((e=>l(i({},e),{tags:e.tags.filter((t=>t!==e.group.id))})))))).catch((e=>console.error(e)))}),[]);const s=w((()=>null==r?void 0:r.filter((t=>t.version.id===e.id||t.group.id===e.id))),[e.id,r]);return d(_,null,d("div",{class:"version-detail"},d("h2",null,e.name),d("div",{class:"version-info"},d(Io,{label:t("versions.released"),value:Co(e)}),d(Io,{label:t("versions.release_target"),value:e.release_target,link:e.id!==e.release_target?`/versions/?id=${e.release_target}`:void 0}),d(Io,{label:t("versions.data_version"),value:e.data_version}),d(Io,{label:t("versions.protocol_version"),value:e.protocol_version}),d(Io,{label:t("versions.data_pack_format"),value:e.data_pack_version}),d(Io,{label:t("versions.resource_pack_format"),value:e.resource_pack_version})),d("div",{class:"version-tabs"},d("span",{class:"changelog"===n?"selected":"",onClick:()=>o("changelog")},t("versions.technical_changes")),d("span",{class:"discussion"===n?"selected":"",onClick:()=>o("discussion")},t("versions.discussion"))),d("div",{class:"version-tab"},"changelog"===n&&d(xo,{changes:s,defaultOrder:"asc"}),"discussion"===n&&d(uo,{term:`version/${e.id}`}))))}function Co(e){return new Date(e.release_time).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"})}function Mo({version:e,link:t}){const{locale:n}=It();return d("a",{class:"version-entry",href:t},d("span",{class:"version-id"},e.id),d(Io,{label:n("versions.released"),value:Co(e),compact:!0}),d(Io,{label:n("versions.data_version"),value:e.data_version,optional:!0}),d(Io,{label:n("versions.pack_format"),value:e.data_pack_version,optional:!0}))}function Ao({versions:e,link:t}){const{locale:n}=It(),[o,r]=v(!0),[a,s]=v(""),i=w((()=>e.filter((e=>!("snapshot"===e.type&&!o)&&e.id.includes(a)))),[e,o,a]);return d(_,null,d("div",{class:"versions-controls"},d(We,{class:"btn btn-input version-search",list:"sound-list",placeholder:n("versions.search"),value:a,onChange:s}),d(Ge,{label:"Include snapshots",value:o,onChange:r})),d("div",{class:"version-list"},i.map((e=>d(Mo,{version:e,link:null==t?void 0:t(e.id)}))),0===i.length&&d("span",null,n("versions.no_results"))))}function Io({label:e,value:t,link:n,compact:o,optional:r}){return d("div",{class:"version-metadata"+(r?" version-metadata-hide":"")},d("span",{class:o?"version-metadata-hide":void 0},e,": "),d("span",{class:"version-metadata-value"},t),n&&d("a",{href:n,class:"version-metadata-link"},Re.link_external))}function zo({category:e}){const{locale:t}=It();return Nt(t("title.generator_category",t(e))),d("main",null,d("div",{class:"category"},pe.generators.filter((t=>t.category===e)).map((e=>d(vo,{title:t(e.id),link:be(e.url)})))))}function jo({}){const{locale:e}=It(),[t,n]=v(null);Nt(e("title.changelog"));const[o,r]=v([]);return c((()=>{Ke().then((e=>r(e))).catch((e=>{console.error(e),n(e)}))}),[]),d("main",null,d(he,{type:"text",id:"changelog"}),t&&d(Fe,{error:t,onDismiss:()=>n(null)}),d("div",{class:"changelog"},d(xo,{changes:o,defaultOrder:"desc"})))}function Eo({}){var e;const{locale:t}=It(),{version:n,changeVersion:o}=Ht(),{project:r,file:a,updateFile:s,openFile:u,closeFile:f}=$t(),[g,w]=v(null),[y,b]=re();if(y)return y.message=`Something went wrong rendering the generator: ${y.message}`,d("main",null,d(Fe,{error:y,onDismiss:b}));const x=ke(m());if(!x)return d("main",null,d(Fe,{error:`Cannot find generator "${m()}"`}));const k=pe.versions.filter((e=>vt(e.id,x.minVersion,x.maxVersion))).map((e=>e.id));Nt(t("title.generator",t(x.id)),k),vt(n,x.minVersion)||w(`The minimum version for this generator is ${x.minVersion}`),vt(n,void 0,x.maxVersion)||w(`This generator is not available in versions above ${x.maxVersion}`);const C=Ce(m()).get("preset");c((()=>{M&&C&&R(C).then((e=>{null==M||M.reset(h.DataModel.wrapLists(e),!1),Me({version:n,preset:C})}))}),[C]);const[M,A]=v(null),[I,z]=v(null);c((()=>{w(null),A(null),async function(e){return(await ft(e)).blockStates}(n).then((e=>z(e))),async function(e,t){var n;if(!ct[t]||ct[t].version!==e){const r=await ft(e);ut=h.Reference(r.schemas,"configured_decorator"),ht=h.ChoiceNode([{type:"string",node:h.StringNode(r.collections,{validator:"resource",params:{pool:"$worldgen/configured_feature"}})},{type:"object",node:h.Reference(r.schemas,"configured_feature")}],{choiceContext:"feature"});const a=null==(n=pe.generators.find((e=>e.id===t)))?void 0:n.schema;if(!a)throw new Error(`Cannot find model ${t}`);try{const n=r.schemas.get(a),o=new h.DataModel(n,{wrapLists:!0});ct[t]?o.reset(ct[t].model.data,!1):(o.validate(!0),o.history=[JSON.stringify(o.data)]),ct[t]={model:o,version:e}}catch(o){const n=new Error(`Cannot get generator "${t}" for version "${e}": ${$e(o)}`);throw o instanceof Error&&(n.stack=o.stack),n}}return ct[t].model}(n,x.id).then((async e=>{if(ue.setGenerator(x.id),C){const t=await R(C);e.reset(h.DataModel.wrapLists(t),!1)}A(e)})).catch((e=>{console.error(e),w(e)}))}),[n,x.id]);const[j,E]=v(!1);Be(M,(()=>{Me({version:void 0,preset:void 0}),w(null),E(!0)}));const[$,O]=v(""),[S,L]=De(),[P,D]=De(),V=()=>{if($!==(null==a?void 0:a.id)&&$&&M&&I){const e=On(M,I);s(x.id,null==a?void 0:a.id,{id:$,data:e})?L():(D(),a&&O(null==a?void 0:a.id))}else a&&O(null==a?void 0:a.id)};c((()=>{a&&O(a.id)}),[a]),c((()=>{var e;M&&(O(null!=(e=null==a?void 0:a.id)?e:""),a&&x.id===a.type&&M.reset(h.DataModel.wrapLists(a.data)),E(!1))}),[a,M]);const N=e=>{e.ctrlKey&&"z"===e.key?(ue.generatorEvent("undo","Hotkey"),null==M||M.undo()):e.ctrlKey&&"y"===e.key&&(ue.generatorEvent("redo","Hotkey"),null==M||M.redo())},T=e=>{if(e.ctrlKey&&"s"===e.key&&(e.preventDefault(),M&&I&&a)){ue.generatorEvent("save","Hotkey");const e=On(M,I);s(x.id,null==a?void 0:a.id,{id:null==a?void 0:a.id,data:e}),E(!1),L()}};c((()=>(document.addEventListener("keyup",N),document.addEventListener("keydown",T),()=>{document.removeEventListener("keyup",N),document.removeEventListener("keydown",T)})),[M,I,a]);const[B,H]=v([]);c((()=>{(async function(e){const t=await ft(e);return mt=t.collections,t.collections})(n).then((e=>{H(e.get(x.id).map((e=>e.slice(10))))})).catch((e=>{console.error(e),w(e)}))}),[n,x.id]);const R=async e=>{var t,o,r;try{const a=await at(n,null!=(t=x.path)?t:x.id,e),s=null==M?void 0:M.get(new h.Path(["generator","seed"]));return void 0!==(null==(o=null==a?void 0:a.generator)?void 0:o.seed)&&void 0!==s&&(a.generator.seed=s,void 0!==(null==(r=a.generator.biome_source)?void 0:r.seed)&&(a.generator.biome_source.seed=s)),a}catch(a){w(a instanceof Error?a:$e(a))}},[F,G]=v(window.innerWidth>820),[J,W]=v(0),[U,Y]=v(0),[q,Z]=v(0),[X,K]=De(),[Q,ee]=v(!1),te=En.includes(x.id)&&!("worldgen/configured_feature"===x.id&&vt(n,"1.18"));Q&&!te&&ee(!1);let ne=1;te&&(ne+=1),F&&(ne+=2);return d(_,null,d("main",{class:Q?"has-preview":""},d(he,{id:"data-pack-generator",type:"text"}),d("div",{class:"controls"},d("div",{class:`project-controls ${a&&"has-file"}`},d("div",{class:"btn-row"},d(He,{icon:"repo",label:r.name,relative:!1},d(me,{icon:"arrow_left",label:t("project.go_to"),onClick:()=>p("/project")}),a&&d(me,{icon:"file",label:t("project.new_file"),onClick:f}),d(qe,{searchPlaceholder:t("Drafts"===r.name?"project.search_drafts":"project.search"),noResults:t("project.no_files"),values:r.files.filter((e=>e.type===x.id)).map((e=>e.id)),onSelect:e=>u(x.id,e)})),d(We,{class:"btn btn-input",placeholder:t("project.unsaved_file"),value:$,onChange:O,onEnter:V,onBlur:V}),a&&d(me,{icon:"trashcan",tooltip:t("project.delete_file"),onClick:()=>{a&&s(x.id,a.id,{})}})),j?d("div",{class:"status-icon"},Re.dot_fill):S?d("div",{class:"status-icon active"},Re.check):P&&d("div",{class:"status-icon danger"},Re.x)),d("div",{class:"generator-controls"},d(me,{icon:"upload",label:t("import"),onClick:()=>{ue.generatorEvent("import"),G(!0),Z(q+1)}}),d(He,{icon:"archive",label:t("presets"),relative:!1},d(qe,{searchPlaceholder:t("search"),noResults:t("no_presets"),values:B,onSelect:e=>{ue.generatorEvent("load-preset",e),Me({version:n,preset:e})}})),d(He,{icon:"tag",label:n,tooltip:t("switch_version"),"data-cy":"version-switcher"},k.reverse().map((e=>d(me,{label:e,active:e===n,onClick:()=>o(e)})))),d(He,{icon:"kebab_horizontal",tooltip:t("more")},d(me,{icon:"history",label:t("reset"),onClick:()=>{ue.generatorEvent("reset"),null==M||M.reset(h.DataModel.wrapLists(M.schema.default()),!0)}}),d(me,{icon:"arrow_left",label:t("undo"),onClick:e=>{e.stopPropagation(),ue.generatorEvent("undo","Menu"),null==M||M.undo()}}),d(me,{icon:"arrow_right",label:t("redo"),onClick:e=>{e.stopPropagation(),ue.generatorEvent("redo","Menu"),null==M||M.redo()}})))),g&&d(Fe,{error:g,onDismiss:()=>w(null)}),d(co,l(i({},{model:M,version:n,blockStates:I}),{onError:w}))),d("div",{class:"popup-actions",style:`--offset: -${8+50*ne}px;`},d("div",{class:`popup-action action-preview${te?" shown":""} tooltipped tip-nw`,"aria-label":t(Q?"hide_preview":"show_preview"),onClick:()=>{ue.generatorEvent("toggle-preview",Q?"hidden":"visible"),ee(!Q),!Q&&F&&G(!1)}},Q?Re.x_circle:Re.play),d("div",{class:`popup-action action-download${F?" shown":""} tooltipped tip-nw`,"aria-label":t("download"),onClick:()=>{ue.generatorEvent("download"),Y(U+1)}},Re.download),d("div",{class:`popup-action action-copy${F?" shown":""}${X?" active":""} tooltipped tip-nw`,"aria-label":t(X?"copied":"copy"),onClick:()=>{ue.generatorEvent("copy"),W(J+1)}},X?Re.check:Re.clippy),d("div",{class:"popup-action action-code shown tooltipped tip-nw","aria-label":t(F?"hide_output":"show_output"),onClick:()=>{ue.generatorEvent("toggle-output",F?"hidden":"visible"),G(!F),W(0),Y(0),Z(0)}},F?Re.chevron_right:Re.code)),d("div",{class:"popup-preview"+(Q?" shown":"")},d($n,l(i({},{model:M,version:n,id:x.id}),{shown:Q,onError:w}))),d("div",{class:"popup-source"+(F?" shown":"")},d(Dn,l(i({},{model:M,blockStates:I,doCopy:J,doDownload:U,doImport:q}),{name:null!=(e=x.schema)?e:"data",copySuccess:K,onError:w}))))}function $o({}){const{locale:e}=It();return Nt(e("title.home")),d("main",null,d("div",{class:"home"},d(vo,{title:"Data packs"},pe.generators.filter((e=>!e.category)).map((t=>d(vo,{title:e(t.id),link:be(t.url)}))),d(vo,{title:e("worldgen"),link:"/worldgen/"})),d(vo,{title:"Resource packs"},pe.generators.filter((e=>"assets"===e.category)).map((t=>d(vo,{title:e(t.id),link:be(t.url)})))),d(vo,{title:"Report Inspector",icon:"report",link:"https://misode.github.io/report/",desc:"Analyse your performance reports"}),d(vo,{title:"Minecraft Sounds",icon:"sounds",link:"/sounds/",desc:"Browse through and mix all the vanilla sounds"}),d(vo,{title:"Data Pack Upgrader",link:"https://misode.github.io/upgrader/",desc:"Convert your data packs from 1.16 to 1.17 to 1.18"}),d(vo,{title:"Technical Changelog",link:"/changelog/"}),d(vo,{title:"Minecraft Versions",link:"/versions/"}),d(uo,null)))}function Oo({}){const{locale:e}=It(),{project:t,openFile:n}=$t();Nt(e("title.project",t.name));const o=w((()=>t.files.map(St)),t.files);return d("main",null,d(he,{id:"data-pack-project",type:"text"}),d("div",{class:"project"},d("h2",null,t.name),d("div",{class:"file-view"},d(go,{entries:o,onSelect:e=>{const[,t,o,...r]=e.split("/");n(o,`${t}:${r}`)}}))))}function So({}){const{locale:e}=It(),{version:t,changeVersion:n}=Ht(),[o,r]=v(null);Nt(e("title.sounds"));const[a,s]=v({}),u=Object.keys(null!=a?a:{});c((()=>{(async function(e){const t=pe.versions.find((t=>t.id===e));await nt(t);try{const e=`${tt(t,"summary")}/sounds/data.min.json`;return await st(e)}catch(n){throw new Error(`Error occurred while fetching sounds for ${t}: ${$e(n)}`)}})(t).then(s).catch((e=>{console.error(e),r(e)}))}),[t]);const[h,m]=v(""),[p,g]=v([]),w=()=>{g([{id:ge(),sound:h,delay:0,pitch:1,volume:1},...p])},y=e=>()=>{g(p.filter((t=>t.id!==e)))},[b,x]=v(0),k=f(null);return d("main",null,o&&d(Fe,{error:o,onDismiss:()=>r(null)}),u.length>0&&d(_,null,d("div",{class:"controls sounds-controls"},d("div",{class:"sound-search-group"},d(We,{class:"btn btn-input sound-search",list:"sound-list",placeholder:e("sounds.search"),value:h,onChange:m,onEnter:w}),d(me,{icon:"plus",tooltip:e("sounds.add_sound"),class:"add-sound",onClick:w})),p.length>1&&d(me,{icon:"play",label:e("sounds.play_all"),class:"play-all-sounds",onClick:()=>{x(b+1)}}),d("div",{class:"spacer"}),d(me,{icon:"download",label:e("download"),tooltip:e("sounds.download_function"),class:"download-sounds",onClick:()=>{const e=p.some((e=>e.delay>0)),t=p.sort(((e,t)=>e.delay-t.delay)).map((t=>`${e?`execute if score @s delay matches ${t.delay} run `:""}playsound minecraft:${t.sound} master @s ~ ~ ~ ${t.volume} ${t.pitch}`)).join("\n");k.current.setAttribute("href","data:text/plain;charset=utf-8,"+t+"%0A"),k.current.setAttribute("download","sounds.mcfunction"),k.current.click()}}),d(He,{icon:"tag",label:t},pe.versions.reverse().map((e=>d(me,{label:e.id,active:e.id===t,onClick:()=>n(e.id)}))))),d("div",{class:"sounds"},p.map((e=>{return d(fo,l(i(i({key:e.id},e),{sounds:a,delayedPlay:b}),{onEdit:(t=e.id,e=>{g(p.map((n=>n.id===t?i(i({},n),e):n)))}),onDelete:y(e.id)}));var t}))),d("a",{ref:k,style:"display: none;"})),d("datalist",{id:"sound-list"},u.map((e=>d("option",{key:e,value:e})))))}function Lo({}){const{locale:e}=It(),[t,n]=v(null);Nt(e("title.versions"));const[o,r]=v([]);c((()=>{(async function(){const e=pe.versions[pe.versions.length-1];await nt(e);try{return st(`${tt(e,"summary")}/versions/data.min.json`)}catch(t){throw new Error(`Error occured while fetching versions: ${$e(t)}`)}})().then((e=>r(e))).catch((e=>{console.error(e),n(e)}))}),[]);const a=Ce(m()).get("id"),s=o.find((e=>e.id===a));Nt(s?s.name:"Versions Explorer",s?[]:void 0);const l=s&&Po(o,s,-1),u=s&&Po(o,s,1);return d("main",null,d(he,{type:"text",id:"versions"}),t&&d(Fe,{error:t,onDismiss:()=>n(null)}),d("div",{class:"versions"},s?d(_,null,d("div",{class:"version-navigation"},d("a",{class:"btn btn-link",href:"/versions/"},Re.three_bars,e("versions.all")),d("a",i({class:"btn btn-link"},u?{href:`/versions/?id=${u.id}`}:{disabled:!0}),Re.arrow_left,e("versions.previous")),d("a",i({class:"btn btn-link"},l?{href:`/versions/?id=${l.id}`}:{disabled:!0}),e("versions.next"),Re.arrow_right)),d(ko,{version:s})):d(Ao,{versions:o,link:e=>`/versions/?id=${e}`})))}function Po(e,t,n){const o=e.findIndex((e=>e.id===t.id))+n;if(!(o<0||o>=e.length))return e[o]}function Do(){return d(_,null,d(mo,null),d(ce,{onChange:e=>{setTimeout((()=>ue.pageview(be(e.url))))}},d($o,{path:"/"}),d(zo,{path:"/worldgen",category:"worldgen"}),d(zo,{path:"/assets",category:"assets"}),d(So,{path:"/sounds"}),d(jo,{path:"/changelog"}),d(Lo,{path:"/versions"}),d(Oo,{path:"/project"}),d(Eo,{default:!0})))}function Vo(){return d(zt,null,d(Dt,null,d(Rt,null,d(Tt,null,d(Ot,null,d(Do,null))))))}de(d(Vo,null),document.body);
//# sourceMappingURL=index.dc4f43f8.js.map