var Vt=i=>{throw TypeError(i)};var wt=(i,t,e)=>t.has(i)||Vt("Cannot "+e);var j=(i,t,e)=>(wt(i,t,"read from private field"),e?e.call(i):t.get(i)),X=(i,t,e)=>t.has(i)?Vt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(i):t.set(i,e),pt=(i,t,e,s)=>(wt(i,t,"write to private field"),s?s.call(i,e):t.set(i,e),e),ft=(i,t,e)=>(wt(i,t,"access private method"),e);import{r as ae,d as _e,c as k,p as Zt,a as qt,b as T,t as xe,e as D,S as le,E as Ae,F as we,f as Se,g as Ee,o as Pe,h as vt,i as P,j as Q,k as Ce,l as z,m as Te,n as ke,s as Le,q as Me,u as Jt}from"./Frame-Cpo70DD7.js";import{m as M,R as Ue,C as Oe,S as Re}from"./index-BcyptosN.js";import{L as Ne,F as Fe}from"./LayersPanel-BajTPlsd.js";const mt=globalThis,kt=mt.ShadowRoot&&(mt.ShadyCSS===void 0||mt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lt=Symbol(),Wt=new WeakMap;let ce=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==Lt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(kt&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=Wt.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Wt.set(e,t))}return t}toString(){return this.cssText}};const He=i=>new ce(typeof i=="string"?i:i+"",void 0,Lt),Ie=(i,...t)=>{const e=i.length===1?i[0]:t.reduce((s,r,o)=>s+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+i[o+1],i[0]);return new ce(e,i,Lt)},je=(i,t)=>{if(kt)i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const s=document.createElement("style"),r=mt.litNonce;r!==void 0&&s.setAttribute("nonce",r),s.textContent=e.cssText,i.appendChild(s)}},Kt=kt?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return He(e)})(i):i;const{is:ze,defineProperty:Be,getOwnPropertyDescriptor:De,getOwnPropertyNames:Ve,getOwnPropertySymbols:Ze,getPrototypeOf:qe}=Object,bt=globalThis,Gt=bt.trustedTypes,Je=Gt?Gt.emptyScript:"",We=bt.reactiveElementPolyfillSupport,et=(i,t)=>i,$t={toAttribute(i,t){switch(t){case Boolean:i=i?Je:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},Mt=(i,t)=>!ze(i,t),Xt={attribute:!0,type:String,converter:$t,reflect:!1,hasChanged:Mt};Symbol.metadata??=Symbol("metadata"),bt.litPropertyMetadata??=new WeakMap;class V extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Xt){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),r=this.getPropertyDescriptor(t,s,e);r!==void 0&&Be(this.prototype,t,r)}}static getPropertyDescriptor(t,e,s){const{get:r,set:o}=De(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get(){return r?.call(this)},set(n){const c=r?.call(this);o.call(this,n),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Xt}static _$Ei(){if(this.hasOwnProperty(et("elementProperties")))return;const t=qe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(et("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(et("properties"))){const e=this.properties,s=[...Ve(e),...Ze(e)];for(const r of s)this.createProperty(r,e[r])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,r]of e)this.elementProperties.set(s,r)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const r=this._$Eu(e,s);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const r of s)e.unshift(Kt(r))}else t!==void 0&&e.push(Kt(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return je(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){const s=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,s);if(r!==void 0&&s.reflect===!0){const o=(s.converter?.toAttribute!==void 0?s.converter:$t).toAttribute(e,s.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){const s=this.constructor,r=s._$Eh.get(t);if(r!==void 0&&this._$Em!==r){const o=s.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:$t;this._$Em=r,this[r]=n.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,s){if(t!==void 0){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??Mt)(this[t],e))return;this.P(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[r,o]of s)o.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],o)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(s=>s.hostUpdate?.()),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach(e=>this._$EC(e,this[e])),this._$EU()}updated(t){}firstUpdated(t){}}V.elementStyles=[],V.shadowRootOptions={mode:"open"},V[et("elementProperties")]=new Map,V[et("finalized")]=new Map,We?.({ReactiveElement:V}),(bt.reactiveElementVersions??=[]).push("2.0.4");const Ut=globalThis,yt=Ut.trustedTypes,Yt=yt?yt.createPolicy("lit-html",{createHTML:i=>i}):void 0,he="$lit$",L=`lit$${Math.random().toFixed(9).slice(2)}$`,de="?"+L,Ke=`<${de}>`,R=document,it=()=>R.createComment(""),rt=i=>i===null||typeof i!="object"&&typeof i!="function",Ot=Array.isArray,Ge=i=>Ot(i)||typeof i?.[Symbol.iterator]=="function",St=`[ \f\r]`,Y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Qt=/-->/g,te=/>/g,U=RegExp(`>|${St}(?:([^\\s"'>=/]+)(${St}*=${St}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),ee=/'/g,se=/"/g,ue=/^(?:script|style|textarea|title)$/i,Xe=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),B=Xe(1),N=Symbol.for("lit-noChange"),m=Symbol.for("lit-nothing"),ie=new WeakMap,O=R.createTreeWalker(R,129);function pe(i,t){if(!Ot(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return Yt!==void 0?Yt.createHTML(t):t}const Ye=(i,t)=>{const e=i.length-1,s=[];let r,o=t===2?"":t===3?"":"",n=Y;for(let c=0;c"?(n=r??Y,h=-1):d[1]===void 0?h=-2:(h=n.lastIndex-d[2].length,p=d[1],n=d[3]===void 0?U:d[3]==='"'?se:ee):n===se||n===ee?n=U:n===Qt||n===te?n=Y:(n=U,r=void 0);const b=n===U&&i[c+1].startsWith("/>")?" ":"";o+=n===Y?a+Ke:h>=0?(s.push(p),a.slice(0,h)+he+a.slice(h)+L+b):a+L+(h===-2?c:b)}return[pe(i,o+(i[e]||">")+(t===2?"":t===3?"":"")),s]};class ot{constructor({strings:t,_$litType$:e},s){let r;this.parts=[];let o=0,n=0;const c=t.length-1,a=this.parts,[p,d]=Ye(t,e);if(this.el=ot.createElement(p,s),O.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=O.nextNode())!==null&&a.length0){r.textContent=yt?yt.emptyScript:"";for(let b=0;b2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=m}_$AI(t,e=this,s,r){const o=this.strings;let n=!1;if(o===void 0)t=W(this,t,e,0),n=!rt(t)||t!==this._$AH&&t!==N,n&&(this._$AH=t);else{const c=t;let a,p;for(t=o[0],a=0;a{const s=e?.renderBefore??t;let r=s._$litPart$;if(r===void 0){const o=e?.renderBefore??null;s._$litPart$=r=new at(t.insertBefore(it(),o),o,void 0,e??{})}return r._$AI(i),r};let st=class extends V{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=os(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return N}};st._$litElement$=!0,st.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:st});const ns=globalThis.litElementPolyfillSupport;ns?.({LitElement:st});(globalThis.litElementVersions??=[]).push("4.1.1");const as={attribute:!0,type:String,converter:$t,reflect:!1,hasChanged:Mt},ls=(i=as,t,e)=>{const{kind:s,metadata:r}=e;let o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),o.set(e.name,i),s==="accessor"){const{name:n}=e;return{set(c){const a=t.get.call(this);t.set.call(this,c),this.requestUpdate(n,a,i)},init(c){return c!==void 0&&this.P(n,void 0,i),c}}}if(s==="setter"){const{name:n}=e;return function(c){const a=this[n];t.call(this,c),this.requestUpdate(n,a,i)}}throw Error("Unsupported decorator location: "+s)};function fe(i){return(t,e)=>typeof e=="object"?ls(i,t,e):((s,r,o)=>{const n=r.hasOwnProperty(o);return r.constructor.createProperty(o,n?{...s,wrapped:!0}:s),n?Object.getOwnPropertyDescriptor(r,o):void 0})(i,t,e)}function ge(i){return fe({...i,state:!0,attribute:!1})}const cs=(i,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(i,t,e),e);let hs;function ds(i){return(t,e)=>cs(t,e,{get(){return(this.renderRoot??(hs??=document.createDocumentFragment())).querySelectorAll(i)}})}const us={ATTRIBUTE:1},ps=i=>(...t)=>({_$litDirective$:i,values:t});class fs{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}const gs=ps(class extends fs{constructor(i){if(super(i),i.type!==us.ATTRIBUTE||i.name!=="class"||i.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter(t=>i[t]).join(" ")+" "}update(i,[t]){if(this.st===void 0){this.st=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in t)t[s]&&!this.nt?.has(s)&&this.st.add(s);return this.render(t)}const e=i.element.classList;for(const s of this.st)s in t||(e.remove(s),this.st.delete(s));for(const s in t){const r=!!t[s];r===this.st.has(s)||this.nt?.has(s)||(r?(e.add(s),this.st.add(s)):(e.remove(s),this.st.delete(s)))}return N}});function*ms(i,t){if(i!==void 0){let e=0;for(const s of i)yield t(s,e++)}}function Et(i,t,e){return i?t(i):e?.(i)}var $s=Object.defineProperty,xt=(i,t,e,s)=>{for(var r=void 0,o=i.length-1,n;o>=0;o--)(n=i[o])&&(r=n(t,e,r)||r);return r&&$s(t,e,r),r};function ys(i){return i instanceof RegExp}function Pt(i){return i===null?"null":Array.isArray(i)?"array":i.constructor.name.toLowerCase()}function tt(i){return i!==Object(i)}function vs(i,{nodeCount:t=3,maxLength:e=15}={}){const s=Array.isArray(i),r=Object.keys(i),o=r.slice(0,t),n=[],c=d=>{switch(Pt(d)){case"object":return Object.keys(d).length===0?"{ }":"{ ... }";case"array":return d.length===0?"[ ]":"[ ... ]";case"string":return`"${d.substring(0,e)}${d.length>e?"...":""}"`;default:return String(d)}},a=[];for(const d of o){const h=[],f=i[d];s||h.push(`${d}: `),h.push(c(f)),a.push(h.join(""))}r.length>t&&a.push("..."),n.push(a.join(", "));const p=n.join("");return s?`[ ${p} ]`:`{ ${p} }`}function*Rt(i){const t=[[i,"",[]]];for(;t.length;){const[e,s,r]=t.shift();if(s&&(yield[e,s,r]),!tt(e))for(const[o,n]of Object.entries(e))t.push([n,`${s}${s?".":""}${o}`,[...r,s]])}}function bs(i,t){const e=i.split("."),s=t.split("."),r=a=>a==="*",o=a=>a==="**";let n=0,c=0;for(;ni&&i.trim()?JSON.parse(i):void 0,toAttribute:i=>JSON.stringify(i)},Ct=i=>i!==void 0,me=(i,t)=>ys(t)?!!i.match(t):bs(i,t),xs=(i,t)=>t.split(".").reduce((e,s)=>e[s],i),re=(i,t)=>e=>({expanded:{...e.expanded,[i]:Ct(t)?!!t:!e.expanded[i]}}),gt=(i,t)=>(e,s)=>{const r={};if(i)for(const[,o,n]of Rt(s.data))me(o,i)&&(r[o]=t,n.forEach(c=>r[c]=t));return{expanded:r}},As=i=>(t,e)=>{const s={};if(i)for(const[,r,o]of Rt(e.data))me(r,i)?(s[r]=!1,o.forEach(n=>s[n]=!1)):s[r]=!0;return{filtered:s}},ws=()=>()=>({filtered:{}}),oe=i=>()=>({highlight:i}),Ss=Ie` :where(:host) { --background-color: #2a2f3a; --color: #f8f8f2; --string-color: #a3eea0; --number-color: #d19a66; --boolean-color: #4ba7ef; --null-color: #df9cf3; --property-color: #6fb3d2; --preview-color: rgba(222, 175, 143, 0.9); --highlight-color: #c92a2a; --outline-color: #e0e4e5; --outline-width: 1px; --outline-style: dotted; --font-family: Nimbus Mono PS, Courier New, monospace; --font-size: 1rem; --line-height: 1.2rem; --indent-size: 0.5rem; --indentguide-size: 1px; --indentguide-style: solid; --indentguide-color: #495057; --indentguide-color-active: #ced4da; --indentguide: var(--indentguide-size) var(--indentguide-style) var(--indentguide-color); --indentguide-active: var(--indentguide-size) var(--indentguide-style) var(--indentguide-color-active); } :host { display: block; background-color: var(--background-color); color: var(--color); font-family: var(--font-family); font-size: var(--font-size); line-height: var(--line-height); } :focus { outline-color: var(--outline-color); outline-width: var(--outline-width); outline-style: var(--outline-style); } .preview { color: var(--preview-color); } .null { color: var(--null-color); } .key { color: var(--property-color); display: inline-flex; align-items: flex-start; } .collapsable::before { display: inline-flex; font-size: 0.8em; content: '▶'; width: var(--line-height); height: var(--line-height); align-items: center; justify-content: center; transition: transform 195ms ease-out; transform: rotate(90deg); color: inherit; } .collapsable--collapsed::before { transform: rotate(0); } .collapsable { cursor: pointer; user-select: none; } .string { color: var(--string-color); } .number { color: var(--number-color); } .boolean { color: var(--boolean-color); } ul { padding: 0; clear: both; } ul, li { list-style: none; position: relative; } li ul > li { position: relative; margin-left: calc(var(--indent-size) + var(--line-height)); padding-left: 0px; } ul ul::before { content: ''; border-left: var(--indentguide); position: absolute; left: calc(var(--line-height) / 2 - var(--indentguide-size)); top: 0.2rem; bottom: 0.2rem; } ul ul:hover::before { border-left: var(--indentguide-active); } mark { background-color: var(--highlight-color); } `,nt,Z,q,F,$e,Tt,J,lt=(J=class extends st{constructor(){super();X(this,F);X(this,nt);X(this,Z);X(this,q);this.state={expanded:{},filtered:{},highlight:null},this.lastFocusedItem=null,pt(this,nt,e=>s=>{s.preventDefault(),this.setState(re(e))}),pt(this,Z,e=>{const s=e.target;e.target===this&&ft(this,F,Tt).call(this,this.lastFocusedItem||this.nodeElements[0]),s.matches('[role="treeitem"]')&&(this.lastFocusedItem&&(this.lastFocusedItem.tabIndex=-1),this.lastFocusedItem=s,this.tabIndex=-1,s.tabIndex=0)}),pt(this,q,e=>{const s=e.relatedTarget;(!s||!this.contains(s))&&(this.tabIndex=0)}),this.addEventListener("focusin",j(this,Z)),this.addEventListener("focusout",j(this,q))}static customRenderer(e,s){return JSON.stringify(e)}async setState(e){const s=this.state;this.state={...s,...e(s,this)}}connectedCallback(){!this.hasAttribute("data")&&!Ct(this.data)&&this.setAttribute("data",this.innerText),this.setAttribute("role","node"),this.setAttribute("tabindex","0"),super.connectedCallback()}expand(e){this.setState(gt(e,!0))}expandAll(){this.setState(gt("**",!0))}collapseAll(){this.setState(gt("**",!1))}collapse(e){this.setState(gt(e,!1))}*search(e){for(const[s,r]of Rt(this.data))tt(s)&&String(s).match(e)&&(this.expand(r),this.updateComplete.then(()=>{const o=this.shadowRoot.querySelector(`[data-path="${r}"]`);o.scrollIntoView({behavior:"smooth",inline:"center",block:"center"}),o.focus()}),this.setState(oe(r)),yield{value:s,path:r});this.setState(oe(null))}filter(e){this.setState(As(e))}resetFilter(){this.setState(ws())}renderObject(e,s){return B` ${ms(Object.entries(e),([r,o])=>{const n=s?`${s}.${r}`:r,c=tt(o),a=this.state.expanded[n];return this.state.filtered[n]?m:B` ${r}: ${Et(!c&&!a,()=>this.renderNodePreview(o))} ${Et(c||a,()=>this.renderValue(o,n))} `})} `}renderValue(e,s=""){return tt(e)?this.renderPrimitive(e,s):this.renderObject(e,s)}renderNodePreview(e){return B` ${vs(e)} `}renderPrimitive(e,s){const r=this.state.highlight,o=Pt(e),n=this.constructor.customRenderer(e,s),c=B` ${n} `;return s===r?B`${c}`:c}render(){const e=this.data;return B` ${Et(Ct(e),()=>this.renderValue(e))} `}},nt=new WeakMap,Z=new WeakMap,q=new WeakMap,F=new WeakSet,$e=function(e){if(!["ArrowDown","ArrowUp","ArrowRight","ArrowLeft","Home","End"].includes(e.key))return;const s=[...this.nodeElements],r=this.matches(":dir(ltr)"),o=this.matches(":dir(rtl)");if(s.length>0){e.preventDefault();const n=s.findIndex(f=>f.matches(":focus")),c=s[n],a=this.state.expanded[c.dataset.path],p=tt(xs(this.data,c.dataset.path)),d=f=>{const b=s[Math.max(Math.min(f,s.length-1),0)];ft(this,F,Tt).call(this,b)},h=f=>{this.setState(re(c.dataset.path,f))};e.key==="ArrowDown"?d(n+1):e.key==="ArrowUp"?d(n-1):r&&e.key==="ArrowRight"||o&&e.key==="ArrowLeft"?!c||a||p?d(n+1):h(!0):r&&e.key==="ArrowLeft"||o&&e.key==="ArrowRight"?!c||!a||p?d(n-1):h(!1):e.key==="Home"?d(0):e.key==="End"&&d(s.length-1)}},Tt=function(e){e.focus()},J.styles=[Ss],J);xt([fe({converter:_s,type:Object})],lt.prototype,"data");xt([ge()],lt.prototype,"state");xt([ge()],lt.prototype,"lastFocusedItem");xt([ds('[role="treeitem"]')],lt.prototype,"nodeElements");customElements.define("json-viewer",lt);var Es=vt('Tile //,'),Ps=vt(''),Cs=vt('fit to boundsInspect featuresShow tile boundsview metadataZ'),Ts=vt("",!0,!1);function ks(i){let t,e;const[s,r]=T(0),[o,n]=T([]),[c,a]=T([]),[p,d]=T(!1),[h,f]=T(!1),b=Se(()=>c().map(l=>({layerName:l.sourceLayer||"unknown",id:l.id?l.id:void 0,properties:l.properties,type:l._vectorTileFeature.type}))),w=new M.Popup({closeButton:!1,closeOnClick:!1,maxWidth:"none"}),Nt=new Ee({metadata:!0});M.addProtocol("pmtiles",Nt.tile);let u,Ft=!0;const ye=()=>{u.zoomTo(Math.round(u.getZoom()))},Ht=async()=>{const l=await i.tileset().getBounds();u.fitBounds([[l[0],l[1]],[l[2],l[3]]],{animate:!1})},ve=()=>{for(const l of u.getStyle().layers)"source"in l&&l.source==="tileset"&&u.removeLayer(l.id);"tileset"in u.getStyle().sources&&u.removeSource("tileset")},It=async l=>{const g=l.archiveForProtocol();g&&Nt.add(g);let A=.2,y=.4;if(await l.isOverlay()&&(d(!0),A=.6,y=.8),await l.isVector()){u.addSource("tileset",{type:"vector",url:l.getMaplibreSourceUrl()});const S=await l.getVectorLayers();n(S.map(_=>({id:_,visible:!0})));for(const[_,$]of S.entries())u.addLayer({id:`tileset_fill_${$}`,type:"fill",source:"tileset","source-layer":$,paint:{"fill-color":z(_),"fill-opacity":["case",["boolean",["feature-state","hover"],!1],y,A]},filter:["==",["geometry-type"],"Polygon"]}),u.addLayer({id:`tileset_line_${$}`,type:"line",source:"tileset","source-layer":$,paint:{"line-color":z(_),"line-width":["case",["boolean",["feature-state","hover"],!1],2,.5]},filter:["==",["geometry-type"],"LineString"]}),u.addLayer({id:`tileset_circle_${$}`,type:"circle",source:"tileset","source-layer":$,paint:{"circle-color":z(_),"circle-radius":["interpolate",["linear"],["zoom"],4,2,12,4],"circle-opacity":.5,"circle-stroke-color":"white","circle-stroke-width":["case",["boolean",["feature-state","hover"],!1],3,0]},filter:["==",["geometry-type"],"Point"]});for(const[_,$]of S.entries())u.addLayer({id:`tileset_line_label_${$}`,type:"symbol",source:"tileset","source-layer":$,layout:{"text-field":["get","name"],"text-font":["Noto Sans Regular"],"text-size":10,"symbol-placement":"line"},paint:{"text-color":z(_),"text-halo-color":"black","text-halo-width":2},filter:["==",["geometry-type"],"LineString"]}),u.addLayer({id:`tileset_point_label_${$}`,type:"symbol",source:"tileset","source-layer":$,layout:{"text-field":["get","name"],"text-font":["Noto Sans Regular"],"text-size":10,"text-offset":[0,-1]},paint:{"text-color":z(_),"text-halo-color":"black","text-halo-width":2},filter:["==",["geometry-type"],"Point"]}),u.addLayer({id:`tileset_polygon_label_${$}`,type:"symbol",source:"tileset","source-layer":$,layout:{"text-field":["get","name"],"text-font":["Noto Sans Regular"],"text-max-angle":85,"text-offset":[0,1],"text-anchor":"bottom","text-rotation-alignment":"map","text-keep-upright":!0,"text-size":10,"symbol-placement":"line","symbol-spacing":250},paint:{"text-color":z(_),"text-halo-color":"black","text-halo-width":2},filter:["==",["geometry-type"],"Polygon"]})}else u.addSource("tileset",{type:"raster",url:l.getMaplibreSourceUrl()}),u.addLayer({source:"tileset",id:"tileset_raster",type:"raster",paint:{"raster-resampling":"nearest"}})};return D(()=>{const l=i.tileset();if(Ft){Ft=!1;return}ve(),It(l)}),D(()=>{const l=p()?"visible":"none";if(u)for(const g of u.getStyle().layers)"source"in g&&g.source==="basemap"&&u.setLayoutProperty(g.id,"visibility",l)}),D(()=>{const l=i.showTileBoundaries();u&&(u.showTileBoundaries=l)}),D(()=>{if(i.inspectFeatures())f(!1);else{for(const l of c())l.id!==void 0&&u.setFeatureState(l,{hover:!1});w.remove()}}),D(()=>{const l=(g,A)=>{u.getLayer(g)&&u.setLayoutProperty(g,"visibility",A)};for(const{id:g,visible:A}of o()){const y=A?"visible":"none";l(`tileset_fill_${g}`,y),l(`tileset_line_${g}`,y),l(`tileset_circle_${g}`,y),l(`tileset_line_label_${g}`,y),l(`tileset_point_label_${g}`,y),l(`tileset_polygon_label_${g}`,y)}}),Pe(async()=>{if(!t){console.error("Could not mount map element");return}M.getRTLTextPluginStatus()==="unavailable"&&M.setRTLTextPlugin("https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.min.js",!0),u=new M.Map({hash:"map",container:t,attributionControl:!1,style:{version:8,glyphs:"https://protomaps.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf",sprite:"https://protomaps.github.io/basemaps-assets/sprites/v4/black",sources:{basemap:{type:"vector",tiles:["https://api.protomaps.com/tiles/v4/{z}/{x}/{y}.mvt?key=1003762824b9687f"],maxzoom:15,attribution:"Background © OpenStreetMap"}},layers:Ue("basemap",Oe("black"),{lang:"en"}).map(l=>("layout"in l||(l.layout={}),l.layout&&(l.layout.visibility="none"),l))}}),u.addControl(new M.NavigationControl({}),"top-left"),u.addControl(new M.AttributionControl({compact:!1}),"bottom-right"),i.mapHashPassed||Ht(),i.showTileBoundaries()&&(u.showTileBoundaries=!0),r(u.getZoom()),u.on("zoom",l=>{r(l.target.getZoom())}),u.on("mousemove",async l=>{if(h()||!i.inspectFeatures())return;for(const x of c())x.id!==void 0&&u.setFeatureState(x,{hover:!1});const{x:g,y:A}=l.point,y=2;let S=u.queryRenderedFeatures([[g-y,A-y],[g+y,A+y]]);S=S.filter(x=>x.source==="tileset");for(const x of S)x.id!==void 0&&u.setFeatureState(x,{hover:!0});a(S);const _=s(),$=new Re,ct=await i.tileset().getMaxZoom(),K=Math.max(0,Math.min(ct,Math.floor(_))),ht=$.px([l.lngLat.lng,l.lngLat.lat],K),E=Math.floor(ht[0]/256),H=Math.floor(ht[1]/256);e&&(e.innerHTML="",ae(()=>(()=>{var x=Es(),C=x.firstChild,dt=C.firstChild,ut=dt.nextSibling,At=ut.nextSibling,G=At.nextSibling;G.nextSibling;var I=C.nextSibling,v=I.firstChild;return P(x,k(Fe,{get features(){return b()}}),C),P(C,K,ut),P(C,E,G),P(C,H,null),P(I,()=>l.lngLat.lng.toFixed(4),v),P(I,()=>l.lngLat.lat.toFixed(4),null),Q(()=>Le(C,"href",Me(i.tileset().getStateUrl(),[K,E,H]))),x})(),e),w.setHTML(e.innerHTML),w.setLngLat(l.lngLat),w.addTo(u))}),u.on("click",()=>{f(!h())}),u.on("load",async()=>{await It(i.tileset()),u.resize()})}),(()=>{var l=Cs(),g=l.firstChild,A=g.firstChild,y=A.firstChild,S=y.nextSibling,_=S.firstChild,$=S.nextSibling,ct=$.firstChild,K=$.nextSibling,ht=A.nextSibling,E=ht.firstChild,H=E.nextSibling,x=H.nextSibling,C=x.nextSibling,dt=C.firstChild,ut=dt.firstChild,At=ut.nextSibling;y.$$click=Ht,_.addEventListener("change",()=>{i.setInspectFeatures(!i.inspectFeatures())}),ct.addEventListener("change",()=>{i.setShowTileBoundaries(!i.showTileBoundaries())}),K.$$click=()=>{i.setShowMetadata(!i.showMetadata())};var G=t;typeof G=="function"?Jt(G,E):t=E;var I=e;return typeof I=="function"?Jt(I,H):e=H,P(x,k(Ne,{layerVisibility:o,setLayerVisibility:n,basemapOption:!0,basemap:p,setBasemap:d})),dt.$$click=ye,P(At,()=>s().toFixed(2)),P(l,k(le,{get when(){return i.showMetadata()},get children(){var v=Ps();return P(v,k(Ls,{get tileset(){return i.tileset}})),v}}),null),Q(v=>{var be={"flex-none":!0,"pb-4":!0,"pt-4":!i.iframe,"px-4":!i.iframe,flex:!0,"justify-between":!0,"text-xs":!0,"md:text-base":!0,"space-x-2":!0},jt=!i.iframe,zt=!!i.iframe,Bt=!!i.inspectFeatures(),Dt=!!h();return v.e=Ce(A,be,v.e),jt!==v.t&&E.classList.toggle("bg-gray-900",v.t=jt),zt!==v.a&&E.classList.toggle("bg-black",v.a=zt),Bt!==v.o&&E.classList.toggle("inspectFeatures",v.o=Bt),Dt!==v.i&&E.classList.toggle("frozen",v.i=Dt),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),Q(()=>_.checked=i.inspectFeatures()),Q(()=>ct.checked=i.showTileBoundaries()),l})()}const Ls=i=>{const[t]=Te(async()=>await i.tileset().getMetadata());return(()=>{var e=Ts();return e._$owner=ke(),Q(()=>e.data=t()),e})()};function Ms(){let i=Zt(location.hash);const t=new URL(window.location.href),e=t.searchParams.get("url");e&&(t.searchParams.delete("url"),history.pushState(null,"",t.toString()),location.hash=qt(location.hash,{url:e,map:i.map}),i=Zt(location.hash));const s=i.iframe==="true",r=i.map!==void 0,[o,n]=T(i.url?xe(decodeURIComponent(i.url)):void 0),[c,a]=T(i.showMetadata==="true"||!1),[p,d]=T(i.showTileBoundaries==="true"),[h,f]=T(i.inspectFeatures==="true");return D(()=>{const w=o()?.getStateUrl();location.hash=qt(location.hash,{url:w?encodeURIComponent(w):void 0,showMetadata:c()?"true":void 0,showTileBoundaries:p()?"true":void 0,inspectFeatures:h()?"true":void 0})}),k(we,{tileset:o,setTileset:n,page:"map",iframe:s,get children(){return k(le,{get when(){return o()},get fallback(){return k(Ae,{setTileset:n})},children:b=>k(ks,{tileset:b,showMetadata:c,setShowMetadata:a,showTileBoundaries:p,setShowTileBoundaries:d,inspectFeatures:h,setInspectFeatures:f,mapHashPassed:r,iframe:s})})}})}const ne=document.getElementById("root");ne&&ae(()=>k(Ms,{}),ne);_e(["click"]);