mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-29 01:22:44 +00:00
3 lines
77 KiB
JavaScript
3 lines
77 KiB
JavaScript
var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,i=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&i(e,n,t[n]);if(o)for(var n of o(t))a.call(t,n)&&i(e,n,t[n]);return e},l=(e,o)=>t(e,n(o));import{y as c,a as d,s as u,l as h,L as m,g,b as p,c as f,d as v,j as _,e as w,f as y,q as b,N as $,R as k}from"./vendor.5f8b9a3f.js";var x;function z({type:e,id:t}){return c((()=>{var e;null==(e=document.getElementById("ad-placeholder"))||e.remove(),"ethicalads"in window&ðicalads.load()}),[]),d("div",{"data-ea-publisher":"misode-github-io","data-ea-type":e,class:"ad dark flat",id:t})}function E({icon:e,label:t,active:n,class:o,onClick:r}){return d("div",{class:`btn${n?" active":""}${o?` ${o}`:""}`,onClick:r},e&&H[e],t&&d("span",null,t))}function M({icon:e,label:t,large:n,type:o,doSelect:r,value:a,onChange:i}){const s=void 0===i?()=>{}:e=>{const t=e.target.value;"number"===o&&(t.endsWith(".")||isNaN(Number(t)))||null==i||i(t)},l=u(null);return c((()=>{r&&l.current&&l.current.select()}),[r]),d("div",{class:"btn btn-input "+(n?"large-input":""),onClick:e=>e.stopPropagation()},e&&H[e],t&&d("span",null,t),d("input",{ref:l,type:"text",value:a,onKeyUp:s}))}function A({icon:e,label:t,relative:n,children:o}){const[r,a]=h(!1),i=()=>{a(!1)};return c((()=>(r&&document.body.addEventListener("click",i),()=>{document.body.removeEventListener("click",i)})),[r]),d("div",{class:"btn-menu"+(!1===n?" no-relative":"")},d(E,{icon:e,label:t,onClick:()=>a(!0)}),r&&d("div",{class:"btn-group"},o))}function C({error:e}){return d("div",{class:"error"},d("h3",null,e),d("p",null,"You can report this as a bug ",d("a",{href:"https://github.com/misode/misode.github.io/issues/new",target:"_blank"},"on GitHub")))}!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.generatorEvent=function(e,t){o(n,e,t)}}(x||(x={}));var j=JSON.parse('{"languages":[{"code":"de","name":"Deutsch"},{"code":"en","name":"English"},{"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","refs":{"mcdata_master":"13355f7"}},{"id":"1.16","refs":{"mcdata_master":"1.16.4","vanilla_datapack_data":"1.16.4-data","vanilla_datapack_summary":"1.16.4-summary"}},{"id":"1.17","refs":{"mcdata_master":"master","vanilla_datapack_data":"data","vanilla_datapack_summary":"summary"},"dynamic":true}],"models":[{"id":"loot-table","name":"Loot Table","path":"loot_tables","schema":"loot_table"},{"id":"predicate","name":"Predicate","path":"predicates","schema":"predicate"},{"id":"item-modifier","name":"Item Modifier","path":"item_modifiers","schema":"item_modifier","minVersion":"1.17"},{"id":"advancement","name":"Advancement","path":"advancements","schema":"advancement"},{"id":"dimension","name":"Dimension","path":"dimension","schema":"dimension","minVersion":"1.16"},{"id":"dimension-type","name":"Dimension Type","path":"dimension_type","schema":"dimension_type","minVersion":"1.16"},{"id":"world","name":"World Settings","schema":"world_settings","minVersion":"1.16"},{"id":"worldgen","name":"Worldgen","category":true,"minVersion":"1.16"},{"id":"worldgen/biome","name":"Biome","path":"worldgen/biome","category":"worldgen","schema":"biome","minVersion":"1.16"},{"id":"worldgen/carver","name":"Carver","path":"worldgen/configured_carver","category":"worldgen","schema":"configured_carver","minVersion":"1.16"},{"id":"worldgen/feature","name":"Feature","path":"worldgen/configured_feature","category":"worldgen","schema":"configured_feature","minVersion":"1.16"},{"id":"worldgen/noise-settings","name":"Noise Settings","path":"worldgen/noise_settings","category":"worldgen","schema":"noise_settings","minVersion":"1.16"},{"id":"worldgen/structure-feature","name":"Structure Feature","path":"worldgen/configured_structure_feature","category":"worldgen","schema":"configured_structure_feature","minVersion":"1.16"},{"id":"worldgen/surface-builder","name":"Surface Builder","path":"worldgen/configured_surface_builder","category":"worldgen","schema":"configured_surface_builder","minVersion":"1.16"},{"id":"worldgen/processor-list","name":"Processor List","path":"worldgen/processor_list","category":"worldgen","schema":"processor_list","minVersion":"1.16"},{"id":"worldgen/template-pool","name":"Template Pool","path":"worldgen/template_pool","category":"worldgen","schema":"template_pool","minVersion":"1.16"}],"registries":[{"id":"advancement","dynamic":true},{"id":"attribute","minVersion":"1.16"},{"id":"block"},{"id":"dimension","dynamic":true},{"id":"dimension_type","dynamic":true},{"id":"enchantment"},{"id":"entity_type"},{"id":"fluid"},{"id":"function","dynamic":true},{"id":"float_provider_type","minVersion":"1.17"},{"id":"item"},{"id":"int_provider_type","minVersion":"1.17"},{"id":"height_provider_type","minVersion":"1.17"},{"id":"loot_condition_type","minVersion":"1.16"},{"id":"loot_condition_type","minVersion":"1.16"},{"id":"loot_function_type","minVersion":"1.16"},{"id":"loot_nbt_provider_type","minVersion":"1.17"},{"id":"loot_number_provider_type","minVersion":"1.17"},{"id":"loot_pool_entry_type","minVersion":"1.16"},{"id":"loot_score_provider_type","minVersion":"1.17"},{"id":"loot_table","dynamic":true},{"id":"mob_effect"},{"id":"pos_rule_test","minVersion":"1.16"},{"id":"potion","minVersion":"1.15"},{"id":"predicate","dynamic":true},{"id":"recipe","dynamic":true},{"id":"rule_test","minVersion":"1.16"},{"id":"sound_event"},{"id":"stat_type"},{"id":"structure","dynamic":true},{"id":"tag/block","dynamic":true},{"id":"tag/entity_type","dynamic":true},{"id":"tag/fluid","dynamic":true},{"id":"tag/function","dynamic":true},{"id":"tag/item","dynamic":true},{"id":"worldgen/biome","dynamic":true},{"id":"worldgen/block_state_provider_type","minVersion":"1.16"},{"id":"worldgen/block_placer_type","minVersion":"1.16"},{"id":"worldgen/biome_source","minVersion":"1.16"},{"id":"worldgen/carver","minVersion":"1.16"},{"id":"worldgen/chunk_generator","minVersion":"1.16"},{"id":"worldgen/configured_carver","minVersion":"1.16","dynamic":true},{"id":"worldgen/configured_decorator","minVersion":"1.16","dynamic":true},{"id":"worldgen/configured_feature","minVersion":"1.16","dynamic":true},{"id":"worldgen/configured_structure_feature","minVersion":"1.16","dynamic":true},{"id":"worldgen/configured_surface_builder","minVersion":"1.16","dynamic":true},{"id":"worldgen/decorator","minVersion":"1.16"},{"id":"worldgen/feature","minVersion":"1.16"},{"id":"worldgen/feature_size_type","minVersion":"1.16"},{"id":"worldgen/foliage_placer_type","minVersion":"1.16"},{"id":"worldgen/noise_settings","minVersion":"1.16","dynamic":true},{"id":"worldgen/processor_list","minVersion":"1.16","dynamic":true},{"id":"worldgen/structure_feature","minVersion":"1.16"},{"id":"worldgen/structure_pool_element","minVersion":"1.16"},{"id":"worldgen/structure_processor","minVersion":"1.16"},{"id":"worldgen/surface_builder","minVersion":"1.16"},{"id":"worldgen/template_pool","minVersion":"1.16","dynamic":true},{"id":"worldgen/tree_decorator_type","minVersion":"1.16"},{"id":"worldgen/trunk_placer_type","minVersion":"1.16"},{"id":"biome","maxVersion":"1.15"},{"id":"worldgen/biome","minVersion":"1.16","path":"processed/reports/biomes"}]}');let V;const L={},P=function(e,t){if(!t)return e();if(void 0===V){const e=document.createElement("link").relList;V=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(t.map((e=>{if(e in L)return;L[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":V,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 I=JSON.parse('{"advancement":"Advancement","button.add":"Add","button.collapse":"Collapse","button.expand":"Expand","button.remove":"Remove","copy":"Copy","dimension-type":"Dimension Type","dimension":"Dimension","download":"Download","fields":"Fields","github":"GitHub","home":"Home","import":"Import","indentation.2_spaces":"2 spaces","indentation.4_spaces":"4 spaces","indentation.tabs":"Tabs","item-modifier":"Item Modifier","language":"Language","loot-table":"Loot Table","not_found.description":"The page you were looking for does not exist.","no_presets":"No presets","predicate":"Predicate","redo":"Redo","reset":"Reset","settings":"Settings","settings.fields.description":"Customize advanced field settings","settings.fields.path":"Context","settings.fields.name":"Name","share":"Share","theme.dark":"Dark","theme.light":"Light","theme.system":"System","title.generator":"%0% Generator","title.generator_category":"%0% Generators","title.home":"Data Pack Generators","presets":"Presets","preview":"Visualize","preview.scale":"Scale","preview.depth":"Depth","preview.width":"Width","source_placeholder":"Paste JSON content here","undo":"Undo","world":"World Settings","worldgen":"Worldgen","worldgen/biome":"Biome","worldgen/carver":"Carver","worldgen/feature":"Feature","worldgen/noise-settings":"Noise Settings","worldgen/processor-list":"Processor List","worldgen/structure-feature":"Structure Feature","worldgen/surface-builder":"Surface Builder","worldgen/template-pool":"Template Pool"}'),D=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:I});const S={fallback:I};function O(e,t,...n){var o,r,a,i,s;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!=(s=null!=(i=null!=(a=null==(o=S[e])?void 0:o[t])?a:null==(r=S.en)?void 0:r[t])?i:S.fallback[t])?s:t,n)}async function N(e){const t=j.languages.find((t=>t.code===e));if(!t)return;const n=await function(e){switch(e){case"../locales/de.json":return P((()=>import("./de.a632fd27.js")),void 0);case"../locales/en.json":return P((()=>Promise.resolve().then((function(){return D}))),void 0);case"../locales/fr.json":return P((()=>import("./fr.ea70bc04.js")),void 0);case"../locales/it.json":return P((()=>import("./it.772fd5c1.js")),void 0);case"../locales/ja.json":return P((()=>import("./ja.ed039f93.js")),void 0);case"../locales/pl.json":return P((()=>import("./pl.ea3084e3.js")),void 0);case"../locales/pt.json":return P((()=>import("./pt.689bba1d.js")),void 0);case"../locales/ru.json":return P((()=>import("./ru.4f4928c9.js")),void 0);case"../locales/sk.json":return P((()=>import("./sk.dcbe99ef.js")),void 0);case"../locales/zh-cn.json":return P((()=>import("./zh-cn.d626787e.js")),void 0);case"../locales/zh-tw.json":return P((()=>import("./zh-tw.2f743133.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/de.json":return P((()=>import("./de.ba8c635a.js")),void 0);case"../../node_modules/@mcschema/locales/src/en.json":return P((()=>import("./en.6ae73cdb.js")),void 0);case"../../node_modules/@mcschema/locales/src/fr.json":return P((()=>import("./fr.c1ebc76d.js")),void 0);case"../../node_modules/@mcschema/locales/src/it.json":return P((()=>import("./it.288ea523.js")),void 0);case"../../node_modules/@mcschema/locales/src/ja.json":return P((()=>import("./ja.d68f1cee.js")),void 0);case"../../node_modules/@mcschema/locales/src/pl.json":return P((()=>import("./pl.2f8b352f.js")),void 0);case"../../node_modules/@mcschema/locales/src/pt.json":return P((()=>import("./pt.98ad9b62.js")),void 0);case"../../node_modules/@mcschema/locales/src/ru.json":return P((()=>import("./ru.61de7e2f.js")),void 0);case"../../node_modules/@mcschema/locales/src/zh-cn.json":return P((()=>import("./zh-cn.655950f4.js")),void 0);case"../../node_modules/@mcschema/locales/src/zh-tw.json":return P((()=>import("./zh-tw.a8f28612.js")),void 0);default:return Promise.reject(new Error("Unknown variable dynamic import: "+e))}}(`../../node_modules/@mcschema/locales/src/${e}.json`);S[e]=s(s({},n.default),o.default)}const T={system:"device_desktop",dark:"moon",light:"sun"};function R({lang:e,title:t,theme:n,changeTheme:o,language:r,changeLanguage:a}){const i=O.bind(null,e);return d("header",null,d("div",{class:"header-title"},d(m,{class:"home-link",href:g().match(/^\/worldgen\/.+/)?"/worldgen/":"/"},H.three_bars),d("h2",null,t)),d("nav",null,d("ul",null,d("li",null,d(A,{icon:"globe"},j.languages.map((({code:e,name:t})=>d(E,{label:t,active:e===r,onClick:()=>a(e)}))))),d("li",null,d(A,{icon:T[n]},Object.entries(T).map((([e,t])=>d(E,{icon:t,label:i(`theme.${e}`),active:e===n,onClick:()=>o(e)}))))),d("li",{class:"dimmed"},d("a",{href:"https://github.com/misode/misode.github.io",target:"_blank",rel:"noreferrer",title:i("github")},H.mark_github)))))}const H={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"})),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"})),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"})),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"})),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"})),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"})),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"})),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"})),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"})),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"})),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"})),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_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 B(e,t){const n={invalidated(){e&&t(e)}};c((()=>(null==e||e.addListener(n),n.invalidated(),()=>{null==e||e.removeListener(n)})),[e])}function F(e,t){if(!e)return;const n=u(),o=u(),r=u([0,0]);c((()=>{const a=e=>{o.current=[e.offsetX,e.offsetY]},i=e=>{if(void 0===o.current)return;const a=e.offsetX-o.current[0],i=e.offsetY-o.current[1];0===a&&0===i||(cancelAnimationFrame(n.current),r.current=[r.current[0]+a,r.current[1]+i],n.current=requestAnimationFrame((()=>{t(...r.current),r.current=[0,0]}))),o.current=[e.offsetX,e.offsetY]},s=e=>{o.current=void 0};return e.addEventListener("mousedown",a),e.addEventListener("mousemove",i),document.body.addEventListener("mouseup",s),()=>{e.removeEventListener("mousedown",a),e.removeEventListener("mousemove",i),document.body.removeEventListener("mouseup",s)}}),[e])}const W=e=>("0"+e.toString(16)).substr(-2);function G(e=12){var t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t,W).join("")}function q(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function J(e){return`/${e}/`.replaceAll("//","/")}function Y(e){const t=Math.abs(function(e){let t=0;for(let n=0;n<e.length;n++)t=Math.imul(31,t)+e.charCodeAt(n)|0;return t}(e));return[t%256,(t>>8)%256,(t>>16)%256]}function U(e,t,n){return Math.max(e,Math.min(t,n))}function X(e,t,n){return n<0?e:n>1?t:K(n,e,t)}function K(e,t,n){return t+e*(n-t)}function Q(e,t,n,o,r,a){return K(t,K(e,n,o),K(e,r,a))}function Z(e){return e*e*e*(e*(6*e-15)+10)}const ee=class{constructor(e){this.xo=256*e(),this.yo=256*e(),this.zo=256*e(),this.p=Array(256);for(let t=0;t<256;t+=1)this.p[t]=t;for(let t=0;t<256;t+=1){const n=e.int32()%(256-t),o=this.p[t];this.p[t]=this.p[t+n],this.p[t+n]=o}}noise(e,t,n,o,r){const a=e+this.xo,i=t+this.yo,s=n+this.zo,l=Math.floor(a),c=Math.floor(i),d=Math.floor(s),u=a-l,h=i-c,m=s-d,g=Z(u),p=Z(h),f=Z(m);let v=0;return 0!==o&&(v=Math.floor(Math.min(r,h)/o)*o),this.sampleAndLerp(l,c,d,u,h-v,m,g,p,f)}gradDot(e,t,n,o){const r=ee.GRADIENT[15&e];return r[0]*t+r[1]*n+r[2]*o}P(e){return 255&this.p[255&e]}sampleAndLerp(e,t,n,o,r,a,i,s,l){const c=this.P(e)+t,d=this.P(c)+n,u=this.P(c+1)+n,h=this.P(e+1)+t,m=this.P(h)+n,g=this.P(h+1)+n;return function(e,t,n,o,r,a,i,s,l,c,d){return K(n,Q(e,t,o,r,a,i),Q(e,t,s,l,c,d))}(i,s,l,this.gradDot(this.P(d),o,r,a),this.gradDot(this.P(m),o-1,r,a),this.gradDot(this.P(u),o,r-1,a),this.gradDot(this.P(g),o-1,r-1,a),this.gradDot(this.P(d+1),o,r,a-1),this.gradDot(this.P(m+1),o-1,r,a-1),this.gradDot(this.P(u+1),o,r-1,a-1),this.gradDot(this.P(g+1),o-1,r-1,a-1))}};let te=ee;te.GRADIENT=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1],[1,1,0],[0,-1,1],[-1,1,0],[0,-1,-1]];class ne{constructor(e,t,n){this.amplitudes=n,this.noiseLevels=Array(this.amplitudes.length);for(let o=0;o<this.amplitudes.length;o+=1)this.noiseLevels[o]=new te(p(e));this.lowestFreqInputFactor=Math.pow(2,t),this.lowestFreqValueFactor=Math.pow(2,n.length-1)/(Math.pow(2,n.length)-1)}static fromRange(e,t,n){return new ne(e,t,Array(n-t+1).fill(1))}getValue(e,t,n,o=0,r=0,a=!1){let i=0,s=this.lowestFreqInputFactor,l=this.lowestFreqValueFactor;for(let c=0;c<this.noiseLevels.length;c+=1){const d=this.noiseLevels[c];d&&(i+=this.amplitudes[c]*d.noise(ne.wrap(e*s),a?-d.yo:ne.wrap(t*s),ne.wrap(n*s),o*s,r*s)*l),s*=2,l/=2}return i}getOctaveNoise(e){return this.noiseLevels[this.noiseLevels.length-1-e]}static wrap(e){return e-33554432*Math.floor(e/33554432+.5)}}class oe{constructor(e,t,n){this.first=new ne(e,t,n),this.second=new ne(e+"a",t,n);let o=1/0,r=-1/0;for(let i=0;i<n.length;i+=1)0!==n[i]&&(o=Math.min(o,i),r=Math.max(r,i));const a=.1*(1+1/(r-o+1));this.valueFactor=1/6/a}getValue(e,t,n){const o=1.0181268882175227*e,r=1.0181268882175227*t,a=1.0181268882175227*n;return(this.first.getValue(e,t,n)+this.second.getValue(o,r,a))*this.valueFactor}}const re=["altitude","temperature","humidity","weirdness"];function ae(e,t,n){var o;switch(null==(o=null==e?void 0:e.type)?void 0:o.replace(/^minecraft:/,"")){case"multi_noise":return function(e,t,n){var o;const r=re.map(((t,o)=>{const r=e[`${t}_noise`];return new oe(n.seed+o,r.firstOctave,r.amplitudes)})),a={};e.biomes.forEach((e=>{a[e.biome]=ie(e.biome,n.biomeColors)}));const i=t.data,s=-n.offset[0]-100+n.res/2,l=-n.offset[1]-100+n.res/2,c=4*t.width/n.res,d=4/n.res;for(let u=0;u<200;u+=n.res)for(let t=0;t<200;t+=n.res){const h=t*c+u*d,m=(u+s)*n.scale,g=(t+l)*n.scale,p=se(r,e.biomes,m,g),f=null!=(o=a[p])?o:[128,128,128];i[h]=f[0],i[h+1]=f[1],i[h+2]=f[2],i[h+3]=255}}(e,t,n);case"fixed":return function(e,t,n){const o=t.data,r=ie(e.biome,n.biomeColors),a=4*t.width/n.res,i=4/n.res;for(let s=0;s<200;s+=n.res)for(let e=0;e<200;e+=n.res){const t=e*a+s*i;o[t]=r[0],o[t+1]=r[1],o[t+2]=r[2],o[t+3]=255}}(e,t,n);case"checkerboard":return function(e,t,n){var o,r,a,i,s,l;const c={};null==(o=e.biomes)||o.forEach((e=>{c[e]=ie(e,n.biomeColors)}));const d=t.data,u=-n.offset[0]-100+n.res/2,h=-n.offset[1]-100+n.res/2,m=4*t.width/n.res,g=4/n.res,p=(null!=(r=e.scale)?r:2)+2,f=null!=(i=null==(a=e.biomes)?void 0:a.length)?i:0;for(let v=0;v<200;v+=n.res)for(let t=0;t<200;t+=n.res){const o=t*m+v*g,r=((((v+u)*n.scale>>p)+((t+h)*n.scale>>p))%f+f)%f,a=null==(s=e.biomes)?void 0:s[r],i=null!=(l=c[a])?l:[128,128,128];d[o]=i[0],d[o+1]=i[1],d[o+2]=i[2],d[o+3]=255}}(e,t,n)}}function ie(e,t){var n;if(!e)return[128,128,128];const o=null!=(n=t[e])?n:ce[e];return void 0===o?Y(e):o}function se(e,t,n,o){if(!Array.isArray(t)||0===t.length)return"";const r=e.map((e=>e.getValue(n,o,0)));let a=1/0,i="";for(const s of t){const e=le(s.parameters,{altitude:r[0],temperature:r[1],humidity:r[2],weirdness:r[3],offset:0});e<a&&(a=e,i=s.biome)}return i}function le(e,t){return(e.altitude-t.altitude)*(e.altitude-t.altitude)+(e.temperature-t.temperature)*(e.temperature-t.temperature)+(e.humidity-t.humidity)*(e.humidity-t.humidity)+(e.weirdness-t.weirdness)*(e.weirdness-t.weirdness)+(e.offset-t.offset)*(e.offset-t.offset)}const ce={"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:giant_spruce_taiga_hills":[109,119,102],"minecraft:giant_tree_taiga":[89,102,81],"minecraft:giant_tree_taiga_hills":[69,79,62],"minecraft:gravelly_mountains":[136,136,136],"minecraft:ice_spikes":[180,220,220],"minecraft:jungle":[83,123,9],"minecraft:jungle_edge":[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:mountains":[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: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:soul_sand_valley":[94,56,48],"minecraft:stone_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: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_hills":[34,85,28],"minecraft:wooded_mountains":[80,112,80]},de=[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],ue=[[255,77,54],[59,118,255],[91,207,25],[217,32,245],[255,209,41],[52,204,209]];function he(e){return e.startsWith("minecraft:")?e.slice(10):e}function me(e,t){return[[e[0],t,e[2]]]}function ge(e,t){return Math.floor(t.random()*e)}function pe(e,t){var n,o;if("number"==typeof e)return e;if(e.base)return null!=(o=e.base)?o:1+ge(1+(null!=(n=e.spread)?n:0),t);switch(he(e.type)){case"constant":return e.value;case"uniform":return e.value.min_inclusive+ge(e.value.max_inclusive-e.value.min_inclusive+1,t);case"biased_to_bottom":return e.value.min_inclusive+ge(ge(e.value.max_inclusive-e.value.min_inclusive+1,t)+1,t);case"clamped":return Math.max(e.value.min_inclusive,Math.min(e.value.max_inclusive,pe(e.value.source,t)))}return 1}function fe(e,t){const n=t.features.indexOf(e);return-1!=n?n:(t.features.push(e),t.features.length-1)}function ve(e,t,n){var o;if("string"==typeof t)return void n.placements.push([e,fe(t,n)]);const r=he(null!=(o=null==t?void 0:t.type)?o:"no_op"),a=we[r];a?a(t.config,e,n):n.placements.push([e,fe(JSON.stringify(t),n)])}function _e(e,t,n){var o;const r=he(null!=(o=null==t?void 0:t.type)?o:"nope"),a=ye[r];return a?a(null==t?void 0:t.config,e,n):[e]}const we={decorated:(e,t,n)=>{_e(t,null==e?void 0:e.decorator,n).forEach((t=>ve(t,null==e?void 0:e.feature,n)))},random_boolean_selector:(e,t,n)=>{ve(t,n.random()<.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.random()<(null!=(r=null==a?void 0:a.chance)?r:0))return void ve(t,a.feature,n);ve(t,null==e?void 0:e.default,n)},simple_random_selector:(e,t,n)=>{var o,r,a;ve(t,null==(a=null==e?void 0:e.features)?void 0:a[ge(null!=(r=null==(o=null==e?void 0:e.features)?void 0:o.length)?r:0,n)],n)}},ye={chance:(e,t,n)=>{var o;return n.random()<1/(null!=(o=null==e?void 0:e.chance)?o:1)?[t]:[]},count:(e,t,n)=>{var o;return new Array(pe(null!=(o=null==e?void 0:e.count)?o:1,n)).fill(t)},count_extra:(e,t,n)=>{var o,r;let a=null!=(o=null==e?void 0:e.count)?o:1;return n.random()<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(pe(null!=(o=null==e?void 0:e.count)?o:1,n)).fill(t).map((e=>[e[0]+ge(16,n),e[1],e[2]+ge(16,n)]))},count_noise:(e,t,n)=>{const o=n.biomeInfoNoise.getValue(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.getValue(t[0]/r,0,t[2]/r),i=Math.max(0,Math.ceil((a+(null!=(o=e.noise_offset)?o:0))*e.noise_to_count_ratio));return new Array(i).fill(t)},dark_oak_tree:(e,t,n)=>[...new Array(16)].map(((e,o)=>{const r=4*Math.floor(o/4)+1+ge(3,n)+t[0];return[r,Math.max(n.seaLevel,de[U(0,63,r)]),4*Math.floor(o%4)+1+ge(3,n)+t[2]]})),decorated:(e,t,n)=>_e(t,null==e?void 0:e.outer,n).flatMap((t=>_e(t,null==e?void 0:e.inner,n))),depth_average:(e,t,n)=>{var o,r,a,i;return me(t,ge(null!=(o=null==e?void 0:e.spread)?o:0,n)+ge(null!=(r=null==e?void 0:e.spread)?r:0,n)-(null!=(a=e.spread)?a:0)+(null!=(i=null==e?void 0:e.baseline)?i:0))},emerald_ore:(e,t,n)=>{const o=3+ge(6,n);return[...new Array(o)].map((()=>[t[0]+ge(16,n),4+ge(28,n),t[2]+ge(16,n)]))},fire:(e,t,n)=>{const o=1+ge(ge(pe(null==e?void 0:e.count,n),n),n);return[...new Array(o)].map((()=>[t[0]+ge(16,n),ge(128,n),t[2]+ge(16,n)]))},glowstone:(e,t,n)=>{const o=ge(1+ge(pe(null==e?void 0:e.count,n),n),n);return[...new Array(o)].map((()=>[t[0]+ge(16,n),ge(128,n),t[2]+ge(16,n)]))},heightmap:(e,t,n)=>me(t,Math.max(n.seaLevel,de[U(0,63,t[0])])),heightmap_spread_double:(e,t,n)=>me(t,ge(2*Math.max(n.seaLevel,de[U(0,63,t[0])]),n)),heightmap_world_surface:(e,t,n)=>me(t,Math.max(n.seaLevel,de[U(0,63,t[0])])),iceberg:(e,t,n)=>[[t[0]+4+ge(8,n),t[1],t[2]+4+ge(8,n)]],lava_lake:(e,t,n)=>{var o,r;if(0===ge((null!=(o=e.chance)?o:1)/10,n)){const o=ge(ge(248,n)+8,n);if(o<n.seaLevel||0==ge((null!=(r=null==e?void 0:e.chance)?r:1)/8,n)){return[[ge(16,n)+t[0],o,ge(16,n)+t[2]]]}}return[]},nope:(e,t)=>[t],range:(e,t,n)=>{var o,r,a;return me(t,ge((null!=(o=null==e?void 0:e.maximum)?o:1)-(null!=(r=null==e?void 0:e.top_offset)?r:0),n)+(null!=(a=null==e?void 0:e.bottom_offset)?a:0))},range_biased:(e,t,n)=>{var o,r,a;return me(t,ge(ge((null!=(o=null==e?void 0:e.maximum)?o:1)-(null!=(r=null==e?void 0:e.top_offset)?r:0),n)+(null!=(a=null==e?void 0:e.bottom_offset)?a:0),n))},range_very_biased:(e,t,n)=>{var o,r,a,i;return me(t,ge(ge(ge((null!=(o=null==e?void 0:e.maximum)?o:1)-(null!=(r=null==e?void 0:e.top_offset)?r:0),n)+(null!=(a=null==e?void 0:e.bottom_offset)?a:0),n)+(null!=(i=null==e?void 0:e.bottom_offset)?i:0),n))},spread_32_above:(e,t,n)=>me(t,ge(t[1]+32,n)),top_solid_heightmap:(e,t)=>me(t,de[U(0,63,t[0])]),magma:(e,t,n)=>me(t,ge(t[1]+32,n)),square:(e,t,n)=>[[t[0]+ge(16,n),t[1],t[2]+ge(16,n)]],water_lake:(e,t,n)=>{var o;return 0===ge(null!=(o=e.chance)?o:1,n)?[[t[0]+ge(16,n),ge(256,n),t[2]+ge(16,n)]]:[]}};class be{constructor(e){this.settings={},this.chunkWidth=4,this.chunkHeight=4,this.chunkCountY=32,this.biomeDepth=.1,this.biomeScale=.2,this.noiseColumnCache=[],this.xOffset=0,this.minLimitPerlinNoise=ne.fromRange(e+"djfqnqd",-15,0),this.maxLimitPerlinNoise=ne.fromRange(e+"gowdnqs",-15,0),this.mainPerlinNoise=ne.fromRange(e+"afiwmco",-7,0),this.depthNoise=ne.fromRange(e+"qphnmeo",-15,0)}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 i=this.chunkCountY-1;i>=0;i-=1)for(let e=this.chunkHeight;e>=0;e-=1){const n=e/this.chunkHeight;t[i*this.chunkHeight+e]=Q(n,o,r[i],r[i+1],a[i],a[i+1])}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,i=r/this.settings.sampling.y_factor,s=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,i);const c=((1-2*l/this.chunkCountY+s)*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=X(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=X(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.getValue(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,i){let s=0,l=0,c=0,d=1;for(let u=0;u<16;u+=1){const h=ne.wrap(e*o*d),m=ne.wrap(t*r*d),g=ne.wrap(n*o*d),p=r*d,f=this.minLimitPerlinNoise.getOctaveNoise(u);f&&(s+=f.noise(h,m,g,p,t*p)/d);const v=this.maxLimitPerlinNoise.getOctaveNoise(u);if(v&&(l+=v.noise(h,m,g,p,t*p)/d),u<8){const o=this.mainPerlinNoise.getOctaveNoise(u);o&&(c+=o.noise(ne.wrap(e*a*d),ne.wrap(t*i*d),ne.wrap(n*a*d),i*d,t*i*d)/d)}d/=2}return X(s/512,l/512,(c/10+1)/2)}}function $e(e,t){return e[t]>0?0:e[t+1]>0?150:255}const ke=["dimension","worldgen/noise-settings","worldgen/feature"],xe=[{id:"biome-noise",generator:"dimension",path:new v.Path(["generator","biome_source"]),predicate:e=>e.get(new v.Path(["generator","type"])).endsWith("noise"),preview:({data:e,shown:t})=>{var n;const[o,r]=h(2),[a,i]=h(G()),[s,l]=h(void 0),m=null==(n=e.type)?void 0:n.replace(/^minecraft:/,""),g=u(null),p=u([0,0]),v=u(void 0),_=u(),w=u();c((()=>{_.current=(t=4)=>{"multi_noise"!==m&&(t=1);const n=g.current.getContext("2d");g.current.width=200/t,g.current.height=200/t;const r=n.createImageData(g.current.width,g.current.height);ae(e,r,{biomeColors:{},offset:p.current,scale:o,seed:a,res:t}),n.putImageData(r,0,0),1!==t&&(clearTimeout(v.current),v.current=setTimeout((()=>_.current(1)),150))},w.current=(t,n)=>{const r=200*t/g.current.clientWidth,i=200*n/g.current.clientHeight,s=function(e,t,n,o){var r,a,i,s,l;const[c,d]=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);switch(null==(r=null==e?void 0:e.type)?void 0:r.replace(/^minecraft:/,"")){case"multi_noise":return se(re.map(((t,n)=>{const r=e[`${t}_noise`];return new oe(o.seed+n,r.firstOctave,r.amplitudes)})),e.biomes,c,d);case"fixed":return e.biome;case"checkerboard":const t=(null!=(a=e.scale)?a:2)+2,n=null!=(s=null==(i=e.biomes)?void 0:i.length)?s:0,r=(((c>>t)+(d>>t))%n+n)%n;return null==(l=e.biomes)?void 0:l[r]}}(e,r,i,{biomeColors:{},offset:p.current,scale:o,seed:a,res:1});l(s)}})),F(g.current,((e,t)=>{const n=200*e/g.current.clientWidth,o=200*t/g.current.clientHeight;p.current=[p.current[0]+n,p.current[1]+o],_.current()})),function(e,t){if(!e)return;const n=e=>{t(e.offsetX,e.offsetY)},o=()=>{t(void 0,void 0)};c((()=>(e.addEventListener("mousemove",n),e.addEventListener("mouseleave",o),()=>{e.removeEventListener("mousemove",n),e.removeEventListener("mouseleave",o)})),[e])}(g.current,((e,t)=>{void 0===e||void 0===t?l(void 0):w.current(e,t)}));const y=JSON.stringify(e);c((()=>{t&&_.current()}),[y,o,a,t]);const b=e=>{p.current[0]*=o/e,p.current[1]*=o/e,r(e)};return d(f,null,d("div",{class:"controls"},s&&d(E,{label:s,class:"no-pointer"}),("multi_noise"===m||"checkerboard"===m)&&d(f,null,d(E,{icon:"dash",onClick:()=>b(1.5*o)}),d(E,{icon:"plus",onClick:()=>b(o/1.5)})),"multi_noise"===m&&d(E,{icon:"sync",onClick:()=>i(G())})),d("canvas",{ref:g,width:"200",height:"200"}))}},{id:"noise-settings",generator:"worldgen/noise-settings",path:new v.Path(["noise"]),predicate:()=>!0,preview:({lang:e,data:t,shown:n})=>{const o=O.bind(null,e),[r,a]=h(G()),[i,s]=h(.1),[l,m]=h(.2),g=u(null),p=u(0),v=u();c((()=>{v.current=()=>{const e=g.current.getContext("2d"),n=t.height;g.current.width=n,g.current.height=n;const o=e.createImageData(g.current.width,g.current.height);!function(e,t,n){const o=new be(n.seed);o.reset(e,n.biomeDepth,n.biomeScale,n.offset,200);const r=t.data,a=4*t.width;for(let i=0;i<n.width;i+=1){const t=o.iterateNoiseColumn(i-n.offset).reverse();for(let n=0;n<e.height;n+=1){const e=n*a+4*i,o=$e(t,n);r[e]=o,r[e+1]=o,r[e+2]=o,r[e+3]=255}}}(t,o,{biomeDepth:i,biomeScale:l,offset:p.current,width:n,seed:r}),e.putImageData(o,0,0)}})),F(g.current,(e=>{const t=e*g.current.width/g.current.clientWidth;p.current=p.current+t,v.current()}));const _=JSON.stringify(t);return c((()=>{n&&v.current()}),[_,i,l,r,n]),d(f,null,d("div",{class:"controls"},d(A,{icon:"gear"},d(M,{type:"number",label:o("preview.depth"),value:`${i}`,onChange:e=>s(Number(e))}),d(M,{type:"number",label:o("preview.scale"),value:`${l}`,onChange:e=>m(Number(e))})),d(E,{icon:"sync",onClick:()=>a(G())})),d("canvas",{ref:g,width:"200",height:t.height}))}},{id:"decorator",generator:"worldgen/feature",path:new v.Path([]),predicate:()=>!0,preview:({data:e,version:t,shown:n})=>{const[o,r]=h(4),[a,i]=h(G()),s=u(null),l=u();c((()=>{l.current=()=>{const n=s.current.getContext("2d");s.current.width=16*o,s.current.height=16*o;const r=n.createImageData(s.current.width,s.current.height);!function(e,t,n){const o={placements:[],features:[],random:p(n.seed),biomeInfoNoise:new ne(n.seed+"frwynup",0,[1]),seaLevel:63,version:n.version};for(let a=0;a<n.size[0]/16;a+=1)for(let t=0;t<n.size[2]/16;t+=1)ve([16*a,0,16*t],e,o);const r=t.data;t.data.fill(255);for(const[a,i]of o.placements){if(a[0]<0||a[1]<0||a[2]<0||a[0]>=n.size[0]||a[1]>=n.size[1]||a[2]>=n.size[2])continue;const e=a[2]*(4*t.width)+4*a[0],s=i<ue.length?ue[i]:Y(o.features[i]);r[e]=U(50,205,s[0]),r[e+1]=U(50,205,s[1]),r[e+2]=U(50,205,s[2]),r[e+3]=255}for(let a=0;a<n.size[0];a+=1)for(let e=0;e<n.size[2];e+=1){if((Math.floor(a/16)+Math.floor(e/16))%2==0)continue;const n=e*(4*t.width)+4*a;for(let e=0;e<3;e+=1)r[n+e]=.85*r[n+e]}}(e,r,{seed:a,version:t,size:[16*o,128,16*o]}),n.putImageData(r,0,0)}}));const m=JSON.stringify(e);return c((()=>{n&&setTimeout((()=>l.current()))}),[m,o,a,n]),d(f,null,d("div",{class:"controls"},d(E,{icon:"dash",onClick:()=>r(Math.min(16,o+1))}),d(E,{icon:"plus",onClick:()=>r(Math.max(1,o-1))}),d(E,{icon:"sync",onClick:()=>i(G())})),d("canvas",{ref:s,width:"64",height:"64"}))}}];function ze({lang:e,model:t,version:n,id:o,shown:r}){const[,a]=h(0);return B(t,(()=>{a((e=>e+1))})),d(f,null,xe.filter((e=>e.generator===o)).map((o=>{const a=null==t?void 0:t.get(o.path);return t&&void 0!==a&&o.predicate(t)?o.preview({lang:e,model:t,data:a,version:n,shown:r}):d(f,null)})))}const Ee={base:({},e,t)=>t,choice({switchNode:e},t,n,o){return e.hook(this,t,n,o)},list({children:e},t,n,o){return Array.isArray(n)?n.map(((n,r)=>e.hook(this,t.push(r),n,o))):n},map({children:e,config:t},n,o,r){var a,i;if(void 0===o)return;const s="block_state_map"===(null==(a=t.validation)?void 0:a.validator)?null==(i=r.blockStates)?void 0:i[v.relativePath(n,t.validation.params.id).get()]:null,l={};return Object.keys(o).forEach((t=>{s&&!Object.keys(s.properties).includes(t)||(l[t]=e.hook(this,n.push(t),o[t],r))})),l},object({getActiveFields:e},t,n,o){if(null==n||"object"!=typeof n)return n;const r={},a=e(t);return Object.keys(a).filter((e=>a[e].enabled(t))).forEach((e=>{r[e]=a[e].hook(this,t.push(e),n[e],o)})),r}};["1.15","1.16","1.17"].forEach((e=>localStorage.removeItem(`cache_${e}`)));const Me="https://raw.githubusercontent.com/Arcensoth/mcdata",Ae="https://raw.githubusercontent.com/SPGoding/vanilla-datapack",Ce=[{id:"mcdata_master",hash:"836e6c1a1c85b56940f8a238906420486d810d45",url:Me},{id:"vanilla_datapack_summary",hash:"8a2f8022eb88840e6871ff6a72f63d6e64afc323",url:Ae}];async function je(e,t,n){const o=j.versions.find((t=>t.id===e));o?(console.debug(`[fetchData] ${JSON.stringify(o)}`),o.dynamic&&await Promise.all(Ce.filter((e=>localStorage.getItem(`cached_${e.id}`)!==e.hash)).map((async e=>{console.debug(`[deleteMatching] ${e.id} '${localStorage.getItem(`cached_${e.id}`)}' < '${e.hash}' ${e.url}/${o.refs[e.id]}`),await async function(e){try{const t=await caches.open("misode-v1");console.debug("[deleteMatching] Opened cache misode-v1");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-v1: ${t.message}`)}}((t=>t.startsWith(`${e.url}/${o.refs[e.id]}`))),console.debug(`[deleteMatching] Done! ${e.id} ${e.hash} '${localStorage.getItem(`cached_${e.id}`)}'`),localStorage.setItem(`cached_${e.id}`,e.hash),console.debug(`[deleteMatching] Set! ${e.id} ${e.hash} '${localStorage.getItem(`cached_${e.id}`)}'`)}))),await Promise.all([Ve(o,t),Le(o,n),Pe(o,t)])):console.error(`[fetchData] Unknown version ${o} in ${JSON.stringify(j.versions)}`)}async function Ve(e,t){console.debug(`[fetchRegistries] ${e.id}`);const n=j.registries.filter((e=>!e.dynamic)).filter((t=>Re(e.id,t.minVersion,t.maxVersion)));if(Re(e.id,void 0,"1.15")){const r=`${Me}/${e.refs.mcdata_master}/generated/reports/registries.json`;try{const e=await Ie(r,(e=>{const t={};return Object.keys(e).forEach((n=>{t[n.slice(10)]=Object.keys(e[n].entries)})),t}));n.forEach((n=>{var o;t.register(n.id,null!=(o=e[n.id])?o:[])}))}catch(o){console.warn("Error occurred while fetching registries:",o)}}else await Promise.all(n.map((async n=>{try{const o=n.path?`${Me}/${e.refs.mcdata_master}/${n.path}/data.min.json`:`${Me}/${e.refs.mcdata_master}/processed/reports/registries/${n.id}/data.min.json`;t.register(n.id,await Ie(o,(e=>e.values)))}catch(o){console.warn(`Error occurred while fetching registry ${n.id}:`,o)}})))}async function Le(e,t){if(console.debug(`[fetchBlockStateMap] ${e.id}`),Re(e.id,void 0,"1.16")){const o=Re(e.id,void 0,"1.15")?`${Me}/${e.refs.mcdata_master}/generated/reports/blocks.json`:`${Me}/${e.refs.mcdata_master}/processed/reports/blocks/data.min.json`;try{const e=await Ie(o,(e=>{const t={};return Object.keys(e).forEach((n=>{t[n]={properties:e[n].properties,default:e[n].states.find((e=>e.default)).properties}})),t}));Object.assign(t,e)}catch(n){console.warn("Error occurred while fetching block state map:",n)}}else{const o=`${Me}/${e.refs.mcdata_master}/processed/reports/blocks/simplified/data.min.json`;try{const e=await Ie(o);Object.assign(t,e)}catch(n){console.warn("Error occurred while fetching block state map:",n)}}}async function Pe(e,t){console.debug(`[fetchDynamicRegistries] ${e.id}`);const n=j.registries.filter((e=>e.dynamic)).filter((t=>Re(e.id,t.minVersion,t.maxVersion)));if(Re(e.id,"1.16")){const r=`${Ae}/${e.refs.vanilla_datapack_summary}/summary/flattened.min.json`;try{const e=await Ie(r);n.forEach((n=>{t.register(n.id,e[n.id])}))}catch(o){console.warn("Error occurred while fetching dynamic registries:",o)}}}async function Ie(e,t=(e=>e)){try{const n=await caches.open("misode-v1");console.debug(`[getData] Opened cache misode-v1 ${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-v1: ${n.message}`),console.debug(`[getData] fetching data ${e}`);const o=await fetch(e);return t(await o.json())}}const De=["1.15","1.16","1.17"],Se={},Oe={},Ne={1.15:_,1.16:w,1.17:y};async function Te(e){return Se[e]||(Se[e]=(async()=>{try{const t=Ne[e].getCollections(),n={};await je(e,t,n);const o=Ne[e].getSchemas(t);return Se[e]={collections:t,schemas:o,blockStates:n},Se[e]}catch(t){throw new Error(`Cannot get version "${e}": ${t.message}`)}})()),Se[e]}function Re(e,t,n){const o=j.versions.findIndex((t=>t.id===e)),r=t?j.versions.findIndex((e=>e.id===t)):0,a=n?j.versions.findIndex((e=>e.id===n)):j.versions.length-1;return r<=o&&o<=a}var He,Be;(Be=He||(He={})).ID_LANGUAGE="language",Be.ID_THEME="theme",Be.ID_VERSION="schema_version",Be.ID_INDENT="indentation",Be.getLanguage=function(){var e;return null!=(e=localStorage.getItem(Be.ID_LANGUAGE))?e:"en"},Be.getTheme=function(){var e;return null!=(e=localStorage.getItem(Be.ID_THEME))?e:"dark"},Be.getVersion=function(){const e=localStorage.getItem(Be.ID_VERSION);return e&&De.includes(e)?e:"1.17"},Be.getIndent=function(){var e;return null!=(e=localStorage.getItem(Be.ID_INDENT))?e:"2_spaces"},Be.setLanguage=function(e){e&&localStorage.setItem(Be.ID_LANGUAGE,e)},Be.setTheme=function(e){e&&localStorage.setItem(Be.ID_THEME,e)},Be.setVersion=function(e){e&&localStorage.setItem(Be.ID_VERSION,e)},Be.setIndent=function(e){e&&localStorage.setItem(Be.ID_INDENT,e)};const Fe={"2_spaces":2,"4_spaces":4,tabs:"\t"};function We({lang:e,name:t,model:n,blockStates:o,doCopy:r,doDownload:a,doImport:i,onError:s}){const l=O.bind(null,e),[m,g]=h(He.getIndent()),p=u(null),_=u(null),w=u();c((()=>{w.current=()=>{if(n&&o)try{const e={blockStates:null!=o?o:{}},t=n.schema.hook(Ee,new v.ModelPath(n),n.data,e);p.current.value=JSON.stringify(t,null,Fe[m])+"\n"}catch(e){s(`Error getting JSON output: ${e.message}`),console.error(e),p.current.value=""}}})),B(n,(()=>{w.current()})),c((()=>{w.current()}),[m]);c((()=>{r&&p.current&&(p.current.select(),document.execCommand("copy"))}),[r]),c((()=>{if(a&&p.current&&_.current){const e=encodeURIComponent(p.current.value);_.current.setAttribute("href",`data:text/json;charset=utf-8,${e}`),_.current.setAttribute("download",`${t}.json`),_.current.click()}}),[a]),c((()=>{i&&p.current&&(p.current.value="",p.current.select())}),[i]);return d(f,null,d("div",{class:"controls"},d(A,{icon:"gear"},Object.entries(Fe).map((([e])=>d(E,{label:l(`indentation.${e}`),active:m===e,onClick:()=>{return t=e,He.setIndent(t),void g(t);var t}}))))),d("textarea",{ref:p,class:"source",onChange:()=>{try{const e=JSON.parse(p.current.value);null==n||n.reset(e,!1)}catch(e){}},spellcheck:!1,autocorrect:"off",placeholder:l("source_placeholder")}),d("a",{ref:_,style:"display: none;"}))}class Ge{constructor(){this.registry={}}register(e){const t=G();return this.registry[t]=e,t}on(e,t){return this.register((n=>{n.addEventListener(e,(e=>{t(n),e.stopPropagation()}))}))}onChange(e){return this.on("change",e)}onClick(e){return this.on("click",e)}mounted(e){e.querySelectorAll("[data-id]").forEach((e=>{var t,n;const o=e.getAttribute("data-id");null==(n=(t=this.registry)[o])||n.call(t,e)})),this.registry={}}}const qe={clippy:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><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"></path></svg>',info:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><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"></path></svg>',issue_opened:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><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"></path></svg>',plus_circle:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><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"></path></svg>',trashcan:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><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"></path></svg>'},Je=["loot_table.type","loot_entry.type","function.function","condition.condition","criterion.trigger","dimension.generator.type","dimension.generator.biome_source.type","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"],Ye=["number_provider.type","score_provider.type","nbt_provider.type","int_provider.type","float_provider.type","height_provider.type"],Ue=["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"],Xe=["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"],Ke=new v.DataModel(v.MapNode(v.StringNode(),v.StringNode()),{historyMax:0}),Qe={base:()=>["","",""],boolean({node:e},t,n,o){const r=o.mounter.onClick((()=>{t.model.set(t,!(!e.optional()||!1!==n)&&void 0)})),a=o.mounter.onClick((()=>{t.model.set(t,!e.optional()||!0!==n||void 0)}));return["",`<button${!1===n?' class="selected"':" "} \n\t\t\t\tdata-id="${r}">${q(o.loc("false"))}</button>\n\t\t\t<button${!0===n?' class="selected"':" "} \n\t\t\t\tdata-id="${a}">${q(o.loc("true"))}</button>`,""]},choice({choices:e,config:t,switchNode:n},o,r,a){const i=n.activeCase(o,!0),s=(null==t?void 0:t.context)?new v.ModelPath(o.getModel(),new v.Path(o.getArray(),[t.context])):o,l=(null==t?void 0:t.choiceContext)?new v.Path([],[t.choiceContext]):(null==t?void 0:t.context)?new v.Path([],[t.context]):o,[c,d,u]=i.node.hook(this,s,r,a);if(1===e.length)return[c,d,u];return[c,`<select data-id="${a.mounter.register((t=>{t.value=i.type,t.addEventListener("change",(()=>{var n;const a=null!=(n=e.find((e=>e.type===t.value)))?n:i;o.model.set(o,a.change?a.change(r):a.node.default())}))}))}">\n\t\t\t${e.map((e=>`<option value="${q(e.type)}">\n\t\t\t\t${q(tt(a.loc,l.contextPush(e.type)))}\n\t\t\t</option>`)).join("")}\n\t\t</select>`+d,u]},list({children:e},t,n,o){const r=o.mounter.onClick((()=>{Array.isArray(n)||(n=[]),t.model.set(t,[e.default(),...n])})),a=o.mounter.onClick((()=>{Array.isArray(n)||(n=[]),t.model.set(t,[...n,e.default()])})),i=`<button class="add" data-id="${r}" aria-label="${o.loc("button.add")}">${qe.plus_circle}</button>`;let s="";return Array.isArray(n)&&(s=n.map(((n,r)=>{const a=o.mounter.onClick((()=>t.model.set(t.push(r),void 0))),i=t.push(r).contextPush("entry"),s=e.category(i),[l,c,d]=e.hook(this,i,n,o);return`<div class="node-entry"><div class="node ${e.type(i)}-node" ${s?`data-category="${q(s)}"`:""}>\n\t\t\t\t\t<div class="node-header">\n\t\t\t\t\t\t${nt(o.loc,i,o.mounter)}\n\t\t\t\t\t\t${ot(o.loc,i,o.mounter)}\n\t\t\t\t\t\t<button class="remove" data-id="${a}" aria-label="${o.loc("button.remove")}">${qe.trashcan}</button>\n\t\t\t\t\t\t${l}\n\t\t\t\t\t\t<label ${at(o.loc,i,o.mounter)}>\n\t\t\t\t\t\t\t${q(tt(o.loc,i,`${r}`))}\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t${c}\n\t\t\t\t\t</div>\n\t\t\t\t\t${d?`<div class="node-body">${d}</div>`:""}\n\t\t\t\t\t</div>\n\t\t\t\t</div>`})).join(""),n.length>2&&(s+=`<div class="node-entry">\n\t\t\t\t\t<div class="node node-header">\n\t\t\t\t\t\t<button class="add" data-id="${a}" aria-label="${o.loc("button.add")}">${qe.plus_circle}</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>`)),["",i,s]},map({children:e,keys:t,config:n},o,r,a){var i,s,l,c;const d=new v.ModelPath(Ke,new v.Path([et(o.toString())])),u=a.mounter.onClick((()=>{const t=d.get();o.model.set(o.push(t),e.default())})),h="block_state_map"===(null==(i=n.validation)?void 0:i.validator)?null==(s=a.blockStates)?void 0:s[v.relativePath(o,n.validation.params.id).get()]:null,m=((null==h?void 0:h.properties)?v.StringNode(null,{enum:Object.keys(null!=(l=h.properties)?l:{})}):t).hook(this,d,null!=(c=d.get())?c:"",a)[1]+`<button class="add" data-id="${u}" aria-label="${a.loc("button.add")}">${qe.plus_circle}</button>`;if(h&&"Properties"===o.last()){"object"!=typeof r&&(r={});const e=Object.entries(h.properties).map((([e,t])=>[e,v.StringNode(null,{enum:t})]));return Object.entries(h.properties).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])})),v.ObjectNode(Object.fromEntries(e)).hook(this,o,r,a)}let g="";return"object"==typeof r&&void 0!==r&&(g=Object.keys(r).map((t=>{var n;const i=a.mounter.onClick((()=>o.model.set(o.push(t),void 0))),s=o.modelPush(t),l=e.category(s),c=h?v.StringNode(null,{enum:null!=(n=h.properties[t])?n:[]}):e;(null==h?void 0:h.properties[t])&&!h.properties[t].includes(r[t])&&o.model.errors.add(s,"error.invalid_enum_option",r[t]);const[d,u,m]=c.hook(this,s,r[t],a);return`<div class="node-entry"><div class="node ${e.type(s)}-node" ${l?`data-category="${q(l)}"`:""}>\n\t\t\t\t\t\t<div class="node-header">\n\t\t\t\t\t\t\t${nt(a.loc,s,a.mounter)}\n\t\t\t\t\t\t\t${ot(a.loc,s,a.mounter)}\n\t\t\t\t\t\t\t<button class="remove" data-id="${i}" aria-label="${a.loc("button.remove")}">${qe.trashcan}</button>\n\t\t\t\t\t\t\t${d}\n\t\t\t\t\t\t\t<label ${at(a.loc,s,a.mounter)}>\n\t\t\t\t\t\t\t\t${q(t)}\n\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t${u}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t${m?`<div class="node-body">${m}</div>`:""}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>`})).join("")),["",m,g]},number({integer:e,config:t},n,o,{mounter:r}){var a;const i=r.onChange((o=>{const r=o.value,a=(null==t?void 0:t.color)?parseInt(r.slice(1),16):e?parseInt(r):parseFloat(r);n.model.set(n,a)}));if(null==t?void 0:t.color){return["",`<input type="color" data-id="${i}" value="#${null!=(a=null==o?void 0:o.toString(16).padStart(6,"0"))?a:"000000"}">`,""]}return["",`<input data-id="${i}" value="${null!=o?o:""}">`,""]},object({node:e,getActiveFields:t,getChildModelPath:n},o,r,a){let i="",s="";e.optional()&&(s=void 0===r?`<button class="collapse closed" data-id="${a.mounter.onClick((()=>o.model.set(o,e.default())))}" aria-label="${a.loc("button.expand")}">${qe.plus_circle}</button>`:`<button class="collapse open" data-id="${a.mounter.onClick((()=>o.model.set(o,void 0)))}" aria-label="${a.loc("button.collapse")}">${qe.trashcan}</button>`);let l="";if("object"==typeof r&&void 0!==r&&(!e.optional()||void 0!==r)){const e=t(o);l=Object.keys(e).filter((t=>e[t].enabled(o))).map((t=>{const l=e[t],c=n(o,t),d=c.getContext().join(".");if(Ye.includes(d))return"";const u=l.category(c),[h,m,g]=l.hook(this,c,r[t],a);if(0===h.length&&0===m.length&&0===g.length)return"";const p="object"===l.type(c)&&Ue.includes(d),f=Xe.includes(d);return p||f?(i+=`${nt(a.loc,c,a.mounter)}${ot(a.loc,c,a.mounter)}${h}`,s+=m,p?g:""):`<div class="node ${l.type(c)}-node ${g?"":"no-body"}" ${u?`data-category="${q(u)}"`:""}>\n\t\t\t\t\t<div class="node-header">\n\t\t\t\t\t\t${nt(a.loc,c,a.mounter)}\n\t\t\t\t\t\t${ot(a.loc,c,a.mounter)}\n\t\t\t\t\t\t${h}\n\t\t\t\t\t\t<label ${at(a.loc,c,a.mounter)}>\n\t\t\t\t\t\t\t${tt(a.loc,c)}\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t${m}\n\t\t\t\t\t</div>\n\t\t\t\t\t${g?`<div class="node-body">${g}</div>`:""}\n\t\t\t\t</div>`})).join("")}return[i,s,l]},string({node:e,getValues:t,config:n},o,r,a){var i,s;const l=a.mounter.register((e=>{e.value=null!=r?r:"",e.addEventListener("change",(t=>{const n=e.value;o.model.set(o,0===n.length?void 0:n),t.stopPropagation()}))}));let c;const d=t();if(Ze(n)&&!n.additional||Je.includes(o.getContext().join("."))){let t=new v.Path([]);Ze(n)&&"string"==typeof n.enum?t=t.contextPush(n.enum):Ze(n)||"resource"!==(null==n?void 0:n.validator)||"string"!=typeof n.params.pool||(t=t.contextPush(n.params.pool)),c=`<select data-id="${l}">\n\t\t\t\t${e.optional()?`<option value="">${a.loc("unset")}</option>`:""}\n\t\t\t\t${d.map((e=>`<option value="${q(e)}">\n\t\t\t\t\t${tt(a.loc,t.contextPush(e.replace(/^minecraft:/,"")))}\n\t\t\t\t</option>`)).join("")}\n\t\t\t</select>`}else if(Ze(n)||"block_state_key"!==(null==n?void 0:n.validator)){const e=G();c=`<input data-id="${l}" ${0===d.length?"":`list="${e}"`}>\n\t\t\t\t${0===d.length?"":`<datalist id="${e}">\n\t\t\t\t\t\t\t\t${d.map((e=>`<option value="${q(e)}">`)).join("")}\n\t\t</datalist>`}`}else{const e=null==(i=a.blockStates)?void 0:i[v.relativePath(o,n.params.id).get()];c=`<select data-id="${l}">\n\t\t\t\t${Object.keys(null!=(s=null==e?void 0:e.properties)?s:{}).map((e=>`<option>${e}</option>`)).join("")}\n\t\t\t</select>`}return["",c,""]}};function Ze(e){return!!(null==e?void 0:e.enum)}function et(e){var t,n=0;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n}function tt(e,t,...n){const o=t.getContext();for(let r=0;r<o.length;r+=1){const t=o.slice(r).join("."),a=e(t,...n);if(t!==a)return a}return q(o[o.length-1])}function nt(e,t,n){const o=t.model.errors.get(t,!0);if(0===o.length)return"";const r=o[0].params?e(o[0].error,...o[0].params):e(o[0].error);return rt("node-error","issue_opened",q(r),n)}function ot(e,t,n){const o=t.contextPush("help").getContext().join("."),r=e(o);return r===o?"":rt("node-help","info",q(r),n)}const rt=(e,t,n,o)=>`<div class="node-icon ${e}" data-id="${o.onClick((e=>{e.getElementsByTagName("span")[0].classList.add("show"),document.body.addEventListener("click",(()=>{e.getElementsByTagName("span")[0].classList.remove("show")}),{capture:!0,once:!0})}))}">\n\t\t${qe[t]}\n\t\t<span class="icon-popup">${n}</span>\n\t</div>`,at=(e,t,n)=>`data-id="${n.register((n=>{const o=()=>{var o;const r=document.createElement("div");r.classList.add("node-menu");const a=e(t.contextPush("help").getContext().join("."));a.endsWith(".help")||r.insertAdjacentHTML("beforeend",`<span class="menu-item help-item">${a}</span>`);const i=t.getContext().join(".");r.insertAdjacentHTML("beforeend",`\n\t\t\t\t<div class="menu-item">\n\t\t\t\t\t<span class="btn">${qe.clippy}</span>\n\t\t\t\t\tContext: \n\t\t\t\t\t<span class="menu-item-context">${i}</span>\n\t\t\t\t</div>`),null==(o=r.querySelector(".menu-item .btn"))||o.addEventListener("click",(()=>{const e=document.createElement("input");e.value=i,n.appendChild(e),e.select(),document.execCommand("copy"),n.removeChild(e)})),n.appendChild(r),document.body.addEventListener("click",(()=>{try{n.removeChild(r)}catch(e){}}),{capture:!0,once:!0}),document.body.addEventListener("contextmenu",(()=>{try{n.removeChild(r)}catch(e){}}),{capture:!0,once:!0})};n.addEventListener("contextmenu",(e=>{o(),e.preventDefault()}));let r=null;n.addEventListener("touchstart",(()=>{r=setTimeout((()=>{o(),r=null}),800)})),n.addEventListener("touchend",(()=>{r&&(clearTimeout(r),r=null)}))}))}"`;function it({lang:e,model:t,version:n,blockStates:o,onError:r}){const a=u(null),i=u();return c((()=>{i.current=()=>{if(t&&o)try{const r=new Ge,i={loc:O.bind(null,e),version:n,mounter:r,blockStates:o},s=new v.ModelPath(t),l=t.schema.hook(Qe,s,t.data,i),c=t.schema.category(s),d=t.schema.type(s);let u=l[2];l[1]&&(u=`<div class="node ${d}-node" ${c?`data-category="${c}"`:""}>\n\t\t\t\t\t\t<div class="node-header">${l[0]}${l[1]}</div>\n\t\t\t\t\t\t<div class="node-body">${l[2]}</div>\n\t\t\t\t\t</div>`),a.current.innerHTML=u,r.mounted(a.current)}catch(i){r(`Error rendering the tree: ${i.message}`),console.error(i),a.current.innerHTML=""}}})),B(t,(()=>{i.current()})),c((()=>{i.current()}),[e,t,o]),d("div",{ref:a,class:"tree"})}function st({lang:e}){const t=O.bind(null,e);return d("main",null,d("div",{class:"settings"},d("p",null,t("settings.fields.description")),d("ul",{class:"field-list"})))}function lt({lang:e,changeTitle:t,version:n,onChangeVersion:o,category:r,generator:a}){var i,u,m;const g=O.bind(null,e),[p,_]=h(""),[w]=b();if(w)return d("main",null,d(C,{error:`Something went wrong rendering the generator: ${w.message}`}));const y=r?`${r}/${a}`:null!=a?a:"",$=j.models.find((e=>e.id===y));if(!$)return d("main",null,d(C,{error:`Cannot find generator "${y}"`}));const k=null!=(u=null==(i=j.models.find((e=>e.id===y)))?void 0:i.minVersion)?u:"1.15",V=j.versions.filter((e=>Re(e.id,k))).map((e=>e.id));t(g("title.generator",g(y)),V);const[L,P]=h(null),[I,D]=h(null);c((()=>{P(null),async function(e){return(await Te(e)).blockStates}(n).then((e=>D(e))),async function(e,t){var n;if(!Oe[t]||Oe[t].version!==e){const r=await Te(e),a=null==(n=j.models.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 v.DataModel(n);Oe[t]?o.reset(Oe[t].model.data,!1):(o.validate(!0),o.history=[JSON.stringify(o.data)]),Oe[t]={model:o,version:e}}catch(o){throw new Error(`Cannot get generator "${t}" for version "${e}": ${o.message}`)}}return Oe[t].model}(n,y).then((e=>P(e))).catch((e=>_(e.message)))}),[n,r,a]);const S=e=>{e.ctrlKey&&"z"===e.key?(x.generatorEvent("undo","Hotkey"),null==L||L.undo()):e.ctrlKey&&"y"===e.key&&(x.generatorEvent("redo","Hotkey"),null==L||L.redo())};c((()=>(document.addEventListener("keyup",S),()=>{document.removeEventListener("keyup",S)})),[L]);const[N,T]=h(""),[R,B]=h([]),F=($.category?$.category+"/":"")+$.schema;c((()=>{$.path&&async function(e){return(await Te(e)).collections}(n).then((e=>{const t=(null!=N?N:"").trim().split(" "),n=e.get(F).map((e=>e.slice(10))).filter((e=>t.every((t=>e.includes(t)))));n&&B(n)})).catch((e=>_(e.message)))}),[n,r,a,N]);const W=e=>{x.generatorEvent("load-preset",e),async function(e,t,n){console.debug(`[fetchPreset] ${n} ${t} ${n}`);const o=j.versions.find((t=>t.id===e));try{const e=await fetch(`${Ae}/${o.refs.vanilla_datapack_data}/data/minecraft/${t}/${n}.json`);return await e.json()}catch(r){console.warn(`Error occurred while fetching ${t} preset ${n}:`,r)}}(n,$.path,e).then((e=>{null==L||L.reset(e,!1)}))},[G,q]=h(window.innerWidth>820),[J,Y]=h(0),[U,X]=h(0),[K,Q]=h(0),[Z,ee]=h(!1),te=ke.includes(y);let ne=1;te&&(ne+=1),G&&(ne+=2);return d(f,null,d("main",{class:Z?"has-preview":""},d(z,{id:"data-pack-generator",type:"text"}),d("div",{class:"controls"},d(E,{icon:"upload",label:g("import"),onClick:()=>{x.generatorEvent("import"),q(!0),Q(K+1)}}),$.path&&d(A,{icon:"archive",label:g("presets"),relative:!1},d(M,{icon:"search",large:!0,value:N,onChange:T,doSelect:1}),d("div",{class:"result-list"},R.map((e=>d(E,{label:e,onClick:()=>W(e)})))),0===R.length&&d(E,{label:g("no_presets")})),d(A,{icon:"tag",label:n},V.reverse().map((e=>d(E,{label:e,active:e===n,onClick:()=>o(e)})))),d(A,{icon:"kebab_horizontal"},d(E,{icon:"history",label:g("reset"),onClick:()=>{x.generatorEvent("reset"),null==L||L.reset(L.schema.default(),!0)}}),d(E,{icon:"arrow_left",label:g("undo"),onClick:e=>{e.stopPropagation(),x.generatorEvent("undo","Menu"),null==L||L.undo()}}),d(E,{icon:"arrow_right",label:g("redo"),onClick:e=>{e.stopPropagation(),x.generatorEvent("redo","Menu"),null==L||L.redo()}}))),p&&d(C,{error:p}),d(it,l(s({},{lang:e,model:L,version:n,blockStates:I}),{onError:_}))),d("div",{class:"popup-actions",style:`--offset: -${10+50*ne}px;`},d("div",{class:"popup-action action-preview"+(te?" shown":""),onClick:()=>{x.generatorEvent("toggle-preview",Z?"hidden":"visible"),ee(!Z)}},Z?H.x_circle:H.play),d("div",{class:"popup-action action-download"+(G?" shown":""),onClick:()=>{x.generatorEvent("download"),X(U+1)}},H.download),d("div",{class:"popup-action action-copy"+(G?" shown":""),onClick:()=>{x.generatorEvent("copy"),Y(J+1)}},H.clippy),d("div",{class:"popup-action action-code shown",onClick:()=>{x.generatorEvent("toggle-output",G?"hidden":"visible"),q(!G),Y(0),X(0),Q(0)}},G?H.chevron_right:H.code)),d("div",{class:"popup-preview"+(Z?" shown":"")},d(ze,l(s({},{lang:e,model:L,version:n,id:y}),{shown:Z,onError:_}))),d("div",{class:"popup-source"+(G?" shown":"")},d(We,l(s({},{lang:e,model:L,blockStates:I,doCopy:J,doDownload:U,doImport:K}),{name:null!=(m=$.schema)?m:"data",onError:_}))))}function ct({lang:e,changeTitle:t,category:n}){const o=O.bind(null,e);return t(n?o("title.generator_category",o(n)):o("title.home")),d("main",null,d("div",{class:"home"},d("div",{class:"generator-picker"},d("ul",{class:"generators-list"},j.models.filter((e=>"string"!=typeof e.category)).map((e=>d("li",null,d(m,{class:"generators-card"+(!0===e.category&&e.id===n?" selected":""),href:J(e.id)},o(e.id),e.category&&H.chevron_right))))),n&&j.models.some((e=>e.category===n))&&d("ul",{class:"generators-list"},j.models.filter((e=>e.category===n)).map((e=>d("li",null,d(m,{class:"generators-card",href:J(e.id)},o(e.id)))))))))}function dt(){const[e,t]=h("en");c((()=>{(async()=>{const e=He.getLanguage();await Promise.all([N("en"),..."en"!==e?[N(e)]:[]]),t(e)})()}),[]);const[n,o]=h(He.getTheme());c((()=>{document.documentElement.setAttribute("data-theme",n)}),[n]);const[r,a]=h(He.getVersion()),i=e=>{x.setVersion(e),He.setVersion(e),a(e)},[u,m]=h(O(e,"title.home")),g=(e,t=["1.15","1.16","1.17"])=>{document.title=`${e} Minecraft ${t.join(", ")}`,m(e)};return d(f,null,d(R,s({},{lang:e,title:u,theme:n,language:e,changeLanguage:async e=>{S[e]||await N(e),x.setLanguage(e),He.setLanguage(e),t(e)},changeTheme:e=>{x.setTheme(e),He.setTheme(e),o(e)}})),d(k,{onChange:e=>{setTimeout((()=>x.pageview(J(e.url))))}},d(ct,s({path:"/"},{lang:e,changeTitle:g})),d(st,s({path:"/settings/fields"},{lang:e,changeTitle:g})),d(ct,s({path:"/worldgen",category:"worldgen"},{lang:e,changeTitle:g})),d(lt,l(s({path:"/:generator"},{lang:e,version:r,changeTitle:g}),{onChangeVersion:i})),d(lt,l(s({path:"/worldgen/:generator",category:"worldgen"},{lang:e,version:r,changeTitle:g}),{onChangeVersion:i}))))}$(d(dt,null),document.body);
|
|
//# sourceMappingURL=index.532ff40b.js.map
|