@spectric/ui 0.0.11 → 0.0.12

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.
Files changed (40) hide show
  1. package/dist/classes/DisposibleElement.d.ts +4 -2
  2. package/dist/components/Bitdisplay.d.ts +4 -4
  3. package/dist/components/Button.d.ts +1 -1
  4. package/dist/components/Header.d.ts +1 -1
  5. package/dist/components/input.d.ts +13 -12
  6. package/dist/components/splitview/splitview.d.ts +5 -5
  7. package/dist/components/table/body.d.ts +2 -1
  8. package/dist/components/table/cell.d.ts +1 -0
  9. package/dist/components/table/table.d.ts +10 -6
  10. package/dist/components/table/virtualBody.d.ts +49 -0
  11. package/dist/components/tooltip/tooltip.d.ts +15 -10
  12. package/dist/custom-elements.json +23 -9
  13. package/dist/index.es.js +1930 -1763
  14. package/dist/index.es.js.map +1 -1
  15. package/dist/index.umd.js +124 -91
  16. package/dist/index.umd.js.map +1 -1
  17. package/dist/style.css +1 -1
  18. package/package.json +1 -1
  19. package/src/classes/DisposibleElement.ts +15 -9
  20. package/src/components/Bitdisplay.ts +7 -7
  21. package/src/components/Button.ts +1 -1
  22. package/src/components/Header.ts +1 -1
  23. package/src/components/input.ts +18 -14
  24. package/src/components/splitview/splitview.ts +5 -5
  25. package/src/components/table/body.ts +13 -5
  26. package/src/components/table/cell.ts +4 -1
  27. package/src/components/table/header.ts +7 -2
  28. package/src/components/table/table.css +10 -6
  29. package/src/components/table/table.ts +45 -16
  30. package/src/components/table/virtualBody.css +13 -0
  31. package/src/components/table/virtualBody.ts +127 -0
  32. package/src/components/tooltip/tooltip.ts +36 -30
  33. package/src/docs/HTML-Vue-Python Integration.mdx +3 -3
  34. package/src/docs/html-include.png +0 -0
  35. package/src/docs/vue-example.png +0 -0
  36. package/src/docs/vue-include.png +0 -0
  37. package/src/stories/BitDisplay.stories.ts +2 -0
  38. package/src/stories/fixtures/data.ts +1 -1
  39. package/src/stories/pagination.stories.ts +2 -1
  40. package/src/stories/table.stories.ts +4 -2
