@spectric/ui 0.0.25 → 0.0.27

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.
package/dist/index.umd.js CHANGED
@@ -2,29 +2,29 @@
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */var ys;const ve=globalThis,gr=ve.ShadowRoot&&(ve.ShadyCSS===void 0||ve.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,br=Symbol(),$i=new WeakMap;let _i=class{constructor(e,r,s){if(this._$cssResult$=!0,s!==br)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(gr&&e===void 0){const s=r!==void 0&&r.length===1;s&&(e=$i.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&$i.set(r,e))}return e}toString(){return this.cssText}};const Bs=i=>new _i(typeof i=="string"?i:i+"",void 0,br),J=(i,...e)=>{const r=i.length===1?i[0]:e.reduce((s,t,o)=>s+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(t)+i[o+1],i[0]);return new _i(r,i,br)},Us=(i,e)=>{if(gr)i.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const s=document.createElement("style"),t=ve.litNonce;t!==void 0&&s.setAttribute("nonce",t),s.textContent=r.cssText,i.appendChild(s)}},wi=gr?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let r="";for(const s of e.cssRules)r+=s.cssText;return Bs(r)})(i):i;/**
5
+ */var ys;const ve=globalThis,br=ve.ShadowRoot&&(ve.ShadyCSS===void 0||ve.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vr=Symbol(),$i=new WeakMap;let _i=class{constructor(e,r,s){if(this._$cssResult$=!0,s!==vr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(br&&e===void 0){const s=r!==void 0&&r.length===1;s&&(e=$i.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&$i.set(r,e))}return e}toString(){return this.cssText}};const Bs=i=>new _i(typeof i=="string"?i:i+"",void 0,vr),J=(i,...e)=>{const r=i.length===1?i[0]:e.reduce((s,t,o)=>s+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(t)+i[o+1],i[0]);return new _i(r,i,vr)},Us=(i,e)=>{if(br)i.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const s=document.createElement("style"),t=ve.litNonce;t!==void 0&&s.setAttribute("nonce",t),s.textContent=r.cssText,i.appendChild(s)}},wi=br?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let r="";for(const s of e.cssRules)r+=s.cssText;return Bs(r)})(i):i;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:Hs,defineProperty:Fs,getOwnPropertyDescriptor:Qs,getOwnPropertyNames:qs,getOwnPropertySymbols:Vs,getPrototypeOf:Ws}=Object,ye=globalThis,Si=ye.trustedTypes,Gs=Si?Si.emptyScript:"",vr=ye.reactiveElementPolyfillSupport,mt=(i,e)=>i,Qt={toAttribute(i,e){switch(e){case Boolean:i=i?Gs:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let r=i;switch(e){case Boolean:r=i!==null;break;case Number:r=i===null?null:Number(i);break;case Object:case Array:try{r=JSON.parse(i)}catch{r=null}}return r}},yr=(i,e)=>!Hs(i,e),xi={attribute:!0,type:String,converter:Qt,reflect:!1,hasChanged:yr};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ye.litPropertyMetadata??(ye.litPropertyMetadata=new WeakMap);class qe extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=xi){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const s=Symbol(),t=this.getPropertyDescriptor(e,s,r);t!==void 0&&Fs(this.prototype,e,t)}}static getPropertyDescriptor(e,r,s){const{get:t,set:o}=Qs(this.prototype,e)??{get(){return this[r]},set(a){this[r]=a}};return{get(){return t==null?void 0:t.call(this)},set(a){const d=t==null?void 0:t.call(this);o.call(this,a),this.requestUpdate(e,d,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??xi}static _$Ei(){if(this.hasOwnProperty(mt("elementProperties")))return;const e=Ws(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(mt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(mt("properties"))){const r=this.properties,s=[...qs(r),...Vs(r)];for(const t of s)this.createProperty(t,r[t])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[s,t]of r)this.elementProperties.set(s,t)}this._$Eh=new Map;for(const[r,s]of this.elementProperties){const t=this._$Eu(r,s);t!==void 0&&this._$Eh.set(t,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const t of s)r.unshift(wi(t))}else e!==void 0&&r.push(wi(e));return r}static _$Eu(e,r){const s=r.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const s of r.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Us(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostDisconnected)==null?void 0:s.call(r)})}attributeChangedCallback(e,r,s){this._$AK(e,s)}_$EC(e,r){var o;const s=this.constructor.elementProperties.get(e),t=this.constructor._$Eu(e,s);if(t!==void 0&&s.reflect===!0){const a=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:Qt).toAttribute(r,s.type);this._$Em=e,a==null?this.removeAttribute(t):this.setAttribute(t,a),this._$Em=null}}_$AK(e,r){var o;const s=this.constructor,t=s._$Eh.get(e);if(t!==void 0&&this._$Em!==t){const a=s.getPropertyOptions(t),d=typeof a.converter=="function"?{fromAttribute:a.converter}:((o=a.converter)==null?void 0:o.fromAttribute)!==void 0?a.converter:Qt;this._$Em=t,this[t]=d.fromAttribute(r,a.type),this._$Em=null}}requestUpdate(e,r,s){if(e!==void 0){if(s??(s=this.constructor.getPropertyOptions(e)),!(s.hasChanged??yr)(this[e],r))return;this.P(e,r,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,r,s){this._$AL.has(e)||this._$AL.set(e,r),s.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[o,a]of t)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],a)}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(s=this._$EO)==null||s.forEach(t=>{var o;return(o=t.hostUpdate)==null?void 0:o.call(t)}),this.update(r)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(s=>{var t;return(t=s.hostUpdated)==null?void 0:t.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(e){}firstUpdated(e){}}qe.elementStyles=[],qe.shadowRootOptions={mode:"open"},qe[mt("elementProperties")]=new Map,qe[mt("finalized")]=new Map,vr==null||vr({ReactiveElement:qe}),(ye.reactiveElementVersions??(ye.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:Hs,defineProperty:Fs,getOwnPropertyDescriptor:Qs,getOwnPropertyNames:qs,getOwnPropertySymbols:Vs,getPrototypeOf:Ws}=Object,ye=globalThis,Si=ye.trustedTypes,Gs=Si?Si.emptyScript:"",yr=ye.reactiveElementPolyfillSupport,$t=(i,e)=>i,qt={toAttribute(i,e){switch(e){case Boolean:i=i?Gs:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let r=i;switch(e){case Boolean:r=i!==null;break;case Number:r=i===null?null:Number(i);break;case Object:case Array:try{r=JSON.parse(i)}catch{r=null}}return r}},mr=(i,e)=>!Hs(i,e),xi={attribute:!0,type:String,converter:qt,reflect:!1,hasChanged:mr};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),ye.litPropertyMetadata??(ye.litPropertyMetadata=new WeakMap);class Ve extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=xi){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(e,r),!r.noAccessor){const s=Symbol(),t=this.getPropertyDescriptor(e,s,r);t!==void 0&&Fs(this.prototype,e,t)}}static getPropertyDescriptor(e,r,s){const{get:t,set:o}=Qs(this.prototype,e)??{get(){return this[r]},set(a){this[r]=a}};return{get(){return t==null?void 0:t.call(this)},set(a){const d=t==null?void 0:t.call(this);o.call(this,a),this.requestUpdate(e,d,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??xi}static _$Ei(){if(this.hasOwnProperty($t("elementProperties")))return;const e=Ws(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty($t("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($t("properties"))){const r=this.properties,s=[...qs(r),...Vs(r)];for(const t of s)this.createProperty(t,r[t])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[s,t]of r)this.elementProperties.set(s,t)}this._$Eh=new Map;for(const[r,s]of this.elementProperties){const t=this._$Eu(r,s);t!==void 0&&this._$Eh.set(t,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const t of s)r.unshift(wi(t))}else e!==void 0&&r.push(wi(e));return r}static _$Eu(e,r){const s=r.attribute;return s===!1?void 0:typeof s=="string"?s:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const s of r.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Us(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostConnected)==null?void 0:s.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var s;return(s=r.hostDisconnected)==null?void 0:s.call(r)})}attributeChangedCallback(e,r,s){this._$AK(e,s)}_$EC(e,r){var o;const s=this.constructor.elementProperties.get(e),t=this.constructor._$Eu(e,s);if(t!==void 0&&s.reflect===!0){const a=(((o=s.converter)==null?void 0:o.toAttribute)!==void 0?s.converter:qt).toAttribute(r,s.type);this._$Em=e,a==null?this.removeAttribute(t):this.setAttribute(t,a),this._$Em=null}}_$AK(e,r){var o;const s=this.constructor,t=s._$Eh.get(e);if(t!==void 0&&this._$Em!==t){const a=s.getPropertyOptions(t),d=typeof a.converter=="function"?{fromAttribute:a.converter}:((o=a.converter)==null?void 0:o.fromAttribute)!==void 0?a.converter:qt;this._$Em=t,this[t]=d.fromAttribute(r,a.type),this._$Em=null}}requestUpdate(e,r,s){if(e!==void 0){if(s??(s=this.constructor.getPropertyOptions(e)),!(s.hasChanged??mr)(this[e],r))return;this.P(e,r,s)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,r,s){this._$AL.has(e)||this._$AL.set(e,r),s.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[o,a]of t)a.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],a)}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(s=this._$EO)==null||s.forEach(t=>{var o;return(o=t.hostUpdate)==null?void 0:o.call(t)}),this.update(r)):this._$EU()}catch(t){throw e=!1,this._$EU(),t}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(s=>{var t;return(t=s.hostUpdated)==null?void 0:t.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(e){}firstUpdated(e){}}Ve.elementStyles=[],Ve.shadowRootOptions={mode:"open"},Ve[$t("elementProperties")]=new Map,Ve[$t("finalized")]=new Map,yr==null||yr({ReactiveElement:Ve}),(ye.reactiveElementVersions??(ye.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const $t=globalThis,qt=$t.trustedTypes,ki=qt?qt.createPolicy("lit-html",{createHTML:i=>i}):void 0,mr="$lit$",pe=`lit$${Math.random().toFixed(9).slice(2)}$`,$r="?"+pe,Ys=`<${$r}>`,Ce=document,_t=()=>Ce.createComment(""),wt=i=>i===null||typeof i!="object"&&typeof i!="function",_r=Array.isArray,Ei=i=>_r(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",wr=`[
14
- \f\r]`,St=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ai=/-->/g,Ci=/>/g,Oe=RegExp(`>|${wr}(?:([^\\s"'>=/]+)(${wr}*=${wr}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Oi=/'/g,Pi=/"/g,Ti=/^(?:script|style|textarea|title)$/i,Zs=i=>(e,...r)=>({_$litType$:i,strings:e,values:r}),$=Zs(1),he=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),Li=new WeakMap,Pe=Ce.createTreeWalker(Ce,129);function Ni(i,e){if(!_r(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ki!==void 0?ki.createHTML(e):e}const Di=(i,e)=>{const r=i.length-1,s=[];let t,o=e===2?"<svg>":e===3?"<math>":"",a=St;for(let d=0;d<r;d++){const c=i[d];let b,_,v=-1,C=0;for(;C<c.length&&(a.lastIndex=C,_=a.exec(c),_!==null);)C=a.lastIndex,a===St?_[1]==="!--"?a=Ai:_[1]!==void 0?a=Ci:_[2]!==void 0?(Ti.test(_[2])&&(t=RegExp("</"+_[2],"g")),a=Oe):_[3]!==void 0&&(a=Oe):a===Oe?_[0]===">"?(a=t??St,v=-1):_[1]===void 0?v=-2:(v=a.lastIndex-_[2].length,b=_[1],a=_[3]===void 0?Oe:_[3]==='"'?Pi:Oi):a===Pi||a===Oi?a=Oe:a===Ai||a===Ci?a=St:(a=Oe,t=void 0);const w=a===Oe&&i[d+1].startsWith("/>")?" ":"";o+=a===St?c+Ys:v>=0?(s.push(b),c.slice(0,v)+mr+c.slice(v)+pe+w):c+pe+(v===-2?d:w)}return[Ni(i,o+(i[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};class xt{constructor({strings:e,_$litType$:r},s){let t;this.parts=[];let o=0,a=0;const d=e.length-1,c=this.parts,[b,_]=Di(e,r);if(this.el=xt.createElement(b,s),Pe.currentNode=this.el.content,r===2||r===3){const v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(t=Pe.nextNode())!==null&&c.length<d;){if(t.nodeType===1){if(t.hasAttributes())for(const v of t.getAttributeNames())if(v.endsWith(mr)){const C=_[a++],w=t.getAttribute(v).split(pe),S=/([.?@])?(.*)/.exec(C);c.push({type:1,index:o,name:S[2],strings:w,ctor:S[1]==="."?zi:S[1]==="?"?Ii:S[1]==="@"?Ri:kt}),t.removeAttribute(v)}else v.startsWith(pe)&&(c.push({type:6,index:o}),t.removeAttribute(v));if(Ti.test(t.tagName)){const v=t.textContent.split(pe),C=v.length-1;if(C>0){t.textContent=qt?qt.emptyScript:"";for(let w=0;w<C;w++)t.append(v[w],_t()),Pe.nextNode(),c.push({type:2,index:++o});t.append(v[C],_t())}}}else if(t.nodeType===8)if(t.data===$r)c.push({type:2,index:o});else{let v=-1;for(;(v=t.data.indexOf(pe,v+1))!==-1;)c.push({type:7,index:o}),v+=pe.length-1}o++}}static createElement(e,r){const s=Ce.createElement("template");return s.innerHTML=e,s}}function Te(i,e,r=i,s){var a,d;if(e===he)return e;let t=s!==void 0?(a=r._$Co)==null?void 0:a[s]:r._$Cl;const o=wt(e)?void 0:e._$litDirective$;return(t==null?void 0:t.constructor)!==o&&((d=t==null?void 0:t._$AO)==null||d.call(t,!1),o===void 0?t=void 0:(t=new o(i),t._$AT(i,r,s)),s!==void 0?(r._$Co??(r._$Co=[]))[s]=t:r._$Cl=t),t!==void 0&&(e=Te(i,t._$AS(i,e.values),t,s)),e}let Mi=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:s}=this._$AD,t=((e==null?void 0:e.creationScope)??Ce).importNode(r,!0);Pe.currentNode=t;let o=Pe.nextNode(),a=0,d=0,c=s[0];for(;c!==void 0;){if(a===c.index){let b;c.type===2?b=new Ve(o,o.nextSibling,this,e):c.type===1?b=new c.ctor(o,c.name,c.strings,this,e):c.type===6&&(b=new ji(o,this,e)),this._$AV.push(b),c=s[++d]}a!==(c==null?void 0:c.index)&&(o=Pe.nextNode(),a++)}return Pe.currentNode=Ce,t}p(e){let r=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,r),r+=s.strings.length-2):s._$AI(e[r])),r++}};class Ve{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,r,s,t){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=s,this.options=t,this._$Cv=(t==null?void 0:t.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Te(this,e,r),wt(e)?e===L||e==null||e===""?(this._$AH!==L&&this._$AR(),this._$AH=L):e!==this._$AH&&e!==he&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ei(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==L&&wt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ce.createTextNode(e)),this._$AH=e}$(e){var o;const{values:r,_$litType$:s}=e,t=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=xt.createElement(Ni(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===t)this._$AH.p(r);else{const a=new Mi(t,this),d=a.u(this.options);a.p(r),this.T(d),this._$AH=a}}_$AC(e){let r=Li.get(e.strings);return r===void 0&&Li.set(e.strings,r=new xt(e)),r}k(e){_r(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let s,t=0;for(const o of e)t===r.length?r.push(s=new Ve(this.O(_t()),this.O(_t()),this,this.options)):s=r[t],s._$AI(o),t++;t<r.length&&(this._$AR(s&&s._$AB.nextSibling,t),r.length=t)}_$AR(e=this._$AA.nextSibling,r){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,r);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var r;this._$AM===void 0&&(this._$Cv=e,(r=this._$AP)==null||r.call(this,e))}}class kt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,s,t,o){this.type=1,this._$AH=L,this._$AN=void 0,this.element=e,this.name=r,this._$AM=t,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=L}_$AI(e,r=this,s,t){const o=this.strings;let a=!1;if(o===void 0)e=Te(this,e,r,0),a=!wt(e)||e!==this._$AH&&e!==he,a&&(this._$AH=e);else{const d=e;let c,b;for(e=o[0],c=0;c<o.length-1;c++)b=Te(this,d[s+c],r,c),b===he&&(b=this._$AH[c]),a||(a=!wt(b)||b!==this._$AH[c]),b===L?e=L:e!==L&&(e+=(b??"")+o[c+1]),this._$AH[c]=b}a&&!t&&this.j(e)}j(e){e===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class zi extends kt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===L?void 0:e}}class Ii extends kt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==L)}}class Ri extends kt{constructor(e,r,s,t,o){super(e,r,s,t,o),this.type=5}_$AI(e,r=this){if((e=Te(this,e,r,0)??L)===he)return;const s=this._$AH,t=e===L&&s!==L||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,o=e!==L&&(s===L||t);t&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,e):this._$AH.handleEvent(e)}}class ji{constructor(e,r,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Te(this,e)}}const Js={M:mr,P:pe,A:$r,C:1,L:Di,R:Mi,D:Ei,V:Te,I:Ve,H:kt,N:Ii,U:Ri,B:zi,F:ji},Sr=$t.litHtmlPolyfillSupport;Sr==null||Sr(xt,Ve),($t.litHtmlVersions??($t.litHtmlVersions=[])).push("3.2.1");const Vt=(i,e,r)=>{const s=(r==null?void 0:r.renderBefore)??e;let t=s._$litPart$;if(t===void 0){const o=(r==null?void 0:r.renderBefore)??null;s._$litPart$=t=new Ve(e.insertBefore(_t(),o),o,void 0,r??{})}return t._$AI(i),t};/**
13
+ */const _t=globalThis,Vt=_t.trustedTypes,ki=Vt?Vt.createPolicy("lit-html",{createHTML:i=>i}):void 0,$r="$lit$",pe=`lit$${Math.random().toFixed(9).slice(2)}$`,_r="?"+pe,Ys=`<${_r}>`,Oe=document,wt=()=>Oe.createComment(""),St=i=>i===null||typeof i!="object"&&typeof i!="function",wr=Array.isArray,Ei=i=>wr(i)||typeof(i==null?void 0:i[Symbol.iterator])=="function",Sr=`[
14
+ \f\r]`,xt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ai=/-->/g,Ci=/>/g,Pe=RegExp(`>|${Sr}(?:([^\\s"'>=/]+)(${Sr}*=${Sr}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Oi=/'/g,Pi=/"/g,Ti=/^(?:script|style|textarea|title)$/i,Zs=i=>(e,...r)=>({_$litType$:i,strings:e,values:r}),_=Zs(1),he=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),Li=new WeakMap,Te=Oe.createTreeWalker(Oe,129);function Ni(i,e){if(!wr(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return ki!==void 0?ki.createHTML(e):e}const Di=(i,e)=>{const r=i.length-1,s=[];let t,o=e===2?"<svg>":e===3?"<math>":"",a=xt;for(let d=0;d<r;d++){const u=i[d];let b,y,v=-1,A=0;for(;A<u.length&&(a.lastIndex=A,y=a.exec(u),y!==null);)A=a.lastIndex,a===xt?y[1]==="!--"?a=Ai:y[1]!==void 0?a=Ci:y[2]!==void 0?(Ti.test(y[2])&&(t=RegExp("</"+y[2],"g")),a=Pe):y[3]!==void 0&&(a=Pe):a===Pe?y[0]===">"?(a=t??xt,v=-1):y[1]===void 0?v=-2:(v=a.lastIndex-y[2].length,b=y[1],a=y[3]===void 0?Pe:y[3]==='"'?Pi:Oi):a===Pi||a===Oi?a=Pe:a===Ai||a===Ci?a=xt:(a=Pe,t=void 0);const w=a===Pe&&i[d+1].startsWith("/>")?" ":"";o+=a===xt?u+Ys:v>=0?(s.push(b),u.slice(0,v)+$r+u.slice(v)+pe+w):u+pe+(v===-2?d:w)}return[Ni(i,o+(i[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),s]};class kt{constructor({strings:e,_$litType$:r},s){let t;this.parts=[];let o=0,a=0;const d=e.length-1,u=this.parts,[b,y]=Di(e,r);if(this.el=kt.createElement(b,s),Te.currentNode=this.el.content,r===2||r===3){const v=this.el.content.firstChild;v.replaceWith(...v.childNodes)}for(;(t=Te.nextNode())!==null&&u.length<d;){if(t.nodeType===1){if(t.hasAttributes())for(const v of t.getAttributeNames())if(v.endsWith($r)){const A=y[a++],w=t.getAttribute(v).split(pe),S=/([.?@])?(.*)/.exec(A);u.push({type:1,index:o,name:S[2],strings:w,ctor:S[1]==="."?zi:S[1]==="?"?Ii:S[1]==="@"?Ri:Et}),t.removeAttribute(v)}else v.startsWith(pe)&&(u.push({type:6,index:o}),t.removeAttribute(v));if(Ti.test(t.tagName)){const v=t.textContent.split(pe),A=v.length-1;if(A>0){t.textContent=Vt?Vt.emptyScript:"";for(let w=0;w<A;w++)t.append(v[w],wt()),Te.nextNode(),u.push({type:2,index:++o});t.append(v[A],wt())}}}else if(t.nodeType===8)if(t.data===_r)u.push({type:2,index:o});else{let v=-1;for(;(v=t.data.indexOf(pe,v+1))!==-1;)u.push({type:7,index:o}),v+=pe.length-1}o++}}static createElement(e,r){const s=Oe.createElement("template");return s.innerHTML=e,s}}function Le(i,e,r=i,s){var a,d;if(e===he)return e;let t=s!==void 0?(a=r._$Co)==null?void 0:a[s]:r._$Cl;const o=St(e)?void 0:e._$litDirective$;return(t==null?void 0:t.constructor)!==o&&((d=t==null?void 0:t._$AO)==null||d.call(t,!1),o===void 0?t=void 0:(t=new o(i),t._$AT(i,r,s)),s!==void 0?(r._$Co??(r._$Co=[]))[s]=t:r._$Cl=t),t!==void 0&&(e=Le(i,t._$AS(i,e.values),t,s)),e}let Mi=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:s}=this._$AD,t=((e==null?void 0:e.creationScope)??Oe).importNode(r,!0);Te.currentNode=t;let o=Te.nextNode(),a=0,d=0,u=s[0];for(;u!==void 0;){if(a===u.index){let b;u.type===2?b=new We(o,o.nextSibling,this,e):u.type===1?b=new u.ctor(o,u.name,u.strings,this,e):u.type===6&&(b=new ji(o,this,e)),this._$AV.push(b),u=s[++d]}a!==(u==null?void 0:u.index)&&(o=Te.nextNode(),a++)}return Te.currentNode=Oe,t}p(e){let r=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(e,s,r),r+=s.strings.length-2):s._$AI(e[r])),r++}};class We{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,r,s,t){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=s,this.options=t,this._$Cv=(t==null?void 0:t.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Le(this,e,r),St(e)?e===L||e==null||e===""?(this._$AH!==L&&this._$AR(),this._$AH=L):e!==this._$AH&&e!==he&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ei(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==L&&St(this._$AH)?this._$AA.nextSibling.data=e:this.T(Oe.createTextNode(e)),this._$AH=e}$(e){var o;const{values:r,_$litType$:s}=e,t=typeof s=="number"?this._$AC(e):(s.el===void 0&&(s.el=kt.createElement(Ni(s.h,s.h[0]),this.options)),s);if(((o=this._$AH)==null?void 0:o._$AD)===t)this._$AH.p(r);else{const a=new Mi(t,this),d=a.u(this.options);a.p(r),this.T(d),this._$AH=a}}_$AC(e){let r=Li.get(e.strings);return r===void 0&&Li.set(e.strings,r=new kt(e)),r}k(e){wr(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let s,t=0;for(const o of e)t===r.length?r.push(s=new We(this.O(wt()),this.O(wt()),this,this.options)):s=r[t],s._$AI(o),t++;t<r.length&&(this._$AR(s&&s._$AB.nextSibling,t),r.length=t)}_$AR(e=this._$AA.nextSibling,r){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,r);e&&e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){var r;this._$AM===void 0&&(this._$Cv=e,(r=this._$AP)==null||r.call(this,e))}}class Et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,s,t,o){this.type=1,this._$AH=L,this._$AN=void 0,this.element=e,this.name=r,this._$AM=t,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=L}_$AI(e,r=this,s,t){const o=this.strings;let a=!1;if(o===void 0)e=Le(this,e,r,0),a=!St(e)||e!==this._$AH&&e!==he,a&&(this._$AH=e);else{const d=e;let u,b;for(e=o[0],u=0;u<o.length-1;u++)b=Le(this,d[s+u],r,u),b===he&&(b=this._$AH[u]),a||(a=!St(b)||b!==this._$AH[u]),b===L?e=L:e!==L&&(e+=(b??"")+o[u+1]),this._$AH[u]=b}a&&!t&&this.j(e)}j(e){e===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class zi extends Et{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===L?void 0:e}}class Ii extends Et{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==L)}}class Ri extends Et{constructor(e,r,s,t,o){super(e,r,s,t,o),this.type=5}_$AI(e,r=this){if((e=Le(this,e,r,0)??L)===he)return;const s=this._$AH,t=e===L&&s!==L||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,o=e!==L&&(s===L||t);t&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,e):this._$AH.handleEvent(e)}}class ji{constructor(e,r,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){Le(this,e)}}const Js={M:$r,P:pe,A:_r,C:1,L:Di,R:Mi,D:Ei,V:Le,I:We,H:Et,N:Ii,U:Ri,B:zi,F:ji},xr=_t.litHtmlPolyfillSupport;xr==null||xr(kt,We),(_t.litHtmlVersions??(_t.litHtmlVersions=[])).push("3.2.1");const Wt=(i,e,r)=>{const s=(r==null?void 0:r.renderBefore)??e;let t=s._$litPart$;if(t===void 0){const o=(r==null?void 0:r.renderBefore)??null;s._$litPart$=t=new We(e.insertBefore(wt(),o),o,void 0,r??{})}return t._$AI(i),t};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */let B=class extends qe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Vt(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return he}};B._$litElement$=!0,B.finalized=!0,(ys=globalThis.litElementHydrateSupport)==null||ys.call(globalThis,{LitElement:B});const xr=globalThis.litElementPolyfillSupport;xr==null||xr({LitElement:B}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
19
+ */let B=class extends Ve{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Wt(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return he}};B._$litElement$=!0,B.finalized=!0,(ys=globalThis.litElementHydrateSupport)==null||ys.call(globalThis,{LitElement:B});const kr=globalThis.litElementPolyfillSupport;kr==null||kr({LitElement:B}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
23
- */const Wt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},We=i=>(...e)=>({_$litDirective$:i,values:e});let Et=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,s){this._$Ct=e,this._$AM=r,this._$Ci=s}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/**
23
+ */const Gt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ge=i=>(...e)=>({_$litDirective$:i,values:e});let At=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,s){this._$Ct=e,this._$AM=r,this._$Ci=s}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};/**
24
24
  * @license
25
25
  * Copyright 2018 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const Bi="important",Ks=" !"+Bi,kr=We(class extends Et{constructor(i){var e;if(super(i),i.type!==Wt.ATTRIBUTE||i.name!=="style"||((e=i.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((e,r)=>{const s=i[r];return s==null?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(i,[e]){const{style:r}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const s of this.ft)e[s]==null&&(this.ft.delete(s),s.includes("-")?r.removeProperty(s):r[s]=null);for(const s in e){const t=e[s];if(t!=null){this.ft.add(s);const o=typeof t=="string"&&t.endsWith(Ks);s.includes("-")||o?r.setProperty(s,o?t.slice(0,-11):t,o?Bi:""):r[s]=t}}return he}}),Xs=J`
27
+ */const Bi="important",Ks=" !"+Bi,Er=Ge(class extends At{constructor(i){var e;if(super(i),i.type!==Gt.ATTRIBUTE||i.name!=="style"||((e=i.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(i){return Object.keys(i).reduce((e,r)=>{const s=i[r];return s==null?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(i,[e]){const{style:r}=i.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const s of this.ft)e[s]==null&&(this.ft.delete(s),s.includes("-")?r.removeProperty(s):r[s]=null);for(const s in e){const t=e[s];if(t!=null){this.ft.add(s);const o=typeof t=="string"&&t.endsWith(Ks);s.includes("-")||o?r.setProperty(s,o?t.slice(0,-11):t,o?Bi:""):r[s]=t}}return he}}),Xs=J`
28
28
  :host{
29
29
  display: inline-block;
30
30
  --text-on-color: var(--spectric-text-on-color, #ffffff);
@@ -282,11 +282,11 @@ opacity:1
282
282
  * @license
283
283
  * Copyright 2017 Google LLC
284
284
  * SPDX-License-Identifier: BSD-3-Clause
285
- */const I=i=>(e,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};/**
285
+ */const R=i=>(e,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(i,e)}):customElements.define(i,e)};/**
286
286
  * @license
287
287
  * Copyright 2017 Google LLC
288
288
  * SPDX-License-Identifier: BSD-3-Clause
289
- */const en={attribute:!0,type:String,converter:Qt,reflect:!1,hasChanged:yr},tn=(i=en,e,r)=>{const{kind:s,metadata:t}=r;let o=globalThis.litPropertyMetadata.get(t);if(o===void 0&&globalThis.litPropertyMetadata.set(t,o=new Map),o.set(r.name,i),s==="accessor"){const{name:a}=r;return{set(d){const c=e.get.call(this);e.set.call(this,d),this.requestUpdate(a,c,i)},init(d){return d!==void 0&&this.P(a,void 0,i),d}}}if(s==="setter"){const{name:a}=r;return function(d){const c=this[a];e.call(this,d),this.requestUpdate(a,c,i)}}throw Error("Unsupported decorator location: "+s)};function g(i){return(e,r)=>typeof r=="object"?tn(i,e,r):((s,t,o)=>{const a=t.hasOwnProperty(o);return t.constructor.createProperty(o,a?{...s,wrapped:!0}:s),a?Object.getOwnPropertyDescriptor(t,o):void 0})(i,e,r)}/**
289
+ */const en={attribute:!0,type:String,converter:qt,reflect:!1,hasChanged:mr},tn=(i=en,e,r)=>{const{kind:s,metadata:t}=r;let o=globalThis.litPropertyMetadata.get(t);if(o===void 0&&globalThis.litPropertyMetadata.set(t,o=new Map),o.set(r.name,i),s==="accessor"){const{name:a}=r;return{set(d){const u=e.get.call(this);e.set.call(this,d),this.requestUpdate(a,u,i)},init(d){return d!==void 0&&this.P(a,void 0,i),d}}}if(s==="setter"){const{name:a}=r;return function(d){const u=this[a];e.call(this,d),this.requestUpdate(a,u,i)}}throw Error("Unsupported decorator location: "+s)};function g(i){return(e,r)=>typeof r=="object"?tn(i,e,r):((s,t,o)=>{const a=t.hasOwnProperty(o);return t.constructor.createProperty(o,a?{...s,wrapped:!0}:s),a?Object.getOwnPropertyDescriptor(t,o):void 0})(i,e,r)}/**
290
290
  * @license
291
291
  * Copyright 2017 Google LLC
292
292
  * SPDX-License-Identifier: BSD-3-Clause
@@ -294,7 +294,7 @@ opacity:1
294
294
  * @license
295
295
  * Copyright 2017 Google LLC
296
296
  * SPDX-License-Identifier: BSD-3-Clause
297
- */function Le(i){return(e,r)=>{const s=typeof e=="function"?e:e[r];Object.assign(s,i)}}/**
297
+ */function Ne(i){return(e,r)=>{const s=typeof e=="function"?e:e[r];Object.assign(s,i)}}/**
298
298
  * @license
299
299
  * Copyright 2017 Google LLC
300
300
  * SPDX-License-Identifier: BSD-3-Clause
@@ -306,44 +306,44 @@ opacity:1
306
306
  * @license
307
307
  * Copyright 2017 Google LLC
308
308
  * SPDX-License-Identifier: BSD-3-Clause
309
- */function At(i){return(e,r)=>Ui(e,r,{async get(){var s;return await this.updateComplete,((s=this.renderRoot)==null?void 0:s.querySelector(i))??null}})}let Er=0;const Hi=()=>Er;class Fi{constructor(e,r,s,t){this._handler=s,this._type=r,this._handler=s,this._options=t||!1,e instanceof Promise?e.then(o=>{this._handler&&(this._node=o,this._node.addEventListener(this._type,this._handler,this._options))}):typeof e=="function"?(this._node=e(),this._node.addEventListener(this._type,this._handler,this._options)):(this._node=e,this._node.addEventListener(this._type,this._handler,this._options)),Er+=1}dispose(){this._handler&&(this._node&&(Er-=1,this._node.removeEventListener(this._type,this._handler,this._options)),this._node=void 0,this._handler=void 0)}}class ie extends B{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(e,r,s,t){if(this._disposableListeners.find(a=>a.event===r&&a.target===e&&a.handler===s)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:e,event:r,handler:s,options:t}),this._connected&&this.registerDisposable(new Fi(e,r,s,t))}registerDisposable(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?console.warn(new Error("Trying to add a disposable to something that has already been disposed of. The added object will be leaked!").stack):this._disposables.add(e),e}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:e,event:r,handler:s,options:t})=>{this.registerDisposable(new Fi(e,r,s,t))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(e=>{e.dispose()}),this._isDisposed=!0}}var rn=Object.defineProperty,sn=Object.getOwnPropertyDescriptor,se=(i,e,r,s)=>{for(var t=s>1?void 0:s?sn(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&rn(e,r,t),t},Ar=(i=>(i.large="large",i.medium="medium",i.small="small",i.xsmall="xsmall",i.xxsmall="xxsmall",i.tiny="tiny",i))(Ar||{}),Cr=(i=>(i.primary="primary",i.secondary="secondary",i.text="text",i))(Cr||{});const nn={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};h.SpectricButton=class extends ie{constructor(){super(),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this.tooltipPosition="right",this.addDisposableListener(this,"click",this._onClick,{capture:!0}),this._onClick=this._onClick.bind(this)}_onClick(e){if(!(e instanceof CustomEvent)&&this.disabled){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();return}}updated(e){this.tooltip&&this.tooltip!==""&&Vt($`<spectric-tooltip slot="tooltip" .text=${this.tooltip} .position=${this.tooltipPosition||"right"}></spectric-tooltip>`,this)}render(){const e=nn[this.variant]||"spectric-button--primary";return $`
309
+ */function Ct(i){return(e,r)=>Ui(e,r,{async get(){var s;return await this.updateComplete,((s=this.renderRoot)==null?void 0:s.querySelector(i))??null}})}let Ar=0;const Hi=()=>Ar;class Fi{constructor(e,r,s,t){this._handler=s,this._type=r,this._handler=s,this._options=t||!1,e instanceof Promise?e.then(o=>{this._handler&&(this._node=o,this._node.addEventListener(this._type,this._handler,this._options))}):typeof e=="function"?(this._node=e(),this._node.addEventListener(this._type,this._handler,this._options)):(this._node=e,this._node.addEventListener(this._type,this._handler,this._options)),Ar+=1}dispose(){this._handler&&(this._node&&(Ar-=1,this._node.removeEventListener(this._type,this._handler,this._options)),this._node=void 0,this._handler=void 0)}}class se extends B{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(e,r,s,t){if(this._disposableListeners.find(a=>a.event===r&&a.target===e&&a.handler===s)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:e,event:r,handler:s,options:t}),this._connected&&this.registerDisposable(new Fi(e,r,s,t))}registerDisposable(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?console.warn(new Error("Trying to add a disposable to something that has already been disposed of. The added object will be leaked!").stack):this._disposables.add(e),e}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:e,event:r,handler:s,options:t})=>{this.registerDisposable(new Fi(e,r,s,t))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(e=>{e.dispose()}),this._isDisposed=!0}}var rn=Object.defineProperty,sn=Object.getOwnPropertyDescriptor,ne=(i,e,r,s)=>{for(var t=s>1?void 0:s?sn(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&rn(e,r,t),t},Cr=(i=>(i.large="large",i.medium="medium",i.small="small",i.xsmall="xsmall",i.xxsmall="xxsmall",i.tiny="tiny",i))(Cr||{}),Or=(i=>(i.primary="primary",i.secondary="secondary",i.text="text",i))(Or||{});const nn={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};h.SpectricButton=class extends se{constructor(){super(),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this.tooltipPosition="right",this.addDisposableListener(this,"click",this._onClick,{capture:!0}),this._onClick=this._onClick.bind(this)}_onClick(e){if(!(e instanceof CustomEvent)&&this.disabled){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();return}}updated(e){this.tooltip&&this.tooltip!==""&&Wt(_`<spectric-tooltip slot="tooltip" .text=${this.tooltip} .position=${this.tooltipPosition||"right"}></spectric-tooltip>`,this)}render(){const e=nn[this.variant]||"spectric-button--primary";return _`
310
310
  <slot name="tooltip"></slot>
311
311
  <button
312
312
  type="button"
313
313
  ?disabled=${this.disabled}
314
314
  class=${["spectric-button",`spectric-button-danger--${this.danger||!1}`,`spectric-button--${this.size||"medium"}`,e].join(" ")}
315
- style=${kr({backgroundColor:this.backgroundColor})}
315
+ style=${Er({backgroundColor:this.backgroundColor})}
316
316
  >
317
317
  <span class="animation"></span>
318
318
  <slot>${this.label}</slot>
319
319
  </button>
320
- `}},h.SpectricButton.styles=Xs,se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"variant",2),se([g({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"disabled",2),se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"backgroundColor",2),se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"size",2),se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"label",2),se([g({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"danger",2),se([g({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"icon",2),se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"tooltip",2),se([g({type:String,reflect:!0})],h.SpectricButton.prototype,"tooltipPosition",2),h.SpectricButton=se([I("spectric-button")],h.SpectricButton);/**
320
+ `}},h.SpectricButton.styles=Xs,ne([g({type:String,reflect:!0})],h.SpectricButton.prototype,"variant",2),ne([g({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"disabled",2),ne([g({type:String,reflect:!0})],h.SpectricButton.prototype,"backgroundColor",2),ne([g({type:String,reflect:!0})],h.SpectricButton.prototype,"size",2),ne([g({type:String,reflect:!0})],h.SpectricButton.prototype,"label",2),ne([g({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"danger",2),ne([g({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"icon",2),ne([g({type:String,reflect:!0})],h.SpectricButton.prototype,"tooltip",2),ne([g({type:String,reflect:!0})],h.SpectricButton.prototype,"tooltipPosition",2),h.SpectricButton=ne([R("spectric-button")],h.SpectricButton);/**
321
321
  * @license
322
322
  * Copyright 2020 Google LLC
323
323
  * SPDX-License-Identifier: BSD-3-Clause
324
- */const{I:on}=Js,Qi=(i,e)=>(i==null?void 0:i._$litType$)!==void 0,an=i=>{var e;return((e=i==null?void 0:i._$litType$)==null?void 0:e.h)!=null},ln=i=>i.strings===void 0,qi=()=>document.createComment(""),Ne=(i,e,r)=>{var o;const s=i._$AA.parentNode,t=e===void 0?i._$AB:e._$AA;if(r===void 0){const a=s.insertBefore(qi(),t),d=s.insertBefore(qi(),t);r=new on(a,d,i,i.options)}else{const a=r._$AB.nextSibling,d=r._$AM,c=d!==i;if(c){let b;(o=r._$AQ)==null||o.call(r,i),r._$AM=i,r._$AP!==void 0&&(b=i._$AU)!==d._$AU&&r._$AP(b)}if(a!==t||c){let b=r._$AA;for(;b!==a;){const _=b.nextSibling;s.insertBefore(b,t),b=_}}}return r},De=(i,e,r=i)=>(i._$AI(e,r),i),cn={},Or=(i,e=cn)=>i._$AH=e,Pr=i=>i._$AH,Tr=i=>{var s;(s=i._$AP)==null||s.call(i,!1,!0);let e=i._$AA;const r=i._$AB.nextSibling;for(;e!==r;){const t=e.nextSibling;e.remove(),e=t}},un=i=>{i._$AR()};/**
324
+ */const{I:on}=Js,Qi=(i,e)=>(i==null?void 0:i._$litType$)!==void 0,an=i=>{var e;return((e=i==null?void 0:i._$litType$)==null?void 0:e.h)!=null},ln=i=>i.strings===void 0,qi=()=>document.createComment(""),De=(i,e,r)=>{var o;const s=i._$AA.parentNode,t=e===void 0?i._$AB:e._$AA;if(r===void 0){const a=s.insertBefore(qi(),t),d=s.insertBefore(qi(),t);r=new on(a,d,i,i.options)}else{const a=r._$AB.nextSibling,d=r._$AM,u=d!==i;if(u){let b;(o=r._$AQ)==null||o.call(r,i),r._$AM=i,r._$AP!==void 0&&(b=i._$AU)!==d._$AU&&r._$AP(b)}if(a!==t||u){let b=r._$AA;for(;b!==a;){const y=b.nextSibling;s.insertBefore(b,t),b=y}}}return r},Me=(i,e,r=i)=>(i._$AI(e,r),i),cn={},Pr=(i,e=cn)=>i._$AH=e,Tr=i=>i._$AH,Lr=i=>{var s;(s=i._$AP)==null||s.call(i,!1,!0);let e=i._$AA;const r=i._$AB.nextSibling;for(;e!==r;){const t=e.nextSibling;e.remove(),e=t}},un=i=>{i._$AR()};/**
325
325
  * @license
326
326
  * Copyright 2017 Google LLC
327
327
  * SPDX-License-Identifier: BSD-3-Clause
328
- */const Ct=(i,e)=>{var s;const r=i._$AN;if(r===void 0)return!1;for(const t of r)(s=t._$AO)==null||s.call(t,e,!1),Ct(t,e);return!0},Gt=i=>{let e,r;do{if((e=i._$AM)===void 0)break;r=e._$AN,r.delete(i),i=e}while((r==null?void 0:r.size)===0)},Vi=i=>{for(let e;e=i._$AM;i=e){let r=e._$AN;if(r===void 0)e._$AN=r=new Set;else if(r.has(i))break;r.add(i),dn(e)}};function pn(i){this._$AN!==void 0?(Gt(this),this._$AM=i,Vi(this)):this._$AM=i}function hn(i,e=!1,r=0){const s=this._$AH,t=this._$AN;if(t!==void 0&&t.size!==0)if(e)if(Array.isArray(s))for(let o=r;o<s.length;o++)Ct(s[o],!1),Gt(s[o]);else s!=null&&(Ct(s,!1),Gt(s));else Ct(this,i)}const dn=i=>{i.type==Wt.CHILD&&(i._$AP??(i._$AP=hn),i._$AQ??(i._$AQ=pn))};class Wi extends Et{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,r,s){super._$AT(e,r,s),Vi(this),this.isConnected=e._$AU}_$AO(e,r=!0){var s,t;e!==this.isConnected&&(this.isConnected=e,e?(s=this.reconnected)==null||s.call(this):(t=this.disconnected)==null||t.call(this)),r&&(Ct(this,e),Gt(this))}setValue(e){if(ln(this._$Ct))this._$Ct._$AI(e,this);else{const r=[...this._$Ct._$AH];r[this._$Ci]=e,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}}/**
328
+ */const Ot=(i,e)=>{var s;const r=i._$AN;if(r===void 0)return!1;for(const t of r)(s=t._$AO)==null||s.call(t,e,!1),Ot(t,e);return!0},Yt=i=>{let e,r;do{if((e=i._$AM)===void 0)break;r=e._$AN,r.delete(i),i=e}while((r==null?void 0:r.size)===0)},Vi=i=>{for(let e;e=i._$AM;i=e){let r=e._$AN;if(r===void 0)e._$AN=r=new Set;else if(r.has(i))break;r.add(i),dn(e)}};function pn(i){this._$AN!==void 0?(Yt(this),this._$AM=i,Vi(this)):this._$AM=i}function hn(i,e=!1,r=0){const s=this._$AH,t=this._$AN;if(t!==void 0&&t.size!==0)if(e)if(Array.isArray(s))for(let o=r;o<s.length;o++)Ot(s[o],!1),Yt(s[o]);else s!=null&&(Ot(s,!1),Yt(s));else Ot(this,i)}const dn=i=>{i.type==Gt.CHILD&&(i._$AP??(i._$AP=hn),i._$AQ??(i._$AQ=pn))};class Wi extends At{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,r,s){super._$AT(e,r,s),Vi(this),this.isConnected=e._$AU}_$AO(e,r=!0){var s,t;e!==this.isConnected&&(this.isConnected=e,e?(s=this.reconnected)==null||s.call(this):(t=this.disconnected)==null||t.call(this)),r&&(Ot(this,e),Yt(this))}setValue(e){if(ln(this._$Ct))this._$Ct._$AI(e,this);else{const r=[...this._$Ct._$AH];r[this._$Ci]=e,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}}/**
329
329
  * @license
330
330
  * Copyright 2020 Google LLC
331
331
  * SPDX-License-Identifier: BSD-3-Clause
332
- */const Ge=()=>new fn;let fn=class{};const Lr=new WeakMap,Ye=We(class extends Wi{render(i){return L}update(i,[e]){var s;const r=e!==this.Y;return r&&this.Y!==void 0&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.Y=e,this.ht=(s=i.options)==null?void 0:s.host,this.rt(this.ct=i.element)),L}rt(i){if(this.isConnected||(i=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let r=Lr.get(e);r===void 0&&(r=new WeakMap,Lr.set(e,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,i),i!==void 0&&this.Y.call(this.ht,i)}else this.Y.value=i}get lt(){var i,e;return typeof this.Y=="function"?(i=Lr.get(this.ht??globalThis))==null?void 0:i.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Nr=class{constructor(e){return this.buffer=e,this.u8=new Uint8Array(e),new Proxy(this,{get(r,s){return r[s]?r[s]:r.getBit(s)}})}getBit(e){var r=this.u8[e>>3],s=e&7;return r>>7-s&1}setBit(e,r){var s=e&7;r?this.u8[e>>3]|=128>>s:this.u8[e>>3]&=~(128>>s)}get length(){return this.u8.byteLength*8}set(e,r){for(let s=r||0,t=0,o=e.length;t<o;s++,t++)this.setBit(s,e[t])}subarray(e,r){let s=[];e=e||0,r=r||this.length,r=r>this.length?this.length:r;for(let t=e;t<r;t++)s.push(this.getBit(t));return s}},Gi=(i,e)=>{let r;return(...s)=>{clearTimeout(r),r=window.setTimeout(()=>i.apply(void 0,s),e)}},Ot=i=>{var e;return(...r)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{i.apply(void 0,r)})}};var gn=Object.defineProperty,bn=Object.getOwnPropertyDescriptor,Me=(i,e,r,s)=>{for(var t=s>1?void 0:s?bn(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&gn(e,r,t),t};const vn=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],Yt={width:200,height:200},Zt={width:10,height:10};h.BitDisplayCanvas=class extends ie{constructor(){super(),this.arrayBuffer=new ArrayBuffer(0),this.frameWidth=100,this.scale=1,this.width=200,this.height=200,this.state={},this.yStart=0,this.xStart=0,this.refs={viewport:Ge(),canvas:Ge(),scrollDiv:Ge()},this.color="#000000",this.onThemeChange=()=>{let s=getComputedStyle(this);this.color!=s.color&&(this.color=s.color,this.paint())},this.onResize=()=>{this.calculateViewport()},this.handleScroll=()=>{if(!this.refs.viewport.value)return;const s=this.getPxPerBit();this.yStart=this.refs.viewport.value.scrollTop?Math.floor(this.refs.viewport.value.scrollTop/s)+1:0,this.xStart=this.refs.viewport.value.scrollLeft?Math.floor(this.refs.viewport.value.scrollLeft/s)+1:0,this.paint()};let e=new ResizeObserver(this.onResize);e.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=e,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var r={};vn.forEach(s=>{this.addDisposableListener(this._canvas,s,Ot(async t=>{t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault();var o=await this._canvas;let a=o.getBoundingClientRect(),d={x:Math.floor(Math.abs(t.clientX-a.left)),y:Math.floor(Math.abs(t.clientY-a.top))},c=this.canvasPositionToBit(d);if(s==="mousemove"&&r[s]==c)return;r[s]=c;let b="bit"+String(s).charAt(0).toUpperCase()+String(s).slice(1);if(c!=-1){let _=new CustomEvent(b,{detail:{bitIndex:c,position:d,nativeEvent:t}});this.dispatchEvent(_)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(e){e.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new Nr(this.arrayBuffer));const r=["arrayBuffer","scale","frameWidth","width","height"];for(const s of r)if(e.has(s)){this.paint();return}}canvasPositionToBit(e){let r=Math.floor(e.x/this.scale),s=Math.floor(e.y/this.scale);return r>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(s*this.frameWidth+r)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:e,_bitArray:r}=this;if(e<=0)return;this.calculateViewport();const{width:s=Yt.width,height:t=Yt.height}=this,o=this.getPxPerBit(),a=this.refs.canvas.value.getContext("2d");if(!a)return;this.state.scale!=o&&(a.reset(),a.scale(o,o));let d=getComputedStyle(this);a.fillStyle=d.color,a.clearRect(0,0,s,t);let c=0;for(let b=this.yStart*e+this.xStart,_=r.length;b<_;b++){let v=b%e-this.xStart;if(!(v<0)){if(Math.floor(v*o)>s){c++,b=c*e+this.yStart*e+this.xStart-1;continue}if(Math.floor(c*o)>t)break;r.getBit(b)===1&&a.fillRect(v,c,1,1),(b+1)%e===0&&b>=e-1&&c++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:e,_bitArray:r}=this;if(this.refs.scrollDiv.value){var s=this.getPxPerBit();const t=r.length/e*s,o=e*s,a=this.refs.scrollDiv.value;a.style.width=o+"px",a.style.height=t+"px"}}render(){const{height:e=Yt.height,width:r=Yt.width}=this;return $`
332
+ */const Ye=()=>new fn;let fn=class{};const Nr=new WeakMap,Ze=Ge(class extends Wi{render(i){return L}update(i,[e]){var s;const r=e!==this.Y;return r&&this.Y!==void 0&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.Y=e,this.ht=(s=i.options)==null?void 0:s.host,this.rt(this.ct=i.element)),L}rt(i){if(this.isConnected||(i=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let r=Nr.get(e);r===void 0&&(r=new WeakMap,Nr.set(e,r)),r.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),r.set(this.Y,i),i!==void 0&&this.Y.call(this.ht,i)}else this.Y.value=i}get lt(){var i,e;return typeof this.Y=="function"?(i=Nr.get(this.ht??globalThis))==null?void 0:i.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Dr=class{constructor(e){return this.buffer=e,this.u8=new Uint8Array(e),new Proxy(this,{get(r,s){return r[s]?r[s]:r.getBit(s)}})}getBit(e){var r=this.u8[e>>3],s=e&7;return r>>7-s&1}setBit(e,r){var s=e&7;r?this.u8[e>>3]|=128>>s:this.u8[e>>3]&=~(128>>s)}get length(){return this.u8.byteLength*8}set(e,r){for(let s=r||0,t=0,o=e.length;t<o;s++,t++)this.setBit(s,e[t])}subarray(e,r){let s=[];e=e||0,r=r||this.length,r=r>this.length?this.length:r;for(let t=e;t<r;t++)s.push(this.getBit(t));return s}},Gi=(i,e)=>{let r;return(...s)=>{clearTimeout(r),r=window.setTimeout(()=>i.apply(void 0,s),e)}},Pt=i=>{var e;return(...r)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{i.apply(void 0,r)})}};var gn=Object.defineProperty,bn=Object.getOwnPropertyDescriptor,ze=(i,e,r,s)=>{for(var t=s>1?void 0:s?bn(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&gn(e,r,t),t};const vn=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],Zt={width:200,height:200},Jt={width:10,height:10};h.BitDisplayCanvas=class extends se{constructor(){super(),this.arrayBuffer=new ArrayBuffer(0),this.frameWidth=100,this.scale=1,this.width=200,this.height=200,this.state={},this.yStart=0,this.xStart=0,this.refs={viewport:Ye(),canvas:Ye(),scrollDiv:Ye()},this.color="#000000",this.onThemeChange=()=>{let s=getComputedStyle(this);this.color!=s.color&&(this.color=s.color,this.paint())},this.onResize=()=>{this.calculateViewport()},this.handleScroll=()=>{if(!this.refs.viewport.value)return;const s=this.getPxPerBit();this.yStart=this.refs.viewport.value.scrollTop?Math.floor(this.refs.viewport.value.scrollTop/s)+1:0,this.xStart=this.refs.viewport.value.scrollLeft?Math.floor(this.refs.viewport.value.scrollLeft/s)+1:0,this.paint()};let e=new ResizeObserver(this.onResize);e.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=e,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var r={};vn.forEach(s=>{this.addDisposableListener(this._canvas,s,Pt(async t=>{t.stopImmediatePropagation(),t.stopPropagation(),t.preventDefault();var o=await this._canvas;let a=o.getBoundingClientRect(),d={x:Math.floor(Math.abs(t.clientX-a.left)),y:Math.floor(Math.abs(t.clientY-a.top))},u=this.canvasPositionToBit(d);if(s==="mousemove"&&r[s]==u)return;r[s]=u;let b="bit"+String(s).charAt(0).toUpperCase()+String(s).slice(1);if(u!=-1){let y=new CustomEvent(b,{detail:{bitIndex:u,position:d,nativeEvent:t}});this.dispatchEvent(y)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(e){e.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new Dr(this.arrayBuffer));const r=["arrayBuffer","scale","frameWidth","width","height"];for(const s of r)if(e.has(s)){this.paint();return}}canvasPositionToBit(e){let r=Math.floor(e.x/this.scale),s=Math.floor(e.y/this.scale);return r>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(s*this.frameWidth+r)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:e,_bitArray:r}=this;if(e<=0)return;this.calculateViewport();const{width:s=Zt.width,height:t=Zt.height}=this,o=this.getPxPerBit(),a=this.refs.canvas.value.getContext("2d");if(!a)return;this.state.scale!=o&&(a.reset(),a.scale(o,o));let d=getComputedStyle(this);a.fillStyle=d.color,a.clearRect(0,0,s,t);let u=0;for(let b=this.yStart*e+this.xStart,y=r.length;b<y;b++){let v=b%e-this.xStart;if(!(v<0)){if(Math.floor(v*o)>s){u++,b=u*e+this.yStart*e+this.xStart-1;continue}if(Math.floor(u*o)>t)break;r.getBit(b)===1&&a.fillRect(v,u,1,1),(b+1)%e===0&&b>=e-1&&u++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:e,_bitArray:r}=this;if(this.refs.scrollDiv.value){var s=this.getPxPerBit();const t=r.length/e*s,o=e*s,a=this.refs.scrollDiv.value;a.style.width=o+"px",a.style.height=t+"px"}}render(){const{height:e=Zt.height,width:r=Zt.width}=this;return _`
333
333
  <div
334
334
  id="viewport"
335
- ${Ye(this.refs.viewport)}
335
+ ${Ze(this.refs.viewport)}
336
336
  @scroll=${this.handleScroll}
337
- style=${`width:${r+Zt.width}px;height:${e+Zt.height}px;overflow:auto;position:relative`}
337
+ style=${`width:${r+Jt.width}px;height:${e+Jt.height}px;overflow:auto;position:relative`}
338
338
  >
339
339
  <div
340
340
  id="fakescrolldiv"
341
- ${Ye(this.refs.scrollDiv)}
341
+ ${Ze(this.refs.scrollDiv)}
342
342
  >
343
343
  </div>
344
344
  </div>
345
345
  <canvas
346
- ${Ye(this.refs.canvas)}
346
+ ${Ze(this.refs.canvas)}
347
347
  width=${r}
348
348
  height=${e}
349
349
  ></canvas>
@@ -371,8 +371,8 @@ opacity:1
371
371
  background-color:var(--background-color);
372
372
  }
373
373
  ::-webkit-scrollbar {
374
- height: ${Zt.height}px;
375
- width: ${Zt.width}px;
374
+ height: ${Jt.height}px;
375
+ width: ${Jt.width}px;
376
376
 
377
377
  }
378
378
 
@@ -443,7 +443,7 @@ opacity:1
443
443
 
444
444
  }
445
445
 
446
- `,Me([g({type:Object,attribute:!1})],h.BitDisplayCanvas.prototype,"arrayBuffer",2),Me([g({type:Number})],h.BitDisplayCanvas.prototype,"frameWidth",2),Me([g({type:Number})],h.BitDisplayCanvas.prototype,"scale",2),Me([g({type:Number})],h.BitDisplayCanvas.prototype,"width",2),Me([g({type:Number})],h.BitDisplayCanvas.prototype,"height",2),Me([At("canvas")],h.BitDisplayCanvas.prototype,"_canvas",2),h.BitDisplayCanvas=Me([I("spectric-bit-display")],h.BitDisplayCanvas);const yn=J`.spectric-header {
446
+ `,ze([g({type:Object,attribute:!1})],h.BitDisplayCanvas.prototype,"arrayBuffer",2),ze([g({type:Number})],h.BitDisplayCanvas.prototype,"frameWidth",2),ze([g({type:Number})],h.BitDisplayCanvas.prototype,"scale",2),ze([g({type:Number})],h.BitDisplayCanvas.prototype,"width",2),ze([g({type:Number})],h.BitDisplayCanvas.prototype,"height",2),ze([Ct("canvas")],h.BitDisplayCanvas.prototype,"_canvas",2),h.BitDisplayCanvas=ze([R("spectric-bit-display")],h.BitDisplayCanvas);const yn=J`.spectric-header {
447
447
  display: flex;
448
448
  justify-content: space-between;
449
449
  align-items: center;
@@ -478,7 +478,7 @@ opacity:1
478
478
  color: #333;
479
479
  font-size: 14px;
480
480
  }
481
- `;var mn=Object.defineProperty,$n=Object.getOwnPropertyDescriptor,Jt=(i,e,r,s)=>{for(var t=s>1?void 0:s?$n(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&mn(e,r,t),t};h.Header=class extends B{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",e))},this.onLogin=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",e))},this.onCreateAccount=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",e))}}render(){return $`
481
+ `;var mn=Object.defineProperty,$n=Object.getOwnPropertyDescriptor,Kt=(i,e,r,s)=>{for(var t=s>1?void 0:s?$n(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&mn(e,r,t),t};h.Header=class extends B{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",e))},this.onLogin=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",e))},this.onCreateAccount=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",e))}}render(){return _`
482
482
  <header>
483
483
  <div class="spectric-header">
484
484
  <div style="flex-grow:1;">
@@ -486,10 +486,10 @@ opacity:1
486
486
  <h1><slot name="name"></slot></h1>
487
487
  <slot name="center"></slot>
488
488
  </div>
489
- ${this.showLoginButton!==!1?$`
489
+ ${this.showLoginButton!==!1?_`
490
490
  <div>
491
- ${this.username&&this.username!==""?$`<spectric-button variant="secondary" size="small" @click=${this.onLogout}>Log out</spectric-button>`:$`
492
- ${this.showCreateAccount!==!1?$`<spectric-button variant="text" size="small" @click=${this.onCreateAccount}>Sign up</spectric-button>`:null}
491
+ ${this.username&&this.username!==""?_`<spectric-button variant="secondary" size="small" @click=${this.onLogout}>Log out</spectric-button>`:_`
492
+ ${this.showCreateAccount!==!1?_`<spectric-button variant="text" size="small" @click=${this.onCreateAccount}>Sign up</spectric-button>`:null}
493
493
  <spectric-button variant="primary" size="small" @click=${this.onLogin}>Log in</spectric-button>`}
494
494
 
495
495
 
@@ -497,16 +497,16 @@ opacity:1
497
497
  <slot name="end"></slot>
498
498
  </div>
499
499
  </header>
500
- `}},h.Header.styles=yn,Jt([g({type:Boolean,reflect:!0})],h.Header.prototype,"showCreateAccount",2),Jt([g({type:Boolean,reflect:!0})],h.Header.prototype,"showLoginButton",2),Jt([g({type:String,reflect:!0})],h.Header.prototype,"username",2),h.Header=Jt([I("spectric-header")],h.Header);var _n=Object.defineProperty,wn=Object.getOwnPropertyDescriptor,Ze=(i,e,r,s)=>{for(var t=s>1?void 0:s?wn(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&_n(e,r,t),t};const Sn={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let ze=class extends B{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=i=>{i.preventDefault(),i.stopPropagation();const e={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:r,text:s,headerStyle:t,dismissable:o}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:r,text:s,headerStyle:t,dismissable:o},...e}))}}render(){if(!this._dismissed)return $`
501
- <header style=${kr({...Sn,...this.headerStyle})}>
500
+ `}},h.Header.styles=yn,Kt([g({type:Boolean,reflect:!0})],h.Header.prototype,"showCreateAccount",2),Kt([g({type:Boolean,reflect:!0})],h.Header.prototype,"showLoginButton",2),Kt([g({type:String,reflect:!0})],h.Header.prototype,"username",2),h.Header=Kt([R("spectric-header")],h.Header);var _n=Object.defineProperty,wn=Object.getOwnPropertyDescriptor,Je=(i,e,r,s)=>{for(var t=s>1?void 0:s?wn(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&_n(e,r,t),t};const Sn={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let Ie=class extends B{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=i=>{i.preventDefault(),i.stopPropagation();const e={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:r,text:s,headerStyle:t,dismissable:o}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:r,text:s,headerStyle:t,dismissable:o},...e}))}}render(){if(!this._dismissed)return _`
501
+ <header style=${Er({...Sn,...this.headerStyle})}>
502
502
  <div style="flex-grow:1">
503
503
  <slot name="text">${this.text}</slot><slot></slot>
504
504
  </div>
505
- ${this.dismissable?$`<spectric-button size="small" @click=${this.onDismiss} icon
505
+ ${this.dismissable?_`<spectric-button size="small" @click=${this.onDismiss} icon
506
506
  >X</spectric-button
507
507
  >`:null}
508
508
  </header>
509
- `}};Ze([g({type:Boolean,reflect:!0})],ze.prototype,"dismissable",2),Ze([g({type:String,reflect:!0})],ze.prototype,"text",2),Ze([g({type:String,reflect:!0})],ze.prototype,"bannerId",2),Ze([g({type:Object})],ze.prototype,"headerStyle",2),Ze([g({state:!0,type:Boolean,attribute:!1})],ze.prototype,"_dismissed",2),ze=Ze([I("spectric-banner")],ze);const xn=J`
509
+ `}};Je([g({type:Boolean,reflect:!0})],Ie.prototype,"dismissable",2),Je([g({type:String,reflect:!0})],Ie.prototype,"text",2),Je([g({type:String,reflect:!0})],Ie.prototype,"bannerId",2),Je([g({type:Object})],Ie.prototype,"headerStyle",2),Je([g({state:!0,type:Boolean,attribute:!1})],Ie.prototype,"_dismissed",2),Ie=Je([R("spectric-banner")],Ie);const xn=J`
510
510
 
511
511
  :host {
512
512
  height:100vh;
@@ -666,18 +666,18 @@ article{
666
666
  * @license
667
667
  * Copyright 2018 Google LLC
668
668
  * SPDX-License-Identifier: BSD-3-Clause
669
- */const Dr=i=>i??L;class Mr extends Wi{constructor(){super(...arguments),this.prevData={}}render(e){return L}update(e,[r]){var s;this.element!==e.element&&(this.element=e.element),this.host=((s=e.options)==null?void 0:s.host)||this.element,this.apply(r),this.groom(r),this.prevData={...r}}apply(e){if(!e)return;const{element:r}=this;for(const s in e){const t=e[s];r[s]!==t&&(r[s]=t)}}groom(e){const{prevData:r,element:s}=this;if(r)for(const t in r)(!e||!(t in e)&&s[t]===r[t])&&(s[t]=void 0)}}const me=We(Mr);var zr=(i=>(i.None="none",i.Uscui="us.cui",i.Usclassified="us.classified",i.Usunclassified="us.unclassified",i.Usconfidential="us.confidential",i.Ussecret="us.secret",i.Ustopsecret="us.topsecret",i.UstopsecretSi="us.topsecret.si",i.Uknotset="uk.notset",i.Ukofficial="uk.official",i.Uksecret="uk.secret",i.Uktopsecret="uk.topsecret",i.Caprotected_a="ca.protected_a",i.Caprotected_b="ca.protected_b",i.Caprotected_c="ca.protected_c",i.Caconfidential="ca.confidential",i.Casecret="ca.secret",i.Catopsecret="ca.topsecret",i.Auunofficial="au.unofficial",i.Auofficial="au.official",i.Auofficialsensitive="au.officialsensitive",i.Auconfidential="au.confidential",i.Ausecret="au.secret",i.Autopsecret="au.topsecret",i))(zr||{});const Kt={none:{},"us.cui":{color:"white",backgroundColor:"#3D1E5A",content:"Controlled Unclassified Information"},"us.classified":{color:"white",backgroundColor:"#723D9A",content:"Classified"},"us.unclassified":{color:"white",backgroundColor:"#007A33",content:"Unclassified"},"us.confidential":{color:"white",backgroundColor:"#0033A0",content:"Confidential"},"us.secret":{color:"white",backgroundColor:"#C8102E",content:"Secret"},"us.topsecret":{color:"white",backgroundColor:"#FF671F",content:"Top Secret"},"us.topsecret.si":{color:"black",backgroundColor:"#F7EA48",content:"Top Secret//SI"},"uk.notset":{color:"white",backgroundColor:" #616161",content:"Not Set"},"uk.official":{color:"white",backgroundColor:"#2B71C7",content:"For Offical Use"},"uk.secret":{color:"white",backgroundColor:"#F39C2C",content:"Secret"},"uk.topsecret":{color:"white",backgroundColor:"#AA0000",content:"Top Secret"},"ca.protected_a":{color:"white",backgroundColor:"#227ABC",content:"PROTECTED A"},"ca.protected_b":{color:"white",backgroundColor:"#900FB5",content:"PROTECTED B"},"ca.protected_c":{color:"white",backgroundColor:"#460FB5",content:"PROTECTED C"},"ca.confidential":{color:"white",backgroundColor:"#0033a0",content:"Confidential"},"ca.secret":{color:"white",backgroundColor:"#c8102e",content:"Secret"},"ca.topsecret":{color:"white",backgroundColor:"#ff671f",content:"Top Secret"},"au.unofficial":{color:"#666",backgroundColor:"#ffffffff",content:"Unofficial"},"au.official":{color:"#666",backgroundColor:"#ffffffff",content:"Official"},"au.officialsensitive":{color:"#666",backgroundColor:"#ffffffff",content:"Official Sentitive"},"au.confidential":{color:"white",backgroundColor:"#4F81BD",content:"Confidential"},"au.secret":{color:"black",backgroundColor:" #E5B8B7",content:"Secret"},"au.topsecret":{color:"black",backgroundColor:"#AA0000",content:"Top Secret"}};var kn=Object.defineProperty,En=Object.getOwnPropertyDescriptor,ne=(i,e,r,s)=>{for(var t=s>1?void 0:s?En(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&kn(e,r,t),t};h.SpectricPage=class extends B{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=zr.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!Kt[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=zr.None);const e=this.classificationLevel?this.classificationText||Kt[this.classificationLevel].content:"",r=this.showHeader?$`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${Dr(this.username)}>
669
+ */const Mr=i=>i??L;class zr extends Wi{constructor(){super(...arguments),this.prevData={}}render(e){return L}update(e,[r]){var s;this.element!==e.element&&(this.element=e.element),this.host=((s=e.options)==null?void 0:s.host)||this.element,this.apply(r),this.groom(r),this.prevData={...r}}apply(e){if(!e)return;const{element:r}=this;for(const s in e){const t=e[s];r[s]!==t&&(r[s]=t)}}groom(e){const{prevData:r,element:s}=this;if(r)for(const t in r)(!e||!(t in e)&&s[t]===r[t])&&(s[t]=void 0)}}const me=Ge(zr);var Ir=(i=>(i.None="none",i.Uscui="us.cui",i.Usclassified="us.classified",i.Usunclassified="us.unclassified",i.Usconfidential="us.confidential",i.Ussecret="us.secret",i.Ustopsecret="us.topsecret",i.UstopsecretSi="us.topsecret.si",i.Uknotset="uk.notset",i.Ukofficial="uk.official",i.Uksecret="uk.secret",i.Uktopsecret="uk.topsecret",i.Caprotected_a="ca.protected_a",i.Caprotected_b="ca.protected_b",i.Caprotected_c="ca.protected_c",i.Caconfidential="ca.confidential",i.Casecret="ca.secret",i.Catopsecret="ca.topsecret",i.Auunofficial="au.unofficial",i.Auofficial="au.official",i.Auofficialsensitive="au.officialsensitive",i.Auconfidential="au.confidential",i.Ausecret="au.secret",i.Autopsecret="au.topsecret",i))(Ir||{});const Xt={none:{},"us.cui":{color:"white",backgroundColor:"#3D1E5A",content:"Controlled Unclassified Information"},"us.classified":{color:"white",backgroundColor:"#723D9A",content:"Classified"},"us.unclassified":{color:"white",backgroundColor:"#007A33",content:"Unclassified"},"us.confidential":{color:"white",backgroundColor:"#0033A0",content:"Confidential"},"us.secret":{color:"white",backgroundColor:"#C8102E",content:"Secret"},"us.topsecret":{color:"white",backgroundColor:"#FF671F",content:"Top Secret"},"us.topsecret.si":{color:"black",backgroundColor:"#F7EA48",content:"Top Secret//SI"},"uk.notset":{color:"white",backgroundColor:" #616161",content:"Not Set"},"uk.official":{color:"white",backgroundColor:"#2B71C7",content:"For Offical Use"},"uk.secret":{color:"white",backgroundColor:"#F39C2C",content:"Secret"},"uk.topsecret":{color:"white",backgroundColor:"#AA0000",content:"Top Secret"},"ca.protected_a":{color:"white",backgroundColor:"#227ABC",content:"PROTECTED A"},"ca.protected_b":{color:"white",backgroundColor:"#900FB5",content:"PROTECTED B"},"ca.protected_c":{color:"white",backgroundColor:"#460FB5",content:"PROTECTED C"},"ca.confidential":{color:"white",backgroundColor:"#0033a0",content:"Confidential"},"ca.secret":{color:"white",backgroundColor:"#c8102e",content:"Secret"},"ca.topsecret":{color:"white",backgroundColor:"#ff671f",content:"Top Secret"},"au.unofficial":{color:"#666",backgroundColor:"#ffffffff",content:"Unofficial"},"au.official":{color:"#666",backgroundColor:"#ffffffff",content:"Official"},"au.officialsensitive":{color:"#666",backgroundColor:"#ffffffff",content:"Official Sentitive"},"au.confidential":{color:"white",backgroundColor:"#4F81BD",content:"Confidential"},"au.secret":{color:"black",backgroundColor:" #E5B8B7",content:"Secret"},"au.topsecret":{color:"black",backgroundColor:"#AA0000",content:"Top Secret"}};var kn=Object.defineProperty,En=Object.getOwnPropertyDescriptor,oe=(i,e,r,s)=>{for(var t=s>1?void 0:s?En(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&kn(e,r,t),t};h.SpectricPage=class extends B{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=Ir.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!Xt[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=Ir.None);const e=this.classificationLevel?this.classificationText||Xt[this.classificationLevel].content:"",r=this.showHeader?_`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${Mr(this.username)}>
670
670
  <slot name="branding" slot="branding"></slot>
671
671
  <slot name="name" slot="name"></slot>
672
672
  <slot name="center" slot="center"></slot>
673
673
  <slot name="end" slot="end"></slot>
674
- </spectric-header>`:null;return $`
675
- ${this.classificationLevel&&e?$`
674
+ </spectric-header>`:null;return _`
675
+ ${this.classificationLevel&&e?_`
676
676
  <!-- Classification Banner -->
677
- <spectric-banner ${me({text:e,headerStyle:Kt[this.classificationLevel]})}></spectric-banner>
677
+ <spectric-banner ${me({text:e,headerStyle:Xt[this.classificationLevel]})}></spectric-banner>
678
678
  `:null}
679
- <spectric-theme theme=${Dr(this.theme)}>
680
- ${this.notifications?this.notifications.map(s=>$`<spectric-banner ${me(s)} ></spectric-banner>`):null}
679
+ <spectric-theme theme=${Mr(this.theme)}>
680
+ ${this.notifications?this.notifications.map(s=>_`<spectric-banner ${me(s)} ></spectric-banner>`):null}
681
681
  ${this.headerSticky?r:null}
682
682
  <article>
683
683
  ${this.headerSticky?null:r}
@@ -687,13 +687,13 @@ article{
687
687
  </section>
688
688
  </article>
689
689
  </spectric-theme>
690
- ${this.classificationLevel&&e?$`<spectric-banner ${me({text:e,headerStyle:Kt[this.classificationLevel]})}></spectric-banner>`:null}
690
+ ${this.classificationLevel&&e?_`<spectric-banner ${me({text:e,headerStyle:Xt[this.classificationLevel]})}></spectric-banner>`:null}
691
691
 
692
- `}},h.SpectricPage.styles=xn,ne([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showHeader",2),ne([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"headerSticky",2),ne([g({type:String,reflect:!0})],h.SpectricPage.prototype,"classificationLevel",2),ne([g({type:String,reflect:!0})],h.SpectricPage.prototype,"classificationText",2),ne([g({type:Array,reflect:!0})],h.SpectricPage.prototype,"notifications",2),ne([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showCreateAccount",2),ne([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showLoginButton",2),ne([g({type:String,reflect:!0})],h.SpectricPage.prototype,"username",2),ne([g({type:String,reflect:!0})],h.SpectricPage.prototype,"theme",2),h.SpectricPage=ne([I("spectric-page")],h.SpectricPage);var An=Object.defineProperty,Cn=Object.getOwnPropertyDescriptor,R=(i,e,r,s)=>{for(var t=s>1?void 0:s?Cn(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&An(e,r,t),t},Ir=(i=>(i.Text="text",i.TextArea="text-area",i.number="number",i.color="color",i.date="date",i.datePopup="popup-date",i.datetime="datetime-local",i.email="email",i.file="file",i.hidden="hidden",i.password="password",i.checkbox="checkbox",i.range="range",i))(Ir||{});h.SpectricInput=class extends B{constructor(){super(...arguments),this.checked=!1,this.files=null,this.placeholder="",this.readonly=!1,this.variant="text",this.disabled=!1,this.label="",this.hidePasswordLabel="Hide",this.showPasswordLabel="Show",this.showPasswordVisibilityToggle=!0,this.helperText="",this.invalid=!1,this.required=!1,this.invalidText="",this.name="",this.pattern="",this.maxCount=0,this._value="",this._showPassword=!1,this.autocomplete="off",this._handleInput=({target:e})=>{const r=e;this.variant=="file"?this.files=r.files:this.value=r.value,this.invalid=!r.validity.valid},this.handleTogglePasswordVisibility=()=>{this._showPassword=!this._showPassword,this.requestUpdate()}}createRenderRoot(){return this}get selectionStart(){return this._input?this._input.selectionStart:null}get value(){return this._input?this.variant=="number"?parseFloat(this._input.value):this._input.value:this._value}set value(e){const r=this._value;this._value=e,this.requestUpdate("value",r),this._input&&(this._input.value=String(e))}blur(){this._input&&this._input.blur()}focus(e){this._input&&(this._input.blur(),this._input.focus(e))}setSelectionRange(e,r,s="none"){this._input&&this._input.setSelectionRange(e,r,s)}updated(e){e.has("checked")&&e.get("checked")}_handleChange(e){e.stopPropagation(),this.variant==="file"?this.files=e.target.files:this.value=e.target.value,this.dispatchEvent(new Event("change",{bubbles:!0}))}render(){const e=$`<spectric-calendar
692
+ `}},h.SpectricPage.styles=xn,oe([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showHeader",2),oe([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"headerSticky",2),oe([g({type:String,reflect:!0})],h.SpectricPage.prototype,"classificationLevel",2),oe([g({type:String,reflect:!0})],h.SpectricPage.prototype,"classificationText",2),oe([g({type:Array,reflect:!0})],h.SpectricPage.prototype,"notifications",2),oe([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showCreateAccount",2),oe([g({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showLoginButton",2),oe([g({type:String,reflect:!0})],h.SpectricPage.prototype,"username",2),oe([g({type:String,reflect:!0})],h.SpectricPage.prototype,"theme",2),h.SpectricPage=oe([R("spectric-page")],h.SpectricPage);var An=Object.defineProperty,Cn=Object.getOwnPropertyDescriptor,I=(i,e,r,s)=>{for(var t=s>1?void 0:s?Cn(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&An(e,r,t),t},Rr=(i=>(i.Text="text",i.TextArea="text-area",i.number="number",i.color="color",i.date="date",i.datePopup="popup-date",i.datetime="datetime-local",i.email="email",i.file="file",i.hidden="hidden",i.password="password",i.checkbox="checkbox",i.range="range",i))(Rr||{});h.SpectricInput=class extends B{constructor(){super(...arguments),this.checked=!1,this.files=null,this.placeholder="",this.readonly=!1,this.variant="text",this.disabled=!1,this.label="",this.hidePasswordLabel="Hide",this.showPasswordLabel="Show",this.showPasswordVisibilityToggle=!0,this.helperText="",this.invalid=!1,this.required=!1,this.invalidText="",this.name="",this.pattern="",this.maxCount=0,this._value="",this._showPassword=!1,this.autocomplete="off",this.spellcheck=!0,this._handleInput=({target:e})=>{const r=e;this.variant=="file"?this.files=r.files:this.value=r.value,this.invalid=!r.validity.valid},this.handleTogglePasswordVisibility=()=>{this._showPassword=!this._showPassword,this.requestUpdate()}}createRenderRoot(){return this}get selectionStart(){return this._input?this._input.selectionStart:null}get value(){return this._input?this.variant=="number"?parseFloat(this._input.value):this._input.value:this._value}set value(e){const r=this._value;this._value=e,this.requestUpdate("value",r),this._input&&(this._input.value=String(e))}blur(){this._input&&this._input.blur()}focus(e){this._input&&(this._input.blur(),this._input.focus(e))}setSelectionRange(e,r,s="none"){this._input&&this._input.setSelectionRange(e,r,s)}updated(e){e.has("checked")&&e.get("checked")}_handleChange(e){e.stopPropagation(),this.variant==="file"?this.files=e.target.files:this.value=e.target.value,this.dispatchEvent(new Event("change",{bubbles:!0}))}render(){const e=_`<spectric-calendar
693
693
  .popup=${this.variant==="popup-date"}
694
694
  @select=${r=>{var s;this.value=r.detail.toISOString(),(s=this.querySelector("spectric-popover"))==null||s.hidePopover()}}
695
695
  >
696
- </spectric-calendar>`;switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"popup-date":case"datetime-local":case"file":case"range":return $`
696
+ </spectric-calendar>`;switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"popup-date":case"datetime-local":case"file":case"range":return _`
697
697
  <div class="inputWrapper">
698
698
  <div class="text-input__label-helper-wrapper">
699
699
  <div class="--text-input__label-wrapper">
@@ -709,21 +709,22 @@ article{
709
709
  ?disabled="${this.disabled}"
710
710
  aria-describedby="helper-text"
711
711
  id="input"
712
- name="${Je(this.name)}"
713
- pattern="${Je(this.pattern)}"
714
- placeholder="${Je(this.placeholder)}"
715
- autocomplete="${Je(this.autocomplete)}"
712
+ name="${Ke(this.name)}"
713
+ pattern="${Ke(this.pattern)}"
714
+ placeholder="${Ke(this.placeholder)}"
715
+ autocomplete="${Ke(this.autocomplete)}"
716
+ spellcheck=${this.spellcheck}
716
717
  ?readonly="${this.readonly}"
717
718
  ?required="${this.required}"
718
- type="${Je(this.variant!=="password"?this.variant!=="date"?this.variant:"text":this._showPassword?"text":"password")}"
719
+ type="${Ke(this.variant!=="password"?this.variant!=="date"?this.variant:"text":this._showPassword?"text":"password")}"
719
720
  .value="${this._value}"
720
- maxlength="${Je(this.maxCount>0?this.maxCount:void 0)}"
721
+ maxlength="${Ke(this.maxCount>0?this.maxCount:void 0)}"
721
722
  @input="${this._handleInput}"
722
723
  @change=${this._handleChange}
723
724
  />
724
725
 
725
726
  ${this.variant==="popup-date"?e:null}
726
- ${this.variant==="password"&&this.showPasswordVisibilityToggle?$`
727
+ ${this.variant==="password"&&this.showPasswordVisibilityToggle?_`
727
728
  <spectric-button
728
729
  icon
729
730
  class="input-button-right"
@@ -746,7 +747,7 @@ article{
746
747
  </div>
747
748
  </div>
748
749
  </div>
749
- `;case"color":return $`<div class="inputWrapper">
750
+ `;case"color":return _`<div class="inputWrapper">
750
751
  <div class="text-input__label-helper-wrapper">
751
752
  <div class="--text-input__label-wrapper">
752
753
  ${this.label} ${this.maxCount>0&&this._value?`${this._value.length}/${this.maxCount}`:null}
@@ -767,33 +768,33 @@ article{
767
768
  </div>
768
769
 
769
770
  </div>
770
- </div>`;case"hidden":return $`<input type="hidden" />`;case"checkbox":return $`
771
+ </div>`;case"hidden":return _`<input type="hidden" />`;case"checkbox":return _`
771
772
  <div class="checkbox">
772
773
  <spectric-button
773
774
  .tooltip=${this.helperText}
774
775
  @click=${()=>{this.checked=!this.checked,this.value=!!this.checked,this.dispatchEvent(new Event("change",{bubbles:!0}))}} icon size=${this.size||"xxsmall"} variant=${this.checked?"primary":"secondary"}>${this.checked?"✓":" "}</spectric-button>
775
- ${this.label.length?$`<span>${this.label}</span>`:null}
776
+ ${this.label.length?_`<span>${this.label}</span>`:null}
776
777
  </div>
777
778
  </label>
778
- `}return`Not yet implemented ${this.variant}`}},R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"checked",2),R([g({type:String,reflect:!0})],h.SpectricInput.prototype,"placeholder",2),R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"readonly",2),R([g({type:String,reflect:!0})],h.SpectricInput.prototype,"variant",2),R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"disabled",2),R([g({type:String,reflect:!0})],h.SpectricInput.prototype,"label",2),R([g()],h.SpectricInput.prototype,"hidePasswordLabel",2),R([g()],h.SpectricInput.prototype,"showPasswordLabel",2),R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"showPasswordVisibilityToggle",2),R([g({type:String,reflect:!0})],h.SpectricInput.prototype,"helperText",2),R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"invalid",2),R([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"required",2),R([g({type:String,reflect:!0})],h.SpectricInput.prototype,"invalidText",2),R([g()],h.SpectricInput.prototype,"name",2),R([g()],h.SpectricInput.prototype,"pattern",2),R([g({type:Number,reflect:!0})],h.SpectricInput.prototype,"maxCount",2),R([g({reflect:!0})],h.SpectricInput.prototype,"autocomplete",2),R([g({reflect:!0})],h.SpectricInput.prototype,"value",1),R([de("input")],h.SpectricInput.prototype,"_input",2),R([Le({capture:!0})],h.SpectricInput.prototype,"_handleChange",1),h.SpectricInput=R([I("spectric-input")],h.SpectricInput);const Je=i=>Dr(i===""?void 0:i??void 0),On="end of input",Pn={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class Yi extends Error{constructor(e,r){let s=e.message;if(e.expected){const a=e.expected.map(c=>Pn[c.description]||c.description).join(", ");let d=e.found?`"${e.found}"`:On;s=`Expected ${a} but ${d} found.`}const t=[s,r,"-".repeat(e.location.start.offset)+"^"].join(`
779
- `);super(t),this.name="DQLSyntaxError",this.shortMessage=s}}function Ke(i){return{type:"literal",value:i}}function Rr(i){return i.value}const Tn=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Ke,toOpenSearchQuery:Rr},Symbol.toStringTag,{value:"Module"})),{parse:Xt}=function(){class i extends SyntaxError{constructor(s,t,o,a){super(s),this.expected=t,this.found=o,this.location=a,this.name="SyntaxError"}format(s){let t="Error: "+this.message;if(this.location){let o=null;const a=s.find(_=>_.source===this.location.source);a&&(o=a.text.split(/\r\n|\n|\r/g));const d=this.location.start,c=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(d):d,b=this.location.source+":"+c.line+":"+c.column;if(o){const _=this.location.end,v="".padEnd(c.line.toString().length," "),C=o[d.line-1],S=(d.line===_.line?_.column:C.length+1)-d.column||1;t+=`
779
+ `}return`Not yet implemented ${this.variant}`}},I([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"checked",2),I([g({type:String,reflect:!0})],h.SpectricInput.prototype,"placeholder",2),I([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"readonly",2),I([g({type:String,reflect:!0})],h.SpectricInput.prototype,"variant",2),I([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"disabled",2),I([g({type:String,reflect:!0})],h.SpectricInput.prototype,"label",2),I([g()],h.SpectricInput.prototype,"hidePasswordLabel",2),I([g()],h.SpectricInput.prototype,"showPasswordLabel",2),I([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"showPasswordVisibilityToggle",2),I([g({type:String,reflect:!0})],h.SpectricInput.prototype,"helperText",2),I([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"invalid",2),I([g({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"required",2),I([g({type:String,reflect:!0})],h.SpectricInput.prototype,"invalidText",2),I([g()],h.SpectricInput.prototype,"name",2),I([g()],h.SpectricInput.prototype,"pattern",2),I([g({type:Number,reflect:!0})],h.SpectricInput.prototype,"maxCount",2),I([g({reflect:!0})],h.SpectricInput.prototype,"autocomplete",2),I([g({reflect:!0,type:Boolean})],h.SpectricInput.prototype,"spellcheck",2),I([g({reflect:!0})],h.SpectricInput.prototype,"value",1),I([de("input")],h.SpectricInput.prototype,"_input",2),I([Ne({capture:!0})],h.SpectricInput.prototype,"_handleChange",1),h.SpectricInput=I([R("spectric-input")],h.SpectricInput);const Ke=i=>Mr(i===""?void 0:i??void 0),On="end of input",Pn={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class Yi extends Error{constructor(e,r){let s=e.message;if(e.expected){const a=e.expected.map(u=>Pn[u.description]||u.description).join(", ");let d=e.found?`"${e.found}"`:On;s=`Expected ${a} but ${d} found.`}const t=[s,r,"-".repeat(e.location.start.offset)+"^"].join(`
780
+ `);super(t),this.name="DQLSyntaxError",this.shortMessage=s}}function Xe(i){return{type:"literal",value:i}}function jr(i){return i.value}const Tn=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Xe,toOpenSearchQuery:jr},Symbol.toStringTag,{value:"Module"})),{parse:er}=function(){class i extends SyntaxError{constructor(s,t,o,a){super(s),this.expected=t,this.found=o,this.location=a,this.name="SyntaxError"}format(s){let t="Error: "+this.message;if(this.location){let o=null;const a=s.find(y=>y.source===this.location.source);a&&(o=a.text.split(/\r\n|\n|\r/g));const d=this.location.start,u=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(d):d,b=this.location.source+":"+u.line+":"+u.column;if(o){const y=this.location.end,v="".padEnd(u.line.toString().length," "),A=o[d.line-1],S=(d.line===y.line?y.column:A.length+1)-d.column||1;t+=`
780
781
  --> `+b+`
781
782
  `+v+` |
782
- `+c.line+" | "+C+`
783
+ `+u.line+" | "+A+`
783
784
  `+v+" | "+"".padEnd(d.column-1," ")+"".padEnd(S,"^")}else t+=`
784
- at `+b}return t}static buildMessage(s,t){function o(S){return S.codePointAt(0).toString(16).toUpperCase()}const a=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function d(S){return a?S.replace(a,A=>"\\u{"+o(A)+"}"):S}function c(S){return d(S.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,A=>"\\x0"+o(A)).replace(/[\x10-\x1F\x7F-\x9F]/g,A=>"\\x"+o(A)))}function b(S){return d(S.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,A=>"\\x0"+o(A)).replace(/[\x10-\x1F\x7F-\x9F]/g,A=>"\\x"+o(A)))}const _={literal(S){return'"'+c(S.text)+'"'},class(S){const A=S.parts.map(N=>Array.isArray(N)?b(N[0])+"-"+b(N[1]):b(N));return"["+(S.inverted?"^":"")+A.join("")+"]"+(S.unicode?"u":"")},any(){return"any character"},end(){return"end of input"},other(S){return S.description}};function v(S){return _[S.type](S)}function C(S){const A=S.map(v);if(A.sort(),A.length>0){let N=1;for(let M=1;M<A.length;M++)A[M-1]!==A[M]&&(A[N]=A[M],N++);A.length=N}switch(A.length){case 1:return A[0];case 2:return A[0]+" or "+A[1];default:return A.slice(0,-1).join(", ")+", or "+A[A.length-1]}}function w(S){return S?'"'+c(S)+'"':"end of input"}return"Expected "+C(s)+" but "+w(t)+" found."}}function e(r,s){s=s!==void 0?s:{};const t={},o=s.grammarSource,a={start:Es,Literal:fi};let d=Es;const c="(",b=")",_=":",v="{",C="}",w="or",S="and",A="not",N=".",M='"',ue="\\",z="*",Z="\\t",H="\\r",ht="\\n",be="<@",Ue="<=",X=">=",lr="<",dt=">",ft="©kuery-cursor©",It=/^[0-9]/,Ee=/^[\\"]/,Wa=/^[^"]/,Ga=/^[\\():<>"*{}]/,Ya=/^[ \t\r\n]/,ms=j("(",!1),$s=j(")",!1),_s=j(":",!1),Za=j("{",!1),Ja=j("}",!1),Ka=He("fieldName"),Xa=He("value"),el=He("OR"),ws=j("or",!0),tl=He("AND"),Ss=j("and",!0),rl=He("NOT"),xs=j("not",!0),il=He("literal"),sl=j(".",!1),cr=Bt([["0","9"]],!1,!1,!1),ur=j('"',!1),ai=j("\\",!1),nl=Bt(["\\",'"'],!1,!1,!1),ol=Bt(['"'],!0,!1,!1),al=sc(),ll=j("*",!1),cl=j("\\t",!1),ul=j("\\r",!1),pl=j("\\n",!1),hl=Bt(["\\","(",")",":","<",">",'"',"*","{","}"],!1,!1,!1),dl=j("<@",!1),fl=j("<=",!1),gl=j(">=",!1),bl=j("<",!1),vl=j(">",!1),yl=He("whitespace"),ml=Bt([" "," ","\r",`
785
- `],!1,!1,!1),$l=j("©kuery-cursor©",!1);function _l(n,l){return l.type==="cursor"?{...l,suggestionTypes:["conjunction"],rule:"start"}:n!==null?n:Fe.function.buildNode("is","*","*")}function wl(n,l){const p=[n,l].find(f=>f.type==="cursor");return p||ee("or",[n,l])}function Sl(n,l){const p=[n,l].find(f=>f.type==="cursor");return p||ee("and",[n,l])}function xl(n){return n.type==="cursor"?n:ee("not",[n])}function kl(n,l){return l.type==="cursor"?{...l,suggestionTypes:["conjunction"],rule:"SubQuery"}:(yt++,{...n,group:yt})}function El(n,l,p){return l.type==="cursor"?{...l,nestedPath:l.nestedPath?`${n.value}.${l.nestedPath}`:n.value}:p.type==="cursor"?{...p,suggestionTypes:["conjunction"]}:ee("nested",[n,l])}function Al(n,l,p){return p.type==="cursor"?{...p,fieldName:n.value,suggestionTypes:["geo_value","conjunction"],rule:"FieldGeoSpatialExpression"}:{type:"function",function:"geospatial",arguments:[n,l,p]}}function Cl(n,l,p){if(p.type==="cursor")return{...p,fieldName:n.value,suggestionTypes:["geo_value","conjunction"],rule:"FieldMultiGeoSpatialExpression"};Is(l,p(n));const f=p(n);return f.function=="is"?ee("geospatial",[n,l,f.arguments[1]]):{...f,arguments:f.arguments.map(y=>ee("geospatial",{type:"function",function:"geospatial",arguments:[n,l,y.arguments[1]]}))}}function Ol(n,l,p){if(p.type==="cursor")return{...p,fieldName:n.value,suggestionTypes:["value","conjunction"],rule:"FieldRangeExpression"};const f=Is(l,p);return ee("range",[n,f])}function Pl(n,l){return l.type==="cursor"?l.prefix.includes(bi)?{...l,fieldName:n.value,suggestionTypes:["conjunction"],rule:"FieldValueExpression"}:{...l,fieldName:n.value,suggestionTypes:["value","conjunction"],rule:"FieldValueExpression"}:l(n)}function Tl(n){if(n.type==="cursor"){const p=`${n.prefix}${n.suffix}`.trim();return{...n,fieldName:p,suggestionTypes:["field","operator","conjunction"],rule:"ValueExpression"}}const l=Ae(null);return n(l)}function Ll(n,l){return l.type==="cursor"?{...l,suggestionTypes:["conjunction"],rule:"ListOfValues"}:n}function Nl(n,l){const p=[n,l].find(f=>f.type==="cursor");return p?{...p,suggestionTypes:["value"],rule:"OrListOfValues"}:(yt++,f=>({...ee("or",[n(f),l(f)]),group:yt}))}function Dl(n,l){const p=[n,l].find(f=>f.type==="cursor");return p?{...p,suggestionTypes:["value"],rule:"AndListOfValues"}:(yt++,f=>({...ee("and",[n(f),l(f)]),group:yt}))}function Ml(n){return n.type==="cursor"?{...list,suggestionTypes:["value"],rule:"NotListOfValues"}:l=>ee("not",[n(l)])}function zl(n){if(n.type==="cursor")return n;const l=Ae(!0);return p=>ee("is",[p,n,l])}function Il(n){if(n.type==="cursor")return n;!kc&&n.type==="wildcard"&&Fe.wildcard.hasLeadingWildcard(n)&&rc("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const l=Ae(!1);return p=>ee("is",[p,n,l])}function Rl(){return parseFloat(jt())}function jl(){return parseInt(jt(),10)}function Bl(n,l,p){const{start:f,end:y}=li();return{type:"cursor",start:f.offset,end:y.offset-l.length,prefix:n.join(""),suffix:p.join(""),text:jt().replace(l,""),rule:"QuotedString"}}function Ul(n){return Ae(n.join(""))}function Uc(n){return n}function Hc(n){return n}function Hl(n,l,p){const{start:f,end:y}=li();return{type:"cursor",start:f.offset,end:y.offset-l.length,prefix:n.join(""),suffix:p.join(""),text:jt().replace(l,""),rule:"UnquotedLiteral"}}function Fl(n){const l=n.join("").trim();return l==="null"?Ae(null):l==="true"?Ae(!0):l==="false"?Ae(!1):n.includes(bi)?Ec(l):Ae(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(l)?isFinite(l)&&(l>Number.MAX_SAFE_INTEGER||l<Number.MIN_SAFE_INTEGER)?BigInt(l):Number(l):l)}function Fc(n){return n}function Ql(){return bi}function ql(n,l,p){const{start:f,end:y}=li();return{type:"cursor",start:f.offset,end:y.offset-l.length,prefix:n.join(""),suffix:p.join(""),text:jt().replace(l,""),rule:"OptionalSpace"}}function Vl(){return" "}function Wl(){return"\r"}function Gl(){return`
786
- `}function Qc(n){return n}function qc(n){return n}function Yl(){return"within"}function Zl(){return"lte"}function Jl(){return"gte"}function Kl(){return"lt"}function Xl(){return"gt"}function ec(){return Sc}function tc(){return xc}let u=s.peg$currPos|0,P=u;const gt=[{line:1,column:1}];let re=u,pr=s.peg$maxFailExpected||[],m=s.peg$silentFails|0,Rt;if(s.startRule){if(!(s.startRule in a))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');d=a[s.startRule]}function jt(){return r.substring(P,u)}function li(){return hr(P,u)}function rc(n,l){throw l=l!==void 0?l:hr(P,u),oc(n,l)}function ic(n=u){const l=r.codePointAt(n);return l===void 0?"":String.fromCodePoint(l)}function j(n,l){return{type:"literal",text:n,ignoreCase:l}}function Bt(n,l,p,f){return{type:"class",parts:n,inverted:l,ignoreCase:p,unicode:f}}function sc(){return{type:"any"}}function nc(){return{type:"end"}}function He(n){return{type:"other",description:n}}function ks(n){let l=gt[n],p;if(l)return l;if(n>=gt.length)p=gt.length-1;else for(p=n;!gt[--p];);for(l=gt[p],l={line:l.line,column:l.column};p<n;)r.charCodeAt(p)===10?(l.line++,l.column=1):l.column++,p++;return gt[n]=l,l}function hr(n,l,p){const f=ks(n),y=ks(l);return{source:o,start:{offset:n,line:f.line,column:f.column},end:{offset:l,line:y.line,column:y.column}}}function E(n){u<re||(u>re&&(re=u,pr=[]),pr.push(n))}function oc(n,l){return new i(n,null,null,l)}function ac(n,l,p){return new i(i.buildMessage(n,l),n,l,p)}function Es(){let n,l,p,f;for(n=u,l=[],p=O();p!==t;)l.push(p),p=O();return p=dr(),p===t&&(p=null),f=Ht(),f!==t?(P=n,n=_l(p,f)):(u=n,n=t),n}function dr(){let n,l,p,f;return n=u,l=ci(),l!==t?(p=pi(),p!==t?(f=dr(),f!==t?(P=n,n=wl(l,f)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t),n===t&&(n=ci()),n}function ci(){let n,l,p,f;return n=u,l=As(),l!==t?(p=hi(),p!==t?(f=ci(),f!==t?(P=n,n=Sl(l,f)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t),n===t&&(n=As()),n}function As(){let n,l,p;return n=u,l=di(),l!==t?(p=Cs(),p!==t?(P=n,n=xl(p)):(u=n,n=t)):(u=n,n=t),n===t&&(n=Cs()),n}function Cs(){let n,l,p,f,y,k;if(n=u,r.charCodeAt(u)===40?(l=c,u++):(l=t,m===0&&E(ms)),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();f=dr(),f!==t?(y=Ht(),y!==t?(r.charCodeAt(u)===41?(k=b,u++):(k=t,m===0&&E($s)),k!==t?(P=n,n=kl(f,y)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t)}else u=n,n=t;return n===t&&(n=lc()),n}function lc(){let n,l,p,f,y,k,js,Qe,yi,mi;if(n=u,l=Ut(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(r.charCodeAt(u)===58?(f=_,u++):(f=t,m===0&&E(_s)),f!==t){for(y=[],k=O();k!==t;)y.push(k),k=O();if(r.charCodeAt(u)===123?(k=v,u++):(k=t,m===0&&E(Za)),k!==t){for(js=[],Qe=O();Qe!==t;)js.push(Qe),Qe=O();Qe=dr(),Qe!==t?(yi=Ht(),yi!==t?(r.charCodeAt(u)===125?(mi=C,u++):(mi=t,m===0&&E(Ja)),mi!==t?(P=n,n=El(l,Qe,yi)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t)}else u=n,n=t}else u=n,n=t}else u=n,n=t;return n===t&&(n=cc()),n}function cc(){let n;return n=uc(),n===t&&(n=pc(),n===t&&(n=hc(),n===t&&(n=dc(),n===t&&(n=fc())))),n}function Ut(){let n;return m++,n=fi(),m--,n===t&&m===0&&E(Ka),n}function uc(){let n,l,p,f,y,k;if(n=u,l=Ut(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(f=zs(),f!==t){for(y=[],k=O();k!==t;)y.push(k),k=O();k=fi(),k!==t?(P=n,n=Al(l,f,k)):(u=n,n=t)}else u=n,n=t}else u=n,n=t;return n}function pc(){let n,l,p,f,y,k;if(n=u,l=Ut(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(f=zs(),f!==t){for(y=[],k=O();k!==t;)y.push(k),k=O();k=fr(),k!==t?(P=n,n=Cl(l,f,k)):(u=n,n=t)}else u=n,n=t}else u=n,n=t;return n}function hc(){let n,l,p,f,y,k;if(n=u,l=Ut(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(f=wc(),f!==t){for(y=[],k=O();k!==t;)y.push(k),k=O();k=vc(),k!==t?(P=n,n=Ol(l,f,k)):(u=n,n=t)}else u=n,n=t}else u=n,n=t;return n}function dc(){let n,l,p,f,y,k;if(n=u,l=Ut(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(r.charCodeAt(u)===58?(f=_,u++):(f=t,m===0&&E(_s)),f!==t){for(y=[],k=O();k!==t;)y.push(k),k=O();k=fr(),k!==t?(P=n,n=Pl(l,k)):(u=n,n=t)}else u=n,n=t}else u=n,n=t;return n}function fc(){let n,l;return n=u,l=Ts(),l!==t&&(P=n,l=Tl(l)),n=l,n}function fr(){let n,l,p,f,y,k;if(n=u,r.charCodeAt(u)===40?(l=c,u++):(l=t,m===0&&E(ms)),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();f=Os(),f!==t?(y=Ht(),y!==t?(r.charCodeAt(u)===41?(k=b,u++):(k=t,m===0&&E($s)),k!==t?(P=n,n=Ll(f,y)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t)}else u=n,n=t;return n===t&&(n=Ts()),n}function Os(){let n,l,p,f;return n=u,l=ui(),l!==t?(p=pi(),p!==t?(f=Os(),f!==t?(P=n,n=Nl(l,f)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t),n===t&&(n=ui()),n}function ui(){let n,l,p,f;return n=u,l=Ps(),l!==t?(p=hi(),p!==t?(f=ui(),f!==t?(P=n,n=Dl(l,f)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t),n===t&&(n=Ps()),n}function Ps(){let n,l,p;return n=u,l=di(),l!==t?(p=fr(),p!==t?(P=n,n=Ml(p)):(u=n,n=t)):(u=n,n=t),n===t&&(n=fr()),n}function Ts(){let n,l;return m++,n=u,l=gi(),l!==t&&(P=n,l=zl(l)),n=l,n===t&&(n=u,l=Ns(),l!==t&&(P=n,l=Il(l)),n=l),m--,n===t&&(l=t,m===0&&E(Xa)),n}function pi(){let n,l,p,f,y;if(m++,n=u,l=[],p=O(),p!==t)for(;p!==t;)l.push(p),p=O();else l=t;if(l!==t)if(p=r.substr(u,2),p.toLowerCase()===w?u+=2:(p=t,m===0&&E(ws)),p!==t){if(f=[],y=O(),y!==t)for(;y!==t;)f.push(y),y=O();else f=t;f!==t?(l=[l,p,f],n=l):(u=n,n=t)}else u=n,n=t;else u=n,n=t;return m--,n===t&&(l=t,m===0&&E(el)),n}function hi(){let n,l,p,f,y;if(m++,n=u,l=[],p=O(),p!==t)for(;p!==t;)l.push(p),p=O();else l=t;if(l!==t)if(p=r.substr(u,3),p.toLowerCase()===S?u+=3:(p=t,m===0&&E(Ss)),p!==t){if(f=[],y=O(),y!==t)for(;y!==t;)f.push(y),y=O();else f=t;f!==t?(l=[l,p,f],n=l):(u=n,n=t)}else u=n,n=t;else u=n,n=t;return m--,n===t&&(l=t,m===0&&E(tl)),n}function di(){let n,l,p,f;if(m++,n=u,l=r.substr(u,3),l.toLowerCase()===A?u+=3:(l=t,m===0&&E(xs)),l!==t){if(p=[],f=O(),f!==t)for(;f!==t;)p.push(f),f=O();else p=t;p!==t?(l=[l,p],n=l):(u=n,n=t)}else u=n,n=t;return m--,n===t&&(l=t,m===0&&E(rl)),n}function fi(){let n;return m++,n=gi(),n===t&&(n=Ns()),m--,n===t&&m===0&&E(il),n}function gc(){let n;return n=bc(),n===t&&(n=Ls()),n}function bc(){let n,l,p,f,y;if(n=u,l=Ls(),l!==t)if(r.charCodeAt(u)===46?(p=N,u++):(p=t,m===0&&E(sl)),p!==t){if(f=[],y=r.charAt(u),It.test(y)?u++:(y=t,m===0&&E(cr)),y!==t)for(;y!==t;)f.push(y),y=r.charAt(u),It.test(y)?u++:(y=t,m===0&&E(cr));else f=t;f!==t?(P=n,n=Rl()):(u=n,n=t)}else u=n,n=t;else u=n,n=t;return n}function Ls(){let n,l,p;if(n=u,l=[],p=r.charAt(u),It.test(p)?u++:(p=t,m===0&&E(cr)),p!==t)for(;p!==t;)l.push(p),p=r.charAt(u),It.test(p)?u++:(p=t,m===0&&E(cr));else l=t;return l!==t&&(P=n,l=jl()),n=l,n}function gi(){let n,l,p,f,y,k;if(n=u,r.charCodeAt(u)===34?(l=M,u++):(l=t,m===0&&E(ur)),l!==t){for(p=[],f=bt();f!==t;)p.push(f),f=bt();if(f=Ft(),f!==t){for(y=[],k=bt();k!==t;)y.push(k),k=bt();r.charCodeAt(u)===34?(k=M,u++):(k=t,m===0&&E(ur)),k!==t?(P=n,n=Bl(p,f,y)):(u=n,n=t)}else u=n,n=t}else u=n,n=t;if(n===t)if(n=u,r.charCodeAt(u)===34?(l=M,u++):(l=t,m===0&&E(ur)),l!==t){for(p=[],f=bt();f!==t;)p.push(f),f=bt();r.charCodeAt(u)===34?(f=M,u++):(f=t,m===0&&E(ur)),f!==t?(P=n,n=Ul(p)):(u=n,n=t)}else u=n,n=t;return n}function vc(){let n;return n=gc(),n===t&&(n=gi(),n===t&&(n=Ht())),n}function bt(){let n,l,p;return n=Ds(),n===t&&(n=u,r.charCodeAt(u)===92?(l=ue,u++):(l=t,m===0&&E(ai)),l!==t?(p=r.charAt(u),Ee.test(p)?u++:(p=t,m===0&&E(nl)),p!==t?(P=n,n=p):(u=n,n=t)):(u=n,n=t),n===t&&(n=u,l=u,m++,p=Ft(),m--,p===t?l=void 0:(u=l,l=t),l!==t?(p=r.charAt(u),Wa.test(p)?u++:(p=t,m===0&&E(ol)),p!==t?(P=n,n=p):(u=n,n=t)):(u=n,n=t))),n}function Ns(){let n,l,p,f,y;for(n=u,l=[],p=vt();p!==t;)l.push(p),p=vt();if(p=Ft(),p!==t){for(f=[],y=vt();y!==t;)f.push(y),y=vt();P=n,n=Hl(l,p,f)}else u=n,n=t;if(n===t){if(n=u,l=[],p=vt(),p!==t)for(;p!==t;)l.push(p),p=vt();else l=t;l!==t&&(P=n,l=Fl(l)),n=l}return n}function vt(){let n,l,p,f,y;return n=Ds(),n===t&&(n=mc(),n===t&&(n=$c(),n===t&&(n=yc(),n===t&&(n=u,l=u,m++,p=Ms(),m--,p===t?l=void 0:(u=l,l=t),l!==t?(p=u,m++,f=_c(),m--,f===t?p=void 0:(u=p,p=t),p!==t?(f=u,m++,y=Ft(),m--,y===t?f=void 0:(u=f,f=t),f!==t?(r.length>u?(y=r.charAt(u),u++):(y=t,m===0&&E(al)),y!==t?(P=n,n=y):(u=n,n=t)):(u=n,n=t)):(u=n,n=t)):(u=n,n=t))))),n}function yc(){let n,l;return n=u,r.charCodeAt(u)===42?(l=z,u++):(l=t,m===0&&E(ll)),l!==t&&(P=n,l=Ql()),n=l,n}function Ht(){let n,l,p,f,y;for(n=u,l=[],p=O();p!==t;)l.push(p),p=O();if(p=Ft(),p!==t){for(f=[],y=O();y!==t;)f.push(y),y=O();P=n,n=ql(l,p,f)}else u=n,n=t;if(n===t)for(n=[],l=O();l!==t;)n.push(l),l=O();return n}function Ds(){let n,l;return n=u,r.substr(u,2)===Z?(l=Z,u+=2):(l=t,m===0&&E(cl)),l!==t&&(P=n,l=Vl()),n=l,n===t&&(n=u,r.substr(u,2)===H?(l=H,u+=2):(l=t,m===0&&E(ul)),l!==t&&(P=n,l=Wl()),n=l,n===t&&(n=u,r.substr(u,2)===ht?(l=ht,u+=2):(l=t,m===0&&E(pl)),l!==t&&(P=n,l=Gl()),n=l)),n}function mc(){let n,l,p;return n=u,r.charCodeAt(u)===92?(l=ue,u++):(l=t,m===0&&E(ai)),l!==t?(p=Ms(),p!==t?(P=n,n=p):(u=n,n=t)):(u=n,n=t),n}function $c(){let n,l,p;return n=u,r.charCodeAt(u)===92?(l=ue,u++):(l=t,m===0&&E(ai)),l!==t?(p=r.substr(u,2),p.toLowerCase()===w?u+=2:(p=t,m===0&&E(ws)),p===t&&(p=r.substr(u,3),p.toLowerCase()===S?u+=3:(p=t,m===0&&E(Ss)),p===t&&(p=r.substr(u,3),p.toLowerCase()===A?u+=3:(p=t,m===0&&E(xs)))),p!==t?(P=n,n=p):(u=n,n=t)):(u=n,n=t),n}function _c(){let n;return n=pi(),n===t&&(n=hi(),n===t&&(n=di())),n}function Ms(){let n;return n=r.charAt(u),Ga.test(n)?u++:(n=t,m===0&&E(hl)),n}function zs(){let n,l;return n=u,r.substr(u,2)===be?(l=be,u+=2):(l=t,m===0&&E(dl)),l!==t&&(P=n,l=Yl()),n=l,n}function wc(){let n,l;return n=u,r.substr(u,2)===Ue?(l=Ue,u+=2):(l=t,m===0&&E(fl)),l!==t&&(P=n,l=Zl()),n=l,n===t&&(n=u,r.substr(u,2)===X?(l=X,u+=2):(l=t,m===0&&E(gl)),l!==t&&(P=n,l=Jl()),n=l,n===t&&(n=u,r.charCodeAt(u)===60?(l=lr,u++):(l=t,m===0&&E(bl)),l!==t&&(P=n,l=Kl()),n=l,n===t&&(n=u,r.charCodeAt(u)===62?(l=dt,u++):(l=t,m===0&&E(vl)),l!==t&&(P=n,l=Xl()),n=l))),n}function O(){let n;return m++,n=r.charAt(u),Ya.test(n)?u++:(n=t,m===0&&E(ml)),m--,n===t&&m===0&&E(yl),n}function Ft(){let n,l,p;return n=u,P=u,l=ec(),l?l=void 0:l=t,l!==t?(r.substr(u,14)===ft?(p=ft,u+=14):(p=t,m===0&&E($l)),p!==t?(P=n,n=tc()):(u=n,n=t)):(u=n,n=t),n}const{errorOnLuceneSyntax:Vc,parseCursor:Sc,cursorSymbol:xc,allowLeadingWildcards:kc=!0,helpers:{nodeTypes:Fe}}=s,ee=Fe.function.buildNodeWithArgumentNodes,Ae=Fe.literal.buildNode,Ec=Fe.wildcard.buildNode,Is=Fe.namedArg.buildNode,{wildcardSymbol:bi}=Fe.wildcard;var yt=0;Rt=d();const vi=Rt!==t&&u===r.length;function Rs(){throw Rt!==t&&u<r.length&&E(nc()),ac(pr,re<r.length?ic(re):null,re<r.length?hr(re,re+1):hr(re,re))}if(s.peg$library)return{peg$result:Rt,peg$currPos:u,peg$FAILED:t,peg$maxFailExpected:pr,peg$maxFailPos:re,peg$success:vi,peg$throw:vi?void 0:Rs};if(vi)return Rt;Rs()}return{StartRules:["start","Literal"],SyntaxError:i,parse:e}}(),jr=(i,e={},r=Xt)=>{if(typeof i>"u")throw new Error("expression must be a string, got undefined instead");return r(i,{...e,helpers:{nodeTypes:le}})},Xe=(i,e={})=>jr(i,{...e,startRule:"Literal"},Xt),er=(i,e={})=>{try{return jr(i,e,Xt)}catch(r){throw r.name==="SyntaxError"?new Yi(r,i):r}},Ln=i=>{try{return jr(i,{errorOnLuceneSyntax:!0},Xt),!1}catch(e){return e.message.startsWith("Lucene")}},Q=(i,e,r,s)=>(e=void 0,!i||!i.type||!le[i.type]?Q(le.function.buildNode("and",[]),e):le[i.type].toOpenSearchQuery(i,e,r,s)),oe="@kuery-wildcard@";function Nn(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dn(i){return i.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Mn(i){return i.includes(oe)?{type:"wildcard",value:i}:Xe(i)}function Zi(i,e){const{value:r}=i,s=r.split(oe).map(Nn).join("[\\s\\S]*");return new RegExp(`^${s}$`).test(e)}function zn(i){const{value:e}=i;return e.split(oe).join("*")}function Br(i){const{value:e}=i;return e.split(oe).map(Dn).join("*")}function In(i){const{value:e}=i;return e.startsWith(oe)&&e.replace(oe,"").length>0}const Rn=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Mn,hasLeadingWildcard:In,test:Zi,toOpenSearchQuery:zn,toQueryStringQuery:Br,wildcardSymbol:oe},Symbol.toStringTag,{value:"Module"}));function Ur(i,e){if(!e)return[];if(i.type==="literal"){const r=Rr(i),s=e.fields.find(t=>t.name===r);return s?[s]:[]}else if(i.type==="wildcard")return e.fields.filter(s=>Zi(i,s.name))}function Ac(i){return i}function Ji(i,e,r){const s={...i,value:r?`${r}.${i.value}`:i.value};if(!e||s.type==="wildcard"&&!r)return s;const o=Ur(s,e).reduce((a,d)=>{const c=d.subType&&d.subType.nested?d.subType.nested.path:void 0;return r&&!c?[...a,`${d.name} is not a nested field but is in nested group "${r}" in the DQL expression.`]:c&&!r?[...a,`${d.name} is a nested field, but is not in a nested group in the DQL expression.`]:c!==r?[...a,`Nested field ${d.name} is being queried with the incorrect nested path. The correct path is ${d.subType.nested.path}.`]:a},[]);if(o.length>0)throw new Error(o.join(`
787
- `));return s}function jn(i,e,r=!1){if(i===void 0)throw new Error("fieldName is a required argument");if(e===void 0)throw new Error("value is a required argument");const s=typeof i=="string"?Xe(i):Ke(i),t=typeof e=="string"?Xe(e):Ke(e),o=Ke(r);return{arguments:[s,t,o]}}function Bn(i,e,r={},s={}){const{arguments:[t,o,a]}=i,d=Ji(t,e,s!=null&&s.nested?s.nested.path:void 0),c=Q(d),b=o!==void 0?Q(o):o,_=a.value?"phrase":"best_fields";if(d.value===null)return o.type==="wildcard"?{query_string:{query:Br(o)}}:{multi_match:{type:_,query:b,lenient:!0}};const v=e?Ur(d,e):[];v&&v.length===0&&v.push({name:Q(d),scripted:!1,type:""});const C=o.type==="wildcard"&&b==="*",w=d.type==="wildcard"&&c==="*"||v&&e&&v.length===e.fields.length;return C&&w?{match_all:{}}:{bool:{should:v.reduce((N,M)=>{const ue=z=>{var Z;return d.type!=="wildcard"||!((Z=M.subType)!=null&&Z.nested)||s!=null&&s.nested?z:{nested:{path:M.subType.nested.path,query:z,score_mode:"none"}}};if(M.scripted)return[];if(C)return[...N,ue({exists:{field:M.name}})];if(o.type==="wildcard")return[...N,ue({query_string:{fields:[M.name],query:Br(o)}})];if(M.type==="date"){const z=r.dateFormatTZ?{time_zone:r.dateFormatTZ}:{};return[...N,ue({range:{[M.name]:{gte:b,lte:b,...z}}})]}else{const z=_==="phrase"?"match_phrase":"match";return[...N,ue({[z]:{[M.name]:b}})]}},[])||[],minimum_should_match:1}}}const Un=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:jn,toOpenSearchQuery:Bn},Symbol.toStringTag,{value:"Module"}));function Hn(i){return{arguments:i}}function Fn(i,e,r={},s={}){return{bool:{filter:(i.arguments||[]).map(o=>Q(o,e,r,s))}}}const Qn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Hn,toOpenSearchQuery:Fn},Symbol.toStringTag,{value:"Module"}));function qn(i){return{arguments:i}}function Vn(i,e,r={},s={}){return{bool:{should:(i.arguments||[]).map(o=>Q(o,e,r,s)),minimum_should_match:1}}}const Wn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:qn,toOpenSearchQuery:Vn},Symbol.toStringTag,{value:"Module"}));function Gn(i){return{arguments:[i]}}function Yn(i,e,r={},s={}){const[t]=i.arguments;return{bool:{must_not:Q(t,e,r,s)}}}const Zn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Gn,toOpenSearchQuery:Yn},Symbol.toStringTag,{value:"Module"}));function Jn(i,...e){let r={};for(let s of e)r[s]=i[s];return r}function Kn(i,e){const r=Jn(e,"gt","lt","gte","lte","format"),s=typeof i=="string"?Xe(i):le.literal.buildNode(i),t=Object.entries(r).map(o=>{let[a,d]=o;return le.namedArg.buildNode(a,d)});return{arguments:[s,...t]}}function Xn(i,e,r={},s={}){const[t,...o]=i.arguments,a=Ji(t,e,s!=null&&s.nested?s.nested.path:void 0),d=e?Ur(a,e):[],c=eo(o),b=Object.fromEntries(Object.entries(c).map(([v,C])=>[v,Q(C)]));return d&&d.length===0&&d.push({name:Q(a),scripted:!1,type:""}),{bool:{should:d.map(v=>{const C=w=>{var S;return a.type!=="wildcard"||!((S=v.subType)!=null&&S.nested)||s.nested?w:{nested:{path:v.subType.nested.path,query:w,score_mode:"none"}}};if(v.scripted)return{};if(v.type==="date"){const w=r.dateFormatTZ?{time_zone:r.dateFormatTZ}:{};return C({range:{[v.name]:{...b,...w}}})}return C({range:{[v.name]:b}})}),minimum_should_match:1}}}function eo(i){if(i.gt&&i.gte||i.lt&&i.lte)throw new Error("range ends cannot be both inclusive and exclusive");const e=["gte","lte","format"];return i.reduce((r,s,t)=>(s.type==="namedArg"?r[s.name]=s.value:r[e[t]]=s,r),{})}const to=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Kn,toOpenSearchQuery:Xn},Symbol.toStringTag,{value:"Module"}));function ro(i){return{arguments:[Ke(i)]}}function io(i,e,r={},s={}){const{arguments:[t]}=i,o={...t,value:s!=null&&s.nested?`${s.nested.path}.${t.value}`:t.value},a=Rr(o),d=((e==null?void 0:e.fields)||[]).find(c=>c.name===a);if(d&&d.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:a}}}const so=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ro,toOpenSearchQuery:io},Symbol.toStringTag,{value:"Module"}));function no(i,e){return{arguments:[typeof i=="string"?Xe(i):Ke(i),e]}}function oo(i,e,r={},s={}){var c;const[t,o]=i.arguments,a=Q(t),d=(c=s==null?void 0:s.nested)!=null&&c.path?`${s.nested.path}.${a}`:a;return{nested:{path:d,query:Q(o,e,r,{...s,nested:{path:d}}),score_mode:"none"}}}const ao=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:no,toOpenSearchQuery:oo},Symbol.toStringTag,{value:"Module"}));/* @preserve
785
+ at `+b}return t}static buildMessage(s,t){function o(S){return S.codePointAt(0).toString(16).toUpperCase()}const a=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function d(S){return a?S.replace(a,C=>"\\u{"+o(C)+"}"):S}function u(S){return d(S.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,C=>"\\x0"+o(C)).replace(/[\x10-\x1F\x7F-\x9F]/g,C=>"\\x"+o(C)))}function b(S){return d(S.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,C=>"\\x0"+o(C)).replace(/[\x10-\x1F\x7F-\x9F]/g,C=>"\\x"+o(C)))}const y={literal(S){return'"'+u(S.text)+'"'},class(S){const C=S.parts.map(M=>Array.isArray(M)?b(M[0])+"-"+b(M[1]):b(M));return"["+(S.inverted?"^":"")+C.join("")+"]"+(S.unicode?"u":"")},any(){return"any character"},end(){return"end of input"},other(S){return S.description}};function v(S){return y[S.type](S)}function A(S){const C=S.map(v);if(C.sort(),C.length>0){let M=1;for(let D=1;D<C.length;D++)C[D-1]!==C[D]&&(C[M]=C[D],M++);C.length=M}switch(C.length){case 1:return C[0];case 2:return C[0]+" or "+C[1];default:return C.slice(0,-1).join(", ")+", or "+C[C.length-1]}}function w(S){return S?'"'+u(S)+'"':"end of input"}return"Expected "+A(s)+" but "+w(t)+" found."}}function e(r,s){s=s!==void 0?s:{};const t={},o=s.grammarSource,a={start:Es,Literal:fi};let d=Es;const u="(",b=")",y=":",v="{",A="}",w="or",S="and",C="not",M=".",D='"',ue="\\",z="*",Z="\\t",H="\\r",dt="\\n",be="<@",He="<=",ee=">=",cr="<",ft=">",gt="©kuery-cursor©",Rt=/^[0-9]/,Ae=/^[\\"]/,Wa=/^[^"]/,Ga=/^[\\():<>"*{}]/,Ya=/^[ \t\r\n]/,ms=j("(",!1),$s=j(")",!1),_s=j(":",!1),Za=j("{",!1),Ja=j("}",!1),Ka=Fe("fieldName"),Xa=Fe("value"),el=Fe("OR"),ws=j("or",!0),tl=Fe("AND"),Ss=j("and",!0),rl=Fe("NOT"),xs=j("not",!0),il=Fe("literal"),sl=j(".",!1),ur=Ut([["0","9"]],!1,!1,!1),pr=j('"',!1),ai=j("\\",!1),nl=Ut(["\\",'"'],!1,!1,!1),ol=Ut(['"'],!0,!1,!1),al=sc(),ll=j("*",!1),cl=j("\\t",!1),ul=j("\\r",!1),pl=j("\\n",!1),hl=Ut(["\\","(",")",":","<",">",'"',"*","{","}"],!1,!1,!1),dl=j("<@",!1),fl=j("<=",!1),gl=j(">=",!1),bl=j("<",!1),vl=j(">",!1),yl=Fe("whitespace"),ml=Ut([" "," ","\r",`
786
+ `],!1,!1,!1),$l=j("©kuery-cursor©",!1);function _l(n,l){return l.type==="cursor"?{...l,suggestionTypes:["conjunction"],rule:"start"}:n!==null?n:Qe.function.buildNode("is","*","*")}function wl(n,l){const p=[n,l].find(f=>f.type==="cursor");return p||te("or",[n,l])}function Sl(n,l){const p=[n,l].find(f=>f.type==="cursor");return p||te("and",[n,l])}function xl(n){return n.type==="cursor"?n:te("not",[n])}function kl(n,l){return l.type==="cursor"?{...l,suggestionTypes:["conjunction"],rule:"SubQuery"}:(mt++,{...n,group:mt})}function El(n,l,p){return l.type==="cursor"?{...l,nestedPath:l.nestedPath?`${n.value}.${l.nestedPath}`:n.value}:p.type==="cursor"?{...p,suggestionTypes:["conjunction"]}:te("nested",[n,l])}function Al(n,l,p){return p.type==="cursor"?{...p,fieldName:n.value,suggestionTypes:["geo_value","conjunction"],rule:"FieldGeoSpatialExpression"}:{type:"function",function:"geospatial",arguments:[n,l,p]}}function Cl(n,l,p){if(p.type==="cursor")return{...p,fieldName:n.value,suggestionTypes:["geo_value","conjunction"],rule:"FieldMultiGeoSpatialExpression"};Is(l,p(n));const f=p(n);return f.function=="is"?te("geospatial",[n,l,f.arguments[1]]):{...f,arguments:f.arguments.map(m=>te("geospatial",{type:"function",function:"geospatial",arguments:[n,l,m.arguments[1]]}))}}function Ol(n,l,p){if(p.type==="cursor")return{...p,fieldName:n.value,suggestionTypes:["value","conjunction"],rule:"FieldRangeExpression"};const f=Is(l,p);return te("range",[n,f])}function Pl(n,l){return l.type==="cursor"?l.prefix.includes(bi)?{...l,fieldName:n.value,suggestionTypes:["conjunction"],rule:"FieldValueExpression"}:{...l,fieldName:n.value,suggestionTypes:["value","conjunction"],rule:"FieldValueExpression"}:l(n)}function Tl(n){if(n.type==="cursor"){const p=`${n.prefix}${n.suffix}`.trim();return{...n,fieldName:p,suggestionTypes:["field","operator","conjunction"],rule:"ValueExpression"}}const l=Ce(null);return n(l)}function Ll(n,l){return l.type==="cursor"?{...l,suggestionTypes:["conjunction"],rule:"ListOfValues"}:n}function Nl(n,l){const p=[n,l].find(f=>f.type==="cursor");return p?{...p,suggestionTypes:["value"],rule:"OrListOfValues"}:(mt++,f=>({...te("or",[n(f),l(f)]),group:mt}))}function Dl(n,l){const p=[n,l].find(f=>f.type==="cursor");return p?{...p,suggestionTypes:["value"],rule:"AndListOfValues"}:(mt++,f=>({...te("and",[n(f),l(f)]),group:mt}))}function Ml(n){return n.type==="cursor"?{...list,suggestionTypes:["value"],rule:"NotListOfValues"}:l=>te("not",[n(l)])}function zl(n){if(n.type==="cursor")return n;const l=Ce(!0);return p=>te("is",[p,n,l])}function Il(n){if(n.type==="cursor")return n;!kc&&n.type==="wildcard"&&Qe.wildcard.hasLeadingWildcard(n)&&rc("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const l=Ce(!1);return p=>te("is",[p,n,l])}function Rl(){return parseFloat(Bt())}function jl(){return parseInt(Bt(),10)}function Bl(n,l,p){const{start:f,end:m}=li();return{type:"cursor",start:f.offset,end:m.offset-l.length,prefix:n.join(""),suffix:p.join(""),text:Bt().replace(l,""),rule:"QuotedString"}}function Ul(n){return Ce(n.join(""))}function Uc(n){return n}function Hc(n){return n}function Hl(n,l,p){const{start:f,end:m}=li();return{type:"cursor",start:f.offset,end:m.offset-l.length,prefix:n.join(""),suffix:p.join(""),text:Bt().replace(l,""),rule:"UnquotedLiteral"}}function Fl(n){const l=n.join("").trim();return l==="null"?Ce(null):l==="true"?Ce(!0):l==="false"?Ce(!1):n.includes(bi)?Ec(l):Ce(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(l)?isFinite(l)&&(l>Number.MAX_SAFE_INTEGER||l<Number.MIN_SAFE_INTEGER)?BigInt(l):Number(l):l)}function Fc(n){return n}function Ql(){return bi}function ql(n,l,p){const{start:f,end:m}=li();return{type:"cursor",start:f.offset,end:m.offset-l.length,prefix:n.join(""),suffix:p.join(""),text:Bt().replace(l,""),rule:"OptionalSpace"}}function Vl(){return" "}function Wl(){return"\r"}function Gl(){return`
787
+ `}function Qc(n){return n}function qc(n){return n}function Yl(){return"within"}function Zl(){return"lte"}function Jl(){return"gte"}function Kl(){return"lt"}function Xl(){return"gt"}function ec(){return Sc}function tc(){return xc}let c=s.peg$currPos|0,P=c;const bt=[{line:1,column:1}];let ie=c,hr=s.peg$maxFailExpected||[],$=s.peg$silentFails|0,jt;if(s.startRule){if(!(s.startRule in a))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');d=a[s.startRule]}function Bt(){return r.substring(P,c)}function li(){return dr(P,c)}function rc(n,l){throw l=l!==void 0?l:dr(P,c),oc(n,l)}function ic(n=c){const l=r.codePointAt(n);return l===void 0?"":String.fromCodePoint(l)}function j(n,l){return{type:"literal",text:n,ignoreCase:l}}function Ut(n,l,p,f){return{type:"class",parts:n,inverted:l,ignoreCase:p,unicode:f}}function sc(){return{type:"any"}}function nc(){return{type:"end"}}function Fe(n){return{type:"other",description:n}}function ks(n){let l=bt[n],p;if(l)return l;if(n>=bt.length)p=bt.length-1;else for(p=n;!bt[--p];);for(l=bt[p],l={line:l.line,column:l.column};p<n;)r.charCodeAt(p)===10?(l.line++,l.column=1):l.column++,p++;return bt[n]=l,l}function dr(n,l,p){const f=ks(n),m=ks(l);return{source:o,start:{offset:n,line:f.line,column:f.column},end:{offset:l,line:m.line,column:m.column}}}function E(n){c<ie||(c>ie&&(ie=c,hr=[]),hr.push(n))}function oc(n,l){return new i(n,null,null,l)}function ac(n,l,p){return new i(i.buildMessage(n,l),n,l,p)}function Es(){let n,l,p,f;for(n=c,l=[],p=O();p!==t;)l.push(p),p=O();return p=fr(),p===t&&(p=null),f=Ft(),f!==t?(P=n,n=_l(p,f)):(c=n,n=t),n}function fr(){let n,l,p,f;return n=c,l=ci(),l!==t?(p=pi(),p!==t?(f=fr(),f!==t?(P=n,n=wl(l,f)):(c=n,n=t)):(c=n,n=t)):(c=n,n=t),n===t&&(n=ci()),n}function ci(){let n,l,p,f;return n=c,l=As(),l!==t?(p=hi(),p!==t?(f=ci(),f!==t?(P=n,n=Sl(l,f)):(c=n,n=t)):(c=n,n=t)):(c=n,n=t),n===t&&(n=As()),n}function As(){let n,l,p;return n=c,l=di(),l!==t?(p=Cs(),p!==t?(P=n,n=xl(p)):(c=n,n=t)):(c=n,n=t),n===t&&(n=Cs()),n}function Cs(){let n,l,p,f,m,k;if(n=c,r.charCodeAt(c)===40?(l=u,c++):(l=t,$===0&&E(ms)),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();f=fr(),f!==t?(m=Ft(),m!==t?(r.charCodeAt(c)===41?(k=b,c++):(k=t,$===0&&E($s)),k!==t?(P=n,n=kl(f,m)):(c=n,n=t)):(c=n,n=t)):(c=n,n=t)}else c=n,n=t;return n===t&&(n=lc()),n}function lc(){let n,l,p,f,m,k,js,qe,yi,mi;if(n=c,l=Ht(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(r.charCodeAt(c)===58?(f=y,c++):(f=t,$===0&&E(_s)),f!==t){for(m=[],k=O();k!==t;)m.push(k),k=O();if(r.charCodeAt(c)===123?(k=v,c++):(k=t,$===0&&E(Za)),k!==t){for(js=[],qe=O();qe!==t;)js.push(qe),qe=O();qe=fr(),qe!==t?(yi=Ft(),yi!==t?(r.charCodeAt(c)===125?(mi=A,c++):(mi=t,$===0&&E(Ja)),mi!==t?(P=n,n=El(l,qe,yi)):(c=n,n=t)):(c=n,n=t)):(c=n,n=t)}else c=n,n=t}else c=n,n=t}else c=n,n=t;return n===t&&(n=cc()),n}function cc(){let n;return n=uc(),n===t&&(n=pc(),n===t&&(n=hc(),n===t&&(n=dc(),n===t&&(n=fc())))),n}function Ht(){let n;return $++,n=fi(),$--,n===t&&$===0&&E(Ka),n}function uc(){let n,l,p,f,m,k;if(n=c,l=Ht(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(f=zs(),f!==t){for(m=[],k=O();k!==t;)m.push(k),k=O();k=fi(),k!==t?(P=n,n=Al(l,f,k)):(c=n,n=t)}else c=n,n=t}else c=n,n=t;return n}function pc(){let n,l,p,f,m,k;if(n=c,l=Ht(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(f=zs(),f!==t){for(m=[],k=O();k!==t;)m.push(k),k=O();k=gr(),k!==t?(P=n,n=Cl(l,f,k)):(c=n,n=t)}else c=n,n=t}else c=n,n=t;return n}function hc(){let n,l,p,f,m,k;if(n=c,l=Ht(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(f=wc(),f!==t){for(m=[],k=O();k!==t;)m.push(k),k=O();k=vc(),k!==t?(P=n,n=Ol(l,f,k)):(c=n,n=t)}else c=n,n=t}else c=n,n=t;return n}function dc(){let n,l,p,f,m,k;if(n=c,l=Ht(),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();if(r.charCodeAt(c)===58?(f=y,c++):(f=t,$===0&&E(_s)),f!==t){for(m=[],k=O();k!==t;)m.push(k),k=O();k=gr(),k!==t?(P=n,n=Pl(l,k)):(c=n,n=t)}else c=n,n=t}else c=n,n=t;return n}function fc(){let n,l;return n=c,l=Ts(),l!==t&&(P=n,l=Tl(l)),n=l,n}function gr(){let n,l,p,f,m,k;if(n=c,r.charCodeAt(c)===40?(l=u,c++):(l=t,$===0&&E(ms)),l!==t){for(p=[],f=O();f!==t;)p.push(f),f=O();f=Os(),f!==t?(m=Ft(),m!==t?(r.charCodeAt(c)===41?(k=b,c++):(k=t,$===0&&E($s)),k!==t?(P=n,n=Ll(f,m)):(c=n,n=t)):(c=n,n=t)):(c=n,n=t)}else c=n,n=t;return n===t&&(n=Ts()),n}function Os(){let n,l,p,f;return n=c,l=ui(),l!==t?(p=pi(),p!==t?(f=Os(),f!==t?(P=n,n=Nl(l,f)):(c=n,n=t)):(c=n,n=t)):(c=n,n=t),n===t&&(n=ui()),n}function ui(){let n,l,p,f;return n=c,l=Ps(),l!==t?(p=hi(),p!==t?(f=ui(),f!==t?(P=n,n=Dl(l,f)):(c=n,n=t)):(c=n,n=t)):(c=n,n=t),n===t&&(n=Ps()),n}function Ps(){let n,l,p;return n=c,l=di(),l!==t?(p=gr(),p!==t?(P=n,n=Ml(p)):(c=n,n=t)):(c=n,n=t),n===t&&(n=gr()),n}function Ts(){let n,l;return $++,n=c,l=gi(),l!==t&&(P=n,l=zl(l)),n=l,n===t&&(n=c,l=Ns(),l!==t&&(P=n,l=Il(l)),n=l),$--,n===t&&(l=t,$===0&&E(Xa)),n}function pi(){let n,l,p,f,m;if($++,n=c,l=[],p=O(),p!==t)for(;p!==t;)l.push(p),p=O();else l=t;if(l!==t)if(p=r.substr(c,2),p.toLowerCase()===w?c+=2:(p=t,$===0&&E(ws)),p!==t){if(f=[],m=O(),m!==t)for(;m!==t;)f.push(m),m=O();else f=t;f!==t?(l=[l,p,f],n=l):(c=n,n=t)}else c=n,n=t;else c=n,n=t;return $--,n===t&&(l=t,$===0&&E(el)),n}function hi(){let n,l,p,f,m;if($++,n=c,l=[],p=O(),p!==t)for(;p!==t;)l.push(p),p=O();else l=t;if(l!==t)if(p=r.substr(c,3),p.toLowerCase()===S?c+=3:(p=t,$===0&&E(Ss)),p!==t){if(f=[],m=O(),m!==t)for(;m!==t;)f.push(m),m=O();else f=t;f!==t?(l=[l,p,f],n=l):(c=n,n=t)}else c=n,n=t;else c=n,n=t;return $--,n===t&&(l=t,$===0&&E(tl)),n}function di(){let n,l,p,f;if($++,n=c,l=r.substr(c,3),l.toLowerCase()===C?c+=3:(l=t,$===0&&E(xs)),l!==t){if(p=[],f=O(),f!==t)for(;f!==t;)p.push(f),f=O();else p=t;p!==t?(l=[l,p],n=l):(c=n,n=t)}else c=n,n=t;return $--,n===t&&(l=t,$===0&&E(rl)),n}function fi(){let n;return $++,n=gi(),n===t&&(n=Ns()),$--,n===t&&$===0&&E(il),n}function gc(){let n;return n=bc(),n===t&&(n=Ls()),n}function bc(){let n,l,p,f,m;if(n=c,l=Ls(),l!==t)if(r.charCodeAt(c)===46?(p=M,c++):(p=t,$===0&&E(sl)),p!==t){if(f=[],m=r.charAt(c),Rt.test(m)?c++:(m=t,$===0&&E(ur)),m!==t)for(;m!==t;)f.push(m),m=r.charAt(c),Rt.test(m)?c++:(m=t,$===0&&E(ur));else f=t;f!==t?(P=n,n=Rl()):(c=n,n=t)}else c=n,n=t;else c=n,n=t;return n}function Ls(){let n,l,p;if(n=c,l=[],p=r.charAt(c),Rt.test(p)?c++:(p=t,$===0&&E(ur)),p!==t)for(;p!==t;)l.push(p),p=r.charAt(c),Rt.test(p)?c++:(p=t,$===0&&E(ur));else l=t;return l!==t&&(P=n,l=jl()),n=l,n}function gi(){let n,l,p,f,m,k;if(n=c,r.charCodeAt(c)===34?(l=D,c++):(l=t,$===0&&E(pr)),l!==t){for(p=[],f=vt();f!==t;)p.push(f),f=vt();if(f=Qt(),f!==t){for(m=[],k=vt();k!==t;)m.push(k),k=vt();r.charCodeAt(c)===34?(k=D,c++):(k=t,$===0&&E(pr)),k!==t?(P=n,n=Bl(p,f,m)):(c=n,n=t)}else c=n,n=t}else c=n,n=t;if(n===t)if(n=c,r.charCodeAt(c)===34?(l=D,c++):(l=t,$===0&&E(pr)),l!==t){for(p=[],f=vt();f!==t;)p.push(f),f=vt();r.charCodeAt(c)===34?(f=D,c++):(f=t,$===0&&E(pr)),f!==t?(P=n,n=Ul(p)):(c=n,n=t)}else c=n,n=t;return n}function vc(){let n;return n=gc(),n===t&&(n=gi(),n===t&&(n=Ft())),n}function vt(){let n,l,p;return n=Ds(),n===t&&(n=c,r.charCodeAt(c)===92?(l=ue,c++):(l=t,$===0&&E(ai)),l!==t?(p=r.charAt(c),Ae.test(p)?c++:(p=t,$===0&&E(nl)),p!==t?(P=n,n=p):(c=n,n=t)):(c=n,n=t),n===t&&(n=c,l=c,$++,p=Qt(),$--,p===t?l=void 0:(c=l,l=t),l!==t?(p=r.charAt(c),Wa.test(p)?c++:(p=t,$===0&&E(ol)),p!==t?(P=n,n=p):(c=n,n=t)):(c=n,n=t))),n}function Ns(){let n,l,p,f,m;for(n=c,l=[],p=yt();p!==t;)l.push(p),p=yt();if(p=Qt(),p!==t){for(f=[],m=yt();m!==t;)f.push(m),m=yt();P=n,n=Hl(l,p,f)}else c=n,n=t;if(n===t){if(n=c,l=[],p=yt(),p!==t)for(;p!==t;)l.push(p),p=yt();else l=t;l!==t&&(P=n,l=Fl(l)),n=l}return n}function yt(){let n,l,p,f,m;return n=Ds(),n===t&&(n=mc(),n===t&&(n=$c(),n===t&&(n=yc(),n===t&&(n=c,l=c,$++,p=Ms(),$--,p===t?l=void 0:(c=l,l=t),l!==t?(p=c,$++,f=_c(),$--,f===t?p=void 0:(c=p,p=t),p!==t?(f=c,$++,m=Qt(),$--,m===t?f=void 0:(c=f,f=t),f!==t?(r.length>c?(m=r.charAt(c),c++):(m=t,$===0&&E(al)),m!==t?(P=n,n=m):(c=n,n=t)):(c=n,n=t)):(c=n,n=t)):(c=n,n=t))))),n}function yc(){let n,l;return n=c,r.charCodeAt(c)===42?(l=z,c++):(l=t,$===0&&E(ll)),l!==t&&(P=n,l=Ql()),n=l,n}function Ft(){let n,l,p,f,m;for(n=c,l=[],p=O();p!==t;)l.push(p),p=O();if(p=Qt(),p!==t){for(f=[],m=O();m!==t;)f.push(m),m=O();P=n,n=ql(l,p,f)}else c=n,n=t;if(n===t)for(n=[],l=O();l!==t;)n.push(l),l=O();return n}function Ds(){let n,l;return n=c,r.substr(c,2)===Z?(l=Z,c+=2):(l=t,$===0&&E(cl)),l!==t&&(P=n,l=Vl()),n=l,n===t&&(n=c,r.substr(c,2)===H?(l=H,c+=2):(l=t,$===0&&E(ul)),l!==t&&(P=n,l=Wl()),n=l,n===t&&(n=c,r.substr(c,2)===dt?(l=dt,c+=2):(l=t,$===0&&E(pl)),l!==t&&(P=n,l=Gl()),n=l)),n}function mc(){let n,l,p;return n=c,r.charCodeAt(c)===92?(l=ue,c++):(l=t,$===0&&E(ai)),l!==t?(p=Ms(),p!==t?(P=n,n=p):(c=n,n=t)):(c=n,n=t),n}function $c(){let n,l,p;return n=c,r.charCodeAt(c)===92?(l=ue,c++):(l=t,$===0&&E(ai)),l!==t?(p=r.substr(c,2),p.toLowerCase()===w?c+=2:(p=t,$===0&&E(ws)),p===t&&(p=r.substr(c,3),p.toLowerCase()===S?c+=3:(p=t,$===0&&E(Ss)),p===t&&(p=r.substr(c,3),p.toLowerCase()===C?c+=3:(p=t,$===0&&E(xs)))),p!==t?(P=n,n=p):(c=n,n=t)):(c=n,n=t),n}function _c(){let n;return n=pi(),n===t&&(n=hi(),n===t&&(n=di())),n}function Ms(){let n;return n=r.charAt(c),Ga.test(n)?c++:(n=t,$===0&&E(hl)),n}function zs(){let n,l;return n=c,r.substr(c,2)===be?(l=be,c+=2):(l=t,$===0&&E(dl)),l!==t&&(P=n,l=Yl()),n=l,n}function wc(){let n,l;return n=c,r.substr(c,2)===He?(l=He,c+=2):(l=t,$===0&&E(fl)),l!==t&&(P=n,l=Zl()),n=l,n===t&&(n=c,r.substr(c,2)===ee?(l=ee,c+=2):(l=t,$===0&&E(gl)),l!==t&&(P=n,l=Jl()),n=l,n===t&&(n=c,r.charCodeAt(c)===60?(l=cr,c++):(l=t,$===0&&E(bl)),l!==t&&(P=n,l=Kl()),n=l,n===t&&(n=c,r.charCodeAt(c)===62?(l=ft,c++):(l=t,$===0&&E(vl)),l!==t&&(P=n,l=Xl()),n=l))),n}function O(){let n;return $++,n=r.charAt(c),Ya.test(n)?c++:(n=t,$===0&&E(ml)),$--,n===t&&$===0&&E(yl),n}function Qt(){let n,l,p;return n=c,P=c,l=ec(),l?l=void 0:l=t,l!==t?(r.substr(c,14)===gt?(p=gt,c+=14):(p=t,$===0&&E($l)),p!==t?(P=n,n=tc()):(c=n,n=t)):(c=n,n=t),n}const{errorOnLuceneSyntax:Vc,parseCursor:Sc,cursorSymbol:xc,allowLeadingWildcards:kc=!0,helpers:{nodeTypes:Qe}}=s,te=Qe.function.buildNodeWithArgumentNodes,Ce=Qe.literal.buildNode,Ec=Qe.wildcard.buildNode,Is=Qe.namedArg.buildNode,{wildcardSymbol:bi}=Qe.wildcard;var mt=0;jt=d();const vi=jt!==t&&c===r.length;function Rs(){throw jt!==t&&c<r.length&&E(nc()),ac(hr,ie<r.length?ic(ie):null,ie<r.length?dr(ie,ie+1):dr(ie,ie))}if(s.peg$library)return{peg$result:jt,peg$currPos:c,peg$FAILED:t,peg$maxFailExpected:hr,peg$maxFailPos:ie,peg$success:vi,peg$throw:vi?void 0:Rs};if(vi)return jt;Rs()}return{StartRules:["start","Literal"],SyntaxError:i,parse:e}}(),Br=(i,e={},r=er)=>{if(typeof i>"u")throw new Error("expression must be a string, got undefined instead");return r(i,{...e,helpers:{nodeTypes:ce}})},et=(i,e={})=>Br(i,{...e,startRule:"Literal"},er),tr=(i,e={})=>{try{return Br(i,e,er)}catch(r){throw r.name==="SyntaxError"?new Yi(r,i):r}},Ln=i=>{try{return Br(i,{errorOnLuceneSyntax:!0},er),!1}catch(e){return e.message.startsWith("Lucene")}},Q=(i,e,r,s)=>(e=void 0,!i||!i.type||!ce[i.type]?Q(ce.function.buildNode("and",[]),e):ce[i.type].toOpenSearchQuery(i,e,r,s)),ae="@kuery-wildcard@";function Nn(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Dn(i){return i.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Mn(i){return i.includes(ae)?{type:"wildcard",value:i}:et(i)}function Zi(i,e){const{value:r}=i,s=r.split(ae).map(Nn).join("[\\s\\S]*");return new RegExp(`^${s}$`).test(e)}function zn(i){const{value:e}=i;return e.split(ae).join("*")}function Ur(i){const{value:e}=i;return e.split(ae).map(Dn).join("*")}function In(i){const{value:e}=i;return e.startsWith(ae)&&e.replace(ae,"").length>0}const Rn=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Mn,hasLeadingWildcard:In,test:Zi,toOpenSearchQuery:zn,toQueryStringQuery:Ur,wildcardSymbol:ae},Symbol.toStringTag,{value:"Module"}));function Hr(i,e){if(!e)return[];if(i.type==="literal"){const r=jr(i),s=e.fields.find(t=>t.name===r);return s?[s]:[]}else if(i.type==="wildcard")return e.fields.filter(s=>Zi(i,s.name))}function Ac(i){return i}function Ji(i,e,r){const s={...i,value:r?`${r}.${i.value}`:i.value};if(!e||s.type==="wildcard"&&!r)return s;const o=Hr(s,e).reduce((a,d)=>{const u=d.subType&&d.subType.nested?d.subType.nested.path:void 0;return r&&!u?[...a,`${d.name} is not a nested field but is in nested group "${r}" in the DQL expression.`]:u&&!r?[...a,`${d.name} is a nested field, but is not in a nested group in the DQL expression.`]:u!==r?[...a,`Nested field ${d.name} is being queried with the incorrect nested path. The correct path is ${d.subType.nested.path}.`]:a},[]);if(o.length>0)throw new Error(o.join(`
788
+ `));return s}function jn(i,e,r=!1){if(i===void 0)throw new Error("fieldName is a required argument");if(e===void 0)throw new Error("value is a required argument");const s=typeof i=="string"?et(i):Xe(i),t=typeof e=="string"?et(e):Xe(e),o=Xe(r);return{arguments:[s,t,o]}}function Bn(i,e,r={},s={}){const{arguments:[t,o,a]}=i,d=Ji(t,e,s!=null&&s.nested?s.nested.path:void 0),u=Q(d),b=o!==void 0?Q(o):o,y=a.value?"phrase":"best_fields";if(d.value===null)return o.type==="wildcard"?{query_string:{query:Ur(o)}}:{multi_match:{type:y,query:b,lenient:!0}};const v=e?Hr(d,e):[];v&&v.length===0&&v.push({name:Q(d),scripted:!1,type:""});const A=o.type==="wildcard"&&b==="*",w=d.type==="wildcard"&&u==="*"||v&&e&&v.length===e.fields.length;return A&&w?{match_all:{}}:{bool:{should:v.reduce((M,D)=>{const ue=z=>{var Z;return d.type!=="wildcard"||!((Z=D.subType)!=null&&Z.nested)||s!=null&&s.nested?z:{nested:{path:D.subType.nested.path,query:z,score_mode:"none"}}};if(D.scripted)return[];if(A)return[...M,ue({exists:{field:D.name}})];if(o.type==="wildcard")return[...M,ue({query_string:{fields:[D.name],query:Ur(o)}})];if(D.type==="date"){const z=r.dateFormatTZ?{time_zone:r.dateFormatTZ}:{};return[...M,ue({range:{[D.name]:{gte:b,lte:b,...z}}})]}else{const z=y==="phrase"?"match_phrase":"match";return[...M,ue({[z]:{[D.name]:b}})]}},[])||[],minimum_should_match:1}}}const Un=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:jn,toOpenSearchQuery:Bn},Symbol.toStringTag,{value:"Module"}));function Hn(i){return{arguments:i}}function Fn(i,e,r={},s={}){return{bool:{filter:(i.arguments||[]).map(o=>Q(o,e,r,s))}}}const Qn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Hn,toOpenSearchQuery:Fn},Symbol.toStringTag,{value:"Module"}));function qn(i){return{arguments:i}}function Vn(i,e,r={},s={}){return{bool:{should:(i.arguments||[]).map(o=>Q(o,e,r,s)),minimum_should_match:1}}}const Wn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:qn,toOpenSearchQuery:Vn},Symbol.toStringTag,{value:"Module"}));function Gn(i){return{arguments:[i]}}function Yn(i,e,r={},s={}){const[t]=i.arguments;return{bool:{must_not:Q(t,e,r,s)}}}const Zn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Gn,toOpenSearchQuery:Yn},Symbol.toStringTag,{value:"Module"}));function Jn(i,...e){let r={};for(let s of e)r[s]=i[s];return r}function Kn(i,e){const r=Jn(e,"gt","lt","gte","lte","format"),s=typeof i=="string"?et(i):ce.literal.buildNode(i),t=Object.entries(r).map(o=>{let[a,d]=o;return ce.namedArg.buildNode(a,d)});return{arguments:[s,...t]}}function Xn(i,e,r={},s={}){const[t,...o]=i.arguments,a=Ji(t,e,s!=null&&s.nested?s.nested.path:void 0),d=e?Hr(a,e):[],u=eo(o),b=Object.fromEntries(Object.entries(u).map(([v,A])=>[v,Q(A)]));return d&&d.length===0&&d.push({name:Q(a),scripted:!1,type:""}),{bool:{should:d.map(v=>{const A=w=>{var S;return a.type!=="wildcard"||!((S=v.subType)!=null&&S.nested)||s.nested?w:{nested:{path:v.subType.nested.path,query:w,score_mode:"none"}}};if(v.scripted)return{};if(v.type==="date"){const w=r.dateFormatTZ?{time_zone:r.dateFormatTZ}:{};return A({range:{[v.name]:{...b,...w}}})}return A({range:{[v.name]:b}})}),minimum_should_match:1}}}function eo(i){if(i.gt&&i.gte||i.lt&&i.lte)throw new Error("range ends cannot be both inclusive and exclusive");const e=["gte","lte","format"];return i.reduce((r,s,t)=>(s.type==="namedArg"?r[s.name]=s.value:r[e[t]]=s,r),{})}const to=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Kn,toOpenSearchQuery:Xn},Symbol.toStringTag,{value:"Module"}));function ro(i){return{arguments:[Xe(i)]}}function io(i,e,r={},s={}){const{arguments:[t]}=i,o={...t,value:s!=null&&s.nested?`${s.nested.path}.${t.value}`:t.value},a=jr(o),d=((e==null?void 0:e.fields)||[]).find(u=>u.name===a);if(d&&d.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:a}}}const so=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ro,toOpenSearchQuery:io},Symbol.toStringTag,{value:"Module"}));function no(i,e){return{arguments:[typeof i=="string"?et(i):Xe(i),e]}}function oo(i,e,r={},s={}){var u;const[t,o]=i.arguments,a=Q(t),d=(u=s==null?void 0:s.nested)!=null&&u.path?`${s.nested.path}.${a}`:a;return{nested:{path:d,query:Q(o,e,r,{...s,nested:{path:d}}),score_mode:"none"}}}const ao=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:no,toOpenSearchQuery:oo},Symbol.toStringTag,{value:"Module"}));/* @preserve
788
789
  * @terraformer/wkt - v2.2.0 - MIT
789
790
  * Copyright (c) 2012-2024 Environmental Systems Research Institute, Inc.
790
791
  * Wed May 15 2024 14:35:51 GMT-0700 (Pacific Daylight Time)
791
- */var x=function(e,r,s,t){for(s=s||{},t=e.length;t--;s[e[t]]=r);return s},et=[1,9],tt=[1,10],rt=[1,11],it=[1,12],st=[1,13],nt=[1,14],ot=[1,15],U=[1,60],T=[5,15,19],fe=[1,67],ae=[1,73],Pt=[1,87],Tt=[1,104],D=[15,19],$e=[1,110],ge=[1,116],tr=[1,130],rr=[1,136],Lt={trace:function(){},yy:{},symbols_:{error:2,expressions:3,point:4,EOF:5,linestring:6,polygon:7,multipoint:8,multilinestring:9,multipolygon:10,geometrycollection:11,coordinate:12,DOUBLE_TOK:13,ptarray:14,COMMA:15,ring_list:16,ring:17,"(":18,")":19,POINT:20,Z:21,ZM:22,M:23,EMPTY:24,point_untagged:25,polygon_list:26,polygon_untagged:27,point_list:28,LINESTRING:29,POLYGON:30,MULTIPOINT:31,MULTILINESTRING:32,MULTIPOLYGON:33,geometry:34,geometry_collection:35,GEOMETRYCOLLECTION:36,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",13:"DOUBLE_TOK",15:"COMMA",18:"(",19:")",20:"POINT",21:"Z",22:"ZM",23:"M",24:"EMPTY",29:"LINESTRING",30:"POLYGON",31:"MULTIPOINT",32:"MULTILINESTRING",33:"MULTIPOLYGON",36:"GEOMETRYCOLLECTION"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[3,2],[3,2],[3,2],[12,2],[12,3],[12,4],[14,3],[14,1],[16,3],[16,1],[17,3],[4,4],[4,5],[4,5],[4,5],[4,2],[25,1],[25,3],[26,3],[26,1],[27,3],[28,3],[28,1],[6,4],[6,5],[6,5],[6,5],[6,2],[7,4],[7,5],[7,5],[7,5],[7,2],[8,4],[8,5],[8,5],[8,5],[8,2],[9,4],[9,5],[9,5],[9,5],[9,2],[10,4],[10,5],[10,5],[10,5],[10,2],[34,1],[34,1],[34,1],[34,1],[34,1],[34,1],[34,1],[35,3],[35,1],[11,4],[11,5],[11,5],[11,5],[11,2]],performAction:function(e,r,s,t,o,a,d){var c=a.length-1;switch(o){case 1:case 2:case 3:case 4:case 5:case 6:case 7:return a[c-1];case 8:this.$=new Nt([Number(a[c-1]),Number(a[c])]);break;case 9:this.$=new Nt([Number(a[c-2]),Number(a[c-1]),Number(a[c])]);break;case 10:this.$=new Nt([Number(a[c-3]),Number(a[c-2]),Number(a[c-1]),Number(a[c])]);break;case 11:case 26:this.$=a[c-2].addPoint(a[c]);break;case 12:case 21:case 27:case 53:case 54:case 55:case 56:case 57:case 58:case 59:this.$=a[c];break;case 13:this.$=a[c-2].addRing(a[c]);break;case 14:this.$=new Hr(a[c]);break;case 15:this.$=new Xi(a[c-1]);break;case 16:this.$={type:"Point",coordinates:a[c-1].data[0]};break;case 17:this.$={type:"Point",coordinates:a[c-1].data[0],properties:{z:!0}};break;case 18:this.$={type:"Point",coordinates:a[c-1].data[0],properties:{z:!0,m:!0}};break;case 19:this.$={type:"Point",coordinates:a[c-1].data[0],properties:{m:!0}};break;case 20:this.$={type:"Point",coordinates:[]};break;case 22:case 25:this.$=a[c-1];break;case 23:this.$=a[c-2].addPolygon(a[c]);break;case 24:this.$=new Qr(a[c]);break;case 28:this.$={type:"LineString",coordinates:a[c-1].data};break;case 29:this.$={type:"LineString",coordinates:a[c-1].data,properties:{z:!0}};break;case 30:this.$={type:"LineString",coordinates:a[c-1].data,properties:{m:!0}};break;case 31:this.$={type:"LineString",coordinates:a[c-1].data,properties:{z:!0,m:!0}};break;case 32:this.$={type:"LineString",coordinates:[]};break;case 33:this.$={type:"Polygon",coordinates:a[c-1].toJSON()};break;case 34:this.$={type:"Polygon",coordinates:a[c-1].toJSON(),properties:{z:!0}};break;case 35:this.$={type:"Polygon",coordinates:a[c-1].toJSON(),properties:{m:!0}};break;case 36:this.$={type:"Polygon",coordinates:a[c-1].toJSON(),properties:{z:!0,m:!0}};break;case 37:this.$={type:"Polygon",coordinates:[]};break;case 38:this.$={type:"MultiPoint",coordinates:a[c-1].data};break;case 39:this.$={type:"MultiPoint",coordinates:a[c-1].data,properties:{z:!0}};break;case 40:this.$={type:"MultiPoint",coordinates:a[c-1].data,properties:{m:!0}};break;case 41:this.$={type:"MultiPoint",coordinates:a[c-1].data,properties:{z:!0,m:!0}};break;case 42:this.$={type:"MultiPoint",coordinates:[]};break;case 43:this.$={type:"MultiLineString",coordinates:a[c-1].toJSON()};break;case 44:this.$={type:"MultiLineString",coordinates:a[c-1].toJSON(),properties:{z:!0}};break;case 45:this.$={type:"MultiLineString",coordinates:a[c-1].toJSON(),properties:{m:!0}};break;case 46:this.$={type:"MultiLineString",coordinates:a[c-1].toJSON(),properties:{z:!0,m:!0}};break;case 47:this.$={type:"MultiLineString",coordinates:[]};break;case 48:this.$={type:"MultiPolygon",coordinates:a[c-1].toJSON()};break;case 49:this.$={type:"MultiPolygon",coordinates:a[c-1].toJSON(),properties:{z:!0}};break;case 50:this.$={type:"MultiPolygon",coordinates:a[c-1].toJSON(),properties:{m:!0}};break;case 51:this.$={type:"MultiPolygon",coordinates:a[c-1].toJSON(),properties:{z:!0,m:!0}};break;case 52:this.$={type:"MultiPolygon",coordinates:[]};break;case 60:this.$=a[c-2].addGeometry(a[c]);break;case 61:this.$=new Fr(a[c]);break;case 62:this.$={type:"GeometryCollection",geometries:a[c-1].toJSON()};break;case 63:this.$={type:"GeometryCollection",geometries:a[c-1].toJSON(),properties:{z:!0}};break;case 64:this.$={type:"GeometryCollection",geometries:a[c-1].toJSON(),properties:{m:!0}};break;case 65:this.$={type:"GeometryCollection",geometries:a[c-1].toJSON(),properties:{z:!0,m:!0}};break;case 66:this.$={type:"GeometryCollection",geometries:[]};break}},table:[{3:1,4:2,6:3,7:4,8:5,9:6,10:7,11:8,20:et,29:tt,30:rt,31:it,32:st,33:nt,36:ot},{1:[3]},{5:[1,16]},{5:[1,17]},{5:[1,18]},{5:[1,19]},{5:[1,20]},{5:[1,21]},{5:[1,22]},{18:[1,23],21:[1,24],22:[1,25],23:[1,26],24:[1,27]},{18:[1,28],21:[1,29],22:[1,31],23:[1,30],24:[1,32]},{18:[1,33],21:[1,34],22:[1,36],23:[1,35],24:[1,37]},{18:[1,38],21:[1,39],22:[1,41],23:[1,40],24:[1,42]},{18:[1,43],21:[1,44],22:[1,46],23:[1,45],24:[1,47]},{18:[1,48],21:[1,49],22:[1,51],23:[1,50],24:[1,52]},{18:[1,53],21:[1,54],22:[1,56],23:[1,55],24:[1,57]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{12:59,13:U,14:58},{18:[1,61]},{18:[1,62]},{18:[1,63]},x(T,[2,20]),{12:66,13:U,18:fe,25:65,28:64},{18:[1,68]},{18:[1,69]},{18:[1,70]},x(T,[2,32]),{16:71,17:72,18:ae},{18:[1,74]},{18:[1,75]},{18:[1,76]},x(T,[2,37]),{12:66,13:U,18:fe,25:65,28:77},{18:[1,78]},{18:[1,79]},{18:[1,80]},x(T,[2,42]),{16:81,17:72,18:ae},{18:[1,82]},{18:[1,83]},{18:[1,84]},x(T,[2,47]),{18:Pt,26:85,27:86},{18:[1,88]},{18:[1,89]},{18:[1,90]},x(T,[2,52]),{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:et,29:tt,30:rt,31:it,32:st,33:nt,34:92,35:91,36:ot},{18:[1,100]},{18:[1,101]},{18:[1,102]},x(T,[2,66]),{15:Tt,19:[1,103]},x(D,[2,12]),{13:[1,105]},{12:59,13:U,14:106},{12:59,13:U,14:107},{12:59,13:U,14:108},{15:$e,19:[1,109]},x(D,[2,27]),x(D,[2,21]),{12:111,13:U},{12:66,13:U,18:fe,25:65,28:112},{12:66,13:U,18:fe,25:65,28:113},{12:66,13:U,18:fe,25:65,28:114},{15:ge,19:[1,115]},x(D,[2,14]),{12:59,13:U,14:117},{16:118,17:72,18:ae},{16:119,17:72,18:ae},{16:120,17:72,18:ae},{15:$e,19:[1,121]},{12:66,13:U,18:fe,25:65,28:122},{12:66,13:U,18:fe,25:65,28:123},{12:66,13:U,18:fe,25:65,28:124},{15:ge,19:[1,125]},{16:126,17:72,18:ae},{16:127,17:72,18:ae},{16:128,17:72,18:ae},{15:tr,19:[1,129]},x(D,[2,24]),{16:131,17:72,18:ae},{18:Pt,26:132,27:86},{18:Pt,26:133,27:86},{18:Pt,26:134,27:86},{15:rr,19:[1,135]},x(D,[2,61]),x(D,[2,53]),x(D,[2,54]),x(D,[2,55]),x(D,[2,56]),x(D,[2,57]),x(D,[2,58]),x(D,[2,59]),{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:et,29:tt,30:rt,31:it,32:st,33:nt,34:92,35:137,36:ot},{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:et,29:tt,30:rt,31:it,32:st,33:nt,34:92,35:138,36:ot},{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:et,29:tt,30:rt,31:it,32:st,33:nt,34:92,35:139,36:ot},x(T,[2,16]),{12:140,13:U},x(D,[2,8],{13:[1,141]}),{15:Tt,19:[1,142]},{15:Tt,19:[1,143]},{15:Tt,19:[1,144]},x(T,[2,28]),{12:66,13:U,18:fe,25:145},{19:[1,146]},{15:$e,19:[1,147]},{15:$e,19:[1,148]},{15:$e,19:[1,149]},x(T,[2,33]),{17:150,18:ae},{15:Tt,19:[1,151]},{15:ge,19:[1,152]},{15:ge,19:[1,153]},{15:ge,19:[1,154]},x(T,[2,38]),{15:$e,19:[1,155]},{15:$e,19:[1,156]},{15:$e,19:[1,157]},x(T,[2,43]),{15:ge,19:[1,158]},{15:ge,19:[1,159]},{15:ge,19:[1,160]},x(T,[2,48]),{18:Pt,27:161},{15:ge,19:[1,162]},{15:tr,19:[1,163]},{15:tr,19:[1,164]},{15:tr,19:[1,165]},x(T,[2,62]),{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:et,29:tt,30:rt,31:it,32:st,33:nt,34:166,36:ot},{15:rr,19:[1,167]},{15:rr,19:[1,168]},{15:rr,19:[1,169]},x(D,[2,11]),x(D,[2,9],{13:[1,170]}),x(T,[2,17]),x(T,[2,18]),x(T,[2,19]),x(D,[2,26]),x(D,[2,22]),x(T,[2,29]),x(T,[2,30]),x(T,[2,31]),x(D,[2,13]),x(D,[2,15]),x(T,[2,34]),x(T,[2,35]),x(T,[2,36]),x(T,[2,39]),x(T,[2,40]),x(T,[2,41]),x(T,[2,44]),x(T,[2,45]),x(T,[2,46]),x(D,[2,23]),x(D,[2,25]),x(T,[2,49]),x(T,[2,50]),x(T,[2,51]),x(D,[2,60]),x(T,[2,63]),x(T,[2,64]),x(T,[2,65]),x(D,[2,10])],defaultActions:{16:[2,1],17:[2,2],18:[2,3],19:[2,4],20:[2,5],21:[2,6],22:[2,7]},parseError:function(e,r){if(r.recoverable)this.trace(e);else{var s=new Error(e);throw s.hash=r,s}},parse:function(e){var r=this,s=[0],t=[null],o=[],a=this.table,d="",c=0,b=0,_=2,v=1,C=o.slice.call(arguments,1),w=Object.create(this.lexer),S={yy:{}};for(var A in this.yy)Object.prototype.hasOwnProperty.call(this.yy,A)&&(S.yy[A]=this.yy[A]);w.setInput(e,S.yy),S.yy.lexer=w,S.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var N=w.yylloc;o.push(N);var M=w.options&&w.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var ue=function(){var Ee;return Ee=w.lex()||v,typeof Ee!="number"&&(Ee=r.symbols_[Ee]||Ee),Ee},z,Z,H,ht,be={},Ue,X,lr,dt;;){if(Z=s[s.length-1],this.defaultActions[Z]?H=this.defaultActions[Z]:((z===null||typeof z>"u")&&(z=ue()),H=a[Z]&&a[Z][z]),typeof H>"u"||!H.length||!H[0]){var ft="";dt=[];for(Ue in a[Z])this.terminals_[Ue]&&Ue>_&&dt.push("'"+this.terminals_[Ue]+"'");w.showPosition?ft="Parse error on line "+(c+1)+`:
792
+ */var x=function(e,r,s,t){for(s=s||{},t=e.length;t--;s[e[t]]=r);return s},tt=[1,9],rt=[1,10],it=[1,11],st=[1,12],nt=[1,13],ot=[1,14],at=[1,15],U=[1,60],T=[5,15,19],fe=[1,67],le=[1,73],Tt=[1,87],Lt=[1,104],N=[15,19],$e=[1,110],ge=[1,116],rr=[1,130],ir=[1,136],Nt={trace:function(){},yy:{},symbols_:{error:2,expressions:3,point:4,EOF:5,linestring:6,polygon:7,multipoint:8,multilinestring:9,multipolygon:10,geometrycollection:11,coordinate:12,DOUBLE_TOK:13,ptarray:14,COMMA:15,ring_list:16,ring:17,"(":18,")":19,POINT:20,Z:21,ZM:22,M:23,EMPTY:24,point_untagged:25,polygon_list:26,polygon_untagged:27,point_list:28,LINESTRING:29,POLYGON:30,MULTIPOINT:31,MULTILINESTRING:32,MULTIPOLYGON:33,geometry:34,geometry_collection:35,GEOMETRYCOLLECTION:36,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",13:"DOUBLE_TOK",15:"COMMA",18:"(",19:")",20:"POINT",21:"Z",22:"ZM",23:"M",24:"EMPTY",29:"LINESTRING",30:"POLYGON",31:"MULTIPOINT",32:"MULTILINESTRING",33:"MULTIPOLYGON",36:"GEOMETRYCOLLECTION"},productions_:[0,[3,2],[3,2],[3,2],[3,2],[3,2],[3,2],[3,2],[12,2],[12,3],[12,4],[14,3],[14,1],[16,3],[16,1],[17,3],[4,4],[4,5],[4,5],[4,5],[4,2],[25,1],[25,3],[26,3],[26,1],[27,3],[28,3],[28,1],[6,4],[6,5],[6,5],[6,5],[6,2],[7,4],[7,5],[7,5],[7,5],[7,2],[8,4],[8,5],[8,5],[8,5],[8,2],[9,4],[9,5],[9,5],[9,5],[9,2],[10,4],[10,5],[10,5],[10,5],[10,2],[34,1],[34,1],[34,1],[34,1],[34,1],[34,1],[34,1],[35,3],[35,1],[11,4],[11,5],[11,5],[11,5],[11,2]],performAction:function(e,r,s,t,o,a,d){var u=a.length-1;switch(o){case 1:case 2:case 3:case 4:case 5:case 6:case 7:return a[u-1];case 8:this.$=new Dt([Number(a[u-1]),Number(a[u])]);break;case 9:this.$=new Dt([Number(a[u-2]),Number(a[u-1]),Number(a[u])]);break;case 10:this.$=new Dt([Number(a[u-3]),Number(a[u-2]),Number(a[u-1]),Number(a[u])]);break;case 11:case 26:this.$=a[u-2].addPoint(a[u]);break;case 12:case 21:case 27:case 53:case 54:case 55:case 56:case 57:case 58:case 59:this.$=a[u];break;case 13:this.$=a[u-2].addRing(a[u]);break;case 14:this.$=new Fr(a[u]);break;case 15:this.$=new Xi(a[u-1]);break;case 16:this.$={type:"Point",coordinates:a[u-1].data[0]};break;case 17:this.$={type:"Point",coordinates:a[u-1].data[0],properties:{z:!0}};break;case 18:this.$={type:"Point",coordinates:a[u-1].data[0],properties:{z:!0,m:!0}};break;case 19:this.$={type:"Point",coordinates:a[u-1].data[0],properties:{m:!0}};break;case 20:this.$={type:"Point",coordinates:[]};break;case 22:case 25:this.$=a[u-1];break;case 23:this.$=a[u-2].addPolygon(a[u]);break;case 24:this.$=new qr(a[u]);break;case 28:this.$={type:"LineString",coordinates:a[u-1].data};break;case 29:this.$={type:"LineString",coordinates:a[u-1].data,properties:{z:!0}};break;case 30:this.$={type:"LineString",coordinates:a[u-1].data,properties:{m:!0}};break;case 31:this.$={type:"LineString",coordinates:a[u-1].data,properties:{z:!0,m:!0}};break;case 32:this.$={type:"LineString",coordinates:[]};break;case 33:this.$={type:"Polygon",coordinates:a[u-1].toJSON()};break;case 34:this.$={type:"Polygon",coordinates:a[u-1].toJSON(),properties:{z:!0}};break;case 35:this.$={type:"Polygon",coordinates:a[u-1].toJSON(),properties:{m:!0}};break;case 36:this.$={type:"Polygon",coordinates:a[u-1].toJSON(),properties:{z:!0,m:!0}};break;case 37:this.$={type:"Polygon",coordinates:[]};break;case 38:this.$={type:"MultiPoint",coordinates:a[u-1].data};break;case 39:this.$={type:"MultiPoint",coordinates:a[u-1].data,properties:{z:!0}};break;case 40:this.$={type:"MultiPoint",coordinates:a[u-1].data,properties:{m:!0}};break;case 41:this.$={type:"MultiPoint",coordinates:a[u-1].data,properties:{z:!0,m:!0}};break;case 42:this.$={type:"MultiPoint",coordinates:[]};break;case 43:this.$={type:"MultiLineString",coordinates:a[u-1].toJSON()};break;case 44:this.$={type:"MultiLineString",coordinates:a[u-1].toJSON(),properties:{z:!0}};break;case 45:this.$={type:"MultiLineString",coordinates:a[u-1].toJSON(),properties:{m:!0}};break;case 46:this.$={type:"MultiLineString",coordinates:a[u-1].toJSON(),properties:{z:!0,m:!0}};break;case 47:this.$={type:"MultiLineString",coordinates:[]};break;case 48:this.$={type:"MultiPolygon",coordinates:a[u-1].toJSON()};break;case 49:this.$={type:"MultiPolygon",coordinates:a[u-1].toJSON(),properties:{z:!0}};break;case 50:this.$={type:"MultiPolygon",coordinates:a[u-1].toJSON(),properties:{m:!0}};break;case 51:this.$={type:"MultiPolygon",coordinates:a[u-1].toJSON(),properties:{z:!0,m:!0}};break;case 52:this.$={type:"MultiPolygon",coordinates:[]};break;case 60:this.$=a[u-2].addGeometry(a[u]);break;case 61:this.$=new Qr(a[u]);break;case 62:this.$={type:"GeometryCollection",geometries:a[u-1].toJSON()};break;case 63:this.$={type:"GeometryCollection",geometries:a[u-1].toJSON(),properties:{z:!0}};break;case 64:this.$={type:"GeometryCollection",geometries:a[u-1].toJSON(),properties:{m:!0}};break;case 65:this.$={type:"GeometryCollection",geometries:a[u-1].toJSON(),properties:{z:!0,m:!0}};break;case 66:this.$={type:"GeometryCollection",geometries:[]};break}},table:[{3:1,4:2,6:3,7:4,8:5,9:6,10:7,11:8,20:tt,29:rt,30:it,31:st,32:nt,33:ot,36:at},{1:[3]},{5:[1,16]},{5:[1,17]},{5:[1,18]},{5:[1,19]},{5:[1,20]},{5:[1,21]},{5:[1,22]},{18:[1,23],21:[1,24],22:[1,25],23:[1,26],24:[1,27]},{18:[1,28],21:[1,29],22:[1,31],23:[1,30],24:[1,32]},{18:[1,33],21:[1,34],22:[1,36],23:[1,35],24:[1,37]},{18:[1,38],21:[1,39],22:[1,41],23:[1,40],24:[1,42]},{18:[1,43],21:[1,44],22:[1,46],23:[1,45],24:[1,47]},{18:[1,48],21:[1,49],22:[1,51],23:[1,50],24:[1,52]},{18:[1,53],21:[1,54],22:[1,56],23:[1,55],24:[1,57]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{1:[2,7]},{12:59,13:U,14:58},{18:[1,61]},{18:[1,62]},{18:[1,63]},x(T,[2,20]),{12:66,13:U,18:fe,25:65,28:64},{18:[1,68]},{18:[1,69]},{18:[1,70]},x(T,[2,32]),{16:71,17:72,18:le},{18:[1,74]},{18:[1,75]},{18:[1,76]},x(T,[2,37]),{12:66,13:U,18:fe,25:65,28:77},{18:[1,78]},{18:[1,79]},{18:[1,80]},x(T,[2,42]),{16:81,17:72,18:le},{18:[1,82]},{18:[1,83]},{18:[1,84]},x(T,[2,47]),{18:Tt,26:85,27:86},{18:[1,88]},{18:[1,89]},{18:[1,90]},x(T,[2,52]),{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:tt,29:rt,30:it,31:st,32:nt,33:ot,34:92,35:91,36:at},{18:[1,100]},{18:[1,101]},{18:[1,102]},x(T,[2,66]),{15:Lt,19:[1,103]},x(N,[2,12]),{13:[1,105]},{12:59,13:U,14:106},{12:59,13:U,14:107},{12:59,13:U,14:108},{15:$e,19:[1,109]},x(N,[2,27]),x(N,[2,21]),{12:111,13:U},{12:66,13:U,18:fe,25:65,28:112},{12:66,13:U,18:fe,25:65,28:113},{12:66,13:U,18:fe,25:65,28:114},{15:ge,19:[1,115]},x(N,[2,14]),{12:59,13:U,14:117},{16:118,17:72,18:le},{16:119,17:72,18:le},{16:120,17:72,18:le},{15:$e,19:[1,121]},{12:66,13:U,18:fe,25:65,28:122},{12:66,13:U,18:fe,25:65,28:123},{12:66,13:U,18:fe,25:65,28:124},{15:ge,19:[1,125]},{16:126,17:72,18:le},{16:127,17:72,18:le},{16:128,17:72,18:le},{15:rr,19:[1,129]},x(N,[2,24]),{16:131,17:72,18:le},{18:Tt,26:132,27:86},{18:Tt,26:133,27:86},{18:Tt,26:134,27:86},{15:ir,19:[1,135]},x(N,[2,61]),x(N,[2,53]),x(N,[2,54]),x(N,[2,55]),x(N,[2,56]),x(N,[2,57]),x(N,[2,58]),x(N,[2,59]),{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:tt,29:rt,30:it,31:st,32:nt,33:ot,34:92,35:137,36:at},{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:tt,29:rt,30:it,31:st,32:nt,33:ot,34:92,35:138,36:at},{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:tt,29:rt,30:it,31:st,32:nt,33:ot,34:92,35:139,36:at},x(T,[2,16]),{12:140,13:U},x(N,[2,8],{13:[1,141]}),{15:Lt,19:[1,142]},{15:Lt,19:[1,143]},{15:Lt,19:[1,144]},x(T,[2,28]),{12:66,13:U,18:fe,25:145},{19:[1,146]},{15:$e,19:[1,147]},{15:$e,19:[1,148]},{15:$e,19:[1,149]},x(T,[2,33]),{17:150,18:le},{15:Lt,19:[1,151]},{15:ge,19:[1,152]},{15:ge,19:[1,153]},{15:ge,19:[1,154]},x(T,[2,38]),{15:$e,19:[1,155]},{15:$e,19:[1,156]},{15:$e,19:[1,157]},x(T,[2,43]),{15:ge,19:[1,158]},{15:ge,19:[1,159]},{15:ge,19:[1,160]},x(T,[2,48]),{18:Tt,27:161},{15:ge,19:[1,162]},{15:rr,19:[1,163]},{15:rr,19:[1,164]},{15:rr,19:[1,165]},x(T,[2,62]),{4:93,6:94,7:95,8:96,9:97,10:98,11:99,20:tt,29:rt,30:it,31:st,32:nt,33:ot,34:166,36:at},{15:ir,19:[1,167]},{15:ir,19:[1,168]},{15:ir,19:[1,169]},x(N,[2,11]),x(N,[2,9],{13:[1,170]}),x(T,[2,17]),x(T,[2,18]),x(T,[2,19]),x(N,[2,26]),x(N,[2,22]),x(T,[2,29]),x(T,[2,30]),x(T,[2,31]),x(N,[2,13]),x(N,[2,15]),x(T,[2,34]),x(T,[2,35]),x(T,[2,36]),x(T,[2,39]),x(T,[2,40]),x(T,[2,41]),x(T,[2,44]),x(T,[2,45]),x(T,[2,46]),x(N,[2,23]),x(N,[2,25]),x(T,[2,49]),x(T,[2,50]),x(T,[2,51]),x(N,[2,60]),x(T,[2,63]),x(T,[2,64]),x(T,[2,65]),x(N,[2,10])],defaultActions:{16:[2,1],17:[2,2],18:[2,3],19:[2,4],20:[2,5],21:[2,6],22:[2,7]},parseError:function(e,r){if(r.recoverable)this.trace(e);else{var s=new Error(e);throw s.hash=r,s}},parse:function(e){var r=this,s=[0],t=[null],o=[],a=this.table,d="",u=0,b=0,y=2,v=1,A=o.slice.call(arguments,1),w=Object.create(this.lexer),S={yy:{}};for(var C in this.yy)Object.prototype.hasOwnProperty.call(this.yy,C)&&(S.yy[C]=this.yy[C]);w.setInput(e,S.yy),S.yy.lexer=w,S.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var M=w.yylloc;o.push(M);var D=w.options&&w.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var ue=function(){var Ae;return Ae=w.lex()||v,typeof Ae!="number"&&(Ae=r.symbols_[Ae]||Ae),Ae},z,Z,H,dt,be={},He,ee,cr,ft;;){if(Z=s[s.length-1],this.defaultActions[Z]?H=this.defaultActions[Z]:((z===null||typeof z>"u")&&(z=ue()),H=a[Z]&&a[Z][z]),typeof H>"u"||!H.length||!H[0]){var gt="";ft=[];for(He in a[Z])this.terminals_[He]&&He>y&&ft.push("'"+this.terminals_[He]+"'");w.showPosition?gt="Parse error on line "+(u+1)+`:
792
793
  `+w.showPosition()+`
793
- Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error on line "+(c+1)+": Unexpected "+(z==v?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(ft,{text:w.match,token:this.terminals_[z]||z,line:w.yylineno,loc:N,expected:dt})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+z);switch(H[0]){case 1:s.push(z),t.push(w.yytext),o.push(w.yylloc),s.push(H[1]),z=null,b=w.yyleng,d=w.yytext,c=w.yylineno,N=w.yylloc;break;case 2:if(X=this.productions_[H[1]][1],be.$=t[t.length-X],be._$={first_line:o[o.length-(X||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(X||1)].first_column,last_column:o[o.length-1].last_column},M&&(be._$.range=[o[o.length-(X||1)].range[0],o[o.length-1].range[1]]),ht=this.performAction.apply(be,[d,b,c,S.yy,H[1],t,o].concat(C)),typeof ht<"u")return ht;X&&(s=s.slice(0,-1*X*2),t=t.slice(0,-1*X),o=o.slice(0,-1*X)),s.push(this.productions_[H[1]][0]),t.push(be.$),o.push(be._$),lr=a[s[s.length-2]][s[s.length-1]],s.push(lr);break;case 3:return!0}}return!0}},lo=function(){var i={EOF:1,parseError:function(r,s){if(this.yy.parser)this.yy.parser.parseError(r,s);else throw new Error(r)},setInput:function(r,s){return this.yy=s||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var s=r.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},unput:function(r){var s=r.length,t=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===o.length?this.yylloc.first_column:0)+o[o.length-t.length].length-t[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
794
+ Expecting `+ft.join(", ")+", got '"+(this.terminals_[z]||z)+"'":gt="Parse error on line "+(u+1)+": Unexpected "+(z==v?"end of input":"'"+(this.terminals_[z]||z)+"'"),this.parseError(gt,{text:w.match,token:this.terminals_[z]||z,line:w.yylineno,loc:M,expected:ft})}if(H[0]instanceof Array&&H.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+z);switch(H[0]){case 1:s.push(z),t.push(w.yytext),o.push(w.yylloc),s.push(H[1]),z=null,b=w.yyleng,d=w.yytext,u=w.yylineno,M=w.yylloc;break;case 2:if(ee=this.productions_[H[1]][1],be.$=t[t.length-ee],be._$={first_line:o[o.length-(ee||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(ee||1)].first_column,last_column:o[o.length-1].last_column},D&&(be._$.range=[o[o.length-(ee||1)].range[0],o[o.length-1].range[1]]),dt=this.performAction.apply(be,[d,b,u,S.yy,H[1],t,o].concat(A)),typeof dt<"u")return dt;ee&&(s=s.slice(0,-1*ee*2),t=t.slice(0,-1*ee),o=o.slice(0,-1*ee)),s.push(this.productions_[H[1]][0]),t.push(be.$),o.push(be._$),cr=a[s[s.length-2]][s[s.length-1]],s.push(cr);break;case 3:return!0}}return!0}},lo=function(){var i={EOF:1,parseError:function(r,s){if(this.yy.parser)this.yy.parser.parseError(r,s);else throw new Error(r)},setInput:function(r,s){return this.yy=s||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var s=r.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},unput:function(r){var s=r.length,t=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1);var a=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===o.length?this.yylloc.first_column:0)+o[o.length-t.length].length-t[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[a[0],a[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
794
795
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(r){this.unput(this.match.slice(r))},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput(),s=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
795
796
  `+s+"^"},test_match:function(r,s){var t,o,a;if(this.options.backtrack_lexer&&(a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(a.yylloc.range=this.yylloc.range.slice(0))),o=r[0].match(/(?:\r\n?|\n).*/g),o&&(this.yylineno+=o.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:o?o[o.length-1].length-o[o.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],t=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t)return t;if(this._backtrack){for(var d in a)this[d]=a[d];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,s,t,o;this._more||(this.yytext="",this.match="");for(var a=this._currentRules(),d=0;d<a.length;d++)if(t=this._input.match(this.rules[a[d]]),t&&(!s||t[0].length>s[0].length)){if(s=t,o=d,this.options.backtrack_lexer){if(r=this.test_match(t,a[d]),r!==!1)return r;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(r=this.test_match(s,a[o]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
796
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r||this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},pushState:function(r){this.begin(r)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(r,s,t,o){switch(t){case 0:break;case 1:return 18;case 2:return 19;case 3:return 13;case 4:return 20;case 5:return 29;case 6:return 30;case 7:return 31;case 8:return 32;case 9:return 33;case 10:return 36;case 11:return 15;case 12:return 24;case 13:return 23;case 14:return 21;case 15:return 22;case 16:return 5;case 17:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:\()/,/^(?:\))/,/^(?:-?[0-9]+(\.[0-9]+)?([eE][\-\+]?[0-9]+)?)/,/^(?:POINT\b)/,/^(?:LINESTRING\b)/,/^(?:POLYGON\b)/,/^(?:MULTIPOINT\b)/,/^(?:MULTILINESTRING\b)/,/^(?:MULTIPOLYGON\b)/,/^(?:GEOMETRYCOLLECTION\b)/,/^(?:,)/,/^(?:EMPTY\b)/,/^(?:M\b)/,/^(?:Z\b)/,/^(?:ZM\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}};return i}();Lt.lexer=lo;function Ki(){this.yy={}}Ki.prototype=Lt,Lt.Parser=Ki,Lt.yy.parseError=function(i){throw i};function Nt(i){this.data=[i],this.type="PointArray"}Nt.prototype.addPoint=function(i){return i.type==="PointArray"?this.data=this.data.concat(i.data):this.data.push(i),this},Nt.prototype.toJSON=function(){return this.data};function Xi(i){this.data=i,this.type="Ring"}Xi.prototype.toJSON=function(){for(var i=[],e=0;e<this.data.data.length;e++)i.push(this.data.data[e]);return i};function Hr(i){this.data=[i],this.type="RingList"}Hr.prototype.addRing=function(i){return this.data.push(i),this},Hr.prototype.toJSON=function(){for(var i=[],e=0;e<this.data.length;e++)i.push(this.data[e].toJSON());return i.length===1,i};function Fr(i){this.data=[i],this.type="GeometryList"}Fr.prototype.addGeometry=function(i){return this.data.push(i),this},Fr.prototype.toJSON=function(){return this.data};function Qr(i){this.data=[i],this.type="PolygonList"}Qr.prototype.addPolygon=function(i){return this.data.push(i),this},Qr.prototype.toJSON=function(){for(var i=[],e=0;e<this.data.length;e++)i=i.concat([this.data[e].toJSON()]);return i};var es=function(e){var r;try{r=Lt.parse(e)}catch(s){throw Error("Unable to parse: "+s)}return r};function co(i){const[e,r,s]=i.arguments;return{bool:{must:[{exists:{field:e.value}},{geo_shape:{[e.value]:{relation:r,shape:es(s.value)}}}]}}}const qr={is:Un,and:Qn,or:Wn,not:Zn,range:to,exists:so,nested:ao,geospatial:Object.freeze(Object.defineProperty({__proto__:null,toOpenSearchQuery:co},Symbol.toStringTag,{value:"Module"}))};function uo(i,...e){const r=qr[i];if(r===void 0)throw new Error(`Unknown function "${i}"`);return{type:"function",function:i,...r.buildNodeParams(...e)}}function po(i,e){if(qr[i]===void 0)throw new Error(`Unknown function "${i}"`);return{type:"function",function:i,arguments:e}}function ho(i,e,r,s){return qr[i.function].toOpenSearchQuery(i,e,r,s)}const fo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:uo,buildNodeWithArgumentNodes:po,toOpenSearchQuery:ho},Symbol.toStringTag,{value:"Module"}));function go(i,e){const r=e.type==="literal"?e:le.literal.buildNode(e);return{type:"namedArg",name:i,value:r}}function bo(i){return Q(i.value)}const le={function:fo,literal:Tn,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:go,toOpenSearchQuery:bo},Symbol.toStringTag,{value:"Module"})),wildcard:Rn},vo=oe,yo=(i,e)=>"("+(i.arguments||[]).map(s=>Ie(s,e)).join(" AND ")+")",mo=(i,e)=>{var{arguments:[r,s,t]}=i;let o="=";s.type==="wildcard"&&(o="");let a=Ie(s);t=t.value||typeof a=="string",s.type==="literal"&&t&&(a=`'${a}'`),s.type==="literal"&&!t&&(a=`${a}`);let d=Ie(r);return d==null?e&&t?`(${e.filter(c=>c.type==="string").map(c=>`${c.name} ILIKE '%${s.value}%'`).join(" OR ")})`:e&&!t&&(s.value===!0||s.value===!1)?`(${e.filter(c=>c.type==="boolean").map(c=>`${c.name}=${s.value}`).join(" OR ")})`:"":d+o+a},$o=(i,e)=>"("+(i.arguments||[]).map(s=>Ie(s,e)).join(" OR ")+")",_o=(i,e)=>{const[r]=i.arguments;return"NOT ("+Ie(r,e)+")"},wo={gt:">",lt:"<",gte:">=",lte:"<="},So={is:mo,and:yo,or:$o,not:_o,range:i=>{const[e,r]=i.arguments;let s=r.value;const t=wo[r.name];let o=Ie(s);return s.type==="literal"&&(o=`${o}`),`${e.value} ${t} ${o}`},exists:i=>{const[e]=i.arguments;return`${e.value} IS NOT NULL`},nested:i=>(console.warn("Nested types dont exist in CQL",i),""),geospatial:i=>{const[e,r,s]=i.arguments;if(console.log(e,r,s),r==="within")return`WITHIN(${e.value},${s.value})`;throw Error(`Unsupported GEO Operator:${r}`)}},xo={function:(i,e)=>So[i.function](i,e),literal:i=>i.value,wildcard:i=>{const{value:e}=i;return` LIKE '${e.split(vo).join("%")}'`}},Ie=(i,e)=>{const r=xo[i.type];return r(i,e)},ko=oe,Eo=i=>({$and:(i.arguments||[]).map(s=>_e(s))}),Ao=i=>{const{arguments:[e,r]}=i;let s=_e(r);if(r.type==="wildcard"&&r.value==="@kuery-wildcard@")return ts(i);let o={};return o[_e(e)]={$eq:s},o},Co=i=>({$or:(i.arguments||[]).map(r=>_e(r))}),Oo=i=>{const[e]=i.arguments;let r={};return r={$ne:_e(e)},r},Po={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},To=i=>{const[e,r]=i.arguments;let s=r.value;const t=Po[r.name];let o=_e(s),a={};return a[e.value]={},a[e.value][t]=o,a},ts=i=>{const[e]=i.arguments;return{[_e(e)]:{$ne:null}}},Lo={is:Ao,and:Eo,or:Co,not:Oo,range:To,exists:ts,nested:i=>(console.warn("TODO Implement nested search",i),""),geospatial:i=>{const[e,r,s]=i.arguments;if(r=="within")return{[e.value]:{$geoWithin:es(s.value)}}}},No={function:i=>Lo[i.function](i),literal:i=>i.value,wildcard:i=>{const{value:e}=i;return`/${e.split(ko).join(".*")}/`}},_e=(i,e)=>{const r=No[i.type];return r(i,e)},Do=oe,Mo=(i,e)=>{const r=i.arguments||[];let s="<span class='and-expression'>"+r.map(t=>we(t,e)).join(" AND ")+"</span>";if(i.group!==void 0){try{let{fieldName:t,values:o}=Wr(r);return`<span class="or-expression">${t}:(${o.join(" OR ")})</span>`}catch(t){console.log(t)}return`( ${s} )`}return s},zo=(i,e)=>{const r=i.arguments||[];let t=`<span class="or-expression">${r.map(o=>we(o,e)).join(" OR ")}</span>`;if(i.group!==void 0){try{let{fieldName:o,values:a}=Wr(r);return`<span class="or-expression">${o}:(${a.join(" OR ")})</span>`}catch(o){console.log(o)}return`( ${t} )`}return t},rs=(i,e,r,s)=>{var o;let t=we(e);return r.value&&(t=`"${t}"`),s&&((o=s.find(a=>a.name===i))==null?void 0:o.type)==="boolean"&&(t=`<span class="value-constant">${e.value}</span>`),`<span class="expression-value">${t}</span>`},Vr=i=>`<span class="field-name">${we(i)}</span>`,Io=(i,e)=>{var{arguments:[r,s,t]}=i;let o=":",a=Vr(r),d=rs(a,s,t,e);return`<span class="is-expression">${a}${o}${d}</span>`},Ro=(i,e)=>{const[r]=i.arguments;return`<span class="not-expression">not ${we(r,e)}</span>`},Wr=(i,e=void 0,r)=>{let s=[];if(!e&&i[0].function=="is"&&(e=Vr(i[0].arguments[0])),!e)throw Error("Cannot group variables because they don't have a groupable field");for(let d of i){var{arguments:[t,o,a]}=d;if(d.function=="is"){if(Vr(t)!==e)throw Error("Cannot group variables because they aren't for the same field");let c=rs(e,o,a,r);s.push(c)}else if(d.function==="or"||d.function==="and"){let c=Wr(d.arguments,e,r);s.push(...c.values)}else throw Error("Cannot group variables because they aren't for the same field")}return{fieldName:e,values:s}},jo={gt:">",lt:"<",gte:">=",lte:"<="},Bo={is:Io,and:Mo,or:zo,not:Ro,range:i=>{const[e,r]=i.arguments;let s=r.value;const t=jo[r.name];let o=we(s);return s.type==="literal"&&(o=`${o}`),Number.isNaN(parseFloat(o))&&(o=`<span class="expression-value">"${o}"</span>`),`<span class="range-expression"><span class="field-name">${e.value}</span> ${t} <span class="field-numeric">${o}</span></span>`},exists:i=>{const[e]=i.arguments;return`<span class="exists-expression"><span class="field-name">${e.value}</span>: *</span>`},nested:i=>(console.warn("Nested types dont exist in CQL",i),""),geospatial:i=>{const[e,r,s]=i.arguments;console.log(e,r,s);let t=sr[r].value;return`<span><span class="field-name">${e.value}</span> ${t}<span title="${s.value}">--GEOMETRY--</span></span>`}},Uo={function:(i,e)=>Bo[i.function](i,e),literal:i=>i.value,wildcard:i=>{const{value:e}=i;return`<span class="wild-card">${e.split(Do).join("*")}</span>`}},we=(i,e)=>{const r=Uo[i.type];return r(i,e)},Ho=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:Yi,doesKueryExpressionHaveLuceneSyntaxError:Ln,fromKueryExpression:er,fromLiteralExpression:Xe,nodeTypes:le,parse:er,toCql:Ie,toDSL:Q,toHTML:we,toMongo:_e,toOpenSearchQuery:Q},Symbol.toStringTag,{value:"Module"})),Fo=J`
797
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r||this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},pushState:function(r){this.begin(r)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(r,s,t,o){switch(t){case 0:break;case 1:return 18;case 2:return 19;case 3:return 13;case 4:return 20;case 5:return 29;case 6:return 30;case 7:return 31;case 8:return 32;case 9:return 33;case 10:return 36;case 11:return 15;case 12:return 24;case 13:return 23;case 14:return 21;case 15:return 22;case 16:return 5;case 17:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:\()/,/^(?:\))/,/^(?:-?[0-9]+(\.[0-9]+)?([eE][\-\+]?[0-9]+)?)/,/^(?:POINT\b)/,/^(?:LINESTRING\b)/,/^(?:POLYGON\b)/,/^(?:MULTIPOINT\b)/,/^(?:MULTILINESTRING\b)/,/^(?:MULTIPOLYGON\b)/,/^(?:GEOMETRYCOLLECTION\b)/,/^(?:,)/,/^(?:EMPTY\b)/,/^(?:M\b)/,/^(?:Z\b)/,/^(?:ZM\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}};return i}();Nt.lexer=lo;function Ki(){this.yy={}}Ki.prototype=Nt,Nt.Parser=Ki,Nt.yy.parseError=function(i){throw i};function Dt(i){this.data=[i],this.type="PointArray"}Dt.prototype.addPoint=function(i){return i.type==="PointArray"?this.data=this.data.concat(i.data):this.data.push(i),this},Dt.prototype.toJSON=function(){return this.data};function Xi(i){this.data=i,this.type="Ring"}Xi.prototype.toJSON=function(){for(var i=[],e=0;e<this.data.data.length;e++)i.push(this.data.data[e]);return i};function Fr(i){this.data=[i],this.type="RingList"}Fr.prototype.addRing=function(i){return this.data.push(i),this},Fr.prototype.toJSON=function(){for(var i=[],e=0;e<this.data.length;e++)i.push(this.data[e].toJSON());return i.length===1,i};function Qr(i){this.data=[i],this.type="GeometryList"}Qr.prototype.addGeometry=function(i){return this.data.push(i),this},Qr.prototype.toJSON=function(){return this.data};function qr(i){this.data=[i],this.type="PolygonList"}qr.prototype.addPolygon=function(i){return this.data.push(i),this},qr.prototype.toJSON=function(){for(var i=[],e=0;e<this.data.length;e++)i=i.concat([this.data[e].toJSON()]);return i};var es=function(e){var r;try{r=Nt.parse(e)}catch(s){throw Error("Unable to parse: "+s)}return r};function co(i){const[e,r,s]=i.arguments;return{bool:{must:[{exists:{field:e.value}},{geo_shape:{[e.value]:{relation:r,shape:es(s.value)}}}]}}}const Vr={is:Un,and:Qn,or:Wn,not:Zn,range:to,exists:so,nested:ao,geospatial:Object.freeze(Object.defineProperty({__proto__:null,toOpenSearchQuery:co},Symbol.toStringTag,{value:"Module"}))};function uo(i,...e){const r=Vr[i];if(r===void 0)throw new Error(`Unknown function "${i}"`);return{type:"function",function:i,...r.buildNodeParams(...e)}}function po(i,e){if(Vr[i]===void 0)throw new Error(`Unknown function "${i}"`);return{type:"function",function:i,arguments:e}}function ho(i,e,r,s){return Vr[i.function].toOpenSearchQuery(i,e,r,s)}const fo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:uo,buildNodeWithArgumentNodes:po,toOpenSearchQuery:ho},Symbol.toStringTag,{value:"Module"}));function go(i,e){const r=e.type==="literal"?e:ce.literal.buildNode(e);return{type:"namedArg",name:i,value:r}}function bo(i){return Q(i.value)}const ce={function:fo,literal:Tn,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:go,toOpenSearchQuery:bo},Symbol.toStringTag,{value:"Module"})),wildcard:Rn},vo=ae,yo=(i,e)=>"("+(i.arguments||[]).map(s=>Re(s,e)).join(" AND ")+")",mo=(i,e)=>{var{arguments:[r,s,t]}=i;let o="=";s.type==="wildcard"&&(o="");let a=Re(s);t=t.value||typeof a=="string",s.type==="literal"&&t&&(a=`'${a}'`),s.type==="literal"&&!t&&(a=`${a}`);let d=Re(r);return d==null?e&&t?`(${e.filter(u=>u.type==="string").map(u=>`${u.name} ILIKE '%${s.value}%'`).join(" OR ")})`:e&&!t&&(s.value===!0||s.value===!1)?`(${e.filter(u=>u.type==="boolean").map(u=>`${u.name}=${s.value}`).join(" OR ")})`:"":d+o+a},$o=(i,e)=>"("+(i.arguments||[]).map(s=>Re(s,e)).join(" OR ")+")",_o=(i,e)=>{const[r]=i.arguments;return"NOT ("+Re(r,e)+")"},wo={gt:">",lt:"<",gte:">=",lte:"<="},So={is:mo,and:yo,or:$o,not:_o,range:i=>{const[e,r]=i.arguments;let s=r.value;const t=wo[r.name];let o=Re(s);return s.type==="literal"&&(o=`${o}`),`${e.value} ${t} ${o}`},exists:i=>{const[e]=i.arguments;return`${e.value} IS NOT NULL`},nested:i=>(console.warn("Nested types dont exist in CQL",i),""),geospatial:i=>{const[e,r,s]=i.arguments;if(console.log(e,r,s),r==="within")return`WITHIN(${e.value},${s.value})`;throw Error(`Unsupported GEO Operator:${r}`)}},xo={function:(i,e)=>So[i.function](i,e),literal:i=>i.value,wildcard:i=>{const{value:e}=i;return` LIKE '${e.split(vo).join("%")}'`}},Re=(i,e)=>{const r=xo[i.type];return r(i,e)},ko=ae,Eo=i=>({$and:(i.arguments||[]).map(s=>_e(s))}),Ao=i=>{const{arguments:[e,r]}=i;let s=_e(r);if(r.type==="wildcard"&&r.value==="@kuery-wildcard@")return ts(i);let o={};return o[_e(e)]={$eq:s},o},Co=i=>({$or:(i.arguments||[]).map(r=>_e(r))}),Oo=i=>{const[e]=i.arguments;let r={};return r={$ne:_e(e)},r},Po={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},To=i=>{const[e,r]=i.arguments;let s=r.value;const t=Po[r.name];let o=_e(s),a={};return a[e.value]={},a[e.value][t]=o,a},ts=i=>{const[e]=i.arguments;return{[_e(e)]:{$ne:null}}},Lo={is:Ao,and:Eo,or:Co,not:Oo,range:To,exists:ts,nested:i=>(console.warn("TODO Implement nested search",i),""),geospatial:i=>{const[e,r,s]=i.arguments;if(r=="within")return{[e.value]:{$geoWithin:es(s.value)}}}},No={function:i=>Lo[i.function](i),literal:i=>i.value,wildcard:i=>{const{value:e}=i;return`/${e.split(ko).join(".*")}/`}},_e=(i,e)=>{const r=No[i.type];return r(i,e)},Do=ae,Mo=(i,e)=>{const r=i.arguments||[];let s="<span class='and-expression'>"+r.map(t=>we(t,e)).join(" AND ")+"</span>";if(i.group!==void 0){try{let{fieldName:t,values:o}=Wr(r),a=":";return t===lt({type:"literal",value:null})&&(t="",a=""),`<span class="and-expression">${t}${a}(${o.join(" AND ")})</span>`}catch(t){console.log(t)}return`( ${s} )`}return s},zo=(i,e)=>{const r=i.arguments||[];let t=`<span class="or-expression">${r.map(o=>we(o,e)).join(" OR ")}</span>`;if(i.group!==void 0){try{let{fieldName:o,values:a}=Wr(r),d=":";return o===lt({type:"literal",value:null})&&(o="",d=""),`<span class="or-expression">${o}${d}(${a.join(" OR ")})</span>`}catch(o){console.log(o)}return`( ${t} )`}return t},rs=(i,e,r,s)=>{var o;let t=we(e);return r.value&&(t=`"${t}"`),s&&((o=s.find(a=>a.name===i))==null?void 0:o.type)==="boolean"&&(t=`<span class="value-constant">${e.value}</span>`),`<span class="expression-value">${t}</span>`},lt=i=>`<span class="field-name">${we(i)}</span>`,Io=(i,e)=>{var{arguments:[r,s,t]}=i;let o=":",a=lt(r);a===lt({type:"literal",value:null})&&(a="",o="");let d=rs(a,s,t,e);return`<span class="is-expression">${a}${o}${d}</span>`},Ro=(i,e)=>{const[r]=i.arguments;return`<span class="not-expression">not ${we(r,e)}</span>`},Wr=(i,e=void 0,r)=>{let s=[];if(!e&&i[0].function=="is"&&(e=lt(i[0].arguments[0])),!e)throw Error("Cannot group variables because they don't have a groupable field");for(let d of i){var{arguments:[t,o,a]}=d;if(d.function=="is"){if(lt(t)!==e)throw Error("Cannot group variables because they aren't for the same field");let u=rs(e,o,a,r);s.push(u)}else if(d.function==="or"||d.function==="and"){let u=Wr(d.arguments,e,r);s.push(...u.values)}else throw Error("Cannot group variables because they aren't for the same field")}return{fieldName:e,values:s}},jo={gt:">",lt:"<",gte:">=",lte:"<="},Bo={is:Io,and:Mo,or:zo,not:Ro,range:i=>{const[e,r]=i.arguments;let s=r.value;const t=jo[r.name];let o=we(s);return s.type==="literal"&&(o=`${o}`),(Number.isNaN(parseFloat(o))||!o.match(/^[-+]?([0-9]*\.[0-9]+|[0-9]+(\.[0-9]*)?)$/))&&(o=`<span class="expression-value">"${o}"</span>`),`<span class="range-expression"><span class="field-name">${e.value}</span> ${t} <span class="field-numeric">${o}</span></span>`},exists:i=>{const[e]=i.arguments;return`<span class="exists-expression"><span class="field-name">${e.value}</span>: *</span>`},nested:i=>(console.warn("Nested types dont exist in CQL",i),""),geospatial:i=>{const[e,r,s]=i.arguments;console.log(e,r,s);let t=nr[r].value;return`<span><span class="field-name">${e.value}</span> ${t}<span title="${s.value}">--GEOMETRY--</span></span>`}},Uo={function:(i,e)=>Bo[i.function](i,e),literal:i=>i.value,wildcard:i=>{const{value:e}=i;return`<span class="wild-card">${e.split(Do).join("*")}</span>`}},we=(i,e)=>{const r=Uo[i.type];return r(i,e)},Ho=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:Yi,doesKueryExpressionHaveLuceneSyntaxError:Ln,fromKueryExpression:tr,fromLiteralExpression:et,nodeTypes:ce,parse:tr,toCql:Re,toDSL:Q,toHTML:we,toMongo:_e,toOpenSearchQuery:Q},Symbol.toStringTag,{value:"Module"})),Fo=J`
797
798
  :host {
798
799
  --dialog-padding: var(--spectric-dialog-padding, 5px);
799
800
  --dialog-background: var(--spectric-background, rgb(246, 249, 252));
@@ -881,7 +882,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
881
882
  :host(spectric-panel[level='3']) {
882
883
  ${ss};
883
884
  }
884
- `;var qo=Object.defineProperty,Vo=Object.getOwnPropertyDescriptor,Gr=(i,e,r,s)=>{for(var t=s>1?void 0:s?Vo(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&qo(e,r,t),t};h.SpectricPanel=class extends ie{constructor(){super(),this.level=0,this.addDisposableListener(this,"layer-add",()=>{this.layers=this.querySelectorAll("spectric-panel")},{capture:!0})}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("layer-add",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}update(e){this.layers=this.querySelectorAll("spectric-panel"),this.layers.forEach(r=>{r.setAttribute("level",((this.level+1)%4).toString())}),super.update(e)}render(){return $` <slot></slot> `}},h.SpectricPanel.styles=Qo,Gr([g({type:Number,reflect:!0})],h.SpectricPanel.prototype,"level",2),Gr([g({attribute:!1})],h.SpectricPanel.prototype,"layers",2),h.SpectricPanel=Gr([I("spectric-panel")],h.SpectricPanel);var Wo=Object.defineProperty,Go=Object.getOwnPropertyDescriptor,Se=(i,e,r,s)=>{for(var t=s>1?void 0:s?Go(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Wo(e,r,t),t};const ir="spectric-dialog";h.DialogElement=class extends B{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async e=>{const r=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||r===e.target&&(this.open=!1)},this._handleKeyDown=e=>{this.closeOnEscape||e.preventDefault(),this.open&&this.closeOnEscape&&e.key==="Escape"&&(this.open=!1)},this._onClose=e=>{e.preventDefault(),e.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(e,r){let s=document.createElement(ir);s.addEventListener("close",()=>{s.remove()});for(let o in e)s[o]=e[o];let t=document.createDocumentFragment();return Vt(r,t),s.appendChild(t),s.open=!0,document.body.appendChild(s),s}connectedCallback(){super.connectedCallback(),this.dialogElement.then(e=>e.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(e=>e.removeEventListener("keydown",this._handleKeyDown))}updated(e){e.has("open")&&this.dialogElement.then(r=>{this.open?r.showModal():r.close()})}render(){return $`
885
+ `;var qo=Object.defineProperty,Vo=Object.getOwnPropertyDescriptor,Gr=(i,e,r,s)=>{for(var t=s>1?void 0:s?Vo(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&qo(e,r,t),t};h.SpectricPanel=class extends se{constructor(){super(),this.level=0,this.addDisposableListener(this,"layer-add",()=>{this.layers=this.querySelectorAll("spectric-panel")},{capture:!0})}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("layer-add",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}update(e){this.layers=this.querySelectorAll("spectric-panel"),this.layers.forEach(r=>{r.setAttribute("level",((this.level+1)%4).toString())}),super.update(e)}render(){return _` <slot></slot> `}},h.SpectricPanel.styles=Qo,Gr([g({type:Number,reflect:!0})],h.SpectricPanel.prototype,"level",2),Gr([g({attribute:!1})],h.SpectricPanel.prototype,"layers",2),h.SpectricPanel=Gr([R("spectric-panel")],h.SpectricPanel);var Wo=Object.defineProperty,Go=Object.getOwnPropertyDescriptor,Se=(i,e,r,s)=>{for(var t=s>1?void 0:s?Go(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Wo(e,r,t),t};const sr="spectric-dialog";h.DialogElement=class extends B{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async e=>{const r=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||r===e.target&&(this.open=!1)},this._handleKeyDown=e=>{this.closeOnEscape||e.preventDefault(),this.open&&this.closeOnEscape&&e.key==="Escape"&&(this.open=!1)},this._onClose=e=>{e.preventDefault(),e.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(e,r){let s=document.createElement(sr);s.addEventListener("close",()=>{s.remove()});for(let o in e)s[o]=e[o];let t=document.createDocumentFragment();return Wt(r,t),s.appendChild(t),s.open=!0,document.body.appendChild(s),s}connectedCallback(){super.connectedCallback(),this.dialogElement.then(e=>e.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(e=>e.removeEventListener("keydown",this._handleKeyDown))}updated(e){e.has("open")&&this.dialogElement.then(r=>{this.open?r.showModal():r.close()})}render(){return _`
885
886
  <dialog
886
887
  class=${this.hideBackdrop?"":"backdrop"}
887
888
  @close=${this._onClose}
@@ -889,7 +890,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
889
890
  >
890
891
  <spectric-panel>
891
892
  <div class="modal">
892
- ${this.dismissable?$`<spectric-button
893
+ ${this.dismissable?_`<spectric-button
893
894
  variant="text"
894
895
  size="xsmall"
895
896
  @click=${()=>{this.open=!1}}
@@ -907,9 +908,9 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
907
908
  </div>
908
909
  </spectric-panel>
909
910
  </dialog>
910
- `}},h.DialogElement.styles=Fo,Se([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"open",2),Se([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"dismissable",2),Se([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"hideBackdrop",2),Se([g({type:String,reflect:!0})],h.DialogElement.prototype,"title",2),Se([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnEscape",2),Se([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnOutsideClick",2),Se([At("dialog")],h.DialogElement.prototype,"dialogElement",2),h.DialogElement=Se([I(ir)],h.DialogElement);const ns=async i=>{let e,r=Ge();return await new Promise(s=>{let t=h.DialogElement.display({},$`
911
+ `}},h.DialogElement.styles=Fo,Se([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"open",2),Se([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"dismissable",2),Se([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"hideBackdrop",2),Se([g({type:String,reflect:!0})],h.DialogElement.prototype,"title",2),Se([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnEscape",2),Se([g({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnOutsideClick",2),Se([Ct("dialog")],h.DialogElement.prototype,"dialogElement",2),h.DialogElement=Se([R(sr)],h.DialogElement);const ns=async i=>{let e,r=Ye();return await new Promise(s=>{let t=h.DialogElement.display({},_`
911
912
  <div class="query-bar-date-quick-select">
912
- ${i.map(o=>{let a=Dt(o);return $`<a
913
+ ${i.map(o=>{let a=Mt(o);return _`<a
913
914
  href="#"
914
915
  @click=${d=>{d.preventDefault(),e=`"${a.label}"`,s(e),t.open=!1}}
915
916
  >${a.value}</a
@@ -920,14 +921,14 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
920
921
  @change=${o=>{if(!o.target)return;e=`"${new Date(o.target.value+":00.000Z").toISOString()}"`,r.value.disabled=e===void 0}}
921
922
  ></spectric-input>
922
923
  <spectric-button
923
- ${Ye(r)}
924
+ ${Ze(r)}
924
925
  .disabled=${!0}
925
926
  @click=${()=>{s(e),t.open=!1}}
926
927
  >Submit</spectric-button
927
928
  >
928
- `)}),e},os=async i=>{let e,r=Ge();return await new Promise(s=>{let t=h.DialogElement.display({},$`
929
+ `)}),e},os=async i=>{let e,r=Ye();return await new Promise(s=>{let t=h.DialogElement.display({},_`
929
930
  <div class="query-bar-date-quick-select">
930
- ${i.map(o=>{let a=Dt(o);return $`<a
931
+ ${i.map(o=>{let a=Mt(o);return _`<a
931
932
  href="#"
932
933
  @click=${d=>{d.preventDefault(),e=`"${a.value}"`,s(e),t.open=!1}}
933
934
  >${a.label}</a
@@ -935,7 +936,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
935
936
  </div>
936
937
  <div>TODO DISPLAY MAP with drawing tools HERE!!</div>
937
938
  <spectric-button
938
- ${Ye(r)}
939
+ ${Ze(r)}
939
940
  .disabled=${!0}
940
941
  @click=${()=>{s(e),t.open=!1}}
941
942
  >Submit</spectric-button
@@ -944,7 +945,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
944
945
  * @license
945
946
  * Copyright 2017 Google LLC
946
947
  * SPDX-License-Identifier: BSD-3-Clause
947
- */class Yr extends Et{constructor(e){if(super(e),this.it=L,e.type!==Wt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===L||e==null)return this._t=void 0,this.it=e;if(e===he)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}}Yr.directiveName="unsafeHTML",Yr.resultType=1;const ta=We(Yr);var ra=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,G=(i,e,r,s)=>{for(var t=s>1?void 0:s?ia(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&ra(e,r,t),t},Zr=(i=>(i.MONGO="toMongo",i.CQL="toCql",i.DSL="toDSL",i.AST="AST",i))(Zr||{});const Dt=i=>typeof i=="string"?{label:i,value:i}:{label:i.label||i.value,value:i.value},as={eq:{value:" : ",label:" equals some value"},gt:{value:" > ",label:" is greater than some value"},lt:{value:" < ",label:" is less than some value"},gte:{value:" >= ",label:" is greater than or equal to some value"},lte:{value:" <= ",label:" is less than or equal to some value"}},sr={within:{value:" <@ ",label:" is contained within geometry"}},sa={exists:{value:": *",label:" exists in any form"}},na={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},oa=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],aa=Object.fromEntries(Object.entries(as).map(([i,e])=>[i,{value:e.value,label:(e.label||"").replace("value","date-time")}]));h.SpectricQuery=class extends B{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._checkClickLocation=async e=>{console.log(e);let r=null;try{r=this._getSuggestion()}catch(s){console.log(s)}r&&this._showValueHelper(r)},this._setValue=(e,r)=>{e!==void 0&&(this.value=this.value.substring(0,r.start)+e+this.value.substring(r.end),this._input.value=this.value,this._input.setSelectionRange(r.start+e.length,r.start+e.length),this._valueHelper&&this._valueHelper.hidePopover())},this._showValueHelper=async e=>{var o,a;if(this.valueHelper=void 0,!e||e.start===e.end)return;let r=this.fields.find(d=>d.name===e.fieldName);if(!r)return;let s=await this.getValuesForField(e.fieldName,e.prefix);r.format==="date-time"&&!s.length&&(s=["now-1m","now-1d","now-1M"]);let t;r.format=="date-time"?t=ns:r.format=="geojson"&&(t=os),!this.completions.length&&!((o=this._autocomplete)!=null&&o.isOpen())&&(this.valueHelper=$`<div>
948
+ */class Yr extends At{constructor(e){if(super(e),this.it=L,e.type!==Gt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===L||e==null)return this._t=void 0,this.it=e;if(e===he)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}}Yr.directiveName="unsafeHTML",Yr.resultType=1;const ta=Ge(Yr);var ra=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,G=(i,e,r,s)=>{for(var t=s>1?void 0:s?ia(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&ra(e,r,t),t},Zr=(i=>(i.MONGO="toMongo",i.CQL="toCql",i.DSL="toDSL",i.AST="AST",i))(Zr||{});const Mt=i=>typeof i=="string"?{label:i,value:i}:{label:i.label||i.value,value:i.value},as={eq:{value:" : ",label:" equals some value"},gt:{value:" > ",label:" is greater than some value"},lt:{value:" < ",label:" is less than some value"},gte:{value:" >= ",label:" is greater than or equal to some value"},lte:{value:" <= ",label:" is less than or equal to some value"}},nr={within:{value:" <@ ",label:" is contained within geometry"}},sa={exists:{value:": *",label:" exists in any form"}},na={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},oa=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],aa=Object.fromEntries(Object.entries(as).map(([i,e])=>[i,{value:e.value,label:(e.label||"").replace("value","date-time")}]));h.SpectricQuery=class extends B{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._checkClickLocation=async e=>{var s;console.log(e);let r=null;try{r=this._getSuggestion()}catch(t){console.log(t),(s=this._autocomplete)==null||s.hidePopover()}r&&this._showValueHelper(r)},this._setValue=(e,r)=>{e!==void 0&&(this.value=this.value.substring(0,r.start)+e+this.value.substring(r.end),this._input.value=this.value,this._input.setSelectionRange(r.start+e.length,r.start+e.length),this._valueHelper&&this._valueHelper.hidePopover())},this._showValueHelper=async e=>{var a,d;if(this.valueHelper=void 0,!e||e.start===e.end)return;let s=(this.fields||[]).find(u=>u.name===e.fieldName);if(!s)return;let t=await this.getValuesForField(e.fieldName,e.prefix);s.format==="date-time"&&!t.length&&(t=["now-1m","now-1d","now-1M"]);let o;s.format=="date-time"?o=ns:s.format=="geojson"&&(o=os),!this.completions.length&&!((a=this._autocomplete)!=null&&a.isOpen())&&(this.valueHelper=_`<div>
948
949
  <spectric-button
949
950
  tooltip="Delete Value"
950
951
  tooltipPosition="top"
@@ -953,25 +954,27 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
953
954
  @click=${()=>{this._setValue("",e)}}
954
955
  >${Zo}</spectric-button
955
956
  >
956
- ${t?$`<spectric-button
957
+ ${o?_`<spectric-button
957
958
  icon
958
959
  tooltip="Edit Value"
959
960
  tooltipPosition="top"
960
961
  size="xsmall"
961
- @click=${async()=>{this._setValue(await t(s),e)}}
962
+ @click=${async()=>{this._setValue(await o(t),e)}}
962
963
  >${Yo}</spectric-button
963
964
  >`:null}
964
- </div>`,(a=this._valueHelper)==null||a.showPopover())},this._getSuggestion=()=>{let e=this.value;this._input.selectionStart!==null&&(e=e.substring(0,this._input.selectionStart)+"©kuery-cursor©"+e.substring(this._input.selectionStart));let r=er(e,{parseCursor:!0,cursorSymbol:"©kuery-cursor©",allowLeadingWildcards:!1});return this._showValueHelper(r),r},this._parseQuery=(e=void 0)=>{let r;if(e&&(e!=null&&e.currentTarget)&&(this.value=e.currentTarget.value),this.value)try{e&&e.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let o=this._getSuggestion();this.autoComplete(o)}catch{return}try{r=er(this.value,{allowLeadingWildcards:!1})}catch{return}let s;this.outputLanguage=="AST"?s=r:s=Ho[this.outputLanguage](r,this.fields);let t=new CustomEvent("change",{detail:s});this.value.trim().length?this.highlightedSyntax=ta(we(r,this.fields)):this.highlightedSyntax="",this.dispatchEvent(t)},this.getValuesForField=async(e,r)=>(console.log("getValuesForField isn't set no values returned",e,r),[]),this._selectCompletion=async()=>{var o;if(!this.suggestion)return;let e=this.completions[this.completionIndex],r=this.value.substring(0,e.start)+e.value,s=r.length,t=this.value.substring(e.end);if(e.value.includes(t)?this.value=r:this.value=r+this.value.substring(e.end),this._input.value=this.value,this._input.setSelectionRange(s,s),e.onSelect){let a=await e.onSelect();a!==void 0&&(a=String(a),this.value+=a,this._input.setSelectionRange(s+a.length,s+a.length))}(o=this._autocomplete)==null||o.hidePopover(),this.completionIndex=0,this.completions=[],setTimeout(()=>{this._parseQuery(),this._input.focus(),this._showValueHelper(this._getSuggestion())})},this._handleArrows=e=>{var r;e.key==="Escape"&&(this.completions=[]),(e.key=="ArrowLeft"||e.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(e.key)&&this.suggestion&&(e.preventDefault(),(e.key==="ArrowDown"||e.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),e.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(r=this._asyncAutocomplete)==null||r.then(s=>{let t=s.querySelector(".option.active");t&&t.scrollIntoView({block:"nearest"})}),e.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(e){var o,a;if(this.completions=[],e.type!=="cursor")return;let r=[];this.suggestion=e;let{start:s,end:t}=e;for(let d of e.suggestionTypes){if(d=="conjunction"&&e.text.endsWith(" ")&&r.push(...["and ","or "].map(c=>({type:d,value:c,start:t,end:t}))),d==="field"){let c=this.fields.filter(b=>b.name.includes(e.fieldName)||b.name.includes(e.prefix)).map(b=>[{type:d,value:b.name,start:s,end:t}]).flat();r.push(...c)}if(d==="operator"){let c=this.fields.find(b=>b.name===e.fieldName);c&&(["number","integer"].includes(c.type)?r.push(...Object.values(as).map(b=>({type:d,...b,start:t,end:t}))):c.type==="object"?(c.format=="geojson"&&r.push(...Object.values(sr).map(b=>({type:d,...b,start:t,end:t,onSelect:async()=>{let _=await this.getValuesForField(e.fieldName,e.prefix);return await os(_)}}))),r.push(...Object.values(sa).map(b=>({type:d,...b,start:t,end:t})))):c.type==="string"?c.format==="date-time"?r.push(...Object.values(aa).map(b=>({type:d,...b,start:t,end:t,onSelect:async()=>{let _=await this.getValuesForField(e.fieldName,e.prefix);return _.length===0&&(_=["now-1m","now-1d","now-1M"]),await ns(_)}}))):r.push(...Object.values(na).map(b=>({type:d,...b,start:t,end:t}))):c.type==="boolean"&&r.push(...oa.map(b=>({type:d,...b,start:t,end:t}))))}if(d==="value"){let c=this.fields.find(b=>b.name===e.fieldName);if(!(c&&c.type=="number"||(c==null?void 0:c.type)=="integer"))if(c&&c.type=="boolean")r.push({type:d,value:"true",start:s,end:t},{type:d,value:"false",start:s,end:t});else{console.log(`invoke callback to get values for ${e.fieldName}`);let b=await this.getValuesForField(e.fieldName,e.prefix);(c==null?void 0:c.type)==="string"&&(b=b.map(_=>`"${_}"`)),r.push(...b.map(Dt).map(_=>({type:d,value:_.value,start:s,end:t})))}}}if(this.completions=r,this.completions.length&&this._autocomplete){(o=this._valueHelper)==null||o.hidePopover();let{width:d}=this._input.getBoundingClientRect();this._autocomplete.maxWidth=d,this._autocomplete.showPopover(),this._autocomplete.style.width=`${d-15}px`;let c=this._autocomplete.querySelector("[popover]");c&&(c.style.width=`${d-15}px`)}else(a=this._autocomplete)==null||a.hidePopover()}updated(e){e.has("outputLanguage")&&this._parseQuery()}render(){return $`
965
+ </div>`,(d=this._valueHelper)==null||d.showPopover())},this._getSuggestion=()=>{let e=this.value;this._input.selectionStart!==null&&(e=e.substring(0,this._input.selectionStart)+"©kuery-cursor©"+e.substring(this._input.selectionStart));let r=tr(e,{parseCursor:!0,cursorSymbol:"©kuery-cursor©",allowLeadingWildcards:!1});return this._showValueHelper(r),r},this._parseQuery=(e=void 0)=>{var o;let r;if(e&&(e!=null&&e.currentTarget)&&(this.value=e.currentTarget.value),this.value)try{e&&e.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let a=this._getSuggestion();this.autoComplete(a)}catch{this.completions=[],(o=this._autocomplete)==null||o.hidePopover()}try{r=tr(this.value,{allowLeadingWildcards:!1})}catch{return}let s;this.outputLanguage=="AST"?s=r:s=Ho[this.outputLanguage||"toDSL"](r,this.fields);let t=new CustomEvent("change",{detail:s});this.value.trim().length?this.highlightedSyntax=ta(we(r,this.fields)):this.highlightedSyntax="",this.dispatchEvent(t)},this.getValuesForField=async(e,r)=>(console.log("getValuesForField isn't set no values returned",e,r),[]),this._selectCompletion=async()=>{var o;if(!this.suggestion)return;let e=this.completions[this.completionIndex],r=this.value.substring(0,e.start)+e.value,s=r.length,t=this.value.substring(e.end);if(e.value.includes(t)?this.value=r:this.value=r+this.value.substring(e.end),this._input.value=this.value,this._input.setSelectionRange(s,s),e.onSelect){let a=await e.onSelect();a!==void 0&&(a=String(a),this.value+=a,this._input.setSelectionRange(s+a.length,s+a.length))}(o=this._autocomplete)==null||o.hidePopover(),this.completionIndex=0,this.completions=[],setTimeout(()=>{this._parseQuery(),this._input.focus(),this._showValueHelper(this._getSuggestion())})},this._handleArrows=e=>{var r;e.key==="Escape"&&(this.completions=[]),(e.key=="ArrowLeft"||e.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(e.key)&&this.suggestion&&(e.preventDefault(),(e.key==="ArrowDown"||e.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),e.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(r=this._asyncAutocomplete)==null||r.then(s=>{let t=s.querySelector(".option.active");t&&t.scrollIntoView({block:"nearest"})}),e.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(e){var o,a;if(this.completions=[],e.type!=="cursor")return;let r=[];this.suggestion=e;let{start:s,end:t}=e;for(let d of e.suggestionTypes){d=="conjunction"&&e.text.endsWith(" ")&&r.push(...["and ","or "].map(b=>({type:d,value:b,start:t,end:t})));let u=this.fields||[];if(d==="field"){let b=u.filter(y=>y.name.includes(e.fieldName)||y.name.includes(e.prefix)).map(y=>[{type:d,value:y.name,start:s,end:t}]).flat();r.push(...b)}if(d==="operator"){let b=u.find(y=>y.name===e.fieldName);b&&(["number","integer"].includes(b.type)?r.push(...Object.values(as).map(y=>({type:d,...y,start:t,end:t}))):b.type==="object"?(b.format=="geojson"&&r.push(...Object.values(nr).map(y=>({type:d,...y,start:t,end:t,onSelect:async()=>{let v=await this.getValuesForField(e.fieldName,e.prefix);return await os(v)}}))),r.push(...Object.values(sa).map(y=>({type:d,...y,start:t,end:t})))):b.type==="string"?b.format==="date-time"?r.push(...Object.values(aa).map(y=>({type:d,...y,start:t,end:t,onSelect:async()=>{let v=await this.getValuesForField(e.fieldName,e.prefix);return v.length===0&&(v=["now-1m","now-1d","now-1M"]),await ns(v)}}))):r.push(...Object.values(na).map(y=>({type:d,...y,start:t,end:t}))):b.type==="boolean"&&r.push(...oa.map(y=>({type:d,...y,start:t,end:t}))))}if(d==="value"){let b=(this.fields||[]).find(y=>y.name===e.fieldName);if(!(b&&b.type=="number"||(b==null?void 0:b.type)=="integer"))if(b&&b.type=="boolean")r.push({type:d,value:"true",start:s,end:t},{type:d,value:"false",start:s,end:t});else{console.log(`invoke callback to get values for ${e.fieldName}`);let y=await this.getValuesForField(e.fieldName,e.prefix);(b==null?void 0:b.type)==="string"&&(y=y.map(v=>`"${v}"`)),r.push(...y.map(Mt).map(v=>({type:d,value:v.value,start:s,end:t})))}}}if(this.completions=r,this.completions.length&&this._autocomplete){(o=this._valueHelper)==null||o.hidePopover();let{width:d}=this._input.getBoundingClientRect();this._autocomplete.maxWidth=d,this._autocomplete.showPopover(),this._autocomplete.style.width=`${d-15}px`;let u=this._autocomplete.querySelector("[popover]");u&&(u.style.width=`${d-15}px`)}else(a=this._autocomplete)==null||a.hidePopover()}update(e){e.has("outputLanguage")&&this._parseQuery(),e.has("value")&&this._parseQuery(),super.update(e)}render(){return _`
965
966
  <div class="syntax-highlighter">${this.highlightedSyntax}</div>
966
967
  <spectric-input
967
968
  .value=${this.value}
968
969
  .placeholder=${this.placeholder}
969
970
  style=${`anchor-name:--${this.uuid};`}
970
971
  autocomplete="off"
972
+ .spellcheck=${!1}
971
973
  @input=${this._parseQuery}
972
974
  @keydown=${this._handleArrows}
973
975
  @change=${e=>e.stopPropagation()}
974
976
  @click=${this._checkClickLocation}
977
+ @blur=${()=>{var e;(e=this._autocomplete)==null||e.hidePopover()}}
975
978
  ></spectric-input>
976
979
  <spectric-popover
977
980
  class="valueHelper"
@@ -981,7 +984,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
981
984
  <spectric-popover
982
985
  position="bottom"
983
986
  class="autocomplete"
984
- .text=${this.completions.map((e,r)=>$`<div
987
+ .text=${this.completions.map((e,r)=>_`<div
985
988
  @click=${()=>{this.completionIndex=r,this._selectCompletion()}}
986
989
  class=${this.completionIndex==r?"option active":"option"}
987
990
  >
@@ -991,7 +994,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
991
994
  </div> `)}
992
995
  >
993
996
  </spectric-popover>
994
- `}},G([g({type:String,reflect:!0})],h.SpectricQuery.prototype,"placeholder",2),G([F()],h.SpectricQuery.prototype,"valueHelper",2),G([F()],h.SpectricQuery.prototype,"highlightedSyntax",2),G([g({type:String,reflect:!0})],h.SpectricQuery.prototype,"value",2),G([g({type:String,reflect:!0})],h.SpectricQuery.prototype,"outputLanguage",2),G([F()],h.SpectricQuery.prototype,"completions",2),G([F()],h.SpectricQuery.prototype,"completionIndex",2),G([g({type:Array,reflect:!0})],h.SpectricQuery.prototype,"fields",2),G([de(".autocomplete")],h.SpectricQuery.prototype,"_autocomplete",2),G([de(".valueHelper")],h.SpectricQuery.prototype,"_valueHelper",2),G([At(".autocomplete")],h.SpectricQuery.prototype,"_asyncAutocomplete",2),G([de("spectric-input")],h.SpectricQuery.prototype,"_input",2),h.SpectricQuery=G([I("spectric-query")],h.SpectricQuery);var la=Object.defineProperty,ca=Object.getOwnPropertyDescriptor,ls=(i,e,r,s)=>{for(var t=s>1?void 0:s?ca(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&la(e,r,t),t};const cs={"--primary":{control:"color"},"--secondary":{control:"color"},"--tertiary":{control:"color"},"--disabled":{control:"color"},"--background":{control:"color"},"--background-inverse":{control:"color"},"--text-primary":{control:"color"},"--text-secondary":{control:"color"},"--text-on-color":{control:"color"},"--border-radius":{control:"text"}},us={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},ps={...us,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},Jr={undefined:{},light:{},dark:us,spectric:ps,spectricFlat:{...ps,"--border-radius":"1px"}},hs=Object.fromEntries(Object.keys(Jr).map(i=>[i,i])),ds=["--spectric-background","--spectric-background-hover","--spectric-background-inverse","--spectric-background-inverse-hover","--spectric-border-radius","--spectric-primary","--spectric-secondary","--spectric-tertiary","--spectric-disabled","--panel-color","--panel-color-inverse","--spectric-border-disabled","--spectric-input-color","--spectric-input-bottom","--spectric-text-on-color","--spectric-text-on-color-disabled","--spectric-text-placeholder","--spectric-text-primary","--spectric-text-secondary","--spectric-button-separator","--spectric-button-primary","--spectric-button-secondary","--spectric-button-tertiary","--spectric-button-danger-primary","--spectric-button-danger-secondary","--spectric-button-danger-active","--spectric-button-primary-active","--spectric-button-secondary-active","--spectric-button-tertiary-active","--spectric-button-danger-hover","--spectric-button-primary-hover","--spectric-button-secondary-hover","--spectric-button-tertiary-hover","--spectric-text-on-color-disabled"],ua=`
997
+ `}},G([g({type:String,reflect:!0})],h.SpectricQuery.prototype,"placeholder",2),G([F()],h.SpectricQuery.prototype,"valueHelper",2),G([F()],h.SpectricQuery.prototype,"highlightedSyntax",2),G([g({type:String,reflect:!0})],h.SpectricQuery.prototype,"value",2),G([g({type:String,reflect:!0})],h.SpectricQuery.prototype,"outputLanguage",2),G([F()],h.SpectricQuery.prototype,"completions",2),G([F()],h.SpectricQuery.prototype,"completionIndex",2),G([g({type:Array,reflect:!0})],h.SpectricQuery.prototype,"fields",2),G([de(".autocomplete")],h.SpectricQuery.prototype,"_autocomplete",2),G([de(".valueHelper")],h.SpectricQuery.prototype,"_valueHelper",2),G([Ct(".autocomplete")],h.SpectricQuery.prototype,"_asyncAutocomplete",2),G([de("spectric-input")],h.SpectricQuery.prototype,"_input",2),h.SpectricQuery=G([R("spectric-query")],h.SpectricQuery);var la=Object.defineProperty,ca=Object.getOwnPropertyDescriptor,ls=(i,e,r,s)=>{for(var t=s>1?void 0:s?ca(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&la(e,r,t),t};const cs={"--primary":{control:"color"},"--secondary":{control:"color"},"--tertiary":{control:"color"},"--disabled":{control:"color"},"--background":{control:"color"},"--background-inverse":{control:"color"},"--text-primary":{control:"color"},"--text-secondary":{control:"color"},"--text-on-color":{control:"color"},"--border-radius":{control:"text"}},us={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},ps={...us,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},Jr={undefined:{},light:{},dark:us,spectric:ps,spectricFlat:{...ps,"--border-radius":"1px"}},hs=Object.fromEntries(Object.keys(Jr).map(i=>[i,i])),ds=["--spectric-background","--spectric-background-hover","--spectric-background-inverse","--spectric-background-inverse-hover","--spectric-border-radius","--spectric-primary","--spectric-secondary","--spectric-tertiary","--spectric-disabled","--panel-color","--panel-color-inverse","--spectric-border-disabled","--spectric-input-color","--spectric-input-bottom","--spectric-text-on-color","--spectric-text-on-color-disabled","--spectric-text-placeholder","--spectric-text-primary","--spectric-text-secondary","--spectric-button-separator","--spectric-button-primary","--spectric-button-secondary","--spectric-button-tertiary","--spectric-button-danger-primary","--spectric-button-danger-secondary","--spectric-button-danger-active","--spectric-button-primary-active","--spectric-button-secondary-active","--spectric-button-tertiary-active","--spectric-button-danger-hover","--spectric-button-primary-hover","--spectric-button-secondary-hover","--spectric-button-tertiary-hover","--spectric-text-on-color-disabled"],ua=`
995
998
  --spectric-background: var(--background,#ffffff);
996
999
  --spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
997
1000
  --spectric-background-inverse: var(--background-inverse,#f4f4f4);
@@ -1035,8 +1038,8 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1035
1038
  --spectric-button-disabled: #c6c6c6;
1036
1039
  color: var(--spectric-text-primary);
1037
1040
  `;h.SpectricThemeProvider=class extends B{constructor(){super(...arguments),this.theme="undefined"}updated(e){if(e.has("theme")&&this.theme!=e.get("theme")){const r={old:e.get("theme"),new:this.theme};this.dispatchEvent(new CustomEvent("theme-change",{detail:r,bubbles:!0,composed:!0}))}}render(){let e=Object.keys(Jr).includes(this.theme)?this.theme:"undefined",r=Object.entries(Jr[e]).map(s=>`${s[0]}:${s[1]};`).join(`
1038
- `);return $`
1039
- ${this.theme&&this.theme!=="light"?$`
1041
+ `);return _`
1042
+ ${this.theme&&this.theme!=="light"?_`
1040
1043
  <style>:host{
1041
1044
  ${r};
1042
1045
  ${ua}
@@ -1112,7 +1115,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1112
1115
  <slot></slot>
1113
1116
  `}},h.SpectricThemeProvider.styles=J`:host{
1114
1117
  display:contents;
1115
- }`,ls([g({reflect:!0})],h.SpectricThemeProvider.prototype,"theme",2),h.SpectricThemeProvider=ls([I("spectric-theme")],h.SpectricThemeProvider);const pa=J`
1118
+ }`,ls([g({reflect:!0})],h.SpectricThemeProvider.prototype,"theme",2),h.SpectricThemeProvider=ls([R("spectric-theme")],h.SpectricThemeProvider);const pa=J`
1116
1119
  :host {
1117
1120
  display: block;
1118
1121
  height: 100%;
@@ -1175,7 +1178,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1175
1178
  width: 5px;
1176
1179
  cursor: ew-resize;
1177
1180
  }
1178
- `;var ha=Object.defineProperty,da=Object.getOwnPropertyDescriptor,K=(i,e,r,s)=>{for(var t=s>1?void 0:s?da(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&ha(e,r,t),t},Kr=(i=>(i.horizontal="horizontal",i.vertical="vertical",i))(Kr||{});const Xr="spectric-splitview";h.SplitView=class extends ie{constructor(){super(),this.orientation="horizontal",this.percentage=50,this.invisible=!1,this.min=10,this.max=90,this.useSavedState=!0,this.isDragging=!1,this._error=!1,this._emitChange=()=>{let{percentage:r,orientation:s,invisible:t,min:o,max:a,useSavedState:d}=this,c=this.getAttribute("id");c&&this.useSavedState&&localStorage.setItem(`splitview-${c}`,String(r)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:s,percentage:r,invisible:t,min:o,max:a,useSavedState:d}}))},this._onMouseMove=Ot(r=>{if(this.isDragging){const s=this.getBoundingClientRect();let t,o;this.orientation==="horizontal"?(t=r.clientX-s.left,o=t/s.width*100):(t=r.clientY-s.top,o=t/s.height*100),o=Math.min(Math.max(o,this.min),this.max),this.percentage=o,this._emitChange()}}),this._assignSlot=r=>{if(!r.target)return;let t=r.target.assignedNodes().filter(o=>o instanceof HTMLElement);t.length>2&&console.log("cannot assign more than 2 elements to a split view"),t.forEach(o=>{if(this._panel1.assignedNodes().length===0){o.slot="panel1";return}if(this._panel2.assignedNodes().length===0){o.slot="panel2";return}this._error="Too many element assigned to split view splitter can only have a maximum of 2 children",console.warn("Too many element assigned to split view splitter can only have a maximum of 2 children")})};let e=this.getAttribute("id");if(e&&this.useSavedState){let r=localStorage.getItem(`splitview-${e}`);r&&(this.percentage=parseFloat(r))}this.addDisposableListener(this._splitter,"mousedown",()=>{this.isDragging=!0}),this.addDisposableListener(this._splitter,"dblclick",()=>{this.percentage=50,this._emitChange()}),this.addDisposableListener(document.body,"mousemove",this._onMouseMove),this.addDisposableListener(document.body,"mouseup",()=>{this.isDragging=!1})}updated(e){e.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return $`
1181
+ `;var ha=Object.defineProperty,da=Object.getOwnPropertyDescriptor,K=(i,e,r,s)=>{for(var t=s>1?void 0:s?da(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&ha(e,r,t),t},Kr=(i=>(i.horizontal="horizontal",i.vertical="vertical",i))(Kr||{});const Xr="spectric-splitview";h.SplitView=class extends se{constructor(){super(),this.orientation="horizontal",this.percentage=50,this.invisible=!1,this.min=10,this.max=90,this.useSavedState=!0,this.isDragging=!1,this._error=!1,this._emitChange=()=>{let{percentage:r,orientation:s,invisible:t,min:o,max:a,useSavedState:d}=this,u=this.getAttribute("id");u&&this.useSavedState&&localStorage.setItem(`splitview-${u}`,String(r)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:s,percentage:r,invisible:t,min:o,max:a,useSavedState:d}}))},this._onMouseMove=Pt(r=>{if(this.isDragging){const s=this.getBoundingClientRect();let t,o;this.orientation==="horizontal"?(t=r.clientX-s.left,o=t/s.width*100):(t=r.clientY-s.top,o=t/s.height*100),o=Math.min(Math.max(o,this.min),this.max),this.percentage=o,this._emitChange()}}),this._assignSlot=r=>{if(!r.target)return;let t=r.target.assignedNodes().filter(o=>o instanceof HTMLElement);t.length>2&&console.log("cannot assign more than 2 elements to a split view"),t.forEach(o=>{if(this._panel1.assignedNodes().length===0){o.slot="panel1";return}if(this._panel2.assignedNodes().length===0){o.slot="panel2";return}this._error="Too many element assigned to split view splitter can only have a maximum of 2 children",console.warn("Too many element assigned to split view splitter can only have a maximum of 2 children")})};let e=this.getAttribute("id");if(e&&this.useSavedState){let r=localStorage.getItem(`splitview-${e}`);r&&(this.percentage=parseFloat(r))}this.addDisposableListener(this._splitter,"mousedown",()=>{this.isDragging=!0}),this.addDisposableListener(this._splitter,"dblclick",()=>{this.percentage=50,this._emitChange()}),this.addDisposableListener(document.body,"mousemove",this._onMouseMove),this.addDisposableListener(document.body,"mouseup",()=>{this.isDragging=!1})}updated(e){e.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return _`
1179
1182
  <div class="split-view ${this.orientation} ${this._error?"error":""} ${this.isDragging?"active":""}" style="--split-percentage: ${this.percentage}%;">
1180
1183
  <span class="error-display">${this._error}</span>
1181
1184
  <div class="panel" style="${this.orientation==="horizontal"?"flex: var(--split-percentage, 50%)":"max-height: var(--split-percentage, 50%)"}">
@@ -1187,7 +1190,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1187
1190
  </div>
1188
1191
  </div>
1189
1192
  <slot @slotchange=${this._assignSlot} style="display:none"></slot>
1190
- `}},h.SplitView.styles=pa,K([g({type:String})],h.SplitView.prototype,"orientation",2),K([g({type:Number,reflect:!0})],h.SplitView.prototype,"percentage",2),K([g({type:Boolean})],h.SplitView.prototype,"invisible",2),K([g({type:Number,reflect:!0})],h.SplitView.prototype,"min",2),K([g({type:Number,reflect:!0})],h.SplitView.prototype,"max",2),K([g({type:Boolean,reflect:!0})],h.SplitView.prototype,"useSavedState",2),K([F()],h.SplitView.prototype,"isDragging",2),K([F()],h.SplitView.prototype,"_error",2),K([At(".splitter")],h.SplitView.prototype,"_splitter",2),K([de("slot[name='panel1']")],h.SplitView.prototype,"_panel1",2),K([de("slot[name='panel2']")],h.SplitView.prototype,"_panel2",2),h.SplitView=K([I(Xr)],h.SplitView);var fa=Object.defineProperty,ga=Object.getOwnPropertyDescriptor,Re=(i,e,r,s)=>{for(var t=s>1?void 0:s?ga(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&fa(e,r,t),t};const ei="spectric-pagination";h.PaginationElement=class extends B{constructor(){super(...arguments),this.page=1,this.pageSize=10,this.pageSizeOptions=[10,20,50,100,1e3],this.size="xsmall",this._handlePageUp=()=>{this.page+=1,this._emitChange()},this._handlePageDown=()=>{this.page-=1,this._emitChange()},this._handleSizeChange=e=>{e.stopPropagation(),e.preventDefault();let r=parseInt(e.target.value);this.pageSize=r,this._emitChange()},this._emitChange=()=>{let{page:e,pageSize:r}=this;this.dispatchEvent(new CustomEvent("change",{detail:{page:e,pageSize:r}}))}}createRenderRoot(){return this}update(e){e.has("pageSize")&&!this.pageSizeOptions.includes(this.pageSize)&&(this.pageSizeOptions=[...this.pageSizeOptions,this.pageSize].sort((r,s)=>r-s),requestAnimationFrame(()=>{this.select&&this.select.value!==String(this.pageSize)&&(this.select.value=String(this.pageSize))})),super.update(e)}render(){let e=this.page*this.pageSize,r=!0;this.totalItems&&e<this.totalItems&&(r=!1);let s="";return this.totalItems&&(s=`${this.page} of ${Math.ceil(this.totalItems/this.pageSize)}`),$`
1193
+ `}},h.SplitView.styles=pa,K([g({type:String})],h.SplitView.prototype,"orientation",2),K([g({type:Number,reflect:!0})],h.SplitView.prototype,"percentage",2),K([g({type:Boolean})],h.SplitView.prototype,"invisible",2),K([g({type:Number,reflect:!0})],h.SplitView.prototype,"min",2),K([g({type:Number,reflect:!0})],h.SplitView.prototype,"max",2),K([g({type:Boolean,reflect:!0})],h.SplitView.prototype,"useSavedState",2),K([F()],h.SplitView.prototype,"isDragging",2),K([F()],h.SplitView.prototype,"_error",2),K([Ct(".splitter")],h.SplitView.prototype,"_splitter",2),K([de("slot[name='panel1']")],h.SplitView.prototype,"_panel1",2),K([de("slot[name='panel2']")],h.SplitView.prototype,"_panel2",2),h.SplitView=K([R(Xr)],h.SplitView);var fa=Object.defineProperty,ga=Object.getOwnPropertyDescriptor,je=(i,e,r,s)=>{for(var t=s>1?void 0:s?ga(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&fa(e,r,t),t};const ei="spectric-pagination";h.PaginationElement=class extends B{constructor(){super(...arguments),this.page=1,this.pageSize=10,this.pageSizeOptions=[10,20,50,100,1e3],this.size="xsmall",this._handlePageUp=()=>{this.page+=1,this._emitChange()},this._handlePageDown=()=>{this.page-=1,this._emitChange()},this._handleSizeChange=e=>{e.stopPropagation(),e.preventDefault();let r=parseInt(e.target.value);this.pageSize=r,this._emitChange()},this._emitChange=()=>{let{page:e,pageSize:r}=this;this.dispatchEvent(new CustomEvent("change",{detail:{page:e,pageSize:r}}))}}createRenderRoot(){return this}update(e){e.has("pageSize")&&!this.pageSizeOptions.includes(this.pageSize)&&(this.pageSizeOptions=[...this.pageSizeOptions,this.pageSize].sort((r,s)=>r-s),requestAnimationFrame(()=>{this.select&&this.select.value!==String(this.pageSize)&&(this.select.value=String(this.pageSize))})),super.update(e)}render(){let e=this.page*this.pageSize,r=!0;this.totalItems&&e<this.totalItems&&(r=!1);let s="";return this.totalItems&&(s=`${this.page} of ${Math.ceil(this.totalItems/this.pageSize)}`),_`
1191
1194
  <div class="spectric-pagination-container">
1192
1195
  <div>
1193
1196
  <!-- TODO/FIXME Make a select component and use it for cross browser styling-->
@@ -1195,7 +1198,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1195
1198
  @change=${this._handleSizeChange}
1196
1199
  .value=${String(this.pageSize)}
1197
1200
  >
1198
- ${this.pageSizeOptions.map(t=>$`<option
1201
+ ${this.pageSizeOptions.map(t=>_`<option
1199
1202
  .value=${String(t)}
1200
1203
  class=${String(t)===String(this.pageSize)?"selected":""}
1201
1204
  >
@@ -1203,7 +1206,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1203
1206
  </option>`)}
1204
1207
  </select>
1205
1208
  </div>
1206
- ${this.totalItems?$`
1209
+ ${this.totalItems?_`
1207
1210
  <div class="spectric-pagination-text">
1208
1211
  ${`Items ${(this.page-1)*this.pageSize}-${Math.min(this.page*this.pageSize,this.totalItems)} of ${this.totalItems}`}
1209
1212
  </div>
@@ -1228,15 +1231,15 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1228
1231
  </div>
1229
1232
  `:null}
1230
1233
  </div>
1231
- `}},Re([g({type:Number,reflect:!0})],h.PaginationElement.prototype,"page",2),Re([g({type:Number,reflect:!0})],h.PaginationElement.prototype,"pageSize",2),Re([g({type:Number,reflect:!0})],h.PaginationElement.prototype,"totalItems",2),Re([g({type:Array})],h.PaginationElement.prototype,"pageSizeOptions",2),Re([de("select")],h.PaginationElement.prototype,"select",2),Re([g({type:String,reflect:!0})],h.PaginationElement.prototype,"size",2),h.PaginationElement=Re([I(ei)],h.PaginationElement);const ba=Object.freeze(Object.defineProperty({__proto__:null,BitArray:Nr,DisposableElement:ie,getListeners:Hi},Symbol.toStringTag,{value:"Module"}));var va=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,nr=(i,e,r,s)=>{for(var t=s>1?void 0:s?ya(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&va(e,r,t),t};const ma="spectric-table-header";let Mt=class extends ie{constructor(){super(),this.columns=[],this._handleSortChange=i=>{this._resizeStart||(i=JSON.parse(JSON.stringify(i)),i.sortable&&(i.sortDirection===q.none||i.sortDirection===void 0?i.sortDirection=q.ascending:i.sortDirection===q.ascending?i.sortDirection=q.descending:i.sortDirection===q.descending&&(i.sortDirection=q.none),this.dispatchEvent(new CustomEvent("sortChange",{composed:!0,bubbles:!0,detail:i}))))},this._handleResizeStart=(i,e)=>{this._resizeStart={event:i,column:e}},this._handleResizeEnd=i=>{var r;if(!this._resizeStart)return;let e=i.pageX-((r=this._resizeStart)==null?void 0:r.event.pageX);if(this._resizeStart.column.width)this._resizeStart.column.width=this._resizeStart.column.width+e;else{let s=this._resizeStart.event.target.closest("td");this._resizeStart.column.width=s.getBoundingClientRect().width+e}this.dispatchEvent(new CustomEvent("columnResize",{detail:this._resizeStart.column})),requestAnimationFrame(()=>{if(this._resizeStart=void 0,window.getSelection){let s=window.getSelection();s&&s.removeAllRanges()}})},this.addDisposableListener(()=>document.body,"mouseup",this._handleResizeEnd)}createRenderRoot(){return this}render(){return $`
1234
+ `}},je([g({type:Number,reflect:!0})],h.PaginationElement.prototype,"page",2),je([g({type:Number,reflect:!0})],h.PaginationElement.prototype,"pageSize",2),je([g({type:Number,reflect:!0})],h.PaginationElement.prototype,"totalItems",2),je([g({type:Array})],h.PaginationElement.prototype,"pageSizeOptions",2),je([de("select")],h.PaginationElement.prototype,"select",2),je([g({type:String,reflect:!0})],h.PaginationElement.prototype,"size",2),h.PaginationElement=je([R(ei)],h.PaginationElement);const ba=Object.freeze(Object.defineProperty({__proto__:null,BitArray:Dr,DisposableElement:se,getListeners:Hi},Symbol.toStringTag,{value:"Module"}));var va=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,or=(i,e,r,s)=>{for(var t=s>1?void 0:s?ya(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&va(e,r,t),t};const ma="spectric-table-header";let zt=class extends se{constructor(){super(),this.columns=[],this._handleSortChange=i=>{this._resizeStart||(i=JSON.parse(JSON.stringify(i)),i.sortable&&(i.sortDirection===q.none||i.sortDirection===void 0?i.sortDirection=q.ascending:i.sortDirection===q.ascending?i.sortDirection=q.descending:i.sortDirection===q.descending&&(i.sortDirection=q.none),this.dispatchEvent(new CustomEvent("sortChange",{composed:!0,bubbles:!0,detail:i}))))},this._handleResizeStart=(i,e)=>{this._resizeStart={event:i,column:e}},this._handleResizeEnd=i=>{var r;if(!this._resizeStart)return;let e=i.pageX-((r=this._resizeStart)==null?void 0:r.event.pageX);if(this._resizeStart.column.width)this._resizeStart.column.width=this._resizeStart.column.width+e;else{let s=this._resizeStart.event.target.closest("th");this._resizeStart.column.width=s.getBoundingClientRect().width+e}this.dispatchEvent(new CustomEvent("columnResize",{detail:this._resizeStart.column})),requestAnimationFrame(()=>{if(this._resizeStart=void 0,window.getSelection){let s=window.getSelection();s&&s.removeAllRanges()}})},this.addDisposableListener(()=>document.body,"mouseup",this._handleResizeEnd)}createRenderRoot(){return this}render(){return _`
1232
1235
  <tr>
1233
1236
  ${this.columns.map(i=>this.renderCell(i))}
1234
1237
  </tr>
1235
- `}renderCell(i){let e=["header-contents"];i.filterable,i.sortable&&e.push("sortable"),this._resizeStart&&e.push("resizing");let r=i.width?`min-width:${i.width}px;max-width:${i.width}px;`:"",s=i.sortDirection===q.ascending?Xo:i.sortDirection==q.descending?ea:"",t=i.sortDirection||q.none,a=i.allowResize||i.allowResize===void 0?$`<div
1238
+ `}renderCell(i){let e=["header-contents"];i.filterable,i.sortable&&e.push("sortable"),this._resizeStart&&e.push("resizing");let r=i.width?`min-width:${i.width}px;max-width:${i.width}px;`:"",s=i.sortDirection===q.ascending?Xo:i.sortDirection==q.descending?ea:"",t=i.sortDirection||q.none,a=i.allowResize||i.allowResize===void 0?_`<div
1236
1239
  class="header-resize-handle"
1237
- @mousedown=${c=>{this._handleResizeStart(c,i)}}
1240
+ @mousedown=${u=>{this._handleResizeStart(u,i)}}
1238
1241
  @mouseup=${this._handleResizeEnd}
1239
- ></div>`:null,d=i.title||i.key;return typeof d=="function"&&(d=d(this.table)||void 0),$` <td
1242
+ ></div>`:null,d=i.title||i.key;return typeof d=="function"&&(d=d(this.table)||void 0),_` <th
1240
1243
  @click=${()=>this._handleSortChange(i)}
1241
1244
  style="${r}"
1242
1245
  >
@@ -1245,11 +1248,11 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1245
1248
  ${d}
1246
1249
  <span class="sort-direction ${t}">${s}</span>
1247
1250
  </div>
1248
- </td>`}};nr([g({type:Array,attribute:!1})],Mt.prototype,"columns",2),nr([F()],Mt.prototype,"_resizeStart",2),nr([g({type:Object,attribute:!1})],Mt.prototype,"table",2),Mt=nr([I(ma)],Mt);/**
1251
+ </th>`}};or([g({type:Array,attribute:!1})],zt.prototype,"columns",2),or([F()],zt.prototype,"_resizeStart",2),or([g({type:Object,attribute:!1})],zt.prototype,"table",2),zt=or([R(ma)],zt);/**
1249
1252
  * @license
1250
1253
  * Copyright 2017 Google LLC
1251
1254
  * SPDX-License-Identifier: BSD-3-Clause
1252
- */const fs=i=>an(i)?i._$litType$.h:i.strings,$a=We(class extends Et{constructor(i){super(i),this.et=new WeakMap}render(i){return[i]}update(i,[e]){const r=Qi(this.it)?fs(this.it):null,s=Qi(e)?fs(e):null;if(r!==null&&(s===null||r!==s)){const t=Pr(i).pop();let o=this.et.get(r);if(o===void 0){const a=document.createDocumentFragment();o=Vt(L,a),o.setConnected(!1),this.et.set(r,o)}Or(o,[t]),Ne(o,void 0,t)}if(s!==null){if(r===null||r!==s){const t=this.et.get(s);if(t!==void 0){const o=Pr(t).pop();un(i),Ne(i,void 0,o),Or(i,[o])}}this.it=e}else this.it=void 0;return this.render(e)}});var _a=Object.defineProperty,wa=Object.getOwnPropertyDescriptor,je=(i,e,r,s)=>{for(var t=s>1?void 0:s?wa(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&_a(e,r,t),t};const Sa="spectric-table-cell";let xe=class extends B{constructor(){super(...arguments),this.overflow="",this.styleRules={whiteSpace:"",width:""},this._handleFilterOut=()=>{let i;this.column.key&&typeof this.row=="object"&&(i=at(this.row,this.column.key)),this._emitFilter({include:!1,row:this.row,value:i,column:this.column})},this._handleFilterFor=()=>{let i;this.column.key&&typeof this.row=="object"&&(i=at(this.row,this.column.key)),this._emitFilter({include:!0,row:this.row,value:i,column:this.column})},this._displayOverflowTooltip=()=>{if(this.column.disableCellOverflowTooltip){this.overflow=null;return}let i=this.querySelector("div.cell-contents"),e=this.querySelector("span");if(i&&e){let r=e.getBoundingClientRect(),s=i.getBoundingClientRect();r.width*r.height>s.width*s.height?(console.log("We need to show a tooltip with the content because we are overflowing"),this.overflow=this.getRenderedValue(),this.updateComplete.then(()=>{let t=this.querySelector("spectric-tooltip");t&&t.showToolTip()})):this.overflow=""}}}createRenderRoot(){return this}updated(i){}_emitFilter(i){this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:i}))}getRenderedValue(){let i;return this.column.render?i=this.column.render(this.row,this.index,this.table):this.column.key&&typeof this.row=="object"?i=at(this.row,this.column.key):i=$`error`,i}render(){var o;let i=this.getRenderedValue(),e=["cell-contents"];(this.column.filterable||(o=this.column.cellActions)!=null&&o.length)&&e.push("hasActions");const r=this.table.getCellActionButtonSize();let s=$a(this.column.filterable?$`
1255
+ */const fs=i=>an(i)?i._$litType$.h:i.strings,$a=Ge(class extends At{constructor(i){super(i),this.et=new WeakMap}render(i){return[i]}update(i,[e]){const r=Qi(this.it)?fs(this.it):null,s=Qi(e)?fs(e):null;if(r!==null&&(s===null||r!==s)){const t=Tr(i).pop();let o=this.et.get(r);if(o===void 0){const a=document.createDocumentFragment();o=Wt(L,a),o.setConnected(!1),this.et.set(r,o)}Pr(o,[t]),De(o,void 0,t)}if(s!==null){if(r===null||r!==s){const t=this.et.get(s);if(t!==void 0){const o=Tr(t).pop();un(i),De(i,void 0,o),Pr(i,[o])}}this.it=e}else this.it=void 0;return this.render(e)}});var _a=Object.defineProperty,wa=Object.getOwnPropertyDescriptor,Be=(i,e,r,s)=>{for(var t=s>1?void 0:s?wa(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&_a(e,r,t),t};const Sa="spectric-table-cell";let xe=class extends B{constructor(){super(...arguments),this.overflow="",this.styleRules={whiteSpace:"",width:""},this._handleFilterOut=()=>{let i;this.column.key&&typeof this.row=="object"&&(i=ct(this.row,this.column.key)),this._emitFilter({include:!1,row:this.row,value:i,column:this.column})},this._handleFilterFor=()=>{let i;this.column.key&&typeof this.row=="object"&&(i=ct(this.row,this.column.key)),this._emitFilter({include:!0,row:this.row,value:i,column:this.column})},this._displayOverflowTooltip=()=>{if(this.column.disableCellOverflowTooltip){this.overflow=null;return}let i=this.querySelector("div.cell-contents"),e=this.querySelector("span");if(i&&e){let r=e.getBoundingClientRect(),s=i.getBoundingClientRect();r.width*r.height>s.width*s.height?(console.log("We need to show a tooltip with the content because we are overflowing"),this.overflow=this.getRenderedValue(),this.updateComplete.then(()=>{let t=this.querySelector("spectric-tooltip");t&&t.showToolTip()})):this.overflow=""}}}createRenderRoot(){return this}updated(i){}_emitFilter(i){this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:i}))}getRenderedValue(){let i;return this.column.render?i=this.column.render(this.row,this.index,this.table):this.column.key&&typeof this.row=="object"?i=ct(this.row,this.column.key):i=_`error`,i}render(){var o;let i=this.getRenderedValue(),e=["cell-contents"];(this.column.filterable||(o=this.column.cellActions)!=null&&o.length)&&e.push("hasActions");const r=this.table.getCellActionButtonSize();let s=$a(this.column.filterable?_`
1253
1256
  <spectric-button
1254
1257
  @click=${this._handleFilterOut}
1255
1258
  .size=${r}
@@ -1266,84 +1269,76 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1266
1269
  tooltip="Filter For Value"
1267
1270
  >+</spectric-button
1268
1271
  >
1269
- `:null),t=(this.column.cellActions||[]).map(a=>$`<spectric-button
1272
+ `:null),t=(this.column.cellActions||[]).map(a=>_`<spectric-button
1270
1273
  @click=${()=>a.onClick(this.row,this.column)}
1271
1274
  .size=${r}
1272
1275
  variant="text"
1273
1276
  icon
1274
1277
  .tooltip=${a.tooltip}
1275
1278
  >${a.icon}</spectric-button
1276
- >`);return this.styleRules={width:this.column.width?this.column.width+"px":null,whiteSpace:this.column.whiteSpace||null},$`
1279
+ >`);return this.styleRules={width:this.column.width?this.column.width+"px":null,whiteSpace:this.column.whiteSpace||null},_`
1277
1280
  <td
1278
- style=${kr(this.styleRules)}
1281
+ style=${Er(this.styleRules)}
1279
1282
  @mouseenter=${this._displayOverflowTooltip}
1280
1283
  >
1281
1284
  <div class="table-cell-actions ${r}">
1282
1285
  ${t} ${s}
1283
1286
  </div>
1284
1287
  <div class=${e.join(" ")}>
1285
- ${this.overflow?$`<spectric-tooltip .text=${this.overflow}></spectric-tooltip>`:null}<span>${i}</span>
1288
+ ${this.overflow?_`<spectric-tooltip .text=${this.overflow}></spectric-tooltip>`:null}<span>${i}</span>
1286
1289
  </div>
1287
1290
  </td>
1288
- `}};je([g({type:Object,attribute:!1})],xe.prototype,"row",2),je([g({type:Number,attribute:!1})],xe.prototype,"index",2),je([g({type:Object,attribute:!1})],xe.prototype,"column",2),je([g({type:Object,attribute:!1})],xe.prototype,"table",2),je([F()],xe.prototype,"overflow",2),je([de("td")],xe.prototype,"td",2),xe=je([I(Sa)],xe);const at=(i,e)=>{let r=e.split("."),s=i[r[0]];return s==null||r.length>1&&(s=at(s,r.slice(1).join("."))),s};/**
1291
+ `}};Be([g({type:Object,attribute:!1})],xe.prototype,"row",2),Be([g({type:Number,attribute:!1})],xe.prototype,"index",2),Be([g({type:Object,attribute:!1})],xe.prototype,"column",2),Be([g({type:Object,attribute:!1})],xe.prototype,"table",2),Be([F()],xe.prototype,"overflow",2),Be([de("td")],xe.prototype,"td",2),xe=Be([R(Sa)],xe);const ct=(i,e)=>{let r=e.split("."),s=i[r[0]];return s==null||r.length>1&&(s=ct(s,r.slice(1).join("."))),s};/**
1289
1292
  * @license
1290
1293
  * Copyright 2017 Google LLC
1291
1294
  * SPDX-License-Identifier: BSD-3-Clause
1292
- */const gs=(i,e,r)=>{const s=new Map;for(let t=e;t<=r;t++)s.set(i[t],t);return s},or=We(class extends Et{constructor(i){if(super(i),i.type!==Wt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,r){let s;r===void 0?r=e:e!==void 0&&(s=e);const t=[],o=[];let a=0;for(const d of i)t[a]=s?s(d,a):a,o[a]=r(d,a),a++;return{values:o,keys:t}}render(i,e,r){return this.dt(i,e,r).values}update(i,[e,r,s]){const t=Pr(i),{values:o,keys:a}=this.dt(e,r,s);if(!Array.isArray(t))return this.ut=a,o;const d=this.ut??(this.ut=[]),c=[];let b,_,v=0,C=t.length-1,w=0,S=o.length-1;for(;v<=C&&w<=S;)if(t[v]===null)v++;else if(t[C]===null)C--;else if(d[v]===a[w])c[w]=De(t[v],o[w]),v++,w++;else if(d[C]===a[S])c[S]=De(t[C],o[S]),C--,S--;else if(d[v]===a[S])c[S]=De(t[v],o[S]),Ne(i,c[S+1],t[v]),v++,S--;else if(d[C]===a[w])c[w]=De(t[C],o[w]),Ne(i,t[v],t[C]),C--,w++;else if(b===void 0&&(b=gs(a,w,S),_=gs(d,v,C)),b.has(d[v]))if(b.has(d[C])){const A=_.get(a[w]),N=A!==void 0?t[A]:null;if(N===null){const M=Ne(i,t[v]);De(M,o[w]),c[w]=M}else c[w]=De(N,o[w]),Ne(i,t[v],N),t[A]=null;w++}else Tr(t[C]),C--;else Tr(t[v]),v++;for(;w<=S;){const A=Ne(i,c[S+1]);De(A,o[w]),c[w++]=A}for(;v<=C;){const A=t[v++];A!==null&&Tr(A)}return this.ut=a,Or(i,c),he}});var xa=Object.defineProperty,ka=Object.getOwnPropertyDescriptor,ti=(i,e,r,s)=>{for(var t=s>1?void 0:s?ka(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&xa(e,r,t),t};const Ea="spectric-table-body";let ar=class extends B{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}firstUpdated(i){this.data.length>100&&console.warn("Table is rendering excessive amounts of data to the DOM you should set rowHeight and use a virtualized scroll or use pagination")}render(){return $`
1295
+ */const gs=(i,e,r)=>{const s=new Map;for(let t=e;t<=r;t++)s.set(i[t],t);return s},ar=Ge(class extends At{constructor(i){if(super(i),i.type!==Gt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(i,e,r){let s;r===void 0?r=e:e!==void 0&&(s=e);const t=[],o=[];let a=0;for(const d of i)t[a]=s?s(d,a):a,o[a]=r(d,a),a++;return{values:o,keys:t}}render(i,e,r){return this.dt(i,e,r).values}update(i,[e,r,s]){const t=Tr(i),{values:o,keys:a}=this.dt(e,r,s);if(!Array.isArray(t))return this.ut=a,o;const d=this.ut??(this.ut=[]),u=[];let b,y,v=0,A=t.length-1,w=0,S=o.length-1;for(;v<=A&&w<=S;)if(t[v]===null)v++;else if(t[A]===null)A--;else if(d[v]===a[w])u[w]=Me(t[v],o[w]),v++,w++;else if(d[A]===a[S])u[S]=Me(t[A],o[S]),A--,S--;else if(d[v]===a[S])u[S]=Me(t[v],o[S]),De(i,u[S+1],t[v]),v++,S--;else if(d[A]===a[w])u[w]=Me(t[A],o[w]),De(i,t[v],t[A]),A--,w++;else if(b===void 0&&(b=gs(a,w,S),y=gs(d,v,A)),b.has(d[v]))if(b.has(d[A])){const C=y.get(a[w]),M=C!==void 0?t[C]:null;if(M===null){const D=De(i,t[v]);Me(D,o[w]),u[w]=D}else u[w]=Me(M,o[w]),De(i,t[v],M),t[C]=null;w++}else Lr(t[A]),A--;else Lr(t[v]),v++;for(;w<=S;){const C=De(i,u[S+1]);Me(C,o[w]),u[w++]=C}for(;v<=A;){const C=t[v++];C!==null&&Lr(C)}return this.ut=a,Pr(i,u),he}});var xa=Object.defineProperty,ka=Object.getOwnPropertyDescriptor,ti=(i,e,r,s)=>{for(var t=s>1?void 0:s?ka(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&xa(e,r,t),t};const Ea="spectric-table-body";let lr=class extends B{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}firstUpdated(i){this.data.length>100&&console.warn("Table is rendering excessive amounts of data to the DOM you should set rowHeight and use a virtualized scroll or use pagination")}render(){return _`
1293
1296
  <body>
1294
- ${or(this.data,(i,e)=>$`
1297
+ ${ar(this.data,(i,e)=>_`
1295
1298
  <tr class="${e%2===0?"odd":""}">
1296
- ${or(this.columns,r=>$`<spectric-table-cell .column=${r} .index=${e} .row=${i} .columns=${this.columns}></spectric-table-cell>`)}
1299
+ ${ar(this.columns,r=>_`<spectric-table-cell .column=${r} .index=${e} .row=${i} .columns=${this.columns}></spectric-table-cell>`)}
1297
1300
  </tr>`)}
1298
1301
 
1299
1302
  </body>
1300
- `}};ti([g({type:Array,attribute:!1})],ar.prototype,"data",2),ti([g({type:Array,attribute:!1})],ar.prototype,"columns",2),ar=ti([I(Ea)],ar);var Aa=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,lt=(i,e,r,s)=>{for(var t=s>1?void 0:s?Ca(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Aa(e,r,t),t};const Oa="spectric-table-virtual-body";let Be=class extends ie{constructor(){super(),this.data=[],this.columns=[],this.rowHeight=30,this.startIndex=0,this.columnsMeasured=!1;let i=0;this.addDisposableListener(()=>this.table.querySelector(".table-wrapper"),"scroll",()=>{const e=this.table.querySelector(".table-wrapper").scrollTop;Math.abs(i-e)<=this.rowHeight/4||(i=e,this.startIndex=Math.floor(e/this.rowHeight))})}updated(){if(this.columnsMeasured===!1){let i=this.querySelector("tr"),e=i==null?void 0:i.querySelectorAll("spectric-table-cell td");i&&e&&e.length&&(this.columns.forEach((r,s)=>{if(!r.width||r.width===0){let t=e[s].getBoundingClientRect();t.width>0&&(this.columnsMeasured=!0,r.width=t.width-ct)}}),this.columnsMeasured&&(this.columns=[...this.columns]))}}createRenderRoot(){return this}render(){let i=this.data.length,e=10,r=this.table.querySelector("spectric-table-header").clientHeight,s=this.table.querySelector(".table-wrapper"),t=Math.max(this.startIndex,0);const o=Math.ceil((s.clientHeight-r)/this.rowHeight),a=Math.min(t+o+e,i),d=a-t;let c=i*this.rowHeight,b=t*this.rowHeight+(s.scrollTop-t*this.rowHeight);a===i&&(b=t*this.rowHeight);let _=d*this.rowHeight,v=c-b-_,C=t!=0?$` <tr
1301
- style="height:${b}px"
1302
- class="virtual-scroll-spacer"
1303
- >
1304
- <td colspan="${this.columns.length}"></td>
1305
- </tr>`:null,w=$` <tr
1306
- style="height:${v}px"
1303
+ `}};ti([g({type:Array,attribute:!1})],lr.prototype,"data",2),ti([g({type:Array,attribute:!1})],lr.prototype,"columns",2),lr=ti([R(Ea)],lr);var Aa=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,Ue=(i,e,r,s)=>{for(var t=s>1?void 0:s?Ca(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Aa(e,r,t),t};const Oa="spectric-table-virtual-body";let ke=class extends se{constructor(){super(),this.data=[],this.columns=[],this.rowHeight=30,this.startIndex=0,this.columnsMeasured=!1,this.buffer=100;let i=0;this.addDisposableListener(()=>this.table.querySelector(".table-wrapper"),"scroll",()=>{const e=this.table.querySelector(".table-wrapper").scrollTop;Math.abs(i-e)<=this.rowHeight/4||(i=e,this.startIndex=Math.floor(e/this.rowHeight))})}update(i){if(this.columnsMeasured===!1){let e=this.querySelector("tr"),r=e==null?void 0:e.querySelectorAll("spectric-table-cell td");e&&r&&r.length&&(this.columns.forEach((s,t)=>{if(!s.width||s.width===0){let o=r[t].getBoundingClientRect();o.width>0&&(this.columnsMeasured=!0,s.width=o.width-ut)}}),this.columnsMeasured&&(this.columns=[...this.columns]))}super.update(i)}createRenderRoot(){return this}render(){let i=this.data.length,e=this.buffer/2,r=this.table.querySelector(".table-wrapper");const s=r.scrollTop,t=Math.max(0,Math.floor(s/this.rowHeight)-e),o=Math.min(i,Math.ceil((s+r.clientHeight)/this.rowHeight)+e);let a=i*this.rowHeight,d=t*this.rowHeight,u=(i-o)*this.rowHeight,b=_` <tr
1304
+ style="height:${d}px"
1307
1305
  class="virtual-scroll-spacer"
1308
- >
1309
- <td colspan="${this.columns.length}"></td>
1310
- </tr>`;return $`
1306
+ ></tr>`,y=_` <tr
1307
+ style="height:${u}px"
1308
+ class="virtual-scroll-spacer"
1309
+ ></tr>`;return _`
1311
1310
  <div
1312
- style="height:${c}px;position: absolute;overflow-x: hidden;overflow-y: hidden;z-index:-1;width:1px;"
1311
+ style="height:${a}px;position: absolute;overflow-x: hidden;overflow-y: hidden;z-index:-1;width:1px;"
1313
1312
  ></div>
1314
1313
  <tbody>
1315
- ${C}
1314
+ ${b}
1316
1315
  </tbody>
1317
- <div
1318
- style="display:table-row-group;max-height:${_}px; overflow:hidden;"
1319
- >
1320
- ${or(this.data.slice(Math.max(t,0),a),(S,A)=>$` <tr
1321
- class="${(A+t)%2===0?"odd":""}"
1322
- >
1323
- ${or(this.columns,N=>$`<spectric-table-cell
1324
- .column=${N}
1325
- .row=${S}
1326
- .index=${A+t}
1327
- .columns=${this.columns}
1328
- .table=${this.table}
1329
- ></spectric-table-cell>`)}
1330
- </tr>`)}
1316
+ <div style="display:table-row-group;overflow:hidden;">
1317
+ ${ar(this.data.slice(Math.max(t,0),o),(v,A)=>_` <tr class="${this.table.getRowClass(v,A+t)}">
1318
+ ${ar(this.columns,w=>_`<spectric-table-cell
1319
+ .column=${w}
1320
+ .row=${v}
1321
+ .index=${A+t}
1322
+ .columns=${this.columns}
1323
+ .table=${this.table}
1324
+ ></spectric-table-cell>`)}
1325
+ </tr>`)}
1331
1326
  </div>
1332
1327
  <tbody>
1333
- ${v>0?w:null}
1328
+ ${y}
1334
1329
  </tbody>
1335
- `}};lt([g({type:Array,attribute:!1})],Be.prototype,"data",2),lt([g({type:Array,attribute:!1})],Be.prototype,"columns",2),lt([g({type:Number,attribute:!1})],Be.prototype,"rowHeight",2),lt([g({type:Number,state:!0})],Be.prototype,"startIndex",2),lt([g({type:Object,attribute:!1})],Be.prototype,"table",2),Be=lt([I(Oa)],Be);function bs(i){let e=!1,r;return function(...s){return e||(e=!0,r=i.apply(this,s)),r}}const Pa=i=>i.map(({key:e,sortDirection:r,compareFn:s})=>(t,o)=>{if(!e)return;let a=at(t,e),d=at(o,e);if(s)return s(t,o);if(typeof a=="number"||typeof a=="bigint"||typeof a=="boolean"){let c=a-d;return r===q.descending&&(c=c*-1),c}else if(typeof a=="string")return a.localeCompare(d)*(r===q.descending?-1:1)});var Ta=Object.defineProperty,La=Object.getOwnPropertyDescriptor,ce=(i,e,r,s)=>{for(var t=s>1?void 0:s?La(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Ta(e,r,t),t};const ri="spectric-table";var ii=(i=>(i.multi="multi",i.single="single",i.none="none",i))(ii||{}),si=(i=>(i.multi="multi",i.single="single",i))(si||{}),q=(i=>(i.ascending="ascending",i.descending="descending",i.none="none",i))(q||{});const ct=4,zt=Symbol("spectric-table-selection-column");h.SpectricTableElement=class extends B{constructor(){super(...arguments),this.data=[],this.columns=[],this.select="none",this.sort="single",this.sortOrder=[],this.rowHeight=25,this.fontSize=16,this.cellActionButtonSize="xxsmall",this._handlePaginationChange=e=>{if(this.pagination){let r={...this.pagination,...e.detail},{totalItems:s,page:t,pageSize:o}=r;s&&t&&o&&(t-1)*o>s&&(r.page=1),this.pagination=r}this.dispatchEvent(new CustomEvent("paginationChange",{detail:e.detail})),this._emitChange()},this._handleSortChange=e=>{let r=e.detail,s=this.columns.find(t=>t.key==r.key);if(!s||s.key===void 0){console.warn("Unable to find sort column");return}if(this.sort=="single"&&(this.columns.forEach(t=>{t.sortDirection="none"}),this.sortOrder=[]),s.sortDirection=r.sortDirection,!s.sortDirection||s.sortDirection==="none"){let t=this.sortOrder.findIndex(o=>o===s.key);t!==-1&&this.sortOrder.splice(t,1)}else this.sortOrder.findIndex(o=>o===s.key)===-1&&(this.sortOrder=[...this.sortOrder,s.key]);this.columns=[...this.columns],this._emitChange()},this._handleColumnResize=e=>{let r=e.detail,s=this.columns.findIndex(t=>t.key==r.key);this.columns[s]={...this.columns[s]},this.columns=[...this.columns],this._emitChange()},this._emitChange=()=>{let{pagination:e,columns:r,sortOrder:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{pagination:e,columns:r,sortOrder:s}}))},this.__DO_NOT_USE_filter=()=>{this.dispatchEvent(new CustomEvent("filter")),this.dispatchEvent(new CustomEvent("sortChange"))},this.selected=[],this._getRowHeight=()=>{let e=this.rowHeight-ct;return e<this.fontSize+ct&&(e=this.fontSize+ct),e},this._handleSelectAllChange=e=>{e.stopPropagation(),e.target.checked?this.selectAll():this.deselectAll()},this.selectColumnConfig={[zt]:!0,allowResize:!1,filterable:!1,width:39,title:e=>e.select==="multi"?$`<spectric-input
1330
+ `}};Ue([g({type:Array,attribute:!1})],ke.prototype,"data",2),Ue([g({type:Array,attribute:!1})],ke.prototype,"columns",2),Ue([g({type:Number,attribute:!1})],ke.prototype,"rowHeight",2),Ue([g({type:Number,state:!0})],ke.prototype,"startIndex",2),Ue([g({type:Object,attribute:!1})],ke.prototype,"table",2),Ue([g({type:Number,attribute:!1})],ke.prototype,"buffer",2),ke=Ue([R(Oa)],ke);function bs(i){let e=!1,r;return function(...s){return e||(e=!0,r=i.apply(this,s)),r}}const Pa=i=>i.map(({key:e,sortDirection:r,compareFn:s})=>(t,o)=>{if(!e)return;let a=ct(t,e),d=ct(o,e);if(s)return s(t,o);if(typeof a=="number"||typeof a=="bigint"||typeof a=="boolean"){let u=a-d;return r===q.descending&&(u=u*-1),u}else if(typeof a=="string")return a.localeCompare(d)*(r===q.descending?-1:1)});var Ta=Object.defineProperty,La=Object.getOwnPropertyDescriptor,X=(i,e,r,s)=>{for(var t=s>1?void 0:s?La(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Ta(e,r,t),t};const ri="spectric-table";var ii=(i=>(i.multi="multi",i.single="single",i.none="none",i))(ii||{}),si=(i=>(i.multi="multi",i.single="single",i))(si||{}),q=(i=>(i.ascending="ascending",i.descending="descending",i.none="none",i))(q||{});const ut=4,It=Symbol("spectric-table-selection-column");h.SpectricTableElement=class extends B{constructor(){super(...arguments),this.data=[],this.columns=[],this.select="none",this.sort="single",this.sortOrder=[],this.rowHeight=25,this.fontSize=16,this.virtualBodyBuffer=100,this.getRowClass=(e,r)=>r%2===0?"odd":"",this.cellActionButtonSize="xxsmall",this._handlePaginationChange=e=>{if(this.pagination){let r={...this.pagination,...e.detail},{totalItems:s,page:t,pageSize:o}=r;s&&t&&o&&(t-1)*o>s&&(r.page=1),this.pagination=r}this.dispatchEvent(new CustomEvent("paginationChange",{detail:e.detail})),this._emitChange()},this._handleSortChange=e=>{let r=e.detail,s=this.columns.find(t=>t.key==r.key);if(!s||s.key===void 0){console.warn("Unable to find sort column");return}if(this.sort=="single"&&(this.columns.forEach(t=>{t.sortDirection="none"}),this.sortOrder=[]),s.sortDirection=r.sortDirection,!s.sortDirection||s.sortDirection==="none"){let t=this.sortOrder.findIndex(o=>o===s.key);t!==-1&&this.sortOrder.splice(t,1)}else this.sortOrder.findIndex(o=>o===s.key)===-1&&(this.sortOrder=[...this.sortOrder,s.key]);this.columns=[...this.columns],this._emitChange()},this._handleColumnResize=e=>{let r=e.detail,s=this.columns.findIndex(t=>t.key==r.key);this.columns[s]={...this.columns[s]},this.columns=[...this.columns],this._emitChange()},this._emitChange=()=>{let{pagination:e,columns:r,sortOrder:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{pagination:e,columns:r,sortOrder:s}}))},this.__DO_NOT_USE_filter=()=>{this.dispatchEvent(new CustomEvent("filter")),this.dispatchEvent(new CustomEvent("sortChange"))},this.selected=[],this._getRowHeight=()=>{let e=this.rowHeight-ut;return e<this.fontSize+ut&&(e=this.fontSize+ut),e},this._handleSelectAllChange=e=>{e.stopPropagation(),e.target.checked?this.selectAll():this.deselectAll()},this.selectColumnConfig={[It]:!0,allowResize:!1,filterable:!1,width:39,title:e=>e.select==="multi"?_`<spectric-input
1336
1331
  variant="checkbox"
1337
1332
  @change=${e._handleSelectAllChange}
1338
1333
  ${me({checked:e.selected.length===e.data.length})}
1339
1334
  .helperText=${"Select All"}
1340
- ></spectric-input>`:null,render:(e,r,s)=>{let t=s.selected.includes(e);return $`<spectric-input
1335
+ ></spectric-input>`:null,render:(e,r,s)=>{let t=s.selected.includes(e);return _`<spectric-input
1341
1336
  variant="checkbox"
1342
1337
  class="table-checkbox-${s.select}"
1343
1338
  .helperText=${""}
1344
1339
  ${me({checked:t})}
1345
- @change=${a=>{a.stopPropagation();let d=s.selected.findIndex(c=>c===e);if(!(a.target.checked&&d!==-1)){{if(!a.target.checked&&d===-1)return;!a.target.checked&&d!==-1&&s.selected.splice(d,1)}a.target.checked&&(s.select==="single"&&(s.selected=[]),s.selected.push(e)),s.setSelected([...s.selected]),s.dispatchEvent(new CustomEvent("selected",{detail:[...s.selected]}))}}}
1346
- ></spectric-input>`}}}getCellActionButtonSize(){return this.cellActionButtonSize}static getDefaultDataSorterAndPaginatior(e){return r=>{let s=(r.sortOrder||[]).map(d=>r.columns.find(c=>c.key===d)),t=[...e];if(s.length){let d=Pa(s);t.sort((c,b)=>{for(let _ of d){let v=_(c,b);if(v)return v}return 0})}if(!r.pagination)return t;let{page:o,pageSize:a}=r.pagination;return!o||!a?t:r.pagination?t.slice((o-1)*a,o*a):t}}createRenderRoot(){return this}forceRefreshofSelectionColumn(){let e=this.columns.findIndex(r=>r[zt]);e!==-1&&(this.columns[e]={...this.selectColumnConfig},this.columns=[...this.columns])}setSelected(e){this.selected=e,this.forceRefreshofSelectionColumn()}getSelected(){return this.selected}deselectAll(){this.setSelected([]),this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}selectAll(){this.setSelected([...this.data]),this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}async scrollToRow(e){let r=-1;if(Number.isInteger(e)?r=e:r=this.data.findIndex(s=>s===e),r!==-1){let s=this.querySelector("spectric-table-virtual-body"),t=this.querySelector(".table-wrapper"),o=r*this._getRowHeight();t.scrollTo({top:o,behavior:"smooth"});for(let a=0;a<100;a++)if(await new Promise(d=>setTimeout(d,10)),t.scrollTop==o){console.log("Scroll complete");break}s&&requestAnimationFrame(()=>{let a=[...s.querySelectorAll("tr")];a=a.filter(d=>{var c;return((c=d.querySelector("spectric-table-cell"))==null?void 0:c.index)===r}),a.length&&a[0].animate([{backgroundColor:"red"},{backgroundColor:"unset"}],{duration:200,iterations:5})})}}update(e){if(e.has("data")&&(this.selected=this.data.reduce((r,s)=>(this.selected.includes(s)&&r.push(s),r),[])),e.has("columns")&&this.select!=="none"&&(this.columns.find(r=>r[zt])||this.columns.unshift(this.selectColumnConfig)),e.has("select")){let r=this.columns.findIndex(s=>s[zt]);this.select!=="none"?(this.forceRefreshofSelectionColumn(),this.columns.find(s=>s[zt])||(this.columns.unshift(this.selectColumnConfig),this.columns=[...this.columns])):r!==-1&&(this.columns.splice(r,1),this.columns=[...this.columns],this.setSelected([])),this.select==="single"&&this.selected.length>1&&(this.setSelected([this.selected[0]]),this.dispatchEvent(new CustomEvent("selected",{detail:[this.selected[0]]})))}super.update(e)}render(){let e=this.columns.filter(s=>!s.hidden),r=this._getRowHeight();return $`
1340
+ @change=${a=>{a.stopPropagation();let d=s.selected.findIndex(u=>u===e);if(!(a.target.checked&&d!==-1)){{if(!a.target.checked&&d===-1)return;!a.target.checked&&d!==-1&&s.selected.splice(d,1)}a.target.checked&&(s.select==="single"&&(s.selected=[]),s.selected.push(e)),s.setSelected([...s.selected]),s.dispatchEvent(new CustomEvent("selected",{detail:[...s.selected]}))}}}
1341
+ ></spectric-input>`}}}getCellActionButtonSize(){return this.cellActionButtonSize}static getDefaultDataSorterAndPaginatior(e){return r=>{let s=(r.sortOrder||[]).map(d=>r.columns.find(u=>u.key===d)),t=[...e];if(s.length){let d=Pa(s);t.sort((u,b)=>{for(let y of d){let v=y(u,b);if(v)return v}return 0})}if(!r.pagination)return t;let{page:o,pageSize:a}=r.pagination;return!o||!a?t:r.pagination?t.slice((o-1)*a,o*a):t}}createRenderRoot(){return this}forceRefreshofSelectionColumn(){let e=this.columns.findIndex(r=>r[It]);e!==-1&&(this.columns[e]={...this.selectColumnConfig},this.columns=[...this.columns])}setSelected(e){this.selected=e,this.forceRefreshofSelectionColumn()}getSelected(){return this.selected}deselectAll(){this.setSelected([]),this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}selectAll(){this.setSelected([...this.data]),this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}async scrollToRow(e){let r=-1;if(Number.isInteger(e)?r=e:r=this.data.findIndex(s=>s===e),r!==-1){let s=this.querySelector("spectric-table-virtual-body"),t=this.querySelector(".table-wrapper"),o=r*this._getRowHeight();t.scrollTo({top:o,behavior:"smooth"});for(let a=0;a<100;a++)if(await new Promise(d=>requestAnimationFrame(d)),t.scrollTop==o){console.log("Scroll complete");break}s&&requestAnimationFrame(()=>{let a=[...s.querySelectorAll("tr")];a=a.filter(d=>{var u;return((u=d.querySelector("spectric-table-cell"))==null?void 0:u.index)===r}),a.length&&a[0].animate([{backgroundColor:"red"},{backgroundColor:"unset"}],{duration:200,iterations:5})})}}update(e){if(e.has("data")&&(this.selected=this.data.reduce((r,s)=>(this.selected.includes(s)&&r.push(s),r),[])),e.has("columns")&&this.select!=="none"&&(this.columns.find(r=>r[It])||this.columns.unshift(this.selectColumnConfig)),e.has("select")){let r=this.columns.findIndex(s=>s[It]);this.select!=="none"?(this.forceRefreshofSelectionColumn(),this.columns.find(s=>s[It])||(this.columns.unshift(this.selectColumnConfig),this.columns=[...this.columns])):r!==-1&&(this.columns.splice(r,1),this.columns=[...this.columns],this.setSelected([])),this.select==="single"&&this.selected.length>1&&(this.setSelected([this.selected[0]]),this.dispatchEvent(new CustomEvent("selected",{detail:[this.selected[0]]})))}super.update(e)}render(){let e=this.columns.filter(s=>!s.hidden),r=this._getRowHeight();return _`
1347
1342
  <div
1348
1343
  class="table-wrapper"
1349
1344
  style="--rowHeight:${r}px;--fontSize:${this.fontSize}px;--lineClamp:${Math.floor(r/this.fontSize)}"
@@ -1356,6 +1351,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1356
1351
  @columnResize=${this._handleColumnResize}
1357
1352
  ></spectric-table-header>
1358
1353
  <spectric-table-virtual-body
1354
+ .buffer=${this.virtualBodyBuffer}
1359
1355
  .columns=${e}
1360
1356
  .data=${this.data}
1361
1357
  .table=${this}
@@ -1363,11 +1359,11 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1363
1359
  ></spectric-table-virtual-body>
1364
1360
  </div>
1365
1361
  </div>
1366
- ${this.pagination?$`<spectric-pagination
1362
+ ${this.pagination?_`<spectric-pagination
1367
1363
  ${me(this.pagination)}
1368
1364
  @change=${this._handlePaginationChange}
1369
1365
  ></spectric-pagination>`:null}
1370
- `}},ce([g({type:Array,attribute:!1})],h.SpectricTableElement.prototype,"data",2),ce([g({type:Object,attribute:!1})],h.SpectricTableElement.prototype,"pagination",2),ce([g({attribute:!1})],h.SpectricTableElement.prototype,"columns",2),ce([g({type:String,reflect:!0})],h.SpectricTableElement.prototype,"select",2),ce([g({type:String,reflect:!0})],h.SpectricTableElement.prototype,"sort",2),ce([g({type:Array,reflect:!1})],h.SpectricTableElement.prototype,"sortOrder",2),ce([g({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"rowHeight",2),ce([g({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"fontSize",2),ce([F()],h.SpectricTableElement.prototype,"selected",2),h.SpectricTableElement=ce([I(ri)],h.SpectricTableElement);var Na=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,te=(i,e,r,s)=>{for(var t=s>1?void 0:s?Da(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Na(e,r,t),t};const Ma="spectric-popover";let V=class extends ie{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.mouseOffsetX=10,this.mouseOffsetY=0,this.portalTarget=document.body,this.open=!1,this._getMousePosition=i=>{this.mouseLocation={left:i.clientX,top:i.clientY},this.position=="mouse"&&this.open&&!this.mouseframe&&(this.mouseframe=requestAnimationFrame(()=>this.positionTooltip()))},this.applyStyle=i=>{Object.entries(i).forEach(([e,r])=>{this.portalElement.style.setProperty(e,r)})},this.positionTooltip=()=>{if(!this.target)return;let i={};const e=this.target.getBoundingClientRect(),r=this.portalElement.getBoundingClientRect();this.target!==document.body&&this.maxWidth&&this.maxWidth>0&&(r.width=Math.min(r.width,this.maxWidth));let s;this.position==="mouse"&&this.mouseLocation?(this.mouseframe=void 0,s={left:this.mouseLocation.left+this.mouseOffsetX+"px",top:this.mouseLocation.top+this.mouseOffsetY-r.height/2+"px"}):this.position==="top"?s={top:e.top-r.height+"px",left:e.left+e.width/2-r.width/2+"px"}:this.position==="bottom"?s={top:e.bottom+"px",left:e.left+e.width/2-r.width/2+"px"}:this.position==="left"?s={top:Math.max(0,e.top+e.height/2-r.height/2)+"px",left:e.left-r.width+"px"}:this.position==="right"?s={top:Math.max(0,e.top+e.height/2-r.height/2)+"px",left:e.right+"px"}:(s={left:"0px",top:"0px"},console.error("Unknown position... Maybe we sould implement auto?")),this.applyStyle({...i,...s}),this.position!=="mouse"&&this.portalElement.animate({opacity:[0,1]},{duration:this.animationDuration})},this.showPopover=this.showPopover.bind(this),this.hidePopover=this.hidePopover.bind(this),this.addDisposableListener(()=>this.target,"mousemove",this._getMousePosition)}isOpen(){return this.open}get target(){return this.triggerTarget||this.parentElement}createRenderRoot(){return this}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}hidePopover(){this.timer&&clearTimeout(this.timer),this.open=!1,this.portalElement.hidePopover()}async showPopover(){this.timer&&clearTimeout(this.timer),await new Promise(i=>{this.timer=window.setTimeout(i,this.delay)}),this.isConnected&&(this.portalElement.showPopover(),this.open=!0,requestAnimationFrame(this.positionTooltip))}render(){return $`<!-- ToolTip -->
1366
+ `}},X([g({type:Array,attribute:!1})],h.SpectricTableElement.prototype,"data",2),X([g({type:Object,attribute:!1})],h.SpectricTableElement.prototype,"pagination",2),X([g({attribute:!1})],h.SpectricTableElement.prototype,"columns",2),X([g({type:String,reflect:!0})],h.SpectricTableElement.prototype,"select",2),X([g({type:String,reflect:!0})],h.SpectricTableElement.prototype,"sort",2),X([g({type:Array,reflect:!1})],h.SpectricTableElement.prototype,"sortOrder",2),X([g({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"rowHeight",2),X([g({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"fontSize",2),X([g({type:Number,reflect:!1})],h.SpectricTableElement.prototype,"virtualBodyBuffer",2),X([g({type:Object,attribute:!1})],h.SpectricTableElement.prototype,"getRowClass",2),X([F()],h.SpectricTableElement.prototype,"selected",2),h.SpectricTableElement=X([R(ri)],h.SpectricTableElement);var Na=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,re=(i,e,r,s)=>{for(var t=s>1?void 0:s?Da(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Na(e,r,t),t};const Ma="spectric-popover";let V=class extends se{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.mouseOffsetX=10,this.mouseOffsetY=0,this.portalTarget=document.body,this.open=!1,this._getMousePosition=i=>{this.mouseLocation={left:i.clientX,top:i.clientY},this.position=="mouse"&&this.open&&!this.mouseframe&&(this.mouseframe=requestAnimationFrame(()=>this.positionTooltip()))},this.applyStyle=i=>{Object.entries(i).forEach(([e,r])=>{this.portalElement.style.setProperty(e,r)})},this.positionTooltip=()=>{if(!this.target)return;let i={};const e=this.target.getBoundingClientRect(),r=this.portalElement.getBoundingClientRect();this.target!==document.body&&this.maxWidth&&this.maxWidth>0&&(r.width=Math.min(r.width,this.maxWidth));let s;this.position==="mouse"&&this.mouseLocation?(this.mouseframe=void 0,s={left:this.mouseLocation.left+this.mouseOffsetX+"px",top:this.mouseLocation.top+this.mouseOffsetY-r.height/2+"px"}):this.position==="top"?s={top:e.top-r.height+"px",left:e.left+e.width/2-r.width/2+"px"}:this.position==="bottom"?s={top:e.bottom+"px",left:e.left+e.width/2-r.width/2+"px"}:this.position==="left"?s={top:Math.max(0,e.top+e.height/2-r.height/2)+"px",left:e.left-r.width+"px"}:this.position==="right"?s={top:Math.max(0,e.top+e.height/2-r.height/2)+"px",left:e.right+"px"}:(s={left:"0px",top:"0px"},console.error("Unknown position... Maybe we sould implement auto?")),this.applyStyle({...i,...s}),this.position!=="mouse"&&this.portalElement.animate({opacity:[0,1]},{duration:this.animationDuration})},this.showPopover=this.showPopover.bind(this),this.hidePopover=this.hidePopover.bind(this),this.addDisposableListener(()=>this.target,"mousemove",this._getMousePosition)}isOpen(){return this.open}get target(){return this.triggerTarget||this.parentElement}createRenderRoot(){return this}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}hidePopover(){this.timer&&clearTimeout(this.timer),this.open=!1,this.portalElement.hidePopover()}async showPopover(){this.timer&&clearTimeout(this.timer),await new Promise(i=>{this.timer=window.setTimeout(i,this.delay)}),this.isConnected&&(this.portalElement.showPopover(),this.open=!0,requestAnimationFrame(this.positionTooltip))}render(){return _`<!-- ToolTip -->
1371
1367
  <div class="spectric-popover-portal ${this.position}" popover>
1372
1368
  <div class="tooltip-container">
1373
1369
  <span class="tooltip-caret"></span>
@@ -1380,28 +1376,28 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1380
1376
  display: none;
1381
1377
  pointer-events: none;
1382
1378
  }
1383
- `,te([g({type:Number,reflect:!0})],V.prototype,"delay",2),te([g({type:Number,reflect:!0})],V.prototype,"animationDuration",2),te([g({type:String,reflect:!1})],V.prototype,"text",2),te([g({type:String,reflect:!0})],V.prototype,"position",2),te([g({type:Number,reflect:!0})],V.prototype,"maxWidth",2),te([g({type:Number,reflect:!1})],V.prototype,"mouseOffsetX",2),te([g({type:Number,reflect:!1})],V.prototype,"mouseOffsetY",2),te([de(".spectric-popover-portal")],V.prototype,"portalElement",2),te([g({attribute:!1})],V.prototype,"portalTarget",2),te([g({attribute:!1})],V.prototype,"triggerTarget",2),V=te([I(Ma)],V);var za=Object.defineProperty,Ia=Object.getOwnPropertyDescriptor,ke=(i,e,r,s)=>{for(var t=s>1?void 0:s?Ia(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&za(e,r,t),t};const ni="spectric-tooltip";var oi=(i=>(i.top="top",i.bottom="bottom",i.left="left",i.right="right",i.mouse="mouse",i))(oi||{});h.TooltipElement=class extends V{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalTarget=document.body,this.open=!1,this.showToolTip=this.showToolTip.bind(this),this.addDisposableListener(()=>this.target,"mouseover",this.showToolTip),this.addDisposableListener(()=>this.target,"mouseleave",this.hidePopover)}async showToolTip(){await super.showPopover(),this.portalElement.classList.add("spectric-tooltip-portal")}},h.TooltipElement.styles=J`:host{max-height: 0px;
1379
+ `,re([g({type:Number,reflect:!0})],V.prototype,"delay",2),re([g({type:Number,reflect:!0})],V.prototype,"animationDuration",2),re([g({type:String,reflect:!1})],V.prototype,"text",2),re([g({type:String,reflect:!0})],V.prototype,"position",2),re([g({type:Number,reflect:!0})],V.prototype,"maxWidth",2),re([g({type:Number,reflect:!1})],V.prototype,"mouseOffsetX",2),re([g({type:Number,reflect:!1})],V.prototype,"mouseOffsetY",2),re([de(".spectric-popover-portal")],V.prototype,"portalElement",2),re([g({attribute:!1})],V.prototype,"portalTarget",2),re([g({attribute:!1})],V.prototype,"triggerTarget",2),V=re([R(Ma)],V);var za=Object.defineProperty,Ia=Object.getOwnPropertyDescriptor,Ee=(i,e,r,s)=>{for(var t=s>1?void 0:s?Ia(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&za(e,r,t),t};const ni="spectric-tooltip";var oi=(i=>(i.top="top",i.bottom="bottom",i.left="left",i.right="right",i.mouse="mouse",i))(oi||{});h.TooltipElement=class extends V{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalTarget=document.body,this.open=!1,this.showToolTip=this.showToolTip.bind(this),this.addDisposableListener(()=>this.target,"mouseover",this.showToolTip),this.addDisposableListener(()=>this.target,"mouseleave",this.hidePopover)}async showToolTip(){await super.showPopover(),this.portalElement.classList.add("spectric-tooltip-portal")}},h.TooltipElement.styles=J`:host{max-height: 0px;
1384
1380
  max-width: 0px;
1385
1381
  display: none;
1386
- pointer-events:none;}`,ke([g({type:Number,reflect:!0})],h.TooltipElement.prototype,"delay",2),ke([g({type:Number,reflect:!0})],h.TooltipElement.prototype,"animationDuration",2),ke([g({type:String,reflect:!1})],h.TooltipElement.prototype,"text",2),ke([g({type:String,reflect:!0})],h.TooltipElement.prototype,"position",2),ke([g({type:Number,reflect:!0})],h.TooltipElement.prototype,"maxWidth",2),ke([g({attribute:!1})],h.TooltipElement.prototype,"portalTarget",2),ke([g({attribute:!1})],h.TooltipElement.prototype,"triggerTarget",2),h.TooltipElement=ke([I(ni)],h.TooltipElement);var Ra=Object.defineProperty,ja=Object.getOwnPropertyDescriptor,Y=(i,e,r,s)=>{for(var t=s>1?void 0:s?ja(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Ra(e,r,t),t};let ut;window.hasOwnProperty("EyeDropper")&&(ut=new EyeDropper);let W=class extends B{constructor(){super(),this.value="#FF0000FF",this.showAlpha=!0,this.hue=0,this.alpha=1,this.saturation=1,this.lightness=1,this.canvas=Ge(),this.sldown=!1,this._handleAlphaChange=this._handleAlphaChange.bind(this),this._handleHueChange=this._handleHueChange.bind(this),this._handleApply=this._handleApply.bind(this),this._cancel=this._cancel.bind(this),this._handleSaturationLightnessClick=this._handleSaturationLightnessClick.bind(this)}createRenderRoot(){return this}update(i){if(i.has("value")){let{h:e,s:r,l:s,a:t}=vs(this.value);this.hue=e,this.saturation=r,this.lightness=s,this.alpha=t,this.renderHueSaturationGrid()}super.update(i)}renderHueSaturationGrid(){if(!this.canvas.value)return;let e=this.canvas.value.getContext("2d");if(!e)return;let r=this.canvas.value.width/100,s=this.canvas.value.height/100,t=0,o=0;for(let a of Ua(this.hue))e.fillStyle=a,e.fillRect(t,o,r,s),t+=r,t=t%(r*101),t||(o+=s)}_handleSaturationLightnessClick(i){if(!this.canvas.value)return;let{offsetX:e,offsetY:r}=i;this.saturation=e/this.canvas.value.width,this.lightness=(this.canvas.value.height-r)/this.canvas.value.height,this.updateValue()}_handleHueChange(i){i.stopPropagation(),this.hue=parseInt(String(i.target.value))/100*360,i.target.style.setProperty("accent-color",`hsl(${this.hue}deg 100% 50%)`),this.renderHueSaturationGrid(),this.updateValue()}updateValue(){let i=Ha(this.hue,this.saturation*100,this.lightness*100)+Math.round(this.alpha*255).toString(16).padStart(2,"0");this.value=i}_handleAlphaChange(i){i.stopPropagation(),this.alpha=parseInt(String(i.target.value))/100,this.updateValue()}_handleApply(){var i;this.updateValue(),(i=this.querySelector("spectric-popover"))==null||i.hidePopover(),this.dispatchEvent(new Event("change",{bubbles:!0}))}_cancel(){var i;this.original&&(this.value=this.original),(i=this.querySelector("spectric-popover"))==null||i.hidePopover(),this.dispatchEvent(new Event("cancel"))}async _openPopover(){var e;let i=this.querySelector("spectric-popover");if(!(!i||i.isOpen())){for(this.original=this.value,(e=this.querySelector("spectric-popover"))==null||e.showPopover();!this.canvas.value;)await new Promise(r=>setTimeout(r,100));this.renderHueSaturationGrid()}}getPopover(){return $`
1382
+ pointer-events:none;}`,Ee([g({type:Number,reflect:!0})],h.TooltipElement.prototype,"delay",2),Ee([g({type:Number,reflect:!0})],h.TooltipElement.prototype,"animationDuration",2),Ee([g({type:String,reflect:!1})],h.TooltipElement.prototype,"text",2),Ee([g({type:String,reflect:!0})],h.TooltipElement.prototype,"position",2),Ee([g({type:Number,reflect:!0})],h.TooltipElement.prototype,"maxWidth",2),Ee([g({attribute:!1})],h.TooltipElement.prototype,"portalTarget",2),Ee([g({attribute:!1})],h.TooltipElement.prototype,"triggerTarget",2),h.TooltipElement=Ee([R(ni)],h.TooltipElement);var Ra=Object.defineProperty,ja=Object.getOwnPropertyDescriptor,Y=(i,e,r,s)=>{for(var t=s>1?void 0:s?ja(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Ra(e,r,t),t};let pt;window.hasOwnProperty("EyeDropper")&&(pt=new EyeDropper);let W=class extends B{constructor(){super(),this.value="#FF0000FF",this.showAlpha=!0,this.hue=0,this.alpha=1,this.saturation=1,this.lightness=1,this.canvas=Ye(),this.sldown=!1,this._handleAlphaChange=this._handleAlphaChange.bind(this),this._handleHueChange=this._handleHueChange.bind(this),this._handleApply=this._handleApply.bind(this),this._cancel=this._cancel.bind(this),this._handleSaturationLightnessClick=this._handleSaturationLightnessClick.bind(this)}createRenderRoot(){return this}update(i){if(i.has("value")){let{h:e,s:r,l:s,a:t}=vs(this.value);this.hue=e,this.saturation=r,this.lightness=s,this.alpha=t,this.renderHueSaturationGrid()}super.update(i)}renderHueSaturationGrid(){if(!this.canvas.value)return;let e=this.canvas.value.getContext("2d");if(!e)return;let r=this.canvas.value.width/100,s=this.canvas.value.height/100,t=0,o=0;for(let a of Ua(this.hue))e.fillStyle=a,e.fillRect(t,o,r,s),t+=r,t=t%(r*101),t||(o+=s)}_handleSaturationLightnessClick(i){if(!this.canvas.value)return;let{offsetX:e,offsetY:r}=i;this.saturation=e/this.canvas.value.width,this.lightness=(this.canvas.value.height-r)/this.canvas.value.height,this.updateValue()}_handleHueChange(i){i.stopPropagation(),this.hue=parseInt(String(i.target.value))/100*360,i.target.style.setProperty("accent-color",`hsl(${this.hue}deg 100% 50%)`),this.renderHueSaturationGrid(),this.updateValue()}updateValue(){let i=Ha(this.hue,this.saturation*100,this.lightness*100)+Math.round(this.alpha*255).toString(16).padStart(2,"0");this.value=i}_handleAlphaChange(i){i.stopPropagation(),this.alpha=parseInt(String(i.target.value))/100,this.updateValue()}_handleApply(){var i;this.updateValue(),(i=this.querySelector("spectric-popover"))==null||i.hidePopover(),this.dispatchEvent(new Event("change",{bubbles:!0}))}_cancel(){var i;this.original&&(this.value=this.original),(i=this.querySelector("spectric-popover"))==null||i.hidePopover(),this.dispatchEvent(new Event("cancel"))}async _openPopover(){var e;let i=this.querySelector("spectric-popover");if(!(!i||i.isOpen())){for(this.original=this.value,(e=this.querySelector("spectric-popover"))==null||e.showPopover();!this.canvas.value;)await new Promise(r=>setTimeout(r,100));this.renderHueSaturationGrid()}}getPopover(){return _`
1387
1383
  <spectric-input label="Hue" class="hue-gradient" variant="range" .value=${this.hue||0} style="accent-color:hsl(${this.hue}deg 100% 50%)" @change=${this._handleHueChange}></spectric-input>
1388
- <canvas ${Ye(this.canvas)} width=200 height=100 class="color-picker-saturation-lightness-grid" @click=${this._handleSaturationLightnessClick}
1384
+ <canvas ${Ze(this.canvas)} width=200 height=100 class="color-picker-saturation-lightness-grid" @click=${this._handleSaturationLightnessClick}
1389
1385
  @mousedown=${i=>{this.sldown=!0,i.preventDefault(),i.stopPropagation()}}
1390
1386
  @mouseup=${i=>{this.sldown=!1,i.preventDefault(),i.stopPropagation()}}
1391
1387
  @mousemove=${i=>{this.sldown&&this._handleSaturationLightnessClick(i)}}
1392
1388
  ></canvas>
1393
1389
  <spectric-input class="alpha-gradient" ?hidden=${!this.showAlpha} label="Opacity" variant="range" .value=${(this.alpha||1)*100} @change=${this._handleAlphaChange}></spectric-input>
1394
1390
  <div class="color-picker-footer">
1395
- <spectric-button icon class="color-picker-eyedropper ${ut===void 0?"hidden":""}" @click=${async()=>{if(ut){let i=await(ut==null?void 0:ut.open()),{h:e,s:r,l:s,a:t}=vs(i.sRGBHex);this.hue=e,this.saturation=r,this.lightness=s,this.alpha=t,this.updateValue()}}}>${Ba}</spectric-button>
1391
+ <spectric-button icon class="color-picker-eyedropper ${pt===void 0?"hidden":""}" @click=${async()=>{if(pt){let i=await(pt==null?void 0:pt.open()),{h:e,s:r,l:s,a:t}=vs(i.sRGBHex);this.hue=e,this.saturation=r,this.lightness=s,this.alpha=t,this.updateValue()}}}>${Ba}</spectric-button>
1396
1392
  <spectric-button @click=${this._handleApply}>Apply</spectric-button>
1397
1393
  <spectric-button variant="secondary" @click=${this._cancel}>Cancel</spectric-button>
1398
1394
  </div>
1399
- `}render(){return $`
1395
+ `}render(){return _`
1400
1396
  <spectric-button variant="secondary" @click=${this._openPopover} icon>
1401
1397
  <spectric-popover .text=${this.getPopover()} icon variant="text"></spectric-popover>
1402
1398
  <div style="width:15px;height:15px;background-color:${this.value}"></div>
1403
1399
  </spectric-button>
1404
- `}};Y([g({type:String,reflect:!0})],W.prototype,"value",2),Y([g({type:Boolean,reflect:!0})],W.prototype,"showAlpha",2),Y([F()],W.prototype,"hue",2),Y([F()],W.prototype,"alpha",2),Y([F()],W.prototype,"saturation",2),Y([F()],W.prototype,"lightness",2),Y([Le({capture:!0})],W.prototype,"_handleSaturationLightnessClick",1),Y([Le({capture:!0})],W.prototype,"_handleHueChange",1),Y([Le({capture:!0})],W.prototype,"_handleAlphaChange",1),Y([Le({capture:!0})],W.prototype,"_handleApply",1),Y([Le({capture:!0})],W.prototype,"_cancel",1),Y([Le({capture:!0})],W.prototype,"_openPopover",1),W=Y([I("spectric-colorpicker")],W);const Ba=$`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" height="15" width="15" fill="currentColor"><path d="M222,67.34a33.81,33.81,0,0,0-10.64-24.25C198.12,30.56,176.68,31,163.54,44.18L142.82,65l-.63-.63a22,22,0,0,0-31.11,0l-9,9a14,14,0,0,0,0,19.81l3.47,3.47L53.14,149.1a37.79,37.79,0,0,0-9.84,36.73l-8.31,19a11.68,11.68,0,0,0,2.46,13A13.91,13.91,0,0,0,47.32,222,14.15,14.15,0,0,0,53,220.82L71,212.92a37.92,37.92,0,0,0,35.84-10.07l52.44-52.46,3.47,3.48a14,14,0,0,0,19.8,0l9-9a22,22,0,0,0,0-31.12l-.66-.66L212,91.85A33.76,33.76,0,0,0,222,67.34Zm-123.61,127a26,26,0,0,1-26,6.47,6,6,0,0,0-4.16.24l-20,8.75a2,2,0,0,1-2.09-.31l9.12-20.9a5.94,5.94,0,0,0,.19-4.31,25.88,25.88,0,0,1,6.26-26.72l52.44-52.45,36.76,36.78Zm105.16-111L178.17,108.9a6,6,0,0,0,0,8.47l4.88,4.89a10,10,0,0,1,0,14.15l-9,9a2,2,0,0,1-2.82,0l-60.69-60.7a2,2,0,0,1,0-2.83l9-9a10,10,0,0,1,14.14,0l4.89,4.89a6,6,0,0,0,4.24,1.75h0a6,6,0,0,0,4.25-1.77L172,52.66c8.58-8.58,22.52-9,31.08-.85a22,22,0,0,1,.44,31.57Z"/></svg>`;function*Ua(i){for(let e=100;e>=0;e--)for(let r=0;r<=100;r++)yield`hsl(${i}, ${r}%, ${e}%)`}function Ha(i,e,r){r/=100;const s=e*Math.min(r,1-r)/100,t=o=>{const a=(o+i/30)%12,d=r-s*Math.max(Math.min(a-3,9-a,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${t(0)}${t(8)}${t(4)}`}function vs(i){let e=0,r=0,s=0,t=255;i.length===4||i.length===5?(e=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),s=parseInt(i[3]+i[3],16),i.length===5&&(t=parseInt(i[4]+i[4],16))):(i.length===7||i.length===9)&&(e=parseInt(i.substring(1,3),16),r=parseInt(i.substring(3,5),16),s=parseInt(i.substring(5,7),16),i.length===9&&(t=parseInt(i.substring(7,9),16))),e/=255,r/=255,s/=255,t/=255;const o=Math.max(e,r,s),a=Math.min(e,r,s);let d=0,c=0,b=(o+a)/2;if(o===a)d=0,c=0;else{const _=o-a;switch(c=b>.5?_/(2-o-a):_/(o+a),o){case e:d=(r-s)/_+(r<s?6:0);break;case r:d=(s-e)/_+2;break;case s:d=(e-r)/_+4;break}d/=6}return d=Math.round(d*360),{h:d,s:c,l:b,a:t}}const Fa=Object.freeze(Object.defineProperty({__proto__:null,SpreadPropsDirective:Mr,debounce:Gi,debounceAnimation:Ot,once:bs,spreadProps:me},Symbol.toStringTag,{value:"Module"}));var Qa=Object.defineProperty,qa=Object.getOwnPropertyDescriptor,pt=(i,e,r,s)=>{for(var t=s>1?void 0:s?qa(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Qa(e,r,t),t};h.SpectricCalendar=class extends ie{constructor(){super(),this.currentDate=new Date,this.date=new Date,this.popup=!1,this.disabled=!1,this.handleMouseMove=Ot(async e=>{const r=await this.calendarElement,s=r.getBoundingClientRect(),t=(e.clientX-s.left)/s.width*100,o=(e.clientY-s.top)/s.height*100;r.style.setProperty("--x",`${t}%`),r.style.setProperty("--y",`${o}%`)}),this.resetMouseMove=async()=>{const e=await this.calendarElement;e.style.setProperty("--x","200%"),e.style.setProperty("--y","200%")},this.addDisposableListener(this.calendarElement,"mousemove",this.handleMouseMove),this.addDisposableListener(this.calendarElement,"mouseleave",this.resetMouseMove)}createRenderRoot(){return this}getMonthDays(e,r){const s=new Date(e,r,1),t=[],o=s.getUTCDay(),a=new Date(e,r+1,0).getUTCDate();for(let d=0;d<o;d++)t.push("");for(let d=1;d<=a;d++)t.push(d);return t}changeMonth(e){const r=new Date(this.date);r.setUTCMonth(r.getUTCMonth()+e),this.currentDate=r}changeYear(e){const r=parseInt(e.target.value,10),s=new Date(this.date);s.setUTCFullYear(r),this.currentDate=s}selectDay(e){let r=this.date.getUTCFullYear(),s=this.date.getUTCMonth(),t=this.date.getUTCHours(),o=this.date.getUTCMinutes(),a=this.date.getUTCSeconds(),d=this.date.getUTCMilliseconds(),c=new Date;c.setUTCFullYear(r,s,e),c.setUTCHours(t,o,a,d),console.log(c.toISOString(),r,s,e),this.date=c;let b=this.querySelector("spectric-popover");b&&b.hidePopover(),this.dispatchEvent(new CustomEvent("select",{detail:c}))}update(e){e.has("currentDate")&&(this.currentDate===void 0?this.date=new Date:this.date=new Date(this.currentDate)),super.update(e)}render(){const e=this.date.getUTCFullYear(),r=this.date.getUTCMonth(),s=this.date.getUTCDate();this.date.toUTCString();const t=new Date(e,r,s).toLocaleString("default",{month:"long"}),o=this.getMonthDays(e,r),a=Array.from({length:21},(c,b)=>e-10+b),d=$`<spectric-panel class="calendar">
1400
+ `}};Y([g({type:String,reflect:!0})],W.prototype,"value",2),Y([g({type:Boolean,reflect:!0})],W.prototype,"showAlpha",2),Y([F()],W.prototype,"hue",2),Y([F()],W.prototype,"alpha",2),Y([F()],W.prototype,"saturation",2),Y([F()],W.prototype,"lightness",2),Y([Ne({capture:!0})],W.prototype,"_handleSaturationLightnessClick",1),Y([Ne({capture:!0})],W.prototype,"_handleHueChange",1),Y([Ne({capture:!0})],W.prototype,"_handleAlphaChange",1),Y([Ne({capture:!0})],W.prototype,"_handleApply",1),Y([Ne({capture:!0})],W.prototype,"_cancel",1),Y([Ne({capture:!0})],W.prototype,"_openPopover",1),W=Y([R("spectric-colorpicker")],W);const Ba=_`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" height="15" width="15" fill="currentColor"><path d="M222,67.34a33.81,33.81,0,0,0-10.64-24.25C198.12,30.56,176.68,31,163.54,44.18L142.82,65l-.63-.63a22,22,0,0,0-31.11,0l-9,9a14,14,0,0,0,0,19.81l3.47,3.47L53.14,149.1a37.79,37.79,0,0,0-9.84,36.73l-8.31,19a11.68,11.68,0,0,0,2.46,13A13.91,13.91,0,0,0,47.32,222,14.15,14.15,0,0,0,53,220.82L71,212.92a37.92,37.92,0,0,0,35.84-10.07l52.44-52.46,3.47,3.48a14,14,0,0,0,19.8,0l9-9a22,22,0,0,0,0-31.12l-.66-.66L212,91.85A33.76,33.76,0,0,0,222,67.34Zm-123.61,127a26,26,0,0,1-26,6.47,6,6,0,0,0-4.16.24l-20,8.75a2,2,0,0,1-2.09-.31l9.12-20.9a5.94,5.94,0,0,0,.19-4.31,25.88,25.88,0,0,1,6.26-26.72l52.44-52.45,36.76,36.78Zm105.16-111L178.17,108.9a6,6,0,0,0,0,8.47l4.88,4.89a10,10,0,0,1,0,14.15l-9,9a2,2,0,0,1-2.82,0l-60.69-60.7a2,2,0,0,1,0-2.83l9-9a10,10,0,0,1,14.14,0l4.89,4.89a6,6,0,0,0,4.24,1.75h0a6,6,0,0,0,4.25-1.77L172,52.66c8.58-8.58,22.52-9,31.08-.85a22,22,0,0,1,.44,31.57Z"/></svg>`;function*Ua(i){for(let e=100;e>=0;e--)for(let r=0;r<=100;r++)yield`hsl(${i}, ${r}%, ${e}%)`}function Ha(i,e,r){r/=100;const s=e*Math.min(r,1-r)/100,t=o=>{const a=(o+i/30)%12,d=r-s*Math.max(Math.min(a-3,9-a,1),-1);return Math.round(255*d).toString(16).padStart(2,"0")};return`#${t(0)}${t(8)}${t(4)}`}function vs(i){let e=0,r=0,s=0,t=255;i.length===4||i.length===5?(e=parseInt(i[1]+i[1],16),r=parseInt(i[2]+i[2],16),s=parseInt(i[3]+i[3],16),i.length===5&&(t=parseInt(i[4]+i[4],16))):(i.length===7||i.length===9)&&(e=parseInt(i.substring(1,3),16),r=parseInt(i.substring(3,5),16),s=parseInt(i.substring(5,7),16),i.length===9&&(t=parseInt(i.substring(7,9),16))),e/=255,r/=255,s/=255,t/=255;const o=Math.max(e,r,s),a=Math.min(e,r,s);let d=0,u=0,b=(o+a)/2;if(o===a)d=0,u=0;else{const y=o-a;switch(u=b>.5?y/(2-o-a):y/(o+a),o){case e:d=(r-s)/y+(r<s?6:0);break;case r:d=(s-e)/y+2;break;case s:d=(e-r)/y+4;break}d/=6}return d=Math.round(d*360),{h:d,s:u,l:b,a:t}}const Fa=Object.freeze(Object.defineProperty({__proto__:null,SpreadPropsDirective:zr,debounce:Gi,debounceAnimation:Pt,once:bs,spreadProps:me},Symbol.toStringTag,{value:"Module"}));var Qa=Object.defineProperty,qa=Object.getOwnPropertyDescriptor,ht=(i,e,r,s)=>{for(var t=s>1?void 0:s?qa(e,r):e,o=i.length-1,a;o>=0;o--)(a=i[o])&&(t=(s?a(e,r,t):a(t))||t);return s&&t&&Qa(e,r,t),t};h.SpectricCalendar=class extends se{constructor(){super(),this.currentDate=new Date,this.date=new Date,this.popup=!1,this.disabled=!1,this.handleMouseMove=Pt(async e=>{const r=await this.calendarElement,s=r.getBoundingClientRect(),t=(e.clientX-s.left)/s.width*100,o=(e.clientY-s.top)/s.height*100;r.style.setProperty("--x",`${t}%`),r.style.setProperty("--y",`${o}%`)}),this.resetMouseMove=async()=>{const e=await this.calendarElement;e.style.setProperty("--x","200%"),e.style.setProperty("--y","200%")},this.addDisposableListener(this.calendarElement,"mousemove",this.handleMouseMove),this.addDisposableListener(this.calendarElement,"mouseleave",this.resetMouseMove)}createRenderRoot(){return this}getMonthDays(e,r){const s=new Date(e,r,1),t=[],o=s.getUTCDay(),a=new Date(e,r+1,0).getUTCDate();for(let d=0;d<o;d++)t.push("");for(let d=1;d<=a;d++)t.push(d);return t}changeMonth(e){const r=new Date(this.date);r.setUTCMonth(r.getUTCMonth()+e),this.currentDate=r}changeYear(e){const r=parseInt(e.target.value,10),s=new Date(this.date);s.setUTCFullYear(r),this.currentDate=s}selectDay(e){let r=this.date.getUTCFullYear(),s=this.date.getUTCMonth(),t=this.date.getUTCHours(),o=this.date.getUTCMinutes(),a=this.date.getUTCSeconds(),d=this.date.getUTCMilliseconds(),u=new Date;u.setUTCFullYear(r,s,e),u.setUTCHours(t,o,a,d),console.log(u.toISOString(),r,s,e),this.date=u;let b=this.querySelector("spectric-popover");b&&b.hidePopover(),this.dispatchEvent(new CustomEvent("select",{detail:u}))}update(e){e.has("currentDate")&&(this.currentDate===void 0?this.date=new Date:this.date=new Date(this.currentDate)),super.update(e)}render(){const e=this.date.getUTCFullYear(),r=this.date.getUTCMonth(),s=this.date.getUTCDate();this.date.toUTCString();const t=new Date(e,r,s).toLocaleString("default",{month:"long"}),o=this.getMonthDays(e,r),a=Array.from({length:21},(u,b)=>e-10+b),d=_`<spectric-panel class="calendar">
1405
1401
  <div class="header">
1406
1402
  <spectric-button
1407
1403
  ?disabled=${this.disabled}
@@ -1414,7 +1410,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1414
1410
  <div class="month-year">
1415
1411
  <span>${t}</span>
1416
1412
  <select ?disabled=${this.disabled} @change=${this.changeYear}>
1417
- ${a.map(c=>$`<option value=${c} ?selected=${c===e}>${c}</option>`)}
1413
+ ${a.map(u=>_`<option value=${u} ?selected=${u===e}>${u}</option>`)}
1418
1414
  </select>
1419
1415
  </div>
1420
1416
  <spectric-button ?disabled=${this.disabled} size="xsmall" icon @click=${()=>this.changeMonth(1)}
@@ -1422,18 +1418,18 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1422
1418
  >
1423
1419
  </div>
1424
1420
  <div class="days">
1425
- ${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(c=>$`<div class="day">${c}</div>`)}
1426
- ${o.map(c=>c==""?$`<span></span>`:$`<spectric-button
1421
+ ${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(u=>_`<div class="day">${u}</div>`)}
1422
+ ${o.map(u=>u==""?_`<span></span>`:_`<spectric-button
1427
1423
  ?disabled=${this.disabled}
1428
- @click=${()=>this.selectDay(c)}
1429
- .backgroundColor=${c===s?void 0:"var(--spectric-background,#f4f4f4)"}
1424
+ @click=${()=>this.selectDay(u)}
1425
+ .backgroundColor=${u===s?void 0:"var(--spectric-background,#f4f4f4)"}
1430
1426
  icon
1431
1427
  size="xsmall"
1432
- class="date ${c===s?"active":""}"
1433
- >${c}</spectric-button
1428
+ class="date ${u===s?"active":""}"
1429
+ >${u}</spectric-button
1434
1430
  >`)}
1435
1431
  </div>
1436
- </spectric-panel>`;return this.popup?$`
1432
+ </spectric-panel>`;return this.popup?_`
1437
1433
  <spectric-button
1438
1434
  class="input-button-right"
1439
1435
  icon
@@ -1441,7 +1437,7 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1441
1437
  variant="text"
1442
1438
  type="button"
1443
1439
  ?disabled=${this.disabled}
1444
- @click=${c=>{let b=this.querySelector("spectric-popover");b&&c.target&&(b.triggerTarget=c.target,b.showPopover())}}
1440
+ @click=${u=>{let b=this.querySelector("spectric-popover");b&&u.target&&(b.triggerTarget=u.target,b.showPopover())}}
1445
1441
  ><svg
1446
1442
  xmlns="http://www.w3.org/2000/svg"
1447
1443
  xmlns:xlink="http://www.w3.org/1999/xlink"
@@ -1483,5 +1479,5 @@ Expecting `+dt.join(", ")+", got '"+(this.terminals_[z]||z)+"'":ft="Parse error
1483
1479
  </g></svg>
1484
1480
  </spectric-button>
1485
1481
  <spectric-popover position="left" .text=${d}></spectric-popover>
1486
- `:d}},pt([At(".days")],h.SpectricCalendar.prototype,"calendarElement",2),pt([g({attribute:!1})],h.SpectricCalendar.prototype,"currentDate",2),pt([F()],h.SpectricCalendar.prototype,"date",2),pt([g({type:Boolean,reflect:!0})],h.SpectricCalendar.prototype,"popup",2),pt([g({type:Boolean,reflect:!0})],h.SpectricCalendar.prototype,"disabled",2),h.SpectricCalendar=pt([I("spectric-calendar")],h.SpectricCalendar);const Va={...ba,...Object.freeze(Object.defineProperty({__proto__:null,get BitDisplayCanvas(){return h.BitDisplayCanvas},ButtonSizes:Ar,ButtonVariants:Cr,CSSPropsControls:cs,get DialogElement(){return h.DialogElement},DialogElementTag:ir,ElementTag:Xr,GeospatialOperators:sr,get Header(){return h.Header},InputVariants:Ir,Orientations:Kr,get PaginationElement(){return h.PaginationElement},PaginationElementTag:ei,SPECTRIC_CSS_VARIABLES:ds,get SpectricButton(){return h.SpectricButton},get SpectricCalendar(){return h.SpectricCalendar},get SpectricInput(){return h.SpectricInput},get SpectricPage(){return h.SpectricPage},get SpectricPanel(){return h.SpectricPanel},get SpectricQuery(){return h.SpectricQuery},get SpectricTableElement(){return h.SpectricTableElement},get SpectricThemeProvider(){return h.SpectricThemeProvider},get SplitView(){return h.SplitView},SupportedLanguages:Zr,TD_BorderAndPadding:ct,TableElementTag:ri,TableSelectOptions:ii,TableSortDirection:q,TableSortOption:si,ThemeSelections:hs,get TooltipElement(){return h.TooltipElement},TooltipElementTag:ni,TooltipPostions:oi,nodeTypes:le,toLabelValue:Dt},Symbol.toStringTag,{value:"Module"})),...Fa};h.BitArray=Nr,h.ButtonSizes=Ar,h.ButtonVariants=Cr,h.CSSPropsControls=cs,h.DialogElementTag=ir,h.DisposableElement=ie,h.ElementTag=Xr,h.GeospatialOperators=sr,h.InputVariants=Ir,h.Orientations=Kr,h.PaginationElementTag=ei,h.SPECTRIC_CSS_VARIABLES=ds,h.SpreadPropsDirective=Mr,h.SupportedLanguages=Zr,h.TD_BorderAndPadding=ct,h.TableElementTag=ri,h.TableSelectOptions=ii,h.TableSortDirection=q,h.TableSortOption=si,h.ThemeSelections=hs,h.TooltipElementTag=ni,h.TooltipPostions=oi,h.debounce=Gi,h.debounceAnimation=Ot,h.default=Va,h.getListeners=Hi,h.nodeTypes=le,h.once=bs,h.spreadProps=me,h.toLabelValue=Dt,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1482
+ `:d}},ht([Ct(".days")],h.SpectricCalendar.prototype,"calendarElement",2),ht([g({attribute:!1})],h.SpectricCalendar.prototype,"currentDate",2),ht([F()],h.SpectricCalendar.prototype,"date",2),ht([g({type:Boolean,reflect:!0})],h.SpectricCalendar.prototype,"popup",2),ht([g({type:Boolean,reflect:!0})],h.SpectricCalendar.prototype,"disabled",2),h.SpectricCalendar=ht([R("spectric-calendar")],h.SpectricCalendar);const Va={...ba,...Object.freeze(Object.defineProperty({__proto__:null,get BitDisplayCanvas(){return h.BitDisplayCanvas},ButtonSizes:Cr,ButtonVariants:Or,CSSPropsControls:cs,get DialogElement(){return h.DialogElement},DialogElementTag:sr,ElementTag:Xr,GeospatialOperators:nr,get Header(){return h.Header},InputVariants:Rr,Orientations:Kr,get PaginationElement(){return h.PaginationElement},PaginationElementTag:ei,SPECTRIC_CSS_VARIABLES:ds,get SpectricButton(){return h.SpectricButton},get SpectricCalendar(){return h.SpectricCalendar},get SpectricInput(){return h.SpectricInput},get SpectricPage(){return h.SpectricPage},get SpectricPanel(){return h.SpectricPanel},get SpectricQuery(){return h.SpectricQuery},get SpectricTableElement(){return h.SpectricTableElement},get SpectricThemeProvider(){return h.SpectricThemeProvider},get SplitView(){return h.SplitView},SupportedLanguages:Zr,TD_BorderAndPadding:ut,TableElementTag:ri,TableSelectOptions:ii,TableSortDirection:q,TableSortOption:si,ThemeSelections:hs,get TooltipElement(){return h.TooltipElement},TooltipElementTag:ni,TooltipPostions:oi,nodeTypes:ce,toLabelValue:Mt},Symbol.toStringTag,{value:"Module"})),...Fa};h.BitArray=Dr,h.ButtonSizes=Cr,h.ButtonVariants=Or,h.CSSPropsControls=cs,h.DialogElementTag=sr,h.DisposableElement=se,h.ElementTag=Xr,h.GeospatialOperators=nr,h.InputVariants=Rr,h.Orientations=Kr,h.PaginationElementTag=ei,h.SPECTRIC_CSS_VARIABLES=ds,h.SpreadPropsDirective=zr,h.SupportedLanguages=Zr,h.TD_BorderAndPadding=ut,h.TableElementTag=ri,h.TableSelectOptions=ii,h.TableSortDirection=q,h.TableSortOption=si,h.ThemeSelections=hs,h.TooltipElementTag=ni,h.TooltipPostions=oi,h.debounce=Gi,h.debounceAnimation=Pt,h.default=Va,h.getListeners=Hi,h.nodeTypes=ce,h.once=bs,h.spreadProps=me,h.toLabelValue=Mt,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1487
1483
  //# sourceMappingURL=index.umd.js.map