@spectric/ui 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * @license
3
3
  * Copyright 2019 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
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;/**
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),F=(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
@@ -12,7 +12,7 @@
12
12
  * SPDX-License-Identifier: BSD-3-Clause
13
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
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};/**
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:Fe}),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 Fe{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 Fe{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===P?void 0:t}}class zr extends Fe{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==P)}}class Rr extends Fe{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:Fe,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
@@ -20,11 +20,11 @@
20
20
  * @license
21
21
  * Copyright 2017 Google LLC
22
22
  * SPDX-License-Identifier: BSD-3-Clause
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)}};/**
23
+ */const Ut={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},st=o=>(...t)=>({_$litDirective$:o,values:t});let Ft=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 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`
27
+ */const Ir="important",Rs=" !"+Ir,Ur=st(class extends Ft{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=F`
28
28
  :host{
29
29
  display: inline-block;
30
30
  --text-on-color: var(--spectric-text-on-color, #ffffff);
@@ -277,19 +277,19 @@ opacity:1
277
277
  * @license
278
278
  * Copyright 2017 Google LLC
279
279
  * SPDX-License-Identifier: BSD-3-Clause
280
- */function Fe(o){return v({...o,state:!0,attribute:!1})}/**
280
+ */function He(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 Hr=(o,t,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(o,t,s),s);/**
284
+ */const Fr=(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 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)}})}}/**
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 Fr(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 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`
292
+ */function ot(o){return(t,s)=>Fr(t,s,{async get(){var i;return await this.updateComplete,((i=this.renderRoot)==null?void 0:i.querySelector(o))??null}})}var Fs=Object.defineProperty,Hs=Object.getOwnPropertyDescriptor,q=(o,t,s,i)=>{for(var n=i>1?void 0:i?Hs(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&&Fs(t,s,n),n},Hr=(o=>(o.large="large",o.medium="medium",o.small="small",o.xsmall="xsmall",o.xxsmall="xxsmall",o.tiny="tiny",o))(Hr||{}),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"
@@ -304,11 +304,11 @@ opacity:1
304
304
  * @license
305
305
  * Copyright 2020 Google LLC
306
306
  * SPDX-License-Identifier: BSD-3-Clause
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}};/**
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,Ht=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 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(){}}/**
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 Ft{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
@@ -330,7 +330,7 @@ opacity:1
330
330
  width=${s}
331
331
  height=${t}
332
332
  ></canvas>
333
- `}},d.BitDisplayCanvas.styles=H`
333
+ `}},d.BitDisplayCanvas.styles=F`
334
334
  :host{
335
335
  position: relative;
336
336
  --border-radius: var(--spectric-border-radius,4em);
@@ -426,7 +426,7 @@ opacity:1
426
426
 
427
427
  }
428
428
 
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 {
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=F`.spectric-header {
430
430
  display: flex;
431
431
  justify-content: space-between;
432
432
  align-items: center;
@@ -485,7 +485,7 @@ opacity:1
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
- `}};_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`
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=F`
489
489
 
490
490
  :host {
491
491
  height:100vh;
@@ -721,10 +721,10 @@ article{
721
721
  </div>
722
722
  </label>
723
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`
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)&&H("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"},Fa={type:"other",description:"whitespace"},Ha=/^[ \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(){H("LuceneOr")},zi="&&",Za={type:"literal",value:"&&",description:'"&&"'},Ri=function(){H("LuceneAnd")},Mi="+",Ii={type:"literal",value:"+",description:'"+"'},Ui="-",Fi={type:"literal",value:"-",description:'"-"'},Hi=function(){H("LuceneNot")},Qi="!",qi={type:"literal",value:"!",description:'"!"'},Wi="_exists_",Xa={type:"literal",value:"_exists_",description:'"_exists_"'},Ga=function(){H("LuceneExists")},Vi=function(){H("LuceneRange")},Yi="?",Ki={type:"literal",value:"?",description:'"?"'},Ja=function(){H("LuceneWildcard")},ar="/",cr={type:"literal",value:"/",description:'"/"'},Zi=/^[^\/]/,Xi={type:"class",value:"[^/]",description:"[^/]"},ec=function(){H("LuceneRegex")},lr="~",pr={type:"literal",value:"~",description:'"~"'},Oe=/^[0-9]/,De={type:"class",value:"[0-9]",description:"[0-9]"},tc=function(){H("LuceneFuzzy")},rc=function(){H("LuceneProximity")},Gi="^",Ji={type:"literal",value:"^",description:'"^"'},ic=function(){H("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 H(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++,Ha.test(i.charAt(c))?(r=i.charAt(c),c++):(r=e,f===0&&m(Qa)),f--,r===e&&f===0&&m(Fa),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(Fi)),a!==e&&(S=r,a=Hi()),r=a,r===e&&(r=c,i.charCodeAt(c)===33?(a=Qi,c++):(a=e,f===0&&m(qi)),a!==e&&(S=r,a=Hi()),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(Fi)),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=Fo(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 Fo(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 Ho=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:Ho,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=F`
728
728
  :host {
729
729
  --dialog-padding: var(--spectric-dialog-padding, 5px);
730
730
  --dialog-background:var(--spectric-background,rgb(246, 249, 252));
@@ -797,7 +797,7 @@ spectric-button{
797
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
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`
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([He()],d.SpectricQuery.prototype,"completions",2),V([He()],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=F`
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
- `,si=H`
808
+ `,si=F`
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
- `,Cn=H`
816
+ `,Cn=F`
817
817
  :host{
818
818
  display:block;
819
819
  border:2px solid black;
@@ -955,9 +955,9 @@ spectric-button{
955
955
  }
956
956
  </style>`:null}
957
957
  <slot></slot>
958
- `}},d.SpectricThemeProvider.styles=H`:host{
958
+ `}},d.SpectricThemeProvider.styles=F`:host{
959
959
  display:contents;
960
- }`,oi([v({reflect:!0})],d.SpectricThemeProvider.prototype,"theme",2),d.SpectricThemeProvider=oi([D("spectric-theme")],d.SpectricThemeProvider);const jn=H`
960
+ }`,oi([v({reflect:!0})],d.SpectricThemeProvider.prototype,"theme",2),d.SpectricThemeProvider=oi([D("spectric-theme")],d.SpectricThemeProvider);const jn=F`
961
961
  :host {
962
962
  display: block;
963
963
  height: 100%;
@@ -1032,7 +1032,7 @@ spectric-button{
1032
1032
  </div>
1033
1033
  </div>
1034
1034
  <slot @slotchange=${this._assignSlot} style="display:none"></slot>
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`
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([He()],d.SplitView.prototype,"isDragging",2),I([He()],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-->
@@ -1053,16 +1053,16 @@ spectric-button{
1053
1053
  </div>
1054
1054
  `:null}
1055
1055
  </div>
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`
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,Fn=Object.getOwnPropertyDescriptor,ui=(o,t,s,i)=>{for(var n=i>1?void 0:i?Fn(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 Hn="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.descending:o.sortDirection===R.descending&&(o.sortDirection=R.none),this.dispatchEvent(new CustomEvent("sortChange",{composed:!0,bubbles:!0,detail:o})))}}createRenderRoot(){return this}render(){return A`
1057
1057
  <tr>
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`
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.descending?"🠋":"",n=o.sortDirection||R.none;return A`
1059
1059
  <td @click=${()=>this._handleSortChange(o)} style="${s}">
1060
1060
  <div class=${t.join(" ")} >${o.title||o.key}
1061
1061
  <span class="sort-direction ${n}">${i}</span>
1062
1062
  </div>
1063
1063
  </td>`})}
1064
1064
  </tr>
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">
1065
+ `}};ui([v({type:Array,attribute:!1})],tr.prototype,"columns",2),tr=ui([D(Hn)],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._emitFilter({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._emitFilter({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}_emitFilter(o){this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:o}))}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">
1066
1066
  <spectric-button @click=${this._handleFilterOut} size="tiny" variant="text" icon tooltip="Filter Out Value">-</spectric-button>
1067
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`
1068
1068
  <td>
@@ -1073,7 +1073,7 @@ spectric-button{
1073
1073
  * @license
1074
1074
  * Copyright 2017 Google LLC
1075
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`
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 Ft{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 Ht(n[E]),E--;else Ht(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&&Ht(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`
1077
1077
  <body>
1078
1078
  ${bt(this.data,(o,t)=>A`
1079
1079
  <tr class="${t%2===0?"odd":""}">
@@ -1101,7 +1101,7 @@ spectric-button{
1101
1101
  ${y>0?x:null}
1102
1102
  </tbody>
1103
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`
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.descending&&(g=g*-1),g}else if(typeof p=="string")return p.localeCompare(h)*(s===R.descending?-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.descending="descending",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.dispatchEvent(new CustomEvent("paginationChange",{detail:t.detail})),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.dispatchEvent(new CustomEvent("sortChange"))},this.selected=[],this._handleSelectAllChange=t=>{t.stopPropagation(),t.target.checked?this.selectAll():this.deselectAll()}}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}deselectAll(){this.selected=[],this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}selectAll(){this.selected=[...this.data],this.dispatchEvent(new CustomEvent("selected",{detail:this.selected}))}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
1105
  <div class="table-wrapper" style="--rowHeight:${this.rowHeight-4}px">
1106
1106
  <div role="table">
1107
1107
  <spectric-table-header .columns=${t} @sortChange=${this._handleSortChange}></spectric-table-header>
@@ -1109,11 +1109,11 @@ spectric-button{
1109
1109
  </div>
1110
1110
  </div>
1111
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">
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([He()],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">
1113
1113
  <span class="tooltip-caret"></span>
1114
1114
  <div class="tooltip-content">${this.text}</div>
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;
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=F`:host{max-height: 0px;
1116
1116
  max-width: 0px;
1117
1117
  display: none;
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"})});
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=Hr,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"})});
1119
1119
  //# sourceMappingURL=index.umd.js.map