package/dist/index.umd.js CHANGED
@@ -1,30 +1,30 @@
1
- (function(d,G){typeof exports=="object"&&typeof module<"u"?G(exports):typeof define=="function"&&define.amd?define(["exports"],G):(d=typeof globalThis<"u"?globalThis:d||self,G(d["Spectric-UI"]={}))})(this,function(d){"use strict";/**
1
+ (function(d,te){typeof exports=="object"&&typeof module<"u"?te(exports):typeof define=="function"&&define.amd?define(["exports"],te):(d=typeof globalThis<"u"?globalThis:d||self,te(d["Spectric-UI"]={}))})(this,function(d){"use strict";/**
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */var ii;const G=globalThis,St=G.ShadowRoot&&(G.ShadyCSS===void 0||G.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,At=Symbol(),lr=new WeakMap;let pr=class{constructor(r,s,i){if(this._$cssResult$=!0,i!==At)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=s}get styleSheet(){let r=this.o;const s=this.t;if(St&&r===void 0){const i=s!==void 0&&s.length===1;i&&(r=lr.get(s)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),i&&lr.set(s,r))}return r}toString(){return this.cssText}};const us=o=>new pr(typeof o=="string"?o:o+"",void 0,At),M=(o,...r)=>{const s=o.length===1?o[0]:r.reduce((i,a,e)=>i+(p=>{if(p._$cssResult$===!0)return p.cssText;if(typeof p=="number")return p;throw Error("Value passed to 'css' function must be a 'css' function result: "+p+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(a)+o[e+1],o[0]);return new pr(s,o,At)},ds=(o,r)=>{if(St)o.adoptedStyleSheets=r.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of r){const i=document.createElement("style"),a=G.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=s.cssText,o.appendChild(i)}},ur=St?o=>o:o=>o instanceof CSSStyleSheet?(r=>{let s="";for(const i of r.cssRules)s+=i.cssText;return us(s)})(o):o;/**
5
+ */var mi;const te=globalThis,Ot=te.ShadowRoot&&(te.ShadyCSS===void 0||te.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Dt=Symbol(),$r=new WeakMap;let wr=class{constructor(t,s,i){if(this._$cssResult$=!0,i!==Dt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=s}get styleSheet(){let t=this.o;const s=this.t;if(Ot&&t===void 0){const i=s!==void 0&&s.length===1;i&&(t=$r.get(s)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&$r.set(s,t))}return t}toString(){return this.cssText}};const Es=o=>new wr(typeof o=="string"?o:o+"",void 0,Dt),H=(o,...t)=>{const s=o.length===1?o[0]:t.reduce((i,n,e)=>i+(p=>{if(p._$cssResult$===!0)return p.cssText;if(typeof p=="number")return p;throw Error("Value passed to 'css' function must be a 'css' function result: "+p+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+o[e+1],o[0]);return new wr(s,o,Dt)},ks=(o,t)=>{if(Ot)o.adoptedStyleSheets=t.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of t){const i=document.createElement("style"),n=te.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=s.cssText,o.appendChild(i)}},_r=Ot?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let s="";for(const i of t.cssRules)s+=i.cssText;return Es(s)})(o):o;/**
6
6
  * @license
7
7
  * Copyright 2017 Google LLC
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
- */const{is:hs,defineProperty:fs,getOwnPropertyDescriptor:gs,getOwnPropertyNames:bs,getOwnPropertySymbols:vs,getPrototypeOf:ms}=Object,J=globalThis,dr=J.trustedTypes,ys=dr?dr.emptyScript:"",xt=J.reactiveElementPolyfillSupport,Te=(o,r)=>o,Ve={toAttribute(o,r){switch(r){case Boolean:o=o?ys:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,r){let s=o;switch(r){case Boolean:s=o!==null;break;case Number:s=o===null?null:Number(o);break;case Object:case Array:try{s=JSON.parse(o)}catch{s=null}}return s}},Et=(o,r)=>!hs(o,r),hr={attribute:!0,type:String,converter:Ve,reflect:!1,hasChanged:Et};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),J.litPropertyMetadata??(J.litPropertyMetadata=new WeakMap);class be extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??(this.l=[])).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,s=hr){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(r,s),!s.noAccessor){const i=Symbol(),a=this.getPropertyDescriptor(r,i,s);a!==void 0&&fs(this.prototype,r,a)}}static getPropertyDescriptor(r,s,i){const{get:a,set:e}=gs(this.prototype,r)??{get(){return this[s]},set(p){this[s]=p}};return{get(){return a==null?void 0:a.call(this)},set(p){const g=a==null?void 0:a.call(this);e.call(this,p),this.requestUpdate(r,g,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??hr}static _$Ei(){if(this.hasOwnProperty(Te("elementProperties")))return;const r=ms(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(Te("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Te("properties"))){const s=this.properties,i=[...bs(s),...vs(s)];for(const a of i)this.createProperty(a,s[a])}const r=this[Symbol.metadata];if(r!==null){const s=litPropertyMetadata.get(r);if(s!==void 0)for(const[i,a]of s)this.elementProperties.set(i,a)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const a=this._$Eu(s,i);a!==void 0&&this._$Eh.set(a,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){const s=[];if(Array.isArray(r)){const i=new Set(r.flat(1/0).reverse());for(const a of i)s.unshift(ur(a))}else r!==void 0&&s.push(ur(r));return s}static _$Eu(r,s){const i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof r=="string"?r.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var r;this._$ES=new Promise(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),(r=this.constructor.l)==null||r.forEach(s=>s(this))}addController(r){var s;(this._$EO??(this._$EO=new Set)).add(r),this.renderRoot!==void 0&&this.isConnected&&((s=r.hostConnected)==null||s.call(r))}removeController(r){var s;(s=this._$EO)==null||s.delete(r)}_$E_(){const r=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(r.set(i,this[i]),delete this[i]);r.size>0&&(this._$Ep=r)}createRenderRoot(){const r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ds(r,this.constructor.elementStyles),r}connectedCallback(){var r;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostConnected)==null?void 0:i.call(s)})}enableUpdating(r){}disconnectedCallback(){var r;(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostDisconnected)==null?void 0:i.call(s)})}attributeChangedCallback(r,s,i){this._$AK(r,i)}_$EC(r,s){var e;const i=this.constructor.elementProperties.get(r),a=this.constructor._$Eu(r,i);if(a!==void 0&&i.reflect===!0){const p=(((e=i.converter)==null?void 0:e.toAttribute)!==void 0?i.converter:Ve).toAttribute(s,i.type);this._$Em=r,p==null?this.removeAttribute(a):this.setAttribute(a,p),this._$Em=null}}_$AK(r,s){var e;const i=this.constructor,a=i._$Eh.get(r);if(a!==void 0&&this._$Em!==a){const p=i.getPropertyOptions(a),g=typeof p.converter=="function"?{fromAttribute:p.converter}:((e=p.converter)==null?void 0:e.fromAttribute)!==void 0?p.converter:Ve;this._$Em=a,this[a]=g.fromAttribute(s,p.type),this._$Em=null}}requestUpdate(r,s,i){if(r!==void 0){if(i??(i=this.constructor.getPropertyOptions(r)),!(i.hasChanged??Et)(this[r],s))return;this.P(r,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(r,s,i){this._$AL.has(r)||this._$AL.set(r,s),i.reflect===!0&&this._$Em!==r&&(this._$Ej??(this._$Ej=new Set)).add(r)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const r=this.scheduleUpdate();return r!=null&&await r,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[e,p]of this._$Ep)this[e]=p;this._$Ep=void 0}const a=this.constructor.elementProperties;if(a.size>0)for(const[e,p]of a)p.wrapped!==!0||this._$AL.has(e)||this[e]===void 0||this.P(e,this[e],p)}let r=!1;const s=this._$AL;try{r=this.shouldUpdate(s),r?(this.willUpdate(s),(i=this._$EO)==null||i.forEach(a=>{var e;return(e=a.hostUpdate)==null?void 0:e.call(a)}),this.update(s)):this._$EU()}catch(a){throw r=!1,this._$EU(),a}r&&this._$AE(s)}willUpdate(r){}_$AE(r){var s;(s=this._$EO)==null||s.forEach(i=>{var a;return(a=i.hostUpdated)==null?void 0:a.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(r)),this.updated(r)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(r){return!0}update(r){this._$Ej&&(this._$Ej=this._$Ej.forEach(s=>this._$EC(s,this[s]))),this._$EU()}updated(r){}firstUpdated(r){}}be.elementStyles=[],be.shadowRootOptions={mode:"open"},be[Te("elementProperties")]=new Map,be[Te("finalized")]=new Map,xt==null||xt({ReactiveElement:be}),(J.reactiveElementVersions??(J.reactiveElementVersions=[])).push("2.0.4");/**
9
+ */const{is:Cs,defineProperty:Ps,getOwnPropertyDescriptor:Ts,getOwnPropertyNames:Os,getOwnPropertySymbols:Ds,getPrototypeOf:Ls}=Object,re=globalThis,Sr=re.trustedTypes,Ns=Sr?Sr.emptyScript:"",Lt=re.reactiveElementPolyfillSupport,je=(o,t)=>o,tt={toAttribute(o,t){switch(t){case Boolean:o=o?Ns:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let s=o;switch(t){case Boolean:s=o!==null;break;case Number:s=o===null?null:Number(o);break;case Object:case Array:try{s=JSON.parse(o)}catch{s=null}}return s}},Nt=(o,t)=>!Cs(o,t),Ar={attribute:!0,type:String,converter:tt,reflect:!1,hasChanged:Nt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),re.litPropertyMetadata??(re.litPropertyMetadata=new WeakMap);class ye extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=Ar){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,s);n!==void 0&&Ps(this.prototype,t,n)}}static getPropertyDescriptor(t,s,i){const{get:n,set:e}=Ts(this.prototype,t)??{get(){return this[s]},set(p){this[s]=p}};return{get(){return n==null?void 0:n.call(this)},set(p){const h=n==null?void 0:n.call(this);e.call(this,p),this.requestUpdate(t,h,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Ar}static _$Ei(){if(this.hasOwnProperty(je("elementProperties")))return;const t=Ls(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(je("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(je("properties"))){const s=this.properties,i=[...Os(s),...Ds(s)];for(const n of i)this.createProperty(n,s[n])}const t=this[Symbol.metadata];if(t!==null){const s=litPropertyMetadata.get(t);if(s!==void 0)for(const[i,n]of s)this.elementProperties.set(i,n)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const n=this._$Eu(s,i);n!==void 0&&this._$Eh.set(n,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const s=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const n of i)s.unshift(_r(n))}else t!==void 0&&s.push(_r(t));return s}static _$Eu(t,s){const i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(s=>s(this))}addController(t){var s;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)==null||s.call(t))}removeController(t){var s;(s=this._$EO)==null||s.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ks(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(s=>{var i;return(i=s.hostConnected)==null?void 0:i.call(s)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(s=>{var i;return(i=s.hostDisconnected)==null?void 0:i.call(s)})}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EC(t,s){var e;const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(n!==void 0&&i.reflect===!0){const p=(((e=i.converter)==null?void 0:e.toAttribute)!==void 0?i.converter:tt).toAttribute(s,i.type);this._$Em=t,p==null?this.removeAttribute(n):this.setAttribute(n,p),this._$Em=null}}_$AK(t,s){var e;const i=this.constructor,n=i._$Eh.get(t);if(n!==void 0&&this._$Em!==n){const p=i.getPropertyOptions(n),h=typeof p.converter=="function"?{fromAttribute:p.converter}:((e=p.converter)==null?void 0:e.fromAttribute)!==void 0?p.converter:tt;this._$Em=n,this[n]=h.fromAttribute(s,p.type),this._$Em=null}}requestUpdate(t,s,i){if(t!==void 0){if(i??(i=this.constructor.getPropertyOptions(t)),!(i.hasChanged??Nt)(this[t],s))return;this.P(t,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),i.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[e,p]of this._$Ep)this[e]=p;this._$Ep=void 0}const n=this.constructor.elementProperties;if(n.size>0)for(const[e,p]of n)p.wrapped!==!0||this._$AL.has(e)||this[e]===void 0||this.P(e,this[e],p)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),(i=this._$EO)==null||i.forEach(n=>{var e;return(e=n.hostUpdate)==null?void 0:e.call(n)}),this.update(s)):this._$EU()}catch(n){throw t=!1,this._$EU(),n}t&&this._$AE(s)}willUpdate(t){}_$AE(t){var s;(s=this._$EO)==null||s.forEach(i=>{var n;return(n=i.hostUpdated)==null?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(s=>this._$EC(s,this[s]))),this._$EU()}updated(t){}firstUpdated(t){}}ye.elementStyles=[],ye.shadowRootOptions={mode:"open"},ye[je("elementProperties")]=new Map,ye[je("finalized")]=new Map,Lt==null||Lt({ReactiveElement:ye}),(re.reactiveElementVersions??(re.reactiveElementVersions=[])).push("2.0.4");/**
10
10
  * @license
11
11
  * Copyright 2017 Google LLC
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
- */const De=globalThis,Ye=De.trustedTypes,fr=Ye?Ye.createPolicy("lit-html",{createHTML:o=>o}):void 0,gr="$lit$",ee=`lit$${Math.random().toFixed(9).slice(2)}$`,br="?"+ee,$s=`<${br}>`,ae=document,Le=()=>ae.createComment(""),Ne=o=>o===null||typeof o!="object"&&typeof o!="function",kt=Array.isArray,_s=o=>kt(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",Ct=`[
14
- \f\r]`,je=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,vr=/-->/g,mr=/>/g,ce=RegExp(`>|${Ct}(?:([^\\s"'>=/]+)(${Ct}*=${Ct}*(?:[^
15
- \f\r"'\`<>=]|("|')|))|$)`,"g"),yr=/'/g,$r=/"/g,_r=/^(?:script|style|textarea|title)$/i,ws=o=>(r,...s)=>({_$litType$:o,strings:r,values:s}),A=ws(1),le=Symbol.for("lit-noChange"),k=Symbol.for("lit-nothing"),wr=new WeakMap,pe=ae.createTreeWalker(ae,129);function Sr(o,r){if(!kt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return fr!==void 0?fr.createHTML(r):r}const Ss=(o,r)=>{const s=o.length-1,i=[];let a,e=r===2?"<svg>":r===3?"<math>":"",p=je;for(let g=0;g<s;g++){const b=o[g];let S,x,w=-1,C=0;for(;C<b.length&&(p.lastIndex=C,x=p.exec(b),x!==null);)C=p.lastIndex,p===je?x[1]==="!--"?p=vr:x[1]!==void 0?p=mr:x[2]!==void 0?(_r.test(x[2])&&(a=RegExp("</"+x[2],"g")),p=ce):x[3]!==void 0&&(p=ce):p===ce?x[0]===">"?(p=a??je,w=-1):x[1]===void 0?w=-2:(w=p.lastIndex-x[2].length,S=x[1],p=x[3]===void 0?ce:x[3]==='"'?$r:yr):p===$r||p===yr?p=ce:p===vr||p===mr?p=je:(p=ce,a=void 0);const E=p===ce&&o[g+1].startsWith("/>")?" ":"";e+=p===je?b+$s:w>=0?(i.push(S),b.slice(0,w)+gr+b.slice(w)+ee+E):b+ee+(w===-2?g:E)}return[Sr(o,e+(o[s]||"<?>")+(r===2?"</svg>":r===3?"</math>":"")),i]};class ze{constructor({strings:r,_$litType$:s},i){let a;this.parts=[];let e=0,p=0;const g=r.length-1,b=this.parts,[S,x]=Ss(r,s);if(this.el=ze.createElement(S,i),pe.currentNode=this.el.content,s===2||s===3){const w=this.el.content.firstChild;w.replaceWith(...w.childNodes)}for(;(a=pe.nextNode())!==null&&b.length<g;){if(a.nodeType===1){if(a.hasAttributes())for(const w of a.getAttributeNames())if(w.endsWith(gr)){const C=x[p++],E=a.getAttribute(w).split(ee),N=/([.?@])?(.*)/.exec(C);b.push({type:1,index:e,name:N[2],strings:E,ctor:N[1]==="."?xs:N[1]==="?"?Es:N[1]==="@"?ks:Ke}),a.removeAttribute(w)}else w.startsWith(ee)&&(b.push({type:6,index:e}),a.removeAttribute(w));if(_r.test(a.tagName)){const w=a.textContent.split(ee),C=w.length-1;if(C>0){a.textContent=Ye?Ye.emptyScript:"";for(let E=0;E<C;E++)a.append(w[E],Le()),pe.nextNode(),b.push({type:2,index:++e});a.append(w[C],Le())}}}else if(a.nodeType===8)if(a.data===br)b.push({type:2,index:e});else{let w=-1;for(;(w=a.data.indexOf(ee,w+1))!==-1;)b.push({type:7,index:e}),w+=ee.length-1}e++}}static createElement(r,s){const i=ae.createElement("template");return i.innerHTML=r,i}}function ve(o,r,s=o,i){var p,g;if(r===le)return r;let a=i!==void 0?(p=s._$Co)==null?void 0:p[i]:s._$Cl;const e=Ne(r)?void 0:r._$litDirective$;return(a==null?void 0:a.constructor)!==e&&((g=a==null?void 0:a._$AO)==null||g.call(a,!1),e===void 0?a=void 0:(a=new e(o),a._$AT(o,s,i)),i!==void 0?(s._$Co??(s._$Co=[]))[i]=a:s._$Cl=a),a!==void 0&&(r=ve(o,a._$AS(o,r.values),a,i)),r}class As{constructor(r,s){this._$AV=[],this._$AN=void 0,this._$AD=r,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(r){const{el:{content:s},parts:i}=this._$AD,a=((r==null?void 0:r.creationScope)??ae).importNode(s,!0);pe.currentNode=a;let e=pe.nextNode(),p=0,g=0,b=i[0];for(;b!==void 0;){if(p===b.index){let S;b.type===2?S=new Be(e,e.nextSibling,this,r):b.type===1?S=new b.ctor(e,b.name,b.strings,this,r):b.type===6&&(S=new Cs(e,this,r)),this._$AV.push(S),b=i[++g]}p!==(b==null?void 0:b.index)&&(e=pe.nextNode(),p++)}return pe.currentNode=ae,a}p(r){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(r,i,s),s+=i.strings.length-2):i._$AI(r[s])),s++}}class Be{get _$AU(){var r;return((r=this._$AM)==null?void 0:r._$AU)??this._$Cv}constructor(r,s,i,a){this.type=2,this._$AH=k,this._$AN=void 0,this._$AA=r,this._$AB=s,this._$AM=i,this.options=a,this._$Cv=(a==null?void 0:a.isConnected)??!0}get parentNode(){let r=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&(r==null?void 0:r.nodeType)===11&&(r=s.parentNode),r}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(r,s=this){r=ve(this,r,s),Ne(r)?r===k||r==null||r===""?(this._$AH!==k&&this._$AR(),this._$AH=k):r!==this._$AH&&r!==le&&this._(r):r._$litType$!==void 0?this.$(r):r.nodeType!==void 0?this.T(r):_s(r)?this.k(r):this._(r)}O(r){return this._$AA.parentNode.insertBefore(r,this._$AB)}T(r){this._$AH!==r&&(this._$AR(),this._$AH=this.O(r))}_(r){this._$AH!==k&&Ne(this._$AH)?this._$AA.nextSibling.data=r:this.T(ae.createTextNode(r)),this._$AH=r}$(r){var e;const{values:s,_$litType$:i}=r,a=typeof i=="number"?this._$AC(r):(i.el===void 0&&(i.el=ze.createElement(Sr(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)==null?void 0:e._$AD)===a)this._$AH.p(s);else{const p=new As(a,this),g=p.u(this.options);p.p(s),this.T(g),this._$AH=p}}_$AC(r){let s=wr.get(r.strings);return s===void 0&&wr.set(r.strings,s=new ze(r)),s}k(r){kt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,a=0;for(const e of r)a===s.length?s.push(i=new Be(this.O(Le()),this.O(Le()),this,this.options)):i=s[a],i._$AI(e),a++;a<s.length&&(this._$AR(i&&i._$AB.nextSibling,a),s.length=a)}_$AR(r=this._$AA.nextSibling,s){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,s);r&&r!==this._$AB;){const a=r.nextSibling;r.remove(),r=a}}setConnected(r){var s;this._$AM===void 0&&(this._$Cv=r,(s=this._$AP)==null||s.call(this,r))}}class Ke{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(r,s,i,a,e){this.type=1,this._$AH=k,this._$AN=void 0,this.element=r,this.name=s,this._$AM=a,this.options=e,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=k}_$AI(r,s=this,i,a){const e=this.strings;let p=!1;if(e===void 0)r=ve(this,r,s,0),p=!Ne(r)||r!==this._$AH&&r!==le,p&&(this._$AH=r);else{const g=r;let b,S;for(r=e[0],b=0;b<e.length-1;b++)S=ve(this,g[i+b],s,b),S===le&&(S=this._$AH[b]),p||(p=!Ne(S)||S!==this._$AH[b]),S===k?r=k:r!==k&&(r+=(S??"")+e[b+1]),this._$AH[b]=S}p&&!a&&this.j(r)}j(r){r===k?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,r??"")}}class xs extends Ke{constructor(){super(...arguments),this.type=3}j(r){this.element[this.name]=r===k?void 0:r}}class Es extends Ke{constructor(){super(...arguments),this.type=4}j(r){this.element.toggleAttribute(this.name,!!r&&r!==k)}}class ks extends Ke{constructor(r,s,i,a,e){super(r,s,i,a,e),this.type=5}_$AI(r,s=this){if((r=ve(this,r,s,0)??k)===le)return;const i=this._$AH,a=r===k&&i!==k||r.capture!==i.capture||r.once!==i.once||r.passive!==i.passive,e=r!==k&&(i===k||a);a&&this.element.removeEventListener(this.name,this,i),e&&this.element.addEventListener(this.name,this,r),this._$AH=r}handleEvent(r){var s;typeof this._$AH=="function"?this._$AH.call(((s=this.options)==null?void 0:s.host)??this.element,r):this._$AH.handleEvent(r)}}class Cs{constructor(r,s,i){this.element=r,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(r){ve(this,r)}}const Pt=De.litHtmlPolyfillSupport;Pt==null||Pt(ze,Be),(De.litHtmlVersions??(De.litHtmlVersions=[])).push("3.2.1");const Ot=(o,r,s)=>{const i=(s==null?void 0:s.renderBefore)??r;let a=i._$litPart$;if(a===void 0){const e=(s==null?void 0:s.renderBefore)??null;i._$litPart$=a=new Be(r.insertBefore(Le(),e),e,void 0,s??{})}return a._$AI(o),a};/**
13
+ */const ze=globalThis,rt=ze.trustedTypes,xr=rt?rt.createPolicy("lit-html",{createHTML:o=>o}):void 0,Bt="$lit$",X=`lit$${Math.random().toFixed(9).slice(2)}$`,jt="?"+X,Bs=`<${jt}>`,pe=document,Re=()=>pe.createComment(""),Me=o=>o===null||typeof o!="object"&&typeof o!="function",zt=Array.isArray,Er=o=>zt(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",Rt=`[
14
+ \f\r]`,Ie=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,kr=/-->/g,Cr=/>/g,ue=RegExp(`>|${Rt}(?:([^\\s"'>=/]+)(${Rt}*=${Rt}*(?:[^
15
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Pr=/'/g,Tr=/"/g,Or=/^(?:script|style|textarea|title)$/i,js=o=>(t,...s)=>({_$litType$:o,strings:t,values:s}),A=js(1),ie=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),Dr=new WeakMap,de=pe.createTreeWalker(pe,129);function Lr(o,t){if(!zt(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return xr!==void 0?xr.createHTML(t):t}const Nr=(o,t)=>{const s=o.length-1,i=[];let n,e=t===2?"<svg>":t===3?"<math>":"",p=Ie;for(let h=0;h<s;h++){const g=o[h];let $,k,y=-1,E=0;for(;E<g.length&&(p.lastIndex=E,k=p.exec(g),k!==null);)E=p.lastIndex,p===Ie?k[1]==="!--"?p=kr:k[1]!==void 0?p=Cr:k[2]!==void 0?(Or.test(k[2])&&(n=RegExp("</"+k[2],"g")),p=ue):k[3]!==void 0&&(p=ue):p===ue?k[0]===">"?(p=n??Ie,y=-1):k[1]===void 0?y=-2:(y=p.lastIndex-k[2].length,$=k[1],p=k[3]===void 0?ue:k[3]==='"'?Tr:Pr):p===Tr||p===Pr?p=ue:p===kr||p===Cr?p=Ie:(p=ue,n=void 0);const x=p===ue&&o[h+1].startsWith("/>")?" ":"";e+=p===Ie?g+Bs:y>=0?(i.push($),g.slice(0,y)+Bt+g.slice(y)+X+x):g+X+(y===-2?h:x)}return[Lr(o,e+(o[s]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class Ue{constructor({strings:t,_$litType$:s},i){let n;this.parts=[];let e=0,p=0;const h=t.length-1,g=this.parts,[$,k]=Nr(t,s);if(this.el=Ue.createElement($,i),de.currentNode=this.el.content,s===2||s===3){const y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(n=de.nextNode())!==null&&g.length<h;){if(n.nodeType===1){if(n.hasAttributes())for(const y of n.getAttributeNames())if(y.endsWith(Bt)){const E=k[p++],x=n.getAttribute(y).split(X),C=/([.?@])?(.*)/.exec(E);g.push({type:1,index:e,name:C[2],strings:x,ctor:C[1]==="."?jr:C[1]==="?"?zr:C[1]==="@"?Rr:He}),n.removeAttribute(y)}else y.startsWith(X)&&(g.push({type:6,index:e}),n.removeAttribute(y));if(Or.test(n.tagName)){const y=n.textContent.split(X),E=y.length-1;if(E>0){n.textContent=rt?rt.emptyScript:"";for(let x=0;x<E;x++)n.append(y[x],Re()),de.nextNode(),g.push({type:2,index:++e});n.append(y[E],Re())}}}else if(n.nodeType===8)if(n.data===jt)g.push({type:2,index:e});else{let y=-1;for(;(y=n.data.indexOf(X,y+1))!==-1;)g.push({type:7,index:e}),y+=X.length-1}e++}}static createElement(t,s){const i=pe.createElement("template");return i.innerHTML=t,i}}function he(o,t,s=o,i){var p,h;if(t===ie)return t;let n=i!==void 0?(p=s._$Co)==null?void 0:p[i]:s._$Cl;const e=Me(t)?void 0:t._$litDirective$;return(n==null?void 0:n.constructor)!==e&&((h=n==null?void 0:n._$AO)==null||h.call(n,!1),e===void 0?n=void 0:(n=new e(o),n._$AT(o,s,i)),i!==void 0?(s._$Co??(s._$Co=[]))[i]=n:s._$Cl=n),n!==void 0&&(t=he(o,n._$AS(o,t.values),n,i)),t}let Br=class{constructor(t,s){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:s},parts:i}=this._$AD,n=((t==null?void 0:t.creationScope)??pe).importNode(s,!0);de.currentNode=n;let e=de.nextNode(),p=0,h=0,g=i[0];for(;g!==void 0;){if(p===g.index){let $;g.type===2?$=new $e(e,e.nextSibling,this,t):g.type===1?$=new g.ctor(e,g.name,g.strings,this,t):g.type===6&&($=new Mr(e,this,t)),this._$AV.push($),g=i[++h]}p!==(g==null?void 0:g.index)&&(e=de.nextNode(),p++)}return de.currentNode=pe,n}p(t){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,s),s+=i.strings.length-2):i._$AI(t[s])),s++}};class $e{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,s,i,n){this.type=2,this._$AH=P,this._$AN=void 0,this._$AA=t,this._$AB=s,this._$AM=i,this.options=n,this._$Cv=(n==null?void 0:n.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=s.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,s=this){t=he(this,t,s),Me(t)?t===P||t==null||t===""?(this._$AH!==P&&this._$AR(),this._$AH=P):t!==this._$AH&&t!==ie&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Er(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==P&&Me(this._$AH)?this._$AA.nextSibling.data=t:this.T(pe.createTextNode(t)),this._$AH=t}$(t){var e;const{values:s,_$litType$:i}=t,n=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=Ue.createElement(Lr(i.h,i.h[0]),this.options)),i);if(((e=this._$AH)==null?void 0:e._$AD)===n)this._$AH.p(s);else{const p=new Br(n,this),h=p.u(this.options);p.p(s),this.T(h),this._$AH=p}}_$AC(t){let s=Dr.get(t.strings);return s===void 0&&Dr.set(t.strings,s=new Ue(t)),s}k(t){zt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,n=0;for(const e of t)n===s.length?s.push(i=new $e(this.O(Re()),this.O(Re()),this,this.options)):i=s[n],i._$AI(e),n++;n<s.length&&(this._$AR(i&&i._$AB.nextSibling,n),s.length=n)}_$AR(t=this._$AA.nextSibling,s){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,s);t&&t!==this._$AB;){const n=t.nextSibling;t.remove(),t=n}}setConnected(t){var s;this._$AM===void 0&&(this._$Cv=t,(s=this._$AP)==null||s.call(this,t))}}class He{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,s,i,n,e){this.type=1,this._$AH=P,this._$AN=void 0,this.element=t,this.name=s,this._$AM=n,this.options=e,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=P}_$AI(t,s=this,i,n){const e=this.strings;let p=!1;if(e===void 0)t=he(this,t,s,0),p=!Me(t)||t!==this._$AH&&t!==ie,p&&(this._$AH=t);else{const h=t;let g,$;for(t=e[0],g=0;g<e.length-1;g++)$=he(this,h[i+g],s,g),$===ie&&($=this._$AH[g]),p||(p=!Me($)||$!==this._$AH[g]),$===P?t=P:t!==P&&(t+=($??"")+e[g+1]),this._$AH[g]=$}p&&!n&&this.j(t)}j(t){t===P?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class jr extends He{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===P?void 0:t}}class zr extends He{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==P)}}class Rr extends He{constructor(t,s,i,n,e){super(t,s,i,n,e),this.type=5}_$AI(t,s=this){if((t=he(this,t,s,0)??P)===ie)return;const i=this._$AH,n=t===P&&i!==P||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,e=t!==P&&(i===P||n);n&&this.element.removeEventListener(this.name,this,i),e&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var s;typeof this._$AH=="function"?this._$AH.call(((s=this.options)==null?void 0:s.host)??this.element,t):this._$AH.handleEvent(t)}}class Mr{constructor(t,s,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){he(this,t)}}const zs={M:Bt,P:X,A:jt,C:1,L:Nr,R:Br,D:Er,V:he,I:$e,H:He,N:zr,U:Rr,B:jr,F:Mr},Mt=ze.litHtmlPolyfillSupport;Mt==null||Mt(Ue,$e),(ze.litHtmlVersions??(ze.litHtmlVersions=[])).push("3.2.1");const it=(o,t,s)=>{const i=(s==null?void 0:s.renderBefore)??t;let n=i._$litPart$;if(n===void 0){const e=(s==null?void 0:s.renderBefore)??null;i._$litPart$=n=new $e(t.insertBefore(Re(),e),e,void 0,s??{})}return n._$AI(o),n};/**
16
16
  * @license
17
17
  * Copyright 2017 Google LLC
18
18
  * SPDX-License-Identifier: BSD-3-Clause
19
- */let P=class extends be{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const r=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=r.firstChild),r}update(r){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=Ot(s,this.renderRoot,this.renderOptions)}connectedCallback(){var r;super.connectedCallback(),(r=this._$Do)==null||r.setConnected(!0)}disconnectedCallback(){var r;super.disconnectedCallback(),(r=this._$Do)==null||r.setConnected(!1)}render(){return le}};P._$litElement$=!0,P.finalized=!0,(ii=globalThis.litElementHydrateSupport)==null||ii.call(globalThis,{LitElement:P});const Tt=globalThis.litElementPolyfillSupport;Tt==null||Tt({LitElement:P}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
19
+ */let O=class extends ye{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const t=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=t.firstChild),t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=it(s,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return ie}};O._$litElement$=!0,O.finalized=!0,(mi=globalThis.litElementHydrateSupport)==null||mi.call(globalThis,{LitElement:O});const It=globalThis.litElementPolyfillSupport;It==null||It({LitElement:O}),(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 Ar={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Dt=o=>(...r)=>({_$litDirective$:o,values:r});let xr=class{constructor(r){}get _$AU(){return this._$AM._$AU}_$AT(r,s,i){this._$Ct=r,this._$AM=s,this._$Ci=i}_$AS(r,s){return this.update(r,s)}update(r,s){return this.render(...s)}};/**
23
+ */const Ut={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},st=o=>(...t)=>({_$litDirective$:o,values:t});let Ht=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,s,i){this._$Ct=t,this._$AM=s,this._$Ci=i}_$AS(t,s){return this.update(t,s)}update(t,s){return this.render(...s)}};/**
24
24
  * @license
25
25
  * Copyright 2018 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
- */const Er="important",Ps=" !"+Er,kr=Dt(class extends xr{constructor(o){var r;if(super(o),o.type!==Ar.ATTRIBUTE||o.name!=="style"||((r=o.strings)==null?void 0:r.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((r,s)=>{const i=o[s];return i==null?r:r+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[r]){const{style:s}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(r)),this.render(r);for(const i of this.ft)r[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in r){const a=r[i];if(a!=null){this.ft.add(i);const e=typeof a=="string"&&a.endsWith(Ps);i.includes("-")||e?s.setProperty(i,e?a.slice(0,-11):a,e?Er:""):s[i]=a}}return le}}),Os=M`
27
+ */const Ir="important",Rs=" !"+Ir,Ur=st(class extends Ht{constructor(o){var t;if(super(o),o.type!==Ut.ATTRIBUTE||o.name!=="style"||((t=o.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((t,s)=>{const i=o[s];return i==null?t:t+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[t]){const{style:s}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in t){const n=t[i];if(n!=null){this.ft.add(i);const e=typeof n=="string"&&n.endsWith(Rs);i.includes("-")||e?s.setProperty(i,e?n.slice(0,-11):n,e?Ir:""):s[i]=n}}return ie}}),Ms=H`
28
28
  :host{
29
29
  display: inline-block;
30
30
  --text-on-color: var(--spectric-text-on-color, #ffffff);
@@ -269,68 +269,68 @@ opacity:1
269
269
  * @license
270
270
  * Copyright 2017 Google LLC
271
271
  * SPDX-License-Identifier: BSD-3-Clause
272
- */const D=o=>(r,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(o,r)}):customElements.define(o,r)};/**
272
+ */const D=o=>(t,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(o,t)}):customElements.define(o,t)};/**
273
273
  * @license
274
274
  * Copyright 2017 Google LLC
275
275
  * SPDX-License-Identifier: BSD-3-Clause
276
- */const Ts={attribute:!0,type:String,converter:Ve,reflect:!1,hasChanged:Et},Ds=(o=Ts,r,s)=>{const{kind:i,metadata:a}=s;let e=globalThis.litPropertyMetadata.get(a);if(e===void 0&&globalThis.litPropertyMetadata.set(a,e=new Map),e.set(s.name,o),i==="accessor"){const{name:p}=s;return{set(g){const b=r.get.call(this);r.set.call(this,g),this.requestUpdate(p,b,o)},init(g){return g!==void 0&&this.P(p,void 0,o),g}}}if(i==="setter"){const{name:p}=s;return function(g){const b=this[p];r.call(this,g),this.requestUpdate(p,b,o)}}throw Error("Unsupported decorator location: "+i)};function m(o){return(r,s)=>typeof s=="object"?Ds(o,r,s):((i,a,e)=>{const p=a.hasOwnProperty(e);return a.constructor.createProperty(e,p?{...i,wrapped:!0}:i),p?Object.getOwnPropertyDescriptor(a,e):void 0})(o,r,s)}/**
276
+ */const Is={attribute:!0,type:String,converter:tt,reflect:!1,hasChanged:Nt},Us=(o=Is,t,s)=>{const{kind:i,metadata:n}=s;let e=globalThis.litPropertyMetadata.get(n);if(e===void 0&&globalThis.litPropertyMetadata.set(n,e=new Map),e.set(s.name,o),i==="accessor"){const{name:p}=s;return{set(h){const g=t.get.call(this);t.set.call(this,h),this.requestUpdate(p,g,o)},init(h){return h!==void 0&&this.P(p,void 0,o),h}}}if(i==="setter"){const{name:p}=s;return function(h){const g=this[p];t.call(this,h),this.requestUpdate(p,g,o)}}throw Error("Unsupported decorator location: "+i)};function v(o){return(t,s)=>typeof s=="object"?Us(o,t,s):((i,n,e)=>{const p=n.hasOwnProperty(e);return n.constructor.createProperty(e,p?{...i,wrapped:!0}:i),p?Object.getOwnPropertyDescriptor(n,e):void 0})(o,t,s)}/**
277
277
  * @license
278
278
  * Copyright 2017 Google LLC
279
279
  * SPDX-License-Identifier: BSD-3-Clause
280
- */function Re(o){return m({...o,state:!0,attribute:!1})}/**
280
+ */function Fe(o){return v({...o,state:!0,attribute:!1})}/**
281
281
  * @license
282
282
  * Copyright 2017 Google LLC
283
283
  * SPDX-License-Identifier: BSD-3-Clause
284
- */const Cr=(o,r,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof r!="object"&&Object.defineProperty(o,r,s),s);/**
284
+ */const Hr=(o,t,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(o,t,s),s);/**
285
285
  * @license
286
286
  * Copyright 2017 Google LLC
287
287
  * SPDX-License-Identifier: BSD-3-Clause
288
- */function me(o,r){return(s,i,a)=>{const e=p=>{var g;return((g=p.renderRoot)==null?void 0:g.querySelector(o))??null};return Cr(s,i,{get(){return e(this)}})}}/**
288
+ */function we(o,t){return(s,i,n)=>{const e=p=>{var h;return((h=p.renderRoot)==null?void 0:h.querySelector(o))??null};return Hr(s,i,{get(){return e(this)}})}}/**
289
289
  * @license
290
290
  * Copyright 2017 Google LLC
291
291
  * SPDX-License-Identifier: BSD-3-Clause
292
- */function Ze(o){return(r,s)=>Cr(r,s,{async get(){var i;return await this.updateComplete,((i=this.renderRoot)==null?void 0:i.querySelector(o))??null}})}var Ls=Object.defineProperty,Ns=Object.getOwnPropertyDescriptor,F=(o,r,s,i)=>{for(var a=i>1?void 0:i?Ns(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Ls(r,s,a),a},Pr=(o=>(o.large="large",o.medium="medium",o.small="small",o.xsmall="xsmall",o.xxsmall="xxsmall",o.tiny="tiny",o))(Pr||{}),Or=(o=>(o.primary="primary",o.secondary="secondary",o.text="text",o))(Or||{});const js={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};d.SpectricButton=class extends P{constructor(){super(...arguments),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this.tooltipPosition="right",this._onClick=r=>{if(r instanceof CustomEvent||(r.preventDefault(),r.stopImmediatePropagation(),r.stopPropagation(),this.disabled))return;const s={bubbles:!0,composed:!0,detail:r};this.dispatchEvent(new CustomEvent("click",s))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onClick,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onClick)}render(){const r=js[this.variant]||"spectric-button--primary";return A`
292
+ */function ot(o){return(t,s)=>Hr(t,s,{async get(){var i;return await this.updateComplete,((i=this.renderRoot)==null?void 0:i.querySelector(o))??null}})}var Hs=Object.defineProperty,Fs=Object.getOwnPropertyDescriptor,q=(o,t,s,i)=>{for(var n=i>1?void 0:i?Fs(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&Hs(t,s,n),n},Fr=(o=>(o.large="large",o.medium="medium",o.small="small",o.xsmall="xsmall",o.xxsmall="xxsmall",o.tiny="tiny",o))(Fr||{}),Qr=(o=>(o.primary="primary",o.secondary="secondary",o.text="text",o))(Qr||{});const Qs={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};d.SpectricButton=class extends O{constructor(){super(...arguments),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this.tooltipPosition="right",this._onClick=t=>{if(t instanceof CustomEvent||(t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation(),this.disabled))return;const s={bubbles:!0,composed:!0,detail:t};this.dispatchEvent(new CustomEvent("click",s))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onClick,{capture:!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onClick)}render(){const t=Qs[this.variant]||"spectric-button--primary";return A`
293
293
  ${this.tooltip?A`<spectric-tooltip .text=${this.tooltip} .position=${this.tooltipPosition||"right"} .triggerTarget=${this}></spectric-tooltip>`:null}
294
294
  <button
295
295
  type="button"
296
296
  ?disabled=${this.disabled}
297
- class=${["spectric-button",`spectric-button-danger--${this.danger||!1}`,`spectric-button--${this.size||"medium"}`,r].join(" ")}
298
- style=${kr({backgroundColor:this.backgroundColor})}
297
+ class=${["spectric-button",`spectric-button-danger--${this.danger||!1}`,`spectric-button--${this.size||"medium"}`,t].join(" ")}
298
+ style=${Ur({backgroundColor:this.backgroundColor})}
299
299
  >
300
300
  <span class="animation"></span>
301
301
  <slot>${this.label}</slot>
302
302
  </button>
303
- `}},d.SpectricButton.styles=Os,F([m({type:String,reflect:!0})],d.SpectricButton.prototype,"variant",2),F([m({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"disabled",2),F([m({type:String,reflect:!0})],d.SpectricButton.prototype,"backgroundColor",2),F([m({type:String,reflect:!0})],d.SpectricButton.prototype,"size",2),F([m({type:String,reflect:!0})],d.SpectricButton.prototype,"label",2),F([m({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"danger",2),F([m({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"icon",2),F([m({type:String,reflect:!0})],d.SpectricButton.prototype,"tooltip",2),F([m({type:String,reflect:!0})],d.SpectricButton.prototype,"tooltipPosition",2),d.SpectricButton=F([D("spectric-button")],d.SpectricButton);/**
303
+ `}},d.SpectricButton.styles=Ms,q([v({type:String,reflect:!0})],d.SpectricButton.prototype,"variant",2),q([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"disabled",2),q([v({type:String,reflect:!0})],d.SpectricButton.prototype,"backgroundColor",2),q([v({type:String,reflect:!0})],d.SpectricButton.prototype,"size",2),q([v({type:String,reflect:!0})],d.SpectricButton.prototype,"label",2),q([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"danger",2),q([v({type:Boolean,reflect:!0})],d.SpectricButton.prototype,"icon",2),q([v({type:String,reflect:!0})],d.SpectricButton.prototype,"tooltip",2),q([v({type:String,reflect:!0})],d.SpectricButton.prototype,"tooltipPosition",2),d.SpectricButton=q([D("spectric-button")],d.SpectricButton);/**
304
304
  * @license
305
305
  * Copyright 2020 Google LLC
306
306
  * SPDX-License-Identifier: BSD-3-Clause
307
- */const zs=o=>o.strings===void 0;/**
307
+ */const{I:qs}=zs,Ws=o=>o.strings===void 0,qr=()=>document.createComment(""),Qe=(o,t,s)=>{var e;const i=o._$AA.parentNode,n=t===void 0?o._$AB:t._$AA;if(s===void 0){const p=i.insertBefore(qr(),n),h=i.insertBefore(qr(),n);s=new qs(p,h,o,o.options)}else{const p=s._$AB.nextSibling,h=s._$AM,g=h!==o;if(g){let $;(e=s._$AQ)==null||e.call(s,o),s._$AM=o,s._$AP!==void 0&&($=o._$AU)!==h._$AU&&s._$AP($)}if(p!==n||g){let $=s._$AA;for(;$!==p;){const k=$.nextSibling;i.insertBefore($,n),$=k}}}return s},fe=(o,t,s=o)=>(o._$AI(t,s),o),Vs={},Ys=(o,t=Vs)=>o._$AH=t,Ks=o=>o._$AH,Ft=o=>{var i;(i=o._$AP)==null||i.call(o,!1,!0);let t=o._$AA;const s=o._$AB.nextSibling;for(;t!==s;){const n=t.nextSibling;t.remove(),t=n}};/**
308
308
  * @license
309
309
  * Copyright 2017 Google LLC
310
310
  * SPDX-License-Identifier: BSD-3-Clause
311
- */const Me=(o,r)=>{var i;const s=o._$AN;if(s===void 0)return!1;for(const a of s)(i=a._$AO)==null||i.call(a,r,!1),Me(a,r);return!0},Xe=o=>{let r,s;do{if((r=o._$AM)===void 0)break;s=r._$AN,s.delete(o),o=r}while((s==null?void 0:s.size)===0)},Tr=o=>{for(let r;r=o._$AM;o=r){let s=r._$AN;if(s===void 0)r._$AN=s=new Set;else if(s.has(o))break;s.add(o),Ms(r)}};function Bs(o){this._$AN!==void 0?(Xe(this),this._$AM=o,Tr(this)):this._$AM=o}function Rs(o,r=!1,s=0){const i=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(r)if(Array.isArray(i))for(let e=s;e<i.length;e++)Me(i[e],!1),Xe(i[e]);else i!=null&&(Me(i,!1),Xe(i));else Me(this,o)}const Ms=o=>{o.type==Ar.CHILD&&(o._$AP??(o._$AP=Rs),o._$AQ??(o._$AQ=Bs))};class Dr extends xr{constructor(){super(...arguments),this._$AN=void 0}_$AT(r,s,i){super._$AT(r,s,i),Tr(this),this.isConnected=r._$AU}_$AO(r,s=!0){var i,a;r!==this.isConnected&&(this.isConnected=r,r?(i=this.reconnected)==null||i.call(this):(a=this.disconnected)==null||a.call(this)),s&&(Me(this,r),Xe(this))}setValue(r){if(zs(this._$Ct))this._$Ct._$AI(r,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=r,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}/**
311
+ */const qe=(o,t)=>{var i;const s=o._$AN;if(s===void 0)return!1;for(const n of s)(i=n._$AO)==null||i.call(n,t,!1),qe(n,t);return!0},nt=o=>{let t,s;do{if((t=o._$AM)===void 0)break;s=t._$AN,s.delete(o),o=t}while((s==null?void 0:s.size)===0)},Wr=o=>{for(let t;t=o._$AM;o=t){let s=t._$AN;if(s===void 0)t._$AN=s=new Set;else if(s.has(o))break;s.add(o),Gs(t)}};function Zs(o){this._$AN!==void 0?(nt(this),this._$AM=o,Wr(this)):this._$AM=o}function Xs(o,t=!1,s=0){const i=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(t)if(Array.isArray(i))for(let e=s;e<i.length;e++)qe(i[e],!1),nt(i[e]);else i!=null&&(qe(i,!1),nt(i));else qe(this,o)}const Gs=o=>{o.type==Ut.CHILD&&(o._$AP??(o._$AP=Xs),o._$AQ??(o._$AQ=Zs))};class Vr extends Ht{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,s,i){super._$AT(t,s,i),Wr(this),this.isConnected=t._$AU}_$AO(t,s=!0){var i,n;t!==this.isConnected&&(this.isConnected=t,t?(i=this.reconnected)==null||i.call(this):(n=this.disconnected)==null||n.call(this)),s&&(qe(this,t),nt(this))}setValue(t){if(Ws(this._$Ct))this._$Ct._$AI(t,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=t,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}/**
312
312
  * @license
313
313
  * Copyright 2020 Google LLC
314
314
  * SPDX-License-Identifier: BSD-3-Clause
315
- */const Ge=()=>new Us;class Us{}const Lt=new WeakMap,Je=Dt(class extends Dr{render(o){return k}update(o,[r]){var i;const s=r!==this.Y;return s&&this.Y!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=r,this.ht=(i=o.options)==null?void 0:i.host,this.rt(this.ct=o.element)),k}rt(o){if(this.isConnected||(o=void 0),typeof this.Y=="function"){const r=this.ht??globalThis;let s=Lt.get(r);s===void 0&&(s=new WeakMap,Lt.set(r,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,o),o!==void 0&&this.Y.call(this.ht,o)}else this.Y.value=o}get lt(){var o,r;return typeof this.Y=="function"?(o=Lt.get(this.ht??globalThis))==null?void 0:o.get(this.Y):(r=this.Y)==null?void 0:r.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Is=class{constructor(r){return this.buffer=r,this.u8=new Uint8Array(r),new Proxy(this,{get(s,i){return s[i]?s[i]:s.getBit(i)}})}getBit(r){var s=this.u8[r>>3],i=r&7;return s>>7-i&1}setBit(r,s){var i=r&7;s?this.u8[r>>3]|=128>>i:this.u8[r>>3]&=~(128>>i)}get length(){return this.u8.byteLength*8}set(r,s){for(let i=s||0,a=0,e=r.length;a<e;i++,a++)this.setBit(i,r[a])}subarray(r,s){let i=[];r=r||0,s=s||this.length,s=s>this.length?this.length:s;for(let a=r;a<s;a++)i.push(this.getBit(a));return i}};class Lr{constructor(r,s,i,a){this.__target=r,this._handler=i,this._type=s,this._handler=i,this._options=a||!1,r instanceof Promise?r.then(e=>{this._handler&&(this._node=e,this._node.addEventListener(this._type,this._handler,this._options))}):(this._node=r,this._node.addEventListener(this._type,this._handler,this._options))}dispose(){this._handler&&(this._node&&(console.log(`removing event ${this._type} from `,this._node,this.__target instanceof Promise),this._node.removeEventListener(this._type,this._handler,this._options)),this.__target=void 0,this._node=void 0,this._handler=void 0)}}class Nr extends P{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(r,s,i){if(this._disposableListeners.find(e=>e.event===s&&e.target===r&&e.handler===i)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:r,event:s,handler:i}),this._connected&&this.registerDisposable(new Lr(r,s,i))}registerDisposable(r){if(!r)return r;if(r===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(r),r}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:r,event:s,handler:i})=>{this.registerDisposable(new Lr(r,s,i))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(r=>{r.dispose()}),this._isDisposed=!0}}const jr=o=>{var r;return(...s)=>{r&&cancelAnimationFrame(r),r=requestAnimationFrame(()=>{o.apply(void 0,s)})}};var Fs=Object.defineProperty,Qs=Object.getOwnPropertyDescriptor,ue=(o,r,s,i)=>{for(var a=i>1?void 0:i?Qs(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Fs(r,s,a),a};const Hs=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],et={width:200,height:200},tt={width:10,height:10};d.BitDisplayCanvas=class extends Nr{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 i=getComputedStyle(this);this.color!=i.color&&(this.color=i.color,this.paint())},this.onResize=()=>{this.calculateViewport()},this.handleScroll=()=>{if(!this.refs.viewport.value)return;const i=this.getPxPerBit();this.yStart=this.refs.viewport.value.scrollTop?Math.floor(this.refs.viewport.value.scrollTop/i)+1:0,this.xStart=this.refs.viewport.value.scrollLeft?Math.floor(this.refs.viewport.value.scrollLeft/i)+1:0,this.paint()};let r=new ResizeObserver(this.onResize);r.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=r,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var s={};Hs.forEach(i=>{this.addDisposableListener(this._canvas,i,jr(async a=>{a.stopImmediatePropagation(),a.stopPropagation(),a.preventDefault();var e=await this._canvas;let p=e.getBoundingClientRect(),g={x:Math.floor(Math.abs(a.clientX-p.left)),y:Math.floor(Math.abs(a.clientY-p.top))},b=this.canvasPositionToBit(g);if(i==="mousemove"&&s[i]==b)return;s[i]=b;let S="bit"+String(i).charAt(0).toUpperCase()+String(i).slice(1);if(b!=-1){let x=new CustomEvent(S,{detail:{bitIndex:b,position:g,nativeEvent:a}});this.dispatchEvent(x)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(r){r.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new Is(this.arrayBuffer));const s=["arrayBuffer","scale","frameWidth","width","height"];for(const i of s)if(r.has(i)){this.paint();return}}canvasPositionToBit(r){let s=Math.floor(r.x/this.scale),i=Math.floor(r.y/this.scale);return s>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(i*this.frameWidth+s)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:r,_bitArray:s}=this;if(r<=0)return;this.calculateViewport();const{width:i=et.width,height:a=et.height}=this,e=this.getPxPerBit(),p=this.refs.canvas.value.getContext("2d");if(!p)return;this.state.scale!=e&&(p.reset(),p.scale(e,e));let g=getComputedStyle(this);p.fillStyle=g.color,p.clearRect(0,0,i,a);let b=0;for(let S=this.yStart*r+this.xStart,x=s.length;S<x;S++){let w=S%r-this.xStart;if(!(w<0)){if(Math.floor(w*e)>i){b++,S=b*r+this.yStart*r+this.xStart-1;continue}if(Math.floor(b*e)>a)break;s.getBit(S)===1&&p.fillRect(w,b,1,1),(S+1)%r===0&&S>=r-1&&b++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:r,_bitArray:s}=this;if(this.refs.scrollDiv.value){var i=this.getPxPerBit();const a=s.length/r*i,e=r*i,p=this.refs.scrollDiv.value;p.style.width=e+"px",p.style.height=a+"px"}}render(){const{height:r=et.height,width:s=et.width}=this;return A`
315
+ */const at=()=>new Js;class Js{}const Qt=new WeakMap,ct=st(class extends Vr{render(o){return P}update(o,[t]){var i;const s=t!==this.Y;return s&&this.Y!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=o.options)==null?void 0:i.host,this.rt(this.ct=o.element)),P}rt(o){if(this.isConnected||(o=void 0),typeof this.Y=="function"){const t=this.ht??globalThis;let s=Qt.get(t);s===void 0&&(s=new WeakMap,Qt.set(t,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,o),o!==void 0&&this.Y.call(this.ht,o)}else this.Y.value=o}get lt(){var o,t;return typeof this.Y=="function"?(o=Qt.get(this.ht??globalThis))==null?void 0:o.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),eo=class{constructor(t){return this.buffer=t,this.u8=new Uint8Array(t),new Proxy(this,{get(s,i){return s[i]?s[i]:s.getBit(i)}})}getBit(t){var s=this.u8[t>>3],i=t&7;return s>>7-i&1}setBit(t,s){var i=t&7;s?this.u8[t>>3]|=128>>i:this.u8[t>>3]&=~(128>>i)}get length(){return this.u8.byteLength*8}set(t,s){for(let i=s||0,n=0,e=t.length;n<e;i++,n++)this.setBit(i,t[n])}subarray(t,s){let i=[];t=t||0,s=s||this.length,s=s>this.length?this.length:s;for(let n=t;n<s;n++)i.push(this.getBit(n));return i}};class Yr{constructor(t,s,i,n){this._handler=i,this._type=s,this._handler=i,this._options=n||!1,t instanceof Promise?t.then(e=>{this._handler&&(this._node=e,this._node.addEventListener(this._type,this._handler,this._options))}):typeof t=="function"?(this._node=t(),this._node.addEventListener(this._type,this._handler,this._options)):(this._node=t,this._node.addEventListener(this._type,this._handler,this._options))}dispose(){this._handler&&(this._node&&this._node.removeEventListener(this._type,this._handler,this._options),this._node=void 0,this._handler=void 0)}}class lt extends O{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(t,s,i){if(this._disposableListeners.find(e=>e.event===s&&e.target===t&&e.handler===i)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:t,event:s,handler:i}),this._connected&&this.registerDisposable(new Yr(t,s,i))}registerDisposable(t){if(!t)return t;if(t===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(t),t}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:t,event:s,handler:i})=>{this.registerDisposable(new Yr(t,s,i))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(t=>{t.dispose()}),this._isDisposed=!0}}const Kr=o=>{var t;return(...s)=>{t&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{o.apply(void 0,s)})}};var to=Object.defineProperty,ro=Object.getOwnPropertyDescriptor,ge=(o,t,s,i)=>{for(var n=i>1?void 0:i?ro(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&to(t,s,n),n};const io=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],pt={width:200,height:200},ut={width:10,height:10};d.BitDisplayCanvas=class extends lt{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:at(),canvas:at(),scrollDiv:at()},this.color="#000000",this.onThemeChange=()=>{let i=getComputedStyle(this);this.color!=i.color&&(this.color=i.color,this.paint())},this.onResize=()=>{this.calculateViewport()},this.handleScroll=()=>{if(!this.refs.viewport.value)return;const i=this.getPxPerBit();this.yStart=this.refs.viewport.value.scrollTop?Math.floor(this.refs.viewport.value.scrollTop/i)+1:0,this.xStart=this.refs.viewport.value.scrollLeft?Math.floor(this.refs.viewport.value.scrollLeft/i)+1:0,this.paint()};let t=new ResizeObserver(this.onResize);t.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=t,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var s={};io.forEach(i=>{this.addDisposableListener(this._canvas,i,Kr(async n=>{n.stopImmediatePropagation(),n.stopPropagation(),n.preventDefault();var e=await this._canvas;let p=e.getBoundingClientRect(),h={x:Math.floor(Math.abs(n.clientX-p.left)),y:Math.floor(Math.abs(n.clientY-p.top))},g=this.canvasPositionToBit(h);if(i==="mousemove"&&s[i]==g)return;s[i]=g;let $="bit"+String(i).charAt(0).toUpperCase()+String(i).slice(1);if(g!=-1){let k=new CustomEvent($,{detail:{bitIndex:g,position:h,nativeEvent:n}});this.dispatchEvent(k)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(t){t.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new eo(this.arrayBuffer));const s=["arrayBuffer","scale","frameWidth","width","height"];for(const i of s)if(t.has(i)){this.paint();return}}canvasPositionToBit(t){let s=Math.floor(t.x/this.scale),i=Math.floor(t.y/this.scale);return s>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(i*this.frameWidth+s)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:t,_bitArray:s}=this;if(t<=0)return;this.calculateViewport();const{width:i=pt.width,height:n=pt.height}=this,e=this.getPxPerBit(),p=this.refs.canvas.value.getContext("2d");if(!p)return;this.state.scale!=e&&(p.reset(),p.scale(e,e));let h=getComputedStyle(this);p.fillStyle=h.color,p.clearRect(0,0,i,n);let g=0;for(let $=this.yStart*t+this.xStart,k=s.length;$<k;$++){let y=$%t-this.xStart;if(!(y<0)){if(Math.floor(y*e)>i){g++,$=g*t+this.yStart*t+this.xStart-1;continue}if(Math.floor(g*e)>n)break;s.getBit($)===1&&p.fillRect(y,g,1,1),($+1)%t===0&&$>=t-1&&g++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:t,_bitArray:s}=this;if(this.refs.scrollDiv.value){var i=this.getPxPerBit();const n=s.length/t*i,e=t*i,p=this.refs.scrollDiv.value;p.style.width=e+"px",p.style.height=n+"px"}}render(){const{height:t=pt.height,width:s=pt.width}=this;return A`
316
316
  <div
317
317
  id="viewport"
318
- ${Je(this.refs.viewport)}
318
+ ${ct(this.refs.viewport)}
319
319
  @scroll=${this.handleScroll}
320
- style=${`width:${s}px;height:${r}px;overflow:auto;position:relative`}
320
+ style=${`width:${s+ut.width}px;height:${t+ut.height}px;overflow:auto;position:relative`}
321
321
  >
322
322
  <div
323
323
  id="fakescrolldiv"
324
- ${Je(this.refs.scrollDiv)}
324
+ ${ct(this.refs.scrollDiv)}
325
325
  >
326
326
  </div>
327
327
  </div>
328
328
  <canvas
329
- ${Je(this.refs.canvas)}
330
- width=${s-tt.width}
331
- height=${r-tt.height}
329
+ ${ct(this.refs.canvas)}
330
+ width=${s}
331
+ height=${t}
332
332
  ></canvas>
333
- `}},d.BitDisplayCanvas.styles=M`
333
+ `}},d.BitDisplayCanvas.styles=H`
334
334
  :host{
335
335
  position: relative;
336
336
  --border-radius: var(--spectric-border-radius,4em);
@@ -354,8 +354,8 @@ opacity:1
354
354
  background-color:var(--background-color);
355
355
  }
356
356
  ::-webkit-scrollbar {
357
- height: ${tt.height}px;
358
- width: ${tt.width}px;
357
+ height: ${ut.height}px;
358
+ width: ${ut.width}px;
359
359
 
360
360
  }
361
361
 
@@ -426,7 +426,7 @@ opacity:1
426
426
 
427
427
  }
428
428
 
429
- `,ue([m({type:Object,attribute:!1})],d.BitDisplayCanvas.prototype,"arrayBuffer",2),ue([m({type:Number})],d.BitDisplayCanvas.prototype,"frameWidth",2),ue([m({type:Number})],d.BitDisplayCanvas.prototype,"scale",2),ue([m({type:Number})],d.BitDisplayCanvas.prototype,"width",2),ue([m({type:Number})],d.BitDisplayCanvas.prototype,"height",2),ue([Ze("canvas")],d.BitDisplayCanvas.prototype,"_canvas",2),d.BitDisplayCanvas=ue([D("spectric-bit-display")],d.BitDisplayCanvas);const qs=M`.spectric-header {
429
+ `,ge([v({type:Object,attribute:!1})],d.BitDisplayCanvas.prototype,"arrayBuffer",2),ge([v({type:Number})],d.BitDisplayCanvas.prototype,"frameWidth",2),ge([v({type:Number})],d.BitDisplayCanvas.prototype,"scale",2),ge([v({type:Number})],d.BitDisplayCanvas.prototype,"width",2),ge([v({type:Number})],d.BitDisplayCanvas.prototype,"height",2),ge([ot("canvas")],d.BitDisplayCanvas.prototype,"_canvas",2),d.BitDisplayCanvas=ge([D("spectric-bit-display")],d.BitDisplayCanvas);const so=H`.spectric-header {
430
430
  display: flex;
431
431
  justify-content: space-between;
432
432
  align-items: center;
@@ -461,7 +461,7 @@ opacity:1
461
461
  color: #333;
462
462
  font-size: 14px;
463
463
  }
464
- `;var Ws=Object.defineProperty,Vs=Object.getOwnPropertyDescriptor,rt=(o,r,s,i)=>{for(var a=i>1?void 0:i?Vs(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Ws(r,s,a),a};d.Header=class extends P{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",r))},this.onLogin=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",r))},this.onCreateAccount=()=>{const r={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",r))}}render(){return A`
464
+ `;var oo=Object.defineProperty,no=Object.getOwnPropertyDescriptor,dt=(o,t,s,i)=>{for(var n=i>1?void 0:i?no(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&oo(t,s,n),n};d.Header=class extends O{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const t={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",t))},this.onLogin=()=>{const t={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",t))},this.onCreateAccount=()=>{const t={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",t))}}render(){return A`
465
465
  <header>
466
466
  <div class="spectric-header">
467
467
  <div style="flex-grow:1;">
@@ -480,12 +480,12 @@ opacity:1
480
480
  <slot name="end"></slot>
481
481
  </div>
482
482
  </header>
483
- `}},d.Header.styles=qs,rt([m({type:Boolean,reflect:!0})],d.Header.prototype,"showCreateAccount",2),rt([m({type:Boolean,reflect:!0})],d.Header.prototype,"showLoginButton",2),rt([m({type:String,reflect:!0})],d.Header.prototype,"username",2),d.Header=rt([D("spectric-header")],d.Header);var Ys=Object.defineProperty,Ks=Object.getOwnPropertyDescriptor,ye=(o,r,s,i)=>{for(var a=i>1?void 0:i?Ks(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Ys(r,s,a),a};const Zs={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let de=class extends P{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=o=>{o.preventDefault(),o.stopPropagation();const r={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:s,text:i,headerStyle:a,dismissable:e}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:s,text:i,headerStyle:a,dismissable:e},...r}))}}render(){if(!this._dismissed)return A`
484
- <header style=${kr({...Zs,...this.headerStyle})}>
483
+ `}},d.Header.styles=so,dt([v({type:Boolean,reflect:!0})],d.Header.prototype,"showCreateAccount",2),dt([v({type:Boolean,reflect:!0})],d.Header.prototype,"showLoginButton",2),dt([v({type:String,reflect:!0})],d.Header.prototype,"username",2),d.Header=dt([D("spectric-header")],d.Header);var ao=Object.defineProperty,co=Object.getOwnPropertyDescriptor,_e=(o,t,s,i)=>{for(var n=i>1?void 0:i?co(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&ao(t,s,n),n};const lo={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let be=class extends O{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=o=>{o.preventDefault(),o.stopPropagation();const t={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:s,text:i,headerStyle:n,dismissable:e}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:s,text:i,headerStyle:n,dismissable:e},...t}))}}render(){if(!this._dismissed)return A`
484
+ <header style=${Ur({...lo,...this.headerStyle})}>
485
485
  <div style="flex-grow:1"><slot name="text">${this.text}</slot><slot></slot></div>
486
486
  ${this.dismissable?A`<spectric-button size="small" @click=${this.onDismiss}>X</spectric-button>`:null}
487
487
  </header>
488
- `}};ye([m({type:Boolean,reflect:!0})],de.prototype,"dismissable",2),ye([m({type:String,reflect:!0})],de.prototype,"text",2),ye([m({type:String,reflect:!0})],de.prototype,"bannerId",2),ye([m({type:Object})],de.prototype,"headerStyle",2),ye([m({state:!0,type:Boolean,attribute:!1})],de.prototype,"_dismissed",2),de=ye([D("spectric-banner")],de);const Xs=M`
488
+ `}};_e([v({type:Boolean,reflect:!0})],be.prototype,"dismissable",2),_e([v({type:String,reflect:!0})],be.prototype,"text",2),_e([v({type:String,reflect:!0})],be.prototype,"bannerId",2),_e([v({type:Object})],be.prototype,"headerStyle",2),_e([v({state:!0,type:Boolean,attribute:!1})],be.prototype,"_dismissed",2),be=_e([D("spectric-banner")],be);const po=H`
489
489
 
490
490
  :host {
491
491
  height:100vh;
@@ -645,18 +645,18 @@ article{
645
645
  * @license
646
646
  * Copyright 2018 Google LLC
647
647
  * SPDX-License-Identifier: BSD-3-Clause
648
- */const Nt=o=>o??k;class Gs extends Dr{constructor(){super(...arguments),this.prevData={}}render(r){return k}update(r,[s]){var i;this.element!==r.element&&(this.element=r.element),this.host=((i=r.options)==null?void 0:i.host)||this.element,this.apply(s),this.groom(s),this.prevData={...s}}apply(r){if(!r)return;const{element:s}=this;for(const i in r){const a=r[i];s[i]!==a&&(s[i]=a)}}groom(r){const{prevData:s,element:i}=this;if(s)for(const a in s)(!r||!(a in r)&&i[a]===s[a])&&(i[a]=void 0)}}const it=Dt(Gs);var jt=(o=>(o.None="none",o.Uscui="us.cui",o.Usclassified="us.classified",o.Usunclassified="us.unclassified",o.Usconfidential="us.confidential",o.Ussecret="us.secret",o.Ustopsecret="us.topsecret",o.UstopsecretSi="us.topsecret.si",o.Uknotset="uk.notset",o.Ukofficial="uk.official",o.Uksecret="uk.secret",o.Uktopsecret="uk.topsecret",o.Caprotected_a="ca.protected_a",o.Caprotected_b="ca.protected_b",o.Caprotected_c="ca.protected_c",o.Caconfidential="ca.confidential",o.Casecret="ca.secret",o.Catopsecret="ca.topsecret",o.Auunofficial="au.unofficial",o.Auofficial="au.official",o.Auofficialsensitive="au.officialsensitive",o.Auconfidential="au.confidential",o.Ausecret="au.secret",o.Autopsecret="au.topsecret",o))(jt||{});const st={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 Js=Object.defineProperty,eo=Object.getOwnPropertyDescriptor,Q=(o,r,s,i)=>{for(var a=i>1?void 0:i?eo(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Js(r,s,a),a};d.SpectricPage=class extends P{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=jt.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!st[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=jt.None);const r=this.classificationLevel?this.classificationText||st[this.classificationLevel].content:"",s=this.showHeader?A`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${Nt(this.username)}>
648
+ */const qt=o=>o??P;class uo extends Vr{constructor(){super(...arguments),this.prevData={}}render(t){return P}update(t,[s]){var i;this.element!==t.element&&(this.element=t.element),this.host=((i=t.options)==null?void 0:i.host)||this.element,this.apply(s),this.groom(s),this.prevData={...s}}apply(t){if(!t)return;const{element:s}=this;for(const i in t){const n=t[i];s[i]!==n&&(s[i]=n)}}groom(t){const{prevData:s,element:i}=this;if(s)for(const n in s)(!t||!(n in t)&&i[n]===s[n])&&(i[n]=void 0)}}const We=st(uo);var Wt=(o=>(o.None="none",o.Uscui="us.cui",o.Usclassified="us.classified",o.Usunclassified="us.unclassified",o.Usconfidential="us.confidential",o.Ussecret="us.secret",o.Ustopsecret="us.topsecret",o.UstopsecretSi="us.topsecret.si",o.Uknotset="uk.notset",o.Ukofficial="uk.official",o.Uksecret="uk.secret",o.Uktopsecret="uk.topsecret",o.Caprotected_a="ca.protected_a",o.Caprotected_b="ca.protected_b",o.Caprotected_c="ca.protected_c",o.Caconfidential="ca.confidential",o.Casecret="ca.secret",o.Catopsecret="ca.topsecret",o.Auunofficial="au.unofficial",o.Auofficial="au.official",o.Auofficialsensitive="au.officialsensitive",o.Auconfidential="au.confidential",o.Ausecret="au.secret",o.Autopsecret="au.topsecret",o))(Wt||{});const ht={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 ho=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,W=(o,t,s,i)=>{for(var n=i>1?void 0:i?fo(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&ho(t,s,n),n};d.SpectricPage=class extends O{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=Wt.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!ht[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=Wt.None);const t=this.classificationLevel?this.classificationText||ht[this.classificationLevel].content:"",s=this.showHeader?A`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${qt(this.username)}>
649
649
  <slot name="branding" slot="branding"></slot>
650
650
  <slot name="name" slot="name"></slot>
651
651
  <slot name="center" slot="center"></slot>
652
652
  <slot name="end" slot="end"></slot>
653
653
  </spectric-header>`:null;return A`
654
- ${this.classificationLevel&&r?A`
654
+ ${this.classificationLevel&&t?A`
655
655
  <!-- Classification Banner -->
656
- <spectric-banner ${it({text:r,headerStyle:st[this.classificationLevel]})}></spectric-banner>
656
+ <spectric-banner ${We({text:t,headerStyle:ht[this.classificationLevel]})}></spectric-banner>
657
657
  `:null}
658
- <spectric-theme theme=${Nt(this.theme)}>
659
- ${this.notifications?this.notifications.map(i=>A`<spectric-banner ${it(i)} ></spectric-banner>`):null}
658
+ <spectric-theme theme=${qt(this.theme)}>
659
+ ${this.notifications?this.notifications.map(i=>A`<spectric-banner ${We(i)} ></spectric-banner>`):null}
660
660
  ${this.headerSticky?s:null}
661
661
  <article>
662
662
  ${this.headerSticky?null:s}
@@ -666,9 +666,9 @@ article{
666
666
  </section>
667
667
  </article>
668
668
  </spectric-theme>
669
- ${this.classificationLevel&&r?A`<spectric-banner ${it({text:r,headerStyle:st[this.classificationLevel]})}></spectric-banner>`:null}
669
+ ${this.classificationLevel&&t?A`<spectric-banner ${We({text:t,headerStyle:ht[this.classificationLevel]})}></spectric-banner>`:null}
670
670
 
671
- `}},d.SpectricPage.styles=Xs,Q([m({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showHeader",2),Q([m({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"headerSticky",2),Q([m({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationLevel",2),Q([m({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationText",2),Q([m({type:Array,reflect:!0})],d.SpectricPage.prototype,"notifications",2),Q([m({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showCreateAccount",2),Q([m({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showLoginButton",2),Q([m({type:String,reflect:!0})],d.SpectricPage.prototype,"username",2),Q([m({type:String,reflect:!0})],d.SpectricPage.prototype,"theme",2),d.SpectricPage=Q([D("spectric-page")],d.SpectricPage);var to=Object.defineProperty,ro=Object.getOwnPropertyDescriptor,O=(o,r,s,i)=>{for(var a=i>1?void 0:i?ro(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&to(r,s,a),a},zr=(o=>(o.Text="text",o.TextArea="text-area",o.number="number",o.color="color",o.date="date",o.datetime="datetime-local",o.email="email",o.file="file",o.hidden="hidden",o.password="password",o.checkbox="checkbox",o))(zr||{});d.SpectricInput=class extends P{constructor(){super(...arguments),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="",this._handleInput=({target:r})=>{const s=r;this.value=s.value,this.invalid=!s.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(r){const s=this._value;this._value=r,this.requestUpdate("value",s),this._input&&(this._input.value=String(r))}blur(){this._input&&this._input.blur()}focus(r){this._input&&(this._input.blur(),this._input.focus(r))}setSelectionRange(r,s,i="none"){this._input&&this._input.setSelectionRange(r,s,i)}render(){switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"datetime-local":case"file":case"color":return A`
671
+ `}},d.SpectricPage.styles=po,W([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showHeader",2),W([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"headerSticky",2),W([v({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationLevel",2),W([v({type:String,reflect:!0})],d.SpectricPage.prototype,"classificationText",2),W([v({type:Array,reflect:!0})],d.SpectricPage.prototype,"notifications",2),W([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showCreateAccount",2),W([v({type:Boolean,reflect:!0})],d.SpectricPage.prototype,"showLoginButton",2),W([v({type:String,reflect:!0})],d.SpectricPage.prototype,"username",2),W([v({type:String,reflect:!0})],d.SpectricPage.prototype,"theme",2),d.SpectricPage=W([D("spectric-page")],d.SpectricPage);var go=Object.defineProperty,bo=Object.getOwnPropertyDescriptor,T=(o,t,s,i)=>{for(var n=i>1?void 0:i?bo(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&go(t,s,n),n},Zr=(o=>(o.Text="text",o.TextArea="text-area",o.number="number",o.color="color",o.date="date",o.datetime="datetime-local",o.email="email",o.file="file",o.hidden="hidden",o.password="password",o.checkbox="checkbox",o))(Zr||{});d.SpectricInput=class extends O{constructor(){super(...arguments),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:t})=>{const s=t;this.value=s.value,this.invalid=!s.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(t){const s=this._value;this._value=t,this.requestUpdate("value",s),this._input&&(this._input.value=String(t))}blur(){this._input&&this._input.blur()}focus(t){this._input&&(this._input.blur(),this._input.focus(t))}setSelectionRange(t,s,i="none"){this._input&&this._input.setSelectionRange(t,s,i)}updated(t){t.has("checked")&&this.dispatchEvent(new Event("change",{bubbles:!0}))}render(){switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"datetime-local":case"file":case"color":return A`
672
672
  <div class="inputWrapper">
673
673
  <div class="text-input__label-helper-wrapper">
674
674
  <div class="--text-input__label-wrapper">
@@ -682,15 +682,15 @@ article{
682
682
  ?disabled="${this.disabled}"
683
683
  aria-describedby="helper-text"
684
684
  id="input"
685
- name="${$e(this.name)}"
686
- pattern="${$e(this.pattern)}"
687
- placeholder="${$e(this.placeholder)}"
688
- autocomplete="${$e(this.autocomplete)}"
685
+ name="${Se(this.name)}"
686
+ pattern="${Se(this.pattern)}"
687
+ placeholder="${Se(this.placeholder)}"
688
+ autocomplete="${Se(this.autocomplete)}"
689
689
  ?readonly="${this.readonly}"
690
690
  ?required="${this.required}"
691
- type="${$e(this.variant!=="password"?this.variant:this._showPassword?"text":"password")}"
691
+ type="${Se(this.variant!=="password"?this.variant:this._showPassword?"text":"password")}"
692
692
  .value="${this._value}"
693
- maxlength="${$e(this.maxCount>0?this.maxCount:void 0)}"
693
+ maxlength="${Se(this.maxCount>0?this.maxCount:void 0)}"
694
694
  @input="${this._handleInput}"
695
695
  @change=${()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))}}
696
696
  />
@@ -715,16 +715,16 @@ article{
715
715
  </div>
716
716
  `;case"hidden":return A`<input type="hidden"></input>`;case"checkbox":return A`
717
717
  <div class="checkbox">
718
- <spectric-button @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>
718
+ <spectric-button @click=${()=>{this.checked=!this.checked,this.value=!!this.checked}} icon size=${this.size||"xxsmall"} variant=${this.checked?"primary":"secondary"}>${this.checked?"✓":" "}</spectric-button>
719
719
  ${this.invalid||this.helperText?A`<spectric-tooltip text=${this.invalid||this.helperText}></spectric-tooltip>`:null}
720
720
  ${this.label}
721
721
  </div>
722
722
  </label>
723
- `}return`Not yet implemented ${this.variant}`}},O([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"checked",2),O([m({type:String,reflect:!0})],d.SpectricInput.prototype,"placeholder",2),O([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"readonly",2),O([m({type:String,reflect:!0})],d.SpectricInput.prototype,"variant",2),O([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"disabled",2),O([m({type:String,reflect:!0})],d.SpectricInput.prototype,"label",2),O([m()],d.SpectricInput.prototype,"hidePasswordLabel",2),O([m()],d.SpectricInput.prototype,"showPasswordLabel",2),O([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"showPasswordVisibilityToggle",2),O([m({type:String,reflect:!0})],d.SpectricInput.prototype,"helperText",2),O([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"invalid",2),O([m({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"required",2),O([m({type:String,reflect:!0})],d.SpectricInput.prototype,"invalidText",2),O([m()],d.SpectricInput.prototype,"name",2),O([m()],d.SpectricInput.prototype,"pattern",2),O([m({type:Number,reflect:!0})],d.SpectricInput.prototype,"maxCount",2),O([m({reflect:!0})],d.SpectricInput.prototype,"autocomplete",2),O([m({reflect:!0})],d.SpectricInput.prototype,"value",1),O([me("input")],d.SpectricInput.prototype,"_input",2),d.SpectricInput=O([D("spectric-input")],d.SpectricInput);const $e=o=>Nt(o===""?void 0:o??void 0),io="end of input",so={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class Br extends Error{constructor(r,s){let i=r.message;if(r.expected){const p=r.expected.map(b=>so[b.description]||b.description).join(", ");let g=r.found?`"${r.found}"`:io;i=`Expected ${p} but ${g} found.`}const a=[i,s,"-".repeat(r.location.start.offset)+"^"].join(`
724
- `);super(a),this.name="DQLSyntaxError",this.shortMessage=i}}function _e(o){return{type:"literal",value:o}}function zt(o){return o.value}const oo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:_e,toOpenSearchQuery:zt},Symbol.toStringTag,{value:"Module"})),{SyntaxError:wc,parse:ot}=function(){function o(i,a){function e(){this.constructor=i}e.prototype=a.prototype,i.prototype=new e}function r(i,a,e,p){this.message=i,this.expected=a,this.found=e,this.location=p,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,r)}o(r,Error);function s(i){var a=arguments.length>1?arguments[1]:{},e={},p={start:Wi,Literal:nr},g=Wi,b=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t!==null?t:ge.function.buildNode("is","*","*")},S=function(){return gc},x=function(t,n){const l=[t,n].find(u=>u.type==="cursor");return l||Y("or",[t,n])},w=function(t,n){const l=[t,n].find(u=>u.type==="cursor");return l||Y("and",[t,n])},C=function(t){return t.type==="cursor"?t:Y("not",[t])},E="(",N={type:"literal",value:"(",description:'"("'},lt=")",se={type:"literal",value:")",description:'")"'},q=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t},W=":",R={type:"literal",value:":",description:'":"'},xe="{",Wt={type:"literal",value:"{",description:'"{"'},Vt="}",Yt={type:"literal",value:"}",description:'"}"'},Fn=function(t,n,l){return n.type==="cursor"?{...n,nestedPath:n.nestedPath?`${t.value}.${n.nestedPath}`:t.value}:l.type==="cursor"?{...l,suggestionTypes:["conjunction"]}:Y("nested",[t,n])},Qn={type:"other",description:"fieldName"},Hn=function(t,n,l){if(l.type==="cursor")return{...l,suggestionTypes:["conjunction"]};const u=$c(n,l);return Y("range",[t,u])},qn=function(t,n){return n.type==="cursor"?{...n,fieldName:t.value,suggestionTypes:["value","conjunction"]}:n(t)},Wn=function(t){if(t.type==="cursor"){const l=`${t.prefix}${t.suffix}`.trim();return{...t,fieldName:l,suggestionTypes:["field","operator","conjunction"]}}const n=oe(null);return t(n)},Vn=function(t,n){return n.type==="cursor"?{...n,suggestionTypes:["conjunction"]}:t},Yn=function(t,n){const l=[t,n].find(u=>u.type==="cursor");return l?{...l,suggestionTypes:["value"]}:u=>Y("or",[t(u),n(u)])},Kn=function(t,n){const l=[t,n].find(u=>u.type==="cursor");return l?{...l,suggestionTypes:["value"]}:u=>Y("and",[t(u),n(u)])},Zn=function(t){return t.type==="cursor"?{...list,suggestionTypes:["value"]}:n=>Y("not",[t(n)])},Xn={type:"other",description:"value"},Gn=function(t){if(t.type==="cursor")return t;const n=oe(!0);return l=>Y("is",[l,t,n])},Jn=function(t){if(t.type==="cursor")return t;!mc&&t.type==="wildcard"&&ge.wildcard.hasLeadingWildcard(t)&&U("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const n=oe(!1);return l=>Y("is",[l,t,n])},ea={type:"other",description:"OR"},si="or",oi={type:"literal",value:"or",description:'"or"'},ta={type:"other",description:"AND"},ni="and",ai={type:"literal",value:"and",description:'"and"'},ra={type:"other",description:"NOT"},ci="not",li={type:"literal",value:"not",description:'"not"'},ia={type:"other",description:"literal"},Ie='"',Fe={type:"literal",value:'"',description:'"\\""'},Kt=function(t,n,l){const{start:u,end:f}=Va();return{type:"cursor",start:u.offset,end:f.offset-n.length,prefix:t.join(""),suffix:l.join(""),text:Wa().replace(n,"")}},sa=function(t){return oe(t.join(""))},Qe="\\",He={type:"literal",value:"\\",description:'"\\\\"'},oa=/^[\\"]/,na={type:"class",value:'[\\\\"]',description:'[\\\\"]'},pt=function(t){return t},aa=/^[^"]/,ca={type:"class",value:'[^"]',description:'[^"]'},la=function(t){const n=t.join("").trim();return n==="null"?oe(null):n==="true"?oe(!0):n==="false"?oe(!1):t.includes(cs)?yc(n):oe(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(n)?isFinite(n)&&(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)?BigInt(n):Number(n):n)},pi={type:"any",description:"any character"},ut="*",dt={type:"literal",value:"*",description:'"*"'},pa=function(){return cs},ui="\\t",ua={type:"literal",value:"\\t",description:'"\\\\t"'},da=function(){return" "},di="\\r",ha={type:"literal",value:"\\r",description:'"\\\\r"'},fa=function(){return"\r"},hi="\\n",ga={type:"literal",value:"\\n",description:'"\\\\n"'},ba=function(){return`
725
- `},va=function(t){return t},ma=/^[\\():<>"*{}]/,ya={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},fi="<=",$a={type:"literal",value:"<=",description:'"<="'},_a=function(){return"lte"},gi=">=",wa={type:"literal",value:">=",description:'">="'},Sa=function(){return"gte"},bi="<",vi={type:"literal",value:"<",description:'"<"'},Aa=function(){return"lt"},mi=">",yi={type:"literal",value:">",description:'">"'},xa=function(){return"gt"},Ea={type:"other",description:"whitespace"},ka=/^[ \t\r\n]/,Ca={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},Pa=function(){return bc},$i="@kuery-cursor@",Oa={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},Ta=function(){return vc},_i="||",Da={type:"literal",value:"||",description:'"||"'},La=function(){U("LuceneOr")},wi="&&",Na={type:"literal",value:"&&",description:'"&&"'},Si=function(){U("LuceneAnd")},Ai="+",xi={type:"literal",value:"+",description:'"+"'},Ei="-",ki={type:"literal",value:"-",description:'"-"'},Ci=function(){U("LuceneNot")},Pi="!",Oi={type:"literal",value:"!",description:'"!"'},Ti="_exists_",ja={type:"literal",value:"_exists_",description:'"_exists_"'},za=function(){U("LuceneExists")},Di=function(){U("LuceneRange")},Li="?",Ni={type:"literal",value:"?",description:'"?"'},Ba=function(){U("LuceneWildcard")},Zt="/",Xt={type:"literal",value:"/",description:'"/"'},ji=/^[^\/]/,zi={type:"class",value:"[^/]",description:"[^/]"},Ra=function(){U("LuceneRegex")},Gt="~",Jt={type:"literal",value:"~",description:'"~"'},Ee=/^[0-9]/,ke={type:"class",value:"[0-9]",description:"[0-9]"},Ma=function(){U("LuceneFuzzy")},Ua=function(){U("LuceneProximity")},Bi="^",Ri={type:"literal",value:"^",description:'"^"'},Ia=function(){U("LuceneBoost")},Fa=function(){return char},Qa="=",Ha={type:"literal",value:"=",description:'"="'},Mi="[",Ui={type:"literal",value:"[",description:'"["'},Ii="]",Fi={type:"literal",value:"]",description:'"]"'},Qi="TO",qa={type:"literal",value:"TO",description:'"TO"'},c=0,_=0,ht=[{line:1,column:1,seenCR:!1}],V=0,er=[],h=0,ft;if("startRule"in a){if(!(a.startRule in p))throw new Error(`Can't start parsing from rule "`+a.startRule+'".');g=p[a.startRule]}function Wa(){return i.substring(_,c)}function Va(){return gt(_,c)}function U(t){throw qi(t,null,i.substring(_,c),gt(_,c))}function Hi(t){var n=ht[t],l,u;if(n)return n;for(l=t-1;!ht[l];)l--;for(n=ht[l],n={line:n.line,column:n.column,seenCR:n.seenCR};l<t;)u=i.charAt(l),u===`
726
- `?(n.seenCR||n.line++,n.column=1,n.seenCR=!1):u==="\r"||u==="\u2028"||u==="\u2029"?(n.line++,n.column=1,n.seenCR=!0):(n.column++,n.seenCR=!1),l++;return ht[t]=n,n}function gt(t,n){var l=Hi(t),u=Hi(n);return{start:{offset:t,line:l.line,column:l.column},end:{offset:n,line:u.line,column:u.column}}}function v(t){c<V||(c>V&&(V=c,er=[]),er.push(t))}function qi(t,n,l,u){function f(T){var L=1;for(T.sort(function(ne,I){return ne.description<I.description?-1:ne.description>I.description?1:0});L<T.length;)T[L-1]===T[L]?T.splice(L,1):L++}function $(T,L){function ne(_c){function wt(X){return X.charCodeAt(0).toString(16).toUpperCase()}return _c.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(X){return"\\x0"+wt(X)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(X){return"\\x"+wt(X)}).replace(/[\u0100-\u0FFF]/g,function(X){return"\\u0"+wt(X)}).replace(/[\u1000-\uFFFF]/g,function(X){return"\\u"+wt(X)})}var I=new Array(T.length),ls,ps,We;for(We=0;We<T.length;We++)I[We]=T[We].description;return ls=T.length>1?I.slice(0,-1).join(", ")+" or "+I[T.length-1]:I[0],ps=L?'"'+ne(L)+'"':"end of input","Expected "+ls+" but "+ps+" found."}return n!==null&&f(n),new r(t!==null?t:$(n,l),n,l,u)}function Wi(){var t,n,l,u;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();return n!==e?(l=bt(),l===e&&(l=null),l!==e?(u=$t(),u!==e?(_=t,n=b(l,u),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t}function bt(){var t,n,l,u;return t=c,_=c,n=S(),n?n=void 0:n=e,n!==e?(l=ic(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=c,n=tr(),n!==e?(l=vt(),l!==e?(u=bt(),u!==e?(_=t,n=x(n,u),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=tr())),t}function tr(){var t,n,l,u;return t=c,n=Vi(),n!==e?(l=mt(),l!==e?(u=tr(),u!==e?(_=t,n=w(n,u),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=Vi()),t}function Vi(){var t,n,l;return t=c,n=or(),n!==e?(l=Yi(),l!==e?(_=t,n=C(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=Yi()),t}function Yi(){var t,n,l,u,f,$;if(t=c,i.charCodeAt(c)===40?(n=E,c++):(n=e,h===0&&v(N)),n!==e){for(l=[],u=y();u!==e;)l.push(u),u=y();l!==e?(u=bt(),u!==e?(f=$t(),f!==e?(i.charCodeAt(c)===41?($=lt,c++):($=e,h===0&&v(se)),$!==e?(_=t,n=q(u,f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t===e&&(t=Ya()),t}function Ya(){var t,n,l,u,f,$,T,L,ne,I;if(t=c,n=rr(),n!==e){for(l=[],u=y();u!==e;)l.push(u),u=y();if(l!==e)if(i.charCodeAt(c)===58?(u=W,c++):(u=e,h===0&&v(R)),u!==e){for(f=[],$=y();$!==e;)f.push($),$=y();if(f!==e)if(i.charCodeAt(c)===123?($=xe,c++):($=e,h===0&&v(Wt)),$!==e){for(T=[],L=y();L!==e;)T.push(L),L=y();T!==e?(L=bt(),L!==e?(ne=$t(),ne!==e?(i.charCodeAt(c)===125?(I=Vt,c++):(I=e,h===0&&v(Yt)),I!==e?(_=t,n=Fn(n,L,ne),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t===e&&(t=Ka()),t}function Ka(){var t;return t=Za(),t===e&&(t=Xa(),t===e&&(t=Ga())),t}function rr(){var t;return h++,t=nr(),h--,t===e&&h===0&&v(Qn),t}function Za(){var t,n,l,u,f,$;if(t=c,n=rr(),n!==e){for(l=[],u=y();u!==e;)l.push(u),u=y();if(l!==e)if(u=es(),u!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=nr(),$!==e?(_=t,n=Hn(n,u,$),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function Xa(){var t,n,l,u,f,$;if(t=c,n=rr(),n!==e){for(l=[],u=y();u!==e;)l.push(u),u=y();if(l!==e)if(i.charCodeAt(c)===58?(u=W,c++):(u=e,h===0&&v(R)),u!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=ir(),$!==e?(_=t,n=qn(n,$),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function Ga(){var t,n;return t=c,n=Xi(),n!==e&&(_=t,n=Wn(n)),t=n,t}function ir(){var t,n,l,u,f,$;if(t=c,i.charCodeAt(c)===40?(n=E,c++):(n=e,h===0&&v(N)),n!==e){for(l=[],u=y();u!==e;)l.push(u),u=y();l!==e?(u=Ki(),u!==e?(f=$t(),f!==e?(i.charCodeAt(c)===41?($=lt,c++):($=e,h===0&&v(se)),$!==e?(_=t,n=Vn(u,f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t===e&&(t=Xi()),t}function Ki(){var t,n,l,u;return t=c,n=sr(),n!==e?(l=vt(),l!==e?(u=Ki(),u!==e?(_=t,n=Yn(n,u),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=sr()),t}function sr(){var t,n,l,u;return t=c,n=Zi(),n!==e?(l=mt(),l!==e?(u=sr(),u!==e?(_=t,n=Kn(n,u),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e),t===e&&(t=Zi()),t}function Zi(){var t,n,l;return t=c,n=or(),n!==e?(l=ir(),l!==e?(_=t,n=Zn(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=ir()),t}function Xi(){var t,n;return h++,t=c,n=yt(),n!==e&&(_=t,n=Gn(n)),t=n,t===e&&(t=c,n=Gi(),n!==e&&(_=t,n=Jn(n)),t=n),h--,t===e&&(n=e,h===0&&v(Xn)),t}function vt(){var t,n,l,u,f;if(h++,t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,2).toLowerCase()===si?(l=i.substr(c,2),c+=2):(l=e,h===0&&v(oi)),l!==e){if(u=[],f=y(),f!==e)for(;f!==e;)u.push(f),f=y();else u=e;u!==e?(n=[n,l,u],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,_=c,n=S(),n?n=void 0:n=e,n!==e?(l=ts(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&v(ea)),t}function mt(){var t,n,l,u,f;if(h++,t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,3).toLowerCase()===ni?(l=i.substr(c,3),c+=3):(l=e,h===0&&v(ai)),l!==e){if(u=[],f=y(),f!==e)for(;f!==e;)u.push(f),f=y();else u=e;u!==e?(n=[n,l,u],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,_=c,n=S(),n?n=void 0:n=e,n!==e?(l=rs(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&v(ta)),t}function or(){var t,n,l,u;if(h++,t=c,i.substr(c,3).toLowerCase()===ci?(n=i.substr(c,3),c+=3):(n=e,h===0&&v(li)),n!==e){if(l=[],u=y(),u!==e)for(;u!==e;)l.push(u),u=y();else l=e;l!==e?(n=[n,l],t=n):(c=t,t=e)}else c=t,t=e;return t===e&&(t=c,_=c,n=S(),n?n=void 0:n=e,n!==e?(l=is(),l!==e?(n=[n,l],t=n):(c=t,t=e)):(c=t,t=e)),h--,t===e&&(n=e,h===0&&v(ra)),t}function nr(){var t;return h++,t=yt(),t===e&&(t=Gi()),h--,t===e&&h===0&&v(ia),t}function yt(){var t,n,l,u,f,$;if(t=c,i.charCodeAt(c)===34?(n=Ie,c++):(n=e,h===0&&v(Fe)),n!==e){for(l=[],u=Ce();u!==e;)l.push(u),u=Ce();if(l!==e)if(u=qe(),u!==e){for(f=[],$=Ce();$!==e;)f.push($),$=Ce();f!==e?(i.charCodeAt(c)===34?($=Ie,c++):($=e,h===0&&v(Fe)),$!==e?(_=t,n=Kt(l,u,f),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;if(t===e)if(t=c,i.charCodeAt(c)===34?(n=Ie,c++):(n=e,h===0&&v(Fe)),n!==e){for(l=[],u=Ce();u!==e;)l.push(u),u=Ce();l!==e?(i.charCodeAt(c)===34?(u=Ie,c++):(u=e,h===0&&v(Fe)),u!==e?(_=t,n=sa(l),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function Ce(){var t,n,l;return t=ar(),t===e&&(t=c,i.charCodeAt(c)===92?(n=Qe,c++):(n=e,h===0&&v(He)),n!==e?(oa.test(i.charAt(c))?(l=i.charAt(c),c++):(l=e,h===0&&v(na)),l!==e?(_=t,n=pt(l),t=n):(c=t,t=e)):(c=t,t=e),t===e&&(t=c,n=c,h++,l=qe(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(aa.test(i.charAt(c))?(l=i.charAt(c),c++):(l=e,h===0&&v(ca)),l!==e?(_=t,n=pt(l),t=n):(c=t,t=e)):(c=t,t=e))),t}function Gi(){var t,n,l,u,f;for(t=c,n=[],l=Pe();l!==e;)n.push(l),l=Pe();if(n!==e)if(l=qe(),l!==e){for(u=[],f=Pe();f!==e;)u.push(f),f=Pe();u!==e?(_=t,n=Kt(n,l,u),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;if(t===e){if(t=c,n=[],l=Pe(),l!==e)for(;l!==e;)n.push(l),l=Pe();else n=e;n!==e&&(_=t,n=la(n)),t=n}return t}function Pe(){var t,n,l,u,f;return t=ar(),t===e&&(t=ec(),t===e&&(t=tc(),t===e&&(t=Ja(),t===e&&(t=c,n=c,h++,l=Ji(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(l=c,h++,u=rc(),h--,u===e?l=void 0:(c=l,l=e),l!==e?(u=c,h++,f=qe(),h--,f===e?u=void 0:(c=u,u=e),u!==e?(i.length>c?(f=i.charAt(c),c++):(f=e,h===0&&v(pi)),f!==e?(_=t,n=pt(f),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e))))),t}function Ja(){var t,n;return t=c,i.charCodeAt(c)===42?(n=ut,c++):(n=e,h===0&&v(dt)),n!==e&&(_=t,n=pa()),t=n,t}function $t(){var t,n,l,u,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(l=qe(),l!==e){for(u=[],f=y();f!==e;)u.push(f),f=y();u!==e?(_=t,n=Kt(n,l,u),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;if(t===e)for(t=[],n=y();n!==e;)t.push(n),n=y();return t}function ar(){var t,n;return t=c,i.substr(c,2)===ui?(n=ui,c+=2):(n=e,h===0&&v(ua)),n!==e&&(_=t,n=da()),t=n,t===e&&(t=c,i.substr(c,2)===di?(n=di,c+=2):(n=e,h===0&&v(ha)),n!==e&&(_=t,n=fa()),t=n,t===e&&(t=c,i.substr(c,2)===hi?(n=hi,c+=2):(n=e,h===0&&v(ga)),n!==e&&(_=t,n=ba()),t=n)),t}function ec(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Qe,c++):(n=e,h===0&&v(He)),n!==e?(l=Ji(),l!==e?(_=t,n=pt(l),t=n):(c=t,t=e)):(c=t,t=e),t}function tc(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Qe,c++):(n=e,h===0&&v(He)),n!==e?(i.substr(c,2).toLowerCase()===si?(l=i.substr(c,2),c+=2):(l=e,h===0&&v(oi)),l===e&&(i.substr(c,3).toLowerCase()===ni?(l=i.substr(c,3),c+=3):(l=e,h===0&&v(ai)),l===e&&(i.substr(c,3).toLowerCase()===ci?(l=i.substr(c,3),c+=3):(l=e,h===0&&v(li)))),l!==e?(_=t,n=va(l),t=n):(c=t,t=e)):(c=t,t=e),t}function rc(){var t;return t=vt(),t===e&&(t=mt(),t===e&&(t=or())),t}function Ji(){var t;return ma.test(i.charAt(c))?(t=i.charAt(c),c++):(t=e,h===0&&v(ya)),t}function es(){var t,n;return t=c,i.substr(c,2)===fi?(n=fi,c+=2):(n=e,h===0&&v($a)),n!==e&&(_=t,n=_a()),t=n,t===e&&(t=c,i.substr(c,2)===gi?(n=gi,c+=2):(n=e,h===0&&v(wa)),n!==e&&(_=t,n=Sa()),t=n,t===e&&(t=c,i.charCodeAt(c)===60?(n=bi,c++):(n=e,h===0&&v(vi)),n!==e&&(_=t,n=Aa()),t=n,t===e&&(t=c,i.charCodeAt(c)===62?(n=mi,c++):(n=e,h===0&&v(yi)),n!==e&&(_=t,n=xa()),t=n))),t}function y(){var t;return h++,ka.test(i.charAt(c))?(t=i.charAt(c),c++):(t=e,h===0&&v(Ca)),h--,t===e&&h===0&&v(Ea),t}function qe(){var t,n,l;return t=c,_=c,n=Pa(),n?n=void 0:n=e,n!==e?(i.substr(c,14)===$i?(l=$i,c+=14):(l=e,h===0&&v(Oa)),l!==e?(_=t,n=Ta(),t=n):(c=t,t=e)):(c=t,t=e),t}function ts(){var t,n,l,u,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(i.substr(c,2)===_i?(l=_i,c+=2):(l=e,h===0&&v(Da)),l!==e){for(u=[],f=y();f!==e;)u.push(f),f=y();u!==e?(_=t,n=La(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function rs(){var t,n,l,u,f;for(t=c,n=[],l=y();l!==e;)n.push(l),l=y();if(n!==e)if(i.substr(c,2)===wi?(l=wi,c+=2):(l=e,h===0&&v(Na)),l!==e){for(u=[],f=y();f!==e;)u.push(f),f=y();u!==e?(_=t,n=Si(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t===e&&(t=c,i.charCodeAt(c)===43?(n=Ai,c++):(n=e,h===0&&v(xi)),n!==e&&(_=t,n=Si()),t=n),t}function is(){var t,n;return t=c,i.charCodeAt(c)===45?(n=Ei,c++):(n=e,h===0&&v(ki)),n!==e&&(_=t,n=Ci()),t=n,t===e&&(t=c,i.charCodeAt(c)===33?(n=Pi,c++):(n=e,h===0&&v(Oi)),n!==e&&(_=t,n=Ci()),t=n),t}function ic(){var t;return t=sc(),t===e&&(t=ss(),t===e&&(t=oc())),t}function sc(){var t,n,l,u,f,$;if(t=c,n=Oe(),n!==e){for(l=[],u=y();u!==e;)l.push(u),u=y();if(l!==e)if(i.charCodeAt(c)===58?(u=W,c++):(u=e,h===0&&v(R)),u!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=ss(),$!==e?(n=[n,l,u,f,$],t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function ss(){var t;return t=nc(),t===e&&(t=cr(),t===e&&(t=ac(),t===e&&(t=cc(),t===e&&(t=lc(),t===e&&(t=pc()))))),t}function oc(){var t,n,l,u,f,$;if(t=c,i.substr(c,8)===Ti?(n=Ti,c+=8):(n=e,h===0&&v(ja)),n!==e){for(l=[],u=y();u!==e;)l.push(u),u=y();if(l!==e)if(i.charCodeAt(c)===58?(u=W,c++):(u=e,h===0&&v(R)),u!==e){for(f=[],$=y();$!==e;)f.push($),$=y();f!==e?($=Oe(),$!==e?(_=t,n=za(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;else c=t,t=e}else c=t,t=e;return t}function nc(){var t,n,l,u,f,$,T;if(t=c,n=es(),n!==e){for(l=[],u=y();u!==e;)l.push(u),u=y();l!==e?(u=Oe(),u!==e?(_=t,n=Di(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;if(t===e)if(t=c,n=hc(),n!==e){for(l=[],u=y();u!==e;)l.push(u),u=y();l!==e?(u=Oe(),u!==e?(f=as(),f!==e?($=Oe(),$!==e?(T=fc(),T!==e?(_=t,n=Di(),t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function cr(){var t,n,l,u,f;for(t=c,n=[],l=_t(),l===e&&(i.charCodeAt(c)===42?(l=ut,c++):(l=e,h===0&&v(dt)));l!==e;)n.push(l),l=_t(),l===e&&(i.charCodeAt(c)===42?(l=ut,c++):(l=e,h===0&&v(dt)));if(n!==e)if(i.charCodeAt(c)===63?(l=Li,c++):(l=e,h===0&&v(Ni)),l!==e){for(u=[],f=cr();f!==e;)u.push(f),f=cr();u!==e?(_=t,n=Ba(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function ac(){var t,n,l,u;if(t=c,i.charCodeAt(c)===47?(n=Zt,c++):(n=e,h===0&&v(Xt)),n!==e){for(l=[],ji.test(i.charAt(c))?(u=i.charAt(c),c++):(u=e,h===0&&v(zi));u!==e;)l.push(u),ji.test(i.charAt(c))?(u=i.charAt(c),c++):(u=e,h===0&&v(zi));l!==e?(i.charCodeAt(c)===47?(u=Zt,c++):(u=e,h===0&&v(Xt)),u!==e?(_=t,n=Ra(),t=n):(c=t,t=e)):(c=t,t=e)}else c=t,t=e;return t}function cc(){var t,n,l,u,f;if(t=c,n=os(),n!==e)if(i.charCodeAt(c)===126?(l=Gt,c++):(l=e,h===0&&v(Jt)),l!==e){for(u=[],Ee.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&v(ke));f!==e;)u.push(f),Ee.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&v(ke));u!==e?(_=t,n=Ma(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function lc(){var t,n,l,u,f;if(t=c,n=yt(),n!==e)if(i.charCodeAt(c)===126?(l=Gt,c++):(l=e,h===0&&v(Jt)),l!==e){for(u=[],Ee.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&v(ke));f!==e;)u.push(f),Ee.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&v(ke));u!==e?(_=t,n=Ua(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function pc(){var t,n,l,u,f;if(t=c,n=Oe(),n!==e)if(i.charCodeAt(c)===94?(l=Bi,c++):(l=e,h===0&&v(Ri)),l!==e){for(u=[],Ee.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&v(ke));f!==e;)u.push(f),Ee.test(i.charAt(c))?(f=i.charAt(c),c++):(f=e,h===0&&v(ke));u!==e?(_=t,n=Ia(),t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function Oe(){var t;return t=yt(),t===e&&(t=os()),t}function os(){var t,n;if(t=[],n=_t(),n!==e)for(;n!==e;)t.push(n),n=_t();else t=e;return t}function _t(){var t,n,l,u;return t=ar(),t===e&&(t=dc(),t===e&&(t=c,n=c,h++,l=ns(),h--,l===e?n=void 0:(c=n,n=e),n!==e?(l=c,h++,u=uc(),h--,u===e?l=void 0:(c=l,l=e),l!==e?(i.length>c?(u=i.charAt(c),c++):(u=e,h===0&&v(pi)),u!==e?(n=[n,l,u],t=n):(c=t,t=e)):(c=t,t=e)):(c=t,t=e))),t}function uc(){var t;return t=vt(),t===e&&(t=mt(),t===e&&(t=ts(),t===e&&(t=rs(),t===e&&(t=is(),t===e&&(t=as()))))),t}function dc(){var t,n,l;return t=c,i.charCodeAt(c)===92?(n=Qe,c++):(n=e,h===0&&v(He)),n!==e?(l=ns(),l!==e?(_=t,n=Fa(),t=n):(c=t,t=e)):(c=t,t=e),t}function ns(){var t;return i.charCodeAt(c)===43?(t=Ai,c++):(t=e,h===0&&v(xi)),t===e&&(i.charCodeAt(c)===45?(t=Ei,c++):(t=e,h===0&&v(ki)),t===e&&(i.charCodeAt(c)===61?(t=Qa,c++):(t=e,h===0&&v(Ha)),t===e&&(i.charCodeAt(c)===62?(t=mi,c++):(t=e,h===0&&v(yi)),t===e&&(i.charCodeAt(c)===60?(t=bi,c++):(t=e,h===0&&v(vi)),t===e&&(i.charCodeAt(c)===33?(t=Pi,c++):(t=e,h===0&&v(Oi)),t===e&&(i.charCodeAt(c)===40?(t=E,c++):(t=e,h===0&&v(N)),t===e&&(i.charCodeAt(c)===41?(t=lt,c++):(t=e,h===0&&v(se)),t===e&&(i.charCodeAt(c)===123?(t=xe,c++):(t=e,h===0&&v(Wt)),t===e&&(i.charCodeAt(c)===125?(t=Vt,c++):(t=e,h===0&&v(Yt)),t===e&&(i.charCodeAt(c)===91?(t=Mi,c++):(t=e,h===0&&v(Ui)),t===e&&(i.charCodeAt(c)===93?(t=Ii,c++):(t=e,h===0&&v(Fi)),t===e&&(i.charCodeAt(c)===94?(t=Bi,c++):(t=e,h===0&&v(Ri)),t===e&&(i.charCodeAt(c)===34?(t=Ie,c++):(t=e,h===0&&v(Fe)),t===e&&(i.charCodeAt(c)===126?(t=Gt,c++):(t=e,h===0&&v(Jt)),t===e&&(i.charCodeAt(c)===42?(t=ut,c++):(t=e,h===0&&v(dt)),t===e&&(i.charCodeAt(c)===63?(t=Li,c++):(t=e,h===0&&v(Ni)),t===e&&(i.charCodeAt(c)===58?(t=W,c++):(t=e,h===0&&v(R)),t===e&&(i.charCodeAt(c)===92?(t=Qe,c++):(t=e,h===0&&v(He)),t===e&&(i.charCodeAt(c)===47?(t=Zt,c++):(t=e,h===0&&v(Xt))))))))))))))))))))),t}function as(){var t,n,l,u,f;if(t=c,n=[],l=y(),l!==e)for(;l!==e;)n.push(l),l=y();else n=e;if(n!==e)if(i.substr(c,2)===Qi?(l=Qi,c+=2):(l=e,h===0&&v(qa)),l!==e){if(u=[],f=y(),f!==e)for(;f!==e;)u.push(f),f=y();else u=e;u!==e?(n=[n,l,u],t=n):(c=t,t=e)}else c=t,t=e;else c=t,t=e;return t}function hc(){var t;return i.charCodeAt(c)===91?(t=Mi,c++):(t=e,h===0&&v(Ui)),t===e&&(i.charCodeAt(c)===123?(t=xe,c++):(t=e,h===0&&v(Wt))),t}function fc(){var t;return i.charCodeAt(c)===93?(t=Ii,c++):(t=e,h===0&&v(Fi)),t===e&&(i.charCodeAt(c)===125?(t=Vt,c++):(t=e,h===0&&v(Yt))),t}const{errorOnLuceneSyntax:gc,parseCursor:bc,cursorSymbol:vc,allowLeadingWildcards:mc=!0,helpers:{nodeTypes:ge}}=a,Y=ge.function.buildNodeWithArgumentNodes,oe=ge.literal.buildNode,yc=ge.wildcard.buildNode,$c=ge.namedArg.buildNode,{wildcardSymbol:cs}=ge.wildcard;if(ft=g(),ft!==e&&c===i.length)return ft;throw ft!==e&&c<i.length&&v({type:"end",description:"end of input"}),qi(null,er,V<i.length?i.charAt(V):null,V<i.length?gt(V,V+1):gt(V,V))}return{SyntaxError:r,parse:s}}(),Bt=(o,r={},s=ot)=>{if(typeof o>"u")throw new Error("expression must be a string, got undefined instead");return s(o,{...r,helpers:{nodeTypes:Z}})},we=(o,r={})=>Bt(o,{...r,startRule:"Literal"},ot),nt=(o,r={})=>{try{return Bt(o,r,ot)}catch(s){throw s.name==="SyntaxError"?new Br(s,o):s}},no=o=>{try{return Bt(o,{errorOnLuceneSyntax:!0},ot),!1}catch(r){return r.message.startsWith("Lucene")}},j=(o,r,s,i)=>(r=void 0,!o||!o.type||!Z[o.type]?j(Z.function.buildNode("and",[]),r):Z[o.type].toOpenSearchQuery(o,r,s,i)),K="@kuery-wildcard@";function ao(o){return o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function co(o){return o.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function lo(o){return o.includes(K)?{type:"wildcard",value:o}:we(o)}function Rr(o,r){const{value:s}=o,i=s.split(K).map(ao).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(r)}function po(o){const{value:r}=o;return r.split(K).join("*")}function Rt(o){const{value:r}=o;return r.split(K).map(co).join("*")}function uo(o){const{value:r}=o;return r.startsWith(K)&&r.replace(K,"").length>0}const ho=Object.freeze(Object.defineProperty({__proto__:null,buildNode:lo,hasLeadingWildcard:uo,test:Rr,toOpenSearchQuery:po,toQueryStringQuery:Rt,wildcardSymbol:K},Symbol.toStringTag,{value:"Module"}));function Mt(o,r){if(!r)return[];if(o.type==="literal"){const s=zt(o),i=r.fields.find(a=>a.name===s);return i?[i]:[]}else if(o.type==="wildcard")return r.fields.filter(i=>Rr(o,i.name))}function Sc(o){return o}function Mr(o,r,s){const i={...o,value:s?`${s}.${o.value}`:o.value};if(!r||i.type==="wildcard"&&!s)return i;const e=Mt(i,r).reduce((p,g)=>{const b=g.subType&&g.subType.nested?g.subType.nested.path:void 0;return s&&!b?[...p,`${g.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:b&&!s?[...p,`${g.name} is a nested field, but is not in a nested group in the DQL expression.`]:b!==s?[...p,`Nested field ${g.name} is being queried with the incorrect nested path. The correct path is ${g.subType.nested.path}.`]:p},[]);if(e.length>0)throw new Error(e.join(`
727
- `));return i}function fo(o,r,s=!1){if(o===void 0)throw new Error("fieldName is a required argument");if(r===void 0)throw new Error("value is a required argument");const i=typeof o=="string"?we(o):_e(o),a=typeof r=="string"?we(r):_e(r),e=_e(s);return{arguments:[i,a,e]}}function go(o,r,s={},i={}){const{arguments:[a,e,p]}=o,g=Mr(a,r,i!=null&&i.nested?i.nested.path:void 0),b=j(g),S=e!==void 0?j(e):e,x=p.value?"phrase":"best_fields";if(g.value===null)return e.type==="wildcard"?{query_string:{query:Rt(e)}}:{multi_match:{type:x,query:S,lenient:!0}};const w=r?Mt(g,r):[];w&&w.length===0&&w.push({name:j(g),scripted:!1,type:""});const C=e.type==="wildcard"&&S==="*",E=g.type==="wildcard"&&b==="*"||w&&r&&w.length===r.fields.length;return C&&E?{match_all:{}}:{bool:{should:w.reduce((se,q)=>{const W=R=>{var xe;return g.type!=="wildcard"||!((xe=q.subType)!=null&&xe.nested)||i!=null&&i.nested?R:{nested:{path:q.subType.nested.path,query:R,score_mode:"none"}}};if(q.scripted)return[];if(C)return[...se,W({exists:{field:q.name}})];if(e.type==="wildcard")return[...se,W({query_string:{fields:[q.name],query:Rt(e)}})];if(q.type==="date"){const R=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return[...se,W({range:{[q.name]:{gte:S,lte:S,...R}}})]}else{const R=x==="phrase"?"match_phrase":"match";return[...se,W({[R]:{[q.name]:S}})]}},[])||[],minimum_should_match:1}}}const bo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:fo,toOpenSearchQuery:go},Symbol.toStringTag,{value:"Module"}));function vo(o){return{arguments:o}}function mo(o,r,s={},i={}){return{bool:{filter:(o.arguments||[]).map(e=>j(e,r,s,i))}}}const yo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:vo,toOpenSearchQuery:mo},Symbol.toStringTag,{value:"Module"}));function $o(o){return{arguments:o}}function _o(o,r,s={},i={}){return{bool:{should:(o.arguments||[]).map(e=>j(e,r,s,i)),minimum_should_match:1}}}const wo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:$o,toOpenSearchQuery:_o},Symbol.toStringTag,{value:"Module"}));function So(o){return{arguments:[o]}}function Ao(o,r,s={},i={}){const[a]=o.arguments;return{bool:{must_not:j(a,r,s,i)}}}const xo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:So,toOpenSearchQuery:Ao},Symbol.toStringTag,{value:"Module"}));function Eo(o,...r){let s={};for(let i of r)s[i]=o[i];return s}function ko(o,r){const s=Eo(r,"gt","lt","gte","lte","format"),i=typeof o=="string"?we(o):Z.literal.buildNode(o),a=Object.entries(s).map(e=>{let[p,g]=e;return Z.namedArg.buildNode(p,g)});return{arguments:[i,...a]}}function Co(o,r,s={},i={}){const[a,...e]=o.arguments,p=Mr(a,r,i!=null&&i.nested?i.nested.path:void 0),g=r?Mt(p,r):[],b=Po(e),S=Object.fromEntries(Object.entries(b).map(([w,C])=>[w,j(C)]));return g&&g.length===0&&g.push({name:j(p),scripted:!1,type:""}),{bool:{should:g.map(w=>{const C=E=>{var N;return p.type!=="wildcard"||!((N=w.subType)!=null&&N.nested)||i.nested?E:{nested:{path:w.subType.nested.path,query:E,score_mode:"none"}}};if(w.scripted)return{};if(w.type==="date"){const E=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return C({range:{[w.name]:{...S,...E}}})}return C({range:{[w.name]:S}})}),minimum_should_match:1}}}function Po(o){if(o.gt&&o.gte||o.lt&&o.lte)throw new Error("range ends cannot be both inclusive and exclusive");const r=["gte","lte","format"];return o.reduce((s,i,a)=>(i.type==="namedArg"?s[i.name]=i.value:s[r[a]]=i,s),{})}const Oo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ko,toOpenSearchQuery:Co},Symbol.toStringTag,{value:"Module"}));function To(o){return{arguments:[_e(o)]}}function Do(o,r,s={},i={}){const{arguments:[a]}=o,e={...a,value:i!=null&&i.nested?`${i.nested.path}.${a.value}`:a.value},p=zt(e),g=((r==null?void 0:r.fields)||[]).find(b=>b.name===p);if(g&&g.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:p}}}const Lo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:To,toOpenSearchQuery:Do},Symbol.toStringTag,{value:"Module"}));function No(o,r){return{arguments:[typeof o=="string"?we(o):_e(o),r]}}function jo(o,r,s={},i={}){var b;const[a,e]=o.arguments,p=j(a),g=(b=i==null?void 0:i.nested)!=null&&b.path?`${i.nested.path}.${p}`:p;return{nested:{path:g,query:j(e,r,s,{...i,nested:{path:g}}),score_mode:"none"}}}const Ut={is:bo,and:yo,or:wo,not:xo,range:Oo,exists:Lo,nested:Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:No,toOpenSearchQuery:jo},Symbol.toStringTag,{value:"Module"}))};function zo(o,...r){const s=Ut[o];if(s===void 0)throw new Error(`Unknown function "${o}"`);return{type:"function",function:o,...s.buildNodeParams(...r)}}function Bo(o,r){if(Ut[o]===void 0)throw new Error(`Unknown function "${o}"`);return{type:"function",function:o,arguments:r}}function Ro(o,r,s,i){return Ut[o.function].toOpenSearchQuery(o,r,s,i)}const Mo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:zo,buildNodeWithArgumentNodes:Bo,toOpenSearchQuery:Ro},Symbol.toStringTag,{value:"Module"}));function Uo(o,r){const s=r.type==="literal"?r:Z.literal.buildNode(r);return{type:"namedArg",name:o,value:s}}function Io(o){return j(o.value)}const Z={function:Mo,literal:oo,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:Uo,toOpenSearchQuery:Io},Symbol.toStringTag,{value:"Module"})),wildcard:ho},Fo=K,Qo=(o,r)=>"("+(o.arguments||[]).map(i=>he(i,r)).join(" AND ")+")",Ho=(o,r)=>{var{arguments:[s,i,a]}=o;let e="=";i.type==="wildcard"&&(e="");let p=he(i);a=a.value||typeof p=="string",i.type==="literal"&&a&&(p=`'${p}'`),i.type==="literal"&&!a&&(p=`${p}`);let g=he(s);return g==null?r&&a?`(${r.filter(b=>b.type==="string").map(b=>`${b.name} ILIKE '%${i.value}%'`).join(" OR ")})`:r&&!a&&(i.value===!0||i.value===!1)?`(${r.filter(b=>b.type==="boolean").map(b=>`${b.name}=${i.value}`).join(" OR ")})`:"":g+e+p},qo=(o,r)=>"("+(o.arguments||[]).map(i=>he(i,r)).join(" OR ")+")",Wo=(o,r)=>{const[s]=o.arguments;return"NOT ("+he(s,r)+")"},Vo={gt:">",lt:"<",gte:">=",lte:"<="},Yo={is:Ho,and:Qo,or:qo,not:Wo,range:o=>{const[r,s]=o.arguments;let i=s.value;const a=Vo[s.name];let e=he(i);return i.type==="literal"&&(e=`${e}`),`${r.value} ${a} ${e}`},exists:o=>{const[r]=o.arguments;return`${r.value} IS NOT NULL`},nested:o=>(console.warn("Nested types dont exist in CQL",o),"")},Ko={function:(o,r)=>Yo[o.function](o,r),literal:o=>o.value,wildcard:o=>{const{value:r}=o;return` LIKE '${r.split(Fo).join("%")}'`}},he=(o,r)=>{const s=Ko[o.type];return s(o,r)},Zo=K,Xo=o=>({$and:(o.arguments||[]).map(i=>te(i))}),Go=o=>{const{arguments:[r,s]}=o;let i=te(s);if(s.type==="wildcard"&&s.value==="@kuery-wildcard@")return Ur(o);let e={};return e[te(r)]={$eq:i},e},Jo=o=>({$or:(o.arguments||[]).map(s=>te(s))}),en=o=>{const[r]=o.arguments;let s={};return s={$ne:te(r)},s},tn={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},rn=o=>{const[r,s]=o.arguments;let i=s.value;const a=tn[s.name];let e=te(i),p={};return p[r.value]={},p[r.value][a]=e,p},Ur=o=>{const[r]=o.arguments;return{[te(r)]:{$ne:null}}},sn={is:Go,and:Xo,or:Jo,not:en,range:rn,exists:Ur,nested:o=>(console.warn("TODO Implement nested search",o),"")},on={function:o=>sn[o.function](o),literal:o=>o.value,wildcard:o=>{const{value:r}=o;return`/${r.split(Zo).join(".*")}/`}},te=(o,r)=>{const s=on[o.type];return s(o,r)},nn=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:Br,doesKueryExpressionHaveLuceneSyntaxError:no,fromKueryExpression:nt,fromLiteralExpression:we,nodeTypes:Z,parse:nt,toCql:he,toDSL:j,toMongo:te,toOpenSearchQuery:j},Symbol.toStringTag,{value:"Module"})),an=M`
723
+ `}return`Not yet implemented ${this.variant}`}},T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"checked",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"placeholder",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"readonly",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"variant",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"disabled",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"label",2),T([v()],d.SpectricInput.prototype,"hidePasswordLabel",2),T([v()],d.SpectricInput.prototype,"showPasswordLabel",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"showPasswordVisibilityToggle",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"helperText",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"invalid",2),T([v({type:Boolean,reflect:!0})],d.SpectricInput.prototype,"required",2),T([v({type:String,reflect:!0})],d.SpectricInput.prototype,"invalidText",2),T([v()],d.SpectricInput.prototype,"name",2),T([v()],d.SpectricInput.prototype,"pattern",2),T([v({type:Number,reflect:!0})],d.SpectricInput.prototype,"maxCount",2),T([v({reflect:!0})],d.SpectricInput.prototype,"autocomplete",2),T([v({reflect:!0})],d.SpectricInput.prototype,"value",1),T([we("input")],d.SpectricInput.prototype,"_input",2),d.SpectricInput=T([D("spectric-input")],d.SpectricInput);const Se=o=>qt(o===""?void 0:o??void 0),vo="end of input",mo={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class Xr extends Error{constructor(t,s){let i=t.message;if(t.expected){const p=t.expected.map(g=>mo[g.description]||g.description).join(", ");let h=t.found?`"${t.found}"`:vo;i=`Expected ${p} but ${h} found.`}const n=[i,s,"-".repeat(t.location.start.offset)+"^"].join(`
724
+ `);super(n),this.name="DQLSyntaxError",this.shortMessage=i}}function Ae(o){return{type:"literal",value:o}}function Vt(o){return o.value}const yo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Ae,toOpenSearchQuery:Vt},Symbol.toStringTag,{value:"Module"})),{SyntaxError:Rc,parse:ft}=function(){function o(i,n){function e(){this.constructor=i}e.prototype=n.prototype,i.prototype=new e}function t(i,n,e,p){this.message=i,this.expected=n,this.found=e,this.location=p,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)}o(t,Error);function s(i){var n=arguments.length>1?arguments[1]:{},e={},p={start:as,Literal:vr},h=as,g=function(r,a){return a.type==="cursor"?{...a,suggestionTypes:["conjunction"]}:r!==null?r:me.function.buildNode("is","*","*")},$=function(){return Oc},k=function(r,a){const l=[r,a].find(u=>u.type==="cursor");return l||Z("or",[r,a])},y=function(r,a){const l=[r,a].find(u=>u.type==="cursor");return l||Z("and",[r,a])},E=function(r){return r.type==="cursor"?r:Z("not",[r])},x="(",C={type:"literal",value:"(",description:'"("'},N=")",z={type:"literal",value:")",description:'")"'},M=function(r,a){return a.type==="cursor"?{...a,suggestionTypes:["conjunction"]}:r},Y=":",U={type:"literal",value:":",description:'":"'},Te="{",ir={type:"literal",value:"{",description:'"{"'},sr="}",or={type:"literal",value:"}",description:'"}"'},sa=function(r,a,l){return a.type==="cursor"?{...a,nestedPath:a.nestedPath?`${r.value}.${a.nestedPath}`:r.value}:l.type==="cursor"?{...l,suggestionTypes:["conjunction"]}:Z("nested",[r,a])},oa={type:"other",description:"fieldName"},na=function(r,a,l){if(l.type==="cursor")return{...l,suggestionTypes:["conjunction"]};const u=jc(a,l);return Z("range",[r,u])},aa=function(r,a){return a.type==="cursor"?{...a,fieldName:r.value,suggestionTypes:["value","conjunction"]}:a(r)},ca=function(r){if(r.type==="cursor"){const l=`${r.prefix}${r.suffix}`.trim();return{...r,fieldName:l,suggestionTypes:["field","operator","conjunction"]}}const a=ce(null);return r(a)},la=function(r,a){return a.type==="cursor"?{...a,suggestionTypes:["conjunction"]}:r},pa=function(r,a){const l=[r,a].find(u=>u.type==="cursor");return l?{...l,suggestionTypes:["value"]}:u=>Z("or",[r(u),a(u)])},ua=function(r,a){const l=[r,a].find(u=>u.type==="cursor");return l?{...l,suggestionTypes:["value"]}:u=>Z("and",[r(u),a(u)])},da=function(r){return r.type==="cursor"?{...list,suggestionTypes:["value"]}:a=>Z("not",[r(a)])},ha={type:"other",description:"value"},fa=function(r){if(r.type==="cursor")return r;const a=ce(!0);return l=>Z("is",[l,r,a])},ga=function(r){if(r.type==="cursor")return r;!Nc&&r.type==="wildcard"&&me.wildcard.hasLeadingWildcard(r)&&F("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const a=ce(!1);return l=>Z("is",[l,r,a])},ba={type:"other",description:"OR"},yi="or",$i={type:"literal",value:"or",description:'"or"'},va={type:"other",description:"AND"},wi="and",_i={type:"literal",value:"and",description:'"and"'},ma={type:"other",description:"NOT"},Si="not",Ai={type:"literal",value:"not",description:'"not"'},ya={type:"other",description:"literal"},Ke='"',Ze={type:"literal",value:'"',description:'"\\""'},nr=function(r,a,l){const{start:u,end:b}=lc();return{type:"cursor",start:u.offset,end:b.offset-a.length,prefix:r.join(""),suffix:l.join(""),text:cc().replace(a,"")}},$a=function(r){return ce(r.join(""))},Xe="\\",Ge={type:"literal",value:"\\",description:'"\\\\"'},wa=/^[\\"]/,_a={type:"class",value:'[\\\\"]',description:'[\\\\"]'},mt=function(r){return r},Sa=/^[^"]/,Aa={type:"class",value:'[^"]',description:'[^"]'},xa=function(r){const a=r.join("").trim();return a==="null"?ce(null):a==="true"?ce(!0):a==="false"?ce(!1):r.includes(Ss)?Bc(a):ce(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(a)?isFinite(a)&&(a>Number.MAX_SAFE_INTEGER||a<Number.MIN_SAFE_INTEGER)?BigInt(a):Number(a):a)},xi={type:"any",description:"any character"},yt="*",$t={type:"literal",value:"*",description:'"*"'},Ea=function(){return Ss},Ei="\\t",ka={type:"literal",value:"\\t",description:'"\\\\t"'},Ca=function(){return" "},ki="\\r",Pa={type:"literal",value:"\\r",description:'"\\\\r"'},Ta=function(){return"\r"},Ci="\\n",Oa={type:"literal",value:"\\n",description:'"\\\\n"'},Da=function(){return`
725
+ `},La=function(r){return r},Na=/^[\\():<>"*{}]/,Ba={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},Pi="<=",ja={type:"literal",value:"<=",description:'"<="'},za=function(){return"lte"},Ti=">=",Ra={type:"literal",value:">=",description:'">="'},Ma=function(){return"gte"},Oi="<",Di={type:"literal",value:"<",description:'"<"'},Ia=function(){return"lt"},Li=">",Ni={type:"literal",value:">",description:'">"'},Ua=function(){return"gt"},Ha={type:"other",description:"whitespace"},Fa=/^[ \t\r\n]/,Qa={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},qa=function(){return Dc},Bi="@kuery-cursor@",Wa={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},Va=function(){return Lc},ji="||",Ya={type:"literal",value:"||",description:'"||"'},Ka=function(){F("LuceneOr")},zi="&&",Za={type:"literal",value:"&&",description:'"&&"'},Ri=function(){F("LuceneAnd")},Mi="+",Ii={type:"literal",value:"+",description:'"+"'},Ui="-",Hi={type:"literal",value:"-",description:'"-"'},Fi=function(){F("LuceneNot")},Qi="!",qi={type:"literal",value:"!",description:'"!"'},Wi="_exists_",Xa={type:"literal",value:"_exists_",description:'"_exists_"'},Ga=function(){F("LuceneExists")},Vi=function(){F("LuceneRange")},Yi="?",Ki={type:"literal",value:"?",description:'"?"'},Ja=function(){F("LuceneWildcard")},ar="/",cr={type:"literal",value:"/",description:'"/"'},Zi=/^[^\/]/,Xi={type:"class",value:"[^/]",description:"[^/]"},ec=function(){F("LuceneRegex")},lr="~",pr={type:"literal",value:"~",description:'"~"'},Oe=/^[0-9]/,De={type:"class",value:"[0-9]",description:"[0-9]"},tc=function(){F("LuceneFuzzy")},rc=function(){F("LuceneProximity")},Gi="^",Ji={type:"literal",value:"^",description:'"^"'},ic=function(){F("LuceneBoost")},sc=function(){return char},oc="=",nc={type:"literal",value:"=",description:'"="'},es="[",ts={type:"literal",value:"[",description:'"["'},rs="]",is={type:"literal",value:"]",description:'"]"'},ss="TO",ac={type:"literal",value:"TO",description:'"TO"'},c=0,S=0,wt=[{line:1,column:1,seenCR:!1}],K=0,ur=[],f=0,_t;if("startRule"in n){if(!(n.startRule in p))throw new Error(`Can't start parsing from rule "`+n.startRule+'".');h=p[n.startRule]}function cc(){return i.substring(S,c)}function lc(){return St(S,c)}function F(r){throw ns(r,null,i.substring(S,c),St(S,c))}function os(r){var a=wt[r],l,u;if(a)return a;for(l=r-1;!wt[l];)l--;for(a=wt[l],a={line:a.line,column:a.column,seenCR:a.seenCR};l<r;)u=i.charAt(l),u===`
726
+ `?(a.seenCR||a.line++,a.column=1,a.seenCR=!1):u==="\r"||u==="\u2028"||u==="\u2029"?(a.line++,a.column=1,a.seenCR=!0):(a.column++,a.seenCR=!1),l++;return wt[r]=a,a}function St(r,a){var l=os(r),u=os(a);return{start:{offset:r,line:l.line,column:l.column},end:{offset:a,line:u.line,column:u.column}}}function m(r){c<K||(c>K&&(K=c,ur=[]),ur.push(r))}function ns(r,a,l,u){function b(L){var B=1;for(L.sort(function(le,Q){return le.description<Q.description?-1:le.description>Q.description?1:0});B<L.length;)L[B-1]===L[B]?L.splice(B,1):B++}function _(L,B){function le(zc){function Tt(ee){return ee.charCodeAt(0).toString(16).toUpperCase()}return zc.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(ee){return"\\x0"+Tt(ee)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ee){return"\\x"+Tt(ee)}).replace(/[\u0100-\u0FFF]/g,function(ee){return"\\u0"+Tt(ee)}).replace(/[\u1000-\uFFFF]/g,function(ee){return"\\u"+Tt(ee)})}var Q=new Array(L.length),As,xs,et;for(et=0;et<L.length;et++)Q[et]=L[et].description;return As=L.length>1?Q.slice(0,-1).join(", ")+" or "+Q[L.length-1]:Q[0],xs=B?'"'+le(B)+'"':"end of input","Expected "+As+" but "+xs+" found."}return a!==null&&b(a),new t(r!==null?r:_(a,l),a,l,u)}function as(){var r,a,l,u;for(r=c,a=[],l=w();l!==e;)a.push(l),l=w();return a!==e?(l=At(),l===e&&(l=null),l!==e?(u=Ct(),u!==e?(S=r,a=g(l,u),r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e),r}function At(){var r,a,l,u;return r=c,S=c,a=$(),a?a=void 0:a=e,a!==e?(l=yc(),l!==e?(a=[a,l],r=a):(c=r,r=e)):(c=r,r=e),r===e&&(r=c,a=dr(),a!==e?(l=xt(),l!==e?(u=At(),u!==e?(S=r,a=k(a,u),r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e),r===e&&(r=dr())),r}function dr(){var r,a,l,u;return r=c,a=cs(),a!==e?(l=Et(),l!==e?(u=dr(),u!==e?(S=r,a=y(a,u),r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e),r===e&&(r=cs()),r}function cs(){var r,a,l;return r=c,a=br(),a!==e?(l=ls(),l!==e?(S=r,a=E(l),r=a):(c=r,r=e)):(c=r,r=e),r===e&&(r=ls()),r}function ls(){var r,a,l,u,b,_;if(r=c,i.charCodeAt(c)===40?(a=x,c++):(a=e,f===0&&m(C)),a!==e){for(l=[],u=w();u!==e;)l.push(u),u=w();l!==e?(u=At(),u!==e?(b=Ct(),b!==e?(i.charCodeAt(c)===41?(_=N,c++):(_=e,f===0&&m(z)),_!==e?(S=r,a=M(u,b),r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;return r===e&&(r=pc()),r}function pc(){var r,a,l,u,b,_,L,B,le,Q;if(r=c,a=hr(),a!==e){for(l=[],u=w();u!==e;)l.push(u),u=w();if(l!==e)if(i.charCodeAt(c)===58?(u=Y,c++):(u=e,f===0&&m(U)),u!==e){for(b=[],_=w();_!==e;)b.push(_),_=w();if(b!==e)if(i.charCodeAt(c)===123?(_=Te,c++):(_=e,f===0&&m(ir)),_!==e){for(L=[],B=w();B!==e;)L.push(B),B=w();L!==e?(B=At(),B!==e?(le=Ct(),le!==e?(i.charCodeAt(c)===125?(Q=sr,c++):(Q=e,f===0&&m(or)),Q!==e?(S=r,a=sa(a,B,le),r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;else c=r,r=e}else c=r,r=e;else c=r,r=e}else c=r,r=e;return r===e&&(r=uc()),r}function uc(){var r;return r=dc(),r===e&&(r=hc(),r===e&&(r=fc())),r}function hr(){var r;return f++,r=vr(),f--,r===e&&f===0&&m(oa),r}function dc(){var r,a,l,u,b,_;if(r=c,a=hr(),a!==e){for(l=[],u=w();u!==e;)l.push(u),u=w();if(l!==e)if(u=gs(),u!==e){for(b=[],_=w();_!==e;)b.push(_),_=w();b!==e?(_=vr(),_!==e?(S=r,a=na(a,u,_),r=a):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;else c=r,r=e}else c=r,r=e;return r}function hc(){var r,a,l,u,b,_;if(r=c,a=hr(),a!==e){for(l=[],u=w();u!==e;)l.push(u),u=w();if(l!==e)if(i.charCodeAt(c)===58?(u=Y,c++):(u=e,f===0&&m(U)),u!==e){for(b=[],_=w();_!==e;)b.push(_),_=w();b!==e?(_=fr(),_!==e?(S=r,a=aa(a,_),r=a):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;else c=r,r=e}else c=r,r=e;return r}function fc(){var r,a;return r=c,a=ds(),a!==e&&(S=r,a=ca(a)),r=a,r}function fr(){var r,a,l,u,b,_;if(r=c,i.charCodeAt(c)===40?(a=x,c++):(a=e,f===0&&m(C)),a!==e){for(l=[],u=w();u!==e;)l.push(u),u=w();l!==e?(u=ps(),u!==e?(b=Ct(),b!==e?(i.charCodeAt(c)===41?(_=N,c++):(_=e,f===0&&m(z)),_!==e?(S=r,a=la(u,b),r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;return r===e&&(r=ds()),r}function ps(){var r,a,l,u;return r=c,a=gr(),a!==e?(l=xt(),l!==e?(u=ps(),u!==e?(S=r,a=pa(a,u),r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e),r===e&&(r=gr()),r}function gr(){var r,a,l,u;return r=c,a=us(),a!==e?(l=Et(),l!==e?(u=gr(),u!==e?(S=r,a=ua(a,u),r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e),r===e&&(r=us()),r}function us(){var r,a,l;return r=c,a=br(),a!==e?(l=fr(),l!==e?(S=r,a=da(l),r=a):(c=r,r=e)):(c=r,r=e),r===e&&(r=fr()),r}function ds(){var r,a;return f++,r=c,a=kt(),a!==e&&(S=r,a=fa(a)),r=a,r===e&&(r=c,a=hs(),a!==e&&(S=r,a=ga(a)),r=a),f--,r===e&&(a=e,f===0&&m(ha)),r}function xt(){var r,a,l,u,b;if(f++,r=c,a=[],l=w(),l!==e)for(;l!==e;)a.push(l),l=w();else a=e;if(a!==e)if(i.substr(c,2).toLowerCase()===yi?(l=i.substr(c,2),c+=2):(l=e,f===0&&m($i)),l!==e){if(u=[],b=w(),b!==e)for(;b!==e;)u.push(b),b=w();else u=e;u!==e?(a=[a,l,u],r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;return r===e&&(r=c,S=c,a=$(),a?a=void 0:a=e,a!==e?(l=bs(),l!==e?(a=[a,l],r=a):(c=r,r=e)):(c=r,r=e)),f--,r===e&&(a=e,f===0&&m(ba)),r}function Et(){var r,a,l,u,b;if(f++,r=c,a=[],l=w(),l!==e)for(;l!==e;)a.push(l),l=w();else a=e;if(a!==e)if(i.substr(c,3).toLowerCase()===wi?(l=i.substr(c,3),c+=3):(l=e,f===0&&m(_i)),l!==e){if(u=[],b=w(),b!==e)for(;b!==e;)u.push(b),b=w();else u=e;u!==e?(a=[a,l,u],r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;return r===e&&(r=c,S=c,a=$(),a?a=void 0:a=e,a!==e?(l=vs(),l!==e?(a=[a,l],r=a):(c=r,r=e)):(c=r,r=e)),f--,r===e&&(a=e,f===0&&m(va)),r}function br(){var r,a,l,u;if(f++,r=c,i.substr(c,3).toLowerCase()===Si?(a=i.substr(c,3),c+=3):(a=e,f===0&&m(Ai)),a!==e){if(l=[],u=w(),u!==e)for(;u!==e;)l.push(u),u=w();else l=e;l!==e?(a=[a,l],r=a):(c=r,r=e)}else c=r,r=e;return r===e&&(r=c,S=c,a=$(),a?a=void 0:a=e,a!==e?(l=ms(),l!==e?(a=[a,l],r=a):(c=r,r=e)):(c=r,r=e)),f--,r===e&&(a=e,f===0&&m(ma)),r}function vr(){var r;return f++,r=kt(),r===e&&(r=hs()),f--,r===e&&f===0&&m(ya),r}function kt(){var r,a,l,u,b,_;if(r=c,i.charCodeAt(c)===34?(a=Ke,c++):(a=e,f===0&&m(Ze)),a!==e){for(l=[],u=Le();u!==e;)l.push(u),u=Le();if(l!==e)if(u=Je(),u!==e){for(b=[],_=Le();_!==e;)b.push(_),_=Le();b!==e?(i.charCodeAt(c)===34?(_=Ke,c++):(_=e,f===0&&m(Ze)),_!==e?(S=r,a=nr(l,u,b),r=a):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;else c=r,r=e}else c=r,r=e;if(r===e)if(r=c,i.charCodeAt(c)===34?(a=Ke,c++):(a=e,f===0&&m(Ze)),a!==e){for(l=[],u=Le();u!==e;)l.push(u),u=Le();l!==e?(i.charCodeAt(c)===34?(u=Ke,c++):(u=e,f===0&&m(Ze)),u!==e?(S=r,a=$a(l),r=a):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;return r}function Le(){var r,a,l;return r=mr(),r===e&&(r=c,i.charCodeAt(c)===92?(a=Xe,c++):(a=e,f===0&&m(Ge)),a!==e?(wa.test(i.charAt(c))?(l=i.charAt(c),c++):(l=e,f===0&&m(_a)),l!==e?(S=r,a=mt(l),r=a):(c=r,r=e)):(c=r,r=e),r===e&&(r=c,a=c,f++,l=Je(),f--,l===e?a=void 0:(c=a,a=e),a!==e?(Sa.test(i.charAt(c))?(l=i.charAt(c),c++):(l=e,f===0&&m(Aa)),l!==e?(S=r,a=mt(l),r=a):(c=r,r=e)):(c=r,r=e))),r}function hs(){var r,a,l,u,b;for(r=c,a=[],l=Ne();l!==e;)a.push(l),l=Ne();if(a!==e)if(l=Je(),l!==e){for(u=[],b=Ne();b!==e;)u.push(b),b=Ne();u!==e?(S=r,a=nr(a,l,u),r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;if(r===e){if(r=c,a=[],l=Ne(),l!==e)for(;l!==e;)a.push(l),l=Ne();else a=e;a!==e&&(S=r,a=xa(a)),r=a}return r}function Ne(){var r,a,l,u,b;return r=mr(),r===e&&(r=bc(),r===e&&(r=vc(),r===e&&(r=gc(),r===e&&(r=c,a=c,f++,l=fs(),f--,l===e?a=void 0:(c=a,a=e),a!==e?(l=c,f++,u=mc(),f--,u===e?l=void 0:(c=l,l=e),l!==e?(u=c,f++,b=Je(),f--,b===e?u=void 0:(c=u,u=e),u!==e?(i.length>c?(b=i.charAt(c),c++):(b=e,f===0&&m(xi)),b!==e?(S=r,a=mt(b),r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e)):(c=r,r=e))))),r}function gc(){var r,a;return r=c,i.charCodeAt(c)===42?(a=yt,c++):(a=e,f===0&&m($t)),a!==e&&(S=r,a=Ea()),r=a,r}function Ct(){var r,a,l,u,b;for(r=c,a=[],l=w();l!==e;)a.push(l),l=w();if(a!==e)if(l=Je(),l!==e){for(u=[],b=w();b!==e;)u.push(b),b=w();u!==e?(S=r,a=nr(a,l,u),r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;if(r===e)for(r=[],a=w();a!==e;)r.push(a),a=w();return r}function mr(){var r,a;return r=c,i.substr(c,2)===Ei?(a=Ei,c+=2):(a=e,f===0&&m(ka)),a!==e&&(S=r,a=Ca()),r=a,r===e&&(r=c,i.substr(c,2)===ki?(a=ki,c+=2):(a=e,f===0&&m(Pa)),a!==e&&(S=r,a=Ta()),r=a,r===e&&(r=c,i.substr(c,2)===Ci?(a=Ci,c+=2):(a=e,f===0&&m(Oa)),a!==e&&(S=r,a=Da()),r=a)),r}function bc(){var r,a,l;return r=c,i.charCodeAt(c)===92?(a=Xe,c++):(a=e,f===0&&m(Ge)),a!==e?(l=fs(),l!==e?(S=r,a=mt(l),r=a):(c=r,r=e)):(c=r,r=e),r}function vc(){var r,a,l;return r=c,i.charCodeAt(c)===92?(a=Xe,c++):(a=e,f===0&&m(Ge)),a!==e?(i.substr(c,2).toLowerCase()===yi?(l=i.substr(c,2),c+=2):(l=e,f===0&&m($i)),l===e&&(i.substr(c,3).toLowerCase()===wi?(l=i.substr(c,3),c+=3):(l=e,f===0&&m(_i)),l===e&&(i.substr(c,3).toLowerCase()===Si?(l=i.substr(c,3),c+=3):(l=e,f===0&&m(Ai)))),l!==e?(S=r,a=La(l),r=a):(c=r,r=e)):(c=r,r=e),r}function mc(){var r;return r=xt(),r===e&&(r=Et(),r===e&&(r=br())),r}function fs(){var r;return Na.test(i.charAt(c))?(r=i.charAt(c),c++):(r=e,f===0&&m(Ba)),r}function gs(){var r,a;return r=c,i.substr(c,2)===Pi?(a=Pi,c+=2):(a=e,f===0&&m(ja)),a!==e&&(S=r,a=za()),r=a,r===e&&(r=c,i.substr(c,2)===Ti?(a=Ti,c+=2):(a=e,f===0&&m(Ra)),a!==e&&(S=r,a=Ma()),r=a,r===e&&(r=c,i.charCodeAt(c)===60?(a=Oi,c++):(a=e,f===0&&m(Di)),a!==e&&(S=r,a=Ia()),r=a,r===e&&(r=c,i.charCodeAt(c)===62?(a=Li,c++):(a=e,f===0&&m(Ni)),a!==e&&(S=r,a=Ua()),r=a))),r}function w(){var r;return f++,Fa.test(i.charAt(c))?(r=i.charAt(c),c++):(r=e,f===0&&m(Qa)),f--,r===e&&f===0&&m(Ha),r}function Je(){var r,a,l;return r=c,S=c,a=qa(),a?a=void 0:a=e,a!==e?(i.substr(c,14)===Bi?(l=Bi,c+=14):(l=e,f===0&&m(Wa)),l!==e?(S=r,a=Va(),r=a):(c=r,r=e)):(c=r,r=e),r}function bs(){var r,a,l,u,b;for(r=c,a=[],l=w();l!==e;)a.push(l),l=w();if(a!==e)if(i.substr(c,2)===ji?(l=ji,c+=2):(l=e,f===0&&m(Ya)),l!==e){for(u=[],b=w();b!==e;)u.push(b),b=w();u!==e?(S=r,a=Ka(),r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;return r}function vs(){var r,a,l,u,b;for(r=c,a=[],l=w();l!==e;)a.push(l),l=w();if(a!==e)if(i.substr(c,2)===zi?(l=zi,c+=2):(l=e,f===0&&m(Za)),l!==e){for(u=[],b=w();b!==e;)u.push(b),b=w();u!==e?(S=r,a=Ri(),r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;return r===e&&(r=c,i.charCodeAt(c)===43?(a=Mi,c++):(a=e,f===0&&m(Ii)),a!==e&&(S=r,a=Ri()),r=a),r}function ms(){var r,a;return r=c,i.charCodeAt(c)===45?(a=Ui,c++):(a=e,f===0&&m(Hi)),a!==e&&(S=r,a=Fi()),r=a,r===e&&(r=c,i.charCodeAt(c)===33?(a=Qi,c++):(a=e,f===0&&m(qi)),a!==e&&(S=r,a=Fi()),r=a),r}function yc(){var r;return r=$c(),r===e&&(r=ys(),r===e&&(r=wc())),r}function $c(){var r,a,l,u,b,_;if(r=c,a=Be(),a!==e){for(l=[],u=w();u!==e;)l.push(u),u=w();if(l!==e)if(i.charCodeAt(c)===58?(u=Y,c++):(u=e,f===0&&m(U)),u!==e){for(b=[],_=w();_!==e;)b.push(_),_=w();b!==e?(_=ys(),_!==e?(a=[a,l,u,b,_],r=a):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;else c=r,r=e}else c=r,r=e;return r}function ys(){var r;return r=_c(),r===e&&(r=yr(),r===e&&(r=Sc(),r===e&&(r=Ac(),r===e&&(r=xc(),r===e&&(r=Ec()))))),r}function wc(){var r,a,l,u,b,_;if(r=c,i.substr(c,8)===Wi?(a=Wi,c+=8):(a=e,f===0&&m(Xa)),a!==e){for(l=[],u=w();u!==e;)l.push(u),u=w();if(l!==e)if(i.charCodeAt(c)===58?(u=Y,c++):(u=e,f===0&&m(U)),u!==e){for(b=[],_=w();_!==e;)b.push(_),_=w();b!==e?(_=Be(),_!==e?(S=r,a=Ga(),r=a):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;else c=r,r=e}else c=r,r=e;return r}function _c(){var r,a,l,u,b,_,L;if(r=c,a=gs(),a!==e){for(l=[],u=w();u!==e;)l.push(u),u=w();l!==e?(u=Be(),u!==e?(S=r,a=Vi(),r=a):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;if(r===e)if(r=c,a=Pc(),a!==e){for(l=[],u=w();u!==e;)l.push(u),u=w();l!==e?(u=Be(),u!==e?(b=_s(),b!==e?(_=Be(),_!==e?(L=Tc(),L!==e?(S=r,a=Vi(),r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e)):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;return r}function yr(){var r,a,l,u,b;for(r=c,a=[],l=Pt(),l===e&&(i.charCodeAt(c)===42?(l=yt,c++):(l=e,f===0&&m($t)));l!==e;)a.push(l),l=Pt(),l===e&&(i.charCodeAt(c)===42?(l=yt,c++):(l=e,f===0&&m($t)));if(a!==e)if(i.charCodeAt(c)===63?(l=Yi,c++):(l=e,f===0&&m(Ki)),l!==e){for(u=[],b=yr();b!==e;)u.push(b),b=yr();u!==e?(S=r,a=Ja(),r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;return r}function Sc(){var r,a,l,u;if(r=c,i.charCodeAt(c)===47?(a=ar,c++):(a=e,f===0&&m(cr)),a!==e){for(l=[],Zi.test(i.charAt(c))?(u=i.charAt(c),c++):(u=e,f===0&&m(Xi));u!==e;)l.push(u),Zi.test(i.charAt(c))?(u=i.charAt(c),c++):(u=e,f===0&&m(Xi));l!==e?(i.charCodeAt(c)===47?(u=ar,c++):(u=e,f===0&&m(cr)),u!==e?(S=r,a=ec(),r=a):(c=r,r=e)):(c=r,r=e)}else c=r,r=e;return r}function Ac(){var r,a,l,u,b;if(r=c,a=$s(),a!==e)if(i.charCodeAt(c)===126?(l=lr,c++):(l=e,f===0&&m(pr)),l!==e){for(u=[],Oe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=e,f===0&&m(De));b!==e;)u.push(b),Oe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=e,f===0&&m(De));u!==e?(S=r,a=tc(),r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;return r}function xc(){var r,a,l,u,b;if(r=c,a=kt(),a!==e)if(i.charCodeAt(c)===126?(l=lr,c++):(l=e,f===0&&m(pr)),l!==e){for(u=[],Oe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=e,f===0&&m(De));b!==e;)u.push(b),Oe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=e,f===0&&m(De));u!==e?(S=r,a=rc(),r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;return r}function Ec(){var r,a,l,u,b;if(r=c,a=Be(),a!==e)if(i.charCodeAt(c)===94?(l=Gi,c++):(l=e,f===0&&m(Ji)),l!==e){for(u=[],Oe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=e,f===0&&m(De));b!==e;)u.push(b),Oe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=e,f===0&&m(De));u!==e?(S=r,a=ic(),r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;return r}function Be(){var r;return r=kt(),r===e&&(r=$s()),r}function $s(){var r,a;if(r=[],a=Pt(),a!==e)for(;a!==e;)r.push(a),a=Pt();else r=e;return r}function Pt(){var r,a,l,u;return r=mr(),r===e&&(r=Cc(),r===e&&(r=c,a=c,f++,l=ws(),f--,l===e?a=void 0:(c=a,a=e),a!==e?(l=c,f++,u=kc(),f--,u===e?l=void 0:(c=l,l=e),l!==e?(i.length>c?(u=i.charAt(c),c++):(u=e,f===0&&m(xi)),u!==e?(a=[a,l,u],r=a):(c=r,r=e)):(c=r,r=e)):(c=r,r=e))),r}function kc(){var r;return r=xt(),r===e&&(r=Et(),r===e&&(r=bs(),r===e&&(r=vs(),r===e&&(r=ms(),r===e&&(r=_s()))))),r}function Cc(){var r,a,l;return r=c,i.charCodeAt(c)===92?(a=Xe,c++):(a=e,f===0&&m(Ge)),a!==e?(l=ws(),l!==e?(S=r,a=sc(),r=a):(c=r,r=e)):(c=r,r=e),r}function ws(){var r;return i.charCodeAt(c)===43?(r=Mi,c++):(r=e,f===0&&m(Ii)),r===e&&(i.charCodeAt(c)===45?(r=Ui,c++):(r=e,f===0&&m(Hi)),r===e&&(i.charCodeAt(c)===61?(r=oc,c++):(r=e,f===0&&m(nc)),r===e&&(i.charCodeAt(c)===62?(r=Li,c++):(r=e,f===0&&m(Ni)),r===e&&(i.charCodeAt(c)===60?(r=Oi,c++):(r=e,f===0&&m(Di)),r===e&&(i.charCodeAt(c)===33?(r=Qi,c++):(r=e,f===0&&m(qi)),r===e&&(i.charCodeAt(c)===40?(r=x,c++):(r=e,f===0&&m(C)),r===e&&(i.charCodeAt(c)===41?(r=N,c++):(r=e,f===0&&m(z)),r===e&&(i.charCodeAt(c)===123?(r=Te,c++):(r=e,f===0&&m(ir)),r===e&&(i.charCodeAt(c)===125?(r=sr,c++):(r=e,f===0&&m(or)),r===e&&(i.charCodeAt(c)===91?(r=es,c++):(r=e,f===0&&m(ts)),r===e&&(i.charCodeAt(c)===93?(r=rs,c++):(r=e,f===0&&m(is)),r===e&&(i.charCodeAt(c)===94?(r=Gi,c++):(r=e,f===0&&m(Ji)),r===e&&(i.charCodeAt(c)===34?(r=Ke,c++):(r=e,f===0&&m(Ze)),r===e&&(i.charCodeAt(c)===126?(r=lr,c++):(r=e,f===0&&m(pr)),r===e&&(i.charCodeAt(c)===42?(r=yt,c++):(r=e,f===0&&m($t)),r===e&&(i.charCodeAt(c)===63?(r=Yi,c++):(r=e,f===0&&m(Ki)),r===e&&(i.charCodeAt(c)===58?(r=Y,c++):(r=e,f===0&&m(U)),r===e&&(i.charCodeAt(c)===92?(r=Xe,c++):(r=e,f===0&&m(Ge)),r===e&&(i.charCodeAt(c)===47?(r=ar,c++):(r=e,f===0&&m(cr))))))))))))))))))))),r}function _s(){var r,a,l,u,b;if(r=c,a=[],l=w(),l!==e)for(;l!==e;)a.push(l),l=w();else a=e;if(a!==e)if(i.substr(c,2)===ss?(l=ss,c+=2):(l=e,f===0&&m(ac)),l!==e){if(u=[],b=w(),b!==e)for(;b!==e;)u.push(b),b=w();else u=e;u!==e?(a=[a,l,u],r=a):(c=r,r=e)}else c=r,r=e;else c=r,r=e;return r}function Pc(){var r;return i.charCodeAt(c)===91?(r=es,c++):(r=e,f===0&&m(ts)),r===e&&(i.charCodeAt(c)===123?(r=Te,c++):(r=e,f===0&&m(ir))),r}function Tc(){var r;return i.charCodeAt(c)===93?(r=rs,c++):(r=e,f===0&&m(is)),r===e&&(i.charCodeAt(c)===125?(r=sr,c++):(r=e,f===0&&m(or))),r}const{errorOnLuceneSyntax:Oc,parseCursor:Dc,cursorSymbol:Lc,allowLeadingWildcards:Nc=!0,helpers:{nodeTypes:me}}=n,Z=me.function.buildNodeWithArgumentNodes,ce=me.literal.buildNode,Bc=me.wildcard.buildNode,jc=me.namedArg.buildNode,{wildcardSymbol:Ss}=me.wildcard;if(_t=h(),_t!==e&&c===i.length)return _t;throw _t!==e&&c<i.length&&m({type:"end",description:"end of input"}),ns(null,ur,K<i.length?i.charAt(K):null,K<i.length?St(K,K+1):St(K,K))}return{SyntaxError:t,parse:s}}(),Yt=(o,t={},s=ft)=>{if(typeof o>"u")throw new Error("expression must be a string, got undefined instead");return s(o,{...t,helpers:{nodeTypes:J}})},xe=(o,t={})=>Yt(o,{...t,startRule:"Literal"},ft),gt=(o,t={})=>{try{return Yt(o,t,ft)}catch(s){throw s.name==="SyntaxError"?new Xr(s,o):s}},$o=o=>{try{return Yt(o,{errorOnLuceneSyntax:!0},ft),!1}catch(t){return t.message.startsWith("Lucene")}},j=(o,t,s,i)=>(t=void 0,!o||!o.type||!J[o.type]?j(J.function.buildNode("and",[]),t):J[o.type].toOpenSearchQuery(o,t,s,i)),G="@kuery-wildcard@";function wo(o){return o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _o(o){return o.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function So(o){return o.includes(G)?{type:"wildcard",value:o}:xe(o)}function Gr(o,t){const{value:s}=o,i=s.split(G).map(wo).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(t)}function Ao(o){const{value:t}=o;return t.split(G).join("*")}function Kt(o){const{value:t}=o;return t.split(G).map(_o).join("*")}function xo(o){const{value:t}=o;return t.startsWith(G)&&t.replace(G,"").length>0}const Eo=Object.freeze(Object.defineProperty({__proto__:null,buildNode:So,hasLeadingWildcard:xo,test:Gr,toOpenSearchQuery:Ao,toQueryStringQuery:Kt,wildcardSymbol:G},Symbol.toStringTag,{value:"Module"}));function Zt(o,t){if(!t)return[];if(o.type==="literal"){const s=Vt(o),i=t.fields.find(n=>n.name===s);return i?[i]:[]}else if(o.type==="wildcard")return t.fields.filter(i=>Gr(o,i.name))}function Mc(o){return o}function Jr(o,t,s){const i={...o,value:s?`${s}.${o.value}`:o.value};if(!t||i.type==="wildcard"&&!s)return i;const e=Zt(i,t).reduce((p,h)=>{const g=h.subType&&h.subType.nested?h.subType.nested.path:void 0;return s&&!g?[...p,`${h.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:g&&!s?[...p,`${h.name} is a nested field, but is not in a nested group in the DQL expression.`]:g!==s?[...p,`Nested field ${h.name} is being queried with the incorrect nested path. The correct path is ${h.subType.nested.path}.`]:p},[]);if(e.length>0)throw new Error(e.join(`
727
+ `));return i}function ko(o,t,s=!1){if(o===void 0)throw new Error("fieldName is a required argument");if(t===void 0)throw new Error("value is a required argument");const i=typeof o=="string"?xe(o):Ae(o),n=typeof t=="string"?xe(t):Ae(t),e=Ae(s);return{arguments:[i,n,e]}}function Co(o,t,s={},i={}){const{arguments:[n,e,p]}=o,h=Jr(n,t,i!=null&&i.nested?i.nested.path:void 0),g=j(h),$=e!==void 0?j(e):e,k=p.value?"phrase":"best_fields";if(h.value===null)return e.type==="wildcard"?{query_string:{query:Kt(e)}}:{multi_match:{type:k,query:$,lenient:!0}};const y=t?Zt(h,t):[];y&&y.length===0&&y.push({name:j(h),scripted:!1,type:""});const E=e.type==="wildcard"&&$==="*",x=h.type==="wildcard"&&g==="*"||y&&t&&y.length===t.fields.length;return E&&x?{match_all:{}}:{bool:{should:y.reduce((z,M)=>{const Y=U=>{var Te;return h.type!=="wildcard"||!((Te=M.subType)!=null&&Te.nested)||i!=null&&i.nested?U:{nested:{path:M.subType.nested.path,query:U,score_mode:"none"}}};if(M.scripted)return[];if(E)return[...z,Y({exists:{field:M.name}})];if(e.type==="wildcard")return[...z,Y({query_string:{fields:[M.name],query:Kt(e)}})];if(M.type==="date"){const U=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return[...z,Y({range:{[M.name]:{gte:$,lte:$,...U}}})]}else{const U=k==="phrase"?"match_phrase":"match";return[...z,Y({[U]:{[M.name]:$}})]}},[])||[],minimum_should_match:1}}}const Po=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ko,toOpenSearchQuery:Co},Symbol.toStringTag,{value:"Module"}));function To(o){return{arguments:o}}function Oo(o,t,s={},i={}){return{bool:{filter:(o.arguments||[]).map(e=>j(e,t,s,i))}}}const Do=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:To,toOpenSearchQuery:Oo},Symbol.toStringTag,{value:"Module"}));function Lo(o){return{arguments:o}}function No(o,t,s={},i={}){return{bool:{should:(o.arguments||[]).map(e=>j(e,t,s,i)),minimum_should_match:1}}}const Bo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Lo,toOpenSearchQuery:No},Symbol.toStringTag,{value:"Module"}));function jo(o){return{arguments:[o]}}function zo(o,t,s={},i={}){const[n]=o.arguments;return{bool:{must_not:j(n,t,s,i)}}}const Ro=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:jo,toOpenSearchQuery:zo},Symbol.toStringTag,{value:"Module"}));function Mo(o,...t){let s={};for(let i of t)s[i]=o[i];return s}function Io(o,t){const s=Mo(t,"gt","lt","gte","lte","format"),i=typeof o=="string"?xe(o):J.literal.buildNode(o),n=Object.entries(s).map(e=>{let[p,h]=e;return J.namedArg.buildNode(p,h)});return{arguments:[i,...n]}}function Uo(o,t,s={},i={}){const[n,...e]=o.arguments,p=Jr(n,t,i!=null&&i.nested?i.nested.path:void 0),h=t?Zt(p,t):[],g=Ho(e),$=Object.fromEntries(Object.entries(g).map(([y,E])=>[y,j(E)]));return h&&h.length===0&&h.push({name:j(p),scripted:!1,type:""}),{bool:{should:h.map(y=>{const E=x=>{var C;return p.type!=="wildcard"||!((C=y.subType)!=null&&C.nested)||i.nested?x:{nested:{path:y.subType.nested.path,query:x,score_mode:"none"}}};if(y.scripted)return{};if(y.type==="date"){const x=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return E({range:{[y.name]:{...$,...x}}})}return E({range:{[y.name]:$}})}),minimum_should_match:1}}}function Ho(o){if(o.gt&&o.gte||o.lt&&o.lte)throw new Error("range ends cannot be both inclusive and exclusive");const t=["gte","lte","format"];return o.reduce((s,i,n)=>(i.type==="namedArg"?s[i.name]=i.value:s[t[n]]=i,s),{})}const Fo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Io,toOpenSearchQuery:Uo},Symbol.toStringTag,{value:"Module"}));function Qo(o){return{arguments:[Ae(o)]}}function qo(o,t,s={},i={}){const{arguments:[n]}=o,e={...n,value:i!=null&&i.nested?`${i.nested.path}.${n.value}`:n.value},p=Vt(e),h=((t==null?void 0:t.fields)||[]).find(g=>g.name===p);if(h&&h.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:p}}}const Wo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Qo,toOpenSearchQuery:qo},Symbol.toStringTag,{value:"Module"}));function Vo(o,t){return{arguments:[typeof o=="string"?xe(o):Ae(o),t]}}function Yo(o,t,s={},i={}){var g;const[n,e]=o.arguments,p=j(n),h=(g=i==null?void 0:i.nested)!=null&&g.path?`${i.nested.path}.${p}`:p;return{nested:{path:h,query:j(e,t,s,{...i,nested:{path:h}}),score_mode:"none"}}}const Xt={is:Po,and:Do,or:Bo,not:Ro,range:Fo,exists:Wo,nested:Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Vo,toOpenSearchQuery:Yo},Symbol.toStringTag,{value:"Module"}))};function Ko(o,...t){const s=Xt[o];if(s===void 0)throw new Error(`Unknown function "${o}"`);return{type:"function",function:o,...s.buildNodeParams(...t)}}function Zo(o,t){if(Xt[o]===void 0)throw new Error(`Unknown function "${o}"`);return{type:"function",function:o,arguments:t}}function Xo(o,t,s,i){return Xt[o.function].toOpenSearchQuery(o,t,s,i)}const Go=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Ko,buildNodeWithArgumentNodes:Zo,toOpenSearchQuery:Xo},Symbol.toStringTag,{value:"Module"}));function Jo(o,t){const s=t.type==="literal"?t:J.literal.buildNode(t);return{type:"namedArg",name:o,value:s}}function en(o){return j(o.value)}const J={function:Go,literal:yo,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:Jo,toOpenSearchQuery:en},Symbol.toStringTag,{value:"Module"})),wildcard:Eo},tn=G,rn=(o,t)=>"("+(o.arguments||[]).map(i=>ve(i,t)).join(" AND ")+")",sn=(o,t)=>{var{arguments:[s,i,n]}=o;let e="=";i.type==="wildcard"&&(e="");let p=ve(i);n=n.value||typeof p=="string",i.type==="literal"&&n&&(p=`'${p}'`),i.type==="literal"&&!n&&(p=`${p}`);let h=ve(s);return h==null?t&&n?`(${t.filter(g=>g.type==="string").map(g=>`${g.name} ILIKE '%${i.value}%'`).join(" OR ")})`:t&&!n&&(i.value===!0||i.value===!1)?`(${t.filter(g=>g.type==="boolean").map(g=>`${g.name}=${i.value}`).join(" OR ")})`:"":h+e+p},on=(o,t)=>"("+(o.arguments||[]).map(i=>ve(i,t)).join(" OR ")+")",nn=(o,t)=>{const[s]=o.arguments;return"NOT ("+ve(s,t)+")"},an={gt:">",lt:"<",gte:">=",lte:"<="},cn={is:sn,and:rn,or:on,not:nn,range:o=>{const[t,s]=o.arguments;let i=s.value;const n=an[s.name];let e=ve(i);return i.type==="literal"&&(e=`${e}`),`${t.value} ${n} ${e}`},exists:o=>{const[t]=o.arguments;return`${t.value} IS NOT NULL`},nested:o=>(console.warn("Nested types dont exist in CQL",o),"")},ln={function:(o,t)=>cn[o.function](o,t),literal:o=>o.value,wildcard:o=>{const{value:t}=o;return` LIKE '${t.split(tn).join("%")}'`}},ve=(o,t)=>{const s=ln[o.type];return s(o,t)},pn=G,un=o=>({$and:(o.arguments||[]).map(i=>se(i))}),dn=o=>{const{arguments:[t,s]}=o;let i=se(s);if(s.type==="wildcard"&&s.value==="@kuery-wildcard@")return ei(o);let e={};return e[se(t)]={$eq:i},e},hn=o=>({$or:(o.arguments||[]).map(s=>se(s))}),fn=o=>{const[t]=o.arguments;let s={};return s={$ne:se(t)},s},gn={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},bn=o=>{const[t,s]=o.arguments;let i=s.value;const n=gn[s.name];let e=se(i),p={};return p[t.value]={},p[t.value][n]=e,p},ei=o=>{const[t]=o.arguments;return{[se(t)]:{$ne:null}}},vn={is:dn,and:un,or:hn,not:fn,range:bn,exists:ei,nested:o=>(console.warn("TODO Implement nested search",o),"")},mn={function:o=>vn[o.function](o),literal:o=>o.value,wildcard:o=>{const{value:t}=o;return`/${t.split(pn).join(".*")}/`}},se=(o,t)=>{const s=mn[o.type];return s(o,t)},yn=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:Xr,doesKueryExpressionHaveLuceneSyntaxError:$o,fromKueryExpression:gt,fromLiteralExpression:xe,nodeTypes:J,parse:gt,toCql:ve,toDSL:j,toMongo:se,toOpenSearchQuery:j},Symbol.toStringTag,{value:"Module"})),$n=H`
728
728
  :host {
729
729
  --dialog-padding: var(--spectric-dialog-padding, 5px);
730
730
  --dialog-background:var(--spectric-background,rgb(246, 249, 252));
@@ -771,7 +771,7 @@ spectric-button{
771
771
  right: 0;
772
772
  top: 0;
773
773
  }
774
- `;var cn=Object.defineProperty,ln=Object.getOwnPropertyDescriptor,re=(o,r,s,i)=>{for(var a=i>1?void 0:i?ln(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&cn(r,s,a),a};const It="spectric-dialog";d.DialogElement=class extends P{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async r=>{const s=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||s===r.target&&(this.open=!1)},this._handleKeyDown=r=>{this.closeOnEscape||r.preventDefault(),this.open&&this.closeOnEscape&&r.key==="Escape"&&(this.open=!1)},this._onClose=r=>{r.preventDefault(),r.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(r,s){let i=document.createElement(It);i.addEventListener("close",()=>{i.remove()});for(let e in r)i[e]=r[e];let a=document.createDocumentFragment();return Ot(s,a),i.appendChild(a),i.open=!0,document.body.appendChild(i),i}connectedCallback(){super.connectedCallback(),this.dialogElement.then(r=>r.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(r=>r.removeEventListener("keydown",this._handleKeyDown))}updated(r){r.has("open")&&this.dialogElement.then(s=>{this.open?s.showModal():s.close()})}render(){return A`
774
+ `;var wn=Object.defineProperty,_n=Object.getOwnPropertyDescriptor,oe=(o,t,s,i)=>{for(var n=i>1?void 0:i?_n(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&wn(t,s,n),n};const Gt="spectric-dialog";d.DialogElement=class extends O{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async t=>{const s=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||s===t.target&&(this.open=!1)},this._handleKeyDown=t=>{this.closeOnEscape||t.preventDefault(),this.open&&this.closeOnEscape&&t.key==="Escape"&&(this.open=!1)},this._onClose=t=>{t.preventDefault(),t.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(t,s){let i=document.createElement(Gt);i.addEventListener("close",()=>{i.remove()});for(let e in t)i[e]=t[e];let n=document.createDocumentFragment();return it(s,n),i.appendChild(n),i.open=!0,document.body.appendChild(i),i}connectedCallback(){super.connectedCallback(),this.dialogElement.then(t=>t.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(t=>t.removeEventListener("keydown",this._handleKeyDown))}updated(t){t.has("open")&&this.dialogElement.then(s=>{this.open?s.showModal():s.close()})}render(){return A`
775
775
  <dialog class=${this.hideBackdrop?"":"backdrop"} @close=${this._onClose} @click=${this.clickHandler}>
776
776
  <spectric-panel>
777
777
  <div class="modal">
@@ -787,17 +787,17 @@ spectric-button{
787
787
  </div>
788
788
  </spectric-panel>
789
789
  </dialog>
790
- `}},d.DialogElement.styles=an,re([m({type:Boolean,reflect:!0})],d.DialogElement.prototype,"open",2),re([m({type:Boolean,reflect:!0})],d.DialogElement.prototype,"dismissable",2),re([m({type:Boolean,reflect:!0})],d.DialogElement.prototype,"hideBackdrop",2),re([m({type:String,reflect:!0})],d.DialogElement.prototype,"title",2),re([m({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnEscape",2),re([m({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnOutsideClick",2),re([Ze("dialog")],d.DialogElement.prototype,"dialogElement",2),d.DialogElement=re([D(It)],d.DialogElement);var pn=Object.defineProperty,un=Object.getOwnPropertyDescriptor,H=(o,r,s,i)=>{for(var a=i>1?void 0:i?un(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&pn(r,s,a),a},Ir=(o=>(o.MONGO="toMongo",o.CQL="toCql",o.DSL="toDSL",o.AST="AST",o))(Ir||{});const Fr={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"}},dn={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},hn=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],fn=Object.fromEntries(Object.entries(Fr).map(([o,r])=>[o,{value:r.value,label:(r.label||"").replace("value","date-time")}]));d.SpectricQuery=class extends P{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._parseQuery=(r=void 0)=>{let s;if(r&&(r!=null&&r.currentTarget)&&(this.value=r.currentTarget.value),this.value)try{r&&r.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let e=this.value;this._input.selectionStart!==null&&(e=e.substring(0,this._input.selectionStart)+"@kuery-cursor@"+e.substring(this._input.selectionStart));let p=nt(e,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(p)}catch{return}try{s=nt(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=s:i=nn[this.outputLanguage](s,this.fields);let a=new CustomEvent("change",{detail:i});this.dispatchEvent(a)},this.getValuesForField=async(r,s)=>(console.log("getValuesForField isn't set no values returned",r,s),[]),this._selectCompletion=async()=>{if(!this.suggestion)return;let r=this.completions[this.completionIndex],s=this.value.substring(0,r.start)+r.value,i=s.length,a=this.value.substring(r.end);if(r.value.includes(a)?this.value=s:this.value=s+this.value.substring(r.end),this._input.value=this.value,this._input.setSelectionRange(i,i),r.onSelect){let e=await r.onSelect();e!==void 0&&(this.value+=e,setTimeout(()=>{this._input.focus()}))}this.completionIndex=0,this.completions=[],this._parseQuery(),this._input.focus()},this._handleArrows=r=>{var s;r.key==="Escape"&&(this.completions=[]),(r.key=="ArrowLeft"||r.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(r.key)&&this.suggestion&&(r.preventDefault(),(r.key==="ArrowDown"||r.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),r.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(s=this._asyncAutocomplete)==null||s.then(i=>{let a=i.querySelector(".option.active");a&&a.scrollIntoView({block:"nearest"})}),r.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(r){if(this.completions=[],r.type!=="cursor")return;let s=[];this.suggestion=r;let{start:i,end:a}=r;for(let e of r.suggestionTypes){if(e=="conjunction"&&r.text.endsWith(" ")&&s.push(...["and ","or "].map(p=>({type:e,value:p,start:a,end:a}))),e==="field"){let p=this.fields.filter(g=>g.name.includes(r.fieldName)||g.name.includes(r.prefix)).map(g=>[{type:e,value:g.name,start:i,end:a}]).flat();s.push(...p)}if(e==="operator"){let p=this.fields.find(g=>g.name===r.fieldName);p&&(p.type==="number"?s.push(...Object.values(Fr).map(g=>({type:e,...g,start:a,end:a}))):p.type==="string"?p.format==="date-time"?s.push(...Object.values(fn).map(g=>({type:e,...g,start:a,end:a,onSelect:async()=>{let b=await this.getValuesForField(r.fieldName,r.prefix);b.length===0&&(b=["now-1m","now-1d","now-1M"]);let S,x=Ge();return await new Promise(w=>{let C=d.DialogElement.display({},A`
790
+ `}},d.DialogElement.styles=$n,oe([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"open",2),oe([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"dismissable",2),oe([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"hideBackdrop",2),oe([v({type:String,reflect:!0})],d.DialogElement.prototype,"title",2),oe([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnEscape",2),oe([v({type:Boolean,reflect:!0})],d.DialogElement.prototype,"closeOnOutsideClick",2),oe([ot("dialog")],d.DialogElement.prototype,"dialogElement",2),d.DialogElement=oe([D(Gt)],d.DialogElement);var Sn=Object.defineProperty,An=Object.getOwnPropertyDescriptor,V=(o,t,s,i)=>{for(var n=i>1?void 0:i?An(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&Sn(t,s,n),n},ti=(o=>(o.MONGO="toMongo",o.CQL="toCql",o.DSL="toDSL",o.AST="AST",o))(ti||{});const ri={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"}},xn={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},En=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],kn=Object.fromEntries(Object.entries(ri).map(([o,t])=>[o,{value:t.value,label:(t.label||"").replace("value","date-time")}]));d.SpectricQuery=class extends O{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._parseQuery=(t=void 0)=>{let s;if(t&&(t!=null&&t.currentTarget)&&(this.value=t.currentTarget.value),this.value)try{t&&t.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let e=this.value;this._input.selectionStart!==null&&(e=e.substring(0,this._input.selectionStart)+"@kuery-cursor@"+e.substring(this._input.selectionStart));let p=gt(e,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(p)}catch{return}try{s=gt(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=s:i=yn[this.outputLanguage](s,this.fields);let n=new CustomEvent("change",{detail:i});this.dispatchEvent(n)},this.getValuesForField=async(t,s)=>(console.log("getValuesForField isn't set no values returned",t,s),[]),this._selectCompletion=async()=>{if(!this.suggestion)return;let t=this.completions[this.completionIndex],s=this.value.substring(0,t.start)+t.value,i=s.length,n=this.value.substring(t.end);if(t.value.includes(n)?this.value=s:this.value=s+this.value.substring(t.end),this._input.value=this.value,this._input.setSelectionRange(i,i),t.onSelect){let e=await t.onSelect();e!==void 0&&(this.value+=e,setTimeout(()=>{this._input.focus()}))}this.completionIndex=0,this.completions=[],this._parseQuery(),this._input.focus()},this._handleArrows=t=>{var s;t.key==="Escape"&&(this.completions=[]),(t.key=="ArrowLeft"||t.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(t.key)&&this.suggestion&&(t.preventDefault(),(t.key==="ArrowDown"||t.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),t.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(s=this._asyncAutocomplete)==null||s.then(i=>{let n=i.querySelector(".option.active");n&&n.scrollIntoView({block:"nearest"})}),t.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(t){if(this.completions=[],t.type!=="cursor")return;let s=[];this.suggestion=t;let{start:i,end:n}=t;for(let e of t.suggestionTypes){if(e=="conjunction"&&t.text.endsWith(" ")&&s.push(...["and ","or "].map(p=>({type:e,value:p,start:n,end:n}))),e==="field"){let p=this.fields.filter(h=>h.name.includes(t.fieldName)||h.name.includes(t.prefix)).map(h=>[{type:e,value:h.name,start:i,end:n}]).flat();s.push(...p)}if(e==="operator"){let p=this.fields.find(h=>h.name===t.fieldName);p&&(p.type==="number"?s.push(...Object.values(ri).map(h=>({type:e,...h,start:n,end:n}))):p.type==="string"?p.format==="date-time"?s.push(...Object.values(kn).map(h=>({type:e,...h,start:n,end:n,onSelect:async()=>{let g=await this.getValuesForField(t.fieldName,t.prefix);g.length===0&&(g=["now-1m","now-1d","now-1M"]);let $,k=at();return await new Promise(y=>{let E=d.DialogElement.display({},A`
791
791
  <div class="query-bar-date-quick-select">
792
- ${b.map(E=>A`<a href="#" @click=${N=>{N.preventDefault(),S=`"${E}"`,w(S),C.open=!1}}>${E}</a>`)}
792
+ ${g.map(x=>A`<a href="#" @click=${C=>{C.preventDefault(),$=`"${x}"`,y($),E.open=!1}}>${x}</a>`)}
793
793
  </div>
794
- <spectric-input variant="datetime-local" @change=${E=>{if(!E.target)return;S=`"${new Date(E.target.value+":00.000Z").toISOString()}"`,x.value.disabled=S===void 0}}></spectric-input>
795
- <spectric-button ${Je(x)} .disabled=${!0} @click=${()=>{w(S),C.open=!1}}>Submit</spectric-button>
796
- `)}),S}}))):s.push(...Object.values(dn).map(g=>({type:e,...g,start:a,end:a}))):p.type==="boolean"&&s.push(...hn.map(g=>({type:e,...g,start:a,end:a}))))}if(e==="value"){let p=this.fields.find(g=>g.name===r.fieldName);if(p&&p.type=="boolean")s.push({type:e,value:"true",start:i,end:a},{type:e,value:"false",start:i,end:a});else{console.log(`invoke callback to get values for ${r.fieldName}`);let g=await this.getValuesForField(r.fieldName,r.prefix);(p==null?void 0:p.type)==="string"&&(g=g.map(b=>`"${b}"`)),s.push(...g.map(b=>({type:e,value:b,start:i,end:a})))}}}if(this.completions=s,this.completions.length&&this._autocomplete){let{width:e,left:p,bottom:g}=this._input.getBoundingClientRect();this._autocomplete.showPopover(),"anchorName"in document.documentElement.style||(this._autocomplete.style.left=`${p+3.75}px`,this._autocomplete.style.top=`${g}px`),this._autocomplete.style.width=`${e-15}px`}}updated(r){r.has("outputLanguage")&&this._parseQuery()}render(){return A`
797
- <spectric-input .value=${this.value} .placeholder=${this.placeholder} style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows} @change=${r=>r.stopPropagation()}></spectric-input>
794
+ <spectric-input variant="datetime-local" @change=${x=>{if(!x.target)return;$=`"${new Date(x.target.value+":00.000Z").toISOString()}"`,k.value.disabled=$===void 0}}></spectric-input>
795
+ <spectric-button ${ct(k)} .disabled=${!0} @click=${()=>{y($),E.open=!1}}>Submit</spectric-button>
796
+ `)}),$}}))):s.push(...Object.values(xn).map(h=>({type:e,...h,start:n,end:n}))):p.type==="boolean"&&s.push(...En.map(h=>({type:e,...h,start:n,end:n}))))}if(e==="value"){let p=this.fields.find(h=>h.name===t.fieldName);if(p&&p.type=="boolean")s.push({type:e,value:"true",start:i,end:n},{type:e,value:"false",start:i,end:n});else{console.log(`invoke callback to get values for ${t.fieldName}`);let h=await this.getValuesForField(t.fieldName,t.prefix);(p==null?void 0:p.type)==="string"&&(h=h.map(g=>`"${g}"`)),s.push(...h.map(g=>({type:e,value:g,start:i,end:n})))}}}if(this.completions=s,this.completions.length&&this._autocomplete){let{width:e,left:p,bottom:h}=this._input.getBoundingClientRect();this._autocomplete.showPopover(),"anchorName"in document.documentElement.style||(this._autocomplete.style.left=`${p+3.75}px`,this._autocomplete.style.top=`${h}px`),this._autocomplete.style.width=`${e-15}px`}}updated(t){t.has("outputLanguage")&&this._parseQuery()}render(){return A`
797
+ <spectric-input .value=${this.value} .placeholder=${this.placeholder} style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows} @change=${t=>t.stopPropagation()}></spectric-input>
798
798
  <div class="autocomplete" popover style=${`position-anchor: --${this.uuid};`}>
799
- ${this.completions.map((r,s)=>A`<div @click=${()=>{this.completionIndex=s,this._selectCompletion()}} class=${this.completionIndex==s?"option active":"option"}><span class="optiontype ${r.type}">${r.type}</span> <span class="value">${r.value}</span> <span class="label">${r.label}</span></span> </div></div>`)}
800
- </div>`}},H([m({type:String,reflect:!0})],d.SpectricQuery.prototype,"placeholder",2),H([m({type:String,reflect:!0})],d.SpectricQuery.prototype,"value",2),H([m({type:String,reflect:!0})],d.SpectricQuery.prototype,"outputLanguage",2),H([Re()],d.SpectricQuery.prototype,"completions",2),H([Re()],d.SpectricQuery.prototype,"completionIndex",2),H([m({type:Array,reflect:!0})],d.SpectricQuery.prototype,"fields",2),H([me(".autocomplete")],d.SpectricQuery.prototype,"_autocomplete",2),H([Ze(".autocomplete")],d.SpectricQuery.prototype,"_asyncAutocomplete",2),H([me("spectric-input")],d.SpectricQuery.prototype,"_input",2),d.SpectricQuery=H([D("spectric-query")],d.SpectricQuery);const Qr=M`
799
+ ${this.completions.map((t,s)=>A`<div @click=${()=>{this.completionIndex=s,this._selectCompletion()}} class=${this.completionIndex==s?"option active":"option"}><span class="optiontype ${t.type}">${t.type}</span> <span class="value">${t.value}</span> <span class="label">${t.label}</span></span> </div></div>`)}
800
+ </div>`}},V([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"placeholder",2),V([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"value",2),V([v({type:String,reflect:!0})],d.SpectricQuery.prototype,"outputLanguage",2),V([Fe()],d.SpectricQuery.prototype,"completions",2),V([Fe()],d.SpectricQuery.prototype,"completionIndex",2),V([v({type:Array,reflect:!0})],d.SpectricQuery.prototype,"fields",2),V([we(".autocomplete")],d.SpectricQuery.prototype,"_autocomplete",2),V([ot(".autocomplete")],d.SpectricQuery.prototype,"_asyncAutocomplete",2),V([we("spectric-input")],d.SpectricQuery.prototype,"_input",2),d.SpectricQuery=V([D("spectric-query")],d.SpectricQuery);const ii=H`
801
801
  border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
802
802
  background-color: var(--panel-color,#0b0b0b);
803
803
  --spectric-input-color: var(--spectric-background);
@@ -805,7 +805,7 @@ spectric-button{
805
805
  --spectric-text-primary:var(--text-primary);
806
806
  --spectric-text-secondary:var(--text-secondary);
807
807
  filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-secondary, #3c4c5b), transparent 50%));
808
- `,Hr=M`
808
+ `,si=H`
809
809
  border-color: color-mix(in hsl, var(--panel-color-inverse,#f4f4f4), var(--spectric-input-color, #000000) 3%);
810
810
  background-color: var(--panel-color-inverse,#0b0b0b);
811
811
  color:var(--text-primary,#3c4c5b);
@@ -813,7 +813,7 @@ spectric-button{
813
813
  --spectric-text-primary:var(--text-secondary);
814
814
  --spectric-text-secondary:var(--text-primary);
815
815
  filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-primary, #3c4c5b), transparent 70%));
816
- `,gn=M`
816
+ `,Cn=H`
817
817
  :host{
818
818
  display:block;
819
819
  border:2px solid black;
@@ -823,20 +823,20 @@ spectric-button{
823
823
 
824
824
  }
825
825
  :host(spectric-panel[level='0']) {
826
- ${Qr};
826
+ ${ii};
827
827
  }
828
828
 
829
829
  :host(spectric-panel[level='1']) {
830
- ${Hr};
830
+ ${si};
831
831
  }
832
832
 
833
833
  :host(spectric-panel[level='2']) {
834
- ${Qr};
834
+ ${ii};
835
835
  }
836
836
  :host(spectric-panel[level='3']) {
837
- ${Hr};
837
+ ${si};
838
838
  }
839
- `;var bn=Object.defineProperty,vn=Object.getOwnPropertyDescriptor,Ft=(o,r,s,i)=>{for(var a=i>1?void 0:i?vn(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&bn(r,s,a),a};d.SpectricPanel=class extends P{constructor(){super(...arguments),this.level=0}updated(){this.layers||(this.layers=this.querySelectorAll("spectric-panel")),this.layers.forEach(r=>{r.setAttribute("level",((this.level+1)%4).toString())}),this.dispatchEvent(new CustomEvent("use-layer",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}render(){return A` <slot></slot> `}},d.SpectricPanel.styles=gn,Ft([m({type:Number,reflect:!0})],d.SpectricPanel.prototype,"level",2),Ft([m({attribute:!1})],d.SpectricPanel.prototype,"layers",2),d.SpectricPanel=Ft([D("spectric-panel")],d.SpectricPanel);var mn=Object.defineProperty,yn=Object.getOwnPropertyDescriptor,qr=(o,r,s,i)=>{for(var a=i>1?void 0:i?yn(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&mn(r,s,a),a};const $n={"--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"}},Wr={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},Vr={...Wr,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},Qt={undefined:{},light:{},dark:Wr,spectric:Vr,spectricFlat:{...Vr,"--border-radius":"1px"}},_n=Object.fromEntries(Object.keys(Qt).map(o=>[o,o])),wn=`
839
+ `;var Pn=Object.defineProperty,Tn=Object.getOwnPropertyDescriptor,Jt=(o,t,s,i)=>{for(var n=i>1?void 0:i?Tn(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&Pn(t,s,n),n};d.SpectricPanel=class extends O{constructor(){super(...arguments),this.level=0}updated(){this.layers||(this.layers=this.querySelectorAll("spectric-panel")),this.layers.forEach(t=>{t.setAttribute("level",((this.level+1)%4).toString())}),this.dispatchEvent(new CustomEvent("use-layer",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}render(){return A` <slot></slot> `}},d.SpectricPanel.styles=Cn,Jt([v({type:Number,reflect:!0})],d.SpectricPanel.prototype,"level",2),Jt([v({attribute:!1})],d.SpectricPanel.prototype,"layers",2),d.SpectricPanel=Jt([D("spectric-panel")],d.SpectricPanel);var On=Object.defineProperty,Dn=Object.getOwnPropertyDescriptor,oi=(o,t,s,i)=>{for(var n=i>1?void 0:i?Dn(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&On(t,s,n),n};const Ln={"--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"}},ni={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},ai={...ni,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},er={undefined:{},light:{},dark:ni,spectric:ai,spectricFlat:{...ai,"--border-radius":"1px"}},Nn=Object.fromEntries(Object.keys(er).map(o=>[o,o])),Bn=`
840
840
  --spectric-background: var(--background,#ffffff);
841
841
  --spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
842
842
  --spectric-background-inverse: var(--background-inverse,#f4f4f4);
@@ -879,12 +879,12 @@ spectric-button{
879
879
  --spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
880
880
  --spectric-button-disabled: #c6c6c6;
881
881
  color: var(--spectric-text-primary);
882
- `;d.SpectricThemeProvider=class extends P{constructor(){super(...arguments),this.theme="undefined"}updated(r){if(r.has("theme")&&this.theme!=r.get("theme")){const s={old:r.get("theme"),new:this.theme};this.dispatchEvent(new CustomEvent("theme-change",{detail:s,bubbles:!0,composed:!0}))}}render(){let r=Object.keys(Qt).includes(this.theme)?this.theme:"undefined",s=Object.entries(Qt[r]).map(i=>`${i[0]}:${i[1]};`).join(`
882
+ `;d.SpectricThemeProvider=class extends O{constructor(){super(...arguments),this.theme="undefined"}updated(t){if(t.has("theme")&&this.theme!=t.get("theme")){const s={old:t.get("theme"),new:this.theme};this.dispatchEvent(new CustomEvent("theme-change",{detail:s,bubbles:!0,composed:!0}))}}render(){let t=Object.keys(er).includes(this.theme)?this.theme:"undefined",s=Object.entries(er[t]).map(i=>`${i[0]}:${i[1]};`).join(`
883
883
  `);return A`
884
884
  ${this.theme&&this.theme!=="light"?A`
885
885
  <style>:host{
886
886
  ${s};
887
- ${wn}
887
+ ${Bn}
888
888
  }
889
889
  /* Webkit psudo elements don't pick up variables defined by the host */
890
890
  ::-webkit-scrollbar-thumb {
@@ -955,9 +955,9 @@ spectric-button{
955
955
  }
956
956
  </style>`:null}
957
957
  <slot></slot>
958
- `}},d.SpectricThemeProvider.styles=M`:host{
958
+ `}},d.SpectricThemeProvider.styles=H`:host{
959
959
  display:contents;
960
- }`,qr([m({reflect:!0})],d.SpectricThemeProvider.prototype,"theme",2),d.SpectricThemeProvider=qr([D("spectric-theme")],d.SpectricThemeProvider);const Sn=M`
960
+ }`,oi([v({reflect:!0})],d.SpectricThemeProvider.prototype,"theme",2),d.SpectricThemeProvider=oi([D("spectric-theme")],d.SpectricThemeProvider);const jn=H`
961
961
  :host {
962
962
  display: block;
963
963
  height: 100%;
@@ -1020,7 +1020,7 @@ spectric-button{
1020
1020
  width: 5px;
1021
1021
  cursor: ew-resize;
1022
1022
  }
1023
- `;var An=Object.defineProperty,xn=Object.getOwnPropertyDescriptor,B=(o,r,s,i)=>{for(var a=i>1?void 0:i?xn(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&An(r,s,a),a},Yr=(o=>(o.horizontal="horizontal",o.vertical="vertical",o))(Yr||{});const Kr="spectric-splitview";d.SplitView=class extends Nr{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:s,orientation:i,invisible:a,min:e,max:p,useSavedState:g}=this,b=this.getAttribute("id");b&&this.useSavedState&&localStorage.setItem(`splitview-${b}`,String(s)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:i,percentage:s,invisible:a,min:e,max:p,useSavedState:g}}))},this._onMouseMove=jr(s=>{if(this.isDragging){const i=this.getBoundingClientRect();let a,e;this.orientation==="horizontal"?(a=s.clientX-i.left,e=a/i.width*100):(a=s.clientY-i.top,e=a/i.height*100),e=Math.min(Math.max(e,this.min),this.max),this.percentage=e,this._emitChange()}}),this._assignSlot=s=>{if(!s.target)return;let a=s.target.assignedNodes().filter(e=>e instanceof HTMLElement);a.length>2&&console.log("cannot assign more than 2 elements to a split view"),a.forEach(e=>{if(this._panel1.assignedNodes().length===0){e.slot="panel1";return}if(this._panel2.assignedNodes().length===0){e.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 r=this.getAttribute("id");if(r&&this.useSavedState){let s=localStorage.getItem(`splitview-${r}`);s&&(this.percentage=parseFloat(s))}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(r){r.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return A`
1023
+ `;var zn=Object.defineProperty,Rn=Object.getOwnPropertyDescriptor,I=(o,t,s,i)=>{for(var n=i>1?void 0:i?Rn(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&zn(t,s,n),n},ci=(o=>(o.horizontal="horizontal",o.vertical="vertical",o))(ci||{});const li="spectric-splitview";d.SplitView=class extends lt{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:s,orientation:i,invisible:n,min:e,max:p,useSavedState:h}=this,g=this.getAttribute("id");g&&this.useSavedState&&localStorage.setItem(`splitview-${g}`,String(s)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:i,percentage:s,invisible:n,min:e,max:p,useSavedState:h}}))},this._onMouseMove=Kr(s=>{if(this.isDragging){const i=this.getBoundingClientRect();let n,e;this.orientation==="horizontal"?(n=s.clientX-i.left,e=n/i.width*100):(n=s.clientY-i.top,e=n/i.height*100),e=Math.min(Math.max(e,this.min),this.max),this.percentage=e,this._emitChange()}}),this._assignSlot=s=>{if(!s.target)return;let n=s.target.assignedNodes().filter(e=>e instanceof HTMLElement);n.length>2&&console.log("cannot assign more than 2 elements to a split view"),n.forEach(e=>{if(this._panel1.assignedNodes().length===0){e.slot="panel1";return}if(this._panel2.assignedNodes().length===0){e.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 t=this.getAttribute("id");if(t&&this.useSavedState){let s=localStorage.getItem(`splitview-${t}`);s&&(this.percentage=parseFloat(s))}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(t){t.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return A`
1024
1024
  <div class="split-view ${this.orientation} ${this._error?"error":""} ${this.isDragging?"active":""}" style="--split-percentage: ${this.percentage}%;">
1025
1025
  <span class="error-display">${this._error}</span>
1026
1026
  <div class="panel" style="${this.orientation==="horizontal"?"flex: var(--split-percentage, 50%)":"max-height: var(--split-percentage, 50%)"}">
@@ -1032,12 +1032,12 @@ spectric-button{
1032
1032
  </div>
1033
1033
  </div>
1034
1034
  <slot @slotchange=${this._assignSlot} style="display:none"></slot>
1035
- `}},d.SplitView.styles=Sn,B([m({type:String})],d.SplitView.prototype,"orientation",2),B([m({type:Number,reflect:!0})],d.SplitView.prototype,"percentage",2),B([m({type:Boolean})],d.SplitView.prototype,"invisible",2),B([m({type:Number,reflect:!0})],d.SplitView.prototype,"min",2),B([m({type:Number,reflect:!0})],d.SplitView.prototype,"max",2),B([m({type:Boolean,reflect:!0})],d.SplitView.prototype,"useSavedState",2),B([Re()],d.SplitView.prototype,"isDragging",2),B([Re()],d.SplitView.prototype,"_error",2),B([Ze(".splitter")],d.SplitView.prototype,"_splitter",2),B([me("slot[name='panel1']")],d.SplitView.prototype,"_panel1",2),B([me("slot[name='panel2']")],d.SplitView.prototype,"_panel2",2),d.SplitView=B([D(Kr)],d.SplitView);var En=Object.defineProperty,kn=Object.getOwnPropertyDescriptor,Se=(o,r,s,i)=>{for(var a=i>1?void 0:i?kn(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&En(r,s,a),a};const Zr="spectric-pagination";console.log("Pagination"),d.PaginationElement=class extends P{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=r=>{let s=parseInt(r.target.value);this.pageSize=s,this._emitChange()},this._emitChange=()=>{let{page:r,pageSize:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{page:r,pageSize:s}}))}}createRenderRoot(){return this}updated(r){r.has("pageSize")&&!this.pageSizeOptions.includes(this.pageSize)&&(this.pageSizeOptions=[...this.pageSizeOptions,this.pageSize].sort((s,i)=>s-i))}render(){let r=this.page*this.pageSize,s=!0;this.totalItems&&r<this.totalItems&&(s=!1);let i="";return this.totalItems&&(i=`${this.page} of ${Math.ceil(this.totalItems/this.pageSize)}`),A`
1035
+ `}},d.SplitView.styles=jn,I([v({type:String})],d.SplitView.prototype,"orientation",2),I([v({type:Number,reflect:!0})],d.SplitView.prototype,"percentage",2),I([v({type:Boolean})],d.SplitView.prototype,"invisible",2),I([v({type:Number,reflect:!0})],d.SplitView.prototype,"min",2),I([v({type:Number,reflect:!0})],d.SplitView.prototype,"max",2),I([v({type:Boolean,reflect:!0})],d.SplitView.prototype,"useSavedState",2),I([Fe()],d.SplitView.prototype,"isDragging",2),I([Fe()],d.SplitView.prototype,"_error",2),I([ot(".splitter")],d.SplitView.prototype,"_splitter",2),I([we("slot[name='panel1']")],d.SplitView.prototype,"_panel1",2),I([we("slot[name='panel2']")],d.SplitView.prototype,"_panel2",2),d.SplitView=I([D(li)],d.SplitView);var Mn=Object.defineProperty,In=Object.getOwnPropertyDescriptor,Ee=(o,t,s,i)=>{for(var n=i>1?void 0:i?In(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&Mn(t,s,n),n};const pi="spectric-pagination";console.log("Pagination"),d.PaginationElement=class extends O{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=t=>{let s=parseInt(t.target.value);this.pageSize=s,this._emitChange()},this._emitChange=()=>{let{page:t,pageSize:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{page:t,pageSize:s}}))}}createRenderRoot(){return this}updated(t){t.has("pageSize")&&!this.pageSizeOptions.includes(this.pageSize)&&(this.pageSizeOptions=[...this.pageSizeOptions,this.pageSize].sort((s,i)=>s-i))}render(){let t=this.page*this.pageSize,s=!0;this.totalItems&&t<this.totalItems&&(s=!1);let i="";return this.totalItems&&(i=`${this.page} of ${Math.ceil(this.totalItems/this.pageSize)}`),A`
1036
1036
  <div class="spectric-pagination-container">
1037
1037
  <div>
1038
1038
  <!-- TODO/FIXME Make a select component and use it for cross browser styling-->
1039
1039
  <select @change=${this._handleSizeChange} .value=${String(this.pageSize)}>
1040
- ${this.pageSizeOptions.map(a=>A`<option .value=${String(a)} class=${String(a)===String(this.pageSize)?"selected":""}>${a}</option>`)}
1040
+ ${this.pageSizeOptions.map(n=>A`<option .value=${String(n)} class=${String(n)===String(this.pageSize)?"selected":""}>${n}</option>`)}
1041
1041
  </select>
1042
1042
  </div>
1043
1043
  ${this.totalItems?A`
@@ -1053,34 +1053,67 @@ spectric-button{
1053
1053
  </div>
1054
1054
  `:null}
1055
1055
  </div>
1056
- `}},Se([m({type:Number,reflect:!0})],d.PaginationElement.prototype,"page",2),Se([m({type:Number,reflect:!0})],d.PaginationElement.prototype,"pageSize",2),Se([m({type:Number,reflect:!0})],d.PaginationElement.prototype,"totalItems",2),Se([m({type:Array})],d.PaginationElement.prototype,"pageSizeOptions",2),Se([m({type:String,reflect:!0})],d.PaginationElement.prototype,"size",2),d.PaginationElement=Se([D(Zr)],d.PaginationElement);var Cn=Object.defineProperty,Pn=Object.getOwnPropertyDescriptor,Xr=(o,r,s,i)=>{for(var a=i>1?void 0:i?Pn(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Cn(r,s,a),a};const On="spectric-table-header";let Ht=class extends P{constructor(){super(...arguments),this.columns=[],this._handleSortChange=o=>{o=JSON.parse(JSON.stringify(o)),o.sortable&&(o.sortDirection===z.none||o.sortDirection===void 0?o.sortDirection=z.ascending:o.sortDirection===z.ascending?o.sortDirection=z.decending:o.sortDirection===z.decending&&(o.sortDirection=z.none),this.dispatchEvent(new CustomEvent("sortChange",{detail:o})))}}createRenderRoot(){return this}render(){return A`
1056
+ `}},Ee([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"page",2),Ee([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"pageSize",2),Ee([v({type:Number,reflect:!0})],d.PaginationElement.prototype,"totalItems",2),Ee([v({type:Array})],d.PaginationElement.prototype,"pageSizeOptions",2),Ee([v({type:String,reflect:!0})],d.PaginationElement.prototype,"size",2),d.PaginationElement=Ee([D(pi)],d.PaginationElement);var Un=Object.defineProperty,Hn=Object.getOwnPropertyDescriptor,ui=(o,t,s,i)=>{for(var n=i>1?void 0:i?Hn(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&Un(t,s,n),n};const Fn="spectric-table-header";let tr=class extends O{constructor(){super(...arguments),this.columns=[],this._handleSortChange=o=>{o=JSON.parse(JSON.stringify(o)),o.sortable&&(o.sortDirection===R.none||o.sortDirection===void 0?o.sortDirection=R.ascending:o.sortDirection===R.ascending?o.sortDirection=R.decending:o.sortDirection===R.decending&&(o.sortDirection=R.none),this.dispatchEvent(new CustomEvent("sortChange",{detail:o})))}}createRenderRoot(){return this}render(){return A`
1057
1057
  <tr>
1058
- ${this.columns.map(o=>{let r=["header-contents"];o.filterable,o.sortable&&r.push("sortable");let s=o.sortDirection===z.ascending?"🠉":o.sortDirection==z.decending?"🠋":"",i=o.sortDirection||z.none;return A`<td @click=${()=>this._handleSortChange(o)}><div class=${r.join(" ")}>${o.title||o.key} <span class="sort-direction ${i}">${s}</span></div></td>`})}
1058
+ ${this.columns.map(o=>{let t=["header-contents"];o.filterable,o.sortable&&t.push("sortable");let s=o.width?`width:${o.width}px;`:"",i=o.sortDirection===R.ascending?"🠉":o.sortDirection==R.decending?"🠋":"",n=o.sortDirection||R.none;return A`
1059
+ <td @click=${()=>this._handleSortChange(o)} style="${s}">
1060
+ <div class=${t.join(" ")} >${o.title||o.key}
1061
+ <span class="sort-direction ${n}">${i}</span>
1062
+ </div>
1063
+ </td>`})}
1059
1064
  </tr>
1060
- `}};Xr([m({type:Array,attribute:!1})],Ht.prototype,"columns",2),Ht=Xr([D(On)],Ht);var Tn=Object.defineProperty,Dn=Object.getOwnPropertyDescriptor,at=(o,r,s,i)=>{for(var a=i>1?void 0:i?Dn(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Tn(r,s,a),a};const Ln="spectric-table-cell";let Ue=class extends P{constructor(){super(),this._handleFilterOut=()=>{let o;this.column.key&&typeof this.row=="object"&&(o=Ae(this.row,this.column.key)),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!1,row:this.row,value:o,column:this.column}}))},this._handleFilterFor=()=>{let o;this.column.key&&typeof this.row=="object"&&(o=Ae(this.row,this.column.key)),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!0,row:this.row,value:o,column:this.column}}))},this.styleRules=document.createElement("span").style}updated(o){Object.assign(this.td.style,this.styleRules)}createRenderRoot(){return this}render(){let o;this.column.render?o=this.column.render(this.row,this.table):this.column.key&&typeof this.row=="object"?o=Ae(this.row,this.column.key):o=A`error`;let r=["cell-contents"];this.column.filterable&&r.push("filterable");let s=A`<div class="table-cell-actions">
1065
+ `}};ui([v({type:Array,attribute:!1})],tr.prototype,"columns",2),tr=ui([D(Fn)],tr);var Qn=Object.defineProperty,qn=Object.getOwnPropertyDescriptor,Ve=(o,t,s,i)=>{for(var n=i>1?void 0:i?qn(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&Qn(t,s,n),n};const Wn="spectric-table-cell";let ke=class extends O{constructor(){super(),this._handleFilterOut=()=>{let o;this.column.key&&typeof this.row=="object"&&(o=Ce(this.row,this.column.key)),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!1,row:this.row,value:o,column:this.column}}))},this._handleFilterFor=()=>{let o;this.column.key&&typeof this.row=="object"&&(o=Ce(this.row,this.column.key)),this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:{include:!0,row:this.row,value:o,column:this.column}}))},this.styleRules=document.createElement("span").style}updated(o){Object.assign(this.td.style,this.styleRules)}createRenderRoot(){return this}render(){let o;this.column.render?o=this.column.render(this.row,this.index,this.table):this.column.key&&typeof this.row=="object"?o=Ce(this.row,this.column.key):o=A`error`;let t=["cell-contents"];this.column.filterable&&t.push("filterable");let s=A`<div class="table-cell-actions">
1061
1066
  <spectric-button @click=${this._handleFilterOut} size="tiny" variant="text" icon tooltip="Filter Out Value">-</spectric-button>
1062
1067
  <spectric-button @click=${this._handleFilterFor} size="tiny" variant="text" icon tooltip="Filter For Value">+</spectric-button></div>`;return this.styleRules={...this.styleRules,width:this.column.width?this.column.width+"px":"",whiteSpace:this.column.whiteSpace||""},A`
1063
1068
  <td>
1064
1069
  ${this.column.filterable?s:null}
1065
- <div class=${r.join(" ")}>${o}</div>
1070
+ <div class=${t.join(" ")}>${o}</div>
1066
1071
  </td>
1067
- `}};at([m({type:Object,attribute:!1})],Ue.prototype,"row",2),at([m({type:Object,attribute:!1})],Ue.prototype,"column",2),at([me("td")],Ue.prototype,"td",2),Ue=at([D(Ln)],Ue);const Ae=(o,r)=>{let s=r.split("."),i=o[s[0]];return s.length>1&&(i=Ae(i,s.slice(1).join("."))),i};var Nn=Object.defineProperty,jn=Object.getOwnPropertyDescriptor,qt=(o,r,s,i)=>{for(var a=i>1?void 0:i?jn(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Nn(r,s,a),a};const zn="spectric-table-body";let ct=class extends P{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}render(){return A`
1072
+ `}};Ve([v({type:Object,attribute:!1})],ke.prototype,"row",2),Ve([v({type:Number,attribute:!1})],ke.prototype,"index",2),Ve([v({type:Object,attribute:!1})],ke.prototype,"column",2),Ve([we("td")],ke.prototype,"td",2),ke=Ve([D(Wn)],ke);const Ce=(o,t)=>{let s=t.split("."),i=o[s[0]];return s.length>1&&(i=Ce(i,s.slice(1).join("."))),i};/**
1073
+ * @license
1074
+ * Copyright 2017 Google LLC
1075
+ * SPDX-License-Identifier: BSD-3-Clause
1076
+ */const di=(o,t,s)=>{const i=new Map;for(let n=t;n<=s;n++)i.set(o[n],n);return i},bt=st(class extends Ht{constructor(o){if(super(o),o.type!==Ut.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,t,s){let i;s===void 0?s=t:t!==void 0&&(i=t);const n=[],e=[];let p=0;for(const h of o)n[p]=i?i(h,p):p,e[p]=s(h,p),p++;return{values:e,keys:n}}render(o,t,s){return this.dt(o,t,s).values}update(o,[t,s,i]){const n=Ks(o),{values:e,keys:p}=this.dt(t,s,i);if(!Array.isArray(n))return this.ut=p,e;const h=this.ut??(this.ut=[]),g=[];let $,k,y=0,E=n.length-1,x=0,C=e.length-1;for(;y<=E&&x<=C;)if(n[y]===null)y++;else if(n[E]===null)E--;else if(h[y]===p[x])g[x]=fe(n[y],e[x]),y++,x++;else if(h[E]===p[C])g[C]=fe(n[E],e[C]),E--,C--;else if(h[y]===p[C])g[C]=fe(n[y],e[C]),Qe(o,g[C+1],n[y]),y++,C--;else if(h[E]===p[x])g[x]=fe(n[E],e[x]),Qe(o,n[y],n[E]),E--,x++;else if($===void 0&&($=di(p,x,C),k=di(h,y,E)),$.has(h[y]))if($.has(h[E])){const N=k.get(p[x]),z=N!==void 0?n[N]:null;if(z===null){const M=Qe(o,n[y]);fe(M,e[x]),g[x]=M}else g[x]=fe(z,e[x]),Qe(o,n[y],z),n[N]=null;x++}else Ft(n[E]),E--;else Ft(n[y]),y++;for(;x<=C;){const N=Qe(o,g[C+1]);fe(N,e[x]),g[x++]=N}for(;y<=E;){const N=n[y++];N!==null&&Ft(N)}return this.ut=p,Ys(o,g),ie}});var Vn=Object.defineProperty,Yn=Object.getOwnPropertyDescriptor,rr=(o,t,s,i)=>{for(var n=i>1?void 0:i?Yn(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&Vn(t,s,n),n};const Kn="spectric-table-body";let vt=class extends O{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}firstUpdated(o){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 A`
1068
1077
  <body>
1069
- ${this.data.map(o=>A`<tr>${this.columns.map(r=>A`<spectric-table-cell .column=${r} .row=${o} .columns=${this.columns}></spectric-table-cell>`)}</tr>`)}
1078
+ ${bt(this.data,(o,t)=>A`
1079
+ <tr class="${t%2===0?"odd":""}">
1080
+ ${bt(this.columns,s=>A`<spectric-table-cell .column=${s} .index=${t} .row=${o} .columns=${this.columns}></spectric-table-cell>`)}
1081
+ </tr>`)}
1082
+
1070
1083
  </body>
1071
- `}};qt([m({type:Array,attribute:!1})],ct.prototype,"data",2),qt([m({type:Array,attribute:!1})],ct.prototype,"columns",2),ct=qt([D(zn)],ct);const Bn=o=>o.map(({key:r,sortDirection:s,compareFn:i})=>(a,e)=>{if(!r)return;let p=Ae(a,r),g=Ae(e,r);if(i)return i(a,e);if(typeof p=="number"||typeof p=="bigint"||typeof p=="boolean"){let b=p-g;return s===z.decending&&(b=b*-1),b}else if(typeof p=="string")return p.localeCompare(g)*(s===z.decending?-1:1)});var Rn=Object.defineProperty,Mn=Object.getOwnPropertyDescriptor,fe=(o,r,s,i)=>{for(var a=i>1?void 0:i?Mn(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Rn(r,s,a),a};const Gr="spectric-table";var Jr=(o=>(o.multi="multi",o.single="single",o.none="none",o))(Jr||{}),ei=(o=>(o.multi="multi",o.single="single",o))(ei||{}),z=(o=>(o.ascending="ascending",o.decending="decending",o.none="none",o))(z||{});d.TableElement=class extends P{constructor(){super(...arguments),this.data=[],this.columns=[],this.select="none",this.sort="single",this._handlePaginationChange=r=>{if(r.preventDefault(),r.stopPropagation(),this.pagination){let s={...this.pagination,...r.detail},{totalItems:i,page:a,pageSize:e}=s;i&&a&&e&&(a-1)*e>i&&(s.page=1),this.pagination=s}this._emitChange()},this._handleSortChange=r=>{let s=r.detail,i=this.columns.find(a=>a.key==s.key);if(!i){console.warn("Unable to find sort column");return}this.sort=="single"&&this.columns.forEach(a=>{a.sortDirection="none"}),i.sortDirection=s.sortDirection,this.columns=[...this.columns],this._emitChange()},this._emitChange=()=>{let{pagination:r,columns:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{pagination:r,columns:s}}))},this.__DO_NOT_USE_filter=()=>{this.dispatchEvent(new CustomEvent("filter"))},this.selected=[],this._handleSelectAllChange=r=>{r.stopPropagation(),r.target.checked?this.selected=[...this.data]:this.selected=[],this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}}static getDefaultDataSorterAndPaginatior(r){return s=>{let i=s.columns.filter(g=>g.sortable&&g.sortDirection&&g.sortDirection!=="none"),a=[...r];if(i.length){let g=Bn(i);a.sort((b,S)=>{for(let x of g){let w=x(b,S);if(w)return w}return 0})}if(!s.pagination)return a;let{page:e,pageSize:p}=s.pagination;return!e||!p?a:s.pagination?a.slice((e-1)*p,e*p):a}}createRenderRoot(){return this}render(){let r=this.columns.filter(s=>!s.hidden);return this.select!=="none"&&r.unshift({title:this.select==="multi"?A`<spectric-input variant="checkbox" @change=${this._handleSelectAllChange} .helperText=${"Select All"}></spectric-input>`:null,render:s=>A`<spectric-input variant="checkbox" class="table-checkbox-${this.select}" .checked=${this.selected.includes(s)} @change=${i=>{if(i.stopPropagation(),this.select==="single"&&(this.selected=[]),i.target.checked)this.selected.push(s),this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}));else{let a=this.selected.findIndex(e=>e===s);a!==-1&&(this.selected.splice(a,1),this.dispatchEvent(new CustomEvent("selected",{detail:this.selected})))}}}></spectric-input>`}),A`
1072
- <div class="table-wrapper">
1084
+ `}};rr([v({type:Array,attribute:!1})],vt.prototype,"data",2),rr([v({type:Array,attribute:!1})],vt.prototype,"columns",2),vt=rr([D(Kn)],vt);var Zn=Object.defineProperty,Xn=Object.getOwnPropertyDescriptor,Ye=(o,t,s,i)=>{for(var n=i>1?void 0:i?Xn(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&Zn(t,s,n),n};const Gn="spectric-table-virtual-body";let Pe=class extends lt{constructor(){super(),this.data=[],this.columns=[],this.rowHeight=30,this.startIndex=0,this.addDisposableListener(()=>this.table.querySelector(".table-wrapper"),"scroll",()=>{const o=this.table.querySelector(".table-wrapper").scrollTop;requestAnimationFrame(()=>{this.startIndex=Math.floor(o/this.rowHeight)})})}firstUpdated(){this.columns.forEach(o=>{o.width||console.warn("When using virtual scrolling it is recomended to set the width of the columns to prevent columns widths from jittering during scroll")})}createRenderRoot(){return this}render(){let o=this.data.length,t=10,s=this.table.querySelector("spectric-table-header").clientHeight,i=this.table.querySelector(".table-wrapper"),n=Math.max(this.startIndex-t,0);const e=Math.ceil((i.clientHeight-s)/this.rowHeight),p=Math.min(n+e+t,o),h=p-n;let g=o*this.rowHeight,$=n*this.rowHeight+(i.scrollTop-n*this.rowHeight);p===o&&($=n*this.rowHeight);let k=h*this.rowHeight,y=g-$-k,E=this.startIndex!=0?A`
1085
+ <tr style="height:${$}px" class="virtual-scroll-spacer">
1086
+ <td colspan="${this.columns.length}"></td></tr>`:null,x=A`
1087
+ <tr style="height:${y}px" class="virtual-scroll-spacer">
1088
+ <td colspan="${this.columns.length}"></td></tr>`;return A`
1089
+ <div style="height:${g}px;position: absolute;overflow-x: hidden;overflow-y: hidden;z-index:-1;width:1px;"></div>
1090
+ <tbody>
1091
+ ${E}
1092
+ </tbody>
1093
+ <div style="display:table-row-group;max-height:${k}px; overflow:hidden;">
1094
+
1095
+ ${bt(this.data.slice(Math.max(n,0),p),(C,N)=>A`
1096
+ <tr class="${(N+n)%2===0?"odd":""}">
1097
+ ${bt(this.columns,z=>A`<spectric-table-cell .column=${z} .row=${C} .index=${N+n} .columns=${this.columns}></spectric-table-cell>`)}
1098
+ </tr>`)}
1099
+ </div>
1100
+ <tbody>
1101
+ ${y>0?x:null}
1102
+ </tbody>
1103
+
1104
+ `}};Ye([v({type:Array,attribute:!1})],Pe.prototype,"data",2),Ye([v({type:Array,attribute:!1})],Pe.prototype,"columns",2),Ye([v({type:Number,attribute:!1})],Pe.prototype,"rowHeight",2),Ye([v({type:Number,state:!0})],Pe.prototype,"startIndex",2),Pe=Ye([D(Gn)],Pe);const Jn=o=>o.map(({key:t,sortDirection:s,compareFn:i})=>(n,e)=>{if(!t)return;let p=Ce(n,t),h=Ce(e,t);if(i)return i(n,e);if(typeof p=="number"||typeof p=="bigint"||typeof p=="boolean"){let g=p-h;return s===R.decending&&(g=g*-1),g}else if(typeof p=="string")return p.localeCompare(h)*(s===R.decending?-1:1)});var ea=Object.defineProperty,ta=Object.getOwnPropertyDescriptor,ne=(o,t,s,i)=>{for(var n=i>1?void 0:i?ta(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&ea(t,s,n),n};const hi="spectric-table";var fi=(o=>(o.multi="multi",o.single="single",o.none="none",o))(fi||{}),gi=(o=>(o.multi="multi",o.single="single",o))(gi||{}),R=(o=>(o.ascending="ascending",o.decending="decending",o.none="none",o))(R||{});d.TableElement=class extends O{constructor(){super(...arguments),this.data=[],this.columns=[],this.select="none",this.sort="single",this.rowHeight=25,this._handlePaginationChange=t=>{if(t.preventDefault(),t.stopPropagation(),this.pagination){let s={...this.pagination,...t.detail},{totalItems:i,page:n,pageSize:e}=s;i&&n&&e&&(n-1)*e>i&&(s.page=1),this.pagination=s}this._emitChange()},this._handleSortChange=t=>{let s=t.detail,i=this.columns.find(n=>n.key==s.key);if(!i){console.warn("Unable to find sort column");return}this.sort=="single"&&this.columns.forEach(n=>{n.sortDirection="none"}),i.sortDirection=s.sortDirection,this.columns=[...this.columns],this._emitChange()},this._emitChange=()=>{let{pagination:t,columns:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{pagination:t,columns:s}}))},this.__DO_NOT_USE_filter=()=>{this.dispatchEvent(new CustomEvent("filter"))},this.selected=[],this._handleSelectAllChange=t=>{t.stopPropagation(),t.target.checked?this.selected=[...this.data]:this.selected=[],this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}}static getDefaultDataSorterAndPaginatior(t){return s=>{let i=s.columns.filter(h=>h.sortable&&h.sortDirection&&h.sortDirection!=="none"),n=[...t];if(i.length){let h=Jn(i);n.sort((g,$)=>{for(let k of h){let y=k(g,$);if(y)return y}return 0})}if(!s.pagination)return n;let{page:e,pageSize:p}=s.pagination;return!e||!p?n:s.pagination?n.slice((e-1)*p,e*p):n}}createRenderRoot(){return this}update(t){t.has("select")&&this.select==="single"&&this.selected.length>1&&(this.selected=[this.selected[0]],this.dispatchEvent(new CustomEvent("selected",{detail:[...this.selected]}))),super.update(t)}render(){let t=this.columns.filter(i=>!i.hidden);return this.select!=="none"&&t.unshift({title:this.select==="multi"?A`<spectric-input variant="checkbox" @change=${this._handleSelectAllChange} .helperText=${"Select All"}></spectric-input>`:null,render:i=>{let n=document.createElement("div"),e=this.selected.includes(i),p=A`<spectric-input variant="checkbox" class="table-checkbox-${this.select}" ${We({checked:e})} @change=${h=>{h.stopPropagation();let g=this.selected.findIndex($=>$===i);if(!(h.target.checked&&g!==-1)){{if(!h.target.checked&&g===-1)return;!h.target.checked&&g!==-1&&this.selected.splice(g,1)}h.target.checked&&(this.select==="single"&&(this.selected=[]),this.selected.push(i)),this.dispatchEvent(new CustomEvent("selected",{detail:[...this.selected]}))}}}></spectric-input>`;return it(p,n),p}}),A`
1105
+ <div class="table-wrapper" style="--rowHeight:${this.rowHeight-4}px">
1073
1106
  <div role="table">
1074
- <spectric-table-header .columns=${r} @sortChange=${this._handleSortChange}></spectric-table-header>
1075
- <spectric-table-body .columns=${r} .data=${this.data} .table=${this}></spectric-table-body>
1107
+ <spectric-table-header .columns=${t} @sortChange=${this._handleSortChange}></spectric-table-header>
1108
+ ${this.rowHeight>=25&&this.data.length>=100?A`<spectric-table-virtual-body .columns=${t} .data=${this.data} .table=${this} .rowHeight=${this.rowHeight}></spectric-table-virtual-body>`:A`<spectric-table-body .columns=${t} .data=${this.data} .table=${this}></spectric-table-body>`}
1076
1109
  </div>
1077
1110
  </div>
1078
- ${this.pagination?A`<spectric-pagination ${it(this.pagination)} @change=${this._handlePaginationChange}></spectric-pagination>`:null}
1079
- `}},fe([m({type:Array,attribute:!1})],d.TableElement.prototype,"data",2),fe([m({type:Object,attribute:!1})],d.TableElement.prototype,"pagination",2),fe([m({attribute:!1})],d.TableElement.prototype,"columns",2),fe([m({type:String,reflect:!0})],d.TableElement.prototype,"select",2),fe([m({type:String,reflect:!0})],d.TableElement.prototype,"sort",2),fe([Re()],d.TableElement.prototype,"selected",2),d.TableElement=fe([D(Gr)],d.TableElement);var Un=Object.defineProperty,In=Object.getOwnPropertyDescriptor,ie=(o,r,s,i)=>{for(var a=i>1?void 0:i?In(r,s):r,e=o.length-1,p;e>=0;e--)(p=o[e])&&(a=(i?p(r,s,a):p(a))||a);return i&&a&&Un(r,s,a),a};const ti="spectric-tooltip";var ri=(o=>(o.top="top",o.bottom="bottom",o.left="left",o.right="right",o.mouse="mouse",o))(ri||{});d.TooltipElement=class extends P{constructor(){super(...arguments),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalElement=document.createElement("div"),this.portalTarget=document.body,this.open=!1,this._getMousePosition=r=>{this.mouseLocation={left:r.clientX,top:r.clientY},this.position=="mouse"&&this.open&&!this.mouseframe&&(this.mouseframe=requestAnimationFrame(()=>this.positionTooltip()))},this._hideTooltip=()=>{this.timer&&clearTimeout(this.timer),this.open=!1,this.portalElement.remove()},this.showToolTip=async()=>{this.timer&&clearTimeout(this.timer),await new Promise(s=>{this.timer=window.setTimeout(s,this.delay)}),this.portalElement.style.pointerEvents="none",this.portalElement.className=`spectric-tooltip-portal ${this.position}`;const r=A`<div class="tooltip-container">
1111
+ ${this.pagination?A`<spectric-pagination ${We(this.pagination)} @change=${this._handlePaginationChange}></spectric-pagination>`:null}
1112
+ `}},ne([v({type:Array,attribute:!1})],d.TableElement.prototype,"data",2),ne([v({type:Object,attribute:!1})],d.TableElement.prototype,"pagination",2),ne([v({attribute:!1})],d.TableElement.prototype,"columns",2),ne([v({type:String,reflect:!0})],d.TableElement.prototype,"select",2),ne([v({type:String,reflect:!0})],d.TableElement.prototype,"sort",2),ne([v({type:Number,reflect:!0})],d.TableElement.prototype,"rowHeight",2),ne([Fe()],d.TableElement.prototype,"selected",2),d.TableElement=ne([D(hi)],d.TableElement);var ra=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,ae=(o,t,s,i)=>{for(var n=i>1?void 0:i?ia(t,s):t,e=o.length-1,p;e>=0;e--)(p=o[e])&&(n=(i?p(t,s,n):p(n))||n);return i&&n&&ra(t,s,n),n};const bi="spectric-tooltip";var vi=(o=>(o.top="top",o.bottom="bottom",o.left="left",o.right="right",o.mouse="mouse",o))(vi||{});d.TooltipElement=class extends lt{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalElement=document.createElement("div"),this.portalTarget=document.body,this.open=!1,this._getMousePosition=t=>{this.mouseLocation={left:t.clientX,top:t.clientY},this.position=="mouse"&&this.open&&!this.mouseframe&&(this.mouseframe=requestAnimationFrame(()=>this.positionTooltip()))},this._hideTooltip=()=>{this.timer&&clearTimeout(this.timer),this.open=!1,this.portalElement.remove()},this.showToolTip=async()=>{this.timer&&clearTimeout(this.timer),await new Promise(s=>{this.timer=window.setTimeout(s,this.delay)}),this.portalElement.style.pointerEvents="none",this.portalElement.className=`spectric-tooltip-portal ${this.position}`;const t=A`<div class="tooltip-container">
1080
1113
  <span class="tooltip-caret"></span>
1081
1114
  <div class="tooltip-content">${this.text}</div>
1082
- </div>`;Ot(r,this.portalElement),!(!this.target||!this.target.checkVisibility())&&(this.portalTarget.appendChild(this.portalElement),this.open=!0,requestAnimationFrame(this.positionTooltip))},this.applyStyle=r=>{Object.entries(r).forEach(([s,i])=>{this.portalElement.style.setProperty(s,i)})},this.positionTooltip=()=>{if(!this.target)return;let r=getComputedStyle(this),s={"--spectric-primary":r.getPropertyValue("--spectric-primary"),"--spectric-background-inverse":r.getPropertyValue("--spectric-background-inverse"),"--spectric-background-hover":r.getPropertyValue("--spectric-background-hover"),"--spectric-text-on-color":r.getPropertyValue("--spectric-text-on-color"),"--spectric-border-radius":r.getPropertyValue("--spectric-border-radius")};const i=this.target.getBoundingClientRect(),a=this.portalElement.getBoundingClientRect();if(this.target!==document.body&&this.maxWidth&&this.maxWidth>0&&(a.width=Math.min(a.width,this.maxWidth)),this.position==="mouse"&&this.mouseLocation){this.mouseframe=void 0;const e={left:this.mouseLocation.left+10+"px",top:this.mouseLocation.top-a.height/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="top"){const e={top:i.top-a.height+"px",left:i.left+i.width/2-a.width/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="bottom"){const e={top:i.bottom+"px",left:i.left+i.width/2-a.width/2+"px"};this.applyStyle({...s,...e})}else if(this.position==="left"){const e={top:Math.max(0,i.top+i.height/2-a.height/2)+"px",left:i.left-a.width+"px"};this.applyStyle({...s,...e})}else if(this.position==="right"){const e={top:Math.max(0,i.top+i.height/2-a.height/2)+"px",left:i.right+"px"};this.applyStyle({...s,...e})}this.position!=="mouse"&&this.portalElement.animate({opacity:[0,1]},{duration:this.animationDuration})}}get target(){return this.triggerTarget||this.parentElement}connectedCallback(){super.connectedCallback(),this.target&&(this.target.addEventListener("mousemove",this._getMousePosition),this.target.addEventListener("mouseover",this.showToolTip),this.target.addEventListener("mouseleave",this._hideTooltip))}disconnectedCallback(){var r,s,i;super.connectedCallback(),(r=this.target)==null||r.removeEventListener("mousemove",this._getMousePosition),(s=this.target)==null||s.removeEventListener("mouseover",this.showToolTip),(i=this.target)==null||i.removeEventListener("mouseleave",this._hideTooltip),this.portalElement.remove()}render(){}},d.TooltipElement.styles=M`:host{max-height: 0px;
1115
+ </div>`;it(t,this.portalElement),!(!this.target||!this.target.checkVisibility())&&(this.portalTarget.appendChild(this.portalElement),this.open=!0,requestAnimationFrame(this.positionTooltip))},this.applyStyle=t=>{Object.entries(t).forEach(([s,i])=>{this.portalElement.style.setProperty(s,i)})},this.positionTooltip=()=>{if(!this.target)return;let t=getComputedStyle(this),s={"--spectric-primary":t.getPropertyValue("--spectric-primary"),"--spectric-background-inverse":t.getPropertyValue("--spectric-background-inverse"),"--spectric-background-hover":t.getPropertyValue("--spectric-background-hover"),"--spectric-text-on-color":t.getPropertyValue("--spectric-text-on-color"),"--spectric-border-radius":t.getPropertyValue("--spectric-border-radius")};const i=this.target.getBoundingClientRect(),n=this.portalElement.getBoundingClientRect();this.target!==document.body&&this.maxWidth&&this.maxWidth>0&&(n.width=Math.min(n.width,this.maxWidth));let e;this.position==="mouse"&&this.mouseLocation?(this.mouseframe=void 0,e={left:this.mouseLocation.left+10+"px",top:this.mouseLocation.top-n.height/2+"px"}):this.position==="top"?e={top:i.top-n.height+"px",left:i.left+i.width/2-n.width/2+"px"}:this.position==="bottom"?e={top:i.bottom+"px",left:i.left+i.width/2-n.width/2+"px"}:this.position==="left"?e={top:Math.max(0,i.top+i.height/2-n.height/2)+"px",left:i.left-n.width+"px"}:this.position==="right"?e={top:Math.max(0,i.top+i.height/2-n.height/2)+"px",left:i.right+"px"}:(e={left:"0px",top:"0px"},console.error("Unknown position... Maybe we sould implement auto?")),this.applyStyle({...s,...e}),this.position!=="mouse"&&this.portalElement.animate({opacity:[0,1]},{duration:this.animationDuration})},this.addDisposableListener(()=>this.target,"mousemove",this._getMousePosition),this.addDisposableListener(()=>this.target,"mouseover",this.showToolTip),this.addDisposableListener(()=>this.target,"mouseleave",this._hideTooltip)}get target(){return this.triggerTarget||this.parentElement}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.portalElement.remove()}render(){}},d.TooltipElement.styles=H`:host{max-height: 0px;
1083
1116
  max-width: 0px;
1084
1117
  display: none;
1085
- pointer-events:none;}`,ie([m({type:Number,reflect:!0})],d.TooltipElement.prototype,"delay",2),ie([m({type:Number,reflect:!0})],d.TooltipElement.prototype,"animationDuration",2),ie([m({type:String,reflect:!1})],d.TooltipElement.prototype,"text",2),ie([m({type:String,reflect:!0})],d.TooltipElement.prototype,"position",2),ie([m({type:Number,reflect:!0})],d.TooltipElement.prototype,"maxWidth",2),ie([m({attribute:!1})],d.TooltipElement.prototype,"portalTarget",2),ie([m({attribute:!1})],d.TooltipElement.prototype,"triggerTarget",2),d.TooltipElement=ie([D(ti)],d.TooltipElement),d.ButtonSizes=Pr,d.ButtonVariants=Or,d.CSSPropsControls=$n,d.DialogElementTag=It,d.ElementTag=Kr,d.InputVariants=zr,d.Orientations=Yr,d.PaginationElementTag=Zr,d.SupportedLanguages=Ir,d.TableElementTag=Gr,d.TableSelectOptions=Jr,d.TableSortDirection=z,d.TableSortOption=ei,d.ThemeSelections=_n,d.TooltipElementTag=ti,d.TooltipPostions=ri,d.nodeTypes=Z,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
1118
+ pointer-events:none;}`,ae([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"delay",2),ae([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"animationDuration",2),ae([v({type:String,reflect:!1})],d.TooltipElement.prototype,"text",2),ae([v({type:String,reflect:!0})],d.TooltipElement.prototype,"position",2),ae([v({type:Number,reflect:!0})],d.TooltipElement.prototype,"maxWidth",2),ae([v({attribute:!1})],d.TooltipElement.prototype,"portalTarget",2),ae([v({attribute:!1})],d.TooltipElement.prototype,"triggerTarget",2),d.TooltipElement=ae([D(bi)],d.TooltipElement),d.ButtonSizes=Fr,d.ButtonVariants=Qr,d.CSSPropsControls=Ln,d.DialogElementTag=Gt,d.ElementTag=li,d.InputVariants=Zr,d.Orientations=ci,d.PaginationElementTag=pi,d.SupportedLanguages=ti,d.TableElementTag=hi,d.TableSelectOptions=fi,d.TableSortDirection=R,d.TableSortOption=gi,d.ThemeSelections=Nn,d.TooltipElementTag=bi,d.TooltipPostions=vi,d.nodeTypes=J,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
1086
1119
  //# sourceMappingURL=index.umd.js.map