@eox/layercontrol 0.15.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,294 +1,87 @@
1
- (function(rt,X){typeof exports=="object"&&typeof module<"u"?X(exports):typeof define=="function"&&define.amd?define(["exports"],X):(rt=typeof globalThis<"u"?globalThis:rt||self,X(rt["eox-layercontrol"]={}))})(this,function(rt){"use strict";var kp=Object.defineProperty;var Sp=(rt,X,ht)=>X in rt?kp(rt,X,{enumerable:!0,configurable:!0,writable:!0,value:ht}):rt[X]=ht;var wt=(rt,X,ht)=>(Sp(rt,typeof X!="symbol"?X+"":X,ht),ht),sn=(rt,X,ht)=>{if(!X.has(rt))throw TypeError("Cannot "+ht)};var nt=(rt,X,ht)=>(sn(rt,X,"read from private field"),ht?ht.call(rt):X.get(rt)),q=(rt,X,ht)=>{if(X.has(rt))throw TypeError("Cannot add the same private member more than once");X instanceof WeakSet?X.add(rt):X.set(rt,ht)},Me=(rt,X,ht,ri)=>(sn(rt,X,"write to private field"),ri?ri.call(rt,ht):X.set(rt,ht),ht);var Lt=(rt,X,ht)=>(sn(rt,X,"access private method"),ht);/**
1
+ (function(O,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(O=typeof globalThis<"u"?globalThis:O||self,A(O["eox-layercontrol"]={}))})(this,function(O){"use strict";var fa=Object.defineProperty;var ga=(O,A,I)=>A in O?fa(O,A,{enumerable:!0,configurable:!0,writable:!0,value:I}):O[A]=I;var L=(O,A,I)=>(ga(O,typeof A!="symbol"?A+"":A,I),I),ti=(O,A,I)=>{if(!A.has(O))throw TypeError("Cannot "+I)};var M=(O,A,I)=>(ti(O,A,"read from private field"),I?I.call(O):A.get(O)),_=(O,A,I)=>{if(A.has(O))throw TypeError("Cannot add the same private member more than once");A instanceof WeakSet?A.add(O):A.set(O,I)},_e=(O,A,I,Gt)=>(ti(O,A,"write to private field"),Gt?Gt.call(O,I):A.set(O,I),I);var X=(O,A,I)=>(ti(O,A,"access private method"),I);/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */var Go,Ye,Be,ss,va,rs,wa,Ai,ki,Si,ns,xa,os,as,Ti,ls,ds,hs,cs,Xe,Vs,us,Ca,ps,fs,ms,gs,bs,ys,_s,Ea,vs,La,ws,Aa,ji,rn,xs,ka,Cs,Sa,Je,Fs,Es,Ls,Qe,As,Ta,ks;const X=globalThis,ht=X.ShadowRoot&&(X.ShadyCSS===void 0||X.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ri=Symbol(),nn=new WeakMap;let ja=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==ri)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(ht&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=nn.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&nn.set(e,t))}return t}toString(){return this.cssText}};const $a=n=>new ja(typeof n=="string"?n:n+"",void 0,ri),Pa=(n,t)=>{if(ht)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=X.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,n.appendChild(i)}},on=ht?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return $a(e)})(n):n;/**
5
+ */var Eo,me,ye,be,Xe,So,Ye,qe,ve,We,Ge,Je,Ke,Yt,yn,Qe,$o,tn,en,nn,on,rn,sn,an,_o,ln,Ao,un,Co,we,ei,dn,To,cn,Po,qt,bn,hn,pn,Wt,fn,Oo,gn;const A=globalThis,I=A.ShadowRoot&&(A.ShadyCSS===void 0||A.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Gt=Symbol(),ni=new WeakMap;let Ro=class{constructor(t,n,i){if(this._$cssResult$=!0,i!==Gt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o;const n=this.t;if(I&&t===void 0){const i=n!==void 0&&n.length===1;i&&(t=ni.get(n)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&ni.set(n,t))}return t}toString(){return this.cssText}};const Do=e=>new Ro(typeof e=="string"?e:e+"",void 0,Gt),No=(e,t)=>{if(I)e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(const n of t){const i=document.createElement("style"),o=A.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=n.cssText,e.appendChild(i)}},ii=I?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let n="";for(const i of t.cssRules)n+=i.cssText;return Do(n)})(e):e;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:Oa,defineProperty:Ia,getOwnPropertyDescriptor:Ba,getOwnPropertyNames:Ra,getOwnPropertySymbols:Da,getPrototypeOf:Na}=Object,_e=globalThis,an=_e.trustedTypes,Ma=an?an.emptyScript:"",zs=_e.reactiveElementPolyfillSupport,ni=(n,t)=>n,Us={toAttribute(n,t){switch(t){case Boolean:n=n?Ma:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},ln=(n,t)=>!Oa(n,t),dn={attribute:!0,type:String,converter:Us,reflect:!1,hasChanged:ln};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),_e.litPropertyMetadata??(_e.litPropertyMetadata=new WeakMap);class He extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=dn){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Ia(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:r}=Ba(this.prototype,t)??{get(){return this[e]},set(o){this[e]=o}};return{get(){return s==null?void 0:s.call(this)},set(o){const a=s==null?void 0:s.call(this);r.call(this,o),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??dn}static _$Ei(){if(this.hasOwnProperty(ni("elementProperties")))return;const t=Na(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(ni("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ni("properties"))){const e=this.properties,i=[...Ra(e),...Da(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(on(s))}else t!==void 0&&e.push(on(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i: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(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Pa(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EC(t,e){var r;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const o=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:Us).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){var r;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const o=i.getPropertyOptions(s),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((r=o.converter)==null?void 0:r.fromAttribute)!==void 0?o.converter:Us;this._$Em=s,this[s]=a.fromAttribute(e,o.type),this._$Em=null}}requestUpdate(t,e,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??ln)(this[t],e))return;this.P(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(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(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(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),(i=this._$EO)==null||i.forEach(s=>{var r;return(r=s.hostUpdate)==null?void 0:r.call(s)}),this.update(e)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),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=this._$Ej.forEach(e=>this._$EC(e,this[e]))),this._$EU()}updated(t){}firstUpdated(t){}}He.elementStyles=[],He.shadowRootOptions={mode:"open"},He[ni("elementProperties")]=new Map,He[ni("finalized")]=new Map,zs==null||zs({ReactiveElement:He}),(_e.reactiveElementVersions??(_e.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:Mo,defineProperty:Io,getOwnPropertyDescriptor:Ho,getOwnPropertyNames:Bo,getOwnPropertySymbols:Vo,getPrototypeOf:Lo}=Object,Et=globalThis,oi=Et.trustedTypes,Uo=oi?oi.emptyScript:"",vn=Et.reactiveElementPolyfillSupport,Jt=(e,t)=>e,wn={toAttribute(e,t){switch(t){case Boolean:e=e?Uo:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},ri=(e,t)=>!Mo(e,t),si={attribute:!0,type:String,converter:wn,reflect:!1,hasChanged:ri};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Et.litPropertyMetadata??(Et.litPropertyMetadata=new WeakMap);class Vt extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=si){if(n.state&&(n.attribute=!1),this._$Ei(),this.elementProperties.set(t,n),!n.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,n);o!==void 0&&Io(this.prototype,t,o)}}static getPropertyDescriptor(t,n,i){const{get:o,set:r}=Ho(this.prototype,t)??{get(){return this[n]},set(s){this[n]=s}};return{get(){return o==null?void 0:o.call(this)},set(s){const a=o==null?void 0:o.call(this);r.call(this,s),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??si}static _$Ei(){if(this.hasOwnProperty(Jt("elementProperties")))return;const t=Lo(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(Jt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Jt("properties"))){const n=this.properties,i=[...Bo(n),...Vo(n)];for(const o of i)this.createProperty(o,n[o])}const t=this[Symbol.metadata];if(t!==null){const n=litPropertyMetadata.get(t);if(n!==void 0)for(const[i,o]of n)this.elementProperties.set(i,o)}this._$Eh=new Map;for(const[n,i]of this.elementProperties){const o=this._$Eu(n,i);o!==void 0&&this._$Eh.set(o,n)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const n=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const o of i)n.unshift(ii(o))}else t!==void 0&&n.push(ii(t));return n}static _$Eu(t,n){const i=n.attribute;return i===!1?void 0:typeof i=="string"?i: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(){var t;this._$ES=new Promise(n=>this.enableUpdating=n),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(n=>n(this))}addController(t){var n;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((n=t.hostConnected)==null||n.call(t))}removeController(t){var n;(n=this._$EO)==null||n.delete(t)}_$E_(){const t=new Map,n=this.constructor.elementProperties;for(const i of n.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return No(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostConnected)==null?void 0:i.call(n)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostDisconnected)==null?void 0:i.call(n)})}attributeChangedCallback(t,n,i){this._$AK(t,i)}_$EC(t,n){var r;const i=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,i);if(o!==void 0&&i.reflect===!0){const s=(((r=i.converter)==null?void 0:r.toAttribute)!==void 0?i.converter:wn).toAttribute(n,i.type);this._$Em=t,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(t,n){var r;const i=this.constructor,o=i._$Eh.get(t);if(o!==void 0&&this._$Em!==o){const s=i.getPropertyOptions(o),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((r=s.converter)==null?void 0:r.fromAttribute)!==void 0?s.converter:wn;this._$Em=o,this[o]=a.fromAttribute(n,s.type),this._$Em=null}}requestUpdate(t,n,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??ri)(this[t],n))return;this.P(t,n,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,n,i){this._$AL.has(t)||this._$AL.set(t,n),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(n){Promise.reject(n)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[r,s]of this._$Ep)this[r]=s;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[r,s]of o)s.wrapped!==!0||this._$AL.has(r)||this[r]===void 0||this.P(r,this[r],s)}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(i=this._$EO)==null||i.forEach(o=>{var r;return(r=o.hostUpdate)==null?void 0:r.call(o)}),this.update(n)):this._$EU()}catch(o){throw t=!1,this._$EU(),o}t&&this._$AE(n)}willUpdate(t){}_$AE(t){var n;(n=this._$EO)==null||n.forEach(i=>{var o;return(o=i.hostUpdated)==null?void 0:o.call(i)}),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=this._$Ej.forEach(n=>this._$EC(n,this[n]))),this._$EU()}updated(t){}firstUpdated(t){}}Vt.elementStyles=[],Vt.shadowRootOptions={mode:"open"},Vt[Jt("elementProperties")]=new Map,Vt[Jt("finalized")]=new Map,vn==null||vn({ReactiveElement:Vt}),(Et.reactiveElementVersions??(Et.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const oi=globalThis,Ii=oi.trustedTypes,hn=Ii?Ii.createPolicy("lit-html",{createHTML:n=>n}):void 0,qs="$lit$",he=`lit$${(Math.random()+"").slice(9)}$`,Gs="?"+he,Ha=`<${Gs}>`,Le=document,ai=()=>Le.createComment(""),li=n=>n===null||typeof n!="object"&&typeof n!="function",cn=Array.isArray,un=n=>cn(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Zs=`[
14
- \f\r]`,di=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,pn=/-->/g,fn=/>/g,Ae=RegExp(`>|${Zs}(?:([^\\s"'>=/]+)(${Zs}*=${Zs}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),mn=/'/g,gn=/"/g,bn=/^(?:script|style|textarea|title)$/i,Va=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),z=Va(1),Qt=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),yn=new WeakMap,ke=Le.createTreeWalker(Le,129);function _n(n,t){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return hn!==void 0?hn.createHTML(t):t}const vn=(n,t)=>{const e=n.length-1,i=[];let s,r=t===2?"<svg>":"",o=di;for(let a=0;a<e;a++){const l=n[a];let d,h,u=-1,g=0;for(;g<l.length&&(o.lastIndex=g,h=o.exec(l),h!==null);)g=o.lastIndex,o===di?h[1]==="!--"?o=pn:h[1]!==void 0?o=fn:h[2]!==void 0?(bn.test(h[2])&&(s=RegExp("</"+h[2],"g")),o=Ae):h[3]!==void 0&&(o=Ae):o===Ae?h[0]===">"?(o=s??di,u=-1):h[1]===void 0?u=-2:(u=o.lastIndex-h[2].length,d=h[1],o=h[3]===void 0?Ae:h[3]==='"'?gn:mn):o===gn||o===mn?o=Ae:o===pn||o===fn?o=di:(o=Ae,s=void 0);const m=o===Ae&&n[a+1].startsWith("/>")?" ":"";r+=o===di?l+Ha:u>=0?(i.push(d),l.slice(0,u)+qs+l.slice(u)+he+m):l+he+(u===-2?a:m)}return[_n(n,r+(n[e]||"<?>")+(t===2?"</svg>":"")),i]};class hi{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,o=0;const a=t.length-1,l=this.parts,[d,h]=vn(t,e);if(this.el=hi.createElement(d,i),ke.currentNode=this.el.content,e===2){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=ke.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const u of s.getAttributeNames())if(u.endsWith(qs)){const g=h[o++],m=s.getAttribute(u).split(he),y=/([.?@])?(.*)/.exec(g);l.push({type:1,index:r,name:y[2],strings:m,ctor:y[1]==="."?xn:y[1]==="?"?Cn:y[1]==="@"?En:ci}),s.removeAttribute(u)}else u.startsWith(he)&&(l.push({type:6,index:r}),s.removeAttribute(u));if(bn.test(s.tagName)){const u=s.textContent.split(he),g=u.length-1;if(g>0){s.textContent=Ii?Ii.emptyScript:"";for(let m=0;m<g;m++)s.append(u[m],ai()),ke.nextNode(),l.push({type:2,index:++r});s.append(u[g],ai())}}}else if(s.nodeType===8)if(s.data===Gs)l.push({type:2,index:r});else{let u=-1;for(;(u=s.data.indexOf(he,u+1))!==-1;)l.push({type:7,index:r}),u+=he.length-1}r++}}static createElement(t,e){const i=Le.createElement("template");return i.innerHTML=t,i}}function Se(n,t,e=n,i){var o,a;if(t===Qt)return t;let s=i!==void 0?(o=e._$Co)==null?void 0:o[i]:e._$Cl;const r=li(t)?void 0:t._$litDirective$;return(s==null?void 0:s.constructor)!==r&&((a=s==null?void 0:s._$AO)==null||a.call(s,!1),r===void 0?s=void 0:(s=new r(n),s._$AT(n,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=s:e._$Cl=s),s!==void 0&&(t=Se(n,s._$AS(n,t.values),s,i)),t}class wn{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=((t==null?void 0:t.creationScope)??Le).importNode(e,!0);ke.currentNode=s;let r=ke.nextNode(),o=0,a=0,l=i[0];for(;l!==void 0;){if(o===l.index){let d;l.type===2?d=new Ve(r,r.nextSibling,this,t):l.type===1?d=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(d=new Ln(r,this,t)),this._$AV.push(d),l=i[++a]}o!==(l==null?void 0:l.index)&&(r=ke.nextNode(),o++)}return ke.currentNode=Le,s}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class Ve{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Se(this,t,e),li(t)?t===K||t==null||t===""?(this._$AH!==K&&this._$AR(),this._$AH=K):t!==this._$AH&&t!==Qt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):un(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==K&&li(this._$AH)?this._$AA.nextSibling.data=t:this.T(Le.createTextNode(t)),this._$AH=t}$(t){var r;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=hi.createElement(_n(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(e);else{const o=new wn(s,this),a=o.u(this.options);o.p(e),this.T(a),this._$AH=o}}_$AC(t){let e=yn.get(t.strings);return e===void 0&&yn.set(t.strings,e=new hi(t)),e}k(t){cn(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const r of t)s===e.length?e.push(i=new Ve(this.S(ai()),this.S(ai()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t&&t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class ci{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,r){this.type=1,this._$AH=K,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=K}_$AI(t,e=this,i,s){const r=this.strings;let o=!1;if(r===void 0)t=Se(this,t,e,0),o=!li(t)||t!==this._$AH&&t!==Qt,o&&(this._$AH=t);else{const a=t;let l,d;for(t=r[0],l=0;l<r.length-1;l++)d=Se(this,a[i+l],e,l),d===Qt&&(d=this._$AH[l]),o||(o=!li(d)||d!==this._$AH[l]),d===K?t=K:t!==K&&(t+=(d??"")+r[l+1]),this._$AH[l]=d}o&&!s&&this.j(t)}j(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class xn extends ci{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===K?void 0:t}}class Cn extends ci{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==K)}}class En extends ci{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){if((t=Se(this,t,e,0)??K)===Qt)return;const i=this._$AH,s=t===K&&i!==K||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==K&&(i===K||s);s&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Ln{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Se(this,t)}}const Fa={P:qs,A:he,C:Gs,M:1,L:vn,R:wn,D:un,V:Se,I:Ve,H:ci,N:Cn,U:En,B:xn,F:Ln},Ws=oi.litHtmlPolyfillSupport;Ws==null||Ws(hi,Ve),(oi.litHtmlVersions??(oi.litHtmlVersions=[])).push("3.1.2");const za=(n,t,e)=>{const i=(e==null?void 0:e.renderBefore)??t;let s=i._$litPart$;if(s===void 0){const r=(e==null?void 0:e.renderBefore)??null;i._$litPart$=s=new Ve(t.insertBefore(ai(),r),r,void 0,e??{})}return s._$AI(n),s};/**
13
+ */const Kt=globalThis,Ae=Kt.trustedTypes,ai=Ae?Ae.createPolicy("lit-html",{createHTML:e=>e}):void 0,En="$lit$",ft=`lit$${(Math.random()+"").slice(9)}$`,xn="?"+ft,ko=`<${xn}>`,Tt=document,Qt=()=>Tt.createComment(""),te=e=>e===null||typeof e!="object"&&typeof e!="function",li=Array.isArray,ui=e=>li(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Sn=`[
14
+ \f\r]`,ee=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,di=/-->/g,ci=/>/g,Pt=RegExp(`>|${Sn}(?:([^\\s"'>=/]+)(${Sn}*=${Sn}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),hi=/'/g,pi=/"/g,fi=/^(?:script|style|textarea|title)$/i,Fo=e=>(t,...n)=>({_$litType$:e,strings:t,values:n}),x=Fo(1),rt=Symbol.for("lit-noChange"),T=Symbol.for("lit-nothing"),gi=new WeakMap,Ot=Tt.createTreeWalker(Tt,129);function mi(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return ai!==void 0?ai.createHTML(t):t}const yi=(e,t)=>{const n=e.length-1,i=[];let o,r=t===2?"<svg>":"",s=ee;for(let a=0;a<n;a++){const l=e[a];let u,c,d=-1,p=0;for(;p<l.length&&(s.lastIndex=p,c=s.exec(l),c!==null);)p=s.lastIndex,s===ee?c[1]==="!--"?s=di:c[1]!==void 0?s=ci:c[2]!==void 0?(fi.test(c[2])&&(o=RegExp("</"+c[2],"g")),s=Pt):c[3]!==void 0&&(s=Pt):s===Pt?c[0]===">"?(s=o??ee,d=-1):c[1]===void 0?d=-2:(d=s.lastIndex-c[2].length,u=c[1],s=c[3]===void 0?Pt:c[3]==='"'?pi:hi):s===pi||s===hi?s=Pt:s===di||s===ci?s=ee:(s=Pt,o=void 0);const f=s===Pt&&e[a+1].startsWith("/>")?" ":"";r+=s===ee?l+ko:d>=0?(i.push(u),l.slice(0,d)+En+l.slice(d)+ft+f):l+ft+(d===-2?a:f)}return[mi(e,r+(e[n]||"<?>")+(t===2?"</svg>":"")),i]};class ne{constructor({strings:t,_$litType$:n},i){let o;this.parts=[];let r=0,s=0;const a=t.length-1,l=this.parts,[u,c]=yi(t,n);if(this.el=ne.createElement(u,i),Ot.currentNode=this.el.content,n===2){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(o=Ot.nextNode())!==null&&l.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(const d of o.getAttributeNames())if(d.endsWith(En)){const p=c[s++],f=o.getAttribute(d).split(ft),g=/([.?@])?(.*)/.exec(p);l.push({type:1,index:r,name:g[2],strings:f,ctor:g[1]==="."?vi:g[1]==="?"?wi:g[1]==="@"?Ei:ie}),o.removeAttribute(d)}else d.startsWith(ft)&&(l.push({type:6,index:r}),o.removeAttribute(d));if(fi.test(o.tagName)){const d=o.textContent.split(ft),p=d.length-1;if(p>0){o.textContent=Ae?Ae.emptyScript:"";for(let f=0;f<p;f++)o.append(d[f],Qt()),Ot.nextNode(),l.push({type:2,index:++r});o.append(d[p],Qt())}}}else if(o.nodeType===8)if(o.data===xn)l.push({type:2,index:r});else{let d=-1;for(;(d=o.data.indexOf(ft,d+1))!==-1;)l.push({type:7,index:r}),d+=ft.length-1}r++}}static createElement(t,n){const i=Tt.createElement("template");return i.innerHTML=t,i}}function Rt(e,t,n=e,i){var s,a;if(t===rt)return t;let o=i!==void 0?(s=n._$Co)==null?void 0:s[i]:n._$Cl;const r=te(t)?void 0:t._$litDirective$;return(o==null?void 0:o.constructor)!==r&&((a=o==null?void 0:o._$AO)==null||a.call(o,!1),r===void 0?o=void 0:(o=new r(e),o._$AT(e,n,i)),i!==void 0?(n._$Co??(n._$Co=[]))[i]=o:n._$Cl=o),o!==void 0&&(t=Rt(e,o._$AS(e,t.values),o,i)),t}class bi{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:n},parts:i}=this._$AD,o=((t==null?void 0:t.creationScope)??Tt).importNode(n,!0);Ot.currentNode=o;let r=Ot.nextNode(),s=0,a=0,l=i[0];for(;l!==void 0;){if(s===l.index){let u;l.type===2?u=new Lt(r,r.nextSibling,this,t):l.type===1?u=new l.ctor(r,l.name,l.strings,this,t):l.type===6&&(u=new xi(r,this,t)),this._$AV.push(u),l=i[++a]}s!==(l==null?void 0:l.index)&&(r=Ot.nextNode(),s++)}return Ot.currentNode=Tt,o}p(t){let n=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,n),n+=i.strings.length-2):i._$AI(t[n])),n++}}class Lt{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,n,i,o){this.type=2,this._$AH=T,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const n=this._$AM;return n!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){t=Rt(this,t,n),te(t)?t===T||t==null||t===""?(this._$AH!==T&&this._$AR(),this._$AH=T):t!==this._$AH&&t!==rt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):ui(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==T&&te(this._$AH)?this._$AA.nextSibling.data=t:this.T(Tt.createTextNode(t)),this._$AH=t}$(t){var r;const{values:n,_$litType$:i}=t,o=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=ne.createElement(mi(i.h,i.h[0]),this.options)),i);if(((r=this._$AH)==null?void 0:r._$AD)===o)this._$AH.p(n);else{const s=new bi(o,this),a=s.u(this.options);s.p(n),this.T(a),this._$AH=s}}_$AC(t){let n=gi.get(t.strings);return n===void 0&&gi.set(t.strings,n=new ne(t)),n}k(t){li(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let i,o=0;for(const r of t)o===n.length?n.push(i=new Lt(this.S(Qt()),this.S(Qt()),this,this.options)):i=n[o],i._$AI(r),o++;o<n.length&&(this._$AR(i&&i._$AB.nextSibling,o),n.length=o)}_$AR(t=this._$AA.nextSibling,n){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,n);t&&t!==this._$AB;){const o=t.nextSibling;t.remove(),t=o}}setConnected(t){var n;this._$AM===void 0&&(this._$Cv=t,(n=this._$AP)==null||n.call(this,t))}}class ie{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,i,o,r){this.type=1,this._$AH=T,this._$AN=void 0,this.element=t,this.name=n,this._$AM=o,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=T}_$AI(t,n=this,i,o){const r=this.strings;let s=!1;if(r===void 0)t=Rt(this,t,n,0),s=!te(t)||t!==this._$AH&&t!==rt,s&&(this._$AH=t);else{const a=t;let l,u;for(t=r[0],l=0;l<r.length-1;l++)u=Rt(this,a[i+l],n,l),u===rt&&(u=this._$AH[l]),s||(s=!te(u)||u!==this._$AH[l]),u===T?t=T:t!==T&&(t+=(u??"")+r[l+1]),this._$AH[l]=u}s&&!o&&this.j(t)}j(t){t===T?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class vi extends ie{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===T?void 0:t}}class wi extends ie{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==T)}}class Ei extends ie{constructor(t,n,i,o,r){super(t,n,i,o,r),this.type=5}_$AI(t,n=this){if((t=Rt(this,t,n,0)??T)===rt)return;const i=this._$AH,o=t===T&&i!==T||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==T&&(i===T||o);o&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var n;typeof this._$AH=="function"?this._$AH.call(((n=this.options)==null?void 0:n.host)??this.element,t):this._$AH.handleEvent(t)}}class xi{constructor(t,n,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Rt(this,t)}}const jo={P:En,A:ft,C:xn,M:1,L:yi,R:bi,D:ui,V:Rt,I:Lt,H:ie,N:wi,U:Ei,B:vi,F:xi},$n=Kt.litHtmlPolyfillSupport;$n==null||$n(ne,Lt),(Kt.litHtmlVersions??(Kt.litHtmlVersions=[])).push("3.1.2");const zo=(e,t,n)=>{const i=(n==null?void 0:n.renderBefore)??t;let o=i._$litPart$;if(o===void 0){const r=(n==null?void 0:n.renderBefore)??null;i._$litPart$=o=new Lt(t.insertBefore(Qt(),r),r,void 0,n??{})}return o._$AI(e),o};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */let Mt=class extends He{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=za(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return Qt}};Mt._$litElement$=!0,Mt.finalized=!0,(Go=globalThis.litElementHydrateSupport)==null||Go.call(globalThis,{LitElement:Mt});const Ys=globalThis.litElementPolyfillSupport;Ys==null||Ys({LitElement:Mt}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
19
+ */let tt=class extends Vt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var n;const t=super.createRenderRoot();return(n=this.renderOptions).renderBefore??(n.renderBefore=t.firstChild),t}update(t){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=zo(n,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return rt}};tt._$litElement$=!0,tt.finalized=!0,(Eo=globalThis.litElementHydrateSupport)==null||Eo.call(globalThis,{LitElement:tt});const _n=globalThis.litElementPolyfillSupport;_n==null||_n({LitElement:tt}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.4");/**
20
20
  * @license
21
21
  * Copyright 2021 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
- */function ee(n,t,e){return n?t(n):e==null?void 0:e(n)}/**
23
+ */function at(e,t,n){return e?t(e):n==null?void 0:n(e)}/**
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const ve={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Xs=n=>(...t)=>({_$litDirective$:n,values:t});class Js{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
27
+ */const xt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},An=e=>(...t)=>({_$litDirective$:e,values:t});class Cn{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,n,i){this._$Ct=t,this._$AM=n,this._$Ci=i}_$AS(t,n){return this.update(t,n)}update(t,n){return this.render(...n)}}/**
28
28
  * @license
29
29
  * Copyright 2020 Google LLC
30
30
  * SPDX-License-Identifier: BSD-3-Clause
31
- */const{I:Ua}=Fa,qa=n=>n.strings===void 0,An=()=>document.createComment(""),ui=(n,t,e)=>{var r;const i=n._$AA.parentNode,s=t===void 0?n._$AB:t._$AA;if(e===void 0){const o=i.insertBefore(An(),s),a=i.insertBefore(An(),s);e=new Ua(o,a,n,n.options)}else{const o=e._$AB.nextSibling,a=e._$AM,l=a!==n;if(l){let d;(r=e._$AQ)==null||r.call(e,n),e._$AM=n,e._$AP!==void 0&&(d=n._$AU)!==a._$AU&&e._$AP(d)}if(o!==s||l){let d=e._$AA;for(;d!==o;){const h=d.nextSibling;i.insertBefore(d,s),d=h}}}return e},Te=(n,t,e=n)=>(n._$AI(t,e),n),Ga={},kn=(n,t=Ga)=>n._$AH=t,Za=n=>n._$AH,Qs=n=>{var i;(i=n._$AP)==null||i.call(n,!1,!0);let t=n._$AA;const e=n._$AB.nextSibling;for(;t!==e;){const s=t.nextSibling;t.remove(),t=s}};/**
31
+ */const{I:Zo}=jo,Xo=e=>e.strings===void 0,Si=()=>document.createComment(""),oe=(e,t,n)=>{var r;const i=e._$AA.parentNode,o=t===void 0?e._$AB:t._$AA;if(n===void 0){const s=i.insertBefore(Si(),o),a=i.insertBefore(Si(),o);n=new Zo(s,a,e,e.options)}else{const s=n._$AB.nextSibling,a=n._$AM,l=a!==e;if(l){let u;(r=n._$AQ)==null||r.call(n,e),n._$AM=e,n._$AP!==void 0&&(u=e._$AU)!==a._$AU&&n._$AP(u)}if(s!==o||l){let u=n._$AA;for(;u!==s;){const c=u.nextSibling;i.insertBefore(u,o),u=c}}}return n},Dt=(e,t,n=e)=>(e._$AI(t,n),e),Yo={},$i=(e,t=Yo)=>e._$AH=t,qo=e=>e._$AH,Tn=e=>{var i;(i=e._$AP)==null||i.call(e,!1,!0);let t=e._$AA;const n=e._$AB.nextSibling;for(;t!==n;){const o=t.nextSibling;t.remove(),t=o}};/**
32
32
  * @license
33
33
  * Copyright 2017 Google LLC
34
34
  * SPDX-License-Identifier: BSD-3-Clause
35
- */const Sn=(n,t,e)=>{const i=new Map;for(let s=t;s<=e;s++)i.set(n[s],s);return i},Wa=Xs(class extends Js{constructor(n){if(super(n),n.type!==ve.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);const s=[],r=[];let o=0;for(const a of n)s[o]=i?i(a,o):o,r[o]=e(a,o),o++;return{values:r,keys:s}}render(n,t,e){return this.dt(n,t,e).values}update(n,[t,e,i]){const s=Za(n),{values:r,keys:o}=this.dt(t,e,i);if(!Array.isArray(s))return this.ut=o,r;const a=this.ut??(this.ut=[]),l=[];let d,h,u=0,g=s.length-1,m=0,y=r.length-1;for(;u<=g&&m<=y;)if(s[u]===null)u++;else if(s[g]===null)g--;else if(a[u]===o[m])l[m]=Te(s[u],r[m]),u++,m++;else if(a[g]===o[y])l[y]=Te(s[g],r[y]),g--,y--;else if(a[u]===o[y])l[y]=Te(s[u],r[y]),ui(n,l[y+1],s[u]),u++,y--;else if(a[g]===o[m])l[m]=Te(s[g],r[m]),ui(n,s[u],s[g]),g--,m++;else if(d===void 0&&(d=Sn(o,m,y),h=Sn(a,u,g)),d.has(a[u]))if(d.has(a[g])){const w=h.get(o[m]),A=w!==void 0?s[w]:null;if(A===null){const et=ui(n,s[u]);Te(et,r[m]),l[m]=et}else l[m]=Te(A,r[m]),ui(n,s[u],A),s[w]=null;m++}else Qs(s[g]),g--;else Qs(s[u]),u++;for(;m<=y;){const w=ui(n,l[y+1]);Te(w,r[m]),l[m++]=w}for(;u<=g;){const w=s[u++];w!==null&&Qs(w)}return this.ut=o,kn(n,l),Qt}});/**
35
+ */const _i=(e,t,n)=>{const i=new Map;for(let o=t;o<=n;o++)i.set(e[o],o);return i},Wo=An(class extends Cn{constructor(e){if(super(e),e.type!==xt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(e,t,n){let i;n===void 0?n=t:t!==void 0&&(i=t);const o=[],r=[];let s=0;for(const a of e)o[s]=i?i(a,s):s,r[s]=n(a,s),s++;return{values:r,keys:o}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,i]){const o=qo(e),{values:r,keys:s}=this.dt(t,n,i);if(!Array.isArray(o))return this.ut=s,r;const a=this.ut??(this.ut=[]),l=[];let u,c,d=0,p=o.length-1,f=0,g=r.length-1;for(;d<=p&&f<=g;)if(o[d]===null)d++;else if(o[p]===null)p--;else if(a[d]===s[f])l[f]=Dt(o[d],r[f]),d++,f++;else if(a[p]===s[g])l[g]=Dt(o[p],r[g]),p--,g--;else if(a[d]===s[g])l[g]=Dt(o[d],r[g]),oe(e,l[g+1],o[d]),d++,g--;else if(a[p]===s[f])l[f]=Dt(o[p],r[f]),oe(e,o[d],o[p]),p--,f++;else if(u===void 0&&(u=_i(s,f,g),c=_i(a,d,p)),u.has(a[d]))if(u.has(a[p])){const y=c.get(s[f]),D=y!==void 0?o[y]:null;if(D===null){const Z=oe(e,o[d]);Dt(Z,r[f]),l[f]=Z}else l[f]=Dt(D,r[f]),oe(e,o[d],D),o[y]=null;f++}else Tn(o[p]),p--;else Tn(o[d]),d++;for(;f<=g;){const y=oe(e,l[g+1]);Dt(y,r[f]),l[f++]=y}for(;d<=p;){const y=o[d++];y!==null&&Tn(y)}return this.ut=s,$i(e,l),rt}});/**
36
36
  * wms-capabilities @0.6.0
37
37
  * @description WMS service Capabilities > JSON, based on openlayers
38
38
  * @license BSD-2-Clause
39
39
  * @preserve
40
- */var V=n=>n!==void 0,Tn=(n,t,e)=>t in n?n[t]:n[t]=e;const pi={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};class Ya{constructor(t){this._parser=new t}toDocument(t){return this._parser.parseFromString(t,"application/xml")}getAllTextContent(t,e){return Bi(t,e).join("")}}function Bi(n,t){return jn(n,t,[]).join("")}function jn(n,t,e){if(n.nodeType===pi.CDATA_SECTION||n.nodeType===pi.TEXT)t?e.push(String(n.nodeValue).replace(/(\r\n|\r|\n)/g,"")):e.push(n.nodeValue);else{var i;for(i=n.firstChild;i;i=i.nextSibling)jn(i,t,e)}return e}function Xa(n,t,e,i){for(var s=Ja(t);s;s=Qa(s)){var r=s.namespaceURI||null,o=n[r];if(V(o)){var a=o[s.localName];V(a)&&a.call(i,s,e)}}}function Ja(n){let t=n.firstElementChild||n.firstChild;for(;t&&t.nodeType!==pi.ELEMENT;)t=t.nextSibling;return t}function Qa(n){let t=n.nextElementSibling||n.nextSibling;for(;t&&t.nodeType!==pi.ELEMENT;)t=t.nextSibling;return t}function jt(n,t,e){return Ka(n,t,e)}function Ka(n,t,e){var i=V(e)?e:{},s,r;for(s=0,r=n.length;s<r;++s)i[n[s]]=t;return i}function $n(n,t){return function(e,i){var s=n.call(V(t)?t:this,e,i);if(V(s)){var r=i[i.length-1];r.push(s)}}}function At(n,t,e,i,s){return i.push(n),Xa(t,e,i,s),i.pop()}function k(n,t,e){return function(i,s){let r=n.call(V(e)?e:this,i,s);if(V(r)){var o=s[s.length-1],a=V(t)?t:i.localName;o[a]=r}}}function Ht(n,t,e){return function(i,s){var r=n.call(V(e)?e:this,i,s);if(V(r)){var o=s[s.length-1],a=V(t)?t:i.localName,l=Tn(o,a,[]);l.push(r)}}}const tl=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function el(n){return n.replace(tl,"")}function je(n){const t=/^\s*(true|1)|(false|0)\s*$/.exec(n);if(t)return V(t[1])||!1}function Fe(n){return ce(Bi(n,!1))}function ce(n){const t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(n);if(t)return parseFloat(t[1])}function Ks(n){return Ri(Bi(n,!1))}function Ri(n){const t=/^\s*(\d+)\s*$/.exec(n);if(t)return parseInt(t[1],10)}function Y(n){return el(Bi(n,!1))}const il="http://www.w3.org/1999/xlink";function tr(n){return n.getAttributeNS(il,"href")}function sl(n,t){return At({},jl,n,t)}function Pn(n){return[ce(n.getAttribute("minx")),ce(n.getAttribute("miny")),ce(n.getAttribute("maxx")),ce(n.getAttribute("maxy"))]}function rl(n,t){const e=Pn(n),i=[ce(n.getAttribute("resx")),ce(n.getAttribute("resy"))];return{crs:n.getAttribute("CRS")||n.getAttribute("SRS"),extent:e,res:i}}function nl(n,t){const e=Pn(n);if(!(!V(e[0])||!V(e[1])||!V(e[2])||!V(e[3])))return e}function ol(n,t){const e=parseFloat(n.getAttribute("min")),i=parseFloat(n.getAttribute("max"));return{min:e,max:i}}function al(n,t){const e=At({},$l,n,t);if(!V(e))return;const i=e.westBoundLongitude,s=e.southBoundLatitude,r=e.eastBoundLongitude,o=e.northBoundLatitude;if(!(!V(i)||!V(s)||!V(r)||!V(o)))return[i,s,r,o]}function ll(n,t){return At({},El,n,t)}function dl(n,t){return At({},Ll,n,t)}function hl(n,t){return At({},Al,n,t)}function cl(n,t){return At({},kl,n,t)}function ul(n,t){return At({},Sl,n,t)}function pl(n,t){return At([],Tl,n,t)}function fl(n,t){const e=je(n.getAttribute("queryable"));return At({queryable:V(e)?e:!1},Bn,n,t)}function ml(n,t){var e=t[t.length-1];const i=At({},Bn,n,t);if(!V(i))return;let s=je(n.getAttribute("queryable"));V(s)||(s=e.queryable),i.queryable=V(s)?s:!1;let r=Ri(n.getAttribute("cascaded"));V(r)||(r=e.cascaded),i.cascaded=r;let o=je(n.getAttribute("opaque"));V(o)||(o=e.opaque),i.opaque=V(o)?o:!1;let a=je(n.getAttribute("noSubsets"));V(a)||(a=e.noSubsets),i.noSubsets=V(a)?a:!1;let l=ce(n.getAttribute("fixedWidth"));V(l)||(l=e.fixedWidth),i.fixedWidth=l;let d=ce(n.getAttribute("fixedHeight"));V(d)||(d=e.fixedHeight),i.fixedHeight=d;const h=["Style","CRS","AuthorityURL"];for(let g=0,m=h.length;g<m;g++){const y=h[g],w=e[y];if(V(w)){let A=Tn(i,y,[]);A=A.concat(w),i[y]=A}}const u=["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"];for(let g=0,m=u.length;g<m;g++){const y=u[g],w=i[y];if(!V(w)){const A=e[y];i[y]=A}}return i}function gl(n,t){return{name:n.getAttribute("name"),units:n.getAttribute("units"),unitSymbol:n.getAttribute("unitSymbol"),default:n.getAttribute("default"),multipleValues:je(n.getAttribute("multipleValues")),nearestValue:je(n.getAttribute("nearestValue")),current:je(n.getAttribute("current")),values:Y(n)}}function ue(n,t){return At({},Dl,n,t)}function bl(n,t){return At({},Pl,n,t)}function yl(n,t){return At({},Il,n,t)}function _l(n,t){return At({},Bl,n,t)}function er(n,t){return At({},Ol,n,t)}function On(n,t){var e=ue(n,t);if(V(e)){const i=[Ri(n.getAttribute("width")),Ri(n.getAttribute("height"))];return e.size=i,e}}function vl(n,t){var e=ue(n,t);if(V(e))return e.name=n.getAttribute("name"),e}function wl(n,t){var e=ue(n,t);if(V(e))return e.type=n.getAttribute("type"),e}function xl(n,t){return At({},Rl,n,t)}function In(n,t){return At([],Nl,n,t)}const $t=[null,"http://www.opengis.net/wms"],Cl=jt($t,{Service:k(dl),Capability:k(ll)}),El=jt($t,{Request:k(bl),Exception:k(pl),Layer:k(fl)}),Ll=jt($t,{Name:k(Y),Title:k(Y),Abstract:k(Y),KeywordList:k(In),OnlineResource:k(tr),ContactInformation:k(hl),Fees:k(Y),AccessConstraints:k(Y),LayerLimit:k(Ks),MaxWidth:k(Ks),MaxHeight:k(Ks)}),Al=jt($t,{ContactPersonPrimary:k(cl),ContactPosition:k(Y),ContactAddress:k(ul),ContactVoiceTelephone:k(Y),ContactFacsimileTelephone:k(Y),ContactElectronicMailAddress:k(Y)}),kl=jt($t,{ContactPerson:k(Y),ContactOrganization:k(Y)}),Sl=jt($t,{AddressType:k(Y),Address:k(Y),City:k(Y),StateOrProvince:k(Y),PostCode:k(Y),Country:k(Y)}),Tl=jt($t,{Format:$n(Y)}),Bn=jt($t,{Name:k(Y),Title:k(Y),Abstract:k(Y),KeywordList:k(In),CRS:Ht(Y),SRS:Ht(Y),EX_GeographicBoundingBox:k(al),LatLonBoundingBox:k(nl),BoundingBox:Ht(rl),Dimension:Ht(gl),Attribution:k(sl),AuthorityURL:Ht(vl),Identifier:Ht(Y),MetadataURL:Ht(wl),DataURL:Ht(ue),FeatureListURL:Ht(ue),Style:Ht(xl),MinScaleDenominator:k(Fe),MaxScaleDenominator:k(Fe),ScaleHint:k(ol),Layer:Ht(ml)}),jl=jt($t,{Title:k(Y),OnlineResource:k(tr),LogoURL:k(On)}),$l=jt($t,{westBoundLongitude:k(Fe),eastBoundLongitude:k(Fe),southBoundLatitude:k(Fe),northBoundLatitude:k(Fe)}),Pl=jt($t,{GetCapabilities:k(er),GetMap:k(er),GetFeatureInfo:k(er)}),Ol=jt($t,{Format:Ht(Y),DCPType:Ht(yl)}),Il=jt($t,{HTTP:k(_l)}),Bl=jt($t,{Get:k(ue),Post:k(ue)}),Rl=jt($t,{Name:k(Y),Title:k(Y),Abstract:k(Y),LegendURL:Ht(On),StyleSheetURL:k(ue),StyleURL:k(ue)}),Dl=jt($t,{Format:k(Y),OnlineResource:k(tr)}),Nl=jt($t,{Keyword:$n(Y)});class Ml{constructor(t,e){!e&&typeof window<"u"&&(e=window.DOMParser),this.version=void 0,this._parser=new Ya(e),this._data=t}data(t){return this._data=t,this}toJSON(t){return t=t||this._data,this.parse(t)}parse(t){return this.readFromDocument(this._parser.toDocument(t))}readFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==pi.ELEMENT)return this.readFromNode(e);return null}readFromNode(t){return this.version=t.getAttribute("version"),At({version:this.version},Cl,t,[])||null}}async function Hl(n){let t=new URL(n),e=t.searchParams;e.set("SERVICE","WMS"),e.set("REQUEST","GetCapabilities");let i=t.toString();const s=await fetch(i);if(s.ok){const r=await s.text();return new Ml(r).toJSON()}else throw new Error(`Error: ${s.status}`)}function ir(n){const t=/\b(?:wms|ows)\b/i,e=/{(?:z|x|y-?)}\/{(?:z|x|y-?)}\/{(?:z|x|y-?)}/i;return t.test(n)?"TileWMS":e.test(n)?"XYZ":!1}function Vl(n){const e=/^(?:(?:https?|ftp):\/\/|\/\/)?(?:localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:\w+[\w-]*\.)+\w+)(?::\d+)?(?:\/\S*)?$/.test(n),i=ir(n);return!!(n&&e&&i)}function Rn(n){return n.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,'"$2": ').replace(/,\s*}/g,"}").replace(/,\s*]/g,"]").replace(/\s*(\{|}|\[|\]|,)\s*/g,"$1").replaceAll('": //',"://")}function Fl(n){try{return JSON.parse(Rn(n)),!!n}catch{return!1}}function zl(n,t){const e=new URL(n).searchParams;Object.entries(t).forEach(([o,a])=>{typeof a=="object"&&!Array.isArray(a)&&a!==null?Object.keys(a).forEach(l=>{e.set(l,a[l])}):e.set(o,a)});const i=n.split("?")[0],s=e.toString();return`${i}?${s}`}/**!
40
+ */var E=e=>e!==void 0,Ai=(e,t,n)=>t in e?e[t]:e[t]=n;const re={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12};class Go{constructor(t){this._parser=new t}toDocument(t){return this._parser.parseFromString(t,"application/xml")}getAllTextContent(t,n){return Ce(t,n).join("")}}function Ce(e,t){return Ci(e,t,[]).join("")}function Ci(e,t,n){if(e.nodeType===re.CDATA_SECTION||e.nodeType===re.TEXT)t?n.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):n.push(e.nodeValue);else{var i;for(i=e.firstChild;i;i=i.nextSibling)Ci(i,t,n)}return n}function Jo(e,t,n,i){for(var o=Ko(t);o;o=Qo(o)){var r=o.namespaceURI||null,s=e[r];if(E(s)){var a=s[o.localName];E(a)&&a.call(i,o,n)}}}function Ko(e){let t=e.firstElementChild||e.firstChild;for(;t&&t.nodeType!==re.ELEMENT;)t=t.nextSibling;return t}function Qo(e){let t=e.nextElementSibling||e.nextSibling;for(;t&&t.nodeType!==re.ELEMENT;)t=t.nextSibling;return t}function F(e,t,n){return tr(e,t,n)}function tr(e,t,n){var i=E(n)?n:{},o,r;for(o=0,r=e.length;o<r;++o)i[e[o]]=t;return i}function Ti(e,t){return function(n,i){var o=e.call(E(t)?t:this,n,i);if(E(o)){var r=i[i.length-1];r.push(o)}}}function U(e,t,n,i,o){return i.push(e),Jo(t,n,i,o),i.pop()}function m(e,t,n){return function(i,o){let r=e.call(E(n)?n:this,i,o);if(E(r)){var s=o[o.length-1],a=E(t)?t:i.localName;s[a]=r}}}function K(e,t,n){return function(i,o){var r=e.call(E(n)?n:this,i,o);if(E(r)){var s=o[o.length-1],a=E(t)?t:i.localName,l=Ai(s,a,[]);l.push(r)}}}const er=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function nr(e){return e.replace(er,"")}function Nt(e){const t=/^\s*(true|1)|(false|0)\s*$/.exec(e);if(t)return E(t[1])||!1}function Ut(e){return gt(Ce(e,!1))}function gt(e){const t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(e);if(t)return parseFloat(t[1])}function Pn(e){return Te(Ce(e,!1))}function Te(e){const t=/^\s*(\d+)\s*$/.exec(e);if(t)return parseInt(t[1],10)}function $(e){return nr(Ce(e,!1))}const ir="http://www.w3.org/1999/xlink";function On(e){return e.getAttributeNS(ir,"href")}function or(e,t){return U({},Rr,e,t)}function Pi(e){return[gt(e.getAttribute("minx")),gt(e.getAttribute("miny")),gt(e.getAttribute("maxx")),gt(e.getAttribute("maxy"))]}function rr(e,t){const n=Pi(e),i=[gt(e.getAttribute("resx")),gt(e.getAttribute("resy"))];return{crs:e.getAttribute("CRS")||e.getAttribute("SRS"),extent:n,res:i}}function sr(e,t){const n=Pi(e);if(!(!E(n[0])||!E(n[1])||!E(n[2])||!E(n[3])))return n}function ar(e,t){const n=parseFloat(e.getAttribute("min")),i=parseFloat(e.getAttribute("max"));return{min:n,max:i}}function lr(e,t){const n=U({},Dr,e,t);if(!E(n))return;const i=n.westBoundLongitude,o=n.southBoundLatitude,r=n.eastBoundLongitude,s=n.northBoundLatitude;if(!(!E(i)||!E(o)||!E(r)||!E(s)))return[i,o,r,s]}function ur(e,t){return U({},_r,e,t)}function dr(e,t){return U({},Ar,e,t)}function cr(e,t){return U({},Cr,e,t)}function hr(e,t){return U({},Tr,e,t)}function pr(e,t){return U({},Pr,e,t)}function fr(e,t){return U([],Or,e,t)}function gr(e,t){const n=Nt(e.getAttribute("queryable"));return U({queryable:E(n)?n:!1},Di,e,t)}function mr(e,t){var n=t[t.length-1];const i=U({},Di,e,t);if(!E(i))return;let o=Nt(e.getAttribute("queryable"));E(o)||(o=n.queryable),i.queryable=E(o)?o:!1;let r=Te(e.getAttribute("cascaded"));E(r)||(r=n.cascaded),i.cascaded=r;let s=Nt(e.getAttribute("opaque"));E(s)||(s=n.opaque),i.opaque=E(s)?s:!1;let a=Nt(e.getAttribute("noSubsets"));E(a)||(a=n.noSubsets),i.noSubsets=E(a)?a:!1;let l=gt(e.getAttribute("fixedWidth"));E(l)||(l=n.fixedWidth),i.fixedWidth=l;let u=gt(e.getAttribute("fixedHeight"));E(u)||(u=n.fixedHeight),i.fixedHeight=u;const c=["Style","CRS","AuthorityURL"];for(let p=0,f=c.length;p<f;p++){const g=c[p],y=n[g];if(E(y)){let D=Ai(i,g,[]);D=D.concat(y),i[g]=D}}const d=["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"];for(let p=0,f=d.length;p<f;p++){const g=d[p],y=i[g];if(!E(y)){const D=n[g];i[g]=D}}return i}function yr(e,t){return{name:e.getAttribute("name"),units:e.getAttribute("units"),unitSymbol:e.getAttribute("unitSymbol"),default:e.getAttribute("default"),multipleValues:Nt(e.getAttribute("multipleValues")),nearestValue:Nt(e.getAttribute("nearestValue")),current:Nt(e.getAttribute("current")),values:$(e)}}function mt(e,t){return U({},Vr,e,t)}function br(e,t){return U({},Nr,e,t)}function vr(e,t){return U({},Ir,e,t)}function wr(e,t){return U({},Hr,e,t)}function Rn(e,t){return U({},Mr,e,t)}function Oi(e,t){var n=mt(e,t);if(E(n)){const i=[Te(e.getAttribute("width")),Te(e.getAttribute("height"))];return n.size=i,n}}function Er(e,t){var n=mt(e,t);if(E(n))return n.name=e.getAttribute("name"),n}function xr(e,t){var n=mt(e,t);if(E(n))return n.type=e.getAttribute("type"),n}function Sr(e,t){return U({},Br,e,t)}function Ri(e,t){return U([],Lr,e,t)}const j=[null,"http://www.opengis.net/wms"],$r=F(j,{Service:m(dr),Capability:m(ur)}),_r=F(j,{Request:m(br),Exception:m(fr),Layer:m(gr)}),Ar=F(j,{Name:m($),Title:m($),Abstract:m($),KeywordList:m(Ri),OnlineResource:m(On),ContactInformation:m(cr),Fees:m($),AccessConstraints:m($),LayerLimit:m(Pn),MaxWidth:m(Pn),MaxHeight:m(Pn)}),Cr=F(j,{ContactPersonPrimary:m(hr),ContactPosition:m($),ContactAddress:m(pr),ContactVoiceTelephone:m($),ContactFacsimileTelephone:m($),ContactElectronicMailAddress:m($)}),Tr=F(j,{ContactPerson:m($),ContactOrganization:m($)}),Pr=F(j,{AddressType:m($),Address:m($),City:m($),StateOrProvince:m($),PostCode:m($),Country:m($)}),Or=F(j,{Format:Ti($)}),Di=F(j,{Name:m($),Title:m($),Abstract:m($),KeywordList:m(Ri),CRS:K($),SRS:K($),EX_GeographicBoundingBox:m(lr),LatLonBoundingBox:m(sr),BoundingBox:K(rr),Dimension:K(yr),Attribution:m(or),AuthorityURL:K(Er),Identifier:K($),MetadataURL:K(xr),DataURL:K(mt),FeatureListURL:K(mt),Style:K(Sr),MinScaleDenominator:m(Ut),MaxScaleDenominator:m(Ut),ScaleHint:m(ar),Layer:K(mr)}),Rr=F(j,{Title:m($),OnlineResource:m(On),LogoURL:m(Oi)}),Dr=F(j,{westBoundLongitude:m(Ut),eastBoundLongitude:m(Ut),southBoundLatitude:m(Ut),northBoundLatitude:m(Ut)}),Nr=F(j,{GetCapabilities:m(Rn),GetMap:m(Rn),GetFeatureInfo:m(Rn)}),Mr=F(j,{Format:K($),DCPType:K(vr)}),Ir=F(j,{HTTP:m(wr)}),Hr=F(j,{Get:m(mt),Post:m(mt)}),Br=F(j,{Name:m($),Title:m($),Abstract:m($),LegendURL:K(Oi),StyleSheetURL:m(mt),StyleURL:m(mt)}),Vr=F(j,{Format:m($),OnlineResource:m(On)}),Lr=F(j,{Keyword:Ti($)});class Ur{constructor(t,n){!n&&typeof window<"u"&&(n=window.DOMParser),this.version=void 0,this._parser=new Go(n),this._data=t}data(t){return this._data=t,this}toJSON(t){return t=t||this._data,this.parse(t)}parse(t){return this.readFromDocument(this._parser.toDocument(t))}readFromDocument(t){for(let n=t.firstChild;n;n=n.nextSibling)if(n.nodeType==re.ELEMENT)return this.readFromNode(n);return null}readFromNode(t){return this.version=t.getAttribute("version"),U({version:this.version},$r,t,[])||null}}async function kr(e){let t=new URL(e),n=t.searchParams;n.set("SERVICE","WMS"),n.set("REQUEST","GetCapabilities");let i=t.toString();const o=await fetch(i);if(o.ok){const r=await o.text();return new Ur(r).toJSON()}else throw new Error(`Error: ${o.status}`)}function Dn(e){const t=/\b(?:wms|ows)\b/i,n=/{(?:z|x|y-?)}\/{(?:z|x|y-?)}\/{(?:z|x|y-?)}/i;return t.test(e)?"TileWMS":n.test(e)?"XYZ":!1}function Fr(e){const n=/^(?:(?:https?|ftp):\/\/|\/\/)?(?:localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:\w+[\w-]*\.)+\w+)(?::\d+)?(?:\/\S*)?$/.test(e),i=Dn(e);return!!(e&&n&&i)}function Ni(e){return e.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,'"$2": ').replace(/,\s*}/g,"}").replace(/,\s*]/g,"]").replace(/\s*(\{|}|\[|\]|,)\s*/g,"$1").replaceAll('": //',"://")}function jr(e){try{return JSON.parse(Ni(e)),!!e}catch{return!1}}function zr(e,t){const n=new URL(e).searchParams;Object.entries(t).forEach(([s,a])=>{typeof a=="object"&&!Array.isArray(a)&&a!==null?Object.keys(a).forEach(l=>{n.set(l,a[l])}):n.set(s,a)});const i=e.split("?")[0],o=n.toString();return`${i}?${o}`}/**!
41
41
  * Sortable 1.15.2
42
42
  * @author RubaXa <trash@rubaxa.org>
43
43
  * @author owenm <owen23355@gmail.com>
44
44
  * @license MIT
45
- */function Dn(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),e.push.apply(e,i)}return e}function ae(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?arguments[t]:{};t%2?Dn(Object(e),!0).forEach(function(i){Ul(n,i,e[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):Dn(Object(e)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(e,i))})}return n}function Di(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Di=function(t){return typeof t}:Di=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Di(n)}function Ul(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function pe(){return pe=Object.assign||function(n){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},pe.apply(this,arguments)}function ql(n,t){if(n==null)return{};var e={},i=Object.keys(n),s,r;for(r=0;r<i.length;r++)s=i[r],!(t.indexOf(s)>=0)&&(e[s]=n[s]);return e}function Gl(n,t){if(n==null)return{};var e=ql(n,t),i,s;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(n,i)&&(e[i]=n[i])}return e}var Zl="1.15.2";function fe(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var me=fe(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),fi=fe(/Edge/i),Nn=fe(/firefox/i),mi=fe(/safari/i)&&!fe(/chrome/i)&&!fe(/android/i),Mn=fe(/iP(ad|od|hone)/i),Hn=fe(/chrome/i)&&fe(/android/i),Vn={capture:!1,passive:!1};function J(n,t,e){n.addEventListener(t,e,!me&&Vn)}function Z(n,t,e){n.removeEventListener(t,e,!me&&Vn)}function Ni(n,t){if(t){if(t[0]===">"&&(t=t.substring(1)),n)try{if(n.matches)return n.matches(t);if(n.msMatchesSelector)return n.msMatchesSelector(t);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(t)}catch{return!1}return!1}}function Wl(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function ie(n,t,e,i){if(n){e=e||document;do{if(t!=null&&(t[0]===">"?n.parentNode===e&&Ni(n,t):Ni(n,t))||i&&n===e)return n;if(n===e)break}while(n=Wl(n))}return null}var Fn=/\s+/g;function qt(n,t,e){if(n&&t)if(n.classList)n.classList[e?"add":"remove"](t);else{var i=(" "+n.className+" ").replace(Fn," ").replace(" "+t+" "," ");n.className=(i+(e?" "+t:"")).replace(Fn," ")}}function P(n,t,e){var i=n&&n.style;if(i){if(e===void 0)return document.defaultView&&document.defaultView.getComputedStyle?e=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(e=n.currentStyle),t===void 0?e:e[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=e+(typeof e=="string"?"":"px")}}function ze(n,t){var e="";if(typeof n=="string")e=n;else do{var i=P(n,"transform");i&&i!=="none"&&(e=i+" "+e)}while(!t&&(n=n.parentNode));var s=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return s&&new s(e)}function zn(n,t,e){if(n){var i=n.getElementsByTagName(t),s=0,r=i.length;if(e)for(;s<r;s++)e(i[s],s);return i}return[]}function le(){var n=document.scrollingElement;return n||document.documentElement}function bt(n,t,e,i,s){if(!(!n.getBoundingClientRect&&n!==window)){var r,o,a,l,d,h,u;if(n!==window&&n.parentNode&&n!==le()?(r=n.getBoundingClientRect(),o=r.top,a=r.left,l=r.bottom,d=r.right,h=r.height,u=r.width):(o=0,a=0,l=window.innerHeight,d=window.innerWidth,h=window.innerHeight,u=window.innerWidth),(t||e)&&n!==window&&(s=s||n.parentNode,!me))do if(s&&s.getBoundingClientRect&&(P(s,"transform")!=="none"||e&&P(s,"position")!=="static")){var g=s.getBoundingClientRect();o-=g.top+parseInt(P(s,"border-top-width")),a-=g.left+parseInt(P(s,"border-left-width")),l=o+r.height,d=a+r.width;break}while(s=s.parentNode);if(i&&n!==window){var m=ze(s||n),y=m&&m.a,w=m&&m.d;m&&(o/=w,a/=y,u/=y,h/=w,l=o+h,d=a+u)}return{top:o,left:a,bottom:l,right:d,width:u,height:h}}}function Un(n,t,e){for(var i=we(n,!0),s=bt(n)[t];i;){var r=bt(i)[e],o=void 0;if(e==="top"||e==="left"?o=s>=r:o=s<=r,!o)return i;if(i===le())break;i=we(i,!1)}return!1}function Ue(n,t,e,i){for(var s=0,r=0,o=n.children;r<o.length;){if(o[r].style.display!=="none"&&o[r]!==O.ghost&&(i||o[r]!==O.dragged)&&ie(o[r],e.draggable,n,!1)){if(s===t)return o[r];s++}r++}return null}function sr(n,t){for(var e=n.lastElementChild;e&&(e===O.ghost||P(e,"display")==="none"||t&&!Ni(e,t));)e=e.previousElementSibling;return e||null}function Kt(n,t){var e=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==O.clone&&(!t||Ni(n,t))&&e++;return e}function qn(n){var t=0,e=0,i=le();if(n)do{var s=ze(n),r=s.a,o=s.d;t+=n.scrollLeft*r,e+=n.scrollTop*o}while(n!==i&&(n=n.parentNode));return[t,e]}function Yl(n,t){for(var e in n)if(n.hasOwnProperty(e)){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===n[e][i])return Number(e)}return-1}function we(n,t){if(!n||!n.getBoundingClientRect)return le();var e=n,i=!1;do if(e.clientWidth<e.scrollWidth||e.clientHeight<e.scrollHeight){var s=P(e);if(e.clientWidth<e.scrollWidth&&(s.overflowX=="auto"||s.overflowX=="scroll")||e.clientHeight<e.scrollHeight&&(s.overflowY=="auto"||s.overflowY=="scroll")){if(!e.getBoundingClientRect||e===document.body)return le();if(i||t)return e;i=!0}}while(e=e.parentNode);return le()}function Xl(n,t){if(n&&t)for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n}function rr(n,t){return Math.round(n.top)===Math.round(t.top)&&Math.round(n.left)===Math.round(t.left)&&Math.round(n.height)===Math.round(t.height)&&Math.round(n.width)===Math.round(t.width)}var gi;function Gn(n,t){return function(){if(!gi){var e=arguments,i=this;e.length===1?n.call(i,e[0]):n.apply(i,e),gi=setTimeout(function(){gi=void 0},t)}}}function Jl(){clearTimeout(gi),gi=void 0}function Zn(n,t,e){n.scrollLeft+=t,n.scrollTop+=e}function Wn(n){var t=window.Polymer,e=window.jQuery||window.Zepto;return t&&t.dom?t.dom(n).cloneNode(!0):e?e(n).clone(!0)[0]:n.cloneNode(!0)}function Yn(n,t,e){var i={};return Array.from(n.children).forEach(function(s){var r,o,a,l;if(!(!ie(s,t.draggable,n,!1)||s.animated||s===e)){var d=bt(s);i.left=Math.min((r=i.left)!==null&&r!==void 0?r:1/0,d.left),i.top=Math.min((o=i.top)!==null&&o!==void 0?o:1/0,d.top),i.right=Math.max((a=i.right)!==null&&a!==void 0?a:-1/0,d.right),i.bottom=Math.max((l=i.bottom)!==null&&l!==void 0?l:-1/0,d.bottom)}}),i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}var Gt="Sortable"+new Date().getTime();function Ql(){var n=[],t;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var i=[].slice.call(this.el.children);i.forEach(function(s){if(!(P(s,"display")==="none"||s===O.ghost)){n.push({target:s,rect:bt(s)});var r=ae({},n[n.length-1].rect);if(s.thisAnimationDuration){var o=ze(s,!0);o&&(r.top-=o.f,r.left-=o.e)}s.fromRect=r}})}},addAnimationState:function(i){n.push(i)},removeAnimationState:function(i){n.splice(Yl(n,{target:i}),1)},animateAll:function(i){var s=this;if(!this.options.animation){clearTimeout(t),typeof i=="function"&&i();return}var r=!1,o=0;n.forEach(function(a){var l=0,d=a.target,h=d.fromRect,u=bt(d),g=d.prevFromRect,m=d.prevToRect,y=a.rect,w=ze(d,!0);w&&(u.top-=w.f,u.left-=w.e),d.toRect=u,d.thisAnimationDuration&&rr(g,u)&&!rr(h,u)&&(y.top-u.top)/(y.left-u.left)===(h.top-u.top)/(h.left-u.left)&&(l=td(y,g,m,s.options)),rr(u,h)||(d.prevFromRect=h,d.prevToRect=u,l||(l=s.options.animation),s.animate(d,y,u,l)),l&&(r=!0,o=Math.max(o,l),clearTimeout(d.animationResetTimer),d.animationResetTimer=setTimeout(function(){d.animationTime=0,d.prevFromRect=null,d.fromRect=null,d.prevToRect=null,d.thisAnimationDuration=null},l),d.thisAnimationDuration=l)}),clearTimeout(t),r?t=setTimeout(function(){typeof i=="function"&&i()},o):typeof i=="function"&&i(),n=[]},animate:function(i,s,r,o){if(o){P(i,"transition",""),P(i,"transform","");var a=ze(this.el),l=a&&a.a,d=a&&a.d,h=(s.left-r.left)/(l||1),u=(s.top-r.top)/(d||1);i.animatingX=!!h,i.animatingY=!!u,P(i,"transform","translate3d("+h+"px,"+u+"px,0)"),this.forRepaintDummy=Kl(i),P(i,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),P(i,"transform","translate3d(0,0,0)"),typeof i.animated=="number"&&clearTimeout(i.animated),i.animated=setTimeout(function(){P(i,"transition",""),P(i,"transform",""),i.animated=!1,i.animatingX=!1,i.animatingY=!1},o)}}}}function Kl(n){return n.offsetWidth}function td(n,t,e,i){return Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))/Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))*i.animation}var qe=[],nr={initializeByDefault:!0},bi={mount:function(t){for(var e in nr)nr.hasOwnProperty(e)&&!(e in t)&&(t[e]=nr[e]);qe.forEach(function(i){if(i.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),qe.push(t)},pluginEvent:function(t,e,i){var s=this;this.eventCanceled=!1,i.cancel=function(){s.eventCanceled=!0};var r=t+"Global";qe.forEach(function(o){e[o.pluginName]&&(e[o.pluginName][r]&&e[o.pluginName][r](ae({sortable:e},i)),e.options[o.pluginName]&&e[o.pluginName][t]&&e[o.pluginName][t](ae({sortable:e},i)))})},initializePlugins:function(t,e,i,s){qe.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var d=new a(t,e,t.options);d.sortable=t,d.options=t.options,t[l]=d,pe(i,d.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var o=this.modifyOption(t,r,t.options[r]);typeof o<"u"&&(t.options[r]=o)}},getEventProperties:function(t,e){var i={};return qe.forEach(function(s){typeof s.eventProperties=="function"&&pe(i,s.eventProperties.call(e[s.pluginName],t))}),i},modifyOption:function(t,e,i){var s;return qe.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[e]=="function"&&(s=r.optionListeners[e].call(t[r.pluginName],i))}),s}};function ed(n){var t=n.sortable,e=n.rootEl,i=n.name,s=n.targetEl,r=n.cloneEl,o=n.toEl,a=n.fromEl,l=n.oldIndex,d=n.newIndex,h=n.oldDraggableIndex,u=n.newDraggableIndex,g=n.originalEvent,m=n.putSortable,y=n.extraEventProperties;if(t=t||e&&e[Gt],!!t){var w,A=t.options,et="on"+i.charAt(0).toUpperCase()+i.substr(1);window.CustomEvent&&!me&&!fi?w=new CustomEvent(i,{bubbles:!0,cancelable:!0}):(w=document.createEvent("Event"),w.initEvent(i,!0,!0)),w.to=o||e,w.from=a||e,w.item=s||e,w.clone=r,w.oldIndex=l,w.newIndex=d,w.oldDraggableIndex=h,w.newDraggableIndex=u,w.originalEvent=g,w.pullMode=m?m.lastPutMode:void 0;var W=ae(ae({},y),bi.getEventProperties(i,t));for(var _t in W)w[_t]=W[_t];e&&e.dispatchEvent(w),A[et]&&A[et].call(t,w)}}var id=["evt"],Vt=function(t,e){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=i.evt,r=Gl(i,id);bi.pluginEvent.bind(O)(t,e,ae({dragEl:x,parentEl:ct,ghostEl:D,rootEl:lt,nextEl:$e,lastDownEl:Mi,cloneEl:dt,cloneHidden:xe,dragStarted:_i,putSortable:Pt,activeSortable:O.active,originalEvent:s,oldIndex:Ge,oldDraggableIndex:yi,newIndex:Zt,newDraggableIndex:Ce,hideGhostForTarget:io,unhideGhostForTarget:so,cloneNowHidden:function(){xe=!0},cloneNowShown:function(){xe=!1},dispatchSortableEvent:function(a){Nt({sortable:e,name:a,originalEvent:s})}},r))};function Nt(n){ed(ae({putSortable:Pt,cloneEl:dt,targetEl:x,rootEl:lt,oldIndex:Ge,oldDraggableIndex:yi,newIndex:Zt,newDraggableIndex:Ce},n))}var x,ct,D,lt,$e,Mi,dt,xe,Ge,Zt,yi,Ce,Hi,Pt,Ze=!1,Vi=!1,Fi=[],Pe,se,or,ar,Xn,Jn,_i,We,vi,wi=!1,zi=!1,Ui,It,lr=[],dr=!1,qi=[],Gi=typeof document<"u",Zi=Mn,Qn=fi||me?"cssFloat":"float",sd=Gi&&!Hn&&!Mn&&"draggable"in document.createElement("div"),Kn=function(){if(Gi){if(me)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),to=function(t,e){var i=P(t),s=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=Ue(t,0,e),o=Ue(t,1,e),a=r&&P(r),l=o&&P(o),d=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+bt(r).width,h=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+bt(o).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var u=a.float==="left"?"left":"right";return o&&(l.clear==="both"||l.clear===u)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||d>=s&&i[Qn]==="none"||o&&i[Qn]==="none"&&d+h>s)?"vertical":"horizontal"},rd=function(t,e,i){var s=i?t.left:t.top,r=i?t.right:t.bottom,o=i?t.width:t.height,a=i?e.left:e.top,l=i?e.right:e.bottom,d=i?e.width:e.height;return s===a||r===l||s+o/2===a+d/2},nd=function(t,e){var i;return Fi.some(function(s){var r=s[Gt].options.emptyInsertThreshold;if(!(!r||sr(s))){var o=bt(s),a=t>=o.left-r&&t<=o.right+r,l=e>=o.top-r&&e<=o.bottom+r;if(a&&l)return i=s}}),i},eo=function(t){function e(r,o){return function(a,l,d,h){var u=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(r==null&&(o||u))return!0;if(r==null||r===!1)return!1;if(o&&r==="clone")return r;if(typeof r=="function")return e(r(a,l,d,h),o)(a,l,d,h);var g=(o?a:l).options.group.name;return r===!0||typeof r=="string"&&r===g||r.join&&r.indexOf(g)>-1}}var i={},s=t.group;(!s||Di(s)!="object")&&(s={name:s}),i.name=s.name,i.checkPull=e(s.pull,!0),i.checkPut=e(s.put),i.revertClone=s.revertClone,t.group=i},io=function(){!Kn&&D&&P(D,"display","none")},so=function(){!Kn&&D&&P(D,"display","")};Gi&&!Hn&&document.addEventListener("click",function(n){if(Vi)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Vi=!1,!1},!0);var Oe=function(t){if(x){t=t.touches?t.touches[0]:t;var e=nd(t.clientX,t.clientY);if(e){var i={};for(var s in t)t.hasOwnProperty(s)&&(i[s]=t[s]);i.target=i.rootEl=e,i.preventDefault=void 0,i.stopPropagation=void 0,e[Gt]._onDragOver(i)}}},od=function(t){x&&x.parentNode[Gt]._isOutsideThisEl(t.target)};function O(n,t){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=t=pe({},t),n[Gt]=this;var e={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return to(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(o,a){o.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:O.supportPointer!==!1&&"PointerEvent"in window&&!mi,emptyInsertThreshold:5};bi.initializePlugins(this,n,e);for(var i in e)!(i in t)&&(t[i]=e[i]);eo(t);for(var s in this)s.charAt(0)==="_"&&typeof this[s]=="function"&&(this[s]=this[s].bind(this));this.nativeDraggable=t.forceFallback?!1:sd,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?J(n,"pointerdown",this._onTapStart):(J(n,"mousedown",this._onTapStart),J(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(J(n,"dragover",this),J(n,"dragenter",this)),Fi.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),pe(this,Ql())}O.prototype={constructor:O,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(We=null)},_getDirection:function(t,e){return typeof this.options.direction=="function"?this.options.direction.call(this,t,e,x):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,i=this.el,s=this.options,r=s.preventOnFilter,o=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,d=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,h=s.filter;if(fd(i),!x&&!(/mousedown|pointerdown/.test(o)&&t.button!==0||s.disabled)&&!d.isContentEditable&&!(!this.nativeDraggable&&mi&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=ie(l,s.draggable,i,!1),!(l&&l.animated)&&Mi!==l)){if(Ge=Kt(l),yi=Kt(l,s.draggable),typeof h=="function"){if(h.call(this,t,l,this)){Nt({sortable:e,rootEl:d,name:"filter",targetEl:l,toEl:i,fromEl:i}),Vt("filter",e,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(h&&(h=h.split(",").some(function(u){if(u=ie(d,u.trim(),i,!1),u)return Nt({sortable:e,rootEl:u,name:"filter",targetEl:l,fromEl:i,toEl:i}),Vt("filter",e,{evt:t}),!0}),h)){r&&t.cancelable&&t.preventDefault();return}s.handle&&!ie(d,s.handle,i,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,i){var s=this,r=s.el,o=s.options,a=r.ownerDocument,l;if(i&&!x&&i.parentNode===r){var d=bt(i);if(lt=r,x=i,ct=x.parentNode,$e=x.nextSibling,Mi=i,Hi=o.group,O.dragged=x,Pe={target:x,clientX:(e||t).clientX,clientY:(e||t).clientY},Xn=Pe.clientX-d.left,Jn=Pe.clientY-d.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,x.style["will-change"]="all",l=function(){if(Vt("delayEnded",s,{evt:t}),O.eventCanceled){s._onDrop();return}s._disableDelayedDragEvents(),!Nn&&s.nativeDraggable&&(x.draggable=!0),s._triggerDragStart(t,e),Nt({sortable:s,name:"choose",originalEvent:t}),qt(x,o.chosenClass,!0)},o.ignore.split(",").forEach(function(h){zn(x,h.trim(),hr)}),J(a,"dragover",Oe),J(a,"mousemove",Oe),J(a,"touchmove",Oe),J(a,"mouseup",s._onDrop),J(a,"touchend",s._onDrop),J(a,"touchcancel",s._onDrop),Nn&&this.nativeDraggable&&(this.options.touchStartThreshold=4,x.draggable=!0),Vt("delayStart",this,{evt:t}),o.delay&&(!o.delayOnTouchOnly||e)&&(!this.nativeDraggable||!(fi||me))){if(O.eventCanceled){this._onDrop();return}J(a,"mouseup",s._disableDelayedDrag),J(a,"touchend",s._disableDelayedDrag),J(a,"touchcancel",s._disableDelayedDrag),J(a,"mousemove",s._delayedDragTouchMoveHandler),J(a,"touchmove",s._delayedDragTouchMoveHandler),o.supportPointer&&J(a,"pointermove",s._delayedDragTouchMoveHandler),s._dragStartTimer=setTimeout(l,o.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){x&&hr(x),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;Z(t,"mouseup",this._disableDelayedDrag),Z(t,"touchend",this._disableDelayedDrag),Z(t,"touchcancel",this._disableDelayedDrag),Z(t,"mousemove",this._delayedDragTouchMoveHandler),Z(t,"touchmove",this._delayedDragTouchMoveHandler),Z(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||t.pointerType=="touch"&&t,!this.nativeDraggable||e?this.options.supportPointer?J(document,"pointermove",this._onTouchMove):e?J(document,"touchmove",this._onTouchMove):J(document,"mousemove",this._onTouchMove):(J(x,"dragend",this),J(lt,"dragstart",this._onDragStart));try{document.selection?Yi(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,e){if(Ze=!1,lt&&x){Vt("dragStarted",this,{evt:e}),this.nativeDraggable&&J(document,"dragover",od);var i=this.options;!t&&qt(x,i.dragClass,!1),qt(x,i.ghostClass,!0),O.active=this,t&&this._appendGhost(),Nt({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(se){this._lastX=se.clientX,this._lastY=se.clientY,io();for(var t=document.elementFromPoint(se.clientX,se.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(se.clientX,se.clientY),t!==e);)e=t;if(x.parentNode[Gt]._isOutsideThisEl(t),e)do{if(e[Gt]){var i=void 0;if(i=e[Gt]._onDragOver({clientX:se.clientX,clientY:se.clientY,target:t,rootEl:e}),i&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);so()}},_onTouchMove:function(t){if(Pe){var e=this.options,i=e.fallbackTolerance,s=e.fallbackOffset,r=t.touches?t.touches[0]:t,o=D&&ze(D,!0),a=D&&o&&o.a,l=D&&o&&o.d,d=Zi&&It&&qn(It),h=(r.clientX-Pe.clientX+s.x)/(a||1)+(d?d[0]-lr[0]:0)/(a||1),u=(r.clientY-Pe.clientY+s.y)/(l||1)+(d?d[1]-lr[1]:0)/(l||1);if(!O.active&&!Ze){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(D){o?(o.e+=h-(or||0),o.f+=u-(ar||0)):o={a:1,b:0,c:0,d:1,e:h,f:u};var g="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");P(D,"webkitTransform",g),P(D,"mozTransform",g),P(D,"msTransform",g),P(D,"transform",g),or=h,ar=u,se=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!D){var t=this.options.fallbackOnBody?document.body:lt,e=bt(x,!0,Zi,!0,t),i=this.options;if(Zi){for(It=t;P(It,"position")==="static"&&P(It,"transform")==="none"&&It!==document;)It=It.parentNode;It!==document.body&&It!==document.documentElement?(It===document&&(It=le()),e.top+=It.scrollTop,e.left+=It.scrollLeft):It=le(),lr=qn(It)}D=x.cloneNode(!0),qt(D,i.ghostClass,!1),qt(D,i.fallbackClass,!0),qt(D,i.dragClass,!0),P(D,"transition",""),P(D,"transform",""),P(D,"box-sizing","border-box"),P(D,"margin",0),P(D,"top",e.top),P(D,"left",e.left),P(D,"width",e.width),P(D,"height",e.height),P(D,"opacity","0.8"),P(D,"position",Zi?"absolute":"fixed"),P(D,"zIndex","100000"),P(D,"pointerEvents","none"),O.ghost=D,t.appendChild(D),P(D,"transform-origin",Xn/parseInt(D.style.width)*100+"% "+Jn/parseInt(D.style.height)*100+"%")}},_onDragStart:function(t,e){var i=this,s=t.dataTransfer,r=i.options;if(Vt("dragStart",this,{evt:t}),O.eventCanceled){this._onDrop();return}Vt("setupClone",this),O.eventCanceled||(dt=Wn(x),dt.removeAttribute("id"),dt.draggable=!1,dt.style["will-change"]="",this._hideClone(),qt(dt,this.options.chosenClass,!1),O.clone=dt),i.cloneId=Yi(function(){Vt("clone",i),!O.eventCanceled&&(i.options.removeCloneOnHide||lt.insertBefore(dt,x),i._hideClone(),Nt({sortable:i,name:"clone"}))}),!e&&qt(x,r.dragClass,!0),e?(Vi=!0,i._loopId=setInterval(i._emulateDragOver,50)):(Z(document,"mouseup",i._onDrop),Z(document,"touchend",i._onDrop),Z(document,"touchcancel",i._onDrop),s&&(s.effectAllowed="move",r.setData&&r.setData.call(i,s,x)),J(document,"drop",i),P(x,"transform","translateZ(0)")),Ze=!0,i._dragStartId=Yi(i._dragStarted.bind(i,e,t)),J(document,"selectstart",i),_i=!0,mi&&P(document.body,"user-select","none")},_onDragOver:function(t){var e=this.el,i=t.target,s,r,o,a=this.options,l=a.group,d=O.active,h=Hi===l,u=a.sort,g=Pt||d,m,y=this,w=!1;if(dr)return;function A(Re,Sr){Vt(Re,y,ae({evt:t,isOwner:h,axis:m?"vertical":"horizontal",revert:o,dragRect:s,targetRect:r,canSort:u,fromSortable:g,target:i,completed:W,onMove:function(Ss,Tr){return Wi(lt,e,x,s,Ss,bt(Ss),t,Tr)},changed:_t},Sr))}function et(){A("dragOverAnimationCapture"),y.captureAnimationState(),y!==g&&g.captureAnimationState()}function W(Re){return A("dragOverCompleted",{insertion:Re}),Re&&(h?d._hideClone():d._showClone(y),y!==g&&(qt(x,Pt?Pt.options.ghostClass:d.options.ghostClass,!1),qt(x,a.ghostClass,!0)),Pt!==y&&y!==O.active?Pt=y:y===O.active&&Pt&&(Pt=null),g===y&&(y._ignoreWhileAnimating=i),y.animateAll(function(){A("dragOverAnimationComplete"),y._ignoreWhileAnimating=null}),y!==g&&(g.animateAll(),g._ignoreWhileAnimating=null)),(i===x&&!x.animated||i===e&&!i.animated)&&(We=null),!a.dragoverBubble&&!t.rootEl&&i!==document&&(x.parentNode[Gt]._isOutsideThisEl(t.target),!Re&&Oe(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),w=!0}function _t(){Zt=Kt(x),Ce=Kt(x,a.draggable),Nt({sortable:y,name:"change",toEl:e,newIndex:Zt,newDraggableIndex:Ce,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),i=ie(i,a.draggable,e,!0),A("dragOver"),O.eventCanceled)return w;if(x.contains(t.target)||i.animated&&i.animatingX&&i.animatingY||y._ignoreWhileAnimating===i)return W(!1);if(Vi=!1,d&&!a.disabled&&(h?u||(o=ct!==lt):Pt===this||(this.lastPutMode=Hi.checkPull(this,d,x,t))&&l.checkPut(this,d,x,t))){if(m=this._getDirection(t,i)==="vertical",s=bt(x),A("dragOverValid"),O.eventCanceled)return w;if(o)return ct=lt,et(),this._hideClone(),A("revert"),O.eventCanceled||($e?lt.insertBefore(x,$e):lt.appendChild(x)),W(!0);var pt=sr(e,a.draggable);if(!pt||hd(t,m,this)&&!pt.animated){if(pt===x)return W(!1);if(pt&&e===t.target&&(i=pt),i&&(r=bt(i)),Wi(lt,e,x,s,i,r,t,!!i)!==!1)return et(),pt&&pt.nextSibling?e.insertBefore(x,pt.nextSibling):e.appendChild(x),ct=e,_t(),W(!0)}else if(pt&&dd(t,m,this)){var kt=Ue(e,0,a,!0);if(kt===x)return W(!1);if(i=kt,r=bt(i),Wi(lt,e,x,s,i,r,t,!1)!==!1)return et(),e.insertBefore(x,kt),ct=e,_t(),W(!0)}else if(i.parentNode===e){r=bt(i);var H=0,ut,Rt=x.parentNode!==e,ot=!rd(x.animated&&x.toRect||s,i.animated&&i.toRect||r,m),T=m?"top":"left",N=Un(i,"top","top")||Un(x,"top","top"),xt=N?N.scrollTop:void 0;We!==i&&(ut=r[T],wi=!1,zi=!ot&&a.invertSwap||Rt),H=cd(t,i,r,m,ot?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,zi,We===i);var Ct;if(H!==0){var St=Kt(x);do St-=H,Ct=ct.children[St];while(Ct&&(P(Ct,"display")==="none"||Ct===D))}if(H===0||Ct===i)return W(!1);We=i,vi=H;var Xt=i.nextElementSibling,Jt=!1;Jt=H===1;var Ke=Wi(lt,e,x,s,i,r,t,Jt);if(Ke!==!1)return(Ke===1||Ke===-1)&&(Jt=Ke===1),dr=!0,setTimeout(ld,30),et(),Jt&&!Xt?e.appendChild(x):i.parentNode.insertBefore(x,Jt?Xt:i),N&&Zn(N,0,xt-N.scrollTop),ct=x.parentNode,ut!==void 0&&!zi&&(Ui=Math.abs(ut-bt(i)[T])),_t(),W(!0)}if(e.contains(x))return W(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){Z(document,"mousemove",this._onTouchMove),Z(document,"touchmove",this._onTouchMove),Z(document,"pointermove",this._onTouchMove),Z(document,"dragover",Oe),Z(document,"mousemove",Oe),Z(document,"touchmove",Oe)},_offUpEvents:function(){var t=this.el.ownerDocument;Z(t,"mouseup",this._onDrop),Z(t,"touchend",this._onDrop),Z(t,"pointerup",this._onDrop),Z(t,"touchcancel",this._onDrop),Z(document,"selectstart",this)},_onDrop:function(t){var e=this.el,i=this.options;if(Zt=Kt(x),Ce=Kt(x,i.draggable),Vt("drop",this,{evt:t}),ct=x&&x.parentNode,Zt=Kt(x),Ce=Kt(x,i.draggable),O.eventCanceled){this._nulling();return}Ze=!1,zi=!1,wi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),cr(this.cloneId),cr(this._dragStartId),this.nativeDraggable&&(Z(document,"drop",this),Z(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),mi&&P(document.body,"user-select",""),P(x,"transform",""),t&&(_i&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),D&&D.parentNode&&D.parentNode.removeChild(D),(lt===ct||Pt&&Pt.lastPutMode!=="clone")&&dt&&dt.parentNode&&dt.parentNode.removeChild(dt),x&&(this.nativeDraggable&&Z(x,"dragend",this),hr(x),x.style["will-change"]="",_i&&!Ze&&qt(x,Pt?Pt.options.ghostClass:this.options.ghostClass,!1),qt(x,this.options.chosenClass,!1),Nt({sortable:this,name:"unchoose",toEl:ct,newIndex:null,newDraggableIndex:null,originalEvent:t}),lt!==ct?(Zt>=0&&(Nt({rootEl:ct,name:"add",toEl:ct,fromEl:lt,originalEvent:t}),Nt({sortable:this,name:"remove",toEl:ct,originalEvent:t}),Nt({rootEl:ct,name:"sort",toEl:ct,fromEl:lt,originalEvent:t}),Nt({sortable:this,name:"sort",toEl:ct,originalEvent:t})),Pt&&Pt.save()):Zt!==Ge&&Zt>=0&&(Nt({sortable:this,name:"update",toEl:ct,originalEvent:t}),Nt({sortable:this,name:"sort",toEl:ct,originalEvent:t})),O.active&&((Zt==null||Zt===-1)&&(Zt=Ge,Ce=yi),Nt({sortable:this,name:"end",toEl:ct,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Vt("nulling",this),lt=x=ct=D=$e=dt=Mi=xe=Pe=se=_i=Zt=Ce=Ge=yi=We=vi=Pt=Hi=O.dragged=O.ghost=O.clone=O.active=null,qi.forEach(function(t){t.checked=!0}),qi.length=or=ar=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":x&&(this._onDragOver(t),ad(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],e,i=this.el.children,s=0,r=i.length,o=this.options;s<r;s++)e=i[s],ie(e,o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||pd(e));return t},sort:function(t,e){var i={},s=this.el;this.toArray().forEach(function(r,o){var a=s.children[o];ie(a,this.options.draggable,s,!1)&&(i[r]=a)},this),e&&this.captureAnimationState(),t.forEach(function(r){i[r]&&(s.removeChild(i[r]),s.appendChild(i[r]))}),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return ie(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var i=this.options;if(e===void 0)return i[t];var s=bi.modifyOption(this,t,e);typeof s<"u"?i[t]=s:i[t]=e,t==="group"&&eo(i)},destroy:function(){Vt("destroy",this);var t=this.el;t[Gt]=null,Z(t,"mousedown",this._onTapStart),Z(t,"touchstart",this._onTapStart),Z(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(Z(t,"dragover",this),Z(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Fi.splice(Fi.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!xe){if(Vt("hideClone",this),O.eventCanceled)return;P(dt,"display","none"),this.options.removeCloneOnHide&&dt.parentNode&&dt.parentNode.removeChild(dt),xe=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(xe){if(Vt("showClone",this),O.eventCanceled)return;x.parentNode==lt&&!this.options.group.revertClone?lt.insertBefore(dt,x):$e?lt.insertBefore(dt,$e):lt.appendChild(dt),this.options.group.revertClone&&this.animate(x,dt),P(dt,"display",""),xe=!1}}};function ad(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function Wi(n,t,e,i,s,r,o,a){var l,d=n[Gt],h=d.options.onMove,u;return window.CustomEvent&&!me&&!fi?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=n,l.dragged=e,l.draggedRect=i,l.related=s||t,l.relatedRect=r||bt(t),l.willInsertAfter=a,l.originalEvent=o,n.dispatchEvent(l),h&&(u=h.call(d,l,o)),u}function hr(n){n.draggable=!1}function ld(){dr=!1}function dd(n,t,e){var i=bt(Ue(e.el,0,e.options,!0)),s=Yn(e.el,e.options,D),r=10;return t?n.clientX<s.left-r||n.clientY<i.top&&n.clientX<i.right:n.clientY<s.top-r||n.clientY<i.bottom&&n.clientX<i.left}function hd(n,t,e){var i=bt(sr(e.el,e.options.draggable)),s=Yn(e.el,e.options,D),r=10;return t?n.clientX>s.right+r||n.clientY>i.bottom&&n.clientX>i.left:n.clientY>s.bottom+r||n.clientX>i.right&&n.clientY>i.top}function cd(n,t,e,i,s,r,o,a){var l=i?n.clientY:n.clientX,d=i?e.height:e.width,h=i?e.top:e.left,u=i?e.bottom:e.right,g=!1;if(!o){if(a&&Ui<d*s){if(!wi&&(vi===1?l>h+d*r/2:l<u-d*r/2)&&(wi=!0),wi)g=!0;else if(vi===1?l<h+Ui:l>u-Ui)return-vi}else if(l>h+d*(1-s)/2&&l<u-d*(1-s)/2)return ud(t)}return g=g||o,g&&(l<h+d*r/2||l>u-d*r/2)?l>h+d/2?1:-1:0}function ud(n){return Kt(x)<Kt(n)?1:-1}function pd(n){for(var t=n.tagName+n.className+n.src+n.href+n.textContent,e=t.length,i=0;e--;)i+=t.charCodeAt(e);return i.toString(36)}function fd(n){qi.length=0;for(var t=n.getElementsByTagName("input"),e=t.length;e--;){var i=t[e];i.checked&&qi.push(i)}}function Yi(n){return setTimeout(n,0)}function cr(n){return clearTimeout(n)}Gi&&J(document,"touchmove",function(n){(O.active||Ze)&&n.cancelable&&n.preventDefault()}),O.utils={on:J,off:Z,css:P,find:zn,is:function(t,e){return!!ie(t,e,t,!1)},extend:Xl,throttle:Gn,closest:ie,toggleClass:qt,clone:Wn,index:Kt,nextTick:Yi,cancelNextTick:cr,detectDirection:to,getChild:Ue},O.get=function(n){return n[Gt]},O.mount=function(){for(var n=arguments.length,t=new Array(n),e=0;e<n;e++)t[e]=arguments[e];t[0].constructor===Array&&(t=t[0]),t.forEach(function(i){if(!i.prototype||!i.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));i.utils&&(O.utils=ae(ae({},O.utils),i.utils)),bi.mount(i)})},O.create=function(n,t){return new O(n,t)},O.version=Zl;var yt=[],xi,ur,pr=!1,fr,mr,Xi,Ci;function md(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return n.prototype={dragStarted:function(e){var i=e.originalEvent;this.sortable.nativeDraggable?J(document,"dragover",this._handleAutoScroll):this.options.supportPointer?J(document,"pointermove",this._handleFallbackAutoScroll):i.touches?J(document,"touchmove",this._handleFallbackAutoScroll):J(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var i=e.originalEvent;!this.options.dragOverBubble&&!i.rootEl&&this._handleAutoScroll(i)},drop:function(){this.sortable.nativeDraggable?Z(document,"dragover",this._handleAutoScroll):(Z(document,"pointermove",this._handleFallbackAutoScroll),Z(document,"touchmove",this._handleFallbackAutoScroll),Z(document,"mousemove",this._handleFallbackAutoScroll)),ro(),Ji(),Jl()},nulling:function(){Xi=ur=xi=pr=Ci=fr=mr=null,yt.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,i){var s=this,r=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,o);if(Xi=e,i||this.options.forceAutoScrollFallback||fi||me||mi){gr(e,this.options,a,i);var l=we(a,!0);pr&&(!Ci||r!==fr||o!==mr)&&(Ci&&ro(),Ci=setInterval(function(){var d=we(document.elementFromPoint(r,o),!0);d!==l&&(l=d,Ji()),gr(e,s.options,d,i)},10),fr=r,mr=o)}else{if(!this.options.bubbleScroll||we(a,!0)===le()){Ji();return}gr(e,this.options,we(a,!1),!1)}}},pe(n,{pluginName:"scroll",initializeByDefault:!0})}function Ji(){yt.forEach(function(n){clearInterval(n.pid)}),yt=[]}function ro(){clearInterval(Ci)}var gr=Gn(function(n,t,e,i){if(t.scroll){var s=(n.touches?n.touches[0]:n).clientX,r=(n.touches?n.touches[0]:n).clientY,o=t.scrollSensitivity,a=t.scrollSpeed,l=le(),d=!1,h;ur!==e&&(ur=e,Ji(),xi=t.scroll,h=t.scrollFn,xi===!0&&(xi=we(e,!0)));var u=0,g=xi;do{var m=g,y=bt(m),w=y.top,A=y.bottom,et=y.left,W=y.right,_t=y.width,pt=y.height,kt=void 0,H=void 0,ut=m.scrollWidth,Rt=m.scrollHeight,ot=P(m),T=m.scrollLeft,N=m.scrollTop;m===l?(kt=_t<ut&&(ot.overflowX==="auto"||ot.overflowX==="scroll"||ot.overflowX==="visible"),H=pt<Rt&&(ot.overflowY==="auto"||ot.overflowY==="scroll"||ot.overflowY==="visible")):(kt=_t<ut&&(ot.overflowX==="auto"||ot.overflowX==="scroll"),H=pt<Rt&&(ot.overflowY==="auto"||ot.overflowY==="scroll"));var xt=kt&&(Math.abs(W-s)<=o&&T+_t<ut)-(Math.abs(et-s)<=o&&!!T),Ct=H&&(Math.abs(A-r)<=o&&N+pt<Rt)-(Math.abs(w-r)<=o&&!!N);if(!yt[u])for(var St=0;St<=u;St++)yt[St]||(yt[St]={});(yt[u].vx!=xt||yt[u].vy!=Ct||yt[u].el!==m)&&(yt[u].el=m,yt[u].vx=xt,yt[u].vy=Ct,clearInterval(yt[u].pid),(xt!=0||Ct!=0)&&(d=!0,yt[u].pid=setInterval((function(){i&&this.layer===0&&O.active._onTouchMove(Xi);var Xt=yt[this.layer].vy?yt[this.layer].vy*a:0,Jt=yt[this.layer].vx?yt[this.layer].vx*a:0;typeof h=="function"&&h.call(O.dragged.parentNode[Gt],Jt,Xt,n,Xi,yt[this.layer].el)!=="continue"||Zn(yt[this.layer].el,Jt,Xt)}).bind({layer:u}),24))),u++}while(t.bubbleScroll&&g!==l&&(g=we(g,!1)));pr=d}},30),no=function(t){var e=t.originalEvent,i=t.putSortable,s=t.dragEl,r=t.activeSortable,o=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(e){var d=i||r;a();var h=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(h.clientX,h.clientY);l(),d&&!d.el.contains(u)&&(o("spill"),this.onSpill({dragEl:s,putSortable:i}))}};function br(){}br.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var s=Ue(this.sortable.el,this.startIndex,this.options);s?this.sortable.el.insertBefore(e,s):this.sortable.el.appendChild(e),this.sortable.animateAll(),i&&i.animateAll()},drop:no},pe(br,{pluginName:"revertOnSpill"});function yr(){}yr.prototype={onSpill:function(t){var e=t.dragEl,i=t.putSortable,s=i||this.sortable;s.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),s.animateAll()},drop:no},pe(yr,{pluginName:"removeOnSpill"}),O.mount(new md),O.mount(yr,br);const gd=n=>{const t=n.item;let e=Array.prototype.slice.call(t.parentNode.childNodes);return e=e.filter(i=>i.nodeType!=Node.ELEMENT_NODE||!i.classList.contains("sortable-fallback")),e},bd=(n,t,e,i,s,r)=>{const a=n.item.parentNode;for(const w of e)a.appendChild(w);if(n.oldIndex==n.newIndex)return;const l=i.getArray(),d=n.item.querySelector("eox-layercontrol-layer").layer.get(s),h=l.find(w=>w.get(s)===d),u=r.dataset.layer,g=l.find(w=>w.get(s)==u);let m,y;for(m=0;m<l.length;m++)if(l[m]==h){i.removeAt(m);break}for(y=0;y<l.length;y++)if(l[y]===g){m>y?i.insertAt(y,h):i.insertAt(y+1,h);break}t.requestUpdate()};function yd(n,t,e,i){let s=[],r=null;n._sortable=O.create(n,{handle:".drag-handle",filter:".drag-handle.disabled",swapThreshold:.5,animation:150,easing:"cubic-bezier(1, 0, 0, 1)",onStart:o=>s=gd(o),onMove:o=>{r=o.related},onEnd:o=>bd(o,i,s,t,e,r)})}function _d(n,t,e,i){const s=n.getArray();let r=!1;s.forEach(o=>{const a=o.ol_uid;o.get(t)||(o.set(t,a),r=!0),o.get(e)||(o.set(e,`layer ${a}`),r=!0),r&&i.requestUpdate()})}function _r(n,t,e){let i=[];const s=(r,o,a)=>{i=[...i,...r.filter(d=>d.get(o)===a)];const l=r.filter(d=>d.getLayers);return l.length>0&&l.forEach(d=>s(d.getLayers().getArray(),o,a)),i};return s(n,t,e),i}function vd(n,t,e){if(!n||!t)return!1;if(!oo(n,e))return!0;const i=n.get("minZoom"),s=n.get("maxZoom"),r=t.getView().getZoom();return r>i&&r<s}function oo(n,t){const e=n.get("minZoom"),i=n.get("maxZoom");return!!(t&&(e!==-1/0||i!==1/0))}function wd(n,t){var s,r,o;return!n||!t?void 0:n.getLayers?"group":((o=(s=t.getInteractions().getArray().filter(a=>a.freehand_!==void 0).map(a=>a.source_))==null?void 0:s.ol_uid)==null?void 0:o.includes(n.getSource?(r=n.getSource())==null?void 0:r.ol_uid:void 0))?"draw":n.declutter_!==void 0?"vector":"raster"}function ao(n,t){var i;let e={};for(const s in n){const r=n[s].type;if(r&&r!=="object")e[s]=r==="number"?Number(t[s]):t[s];else if(typeof n[s]=="object"&&((i=n[s])!=null&&i.properties)){const o=ao(n[s].properties,t);Object.keys(o).length>0&&(e[s]=o)}}return e}function xd(n,t){var r;if(!t||!n.getSource().getTileUrlFunction())return null;const e=new URL(n.getSource().getTileUrlFunction()([0,0,0])),i=Object.fromEntries(e.searchParams.entries()),s=ao(((r=t.schema)==null?void 0:r.properties)||t.schema,i);return Object.keys(s).length?s:null}const Cd=(n,t)=>n==null?void 0:n.filter(e=>["remove","sort"].filter(i=>t!=null&&t.get("layerControlDisable")?i!=="sort":!0).includes(e)),Ed=(n,t)=>n==null?void 0:n.filter(e=>{let i=!0;return["remove","sort"].includes(e)&&(i=!1),e==="info"&&(i=t.get("description")),e==="config"&&(i=t.get("layerConfig")),i}),Ld=(n,t)=>z`
46
- <button slot="${n}-icon" class="icon">${t?n:K}</button>
47
- `,Ad=n=>z`
45
+ */function Mi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function ht(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Mi(Object(n),!0).forEach(function(i){Zr(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mi(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function Pe(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Pe=function(t){return typeof t}:Pe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pe(e)}function Zr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yt(){return yt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},yt.apply(this,arguments)}function Xr(e,t){if(e==null)return{};var n={},i=Object.keys(e),o,r;for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Yr(e,t){if(e==null)return{};var n=Xr(e,t),i,o;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}var qr="1.15.2";function bt(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var vt=bt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),se=bt(/Edge/i),Ii=bt(/firefox/i),ae=bt(/safari/i)&&!bt(/chrome/i)&&!bt(/android/i),Hi=bt(/iP(ad|od|hone)/i),Bi=bt(/chrome/i)&&bt(/android/i),Vi={capture:!1,passive:!1};function C(e,t,n){e.addEventListener(t,n,!vt&&Vi)}function S(e,t,n){e.removeEventListener(t,n,!vt&&Vi)}function Oe(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Wr(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function lt(e,t,n,i){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Oe(e,t):Oe(e,t))||i&&e===n)return e;if(e===n)break}while(e=Wr(e))}return null}var Li=/\s+/g;function et(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var i=(" "+e.className+" ").replace(Li," ").replace(" "+t+" "," ");e.className=(i+(n?" "+t:"")).replace(Li," ")}}function b(e,t,n){var i=e&&e.style;if(i){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in i)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),i[t]=n+(typeof n=="string"?"":"px")}}function kt(e,t){var n="";if(typeof e=="string")n=e;else do{var i=b(e,"transform");i&&i!=="none"&&(n=i+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function Ui(e,t,n){if(e){var i=e.getElementsByTagName(t),o=0,r=i.length;if(n)for(;o<r;o++)n(i[o],o);return i}return[]}function pt(){var e=document.scrollingElement;return e||document.documentElement}function B(e,t,n,i,o){if(!(!e.getBoundingClientRect&&e!==window)){var r,s,a,l,u,c,d;if(e!==window&&e.parentNode&&e!==pt()?(r=e.getBoundingClientRect(),s=r.top,a=r.left,l=r.bottom,u=r.right,c=r.height,d=r.width):(s=0,a=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!vt))do if(o&&o.getBoundingClientRect&&(b(o,"transform")!=="none"||n&&b(o,"position")!=="static")){var p=o.getBoundingClientRect();s-=p.top+parseInt(b(o,"border-top-width")),a-=p.left+parseInt(b(o,"border-left-width")),l=s+r.height,u=a+r.width;break}while(o=o.parentNode);if(i&&e!==window){var f=kt(o||e),g=f&&f.a,y=f&&f.d;f&&(s/=y,a/=g,d/=g,c/=y,l=s+c,u=a+d)}return{top:s,left:a,bottom:l,right:u,width:d,height:c}}}function ki(e,t,n){for(var i=St(e,!0),o=B(e)[t];i;){var r=B(i)[n],s=void 0;if(n==="top"||n==="left"?s=o>=r:s=o<=r,!s)return i;if(i===pt())break;i=St(i,!1)}return!1}function Ft(e,t,n,i){for(var o=0,r=0,s=e.children;r<s.length;){if(s[r].style.display!=="none"&&s[r]!==v.ghost&&(i||s[r]!==v.dragged)&&lt(s[r],n.draggable,e,!1)){if(o===t)return s[r];o++}r++}return null}function Nn(e,t){for(var n=e.lastElementChild;n&&(n===v.ghost||b(n,"display")==="none"||t&&!Oe(n,t));)n=n.previousElementSibling;return n||null}function st(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==v.clone&&(!t||Oe(e,t))&&n++;return n}function Fi(e){var t=0,n=0,i=pt();if(e)do{var o=kt(e),r=o.a,s=o.d;t+=e.scrollLeft*r,n+=e.scrollTop*s}while(e!==i&&(e=e.parentNode));return[t,n]}function Gr(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var i in t)if(t.hasOwnProperty(i)&&t[i]===e[n][i])return Number(n)}return-1}function St(e,t){if(!e||!e.getBoundingClientRect)return pt();var n=e,i=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=b(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return pt();if(i||t)return n;i=!0}}while(n=n.parentNode);return pt()}function Jr(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function Mn(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var le;function ji(e,t){return function(){if(!le){var n=arguments,i=this;n.length===1?e.call(i,n[0]):e.apply(i,n),le=setTimeout(function(){le=void 0},t)}}}function Kr(){clearTimeout(le),le=void 0}function zi(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function Zi(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function Xi(e,t,n){var i={};return Array.from(e.children).forEach(function(o){var r,s,a,l;if(!(!lt(o,t.draggable,e,!1)||o.animated||o===n)){var u=B(o);i.left=Math.min((r=i.left)!==null&&r!==void 0?r:1/0,u.left),i.top=Math.min((s=i.top)!==null&&s!==void 0?s:1/0,u.top),i.right=Math.max((a=i.right)!==null&&a!==void 0?a:-1/0,u.right),i.bottom=Math.max((l=i.bottom)!==null&&l!==void 0?l:-1/0,u.bottom)}}),i.width=i.right-i.left,i.height=i.bottom-i.top,i.x=i.left,i.y=i.top,i}var nt="Sortable"+new Date().getTime();function Qr(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var i=[].slice.call(this.el.children);i.forEach(function(o){if(!(b(o,"display")==="none"||o===v.ghost)){e.push({target:o,rect:B(o)});var r=ht({},e[e.length-1].rect);if(o.thisAnimationDuration){var s=kt(o,!0);s&&(r.top-=s.f,r.left-=s.e)}o.fromRect=r}})}},addAnimationState:function(i){e.push(i)},removeAnimationState:function(i){e.splice(Gr(e,{target:i}),1)},animateAll:function(i){var o=this;if(!this.options.animation){clearTimeout(t),typeof i=="function"&&i();return}var r=!1,s=0;e.forEach(function(a){var l=0,u=a.target,c=u.fromRect,d=B(u),p=u.prevFromRect,f=u.prevToRect,g=a.rect,y=kt(u,!0);y&&(d.top-=y.f,d.left-=y.e),u.toRect=d,u.thisAnimationDuration&&Mn(p,d)&&!Mn(c,d)&&(g.top-d.top)/(g.left-d.left)===(c.top-d.top)/(c.left-d.left)&&(l=es(g,p,f,o.options)),Mn(d,c)||(u.prevFromRect=c,u.prevToRect=d,l||(l=o.options.animation),o.animate(u,g,d,l)),l&&(r=!0,s=Math.max(s,l),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},l),u.thisAnimationDuration=l)}),clearTimeout(t),r?t=setTimeout(function(){typeof i=="function"&&i()},s):typeof i=="function"&&i(),e=[]},animate:function(i,o,r,s){if(s){b(i,"transition",""),b(i,"transform","");var a=kt(this.el),l=a&&a.a,u=a&&a.d,c=(o.left-r.left)/(l||1),d=(o.top-r.top)/(u||1);i.animatingX=!!c,i.animatingY=!!d,b(i,"transform","translate3d("+c+"px,"+d+"px,0)"),this.forRepaintDummy=ts(i),b(i,"transition","transform "+s+"ms"+(this.options.easing?" "+this.options.easing:"")),b(i,"transform","translate3d(0,0,0)"),typeof i.animated=="number"&&clearTimeout(i.animated),i.animated=setTimeout(function(){b(i,"transition",""),b(i,"transform",""),i.animated=!1,i.animatingX=!1,i.animatingY=!1},s)}}}}function ts(e){return e.offsetWidth}function es(e,t,n,i){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*i.animation}var jt=[],In={initializeByDefault:!0},ue={mount:function(t){for(var n in In)In.hasOwnProperty(n)&&!(n in t)&&(t[n]=In[n]);jt.forEach(function(i){if(i.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),jt.push(t)},pluginEvent:function(t,n,i){var o=this;this.eventCanceled=!1,i.cancel=function(){o.eventCanceled=!0};var r=t+"Global";jt.forEach(function(s){n[s.pluginName]&&(n[s.pluginName][r]&&n[s.pluginName][r](ht({sortable:n},i)),n.options[s.pluginName]&&n[s.pluginName][t]&&n[s.pluginName][t](ht({sortable:n},i)))})},initializePlugins:function(t,n,i,o){jt.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var u=new a(t,n,t.options);u.sortable=t,u.options=t.options,t[l]=u,yt(i,u.defaults)}});for(var r in t.options)if(t.options.hasOwnProperty(r)){var s=this.modifyOption(t,r,t.options[r]);typeof s<"u"&&(t.options[r]=s)}},getEventProperties:function(t,n){var i={};return jt.forEach(function(o){typeof o.eventProperties=="function"&&yt(i,o.eventProperties.call(n[o.pluginName],t))}),i},modifyOption:function(t,n,i){var o;return jt.forEach(function(r){t[r.pluginName]&&r.optionListeners&&typeof r.optionListeners[n]=="function"&&(o=r.optionListeners[n].call(t[r.pluginName],i))}),o}};function ns(e){var t=e.sortable,n=e.rootEl,i=e.name,o=e.targetEl,r=e.cloneEl,s=e.toEl,a=e.fromEl,l=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,p=e.originalEvent,f=e.putSortable,g=e.extraEventProperties;if(t=t||n&&n[nt],!!t){var y,D=t.options,Z="on"+i.charAt(0).toUpperCase()+i.substr(1);window.CustomEvent&&!vt&&!se?y=new CustomEvent(i,{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent(i,!0,!0)),y.to=s||n,y.from=a||n,y.item=o||n,y.clone=r,y.oldIndex=l,y.newIndex=u,y.oldDraggableIndex=c,y.newDraggableIndex=d,y.originalEvent=p,y.pullMode=f?f.lastPutMode:void 0;var k=ht(ht({},g),ue.getEventProperties(i,t));for(var ot in k)y[ot]=k[ot];n&&n.dispatchEvent(y),D[Z]&&D[Z].call(t,y)}}var is=["evt"],Q=function(t,n){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.evt,r=Yr(i,is);ue.pluginEvent.bind(v)(t,n,ht({dragEl:h,parentEl:H,ghostEl:w,rootEl:R,nextEl:Mt,lastDownEl:Re,cloneEl:N,cloneHidden:$t,dragStarted:ce,putSortable:z,activeSortable:v.active,originalEvent:o,oldIndex:zt,oldDraggableIndex:de,newIndex:it,newDraggableIndex:_t,hideGhostForTarget:Qi,unhideGhostForTarget:to,cloneNowHidden:function(){$t=!0},cloneNowShown:function(){$t=!1},dispatchSortableEvent:function(a){G({sortable:n,name:a,originalEvent:o})}},r))};function G(e){ns(ht({putSortable:z,cloneEl:N,targetEl:h,rootEl:R,oldIndex:zt,oldDraggableIndex:de,newIndex:it,newDraggableIndex:_t},e))}var h,H,w,R,Mt,Re,N,$t,zt,it,de,_t,De,z,Zt=!1,Ne=!1,Me=[],It,ut,Hn,Bn,Yi,qi,ce,Xt,he,pe=!1,Ie=!1,He,Y,Vn=[],Ln=!1,Be=[],Ve=typeof document<"u",Le=Hi,Wi=se||vt?"cssFloat":"float",os=Ve&&!Bi&&!Hi&&"draggable"in document.createElement("div"),Gi=function(){if(Ve){if(vt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),Ji=function(t,n){var i=b(t),o=parseInt(i.width)-parseInt(i.paddingLeft)-parseInt(i.paddingRight)-parseInt(i.borderLeftWidth)-parseInt(i.borderRightWidth),r=Ft(t,0,n),s=Ft(t,1,n),a=r&&b(r),l=s&&b(s),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+B(r).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+B(s).width;if(i.display==="flex")return i.flexDirection==="column"||i.flexDirection==="column-reverse"?"vertical":"horizontal";if(i.display==="grid")return i.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=o&&i[Wi]==="none"||s&&i[Wi]==="none"&&u+c>o)?"vertical":"horizontal"},rs=function(t,n,i){var o=i?t.left:t.top,r=i?t.right:t.bottom,s=i?t.width:t.height,a=i?n.left:n.top,l=i?n.right:n.bottom,u=i?n.width:n.height;return o===a||r===l||o+s/2===a+u/2},ss=function(t,n){var i;return Me.some(function(o){var r=o[nt].options.emptyInsertThreshold;if(!(!r||Nn(o))){var s=B(o),a=t>=s.left-r&&t<=s.right+r,l=n>=s.top-r&&n<=s.bottom+r;if(a&&l)return i=o}}),i},Ki=function(t){function n(r,s){return function(a,l,u,c){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(r==null&&(s||d))return!0;if(r==null||r===!1)return!1;if(s&&r==="clone")return r;if(typeof r=="function")return n(r(a,l,u,c),s)(a,l,u,c);var p=(s?a:l).options.group.name;return r===!0||typeof r=="string"&&r===p||r.join&&r.indexOf(p)>-1}}var i={},o=t.group;(!o||Pe(o)!="object")&&(o={name:o}),i.name=o.name,i.checkPull=n(o.pull,!0),i.checkPut=n(o.put),i.revertClone=o.revertClone,t.group=i},Qi=function(){!Gi&&w&&b(w,"display","none")},to=function(){!Gi&&w&&b(w,"display","")};Ve&&!Bi&&document.addEventListener("click",function(e){if(Ne)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Ne=!1,!1},!0);var Ht=function(t){if(h){t=t.touches?t.touches[0]:t;var n=ss(t.clientX,t.clientY);if(n){var i={};for(var o in t)t.hasOwnProperty(o)&&(i[o]=t[o]);i.target=i.rootEl=n,i.preventDefault=void 0,i.stopPropagation=void 0,n[nt]._onDragOver(i)}}},as=function(t){h&&h.parentNode[nt]._isOutsideThisEl(t.target)};function v(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=yt({},t),e[nt]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ji(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:v.supportPointer!==!1&&"PointerEvent"in window&&!ae,emptyInsertThreshold:5};ue.initializePlugins(this,e,n);for(var i in n)!(i in t)&&(t[i]=n[i]);Ki(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:os,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?C(e,"pointerdown",this._onTapStart):(C(e,"mousedown",this._onTapStart),C(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(C(e,"dragover",this),C(e,"dragenter",this)),Me.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),yt(this,Qr())}v.prototype={constructor:v,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Xt=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,h):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,i=this.el,o=this.options,r=o.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(gs(i),!h&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||o.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&ae&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=lt(l,o.draggable,i,!1),!(l&&l.animated)&&Re!==l)){if(zt=st(l),de=st(l,o.draggable),typeof c=="function"){if(c.call(this,t,l,this)){G({sortable:n,rootEl:u,name:"filter",targetEl:l,toEl:i,fromEl:i}),Q("filter",n,{evt:t}),r&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=lt(u,d.trim(),i,!1),d)return G({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:i,toEl:i}),Q("filter",n,{evt:t}),!0}),c)){r&&t.cancelable&&t.preventDefault();return}o.handle&&!lt(u,o.handle,i,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,i){var o=this,r=o.el,s=o.options,a=r.ownerDocument,l;if(i&&!h&&i.parentNode===r){var u=B(i);if(R=r,h=i,H=h.parentNode,Mt=h.nextSibling,Re=i,De=s.group,v.dragged=h,It={target:h,clientX:(n||t).clientX,clientY:(n||t).clientY},Yi=It.clientX-u.left,qi=It.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,h.style["will-change"]="all",l=function(){if(Q("delayEnded",o,{evt:t}),v.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!Ii&&o.nativeDraggable&&(h.draggable=!0),o._triggerDragStart(t,n),G({sortable:o,name:"choose",originalEvent:t}),et(h,s.chosenClass,!0)},s.ignore.split(",").forEach(function(c){Ui(h,c.trim(),Un)}),C(a,"dragover",Ht),C(a,"mousemove",Ht),C(a,"touchmove",Ht),C(a,"mouseup",o._onDrop),C(a,"touchend",o._onDrop),C(a,"touchcancel",o._onDrop),Ii&&this.nativeDraggable&&(this.options.touchStartThreshold=4,h.draggable=!0),Q("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(se||vt))){if(v.eventCanceled){this._onDrop();return}C(a,"mouseup",o._disableDelayedDrag),C(a,"touchend",o._disableDelayedDrag),C(a,"touchcancel",o._disableDelayedDrag),C(a,"mousemove",o._delayedDragTouchMoveHandler),C(a,"touchmove",o._delayedDragTouchMoveHandler),s.supportPointer&&C(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){h&&Un(h),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;S(t,"mouseup",this._disableDelayedDrag),S(t,"touchend",this._disableDelayedDrag),S(t,"touchcancel",this._disableDelayedDrag),S(t,"mousemove",this._delayedDragTouchMoveHandler),S(t,"touchmove",this._delayedDragTouchMoveHandler),S(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?C(document,"pointermove",this._onTouchMove):n?C(document,"touchmove",this._onTouchMove):C(document,"mousemove",this._onTouchMove):(C(h,"dragend",this),C(R,"dragstart",this._onDragStart));try{document.selection?ke(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Zt=!1,R&&h){Q("dragStarted",this,{evt:n}),this.nativeDraggable&&C(document,"dragover",as);var i=this.options;!t&&et(h,i.dragClass,!1),et(h,i.ghostClass,!0),v.active=this,t&&this._appendGhost(),G({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(ut){this._lastX=ut.clientX,this._lastY=ut.clientY,Qi();for(var t=document.elementFromPoint(ut.clientX,ut.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ut.clientX,ut.clientY),t!==n);)n=t;if(h.parentNode[nt]._isOutsideThisEl(t),n)do{if(n[nt]){var i=void 0;if(i=n[nt]._onDragOver({clientX:ut.clientX,clientY:ut.clientY,target:t,rootEl:n}),i&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);to()}},_onTouchMove:function(t){if(It){var n=this.options,i=n.fallbackTolerance,o=n.fallbackOffset,r=t.touches?t.touches[0]:t,s=w&&kt(w,!0),a=w&&s&&s.a,l=w&&s&&s.d,u=Le&&Y&&Fi(Y),c=(r.clientX-It.clientX+o.x)/(a||1)+(u?u[0]-Vn[0]:0)/(a||1),d=(r.clientY-It.clientY+o.y)/(l||1)+(u?u[1]-Vn[1]:0)/(l||1);if(!v.active&&!Zt){if(i&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))<i)return;this._onDragStart(t,!0)}if(w){s?(s.e+=c-(Hn||0),s.f+=d-(Bn||0)):s={a:1,b:0,c:0,d:1,e:c,f:d};var p="matrix(".concat(s.a,",").concat(s.b,",").concat(s.c,",").concat(s.d,",").concat(s.e,",").concat(s.f,")");b(w,"webkitTransform",p),b(w,"mozTransform",p),b(w,"msTransform",p),b(w,"transform",p),Hn=c,Bn=d,ut=r}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!w){var t=this.options.fallbackOnBody?document.body:R,n=B(h,!0,Le,!0,t),i=this.options;if(Le){for(Y=t;b(Y,"position")==="static"&&b(Y,"transform")==="none"&&Y!==document;)Y=Y.parentNode;Y!==document.body&&Y!==document.documentElement?(Y===document&&(Y=pt()),n.top+=Y.scrollTop,n.left+=Y.scrollLeft):Y=pt(),Vn=Fi(Y)}w=h.cloneNode(!0),et(w,i.ghostClass,!1),et(w,i.fallbackClass,!0),et(w,i.dragClass,!0),b(w,"transition",""),b(w,"transform",""),b(w,"box-sizing","border-box"),b(w,"margin",0),b(w,"top",n.top),b(w,"left",n.left),b(w,"width",n.width),b(w,"height",n.height),b(w,"opacity","0.8"),b(w,"position",Le?"absolute":"fixed"),b(w,"zIndex","100000"),b(w,"pointerEvents","none"),v.ghost=w,t.appendChild(w),b(w,"transform-origin",Yi/parseInt(w.style.width)*100+"% "+qi/parseInt(w.style.height)*100+"%")}},_onDragStart:function(t,n){var i=this,o=t.dataTransfer,r=i.options;if(Q("dragStart",this,{evt:t}),v.eventCanceled){this._onDrop();return}Q("setupClone",this),v.eventCanceled||(N=Zi(h),N.removeAttribute("id"),N.draggable=!1,N.style["will-change"]="",this._hideClone(),et(N,this.options.chosenClass,!1),v.clone=N),i.cloneId=ke(function(){Q("clone",i),!v.eventCanceled&&(i.options.removeCloneOnHide||R.insertBefore(N,h),i._hideClone(),G({sortable:i,name:"clone"}))}),!n&&et(h,r.dragClass,!0),n?(Ne=!0,i._loopId=setInterval(i._emulateDragOver,50)):(S(document,"mouseup",i._onDrop),S(document,"touchend",i._onDrop),S(document,"touchcancel",i._onDrop),o&&(o.effectAllowed="move",r.setData&&r.setData.call(i,o,h)),C(document,"drop",i),b(h,"transform","translateZ(0)")),Zt=!0,i._dragStartId=ke(i._dragStarted.bind(i,n,t)),C(document,"selectstart",i),ce=!0,ae&&b(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,i=t.target,o,r,s,a=this.options,l=a.group,u=v.active,c=De===l,d=a.sort,p=z||u,f,g=this,y=!1;if(Ln)return;function D($e,ha){Q($e,g,ht({evt:t,isOwner:c,axis:f?"vertical":"horizontal",revert:s,dragRect:o,targetRect:r,canSort:d,fromSortable:p,target:i,completed:k,onMove:function(xo,pa){return Ue(R,n,h,o,xo,B(xo),t,pa)},changed:ot},ha))}function Z(){D("dragOverAnimationCapture"),g.captureAnimationState(),g!==p&&p.captureAnimationState()}function k($e){return D("dragOverCompleted",{insertion:$e}),$e&&(c?u._hideClone():u._showClone(g),g!==p&&(et(h,z?z.options.ghostClass:u.options.ghostClass,!1),et(h,a.ghostClass,!0)),z!==g&&g!==v.active?z=g:g===v.active&&z&&(z=null),p===g&&(g._ignoreWhileAnimating=i),g.animateAll(function(){D("dragOverAnimationComplete"),g._ignoreWhileAnimating=null}),g!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(i===h&&!h.animated||i===n&&!i.animated)&&(Xt=null),!a.dragoverBubble&&!t.rootEl&&i!==document&&(h.parentNode[nt]._isOutsideThisEl(t.target),!$e&&Ht(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),y=!0}function ot(){it=st(h),_t=st(h,a.draggable),G({sortable:g,name:"change",toEl:n,newIndex:it,newDraggableIndex:_t,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),i=lt(i,a.draggable,n,!0),D("dragOver"),v.eventCanceled)return y;if(h.contains(t.target)||i.animated&&i.animatingX&&i.animatingY||g._ignoreWhileAnimating===i)return k(!1);if(Ne=!1,u&&!a.disabled&&(c?d||(s=H!==R):z===this||(this.lastPutMode=De.checkPull(this,u,h,t))&&l.checkPut(this,u,h,t))){if(f=this._getDirection(t,i)==="vertical",o=B(h),D("dragOverValid"),v.eventCanceled)return y;if(s)return H=R,Z(),this._hideClone(),D("revert"),v.eventCanceled||(Mt?R.insertBefore(h,Mt):R.appendChild(h)),k(!0);var J=Nn(n,a.draggable);if(!J||cs(t,f,this)&&!J.animated){if(J===h)return k(!1);if(J&&n===t.target&&(i=J),i&&(r=B(i)),Ue(R,n,h,o,i,r,t,!!i)!==!1)return Z(),J&&J.nextSibling?n.insertBefore(h,J.nextSibling):n.appendChild(h),H=n,ot(),k(!0)}else if(J&&ds(t,f,this)){var dt=Ft(n,0,a,!0);if(dt===h)return k(!1);if(i=dt,r=B(i),Ue(R,n,h,o,i,r,t,!1)!==!1)return Z(),n.insertBefore(h,dt),H=n,ot(),k(!0)}else if(i.parentNode===n){r=B(i);var P=0,q,ct=h.parentNode!==n,W=!rs(h.animated&&h.toRect||o,i.animated&&i.toRect||r,f),Ee=f?"top":"left",At=ki(i,"top","top")||ki(h,"top","top"),xe=At?At.scrollTop:void 0;Xt!==i&&(q=r[Ee],pe=!1,Ie=!W&&a.invertSwap||ct),P=hs(t,i,r,f,W?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Ie,Xt===i);var wt;if(P!==0){var Bt=st(h);do Bt-=P,wt=H.children[Bt];while(wt&&(b(wt,"display")==="none"||wt===w))}if(P===0||wt===i)return k(!1);Xt=i,he=P;var Se=i.nextElementSibling,Ct=!1;Ct=P===1;var mn=Ue(R,n,h,o,i,r,t,Ct);if(mn!==!1)return(mn===1||mn===-1)&&(Ct=mn===1),Ln=!0,setTimeout(us,30),Z(),Ct&&!Se?n.appendChild(h):i.parentNode.insertBefore(h,Ct?Se:i),At&&zi(At,0,xe-At.scrollTop),H=h.parentNode,q!==void 0&&!Ie&&(He=Math.abs(q-B(i)[Ee])),ot(),k(!0)}if(n.contains(h))return k(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){S(document,"mousemove",this._onTouchMove),S(document,"touchmove",this._onTouchMove),S(document,"pointermove",this._onTouchMove),S(document,"dragover",Ht),S(document,"mousemove",Ht),S(document,"touchmove",Ht)},_offUpEvents:function(){var t=this.el.ownerDocument;S(t,"mouseup",this._onDrop),S(t,"touchend",this._onDrop),S(t,"pointerup",this._onDrop),S(t,"touchcancel",this._onDrop),S(document,"selectstart",this)},_onDrop:function(t){var n=this.el,i=this.options;if(it=st(h),_t=st(h,i.draggable),Q("drop",this,{evt:t}),H=h&&h.parentNode,it=st(h),_t=st(h,i.draggable),v.eventCanceled){this._nulling();return}Zt=!1,Ie=!1,pe=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),kn(this.cloneId),kn(this._dragStartId),this.nativeDraggable&&(S(document,"drop",this),S(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ae&&b(document.body,"user-select",""),b(h,"transform",""),t&&(ce&&(t.cancelable&&t.preventDefault(),!i.dropBubble&&t.stopPropagation()),w&&w.parentNode&&w.parentNode.removeChild(w),(R===H||z&&z.lastPutMode!=="clone")&&N&&N.parentNode&&N.parentNode.removeChild(N),h&&(this.nativeDraggable&&S(h,"dragend",this),Un(h),h.style["will-change"]="",ce&&!Zt&&et(h,z?z.options.ghostClass:this.options.ghostClass,!1),et(h,this.options.chosenClass,!1),G({sortable:this,name:"unchoose",toEl:H,newIndex:null,newDraggableIndex:null,originalEvent:t}),R!==H?(it>=0&&(G({rootEl:H,name:"add",toEl:H,fromEl:R,originalEvent:t}),G({sortable:this,name:"remove",toEl:H,originalEvent:t}),G({rootEl:H,name:"sort",toEl:H,fromEl:R,originalEvent:t}),G({sortable:this,name:"sort",toEl:H,originalEvent:t})),z&&z.save()):it!==zt&&it>=0&&(G({sortable:this,name:"update",toEl:H,originalEvent:t}),G({sortable:this,name:"sort",toEl:H,originalEvent:t})),v.active&&((it==null||it===-1)&&(it=zt,_t=de),G({sortable:this,name:"end",toEl:H,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){Q("nulling",this),R=h=H=w=Mt=N=Re=$t=It=ut=ce=it=_t=zt=de=Xt=he=z=De=v.dragged=v.ghost=v.clone=v.active=null,Be.forEach(function(t){t.checked=!0}),Be.length=Hn=Bn=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":h&&(this._onDragOver(t),ls(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,i=this.el.children,o=0,r=i.length,s=this.options;o<r;o++)n=i[o],lt(n,s.draggable,this.el,!1)&&t.push(n.getAttribute(s.dataIdAttr)||fs(n));return t},sort:function(t,n){var i={},o=this.el;this.toArray().forEach(function(r,s){var a=o.children[s];lt(a,this.options.draggable,o,!1)&&(i[r]=a)},this),n&&this.captureAnimationState(),t.forEach(function(r){i[r]&&(o.removeChild(i[r]),o.appendChild(i[r]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return lt(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var i=this.options;if(n===void 0)return i[t];var o=ue.modifyOption(this,t,n);typeof o<"u"?i[t]=o:i[t]=n,t==="group"&&Ki(i)},destroy:function(){Q("destroy",this);var t=this.el;t[nt]=null,S(t,"mousedown",this._onTapStart),S(t,"touchstart",this._onTapStart),S(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(S(t,"dragover",this),S(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Me.splice(Me.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!$t){if(Q("hideClone",this),v.eventCanceled)return;b(N,"display","none"),this.options.removeCloneOnHide&&N.parentNode&&N.parentNode.removeChild(N),$t=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if($t){if(Q("showClone",this),v.eventCanceled)return;h.parentNode==R&&!this.options.group.revertClone?R.insertBefore(N,h):Mt?R.insertBefore(N,Mt):R.appendChild(N),this.options.group.revertClone&&this.animate(h,N),b(N,"display",""),$t=!1}}};function ls(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Ue(e,t,n,i,o,r,s,a){var l,u=e[nt],c=u.options.onMove,d;return window.CustomEvent&&!vt&&!se?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=i,l.related=o||t,l.relatedRect=r||B(t),l.willInsertAfter=a,l.originalEvent=s,e.dispatchEvent(l),c&&(d=c.call(u,l,s)),d}function Un(e){e.draggable=!1}function us(){Ln=!1}function ds(e,t,n){var i=B(Ft(n.el,0,n.options,!0)),o=Xi(n.el,n.options,w),r=10;return t?e.clientX<o.left-r||e.clientY<i.top&&e.clientX<i.right:e.clientY<o.top-r||e.clientY<i.bottom&&e.clientX<i.left}function cs(e,t,n){var i=B(Nn(n.el,n.options.draggable)),o=Xi(n.el,n.options,w),r=10;return t?e.clientX>o.right+r||e.clientY>i.bottom&&e.clientX>i.left:e.clientY>o.bottom+r||e.clientX>i.right&&e.clientY>i.top}function hs(e,t,n,i,o,r,s,a){var l=i?e.clientY:e.clientX,u=i?n.height:n.width,c=i?n.top:n.left,d=i?n.bottom:n.right,p=!1;if(!s){if(a&&He<u*o){if(!pe&&(he===1?l>c+u*r/2:l<d-u*r/2)&&(pe=!0),pe)p=!0;else if(he===1?l<c+He:l>d-He)return-he}else if(l>c+u*(1-o)/2&&l<d-u*(1-o)/2)return ps(t)}return p=p||s,p&&(l<c+u*r/2||l>d-u*r/2)?l>c+u/2?1:-1:0}function ps(e){return st(h)<st(e)?1:-1}function fs(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,i=0;n--;)i+=t.charCodeAt(n);return i.toString(36)}function gs(e){Be.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var i=t[n];i.checked&&Be.push(i)}}function ke(e){return setTimeout(e,0)}function kn(e){return clearTimeout(e)}Ve&&C(document,"touchmove",function(e){(v.active||Zt)&&e.cancelable&&e.preventDefault()}),v.utils={on:C,off:S,css:b,find:Ui,is:function(t,n){return!!lt(t,n,t,!1)},extend:Jr,throttle:ji,closest:lt,toggleClass:et,clone:Zi,index:st,nextTick:ke,cancelNextTick:kn,detectDirection:Ji,getChild:Ft},v.get=function(e){return e[nt]},v.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(i){if(!i.prototype||!i.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(i));i.utils&&(v.utils=ht(ht({},v.utils),i.utils)),ue.mount(i)})},v.create=function(e,t){return new v(e,t)},v.version=qr;var V=[],fe,Fn,jn=!1,zn,Zn,Fe,ge;function ms(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var i=n.originalEvent;this.sortable.nativeDraggable?C(document,"dragover",this._handleAutoScroll):this.options.supportPointer?C(document,"pointermove",this._handleFallbackAutoScroll):i.touches?C(document,"touchmove",this._handleFallbackAutoScroll):C(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var i=n.originalEvent;!this.options.dragOverBubble&&!i.rootEl&&this._handleAutoScroll(i)},drop:function(){this.sortable.nativeDraggable?S(document,"dragover",this._handleAutoScroll):(S(document,"pointermove",this._handleFallbackAutoScroll),S(document,"touchmove",this._handleFallbackAutoScroll),S(document,"mousemove",this._handleFallbackAutoScroll)),eo(),je(),Kr()},nulling:function(){Fe=Fn=fe=jn=ge=zn=Zn=null,V.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,i){var o=this,r=(n.touches?n.touches[0]:n).clientX,s=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(r,s);if(Fe=n,i||this.options.forceAutoScrollFallback||se||vt||ae){Xn(n,this.options,a,i);var l=St(a,!0);jn&&(!ge||r!==zn||s!==Zn)&&(ge&&eo(),ge=setInterval(function(){var u=St(document.elementFromPoint(r,s),!0);u!==l&&(l=u,je()),Xn(n,o.options,u,i)},10),zn=r,Zn=s)}else{if(!this.options.bubbleScroll||St(a,!0)===pt()){je();return}Xn(n,this.options,St(a,!1),!1)}}},yt(e,{pluginName:"scroll",initializeByDefault:!0})}function je(){V.forEach(function(e){clearInterval(e.pid)}),V=[]}function eo(){clearInterval(ge)}var Xn=ji(function(e,t,n,i){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,r=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,a=t.scrollSpeed,l=pt(),u=!1,c;Fn!==n&&(Fn=n,je(),fe=t.scroll,c=t.scrollFn,fe===!0&&(fe=St(n,!0)));var d=0,p=fe;do{var f=p,g=B(f),y=g.top,D=g.bottom,Z=g.left,k=g.right,ot=g.width,J=g.height,dt=void 0,P=void 0,q=f.scrollWidth,ct=f.scrollHeight,W=b(f),Ee=f.scrollLeft,At=f.scrollTop;f===l?(dt=ot<q&&(W.overflowX==="auto"||W.overflowX==="scroll"||W.overflowX==="visible"),P=J<ct&&(W.overflowY==="auto"||W.overflowY==="scroll"||W.overflowY==="visible")):(dt=ot<q&&(W.overflowX==="auto"||W.overflowX==="scroll"),P=J<ct&&(W.overflowY==="auto"||W.overflowY==="scroll"));var xe=dt&&(Math.abs(k-o)<=s&&Ee+ot<q)-(Math.abs(Z-o)<=s&&!!Ee),wt=P&&(Math.abs(D-r)<=s&&At+J<ct)-(Math.abs(y-r)<=s&&!!At);if(!V[d])for(var Bt=0;Bt<=d;Bt++)V[Bt]||(V[Bt]={});(V[d].vx!=xe||V[d].vy!=wt||V[d].el!==f)&&(V[d].el=f,V[d].vx=xe,V[d].vy=wt,clearInterval(V[d].pid),(xe!=0||wt!=0)&&(u=!0,V[d].pid=setInterval((function(){i&&this.layer===0&&v.active._onTouchMove(Fe);var Se=V[this.layer].vy?V[this.layer].vy*a:0,Ct=V[this.layer].vx?V[this.layer].vx*a:0;typeof c=="function"&&c.call(v.dragged.parentNode[nt],Ct,Se,e,Fe,V[this.layer].el)!=="continue"||zi(V[this.layer].el,Ct,Se)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&p!==l&&(p=St(p,!1)));jn=u}},30),no=function(t){var n=t.originalEvent,i=t.putSortable,o=t.dragEl,r=t.activeSortable,s=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var u=i||r;a();var c=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(c.clientX,c.clientY);l(),u&&!u.el.contains(d)&&(s("spill"),this.onSpill({dragEl:o,putSortable:i}))}};function Yn(){}Yn.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,i=t.putSortable;this.sortable.captureAnimationState(),i&&i.captureAnimationState();var o=Ft(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(n,o):this.sortable.el.appendChild(n),this.sortable.animateAll(),i&&i.animateAll()},drop:no},yt(Yn,{pluginName:"revertOnSpill"});function qn(){}qn.prototype={onSpill:function(t){var n=t.dragEl,i=t.putSortable,o=i||this.sortable;o.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),o.animateAll()},drop:no},yt(qn,{pluginName:"removeOnSpill"}),v.mount(new ms),v.mount(qn,Yn);const ys=e=>{const t=e.item;let n=Array.prototype.slice.call(t.parentNode.childNodes);return n=n.filter(i=>i.nodeType!=Node.ELEMENT_NODE||!i.classList.contains("sortable-fallback")),n},bs=(e,t,n,i,o,r)=>{const a=e.item.parentNode;for(const y of n)a.appendChild(y);if(e.oldIndex==e.newIndex)return;const l=i.getArray(),u=e.item.querySelector("eox-layercontrol-layer").layer.get(o),c=l.find(y=>y.get(o)===u),d=r.dataset.layer,p=l.find(y=>y.get(o)==d);let f,g;for(f=0;f<l.length;f++)if(l[f]==c){i.removeAt(f);break}for(g=0;g<l.length;g++)if(l[g]===p){f>g?i.insertAt(g,c):i.insertAt(g+1,c);break}t.requestUpdate()};function vs(e,t,n,i){let o=[],r=null;e._sortable=v.create(e,{handle:".drag-handle",filter:".drag-handle.disabled",swapThreshold:.5,animation:150,easing:"cubic-bezier(1, 0, 0, 1)",onStart:s=>o=ys(s),onMove:s=>{r=s.related},onEnd:s=>bs(s,i,o,t,n,r)})}function ws(e,t,n,i){const o=e.getArray();let r=!1;o.forEach(s=>{const a=s.ol_uid;s.get(t)||(s.set(t,a),r=!0),s.get(n)||(s.set(n,`layer ${a}`),r=!0),r&&i.requestUpdate()})}function Wn(e,t,n){let i=[];const o=(r,s,a)=>{i=[...i,...r.filter(u=>u.get(s)===a)];const l=r.filter(u=>u.getLayers);return l.length>0&&l.forEach(u=>o(u.getLayers().getArray(),s,a)),i};return o(e,t,n),i}function Es(e,t,n){if(!e||!t)return!1;if(!io(e,n))return!0;const i=e.get("minZoom"),o=e.get("maxZoom"),r=t.getView().getZoom();return r>i&&r<o}function io(e,t){const n=e.get("minZoom"),i=e.get("maxZoom");return!!(t&&(n!==-1/0||i!==1/0))}function xs(e,t){var o,r,s;return!e||!t?void 0:e.getLayers?"group":((s=(o=t.getInteractions().getArray().filter(a=>a.freehand_!==void 0).map(a=>a.source_))==null?void 0:o.ol_uid)==null?void 0:s.includes(e.getSource?(r=e.getSource())==null?void 0:r.ol_uid:void 0))?"draw":e.declutter_!==void 0?"vector":"raster"}function oo(e,t){var i;let n={};for(const o in e){const r=e[o].type;if(r&&r!=="object")n[o]=r==="number"?Number(t[o]):t[o];else if(typeof e[o]=="object"&&((i=e[o])!=null&&i.properties)){const s=oo(e[o].properties,t);Object.keys(s).length>0&&(n[o]=s)}}return n}function Ss(e,t){var r;if(!t||!e.getSource().getTileUrlFunction())return null;const n=new URL(e.getSource().getTileUrlFunction()([0,0,0])),i=Object.fromEntries(n.searchParams.entries()),o=oo(((r=t.schema)==null?void 0:r.properties)||t.schema,i);return Object.keys(o).length?o:null}const $s=(e,t)=>e==null?void 0:e.filter(n=>["remove","sort"].filter(i=>t!=null&&t.get("layerControlDisable")?i!=="sort":!0).includes(n)),_s=(e,t)=>e==null?void 0:e.filter(n=>{let i=!0;return["remove","sort"].includes(n)&&(i=!1),n==="info"&&(i=t.get("description")),n==="config"&&(i=t.get("layerConfig")),i}),As=(e,t)=>x`
46
+ <button slot="${e}-icon" class="icon">${t?e:T}</button>
47
+ `,Cs=e=>x`
48
48
  <button
49
49
  class="remove-icon icon"
50
- @click=${()=>{const{layer:t}=n;t==null||t.set("layerControlOptional",!0),t==null||t.setVisible(!1),n.dispatchEvent(new CustomEvent("changed",{detail:t,bubbles:!0}))}}
50
+ @click=${()=>{const{layer:t}=e;t==null||t.set("layerControlOptional",!0),t==null||t.setVisible(!1),e.dispatchEvent(new CustomEvent("changed",{detail:t,bubbles:!0}))}}
51
51
  >
52
- ${n.unstyled?"x":K}
52
+ ${e.unstyled?"x":T}
53
53
  </button>
54
- `,kd=n=>z`
54
+ `,Ts=e=>x`
55
55
  <span class="button sort-icon icon drag-handle">
56
- ${n?"═":K}
56
+ ${e?"═":T}
57
57
  </span>
58
- `,lo=n=>{var e;const t=["layerControlHide","layerControlOptional"];return(e=n==null?void 0:n.getArray())==null?void 0:e.filter(i=>t.every(s=>!i.get(s)))};/**
58
+ `,ro=e=>{var n;const t=["layerControlHide","layerControlOptional"];return(n=e==null?void 0:e.getArray())==null?void 0:n.filter(i=>t.every(o=>!i.get(o)))};/**
59
59
  * @license
60
60
  * Copyright 2020 Google LLC
61
61
  * SPDX-License-Identifier: BSD-3-Clause
62
- */const ho=Xs(class extends Js{constructor(n){if(super(n),n.type!==ve.PROPERTY&&n.type!==ve.ATTRIBUTE&&n.type!==ve.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!qa(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[t]){if(t===Qt||t===K)return t;const e=n.element,i=n.name;if(n.type===ve.PROPERTY){if(t===e[i])return Qt}else if(n.type===ve.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return Qt}else if(n.type===ve.ATTRIBUTE&&e.getAttribute(i)===t+"")return Qt;return kn(n),t}});/**
62
+ */const so=An(class extends Cn{constructor(e){if(super(e),e.type!==xt.PROPERTY&&e.type!==xt.ATTRIBUTE&&e.type!==xt.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Xo(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[t]){if(t===rt||t===T)return t;const n=e.element,i=e.name;if(e.type===xt.PROPERTY){if(t===n[i])return rt}else if(e.type===xt.BOOLEAN_ATTRIBUTE){if(!!t===n.hasAttribute(i))return rt}else if(e.type===xt.ATTRIBUTE&&n.getAttribute(i)===t+"")return rt;return $i(e),t}});/**
63
63
  * @license
64
64
  * Copyright 2017 Google LLC
65
65
  * SPDX-License-Identifier: BSD-3-Clause
66
- */class vr extends Js{constructor(t){if(super(t),this.it=K,t.type!==ve.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===K||t==null)return this._t=void 0,this.it=t;if(t===Qt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}vr.directiveName="unsafeHTML",vr.resultType=1;const Sd=Xs(vr);/**
66
+ */class Gn extends Cn{constructor(t){if(super(t),this.it=T,t.type!==xt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===T||t==null)return this._t=void 0,this.it=t;if(t===rt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}Gn.directiveName="unsafeHTML",Gn.resultType=1;const Ps=An(Gn);/**
67
67
  * @license
68
68
  * Copyright 2021 Google LLC
69
69
  * SPDX-License-Identifier: BSD-3-Clause
70
- */function*Qi(n,t){if(n!==void 0){let e=0;for(const i of n)yield t(i,e++)}}const Td=n=>typeof n.type!="string"&&"multiple",jd=n=>typeof n.type=="string"&&"string",$d=n=>!n.type&&n.properties&&"object",Pd=n=>typeof n.type=="string"&&["string","number","integer","boolean","null","array","object"].includes(n.type)&&n.type,Od=n=>n.type==="string"&&n.format==="signature"&&"signature",Id=n=>{if(n.type==="boolean")return n.format==="checkbox"||n.options&&n.options.checkbox?"checkbox":n.format==="select2"?"select2":n.format==="selectize"?"selectize":n.format==="choices"?"choices":"select"},Bd=n=>n.type==="any"&&"multiple",Rd=n=>n.type==="string"&&n.media&&n.media.binaryEncoding==="base64"&&"base64",Dd=n=>n.type==="string"&&n.format==="url"&&window.FileReader&&n.options&&n.options.upload===Object(n.options.upload)&&"upload",Nd=n=>n.type==="array"&&n.format==="table"&&"table",Md=n=>{if(n.enumSource)return n.format==="radio"?"radio":n.format==="select2"?"select2":n.format==="selectize"?"selectize":n.format==="choices"?"choices":"select"},Hd=n=>{if(n.enum){if(n.type==="array"||n.type==="object")return"enum";if(n.type==="number"||n.type==="integer"||n.type==="string")return n.format==="radio"?"radio":n.format==="select2"?"select2":n.format==="selectize"?"selectize":n.format==="choices"?"choices":"select"}},Vd=(n,t)=>{if(n.items&&(n.items=t.expandSchema(n.items)),n.type==="array"&&n.items&&!Array.isArray(n.items)&&["string","number","integer"].includes(n.items.type)){if(n.format==="choices")return"arrayChoices";if(n.uniqueItems){if(n.format==="selectize")return"arraySelectize";if(n.format==="select2")return"arraySelect2";if(n.items.enum)return"multiselect"}}},Fd=n=>(n.oneOf||n.anyOf)&&"multiple",zd=n=>n.if&&"multiple",Ud=n=>["string","integer"].includes(n.type)&&["date","time","datetime-local"].includes(n.format)&&"datetime",qd=n=>["string","integer"].includes(n.type)&&["starrating","rating"].includes(n.format)&&"starrating",Gd=n=>{if(n.links){for(let t=0;t<n.links.length;t++)if(n.links[t].rel&&n.links[t].rel.toLowerCase()==="describedby")return"describedBy"}},Zd=n=>{if((n.type==="integer"||n.type==="number")&&n.format==="stepper")return"stepper"},Wd=n=>n.format==="button"&&"button",Yd=n=>n.format==="info"&&"info",Xd=n=>n.type==="string"&&n.format==="uuid"&&"uuid",Jd=n=>n.type==="string"&&n.format==="autocomplete"&&"autocomplete",Qd=n=>n.type==="string"&&n.format==="jodit"&&"jodit",Kd=n=>n.type==="string"&&n.format==="markdown"&&"simplemde",th=n=>n.type==="string"&&["xhtml","bbcode"].includes(n.format)&&"sceditor",eh=["actionscript","batchfile","c","c++","cpp","coffee","csharp","css","dart","django","ejs","erlang","golang","groovy","handlebars","haskell","haxe","html","ini","jade","java","javascript","json","less","lisp","lua","makefile","matlab","mysql","objectivec","pascal","perl","pgsql","php","python","prql","r","ruby","rust","sass","scala","scss","sh","smarty","sql","sqlserver","stylus","svg","typescript","twig","vbscript","xml","yaml","zig"],ih=[n=>n.type==="string"&&n.format==="color"&&"colorpicker",n=>n.type==="string"&&["ip","ipv4","ipv6","hostname"].includes(n.format)&&"ip",n=>n.type==="string"&&eh.includes(n.format)&&"ace",th,Kd,Qd,Jd,Xd,Yd,Wd,Zd,Gd,qd,Ud,Fd,zd,Vd,Hd,Md,Nd,Dd,Rd,Bd,Id,Od,Pd,$d,Td,jd];function co(n){return!(n===null||typeof n!="object"||n.nodeType||n===n.window||n.constructor&&!Wt(n.constructor.prototype,"isPrototypeOf"))}function uo(n){return co(n)?$({},n):Array.isArray(n)?n.map(uo):n}function $(n,...t){return t.forEach(e=>{e&&Object.keys(e).forEach(i=>{e[i]&&co(e[i])?(Wt(n,i)||(n[i]={}),$(n[i],e[i])):Array.isArray(e[i])?n[i]=uo(e[i]):n[i]=e[i]})}),n}function re(n,t){const e=document.createEvent("HTMLEvents");e.initEvent(t,!0,!0),n.dispatchEvent(e)}function po(n){return n&&(n.toString()==="[object ShadowRoot]"?n:po(n.parentNode))}function Wt(n,t){return n&&Object.prototype.hasOwnProperty.call(n,t)}const sh=/^\s*(-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/;function rh(n){if(typeof n>"u"||n===null)return!1;const t=n.match(sh),e=parseFloat(n);return t!==null&&!isNaN(e)&&isFinite(e)}const nh=/^\s*(-|\+)?(\d+)\s*$/;function oh(n){if(typeof n>"u"||n===null)return!1;const t=n.match(nh),e=parseInt(n);return t!==null&&!isNaN(e)&&isFinite(e)}function Ei(){let n=new Date().getTime();return typeof performance<"u"&&typeof performance.now=="function"&&(n+=performance.now()),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=(n+Math.random()*16)%16|0;return n=Math.floor(n/16),(t==="x"?e:e&3|8).toString(16)})}function wr(n){return n&&typeof n=="object"&&!Array.isArray(n)}function Ki(n,...t){if(!t.length)return n;const e=t.shift();if(wr(n)&&wr(e))for(const i in e)wr(e[i])?(n[i]||Object.assign(n,{[i]:{}}),Ki(n[i],e[i])):Object.assign(n,{[i]:e[i]});return Ki(n,...t)}function ah(n,t){return Object.keys(t).forEach(function(e){e in n&&(n[e]=t[e])}),n}class Bt{constructor(t,e){this.defaults=e,this.jsoneditor=t.jsoneditor,this.theme=this.jsoneditor.theme,this.template_engine=this.jsoneditor.template,this.iconlib=this.jsoneditor.iconlib,this.translate=this.jsoneditor.translate||this.defaults.translate,this.translateProperty=this.jsoneditor.translateProperty||this.defaults.translateProperty,this.original_schema=t.schema,this.schema=this.jsoneditor.expandSchema(this.original_schema),this.active=!0,this.isUiOnly=!1,this.options=$({},this.options||{},this.schema.options||{},t.schema.options||{},t),this.formname=this.jsoneditor.options.form_name_root||"root",!t.path&&!this.schema.id&&(this.schema.id=this.formname),this.path=t.path||this.formname,this.formname=t.formname||this.path.replace(/\.([^.]+)/g,"[$1]"),this.parent=t.parent,this.key=this.parent!==void 0?this.path.split(".").slice(this.parent.path.split(".").length).join("."):this.path,this.link_watchers=[],this.watchLoop=!1,t.container&&this.setContainer(t.container),this.registerDependencies()}onChildEditorChange(t){this.onChange(!0)}notify(){this.path&&this.jsoneditor.notifyWatchers(this.path)}change(){this.parent?this.parent.onChildEditorChange(this):this.jsoneditor&&this.jsoneditor.onChange()}onChange(t){this.notify(),this.watch_listener&&this.watch_listener(),t&&this.change()}register(){if(this.jsoneditor.registerEditor(this),this.input&&!this.label){const t=this.getTitle()||this.formname;this.input.setAttribute("aria-label",t)}this.onChange()}unregister(){this.jsoneditor&&this.jsoneditor.unregisterEditor(this)}getNumColumns(){return 12}isActive(){return this.active}activate(){this.active=!0,this.optInCheckbox.checked=!0,this.enable(),this.change()}deactivate(){this.isRequired()||(this.active=!1,this.optInCheckbox.checked=!1,this.disable(),this.change())}registerDependencies(){this.dependenciesFulfilled=!0;const t=this.options.dependencies;t&&Object.keys(t).forEach(e=>{let i;e.startsWith(this.jsoneditor.root.path)?i=e:(i=this.path.split("."),i[i.length-1]=e,i=i.join(".")),this.jsoneditor.watch(i,()=>{this.evaluateDependencies()})})}evaluateDependencies(){const t=this.container||this.control;if(!t||this.jsoneditor===null)return;const e=this.options.dependencies;if(!e)return;const i=this.dependenciesFulfilled;this.dependenciesFulfilled=!0,Object.keys(e).forEach(r=>{let o;r.startsWith(this.jsoneditor.root.path)?o=r:(o=this.path.split("."),o[o.length-1]=r,o=o.join("."));const l=e[r];this.checkDependency(o,l)}),this.dependenciesFulfilled!==i&&this.notify();let s=this.dependenciesFulfilled?"block":"none";this.options.hidden&&(s="none"),t.tagName==="TD"?Object.keys(t.childNodes).forEach(r=>t.childNodes[r].style.display=s):t.style.display=s}checkDependency(t,e){if(this.path===t||this.jsoneditor===null)return;const i=this.jsoneditor.getEditor(t),s=i?i.getValue():void 0;!i||!i.dependenciesFulfilled?this.dependenciesFulfilled=!1:Array.isArray(e)?this.dependenciesFulfilled=e.some(r=>{if(JSON.stringify(s)===JSON.stringify(r))return!0}):typeof e=="object"?typeof s!="object"?this.dependenciesFulfilled=e===s:Object.keys(e).some(r=>{if(!Wt(e,r))return!1;if(!Wt(s,r)||e[r]!==s[r])return this.dependenciesFulfilled=!1,!0}):typeof e=="string"||typeof e=="number"?this.dependenciesFulfilled=this.dependenciesFulfilled&&s===e:typeof e=="boolean"&&(e?this.dependenciesFulfilled=this.dependenciesFulfilled&&(s||s.length>0):this.dependenciesFulfilled=this.dependenciesFulfilled&&(!s||s.length===0))}setContainer(t){this.container=t,this.setContainerAttributes(),this.schema.id&&this.container.setAttribute("data-schemaid",this.schema.id),this.schema.type&&typeof this.schema.type=="string"&&this.container.setAttribute("data-schematype",this.schema.type),this.container.setAttribute("data-schemapath",this.path)}setOptInCheckbox(t){this.optInLabel=this.theme.getHiddenLabel(this.formname+" opt-in"),this.optInLabel.setAttribute("for",this.formname+"-opt-in"),this.optInCheckbox=document.createElement("input"),this.optInCheckbox.setAttribute("type","checkbox"),this.optInCheckbox.setAttribute("style","margin: 0 10px 0 0;"),this.optInCheckbox.setAttribute("id",this.formname+"-opt-in"),this.optInCheckbox.classList.add("json-editor-opt-in"),this.optInCheckbox.addEventListener("click",()=>{this.isActive()?this.deactivate():this.activate()});const e=this.jsoneditor.options.show_opt_in,i=typeof this.parent.options.show_opt_in<"u",s=i&&this.parent.options.show_opt_in===!0,r=i&&this.parent.options.show_opt_in===!1;(s||!r&&e||!i&&e)&&this.parent&&this.parent.schema.type==="object"&&!this.isRequired()&&this.header&&(this.header.appendChild(this.optInLabel),this.header.appendChild(this.optInCheckbox),this.header.insertBefore(this.optInCheckbox,this.header.firstChild))}preBuild(){}build(){}postBuild(){this.setupWatchListeners(),this.addLinks(),this.register(),this.setValue(this.getDefault(),!0),this.updateHeaderText(),this.onWatchedFieldChange(),this.options.titleHidden&&(this.theme.visuallyHidden(this.label),this.theme.visuallyHidden(this.header))}setupWatchListeners(){if(this.watched={},this.schema.vars&&(this.schema.watch=this.schema.vars),this.watched_values={},this.watch_listener=()=>{this.refreshWatchedFieldValues()&&this.onWatchedFieldChange()},Wt(this.schema,"watch")){let t,e,i,s,r;const o=this.container.getAttribute("data-schemapath");Object.keys(this.schema.watch).forEach(a=>{if(t=this.schema.watch[a],Array.isArray(t)){if(t.length<2)return;e=[t[0]].concat(t[1].split("."))}else e=t.split("."),this.theme.closest(this.container,`[data-schemaid="${e[0]}"]`)||e.unshift("#");if(i=e.shift(),i==="#"&&(i=this.jsoneditor.schema.id||this.jsoneditor.root.formname),s=this.theme.closest(this.container,`[data-schemaid="${i}"]`),!s)throw new Error(`Could not find ancestor node with id ${i}`);r=`${s.getAttribute("data-schemapath")}.${e.join(".")}`,o.startsWith(r)&&(this.watchLoop=!0),this.jsoneditor.watch(r,this.watch_listener),this.watched[a]=r})}this.schema.headerTemplate&&(this.header_template=this.jsoneditor.compileTemplate(this.schema.headerTemplate,this.template_engine))}addLinks(){if(!this.no_link_holder&&(this.link_holder=this.theme.getLinksHolder(),typeof this.description<"u"?this.description.parentNode.insertBefore(this.link_holder,this.description):this.container.appendChild(this.link_holder),this.schema.links))for(let t=0;t<this.schema.links.length;t++)this.addLink(this.getLink(this.schema.links[t]))}onMove(){}getButton(t,e,i,s=[]){const r=`json-editor-btn-${e}`;this.iconlib?e=this.iconlib.getIcon(e):e=null,t=this.translate(t,s),i=this.translate(i,s),!e&&i&&(t=i,i=null);const o=this.theme.getButton(t,e,i);return o.classList.add(r),o}setButtonText(t,e,i,s,r=[]){return this.iconlib?i=this.iconlib.getIcon(i):i=null,e=this.translate(e,r),s=this.translate(s,r),!i&&s&&(e=s,s=null),this.theme.setButtonText(t,e,i,s)}addLink(t){this.link_holder&&this.link_holder.appendChild(t)}getLink(t){let e,i;const r=(t.mediaType||"application/javascript").split("/")[0],o=this.jsoneditor.compileTemplate(t.href,this.template_engine),a=this.jsoneditor.compileTemplate(t.rel?t.rel:t.href,this.template_engine);let l=null;if(t.download&&(l=t.download),l&&l!==!0&&(l=this.jsoneditor.compileTemplate(l,this.template_engine)),r==="image"){e=this.theme.getBlockLinkHolder(),i=document.createElement("a"),i.setAttribute("target","_blank");const d=document.createElement("img");this.theme.createImageLink(e,i,d),this.link_watchers.push(h=>{const u=o(h),g=a(h);i.setAttribute("href",u),i.setAttribute("title",g||u),d.setAttribute("src",u)})}else if(["audio","video"].includes(r)){e=this.theme.getBlockLinkHolder(),i=this.theme.getBlockLink(),i.setAttribute("target","_blank");const d=document.createElement(r);d.setAttribute("controls","controls"),this.theme.createMediaLink(e,i,d),this.link_watchers.push(h=>{const u=o(h),g=a(h);i.setAttribute("href",u),i.textContent=g||u,d.setAttribute("src",u)})}else i=e=this.theme.getBlockLink(),e.setAttribute("target","_blank"),e.textContent=t.rel,e.style.display="none",this.link_watchers.push(d=>{const h=o(d),u=a(d);h&&(e.style.display=""),e.setAttribute("href",h),e.textContent=u||h});return l&&i&&(l===!0?i.setAttribute("download",""):this.link_watchers.push(d=>{i.setAttribute("download",l(d))})),t.class&&i.classList.add(t.class),e}refreshWatchedFieldValues(){if(!this.watched_values)return;const t={};let e=!1;return this.watched&&Object.keys(this.watched).forEach(i=>{const s=this.jsoneditor.getEditor(this.watched[i]),r=s?s.getValue():null;this.watched_values[i]!==r&&(e=!0),t[i]=r}),t.self=this.getValue(),this.watched_values.self!==t.self&&(e=!0),this.watched_values=t,e}getWatchedFieldValues(){return this.watched_values}updateHeaderText(){if(this.header){const t=this.getHeaderText();if(this.header.children.length){for(let e=0;e<this.header.childNodes.length;e++)if(this.header.childNodes[e].nodeType===3){this.header.childNodes[e].nodeValue=this.cleanText(t);break}}else window.DOMPurify?this.header.innerHTML=window.DOMPurify.sanitize(t):this.header.textContent=this.cleanText(t)}}getHeaderText(t){return this.header_text?this.header_text:t?this.translateProperty(this.schema.title):this.getTitle()}getPathDepth(){return this.path.split(".").length}cleanText(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText}onWatchedFieldChange(){let t;if(this.header_template){t=$(this.getWatchedFieldValues(),{key:this.key,i:this.key,i0:this.key*1,i1:this.key*1+1,title:this.getTitle()}),this.editors&&Object.keys(this.editors).length&&(t.properties={},Object.keys(this.editors).forEach(i=>{const s=this.editors[i];if(s.schema&&s.schema.enum&&s.schema.options&&s.schema.options.enum_titles){const r=s.schema.enum.indexOf(s.value),o=s.options.enum_titles[r];t.properties[i]={enumTitle:o}}}));const e=this.header_template(t);e!==this.header_text&&(this.header_text=e,this.updateHeaderText(),this.notify())}if(this.link_watchers.length){t=this.getWatchedFieldValues();for(let e=0;e<this.link_watchers.length;e++)this.link_watchers[e](t)}}setValue(t){this.value=t}getValue(){if(this.dependenciesFulfilled)return this.value}refreshValue(){}getChildEditors(){return!1}destroy(){this.unregister(this),this.watched&&Object.values(this.watched).forEach(t=>this.jsoneditor.unwatch(t,this.watch_listener)),this.watched=null,this.watched_values=null,this.watch_listener=null,this.header_text=null,this.header_template=null,this.value=null,this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.container=null,this.jsoneditor=null,this.schema=null,this.path=null,this.key=null,this.parent=null}isDefaultRequired(){return this.isRequired()||!!this.jsoneditor.options.use_default_values}getDefault(){if(typeof this.schema.default<"u")return this.schema.default;if(typeof this.schema.enum<"u")return this.schema.enum[0];let t=this.schema.type||this.schema.oneOf;if(t&&Array.isArray(t)&&(t=t[0]),t&&typeof t=="object"&&(t=t.type),t&&Array.isArray(t)&&(t=t[0]),typeof t=="string"){if(t==="number")return this.isDefaultRequired()?0:void 0;if(t==="boolean")return this.isDefaultRequired()?!1:void 0;if(t==="integer")return this.isDefaultRequired()?0:void 0;if(t==="string")return this.isDefaultRequired()?"":void 0;if(t==="null")return null;if(t==="object")return{};if(t==="array")return[]}}getTitle(){return this.translateProperty(this.schema.title||this.key||this.formname)}enable(){this.disabled=!1}disable(){this.disabled=!0}isEnabled(){return!this.disabled}isRequired(){return typeof this.schema.required=="boolean"?this.schema.required:this.parent&&this.parent.schema&&Array.isArray(this.parent.schema.required)?this.parent.schema.required.includes(this.key):!!this.jsoneditor.options.required_by_default}getDisplayText(t){const e=[],i={};t.forEach(r=>{r.title&&(i[r.title]=i[r.title]||0,i[r.title]++),r.description&&(i[r.description]=i[r.description]||0,i[r.description]++),r.format&&(i[r.format]=i[r.format]||0,i[r.format]++),r.type&&(i[r.type]=i[r.type]||0,i[r.type]++)}),t.forEach(r=>{let o;typeof r=="string"?o=r:r.title&&i[r.title]<=1?o=r.title:r.format&&i[r.format]<=1?o=r.format:r.type&&i[r.type]<=1?o=r.type:r.description&&i[r.description]<=1?o=r.description:r.title?o=r.title:r.format?o=r.format:r.type?o=r.type:r.description?o=r.description:JSON.stringify(r).length<500?o=JSON.stringify(r):o="type",e.push(o)});const s={};return e.forEach((r,o)=>{s[r]=s[r]||0,s[r]++,i[r]>1&&(e[o]=`${r} ${s[r]}`)}),e}getValidId(t){return t=t===void 0?"":t.toString(),t.replace(/\s+/g,"-")}setInputAttributes(t){if(this.schema.options&&this.schema.options.inputAttributes){const e=this.schema.options.inputAttributes,i=["name","type"].concat(t);Object.keys(e).forEach(s=>{i.includes(s.toLowerCase())||this.input.setAttribute(s,e[s])})}}setContainerAttributes(){if(this.schema.options&&this.schema.options.containerAttributes){const t=this.schema.options.containerAttributes,e=["data-schemapath","data-schematype","data-schemaid"];Object.keys(t).forEach(i=>{e.includes(i.toLowerCase())||this.container.setAttribute(i,t[i])})}}expandCallbacks(t,e){const i=this.defaults.callbacks[t];return Object.entries(e).forEach(([s,r])=>{r===Object(r)?e[s]=this.expandCallbacks(t,r):typeof r=="string"&&typeof i=="object"&&typeof i[r]=="function"&&(e[s]=i[r].bind(null,this))}),e}showValidationErrors(t){}}class Yt extends Bt{register(){super.register(),this.input&&this.jsoneditor.options.use_name_attributes&&this.input.setAttribute("name",this.formname)}unregister(){super.unregister(),this.input&&(this.input.removeAttribute("name"),this.input.removeAttribute("aria-label"))}setValue(t,e,i){if(this.template&&!i||(!this.shouldBeUnset()&&(t===null||typeof t>"u")?t="":typeof t=="object"?t=JSON.stringify(t):!this.shouldBeUnset()&&typeof t!="string"&&(t=`${t}`),t===this.serialized))return;const s=this.sanitize(t);if(this.input.value===s)return;if(this.setValueToInputField(s),this.format==="range"){const o=this.control.querySelector("output");o&&(o.value=s)}const r=i||this.getValue()!==t;return this.refreshValue(),e?this.is_dirty=!1:this.jsoneditor.options.show_errors==="change"&&(this.is_dirty=!0),this.adjust_height&&this.adjust_height(this.input),i||this.onChange(r),{changed:r,value:s}}setValueToInputField(t){this.input.value=t===void 0?"":t}getNumColumns(){const t=Math.ceil(Math.max(this.getTitle().length,this.schema.maxLength||0,this.schema.minLength||0)/5);let e;return this.input_type==="textarea"?e=6:["text","email"].includes(this.input_type)?e=4:e=2,Math.min(12,Math.max(t,e))}build(){if(this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.format=this.schema.format,!this.format&&this.schema.media&&this.schema.media.type&&(this.format=this.schema.media.type.replace(/(^(application|text)\/(x-)?(script\.)?)|(-source$)/g,"")),!this.format&&this.options.default_format&&(this.format=this.options.default_format),this.options.format&&(this.format=this.options.format),this.format)if(this.format==="textarea")this.input_type="textarea",this.input=this.theme.getTextareaInput();else if(this.format==="range"){this.input_type="range";let e=this.schema.minimum||0,i=this.schema.maximum||Math.max(100,e+1),s=1;this.schema.multipleOf&&(e%this.schema.multipleOf&&(e=Math.ceil(e/this.schema.multipleOf)*this.schema.multipleOf),i%this.schema.multipleOf&&(i=Math.floor(i/this.schema.multipleOf)*this.schema.multipleOf),s=this.schema.multipleOf),this.input=this.theme.getRangeInput(e,i,s,this.description,this.formname),this.input.setAttribute("id",this.formname)}else this.input_type="text",["button","checkbox","color","date","datetime-local","email","file","hidden","image","month","number","password","radio","reset","search","submit","tel","text","time","url","week"].includes(this.format)&&(this.input_type=this.format),this.input=this.theme.getFormInputField(this.input_type);else this.input_type="text",this.input=this.theme.getFormInputField(this.input_type);typeof this.schema.maxLength<"u"&&this.input.setAttribute("maxlength",this.schema.maxLength),typeof this.schema.pattern<"u"?this.input.setAttribute("pattern",this.schema.pattern):typeof this.schema.minLength<"u"&&this.input.setAttribute("pattern",`.{${this.schema.minLength},}`),this.options.compact?this.container.classList.add("compact"):this.options.input_width&&(this.input.style.width=this.options.input_width),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&(this.disable(!0),this.input.setAttribute("readonly","true")),this.setInputAttributes(["maxlength","pattern","readonly","min","max","step"]),this.input.addEventListener("change",e=>{if(e.preventDefault(),e.stopPropagation(),this.schema.template){e.currentTarget.value=this.value;return}const i=e.currentTarget.value,s=this.sanitize(i);i!==s&&(e.currentTarget.value=s),this.is_dirty=!0,this.refreshValue(),this.onChange(!0)}),this.options.input_height&&(this.input.style.height=this.options.input_height),this.options.expand_height&&(this.adjust_height=e=>{if(!e)return;let i,s=e.offsetHeight;if(e.offsetHeight<e.scrollHeight)for(i=0;e.offsetHeight<e.scrollHeight+3&&!(i>100);)i++,s++,e.style.height=`${s}px`;else{for(i=0;e.offsetHeight>=e.scrollHeight+3&&!(i>100);)i++,s--,e.style.height=`${s}px`;e.style.height=`${s+1}px`}},this.input.addEventListener("keyup",e=>{this.adjust_height(e.currentTarget)}),this.input.addEventListener("change",e=>{this.adjust_height(e.currentTarget)}),this.adjust_height()),this.format&&this.input.setAttribute("data-schemaformat",this.format);let{input:t}=this;if(this.format==="range"&&(t=this.theme.getRangeControl(this.input,this.theme.getRangeOutput(this.input,this.schema.default||Math.max(this.schema.minimum||0,0)))),this.control=this.theme.getFormControl(this.label,t,this.description,this.infoButton,this.formname),this.container.appendChild(this.control),window.requestAnimationFrame(()=>{if(this.input.parentNode&&this.afterInputReady(),this.adjust_height&&this.adjust_height(this.input),this.format==="range"){const e=this.control.querySelector("output");e.value=this.input.value}}),this.schema.template){const e=this.expandCallbacks("template",{template:this.schema.template});typeof e.template=="function"?this.template=e.template:this.template=this.jsoneditor.compileTemplate(this.schema.template,this.template_engine),this.refreshValue()}else this.refreshValue()}setupCleave(t){const e=this.expandCallbacks("cleave",$({},this.defaults.options.cleave||{},this.options.cleave||{}));typeof e=="object"&&Object.keys(e).length>0&&(this.cleave_instance=new window.Cleave(t,e))}setupImask(t){const e=this.expandCallbacks("imask",$({},this.defaults.options.imask||{},this.options.imask||{}));typeof e=="object"&&Object.keys(e).length>0&&(this.imask_instance=window.IMask(t,this.ajustIMaskOptions(e)))}ajustIMaskOptions(t){return Object.keys(t).forEach(e=>{if(t[e]===Object(t[e]))t[e]=this.ajustIMaskOptions(t[e]);else if(e==="mask")if(t[e].substr(0,6)==="regex:"){const i=t[e].match(/^regex:\/(.*)\/([gimsuy]*)$/);if(i!==null)try{t[e]=new RegExp(i[1],i[2])}catch{}}else t[e]=this.getGlobalPropertyFromString(t[e])}),t}getGlobalPropertyFromString(t){if(t.includes(".")){const e=t.split("."),i=e[0],s=e[1];if(typeof window[i]<"u"&&typeof window[i][s]<"u")return window[i][s]}else if(typeof window[t]<"u")return window[t];return t}shouldBeUnset(){return!this.jsoneditor.options.use_default_values&&!this.is_dirty}getValue(){const t=!!(this.input&&this.input.value);if(!(this.shouldBeUnset()&&!t))return this.imask_instance&&this.dependenciesFulfilled&&this.options.imask.returnUnmasked?this.imask_instance.unmaskedValue:super.getValue()}enable(){this.always_disabled||(this.input.disabled=!1,super.enable())}disable(t){t&&(this.always_disabled=!0),this.input.disabled=!0,super.disable()}afterInputReady(){this.theme.afterInputReady(this.input),window.Cleave&&!this.cleave_instance?this.setupCleave(this.input):window.IMask&&!this.imask_instance&&this.setupImask(this.input)}refreshValue(){this.input&&(this.value=this.input.value,typeof this.value!="string"&&!this.shouldBeUnset()&&(this.value=""),this.serialized=this.value)}destroy(){this.cleave_instance&&this.cleave_instance.destroy(),this.imask_instance&&this.imask_instance.destroy(),this.template=null,this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),super.destroy()}sanitize(t){return t}onWatchedFieldChange(){let t;this.template&&(t=this.getWatchedFieldValues(),this.setValue(this.template(t),!1,!0)),super.onWatchedFieldChange()}showValidationErrors(t){if(this.jsoneditor.options.show_errors!=="always"){if(!this.is_dirty&&this.previous_error_setting===this.jsoneditor.options.show_errors)return}this.previous_error_setting=this.jsoneditor.options.show_errors;const e=(s,r)=>(r.path===this.path&&s.push(r.message),s),i=t.reduce(e,[]);i.length?this.theme.addInputError(this.input,`${i.join(". ")}.`):this.theme.removeInputError(this.input)}}class lh extends Yt{setValue(t,e,i){const s=super.setValue(t,e,i);s!==void 0&&s.changed&&this.ace_editor_instance&&(this.ace_editor_instance.setValue(s.value),this.ace_editor_instance.session.getSelection().clearSelection(),this.ace_editor_instance.resize())}build(){this.options.format="textarea",super.build(),this.input_type=this.schema.format,this.input.setAttribute("data-schemaformat",this.input_type)}afterInputReady(){let t;if(window.ace){let e=this.input_type;(e==="cpp"||e==="c++"||e==="c")&&(e="c_cpp"),t=this.expandCallbacks("ace",$({},{selectionStyle:"text",minLines:30,maxLines:30},this.defaults.options.ace||{},this.options.ace||{},{mode:`ace/mode/${e}`})),this.ace_container=document.createElement("div"),this.ace_container.style.width="100%",this.ace_container.style.position="relative",this.input.parentNode.insertBefore(this.ace_container,this.input),this.input.style.display="none",this.ace_editor_instance=window.ace.edit(this.ace_container,t),this.ace_editor_instance.setValue(this.getValue()),this.ace_editor_instance.session.getSelection().clearSelection(),this.ace_editor_instance.resize(),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&this.ace_editor_instance.setReadOnly(!0),this.ace_editor_instance.on("change",()=>{this.input.value=this.ace_editor_instance.getValue(),this.refreshValue(),this.is_dirty=!0,this.onChange(!0)}),this.theme.afterInputReady(this.input)}else super.afterInputReady()}getNumColumns(){return 6}enable(){!this.always_disabled&&this.ace_editor_instance&&this.ace_editor_instance.setReadOnly(!1),super.enable()}disable(t){this.ace_editor_instance&&this.ace_editor_instance.setReadOnly(!0),super.disable(t)}destroy(){this.ace_editor_instance&&(this.ace_editor_instance.destroy(),this.ace_editor_instance=null),super.destroy()}}const dh={".json-editor-btntype-toggle":"margin:0%2010px%200%200",".je-array-control-btn":"width:100%25;text-align:left;margin-bottom:3px"};class xr extends Bt{askConfirmation(){return!(this.jsoneditor.options.prompt_before_delete===!0&&window.confirm(this.translate("button_delete_node_warning"))===!1)}getDefault(){return this.schema.default||[]}register(){super.register(),this.rows&&this.rows.forEach(t=>t.register())}unregister(){super.unregister(),this.rows&&this.rows.forEach(t=>t.unregister())}getNumColumns(){const t=this.getItemInfo(0);return this.tabs_holder&&this.schema.format!=="tabs-top"?Math.max(Math.min(12,t.width+2),4):t.width}enable(){this.always_disabled||(this.setAvailability(this,!1),this.rows&&this.rows.forEach(t=>{t.enable(),this.setAvailability(t,!1)}),super.enable())}disable(t){t&&(this.always_disabled=!0),this.setAvailability(this,!0),this.rows&&this.rows.forEach(e=>{e.disable(t),this.setAvailability(e,!0)}),super.disable()}setAvailability(t,e){t.add_row_button&&(t.add_row_button.disabled=e),t.remove_all_rows_button&&(t.remove_all_rows_button.disabled=e),t.delete_last_row_button&&(t.delete_last_row_button.disabled=e),t.copy_button&&(t.copy_button.disabled=e),t.delete_button&&(t.delete_button.disabled=e),t.moveup_button&&(t.moveup_button.disabled=e),t.movedown_button&&(t.movedown_button.disabled=e)}preBuild(){super.preBuild(),this.rows=[],this.row_cache=[],this.hide_delete_buttons=this.options.disable_array_delete||this.jsoneditor.options.disable_array_delete,this.hide_delete_all_rows_buttons=this.hide_delete_buttons||this.options.disable_array_delete_all_rows||this.jsoneditor.options.disable_array_delete_all_rows,this.hide_delete_last_row_buttons=this.hide_delete_buttons||this.options.disable_array_delete_last_row||this.jsoneditor.options.disable_array_delete_last_row,this.hide_move_buttons=this.options.disable_array_reorder||this.jsoneditor.options.disable_array_reorder,this.hide_add_button=this.options.disable_array_add||this.jsoneditor.options.disable_array_add,this.show_copy_button=this.options.enable_array_copy||this.jsoneditor.options.enable_array_copy,this.array_controls_top=this.options.array_controls_top||this.jsoneditor.options.array_controls_top}build(){this.options.compact?(this.title=this.theme.getHeader("",this.getPathDepth()),this.container.appendChild(this.title),this.panel=this.theme.getIndentedPanel(),this.container.appendChild(this.panel),this.title_controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.title_controls),this.controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.controls),this.row_holder=document.createElement("div"),this.panel.appendChild(this.row_holder)):(this.header=document.createElement("span"),this.header.textContent=this.getTitle(),this.title=this.theme.getHeader(this.header,this.getPathDepth()),this.container.appendChild(this.title),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText)),this.container.appendChild(this.infoButton)),this.title_controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.title_controls),this.schema.description&&(this.description=this.theme.getDescription(this.translateProperty(this.schema.description)),this.container.appendChild(this.description)),this.error_holder=document.createElement("div"),this.container.appendChild(this.error_holder),this.schema.format==="tabs-top"?(this.controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.controls),this.tabs_holder=this.theme.getTopTabHolder(this.getValidId(this.getItemTitle())),this.container.appendChild(this.tabs_holder),this.row_holder=this.theme.getTopTabContentHolder(this.tabs_holder),this.active_tab=null):this.schema.format==="tabs"?(this.controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.controls),this.tabs_holder=this.theme.getTabHolder(this.getValidId(this.getItemTitle())),this.container.appendChild(this.tabs_holder),this.row_holder=this.theme.getTabContentHolder(this.tabs_holder),this.active_tab=null):(this.panel=this.theme.getIndentedPanel(),this.container.appendChild(this.panel),this.row_holder=document.createElement("div"),this.panel.appendChild(this.row_holder),this.controls=this.theme.getButtonHolder(),this.array_controls_top?this.title.appendChild(this.controls):this.panel.appendChild(this.controls))),this.addControls()}postBuild(){super.postBuild(),(this.schema.readOnly||this.schema.readonly)&&this.disable()}onChildEditorChange(t){this.refreshValue(),this.refreshTabs(!0),super.onChildEditorChange(t)}getItemTitle(){if(!this.item_title)if(this.schema.items&&!Array.isArray(this.schema.items)){const t=this.jsoneditor.expandRefs(this.schema.items);this.item_title=this.translateProperty(t.title)||this.translate("default_array_item_title")}else this.item_title=this.translate("default_array_item_title");return this.cleanText(this.item_title)}getItemSchema(t){if(Array.isArray(this.schema.items))if(t>=this.schema.items.length){if(this.schema.additionalItems===!0)return{};if(this.schema.additionalItems)return $({},this.schema.additionalItems)}else return $({},this.schema.items[t]);else return this.schema.items?$({},this.schema.items):{}}getItemInfo(t){let e=this.getItemSchema(t);this.item_info=this.item_info||{};const i=JSON.stringify(e);return typeof this.item_info[i]<"u"?this.item_info[i]:(e=this.jsoneditor.expandRefs(e),this.item_info[i]={title:this.translateProperty(e.title)||this.translate("default_array_item_title"),default:e.default,width:12,child_editors:e.properties||e.items},this.item_info[i])}getElementEditor(t){const e=this.getItemInfo(t);let i=this.getItemSchema(t);i=this.jsoneditor.expandRefs(i),i.title=`${e.title} ${t+1}`;const s=this.jsoneditor.getEditorClass(i);let r;this.tabs_holder?(this.schema.format==="tabs-top"?r=this.theme.getTopTabContent():r=this.theme.getTabContent(),r.id=`${this.path}.${t}`):e.child_editors?r=this.theme.getChildEditorHolder():r=this.theme.getIndentedPanel(),this.row_holder.appendChild(r);const o=this.jsoneditor.createEditor(s,{jsoneditor:this.jsoneditor,schema:i,container:r,path:`${this.path}.${t}`,parent:this,required:!0});return o.preBuild(),o.build(),o.postBuild(),o.title_controls||(o.array_controls=this.theme.getButtonHolder(),r.appendChild(o.array_controls)),o}checkParent(t){return t&&t.parentNode}destroy(){this.empty(!0),this.checkParent(this.title)&&this.title.parentNode.removeChild(this.title),this.checkParent(this.description)&&this.description.parentNode.removeChild(this.description),this.checkParent(this.row_holder)&&this.row_holder.parentNode.removeChild(this.row_holder),this.checkParent(this.controls)&&this.controls.parentNode.removeChild(this.controls),this.checkParent(this.panel)&&this.panel.parentNode.removeChild(this.panel),this.rows=this.row_cache=this.title=this.description=this.row_holder=this.panel=this.controls=null,super.destroy()}empty(t){if(this.rows!==null){if(this.rows.forEach((e,i)=>{t&&(this.checkParent(e.tab)&&e.tab.parentNode.removeChild(e.tab),this.destroyRow(e,!0),this.row_cache[i]=null),this.rows[i]=null}),t)for(let e=this.rows.length;e<this.row_cache.length;e++)this.destroyRow(this.row_cache[e],!0),this.row_cache[e]=null;this.rows=[],t&&(this.row_cache=[])}}destroyRow(t,e){const i=t.container;e?(t.destroy(),i.parentNode&&i.parentNode.removeChild(i),this.checkParent(t.tab)&&t.tab.parentNode.removeChild(t.tab)):(t.tab&&(t.tab.style.display="none"),i.style.display="none",t.unregister())}getMax(){return Array.isArray(this.schema.items)&&this.schema.additionalItems===!1?Math.min(this.schema.items.length,this.schema.maxItems||1/0):this.schema.maxItems||1/0}refreshTabs(t){this.rows.forEach(e=>{e.tab&&(t?e.tab_text.textContent=e.getHeaderText():e.tab===this.active_tab?this.theme.markTabActive(e):this.theme.markTabInactive(e))})}ensureArraySize(t){if(Array.isArray(t)||(t=[t]),this.schema.minItems)for(;t.length<this.schema.minItems;)t.push(this.getItemInfo(t.length).default);return this.getMax()&&t.length>this.getMax()&&(t=t.slice(0,this.getMax())),t}setValue(t=[],e){if(t=this.ensureArraySize(t),JSON.stringify(t)===this.serialized){e&&this.refreshValue(e);return}t.forEach((o,a)=>{if(this.rows[a])this.rows[a].setValue(o,e);else if(this.row_cache[a])this.rows[a]=this.row_cache[a],this.rows[a].setValue(o,e),this.rows[a].container.style.display="",this.rows[a].tab&&(this.rows[a].tab.style.display=""),this.rows[a].register(),this.jsoneditor.trigger("addRow",this.rows[a]);else{const l=this.addRow(o,e);this.jsoneditor.trigger("addRow",l)}});for(let o=t.length;o<this.rows.length;o++)this.destroyRow(this.rows[o]),this.rows[o]=null;this.rows=this.rows.slice(0,t.length);const s=this.rows.find(o=>o.tab===this.active_tab);let r=typeof s<"u"?s.tab:null;!r&&this.rows.length&&(r=this.rows[0].tab),this.active_tab=r,this.refreshValue(e),this.refreshTabs(!0),this.refreshTabs(),this.onChange()}setButtonState(t,e){switch(this.options.button_state_mode||this.jsoneditor.options.button_state_mode){case 1:t.style.display=e?"":"none";break;case 2:t.disabled=!e;break;default:t.style.display=e?"":"none"}}setupButtons(t){const e=[];if(!this.value.length)this.setButtonState(this.delete_last_row_button,!1),this.setButtonState(this.remove_all_rows_button,!1);else if(this.value.length===1){this.setButtonState(this.remove_all_rows_button,!1);const s=!(t||this.hide_delete_last_row_buttons);this.setButtonState(this.delete_last_row_button,s),e.push(s)}else{const s=!(t||this.hide_delete_last_row_buttons);this.setButtonState(this.delete_last_row_button,s),e.push(s);const r=!(t||this.hide_delete_all_rows_buttons);this.setButtonState(this.remove_all_rows_button,r),e.push(r)}const i=!(this.getMax()&&this.getMax()<=this.rows.length||this.hide_add_button);return this.setButtonState(this.add_row_button,i),e.push(i),e.some(s=>s)}refreshValue(t){const e=this.value?this.value.length:0;if(this.value=this.rows.map(i=>i.getValue()),e!==this.value.length||t){const i=this.schema.minItems&&this.schema.minItems>=this.rows.length;this.rows.forEach((s,r)=>{if(s.movedown_button){const o=r!==this.rows.length-1;this.setButtonState(s.movedown_button,o)}s.delete_button&&this.setButtonState(s.delete_button,!i),this.value[r]=s.getValue()}),this.setupButtons(i)&&!this.collapsed?this.controls.style.display="inline-block":this.controls.style.display="none"}this.serialized=JSON.stringify(this.value)}addRow(t,e){const i=this.rows.length;this.rows[i]=this.getElementEditor(i),this.row_cache[i]=this.rows[i],this.tabs_holder&&(this.rows[i].tab_text=document.createElement("span"),this.rows[i].tab_text.textContent=this.rows[i].getHeaderText(),this.schema.format==="tabs-top"?(this.rows[i].tab=this.theme.getTopTab(this.rows[i].tab_text,this.getValidId(this.rows[i].path)),this.theme.addTopTab(this.tabs_holder,this.rows[i].tab)):(this.rows[i].tab=this.theme.getTab(this.rows[i].tab_text,this.getValidId(this.rows[i].path)),this.theme.addTab(this.tabs_holder,this.rows[i].tab)),this.rows[i].tab.addEventListener("click",r=>{this.active_tab=this.rows[i].tab,this.refreshTabs(),r.preventDefault(),r.stopPropagation()}));const s=this.rows[i].title_controls||this.rows[i].array_controls;return this.hide_delete_buttons||(this.rows[i].delete_button=this._createDeleteButton(i,s)),this.show_copy_button&&(this.rows[i].copy_button=this._createCopyButton(i,s)),i&&!this.hide_move_buttons&&(this.rows[i].moveup_button=this._createMoveUpButton(i,s)),this.hide_move_buttons||(this.rows[i].movedown_button=this._createMoveDownButton(i,s)),typeof t<"u"&&this.rows[i].setValue(t,e),this.refreshTabs(),this.rows[i]}_createDeleteButton(t,e){const i=this.getButton(this.getItemTitle(),"delete","button_delete_row_title",[this.getItemTitle()]);return i.classList.add("delete","json-editor-btntype-delete"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{if(s.preventDefault(),s.stopPropagation(),!this.askConfirmation())return!1;const r=s.currentTarget.getAttribute("data-i")*1,o=this.getValue().filter((h,u)=>u!==r);let a=null;const d=this.rows[r].getValue();this.setValue(o),this.rows[r]?a=this.rows[r].tab:this.rows[r-1]&&(a=this.rows[r-1].tab),a&&(this.active_tab=a,this.refreshTabs()),this.onChange(!0),this.jsoneditor.trigger("deleteRow",d)}),e&&e.appendChild(i),i}_createCopyButton(t,e){const i=this.getButton(this.getItemTitle(),"copy","button_copy_row_title",[this.getItemTitle()]),s=this.schema;return i.classList.add("copy","json-editor-btntype-copy"),i.setAttribute("data-i",t),i.addEventListener("click",r=>{const o=this.getValue();r.preventDefault(),r.stopPropagation();const a=r.currentTarget.getAttribute("data-i")*1;o.forEach((l,d)=>{if(d===a){if(s.items.type==="string"&&s.items.format==="uuid")l=Ei();else if(s.items.type==="object"&&s.items.properties)for(const h of Object.keys(l))s.items.properties&&s.items.properties[h]&&s.items.properties[h].format==="uuid"&&(l[h]=Ei());o.push(l)}}),this.setValue(o),this.refreshValue(!0),this.onChange(!0)}),e.appendChild(i),i}_createMoveUpButton(t,e){const i=this.getButton("",this.schema.format==="tabs-top"?"moveleft":"moveup","button_move_up_title");return i.classList.add("moveup","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();const r=s.currentTarget.getAttribute("data-i")*1;if(r<=0)return;const o=this.getValue(),a=o[r-1];o[r-1]=o[r],o[r]=a,this.setValue(o),this.active_tab=this.rows[r-1].tab,this.refreshTabs(),this.onChange(!0),this.jsoneditor.trigger("moveRow",this.rows[r-1])}),e&&e.appendChild(i),i}_createMoveDownButton(t,e){const i=this.getButton("",this.schema.format==="tabs-top"?"moveright":"movedown","button_move_down_title");return i.classList.add("movedown","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();const r=s.currentTarget.getAttribute("data-i")*1,o=this.getValue();if(r>=o.length-1)return;const a=o[r+1];o[r+1]=o[r],o[r]=a,this.setValue(o),this.active_tab=this.rows[r+1].tab,this.refreshTabs(),this.onChange(!0),this.jsoneditor.trigger("moveRow",this.rows[r+1])}),e&&e.appendChild(i),i}addControls(){this.collapsed=!1,this.toggle_button=this._createToggleButton(),this.options.collapsed&&re(this.toggle_button,"click"),this.schema.options&&typeof this.schema.options.disable_collapse<"u"?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none"),this.add_row_button=this._createAddRowButton(),this.delete_last_row_button=this._createDeleteLastRowButton(),this.remove_all_rows_button=this._createRemoveAllRowsButton(),this.tabs&&(this.add_row_button.classList.add("je-array-control-btn"),this.delete_last_row_button.classList.add("je-array-control-btn"),this.remove_all_rows_button.classList.add("je-array-control-btn"))}_createToggleButton(){const t=this.getButton("","collapse","button_collapse");t.classList.add("json-editor-btntype-toggle"),this.title.insertBefore(t,this.title.childNodes[0]);const e=this.row_holder.style.display,i=this.controls.style.display;return t.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),this.panel&&this.setButtonState(this.panel,this.collapsed),this.tabs_holder&&this.setButtonState(this.tabs_holder,this.collapsed),this.collapsed?(this.collapsed=!1,this.row_holder.style.display=e,this.controls.style.display=i,this.setButtonText(s.currentTarget,"","collapse","button_collapse")):(this.collapsed=!0,this.row_holder.style.display="none",this.controls.style.display="none",this.setButtonText(s.currentTarget,"","expand","button_expand"))}),t}_createAddRowButton(){const t=this.getButton(this.getItemTitle(),"add","button_add_row_title",[this.getItemTitle()]);return t.classList.add("json-editor-btntype-add"),t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const i=this.rows.length;let s;this.row_cache[i]?(s=this.rows[i]=this.row_cache[i],this.rows[i].setValue(this.rows[i].getDefault(),!0),this.rows[i].container.style.display="",this.rows[i].tab&&(this.rows[i].tab.style.display=""),this.rows[i].register()):s=this.addRow(),this.active_tab=this.rows[i].tab,this.refreshTabs(),this.refreshValue(),this.onChange(!0),this.jsoneditor.trigger("addRow",s)}),this.controls.appendChild(t),t}_createDeleteLastRowButton(){const t=this.getButton("button_delete_last","subtract","button_delete_last_title",[this.getItemTitle()]);return t.classList.add("json-editor-btntype-deletelast"),t.addEventListener("click",e=>{if(e.preventDefault(),e.stopPropagation(),!this.askConfirmation())return!1;const i=this.getValue();let s=null;const r=i.pop();this.setValue(i),this.rows[this.rows.length-1]&&(s=this.rows[this.rows.length-1].tab),s&&(this.active_tab=s,this.refreshTabs()),this.onChange(!0),this.jsoneditor.trigger("deleteRow",r)}),this.controls.appendChild(t),t}_createRemoveAllRowsButton(){const t=this.getButton("button_delete_all","delete","button_delete_all_title");return t.classList.add("json-editor-btntype-deleteall"),t.addEventListener("click",e=>{if(e.preventDefault(),e.stopPropagation(),!this.askConfirmation())return!1;const i=this.getValue();this.empty(!0),this.setValue([]),this.onChange(!0),this.jsoneditor.trigger("deleteAllRows",i)}),this.controls.appendChild(t),t}showValidationErrors(t){const e=[],i=[];t.forEach(s=>{s.path===this.path?e.push(s):i.push(s)}),this.error_holder&&(e.length?(this.error_holder.innerHTML="",this.error_holder.style.display="",e.forEach(s=>{this.error_holder.appendChild(this.theme.getErrorMessage(s.message))})):this.error_holder.style.display="none"),this.rows.forEach(s=>s.showValidationErrors(i))}}xr.rules=dh;class ts extends Bt{onInputChange(){this.value=this.input.value,this.onChange(!0)}register(){super.register(),this.input&&this.jsoneditor.options.use_name_attributes&&this.input.setAttribute("name",this.formname)}unregister(){super.unregister(),this.input&&this.input.removeAttribute("name")}getNumColumns(){let t=this.getTitle().length;return Object.keys(this.select_values).forEach(e=>t=Math.max(t,`${this.select_values[e]}`.length+4)),Math.min(12,Math.max(t/7,2))}preBuild(){super.preBuild(),this.select_options={},this.select_values={},this.option_titles=[],this.option_keys=[],this.option_enum=[];let t;const e=this.jsoneditor.expandRefs(this.schema.items||{}),i=e.enum||[],s=e.options?e.options.enum||[]:[],r=e.options?e.options.enum_titles||[]:[];for(t=0;t<i.length;t++){if(this.sanitize(i[t])!==i[t])continue;const o=s[t]||{};"title"in o||(o.title=`${r[t]||i[t]}`),this.option_keys.push(`${i[t]}`),this.option_enum.push(o),this.select_values[`${i[t]}`]=i[t]}}build(){let t;if(this.options.compact||(this.header=this.label=this.theme.getLabelLike(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.compact&&this.container.classList.add("compact"),!this.schema.format&&this.option_keys.length<8||this.schema.format==="checkbox"){for(this.input_type="checkboxes",this.inputs={},this.controls={},t=0;t<this.option_keys.length;t++){const e=this.formname+t.toString();this.inputs[this.option_keys[t]]=this.theme.getCheckbox(),this.inputs[this.option_keys[t]].id=e,this.select_options[this.option_keys[t]]=this.inputs[this.option_keys[t]];const i=this.theme.getCheckboxLabel(this.option_enum[t].title);if(i.htmlFor=e,this.option_enum[t].infoText){const s=this.theme.getInfoButton(this.translateProperty(this.option_enum[t].infoText));i.appendChild(s)}this.controls["_"+this.option_keys[t]]=this.theme.getFormControl(i,this.inputs[this.option_keys[t]])}this.control=this.theme.getMultiCheckboxHolder(this.controls,this.label,this.description,this.infoButton),this.inputs.controlgroup=this.inputs.controls=this.control}else{for(this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.input_type="select",this.input=this.theme.getSelectInput(this.option_keys,!0),this.theme.setSelectOptions(this.input,this.option_keys,this.option_enum.map(e=>e.title)),this.input.setAttribute("multiple","multiple"),this.input.size=Math.min(10,this.option_keys.length),t=0;t<this.option_keys.length;t++)this.select_options[this.option_keys[t]]=this.input.children[t];this.control=this.theme.getFormControl(this.label,this.input,this.description,this.infoButton,this.formname)}(this.schema.readOnly||this.schema.readonly)&&this.disable(!0),this.container.appendChild(this.control),this.multiselectChangeHandler=e=>{const i=[];for(t=0;t<this.option_keys.length;t++)this.select_options[this.option_keys[t]]&&(this.select_options[this.option_keys[t]].selected||this.select_options[this.option_keys[t]].checked)&&i.push(this.select_values[this.option_keys[t]]);this.updateValue(i),this.onChange(!0)},this.control.addEventListener("change",this.multiselectChangeHandler,!1),window.requestAnimationFrame(()=>{this.afterInputReady()})}postBuild(){super.postBuild()}afterInputReady(){this.theme.afterInputReady(this.input||this.inputs)}setValue(t,e){t=t||[],Array.isArray(t)||(t=[t]),t=t.map(i=>`${i}`),Object.keys(this.select_options).forEach(i=>{this.select_options[i][this.input_type==="select"?"selected":"checked"]=t.includes(i)}),this.updateValue(t),this.onChange(!0)}removeValue(t){t=[].concat(t),this.setValue(this.getValue().filter(e=>!t.includes(e)))}addValue(t){this.setValue(this.getValue().concat(t))}updateValue(t){let e=!1;const i=[];for(let s=0;s<t.length;s++){if(!this.select_options[`${t[s]}`]){e=!0;continue}const r=this.sanitize(this.select_values[t[s]]);i.push(r),r!==t[s]&&(e=!0)}return this.value=i,e}sanitize(t){return this.schema.items.type==="boolean"?!!t:this.schema.items.type==="number"?1*t||0:this.schema.items.type==="integer"?Math.floor(t*1||0):`${t}`}enable(){this.always_disabled||(this.input?this.input.disabled=!1:this.inputs&&Object.keys(this.inputs).forEach(t=>this.inputs[t].disabled=!1),super.enable())}disable(t){t&&(this.always_disabled=!0),this.input?this.input.disabled=!0:this.inputs&&Object.keys(this.inputs).forEach(e=>this.inputs[e].disabled=!0),super.disable()}destroy(){super.destroy()}escapeRegExp(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}showValidationErrors(t){const e=new RegExp(`^${this.escapeRegExp(this.path)}(\\.\\d+)?$`),i=(r,o)=>(o.path.match(e)&&r.push(o.message),r),s=t.reduce(i,[]);s.length?this.theme.addInputError(this.input||this.inputs,`${s.join(". ")}.`):this.theme.removeInputError(this.input||this.inputs)}}class hh extends ts{setValue(t,e){this.choices_instance?(t=[].concat(t).map(i=>`${i}`),this.updateValue(t),this.choices_instance.removeActiveItems(),this.choices_instance.setChoiceByValue(this.value),this.onChange(!0)):super.setValue(t,e)}afterInputReady(){if(window.Choices&&!this.choices_instance){const t=this.expandCallbacks("choices",$({},{removeItems:!0,removeItemButton:!0},this.defaults.options.choices||{},this.options.choices||{},{addItems:!0,editItems:!1,duplicateItemsAllowed:!1}));this.newEnumAllowed=!1,this.choices_instance=new window.Choices(this.input,t),this.control.removeEventListener("change",this.multiselectChangeHandler),this.multiselectChangeHandler=e=>{const i=this.choices_instance.getValue(!0);this.updateValue(i),this.onChange(!0)},this.control.addEventListener("change",this.multiselectChangeHandler,!1)}super.afterInputReady()}updateValue(t){t=[].concat(t);let e=!1;const i=[];for(let s=0;s<t.length;s++){if(!this.select_values[`${t[s]}`])if(e=!0,this.newEnumAllowed){if(!this.addNewOption(t[s]))continue}else continue;const r=this.sanitize(this.select_values[t[s]]);i.push(r),r!==t[s]&&(e=!0)}return this.value=i,e}addNewOption(t){return this.option_keys.push(`${t}`),this.option_titles.push(`${t}`),this.select_values[`${t}`]=t,this.schema.items.enum.push(t),this.choices_instance.setChoices([{value:`${t}`,label:`${t}`}],"value","label",!1),!0}enable(){!this.always_disabled&&this.choices_instance&&this.choices_instance.enable(),super.enable()}disable(t){this.choices_instance&&this.choices_instance.disable(),super.disable(t)}destroy(){this.choices_instance&&(this.choices_instance.destroy(),this.choices_instance=null),super.destroy()}}class ch extends ts{setValue(t,e){this.select2_instance?(t=[].concat(t).map(i=>`${i}`),this.updateValue(t),this.select2v4?this.select2_instance.val(this.value).change():this.select2_instance.select2("val",this.value),this.onChange(!0)):super.setValue(t,e)}afterInputReady(){let t;window.jQuery&&window.jQuery.fn&&window.jQuery.fn.select2&&!this.select2_instance&&(t=this.expandCallbacks("select2",$({},{tags:!0,width:"100%"},this.defaults.options.select2||{},this.options.select2||{})),this.newEnumAllowed=t.tags=!!t.tags&&this.schema.items&&this.schema.items.type==="string",this.select2_instance=window.jQuery(this.input).select2(t),this.select2v4=Wt(this.select2_instance.select2,"amd"),this.selectChangeHandler=()=>{const e=this.select2v4?this.select2_instance.val():this.select2_instance.select2("val");this.updateValue(e),this.onChange(!0)},this.select2_instance.on("select2-blur",this.selectChangeHandler),this.select2_instance.on("change",this.selectChangeHandler)),super.afterInputReady()}updateValue(t){t=[].concat(t);let e=!1;const i=[];for(let s=0;s<t.length;s++){if(!this.select_values[`${t[s]}`])if(e=!0,this.newEnumAllowed){if(!this.addNewOption(t[s]))continue}else continue;const r=this.sanitize(this.select_values[t[s]]);i.push(r),r!==t[s]&&(e=!0)}return this.value=i,e}addNewOption(t){this.option_keys.push(`${t}`),this.option_titles.push(`${t}`),this.select_values[`${t}`]=t,this.schema.items.enum.push(t);const e=this.input.querySelector(`option[value="${t}"]`);return e?e.removeAttribute("data-select2-tag"):this.input.appendChild(new Option(t,t,!1,!1)).trigger("change"),!0}enable(){!this.always_disabled&&this.select2_instance&&(this.select2v4?this.select2_instance.prop("disabled",!1):this.select2_instance.select2("enable",!0)),super.enable()}disable(t){this.select2_instance&&(this.select2v4?this.select2_instance.prop("disabled",!0):this.select2_instance.select2("enable",!1)),super.disable()}destroy(){this.select2_instance&&(this.select2_instance.select2("destroy"),this.select2_instance=null),super.destroy()}}class uh extends ts{setValue(t,e){this.selectize_instance?(t=[].concat(t).map(i=>`${i}`),this.updateValue(t),this.selectize_instance.setValue(this.value),this.onChange(!0)):super.setValue(t,e)}afterInputReady(){let t;if(window.jQuery&&window.jQuery.fn&&window.jQuery.fn.selectize&&!this.selectize_instance){t=this.expandCallbacks("selectize",$({},{plugins:["remove_button"],delimiter:!1,createOnBlur:!0,create:!0},this.defaults.options.selectize||{},this.options.selectize||{})),this.newEnumAllowed=t.create=!!t.create&&this.schema.items&&this.schema.items.type==="string",this.selectize_instance=window.jQuery(this.input).selectize(t)[0].selectize,this.control.removeEventListener("change",this.multiselectChangeHandler),this.multiselectChangeHandler=s=>{const r=this.selectize_instance.getValue();this.updateValue(r),this.onChange(!0)},this.selectize_instance.on("change",this.multiselectChangeHandler);const e=this.theme.getHiddenLabel(this.formname);this.input.setAttribute("id",this.formname+"-hidden-input"),e.setAttribute("for",this.formname+"-hidden-input"),this.input.parentNode.insertBefore(e,this.input);const i=this.selectize_instance.$control[0];if(i){const s=this.theme.getHiddenLabel(this.formname);s.setAttribute("for",this.formname+"-selectized"),i.appendChild(s)}}super.afterInputReady()}updateValue(t){t=[].concat(t);let e=!1;const i=[];for(let s=0;s<t.length;s++){if(!this.select_values[`${t[s]}`])if(e=!0,this.newEnumAllowed){if(!this.addNewOption(t[s]))continue}else continue;const r=this.sanitize(this.select_values[t[s]]);i.push(r),r!==t[s]&&(e=!0)}return this.value=i,e}addNewOption(t){return this.option_keys.push(`${t}`),this.option_titles.push(`${t}`),this.select_values[`${t}`]=t,this.selectize_instance.addOption({text:t,value:t}),!0}enable(){!this.always_disabled&&this.selectize_instance&&this.selectize_instance.unlock(),super.enable()}disable(t){this.selectize_instance&&this.selectize_instance.lock(),super.disable(t)}destroy(){this.selectize_instance&&(this.selectize_instance.destroy(),this.selectize_instance=null),super.destroy()}}class ph extends Yt{postBuild(){window.Autocomplete&&(this.autocomplete_wrapper=document.createElement("div"),this.input.parentNode.insertBefore(this.autocomplete_wrapper,this.input.nextSibling),this.autocomplete_wrapper.appendChild(this.input),this.autocomplete_dropdown=document.createElement("ul"),this.input.parentNode.insertBefore(this.autocomplete_dropdown,this.input.nextSibling)),super.postBuild()}afterInputReady(){let t;window.Autocomplete&&!this.autocomplete_instance&&(t=this.expandCallbacks("autocomplete",$({},{search:e=>(console.log(`No "search" callback defined for autocomplete in property "${e.key}"`),[]),onSubmit:()=>{this.input.blur()},baseClass:"autocomplete"},this.defaults.options.autocomplete||{},this.options.autocomplete||{})),this.autocomplete_wrapper.classList.add(t.baseClass),this.autocomplete_dropdown.classList.add(`${t.baseClass}-result-list`),this.autocomplete_instance=new window.Autocomplete(this.autocomplete_wrapper,t)),super.afterInputReady()}destroy(){this.autocomplete_instance&&(this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.autocomplete_dropdown&&this.autocomplete_dropdown.parentNode&&this.autocomplete_dropdown.parentNode.removeChild(this.autocomplete_dropdown),this.autocomplete_wrapper&&this.autocomplete_wrapper.parentNode&&this.autocomplete_wrapper.parentNode.removeChild(this.autocomplete_wrapper),this.autocomplete_instance=null),super.destroy()}}class fh extends Bt{getNumColumns(){return 4}setFileReaderListener(t){t.addEventListener("load",e=>{if(this.count===this.current_item_index)this.value[this.count][this.key]=e.target.result;else{const i={};for(const s in this.parent.schema.properties)i[s]="";i[this.key]=e.target.result,this.value.splice(this.count,0,i)}this.count+=1,this.count===this.total+this.current_item_index&&this.arrayEditor.setValue(this.value)})}build(){if(this.options.compact||(this.title=this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.input=this.theme.getFormInputField("hidden"),this.container.appendChild(this.input),!this.schema.readOnly&&!this.schema.readonly){if(!window.FileReader)throw new Error("FileReader required for base64 editor");this.uploader=this.theme.getFormInputField("file"),this.uploader.style.display="none",this.schema.options&&this.schema.options.multiple&&this.schema.options.multiple===!0&&this.parent&&this.parent.schema.type==="object"&&this.parent.parent&&this.parent.parent.schema.type==="array"&&this.uploader.setAttribute("multiple",""),this.uploader.addEventListener("change",e=>{if(e.preventDefault(),e.stopPropagation(),e.currentTarget.files&&e.currentTarget.files.length)if(e.currentTarget.files.length>1&&this.schema.options&&this.schema.options.multiple&&this.schema.options.multiple===!0&&this.parent&&this.parent.schema.type==="object"&&this.parent.parent&&this.parent.parent.schema.type==="array"){this.arrayEditor=this.jsoneditor.getEditor(this.parent.parent.path),this.value=this.arrayEditor.getValue(),this.total=e.currentTarget.files.length,this.current_item_index=parseInt(this.parent.key),this.count=this.current_item_index;for(let i=0;i<this.total;i++){const s=new FileReader;this.setFileReaderListener(s),s.readAsDataURL(e.currentTarget.files[i])}}else{let i=new FileReader;i.onload=s=>{this.value=s.target.result,this.refreshPreview(),this.onChange(!0),i=null},i.readAsDataURL(e.currentTarget.files[0])}})}this.preview=this.theme.getFormInputDescription(this.translateProperty(this.schema.description)),this.container.appendChild(this.preview),this.control=this.theme.getFormControl(this.label,this.uploader||this.input,this.preview,this.infoButton),this.container.appendChild(this.control);const t=this.getButton("button_upload","upload","button_upload");t.addEventListener("click",()=>{this.uploader.click()}),this.control.appendChild(t)}refreshPreview(){if(this.last_preview===this.value||(this.last_preview=this.value,this.preview.innerHTML="",!this.value))return;let t=this.value.match(/^data:([^;,]+)[;,]/);if(t&&(t=t[1]),!t)this.preview.innerHTML="<em>Invalid data URI</em>";else if(this.preview.innerHTML=`<strong>Type:</strong> ${t}, <strong>Size:</strong> ${Math.floor((this.value.length-this.value.split(",")[0].length-1)/1.33333)} bytes`,t.substr(0,5)==="image"){this.preview.innerHTML+="<br>";const e=document.createElement("img");e.style.maxWidth="100%",e.style.maxHeight="100px",e.src=this.value,this.preview.appendChild(e)}}enable(){this.always_disabled||(this.uploader&&(this.uploader.disabled=!1),super.enable())}disable(t){t&&(this.always_disabled=!0),this.uploader&&(this.uploader.disabled=!0),super.disable()}setValue(t){this.value!==t&&(this.schema.readOnly&&this.schema.enum&&!this.schema.enum.includes(t)?this.value=this.schema.enum[0]:this.value=t,this.input.value=this.value,this.refreshPreview(),this.onChange())}destroy(){this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.uploader&&this.uploader.parentNode&&this.uploader.parentNode.removeChild(this.uploader),super.destroy()}}class fo extends Bt{constructor(t,e){super(t,e),this.active=!1,this.isUiOnly=!0,this.parent&&this.parent.schema&&(Array.isArray(this.parent.schema.required)?this.parent.schema.required.includes(this.key)||this.parent.schema.required.push(this.key):this.parent.schema.required=[this.key])}build(){this.options.compact=!0;const t=this.expandCallbacks("button",$({},{icon:"",validated:!1,align:"left",action:(i,s)=>{window.alert(`No button action defined for "${i.path}"`)}},this.defaults.options.button||{},this.options.button||{})),e=this.translateProperty(t.text||this.schema.title)||this.key;this.input=this.getButton(e,t.icon,e),typeof t.action!="function"?window.alert(`No button action defined for "${this.path}"`):this.input.addEventListener("click",t.action,!1),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&(this.disable(!0),this.input.setAttribute("readonly","true")),this.setInputAttributes(["readonly"]),this.control=this.theme.getFormButtonHolder(t.align),this.control.appendChild(this.input),this.container.appendChild(this.control),this.changeHandler=()=>{this.jsoneditor.validate(this.jsoneditor.getValue()).length>0?this.disable():this.enable()},t.validated&&this.jsoneditor.on("change",this.changeHandler)}enable(){this.always_disabled||(this.input.disabled=!1,super.enable())}disable(t){t&&(this.always_disabled=!0),this.input.disabled=!0,super.disable()}getNumColumns(){return 2}activate(){this.active=!1,this.enable()}deactivate(){this.isRequired()||(this.active=!1,this.disable())}destroy(){this.jsoneditor.off("change",this.changeHandler),this.changeHandler=null,super.destroy()}}class mh extends Bt{setValue(t,e){t=!!t;const i=this.getValue()!==t;this.value=t,this.input.checked=this.value,e||(this.is_dirty=!0),this.onChange(i)}register(){super.register(),this.input&&this.jsoneditor.options.use_name_attributes&&this.input.setAttribute("name",this.formname)}unregister(){super.unregister(),this.input&&this.input.removeAttribute("name")}getNumColumns(){return Math.min(12,Math.max(this.getTitle().length/7,2))}build(){this.parent.options.table_row||(this.label=this.header=this.theme.getCheckboxLabel(this.getTitle(),this.isRequired()),this.label.htmlFor=this.formname),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&!this.options.compact&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.compact&&this.container.classList.add("compact"),this.input=this.theme.getCheckbox(),this.input.id=this.formname,this.control=this.theme.getFormControl(this.label,this.input,this.description,this.infoButton),(this.schema.readOnly||this.schema.readonly)&&(this.disable(!0),this.input.disabled=!0),this.input.addEventListener("change",t=>{t.preventDefault(),t.stopPropagation(),this.value=t.currentTarget.checked,this.is_dirty=!0,this.onChange(!0)}),this.container.appendChild(this.control)}enable(){this.always_disabled||(this.input.disabled=!1,super.enable())}disable(t){t&&(this.always_disabled=!0),this.input.disabled=!0,super.disable()}destroy(){this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),super.destroy()}showValidationErrors(t){const e=this.jsoneditor.options.show_errors,i=e==="change"||e==="interaction";if(e==="never"||i&&!this.is_dirty)return;const r=(a,l)=>(l.path===this.path&&a.push(l.message),a),o=t.reduce(r,[]);this.input.controlgroup=this.control,o.length?this.theme.addInputError(this.input,`${o.join(". ")}.`):this.theme.removeInputError(this.input)}}class Li extends Bt{setValue(t,e){let i=this.typecast(t);const s=!!this.jsoneditor.options.use_default_values||typeof this.schema.default<"u";(this.enum_options.length>0&&!this.enum_values.includes(i)||e&&!this.isRequired()&&!s)&&(i=this.enum_values[0]),this.value!==i&&(this.input.value=this.enum_options[this.enum_values.indexOf(i)],this.value=i,e||(this.is_dirty=!0),this.onChange(),this.change())}register(){super.register(),this.input&&this.jsoneditor.options.use_name_attributes&&this.input.setAttribute("name",this.formname)}unregister(){super.unregister(),this.input&&this.input.removeAttribute("name")}getNumColumns(){if(!this.enum_options)return 3;let t=this.getTitle().length;for(let e=0;e<this.enum_options.length;e++)t=Math.max(t,this.enum_options[e].length+4);return Math.min(12,Math.max(t/7,2))}typecast(t){return this.schema.type==="boolean"?t==="undefined"||t===void 0?void 0:!!t:this.schema.type==="number"?1*t||0:this.schema.type==="integer"?Math.floor(t*1||0):this.schema.enum&&t===void 0?void 0:`${t}`}getValue(){if(this.dependenciesFulfilled)return this.typecast(this.value)}preBuild(){this.input_type="select",this.enum_options=[],this.enum_values=[],this.enum_display=[];let t,e;if(this.schema.enum){const i=this.schema.options&&this.schema.options.enum_titles||[];this.schema.enum.forEach((s,r)=>{this.enum_options[r]=`${s}`,this.enum_display[r]=`${this.translateProperty(i[r])||s}`,this.enum_values[r]=this.typecast(s)})}else if(this.schema.type==="boolean")this.enum_display=this.schema.options&&this.schema.options.enum_titles||["true","false"],this.enum_options=["1",""],this.enum_values=[!0,!1],this.isRequired()||(this.enum_display.unshift(" "),this.enum_options.unshift("undefined"),this.enum_values.unshift(void 0));else if(this.schema.enumSource){if(this.enumSource=[],this.enum_display=[],this.enum_options=[],this.enum_values=[],!Array.isArray(this.schema.enumSource))this.schema.enumValue?this.enumSource=[{source:this.schema.enumSource,value:this.schema.enumValue}]:this.enumSource=[{source:this.schema.enumSource}];else for(t=0;t<this.schema.enumSource.length;t++)typeof this.schema.enumSource[t]=="string"?this.enumSource[t]={source:this.schema.enumSource[t]}:Array.isArray(this.schema.enumSource[t])?this.enumSource[t]=this.schema.enumSource[t]:this.enumSource[t]=$({},this.schema.enumSource[t]);for(t=0;t<this.enumSource.length;t++)this.enumSource[t].value&&(e=this.expandCallbacks("template",{template:this.enumSource[t].value}),typeof e.template=="function"?this.enumSource[t].value=e.template:this.enumSource[t].value=this.jsoneditor.compileTemplate(this.enumSource[t].value,this.template_engine)),this.enumSource[t].title&&(e=this.expandCallbacks("template",{template:this.enumSource[t].title}),typeof e.template=="function"?this.enumSource[t].title=e.template:this.enumSource[t].title=this.jsoneditor.compileTemplate(this.enumSource[t].title,this.template_engine)),this.enumSource[t].filter&&this.enumSource[t].value&&(e=this.expandCallbacks("template",{template:this.enumSource[t].filter}),typeof e.template=="function"?this.enumSource[t].filter=e.template:this.enumSource[t].filter=this.jsoneditor.compileTemplate(this.enumSource[t].filter,this.template_engine))}else throw new Error("'select' editor requires the enum property to be set.")}build(){this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.compact&&this.container.classList.add("compact"),this.input=this.theme.getSelectInput(this.enum_options,!1),this.theme.setSelectOptions(this.input,this.enum_options,this.enum_display),(this.schema.readOnly||this.schema.readonly)&&(this.disable(!0),this.input.disabled=!0),this.setInputAttributes([]),this.input.addEventListener("change",t=>{t.preventDefault(),t.stopPropagation(),this.onInputChange()}),this.control=this.theme.getFormControl(this.label,this.input,this.description,this.infoButton,this.formname),this.container.appendChild(this.control),this.value=this.enum_values[0],window.requestAnimationFrame(()=>{this.input.parentNode&&this.afterInputReady()})}afterInputReady(){this.theme.afterInputReady(this.input)}onInputChange(){const t=this.typecast(this.input.value);let e;this.enum_values.includes(t)?e=this.enum_values[this.enum_values.indexOf(t)]:e=this.enum_values[0],e!==this.value&&(this.is_dirty=!0,this.value=e,this.onChange(!0))}onWatchedFieldChange(){let t,e,i=[],s=[];if(this.enumSource){t=this.getWatchedFieldValues();for(let o=0;o<this.enumSource.length;o++)if(Array.isArray(this.enumSource[o]))i=i.concat(this.enumSource[o]),s=s.concat(this.enumSource[o]);else{let a=[];if(Array.isArray(this.enumSource[o].source)?a=this.enumSource[o].source:a=t[this.enumSource[o].source],a){if(this.enumSource[o].slice&&(a=Array.prototype.slice.apply(a,this.enumSource[o].slice)),this.enumSource[o].filter){const h=[];for(e=0;e<a.length;e++)this.enumSource[o].filter({i:e,item:a[e],watched:t})&&h.push(a[e]);a=h}const l=[],d=[];for(e=0;e<a.length;e++){const h=a[e];this.enumSource[o].value?d[e]=this.typecast(this.enumSource[o].value({i:e,item:h})):d[e]=a[e],this.enumSource[o].title?l[e]=this.enumSource[o].title({i:e,item:h}):l[e]=d[e]}this.enumSource[o].sort&&((h,u,g)=>{h.map((m,y)=>({v:m,t:u[y]})).sort((m,y)=>m.v<y.v?-g:m.v===y.v?0:g).forEach((m,y)=>{h[y]=m.v,u[y]=m.t})}).bind(null,d,l,this.enumSource[o].sort==="desc"?1:-1)(),i=i.concat(d),s=s.concat(l)}}const r=this.value;this.theme.setSelectOptions(this.input,i,s),this.enum_options=i,this.enum_display=s,this.enum_values=i,i.includes(r)||this.jsoneditor.options.enum_source_value_auto_select!==!1?(this.input.value=r,this.value=r):(this.input.value=i[0],this.value=this.typecast(i[0]||""),this.parent&&!this.watchLoop?this.parent.onChildEditorChange(this):this.jsoneditor.onChange(),this.jsoneditor.notifyWatchers(this.path))}super.onWatchedFieldChange()}enable(){this.always_disabled||(this.input.disabled=!1,super.enable())}disable(t){t&&(this.always_disabled=!0),this.input.disabled=!0,super.disable(t)}destroy(){this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),super.destroy()}showValidationErrors(t){const e=this.jsoneditor.options.show_errors,i=e==="change"||e==="interaction";if(e==="never"||i&&!this.is_dirty)return;const r=(a,l)=>(l.path===this.path&&a.push(l.message),a),o=t.reduce(r,[]);o.length?this.theme.addInputError(this.input,`${o.join(". ")}.`):this.theme.removeInputError(this.input)}}const gh={".choices > *":"box-sizing:border-box"};class mo extends Li{setValue(t,e){if(this.choices_instance){let i=this.typecast(t||"");if(this.enum_values.includes(i)||(i=this.enum_values[0]),this.value===i)return;e?this.is_dirty=!1:this.jsoneditor.options.show_errors==="change"&&(this.is_dirty=!0),this.input.value=this.enum_options[this.enum_values.indexOf(i)],this.choices_instance.setChoiceByValue(this.input.value),this.value=i,this.onChange()}else super.setValue(t,e)}afterInputReady(){if(window.Choices&&!this.choices_instance){const t=this.expandCallbacks("choices",$({},this.defaults.options.choices||{},this.options.choices||{}));this.choices_instance=new window.Choices(this.input,t)}super.afterInputReady()}onWatchedFieldChange(){if(super.onWatchedFieldChange(),this.choices_instance){const t=this.enum_options.map((e,i)=>({value:e,label:this.enum_display[i]}));this.choices_instance.setChoices(t,"value","label",!0),this.choices_instance.setChoiceByValue(`${this.value}`)}}enable(){!this.always_disabled&&this.choices_instance&&this.choices_instance.enable(),super.enable()}disable(t){this.choices_instance&&this.choices_instance.disable(),super.disable(t)}destroy(){this.choices_instance&&(this.choices_instance.destroy(),this.choices_instance=null),super.destroy()}}mo.rules=gh;class bh extends Yt{build(){if(super.build(),!!this.input&&(this.schema.max&&typeof this.schema.max=="string"&&this.input.setAttribute("max",this.schema.max),this.schema.min&&typeof this.schema.max=="string"&&this.input.setAttribute("min",this.schema.min),window.flatpickr&&typeof this.options.flatpickr=="object")){this.options.flatpickr.enableTime=this.schema.format!=="date",this.options.flatpickr.noCalendar=this.schema.format==="time",this.schema.type==="integer"&&(this.options.flatpickr.mode="single"),this.input.setAttribute("data-input","");let{input:t}=this;if(this.options.flatpickr.wrap===!0){const e=[];if(this.options.flatpickr.showToggleButton!==!1){const o=this.getButton("",this.schema.format==="time"?"time":"calendar","flatpickr_toggle_button");o.setAttribute("data-toggle",""),e.push(o)}if(this.options.flatpickr.showClearButton!==!1){const o=this.getButton("","clear","flatpickr_clear_button");o.setAttribute("data-clear",""),e.push(o)}const{parentNode:i}=this.input,{nextSibling:s}=this.input,r=this.theme.getInputGroup(this.input,e);r!==void 0?(this.options.flatpickr.inline=!1,i.insertBefore(r,s),t=r):this.options.flatpickr.wrap=!1}this.flatpickr=window.flatpickr(t,this.options.flatpickr),this.options.flatpickr.inline===!0&&this.options.flatpickr.inlineHideInput===!0&&this.input.setAttribute("type","hidden")}}getValue(){if(!this.dependenciesFulfilled)return;if(this.schema.type==="string")return this.value;if(this.value===""||this.value===void 0)return;const t=this.schema.format==="time"?`1970-01-01 ${this.value}`:this.value;return parseInt(new Date(t).getTime()/1e3)}setValue(t,e,i){if(this.schema.type==="string")super.setValue(t,e,i),this.flatpickr&&this.flatpickr.setDate(t);else if(t>0){const s=new Date(t*1e3),r=s.getFullYear(),o=this.zeroPad(s.getMonth()+1),a=this.zeroPad(s.getDate()),l=this.zeroPad(s.getHours()),d=this.zeroPad(s.getMinutes()),h=this.zeroPad(s.getSeconds()),u=[r,o,a].join("-"),g=[l,d,h].join(":");let m=`${u}T${g}`;this.schema.format==="date"?m=u:this.schema.format==="time"&&(m=g),this.input.value=m,this.refreshValue(),this.flatpickr&&this.flatpickr.setDate(m)}}destroy(){this.flatpickr&&this.flatpickr.destroy(),this.flatpickr=null,super.destroy()}zeroPad(t){return`0${t}`.slice(-2)}}class yh extends Bt{register(){if(this.editors){for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].unregister();this.editors[this.currentEditor]&&this.editors[this.currentEditor].register()}super.register()}unregister(){if(super.unregister(),this.editors)for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].unregister()}getNumColumns(){return this.editors[this.currentEditor]?Math.max(this.editors[this.currentEditor].getNumColumns(),4):4}enable(){if(this.editors)for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].enable();super.enable()}disable(){if(this.editors)for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].disable();super.disable()}switchEditor(){const t=this.getWatchedFieldValues();if(!t)return;const e=document.location.origin+document.location.pathname+this.template(t);this.editors[this.refs[e]]||this.buildChildEditor(e),this.currentEditor=this.refs[e],this.register(),this.editors.forEach((i,s)=>{i&&(this.currentEditor===s?i.container.style.display="":i.container.style.display="none")}),this.refreshValue(),this.onChange(!0)}buildChildEditor(t){this.refs[t]=this.editors.length;const e=this.theme.getChildEditorHolder();this.editor_holder.appendChild(e);const i=$({},this.schema,this.jsoneditor.refs[t]),s=this.jsoneditor.getEditorClass(i,this.jsoneditor),r=this.jsoneditor.createEditor(s,{jsoneditor:this.jsoneditor,schema:i,container:e,path:this.path,parent:this,required:!0});this.editors.push(r),r.preBuild(),r.build(),r.postBuild()}preBuild(){this.refs={},this.editors=[],this.currentEditor="";let t;for(t=0;t<this.schema.links.length;t++)if(this.schema.links[t].rel.toLowerCase()==="describedby"){this.template=this.jsoneditor.compileTemplate(this.schema.links[t].href,this.template_engine);break}this.schema.links=this.schema.links.slice(0,t).concat(this.schema.links.slice(t+1)),this.schema.links.length===0&&delete this.schema.links,this.baseSchema=$({},this.schema)}build(){this.editor_holder=document.createElement("div"),this.container.appendChild(this.editor_holder),this.switchEditor()}onWatchedFieldChange(){this.switchEditor()}onChildEditorChange(t){this.editors[this.currentEditor]&&this.refreshValue(),super.onChildEditorChange(t)}refreshValue(){this.editors[this.currentEditor]&&(this.value=this.editors[this.currentEditor].getValue())}setValue(t,e){this.editors[this.currentEditor]&&(this.editors[this.currentEditor].setValue(t,e),this.refreshValue(),this.onChange())}destroy(){this.editors.forEach(t=>{t&&t.destroy()}),this.editor_holder&&this.editor_holder.parentNode&&this.editor_holder.parentNode.removeChild(this.editor_holder),super.destroy()}showValidationErrors(t){this.editors.forEach(e=>{e&&e.showValidationErrors(t)})}}class _h extends Bt{getNumColumns(){return 4}build(){this.title=this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired()),this.container.appendChild(this.title),this.options.enum_titles=this.options.enum_titles||[],this.enum=this.schema.enum,this.selected=0,this.select_options=[],this.html_values=[];for(let t=0;t<this.enum.length;t++)this.select_options[t]=this.options.enum_titles[t]||`Value ${t+1}`,this.html_values[t]=this.getHTML(this.enum[t]);this.switcher=this.theme.getSwitcher(this.select_options),this.container.appendChild(this.switcher),this.display_area=this.theme.getIndentedPanel(),this.container.appendChild(this.display_area),this.options.hide_display&&(this.display_area.style.display="none"),this.switcher.addEventListener("change",t=>{this.selected=this.select_options.indexOf(t.currentTarget.value),this.value=this.enum[this.selected],this.refreshValue(),this.onChange(!0)}),this.value=this.enum[0],this.refreshValue(),this.enum.length===1&&(this.switcher.style.display="none")}refreshValue(){this.selected=-1;const t=JSON.stringify(this.value);if(this.enum.forEach((e,i)=>{if(t===JSON.stringify(e))return this.selected=i,!1}),this.selected<0){this.setValue(this.enum[0]);return}this.switcher.value=this.select_options[this.selected],this.display_area.innerHTML=this.html_values[this.selected]}enable(){this.always_disabled||(this.switcher.disabled=!1,super.enable())}disable(t){t&&(this.always_disabled=!0),this.switcher.disabled=!0,super.disable()}getHTML(t){const e=(i,s)=>{Array.isArray(i)||typeof i.length=="number"&&i.length>0&&i.length-1 in i?Array.from(i).forEach((r,o)=>s(o,r)):Object.entries(i).forEach(([r,o])=>s(r,o))};if(t===null)return"<em>null</em>";if(typeof t=="object"){let i="";return e(t,(r,o)=>{let a=this.getHTML(o);Array.isArray(t)||(a=`<div><em>${r}</em>: ${a}</div>`),i+=`<li>${a}</li>`}),Array.isArray(t)?i=`<ol>${i}</ol>`:i=`<ul style='margin-top:0;margin-bottom:0;padding-top:0;padding-bottom:0;'>${i}</ul>`,i}else{if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}return t}setValue(t){this.value!==t&&(this.value=t,this.refreshValue(),this.onChange())}destroy(){this.display_area&&this.display_area.parentNode&&this.display_area.parentNode.removeChild(this.display_area),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.switcher&&this.switcher.parentNode&&this.switcher.parentNode.removeChild(this.switcher),super.destroy()}}class vh extends Bt{register(){super.register(),this.input&&this.jsoneditor.options.use_name_attributes&&this.input.setAttribute("name",this.formname)}unregister(){super.unregister(),this.input&&this.input.removeAttribute("name")}setValue(t,e,i){if(this.template&&!i||(t===null||typeof t>"u"?t="":typeof t=="object"?t=JSON.stringify(t):typeof t!="string"&&(t=`${t}`),t===this.serialized))return;const s=this.sanitize(t);if(this.input.value===s)return;this.input.value=s;const r=i||this.getValue()!==t;this.refreshValue(),e?this.is_dirty=!1:this.jsoneditor.options.show_errors==="change"&&(this.is_dirty=!0),this.adjust_height&&this.adjust_height(this.input),this.onChange(r)}getNumColumns(){return 2}enable(){super.enable()}disable(){super.disable()}refreshValue(){this.value=this.input.value,typeof this.value!="string"&&(this.value=""),this.serialized=this.value}destroy(){this.template=null,this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),super.destroy()}sanitize(t){return t}onWatchedFieldChange(){let t;this.template&&(t=this.getWatchedFieldValues(),this.setValue(this.template(t),!1,!0)),super.onWatchedFieldChange()}build(){if(this.format=this.schema.format,!this.format&&this.options.default_format&&(this.format=this.options.default_format),this.options.format&&(this.format=this.options.format),this.input_type="hidden",this.input=this.theme.getFormInputField(this.input_type),this.format&&this.input.setAttribute("data-schemaformat",this.format),this.container.appendChild(this.input),this.schema.template){const t=this.expandCallbacks("template",{template:this.schema.template});typeof t.template=="function"?this.template=t.template:this.template=this.jsoneditor.compileTemplate(this.schema.template,this.template_engine),this.refreshValue()}else this.refreshValue()}}class wh extends fo{build(){this.options.compact=!1,this.header=this.label=this.theme.getLabelLike(this.getTitle()),this.description=this.theme.getDescription(this.schema.description||""),this.control=this.theme.getFormControl(this.label,this.description,null),this.container.appendChild(this.control)}getTitle(){return this.translateProperty(this.schema.title)}getNumColumns(){return 12}}class go extends Yt{build(){if(super.build(),typeof this.schema.minimum<"u"){let{minimum:t}=this.schema;typeof this.schema.exclusiveMinimum<"u"&&(t+=1),this.input.setAttribute("min",t)}if(typeof this.schema.maximum<"u"){let{maximum:t}=this.schema;typeof this.schema.exclusiveMaximum<"u"&&(t-=1),this.input.setAttribute("max",t)}if(typeof this.schema.step<"u"){const t=this.schema.step||1;this.input.setAttribute("step",t)}this.setInputAttributes(["maxlength","pattern","readonly","min","max","step"])}getNumColumns(){return 2}getValue(){if(this.dependenciesFulfilled)if(!this.schema.default&&!this.jsoneditor.options.use_default_values&&this.value===""){if(this.shouldBeUnset()){this.input.value="";return}}else return rh(this.value)?parseFloat(this.value):this.value}}class bo extends go{getNumColumns(){return 2}getValue(){if(this.dependenciesFulfilled)if(!this.schema.default&&!this.jsoneditor.options.use_default_values&&this.value===""){if(this.shouldBeUnset())return}else return oh(this.value)?parseInt(this.value):this.value}}class xh extends Yt{preBuild(){if(super.preBuild(),this.schema.options||(this.schema.options={}),!this.schema.options.cleave)switch(this.format){case"ipv6":this.schema.options.cleave={delimiters:[":"],blocks:[4,4,4,4,4,4,4,4],uppercase:!0};break;case"ipv4":this.schema.options.cleave={delimiters:["."],blocks:[3,3,3,3],numericOnly:!0};break}this.options=$(this.options,this.schema.options||{})}}class Ch extends Yt{setValue(t,e,i){const s=super.setValue(t,e,i);s!==void 0&&s.changed&&this.jodit_instance&&this.jodit_instance.setEditorValue(s.value)}build(){this.options.format="textarea",super.build(),this.input_type=this.schema.format,this.input.setAttribute("data-schemaformat",this.input_type)}afterInputReady(){let t;window.Jodit?(t=this.expandCallbacks("jodit",$({},{height:300},this.defaults.options.jodit||{},this.options.jodit||{})),this.jodit_instance=new window.Jodit(this.input,t),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&this.jodit_instance.setReadOnly(!0),this.jodit_instance.events.on("change",()=>{this.value=this.jodit_instance.getEditorValue(),this.is_dirty=!0,this.onChange(!0)}),this.theme.afterInputReady(this.input)):super.afterInputReady()}getNumColumns(){return 6}enable(){!this.always_disabled&&this.jodit_instance&&this.jodit_instance.setReadOnly(!1),super.enable()}disable(t){this.jodit_instance&&this.jodit_instance.setReadOnly(!0),super.disable(t)}destroy(){this.jodit_instance&&(this.jodit_instance.destruct(),this.jodit_instance=null),super.destroy()}}const Eh=n=>{const t=n.split(".");if(t.length!==4)throw new Error("error_ipv4");t.forEach(e=>{if(isNaN(+e)||+e<0||+e>255)throw new Error("error_ipv4")})},Lh=n=>{if(!n.match("^(?:(?:(?:[a-fA-F0-9]{1,4}:){6}|(?=(?:[a-fA-F0-9]{0,4}:){2,6}(?:[0-9]{1,3}.){3}[0-9]{1,3}$)(([0-9a-fA-F]{1,4}:){1,5}|:)((:[0-9a-fA-F]{1,4}){1,5}:|:)|::(?:[a-fA-F0-9]{1,4}:){5})(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9]).){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])|(?:[a-fA-F0-9]{1,4}:){7}[a-fA-F0-9]{1,4}|(?=(?:[a-fA-F0-9]{0,4}:){0,7}[a-fA-F0-9]{0,4}$)(([0-9a-fA-F]{1,4}:){1,7}|:)((:[0-9a-fA-F]{1,4}){1,7}|:)|(?:[a-fA-F0-9]{1,4}:){7}:|:(:[a-fA-F0-9]{1,4}){7})$"))throw new Error("error_ipv6")},Ah=n=>{if(!n.match("(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9].)+[a-zA-Z]{2,63}$)"))throw new Error("error_hostname")};function kh(n,t,e,i){try{switch(n.format){case"ipv4":Eh(t);break;case"ipv6":Lh(t);break;case"hostname":Ah(t);break}return[]}catch(s){return[{path:e,property:"format",message:i(s.message)}]}}class yo{constructor(t,e,i,s){this.jsoneditor=t,this.schema=e||this.jsoneditor.schema,this.options=i||{},this.translate=this.jsoneditor.translate||s.translate,this.translateProperty=this.jsoneditor.translateProperty||s.translateProperty,this.defaults=s,this._validateSubSchema={dependentRequired(r,o,a){const l=[];if(typeof r.dependentRequired<"u"){let d=[];Object.keys(r.dependentRequired).forEach(u=>{typeof o[u]<"u"&&(d=r.dependentRequired[u].filter(m=>!Wt(o,m)))}),d.length>0&&l.push({message:"Must have the required properties: "+d.join(", "),path:a})}return l},dependentSchemas(r,o,a){let l=[];return Object.keys(r.dependentSchemas).forEach(d=>{if(typeof o[d]<"u"){const h=r.dependentSchemas[d],u=this._validateSchema(h,o,a);l=[...l,...u]}}),l},contains(r,o,a){const l=[];let d=0;o.forEach(u=>{this._validateSchema(r.contains,u,a).length===0&&d++});const h=d===0;return typeof r.minContains<"u"?d<r.minContains&&l.push({message:this.translate("error_minContains",[d,r.minContains],r),path:a}):h&&l.push({message:this.translate("error_contains",null,r),path:a}),typeof r.maxContains<"u"&&d>r.maxContains&&l.push({message:this.translate("error_maxContains",[d,r.maxContains],r),path:a}),l},if(r,o,a){if(typeof r.then>"u"&&typeof r.else>"u")return[];const l=this._validateSchema(r.if,o,a);let d=[],h=[];return typeof r.then<"u"&&(d=this._validateSchema(r.then,o,a)),typeof r.else<"u"&&(h=this._validateSchema(r.else,o,a)),r.if===!0?d:r.if===!1?h:l.length===0?d:l.length>0?h:[]},const(r,o,a){return JSON.stringify(r.const)===JSON.stringify(o)?[]:[{path:a,property:"const",message:this.translate("error_const",null,r)}]},enum(r,o,a){const l=JSON.stringify(o);return r.enum.some(h=>l===JSON.stringify(h))?[]:[{path:a,property:"enum",message:this.translate("error_enum",null,r)}]},extends(r,o,a){const l=(d,h)=>(d.push(...this._validateSchema(h,o,a)),d);return r.extends.reduce(l,[])},allOf(r,o,a){const l=(d,h)=>(d.push(...this._validateSchema(h,o,a)),d);return r.allOf.reduce(l,[])},anyOf(r,o,a){return r.anyOf.some(d=>!this._validateSchema(d,o,a).length)?[]:[{path:a,property:"anyOf",message:this.translate("error_anyOf",null,r)}]},oneOf(r,o,a){let l=0;const d=[];r.oneOf.forEach((u,g)=>{const m=this._validateSchema(u,o,a);m.length||l++,m.forEach(y=>{y.path=`${a}.oneOf[${g}]${y.path.substr(a.length)}`}),d.push(...m)});const h=[];return l!==1&&(h.push({path:a,property:"oneOf",message:this.translate("error_oneOf",[l],r)}),h.push(...d)),h},not(r,o,a){return this._validateSchema(r.not,o,a).length?[]:[{path:a,property:"not",message:this.translate("error_not",null,r)}]},type(r,o,a){if(Array.isArray(r.type)){if(!r.type.some(d=>this._checkType(d,o)))return[{path:a,property:"type",message:this.translate("error_type_union",null,r)}]}else if(["date","time","datetime-local"].includes(r.format)&&r.type==="integer"){if(!this._checkType("string",`${o}`))return[{path:a,property:"type",message:this.translate("error_type",[r.format],r)}]}else if(!this._checkType(r.type,o))return[{path:a,property:"type",message:this.translate("error_type",[r.type],r)}];return[]},disallow(r,o,a){if(Array.isArray(r.disallow)){if(r.disallow.some(d=>this._checkType(d,o)))return[{path:a,property:"disallow",message:this.translate("error_disallow_union",null,r)}]}else if(this._checkType(r.disallow,o))return[{path:a,property:"disallow",message:this.translate("error_disallow",[r.disallow],r)}];return[]}},this._validateNumberSubSchema={multipleOf(r,o,a){return this._validateNumberSubSchemaMultipleDivisible(r,o,a)},divisibleBy(r,o,a){return this._validateNumberSubSchemaMultipleDivisible(r,o,a)},maximum(r,o,a){let l=r.exclusiveMaximum?o<r.maximum:o<=r.maximum;return window.math?l=window.math[r.exclusiveMaximum?"smaller":"smallerEq"](window.math.bignumber(o),window.math.bignumber(r.maximum)):window.Decimal&&(l=new window.Decimal(o)[r.exclusiveMaximum?"lt":"lte"](new window.Decimal(r.maximum))),l?[]:[{path:a,property:"maximum",message:this.translate(r.exclusiveMaximum?"error_maximum_excl":"error_maximum_incl",[r.maximum],r)}]},minimum(r,o,a){let l=r.exclusiveMinimum?o>r.minimum:o>=r.minimum;return window.math?l=window.math[r.exclusiveMinimum?"larger":"largerEq"](window.math.bignumber(o),window.math.bignumber(r.minimum)):window.Decimal&&(l=new window.Decimal(o)[r.exclusiveMinimum?"gt":"gte"](new window.Decimal(r.minimum))),l?[]:[{path:a,property:"minimum",message:this.translate(r.exclusiveMinimum?"error_minimum_excl":"error_minimum_incl",[r.minimum],r)}]}},this._validateStringSubSchema={maxLength(r,o,a){const l=[];return`${o}`.length>r.maxLength&&l.push({path:a,property:"maxLength",message:this.translate("error_maxLength",[r.maxLength],r)}),l},minLength(r,o,a){return`${o}`.length<r.minLength?[{path:a,property:"minLength",message:this.translate(r.minLength===1?"error_notempty":"error_minLength",[r.minLength],r)}]:[]},pattern(r,o,a){return new RegExp(r.pattern).test(o)?[]:[{path:a,property:"pattern",message:r.options&&r.options.patternmessage?r.options.patternmessage:this.translate("error_pattern",[r.pattern],r)}]}},this._validateArraySubSchema={items(r,o,a){const l=[];if(Array.isArray(r.items))for(let d=0;d<o.length;d++)if(r.items[d])l.push(...this._validateSchema(r.items[d],o[d],`${a}.${d}`));else{if(r.additionalItems===!0)break;if(r.additionalItems)l.push(...this._validateSchema(r.additionalItems,o[d],`${a}.${d}`));else if(r.additionalItems===!1){l.push({path:a,property:"additionalItems",message:this.translate("error_additionalItems",null,r)});break}else break}else o.forEach((d,h)=>{l.push(...this._validateSchema(r.items,d,`${a}.${h}`))});return l},maxItems(r,o,a){return o.length>r.maxItems?[{path:a,property:"maxItems",message:this.translate("error_maxItems",[r.maxItems],r)}]:[]},minItems(r,o,a){return o.length<r.minItems?[{path:a,property:"minItems",message:this.translate("error_minItems",[r.minItems],r)}]:[]},uniqueItems(r,o,a){const l={};for(let d=0;d<o.length;d++){const h=JSON.stringify(o[d]);if(l[h])return[{path:a,property:"uniqueItems",message:this.translate("error_uniqueItems",null,r)}];l[h]=!0}return[]}},this._validateObjectSubSchema={maxProperties(r,o,a){return Object.keys(o).length>r.maxProperties?[{path:a,property:"maxProperties",message:this.translate("error_maxProperties",[r.maxProperties],r)}]:[]},minProperties(r,o,a){return Object.keys(o).length<r.minProperties?[{path:a,property:"minProperties",message:this.translate("error_minProperties",[r.minProperties],r)}]:[]},required(r,o,a){const l=[];return Array.isArray(r.required)&&r.required.forEach(d=>{if(typeof o[d]<"u")return;const h=this.jsoneditor.getEditor(`${a}.${d}`);h&&h.dependenciesFulfilled===!1||h&&["button","info"].includes(h.schema.format||h.schema.type)||l.push({path:a,property:"required",message:this.translate("error_required",[r&&r.properties&&r.properties[d]&&r.properties[d].title?r.properties[d].title:d],r)})}),l},properties(r,o,a,l){const d=[];return Object.entries(r.properties).forEach(([h,u])=>{l[h]=!0,d.push(...this._validateSchema(u,o[h],`${a}.${h}`))}),d},patternProperties(r,o,a,l){const d=[];return Object.entries(r.patternProperties).forEach(([h,u])=>{const g=new RegExp(h);Object.entries(o).forEach(([m,y])=>{g.test(m)&&(l[m]=!0,d.push(...this._validateSchema(u,y,`${a}.${m}`)))})}),d}},this._validateObjectSubSchema2={propertyNames(r,o,a,l){const d=[],h=Object.keys(o);let u=null;for(let g=0;g<h.length;g++){let m="",y=!1;if(u=h[g],typeof r.propertyNames=="boolean"){if(r.propertyNames===!0)continue;d.push({path:a,property:"propertyNames",message:this.translate("error_property_names_false",[u],r)});break}if(y=Object.entries(r.propertyNames).every(([w,A])=>{let et=!1,W=null;switch(w){case"maxLength":if(typeof A!="number"){m="error_property_names_maxlength";break}if(u.length>A){m="error_property_names_exceeds_maxlength";break}return!0;case"const":if(A!==u){m="error_property_names_const_mismatch";break}return!0;case"enum":if(!Array.isArray(A)){m="error_property_names_enum";break}if(A.forEach(_t=>{_t===u&&(et=!0)}),!et){m="error_property_names_enum_mismatch";break}return!0;case"pattern":if(typeof A!="string"){m="error_property_names_pattern";break}if(W=new RegExp(A),!W.test(u)){m="error_property_names_pattern_mismatch";break}return!0;default:return d.push({path:a,property:"propertyNames",message:this.translate("error_property_names_unsupported",[w],r)}),!1}return d.push({path:a,property:"propertyNames",message:this.translate(m,[u],r)}),!1}),!y)break}return d},additionalProperties(r,o,a,l){const d=[],h=Object.keys(o);for(let u=0;u<h.length;u++){const g=h[u];if(!l[g])if(r.additionalProperties){if(r.additionalProperties===!0)break;d.push(...this._validateSchema(r.additionalProperties,o[g],`${a}.${g}`))}else{d.push({path:a,property:"additionalProperties",message:this.translate("error_additional_properties",[g],r)});break}}return d},dependencies(r,o,a){const l=[];return Object.entries(r.dependencies).forEach(([d,h])=>{typeof o[d]>"u"||(Array.isArray(h)?h.forEach(u=>{typeof o[u]>"u"&&l.push({path:a,property:"dependencies",message:this.translate("error_dependency",[u],r)})}):l.push(...this._validateSchema(h,o,a)))}),l}}}fitTest(t,e,i=1e7){const s={match:0,extra:0};if(typeof t=="object"&&t!==null){const r=this._getSchema(e);if(r.anyOf){let o={...s};for(const a of r.anyOf){const l=this.fitTest(t,a,i);(l.match>o.match||l.match===o.match&&l.extra<o.extra)&&(o=l)}return o}else{const o=this._getSchema(e).properties;for(const a in o){if(!Wt(o,a)){s.extra+=i;continue}if(typeof t[a]=="object"&&typeof o[a]=="object"&&typeof o[a].properties=="object"){const l=this.fitTest(t[a],o[a],i/100);s.match+=l.match,s.extra+=l.extra}typeof t[a]<"u"&&(s.match+=i)}}}return s}_getSchema(t){return typeof t>"u"?$({},this.jsoneditor.expandRefs(this.schema)):t}validate(t){return this._validateSchema(this.schema,t)}_validateSchema(t,e,i){const s=[];return i=i||this.jsoneditor.root.formname,t=$({},this.jsoneditor.expandRefs(t)),typeof e>"u"?this._validateV3Required(t,e,i):(Object.keys(t).forEach(r=>{this._validateSubSchema[r]&&s.push(...this._validateSubSchema[r].call(this,t,e,i))}),s.push(...this._validateByValueType(t,e,i)),t.links&&t.links.forEach((r,o)=>{r.rel&&r.rel.toLowerCase()==="describedby"&&(t=this._expandSchemaLink(t,o),s.push(...this._validateSchema(t,e,i,this.translate)))}),["date","time","datetime-local"].includes(t.format)&&s.push(...this._validateDateTimeSubSchema(t,e,i)),["uuid"].includes(t.format)&&s.push(...this._validateUUIDSchema(t,e,i)),s.push(...this._validateCustomValidator(t,e,i)),this._removeDuplicateErrors(s))}_expandSchemaLink(t,e){const i=t.links[e].href,s=this.jsoneditor.root.getValue(),r=this.jsoneditor.compileTemplate(i,this.jsoneditor.template),o=document.location.origin+document.location.pathname+r(s);return t.links=t.links.slice(0,e).concat(t.links.slice(e+1)),$({},t,this.jsoneditor.refs[o])}_validateV3Required(t,e,i){return(typeof t.required<"u"&&t.required===!0||typeof t.required>"u"&&this.jsoneditor.options.required_by_default===!0)&&t.type!=="info"?[{path:i,property:"required",message:this.translate("error_notset",null,t)}]:[]}_validateByValueType(t,e,i){const s=[];if(e===null)return s;if(typeof e=="number")Object.keys(t).forEach(r=>{this._validateNumberSubSchema[r]&&s.push(...this._validateNumberSubSchema[r].call(this,t,e,i))});else if(typeof e=="string")Object.keys(t).forEach(r=>{this._validateStringSubSchema[r]&&s.push(...this._validateStringSubSchema[r].call(this,t,e,i))});else if(Array.isArray(e))Object.keys(t).forEach(r=>{this._validateArraySubSchema[r]&&s.push(...this._validateArraySubSchema[r].call(this,t,e,i))});else if(typeof e=="object"){const r={};Object.keys(t).forEach(o=>{this._validateObjectSubSchema[o]&&s.push(...this._validateObjectSubSchema[o].call(this,t,e,i,r))}),typeof t.additionalProperties>"u"&&this.jsoneditor.options.no_additional_properties&&!t.oneOf&&!t.anyOf&&!t.allOf&&(t.additionalProperties=!1),Object.keys(t).forEach(o=>{typeof this._validateObjectSubSchema2[o]<"u"&&s.push(...this._validateObjectSubSchema2[o].call(this,t,e,i,r))})}return s}_validateUUIDSchema(t,e,i){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)?[]:[{path:i,property:"format",message:this.translate("error_pattern",["^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"],t)}]}_validateNumberSubSchemaMultipleDivisible(t,e,i){const s=t.multipleOf||t.divisibleBy;let r=e/s===Math.floor(e/s);return window.math?r=window.math.mod(window.math.bignumber(e),window.math.bignumber(s)).equals(0):window.Decimal&&(r=new window.Decimal(e).mod(new window.Decimal(s)).equals(0)),r?[]:[{path:i,property:t.multipleOf?"multipleOf":"divisibleBy",message:this.translate("error_multipleOf",[s],t)}]}_validateDateTimeSubSchema(t,e,i){const s=(h,u,g)=>u*1<1?[{path:g,property:"format",message:this.translate("error_invalid_epoch",null,h)}]:u!==Math.abs(parseInt(u))?[{path:g,property:"format",message:this.translate(`error_${h.format.replace(/-/g,"_")}`,[d],h)}]:[],r=(h,u,g,m)=>{if(u!==""){let y;if(m.flatpickr.config.mode!=="single"){const w=m.flatpickr.config.mode==="range"?m.flatpickr.l10n.rangeSeparator:", ";y=m.flatpickr.selectedDates.map(et=>m.flatpickr.formatDate(et,m.flatpickr.config.dateFormat)).join(w)}try{if(y){if(y!==u)throw new Error(`${m.flatpickr.config.mode} mismatch`)}else if(m.flatpickr.formatDate(m.flatpickr.parseDate(u,m.flatpickr.config.dateFormat),m.flatpickr.config.dateFormat)!==u)throw new Error("mismatch")}catch{const A=m.flatpickr.config.errorDateFormat!==void 0?m.flatpickr.config.errorDateFormat:m.flatpickr.config.dateFormat;return[{path:g,property:"format",message:this.translate(`error_${m.format.replace(/-/g,"_")}`,[A],h)}]}}return[]},o={date:/^(\d{4}\D\d{2}\D\d{2})$/,time:/^(\d{2}:\d{2}(?::\d{2})?)$/,"datetime-local":/^(\d{4}\D\d{2}\D\d{2}[ T]\d{2}:\d{2}(?::\d{2})?)$/},a={date:'"YYYY-MM-DD"',time:'"HH:MM"',"datetime-local":'"YYYY-MM-DD HH:MM"'},l=this.jsoneditor.getEditor(i),d=l&&l.flatpickr?l.flatpickr.config.dateFormat:a[t.format];if(t.type==="integer")return s(t,e,i);if(!l||!l.flatpickr){if(!o[t.format].test(e))return[{path:i,property:"format",message:this.translate(`error_${t.format.replace(/-/g,"_")}`,[d],t)}]}else if(l)return r(t,e,i,l);return[]}_validateCustomValidator(t,e,i){const s=[];s.push(...kh.call(this,t,e,i,this.translate));const r=o=>{s.push(...o.call(this,t,e,i))};return this.defaults.custom_validators.forEach(r),this.options.custom_validators&&this.options.custom_validators.forEach(r),s}_removeDuplicateErrors(t){return t.reduce((e,i)=>{let s=!0;return e||(e=[]),e.forEach(r=>{r.message===i.message&&r.path===i.path&&r.property===i.property&&(r.errorcount++,s=!1)}),s&&(i.errorcount=1,e.push(i)),e},[])}_checkType(t,e){const i={string:s=>typeof s=="string",number:s=>typeof s=="number",integer:s=>typeof s=="number"&&s===Math.floor(s),boolean:s=>typeof s=="boolean",array:s=>Array.isArray(s),object:s=>s!==null&&!Array.isArray(s)&&typeof s=="object",null:s=>s===null};return typeof t=="string"?i[t]?i[t](e):!0:!this._validateSchema(t,e).length}}class Sh extends Bt{register(){if(this.editors){for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].unregister();this.editors[this.type]&&this.editors[this.type].register()}super.register()}unregister(){if(super.unregister(),this.editors)for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].unregister()}getNumColumns(){return this.editors[this.type]?Math.max(this.editors[this.type].getNumColumns(),4):4}enable(){if(!this.always_disabled){if(this.editors)for(let t=0;t<this.editors.length;t++)this.editors[t]&&this.editors[t].enable();this.switcher.disabled=!1,super.enable()}}disable(t){if(t&&(this.always_disabled=!0),this.editors)for(let e=0;e<this.editors.length;e++)this.editors[e]&&this.editors[e].disable(t);this.switcher.disabled=!0,super.disable()}switchEditor(t){this.lastType=this.type,this.editors[t]||this.buildChildEditor(t);let e=this.getValue();this.type=t,this.register(),this.editors.forEach((i,s)=>{i&&(this.type===s?(this.keep_only_existing_values&&(e=ah(i.getValue(),e)),(this.keep_values||this.if)&&i.setValue(e,!0),i.container.style.display=""):i.container.style.display="none")}),this.refreshValue(),this.refreshHeaderText()}buildChildEditor(t){var o;const e=this.types[t],i=this.theme.getChildEditorHolder();this.editor_holder.appendChild(i);let s;typeof e=="string"?(s=$({},this.schema),s.type=e):(s=$({},this.schema,e),s=this.jsoneditor.expandRefs(s),e&&e.required&&Array.isArray(e.required)&&this.schema.required&&Array.isArray(this.schema.required)&&(s.required=this.schema.required.concat(e.required))),(o=s==null?void 0:s.options)!=null&&o.dependencies&&delete s.options.dependencies;const r=this.jsoneditor.getEditorClass(s);this.editors[t]=this.jsoneditor.createEditor(r,{jsoneditor:this.jsoneditor,schema:s,container:i,path:this.path,parent:this,required:!0}),this.editors[t].preBuild(),this.editors[t].build(),this.editors[t].postBuild(),this.editors[t].header&&this.theme.visuallyHidden(this.editors[t].header),this.editors[t].option=this.switcher_options[t],i.addEventListener("change_header_text",()=>{this.refreshHeaderText()}),t!==this.type&&(i.style.display="none")}preBuild(){if(this.types=[],this.type=0,this.editors=[],this.validators=[],this.keep_values=!0,typeof this.jsoneditor.options.keep_oneof_values<"u"&&(this.keep_values=this.jsoneditor.options.keep_oneof_values),typeof this.options.keep_oneof_values<"u"&&(this.keep_values=this.options.keep_oneof_values),this.keep_only_existing_values=!1,typeof this.jsoneditor.options.keep_only_existing_values<"u"&&(this.keep_only_existing_values=this.jsoneditor.options.keep_only_existing_values),typeof this.options.keep_only_existing_values<"u"&&(this.keep_only_existing_values=this.options.keep_only_existing_values),this.schema.oneOf)this.oneOf=!0,this.types=this.schema.oneOf,delete this.schema.oneOf;else if(this.schema.anyOf)this.anyOf=!0,this.types=this.schema.anyOf,delete this.schema.anyOf;else if(this.schema.if)this.if=!0,this.ifSchema=JSON.parse(JSON.stringify(this.schema.if)),this.thenSchema={title:"then"},this.elseSchema={title:"else"},this.types=[],this.schema.then&&Ki(this.thenSchema,this.schema,this.schema.then),this.schema.else&&Ki(this.elseSchema,this.schema,this.schema.else),this.types.push(this.thenSchema),this.types.push(this.elseSchema),this.types.forEach(t=>{delete t.if,delete t.then,delete t.else}),delete this.schema.if;else{if(!this.schema.type||this.schema.type==="any"){if(this.types=["string","number","integer","boolean","object","array","null"],this.schema.disallow){let{disallow:t}=this.schema;(typeof t!="object"||!Array.isArray(t))&&(t=[t]);const e=[];this.types.forEach(i=>{t.includes(i)||e.push(i)}),this.types=e}}else Array.isArray(this.schema.type)?this.types=this.schema.type:this.types=[this.schema.type];delete this.schema.type}this.display_text=this.getDisplayText(this.types)}build(){const{container:t}=this;this.header=this.label=this.theme.getLabelLike(this.getTitle(),this.isRequired()),this.switcher=this.theme.getSwitcher(this.display_text),this.switcher.setAttribute("id",this.formname+"switcher"),this.switcherLabel=this.theme.getHiddenLabel(this.formname+" switcher"),this.switcherLabel.setAttribute("for",this.formname+"switcher"),this.if||(this.container.appendChild(this.header),t.appendChild(this.switcherLabel),t.appendChild(this.switcher)),this.switcher.addEventListener("change",i=>{i.preventDefault(),i.stopPropagation(),this.switchEditor(this.display_text.indexOf(i.currentTarget.value)),this.onChange(!0)}),this.editor_holder=document.createElement("div"),t.appendChild(this.editor_holder);const e={};this.jsoneditor.options.custom_validators&&(e.custom_validators=this.jsoneditor.options.custom_validators),this.switcher_options=this.theme.getSwitcherOptions(this.switcher),this.types.forEach((i,s)=>{this.editors[s]=!1;let r;typeof i=="string"?(r=$({},this.schema),r.type=i):(r=$({},this.schema,i),i.required&&Array.isArray(i.required)&&this.schema.required&&Array.isArray(this.schema.required)&&(r.required=this.schema.required.concat(i.required))),this.validators[s]=new yo(this.jsoneditor,r,e,this.defaults)}),this.jsoneditor.on("change",()=>{this.switchIf()}),this.switchEditor(0)}onChildEditorChange(t){this.editors[this.type]&&(this.refreshValue(),this.refreshHeaderText()),super.onChildEditorChange()}refreshHeaderText(){const t=this.getDisplayText(this.types);Array.from(this.switcher_options).forEach((e,i)=>{e.textContent=t[i]})}refreshValue(){this.editors[this.type]&&(this.value=this.editors[this.type].getValue())}switchIf(){if(this.ifSchema&&this.value){const t=this.getIfType(this.value);this.lastType!==t&&(this.switchEditor(t),this.editors[this.type].setValue(this.value,!0)),this.switcher.value=this.display_text[this.type]}}getIfType(t){return this.jsoneditor.validator._validateSchema(this.ifSchema,t).length===0?0:1}setValue(t,e){const i=this.type;let s={match:0,extra:0,i:this.type};const r={match:0,i:null};this.validators.forEach((l,d)=>{let h=null;typeof this.anyOf<"u"&&this.anyOf&&(h=l.fitTest(t),(s.match<h.match||s.match===h.match&&s.extra>h.extra)&&(s=h,s.i=d)),!l.validate(t).length&&r.i===null?(r.i=d,h!==null&&(r.match=h.match)):s=r});let o=r.i;typeof this.anyOf<"u"&&this.anyOf&&r.match<s.match&&(o=s.i),this.if&&(o=this.getIfType(t)),o===null&&(o=this.type),this.type=o,this.switcher.value=this.display_text[o];const a=this.type!==i;a&&(this.switchEditor(this.type),this.editors[this.type].setValue(t,e)),typeof t<"u"&&this.editors[this.type].setValue(t,e),this.refreshValue(),this.onChange(a)}destroy(){this.editors.forEach(t=>{t&&t.destroy()}),this.editor_holder&&this.editor_holder.parentNode&&this.editor_holder.parentNode.removeChild(this.editor_holder),this.switcher&&this.switcher.parentNode&&this.switcher.parentNode.removeChild(this.switcher),super.destroy()}showValidationErrors(t){if(this.oneOf||this.anyOf){const e=this.oneOf?"oneOf":"anyOf";this.editors.forEach((i,s)=>{if(!i)return;const r=`${this.path}.${e}[${s}]`,o=(a,l)=>{if(l.path.startsWith(r)||l.path===r.substr(0,l.path.length)){const d=$({},l);l.path.startsWith(r)&&(d.path=this.path+d.path.substr(r.length)),a.push(d)}return a};i.showValidationErrors(t.reduce(o,[]))})}else this.editors.forEach(e=>{e&&e.showValidationErrors(t)})}addLinks(){}}class Th extends Bt{getValue(){if(this.dependenciesFulfilled)return null}setValue(){this.onChange()}getNumColumns(){return 2}}const jh={".je-object__title":"display:inline-block",".je-object__controls":"margin:0%200%200%2010px",".je-object__container":"position:relative",".je-object__property-checkbox":"margin:0;height:auto",".property-selector":"width:295px;max-height:160px;padding:5px%200;overflow-y:auto;overflow-x:hidden;padding-left:5px",".property-selector-input":"width:220px;margin-bottom:0;display:inline-block",".json-editor-btntype-toggle":"margin:0%2010px%200%200",".je-edit-json--textarea":"height:170px;width:300px;display:block"};class _o extends Bt{constructor(t,e,i){super(t,e),this.currentDepth=i}getDefault(){return $({},this.schema.default||{})}getChildEditors(){return this.editors}register(){super.register(),this.editors&&Object.values(this.editors).forEach(t=>t.register())}unregister(){super.unregister(),this.editors&&Object.values(this.editors).forEach(t=>t.unregister())}getNumColumns(){return Math.max(Math.min(12,this.maxwidth),3)}enable(){this.always_disabled||(this.editjson_control&&(this.editjson_control.disabled=!1),this.addproperty_button&&(this.addproperty_button.disabled=!1),super.enable(),this.editors&&Object.values(this.editors).forEach(t=>{(t.isActive()||t.isUiOnly)&&t.enable(),t.optInCheckbox.disabled=!1}))}disable(t){t&&(this.always_disabled=!0),this.editjson_control&&(this.editjson_control.disabled=!0),this.addproperty_button&&(this.addproperty_button.disabled=!0),this.hideEditJSON(),super.disable(),this.editors&&Object.values(this.editors).forEach(e=>{(e.isActive()||e.isUiOnly)&&e.disable(t),e.optInCheckbox.disabled=!0})}layoutEditors(){let t,e;if(!this.row_container)return;this.property_order=Object.keys(this.editors),this.property_order=this.property_order.sort((d,h)=>{let u=this.editors[d].schema.propertyOrder,g=this.editors[h].schema.propertyOrder;return typeof u!="number"&&(u=1e3),typeof g!="number"&&(g=1e3),u-g});let i;const s=this.format==="categories",r=[];let o=null,a=null,l;if(this.format==="grid-strict"){let d=0;if(l=[],this.property_order.forEach(h=>{const u=this.editors[h];if(u.property_removed)return;const g=u.options.hidden?0:u.options.grid_columns||u.getNumColumns(),m=u.options.hidden?0:u.options.grid_offset||0,y=u.options.hidden?!1:u.options.grid_break||!1,w=u.options.hidden?0:u.container.offsetHeight,A={key:h,width:g,offset:m,height:w};l.push(A),r[d]=l,y&&(d++,l=[])}),this.layout===JSON.stringify(r))return!1;for(this.layout=JSON.stringify(r),i=document.createElement("div"),t=0;t<r.length;t++)for(l=this.theme.getGridRow(),i.appendChild(l),e=0;e<r[t].length;e++)o=r[t][e].key,a=this.editors[o],a.options.hidden?a.container.style.display="none":this.theme.setGridColumnSize(a.container,r[t][e].width,r[t][e].offset),l.appendChild(a.container)}else if(this.format==="grid"){for(this.property_order.forEach(d=>{const h=this.editors[d];if(h.property_removed)return;let u=!1;const g=h.options.hidden?0:h.options.grid_columns||h.getNumColumns(),m=h.options.hidden?0:h.container.offsetHeight;for(let y=0;y<r.length;y++)r[y].width+g<=12&&(!m||r[y].minh*.5<m&&r[y].maxh*2>m)&&(u=y);u===!1&&(r.push({width:0,minh:999999,maxh:0,editors:[]}),u=r.length-1),r[u].editors.push({key:d,width:g,height:m}),r[u].width+=g,r[u].minh=Math.min(r[u].minh,m),r[u].maxh=Math.max(r[u].maxh,m)}),t=0;t<r.length;t++)if(r[t].width<12){let d=!1,h=0;for(e=0;e<r[t].editors.length;e++)(d===!1||r[t].editors[e].width>r[t].editors[d].width)&&(d=e),r[t].editors[e].width*=12/r[t].width,r[t].editors[e].width=Math.floor(r[t].editors[e].width),h+=r[t].editors[e].width;h<12&&(r[t].editors[d].width+=12-h),r[t].width=12}if(this.layout===JSON.stringify(r))return!1;for(this.layout=JSON.stringify(r),i=document.createElement("div"),t=0;t<r.length;t++)for(l=this.theme.getGridRow(),i.appendChild(l),e=0;e<r[t].editors.length;e++)o=r[t].editors[e].key,a=this.editors[o],a.options.hidden?a.container.style.display="none":this.theme.setGridColumnSize(a.container,r[t].editors[e].width),l.appendChild(a.container)}else{if(i=document.createElement("div"),s){const d=document.createElement("div"),h=this.theme.getTopTabHolder(this.translateProperty(this.schema.title)),u=this.theme.getTopTabContentHolder(h);for(this.property_order.forEach(y=>{const w=this.editors[y];if(w.property_removed)return;const A=this.theme.getTabContent(),et=w.schema&&(w.schema.type==="object"||w.schema.type==="array");A.isObjOrArray=et;const W=this.theme.getGridRow();w.tab||(typeof this.basicPane>"u"?this.addRow(w,h,A):this.addRow(w,h,this.basicPane)),A.id=this.getValidId(w.tab_text.textContent),et?(A.appendChild(W),u.appendChild(A),this.theme.addTopTab(h,w.tab)):(d.appendChild(W),u.childElementCount>0?u.firstChild.isObjOrArray&&(A.appendChild(d),u.insertBefore(A,u.firstChild),this.theme.insertBasicTopTab(w.tab,h),w.basicPane=A):(A.appendChild(d),u.appendChild(A),this.theme.addTopTab(h,w.tab),w.basicPane=A)),w.options.hidden?w.container.style.display="none":this.theme.setGridColumnSize(w.container,12),W.appendChild(w.container),w.rowPane=A});this.tabPanesContainer.firstChild;)this.tabPanesContainer.removeChild(this.tabPanesContainer.firstChild);const g=this.tabs_holder.parentNode;g.removeChild(g.firstChild),g.appendChild(h),this.tabPanesContainer=u,this.tabs_holder=h;const m=this.theme.getFirstTab(this.tabs_holder);m&&re(m,"click");return}this.property_order.forEach(d=>{const h=this.editors[d];h.property_removed||(l=this.theme.getGridRow(),i.appendChild(l),h.options.hidden?h.container.style.display="none":this.theme.setGridColumnSize(h.container,12),l.appendChild(h.container))})}for(;this.row_container.firstChild;)this.row_container.removeChild(this.row_container.firstChild);this.row_container.appendChild(i)}getPropertySchema(t){let e=this.schema.properties[t]||{};e=$({},e);let i=!!this.schema.properties[t];return this.schema.patternProperties&&Object.keys(this.schema.patternProperties).forEach(s=>{new RegExp(s).test(t)&&(e.allOf=e.allOf||[],e.allOf.push(this.schema.patternProperties[s]),i=!0)}),!i&&this.schema.additionalProperties&&typeof this.schema.additionalProperties=="object"&&(e=$({},this.schema.additionalProperties)),e}preBuild(){if(super.preBuild(),this.editors={},this.cached_editors={},this.format=this.options.layout||this.options.object_layout||this.schema.format||this.jsoneditor.options.object_layout||"normal",this.schema.properties=this.schema.properties||{},this.minwidth=0,this.maxwidth=0,this.options.table_row)Object.entries(this.schema.properties).forEach(([t,e])=>{const i=this.jsoneditor.getEditorClass(e);this.editors[t]=this.jsoneditor.createEditor(i,{jsoneditor:this.jsoneditor,schema:e,path:`${this.path}.${t}`,parent:this,compact:!0,required:!0},this.currentDepth+1),this.editors[t].preBuild();const s=this.editors[t].options.hidden?0:this.editors[t].options.grid_columns||this.editors[t].getNumColumns();this.minwidth+=s,this.maxwidth+=s}),this.no_link_holder=!0;else{if(this.options.table)throw new Error("Not supported yet");this.schema.defaultProperties||(this.jsoneditor.options.display_required_only||this.options.display_required_only?this.schema.defaultProperties=Object.keys(this.schema.properties).filter(t=>this.isRequiredObject({key:t,schema:this.schema.properties[t]})):this.schema.defaultProperties=Object.keys(this.schema.properties)),this.maxwidth+=1,Array.isArray(this.schema.defaultProperties)&&this.schema.defaultProperties.forEach(t=>{this.addObjectProperty(t,!0),this.editors[t]&&(this.minwidth=Math.max(this.minwidth,this.editors[t].options.grid_columns||this.editors[t].getNumColumns()),this.maxwidth+=this.editors[t].options.grid_columns||this.editors[t].getNumColumns())})}this.property_order=Object.keys(this.editors),this.property_order=this.property_order.sort((t,e)=>{let i=this.editors[t].schema.propertyOrder,s=this.editors[e].schema.propertyOrder;return typeof i!="number"&&(i=1e3),typeof s!="number"&&(s=1e3),i-s})}addTab(t){const e=this.rows[t].schema&&(this.rows[t].schema.type==="object"||this.rows[t].schema.type==="array");this.tabs_holder&&(this.rows[t].tab_text=document.createElement("span"),e?this.rows[t].tab_text.textContent=this.rows[t].getHeaderText():this.rows[t].tab_text.textContent=typeof this.schema.basicCategoryTitle>"u"?"Basic":this.schema.basicCategoryTitle,this.rows[t].tab=this.theme.getTopTab(this.rows[t].tab_text,this.getValidId(this.rows[t].tab_text.textContent)),this.rows[t].tab.addEventListener("click",i=>{this.active_tab=this.rows[t].tab,this.refreshTabs(),i.preventDefault(),i.stopPropagation()}))}addRow(t,e,i){const s=this.rows.length,r=t.schema.type==="object"||t.schema.type==="array";this.rows[s]=t,this.rows[s].rowPane=i,r?(this.addTab(s),this.theme.addTopTab(e,this.rows[s].tab)):typeof this.basicTab>"u"?(this.addTab(s),this.basicTab=s,this.basicPane=i,this.theme.addTopTab(e,this.rows[s].tab)):(this.rows[s].tab=this.rows[this.basicTab].tab,this.rows[s].tab_text=this.rows[this.basicTab].tab_text,this.rows[s].rowPane=this.rows[this.basicTab].rowPane)}refreshTabs(t){const e=typeof this.basicTab<"u";let i=!1;this.rows.forEach(s=>{!s.tab||!s.rowPane||!s.rowPane.parentNode||e&&s.tab===this.rows[this.basicTab].tab&&i||(t?s.tab_text.textContent=s.getHeaderText():(e&&s.tab===this.rows[this.basicTab].tab&&(i=!0),s.tab===this.active_tab?this.theme.markTabActive(s):this.theme.markTabInactive(s)))})}build(){const t=this.format==="categories";if(this.rows=[],this.active_tab=null,this.options.table_row)this.editor_holder=this.container,Object.entries(this.editors).forEach(([e,i])=>{const s=this.theme.getTableCell();this.editor_holder.appendChild(s),i.setContainer(s),i.build(),i.postBuild(),i.setOptInCheckbox(i.header),i.setValue(i.getDefault(),!0),this.editors[e].options.hidden&&(s.style.display="none"),this.editors[e].options.input_width&&(s.style.width=this.editors[e].options.input_width)});else{if(this.options.table)throw new Error("Not supported yet");{this.header="",this.options.compact||(this.header=document.createElement("span"),this.header.textContent=this.getTitle()),this.title=this.theme.getHeader(this.header,this.getPathDepth()),this.title.classList.add("je-object__title"),this.controls=this.theme.getButtonHolder(),this.controls.classList.add("je-object__controls"),this.container.appendChild(this.title),this.container.appendChild(this.controls),this.container.classList.add("je-object__container"),this.editjson_holder=this.theme.getModal(),this.editjson_textarea_label=this.theme.getHiddenLabel(this.translate("button_edit_json")),this.editjson_textarea_label.setAttribute("for",this.path+"-edit-json-textarea"),this.editjson_textarea=this.theme.getTextareaInput(),this.editjson_textarea.setAttribute("id",this.path+"-edit-json-textarea"),this.editjson_textarea.setAttribute("aria-labelledby",this.path+"-edit-json-textarea"),this.editjson_textarea.classList.add("je-edit-json--textarea"),this.editjson_save=this.getButton("button_save","save","button_save"),this.editjson_save.classList.add("json-editor-btntype-save"),this.editjson_save.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.saveJSON()}),this.editjson_copy=this.getButton("button_copy","copy","button_copy"),this.editjson_copy.classList.add("json-editor-btntype-copy"),this.editjson_copy.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.copyJSON()}),this.editjson_cancel=this.getButton("button_cancel","cancel","button_cancel"),this.editjson_cancel.classList.add("json-editor-btntype-cancel"),this.editjson_cancel.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.hideEditJSON()}),this.editjson_holder.appendChild(this.editjson_textarea_label),this.editjson_holder.appendChild(this.editjson_textarea),this.editjson_holder.appendChild(this.editjson_save),this.editjson_holder.appendChild(this.editjson_copy),this.editjson_holder.appendChild(this.editjson_cancel),this.addproperty_holder=this.theme.getModal(),this.addproperty_list=document.createElement("div"),this.addproperty_list.classList.add("property-selector"),this.addproperty_add=this.getButton("button_add","add","button_add"),this.addproperty_add.classList.add("json-editor-btntype-add"),this.addproperty_input=this.theme.getFormInputField("text"),this.addproperty_input.setAttribute("placeholder","Property name..."),this.addproperty_input_label=this.theme.getHiddenLabel(this.translate("button_properties")),this.addproperty_input_label.setAttribute("for",this.path+"-property-selector"),this.addproperty_input.classList.add("property-selector-input"),this.addproperty_input.setAttribute("id",this.path+"-property-selector"),this.addproperty_input.setAttribute("aria-labelledby",this.path+"-property-selector"),this.addproperty_add.addEventListener("click",i=>{if(i.preventDefault(),i.stopPropagation(),this.addproperty_input.value){if(this.editors[this.addproperty_input.value]){window.alert("there is already a property with that name");return}this.addObjectProperty(this.addproperty_input.value),this.editors[this.addproperty_input.value]&&this.editors[this.addproperty_input.value].disable(),this.onChange(!0)}}),this.addproperty_input.addEventListener("input",i=>{i.target.previousSibling.previousSibling.childNodes.forEach(s=>{let r=s.innerText,o=i.target.value;this.options.case_sensitive_property_search||this.jsoneditor.options.case_sensitive_property_search||(r=r.toLowerCase(),o=o.toLowerCase()),r.includes(o)?s.style.display="":s.style.display="none"})}),this.addproperty_holder.appendChild(this.addproperty_list),this.addproperty_holder.appendChild(this.addproperty_input_label),this.addproperty_holder.appendChild(this.addproperty_input),this.addproperty_holder.appendChild(this.addproperty_add);const e=document.createElement("div");e.style.clear="both",this.addproperty_holder.appendChild(e),this.onOutsideModalClickListener=this.onOutsideModalClick.bind(this),document.addEventListener("click",this.onOutsideModalClickListener,!0),this.schema.description&&(this.description=this.theme.getDescription(this.translateProperty(this.schema.description)),this.container.appendChild(this.description)),this.error_holder=document.createElement("div"),this.container.appendChild(this.error_holder),this.editor_holder=this.theme.getIndentedPanel(),this.container.appendChild(this.editor_holder),this.row_container=this.theme.getGridContainer(),t?(this.tabs_holder=this.theme.getTopTabHolder(this.getValidId(this.translateProperty(this.schema.title))),this.tabPanesContainer=this.theme.getTopTabContentHolder(this.tabs_holder),this.editor_holder.appendChild(this.tabs_holder)):(this.tabs_holder=this.theme.getTabHolder(this.getValidId(this.translateProperty(this.schema.title))),this.tabPanesContainer=this.theme.getTabContentHolder(this.tabs_holder),this.editor_holder.appendChild(this.row_container)),Object.values(this.editors).forEach(i=>{const s=this.theme.getTabContent(),r=this.theme.getGridColumn(),o=!!(i.schema&&(i.schema.type==="object"||i.schema.type==="array"));if(s.isObjOrArray=o,t){if(o){const a=this.theme.getGridContainer();a.appendChild(r),s.appendChild(a),this.tabPanesContainer.appendChild(s),this.row_container=a}else typeof this.row_container_basic>"u"&&(this.row_container_basic=this.theme.getGridContainer(),s.appendChild(this.row_container_basic),this.tabPanesContainer.childElementCount===0?this.tabPanesContainer.appendChild(s):this.tabPanesContainer.insertBefore(s,this.tabPanesContainer.childNodes[1])),this.row_container_basic.appendChild(r);this.addRow(i,this.tabs_holder,s),s.id=this.getValidId(i.schema.title)}else this.row_container.appendChild(r);i.setContainer(r),i.build(),i.postBuild(),i.setOptInCheckbox(i.header)}),this.rows[0]&&re(this.rows[0].tab,"click"),this.collapsed=!1,this.collapse_control=this.getButton("","collapse","button_collapse"),this.collapse_control.classList.add("json-editor-btntype-toggle"),this.title.insertBefore(this.collapse_control,this.title.childNodes[0]),this.collapse_control.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.collapsed?(this.editor_holder.style.display="",this.collapsed=!1,this.setButtonText(this.collapse_control,"","collapse","button_collapse")):(this.editor_holder.style.display="none",this.collapsed=!0,this.setButtonText(this.collapse_control,"","expand","button_expand"))}),this.options.collapsed&&re(this.collapse_control,"click"),this.schema.options&&typeof this.schema.options.disable_collapse<"u"?this.schema.options.disable_collapse&&(this.collapse_control.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.collapse_control.style.display="none"),this.editjson_control=this.getButton("JSON","edit","button_edit_json"),this.editjson_control.classList.add("json-editor-btntype-editjson"),this.editjson_control.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.toggleEditJSON()}),this.controls.appendChild(this.editjson_control),this.controls.insertBefore(this.editjson_holder,this.controls.childNodes[0]),this.schema.options&&typeof this.schema.options.disable_edit_json<"u"?this.schema.options.disable_edit_json&&(this.editjson_control.style.display="none"):this.jsoneditor.options.disable_edit_json&&(this.editjson_control.style.display="none"),this.addproperty_button=this.getButton("properties","edit_properties","button_object_properties"),this.addproperty_button.classList.add("json-editor-btntype-properties"),this.addproperty_button.addEventListener("click",i=>{i.preventDefault(),i.stopPropagation(),this.toggleAddProperty()}),this.controls.appendChild(this.addproperty_button),this.controls.insertBefore(this.addproperty_holder,this.controls.childNodes[1]),this.refreshAddProperties(),this.deactivateNonRequiredProperties()}}this.options.table_row?(this.editor_holder=this.container,this.property_order.forEach(e=>{this.editor_holder.appendChild(this.editors[e].container)})):(this.layoutEditors(),this.layoutEditors()),(this.schema.readOnly||this.schema.readonly)&&this.disable()}deactivateNonRequiredProperties(){const t=this.jsoneditor.options.show_opt_in,e=typeof this.options.show_opt_in<"u",i=e&&this.options.show_opt_in===!0,s=e&&this.options.show_opt_in===!1;(i||!s&&t||!e&&t)&&Object.entries(this.editors).forEach(([r,o])=>{this.isRequiredObject(o)||this.editors[r].deactivate()})}showEditJSON(){this.editjson_holder&&(this.hideAddProperty(),this.editjson_holder.style.left=`${this.editjson_control.offsetLeft}px`,this.editjson_holder.style.top=`${this.editjson_control.offsetTop+this.editjson_control.offsetHeight}px`,this.editjson_textarea.value=JSON.stringify(this.getValue(),null,2),this.disable(),this.editjson_holder.style.display="",this.editjson_control.disabled=!1,this.editing_json=!0)}hideEditJSON(){this.editjson_holder&&this.editing_json&&(this.editjson_holder.style.display="none",this.enable(),this.editing_json=!1)}copyJSON(){this.editjson_holder&&navigator.clipboard.writeText(this.editjson_textarea.value).catch(t=>window.alert(t))}saveJSON(){if(this.editjson_holder)try{const t=JSON.parse(this.editjson_textarea.value);this.setValue(t),this.hideEditJSON(),this.onChange(!0)}catch(t){throw window.alert("invalid JSON"),t}}toggleEditJSON(){this.editing_json?this.hideEditJSON():this.showEditJSON()}insertPropertyControlUsingPropertyOrder(t,e,i){let s;this.schema.properties[t]&&(s=this.schema.properties[t].propertyOrder),typeof s!="number"&&(s=1e3),e.propertyOrder=s;for(let r=0;r<i.childNodes.length;r++){const o=i.childNodes[r];if(e.propertyOrder<o.propertyOrder){this.addproperty_list.insertBefore(e,o),e=null;break}}e&&this.addproperty_list.appendChild(e)}addPropertyCheckbox(t){let e;const i=this.theme.getCheckbox();this.schema.properties[t]&&this.schema.properties[t].title?e=this.schema.properties[t].title:e=t;const s=this.theme.getCheckboxLabel(e),r=this.theme.getFormControl(s,i,null,null,this.path+"-"+t);return r.style.paddingBottom=r.style.marginBottom=r.style.paddingTop=r.style.marginTop=0,r.style.height="auto",this.insertPropertyControlUsingPropertyOrder(t,r,this.addproperty_list),i.checked=t in this.editors,i.addEventListener("change",()=>{i.checked?this.addObjectProperty(t):this.removeObjectProperty(t),this.onChange(!0)}),this.addproperty_checkboxes[t]=i,i}showAddProperty(){this.addproperty_holder&&(this.hideEditJSON(),this.addproperty_holder.style.left=`${this.addproperty_button.offsetLeft}px`,this.addproperty_holder.style.top=`${this.addproperty_button.offsetTop+this.addproperty_button.offsetHeight}px`,this.disable(),this.adding_property=!0,this.addproperty_button.disabled=!1,this.addproperty_holder.style.display="",this.refreshAddProperties())}hideAddProperty(){this.addproperty_holder&&this.adding_property&&(this.addproperty_holder.style.display="none",this.enable(),this.adding_property=!1)}toggleAddProperty(){this.adding_property?this.hideAddProperty():this.showAddProperty()}removeObjectProperty(t){this.editors[t]&&(this.editors[t].unregister(),delete this.editors[t],this.refreshValue(),this.layoutEditors())}getSchemaOnMaxDepth(t){return Object.keys(t).reduce((e,i)=>{switch(i){case"$ref":return e;case"properties":case"items":return{...e,[i]:{}};case"additionalProperties":case"propertyNames":return{...e,[i]:!0};default:return{...e,[i]:t[i]}}},{})}addObjectProperty(t,e){if(!this.editors[t]){if(this.cached_editors[t]){if(this.editors[t]=this.cached_editors[t],e)return;this.editors[t].register()}else{if(!this.canHaveAdditionalProperties()&&(!this.schema.properties||!this.schema.properties[t])&&(!this.schema.patternProperties||!Object.keys(this.schema.patternProperties).find(o=>new RegExp(o).test(t))))return;const i=this.getPropertySchema(t);typeof i.propertyOrder!="number"&&(i.propertyOrder=Object.keys(this.editors).length+1e3);const s=this.jsoneditor.getEditorClass(i),{max_depth:r}=this.jsoneditor.options;if(this.editors[t]=this.jsoneditor.createEditor(s,{jsoneditor:this.jsoneditor,schema:r&&this.currentDepth>=r?this.getSchemaOnMaxDepth(i):i,path:`${this.path}.${t}`,parent:this},this.currentDepth+1),this.editors[t].preBuild(),!e){const o=this.theme.getChildEditorHolder();this.editor_holder.appendChild(o),this.editors[t].setContainer(o),this.editors[t].build(),this.editors[t].postBuild(),this.editors[t].setOptInCheckbox(s.header),this.editors[t].activate()}this.cached_editors[t]=this.editors[t]}e||(this.refreshValue(),this.layoutEditors())}}onOutsideModalClick(t){const e=t.path||t.composedPath&&t.composedPath();this.addproperty_holder&&!this.addproperty_holder.contains(e[0])&&this.adding_property&&(t.preventDefault(),t.stopPropagation(),this.toggleAddProperty())}onChildEditorChange(t){this.refreshValue(),super.onChildEditorChange(t)}canHaveAdditionalProperties(){return typeof this.schema.additionalProperties=="boolean"?this.schema.additionalProperties:typeof this.schema.additionalProperties=="object"&&this.schema.additionalProperties!==null?!0:typeof this.options.no_additional_properties=="boolean"?!this.options.no_additional_properties:typeof this.jsoneditor.options.no_additional_properties=="boolean"?!this.jsoneditor.options.no_additional_properties:!0}destroy(){Object.values(this.cached_editors).forEach(t=>t.destroy()),this.editor_holder&&(this.editor_holder.innerHTML=""),this.title&&this.title.parentNode&&this.title.parentNode.removeChild(this.title),this.error_holder&&this.error_holder.parentNode&&this.error_holder.parentNode.removeChild(this.error_holder),this.editors=null,this.cached_editors=null,this.editor_holder&&this.editor_holder.parentNode&&this.editor_holder.parentNode.removeChild(this.editor_holder),this.editor_holder=null,document.removeEventListener("click",this.onOutsideModalClickListener,!0),super.destroy()}getValue(){if(!this.dependenciesFulfilled)return;const t=super.getValue(),e=i=>typeof i>"u"||i===""||i===Object(i)&&Object.keys(i).length===0&&i.constructor===Object;return t&&(this.jsoneditor.options.remove_empty_properties||this.options.remove_empty_properties)&&Object.keys(t).forEach(i=>{e(t[i])&&delete t[i]}),t}refreshValue(){this.value={},this.editors&&(Object.keys(this.editors).forEach(t=>{this.editors[t].isActive()&&(this.editors[t].refreshValue(),this.value[t]=this.editors[t].getValue())}),Object.keys(this.editors).forEach(t=>{this.editors[t].isActive()&&this.activateDependentRequired(this.editors[t].key)}),this.adding_property&&this.refreshAddProperties())}activateDependentRequired(t){this.getDependentRequired(t).forEach(i=>{let s;Object.entries(this.cached_editors).forEach(([r,o])=>{o.key===i&&(s=o)}),s&&!s.isActive()&&s.activate()})}getDependentRequired(t){return this.schema.dependentRequired&&Wt(this.schema.dependentRequired,t)?this.schema.dependentRequired[t]:[]}refreshAddProperties(){if(this.options.disable_properties||this.options.disable_properties!==!1&&this.jsoneditor.options.disable_properties){this.addproperty_button.style.display="none";return}let t=!1,e=0,i=!1;Object.keys(this.editors).forEach(s=>e++),t=this.canHaveAdditionalProperties()&&!(typeof this.schema.maxProperties<"u"&&e>=this.schema.maxProperties),this.addproperty_checkboxes&&(this.addproperty_list.innerHTML=""),this.addproperty_checkboxes={},Object.keys(this.cached_editors).forEach(s=>{this.addPropertyCheckbox(s),this.isRequiredObject(this.cached_editors[s])&&s in this.editors&&(this.addproperty_checkboxes[s].disabled=!0),typeof this.schema.minProperties<"u"&&e<=this.schema.minProperties?(this.addproperty_checkboxes[s].disabled=this.addproperty_checkboxes[s].checked,this.addproperty_checkboxes[s].checked||(i=!0)):s in this.editors?i=!0:!t&&!Wt(this.schema.properties,s)?this.addproperty_checkboxes[s].disabled=!0:(this.addproperty_checkboxes[s].disabled=!1,i=!0)}),this.canHaveAdditionalProperties()&&(i=!0),Object.keys(this.schema.properties).forEach(s=>{this.cached_editors[s]||(i=!0,this.addPropertyCheckbox(s))}),i?this.canHaveAdditionalProperties()?t?this.addproperty_add.disabled=!1:this.addproperty_add.disabled=!0:(this.addproperty_add.style.display="none",this.addproperty_input.style.display="none"):(this.hideAddProperty(),this.addproperty_button.style.display="none")}isRequiredObject(t){if(t)return typeof t.schema.required=="boolean"?t.schema.required:Array.isArray(this.schema.required)?this.schema.required.includes(t.key):!!this.jsoneditor.options.required_by_default}setValue(t,e){t=t||{},(typeof t!="object"||Array.isArray(t))&&(t={}),Object.entries(this.cached_editors).forEach(([i,s])=>{typeof t[i]<"u"?(this.addObjectProperty(i),s.setValue(t[i],e),s.activate()):!e&&!this.isRequiredObject(s)?this.jsoneditor.options.show_opt_in||this.options.show_opt_in?s.deactivate():this.removeObjectProperty(i):s.setValue(s.getDefault(),e)}),Object.entries(t).forEach(([i,s])=>{this.cached_editors[i]||(this.addObjectProperty(i),this.editors[i]&&this.editors[i].setValue(s,e,!!this.editors[i].template))}),this.refreshValue(),this.layoutEditors(),this.onChange()}showValidationErrors(t){const e=[],i=[];t.forEach(s=>{s.path===this.path?e.push(s):i.push(s)}),this.error_holder&&(e.length?(this.error_holder.innerHTML="",this.error_holder.style.display="",e.forEach(s=>{s.errorcount&&s.errorcount>1&&(s.message+=` (${s.errorcount} errors)`),this.error_holder.appendChild(this.theme.getErrorMessage(s.message))})):this.error_holder.style.display="none"),this.options.table_row&&(e.length?this.theme.addTableRowError(this.container):this.theme.removeTableRowError(this.container)),Object.values(this.editors).forEach(s=>{s.showValidationErrors(i)})}}_o.rules=jh;class $h extends Li{preBuild(){super.preBuild()}build(){this.label="",this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.compact&&this.container.classList.add("compact"),this.radioContainer=document.createElement("div"),this.radioGroup=[];const t=i=>{this.setValue(i.currentTarget.value),this.onChange(!0),this.radioGroup.forEach(s=>{s.checked=s.value===this.getValue()})};for(let i=0;i<this.enum_values.length;i++){const s={id:`${this.formname}[${i}]`,value:this.enum_values[i]};this.jsoneditor.options.use_name_attributes&&(s.name=this.formname),this.input=this.theme.getFormRadio(s),this.setInputAttributes(["id","value","name"]),this.input.addEventListener("change",t,!1),this.radioGroup.push(this.input);const r=this.theme.getFormRadioLabel(this.enum_display[i]);r.htmlFor=this.input.id;const o=this.theme.getFormRadioControl(r,this.input,!!(this.options.layout==="horizontal"||this.options.compact));this.radioContainer.appendChild(o)}if(this.schema.readOnly||this.schema.readonly){this.disable(!0);for(let i=0;i<this.radioGroup.length;i++)this.radioGroup[i].disabled=!0;this.radioContainer.classList.add("readonly")}const e=this.theme.getContainer();e.appendChild(this.radioContainer),e.dataset.containerFor="radio",this.input=e,this.control=this.theme.getFormControl(this.label,e,this.description,this.infoButton),this.container.appendChild(this.control),window.requestAnimationFrame(()=>{this.input.parentNode&&this.afterInputReady()})}enable(){if(!this.always_disabled){for(let t=0;t<this.radioGroup.length;t++)this.radioGroup[t].disabled=!1;this.radioContainer.classList.remove("readonly"),super.enable()}}disable(t){t&&(this.always_disabled=!0);for(let e=0;e<this.radioGroup.length;e++)this.radioGroup[e].disabled=!0;this.radioContainer.classList.add("readonly"),super.disable()}destroy(){this.radioContainer.parentNode&&this.radioContainer.parentNode.parentNode&&this.radioContainer.parentNode.parentNode.removeChild(this.radioContainer.parentNode),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),super.destroy()}getNumColumns(){return 2}setValue(t){typeof t!="string"&&(t=String(t));for(let e=0;e<this.radioGroup.length;e++)if(this.radioGroup[e].value===t){this.radioGroup[e].checked=!0,this.value=t,this.onChange();break}}}class Ph extends Yt{setValue(t,e,i){const s=super.setValue(t,e,i);s!==void 0&&s.changed&&this.sceditor_instance&&this.sceditor_instance.val(s.value)}build(){this.options.format="textarea",super.build(),this.input_type=this.schema.format,this.input.setAttribute("data-schemaformat",this.input_type)}afterInputReady(){if(window.sceditor){const t=this.expandCallbacks("sceditor",$({},{format:this.input_type,emoticonsEnabled:!1,width:"100%",height:300,readOnly:this.schema.readOnly||this.schema.readonly||this.schema.template},this.defaults.options.sceditor||{},this.options.sceditor||{},{element:this.input})),e=window.sceditor.instance(this.input);e===void 0&&window.sceditor.create(this.input,t),this.sceditor_instance=e||window.sceditor.instance(this.input),this.sceditor_instance.blur(()=>{this.value=this.sceditor_instance.val(),this.sceditor_instance.updateOriginal(),this.is_dirty=!0,this.onChange(!0)}),this.theme.afterInputReady(this.input)}else super.afterInputReady()}getNumColumns(){return 6}enable(){!this.always_disabled&&this.sceditor_instance&&this.sceditor_instance.readOnly(!1),super.enable()}disable(t){this.sceditor_instance&&this.sceditor_instance.readOnly(!0),super.disable(t)}destroy(){this.sceditor_instance&&(this.sceditor_instance.destroy(),this.sceditor_instance=null),super.destroy()}}class Oh extends Li{setValue(t,e){if(this.select2_instance){e?this.is_dirty=!1:this.jsoneditor.options.show_errors==="change"&&(this.is_dirty=!0);const i=this.updateValue(t);this.input.value=i,this.select2v4?this.select2_instance.val(i).trigger("change"):this.select2_instance.select2("val",i),this.onChange(!0)}else super.setValue(t,e)}afterInputReady(){if(window.jQuery&&window.jQuery.fn&&window.jQuery.fn.select2&&!this.select2_instance){const t=this.expandCallbacks("select2",$({},this.defaults.options.select2||{},this.options.select2||{}));this.newEnumAllowed=t.tags=!!t.tags&&this.schema.type==="string",this.select2_instance=window.jQuery(this.input).select2(t),this.select2v4=Wt(this.select2_instance.select2,"amd"),this.selectChangeHandler=()=>{const e=this.select2v4?this.select2_instance.val():this.select2_instance.select2("val");this.updateValue(e),this.onChange(!0)},this.select2_instance.on("change",this.selectChangeHandler),this.select2_instance.on("select2-blur",this.selectChangeHandler)}super.afterInputReady()}updateValue(t){let e=this.enum_values[0];return t=this.typecast(t||""),this.enum_values.includes(t)?e=t:this.newEnumAllowed&&(e=this.addNewOption(t)?t:e),this.value=e,e}addNewOption(t){const e=this.typecast(t);let i=!1,s;return!this.enum_values.includes(e)&&e!==""&&(this.enum_options.push(`${e}`),this.enum_display.push(`${e}`),this.enum_values.push(e),this.schema.enum.push(e),s=this.input.querySelector(`option[value="${e}"]`),s?s.removeAttribute("data-select2-tag"):this.input.appendChild(new Option(e,e,!1,!1)).trigger("change"),i=!0),i}enable(){this.always_disabled||this.select2_instance&&(this.select2v4?this.select2_instance.prop("disabled",!1):this.select2_instance.select2("enable",!0)),super.enable()}disable(t){this.select2_instance&&(this.select2v4?this.select2_instance.prop("disabled",!0):this.select2_instance.select2("enable",!1)),super.disable(t)}destroy(){this.select2_instance&&(this.select2_instance.select2("destroy"),this.select2_instance=null),super.destroy()}}class Ih extends Li{setValue(t,e){if(this.selectize_instance){e?this.is_dirty=!1:this.jsoneditor.options.show_errors==="change"&&(this.is_dirty=!0);const i=this.updateValue(t);this.input.value=i,this.selectize_instance.clear(!0),this.selectize_instance.setValue(i),this.onChange(!0)}else super.setValue(t,e)}afterInputReady(){if(window.jQuery&&window.jQuery.fn&&window.jQuery.fn.selectize&&!this.selectize_instance){const t=this.expandCallbacks("selectize",$({},this.defaults.options.selectize||{},this.options.selectize||{}));this.newEnumAllowed=t.create=!!t.create&&this.schema.type==="string",this.selectize_instance=window.jQuery(this.input).selectize(t)[0].selectize,this.control.removeEventListener("change",this.multiselectChangeHandler),this.multiselectChangeHandler=e=>{this.updateValue(e),this.onChange(!0)},this.selectize_instance.on("change",this.multiselectChangeHandler)}super.afterInputReady()}updateValue(t){let e=this.enum_values[0];return t=this.typecast(t||""),this.enum_values.includes(t)?e=t:this.newEnumAllowed&&(e=this.addNewOption(t)?t:e),this.value=e,e}addNewOption(t){const e=this.typecast(t);let i=!1;return!this.enum_values.includes(e)&&e!==""&&(this.enum_options.push(`${e}`),this.enum_display.push(`${e}`),this.enum_values.push(e),this.schema.enum.push(e),this.selectize_instance.addItem(e),this.selectize_instance.refreshOptions(!1),i=!0),i}onWatchedFieldChange(){super.onWatchedFieldChange(),this.selectize_instance&&(this.selectize_instance.clear(!0),this.selectize_instance.clearOptions(!0),this.enum_options.forEach((t,e)=>{this.selectize_instance.addOption({value:t,text:this.enum_display[e]})}),this.selectize_instance.addItem(`${this.value}`,!0))}enable(){!this.always_disabled&&this.selectize_instance&&this.selectize_instance.unlock(),super.enable()}disable(t){this.selectize_instance&&this.selectize_instance.lock(),super.disable(t)}destroy(){this.selectize_instance&&(this.selectize_instance.destroy(),this.selectize_instance=null),super.destroy()}}class Bh extends Yt{build(){this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description)));const t=this.formname.replace(/\W/g,"");if(typeof SignaturePad=="function"){this.input=this.theme.getFormInputField("hidden"),this.container.appendChild(this.input);const e=document.createElement("div");e.classList.add("signature-container");const i=document.createElement("canvas");this.jsoneditor.options.use_name_attributes&&i.setAttribute("name",t),i.classList.add("signature"),e.appendChild(i),this.signaturePad=new window.SignaturePad(i),this.signaturePad.onEnd=()=>{this.signaturePad.isEmpty()?this.input.value="":this.input.value=this.signaturePad.toDataURL(),this.is_dirty=!0,this.refreshValue(),this.watch_listener(),this.jsoneditor.notifyWatchers(this.path),this.parent?this.parent.onChildEditorChange(this):this.jsoneditor.onChange()};const s=document.createElement("div"),r=document.createElement("button");r.classList.add("tiny","button"),r.innerHTML="Clear signature",s.appendChild(r),e.appendChild(s),this.options.compact&&this.container.setAttribute("class",`${this.container.getAttribute("class")} compact`),(this.schema.readOnly||this.schema.readonly)&&(this.disable(!0),Array.from(this.inputs).forEach(o=>{i.setAttribute("readOnly","readOnly"),o.disabled=!0})),r.addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),this.signaturePad.clear(),this.signaturePad.strokeEnd()}),this.control=this.theme.getFormControl(this.label,e,this.description),this.container.appendChild(this.control),this.refreshValue(),i.width=e.offsetWidth,this.options&&this.options.canvas_height?i.height=this.options.canvas_height:i.height="300"}else{const e=document.createElement("p");e.innerHTML="Signature pad is not available, please include SignaturePad from https://github.com/szimek/signature_pad",this.container.appendChild(e)}}setValue(t){if(typeof SignaturePad=="function"){const e=this.sanitize(t);return this.value===e?void 0:(this.value=e,this.input.value=this.value,this.signaturePad.clear(),t&&t!==""&&this.signaturePad.fromDataURL(t),this.watch_listener(),this.jsoneditor.notifyWatchers(this.path),!1)}}destroy(){this.signaturePad.off(),delete this.signaturePad}}class Rh extends Yt{setValue(t,e,i){const s=super.setValue(t,e,i);s!==void 0&&s.changed&&this.simplemde_instance&&this.simplemde_instance.value(s.value)}build(){this.options.format="textarea",super.build(),this.input_type=this.schema.format,this.input.setAttribute("data-schemaformat",this.input_type)}afterInputReady(){let t;window.SimpleMDE?(t=this.expandCallbacks("simplemde",$({},{height:300},this.defaults.options.simplemde||{},this.options.simplemde||{},{element:this.input,forceSync:!0})),this.simplemde_instance=new window.SimpleMDE(t),(this.schema.readOnly||this.schema.readonly||this.schema.template)&&(this.simplemde_instance.codemirror.options.readOnly=!0),this.simplemde_instance.codemirror.on("change",()=>{this.value=this.simplemde_instance.value(),this.is_dirty=!0,this.onChange(!0)}),t.autorefresh&&this.startListening(this.simplemde_instance.codemirror,this.simplemde_instance.codemirror.state.autoRefresh={delay:250}),this.theme.afterInputReady(this.input)):super.afterInputReady()}getNumColumns(){return 6}enable(){!this.always_disabled&&this.simplemde_instance&&(this.simplemde_instance.codemirror.options.readOnly=!1),super.enable()}disable(t){this.simplemde_instance&&(this.simplemde_instance.codemirror.options.readOnly=!0),super.disable(t)}destroy(){this.simplemde_instance&&(this.simplemde_instance.toTextArea(),this.simplemde_instance=null),super.destroy()}startListening(t,e){function i(){t.display.wrapper.offsetHeight?(this.stopListening(t,e),t.display.lastWrapHeight!==t.display.wrapper.clientHeight&&t.refresh()):e.timeout=window.setTimeout(i,e.delay)}e.timeout=window.setTimeout(i,e.delay),e.hurry=()=>{window.clearTimeout(e.timeout),e.timeout=window.setTimeout(i,50)},t.on(window,"mouseup",e.hurry),t.on(window,"keyup",e.hurry)}stopListening(t,e){window.clearTimeout(e.timeout),t.off(window,"mouseup",e.hurry),t.off(window,"keyup",e.hurry)}}const Dh={".starrating":"direction:rtl;display:inline-block;white-space:nowrap",".starrating > input":"display:none",".starrating > label:before":"content:'%5C2606';margin:1px;font-size:18px;font-style:normal;font-weight:400;line-height:1;font-family:'Arial';display:inline-block",".starrating > label":"color:%23888;cursor:pointer;margin:8px%200%202px%200",".starrating > label.starrating-display-enabled":"margin:1px%200%200%200",".starrating > input:checked ~ label":"color:%23ffca08",".starrating:not(.readonly) > input:hover ~ label":"color:%23ffca08",".starrating > input:checked ~ label:before":"content:'%5C2605';text-shadow:0%200%201px%20rgba(0%2C20%2C20%2C1)",".starrating:not(.readonly) > input:hover ~ label:before":"content:'%5C2605';text-shadow:0%200%201px%20rgba(0%2C20%2C20%2C1)",".starrating .starrating-display":"position:relative;direction:rtl;text-align:center;font-size:10px;line-height:0px"};class vo extends Yt{build(){if(this.options.compact||(this.header=this.label=this.theme.getLabelLike(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.compact&&this.container.classList.add("compact"),this.ratingContainer=document.createElement("div"),this.ratingContainer.classList.add("starrating"),this.schema.enum===void 0){let i=this.schema.maximum?this.schema.maximum:5;this.schema.exclusiveMaximum&&i--,this.enum_values=[];for(let s=0;s<i;s++)this.enum_values.push(s+1)}else this.enum_values=this.schema.enum;this.radioGroup=[];const t=i=>{i.preventDefault(),i.stopPropagation(),this.setValue(i.currentTarget.value),this.onChange(!0)};for(let i=this.enum_values.length-1;i>-1;i--){const s=this.formname+(i+1),r=this.theme.getFormInputField("radio");r.name=`${this.formname}[starrating]`,r.value=this.enum_values[i],r.id=s,r.addEventListener("change",t,!1),this.radioGroup.push(r);const o=document.createElement("label");o.htmlFor=s,o.title=this.enum_values[i],this.options.displayValue&&o.classList.add("starrating-display-enabled");const a=this.theme.getHiddenText("label");a.textContent=i,o.appendChild(a),this.ratingContainer.appendChild(r),this.ratingContainer.appendChild(o)}if(this.options.displayValue&&(this.displayRating=document.createElement("div"),this.displayRating.classList.add("starrating-display"),this.displayRating.innerText=this.enum_values[0],this.ratingContainer.appendChild(this.displayRating)),this.schema.readOnly||this.schema.readonly){this.disable(!0);for(let i=0;i<this.radioGroup.length;i++)this.radioGroup[i].disabled=!0;this.ratingContainer.classList.add("readonly")}const e=this.theme.getContainer();e.appendChild(this.ratingContainer),this.input=e,this.control=this.theme.getFormControl(this.label,e,this.description,this.infoButton),this.container.appendChild(this.control),this.refreshValue()}enable(){if(!this.always_disabled){for(let t=0;t<this.radioGroup.length;t++)this.radioGroup[t].disabled=!1;this.ratingContainer.classList.remove("readonly"),this.disabled=!1}}disable(t){t&&(this.always_disabled=!0);for(let e=0;e<this.radioGroup.length;e++)this.radioGroup[e].disabled=!0;this.ratingContainer.classList.add("readonly"),this.disabled=!0}destroy(){this.ratingContainer.parentNode&&this.ratingContainer.parentNode.parentNode&&this.ratingContainer.parentNode.parentNode.removeChild(this.ratingContainer.parentNode),this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),super.destroy()}getNumColumns(){return 2}getValue(){if(this.dependenciesFulfilled)return this.schema.type==="integer"?this.value===""?void 0:this.value*1:this.value}setValue(t){for(let e=0;e<this.radioGroup.length;e++)if(this.radioGroup[e].value===`${t}`){this.radioGroup[e].checked=!0,this.value=t,this.options.displayValue&&(this.displayRating.innerHTML=this.value),this.onChange(!0);break}}}vo.rules=Dh;class Nh extends bo{build(){super.build(),this.input.setAttribute("type","number"),this.input.getAttribute("step")||this.input.setAttribute("step","1");const t=this.theme.getStepperButtons(this.input);this.control.appendChild(t),this.stepperDown=this.control.querySelector(".stepper-down"),this.stepperUp=this.control.querySelector(".stepper-up")}enable(){super.enable(),this.stepperDown.removeAttribute("disabled"),this.stepperUp.removeAttribute("disabled")}disable(){super.disable(),this.stepperDown.setAttribute("disabled",!0),this.stepperUp.setAttribute("disabled",!0)}}class Mh extends xr{register(){if(super.register(),this.rows)for(let t=0;t<this.rows.length;t++)this.rows[t].register()}unregister(){if(super.unregister(),this.rows)for(let t=0;t<this.rows.length;t++)this.rows[t].unregister()}getNumColumns(){return Math.max(Math.min(12,this.width),3)}preBuild(){const t=this.jsoneditor.expandRefs(this.schema.items||{});this.item_title=t.title||"row",this.item_default=t.default||null,this.item_has_child_editors=t.properties||t.items,this.width=12,this.array_controls_top=this.options.array_controls_top||this.jsoneditor.options.array_controls_top,super.preBuild()}build(){this.tableContainer=this.theme.getTableContainer(),this.table=this.theme.getTable(),this.tableContainer.appendChild(this.table),this.container.appendChild(this.tableContainer),this.thead=this.theme.getTableHead(),this.table.appendChild(this.thead),this.header_row=this.theme.getTableRow(),this.thead.appendChild(this.header_row),this.row_holder=this.theme.getTableBody(),this.table.appendChild(this.row_holder);const t=this.getElementEditor(0,!0);if(this.item_default=t.getDefault(),this.width=t.getNumColumns()+2,this.options.compact?(this.panel=document.createElement("div"),this.container.appendChild(this.panel)):(this.header=document.createElement("span"),this.header.textContent=this.getTitle(),this.title=this.theme.getHeader(this.header,this.getPathDepth()),this.container.appendChild(this.title),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText)),this.container.appendChild(this.infoButton)),this.title_controls=this.theme.getHeaderButtonHolder(),this.title.appendChild(this.title_controls),this.schema.description&&(this.description=this.theme.getDescription(this.translateProperty(this.schema.description)),this.container.appendChild(this.description)),this.panel=this.theme.getIndentedPanel(),this.container.appendChild(this.panel),this.error_holder=document.createElement("div"),this.panel.appendChild(this.error_holder)),this.panel.appendChild(this.tableContainer),this.controls=this.theme.getButtonHolder(),this.array_controls_top?this.title.appendChild(this.controls):this.panel.appendChild(this.controls),this.item_has_child_editors){const e=t.getChildEditors(),i=t.property_order||Object.keys(e);for(let s=0;s<i.length;s++){const r=this.theme.getTableHeaderCell(e[i[s]].getTitle());e[i[s]].options.hidden&&(r.style.display="none"),this.header_row.appendChild(r)}}else this.header_row.appendChild(this.theme.getTableHeaderCell(this.item_title));t.destroy(),this.row_holder.innerHTML="",this.controls_header_cell=this.theme.getTableHeaderCell(this.translate("table_controls")),this.controls_header_cell.setAttribute("aria-hidden","true"),this.controls_header_cell.style.visibility="hidden",this.header_row.appendChild(this.controls_header_cell),this.addControls()}onChildEditorChange(t){this.refreshValue(),super.onChildEditorChange()}getItemDefault(){return $({},{default:this.item_default}).default}getItemTitle(){return this.item_title}getElementEditor(t,e){const i=$({},this.schema.items),s=this.jsoneditor.getEditorClass(i,this.jsoneditor),r=this.row_holder.appendChild(this.theme.getTableRow());let o=r;this.item_has_child_editors||(o=this.theme.getTableCell(),r.appendChild(o));const a=this.jsoneditor.createEditor(s,{jsoneditor:this.jsoneditor,schema:i,container:o,path:`${this.path}.${t}`,parent:this,compact:!0,table_row:!0});return a.preBuild(),e||(a.build(),a.postBuild(),a.controls_cell=r.appendChild(this.theme.getTableCell()),a.row=r,a.table_controls=this.theme.getButtonHolder(),a.controls_cell.appendChild(a.table_controls),a.table_controls.style.margin=0,a.table_controls.style.padding=0),a}destroy(){this.innerHTML="",this.checkParent(this.title)&&this.title.parentNode.removeChild(this.title),this.checkParent(this.description)&&this.description.parentNode.removeChild(this.description),this.checkParent(this.row_holder)&&this.row_holder.parentNode.removeChild(this.row_holder),this.checkParent(this.table)&&this.table.parentNode.removeChild(this.table),this.checkParent(this.panel)&&this.panel.parentNode.removeChild(this.panel),this.rows=this.title=this.description=this.row_holder=this.table=this.panel=null,super.destroy()}ensureArraySize(t){if(Array.isArray(t)||(t=[t]),this.schema.minItems)for(;t.length<this.schema.minItems;)t.push(this.getItemDefault());return this.schema.maxItems&&t.length>this.schema.maxItems&&(t=t.slice(0,this.schema.maxItems)),t}setValue(t=[],e){if(t=this.ensureArraySize(t),JSON.stringify(t)===this.serialized)return;let s=!1;t.forEach((r,o)=>{this.rows[o]?this.rows[o].setValue(r):(this.addRow(r),s=!0)});for(let r=t.length;r<this.rows.length;r++){const o=this.rows[r].container;this.item_has_child_editors||this.rows[r].row.parentNode.removeChild(this.rows[r].row),this.rows[r].destroy(),o.parentNode&&o.parentNode.removeChild(o),this.rows[r]=null,s=!0}this.rows=this.rows.slice(0,t.length),this.refreshValue(),(s||e)&&this.refreshRowButtons(),this.onChange()}refreshRowButtons(){const t=this.schema.minItems&&this.schema.minItems>=this.rows.length,e=this.schema.maxItems&&this.schema.maxItems<=this.rows.length,i=[];this.rows.forEach((d,h)=>{if(d.delete_button){const u=!t;this.setButtonState(d.delete_button,u),i.push(u)}if(d.copy_button){const u=!e;this.setButtonState(d.copy_button,u),i.push(u)}if(d.moveup_button){const u=h!==0;this.setButtonState(d.moveup_button,u),i.push(u)}if(d.movedown_button){const u=h!==this.rows.length-1;this.setButtonState(d.movedown_button,u),i.push(u)}});const s=i.some(d=>d);this.rows.forEach(d=>this.setButtonState(d.controls_cell,s)),this.setButtonState(this.controls_header_cell,s),this.setButtonState(this.table,this.value.length);const r=!(e||this.hide_add_button);this.setButtonState(this.add_row_button,r);const o=!(!this.value.length||t||this.hide_delete_last_row_buttons);this.setButtonState(this.delete_last_row_button,o);const a=!(this.value.length<=1||t||this.hide_delete_all_rows_buttons);this.setButtonState(this.remove_all_rows_button,a);const l=r||o||a;this.setButtonState(this.controls,l)}refreshValue(){this.value=[],this.rows.forEach((t,e)=>{this.value[e]=t.getValue()}),this.serialized=JSON.stringify(this.value)}addRow(t){const e=this.rows.length;this.rows[e]=this.getElementEditor(e);const i=this.rows[e].table_controls;return this.hide_delete_buttons||(this.rows[e].delete_button=this._createDeleteButton(e,i)),this.show_copy_button&&(this.rows[e].copy_button=this._createCopyButton(e,i)),this.hide_move_buttons||(this.rows[e].moveup_button=this._createMoveUpButton(e,i)),this.hide_move_buttons||(this.rows[e].movedown_button=this._createMoveDownButton(e,i)),typeof t<"u"&&this.rows[e].setValue(t),this.rows[e]}_createDeleteButton(t,e){const i=this.getButton("","delete","button_delete_row_title_short");return i.classList.add("delete","json-editor-btntype-delete"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{if(s.preventDefault(),s.stopPropagation(),!this.askConfirmation())return!1;const r=s.currentTarget.getAttribute("data-i")*1,o=this.getValue(),l=this.getValue()[r];o.splice(r,1),this.setValue(o),this.onChange(!0),this.jsoneditor.trigger("deleteRow",l)}),e.appendChild(i),i}_createCopyButton(t,e){const i=this.getButton("","copy","button_copy_row_title_short"),s=this.schema;return i.classList.add("copy","json-editor-btntype-copy"),i.setAttribute("data-i",t),i.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();const o=r.currentTarget.getAttribute("data-i")*1,a=this.getValue();let l=a[o];s.items.type==="string"&&s.items.format==="uuid"?l=Ei():s.items.type==="object"&&s.items.properties&&a.forEach((d,h)=>{if(o===h)for(const u of Object.keys(d))s.items.properties&&s.items.properties[u]&&s.items.properties[u].format==="uuid"&&(l=Object.assign({},a[o]),l[u]=Ei())}),a.splice(o+1,0,l),this.setValue(a),this.onChange(!0),this.jsoneditor.trigger("copyRow",this.rows[o+1])}),e.appendChild(i),i}_createMoveUpButton(t,e){const i=this.getButton("","moveup","button_move_up_title");return i.classList.add("moveup","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();const r=s.currentTarget.getAttribute("data-i")*1,o=this.getValue();o.splice(r-1,0,o.splice(r,1)[0]),this.setValue(o),this.onChange(!0),this.jsoneditor.trigger("moveRow",this.rows[r-1])}),e.appendChild(i),i}_createMoveDownButton(t,e){const i=this.getButton("","movedown","button_move_down_title");return i.classList.add("movedown","json-editor-btntype-move"),i.setAttribute("data-i",t),i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();const r=s.currentTarget.getAttribute("data-i")*1,o=this.getValue();o.splice(r+1,0,o.splice(r,1)[0]),this.setValue(o),this.onChange(!0),this.jsoneditor.trigger("moveRow",this.rows[r+1])}),e.appendChild(i),i}addControls(){this.collapsed=!1,this.toggle_button=this._createToggleButton(),this.title_controls&&(this.title.insertBefore(this.toggle_button,this.title.childNodes[0]),this.toggle_button.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.setButtonState(this.panel,this.collapsed),this.collapsed?(this.collapsed=!1,this.setButtonText(t.currentTarget,"","collapse","button_collapse")):(this.collapsed=!0,this.setButtonText(t.currentTarget,"","expand","button_expand"))}),this.options.collapsed&&re(this.toggle_button,"click"),this.schema.options&&typeof this.schema.options.disable_collapse<"u"?this.schema.options.disable_collapse&&(this.toggle_button.style.display="none"):this.jsoneditor.options.disable_collapse&&(this.toggle_button.style.display="none")),this.add_row_button=this._createAddRowButton(),this.delete_last_row_button=this._createDeleteLastRowButton(),this.remove_all_rows_button=this._createRemoveAllRowsButton()}_createToggleButton(){const t=this.getButton("","collapse","button_collapse");return t.classList.add("json-editor-btntype-toggle"),t}_createAddRowButton(){const t=this.getButton(this.getItemTitle(),"add","button_add_row_title",[this.getItemTitle()]);return t.classList.add("json-editor-btntype-add"),t.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation();const i=this.addRow();this.refreshValue(),this.refreshRowButtons(),this.onChange(!0),this.jsoneditor.trigger("addRow",i)}),this.controls.appendChild(t),t}_createDeleteLastRowButton(){const t=this.getButton("button_delete_last","subtract","button_delete_last_title",[this.getItemTitle()]);return t.classList.add("json-editor-btntype-deletelast"),t.addEventListener("click",e=>{if(e.preventDefault(),e.stopPropagation(),!this.askConfirmation())return!1;const i=this.getValue(),s=i.pop();this.setValue(i),this.onChange(!0),this.jsoneditor.trigger("deleteRow",s)}),this.controls.appendChild(t),t}_createRemoveAllRowsButton(){const t=this.getButton("button_delete_all","delete","button_delete_all_title");return t.classList.add("json-editor-btntype-deleteall"),t.addEventListener("click",e=>{if(e.preventDefault(),e.stopPropagation(),!this.askConfirmation())return!1;const i=this.getValue();this.setValue([]),this.onChange(!0),this.jsoneditor.trigger("deleteAllRows",i)}),this.controls.appendChild(t),t}}class Hh extends Bt{getNumColumns(){return 4}build(){if(this.options.compact||(this.header=this.label=this.theme.getFormInputLabel(this.getTitle(),this.isRequired())),this.schema.description&&(this.description=this.theme.getFormInputDescription(this.translateProperty(this.schema.description))),this.options.infoText&&(this.infoButton=this.theme.getInfoButton(this.translateProperty(this.options.infoText))),this.options.hidden&&(this.container.style.display="none"),this.options=this.expandCallbacks("upload",$({},{title:"Browse",icon:"",auto_upload:!1,hide_input:!1,enable_drag_drop:!1,drop_zone_text:"Drag & Drop file here",drop_zone_top:!1,alt_drop_zone:"",mime_type:"",max_upload_size:0,upload_handler:(i,s,r,o)=>{window.alert(`No upload_handler defined for "${i.path}". You must create your own handler to enable upload to server`)}},this.defaults.options.upload||{},this.options.upload||{})),this.options.mime_type=this.options.mime_type?[].concat(this.options.mime_type):[],this.input=this.theme.getFormInputField("hidden"),this.container.appendChild(this.input),!this.schema.readOnly&&!this.schema.readonly){if(typeof this.options.upload_handler!="function")throw new Error("Upload handler required for upload editor");if(this.uploader=this.theme.getFormInputField("file"),this.uploader.style.display="none",this.options.mime_type.length&&this.uploader.setAttribute("accept",this.options.mime_type),this.options.enable_drag_drop===!0&&this.options.hide_input===!0||(this.clickHandler=i=>{this.uploader.dispatchEvent(new window.MouseEvent("click",{view:window,bubbles:!0,cancelable:!1}))},this.browseButton=this.getButton(this.options.title,this.options.icon,this.options.title),this.browseButton.addEventListener("click",this.clickHandler),this.fileDisplay=this.theme.getFormInputField("input"),this.fileDisplay.setAttribute("readonly",!0),this.fileDisplay.value="No file selected.",this.fileDisplay.addEventListener("dblclick",this.clickHandler),this.fileUploadGroup=this.theme.getInputGroup(this.fileDisplay,[this.browseButton]),this.fileUploadGroup||(this.fileUploadGroup=document.createElement("div"),this.fileUploadGroup.appendChild(this.fileDisplay),this.fileUploadGroup.appendChild(this.browseButton))),this.options.enable_drag_drop===!0){if(this.options.alt_drop_zone!=="")if(this.altDropZone=document.querySelector(this.options.alt_drop_zone),this.altDropZone)this.dropZone=this.altDropZone;else throw new Error(`Error: alt_drop_zone selector "${this.options.alt_drop_zone}" not found!`);else this.dropZone=this.theme.getDropZone(this.options.drop_zone_text);this.dropZone&&(this.dropZone.classList.add("upload-dropzone"),this.dropZone.addEventListener("dblclick",this.clickHandler))}this.uploadHandler=i=>{i.preventDefault(),i.stopPropagation();const s=i.target.files||i.dataTransfer.files;if(s&&s.length)if(this.options.max_upload_size!==0&&s[0].size>this.options.max_upload_size)this.theme.addInputError(this.uploader,`${this.translate("upload_max_size")} ${this.options.max_upload_size}`);else if(this.options.mime_type.length!==0&&!this.isValidMimeType(s[0].type,this.options.mime_type))this.theme.addInputError(this.uploader,`${this.translate("upload_wrong_file_format")} ${this.options.mime_type.toString()}`);else{this.fileDisplay&&(this.fileDisplay.value=s[0].name);let r=new window.FileReader;r.onload=o=>{this.preview_value=o.target.result,this.refreshPreview(s),this.onChange(!0),r=null},r.readAsDataURL(s[0])}},this.uploader.addEventListener("change",this.uploadHandler),this.dragHandler=i=>{const s=i.dataTransfer.items||i.dataTransfer.files,r=s&&s.length&&(this.options.mime_type.length===0||this.isValidMimeType(s[0].type,this.options.mime_type)),o=i.currentTarget.classList&&i.currentTarget.classList.contains("upload-dropzone")&&r;switch((i.currentTarget===window?"w_":"e_")+i.type){case"w_drop":case"w_dragover":o||(i.dataTransfer.dropEffect="none");break;case"e_dragenter":{o?(this.dropZone.classList.add("valid-dropzone"),i.dataTransfer.dropEffect="copy"):this.dropZone.classList.add("invalid-dropzone");break}case"e_dragover":{o&&(i.dataTransfer.dropEffect="copy");break}case"e_dragleave":this.dropZone.classList.remove("valid-dropzone","invalid-dropzone");break;case"e_drop":{this.dropZone.classList.remove("valid-dropzone","invalid-dropzone"),o&&this.uploadHandler(i);break}}o||i.preventDefault()},this.options.enable_drag_drop===!0&&(["dragover","drop"].forEach(i=>{window.addEventListener(i,this.dragHandler,!0)}),["dragenter","dragover","dragleave","drop"].forEach(i=>{this.dropZone.addEventListener(i,this.dragHandler,!0)}))}this.preview=document.createElement("div"),this.control=this.input.controlgroup=this.theme.getFormControl(this.label,this.uploader||this.input,this.description,this.infoButton),this.uploader&&(this.uploader.controlgroup=this.control);const t=this.uploader||this.input,e=document.createElement("div");this.dropZone&&!this.altDropZone&&this.options.drop_zone_top===!0&&e.appendChild(this.dropZone),this.fileUploadGroup&&e.appendChild(this.fileUploadGroup),this.dropZone&&!this.altDropZone&&this.options.drop_zone_top!==!0&&e.appendChild(this.dropZone),e.appendChild(this.preview),t.parentNode.insertBefore(e,t.nextSibling),this.container.appendChild(this.control),window.requestAnimationFrame(()=>{this.afterInputReady()})}afterInputReady(){if(this.value){const t=document.createElement("img");t.style.maxWidth="100%",t.style.maxHeight="100px",t.onload=e=>{this.preview.appendChild(t)},t.onerror=e=>{console.error("upload error",e,e.currentTarget)},t.src=this.container.querySelector("a").href}this.theme.afterInputReady(this.input)}refreshPreview(t){if(this.last_preview===this.preview_value||(this.last_preview=this.preview_value,this.preview.innerHTML="",!this.preview_value))return;const e=t[0],i=this.preview_value.match(/^data:([^;,]+)[;,]/);if(e.mimeType=i?i[1]:"unknown",e.size>0){const r=Math.floor(Math.log(e.size)/Math.log(1024));e.formattedSize=`${parseFloat((e.size/1024**r).toFixed(2))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`}else e.formattedSize="0 Bytes";const s=this.getButton("button_upload","upload","button_upload");s.addEventListener("click",r=>{r.preventDefault(),s.setAttribute("disabled","disabled"),this.theme.removeInputError(this.uploader),this.theme.getProgressBar&&(this.progressBar=this.theme.getProgressBar(),this.preview.appendChild(this.progressBar)),this.options.upload_handler(this.path,e,{success:o=>{this.setValue(o),this.parent?this.parent.onChildEditorChange(this):this.jsoneditor.onChange(),this.progressBar&&this.preview.removeChild(this.progressBar),s.removeAttribute("disabled")},failure:o=>{this.theme.addInputError(this.uploader,o),this.progressBar&&this.preview.removeChild(this.progressBar),s.removeAttribute("disabled")},updateProgress:o=>{this.progressBar&&(o?this.theme.updateProgressBar(this.progressBar,o):this.theme.updateProgressBarUnknown(this.progressBar))}})}),this.preview.appendChild(this.theme.getUploadPreview(e,s,this.preview_value)),this.options.auto_upload&&(s.dispatchEvent(new window.MouseEvent("click")),s.parentNode.removeChild(s))}enable(){this.always_disabled||(this.uploader&&(this.uploader.disabled=!1),super.enable())}disable(t){t&&(this.always_disabled=!0),this.uploader&&(this.uploader.disabled=!0),super.disable()}setValue(t){this.value!==t&&(this.value=t,this.input.value=this.value,this.onChange())}destroy(){this.options.enable_drag_drop===!0&&(["dragover","drop"].forEach(t=>{window.removeEventListener(t,this.dragHandler,!0)}),["dragenter","dragover","dragleave","drop"].forEach(t=>{this.dropZone.removeEventListener(t,this.dragHandler,!0)}),this.dropZone.removeEventListener("dblclick",this.clickHandler),this.dropZone&&this.dropZone.parentNode&&this.dropZone.parentNode.removeChild(this.dropZone)),this.uploader&&this.uploader.parentNode&&(this.uploader.removeEventListener("change",this.uploadHandler),this.uploader.parentNode.removeChild(this.uploader)),this.browseButton&&this.browseButton.parentNode&&(this.browseButton.removeEventListener("click",this.clickHandler),this.browseButton.parentNode.removeChild(this.browseButton)),this.fileDisplay&&this.fileDisplay.parentNode&&(this.fileDisplay.removeEventListener("dblclick",this.clickHandler),this.fileDisplay.parentNode.removeChild(this.fileDisplay)),this.fileUploadGroup&&this.fileUploadGroup.parentNode&&this.fileUploadGroup.parentNode.removeChild(this.fileUploadGroup),this.preview&&this.preview.parentNode&&this.preview.parentNode.removeChild(this.preview),this.header&&this.header.parentNode&&this.header.parentNode.removeChild(this.header),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),super.destroy()}isValidMimeType(t,e){return e.reduce((i,s)=>i||new RegExp(s.replace(/\*/g,".*"),"gi").test(t),!1)}}class Vh extends Yt{preBuild(){super.preBuild(),this.schema.default=this.uuid=this.getUuid(),this.schema.options||(this.schema.options={}),this.schema.options.cleave||(this.schema.options.cleave={delimiters:["-"],blocks:[8,4,4,4,12]})}build(){super.build(),this.disable(!0),this.input.setAttribute("readonly","true")}sanitize(t){return this.testUuid(t)||(t=this.uuid),t}setValue(t,e,i){this.testUuid(t)||(t=this.uuid),this.uuid=t,super.setValue(t,e,i)}getUuid(){return Ei()}testUuid(t){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}}class Fh extends Yt{postBuild(){window.Picker&&(this.input.type="text"),this.input.style.padding="3px"}setValue(t,e,i){const s=super.setValue(t,e,i);return this.picker_instance&&this.picker_instance.domElement&&s&&s.changed&&this.picker_instance.setColor(s.value,!0),s}getNumColumns(){return 2}afterInputReady(){super.afterInputReady(),this.createPicker(!0)}disable(){if(super.disable(),this.picker_instance&&this.picker_instance.domElement){this.picker_instance.domElement.style.pointerEvents="none";const t=this.picker_instance.domElement.querySelectorAll("button");for(let e=0;e<t.length;e++)t[e].disabled=!0}}enable(){if(super.enable(),this.picker_instance&&this.picker_instance.domElement){this.picker_instance.domElement.style.pointerEvents="auto";const t=this.picker_instance.domElement.querySelectorAll("button");for(let e=0;e<t.length;e++)t[e].disabled=!1}}destroy(){this.createPicker(!1),super.destroy()}createPicker(t){if(t){if(window.Picker&&!this.picker_instance){const e=this.expandCallbacks("colorpicker",$({},{editor:!1,alpha:!1,color:this.value,popup:"bottom"},this.defaults.options.colorpicker||{},this.options.colorpicker||{},{parent:this.container})),i=s=>{const r=this.picker_instance.settings.editorFormat,o=this.picker_instance.settings.alpha;this.setValue(r==="hex"?o?s.hex:s.hex.slice(0,7):s[`${r+(o?"a":"")}String`])};!e.popup&&typeof e.onChange!="function"?e.onChange=i:e.popup&&typeof e.onDone!="function"&&(e.onDone=i),this.picker_instance=new window.Picker(e),e.popup||(this.input.style.display="none",this.theme.afterInputReady(this.picker_instance.domElement))}}else this.picker_instance&&(this.picker_instance.destroy(),this.picker_instance=null,this.input.style.display="")}}const es={ace:lh,array:xr,arrayChoices:hh,arraySelect2:ch,arraySelectize:uh,autocomplete:ph,base64:fh,button:fo,checkbox:mh,choices:mo,datetime:bh,describedBy:yh,enum:_h,hidden:vh,info:wh,integer:bo,ip:xh,jodit:Ch,multiple:Sh,multiselect:ts,null:Th,number:go,object:_o,radio:$h,sceditor:Ph,select:Li,select2:Oh,selectize:Ih,signature:Bh,simplemde:Rh,starrating:vo,stepper:Nh,string:Yt,table:Mh,upload:Hh,uuid:Vh,colorpicker:Fh},zh="html",Uh="default",qh={},Gh={},Zh={},Wh={},wo={},Yh=[],Cr="en",Xh=Cr;wo.en={error_notset:"Property must be set",error_notempty:"Value required",error_enum:"Value must be one of the enumerated values",error_const:"Value must be the constant value",error_anyOf:"Value must validate against at least one of the provided schemas",error_oneOf:"Value must validate against exactly one of the provided schemas. It currently validates against {{0}} of the schemas.",error_not:"Value must not validate against the provided schema",error_type_union:"Value must be one of the provided types",error_type:"Value must be of type {{0}}",error_disallow_union:"Value must not be one of the provided disallowed types",error_disallow:"Value must not be of type {{0}}",error_multipleOf:"Value must be a multiple of {{0}}",error_maximum_excl:"Value must be less than {{0}}",error_maximum_incl:"Value must be at most {{0}}",error_minimum_excl:"Value must be greater than {{0}}",error_minimum_incl:"Value must be at least {{0}}",error_maxLength:"Value must be at most {{0}} characters long",error_contains:"No items match contains",error_minContains:"Contains match count {{0}} is less than minimum contains count of {{1}}",error_maxContains:"Contains match count {{0}} exceeds maximum contains count of {{1}}",error_minLength:"Value must be at least {{0}} characters long",error_pattern:"Value must match the pattern {{0}}",error_additionalItems:"No additional items allowed in this array",error_maxItems:"Value must have at most {{0}} items",error_minItems:"Value must have at least {{0}} items",error_uniqueItems:"Array must have unique items",error_maxProperties:"Object must have at most {{0}} properties",error_minProperties:"Object must have at least {{0}} properties",error_required:"Object is missing the required property '{{0}}'",error_additional_properties:"No additional properties allowed, but property {{0}} is set",error_property_names_exceeds_maxlength:"Property name {{0}} exceeds maxLength",error_property_names_enum_mismatch:"Property name {{0}} does not match any enum values",error_property_names_const_mismatch:"Property name {{0}} does not match the const value",error_property_names_pattern_mismatch:"Property name {{0}} does not match pattern",error_property_names_false:"Property name {{0}} fails when propertyName is false",error_property_names_maxlength:"Property name {{0}} cannot match invalid maxLength",error_property_names_enum:"Property name {{0}} cannot match invalid enum",error_property_names_pattern:"Property name {{0}} cannot match invalid pattern",error_property_names_unsupported:"Unsupported propertyName {{0}}",error_dependency:"Must have property {{0}}",error_date:"Date must be in the format {{0}}",error_time:"Time must be in the format {{0}}",error_datetime_local:"Datetime must be in the format {{0}}",error_invalid_epoch:"Date must be greater than 1 January 1970",error_ipv4:"Value must be a valid IPv4 address in the form of 4 numbers between 0 and 255, separated by dots",error_ipv6:"Value must be a valid IPv6 address",error_hostname:"The hostname has the wrong format",upload_max_size:"Filesize too large. Max size is ",upload_wrong_file_format:"Wrong file format. Allowed format(s): ",button_save:"Save",button_copy:"Copy",button_cancel:"Cancel",button_add:"Add",button_delete_all:"All",button_delete_all_title:"Delete All",button_delete_last:"Last {{0}}",button_delete_last_title:"Delete Last {{0}}",button_add_row_title:"Add {{0}}",button_move_down_title:"Move down",button_move_up_title:"Move up",button_properties:"Properties",button_object_properties:"Object Properties",button_copy_row_title:"Copy {{0}}",button_delete_row_title:"Delete {{0}}",button_delete_row_title_short:"Delete",button_copy_row_title_short:"Copy",button_collapse:"Collapse",button_expand:"Expand",button_edit_json:"Edit JSON",button_upload:"Upload",flatpickr_toggle_button:"Toggle",flatpickr_clear_button:"Clear",choices_placeholder_text:"Start typing to add value",default_array_item_title:"item",button_delete_node_warning:"Are you sure you want to remove this item?",table_controls:"Controls"},Object.entries(es).forEach(([n,t])=>{es[n].options=t.options||{}});function Jh(n,t,e){console.log("Upload handler required for upload editor")}function Qh(n,t,e){let i={};e&&e.options&&e.options.error_messages&&e.options.error_messages[Ie.language]&&(i=e.options.error_messages[Ie.language]);const s=Ie.languages[Ie.language];if(!s)throw new Error(`Unknown language ${Ie.language}`);let r=i[n]||s[n]||Ie.languages[Cr][n]||n;if(t)for(let o=0;o<t.length;o++)r=r.replace(new RegExp(`\\{\\{${o}}}`,"g"),t[o]);return r}function Kh(n,t){return n}const Ie={options:{upload:Jh,use_name_attributes:!0,prompt_before_delete:!0,use_default_values:!0,max_depth:0,button_state_mode:1,case_sensitive_property_search:!0,show_errors:"interaction"},theme:zh,template:Uh,themes:Gh,callbacks:qh,templates:Zh,iconlibs:Wh,editors:es,languages:wo,resolvers:ih,custom_validators:Yh,default_language:Cr,language:Xh,translate:Qh,translateProperty:Kh};class tc{constructor(t){this.options=t||{},this.schema={},this.refs=this.options.refs||{},this.refs_with_info={},this.refs_prefix="#/counter/",this.refs_counter=1,this._subSchema1={type(e){typeof e.type=="object"&&(e.type=this._expandSubSchema(e.type))},disallow(e){typeof e.disallow=="object"&&(e.disallow=this._expandSubSchema(e.disallow))},anyOf(e){Object.entries(e.anyOf).forEach(([i,s])=>{e.anyOf[i]=this.expandSchema(s)})},dependencies(e){Object.entries(e.dependencies).forEach(([i,s])=>{typeof s=="object"&&!Array.isArray(s)&&(e.dependencies[i]=this.expandSchema(s))})},not(e){e.not=this.expandSchema(e.not)}},this._subSchema2={allOf(e,i){let s=$({},i);return Object.entries(e.allOf).forEach(([r,o])=>{e.allOf[r]=this.expandRefs(o,!0),s=this.extendSchemas(s,this.expandSchema(o))}),delete s.allOf,s},extends(e,i){let s;return Array.isArray(e.extends)?s=e.extends.reduce((r,o,a)=>this.extendSchemas(r,this.expandSchema(o)),i):s=this.extendSchemas(i,this.expandSchema(e.extends)),delete s.extends,s},oneOf(e,i){const s=$({},i);return delete s.oneOf,e.oneOf.reduce((r,o,a)=>(r.oneOf[a]=this.extendSchemas(this.expandSchema(o),s),r),i),i}}}async load(t,e,i){return this.schema=t,await this._asyncloadExternalRefs(t,e,this._getFileBase(i),!0),this.expandRefs(t)}expandRefs(t,e){const i=$({},t);if(!i.$ref)return i;const s=i.$ref.split("#");if(s.length===2&&!this.refs_with_info[i.$ref]){const l=this.expandRecursivePointer(this.schema,s[1]),d=this.extendSchemas(i,this.expandSchema(l));return delete d.$ref,d}const r=s.length>2?this.refs_with_info["#"+s[1]]:this.refs_with_info[i.$ref];delete i.$ref;const o=r.$ref.startsWith("#")?r.fetchUrl:"",a=this._getRef(o,r);if(!this.refs[a])console.warn(`reference:'${a}' not found!`);else if(e&&Wt(this.refs[a],"allOf")){const l=this.refs[a].allOf;Object.keys(l).forEach(d=>{l[d]=this.expandRefs(l[d],!0)})}return s.length>2?this.extendSchemas(i,this.expandSchema(this.expandRecursivePointer(this.refs[a],s[2]))):this.extendSchemas(i,this.expandSchema(this.refs[a]))}expandRecursivePointer(t,e){let i=t;return e.split("/").slice(1).forEach(s=>{i[s]&&(i=i[s])}),i.$refs&&i.$refs.startsWith("#")?this.expandRecursivePointer(t,i.$refs):i}expandSchema(t){Object.entries(this._subSchema1).forEach(([i,s])=>{t[i]&&s.call(this,t)});let e=$({},t);return Object.entries(this._subSchema2).forEach(([i,s])=>{t[i]&&(e=s.call(this,t,e))}),this.expandRefs(e)}_getRef(t,e){const i=t+e;return this.refs[i]?i:t+decodeURIComponent(e.$ref)}_expandSubSchema(t){return Array.isArray(t)?t.map(e=>typeof e=="object"?this.expandSchema(e):e):this.expandSchema(t)}_manageRecursivePointer(t,e){Object.keys(t).forEach(i=>{t[i].$ref&&t[i].$ref.indexOf("#")===0&&(t[i].$ref=e+t[i].$ref)})}_getExternalRefs(t,e,i=!1){i||this._manageRecursivePointer(t,e);const s={},r=o=>Object.keys(o).forEach(a=>{s[a]=!0});if(t.$ref&&typeof t.$ref!="object"&&!(t.$ref.indexOf("#")===0&&i)){let o=t.$ref,a="";o.indexOf("#")>0&&(o=o.substr(0,o.indexOf("#"))),o!==t.$ref&&(a=t.$ref.substr(t.$ref.indexOf("#")));const l=this.refs_prefix+this.refs_counter++,d=l+a;t.$ref.substr(0,1)!=="#"&&!this.refs[t.$ref]&&(s[o]=!0),this.refs_with_info[l]={fetchUrl:e,$ref:o},t.$ref=d}return Object.values(t).forEach(o=>{!o||typeof o!="object"||(Array.isArray(o)?Object.values(o).forEach(a=>{a&&typeof a=="object"&&r(this._getExternalRefs(a,e,i))}):(!o.$ref||!(typeof o.$ref=="string"&&o.$ref.startsWith("#")))&&r(this._getExternalRefs(o,e,i)))}),t.id&&typeof t.id=="string"&&t.id.substr(0,4)==="urn:"?this.refs[t.id]=t:t.$id&&typeof t.$id=="string"&&t.$id.substr(0,4)==="urn:"&&(this.refs[t.$id]=t),s}_getFileBase(t){if(!t)return"/";const{ajaxBase:e}=this.options;return typeof e>"u"?this._getFileBaseFromFileLocation(t):e}_getFileBaseFromFileLocation(t){const e=t.split("/");return e.pop(),`${e.join("/")}/`}_joinUrl(t,e){var i=t;return t.substr(0,7)!=="http://"&&t.substr(0,8)!=="https://"&&t.substr(0,5)!=="blob:"&&t.substr(0,5)!=="data:"&&t.substr(0,1)!=="#"&&t.substr(0,1)!=="/"&&(i=e+t),i.indexOf("#")>0&&(i=i.substr(0,i.indexOf("#"))),i}_isUniformResourceName(t){return t.substr(0,4)==="urn:"}async _asyncloadExternalRefs(t,e,i,s=!1){const r=this._getExternalRefs(t,e,s);let o=0;for(const a of Object.keys(r)){if(typeof a>"u"||this.refs[a])continue;if(this._isUniformResourceName(a)){this.refs[a]="loading",o++;const u=this.options.urn_resolver;let g=a;if(typeof u!="function")throw console.log(`No "urn_resolver" callback defined to resolve "${g}"`),new Error(`Must set urn_resolver option to a callback to resolve ${g}`);g.indexOf("#")>0&&(g=g.substr(0,g.indexOf("#")));let m;try{let y;m=await u(g);try{y=JSON.parse(m)}catch(w){throw console.log(w),new Error(`Failed to parse external ref ${g}`)}if(!(typeof y=="boolean"||typeof y=="object")||y===null||Array.isArray(y))throw new Error(`External ref does not contain a valid schema - ${g}`);this.refs[a]=y,await this._asyncloadExternalRefs(y,a,i)}catch(y){throw console.log(y),new Error(`Failed to parse external ref ${g}`)}if(typeof m=="boolean")throw new Error(`External ref does not contain a valid schema - ${g}`);continue}if(!this.options.ajax)throw new Error(`Must set ajax option to true to load external ref ${a}`);o++;let l=this._joinUrl(a,i),d;if(this.options.ajax_cache_responses){const u=this.cacheGet(l);u&&(d=u)}if(!d){const u=await new Promise(g=>{const m=new XMLHttpRequest;this.options.ajaxCredentials&&(m.withCredentials=this.options.ajaxCredentials),m.overrideMimeType("application/json"),m.open("GET",l,!0),m.onload=()=>{g(m)},m.onerror=y=>{g(void 0)},m.send()});if(typeof u>"u")throw new Error(`Failed to fetch ref via ajax - ${a}`);try{d=JSON.parse(u.responseText),this.onSchemaLoaded({schema:d,schemaUrl:l}),this.options.ajax_cache_responses&&this.cacheSet(l,d)}catch(g){throw console.log(g),new Error(`Failed to parse external ref ${l}`)}}if(!(typeof d=="boolean"||typeof d=="object")||d===null||Array.isArray(d))throw new Error(`External ref does not contain a valid schema - ${l}`);this.refs[a]=d;const h=this._getFileBaseFromFileLocation(l);if(l!==a){const u=l.split("/");l=(a.substr(0,1)==="/"?"/":"")+u.pop()}await this._asyncloadExternalRefs(d,l,h)}if(!o)return!0;this.onAllSchemasLoaded()}onSchemaLoaded(t){}onAllSchemasLoaded(){}extendSchemas(t,e){t=$({},t),e=$({},e);const i={},s=(a,l)=>(a==="required"||a==="defaultProperties")&&typeof l=="object"&&Array.isArray(l),r=(a,l)=>{s(a,l)?i[a]=l.concat(e[a]).reduce((d,h)=>(d.includes(h)||d.push(h),d),[]):a==="type"&&(typeof l=="string"||Array.isArray(l))?o(l):typeof l=="object"&&!Array.isArray(l)&&l!==null?i[a]=this.extendSchemas(l,e[a]):i[a]=l},o=a=>{typeof a=="string"&&(a=[a]),typeof e.type=="string"&&(e.type=[e.type]),!e.type||!e.type.length?i.type=a:i.type=a.filter(l=>e.type.includes(l)),i.type.length===1&&typeof i.type[0]=="string"?i.type=i.type[0]:i.type.length===0&&delete i.type};return Object.entries(t).forEach(([a,l])=>{typeof e[a]<"u"?r(a,l):i[a]=l}),Object.entries(e).forEach(([a,l])=>{typeof t[a]>"u"&&(i[a]=l)}),i}getCacheKey(t){return["je-cache",t].join("::")}getCacheBuster(){return this.options.ajax_cache_buster||new Date().toISOString().slice(0,10)}cacheSet(t,e){try{window.localStorage.setItem(this.getCacheKey(t),JSON.stringify({cacheBuster:this.getCacheBuster(),schema:e}))}catch(i){console.error(i)}}cacheGet(t){try{const e=window.localStorage.getItem(this.getCacheKey(t));if(e){const i=JSON.parse(e);if(i.cacheBuster&&i.schema&&i.cacheBuster===this.getCacheBuster())return i.schema;this.cacheDelete(t)}}catch(e){console.error(e)}}cacheDelete(t){window.localStorage.removeItem(this.getCacheKey(t))}}const ec={default:()=>({compile(n){const t=n.match(/{{\s*([a-zA-Z0-9\-_ .]+)\s*}}/g),e=t&&t.length;if(!e)return()=>n;const i=[],s=o=>{let a=t[o].replace(/[{}]+/g,"").trim().split(".");const l=a.length;let d;if(l>1){let h;d=u=>{for(h=u,o=0;o<l&&(h=h[a[o]],!!h);o++);return h}}else a=a[0],d=h=>h[a];i.push({s:t[o],r:d})};for(var r=0;r<e;r++)s(r);return o=>{let a=`${n}`,l;for(r=0;r<e;r++)l=i[r],a=a.replace(l.s,l.r(o));return a}}}),ejs:()=>window.EJS?{compile(n){const t=new window.EJS({text:n});return e=>t.render(e)}}:!1,handlebars:()=>window.Handlebars,hogan:()=>window.Hogan?{compile(n){const t=window.Hogan.compile(n);return e=>t.render(e)}}:!1,lodash:()=>window._?{compile(n){return t=>window._.template(n)(t)}}:!1,markup:()=>!window.Mark||!window.Mark.up?!1:{compile(n){return t=>window.Mark.up(n,t)}},mustache:()=>window.Mustache?{compile(n){return t=>window.Mustache.render(n,t)}}:!1,swig:()=>window.swig,underscore:()=>window._?{compile(n){return t=>window._.template(n)(t)}}:!1},ic={collapse:"",expand:"",delete:"",edit:"",add:"",cancel:"",save:"",moveup:"",movedown:""};class ge{constructor(t="",e=ic){this.mapping=e,this.icon_prefix=t}getIconClass(t){return this.mapping[t]?this.icon_prefix+this.mapping[t]:this.icon_prefix+t}getIcon(t){const e=this.getIconClass(t);if(!e)return null;const i=document.createElement("i");return i.classList.add(...e.split(" ")),i}}const sc="glyphicon glyphicon-",rc={collapse:"chevron-down",expand:"chevron-right",delete:"trash",edit:"pencil",add:"plus",subtract:"minus",cancel:"floppy-remove",save:"floppy-saved",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"copy",clear:"remove-circle",time:"time",calendar:"calendar",edit_properties:"list"};class nc extends ge{constructor(){super(sc,rc)}}const oc="icon-",ac={collapse:"chevron-down",expand:"chevron-right",delete:"trash",edit:"pencil",add:"plus",subtract:"minus",cancel:"ban-circle",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"copy",clear:"remove-circle",time:"time",calendar:"calendar",edit_properties:"list"};class lc extends ge{constructor(){super(oc,ac)}}const dc="fa fa-",hc={collapse:"caret-square-o-down",expand:"caret-square-o-right",delete:"times",edit:"pencil",add:"plus",subtract:"minus",cancel:"ban",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"files-o",clear:"times-circle-o",time:"clock-o",calendar:"calendar",edit_properties:"list"};class cc extends ge{constructor(){super(dc,hc)}}const uc="fas fa-",pc={collapse:"caret-down",expand:"caret-right",delete:"trash",edit:"pen",add:"plus",subtract:"minus",cancel:"ban",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"copy",clear:"times-circle",time:"clock",calendar:"calendar",edit_properties:"list"};class fc extends ge{constructor(){super(uc,pc)}}const mc="ui-icon ui-icon-",gc={collapse:"triangle-1-s",expand:"triangle-1-e",delete:"trash",edit:"pencil",add:"plusthick",subtract:"minusthick",cancel:"closethick",save:"disk",moveup:"arrowthick-1-n",moveright:"arrowthick-1-e",movedown:"arrowthick-1-s",moveleft:"arrowthick-1-w",copy:"copy",clear:"circle-close",time:"time",calendar:"calendar",edit_properties:"note"};class bc extends ge{constructor(){super(mc,gc)}}const yc="oi oi-",_c={collapse:"collapse-down",expand:"expand-right",delete:"trash",edit:"pencil",add:"plus",subtract:"minus",cancel:"ban",save:"file",moveup:"arrow-thick-top",moveright:"arrow-thick-right",movedown:"arrow-thick-bottom",moveleft:"arrow-thick-left",copy:"clipboard",clear:"circle-x",time:"clock",calendar:"calendar",edit_properties:"list"};class vc extends ge{constructor(){super(yc,_c)}}const wc="icon icon-",xc={collapse:"arrow-down",expand:"arrow-right",delete:"delete",edit:"edit",add:"plus",subtract:"minus",cancel:"cross",save:"check",moveup:"upward",moveright:"forward",movedown:"downward",moveleft:"back",copy:"copy",clear:"close",time:"time",calendar:"bookmark",edit_properties:"menu"};class Cc extends ge{constructor(){super(wc,xc)}}const Ec="bi bi-",Lc={collapse:"chevron-down",expand:"chevron-right",delete:"trash",edit:"pencil",add:"plus",subtract:"dash",cancel:"x-circle",save:"save",moveup:"arrow-up",moveright:"arrow-right",movedown:"arrow-down",moveleft:"arrow-left",copy:"clipboard",clear:"x-circle",time:"clock",calendar:"calendar",edit_properties:"list-ul"};class Ac extends ge{constructor(){super(Ec,Lc)}}const kc={bootstrap:Ac,bootstrap3:nc,fontawesome3:lc,fontawesome4:cc,fontawesome5:fc,jqueryui:bc,openiconic:vc,spectre:Cc},xo=["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"].find(n=>n in document.documentElement);class be{constructor(t,e={disable_theme_rules:!1}){this.jsoneditor=t,Object.keys(e).forEach(i=>{typeof t.options[i]<"u"&&(e[i]=t.options[i])}),this.options=e}getContainer(){return document.createElement("div")}getFloatRightLinkHolder(){const t=document.createElement("div");return t.classList.add("je-float-right-linkholder"),t}getModal(){const t=document.createElement("div");return t.style.display="none",t.classList.add("je-modal"),t}getGridContainer(){return document.createElement("div")}getGridRow(){const t=document.createElement("div");return t.classList.add("row"),t}getGridColumn(){return document.createElement("div")}setGridColumnSize(t,e){}getLink(t){const e=document.createElement("a");return e.setAttribute("href","#"),e.appendChild(document.createTextNode(t)),e}disableHeader(t){t.style.color="#ccc"}disableLabel(t){t.style.color="#ccc"}enableHeader(t){t.style.color=""}enableLabel(t){t.style.color=""}getInfoButton(t){const e=document.createElement("span");e.innerText="ⓘ",e.classList.add("je-infobutton-icon");const i=document.createElement("span");return i.classList.add("je-infobutton-tooltip"),i.innerText=t,e.onmouseover=()=>{i.style.visibility="visible"},e.onmouseleave=()=>{i.style.visibility="hidden"},e.appendChild(i),e}getFormInputLabel(t,e){const i=document.createElement("label");return i.appendChild(document.createTextNode(t)),e&&i.classList.add("required"),i}getLabelLike(t,e){const i=document.createElement("b");return i.appendChild(document.createTextNode(t)),e&&i.classList.add("required"),i}getHeader(t,e){const i=document.createElement("span");return typeof t=="string"?i.textContent=t:i.appendChild(t),i.classList.add("je-header"),i}getCheckbox(){const t=this.getFormInputField("checkbox");return t.classList.add("je-checkbox"),t}getCheckboxLabel(t,e){const i=document.createElement("label");return i.appendChild(document.createTextNode(` ${t}`)),e&&i.classList.add("required"),i}getMultiCheckboxHolder(t,e,i,s){const r=document.createElement("div");return r.classList.add("control-group"),e&&(e.style.display="block",r.appendChild(e),s&&e.appendChild(s)),Object.values(t).forEach(o=>{o.style.display="inline-block",o.style.marginRight="20px",r.appendChild(o)}),i&&r.appendChild(i),r}getFormCheckboxControl(t,e,i){const s=document.createElement("div");return s.appendChild(t),e.style.width="auto",t.insertBefore(e,t.firstChild),i&&s.classList.add("je-checkbox-control--compact"),s}getFormRadio(t){const e=this.getFormInputField("radio");return Object.keys(t).forEach(i=>e.setAttribute(i,t[i])),e.classList.add("je-radio"),e}getFormRadioLabel(t,e){const i=document.createElement("label");return i.appendChild(document.createTextNode(` ${t}`)),e&&i.classList.add("required"),i}getFormRadioControl(t,e,i,s){const r=document.createElement("div");return r.appendChild(t),e.style.width="auto",t.insertBefore(e,t.firstChild),i&&r.classList.add("je-radio-control--compact"),e.tagName.toLowerCase()!=="div"&&s&&t&&e&&(e.setAttribute("id",s),e.setAttribute("aria-labelledby",s),t.setAttribute("for",s)),r}getSelectInput(t,e){const i=document.createElement("select");return t&&this.setSelectOptions(i,t),i}getSwitcher(t){const e=this.getSelectInput(t,!1);return e.classList.add("je-switcher"),e}getSwitcherOptions(t){return t.getElementsByTagName("option")}setSwitcherOptions(t,e,i){this.setSelectOptions(t,e,i)}setSelectOptions(t,e,i=[]){t.innerHTML="";for(let s=0;s<e.length;s++){const r=document.createElement("option");r.setAttribute("value",e[s]),r.textContent=i[s]||e[s],t.appendChild(r)}}getTextareaInput(){const t=document.createElement("textarea");return t.classList.add("je-textarea"),t}getHiddenLabel(t){const e=document.createElement("label");return e.textContent=t,e.setAttribute("style","position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0,0,0,0);border: 0;"),e}visuallyHidden(t){t&&t.setAttribute("style","position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0,0,0,0);border: 0;")}getHiddenText(t){const e=document.createElement("span");return e.textContent=t,e.setAttribute("style","position: absolute;width: 1px;height: 1px;padding: 0;margin: -1px;overflow: hidden;clip: rect(0,0,0,0);border: 0;"),e}getRangeInput(t,e,i,s,r){const o=this.getFormInputField("range");return o.setAttribute("min",t),o.setAttribute("max",e),o.setAttribute("step",i),s&&(s.setAttribute("id",r+"-description"),o.setAttribute("aria-describedby",r+"-description")),o}getStepperButtons(t){const e=document.createElement("div"),i=document.createElement("button");i.setAttribute("type","button"),i.classList.add("stepper-down");const s=document.createElement("button");s.setAttribute("type","button"),s.classList.add("stepper-up"),t.getAttribute("readonly")&&(i.setAttribute("disabled",!0),s.setAttribute("disabled",!0)),i.textContent="-",s.textContent="+";const o=(d,h)=>{h?d.value=Number(h):d.value=Number(d.value),d.setAttribute("initialized","1")},a=t.getAttribute("min"),l=t.getAttribute("max");return i.addEventListener("click",()=>{t.getAttribute("initialized")?a?Number(t.value)>Number(a)&&t.stepDown():t.stepDown():o(t,a),re(t,"change")}),s.addEventListener("click",()=>{t.getAttribute("initialized")?l?Number(t.value)<Number(l)&&t.stepUp():t.stepUp():o(t,a),re(t,"change")}),e.appendChild(i),e.appendChild(s),e}getRangeOutput(t){const e=document.createElement("output"),i=s=>{e.value=s.currentTarget.value};return t.addEventListener("change",i,!1),t.addEventListener("input",i,!1),e}getRangeControl(t,e){const i=document.createElement("div");return i.classList.add("je-range-control"),e&&i.appendChild(e),i.appendChild(t),i}getFormInputField(t){const e=document.createElement("input");return e.setAttribute("type",t),e}afterInputReady(t){}getFormControl(t,e,i,s,r){const o=document.createElement("div");return o.classList.add("form-control"),t&&(o.appendChild(t),r&&t.setAttribute("for",r)),(e.type==="checkbox"||e.type==="radio")&&t?(e.style.width="auto",t.insertBefore(e,t.firstChild),s&&t.appendChild(s)):(s&&t&&t.appendChild(s),o.appendChild(e)),e.tagName.toLowerCase()!=="div"&&e&&t&&r&&(t.setAttribute("for",r),e.setAttribute("id",r)),e.tagName.toLowerCase()!=="div"&&e&&i&&(i.setAttribute("id",r+"-description"),e.setAttribute("aria-describedby",r+"-description")),i&&o.appendChild(i),o}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("je-indented-panel"),t}getTopIndentedPanel(){const t=document.createElement("div");return t.classList.add("je-indented-panel--top"),t}getChildEditorHolder(){return document.createElement("div")}getDescription(t){const e=document.createElement("p");return window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getCheckboxDescription(t){return this.getDescription(t)}getFormInputDescription(t){return this.getDescription(t)}getButtonHolder(){return document.createElement("span")}getHeaderButtonHolder(){return this.getButtonHolder()}getFormButtonHolder(t){return this.getButtonHolder()}getButton(t,e,i){const s=document.createElement("button");return s.type="button",this.setButtonText(s,t,e,i),s}getFormButton(t,e,i){return this.getButton(t,e,i)}setButtonText(t,e,i,s){for(;t.firstChild;)t.removeChild(t.firstChild);if(i&&(t.appendChild(i),e=` ${e}`),!this.jsoneditor.options.iconlib||!this.jsoneditor.options.remove_button_labels||!i){const r=document.createElement("span");r.appendChild(document.createTextNode(e)),t.appendChild(r)}s&&t.setAttribute("title",s)}getTableContainer(){return document.createElement("div")}getTable(){return document.createElement("table")}getTableRow(){return document.createElement("tr")}getTableHead(){return document.createElement("thead")}getTableBody(){return document.createElement("tbody")}getTableHeaderCell(t){const e=document.createElement("th");return e.textContent=t,e}getTableCell(){return document.createElement("td")}getErrorMessage(t){const e=document.createElement("p");return e.style=e.style||{},e.style.color="red",e.appendChild(document.createTextNode(t)),e}addInputError(t,e){t.errmsg.setAttribute("role","alert")}removeInputError(t){}addTableRowError(t){}removeTableRowError(t){}getTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<div class='je-tabholder tabs'></div><div class='content' id='${e}'></div><div class='je-tabholder--clear'></div>`,i}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<div class='tabs je-tabholder--top'></div><div class='je-tabholder--clear'></div><div class='content' id='${e}'></div>`,i}applyStyles(t,e){Object.keys(e).forEach(i=>t.style[i]=e[i])}closest(t,e){for(;t&&t!==document;)if(t[xo]){if(t[xo](e))return t;t=t.parentNode}else return!1;return!1}insertBasicTopTab(t,e){e.firstChild.insertBefore(t,e.firstChild.firstChild)}getTab(t,e){const i=document.createElement("div");return i.appendChild(t),i.id=e,i.classList.add("je-tab"),i}getTopTab(t,e){const i=document.createElement("div");return i.appendChild(t),i.id=e,i.classList.add("je-tab--top"),i}getTabContentHolder(t){return t.children[1]}getTopTabContentHolder(t){return t.children[1]}getTabContent(){return this.getIndentedPanel()}getTopTabContent(){return this.getTopIndentedPanel()}markTabActive(t){this.applyStyles(t.tab,{opacity:1,background:"white"}),typeof t.rowPane<"u"?t.rowPane.style.display="":t.container.style.display=""}markTabInactive(t){this.applyStyles(t.tab,{opacity:.5,background:""}),typeof t.rowPane<"u"?t.rowPane.style.display="none":t.container.style.display="none"}addTab(t,e){t.children[0].appendChild(e)}addTopTab(t,e){t.children[0].appendChild(e)}getBlockLink(){const t=document.createElement("a");return t.classList.add("je-block-link"),t}getBlockLinkHolder(){return document.createElement("div")}getLinksHolder(){return document.createElement("div")}createMediaLink(t,e,i){t.appendChild(e),i.classList.add("je-media"),t.appendChild(i)}createImageLink(t,e,i){t.appendChild(e),e.appendChild(i)}getFirstTab(t){return t.firstChild.firstChild}getInputGroup(t,e){}cleanText(t){const e=document.createElement("div");return e.innerHTML=t,e.textContent||e.innerText}getDropZone(t){const e=document.createElement("div");return e.setAttribute("data-text",t),e.classList.add("je-dropzone"),e}getUploadPreview(t,e,i){const s=document.createElement("div");if(s.classList.add("je-upload-preview"),t.mimeType.substr(0,5)==="image"){const a=document.createElement("img");a.src=i,s.appendChild(a)}const r=document.createElement("div");r.innerHTML+=`<strong>Name:</strong> ${t.name}<br><strong>Type:</strong> ${t.type}<br><strong>Size:</strong> ${t.formattedSize}`,s.appendChild(r),s.appendChild(e);const o=document.createElement("div");return o.style.clear="left",s.appendChild(o),s}getProgressBar(){const i=document.createElement("progress");return i.setAttribute("max",100),i.setAttribute("value",0),i}updateProgressBar(t,e){t&&t.setAttribute("value",e)}updateProgressBarUnknown(t){t&&t.removeAttribute("value")}}const Sc={".je-form-input-label":"display:block;margin-bottom:3px;font-weight:bold",".je-form-input-description":"display:inline-block;margin:0;font-size:0.8em;font-style:italic",".je-indented-panel":"padding:5px;margin:10px;border-radius:3px;border:1px%20solid%20%23ddd",".je-child-editor-holder":"margin-bottom:8px",".je-header-button-holder":"display:inline-block;margin-left:10px;font-size:0.8em;vertical-align:middle",".je-table":"margin-bottom:5px;border-bottom:1px%20solid%20%23ccc",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"};class Co extends be{getFormInputLabel(t,e){const i=super.getFormInputLabel(t,e);return i.classList.add("je-form-input-label"),i}getFormInputDescription(t){const e=super.getFormInputDescription(t);return e.classList.add("je-form-input-label"),e}getIndentedPanel(){const t=super.getIndentedPanel();return t.classList.add("je-indented-panel"),t}getTopIndentedPanel(){return this.getIndentedPanel()}getChildEditorHolder(){const t=super.getChildEditorHolder();return t.classList.add("je-child-editor-holder"),t}getHeaderButtonHolder(){const t=this.getButtonHolder();return t.classList.add("je-header-button-holder"),t}getTable(){const t=super.getTable();return t.classList.add("je-table"),t}addInputError(t,e){const i=this.closest(t,".form-control")||t.controlgroup;t.errmsg?t.errmsg.style.display="block":(t.errmsg=document.createElement("div"),t.errmsg.setAttribute("class","errmsg"),t.errmsg.style=t.errmsg.style||{},t.errmsg.style.color="red",i.appendChild(t.errmsg)),t.errmsg.innerHTML="",t.errmsg.appendChild(document.createTextNode(e)),t.errmsg.setAttribute("role","alert")}removeInputError(t){t.style&&(t.style.borderColor=""),t.errmsg&&(t.errmsg.style.display="none")}}Co.rules=Sc;const Tc={};class Eo extends be{getSelectInput(t,e){const i=super.getSelectInput(t);return i.classList.add("form-control"),i}setGridColumnSize(t,e,i){t.classList.add(`col-md-${e}`),i&&t.classList.add(`col-md-offset-${i}`)}afterInputReady(t){t.controlgroup||(t.controlgroup=this.closest(t,".form-group"),this.closest(t,".compact")&&(t.controlgroup.style.marginBottom=0))}getTextareaInput(){const t=document.createElement("textarea");return t.classList.add("form-control"),t}getRangeInput(t,e,i,s,r){return super.getRangeInput(t,e,i,s,r)}getFormInputField(t){const e=super.getFormInputField(t);return t!=="checkbox"&&t!=="radio"&&e.classList.add("form-control"),e}getHiddenLabel(t){const e=document.createElement("label");return e.textContent=t,e.classList.add("sr-only"),e}visuallyHidden(t){t&&t.classList.add("sr-only")}getHiddenText(t){const e=document.createElement("span");return e.textContent=t,e.classList.add("sr-only"),e}getFormControl(t,e,i,s,r){const o=document.createElement("div");return t&&(e.type==="checkbox"||e.type==="radio")?(o.classList.add(e.type),s&&t.appendChild(s),t.insertBefore(e,t.firstChild),o.appendChild(t)):(o.classList.add("form-group"),t&&(t.classList.add("control-label"),o.appendChild(t),s&&t.appendChild(s)),o.appendChild(e)),i&&o.appendChild(i),e.tagName.toLowerCase()!=="div"&&e&&t&&r&&(t.setAttribute("for",r),e.setAttribute("id",r)),e.tagName.toLowerCase()!=="div"&&e&&i&&(i.setAttribute("id",r+"-description"),e.setAttribute("aria-describedby",r+"-description")),o}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("well","well-sm"),t.style.paddingBottom=0,t}getInfoButton(t){const e=document.createElement("span");e.classList.add("glyphicon","glyphicon-info-sign","pull-right"),e.style.padding=".25rem",e.style.position="relative",e.style.display="inline-block";const i=document.createElement("span");return i.style["font-family"]="sans-serif",i.style.visibility="hidden",i.style["background-color"]="rgba(50, 50, 50, .75)",i.style.margin="0 .25rem",i.style.color="#FAFAFA",i.style.padding=".5rem 1rem",i.style["border-radius"]=".25rem",i.style.width="25rem",i.style.position="absolute",i.innerText=t,e.onmouseover=()=>{i.style.visibility="visible"},e.onmouseleave=()=>{i.style.visibility="hidden"},e.appendChild(i),e}getFormInputDescription(t){const e=document.createElement("p");return e.classList.add("help-block"),window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getHeader(t,e){const i=document.createElement("span");return i.classList.add("h3"),typeof t=="string"?i.textContent=t:i.appendChild(t),i}getHeaderButtonHolder(){const t=this.getButtonHolder();return t.style.marginLeft="10px",t}getButtonHolder(){const t=document.createElement("span");return t.classList.add("btn-group"),t}getButton(t,e,i){const s=super.getButton(t,e,i);return s.classList.add("btn","btn-default"),s}getTableContainer(){const t=super.getTableContainer();return t.classList.add("table-responsive"),t}getTable(){const t=document.createElement("table");return t.classList.add("table","table-bordered"),t.style.width="auto",t.style.maxWidth="none",t}addInputError(t,e){t.controlgroup&&(t.controlgroup.classList.add("has-error"),t.errmsg?t.errmsg.style.display="":(t.errmsg=document.createElement("p"),t.errmsg.classList.add("help-block","errormsg"),t.controlgroup.appendChild(t.errmsg)),t.errmsg.textContent=e,t.errmsg.setAttribute("role","alert"))}removeInputError(t){t.errmsg&&(t.errmsg.style.display="none",t.controlgroup.classList.remove("has-error"))}getTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<ul class='col-md-2 nav nav-pills nav-stacked' id='${e}' role='tablist'></ul><div class='col-md-10 tab-content active well well-small' id='${e}'></div>`,i}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<ul class='nav nav-tabs' id='${e}' role='tablist'></ul><div class='tab-content active well well-small' id='${e}'></div>`,i}getTab(t,e){const i=document.createElement("li");i.setAttribute("role","presentation");const s=document.createElement("a");return s.setAttribute("href",`#${e}`),s.appendChild(t),s.setAttribute("aria-controls",e),s.setAttribute("role","tab"),s.setAttribute("data-toggle","tab"),i.appendChild(s),i}getTopTab(t,e){const i=document.createElement("li");i.setAttribute("role","presentation");const s=document.createElement("a");return s.setAttribute("href",`#${e}`),s.appendChild(t),s.setAttribute("aria-controls",e),s.setAttribute("role","tab"),s.setAttribute("data-toggle","tab"),i.appendChild(s),i}getTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}getTopTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}markTabActive(t){t.tab.classList.add("active"),typeof t.rowPane<"u"?t.rowPane.classList.add("active"):t.container.classList.add("active")}markTabInactive(t){t.tab.classList.remove("active"),typeof t.rowPane<"u"?t.rowPane.classList.remove("active"):t.container.classList.remove("active")}getProgressBar(){const s=document.createElement("div");s.classList.add("progress");const r=document.createElement("div");return r.classList.add("progress-bar"),r.setAttribute("role","progressbar"),r.setAttribute("aria-valuenow",0),r.setAttribute("aria-valuemin",0),r.setAttribute("aria-valuenax",100),r.innerHTML="0%",s.appendChild(r),s}updateProgressBar(t,e){if(!t)return;const i=t.firstChild,s=`${e}%`;i.setAttribute("aria-valuenow",e),i.style.width=s,i.innerHTML=s}updateProgressBarUnknown(t){if(!t)return;const e=t.firstChild;t.classList.add("progress","progress-striped","active"),e.removeAttribute("aria-valuenow"),e.style.width="100%",e.innerHTML=""}getInputGroup(t,e){if(!t)return;const i=document.createElement("div");i.classList.add("input-group"),i.appendChild(t);const s=document.createElement("div");s.classList.add("input-group-btn"),i.appendChild(s);for(let r=0;r<e.length;r++)s.appendChild(e[r]);return i}}Eo.rules=Tc;const jc={".jsoneditor-twbs4-text-button":"background:none;padding:0;border:0;color:currentColor","td > .form-group":"margin-bottom:0",".json-editor-btn-upload":"margin-top:1rem",".je-noindent .card":"padding:0;border:0",".je-tooltip:hover::before":"display:block;position:absolute;font-size:0.8em;color:%23fff;border-radius:0.2em;content:attr(title);background-color:%23000;margin-top:-2.5em;padding:0.3em",".je-tooltip:hover::after":"display:block;position:absolute;font-size:0.8em;color:%23fff",".select2-container--default .select2-selection--single":"height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".select2-container--default .select2-selection--single .select2-selection__arrow":"height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".select2-container--default .select2-selection--single .select2-selection__rendered":"line-height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".selectize-control.form-control":"padding:0",".selectize-dropdown.form-control":"padding:0;height:auto",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"},$c={disable_theme_rules:!1,input_size:"normal",custom_forms:!1,object_indent:!0,object_background:"bg-light",object_text:"",table_border:!1,table_zebrastyle:!1,tooltip:"bootstrap"};class Lo extends be{constructor(t){super(t,$c)}getSelectInput(t,e){const i=super.getSelectInput(t);return i.classList.add("form-control"),this.options.custom_forms===!1?(this.options.input_size==="small"&&i.classList.add("form-control-sm"),this.options.input_size==="large"&&i.classList.add("form-control-lg")):(i.classList.remove("form-control"),i.classList.add("custom-select"),this.options.input_size==="small"&&i.classList.add("custom-select-sm"),this.options.input_size==="large"&&i.classList.add("custom-select-lg")),i}getContainer(){const t=document.createElement("div");return this.options.object_indent||t.classList.add("je-noindent"),t}setGridColumnSize(t,e,i){t.classList.add(`col-md-${e}`),i&&t.classList.add(`offset-md-${i}`)}afterInputReady(t){if(t.controlgroup)return;const e=t.name;t.id=e;const i=t.parentNode.parentNode.getElementsByTagName("label")[0];i&&(i.htmlFor=e),t.controlgroup=this.closest(t,".form-group")}getTextareaInput(){const t=document.createElement("textarea");return t.classList.add("form-control"),this.options.input_size==="small"&&t.classList.add("form-control-sm"),this.options.input_size==="large"&&t.classList.add("form-control-lg"),t}getRangeInput(t,e,i,s,r){const o=super.getRangeInput(t,e,i,s,r);return this.options.custom_forms===!0&&(o.classList.remove("form-control"),o.classList.add("custom-range")),o}getStepperButtons(t){const e=document.createElement("div"),i=document.createElement("div"),s=document.createElement("div"),r=document.createElement("button");r.setAttribute("type","button");const o=document.createElement("button");o.setAttribute("type","button"),e.appendChild(i),e.appendChild(t),e.appendChild(s),i.appendChild(r),s.appendChild(o),e.classList.add("input-group"),i.classList.add("input-group-prepend"),s.classList.add("input-group-append"),r.classList.add("btn"),r.classList.add("btn-secondary"),r.classList.add("stepper-down"),o.classList.add("btn"),o.classList.add("btn-secondary"),o.classList.add("stepper-up"),t.getAttribute("readonly")&&(r.setAttribute("disabled",!0),o.setAttribute("disabled",!0)),r.textContent="-",o.textContent="+";const l=(u,g)=>{g?u.value=Number(g):u.value=Number(u.value),u.setAttribute("initialized","1")},d=t.getAttribute("min"),h=t.getAttribute("max");return t.addEventListener("change",()=>{t.getAttribute("initialized")||t.setAttribute("initialized","1")}),r.addEventListener("click",()=>{t.getAttribute("initialized")?d?Number(t.value)>Number(d)&&t.stepDown():t.stepDown():l(t,d),re(t,"change")}),o.addEventListener("click",()=>{t.getAttribute("initialized")?h?Number(t.value)<Number(h)&&t.stepUp():t.stepUp():l(t,d),re(t,"change")}),e}getFormInputField(t){const e=super.getFormInputField(t);return t!=="checkbox"&&t!=="radio"&&t!=="file"&&(e.classList.add("form-control"),this.options.input_size==="small"&&e.classList.add("form-control-sm"),this.options.input_size==="large"&&e.classList.add("form-control-lg")),t==="file"&&e.classList.add("form-control-file"),e}getHiddenLabel(t){const e=document.createElement("label");return e.textContent=t,e.classList.add("sr-only"),e}visuallyHidden(t){t&&t.classList.add("sr-only")}getHiddenText(t){const e=document.createElement("span");return e.textContent=t,e.classList.add("sr-only"),e}getFormControl(t,e,i,s,r){const o=document.createElement("div");if(o.classList.add("form-group"),t&&(e.type==="checkbox"||e.type==="radio")){const a=document.createElement("div");this.options.custom_forms===!1?(a.classList.add("form-check"),e.classList.add("form-check-input"),t.classList.add("form-check-label")):(a.classList.add("custom-control"),e.classList.add("custom-control-input"),t.classList.add("custom-control-label"),e.type==="checkbox"?a.classList.add("custom-checkbox"):a.classList.add("custom-radio")),a.appendChild(e),a.appendChild(t),s&&a.appendChild(s),o.appendChild(a)}else t&&(o.appendChild(t),s&&o.appendChild(s)),o.appendChild(e);return i&&o.appendChild(i),e.tagName.toLowerCase()!=="div"&&e&&t&&r&&(t.setAttribute("for",r),e.setAttribute("id",r)),e.tagName.toLowerCase()!=="div"&&e&&i&&(i.setAttribute("id",r+"-description"),e.setAttribute("aria-describedby",r+"-description")),o}getInfoButton(t){const e=document.createElement("button");e.type="button",e.classList.add("ml-3","jsoneditor-twbs4-text-button"),e.setAttribute("data-toggle","tooltip"),e.setAttribute("data-placement","auto"),e.title=t;const i=document.createTextNode("ⓘ");return e.appendChild(i),this.options.tooltip==="bootstrap"?window.jQuery&&window.jQuery().tooltip?window.jQuery(e).tooltip():console.warn("Could not find popper jQuery plugin of Bootstrap."):this.options.tooltip==="css"&&e.classList.add("je-tooltip"),e}getCheckbox(){return this.getFormInputField("checkbox")}getMultiCheckboxHolder(t,e,i,s){const r=document.createElement("div");r.classList.add("form-group"),e&&(r.appendChild(e),s&&e.appendChild(s));const o=document.createElement("div");return Object.values(t).forEach(a=>{const l=a.firstChild;o.appendChild(l)}),r.appendChild(o),i&&r.appendChild(i),r}getFormRadio(t){const e=this.getFormInputField("radio");for(const i in t)e.setAttribute(i,t[i]);return this.options.custom_forms===!1?e.classList.add("form-check-input"):e.classList.add("custom-control-input"),e}getFormRadioLabel(t,e){const i=document.createElement("label");return this.options.custom_forms===!1?i.classList.add("form-check-label"):i.classList.add("custom-control-label"),i.appendChild(document.createTextNode(t)),i}getFormRadioControl(t,e,i){const s=document.createElement("div");return this.options.custom_forms===!1?s.classList.add("form-check"):s.classList.add("custom-control","custom-radio"),s.appendChild(e),s.appendChild(t),i&&(this.options.custom_forms===!1?s.classList.add("form-check-inline"):s.classList.add("custom-control-inline")),s}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("card","card-body","mb-3"),this.options.object_background&&t.classList.add(this.options.object_background),this.options.object_text&&t.classList.add(this.options.object_text),t}getFormInputDescription(t){const e=document.createElement("small");return e.classList.add("form-text"),window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getHeader(t,e){const i=document.createElement("span");return i.classList.add("h3"),i.classList.add("card-title"),i.classList.add("level-"+e),typeof t=="string"?i.textContent=t:i.appendChild(t),i.style.display="inline-block",i}getHeaderButtonHolder(){return this.getButtonHolder()}getButtonHolder(){const t=document.createElement("span");return t.classList.add("btn-group"),t}getFormButtonHolder(t){const e=this.getButtonHolder();return e.classList.add("d-block"),t==="center"?e.classList.add("text-center"):t==="right"&&e.classList.add("text-right"),e}getButton(t,e,i){const s=super.getButton(t,e,i);return s.classList.add("btn","btn-secondary","btn-sm"),s}getTableContainer(){const t=super.getTableContainer();return t.classList.add("table-responsive"),t}getTable(){const t=document.createElement("table");return t.classList.add("table","table-sm"),this.options.table_border&&t.classList.add("table-bordered"),this.options.table_zebrastyle&&t.classList.add("table-striped"),t}getErrorMessage(t){const e=document.createElement("div");return e.classList.add("alert","alert-danger"),e.setAttribute("role","alert"),e.appendChild(document.createTextNode(t)),e}addInputError(t,e){t.controlgroup&&(t.controlgroup.classList.add("is-invalid"),t.errmsg||(t.errmsg=document.createElement("p"),t.errmsg.classList.add("invalid-feedback"),t.controlgroup.appendChild(t.errmsg),t.errmsg.style.display="block"),t.errmsg.style.display="block",t.errmsg.textContent=e,t.errmsg.setAttribute("role","alert"))}removeInputError(t){t.errmsg&&(t.errmsg.style.display="none",t.controlgroup.classList.remove("is-invalid"))}getTabHolder(t){const e=document.createElement("div"),i=typeof t>"u"?"":t;return e.innerHTML=`<div class='col-md-2' id='${i}'><ul class='nav flex-column nav-pills'></ul></div><div class='col-md-10'><div class='tab-content' id='${i}'></div></div>`,e.classList.add("row"),e}addTab(t,e){t.children[0].children[0].appendChild(e)}getTabContentHolder(t){return t.children[1].children[0]}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.classList.add("card"),i.innerHTML=`<div class='card-header'><ul class='nav nav-tabs card-header-tabs' id='${e}'></ul></div><div class='card-body'><div class='tab-content' id='${e}'></div></div>`,i}getTab(t,e){const i=document.createElement("li");i.classList.add("nav-item");const s=document.createElement("a");return s.classList.add("nav-link"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTopTab(t,e){const i=document.createElement("li");i.classList.add("nav-item");const s=document.createElement("a");return s.classList.add("nav-link"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}getTopTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}markTabActive(t){t.tab.firstChild.classList.add("active"),typeof t.rowPane<"u"?t.rowPane.classList.add("active"):t.container.classList.add("active")}markTabInactive(t){t.tab.firstChild.classList.remove("active"),typeof t.rowPane<"u"?t.rowPane.classList.remove("active"):t.container.classList.remove("active")}insertBasicTopTab(t,e){e.children[0].children[0].insertBefore(t,e.children[0].children[0].firstChild)}addTopTab(t,e){t.children[0].children[0].appendChild(e)}getTopTabContentHolder(t){return t.children[1].children[0]}getFirstTab(t){return t.firstChild.firstChild.firstChild}getProgressBar(){const s=document.createElement("div");s.classList.add("progress");const r=document.createElement("div");return r.classList.add("progress-bar"),r.setAttribute("role","progressbar"),r.setAttribute("aria-valuenow",0),r.setAttribute("aria-valuemin",0),r.setAttribute("aria-valuenax",100),r.innerHTML="0%",s.appendChild(r),s}updateProgressBar(t,e){if(!t)return;const i=t.firstChild,s=`${e}%`;i.setAttribute("aria-valuenow",e),i.style.width=s,i.innerHTML=s}updateProgressBarUnknown(t){if(!t)return;const e=t.firstChild;t.classList.add("progress","progress-striped","active"),e.removeAttribute("aria-valuenow"),e.style.width="100%",e.innerHTML=""}getBlockLink(){const t=document.createElement("a");return t.classList.add("mb-3","d-inline-block"),t}getLinksHolder(){return document.createElement("div")}getInputGroup(t,e){if(!t)return;const i=document.createElement("div");i.classList.add("input-group"),i.appendChild(t);const s=document.createElement("div");s.classList.add("input-group-append"),i.appendChild(s);for(let r=0;r<e.length;r++)e[r].classList.remove("mr-2","btn-secondary"),e[r].classList.add("btn-outline-secondary"),s.appendChild(e[r]);return i}}Lo.rules=jc;const Pc={".form-group":"margin-bottom:1rem",".form-text":"display:block",".jsoneditor-twbs5-text-button":"background:none;padding:0;border:0;color:currentColor","td > .form-group":"margin-bottom:0",".json-editor-btn-upload":"margin-top:1rem",".je-noindent .card":"padding:0;border:0",".je-tooltip:hover::before":"display:block;position:absolute;font-size:0.8em;color:%23fff;border-radius:0.2em;content:attr(title);background-color:%23000;margin-top:-2.5em;padding:0.3em",".je-tooltip:hover::after":"display:block;position:absolute;font-size:0.8em;color:%23fff",".select2-container--default .select2-selection--single":"height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".select2-container--default .select2-selection--single .select2-selection__arrow":"height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".select2-container--default .select2-selection--single .select2-selection__rendered":"line-height:calc(1.5em%20%2B%200.75rem%20%2B%202px)",".selectize-control.form-control":"padding:0",".selectize-dropdown.form-control":"padding:0;height:auto",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"},Oc={disable_theme_rules:!1,input_size:"normal",object_indent:!0,object_background:"bg-light",object_text:"",table_border:!1,table_zebrastyle:!1,tooltip:"bootstrap"};class Ao extends be{constructor(t){super(t,Oc)}getSelectInput(t,e){const i=super.getSelectInput(t);return i.classList.add("form-control"),i.classList.add("form-select"),this.options.input_size==="small"&&i.classList.add("form-control-sm"),this.options.input_size==="large"&&i.classList.add("form-control-lg"),i}getContainer(){const t=document.createElement("div");return this.options.object_indent||t.classList.add("je-noindent"),t}setGridColumnSize(t,e,i){t.classList.add(`col-md-${e}`),i&&t.classList.add(`offset-md-${i}`)}afterInputReady(t){if(t.controlgroup)return;const e=t.name;t.id=e;const i=t.parentNode.parentNode.getElementsByTagName("label")[0];i&&(i.classList.add("form-label"),i.htmlFor=e),t.controlgroup=this.closest(t,".form-group")}getTextareaInput(){const t=document.createElement("textarea");return t.classList.add("form-control"),this.options.input_size==="small"&&t.classList.add("form-control-sm"),this.options.input_size==="large"&&t.classList.add("form-control-lg"),t}getRangeInput(t,e,i,s,r){const o=super.getRangeInput(t,e,i,s,r);return o.classList.remove("form-control"),o.classList.add("form-range"),o}getStepperButtons(t){const e=document.createElement("div"),i=document.createElement("button");i.setAttribute("type","button");const s=document.createElement("button");s.setAttribute("type","button"),e.appendChild(i),e.appendChild(t),e.appendChild(s),e.classList.add("input-group"),i.classList.add("btn"),i.classList.add("btn-secondary"),i.classList.add("stepper-down"),s.classList.add("btn"),s.classList.add("btn-secondary"),s.classList.add("stepper-up"),t.getAttribute("readonly")&&(i.setAttribute("disabled",!0),s.setAttribute("disabled",!0)),i.textContent="-",s.textContent="+";const o=(d,h)=>{h?d.value=Number(h):d.value=Number(d.value),d.setAttribute("initialized","1")},a=t.getAttribute("min"),l=t.getAttribute("max");return t.addEventListener("change",()=>{t.getAttribute("initialized")||t.setAttribute("initialized","1")}),i.addEventListener("click",()=>{t.getAttribute("initialized")?a?Number(t.value)>Number(a)&&t.stepDown():t.stepDown():o(t,a),re(t,"change")}),s.addEventListener("click",()=>{t.getAttribute("initialized")?l?Number(t.value)<Number(l)&&t.stepUp():t.stepUp():o(t,a),re(t,"change")}),e}getFormInputField(t){const e=super.getFormInputField(t);return t!=="checkbox"&&t!=="radio"&&(e.classList.add("form-control"),this.options.input_size==="small"&&e.classList.add("form-control-sm"),this.options.input_size==="large"&&e.classList.add("form-control-lg")),e}getFormControl(t,e,i,s,r){const o=document.createElement("div");if(o.classList.add("form-group"),t&&(e.type==="checkbox"||e.type==="radio")){const a=document.createElement("div");a.classList.add("form-check"),e.classList.add("form-check-input"),t.classList.add("form-check-label"),e.tagName.toLowerCase()!=="div"&&e&&t&&r&&(t.setAttribute("for",r),e.setAttribute("id",r)),e.tagName.toLowerCase()!=="div"&&e&&i&&(i.setAttribute("id",r+"-description"),e.setAttribute("aria-describedby",r+"-description")),a.appendChild(e),a.appendChild(t),s&&a.appendChild(s),o.appendChild(a)}else t&&(t.classList.add("form-label"),o.appendChild(t),s&&o.appendChild(s)),o.appendChild(e);return i&&o.appendChild(i),o}getHiddenLabel(t){const e=document.createElement("label");return e.textContent=t,e.classList.add("visually-hidden"),e}visuallyHidden(t){t&&t.classList.add("visually-hidden")}getHiddenText(t){const e=document.createElement("span");return e.textContent=t,e.classList.add("sr-only"),e}getInfoButton(t){const e=document.createElement("button");e.type="button",e.classList.add("ms-3","jsoneditor-twbs5-text-button"),e.setAttribute("data-toggle","tooltip"),e.setAttribute("data-placement","auto"),e.title=t;const i=document.createTextNode("ⓘ");return e.appendChild(i),this.options.tooltip==="bootstrap"?window.jQuery&&window.jQuery().tooltip?window.jQuery(e).tooltip():console.warn("Could not find popper jQuery plugin of Bootstrap."):this.options.tooltip==="css"&&e.classList.add("je-tooltip"),e}getCheckbox(){return this.getFormInputField("checkbox")}getMultiCheckboxHolder(t,e,i,s){const r=document.createElement("div");r.classList.add("form-group"),e&&(r.appendChild(e),s&&e.appendChild(s));const o=document.createElement("div");return Object.values(t).forEach(a=>{const l=a.firstChild;o.appendChild(l)}),r.appendChild(o),i&&r.appendChild(i),r}getFormRadio(t){const e=this.getFormInputField("radio");for(const i in t)e.setAttribute(i,t[i]);return e.classList.add("form-check-input"),e}getFormRadioLabel(t,e){const i=document.createElement("label");return i.classList.add("form-check-label"),i.appendChild(document.createTextNode(t)),i}getFormRadioControl(t,e,i){const s=document.createElement("div");return s.classList.add("form-check"),s.appendChild(e),s.appendChild(t),i&&s.classList.add("form-check-inline"),s}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("card","card-body","my-3"),this.options.object_background&&t.classList.add(this.options.object_background),this.options.object_text&&t.classList.add(this.options.object_text),t}getFormInputDescription(t){const e=document.createElement("small");return e.classList.add("form-text"),e.classList.add("d-block"),window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getHeader(t,e){const i=document.createElement("span");return i.classList.add("h3"),i.classList.add("card-title"),i.classList.add("level-"+e),typeof t=="string"?i.textContent=t:i.appendChild(t),i.style.display="inline-block",i}getHeaderButtonHolder(){return this.getButtonHolder()}getButtonHolder(){const t=document.createElement("span");return t.classList.add("btn-group"),t}getFormButtonHolder(t){const e=this.getButtonHolder();return e.classList.add("d-block"),t==="center"?e.classList.add("text-center"):t==="right"&&e.classList.add("text-end"),e}getButton(t,e,i){const s=super.getButton(t,e,i);return s.classList.add("btn","btn-secondary","btn-sm"),s}getTableContainer(){const t=super.getTableContainer();return t.classList.add("table-responsive"),t}getTable(){const t=document.createElement("table");return t.classList.add("table","table-sm"),this.options.table_border&&t.classList.add("table-bordered"),this.options.table_zebrastyle&&t.classList.add("table-striped"),t}getErrorMessage(t){const e=document.createElement("div");return e.classList.add("alert","alert-danger"),e.setAttribute("role","alert"),e.appendChild(document.createTextNode(t)),e}addInputError(t,e){t.controlgroup&&(t.controlgroup.classList.add("is-invalid"),t.errmsg||(t.errmsg=document.createElement("p"),t.errmsg.classList.add("invalid-feedback"),t.controlgroup.appendChild(t.errmsg),t.errmsg.style.display="block"),t.errmsg.style.display="block",t.errmsg.textContent=e,t.errmsg.setAttribute("role","alert"))}removeInputError(t){t.errmsg&&(t.errmsg.style.display="none",t.controlgroup.classList.remove("is-invalid"))}getTabHolder(t){const e=document.createElement("div"),i=typeof t>"u"?"":t;return e.innerHTML=`<div class='col-md-2' id='${i}'><ul class='nav flex-column nav-pills'></ul></div><div class='col-md-10'><div class='tab-content' id='${i}'></div></div>`,e.classList.add("row"),e}addTab(t,e){t.children[0].children[0].appendChild(e)}getTabContentHolder(t){return t.children[1].children[0]}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.classList.add("card"),i.innerHTML=`<div class='card-header'><ul class='nav nav-tabs card-header-tabs' id='${e}'></ul></div><div class='card-body'><div class='tab-content' id='${e}'></div></div>`,i}getTab(t,e){const i=document.createElement("li");i.classList.add("nav-item");const s=document.createElement("a");return s.classList.add("nav-link"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTopTab(t,e){const i=document.createElement("li");i.classList.add("nav-item");const s=document.createElement("a");return s.classList.add("nav-link"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}getTopTabContent(){const t=document.createElement("div");return t.classList.add("tab-pane"),t.setAttribute("role","tabpanel"),t}markTabActive(t){t.tab.firstChild.classList.add("active"),typeof t.rowPane<"u"?t.rowPane.classList.add("active"):t.container.classList.add("active")}markTabInactive(t){t.tab.firstChild.classList.remove("active"),typeof t.rowPane<"u"?t.rowPane.classList.remove("active"):t.container.classList.remove("active")}insertBasicTopTab(t,e){e.children[0].children[0].insertBefore(t,e.children[0].children[0].firstChild)}addTopTab(t,e){t.children[0].children[0].appendChild(e)}getTopTabContentHolder(t){return t.children[1].children[0]}getFirstTab(t){return t.firstChild.firstChild.firstChild}getProgressBar(){const s=document.createElement("div");s.classList.add("progress");const r=document.createElement("div");return r.classList.add("progress-bar"),r.setAttribute("role","progressbar"),r.setAttribute("aria-valuenow",0),r.setAttribute("aria-valuemin",0),r.setAttribute("aria-valuenax",100),r.innerHTML="0%",s.appendChild(r),s}updateProgressBar(t,e){if(!t)return;const i=t.firstChild,s=`${e}%`;i.setAttribute("aria-valuenow",e),i.style.width=s,i.innerHTML=s}updateProgressBarUnknown(t){if(!t)return;const e=t.firstChild;t.classList.add("progress","progress-striped","active"),e.removeAttribute("aria-valuenow"),e.style.width="100%",e.innerHTML=""}getBlockLink(){const t=document.createElement("a");return t.classList.add("mb-3","d-inline-block"),t}getLinksHolder(){return document.createElement("div")}getInputGroup(t,e){if(!t)return;const i=document.createElement("div");i.classList.add("input-group"),i.appendChild(t);for(let s=0;s<e.length;s++)e[s].classList.remove("me-2","btn-secondary"),e[s].classList.add("btn-outline-secondary"),i.appendChild(e[s]);return i}}Ao.rules=Pc;class ko extends be{getTable(){const t=super.getTable();return t.setAttribute("cellpadding",5),t.setAttribute("cellspacing",0),t}getTableHeaderCell(t){const e=super.getTableHeaderCell(t);return e.classList.add("ui-state-active"),e.style.fontWeight="bold",e}getTableCell(){const t=super.getTableCell();return t.classList.add("ui-widget-content"),t}getHeaderButtonHolder(){const t=this.getButtonHolder();return t.style.marginLeft="10px",t.style.fontSize=".6em",t.style.display="inline-block",t}getFormInputDescription(t){const e=this.getDescription(t);return e.style.marginLeft="10px",e.style.display="inline-block",e}getFormControl(t,e,i,s){const r=super.getFormControl(t,e,i,s);return e.type==="checkbox"?(r.style.lineHeight="25px",r.style.padding="3px 0"):r.style.padding="4px 0 8px 0",r}getDescription(t){const e=document.createElement("span");return e.style.fontSize=".8em",e.style.fontStyle="italic",window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getButtonHolder(){const t=document.createElement("div");return t.classList.add("ui-buttonset"),t.style.fontSize=".7em",t}getFormInputLabel(t,e){const i=document.createElement("label");return i.style.fontWeight="bold",i.style.display="block",i.textContent=t,e&&i.classList.add("required"),i}getButton(t,e,i){const s=document.createElement("button");s.classList.add("ui-button","ui-widget","ui-state-default","ui-corner-all"),e&&!t?(s.classList.add("ui-button-icon-only"),e.classList.add("ui-button-icon-primary","ui-icon-primary"),s.appendChild(e)):e?(s.classList.add("ui-button-text-icon-primary"),e.classList.add("ui-button-icon-primary","ui-icon-primary"),s.appendChild(e)):s.classList.add("ui-button-text-only");const r=document.createElement("span");return r.classList.add("ui-button-text"),r.textContent=t||i||".",s.appendChild(r),s.setAttribute("title",i),s}setButtonText(t,e,i,s){t.innerHTML="",t.classList.add("ui-button","ui-widget","ui-state-default","ui-corner-all"),i&&!e?(t.classList.add("ui-button-icon-only"),i.classList.add("ui-button-icon-primary","ui-icon-primary"),t.appendChild(i)):i?(t.classList.add("ui-button-text-icon-primary"),i.classList.add("ui-button-icon-primary","ui-icon-primary"),t.appendChild(i)):t.classList.add("ui-button-text-only");const r=document.createElement("span");r.classList.add("ui-button-text"),r.textContent=e||s||".",t.appendChild(r),t.setAttribute("title",s)}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("ui-widget-content","ui-corner-all"),t.style.padding="1em 1.4em",t.style.marginBottom="20px",t}afterInputReady(t){if(!t.controls&&(t.controls=this.closest(t,".form-control"),this.queuedInputErrorText)){const e=this.queuedInputErrorText;delete this.queuedInputErrorText,this.addInputError(t,e)}}addInputError(t,e){if(!t.controls){this.queuedInputErrorText=e;return}t.errmsg?t.errmsg.style.display="":(t.errmsg=document.createElement("div"),t.errmsg.classList.add("ui-state-error"),t.controls.appendChild(t.errmsg)),t.errmsg.textContent=e}removeInputError(t){t.controls||delete this.queuedInputErrorText,t.errmsg&&(t.errmsg.style.display="none")}markTabActive(t){t.tab.classList.remove("ui-widget-header"),t.tab.classList.add("ui-state-active"),typeof t.rowPane<"u"?t.rowPane.style.display="":t.container.style.display=""}markTabInactive(t){t.tab.classList.add("ui-widget-header"),t.tab.classList.remove("ui-state-active"),typeof t.rowPane<"u"?t.rowPane.style.display="none":t.container.style.display="none"}}ko.rules={'div[data-schemaid="root"]:after':'position:relative;color:red;margin:10px 0;font-weight:600;display:block;width:100%;text-align:center;content:"This is an old JSON-Editor 1.x Theme and might not display elements correctly when used with the 2.x version"'};const Ic={".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"};class So extends be{addInputError(t,e){if(t.errmsg)t.errmsg.style.display="block";else{const i=this.closest(t,".form-control");t.errmsg=document.createElement("div"),t.errmsg.setAttribute("class","errmsg"),i.nodeName&&i.appendChild(t.errmsg)}t.errmsg.innerHTML="",t.errmsg.appendChild(document.createTextNode(e)),t.errmsg.setAttribute("role","alert")}removeInputError(t){t.style&&(t.style.borderColor=""),t.errmsg&&(t.errmsg.style.display="none")}}So.rules=Ic;const Bc={"*":"--primary-color:%235755d9;--gray-color:%23bcc3ce;--light-color:%23fff",".slider:focus":"box-shadow:none","h4 > label + .btn-group":"margin-left:1rem",".text-right > button":"margin-right:0%20!important",".text-left > button":"margin-left:0%20!important",".property-selector":"font-size:0.7rem;font-weight:normal;max-height:260px%20!important;width:395px%20!important",".property-selector .form-checkbox":"margin:0",textarea:"width:100%25;min-height:2rem;resize:vertical",table:"border-collapse:collapse",".table td":"padding:0.4rem%200.4rem",".mr-5":"margin-right:1rem%20!important","div[data-schematype]:not([data-schematype='object'])":"transition:0.5s","div[data-schematype]:not([data-schematype='object']):hover":"background-color:%23eee",".je-table-border td":"border:0.05rem%20solid%20%23dadee4%20!important",".btn-info":"font-size:0.5rem;font-weight:bold;height:0.8rem;padding:0.15rem%200;line-height:0.8;margin:0.3rem%200%200.3rem%200.1rem",".je-label + select":"min-width:5rem",".je-label":"font-weight:600",".btn-action.btn-info":"width:0.8rem",".je-border":"border:0.05rem%20solid%20%23dadee4",".je-panel":"padding:0.2rem;margin:0.2rem;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".je-panel-top":"padding:0.2rem;margin:0.2rem;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".required:after":"content:%22%20*%22;color:red;font:inherit",".je-align-bottom":"margin-top:auto",".je-desc":"font-size:smaller;margin:0.2rem%200",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem;border:3px%20solid%20white;box-shadow:0px%200px%208px%20rgba(0%2C%200%2C%200%2C%200.3);box-sizing:border-box",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red",".columns .container.je-noindent":"padding-left:0;padding-right:0",".selectize-control.multi .item":"background:var(--primary-color)%20!important",".select2-container--default .select2-selection--single .select2-selection__arrow":"display:none",".select2-container--default .select2-selection--single":"border:none",".select2-container .select2-selection--single .select2-selection__rendered":"padding:0",".select2-container .select2-search--inline .select2-search__field":"margin-top:0",".select2-container--default.select2-container--focus .select2-selection--multiple":"border:0.05rem%20solid%20var(--gray-color)",".select2-container--default .select2-selection--multiple .select2-selection__choice":"margin:0.4rem%200.2rem%200.2rem%200;padding:2px%205px;background-color:var(--primary-color);color:var(--light-color)",".select2-container--default .select2-search--inline .select2-search__field":"line-height:normal",".choices":"margin-bottom:auto",".choices__list--multiple .choices__item":"border:none;background-color:var(--primary-color);color:var(--light-color)",".choices[data-type*='select-multiple'] .choices__button":"border-left:0.05rem%20solid%20%232826a6",".choices__inner":"font-size:inherit;min-height:20px;padding:4px%207.5px%204px%203.75px",".choices[data-type*='select-one'] .choices__inner":"padding-bottom:4px",".choices__list--dropdown .choices__item":"font-size:inherit"},Rc={disable_theme_rules:!1,label_bold:!0,align_bottom:!1,object_indent:!1,object_border:!1,table_border:!1,table_zebrastyle:!1,input_size:"normal"};class To extends be{constructor(t){super(t,Rc)}setGridColumnSize(t,e,i){t.classList.add(`col-${e}`),i&&t.classList.add("col-mx-auto")}getGridContainer(){const t=document.createElement("div");return t.classList.add("container"),this.options.object_indent||t.classList.add("je-noindent"),t}getGridRow(){const t=document.createElement("div");return t.classList.add("columns"),t}getGridColumn(){const t=document.createElement("div");return t.classList.add("column"),this.options.align_bottom&&t.classList.add("je-align-bottom"),t}getIndentedPanel(){const t=document.createElement("div");return t.classList.add("je-panel"),this.options.object_border&&t.classList.add("je-border"),t}getTopIndentedPanel(){const t=document.createElement("div");return t.classList.add("je-panel-top"),this.options.object_border&&t.classList.add("je-border"),t}getHeaderButtonHolder(){return this.getButtonHolder()}getButtonHolder(){const t=super.getButtonHolder();return t.classList.add("btn-group"),t}getFormButtonHolder(t){const e=super.getFormButtonHolder();return e.classList.remove("btn-group"),e.classList.add("d-block"),t==="center"?e.classList.add("text-center"):t==="right"?e.classList.add("text-right"):e.classList.add("text-left"),e}getFormButton(t,e,i){const s=super.getFormButton(t,e,i);return s.classList.add("btn","btn-primary","mx-2","my-1"),this.options.input_size!=="small"&&s.classList.remove("btn-sm"),this.options.input_size==="large"&&s.classList.add("btn-lg"),s}getButton(t,e,i){const s=super.getButton(t,e,i);return s.classList.add("btn","btn-sm","btn-primary","mr-2","my-1"),s}getHeader(t,e){const i=document.createElement("span");return typeof t=="string"?i.textContent=t:i.appendChild(t),i.style.display="inline-block",i}getFormInputDescription(t){const e=super.getFormInputDescription(t);return e.classList.add("je-desc","hide-sm"),e}getFormInputLabel(t,e){const i=super.getFormInputLabel(t,e);return this.options.label_bold&&i.classList.add("je-label"),i}getCheckbox(){return this.getFormInputField("checkbox")}getCheckboxLabel(t,e){const i=super.getCheckboxLabel(t,e),s=document.createElement("i");return s.classList.add("form-icon"),i.classList.add("form-checkbox","pr-0"),i.insertBefore(s,i.firstChild),i}getFormCheckboxControl(t,e,i){return t.insertBefore(e,t.firstChild),i&&t.classList.add("form-inline"),t}getMultiCheckboxHolder(t,e,i,s){return super.getMultiCheckboxHolder(t,e,i,s)}getFormRadio(t){const e=this.getFormInputField("radio");for(const i in t)e.setAttribute(i,t[i]);return e}getFormRadioLabel(t,e){const i=super.getFormRadioLabel(t,e),s=document.createElement("i");return s.classList.add("form-icon"),i.classList.add("form-radio"),i.insertBefore(s,i.firstChild),i}getFormRadioControl(t,e,i){return t.insertBefore(e,t.firstChild),i&&t.classList.add("form-inline"),t}getFormInputField(t){const e=super.getFormInputField(t);return["checkbox","radio"].includes(t)||e.classList.add("form-input"),e}getRangeInput(t,e,i,s,r){const o=super.getRangeInput(t,e,i,s,r);return o.classList.add("slider"),o.classList.remove("form-input"),o.setAttribute("oninput",'this.setAttribute("value", this.value)'),o}getRangeControl(t,e){const i=super.getRangeControl(t,e);return i.classList.add("text-center"),i}getSelectInput(t,e){const i=super.getSelectInput(t);return i.classList.add("form-select"),i}getTextareaInput(){const t=document.createElement("textarea");return t.classList.add("form-input"),t}getFormControl(t,e,i,s,r){const o=document.createElement("div");return o.classList.add("form-group"),t&&(e.type==="checkbox"||e.type==="radio")?(o.classList.add(e.type),s&&t.appendChild(s),t.insertBefore(e,t.firstChild),o.appendChild(t)):(t&&(t.classList.add("form-label"),o.appendChild(t),s&&t.appendChild(s)),o.appendChild(e)),this.options.input_size==="small"?e.classList.add("input-sm","select-sm"):this.options.input_size==="large"&&e.classList.add("input-lg","select-lg"),e.type!=="checkbox"&&o.appendChild(e),i&&o.appendChild(i),e.tagName.toLowerCase()!=="div"&&e&&t&&r&&(t.setAttribute("for",r),e.setAttribute("id",r)),e.tagName.toLowerCase()!=="div"&&e&&i&&(i.setAttribute("id",r+"-description"),e.setAttribute("aria-describedby",r+"-description")),o}getInputGroup(t,e){if(!t)return;const i=document.createElement("div");i.classList.add("input-group"),i.appendChild(t);for(let s=0;s<e.length;s++)e[s].classList.add("input-group-btn"),e[s].classList.remove("btn-sm","mr-2","my-1"),i.appendChild(e[s]);return i}getInfoButton(t){const e=document.createElement("div");e.classList.add("popover","popover-left","float-right");const i=document.createElement("button");i.classList.add("btn","btn-secondary","btn-info","btn-action","s-circle"),i.setAttribute("tabindex","-1"),e.appendChild(i);const s=document.createTextNode("I");i.appendChild(s);const r=document.createElement("div");r.classList.add("popover-container"),e.appendChild(r);const o=document.createElement("div");o.classList.add("card"),r.appendChild(o);const a=document.createElement("div");return a.classList.add("card-body"),a.innerHTML=t,o.appendChild(a),e}getTable(){const t=super.getTable();return t.classList.add("table","table-scroll"),this.options.table_border&&t.classList.add("je-table-border"),this.options.table_zebrastyle&&t.classList.add("table-striped"),t}getProgressBar(){const t=super.getProgressBar();return t.classList.add("progress"),t}getTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.classList.add("columns"),i.innerHTML=`<div class="column col-2"></div><div class="column col-10 content" id="${e}"></div>`,i}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<ul class="tab"></ul><div class="content" id="${e}"></div>`,i}getTab(t,e){const i=document.createElement("a");return i.classList.add("btn","btn-secondary","btn-block"),i.setAttribute("href",`#${e}`),i.appendChild(t),i}getTopTab(t,e){const i=document.createElement("li");i.id=e,i.classList.add("tab-item");const s=document.createElement("a");return s.setAttribute("href",`#${e}`),s.appendChild(t),i.appendChild(s),i}markTabActive(t){t.tab.classList.add("active"),typeof t.rowPane<"u"?t.rowPane.style.display="":t.container.style.display=""}markTabInactive(t){t.tab.classList.remove("active"),typeof t.rowPane<"u"?t.rowPane.style.display="none":t.container.style.display="none"}afterInputReady(t){if(t.localName==="select"){if(t.classList.contains("selectized")){const e=t.nextSibling;e&&(e.classList.remove("form-select"),Array.from(e.querySelectorAll(".form-select")).forEach(i=>{i.classList.remove("form-select")}))}else if(t.classList.contains("select2-hidden-accessible")){const e=t.nextSibling;e&&e.querySelector(".select2-selection--single")&&e.classList.add("form-select")}}t.controlgroup||(t.controlgroup=this.closest(t,".form-group"),this.closest(t,".compact")&&(t.controlgroup.style.marginBottom=0))}addInputError(t,e){t.controlgroup&&(t.controlgroup.classList.add("has-error"),t.errmsg||(t.errmsg=document.createElement("p"),t.errmsg.classList.add("form-input-hint"),t.controlgroup.appendChild(t.errmsg)),t.errmsg.classList.remove("d-hide"),t.errmsg.textContent=e,t.errmsg.setAttribute("role","alert"))}removeInputError(t){t.errmsg&&(t.errmsg.classList.add("d-hide"),t.controlgroup.classList.remove("has-error"))}}To.rules=Bc;const Dc={".slider":"-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;display:block;border:none;height:1.2rem;width:100%25",".slider:focus":"box-shadow:0%200%200%200%20rgba(87%2C%2085%2C%20217%2C%200.2);outline:none",".slider.tooltip:not([data-tooltip])::after":"content:attr(value)",".slider::-webkit-slider-thumb":"-webkit-appearance:none;background:%23f17405;border-radius:100%25;height:0.6rem;margin-top:-0.25rem;transition:transform%200.2s;width:0.6rem",".slider:active::-webkit-slider-thumb":"transform:scale(1.25);outline:none",".slider::-webkit-slider-runnable-track":"background:%23b2b4b6;border-radius:0.1rem;height:0.1rem;width:100%25","a.tooltips":"position:relative;display:inline","a.tooltips span":"position:absolute;white-space:nowrap;width:auto;padding-left:1rem;padding-right:1rem;color:%23ffffff;background:rgba(56%2C%2056%2C%2056%2C%200.85);height:1.5rem;line-height:1.5rem;text-align:center;visibility:hidden;border-radius:3px","a.tooltips span:after":"content:%22%22;position:absolute;top:50%25;left:100%25;margin-top:-5px;width:0;height:0;border-left:5px%20solid%20rgba(56%2C%2056%2C%2056%2C%200.85);border-top:5px%20solid%20transparent;border-bottom:5px%20solid%20transparent","a:hover.tooltips span":"visibility:visible;opacity:0.9;font-size:0.8rem;right:100%25;top:50%25;margin-top:-12px;margin-right:10px;z-index:999",".json-editor-btntype-properties + div":"font-size:0.8rem;font-weight:normal",textarea:"width:100%25;min-height:2rem;resize:vertical",table:"width:100%25;border-collapse:collapse",".table td":"padding:0rem%200rem","div[data-schematype]:not([data-schematype='object'])":"transition:0.5s","div[data-schematype]:not([data-schematype='object']):hover":"background-color:%23e6f4fe","div[data-schemaid='root']":"position:relative;width:inherit;display:inherit;overflow-x:hidden;z-index:10","select[multiple]":"height:auto","select[multiple].from-select":"height:auto",".je-table-zebra:nth-child(even)":"background-color:%23f2f2f2",".je-table-border":"border:0.5px%20solid%20black",".je-table-hdiv":"border-bottom:1px%20solid%20black",".je-border":"border:0.05rem%20solid%20%233182ce",".je-panel":"width:inherit;padding:0.2rem;margin:0.2rem;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".je-panel-top":"width:100%25;padding:0.2rem;margin:0.2rem;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".required:after":"content:%22%20*%22;color:red;font:inherit;font-weight:bold",".je-desc":"font-size:smaller;margin:0.2rem%200",".container-xl.je-noindent":"padding-left:0;padding-right:0",".json-editor-btntype-add":"color:white;margin:0.3rem;padding:0.3rem%200.8rem;background-color:%234299e1;box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-webkit-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-moz-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2)",".json-editor-btntype-deletelast":"color:white;margin:0.3rem;padding:0.3rem%200.8rem;background-color:%23e53e3e;box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-webkit-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-moz-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2)",".json-editor-btntype-deleteall":"color:white;margin:0.3rem;padding:0.3rem%200.8rem;background-color:%23000000;box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-webkit-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-moz-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2)",".json-editor-btn-save":"float:right;color:white;margin:0.3rem;padding:0.3rem%200.8rem;background-color:%232b6cb0;box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-webkit-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-moz-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2)",".json-editor-btn-back":"color:white;margin:0.3rem;padding:0.3rem%200.8rem;background-color:%232b6cb0;box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-webkit-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2);-moz-box-shadow:3px%203px%205px%201px%20rgba(4%2C%204%2C%204%2C%200.2)",".json-editor-btntype-delete":"color:%23e53e3e;background-color:rgba(218%2C%20222%2C%20228%2C%200.1);margin:0.03rem;padding:0.1rem",".json-editor-btntype-move":"color:%23000000;background-color:rgba(218%2C%20222%2C%20228%2C%200.1);margin:0.03rem;padding:0.1rem",".json-editor-btn-collapse":"padding:0em%200.8rem;font-size:1.3rem;color:%23e53e3e;background-color:rgba(218%2C%20222%2C%20228%2C%200.1)",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"},Nc={disable_theme_rules:!1,label_bold:!1,object_panel_default:!0,object_indent:!0,object_border:!1,table_border:!1,table_hdiv:!1,table_zebrastyle:!1,input_size:"small",enable_compact:!1};class jo extends be{constructor(t){super(t,Nc)}getGridContainer(){const t=document.createElement("div");return t.classList.add("flex","flex-col","w-full"),this.options.object_indent||t.classList.add("je-noindent"),t}getGridRow(){const t=document.createElement("div");return t.classList.add("flex","flex-wrap","w-full"),t}getGridColumn(){const t=document.createElement("div");return t.classList.add("flex","flex-col"),t}setGridColumnSize(t,e,i){e>0&&e<12?t.classList.add(`w-${e}/12`,"px-1"):t.classList.add("w-full","px-1"),i&&(t.style.marginLeft=`${100/12*i}%`)}getIndentedPanel(){const t=document.createElement("div");return this.options.object_panel_default?t.classList.add("w-full","p-1"):t.classList.add("relative","flex","flex-col","rounded","break-words","border","bg-white","border-0","border-blue-400","p-1","shadow-md"),this.options.object_border&&t.classList.add("je-border"),t}getTopIndentedPanel(){const t=document.createElement("div");return this.options.object_panel_default?t.classList.add("w-full","m-2"):t.classList.add("relative","flex","flex-col","rounded","break-words","border","bg-white","border-0","border-blue-400","p-1","shadow-md"),this.options.object_border&&t.classList.add("je-border"),t}getTitle(){return this.translateProperty(this.schema.title)}getSelectInput(t,e){const i=super.getSelectInput(t);return e?i.classList.add("form-multiselect","block","py-0","h-auto","w-full","px-1","text-sm","text-black","leading-normal","bg-white","border","border-grey","rounded"):i.classList.add("form-select","block","py-0","h-6","w-full","px-1","text-sm","text-black","leading-normal","bg-white","border","border-grey","rounded"),this.options.enable_compact&&i.classList.add("compact"),i}afterInputReady(t){t.controlgroup||(t.controlgroup=this.closest(t,".form-group"),this.closest(t,".compact")&&(t.controlgroup.style.marginBottom=0))}getTextareaInput(){const t=super.getTextareaInput();return t.classList.add("block","w-full","px-1","text-sm","leading-normal","bg-white","text-black","border","border-grey","rounded"),this.options.enable_compact&&t.classList.add("compact"),t.style.height=0,t}getRangeInput(t,e,i){const s=this.getFormInputField("range");return s.classList.add("slider"),this.options.enable_compact&&s.classList.add("compact"),s.setAttribute("oninput",'this.setAttribute("value", this.value)'),s.setAttribute("min",t),s.setAttribute("max",e),s.setAttribute("step",i),s}getRangeControl(t,e){const i=super.getRangeControl(t,e);return i.classList.add("text-center","text-black"),i}getCheckbox(){const t=this.getFormInputField("checkbox");return t.classList.add("form-checkbox","text-red-600"),t}getCheckboxLabel(t,e){const i=super.getCheckboxLabel(t,e);return i.classList.add("inline-flex","items-center"),i}getFormCheckboxControl(t,e,i){return t.insertBefore(e,t.firstChild),i&&t.classList.add("inline-flex flex-row"),t}getMultiCheckboxHolder(t,e,i,s){const r=super.getMultiCheckboxHolder(t,e,i,s);return r.classList.add("inline-flex","flex-col"),r}getFormRadio(t){const e=this.getFormInputField("radio");e.classList.add("form-radio","text-red-600");for(const i in t)e.setAttribute(i,t[i]);return e}getFormRadioLabel(t,e){const i=super.getFormRadioLabel(t,e);return i.classList.add("inline-flex","items-center","mr-2"),i}getFormRadioControl(t,e,i){return t.insertBefore(e,t.firstChild),i&&t.classList.add("form-radio"),t}getRadioHolder(t,e,i,s,r){const o=super.getRadioHolder(e,i,s,r);return t.options.layout==="h"?o.classList.add("inline-flex","flex-row"):o.classList.add("inline-flex","flex-col"),o}getFormInputLabel(t,e){const i=super.getFormInputLabel(t,e);return this.options.label_bold?i.classList.add("font-bold"):i.classList.add("required"),i}getFormInputField(t){const e=super.getFormInputField(t);return["checkbox","radio"].includes(t)||e.classList.add("block","w-full","px-1","text-black","text-sm","leading-normal","bg-white","border","border-grey","rounded"),this.options.enable_compact&&e.classList.add("compact"),e}getFormInputDescription(t){const e=document.createElement("p");return e.classList.add("block","mt-1","text-xs"),window.DOMPurify?e.innerHTML=window.DOMPurify.sanitize(t):e.textContent=this.cleanText(t),e}getFormControl(t,e,i,s){const r=document.createElement("div");return r.classList.add("form-group","mb-1","w-full"),t&&(t.classList.add("text-xs"),e.type==="checkbox"&&(e.classList.add("form-checkbox","text-xs","text-red-600","mr-1"),t.classList.add("items-center","flex"),t=this.getFormCheckboxControl(t,e,!1,s)),e.type==="radio"&&(e.classList.add("form-radio","text-red-600","mr-1"),t.classList.add("items-center","flex"),t=this.getFormRadioControl(t,e,!1,s)),r.appendChild(t),!["checkbox","radio"].includes(e.type)&&s&&r.appendChild(s)),["checkbox","radio"].includes(e.type)||(this.options.input_size==="small"?e.classList.add("text-xs"):this.options.input_size==="normal"?e.classList.add("text-base"):this.options.input_size==="large"&&e.classList.add("text-xl"),r.appendChild(e)),i&&r.appendChild(i),r}getHeaderButtonHolder(){const t=this.getButtonHolder();return t.classList.add("text-sm"),t}getButtonHolder(){const t=document.createElement("div");return t.classList.add("flex","relative","inline-flex","align-middle"),t}getButton(t,e,i){const s=super.getButton(t,e,i);return s.classList.add("inline-block","align-middle","text-center","text-sm","bg-blue-700","text-white","py-1","pr-1","m-2","shadow","select-none","whitespace-no-wrap","rounded"),s}getInfoButton(t){const e=document.createElement("a");e.classList.add("tooltips","float-right"),e.innerHTML="ⓘ";const i=document.createElement("span");return i.innerHTML=t,e.appendChild(i),e}getTable(){const t=super.getTable();return this.options.table_border?t.classList.add("je-table-border"):t.classList.add("table","border","p-0"),t}getTableRow(){const t=super.getTableRow();return this.options.table_border&&t.classList.add("je-table-border"),this.options.table_zebrastyle&&t.classList.add("je-table-zebra"),t}getTableHeaderCell(t){const e=super.getTableHeaderCell(t);return this.options.table_border?e.classList.add("je-table-border"):this.options.table_hdiv?e.classList.add("je-table-hdiv"):e.classList.add("text-xs","border","p-0","m-0"),e}getTableCell(){const t=super.getTableCell();return this.options.table_border?t.classList.add("je-table-border"):this.options.table_hdiv?t.classList.add("je-table-hdiv"):t.classList.add("border-0","p-0","m-0"),t}addInputError(t,e){t.controlgroup&&(t.controlgroup.classList.add("has-error"),t.controlgroup.classList.add("text-red-600"),t.errmsg?t.errmsg.style.display="":(t.errmsg=document.createElement("p"),t.errmsg.classList.add("block","mt-1","text-xs","text-red"),t.controlgroup.appendChild(t.errmsg)),t.errmsg.textContent=e)}removeInputError(t){t.errmsg&&(t.errmsg.style.display="none",t.controlgroup.classList.remove("text-red-600"),t.controlgroup.classList.remove("has-error"))}getTabHolder(t){const e=document.createElement("div"),i=typeof t>"u"?"":t;return e.innerHTML=`<div class='w-2/12' id='${i}'><ul class='list-reset pl-0 mb-0'></ul></div><div class='w-10/12' id='${i}'></div>`,e.classList.add("flex"),e}addTab(t,e){t.children[0].children[0].appendChild(e)}getTopTabHolder(t){const e=typeof t>"u"?"":t,i=document.createElement("div");return i.innerHTML=`<ul class='nav-tabs flex list-reset pl-0 mb-0 border-b border-grey-light' id='${e}'></ul><div class='p-6 block' id='${e}'></div>`,i}getTab(t,e){const i=document.createElement("li");i.classList.add("nav-item","flex-col","text-center","text-white","bg-blue-500","shadow-md","border","p-2","mb-2","mr-2","hover:bg-blue-400","rounded");const s=document.createElement("a");return s.classList.add("nav-link","text-center"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTopTab(t,e){const i=document.createElement("li");i.classList.add("nav-item","flex","border-l","border-t","border-r");const s=document.createElement("a");return s.classList.add("nav-link","-mb-px","flex-row","text-center","bg-white","p-2","hover:bg-blue-400","rounded-t"),s.setAttribute("href",`#${e}`),s.setAttribute("data-toggle","tab"),s.appendChild(t),i.appendChild(s),i}getTabContent(){const t=document.createElement("div");return t.setAttribute("role","tabpanel"),t}getTopTabContent(){const t=document.createElement("div");return t.setAttribute("role","tabpanel"),t}markTabActive(t){t.tab.firstChild.classList.add("block"),t.tab.firstChild.classList.contains("border-b")===!0?(t.tab.firstChild.classList.add("border-b-0"),t.tab.firstChild.classList.remove("border-b")):t.tab.firstChild.classList.add("border-b-0"),t.container.classList.contains("hidden")===!0&&t.container.classList.remove("hidden"),t.container.classList.add("block")}markTabInactive(t){t.tab.firstChild.classList.contains("border-b-0")===!0?(t.tab.firstChild.classList.add("border-b"),t.tab.firstChild.classList.remove("border-b-0")):t.tab.firstChild.classList.add("border-b"),t.container.classList.contains("block")===!0&&(t.container.classList.remove("block"),t.container.classList.add("hidden"))}getProgressBar(){const s=document.createElement("div");s.classList.add("progress");const r=document.createElement("div");return r.classList.add("bg-blue","leading-none","py-1","text-xs","text-center","text-white"),r.setAttribute("role","progressbar"),r.setAttribute("aria-valuenow",0),r.setAttribute("aria-valuemin",0),r.setAttribute("aria-valuenax",100),r.innerHTML="0%",s.appendChild(r),s}updateProgressBar(t,e){if(!t)return;const i=t.firstChild,s=`${e}%`;i.setAttribute("aria-valuenow",e),i.style.width=s,i.innerHTML=s}updateProgressBarUnknown(t){if(!t)return;const e=t.firstChild;t.classList.add("progress","bg-blue","leading-none","py-1","text-xs","text-center","text-white","block"),e.removeAttribute("aria-valuenow"),e.classList.add("w-full"),e.innerHTML=""}getInputGroup(t,e){if(!t)return;const i=document.createElement("div");i.classList.add("relative","items-stretch","w-full"),i.appendChild(t);const s=document.createElement("div");s.classList.add("-mr-1"),i.appendChild(s);for(let r=0;r<e.length;r++)s.appendChild(e[r]);return i}}jo.rules=Dc;const Mc={html:Co,bootstrap3:Eo,bootstrap4:Lo,bootstrap5:Ao,jqueryui:ko,barebones:So,spectre:To,tailwind:jo},Hc={".je-float-right-linkholder":"float:right;margin-left:10px",".je-modal":"background-color:white;border:1px%20solid%20black;box-shadow:3px%203px%20black;position:absolute;z-index:10",".je-infobutton-icon":"font-size:16px;font-weight:bold;padding:0.25rem;position:relative;display:inline-block",".je-infobutton-tooltip":"font-size:12px;font-weight:normal;font-family:sans-serif;visibility:hidden;background-color:rgba(50%2C%2050%2C%2050%2C%200.75);margin:0%200.25rem;color:%23fafafa;padding:0.5rem%201rem;border-radius:0.25rem;width:20rem;position:absolute",".je-not-loaded":"pointer-events:none",".je-header":"display:inline-block",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-checkbox":"display:inline-block;width:auto",".je-checkbox-control--compact":"display:inline-block;margin-right:1rem",".je-radio":"display:inline-block;width:auto",".je-radio-control--compact":"display:inline-block;margin-right:1rem",".je-switcher":"background-color:transparent;display:inline-block;font-style:italic;font-weight:normal;height:auto;width:auto;margin-bottom:0;margin-left:5px;padding:0%200%200%203px",".je-textarea":"width:100%25;height:300px;box-sizing:border-box",".je-range-control":"text-align:center",".je-indented-panel":"padding-left:10px;margin-left:10px;border-left:1px%20solid%20%23ccc",".je-indented-panel--top":"padding-left:10px;margin-left:10px",".je-tabholder":"float:left;width:130px",".je-tabholder .content":"margin-left:120px",".je-tabholder--top":"margin-left:10px",".je-tabholder--clear":"clear:both",".je-tab":"border:1px%20solid%20%23ccc;border-width:1px%200%201px%201px;text-align:center;line-height:30px;border-radius:5px;border-bottom-right-radius:0;border-top-right-radius:0;font-weight:bold;cursor:pointer",".je-tab--top":"float:left;border:1px%20solid%20%23ccc;border-width:1px%201px%200px%201px;text-align:center;line-height:30px;border-radius:5px;padding-left:5px;padding-right:5px;border-bottom-right-radius:0;border-bottom-left-radius:0;font-weight:bold;cursor:pointer",".je-block-link":"display:block",".je-media":"width:100%25"};class tt{constructor(t,e={}){if(!(t instanceof Element))throw new Error("element should be an instance of Element");this.element=t,this.options=$({},tt.defaults.options,e),this.ready=!1,this.copyClipboard=null,this.schema=this.options.schema,this.template=this.options.template,this.translate=this.options.translate||tt.defaults.translate,this.translateProperty=this.options.translateProperty||tt.defaults.translateProperty,this.uuid=0,this.__data={};const i=this.options.theme||tt.defaults.theme,s=tt.defaults.themes[i];if(!s)throw new Error(`Unknown theme ${i}`);this.element.setAttribute("data-theme",i),this.element.classList.add("je-not-loaded"),this.element.classList.remove("je-ready"),this.theme=new s(this);const r=$(Hc,this.getEditorsRules()),o=(l,d,h)=>h?this.addNewStyleRulesToShadowRoot(l,d,h):this.addNewStyleRules(l,d);if(!this.theme.options.disable_theme_rules){const l=po(this.element);o("default",r,l),typeof s.rules<"u"&&o(i,s.rules,l)}const a=tt.defaults.iconlibs[this.options.iconlib||tt.defaults.iconlib];a&&(this.iconlib=new a),this.root_container=this.theme.getContainer(),this.element.appendChild(this.root_container),this.promise=this.load()}async load(){const t=document.location.origin+document.location.pathname.toString(),e=new tc(this.options);e.onSchemaLoaded=a=>{this.trigger("schemaLoaded",a)},e.onAllSchemasLoaded=()=>{this.trigger("allSchemasLoaded")},this.expandSchema=a=>e.expandSchema(a),this.expandRefs=(a,l)=>e.expandRefs(a,l);const i=document.location.toString(),s=await e.load(this.schema,t,i),r=this.options.custom_validators?{custom_validators:this.options.custom_validators}:{};this.validator=new yo(this,null,r,tt.defaults);const o=this.getEditorClass(s);this.root=this.createEditor(o,{jsoneditor:this,schema:s,required:!0,container:this.root_container}),this.root.preBuild(),this.root.build(),this.root.postBuild(),Wt(this.options,"startval")&&this.root.setValue(this.options.startval),this.validation_results=this.validator.validate(this.root.getValue()),this.root.showValidationErrors(this.validation_results),this.ready=!0,this.element.classList.remove("je-not-loaded"),this.element.classList.add("je-ready"),window.requestAnimationFrame(()=>{this.ready&&(this.validation_results=this.validator.validate(this.root.getValue()),this.root.showValidationErrors(this.validation_results),this.trigger("ready"),this.trigger("change"))})}getValue(){if(!this.ready)throw new Error("JSON Editor not ready yet. Make sure the load method is complete");return this.root.getValue()}setValue(t){if(!this.ready)throw new Error("JSON Editor not ready yet. Make sure the load method is complete");return this.root.setValue(t),this}validate(t){if(!this.ready)throw new Error("JSON Editor not ready yet. Make sure the load method is complete");return arguments.length===1?this.validator.validate(t):this.validation_results}destroy(){this.destroyed||this.ready&&(this.schema=null,this.options=null,this.root.destroy(),this.root=null,this.root_container=null,this.validator=null,this.validation_results=null,this.theme=null,this.iconlib=null,this.template=null,this.__data=null,this.ready=!1,this.element.innerHTML="",this.element.removeAttribute("data-theme"),this.destroyed=!0)}on(t,e){return this.callbacks=this.callbacks||{},this.callbacks[t]=this.callbacks[t]||[],this.callbacks[t].push(e),this}off(t,e){if(t&&e){this.callbacks=this.callbacks||{},this.callbacks[t]=this.callbacks[t]||[];const i=[];for(let s=0;s<this.callbacks[t].length;s++)this.callbacks[t][s]!==e&&i.push(this.callbacks[t][s]);this.callbacks[t]=i}else t?(this.callbacks=this.callbacks||{},this.callbacks[t]=[]):this.callbacks={};return this}trigger(t,e){if(this.callbacks&&this.callbacks[t]&&this.callbacks[t].length)for(let i=0;i<this.callbacks[t].length;i++)this.callbacks[t][i].apply(this,[e]);return this}setOption(t,e){if(t==="show_errors")this.options.show_errors=e,this.onChange();else throw new Error(`Option ${t} must be set during instantiation and cannot be changed later`);return this}getEditorsRules(){const t=(e,i)=>i.rules?$(e,i.rules):e;return Object.values(tt.defaults.editors).reduce(t,{})}getEditorClass(t){let e;if(t=this.expandSchema(t),tt.defaults.resolvers.find(i=>(e=i(t,this),e&&tt.defaults.editors[e])),!e)throw new Error(`Unknown editor for schema ${JSON.stringify(t)}`);if(!tt.defaults.editors[e])throw new Error(`Unknown editor ${e}`);return tt.defaults.editors[e]}createEditor(t,e,i=1){return e=$({},t.options||{},e),new t(e,tt.defaults,i)}onChange(){if(this.ready&&!this.firing_change)return this.firing_change=!0,window.requestAnimationFrame(()=>{this.firing_change=!1,this.ready&&(this.validation_results=this.validator.validate(this.root.getValue()),this.options.show_errors!=="never"?this.root.showValidationErrors(this.validation_results):this.root.showValidationErrors([]),this.trigger("change"))}),this}compileTemplate(t,e=tt.defaults.template){let i;if(typeof e=="string"){if(!tt.defaults.templates[e])throw new Error(`Unknown template engine ${e}`);if(i=tt.defaults.templates[e](),!i)throw new Error(`Template engine ${e} missing required library.`)}else i=e;if(!i)throw new Error("No template engine set");if(!i.compile)throw new Error("Invalid template engine set");return i.compile(t)}_data(t,e,i){if(arguments.length===3){let s;t.hasAttribute(`data-jsoneditor-${e}`)?s=t.getAttribute(`data-jsoneditor-${e}`):(s=this.uuid++,t.setAttribute(`data-jsoneditor-${e}`,s)),this.__data[s]=i}else return t.hasAttribute(`data-jsoneditor-${e}`)?this.__data[t.getAttribute(`data-jsoneditor-${e}`)]:null}registerEditor(t){return this.editors=this.editors||{},this.editors[t.path]=t,this}unregisterEditor(t){return this.editors=this.editors||{},this.editors[t.path]=null,this}getEditor(t){if(this.editors)return this.editors[t]}watch(t,e){return this.watchlist=this.watchlist||{},this.watchlist[t]=this.watchlist[t]||[],this.watchlist[t].push(e),this}unwatch(t,e){if(!this.watchlist||!this.watchlist[t])return this;if(!e)return this.watchlist[t]=null,this;const i=[];for(let s=0;s<this.watchlist[t].length;s++)this.watchlist[t][s]!==e&&i.push(this.watchlist[t][s]);return this.watchlist[t]=i.length?i:null,this}notifyWatchers(t){if(!this.watchlist||!this.watchlist[t])return this;for(let e=0;e<this.watchlist[t].length;e++)this.watchlist[t][e]()}isEnabled(){return!this.root||this.root.isEnabled()}enable(){this.root.enable()}disable(){this.root.disable()}setCopyClipboardContents(t){this.copyClipboard=t}getCopyClipboardContents(){return this.copyClipboard}addNewStyleRules(t,e){let i=document.querySelector(`#theme-${t}`);i||(i=document.createElement("style"),i.setAttribute("id",`theme-${t}`),i.appendChild(document.createTextNode("")),document.head.appendChild(i));const s=i.sheet?i.sheet:i.styleSheet,r=this.element.nodeName.toLowerCase();for(;s.cssRules.length>0;)s.deleteRule(0);Object.keys(e).forEach(o=>{const a=t==="default"?o:`${r}[data-theme="${t}"] ${o}`;s.insertRule?s.insertRule(a+" {"+decodeURIComponent(e[o])+"}",0):s.addRule&&s.addRule(a,decodeURIComponent(e[o]),0)})}addNewStyleRulesToShadowRoot(t,e,i){const s=this.element.nodeName.toLowerCase();let r="";Object.keys(e).forEach(a=>{const l=t==="default"?a:`${s}[data-theme="${t}"] ${a}`;r+=l+" {"+decodeURIComponent(e[a])+`}
71
- `});const o=new CSSStyleSheet;o.replaceSync(r),i.adoptedStyleSheets=[...i.adoptedStyleSheets,o]}}tt.defaults=Ie,tt.AbstractEditor=Bt,tt.AbstractTheme=be,tt.AbstractIconLib=ge,Object.assign(tt.defaults.themes,Mc),Object.assign(tt.defaults.editors,es),Object.assign(tt.defaults.templates,ec),Object.assign(tt.defaults.iconlibs,kc);const Vc=`
72
- * {
73
- font-family: Roboto, sans-serif;
74
- }
75
- `,Er=`
76
- input[type=checkbox] {
77
- appearance: none;
78
- -webkit-appearance: none;
79
- margin: 0;
80
- cursor: pointer;
81
- display: flex;
82
- flex-direction: row;
83
- align-items: center;
84
- width: 24px;
85
- height: 24px;
86
- }
87
- input[type=checkbox]:after {
88
- display: block;
89
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckbox-blank-outline%3C/title%3E%3Cpath d='M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z' /%3E%3C/svg%3E");
90
- width: 20px;
91
- height: 20px;
92
- margin-right: 4px;
93
- }
94
- input[type=checkbox]:checked:after {
95
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckbox-marked%3C/title%3E%3Cpath d='M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z' /%3E%3C/svg%3E");
96
-
97
- }
98
- `,$o=`
99
- input[type=radio] {
100
- appearance: none;
101
- -webkit-appearance: none;
102
- margin: 0;
103
- cursor: pointer;
104
- display: flex;
105
- flex-direction: row;
106
- align-items: center;
107
- width: 24px;
108
- height: 24px;
109
- }
110
-
111
- label span {
112
- font-size: small;
113
- }
114
-
115
- input[type=radio]:after {
116
- display: block;
117
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-blank%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z' /%3E%3C/svg%3E");
118
- width: 20px;
119
- height: 20px;
120
- margin-right: 4px;
121
- }
122
- input[type=radio]:checked:after {
123
- content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-marked%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7Z' /%3E%3C/svg%3E");
124
-
125
- }
126
- `,Po=`
127
- input[type="range"] {
128
- -webkit-appearance: none;
129
- width: 90%;
130
- margin-left: 5%;
131
- height: 6px;
132
- border-radius: 5px;
133
- background: #d7dcdf;
134
- outline: none;
135
- padding: 0;
136
- }
137
- input[type="range"]::-webkit-slider-thumb {
138
- appearance: none;
139
- width: 15px;
140
- height: 15px;
141
- border-radius: 50%;
142
- background: #2c3e50;
143
- cursor: pointer;
144
- transition: background 0.15s ease-in-out;
145
- }
146
- .range-slider {
147
- margin: 60px 0 0 0;
148
- }
149
- .range-slider {
150
- width: 100%;
151
- }
152
- input[type="range"]::-webkit-slider-thumb:hover {
153
- background: #00416F;
154
- }
155
- input[type="range"]:active::-webkit-slider-thumb {
156
- background: #00416F;
157
- }
158
- input[type="range"]::-moz-range-thumb {
159
- width: 15px;
160
- height: 15px;
161
- border: 0;
162
- border-radius: 50%;
163
- background: #2c3e50;
164
- cursor: pointer;
165
- transition: background 0.15s ease-in-out;
166
- }
167
- input[type="range"]::-moz-range-thumb:hover {
168
- background: #00416F;
169
- }
170
- input[type="range"]:active::-moz-range-thumb {
171
- background: #00416F;
172
- }
173
- input[type="range"]:focus::-webkit-slider-thumb {
174
- box-shadow: 0 0 0 3px #fff0, 0 0 0 6px #00416F00;
175
- }
176
- .range-slider__value {
177
- display: inline-block;
178
- position: relative;
179
- width: 60px;
180
- color: #fff;
181
- line-height: 20px;
182
- text-align: center;
183
- border-radius: 3px;
184
- background: #2c3e50;
185
- padding: 5px 10px;
186
- margin-left: 8px;
187
- }
188
- .range-slider__value:after {
189
- position: absolute;
190
- top: 8px;
191
- left: -7px;
192
- width: 0;
193
- height: 0;
194
- border-top: 7px solid transparent;
195
- border-right: 7px solid #2c3e50;
196
- border-bottom: 7px solid transparent;
197
- content: '';
198
- }
199
-
200
- input::-moz-focus-inner, input::-moz-focus-outer {
201
- border: 0;
202
- }
203
- `,Fc=`
204
- ${Er}
205
- ${$o}
206
- ${Po}
207
-
208
- [data-schemaid=root] > .je-header {
209
- display: none;
210
- }
211
- input[type="text"], select {
212
- box-sizing: border-box !important;
213
- width: 100% !important;
214
- margin: 0.5rem 0rem !important;
215
- padding: 5px 7px !important;
216
- border-radius: 4px !important;
217
- border: 1px solid #0004 !important;
218
- }
219
- .je-range-control {
220
- padding: 0.5rem 0;
221
- }
222
- .errmsg {
223
- font-size: x-small;
224
- }
225
- tc-range-slider{
226
- display: block;
227
- margin: 0.5rem 0;
228
- }
229
- `;(()=>{var n=r=>r==null?!1:typeof r=="boolean"?r:r.trim().toLowerCase()==="true";window.tcRangeSliderPlugins=window.tcRangeSliderPlugins||[];var t="min-label",e="max-label",i="#1E293B",s=()=>{let r=null,o=null,a=null,l,d=!1,h=i,u="",g,m=null,y=null,w=null,A=[],et=()=>{var T;let N=(T=r==null?void 0:r.shadowRoot)==null?void 0:T.querySelector(".range-slider-box");m=document.createElement("div"),m.classList.add("labels-row"),N.prepend(m)},W=T=>{let N=document.createElement("label");return N.className=T,N.setAttribute("for","range-slider"),N},_t=()=>{y=W(t),y.textContent=ot(a==null?void 0:a.getTextMin(),u),w=W(e),w.textContent=ot(a==null?void 0:a.getTextMax(),u),o==null||o.before(y),o==null||o.after(w);let T=a==null?void 0:a.getValues();if(T)for(let N=0;N<T.length;N++){let xt=W(`value${N+1}-label generated-label`);xt.textContent=ot(T[N],u),A.push(xt),m==null||m.append(xt)}},pt=()=>{for(let T of A)!T||T.remove();y==null||y.remove(),w==null||w.remove(),m==null||m.remove(),A=[]},kt=T=>{d=T,d?(et(),_t()):pt()},H=T=>{h=T;for(let N of A)!N||(N.style.color=h??i);y&&(y.style.color=h??i),w&&(w.style.color=h??i)},ut=T=>{u=T,l&&l()},Rt=()=>{!a||!m||m.classList.toggle("is-reversed",a.isRightToLeft()||a.isBottomToTop())},ot=(T,N)=>{let xt=`${(T??"").toString()}${N}`;return g&&typeof g=="function"?g(T):xt};return{get name(){return"Generated Labels"},init:(T,N,xt,Ct)=>{var St,Xt,Jt;r=T,a=Ct,o=(St=T.shadowRoot)==null?void 0:St.getElementById("range-slider"),l=N,h=(Xt=r.getAttribute("generate-labels-text-color"))!=null?Xt:i,u=(Jt=r.getAttribute("generate-labels-units"))!=null?Jt:"",kt(n(r.getAttribute("generate-labels"))),Rt(),H(h)},update:T=>{if(!(!d||!T.values)){Rt();for(let N=0;N<T.values.length;N++){let xt=T.values[N],Ct=A[N];if(xt===void 0&&Ct){Ct.remove(),A[N]=void 0;continue}if(xt!==void 0&&!Ct){let St=W(`value${N+1}-label generated-label`);if(St.textContent=ot(xt,u),A[N]=St,T.values.length<=0)m==null||m.append(St);else if(N===0)m==null||m.append(St);else{let Xt=A[N-1];Xt==null||Xt.after(St)}continue}!Ct||(Ct.textContent=ot(xt,u))}y&&(y.textContent=ot(T.textMin,u)),w&&(w.textContent=ot(T.textMax,u)),H(h)}},onAttrChange:(T,N)=>{T==="generate-labels"&&kt(n(N)),T==="generate-labels-text-color"&&H(N),T==="generate-labels-units"&&ut(N)},gettersAndSetters:[{name:"generateLabels",attributes:{get(){return d??!1},set:T=>{kt(n(T))}}},{name:"textColor",attributes:{get(){return h??""},set:T=>{H(T)}}},{name:"generateLabelsTextColor",attributes:{get(){return h??""},set:T=>{H(T)}}},{name:"units",attributes:{get(){return u??""},set:T=>{ut(T)}}},{name:"generateLabelsUnits",attributes:{get(){return u??""},set:T=>{ut(T)}}},{name:"generateLabelsFormat",attributes:{get(){return g},set:T=>{g=T,l&&l()}}}],css:`
230
- .labels-row{
231
- text-align: center;
232
- display: flex;
233
- justify-content: center;
234
- }
235
-
236
- .is-reversed,
237
- .is-reversed + .row{
238
- flex-direction: row-reverse;
239
- }
240
-
241
- .type-vertical{
242
- position: relative;
243
- }
244
-
245
- .type-vertical .labels-row{
246
- flex-direction: column;
247
- position: absolute;
248
- top: 50%;
249
- right: -100%;
250
- transform: translateY(-50%);
251
- }
252
-
253
- .type-vertical .is-reversed,
254
- .type-vertical .is-reversed + .row{
255
- flex-direction: column-reverse;
256
- }
257
-
258
- .max-label,
259
- .min-label{
260
- margin: 0 1rem;
261
- width: 2rem;
262
- text-align: center;
263
- white-space: nowrap;
264
- }
265
-
266
- .generated-label{
267
- text-align: center;
268
- margin: 0 0.5rem;
269
- white-space: nowrap;
270
- }
271
- `,destroy:pt}};window.tcRangeSliderPlugins.push(s)})(),(()=>{var n=Object.defineProperty,t=Math.pow,e=(c,f,_)=>f in c?n(c,f,{enumerable:!0,configurable:!0,writable:!0,value:_}):c[f]=_,i=(c,f,_)=>(e(c,typeof f!="symbol"?f+"":f,_),_),s=(c,f)=>` ${f&&f.length>0?f.map(_=>`<link rel="stylesheet" href="${_}" />`).join(""):""} <style> ${c} </style> <div class="range-slider-box"> <div class="row"> <div id="range-slider" class="range-slider"> <div class="container"> <div class="panel"></div> <div class="panel-fill"></div> <div class="container"> <div class="pointer" tabindex="0" role="slider"> <div class="pointer-shape"></div> </div> </div> </div> </div> </div> </div>`,r=":host{--width:300px;--height:.25rem;--opacity:.4;--panel-bg:#cbd5e1;--panel-bg-hover:#94a3b8;--panel-bg-fill:#475569;--panel-bg-border-radius:1rem;--pointer-width:1rem;--pointer-height:1rem;--pointer-bg:#fff;--pointer-bg-hover:#dcdcdc;--pointer-bg-focus:#dcdcdc;--pointer-shadow:0 0 2px rgba(0,0,0,0.8);--pointer-shadow-hover:0 0 2px #000;--pointer-shadow-focus:var(--pointer-shadow-hover);--pointer-border:1px solid hsla(0,0%,88%,0.5);--pointer-border-hover:1px solid #94a3b8;--pointer-border-focus:var(--pointer-border-hover);--pointer-border-radius:100%;--animate-onclick:.3s}:host{max-width:100%}.range-slider-box{display:flex;position:relative;flex-direction:column}.range-slider{position:relative;width:var(--width,100%);height:var(--height,0.25rem);touch-action:none;max-width:100%;box-sizing:border-box;cursor:pointer}.row{width:100%;display:flex;align-items:center}.range-slider.disabled{opacity:var(--opacity,0.4);cursor:default}.pointer.disabled{-webkit-filter:brightness(0.8);filter:brightness(0.8);cursor:default}.range-slider *{box-sizing:border-box}.container{position:absolute;width:100%;height:100%}.panel{position:absolute;z-index:10;width:100%;height:100%;background:var(--panel-bg,#2d4373);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;transition:.3s all ease}.panel-fill{background:var(--panel-bg-fill,#000);border-radius:var(--panel-bg-border-radius,1rem);overflow:hidden;height:100%;position:absolute;z-index:10}.panel:hover{background:var(--panel-bg-hover,#5f79b7)}.disabled .panel:hover{background:var(--panel-bg,#5f79b7)}.pointer{position:absolute;z-index:20;outline:0;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;box-shadow:var(--pointer-shadow);border:var(--pointer-border);border-radius:var(--pointer-border-radius,100%);-webkit-transform:translateX(-50%);transform:translateX(-50%);width:var(--pointer-width,15px);height:var(--pointer-height,15px);transition:.3s all ease}.pointer-shape:hover{background:var(--pointer-bg-hover,#fff);background-size:contain;border:var(--pointer-border-hover);box-shadow:var(--pointer-shadow-hover)}.disabled .pointer-shape:hover{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.pointer:focus .pointer-shape{background:var(--pointer-bg-focus,#fff);background-size:contain;border:var(--pointer-border-focus);box-shadow:var(--pointer-shadow-focus)}.disabled .pointer:focus .pointer-shape{background:var(--pointer-bg,#fff);background-size:contain;border:var(--pointer-border);box-shadow:var(--pointer-shadow)}.type-vertical .range-slider{--width:.25rem;--height:300px;max-height:100%}.type-vertical .range-slider .pointer{left:50%}.type-vertical .range-slider .panel-fill{width:100%}.type-vertical.range-slider-box{flex-direction:row}.type-vertical .row{flex-direction:column}.animate-on-click .pointer,.animate-on-click .panel-fill{transition:all var(--animate-onclick)}.range-dragging .panel-fill{cursor:move}",o="pointers-overlap",a="pointers-min-distance",l="pointers-max-distance",d="range-dragging",h="data",u="min",g="max",m="step",y="round",w="type",A="theme",et="rtl",W="btt",_t="disabled",pt="keyboard-disabled",kt="mousewheel-disabled",H="slider-width",ut="slider-height",Rt="slider-radius",ot="slider-bg",T="slider-bg-hover",N="slider-bg-fill",xt="pointer-width",Ct="pointer-height",St="pointer-radius",Xt="pointer-bg",Jt="pointer-bg-hover",Ke="pointer-bg-focus",Re="pointer-shadow",Sr="pointer-shadow-hover",Zo="pointer-shadow-focus",Ss="pointer-border",Tr="pointer-border-hover",ku="pointer-border-focus",Wo="animate-onclick",Su="css-links",ne="vertical",ti="horizontal",jr=(c,f,_,b,C)=>{let I=f-c;return I===0?_:(b-_)*(C-c)/I+_},ye=c=>!isNaN(parseFloat(c))&&isFinite(c),vt=(c,f)=>ye(c)?Number(c):f,Yo=(c,f)=>f===0?0:Math.round(c/f)*f,Tu=(c,f=1/0)=>{if(f===1/0)return c;let _=t(10,f);return Math.round(c*_)/_},Ot=c=>c==null?!1:typeof c=="boolean"?c:c.trim().toLowerCase()==="true",ju=(c,f)=>{c.dispatchEvent(new CustomEvent("onPointerClicked",{detail:{$pointer:f}}))},$u=(c,f)=>{c.dispatchEvent(new CustomEvent("onMouseDown",{detail:{nativeEvent:f}}))},Pu=(c,f)=>{c.dispatchEvent(new CustomEvent("onMouseUp",{detail:{nativeEvent:f}}))},Ou=(c,f)=>{c.dispatchEvent(new CustomEvent("onKeyDown",{detail:{nativeEvent:f}}))},Iu=(c,f)=>{if(!f||f.length<=0)return;let _=f.map(C=>ye(C)?vt(C,C):C),b={values:_||[]};b.value=_[0],b.value0=_[0],b.value1=_[0];for(let C=1;C<_.length;C++)b[`value${C+1}`]=_[C];c.dispatchEvent(new CustomEvent("change",{detail:b}))},$r=(c,f,_)=>{let b=0,C,I,M,E,L=!1,F=(R,at,Tt,Et,ft,mt)=>{let Ft=b;Tt!==void 0&&R>Tt&&(R=Tt),at!==void 0&&R<at&&(R=at),b=R;let zt=b;return(Et===ne&&mt||Et===ti&&ft)&&(zt=100-zt),Et===ne?f.style.top=`${zt}%`:f.style.left=`${zt}%`,Ft!==b},G=R=>R===f||f.contains(R),j=(R,at,Tt,Et)=>{C=R,I=at,M=Tt,E=Et},it=R=>{L=R,f.classList.toggle("disabled",L),L?f.setAttribute("aria-disabled","true"):f.hasAttribute("aria-disabled")&&f.removeAttribute("aria-disabled")},te=(R,at)=>{at==null?f.removeAttribute(R):f.setAttribute(R,at)},Dt=R=>f.getAttribute(R),B=R=>{if(!L){switch(R.key){case"ArrowLeft":{R.preventDefault(),typeof C=="function"&&C(_);break}case"ArrowRight":{R.preventDefault(),typeof I=="function"&&I(_);break}case"ArrowUp":{R.preventDefault(),typeof M=="function"&&M(_);break}case"ArrowDown":{R.preventDefault(),typeof E=="function"&&E(_);break}}Ou(c,R)}},U=()=>{L||ju(c,f)};return f.className=`pointer pointer-${_}`,f.addEventListener("keydown",B),f.addEventListener("click",U),{$pointer:f,get percent(){return b},get disabled(){return L},set disabled(R){it(R)},updatePosition:F,isClicked:G,setCallbacks:j,setAttr:te,getAttr:Dt,destroy:()=>{f.removeEventListener("keydown",B),f.removeEventListener("click",U),f.remove()}}},Bu=c=>{if(c==null)return;if(Array.isArray(c))return c;if(c.trim()==="")return;let f=c.split(","),_=[],b=!0;for(let C=0;C<f.length;C++){let I=f[C].trim();I!==""&&(_.push(I),ye(I)||(b=!1))}return b?_.map(C=>Number(C)):_},Ru=(c,f)=>f?f.findIndex(_=>_===c||_.toString().trim()===c.toString().trim()):-1,Du=c=>({updatePosition:(f,_,b,C)=>{if(_.length<=0)return;let I=_.length===1,M=_[0],E=_[_.length-1];f===ne?(c.style.removeProperty("width"),c.style.removeProperty("right"),c.style.removeProperty("left"),I?c.style.height=`${M}%`:c.style.height=`${Math.abs(M-E)}%`,C?(c.style.bottom="0%",I?c.style.top="auto":c.style.top=`${Math.min(100-E,100-M)}%`):(c.style.bottom="auto",I?c.style.top="0%":c.style.top=`${Math.min(M,E)}%`)):(c.style.removeProperty("height"),c.style.removeProperty("top"),c.style.removeProperty("bottom"),I?c.style.width=`${M}%`:c.style.width=`${Math.abs(M-E)}%`,b?(c.style.right="0%",I?c.style.left="auto":c.style.left=`${Math.min(100-E,100-M)}%`):(c.style.right="auto",I?c.style.left="0%":c.style.left=`${Math.min(M,E)}%`))}}),Xo="--animate-onclick",Nu="--width",Mu="--height",Hu="--panel-bg-border-radius",Vu="--panel-bg",Fu="--panel-bg-hover",zu="--panel-bg-fill",Uu="--pointer-width",qu="--pointer-height",Gu="--pointer-border-radius",Zu="--pointer-bg",Wu="--pointer-bg-hover",Yu="--pointer-bg-focus",Xu="--pointer-shadow",Ju="--pointer-shadow-hover",Qu="--pointer-shadow-focus",Ku="--pointer-border",tp="--pointer-border-hover",ep="--pointer-border-focus",Ts=(c,f,_)=>{let b=new Map;for(let C of c.attributes){let I=C.nodeName.trim().toLowerCase();if(!f.test(I))continue;let M=I.replace(/\D/g,"").trim(),E=M===""||M==="0"||M==="1"?0:vt(M,0)-1,L=_&&typeof _=="function"?_(C.value):C.value;b.set(E,L)}return b},ip=c=>{if(!c)return null;let f=c.getAttribute(Su);if(!f)return null;let _=f.split(";"),b=[];for(let C of _)C.trim()!==""&&b.push(C.trim());return b},Jo=[[Nu,H,"sliderWidth",null],[Mu,ut,"sliderHeight",null],[Hu,Rt,"sliderRadius",null],[Vu,ot,"sliderBg",null],[Fu,T,"sliderBgHover",null],[zu,N,"sliderBgFill",null],[Uu,xt,"pointer#Width",/^pointer([0-9]*)-width$/],[qu,Ct,"pointer#Height",/^pointer([0-9]*)-height$/],[Gu,St,"pointer#Radius",/^pointer([0-9]*)-radius$/],[Zu,Xt,"pointer#Bg",/^pointer([0-9]*)-bg$/],[Wu,Jt,"pointer#BgHover",/^pointer([0-9]*)-bg-hover$/],[Yu,Ke,"pointer#BgFocus",/^pointer([0-9]*)-bg-focus$/],[Xu,Re,"pointer#Shadow",/^pointer([0-9]*)-shadow$/],[Ju,Sr,"pointer#ShadowHover",/^pointer([0-9]*)-shadow-hover$/],[Qu,Zo,"pointer#ShadowFocus",/^pointer([0-9]*)-shadow-focus$/],[Ku,Ss,"pointer#Border",/^pointer([0-9]*)-border$/],[tp,Tr,"pointer#BorderHover",/^pointer([0-9]*)-border-hover$/],[ep,ku,"pointer#BorderFocus",/^pointer([0-9]*)-border-focus$/]],sp=(c,f,_)=>{let b=null,C=[],I=new Map,M=(B,U=f)=>{let R=[...U.classList];for(let at of R)at.startsWith(B)&&f.classList.remove(at)},E=()=>{M("shape");let B=f.querySelectorAll(".pointer");for(let U of B)M("shape",U)},L=B=>{b=B,M("theme-"),typeof B=="string"&&f.classList.add(`theme-${B}`)},F=()=>{if(E(),!(C.length<=0)){f.classList.add("shape",`shape-${C[0]}`);for(let B=1;B<C.length;B++){let U=C[B];if(!U)continue;let R=f.querySelector(`.pointer-${B}`);!R||R.classList.add("shape",`shape-${U}`)}}},G=(B,U)=>{C[B]=U,F()},j=()=>{E();let B=Ts(c,/^pointer([0-9]*)-shape$/);if(!(B.size<=0)){for(let U of B){let R=U[0];C[R]=U[1]}F()}},it=(B,U)=>`${B}-${U}`,te=(B,U,R)=>{let at=_[R];if(!at)return;let Tt=R===0?f:at.$pointer;if(U==null){I.has(it(B,R))&&I.delete(it(B,R)),Tt.style.removeProperty(B);return}I.set(it(B,R),U),Tt.style.setProperty(B,U)},Dt=(B,U)=>I.get(it(B,U));return(()=>{for(let B of Jo){let[U,R,at,Tt]=B;if(Tt){let ft=Ts(c,Tt);for(let mt of ft){let Ft=mt[0],zt=mt[1];te(U,zt,Ft)}}else{let ft=c.getAttribute(R);te(U,ft,0)}let Et=[];if(at.indexOf("#")===-1)Et.push([at,0]);else{Et.push([at.replace("#",""),0]),Et.push([at.replace("#","0"),0]),Et.push([at.replace("#","1"),0]);for(let ft=1;ft<_.length;ft++)Et.push([at.replace("#",(ft+1).toString()),ft])}for(let ft of Et)try{let mt=ft[0],Ft=ft[1];Object.prototype.hasOwnProperty.call(c,mt)||Object.defineProperty(c,mt,{get(){return Dt(U,Ft)},set:zt=>{te(U,zt,Ft)}})}catch(mt){console.error(mt)}}L(c.getAttribute(A)),j()})(),{setStyle:te,getStyle:Dt,get theme(){return b},set theme(B){L(B)},get pointerShapes(){return C},setPointerShape:G}},ei="animate-on-click",Qo="range-dragging",rp=(c,f,_,b)=>{let C=[],I=G=>{for(let j of C)j.update&&typeof j.update=="function"&&j.update(G)},M=()=>{for(let G of C)G.destroy&&typeof G.destroy=="function"&&G.destroy()},E=(G,j)=>{for(let it of C)it.onAttrChange&&typeof it.onAttrChange=="function"&&it.onAttrChange(G,j)},L=G=>{if(G.gettersAndSetters){for(let j of G.gettersAndSetters)if(!(!j.name||!j.attributes))try{Object.prototype.hasOwnProperty.call(c,j.name)||Object.defineProperty(c,j.name,j.attributes)}catch(it){console.error("defineSettersGetters error:",it)}}},F=G=>{var j;if(!G.css)return;let it=(j=c.shadowRoot)==null?void 0:j.querySelector("style");!it||(it.innerHTML+=G.css)};return{init:()=>{if(window.tcRangeSliderPlugins)for(let G of window.tcRangeSliderPlugins){let j=G();C.push(j),j.init&&typeof j.init=="function"&&(j.init(c,f,_,b),L(j),F(j))}},update:I,onAttrChange:E,destroy:M}},np=10,Ko=20,op=(c,f)=>{let _=new Map,b=/^value([0-9]*)$/;for(let E of c.attributes){let L=E.nodeName.trim().toLowerCase();if(!b.test(L))continue;let F=L.replace("value","").trim(),G=F===""||F==="0"||F==="1"?0:vt(F,0)-1,j=ye(E.value)?vt(E.value,0):E.value;_.set(G,j)}let C=Math.max(...Array.from(_.keys())),I=[];I.push([$r(c,f,0),_.get(0)]);let M=f;for(let E=1;E<=C;E++){let L=f.cloneNode(!0);M.after(L),M=L,I.push([$r(c,L,E),_.get(E)])}return I},ta=(c,f,_,b,C,I,M)=>{try{Object.defineProperty(c,b,{configurable:!0,get(){if(!f)return;let E=f.pointers[_];if(!E)return;let L=f.getTextValue(E.percent);return ye(L)?vt(L,L):L},set:E=>{f.pointers[_]?f==null||f.setValue(E,_):f==null||f.addPointer(E)}}),Object.defineProperty(c,C,{configurable:!0,get(){var E,L;return(L=(E=f==null?void 0:f.pointers[_])==null?void 0:E.getAttr("aria-label"))!=null?L:void 0},set:E=>{!f||f.setAriaLabel(_,E)}}),Object.defineProperty(c,I,{configurable:!0,get(){var E,L;return(L=(E=f==null?void 0:f.styles)==null?void 0:E.pointerShapes[_])!=null?L:null},set:E=>{!f||!f.styles||f.styles.setPointerShape(_,E)}}),Object.defineProperty(c,M,{configurable:!0,get(){var E;return(E=f==null?void 0:f.pointers[_].disabled)!=null?E:!1},set:E=>{if(!f)return;let L=f==null?void 0:f.pointers[_];!L||(L.disabled=E)}})}catch(E){console.error(E)}},ap=(c,f)=>{let _=[["value","ariaLabel","pointerShape","pointerDisabled",0],["value0","ariaLabel0","pointerShape0","pointer0Disabled",0],["value1","ariaLabel1","pointerShape1","pointer1Disabled",0]];for(let b=2;b<np;b++)_.push([`value${b}`,`ariaLabel${b}`,`pointer${b}Shape`,`pointer${b}Disabled`,b-1]);for(let b of _)ta(c,f,b[4],b[0],b[1],b[2],b[3])},ea=(c,f,_)=>{var b;let C=(b=_.shadowRoot)==null?void 0:b.querySelector(".container");if(C)for(let I of c)f?C.prepend(I.$pointer):C.append(I.$pointer)},lp=(c,f)=>{if(!(!f||c.length<=1)){for(let _ of c)_.$pointer.style.zIndex=Ko.toString();f.$pointer.style.zIndex=(Ko*2).toString()}},Pr=0,$i=100,ii=2,ia="0.3s",dp=(c,f,_)=>{let b=_.map(p=>p[0]),C=null,I=null,M=null,E=null,L=Pr,F=$i,G,j,it=ti,te=ii,Dt=!1,B=!1,U=!1,R=0,at=1/0,Tt=!1,Et,ft,mt=!1,Ft=!1,zt=!1,Ee=ia,sa=[],ra=p=>{mt||(p.preventDefault&&p.preventDefault(),De(p),window.addEventListener("mousemove",De),window.addEventListener("mouseup",js),$u(c,p))},js=p=>{mt||(Et=void 0,ft=void 0,window.removeEventListener("mousemove",De),window.removeEventListener("mouseup",js),Ee&&f.classList.add(ei),Pu(c,p))},up=(p,v)=>{if(b.length<=0)return;if(b.length===1)return b[0].isClicked(p)&&Ee&&f.classList.remove(ei),b[0];let S=fp(p);if(Tt){let Q=v,oe=Ps(Q);oe!==void 0&&(Q=Yo(Q,oe)),S?(Et=Q,ft=0,Ee&&f.classList.remove(ei)):Et!==void 0&&(ft=Q-Et,Et=Q)}if(!pp(p)&&!S){for(let Q of b)if(!(!Q.isClicked(p)||Q.disabled))return Ee&&f.classList.remove(ei),Q;for(let Q of b)if(C===Q)return Q}let st=1/0,gt=null;for(let Q of b){if(Q.disabled)continue;let oe=Math.abs(v-Q.percent);oe<st&&(st=oe,gt=Q)}return gt},na=()=>b.findIndex(p=>C===p&&!p.disabled),De=p=>{let v;if(it===ne){let{height:st,top:gt}=f.getBoundingClientRect(),Q=p.type.indexOf("mouse")!==-1?p.clientY:p.touches[0].clientY;v=Math.min(Math.max(0,Q-gt),st)*100/st}else{let{width:st,left:gt}=f.getBoundingClientRect(),Q=p.type.indexOf("mouse")!==-1?p.clientX:p.touches[0].clientX;v=Math.min(Math.max(0,Q-gt),st)*100/st}if((Dt||B)&&(v=100-v),C=up(p.target,v),C&&lp(b,C),Tt&&b.length>1&&ft!==void 0){let st=b[0],gt=b[b.length-1],Q=st.percent+ft<0,oe=gt.percent+ft>100;if(Q||oe)return;for(let Hs=0;Hs<b.length;Hs++)Ut(Hs,b[Hs].percent+ft);return}let S=na();S!==-1&&(Ut(S,v),C==null||C.$pointer.focus())},$s=p=>{if(mt||document.activeElement!==c||C!=null&&C.disabled)return;p.stopPropagation(),p.preventDefault();let v=p.deltaY<0,S=Dt||B,st=v?!S:S,gt=na();gt!==-1&&(st?Pi(gt,b[gt].percent):Oi(gt,b[gt].percent))},oa=p=>{mt||Ft||(it===ne?B?Ut(p,100):Ut(p,0):Dt?Oi(p,b[p].percent):Pi(p,b[p].percent))},aa=p=>{mt||Ft||(it===ne?B?Ut(p,0):Ut(p,100):Dt?Pi(p,b[p].percent):Oi(p,b[p].percent))},la=p=>{mt||Ft||(it===ne?B?Oi(p,b[p].percent):Pi(p,b[p].percent):Dt?Ut(p,100):Ut(p,0))},da=p=>{mt||Ft||(it===ne?B?Pi(p,b[p].percent):Oi(p,b[p].percent):Dt?Ut(p,0):Ut(p,100))},pp=p=>p.classList.contains("panel"),fp=p=>p.classList.contains("panel-fill"),Pi=(p,v)=>{if(v===void 0)return;let S=Ps(v);S==null&&(S=1),v-=S,v<0&&(v=0),Ut(p,v)},Oi=(p,v)=>{if(v===void 0)return;let S=Ps(v);S==null&&(S=1),v+=S,v>100&&(v=100),Ut(p,v)},Ne=()=>{!E||E.update({percents:ha(),values:ca(),$pointers:ua(),min:pa(),max:fa(),data:Br(),step:Ir(),round:Dr(),type:Rr(),textMin:Os(),textMax:Is(),rightToLeft:Hr(),bottomToTop:Vr(),pointersOverlap:qr(),pointersMinDistance:Nr(),pointersMaxDistance:Mr(),rangeDragging:Gr(),disabled:Fr(),keyboardDisabled:zr(),mousewheelDisabled:Ur()})},mp=()=>{Ne()},gp=p=>{if(!(U||b.length<=1||F===L))if(p===0){let v=at*100/(F-L);return Math.max(0,b[p+1].percent-v)}else{let v=R*100/(F-L);return Math.min(b[p-1].percent+v,100)}},bp=p=>{if(!(U||b.length<=1||F===L))if(p===b.length-1){let v=at*100/(F-L);return Math.min(b[p-1].percent+v,100)}else{let v=R*100/(F-L);return Math.max(0,b[p+1].percent-v)}},Ps=p=>{let v;if(typeof G=="function"){let S=jr(0,100,L,F,p);v=G(S,p)}else v=G;if(ye(v)){let S=F-L;return v=S===0?0:v*100/S,v}},si=p=>{if(p===void 0)return;let v=jr(0,100,L,F,p);return j!==void 0?j[Math.round(v)]:Tu(v,te)},Os=()=>j!==void 0?j[L]:L,Is=()=>j!==void 0?j[F]:F,Ir=()=>G,yp=p=>{var v;return p<=0||U?Os():(v=si(b[p-1].percent))!=null?v:""},_p=p=>{var v;return b.length<=1||p>=b.length-1||U?Is():(v=si(b[p+1].percent))!=null?v:""},ha=()=>b.map(p=>p.percent),ca=()=>b.map(p=>si(p.percent)),ua=()=>b.map(p=>p.$pointer),pa=()=>L,fa=()=>F,Br=()=>j,Rr=()=>it,Dr=()=>te,Nr=()=>R,Mr=()=>at,vp=p=>sa[p],Hr=()=>Dt,Vr=()=>B,Fr=()=>mt,zr=()=>Ft,Ur=()=>zt,qr=()=>U,Gr=()=>Tt,Ut=(p,v)=>{if(v===void 0)return;let S=Ps(v);S!==void 0&&(v=Yo(v,S));let st=b[p];if(!st)return;let gt=st.updatePosition(v,gp(p),bp(p),it,Dt,B);I==null||I.updatePosition(it,b.map(Q=>Q.percent),Dt,B),Ne();for(let Q of b){let oe=si(Q.percent);oe!==void 0&&(Q.setAttr("aria-valuenow",oe.toString()),Q.setAttr("aria-valuetext",oe.toString()))}xp(),gt&&Iu(c,b.map(Q=>si(Q.percent)))},de=()=>{for(let p=0;p<b.length;p++)Ut(p,b[p].percent)},wp=(p,v)=>{L=j!==void 0?0:vt(p,Pr),F=j!==void 0?j.length-1:vt(v,$i),Bs(L),Rs(F)},xp=()=>{var p,v;for(let S=0;S<b.length;S++){let st=b[S];st.setAttr("aria-valuemin",((p=yp(S))!=null?p:"").toString()),st.setAttr("aria-valuemax",((v=_p(S))!=null?v:"").toString())}},Bs=p=>{L=vt(p,Pr),L>F&&(F=L+$i),de()},Rs=p=>{F=vt(p,$i),F<L&&(F=L+$i),de()},ma=p=>{U=!0;for(let v=0;v<p.length;v++)Ds(p[v],v);U=!1;for(let v=0;v<p.length;v++)Ds(p[v],v)},Ds=(p,v)=>{let S;j!==void 0?(S=p==null?0:Ru(p,j),S===-1&&(S=0)):(S=vt(p,L),S<L&&(S=L),S>F&&(S=F));let st=jr(L,F,0,100,S);Ut(v,st)},Ns=p=>{if(p==null){G=void 0;return}if(typeof p=="function"){G=p,de();return}if(ye(p)){G=vt(p,1);let v=Math.abs(F-L);G>v&&(G=void 0),de();return}G=void 0},Zr=p=>{U=p,de()},Wr=p=>{(!ye(p)||p<0)&&(p=0),R=p},Yr=p=>{(!ye(p)||p<0)&&(p=1/0),at=p},Xr=p=>{mt=p,f.classList.toggle("disabled",mt),mt?f.setAttribute("aria-disabled","true"):f.hasAttribute("aria-disabled")&&f.removeAttribute("aria-disabled")},ga=p=>{Ft=p},ba=p=>{zt=p,zt?document.removeEventListener("wheel",$s):document.addEventListener("wheel",$s,{passive:!1})},Jr=p=>{if(p==null){j=void 0;return}if(j=Bu(p),j===void 0||j.length<=0){j=void 0;return}Bs(0),Rs(j.length-1),G===void 0&&Ns(1)},Qr=p=>{var v;typeof p=="string"?it=p.trim().toLowerCase()===ne?ne:ti:it=ti;let S=(v=c.shadowRoot)==null?void 0:v.querySelector(".range-slider-box");if(!S)return;S.className=`range-slider-box type-${it}`,de();let st=it===ne?"vertical":"horizontal";for(let gt of b)gt.setAttr("aria-orientation",st)},Kr=p=>{Dt=p,b.length>1&&ea(b,Dt,c),de(),Ne()},tn=p=>{B=p,b.length>1&&ea(b,B,c),de(),Ne()},en=p=>{te=vt(p,ii),te<0&&(te=ii),Ne()},ya=p=>{p==null||p.toString().trim().toLowerCase()==="false"?(Ee=void 0,f.style.removeProperty(Xo),f.classList.remove(ei)):(Ee=p.toString(),f.style.setProperty(Xo,Ee),f.classList.add(ei))},_a=(p,v)=>{let S=b[p];!S||(S.setAttr("aria-label",v),sa[p]=v)},Ms=p=>{if(Et=void 0,b.length<=1){Tt=!1,f.classList.remove(Qo);return}Tt=p,f.classList.toggle(Qo,Tt)},Cp=()=>{Xr(Ot(c.getAttribute(_t))),Ft=Ot(c.getAttribute(pt)),zt=Ot(c.getAttribute(kt));let p=Ts(c,/^pointer([0-9]*)-disabled$/,v=>Ot(v));for(let v of p){let S=v[0];!b[S]||(b[S].disabled=v[1])}},Ep=()=>{let p=Ts(c,/^aria-label([0-9]*)$/);for(let v of p){let S=v[0];_a(S,v[1])}},Lp=p=>{let v=b.length,S=b[v-1].$pointer,st=S.cloneNode(!0);S.after(st);let gt=$r(c,st,v);return gt.setCallbacks(oa,aa,la,da),b.push(gt),Ds(p,v),de(),Ne(),v},Ap=()=>{let p=b.length,v=b[p-1];return v?(v.destroy(),b.pop(),b.length<=1&&Ms(!1),de(),Ne(),p-1):-1};return(()=>{var p,v;for(let st of b)st.setCallbacks(oa,aa,la,da);let S=(p=c.shadowRoot)==null?void 0:p.querySelector(".panel-fill");S&&(I=Du(S)),Qr(c.getAttribute(w)),Kr(Ot(c.getAttribute(et))),tn(Ot(c.getAttribute(W))),wp(c.getAttribute(u),c.getAttribute(g)),Ns(c.getAttribute(m)),Jr(c.getAttribute(h)),ma(_.map(st=>st[1])),Zr(Ot(c.getAttribute(o))),Wr(vt(c.getAttribute(a),0)),Yr(vt(c.getAttribute(l),1/0)),Ms(Ot(c.getAttribute(d))),en(vt(c.getAttribute(y),ii)),Cp(),Ep(),M=sp(c,f,b),ya((v=c.getAttribute(Wo))!=null?v:ia),f.addEventListener("mousedown",ra),f.addEventListener("mouseup",js),f.addEventListener("touchmove",De),f.addEventListener("touchstart",De),zt||document.addEventListener("wheel",$s,{passive:!1}),E=rp(c,mp,{setValues:ma,setMin:Bs,setMax:Rs,setStep:Ns,setPointersOverlap:Zr,setPointersMinDistance:Wr,setPointersMaxDistance:Yr,setDisabled:Xr,setType:Qr,setRightToLeft:Kr,setBottomToTop:tn,setRound:en,setKeyboardDisabled:ga,setMousewheelDisabled:ba,setRangeDragging:Ms,setData:Jr},{getPercents:ha,getValues:ca,getPointerElements:ua,getMin:pa,getMax:fa,getStep:Ir,getData:Br,getType:Rr,getRound:Dr,getTextMin:Os,getTextMax:Is,isRightToLeft:Hr,isBottomToTop:Vr,isDisabled:Fr,isKeyboardDisabled:zr,isMousewheelDisabled:Ur,isPointersOverlap:qr,isRangeDraggingEnabled:Gr,getPointersMinDistance:Nr,getPointersMaxDistance:Mr}),E.init()})(),{get pointers(){return b},get styles(){return M},get pluginsManager(){return E},get min(){return Os()},get max(){return Is()},get step(){return Ir()},get pointersOverlap(){return qr()},set pointersOverlap(p){Zr(p)},get pointersMinDistance(){return Nr()},set pointersMinDistance(p){Wr(p)},get pointersMaxDistance(){return Mr()},set pointersMaxDistance(p){Yr(p)},get disabled(){return Fr()},set disabled(p){Xr(p)},get data(){return Br()},get type(){return Rr()},set type(p){Qr(p)},get rightToLeft(){return Hr()},set rightToLeft(p){Kr(p)},get bottomToTop(){return Vr()},set bottomToTop(p){tn(p)},get round(){return Dr()},set round(p){en(p)},get animateOnClick(){return Ee},set animateOnClick(p){ya(p)},get keyboardDisabled(){return zr()},set keyboardDisabled(p){ga(p)},get mousewheelDisabled(){return Ur()},set mousewheelDisabled(p){ba(p)},get rangeDragging(){return Gr()},set rangeDragging(p){Ms(p)},setMin:Bs,setMax:Rs,setValue:Ds,setStep:Ns,setData:Jr,getTextValue:si,setAriaLabel:_a,getAriaLabel:vp,addPointer:Lp,removePointer:Ap,destroy:()=>{f.removeEventListener("mousedown",ra),f.removeEventListener("mouseup",js),f.removeEventListener("touchmove",De),f.removeEventListener("touchstart",De),document.removeEventListener("wheel",$s);for(let p of b)p.destroy();E==null||E.destroy()}}},hp=(c,f,_)=>{let b=Jo.find(([E,L,F,G])=>L.replace("#","")===f.replace(/\d+/g,""));if(b&&c.styles){let[E,L,F,G]=b,j=f.replace(/\D/g,"").trim(),it=j===""||j==="0"||j==="1"?0:vt(j,0)-1;c.styles.setStyle(E,_,it);return}switch(c&&c.pluginsManager&&c.pluginsManager.onAttrChange(f,_),f){case u:{c.setMin(_);break}case g:{c.setMax(_);break}case m:{c.setStep(_);break}case o:{c.pointersOverlap=Ot(_);break}case a:{c.pointersMinDistance=vt(_,0);break}case d:{c.rangeDragging=Ot(_);break}case l:{c.pointersMaxDistance=vt(_,1/0);break}case _t:{c.disabled=Ot(_);break}case pt:{c.keyboardDisabled=Ot(_);break}case kt:{c.mousewheelDisabled=Ot(_);break}case h:{c.setData(_);break}case w:{c.type=_;break}case et:{c.rightToLeft=Ot(_);break}case W:{c.bottomToTop=Ot(_);break}case y:{c.round=vt(_,ii);break}case A:{c.styles&&(c.styles.theme=_);break}case Wo:{c.animateOnClick=_;break}}let C=null;if(/^value([0-9]*)$/.test(f)&&(C="value"),/^pointer([0-9]*)-disabled$/.test(f)&&(C="pointer-disabled"),/^aria-label([0-9]*)$/.test(f)&&(C="aria-label"),/^pointer([0-9]*)-shape$/.test(f)&&(C="pointer-shape"),!C)return;let I=f.replace(/\D/g,"").trim(),M=I===""||I==="0"||I==="1"?0:vt(I,0)-1;switch(C){case"value":{c.setValue(_,M);break}case"pointer-disabled":{let E=c==null?void 0:c.pointers[M];if(!E)return;E.disabled=Ot(_);break}case"aria-label":{c.setAriaLabel(M,_);break}case"pointer-shape":{c.styles&&c.styles.setPointerShape(M,_);break}}},cp=class extends HTMLElement{constructor(){super(),i(this,"slider"),i(this,"_externalCSSList",[]),i(this,"_observer",null),this.attachShadow({mode:"open"})}set step(c){this.slider&&this.slider.setStep(c)}get step(){var c;return(c=this.slider)==null?void 0:c.step}set disabled(c){this.slider&&(this.slider.disabled=c)}get disabled(){var c,f;return(f=(c=this.slider)==null?void 0:c.disabled)!=null?f:!1}set data(c){var f;(f=this.slider)==null||f.setData(c)}get data(){var c;return(c=this.slider)==null?void 0:c.data}set min(c){var f;(f=this.slider)==null||f.setMin(c)}get min(){var c;return(c=this.slider)==null?void 0:c.min}set max(c){var f;(f=this.slider)==null||f.setMax(c)}get max(){var c;return(c=this.slider)==null?void 0:c.max}set round(c){!this.slider||(this.slider.round=c)}get round(){var c,f;return(f=(c=this.slider)==null?void 0:c.round)!=null?f:ii}set type(c){!this.slider||(this.slider.type=c??ti)}get type(){var c;return((c=this.slider)==null?void 0:c.type)||ti}set pointersOverlap(c){!this.slider||(this.slider.pointersOverlap=c)}get pointersOverlap(){var c,f;return(f=(c=this.slider)==null?void 0:c.pointersOverlap)!=null?f:!1}set pointersMinDistance(c){!this.slider||(this.slider.pointersMinDistance=c)}get pointersMinDistance(){var c,f;return(f=(c=this.slider)==null?void 0:c.pointersMinDistance)!=null?f:0}set pointersMaxDistance(c){!this.slider||(this.slider.pointersMaxDistance=c)}get pointersMaxDistance(){var c,f;return(f=(c=this.slider)==null?void 0:c.pointersMaxDistance)!=null?f:1/0}set theme(c){!this.slider||!this.slider.styles||(this.slider.styles.theme=c)}get theme(){var c,f,_;return(_=(f=(c=this.slider)==null?void 0:c.styles)==null?void 0:f.theme)!=null?_:null}set rtl(c){!this.slider||(this.slider.rightToLeft=c)}get rtl(){var c,f;return(f=(c=this.slider)==null?void 0:c.rightToLeft)!=null?f:!1}set btt(c){!this.slider||(this.slider.bottomToTop=c)}get btt(){var c,f;return(f=(c=this.slider)==null?void 0:c.bottomToTop)!=null?f:!1}set keyboardDisabled(c){!this.slider||(this.slider.keyboardDisabled=c)}get keyboardDisabled(){var c,f;return(f=(c=this.slider)==null?void 0:c.keyboardDisabled)!=null?f:!1}set mousewheelDisabled(c){!this.slider||(this.slider.mousewheelDisabled=c)}get mousewheelDisabled(){var c,f;return(f=(c=this.slider)==null?void 0:c.mousewheelDisabled)!=null?f:!1}set animateOnClick(c){!this.slider||(this.slider.animateOnClick=c)}get animateOnClick(){var c;return(c=this.slider)==null?void 0:c.animateOnClick}get rangeDragging(){var c,f;return(f=(c=this.slider)==null?void 0:c.rangeDragging)!=null?f:!1}set rangeDragging(c){this.slider&&(this.slider.rangeDragging=Ot(c))}get externalCSSList(){return this._externalCSSList}addPointer(c){var f,_;if(!this.slider)return;let b=(_=(f=this.slider)==null?void 0:f.addPointer(c))!=null?_:0;ta(this,this.slider,b,`value${b+1}`,`ariaLabel${b+1}`,`pointerShape${b+1}`,`pointer${b+1}Disabled`)}removePointer(){var c;!this.slider||(c=this.slider)==null||c.removePointer()}addCSS(c){if(!this.shadowRoot)return;let f=document.createElement("style");f.textContent=c,this.shadowRoot.appendChild(f)}connectedCallback(){var c,f;if(!this.shadowRoot)return;this._externalCSSList=ip(this),this.shadowRoot.innerHTML=s(r,this._externalCSSList);let _=(c=this.shadowRoot)==null?void 0:c.querySelector(".pointer");if(!_)return;let b=(f=this.shadowRoot)==null?void 0:f.getElementById("range-slider");if(!b)return;let C=op(this,_);this.slider=dp(this,b,C),ap(this,this.slider),this._observer=new MutationObserver(I=>{I.forEach(M=>{var E;if(!this.slider||M.type!=="attributes")return;let L=M.attributeName;!L||hp(this.slider,L,(E=this.getAttribute(L))!=null?E:"")})}),this._observer.observe(this,{attributes:!0})}disconnectedCallback(){this._observer&&this._observer.disconnect(),this.slider&&this.slider.destroy()}},Or=cp;window.tcRangeSlider=Or,customElements.get("toolcool-range-slider")||customElements.define("toolcool-range-slider",Or),customElements.get("tc-range-slider")||customElements.define("tc-range-slider",class extends Or{})})();function zc(n,t){Object.keys(t).forEach(e=>{n.setAttribute(e,t[e])})}class Uc extends Bt{register(){super.register()}unregister(){super.unregister()}build(){const t=this.schema.properties,e=this.options,i=this.schema.description,s=this.theme,r=this.defaults.startVals[this.key];e.compact||(this.header=this.label=s.getFormInputLabel(this.getTitle(),this.isRequired())),i&&(this.description=s.getFormInputDescription(this.translateProperty(i))),e.infoText&&(this.infoButton=s.getInfoButton(this.translateProperty(e.infoText)));const o=document.createElement("tc-range-slider"),a=Object.keys(t).find(h=>h.includes("min")),l=Object.keys(t).find(h=>h.includes("max")),d={min:t[a].minimum,max:t[l].maximum,value1:(r==null?void 0:r[a])||t[a].default,value2:(r==null?void 0:r[l])||t[l].default,"slider-bg-fill":"#004170","generate-labels":"true","slider-width":"100%","range-dragging":"false"};zc(o,d),this.input=o,this.input.id=this.formname,this.control=s.getFormControl(this.label,this.input,this.description,this.infoButton),(this.schema.readOnly||this.schema.readonly)&&(this.disable(!0),this.input.disabled=!0),this.input.addEventListener("change",h=>{h.preventDefault(),h.stopPropagation(),this.value={[a]:h.detail.value1,[l]:h.detail.value2},this.onChange(!0)}),this.container.appendChild(this.control)}destroy(){this.label&&this.label.parentNode&&this.label.parentNode.removeChild(this.label),this.description&&this.description.parentNode&&this.description.parentNode.removeChild(this.description),this.input&&this.input.parentNode&&this.input.parentNode.removeChild(this.input),super.destroy()}}const qc=[{type:"object",format:"minmax",func:Uc}],Gc=n=>{qc.map(({type:t,format:e,func:i})=>{tt.defaults.startVals=n,tt.defaults.editors[e]=i,tt.defaults.resolvers.unshift(s=>{if(s.type===t&&s.format===e)return e})})};class Oo extends Mt{constructor(){super();q(this,ss);q(this,rs);q(this,Ye,{});q(this,Be,null);this.schema,this.startVals,this.options={show_opt_in:!1,disable_collapse:!0,disable_edit_json:!0,disable_properties:!0,disable_array_delete_all_rows:!0,disable_array_delete_last_row:!0,array_controls_top:!0},this.unstyled=!1}getSchema(){return this.schema}setSchema(e){this.schema=e}getDefaultValues(){return this.startVals}setDefaultValues(e){this.startVals=e}getValues(){return nt(this,Ye)}firstUpdated(){if(!nt(this,Be)){Gc(this.startVals||{});const e=this.renderRoot.querySelector("form");Me(this,Be,new tt(e,{schema:this.schema,...this.startVals?{startval:this.startVals}:{},theme:"html",ajax:!0,...this.options})),Lt(this,rs,wa).call(this)}}render(){return z`
70
+ */function*ze(e,t){if(e!==void 0){let n=0;for(const i of e)yield t(i,n++)}}const Os=(e,t,n)=>{let i=t;return n.layer.getSource().getTileUrlFunction()&&(i||(i=n.layer.getSource().getTileUrlFunction()),n.layer.getSource().setTileUrlFunction((...o)=>zr(i(...o),e)),n.layer.getSource().setKey(new Date)),i};var Ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ds="Expected a function",ao=NaN,Ns="[object Symbol]",Ms=/^\s+|\s+$/g,Is=/^[-+]0x[0-9a-f]+$/i,Hs=/^0b[01]+$/i,Bs=/^0o[0-7]+$/i,Vs=parseInt,Ls=typeof Ze=="object"&&Ze&&Ze.Object===Object&&Ze,Us=typeof self=="object"&&self&&self.Object===Object&&self,ks=Ls||Us||Function("return this")(),Fs=Object.prototype,js=Fs.toString,zs=Math.max,Zs=Math.min,Jn=function(){return ks.Date.now()};function Xs(e,t,n){var i,o,r,s,a,l,u=0,c=!1,d=!1,p=!0;if(typeof e!="function")throw new TypeError(Ds);t=lo(t)||0,Kn(n)&&(c=!!n.leading,d="maxWait"in n,r=d?zs(lo(n.maxWait)||0,t):r,p="trailing"in n?!!n.trailing:p);function f(P){var q=i,ct=o;return i=o=void 0,u=P,s=e.apply(ct,q),s}function g(P){return u=P,a=setTimeout(Z,t),c?f(P):s}function y(P){var q=P-l,ct=P-u,W=t-q;return d?Zs(W,r-ct):W}function D(P){var q=P-l,ct=P-u;return l===void 0||q>=t||q<0||d&&ct>=r}function Z(){var P=Jn();if(D(P))return k(P);a=setTimeout(Z,y(P))}function k(P){return a=void 0,p&&i?f(P):(i=o=void 0,s)}function ot(){a!==void 0&&clearTimeout(a),u=0,i=l=o=a=void 0}function J(){return a===void 0?s:k(Jn())}function dt(){var P=Jn(),q=D(P);if(i=arguments,o=this,l=P,q){if(a===void 0)return g(l);if(d)return a=setTimeout(Z,t),f(l)}return a===void 0&&(a=setTimeout(Z,t)),s}return dt.cancel=ot,dt.flush=J,dt}function Kn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Ys(e){return!!e&&typeof e=="object"}function qs(e){return typeof e=="symbol"||Ys(e)&&js.call(e)==Ns}function lo(e){if(typeof e=="number")return e;if(qs(e))return ao;if(Kn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Kn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(Ms,"");var n=Hs.test(e);return n||Bs.test(e)?Vs(e.slice(2),n?2:8):Is.test(e)?ao:+e}var Ws=Xs;const uo=Rs(Ws);class co extends tt{constructor(){super();_(this,Xe);_(this,me,{});_(this,ye,null);_(this,be,void 0);_(this,Ye,"");_(this,qe,"");this.layer=null,this.unstyled=!1,this.noShadow=!1,this.layerConfig=null,this.debouncedDataChange=uo(X(this,Xe,So),1e3,{leading:!0})}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){_e(this,ye,Ss(this.layer,this.layerConfig)),customElements.get("eox-jsonform")||console.error("Please import @eox/jsonform in order to use layerconfig");const n={disable_edit_json:!0,disable_collapse:!0,disable_properties:!0};return x`
272
71
  <style>
273
- ${Vc}
274
- ${!this.unstyled&&Fc}
72
+ ${M(this,Ye)}
73
+ ${!this.unstyled&&M(this,qe)}
275
74
  </style>
276
- <form></form>
277
- `}}Ye=new WeakMap,Be=new WeakMap,ss=new WeakSet,va=function(){this.dispatchEvent(new CustomEvent("change",{detail:nt(this,Ye),bubbles:!0,composed:!0})),this.requestUpdate()},rs=new WeakSet,wa=function(){["ready","change"].map(i=>{nt(this,Be).on(i,()=>{Me(this,Ye,nt(this,Be).getValue()),Lt(this,ss,va).call(this)})})},wt(Oo,"properties",{schema:{attribute:!1,type:Object},startVals:{attribute:!1,type:Object},options:{attribute:!1,type:Object},unstyled:{type:Boolean}}),customElements.define("eox-jsonform",Oo);const Zc=(n,t,e)=>{let i=t;return e.layer.getSource().getTileUrlFunction()&&(i||(i=e.layer.getSource().getTileUrlFunction()),e.layer.getSource().setTileUrlFunction((...s)=>zl(i(...s),n)),e.layer.getSource().setKey(new Date)),i};var is=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wc(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Yc="Expected a function",Io=NaN,Xc="[object Symbol]",Jc=/^\s+|\s+$/g,Qc=/^[-+]0x[0-9a-f]+$/i,Kc=/^0b[01]+$/i,tu=/^0o[0-7]+$/i,eu=parseInt,iu=typeof is=="object"&&is&&is.Object===Object&&is,su=typeof self=="object"&&self&&self.Object===Object&&self,ru=iu||su||Function("return this")(),nu=Object.prototype,ou=nu.toString,au=Math.max,lu=Math.min,Lr=function(){return ru.Date.now()};function du(n,t,e){var i,s,r,o,a,l,d=0,h=!1,u=!1,g=!0;if(typeof n!="function")throw new TypeError(Yc);t=Bo(t)||0,Ar(e)&&(h=!!e.leading,u="maxWait"in e,r=u?au(Bo(e.maxWait)||0,t):r,g="trailing"in e?!!e.trailing:g);function m(H){var ut=i,Rt=s;return i=s=void 0,d=H,o=n.apply(Rt,ut),o}function y(H){return d=H,a=setTimeout(et,t),h?m(H):o}function w(H){var ut=H-l,Rt=H-d,ot=t-ut;return u?lu(ot,r-Rt):ot}function A(H){var ut=H-l,Rt=H-d;return l===void 0||ut>=t||ut<0||u&&Rt>=r}function et(){var H=Lr();if(A(H))return W(H);a=setTimeout(et,w(H))}function W(H){return a=void 0,g&&i?m(H):(i=s=void 0,o)}function _t(){a!==void 0&&clearTimeout(a),d=0,i=l=s=a=void 0}function pt(){return a===void 0?o:W(Lr())}function kt(){var H=Lr(),ut=A(H);if(i=arguments,s=this,l=H,ut){if(a===void 0)return y(l);if(u)return a=setTimeout(et,t),m(l)}return a===void 0&&(a=setTimeout(et,t)),o}return kt.cancel=_t,kt.flush=pt,kt}function Ar(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function hu(n){return!!n&&typeof n=="object"}function cu(n){return typeof n=="symbol"||hu(n)&&ou.call(n)==Xc}function Bo(n){if(typeof n=="number")return n;if(cu(n))return Io;if(Ar(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=Ar(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(Jc,"");var e=Kc.test(n);return e||tu.test(n)?eu(n.slice(2),e?2:8):Qc.test(n)?Io:+n}var uu=du;const Ro=Wc(uu);class Do extends Mt{constructor(){super();q(this,ns);q(this,Ai,{});q(this,ki,null);q(this,Si,void 0);q(this,os,"");q(this,as,"");this.layer=null,this.unstyled=!1,this.noShadow=!1,this.layerConfig=null,this.debouncedDataChange=Ro(Lt(this,ns,xa),1e3,{leading:!0})}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){Me(this,ki,xd(this.layer,this.layerConfig));const e={disable_edit_json:!0,disable_collapse:!0,disable_properties:!0};return z`
278
- <style>
279
- ${nt(this,os)}
280
- ${!this.unstyled&&nt(this,as)}
281
- </style>
282
- ${ee(this.layerConfig,()=>z`
75
+ ${at(this.layerConfig,()=>x`
283
76
  <!-- Render a JSON form for layer configuration -->
284
77
  <eox-jsonform
285
78
  .schema=${this.layerConfig.schema}
286
- .startVals=${nt(this,ki)}
287
- .options=${e}
79
+ .startVals=${M(this,ye)}
80
+ .options=${n}
288
81
  @change=${this.debouncedDataChange}
289
82
  ></eox-jsonform>
290
83
  `)}
291
- `}}Ai=new WeakMap,ki=new WeakMap,Si=new WeakMap,ns=new WeakSet,xa=function(e){Me(this,Ai,e.detail),Me(this,Si,Zc(nt(this,Ai),nt(this,Si),this)),this.requestUpdate()},os=new WeakMap,as=new WeakMap,wt(Do,"properties",{layer:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},layerConfig:{attribute:!1}}),customElements.define("eox-layercontrol-layerconfig",Do);class No extends Mt{constructor(){super();q(this,Ti,e=>this.selectedTab===e&&"highlighted");q(this,ls,`
84
+ `}}me=new WeakMap,ye=new WeakMap,be=new WeakMap,Xe=new WeakSet,So=function(n){_e(this,me,n.detail),_e(this,be,Os(M(this,me),M(this,be),this)),this.requestUpdate()},Ye=new WeakMap,qe=new WeakMap,L(co,"properties",{layer:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},layerConfig:{attribute:!1}}),customElements.define("eox-layercontrol-layerconfig",co);class ho extends tt{constructor(){super();_(this,ve,n=>this.selectedTab===n&&"highlighted");_(this,We,`
292
85
  .tabbed figure {
293
86
  margin: 0;
294
87
  }
@@ -308,7 +101,7 @@ input::-moz-focus-inner, input::-moz-focus-outer {
308
101
  .tabbed label.highlighted {
309
102
  background: lightgrey;
310
103
  }
311
- `);q(this,ds,`
104
+ `);_(this,Ge,`
312
105
  .tabbed {
313
106
  font-size: small;
314
107
  }
@@ -329,21 +122,21 @@ input::-moz-focus-inner, input::-moz-focus-outer {
329
122
  background: #00417011;
330
123
  border-top: 1px solid #0041701a;
331
124
  }
332
- `);this.actions=[],this.selectedTab=0,this.tabs=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const e=this.tabs,i=this.actions,s=i.length+e.length>1;return z`
125
+ `);this.actions=[],this.selectedTab=0,this.tabs=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const n=this.tabs,i=this.actions,o=i.length+n.length>1;return x`
333
126
  <style>
334
- ${nt(this,ls)}
335
- ${!this.unstyled&&nt(this,ds)}
127
+ ${M(this,We)}
128
+ ${!this.unstyled&&M(this,Ge)}
336
129
  </style>
337
130
  <div class="tabbed">
338
131
  <!-- Navigation for tabs and actions -->
339
- ${ee(s,()=>z`
132
+ ${at(o,()=>x`
340
133
  <nav>
341
134
  <div>
342
135
  <!-- Labels for tabs -->
343
- ${Qi(e,(r,o)=>z`
136
+ ${ze(n,(r,s)=>x`
344
137
  <label
345
- class=${nt(this,Ti).call(this,o)}
346
- @click=${()=>this.selectedTab=o}
138
+ class=${M(this,ve).call(this,s)}
139
+ @click=${()=>this.selectedTab=s}
347
140
  >
348
141
  <!-- Customizable icon for each tab -->
349
142
  <slot name=${`${r}-icon`}>${r}</slot>
@@ -352,7 +145,7 @@ input::-moz-focus-inner, input::-moz-focus-outer {
352
145
  </div>
353
146
  <div>
354
147
  <!-- Icons for actions -->
355
- ${Qi(i,r=>z`
148
+ ${ze(i,r=>x`
356
149
  <span>
357
150
  <!-- Customizable icon for each action -->
358
151
  <slot name=${`${r}-icon`}>${r}</slot>
@@ -363,15 +156,15 @@ input::-moz-focus-inner, input::-moz-focus-outer {
363
156
  `)}
364
157
  <figure>
365
158
  <!-- Content for each tab -->
366
- ${Qi(e,(r,o)=>z`
367
- <div class="tab ${nt(this,Ti).call(this,o)}">
159
+ ${ze(n,(r,s)=>x`
160
+ <div class="tab ${M(this,ve).call(this,s)}">
368
161
  <!-- Content slot for each tab -->
369
162
  <slot name=${`${r}-content`}>${r}</slot>
370
163
  </div>
371
164
  `)}
372
165
  </figure>
373
166
  </div>
374
- `}}Ti=new WeakMap,ls=new WeakMap,ds=new WeakMap,wt(No,"properties",{actions:{attribute:!1},selectedTab:{state:!0},tabs:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-tabs",No);const pu=`
167
+ `}}ve=new WeakMap,We=new WeakMap,Ge=new WeakMap,L(ho,"properties",{actions:{attribute:!1},selectedTab:{state:!0},tabs:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-tabs",ho);const Gs=`
375
168
  button,
376
169
  .button {
377
170
  /* TODO: why does this only work here and not from :root? */
@@ -480,11 +273,139 @@ button.smallest.icon::before {
480
273
  width: 16px;
481
274
  padding: 0px;
482
275
  }
483
- `;class Mo extends Mt{constructor(){super();wt(this,"_removeButton",()=>Ad(this));wt(this,"_sortButton",()=>kd(this.unstyled));wt(this,"_button",e=>Ld(e,this.unstyled));q(this,hs,"");q(this,cs,`
484
- ${pu}
485
- ${$o}
486
- ${Er}
487
- ${Po}
276
+ `,Js=`
277
+ input[type=radio] {
278
+ appearance: none;
279
+ -webkit-appearance: none;
280
+ margin: 0;
281
+ cursor: pointer;
282
+ display: flex;
283
+ flex-direction: row;
284
+ align-items: center;
285
+ width: 24px;
286
+ height: 24px;
287
+ }
288
+
289
+ label span {
290
+ font-size: small;
291
+ }
292
+
293
+ input[type=radio]:after {
294
+ display: block;
295
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-blank%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z' /%3E%3C/svg%3E");
296
+ width: 20px;
297
+ height: 20px;
298
+ margin-right: 4px;
299
+ }
300
+ input[type=radio]:checked:after {
301
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Eradiobox-marked%3C/title%3E%3Cpath d='M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7Z' /%3E%3C/svg%3E");
302
+
303
+ }
304
+ `,po=`
305
+ input[type=checkbox] {
306
+ appearance: none;
307
+ -webkit-appearance: none;
308
+ margin: 0;
309
+ cursor: pointer;
310
+ display: flex;
311
+ flex-direction: row;
312
+ align-items: center;
313
+ width: 24px;
314
+ height: 24px;
315
+ }
316
+ input[type=checkbox]:after {
317
+ display: block;
318
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckbox-blank-outline%3C/title%3E%3Cpath d='M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z' /%3E%3C/svg%3E");
319
+ width: 20px;
320
+ height: 20px;
321
+ margin-right: 4px;
322
+ }
323
+ input[type=checkbox]:checked:after {
324
+ content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23004170' viewBox='0 0 24 24'%3E%3Ctitle%3Echeckbox-marked%3C/title%3E%3Cpath d='M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z' /%3E%3C/svg%3E");
325
+
326
+ }
327
+ `,Ks=`
328
+ input[type="range"] {
329
+ -webkit-appearance: none;
330
+ width: 90%;
331
+ margin-left: 5%;
332
+ height: 6px;
333
+ border-radius: 5px;
334
+ background: #d7dcdf;
335
+ outline: none;
336
+ padding: 0;
337
+ }
338
+ input[type="range"]::-webkit-slider-thumb {
339
+ appearance: none;
340
+ width: 15px;
341
+ height: 15px;
342
+ border-radius: 50%;
343
+ background: #2c3e50;
344
+ cursor: pointer;
345
+ transition: background 0.15s ease-in-out;
346
+ }
347
+ .range-slider {
348
+ margin: 60px 0 0 0;
349
+ }
350
+ .range-slider {
351
+ width: 100%;
352
+ }
353
+ input[type="range"]::-webkit-slider-thumb:hover {
354
+ background: #00416F;
355
+ }
356
+ input[type="range"]:active::-webkit-slider-thumb {
357
+ background: #00416F;
358
+ }
359
+ input[type="range"]::-moz-range-thumb {
360
+ width: 15px;
361
+ height: 15px;
362
+ border: 0;
363
+ border-radius: 50%;
364
+ background: #2c3e50;
365
+ cursor: pointer;
366
+ transition: background 0.15s ease-in-out;
367
+ }
368
+ input[type="range"]::-moz-range-thumb:hover {
369
+ background: #00416F;
370
+ }
371
+ input[type="range"]:active::-moz-range-thumb {
372
+ background: #00416F;
373
+ }
374
+ input[type="range"]:focus::-webkit-slider-thumb {
375
+ box-shadow: 0 0 0 3px #fff0, 0 0 0 6px #00416F00;
376
+ }
377
+ .range-slider__value {
378
+ display: inline-block;
379
+ position: relative;
380
+ width: 60px;
381
+ color: #fff;
382
+ line-height: 20px;
383
+ text-align: center;
384
+ border-radius: 3px;
385
+ background: #2c3e50;
386
+ padding: 5px 10px;
387
+ margin-left: 8px;
388
+ }
389
+ .range-slider__value:after {
390
+ position: absolute;
391
+ top: 8px;
392
+ left: -7px;
393
+ width: 0;
394
+ height: 0;
395
+ border-top: 7px solid transparent;
396
+ border-right: 7px solid #2c3e50;
397
+ border-bottom: 7px solid transparent;
398
+ content: '';
399
+ }
400
+
401
+ input::-moz-focus-inner, input::-moz-focus-outer {
402
+ border: 0;
403
+ }
404
+ `;class fo extends tt{constructor(){super();L(this,"_removeButton",()=>Cs(this));L(this,"_sortButton",()=>Ts(this.unstyled));L(this,"_button",n=>As(n,this.unstyled));_(this,Je,"");_(this,Ke,`
405
+ ${Gs}
406
+ ${Js}
407
+ ${po}
408
+ ${Ks}
488
409
  .drag-handle {
489
410
  cursor: n-resize;
490
411
  }
@@ -576,35 +497,35 @@ button.smallest.icon::before {
576
497
  [slot=opacity-content] {
577
498
  padding: 12px 6px;
578
499
  }
579
- `);this.layer=null,this.tools=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){var l;const e=Cd(this.tools,this.layer),i=Ed(this.tools,this.layer),s=this[`_${e==null?void 0:e[0]}Button`]?this[`_${e==null?void 0:e[0]}Button`]():K,r=((l=this.tools)==null?void 0:l.length)===1?`${this.tools[0]}-icon`:"",o=e==null?void 0:e.length,a=i==null?void 0:i.length;return z`
500
+ `);this.layer=null,this.tools=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){var l;const n=$s(this.tools,this.layer),i=_s(this.tools,this.layer),o=this[`_${n==null?void 0:n[0]}Button`]?this[`_${n==null?void 0:n[0]}Button`]():T,r=((l=this.tools)==null?void 0:l.length)===1?`${this.tools[0]}-icon`:"",s=n==null?void 0:n.length,a=i==null?void 0:i.length;return x`
580
501
  <style>
581
- ${nt(this,hs)}
582
- ${!this.unstyled&&nt(this,cs)}
502
+ ${M(this,Je)}
503
+ ${!this.unstyled&&M(this,Ke)}
583
504
  </style>
584
- ${ee(o+a>0,()=>z`
585
- ${ee(o===1&&a===0,()=>z`
505
+ ${at(s+a>0,()=>x`
506
+ ${at(s===1&&a===0,()=>x`
586
507
  <div class="single-action-container">
587
- <div class="single-action">${s}</div>
508
+ <div class="single-action">${o}</div>
588
509
  </div>
589
- `,()=>{var d;return z`
510
+ `,()=>{var u;return x`
590
511
  <details
591
512
  class="tools"
592
- open=${this.layer.get("layerControlToolsExpand")||K}
513
+ open=${this.layer.get("layerControlToolsExpand")||T}
593
514
  >
594
515
  <summary>
595
516
  <button class="icon ${r}">Tools</button>
596
517
  </summary>
597
518
  <eox-layercontrol-tabs
598
519
  .noShadow=${!1}
599
- .actions=${e}
520
+ .actions=${n}
600
521
  .tabs=${i}
601
522
  .unstyled=${this.unstyled}
602
523
  >
603
524
  <!-- Rendering tabs and content -->
604
- ${Qi(i,h=>this._button(h))}
525
+ ${ze(i,c=>this._button(c))}
605
526
 
606
527
  <div slot="info-content">
607
- ${Sd(this.layer.get("description"))}
528
+ ${Ps(this.layer.get("description"))}
608
529
  </div>
609
530
  <div slot="opacity-content">
610
531
  <!-- Input for opacity -->
@@ -613,8 +534,8 @@ button.smallest.icon::before {
613
534
  min="0"
614
535
  max="1"
615
536
  step="0.01"
616
- value=${ho((d=this.layer)==null?void 0:d.getOpacity())}
617
- @input=${h=>this.layer.setOpacity(parseFloat(h.target.value))}
537
+ value=${so((u=this.layer)==null?void 0:u.getOpacity())}
538
+ @input=${c=>this.layer.setOpacity(parseFloat(c.target.value))}
618
539
  />
619
540
  </div>
620
541
  <div slot="config-content">
@@ -634,8 +555,8 @@ button.smallest.icon::before {
634
555
  </details>
635
556
  `})}
636
557
  `)}
637
- `}}hs=new WeakMap,cs=new WeakMap,wt(Mo,"properties",{layer:{attribute:!1},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-layer-tools",Mo);const fu=n=>{const t=()=>{const e=vd(n.layer,n.map,n.showLayerZoomState);let i=!1;!e&&n.currLayerVisibilityBasedOnZoom?(n.currLayerVisibilityBasedOnZoom=!1,i=!0):e&&!n.currLayerVisibilityBasedOnZoom&&(n.currLayerVisibilityBasedOnZoom=!0,i=!0),i&&(n.requestUpdate(),n.dispatchEvent(new CustomEvent("change:resolution",{bubbles:!0})))};oo(n.layer,n.showLayerZoomState)&&(t(),n.map.getView().on("change:resolution",()=>t()))},mu=(n,t)=>{const e=t.layer;e.setVisible(n.target.checked),n.target.checked&&e.get("layerControlExclusive")&&t.parentNode.parentNode.querySelectorAll("li > eox-layercontrol-layer").forEach(s=>{var r;s.layer!==e&&((r=s.layer)!=null&&r.get("layerControlExclusive"))&&(s.layer.setVisible(!1),s.requestUpdate())}),t.dispatchEvent(new CustomEvent("changed",{bubbles:!0})),t.requestUpdate()};class Ho extends Mt{constructor(){super();q(this,Xe);q(this,us);wt(this,"currLayerVisibilityBasedOnZoom",!0);q(this,ps,"");q(this,fs,`
638
- ${Er}
558
+ `}}Je=new WeakMap,Ke=new WeakMap,L(fo,"properties",{layer:{attribute:!1},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-layer-tools",fo);const Qs=e=>{const t=()=>{const n=Es(e.layer,e.map,e.showLayerZoomState);let i=!1;!n&&e.currLayerVisibilityBasedOnZoom?(e.currLayerVisibilityBasedOnZoom=!1,i=!0):n&&!e.currLayerVisibilityBasedOnZoom&&(e.currLayerVisibilityBasedOnZoom=!0,i=!0),i&&(e.requestUpdate(),e.dispatchEvent(new CustomEvent("change:resolution",{bubbles:!0})))};io(e.layer,e.showLayerZoomState)&&(t(),e.map.getView().on("change:resolution",()=>t()))},ta=(e,t)=>{const n=t.layer;n.setVisible(e.target.checked),e.target.checked&&n.get("layerControlExclusive")&&t.parentNode.parentNode.querySelectorAll("li > eox-layercontrol-layer").forEach(o=>{var r;o.layer!==n&&((r=o.layer)!=null&&r.get("layerControlExclusive"))&&(o.layer.setVisible(!1),o.requestUpdate())}),t.dispatchEvent(new CustomEvent("changed",{bubbles:!0,detail:n})),t.requestUpdate()};class go extends tt{constructor(){super();_(this,Yt);_(this,Qe);L(this,"currLayerVisibilityBasedOnZoom",!0);_(this,tn,"");_(this,en,`
559
+ ${po}
639
560
  eox-layercontrol-layer {
640
561
  width: 100%;
641
562
  }
@@ -675,25 +596,25 @@ button.smallest.icon::before {
675
596
  [data-type=draw] .title::before {
676
597
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230041703a' viewBox='0 0 24 24'%3E%3Ctitle%3Evector-square-edit%3C/title%3E%3Cpath d='M22.7 14.4L21.7 15.4L19.6 13.3L20.6 12.3C20.8 12.1 21.2 12.1 21.4 12.3L22.7 13.6C22.9 13.8 22.9 14.1 22.7 14.4M13 19.9L19.1 13.8L21.2 15.9L15.1 22H13V19.9M11 19.9V19.1L11.6 18.5L12.1 18H8V16H6V8H8V6H16V8H18V12.1L19.1 11L19.3 10.8C19.5 10.6 19.8 10.4 20.1 10.3V8H22.1V2H16.1V4H8V2H2V8H4V16H2V22H8V20L11 19.9M18 4H20V6H18V4M4 4H6V6H4V4M6 20H4V18H6V20Z' /%3E%3C/svg%3E");
677
598
  }
678
- `);this.layer=null,this.map=null,this.titleProperty="title",this.showLayerZoomState=!1,this.tools=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){fu(this)}render(){var l;const e=this.layer.getVisible(),i=e?"visible":"",s=this.currLayerVisibilityBasedOnZoom?"":"zoom-state-invisible",r=Lt(this,Xe,Vs).call(this,"layerControlDisable")?"disabled":"",o=Lt(this,Xe,Vs).call(this,"layerControlExclusive")?"radio":"checkbox",a=((l=this.tools)==null?void 0:l.length)>0;return z`
599
+ `);this.layer=null,this.map=null,this.titleProperty="title",this.showLayerZoomState=!1,this.tools=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){Qs(this)}render(){var l;const n=this.layer.getVisible(),i=n?"visible":"",o=this.currLayerVisibilityBasedOnZoom?"":"zoom-state-invisible",r=X(this,Yt,yn).call(this,"layerControlDisable")?"disabled":"",s=X(this,Yt,yn).call(this,"layerControlExclusive")?"radio":"checkbox",a=((l=this.tools)==null?void 0:l.length)>0;return x`
679
600
  <style>
680
- ${nt(this,ps)}
681
- ${!this.unstyled&&nt(this,fs)}
601
+ ${M(this,tn)}
602
+ ${!this.unstyled&&M(this,en)}
682
603
  </style>
683
- ${ee(this.layer,()=>z`
604
+ ${at(this.layer,()=>x`
684
605
  <!-- Render the layer -->
685
- <div class="layer ${i} ${s}">
606
+ <div class="layer ${i} ${o}">
686
607
  <label class="drag-handle ${r}">
687
608
  <!-- Input element for layer visibility -->
688
609
  <input
689
- type=${o}
690
- .checked=${ho(e)}
691
- @click=${Lt(this,us,Ca)}
610
+ type=${s}
611
+ .checked=${so(n)}
612
+ @click=${X(this,Qe,$o)}
692
613
  />
693
614
 
694
615
  <!-- Layer title -->
695
- <span class="title">${Lt(this,Xe,Vs).call(this,this.titleProperty)}</span>
696
- ${ee(a,()=>z`<span class="tools-placeholder"></span>`)}
616
+ <span class="title">${X(this,Yt,yn).call(this,this.titleProperty)}</span>
617
+ ${at(a,()=>x`<span class="tools-placeholder"></span>`)}
697
618
  </label>
698
619
  </div>
699
620
 
@@ -705,7 +626,7 @@ button.smallest.icon::before {
705
626
  .unstyled=${this.unstyled}
706
627
  ></eox-layercontrol-layer-tools>
707
628
  `)}
708
- `}}Xe=new WeakSet,Vs=function(e){var i;return(i=this.layer)==null?void 0:i.get(e)},us=new WeakSet,Ca=function(e){mu(e,this)},ps=new WeakMap,fs=new WeakMap,wt(Ho,"properties",{layer:{attribute:!1},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-layer",Ho);class Vo extends Mt{constructor(){super();q(this,ms,"");q(this,gs,`
629
+ `}}Yt=new WeakSet,yn=function(n){var i;return(i=this.layer)==null?void 0:i.get(n)},Qe=new WeakSet,$o=function(n){ta(n,this)},tn=new WeakMap,en=new WeakMap,L(go,"properties",{layer:{attribute:!1},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-layer",go);class mo extends tt{constructor(){super();_(this,nn,"");_(this,on,`
709
630
  details summary {
710
631
  cursor: pointer;
711
632
  display: flex;
@@ -729,15 +650,15 @@ button.smallest.icon::before {
729
650
  details[data-children-length="0"] summary::before {
730
651
  display: none;
731
652
  }
732
- `);this.group=null,this.idProperty="id",this.map=null,this.titleProperty="title",this.showLayerZoomState=!1,this.tools=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){var s,r;const e=!!((s=this.group)!=null&&s.get("layerControlExpand")),i=(r=lo(this.group.getLayers()))==null?void 0:r.length;return z`
653
+ `);this.group=null,this.idProperty="id",this.map=null,this.titleProperty="title",this.showLayerZoomState=!1,this.tools=[],this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){var o,r;const n=!!((o=this.group)!=null&&o.get("layerControlExpand")),i=(r=ro(this.group.getLayers()))==null?void 0:r.length;return x`
733
654
  <style>
734
- ${nt(this,ms)}
735
- ${!this.unstyled&&nt(this,gs)}
655
+ ${M(this,nn)}
656
+ ${!this.unstyled&&M(this,on)}
736
657
  </style>
737
- ${ee(this.group,()=>z`
658
+ ${at(this.group,()=>x`
738
659
  <!-- Render the details element with the layer control -->
739
660
  <details
740
- open=${e||K}
661
+ open=${n||T}
741
662
  data-children-length=${i}
742
663
  >
743
664
  <summary>
@@ -768,7 +689,7 @@ button.smallest.icon::before {
768
689
  ></eox-layercontrol-layer-list>
769
690
  </details>
770
691
  `)}
771
- `}}ms=new WeakMap,gs=new WeakMap,wt(Vo,"properties",{group:{attribute:!1},idProperty:{attribute:"id-property"},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-layer-group",Vo);const gu=n=>{const{layers:t,idProperty:e,titleProperty:i,renderRoot:s}=n;if(t){const r=s.querySelector("ul");_d(t,e,i,n),yd(r,t,e,n)}},bu=n=>{const{layers:t}=n,e=Ro(()=>{n.requestUpdate(),n.dispatchEvent(new CustomEvent("changed",{bubbles:!0}))},50),i=()=>e();t&&(t.hasListener("change:length")&&(t==null||t.un("change:length",i)),t.on("change:length",i))};class Fo extends Mt{constructor(){super();q(this,bs,"");q(this,ys,`
692
+ `}}nn=new WeakMap,on=new WeakMap,L(mo,"properties",{group:{attribute:!1},idProperty:{attribute:"id-property"},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-layer-group",mo);const ea=e=>{const{layers:t,idProperty:n,titleProperty:i,renderRoot:o}=e;if(t){const r=o.querySelector("ul");ws(t,n,i,e),vs(r,t,n,e)}},na=e=>{const{layers:t}=e,n=uo(()=>{e.requestUpdate(),e.dispatchEvent(new CustomEvent("changed",{bubbles:!0}))},50),i=()=>n();t&&(t.hasListener("change:length")&&(t==null||t.un("change:length",i)),t.on("change:length",i))};class yo extends tt{constructor(){super();_(this,rn,"");_(this,sn,`
772
693
  ul {
773
694
  padding: 0;
774
695
  margin: 0;
@@ -796,19 +717,19 @@ button.smallest.icon::before {
796
717
  }
797
718
  li.sortable-ghost {
798
719
  }
799
- `);this.idProperty="id",this.layers=null,this.map=null,this.tools=void 0,this.titleProperty="title",this.showLayerZoomState=!1,this.unstyled=!1,this.noShadow=!1}firstUpdated(){gu(this)}updated(){bu(this)}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const e=lo(this.layers).reverse();return z`
720
+ `);this.idProperty="id",this.layers=null,this.map=null,this.tools=void 0,this.titleProperty="title",this.showLayerZoomState=!1,this.unstyled=!1,this.noShadow=!1}firstUpdated(){ea(this)}updated(){na(this)}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const n=ro(this.layers).reverse();return x`
800
721
  <style>
801
- ${nt(this,bs)}
802
- ${!this.unstyled&&nt(this,ys)}
722
+ ${M(this,rn)}
723
+ ${!this.unstyled&&M(this,sn)}
803
724
  </style>
804
725
  <ul>
805
- ${ee(this.layers,()=>z`
806
- ${Wa(e,i=>i,i=>z`
726
+ ${at(this.layers,()=>x`
727
+ ${Wo(n,i=>i,i=>x`
807
728
  <li
808
729
  data-layer="${i.get(this.idProperty)}"
809
- data-type="${wd(i,this.map)}"
730
+ data-type="${xs(i,this.map)}"
810
731
  >
811
- ${i.getLayers?z`
732
+ ${i.getLayers?x`
812
733
  <eox-layercontrol-layer-group
813
734
  .noShadow=${!0}
814
735
  .group=${i}
@@ -821,7 +742,7 @@ button.smallest.icon::before {
821
742
  @changed=${()=>this.requestUpdate()}
822
743
  >
823
744
  </eox-layercontrol-layer-group>
824
- `:z`
745
+ `:x`
825
746
  <eox-layercontrol-layer
826
747
  .noShadow=${!0}
827
748
  .layer=${i}
@@ -837,7 +758,7 @@ button.smallest.icon::before {
837
758
  `)}
838
759
  `)}
839
760
  </ul>
840
- `}}bs=new WeakMap,ys=new WeakMap,wt(Fo,"properties",{idProperty:{attribute:"id-property"},layers:{attribute:!1},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-layer-list",Fo);const yu=n=>{const t=n.querySelector("select[name=optional]"),e=t?t.value:null,i=_r(n.layers.getArray(),"layerControlOptional",!0).find(s=>(s.get(n.idProperty)||s.ol_uid)===e);i==null||i.set("layerControlOptional",!1),i==null||i.setVisible(!0),n.dispatchEvent(new CustomEvent("changed",{bubbles:!0})),n.renderRoot.parentNode.querySelectorAll("eox-layercontrol-layer-list").forEach(s=>s.requestUpdate()),n.requestUpdate()};class zo extends Mt{constructor(){super();q(this,_s);this.idProperty="id",this.layers=null,this.titleProperty="title",this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const e=_r(this.layers.getArray(),"layerControlOptional",!0);return z`
761
+ `}}rn=new WeakMap,sn=new WeakMap,L(yo,"properties",{idProperty:{attribute:"id-property"},layers:{attribute:!1},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-layer-list",yo);const ia=e=>{const t=e.querySelector("select[name=optional]"),n=t?t.value:null,i=Wn(e.layers.getArray(),"layerControlOptional",!0).find(o=>(o.get(e.idProperty)||o.ol_uid)===n);i==null||i.set("layerControlOptional",!1),i==null||i.setVisible(!0),e.dispatchEvent(new CustomEvent("changed",{bubbles:!0})),e.renderRoot.parentNode.querySelectorAll("eox-layercontrol-layer-list").forEach(o=>o.requestUpdate()),e.requestUpdate()};class bo extends tt{constructor(){super();_(this,an);this.idProperty="id",this.layers=null,this.titleProperty="title",this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const n=Wn(this.layers.getArray(),"layerControlOptional",!0);return x`
841
762
  <!-- Label for the dropdown -->
842
763
  <label for="optional">Optional layers</label>
843
764
 
@@ -849,19 +770,19 @@ button.smallest.icon::before {
849
770
  </option>
850
771
 
851
772
  <!-- Mapping through filtered layers list to generate dropdown options -->
852
- ${e.map(i=>{const s=i.get(this.idProperty)||i.ol_uid,r=i.get(this.titleProperty),o=`layer ${i.get(this.idProperty)}`;return z` <option value="${s}">${r||o}</option> `})}
773
+ ${n.map(i=>{const o=i.get(this.idProperty)||i.ol_uid,r=i.get(this.titleProperty),s=`layer ${i.get(this.idProperty)}`;return x` <option value="${o}">${r||s}</option> `})}
853
774
  </select>
854
775
 
855
776
  <!-- Button to handle adding layers -->
856
- <button @click="${Lt(this,_s,Ea)}">add</button>
857
- `}}_s=new WeakSet,Ea=function(){yu(this)},wt(zo,"properties",{idProperty:{attribute:"id-property"},layers:{attribute:!1},titleProperty:{attribute:"title-property",type:String},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-optional-list",zo);const _u=(n,t)=>{t.jsonInput=n.target.value,t.requestUpdate()},Uo=n=>{const t=JSON.parse(`{"data":${Rn(n.jsonInput)}}`);Array.isArray(t.data)?t.data.forEach(e=>{n.eoxMap.addOrUpdateLayer(e)}):n.eoxMap.addOrUpdateLayer(t.data),n.jsonInput=null,n.requestUpdate()},vu=(n,t)=>{t.urlInput=n.target.value,t.requestUpdate()};async function wu(n){const t=n.urlInput;if(n.wmsCapabilities=null,n.searchLoad=!0,n.requestUpdate(),!t)return!1;if(ir(t)==="XYZ")return{Name:t};try{const e=await Hl(t);n.wmsCapabilities=e}catch{}finally{n.searchLoad=!1,n.requestUpdate()}return!1}const xu=(n,t)=>{const{Name:e}=n,i=ir(t.urlInput)||"XYZ",s={type:"Tile",properties:{id:e,title:e},source:{type:i,url:t.urlInput,params:{LAYERS:e}}};t.jsonInput=JSON.stringify(s)},Cu=(n,t)=>{t.open=n||null,t.urlInput=null,t.jsonInput=null,t.wmsCapabilities=null,t.requestUpdate()};class qo extends Mt{constructor(){super();q(this,vs);q(this,ws);q(this,ji);q(this,xs);q(this,Cs);q(this,Je);wt(this,"urlInput",null);wt(this,"jsonInput",null);wt(this,"open",null);wt(this,"searchLoad",!1);wt(this,"wmsCapabilities",null);q(this,Es,`
777
+ <button @click="${X(this,an,_o)}">add</button>
778
+ `}}an=new WeakSet,_o=function(){ia(this)},L(bo,"properties",{idProperty:{attribute:"id-property"},layers:{attribute:!1},titleProperty:{attribute:"title-property",type:String},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-optional-list",bo);const oa=(e,t)=>{t.jsonInput=e.target.value,t.requestUpdate()},vo=e=>{const t=JSON.parse(`{"data":${Ni(e.jsonInput)}}`);Array.isArray(t.data)?t.data.forEach(n=>{e.eoxMap.addOrUpdateLayer(n)}):e.eoxMap.addOrUpdateLayer(t.data),e.jsonInput=null,e.requestUpdate()},ra=(e,t)=>{t.urlInput=e.target.value,t.requestUpdate()};async function sa(e){const t=e.urlInput;if(e.wmsCapabilities=null,e.searchLoad=!0,e.requestUpdate(),!t)return!1;if(Dn(t)==="XYZ")return{Name:t};try{const n=await kr(t);e.wmsCapabilities=n}catch{}finally{e.searchLoad=!1,e.requestUpdate()}return!1}const aa=(e,t)=>{const{Name:n}=e,i=Dn(t.urlInput)||"XYZ",o={type:"Tile",properties:{id:n,title:n},source:{type:i,url:t.urlInput,params:{LAYERS:n}}};t.jsonInput=JSON.stringify(o)},la=(e,t)=>{t.open=e||null,t.urlInput=null,t.jsonInput=null,t.wmsCapabilities=null,t.requestUpdate()};class wo extends tt{constructor(){super();_(this,ln);_(this,un);_(this,we);_(this,dn);_(this,cn);_(this,qt);L(this,"urlInput",null);L(this,"jsonInput",null);L(this,"open",null);L(this,"searchLoad",!1);L(this,"wmsCapabilities",null);_(this,hn,`
858
779
  .eox-add-layer-main .open {
859
780
  position: relative;
860
781
  }
861
782
  .eox-add-layer-main .close {
862
783
  display: none;
863
784
  }
864
- `);q(this,Ls,`
785
+ `);_(this,pn,`
865
786
  .eox-add {
866
787
  background: #f0f2f5;
867
788
  border-top: 1px solid #0041701a;
@@ -994,24 +915,24 @@ button.smallest.icon::before {
994
915
  font-weight: bold;
995
916
  display: inline-block;
996
917
  }
997
- `);this.eoxMap=null,this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const e=this.open?"open":"close",i=this.open==="url",s=this.open==="json",r=!Vl(this.urlInput)||this.searchLoad?!0:K;return z`
918
+ `);this.eoxMap=null,this.unstyled=!1,this.noShadow=!1}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){const n=this.open?"open":"close",i=this.open==="url",o=this.open==="json",r=!Fr(this.urlInput)||this.searchLoad?!0:T;return x`
998
919
  <style>
999
- ${nt(this,Es)}
1000
- ${!this.unstyled&&nt(this,Ls)}
920
+ ${M(this,hn)}
921
+ ${!this.unstyled&&M(this,pn)}
1001
922
  </style>
1002
923
  <div class="eox-add-layer-main">
1003
924
  <div class="eox-add-layer-col">
1004
925
  <!-- Tabbed interface for URL and JSON -->
1005
- <ul class="eox-add-layer-tab ${e}">
926
+ <ul class="eox-add-layer-tab ${n}">
1006
927
  <li
1007
- @click=${()=>Lt(this,Je,Fs).call(this,"url")}
928
+ @click=${()=>X(this,qt,bn).call(this,"url")}
1008
929
  class="${i?"active":""}"
1009
930
  >
1010
931
  URL
1011
932
  </li>
1012
933
  <li
1013
- @click=${()=>Lt(this,Je,Fs).call(this,"json")}
1014
- class="${s?"active":""}"
934
+ @click=${()=>X(this,qt,bn).call(this,"json")}
935
+ class="${o?"active":""}"
1015
936
  >
1016
937
  JSON
1017
938
  </li>
@@ -1020,13 +941,13 @@ button.smallest.icon::before {
1020
941
  <!-- Button to toggle tabs -->
1021
942
  <button
1022
943
  class="add-icon icon"
1023
- @click=${()=>Lt(this,Je,Fs).call(this,this.open?null:"url")}
944
+ @click=${()=>X(this,qt,bn).call(this,this.open?null:"url")}
1024
945
  >
1025
946
  ${this.unstyled?"Add Layer":""}
1026
947
  </button>
1027
948
  </div>
1028
- <div class="eox-add ${e}">
1029
- ${i?z`
949
+ <div class="eox-add ${n}">
950
+ ${i?x`
1030
951
  <!-- Input field for URL -->
1031
952
  <div class="eox-add-layer-col">
1032
953
  <input
@@ -1034,71 +955,71 @@ button.smallest.icon::before {
1034
955
  class="add-url"
1035
956
  placeholder="Add URL (WMS/XYZ)"
1036
957
  .value="${this.urlInput}"
1037
- @input=${Lt(this,vs,La)}
958
+ @input=${X(this,ln,Ao)}
1038
959
  >
1039
960
  </input>
1040
961
  <!-- Search button for URL -->
1041
962
  <button
1042
963
  class="search-icon"
1043
964
  disabled=${r}
1044
- @click=${Lt(this,ws,Aa)}
965
+ @click=${X(this,un,Co)}
1045
966
  >
1046
967
  ${this.unstyled?"Search":""}
1047
968
  </button>
1048
969
  </div>
1049
970
 
1050
971
  <!-- Display layers for WMS capabilities -->
1051
- ${this.wmsCapabilities?z`<ul class="search-lists">
1052
- ${this.wmsCapabilities.Capability.Layer.Layer.map(o=>{const a=o.Name;return z`
972
+ ${this.wmsCapabilities?x`<ul class="search-lists">
973
+ ${this.wmsCapabilities.Capability.Layer.Layer.map(s=>{const a=s.Name;return x`
1053
974
  <li class="search-list">
1054
975
  ${a}
1055
976
  <!-- Button to add layer -->
1056
977
  <button
1057
978
  class="add-layer-icon icon"
1058
- @click=${()=>Lt(this,ji,rn).call(this,o)}
979
+ @click=${()=>X(this,we,ei).call(this,s)}
1059
980
  >
1060
981
  ${this.unstyled?"+":""}
1061
982
  </button>
1062
983
  </li>
1063
984
  `})}
1064
- </ul>`:K}
1065
- `:z`
985
+ </ul>`:T}
986
+ `:x`
1066
987
  <!-- Textarea for JSON input -->
1067
988
  <textarea
1068
989
  class="add-layer-input"
1069
990
  placeholder="Please put a valid eox-map layer JSON."
1070
- @input=${Lt(this,Cs,Sa)}
991
+ @input=${X(this,cn,Po)}
1071
992
  .value=${this.jsonInput}
1072
993
  ></textarea>
1073
994
 
1074
995
  <!-- Button to add JSON layer -->
1075
996
  <button
1076
997
  class="add-layer-icon json-add-layer"
1077
- disabled=${Fl(this.jsonInput)?K:!0}
1078
- @click=${Lt(this,xs,ka)}
998
+ disabled=${jr(this.jsonInput)?T:!0}
999
+ @click=${X(this,dn,To)}
1079
1000
  >
1080
1001
  ${this.unstyled?"Add JSON":""}
1081
1002
  </button>
1082
1003
  `}
1083
1004
  </div>
1084
1005
  </div>
1085
- `}}vs=new WeakSet,La=function(e){vu(e,this)},ws=new WeakSet,Aa=async function(){const e=await wu(this);e&&Lt(this,ji,rn).call(this,e)},ji=new WeakSet,rn=function(e){xu(e,this),Uo(this)},xs=new WeakSet,ka=function(){Uo(this)},Cs=new WeakSet,Sa=function(e){_u(e,this)},Je=new WeakSet,Fs=function(e){Cu(e,this)},Es=new WeakMap,Ls=new WeakMap,wt(qo,"properties",{eoxMap:{attribute:!1,state:!0},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-add-layers",qo);const Eu=(n,t)=>{if(t.requestUpdate(),n.target.tagName==="EOX-LAYERCONTROL-LAYER-TOOLS"){const e=t.renderRoot.querySelector("eox-layercontrol-optional-list");e==null||e.requestUpdate()}},Lu=n=>{const t=n.for;return document.querySelector(t)},Au=n=>{const t=document.querySelector(n.for);t&&t.map!==n.map&&(n.map=t.map)};class kr extends Mt{constructor(){super();q(this,As);q(this,Qe,void 0);q(this,ks,"* { font-family: Roboto, sans-serif; }");this.for="eox-map",this.idProperty="id",this.map=null,this.titleProperty="title",this.showLayerZoomState=!1,this.tools=["info","opacity","config","remove","sort"],this.addExternalLayers=!1,this.unstyled=!1,this.styleOverride=""}updated(){Au(this)}firstUpdated(){Me(this,Qe,Lu(this))}render(){var s,r,o;const e=(s=this.map)==null?void 0:s.getLayers().getArray(),i=e&&((r=_r(e,"layerControlOptional",!0))==null?void 0:r.length)>0;return z`
1006
+ `}}ln=new WeakSet,Ao=function(n){ra(n,this)},un=new WeakSet,Co=async function(){const n=await sa(this);n&&X(this,we,ei).call(this,n)},we=new WeakSet,ei=function(n){aa(n,this),vo(this)},dn=new WeakSet,To=function(){vo(this)},cn=new WeakSet,Po=function(n){oa(n,this)},qt=new WeakSet,bn=function(n){la(n,this)},hn=new WeakMap,pn=new WeakMap,L(wo,"properties",{eoxMap:{attribute:!1,state:!0},unstyled:{type:Boolean},noShadow:{type:Boolean}}),customElements.define("eox-layercontrol-add-layers",wo);const ua=(e,t)=>{if(t.requestUpdate(),e.target.tagName==="EOX-LAYERCONTROL-LAYER-TOOLS"){const n=t.renderRoot.querySelector("eox-layercontrol-optional-list");n==null||n.requestUpdate()}},da=e=>{const t=e.for;return document.querySelector(t)},ca=e=>{const t=document.querySelector(e.for);t&&t.map!==e.map&&(e.map=t.map)};class Qn extends tt{constructor(){super();_(this,fn);_(this,Wt,void 0);_(this,gn,"* { font-family: Roboto, sans-serif; }");this.for="eox-map",this.idProperty="id",this.map=null,this.titleProperty="title",this.showLayerZoomState=!1,this.tools=["info","opacity","config","remove","sort"],this.addExternalLayers=!1,this.unstyled=!1,this.styleOverride=""}updated(){ca(this)}firstUpdated(){_e(this,Wt,da(this))}render(){var o,r,s;const n=(o=this.map)==null?void 0:o.getLayers().getArray(),i=n&&((r=Wn(n,"layerControlOptional",!0))==null?void 0:r.length)>0;return x`
1086
1007
  <style>
1087
- ${!this.unstyled&&nt(this,ks)}
1008
+ ${!this.unstyled&&M(this,gn)}
1088
1009
  ${this.styleOverride}
1089
1010
  </style>
1090
1011
 
1091
1012
  <!-- Conditional rendering of add layers component -->
1092
- ${ee(this.addExternalLayers&&((o=nt(this,Qe))==null?void 0:o.addOrUpdateLayer),()=>z`
1013
+ ${at(this.addExternalLayers&&((s=M(this,Wt))==null?void 0:s.addOrUpdateLayer),()=>x`
1093
1014
  <eox-layercontrol-add-layers
1094
1015
  .noShadow=${!0}
1095
- .eoxMap=${nt(this,Qe)}
1016
+ .eoxMap=${M(this,Wt)}
1096
1017
  .unstyled=${this.unstyled}
1097
1018
  ></eox-layercontrol-add-layers>
1098
1019
  `)}
1099
1020
 
1100
1021
  <!-- Conditional rendering of layer list component -->
1101
- ${ee(this.map,()=>z`
1022
+ ${at(this.map,()=>x`
1102
1023
  <eox-layercontrol-layer-list
1103
1024
  .noShadow=${!0}
1104
1025
  class="layers"
@@ -1109,12 +1030,12 @@ button.smallest.icon::before {
1109
1030
  .showLayerZoomState=${this.showLayerZoomState}
1110
1031
  .tools=${this.tools}
1111
1032
  .unstyled=${this.unstyled}
1112
- @changed=${Lt(this,As,Ta)}
1033
+ @changed=${X(this,fn,Oo)}
1113
1034
  ></eox-layercontrol-layer-list>
1114
1035
  `)}
1115
1036
 
1116
1037
  <!-- Conditional rendering of optional list component -->
1117
- ${ee(i,()=>z`
1038
+ ${at(i,()=>x`
1118
1039
  <eox-layercontrol-optional-list
1119
1040
  .noShadow=${!0}
1120
1041
  .idProperty=${this.idProperty}
@@ -1123,4 +1044,4 @@ button.smallest.icon::before {
1123
1044
  @changed=${()=>this.requestUpdate()}
1124
1045
  ></eox-layercontrol-optional-list>
1125
1046
  `)}
1126
- `}}Qe=new WeakMap,As=new WeakSet,Ta=function(e){Eu(e,this)},ks=new WeakMap,wt(kr,"properties",{for:{type:String},idProperty:{attribute:"id-property"},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},addExternalLayers:{attribute:!1},unstyled:{type:Boolean},styleOverride:{type:String}}),customElements.define("eox-layercontrol",kr),rt.EOxLayerControl=kr,Object.defineProperty(rt,Symbol.toStringTag,{value:"Module"})});
1047
+ `}}Wt=new WeakMap,fn=new WeakSet,Oo=function(n){ua(n,this),this.dispatchEvent(new CustomEvent("layerchange",{detail:n.detail}))},gn=new WeakMap,L(Qn,"properties",{for:{type:String},idProperty:{attribute:"id-property"},map:{attribute:!1,state:!0},titleProperty:{attribute:"title-property",type:String},showLayerZoomState:{attribute:"show-layer-zoom-state",type:Boolean},tools:{attribute:!1},addExternalLayers:{attribute:!1},unstyled:{type:Boolean},styleOverride:{type:String}}),customElements.define("eox-layercontrol",Qn),O.EOxLayerControl=Qn,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});