@spectric/ui 0.0.18 → 0.0.20
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/components/Button.d.ts +2 -1
- package/dist/components/Panel.d.ts +6 -3
- package/dist/components/calendar/calendar.d.ts +58 -0
- package/dist/components/calendar/index.d.ts +1 -0
- package/dist/components/color_picker/ColorPicker.d.ts +7 -6
- package/dist/components/index.d.ts +1 -0
- package/dist/components/input.d.ts +24 -20
- package/dist/components/query_bar/QueryBar.d.ts +2 -1
- package/dist/components/table/table.d.ts +3 -0
- package/dist/components/tooltip/popover.d.ts +32 -2
- package/dist/components/tooltip/tooltip.d.ts +1 -32
- package/dist/custom-elements.json +59 -14
- package/dist/index.d.ts +2 -0
- package/dist/index.es.js +2842 -2564
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +298 -178
- package/dist/index.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/Button.ts +14 -13
- package/src/components/Panel.ts +25 -18
- package/src/components/button.css.ts +13 -0
- package/src/components/calendar/calendar.css +50 -0
- package/src/components/calendar/calendar.ts +281 -0
- package/src/components/calendar/index.ts +1 -0
- package/src/components/color_picker/ColorPicker.css +36 -3
- package/src/components/color_picker/ColorPicker.ts +46 -15
- package/src/components/index.ts +2 -1
- package/src/components/input.css +1 -1
- package/src/components/input.ts +203 -142
- package/src/components/panel.css.ts +7 -5
- package/src/components/query_bar/QueryBar.css +6 -2
- package/src/components/query_bar/QueryBar.ts +25 -13
- package/src/components/table/table.ts +43 -35
- package/src/components/table/virtualBody.ts +5 -4
- package/src/components/tooltip/popover.ts +70 -30
- package/src/components/tooltip/tooltip.css +7 -2
- package/src/components/tooltip/tooltip.ts +3 -37
- package/src/stories/Calendar.stories.ts +70 -0
- package/src/stories/fixtures/ExampleContent.ts +1 -1
- package/src/stories/table.stories.ts +10 -5
- package/src/stories/tooltip.stories.ts +9 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
(function(h,
|
|
1
|
+
(function(h,ce){typeof exports=="object"&&typeof module<"u"?ce(exports):typeof define=="function"&&define.amd?define(["exports"],ce):(h=typeof globalThis<"u"?globalThis:h||self,ce(h["Spectric-UI"]={}))})(this,function(h){"use strict";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2019 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/var
|
|
5
|
+
*/var Ui;const ce=globalThis,Ft=ce.ShadowRoot&&(ce.ShadyCSS===void 0||ce.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Qt=Symbol(),Yr=new WeakMap;let Zr=class{constructor(e,s,i){if(this._$cssResult$=!0,i!==Qt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=s}get styleSheet(){let e=this.o;const s=this.t;if(Ft&&e===void 0){const i=s!==void 0&&s.length===1;i&&(e=Yr.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&Yr.set(s,e))}return e}toString(){return this.cssText}};const Zs=n=>new Zr(typeof n=="string"?n:n+"",void 0,Qt),F=(n,...e)=>{const s=n.length===1?n[0]:e.reduce((i,o,t)=>i+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+n[t+1],n[0]);return new Zr(s,n,Qt)},Ks=(n,e)=>{if(Ft)n.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const i=document.createElement("style"),o=ce.litNonce;o!==void 0&&i.setAttribute("nonce",o),i.textContent=s.cssText,n.appendChild(i)}},Kr=Ft?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let s="";for(const i of e.cssRules)s+=i.cssText;return Zs(s)})(n):n;/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright 2017 Google LLC
|
|
8
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const{is:
|
|
9
|
+
*/const{is:Xs,defineProperty:Gs,getOwnPropertyDescriptor:Js,getOwnPropertyNames:en,getOwnPropertySymbols:tn,getPrototypeOf:rn}=Object,le=globalThis,Xr=le.trustedTypes,sn=Xr?Xr.emptyScript:"",qt=le.reactiveElementPolyfillSupport,Ze=(n,e)=>n,vt={toAttribute(n,e){switch(e){case Boolean:n=n?sn:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let s=n;switch(e){case Boolean:s=n!==null;break;case Number:s=n===null?null:Number(n);break;case Object:case Array:try{s=JSON.parse(n)}catch{s=null}}return s}},Wt=(n,e)=>!Xs(n,e),Gr={attribute:!0,type:String,converter:vt,reflect:!1,hasChanged:Wt};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),le.litPropertyMetadata??(le.litPropertyMetadata=new WeakMap);class Oe extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,s=Gr){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(e,s),!s.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(e,i,s);o!==void 0&&Gs(this.prototype,e,o)}}static getPropertyDescriptor(e,s,i){const{get:o,set:t}=Js(this.prototype,e)??{get(){return this[s]},set(l){this[s]=l}};return{get(){return o==null?void 0:o.call(this)},set(l){const f=o==null?void 0:o.call(this);t.call(this,l),this.requestUpdate(e,f,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Gr}static _$Ei(){if(this.hasOwnProperty(Ze("elementProperties")))return;const e=rn(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Ze("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Ze("properties"))){const s=this.properties,i=[...en(s),...tn(s)];for(const o of i)this.createProperty(o,s[o])}const e=this[Symbol.metadata];if(e!==null){const s=litPropertyMetadata.get(e);if(s!==void 0)for(const[i,o]of s)this.elementProperties.set(i,o)}this._$Eh=new Map;for(const[s,i]of this.elementProperties){const o=this._$Eu(s,i);o!==void 0&&this._$Eh.set(o,s)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const s=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const o of i)s.unshift(Kr(o))}else e!==void 0&&s.push(Kr(e));return s}static _$Eu(e,s){const i=s.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(s=>s(this))}addController(e){var s;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((s=e.hostConnected)==null||s.call(e))}removeController(e){var s;(s=this._$EO)==null||s.delete(e)}_$E_(){const e=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Ks(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostConnected)==null?void 0:i.call(s)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(s=>{var i;return(i=s.hostDisconnected)==null?void 0:i.call(s)})}attributeChangedCallback(e,s,i){this._$AK(e,i)}_$EC(e,s){var t;const i=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,i);if(o!==void 0&&i.reflect===!0){const l=(((t=i.converter)==null?void 0:t.toAttribute)!==void 0?i.converter:vt).toAttribute(s,i.type);this._$Em=e,l==null?this.removeAttribute(o):this.setAttribute(o,l),this._$Em=null}}_$AK(e,s){var t;const i=this.constructor,o=i._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const l=i.getPropertyOptions(o),f=typeof l.converter=="function"?{fromAttribute:l.converter}:((t=l.converter)==null?void 0:t.fromAttribute)!==void 0?l.converter:vt;this._$Em=o,this[o]=f.fromAttribute(s,l.type),this._$Em=null}}requestUpdate(e,s,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??Wt)(this[e],s))return;this.P(e,s,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,s,i){this._$AL.has(e)||this._$AL.set(e,s),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(s){Promise.reject(s)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,l]of this._$Ep)this[t]=l;this._$Ep=void 0}const o=this.constructor.elementProperties;if(o.size>0)for(const[t,l]of o)l.wrapped!==!0||this._$AL.has(t)||this[t]===void 0||this.P(t,this[t],l)}let e=!1;const s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(i=this._$EO)==null||i.forEach(o=>{var t;return(t=o.hostUpdate)==null?void 0:t.call(o)}),this.update(s)):this._$EU()}catch(o){throw e=!1,this._$EU(),o}e&&this._$AE(s)}willUpdate(e){}_$AE(e){var s;(s=this._$EO)==null||s.forEach(i=>{var o;return(o=i.hostUpdated)==null?void 0:o.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(s=>this._$EC(s,this[s]))),this._$EU()}updated(e){}firstUpdated(e){}}Oe.elementStyles=[],Oe.shadowRootOptions={mode:"open"},Oe[Ze("elementProperties")]=new Map,Oe[Ze("finalized")]=new Map,qt==null||qt({ReactiveElement:Oe}),(le.reactiveElementVersions??(le.reactiveElementVersions=[])).push("2.0.4");/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/const
|
|
14
|
-
\f\r]`,
|
|
15
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
13
|
+
*/const Ke=globalThis,bt=Ke.trustedTypes,Jr=bt?bt.createPolicy("lit-html",{createHTML:n=>n}):void 0,Vt="$lit$",ne=`lit$${Math.random().toFixed(9).slice(2)}$`,Yt="?"+ne,nn=`<${Yt}>`,be=document,Xe=()=>be.createComment(""),Ge=n=>n===null||typeof n!="object"&&typeof n!="function",Zt=Array.isArray,ei=n=>Zt(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",Kt=`[
|
|
14
|
+
\f\r]`,Je=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ti=/-->/g,ri=/>/g,me=RegExp(`>|${Kt}(?:([^\\s"'>=/]+)(${Kt}*=${Kt}*(?:[^
|
|
15
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ii=/'/g,si=/"/g,ni=/^(?:script|style|textarea|title)$/i,on=n=>(e,...s)=>({_$litType$:n,strings:e,values:s}),w=on(1),pe=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),oi=new WeakMap,ye=be.createTreeWalker(be,129);function ai(n,e){if(!Zt(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Jr!==void 0?Jr.createHTML(e):e}const ci=(n,e)=>{const s=n.length-1,i=[];let o,t=e===2?"<svg>":e===3?"<math>":"",l=Je;for(let f=0;f<s;f++){const d=n[f];let y,C,$=-1,E=0;for(;E<d.length&&(l.lastIndex=E,C=l.exec(d),C!==null);)E=l.lastIndex,l===Je?C[1]==="!--"?l=ti:C[1]!==void 0?l=ri:C[2]!==void 0?(ni.test(C[2])&&(o=RegExp("</"+C[2],"g")),l=me):C[3]!==void 0&&(l=me):l===me?C[0]===">"?(l=o??Je,$=-1):C[1]===void 0?$=-2:($=l.lastIndex-C[2].length,y=C[1],l=C[3]===void 0?me:C[3]==='"'?si:ii):l===si||l===ii?l=me:l===ti||l===ri?l=Je:(l=me,o=void 0);const x=l===me&&n[f+1].startsWith("/>")?" ":"";t+=l===Je?d+nn:$>=0?(i.push(y),d.slice(0,$)+Vt+d.slice($)+ne+x):d+ne+($===-2?f:x)}return[ai(n,t+(n[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class et{constructor({strings:e,_$litType$:s},i){let o;this.parts=[];let t=0,l=0;const f=e.length-1,d=this.parts,[y,C]=ci(e,s);if(this.el=et.createElement(y,i),ye.currentNode=this.el.content,s===2||s===3){const $=this.el.content.firstChild;$.replaceWith(...$.childNodes)}for(;(o=ye.nextNode())!==null&&d.length<f;){if(o.nodeType===1){if(o.hasAttributes())for(const $ of o.getAttributeNames())if($.endsWith(Vt)){const E=C[l++],x=o.getAttribute($).split(ne),k=/([.?@])?(.*)/.exec(E);d.push({type:1,index:t,name:k[2],strings:x,ctor:k[1]==="."?pi:k[1]==="?"?ui:k[1]==="@"?hi:tt}),o.removeAttribute($)}else $.startsWith(ne)&&(d.push({type:6,index:t}),o.removeAttribute($));if(ni.test(o.tagName)){const $=o.textContent.split(ne),E=$.length-1;if(E>0){o.textContent=bt?bt.emptyScript:"";for(let x=0;x<E;x++)o.append($[x],Xe()),ye.nextNode(),d.push({type:2,index:++t});o.append($[E],Xe())}}}else if(o.nodeType===8)if(o.data===Yt)d.push({type:2,index:t});else{let $=-1;for(;($=o.data.indexOf(ne,$+1))!==-1;)d.push({type:7,index:t}),$+=ne.length-1}t++}}static createElement(e,s){const i=be.createElement("template");return i.innerHTML=e,i}}function $e(n,e,s=n,i){var l,f;if(e===pe)return e;let o=i!==void 0?(l=s._$Co)==null?void 0:l[i]:s._$Cl;const t=Ge(e)?void 0:e._$litDirective$;return(o==null?void 0:o.constructor)!==t&&((f=o==null?void 0:o._$AO)==null||f.call(o,!1),t===void 0?o=void 0:(o=new t(n),o._$AT(n,s,i)),i!==void 0?(s._$Co??(s._$Co=[]))[i]=o:s._$Cl=o),o!==void 0&&(e=$e(n,o._$AS(n,e.values),o,i)),e}let li=class{constructor(e,s){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:s},parts:i}=this._$AD,o=((e==null?void 0:e.creationScope)??be).importNode(s,!0);ye.currentNode=o;let t=ye.nextNode(),l=0,f=0,d=i[0];for(;d!==void 0;){if(l===d.index){let y;d.type===2?y=new De(t,t.nextSibling,this,e):d.type===1?y=new d.ctor(t,d.name,d.strings,this,e):d.type===6&&(y=new di(t,this,e)),this._$AV.push(y),d=i[++f]}l!==(d==null?void 0:d.index)&&(t=ye.nextNode(),l++)}return ye.currentNode=be,o}p(e){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,s),s+=i.strings.length-2):i._$AI(e[s])),s++}};class De{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,s,i,o){this.type=2,this._$AH=P,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=i,this.options=o,this._$Cv=(o==null?void 0:o.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=s.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,s=this){e=$e(this,e,s),Ge(e)?e===P||e==null||e===""?(this._$AH!==P&&this._$AR(),this._$AH=P):e!==this._$AH&&e!==pe&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ei(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==P&&Ge(this._$AH)?this._$AA.nextSibling.data=e:this.T(be.createTextNode(e)),this._$AH=e}$(e){var t;const{values:s,_$litType$:i}=e,o=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=et.createElement(ai(i.h,i.h[0]),this.options)),i);if(((t=this._$AH)==null?void 0:t._$AD)===o)this._$AH.p(s);else{const l=new li(o,this),f=l.u(this.options);l.p(s),this.T(f),this._$AH=l}}_$AC(e){let s=oi.get(e.strings);return s===void 0&&oi.set(e.strings,s=new et(e)),s}k(e){Zt(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,o=0;for(const t of e)o===s.length?s.push(i=new De(this.O(Xe()),this.O(Xe()),this,this.options)):i=s[o],i._$AI(t),o++;o<s.length&&(this._$AR(i&&i._$AB.nextSibling,o),s.length=o)}_$AR(e=this._$AA.nextSibling,s){var i;for((i=this._$AP)==null?void 0:i.call(this,!1,!0,s);e&&e!==this._$AB;){const o=e.nextSibling;e.remove(),e=o}}setConnected(e){var s;this._$AM===void 0&&(this._$Cv=e,(s=this._$AP)==null||s.call(this,e))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,i,o,t){this.type=1,this._$AH=P,this._$AN=void 0,this.element=e,this.name=s,this._$AM=o,this.options=t,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=P}_$AI(e,s=this,i,o){const t=this.strings;let l=!1;if(t===void 0)e=$e(this,e,s,0),l=!Ge(e)||e!==this._$AH&&e!==pe,l&&(this._$AH=e);else{const f=e;let d,y;for(e=t[0],d=0;d<t.length-1;d++)y=$e(this,f[i+d],s,d),y===pe&&(y=this._$AH[d]),l||(l=!Ge(y)||y!==this._$AH[d]),y===P?e=P:e!==P&&(e+=(y??"")+t[d+1]),this._$AH[d]=y}l&&!o&&this.j(e)}j(e){e===P?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class pi extends tt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===P?void 0:e}}class ui extends tt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==P)}}class hi extends tt{constructor(e,s,i,o,t){super(e,s,i,o,t),this.type=5}_$AI(e,s=this){if((e=$e(this,e,s,0)??P)===pe)return;const i=this._$AH,o=e===P&&i!==P||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,t=e!==P&&(i===P||o);o&&this.element.removeEventListener(this.name,this,i),t&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var s;typeof this._$AH=="function"?this._$AH.call(((s=this.options)==null?void 0:s.host)??this.element,e):this._$AH.handleEvent(e)}}class di{constructor(e,s,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){$e(this,e)}}const an={M:Vt,P:ne,A:Yt,C:1,L:ci,R:li,D:ei,V:$e,I:De,H:tt,N:ui,U:hi,B:pi,F:di},Xt=Ke.litHtmlPolyfillSupport;Xt==null||Xt(et,De),(Ke.litHtmlVersions??(Ke.litHtmlVersions=[])).push("3.2.1");const rt=(n,e,s)=>{const i=(s==null?void 0:s.renderBefore)??e;let o=i._$litPart$;if(o===void 0){const t=(s==null?void 0:s.renderBefore)??null;i._$litPart$=o=new De(e.insertBefore(Xe(),t),t,void 0,s??{})}return o._$AI(n),o};/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/let
|
|
19
|
+
*/let z=class extends Oe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var s;const e=super.createRenderRoot();return(s=this.renderOptions).renderBefore??(s.renderBefore=e.firstChild),e}update(e){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=rt(s,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return pe}};z._$litElement$=!0,z.finalized=!0,(Ui=globalThis.litElementHydrateSupport)==null||Ui.call(globalThis,{LitElement:z});const Gt=globalThis.litElementPolyfillSupport;Gt==null||Gt({LitElement:z}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
22
22
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/const
|
|
23
|
+
*/const Jt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},it=n=>(...e)=>({_$litDirective$:n,values:e});let mt=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,s,i){this._$Ct=e,this._$AM=s,this._$Ci=i}_$AS(e,s){return this.update(e,s)}update(e,s){return this.render(...s)}};/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2018 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/const
|
|
27
|
+
*/const fi="important",cn=" !"+fi,er=it(class extends mt{constructor(n){var e;if(super(n),n.type!==Jt.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,s)=>{const i=n[s];return i==null?e:e+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(n,[e]){const{style:s}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in e){const o=e[i];if(o!=null){this.ft.add(i);const t=typeof o=="string"&&o.endsWith(cn);i.includes("-")||t?s.setProperty(i,t?o.slice(0,-11):o,t?fi:""):s[i]=o}}return pe}}),ln=F`
|
|
28
28
|
:host{
|
|
29
29
|
display: inline-block;
|
|
30
30
|
--text-on-color: var(--spectric-text-on-color, #ffffff);
|
|
@@ -139,27 +139,40 @@
|
|
|
139
139
|
:host([icon][size="tiny"]) .spectric-button{
|
|
140
140
|
width: 10px;
|
|
141
141
|
height: 10px;
|
|
142
|
+
font-size:8px;
|
|
143
|
+
line-height:8px
|
|
142
144
|
}
|
|
143
145
|
:host([icon][size="xxsmall"]) .spectric-button{
|
|
144
146
|
width: 16px;
|
|
145
147
|
height: 16px;
|
|
148
|
+
font-size: 10px;
|
|
149
|
+
line-height: 10px;
|
|
146
150
|
}
|
|
147
151
|
:host([icon][size="xsmall"]) .spectric-button{
|
|
148
152
|
width: 28px;
|
|
149
153
|
height: 28px;
|
|
154
|
+
font-size: 16px;
|
|
155
|
+
line-height: 16px;
|
|
150
156
|
}
|
|
151
157
|
:host([icon][size="small"]) .spectric-button{
|
|
152
158
|
width: 34px;
|
|
153
159
|
height: 34px;
|
|
160
|
+
font-size: 20px;
|
|
161
|
+
line-height: 20px;
|
|
162
|
+
|
|
154
163
|
}
|
|
155
164
|
:host([icon][size="medium"]) .spectric-button{
|
|
156
165
|
width: 40px;
|
|
157
166
|
height: 40px;
|
|
167
|
+
font-size: 28px;
|
|
168
|
+
line-height: 28px;
|
|
158
169
|
}
|
|
159
170
|
|
|
160
171
|
:host([icon][size="large"]) .spectric-button{
|
|
161
172
|
width: 48px;
|
|
162
173
|
height: 48px;
|
|
174
|
+
line-height: 32px;
|
|
175
|
+
font-size: 32px;
|
|
163
176
|
}
|
|
164
177
|
|
|
165
178
|
.spectric-button:disabled{
|
|
@@ -269,72 +282,72 @@ opacity:1
|
|
|
269
282
|
* @license
|
|
270
283
|
* Copyright 2017 Google LLC
|
|
271
284
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
272
|
-
*/const
|
|
285
|
+
*/const T=n=>(e,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(n,e)}):customElements.define(n,e)};/**
|
|
273
286
|
* @license
|
|
274
287
|
* Copyright 2017 Google LLC
|
|
275
288
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
276
|
-
*/const
|
|
289
|
+
*/const pn={attribute:!0,type:String,converter:vt,reflect:!1,hasChanged:Wt},un=(n=pn,e,s)=>{const{kind:i,metadata:o}=s;let t=globalThis.litPropertyMetadata.get(o);if(t===void 0&&globalThis.litPropertyMetadata.set(o,t=new Map),t.set(s.name,n),i==="accessor"){const{name:l}=s;return{set(f){const d=e.get.call(this);e.set.call(this,f),this.requestUpdate(l,d,n)},init(f){return f!==void 0&&this.P(l,void 0,n),f}}}if(i==="setter"){const{name:l}=s;return function(f){const d=this[l];e.call(this,f),this.requestUpdate(l,d,n)}}throw Error("Unsupported decorator location: "+i)};function v(n){return(e,s)=>typeof s=="object"?un(n,e,s):((i,o,t)=>{const l=o.hasOwnProperty(t);return o.constructor.createProperty(t,l?{...i,wrapped:!0}:i),l?Object.getOwnPropertyDescriptor(o,t):void 0})(n,e,s)}/**
|
|
277
290
|
* @license
|
|
278
291
|
* Copyright 2017 Google LLC
|
|
279
292
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
280
|
-
*/function
|
|
293
|
+
*/function Q(n){return v({...n,state:!0,attribute:!1})}/**
|
|
281
294
|
* @license
|
|
282
295
|
* Copyright 2017 Google LLC
|
|
283
296
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
284
|
-
*/function
|
|
297
|
+
*/function we(n){return(e,s)=>{const i=typeof e=="function"?e:e[s];Object.assign(i,n)}}/**
|
|
285
298
|
* @license
|
|
286
299
|
* Copyright 2017 Google LLC
|
|
287
300
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
288
|
-
*/const
|
|
301
|
+
*/const gi=(n,e,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(n,e,s),s);/**
|
|
289
302
|
* @license
|
|
290
303
|
* Copyright 2017 Google LLC
|
|
291
304
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
292
|
-
*/function
|
|
305
|
+
*/function ue(n,e){return(s,i,o)=>{const t=l=>{var f;return((f=l.renderRoot)==null?void 0:f.querySelector(n))??null};return gi(s,i,{get(){return t(this)}})}}/**
|
|
293
306
|
* @license
|
|
294
307
|
* Copyright 2017 Google LLC
|
|
295
308
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
296
|
-
*/function
|
|
297
|
-
|
|
309
|
+
*/function st(n){return(e,s)=>gi(e,s,{async get(){var i;return await this.updateComplete,((i=this.renderRoot)==null?void 0:i.querySelector(n))??null}})}let tr=0;const vi=()=>tr;class bi{constructor(e,s,i,o){this._handler=i,this._type=s,this._handler=i,this._options=o||!1,e instanceof Promise?e.then(t=>{this._handler&&(this._node=t,this._node.addEventListener(this._type,this._handler,this._options))}):typeof e=="function"?(this._node=e(),this._node.addEventListener(this._type,this._handler,this._options)):(this._node=e,this._node.addEventListener(this._type,this._handler,this._options)),tr+=1}dispose(){this._handler&&(this._node&&(tr-=1,this._node.removeEventListener(this._type,this._handler,this._options)),this._node=void 0,this._handler=void 0)}}class K extends z{constructor(){super(...arguments),this._disposables=new Set,this._isDisposed=!1,this._disposableListeners=[],this._connected=!1}addDisposableListener(e,s,i,o){if(this._disposableListeners.find(l=>l.event===s&&l.target===e&&l.handler===i)){console.warn("Event handler already exists best practice is to add the this in the constructor");return}this._disposableListeners.push({target:e,event:s,handler:i,options:o}),this._connected&&this.registerDisposable(new bi(e,s,i,o))}registerDisposable(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?console.warn(new Error("Trying to add a disposable to something that has already been disposed of. The added object will be leaked!").stack):this._disposables.add(e),e}connectedCallback(){super.connectedCallback(),this._connected=!0,this._isDisposed=!1,this._disposableListeners.forEach(({target:e,event:s,handler:i,options:o})=>{this.registerDisposable(new bi(e,s,i,o))})}disconnectedCallback(){super.disconnectedCallback(),this._connected=!1,this._disposables.forEach(e=>{e.dispose()}),this._isDisposed=!0}}var hn=Object.defineProperty,dn=Object.getOwnPropertyDescriptor,X=(n,e,s,i)=>{for(var o=i>1?void 0:i?dn(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&hn(e,s,o),o},rr=(n=>(n.large="large",n.medium="medium",n.small="small",n.xsmall="xsmall",n.xxsmall="xxsmall",n.tiny="tiny",n))(rr||{}),ir=(n=>(n.primary="primary",n.secondary="secondary",n.text="text",n))(ir||{});const fn={primary:"spectric-button--primary",secondary:"spectric-button--secondary",text:"spectric-button--text"};h.SpectricButton=class extends K{constructor(){super(),this.variant="primary",this.disabled=!1,this.size="small",this.label="",this.danger=!1,this.icon=!1,this.tooltipPosition="right",this.addDisposableListener(this,"click",this._onClick,{capture:!0}),this._onClick=this._onClick.bind(this)}_onClick(e){if(!(e instanceof CustomEvent)&&this.disabled){e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation();return}}updated(e){this.tooltip&&this.tooltip!==""&&rt(w`<spectric-tooltip slot="tooltip" .text=${this.tooltip} .position=${this.tooltipPosition||"right"}></spectric-tooltip>`,this)}render(){const e=fn[this.variant]||"spectric-button--primary";return w`
|
|
310
|
+
<slot name="tooltip"></slot>
|
|
298
311
|
<button
|
|
299
312
|
type="button"
|
|
300
313
|
?disabled=${this.disabled}
|
|
301
314
|
class=${["spectric-button",`spectric-button-danger--${this.danger||!1}`,`spectric-button--${this.size||"medium"}`,e].join(" ")}
|
|
302
|
-
style=${
|
|
315
|
+
style=${er({backgroundColor:this.backgroundColor})}
|
|
303
316
|
>
|
|
304
317
|
<span class="animation"></span>
|
|
305
318
|
<slot>${this.label}</slot>
|
|
306
319
|
</button>
|
|
307
|
-
`}},h.SpectricButton.styles=
|
|
320
|
+
`}},h.SpectricButton.styles=ln,X([v({type:String,reflect:!0})],h.SpectricButton.prototype,"variant",2),X([v({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"disabled",2),X([v({type:String,reflect:!0})],h.SpectricButton.prototype,"backgroundColor",2),X([v({type:String,reflect:!0})],h.SpectricButton.prototype,"size",2),X([v({type:String,reflect:!0})],h.SpectricButton.prototype,"label",2),X([v({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"danger",2),X([v({type:Boolean,reflect:!0})],h.SpectricButton.prototype,"icon",2),X([v({type:String,reflect:!0})],h.SpectricButton.prototype,"tooltip",2),X([v({type:String,reflect:!0})],h.SpectricButton.prototype,"tooltipPosition",2),h.SpectricButton=X([T("spectric-button")],h.SpectricButton);/**
|
|
308
321
|
* @license
|
|
309
322
|
* Copyright 2020 Google LLC
|
|
310
323
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
311
|
-
*/const{I:
|
|
324
|
+
*/const{I:gn}=an,mi=(n,e)=>(n==null?void 0:n._$litType$)!==void 0,vn=n=>{var e;return((e=n==null?void 0:n._$litType$)==null?void 0:e.h)!=null},bn=n=>n.strings===void 0,yi=()=>document.createComment(""),_e=(n,e,s)=>{var t;const i=n._$AA.parentNode,o=e===void 0?n._$AB:e._$AA;if(s===void 0){const l=i.insertBefore(yi(),o),f=i.insertBefore(yi(),o);s=new gn(l,f,n,n.options)}else{const l=s._$AB.nextSibling,f=s._$AM,d=f!==n;if(d){let y;(t=s._$AQ)==null||t.call(s,n),s._$AM=n,s._$AP!==void 0&&(y=n._$AU)!==f._$AU&&s._$AP(y)}if(l!==o||d){let y=s._$AA;for(;y!==l;){const C=y.nextSibling;i.insertBefore(y,o),y=C}}}return s},Se=(n,e,s=n)=>(n._$AI(e,s),n),mn={},sr=(n,e=mn)=>n._$AH=e,nr=n=>n._$AH,or=n=>{var i;(i=n._$AP)==null||i.call(n,!1,!0);let e=n._$AA;const s=n._$AB.nextSibling;for(;e!==s;){const o=e.nextSibling;e.remove(),e=o}},yn=n=>{n._$AR()};/**
|
|
312
325
|
* @license
|
|
313
326
|
* Copyright 2017 Google LLC
|
|
314
327
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
315
|
-
*/const
|
|
328
|
+
*/const nt=(n,e)=>{var i;const s=n._$AN;if(s===void 0)return!1;for(const o of s)(i=o._$AO)==null||i.call(o,e,!1),nt(o,e);return!0},yt=n=>{let e,s;do{if((e=n._$AM)===void 0)break;s=e._$AN,s.delete(n),n=e}while((s==null?void 0:s.size)===0)},$i=n=>{for(let e;e=n._$AM;n=e){let s=e._$AN;if(s===void 0)e._$AN=s=new Set;else if(s.has(n))break;s.add(n),_n(e)}};function $n(n){this._$AN!==void 0?(yt(this),this._$AM=n,$i(this)):this._$AM=n}function wn(n,e=!1,s=0){const i=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(e)if(Array.isArray(i))for(let t=s;t<i.length;t++)nt(i[t],!1),yt(i[t]);else i!=null&&(nt(i,!1),yt(i));else nt(this,n)}const _n=n=>{n.type==Jt.CHILD&&(n._$AP??(n._$AP=wn),n._$AQ??(n._$AQ=$n))};class wi extends mt{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,s,i){super._$AT(e,s,i),$i(this),this.isConnected=e._$AU}_$AO(e,s=!0){var i,o;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(o=this.disconnected)==null||o.call(this)),s&&(nt(this,e),yt(this))}setValue(e){if(bn(this._$Ct))this._$Ct._$AI(e,this);else{const s=[...this._$Ct._$AH];s[this._$Ci]=e,this._$Ct._$AI(s,this,0)}}disconnected(){}reconnected(){}}/**
|
|
316
329
|
* @license
|
|
317
330
|
* Copyright 2020 Google LLC
|
|
318
331
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
319
|
-
*/const
|
|
332
|
+
*/const ot=()=>new Sn;let Sn=class{};const ar=new WeakMap,at=it(class extends wi{render(n){return P}update(n,[e]){var i;const s=e!==this.Y;return s&&this.Y!==void 0&&this.rt(void 0),(s||this.lt!==this.ct)&&(this.Y=e,this.ht=(i=n.options)==null?void 0:i.host,this.rt(this.ct=n.element)),P}rt(n){if(this.isConnected||(n=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let s=ar.get(e);s===void 0&&(s=new WeakMap,ar.set(e,s)),s.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),s.set(this.Y,n),n!==void 0&&this.Y.call(this.ht,n)}else this.Y.value=n}get lt(){var n,e;return typeof this.Y=="function"?(n=ar.get(this.ht??globalThis))==null?void 0:n.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),cr=class{constructor(e){return this.buffer=e,this.u8=new Uint8Array(e),new Proxy(this,{get(s,i){return s[i]?s[i]:s.getBit(i)}})}getBit(e){var s=this.u8[e>>3],i=e&7;return s>>7-i&1}setBit(e,s){var i=e&7;s?this.u8[e>>3]|=128>>i:this.u8[e>>3]&=~(128>>i)}get length(){return this.u8.byteLength*8}set(e,s){for(let i=s||0,o=0,t=e.length;o<t;i++,o++)this.setBit(i,e[o])}subarray(e,s){let i=[];e=e||0,s=s||this.length,s=s>this.length?this.length:s;for(let o=e;o<s;o++)i.push(this.getBit(o));return i}},_i=(n,e)=>{let s;return(...i)=>{clearTimeout(s),s=window.setTimeout(()=>n.apply(void 0,i),e)}},ct=n=>{var e;return(...s)=>{e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{n.apply(void 0,s)})}};var An=Object.defineProperty,Cn=Object.getOwnPropertyDescriptor,Ae=(n,e,s,i)=>{for(var o=i>1?void 0:i?Cn(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&An(e,s,o),o};const xn=["mousemove","click","dblclick","mousedown","mouseup","contextmenu"],$t={width:200,height:200},wt={width:10,height:10};h.BitDisplayCanvas=class extends K{constructor(){super(),this.arrayBuffer=new ArrayBuffer(0),this.frameWidth=100,this.scale=1,this.width=200,this.height=200,this.state={},this.yStart=0,this.xStart=0,this.refs={viewport:ot(),canvas:ot(),scrollDiv:ot()},this.color="#000000",this.onThemeChange=()=>{let i=getComputedStyle(this);this.color!=i.color&&(this.color=i.color,this.paint())},this.onResize=()=>{this.calculateViewport()},this.handleScroll=()=>{if(!this.refs.viewport.value)return;const i=this.getPxPerBit();this.yStart=this.refs.viewport.value.scrollTop?Math.floor(this.refs.viewport.value.scrollTop/i)+1:0,this.xStart=this.refs.viewport.value.scrollLeft?Math.floor(this.refs.viewport.value.scrollLeft/i)+1:0,this.paint()};let e=new ResizeObserver(this.onResize);e.dispose=()=>{this.resizeObserver.disconnect()},this.resizeObserver=e,this.addDisposableListener(document.body,"theme-change",this.onThemeChange);var s={};xn.forEach(i=>{this.addDisposableListener(this._canvas,i,ct(async o=>{o.stopImmediatePropagation(),o.stopPropagation(),o.preventDefault();var t=await this._canvas;let l=t.getBoundingClientRect(),f={x:Math.floor(Math.abs(o.clientX-l.left)),y:Math.floor(Math.abs(o.clientY-l.top))},d=this.canvasPositionToBit(f);if(i==="mousemove"&&s[i]==d)return;s[i]=d;let y="bit"+String(i).charAt(0).toUpperCase()+String(i).slice(1);if(d!=-1){let C=new CustomEvent(y,{detail:{bitIndex:d,position:f,nativeEvent:o}});this.dispatchEvent(C)}}))})}connectedCallback(){this.onResize(),super.connectedCallback(),this.registerDisposable(this.resizeObserver),this.resizeObserver.observe(this)}updated(e){e.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new cr(this.arrayBuffer));const s=["arrayBuffer","scale","frameWidth","width","height"];for(const i of s)if(e.has(i)){this.paint();return}}canvasPositionToBit(e){let s=Math.floor(e.x/this.scale),i=Math.floor(e.y/this.scale);return s>this.frameWidth-1?-1:this.yStart*this.frameWidth+this.xStart+(i*this.frameWidth+s)}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:e,_bitArray:s}=this;if(e<=0)return;this.calculateViewport();const{width:i=$t.width,height:o=$t.height}=this,t=this.getPxPerBit(),l=this.refs.canvas.value.getContext("2d");if(!l)return;this.state.scale!=t&&(l.reset(),l.scale(t,t));let f=getComputedStyle(this);l.fillStyle=f.color,l.clearRect(0,0,i,o);let d=0;for(let y=this.yStart*e+this.xStart,C=s.length;y<C;y++){let $=y%e-this.xStart;if(!($<0)){if(Math.floor($*t)>i){d++,y=d*e+this.yStart*e+this.xStart-1;continue}if(Math.floor(d*t)>o)break;s.getBit(y)===1&&l.fillRect($,d,1,1),(y+1)%e===0&&y>=e-1&&d++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:e,_bitArray:s}=this;if(this.refs.scrollDiv.value){var i=this.getPxPerBit();const o=s.length/e*i,t=e*i,l=this.refs.scrollDiv.value;l.style.width=t+"px",l.style.height=o+"px"}}render(){const{height:e=$t.height,width:s=$t.width}=this;return w`
|
|
320
333
|
<div
|
|
321
334
|
id="viewport"
|
|
322
|
-
${
|
|
335
|
+
${at(this.refs.viewport)}
|
|
323
336
|
@scroll=${this.handleScroll}
|
|
324
|
-
style=${`width:${
|
|
337
|
+
style=${`width:${s+wt.width}px;height:${e+wt.height}px;overflow:auto;position:relative`}
|
|
325
338
|
>
|
|
326
339
|
<div
|
|
327
340
|
id="fakescrolldiv"
|
|
328
|
-
${
|
|
341
|
+
${at(this.refs.scrollDiv)}
|
|
329
342
|
>
|
|
330
343
|
</div>
|
|
331
344
|
</div>
|
|
332
345
|
<canvas
|
|
333
|
-
${
|
|
334
|
-
width=${
|
|
346
|
+
${at(this.refs.canvas)}
|
|
347
|
+
width=${s}
|
|
335
348
|
height=${e}
|
|
336
349
|
></canvas>
|
|
337
|
-
`}},h.BitDisplayCanvas.styles=
|
|
350
|
+
`}},h.BitDisplayCanvas.styles=F`
|
|
338
351
|
:host{
|
|
339
352
|
position: relative;
|
|
340
353
|
--border-radius: var(--spectric-border-radius,4em);
|
|
@@ -358,8 +371,8 @@ opacity:1
|
|
|
358
371
|
background-color:var(--background-color);
|
|
359
372
|
}
|
|
360
373
|
::-webkit-scrollbar {
|
|
361
|
-
height: ${
|
|
362
|
-
width: ${
|
|
374
|
+
height: ${wt.height}px;
|
|
375
|
+
width: ${wt.width}px;
|
|
363
376
|
|
|
364
377
|
}
|
|
365
378
|
|
|
@@ -430,7 +443,7 @@ opacity:1
|
|
|
430
443
|
|
|
431
444
|
}
|
|
432
445
|
|
|
433
|
-
`,
|
|
446
|
+
`,Ae([v({type:Object,attribute:!1})],h.BitDisplayCanvas.prototype,"arrayBuffer",2),Ae([v({type:Number})],h.BitDisplayCanvas.prototype,"frameWidth",2),Ae([v({type:Number})],h.BitDisplayCanvas.prototype,"scale",2),Ae([v({type:Number})],h.BitDisplayCanvas.prototype,"width",2),Ae([v({type:Number})],h.BitDisplayCanvas.prototype,"height",2),Ae([st("canvas")],h.BitDisplayCanvas.prototype,"_canvas",2),h.BitDisplayCanvas=Ae([T("spectric-bit-display")],h.BitDisplayCanvas);const En=F`.spectric-header {
|
|
434
447
|
display: flex;
|
|
435
448
|
justify-content: space-between;
|
|
436
449
|
align-items: center;
|
|
@@ -465,7 +478,7 @@ opacity:1
|
|
|
465
478
|
color: #333;
|
|
466
479
|
font-size: 14px;
|
|
467
480
|
}
|
|
468
|
-
`;var
|
|
481
|
+
`;var kn=Object.defineProperty,Pn=Object.getOwnPropertyDescriptor,_t=(n,e,s,i)=>{for(var o=i>1?void 0:i?Pn(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&kn(e,s,o),o};h.Header=class extends z{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",e))},this.onLogin=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",e))},this.onCreateAccount=()=>{const e={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",e))}}render(){return w`
|
|
469
482
|
<header>
|
|
470
483
|
<div class="spectric-header">
|
|
471
484
|
<div style="flex-grow:1;">
|
|
@@ -473,10 +486,10 @@ opacity:1
|
|
|
473
486
|
<h1><slot name="name"></slot></h1>
|
|
474
487
|
<slot name="center"></slot>
|
|
475
488
|
</div>
|
|
476
|
-
${this.showLoginButton!==!1?
|
|
489
|
+
${this.showLoginButton!==!1?w`
|
|
477
490
|
<div>
|
|
478
|
-
${this.username&&this.username!==""?
|
|
479
|
-
${this.showCreateAccount!==!1?
|
|
491
|
+
${this.username&&this.username!==""?w`<spectric-button variant="secondary" size="small" @click=${this.onLogout}>Log out</spectric-button>`:w`
|
|
492
|
+
${this.showCreateAccount!==!1?w`<spectric-button variant="text" size="small" @click=${this.onCreateAccount}>Sign up</spectric-button>`:null}
|
|
480
493
|
<spectric-button variant="primary" size="small" @click=${this.onLogin}>Log in</spectric-button>`}
|
|
481
494
|
|
|
482
495
|
|
|
@@ -484,12 +497,12 @@ opacity:1
|
|
|
484
497
|
<slot name="end"></slot>
|
|
485
498
|
</div>
|
|
486
499
|
</header>
|
|
487
|
-
`}},h.Header.styles=
|
|
488
|
-
<header style=${
|
|
500
|
+
`}},h.Header.styles=En,_t([v({type:Boolean,reflect:!0})],h.Header.prototype,"showCreateAccount",2),_t([v({type:Boolean,reflect:!0})],h.Header.prototype,"showLoginButton",2),_t([v({type:String,reflect:!0})],h.Header.prototype,"username",2),h.Header=_t([T("spectric-header")],h.Header);var Tn=Object.defineProperty,On=Object.getOwnPropertyDescriptor,Le=(n,e,s,i)=>{for(var o=i>1?void 0:i?On(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&Tn(e,s,o),o};const Dn={display:"flex",alignItems:"center",backgroundColor:"black",color:"white",textAlign:"center"};let Ce=class extends z{constructor(){super(...arguments),this.dismissable=!1,this.text="",this.bannerId="",this.headerStyle={},this._dismissed=!1,this.onDismiss=n=>{n.preventDefault(),n.stopPropagation();const e={bubbles:!0,composed:!0};this._dismissed=!0;let{bannerId:s,text:i,headerStyle:o,dismissable:t}=this;this.dispatchEvent(new CustomEvent("bannerDismissed",{detail:{bannerId:s,text:i,headerStyle:o,dismissable:t},...e}))}}render(){if(!this._dismissed)return w`
|
|
501
|
+
<header style=${er({...Dn,...this.headerStyle})}>
|
|
489
502
|
<div style="flex-grow:1"><slot name="text">${this.text}</slot><slot></slot></div>
|
|
490
|
-
${this.dismissable?
|
|
503
|
+
${this.dismissable?w`<spectric-button size="small" @click=${this.onDismiss}>X</spectric-button>`:null}
|
|
491
504
|
</header>
|
|
492
|
-
`}};
|
|
505
|
+
`}};Le([v({type:Boolean,reflect:!0})],Ce.prototype,"dismissable",2),Le([v({type:String,reflect:!0})],Ce.prototype,"text",2),Le([v({type:String,reflect:!0})],Ce.prototype,"bannerId",2),Le([v({type:Object})],Ce.prototype,"headerStyle",2),Le([v({state:!0,type:Boolean,attribute:!1})],Ce.prototype,"_dismissed",2),Ce=Le([T("spectric-banner")],Ce);const Ln=F`
|
|
493
506
|
|
|
494
507
|
:host {
|
|
495
508
|
height:100vh;
|
|
@@ -649,76 +662,86 @@ article{
|
|
|
649
662
|
* @license
|
|
650
663
|
* Copyright 2018 Google LLC
|
|
651
664
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
652
|
-
*/const
|
|
665
|
+
*/const lr=n=>n??P;class pr extends wi{constructor(){super(...arguments),this.prevData={}}render(e){return P}update(e,[s]){var i;this.element!==e.element&&(this.element=e.element),this.host=((i=e.options)==null?void 0:i.host)||this.element,this.apply(s),this.groom(s),this.prevData={...s}}apply(e){if(!e)return;const{element:s}=this;for(const i in e){const o=e[i];s[i]!==o&&(s[i]=o)}}groom(e){const{prevData:s,element:i}=this;if(s)for(const o in s)(!e||!(o in e)&&i[o]===s[o])&&(i[o]=void 0)}}const xe=it(pr);var ur=(n=>(n.None="none",n.Uscui="us.cui",n.Usclassified="us.classified",n.Usunclassified="us.unclassified",n.Usconfidential="us.confidential",n.Ussecret="us.secret",n.Ustopsecret="us.topsecret",n.UstopsecretSi="us.topsecret.si",n.Uknotset="uk.notset",n.Ukofficial="uk.official",n.Uksecret="uk.secret",n.Uktopsecret="uk.topsecret",n.Caprotected_a="ca.protected_a",n.Caprotected_b="ca.protected_b",n.Caprotected_c="ca.protected_c",n.Caconfidential="ca.confidential",n.Casecret="ca.secret",n.Catopsecret="ca.topsecret",n.Auunofficial="au.unofficial",n.Auofficial="au.official",n.Auofficialsensitive="au.officialsensitive",n.Auconfidential="au.confidential",n.Ausecret="au.secret",n.Autopsecret="au.topsecret",n))(ur||{});const St={none:{},"us.cui":{color:"white",backgroundColor:"#3D1E5A",content:"Controlled Unclassified Information"},"us.classified":{color:"white",backgroundColor:"#723D9A",content:"Classified"},"us.unclassified":{color:"white",backgroundColor:"#007A33",content:"Unclassified"},"us.confidential":{color:"white",backgroundColor:"#0033A0",content:"Confidential"},"us.secret":{color:"white",backgroundColor:"#C8102E",content:"Secret"},"us.topsecret":{color:"white",backgroundColor:"#FF671F",content:"Top Secret"},"us.topsecret.si":{color:"black",backgroundColor:"#F7EA48",content:"Top Secret//SI"},"uk.notset":{color:"white",backgroundColor:" #616161",content:"Not Set"},"uk.official":{color:"white",backgroundColor:"#2B71C7",content:"For Offical Use"},"uk.secret":{color:"white",backgroundColor:"#F39C2C",content:"Secret"},"uk.topsecret":{color:"white",backgroundColor:"#AA0000",content:"Top Secret"},"ca.protected_a":{color:"white",backgroundColor:"#227ABC",content:"PROTECTED A"},"ca.protected_b":{color:"white",backgroundColor:"#900FB5",content:"PROTECTED B"},"ca.protected_c":{color:"white",backgroundColor:"#460FB5",content:"PROTECTED C"},"ca.confidential":{color:"white",backgroundColor:"#0033a0",content:"Confidential"},"ca.secret":{color:"white",backgroundColor:"#c8102e",content:"Secret"},"ca.topsecret":{color:"white",backgroundColor:"#ff671f",content:"Top Secret"},"au.unofficial":{color:"#666",backgroundColor:"#ffffffff",content:"Unofficial"},"au.official":{color:"#666",backgroundColor:"#ffffffff",content:"Official"},"au.officialsensitive":{color:"#666",backgroundColor:"#ffffffff",content:"Official Sentitive"},"au.confidential":{color:"white",backgroundColor:"#4F81BD",content:"Confidential"},"au.secret":{color:"black",backgroundColor:" #E5B8B7",content:"Secret"},"au.topsecret":{color:"black",backgroundColor:"#AA0000",content:"Top Secret"}};var zn=Object.defineProperty,Nn=Object.getOwnPropertyDescriptor,G=(n,e,s,i)=>{for(var o=i>1?void 0:i?Nn(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&zn(e,s,o),o};h.SpectricPage=class extends z{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=ur.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!St[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=ur.None);const e=this.classificationLevel?this.classificationText||St[this.classificationLevel].content:"",s=this.showHeader?w`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${lr(this.username)}>
|
|
653
666
|
<slot name="branding" slot="branding"></slot>
|
|
654
667
|
<slot name="name" slot="name"></slot>
|
|
655
668
|
<slot name="center" slot="center"></slot>
|
|
656
669
|
<slot name="end" slot="end"></slot>
|
|
657
|
-
</spectric-header>`:null;return
|
|
658
|
-
${this.classificationLevel&&e?
|
|
670
|
+
</spectric-header>`:null;return w`
|
|
671
|
+
${this.classificationLevel&&e?w`
|
|
659
672
|
<!-- Classification Banner -->
|
|
660
|
-
<spectric-banner ${
|
|
673
|
+
<spectric-banner ${xe({text:e,headerStyle:St[this.classificationLevel]})}></spectric-banner>
|
|
661
674
|
`:null}
|
|
662
|
-
<spectric-theme theme=${
|
|
663
|
-
${this.notifications?this.notifications.map(i=>
|
|
664
|
-
${this.headerSticky?
|
|
675
|
+
<spectric-theme theme=${lr(this.theme)}>
|
|
676
|
+
${this.notifications?this.notifications.map(i=>w`<spectric-banner ${xe(i)} ></spectric-banner>`):null}
|
|
677
|
+
${this.headerSticky?s:null}
|
|
665
678
|
<article>
|
|
666
|
-
${this.headerSticky?null:
|
|
679
|
+
${this.headerSticky?null:s}
|
|
667
680
|
<section class="spectric-page">
|
|
668
681
|
<slot name="content"></slot>
|
|
669
682
|
<slot></slot>
|
|
670
683
|
</section>
|
|
671
684
|
</article>
|
|
672
685
|
</spectric-theme>
|
|
673
|
-
${this.classificationLevel&&e?
|
|
674
|
-
|
|
675
|
-
`}},h.SpectricPage.styles=
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
${this.
|
|
703
|
-
|
|
686
|
+
${this.classificationLevel&&e?w`<spectric-banner ${xe({text:e,headerStyle:St[this.classificationLevel]})}></spectric-banner>`:null}
|
|
687
|
+
|
|
688
|
+
`}},h.SpectricPage.styles=Ln,G([v({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showHeader",2),G([v({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"headerSticky",2),G([v({type:String,reflect:!0})],h.SpectricPage.prototype,"classificationLevel",2),G([v({type:String,reflect:!0})],h.SpectricPage.prototype,"classificationText",2),G([v({type:Array,reflect:!0})],h.SpectricPage.prototype,"notifications",2),G([v({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showCreateAccount",2),G([v({type:Boolean,reflect:!0})],h.SpectricPage.prototype,"showLoginButton",2),G([v({type:String,reflect:!0})],h.SpectricPage.prototype,"username",2),G([v({type:String,reflect:!0})],h.SpectricPage.prototype,"theme",2),h.SpectricPage=G([T("spectric-page")],h.SpectricPage);var Bn=Object.defineProperty,Mn=Object.getOwnPropertyDescriptor,O=(n,e,s,i)=>{for(var o=i>1?void 0:i?Mn(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&Bn(e,s,o),o},hr=(n=>(n.Text="text",n.TextArea="text-area",n.number="number",n.color="color",n.date="date",n.datePopup="popup-date",n.datetime="datetime-local",n.email="email",n.file="file",n.hidden="hidden",n.password="password",n.checkbox="checkbox",n.range="range",n))(hr||{});h.SpectricInput=class extends z{constructor(){super(...arguments),this.files=null,this.placeholder="",this.readonly=!1,this.variant="text",this.disabled=!1,this.label="",this.hidePasswordLabel="Hide",this.showPasswordLabel="Show",this.showPasswordVisibilityToggle=!0,this.helperText="",this.invalid=!1,this.required=!1,this.invalidText="",this.name="",this.pattern="",this.maxCount=0,this._value="",this._showPassword=!1,this.autocomplete="off",this._handleInput=({target:e})=>{const s=e;this.variant=="file"?this.files=s.files:this.value=s.value,this.invalid=!s.validity.valid},this.handleTogglePasswordVisibility=()=>{this._showPassword=!this._showPassword,this.requestUpdate()}}createRenderRoot(){return this}get selectionStart(){return this._input?this._input.selectionStart:null}get value(){return this._input?this.variant=="number"?parseFloat(this._input.value):this._input.value:this._value}set value(e){const s=this._value;this._value=e,this.requestUpdate("value",s),this._input&&(this._input.value=String(e))}blur(){this._input&&this._input.blur()}focus(e){this._input&&(this._input.blur(),this._input.focus(e))}setSelectionRange(e,s,i="none"){this._input&&this._input.setSelectionRange(e,s,i)}updated(e){e.has("checked")&&this.dispatchEvent(new Event("change",{bubbles:!0}))}_handleChange(e){e.stopPropagation(),this.variant==="file"?this.files=e.target.files:this.value=e.target.value,this.dispatchEvent(new Event("change",{bubbles:!0}))}render(){const e=w`<spectric-calendar
|
|
689
|
+
.popup=${this.variant==="popup-date"}
|
|
690
|
+
@select=${s=>{var i;this.value=s.detail.toISOString(),(i=this.querySelector("spectric-popover"))==null||i.hidePopover()}}>
|
|
691
|
+
</spectric-calendar>`;switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"popup-date":case"datetime-local":case"file":case"range":return w`
|
|
692
|
+
<div class="inputWrapper">
|
|
693
|
+
<div class="text-input__label-helper-wrapper">
|
|
694
|
+
<div class="--text-input__label-wrapper">
|
|
695
|
+
${this.label}
|
|
696
|
+
${this.maxCount>0&&this._value?`${this._value.length}/${this.maxCount}`:null}
|
|
697
|
+
</div>
|
|
698
|
+
</div>
|
|
699
|
+
<div class="fieldwrapper">
|
|
700
|
+
<div ?data-invalid="${this.invalid}" class="inputContainer">
|
|
701
|
+
${this.variant==="date"?e:null}
|
|
702
|
+
<input
|
|
703
|
+
?data-invalid="${this.invalid}"
|
|
704
|
+
?disabled="${this.disabled}"
|
|
705
|
+
aria-describedby="helper-text"
|
|
706
|
+
id="input"
|
|
707
|
+
name="${ze(this.name)}"
|
|
708
|
+
pattern="${ze(this.pattern)}"
|
|
709
|
+
placeholder="${ze(this.placeholder)}"
|
|
710
|
+
autocomplete="${ze(this.autocomplete)}"
|
|
711
|
+
?readonly="${this.readonly}"
|
|
712
|
+
?required="${this.required}"
|
|
713
|
+
type="${ze(this.variant!=="password"?this.variant!=="date"?this.variant:"text":this._showPassword?"text":"password")}"
|
|
714
|
+
.value="${this._value}"
|
|
715
|
+
maxlength="${ze(this.maxCount>0?this.maxCount:void 0)}"
|
|
716
|
+
@input="${this._handleInput}"
|
|
717
|
+
@change=${this._handleChange}
|
|
718
|
+
/>
|
|
719
|
+
|
|
720
|
+
${this.variant==="popup-date"?e:null}
|
|
721
|
+
${this.variant==="password"&&this.showPasswordVisibilityToggle?w`
|
|
722
|
+
<spectric-button
|
|
723
|
+
icon
|
|
724
|
+
class="input-button-right"
|
|
704
725
|
size="small"
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
726
|
+
type="button"
|
|
727
|
+
?disabled="${this.disabled}"
|
|
728
|
+
@click=${this.handleTogglePasswordVisibility}
|
|
729
|
+
>
|
|
730
|
+
${this._showPassword?this.hidePasswordLabel:this.showPasswordLabel}
|
|
731
|
+
</spectric-button>
|
|
732
|
+
`:null}
|
|
733
|
+
</div>
|
|
734
|
+
<div
|
|
735
|
+
id="helper-text"
|
|
736
|
+
class="${this.helperText||this.invalid?"":"hidden"}"
|
|
737
|
+
>
|
|
738
|
+
<slot name="helper-text">
|
|
739
|
+
${this.invalid?this.invalidText:this.helperText}
|
|
740
|
+
</slot>
|
|
719
741
|
</div>
|
|
720
742
|
</div>
|
|
721
|
-
|
|
743
|
+
</div>
|
|
744
|
+
`;case"color":return w`<div class="inputWrapper">
|
|
722
745
|
<div class="text-input__label-helper-wrapper">
|
|
723
746
|
<div class="--text-input__label-wrapper">
|
|
724
747
|
${this.label} ${this.maxCount>0&&this._value?`${this._value.length}/${this.maxCount}`:null}
|
|
@@ -726,7 +749,10 @@ article{
|
|
|
726
749
|
</div>
|
|
727
750
|
<div class="fieldwrapper">
|
|
728
751
|
<div ?data-invalid="${this.invalid}" class="inputContainer">
|
|
729
|
-
<
|
|
752
|
+
<input type="hidden" .value=${String(this.value)} > </input>
|
|
753
|
+
<spectric-colorpicker
|
|
754
|
+
@cancel=${s=>{this.value=s.target.value}}
|
|
755
|
+
@change=${s=>{s.stopPropagation(),this.value=s.target.value,this._handleChange(s)}} .value=${String(this.value)}></spectric-colorpicker>
|
|
730
756
|
</div>
|
|
731
757
|
<div
|
|
732
758
|
id="helper-text"
|
|
@@ -736,7 +762,7 @@ article{
|
|
|
736
762
|
</div>
|
|
737
763
|
|
|
738
764
|
</div>
|
|
739
|
-
</div>`;case"hidden":return
|
|
765
|
+
</div>`;case"hidden":return w`<input type="hidden" />`;case"checkbox":return w`
|
|
740
766
|
<div class="checkbox">
|
|
741
767
|
<spectric-button
|
|
742
768
|
.tooltip=${this.helperText}
|
|
@@ -745,11 +771,11 @@ article{
|
|
|
745
771
|
${this.label}
|
|
746
772
|
</div>
|
|
747
773
|
</label>
|
|
748
|
-
`}return`Not yet implemented ${this.variant}`}},
|
|
749
|
-
`);super(o),this.name="DQLSyntaxError",this.shortMessage=i}}function Ne(
|
|
750
|
-
`},
|
|
751
|
-
`?(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),p++;return Pt[r]=a,a}function Ot(r,a){var p=_s(r),u=_s(a);return{start:{offset:r,line:p.line,column:p.column},end:{offset:a,line:u.line,column:u.column}}}function m(r){c<J||(c>J&&(J=c,Br=[]),Br.push(r))}function Ss(r,a,p,u){function v(L){var z=1;for(L.sort(function(fe,W){return fe.description<W.description?-1:fe.description>W.description?1:0});z<L.length;)L[z-1]===L[z]?L.splice(z,1):z++}function _(L,z){function fe(pl){function Rt(ie){return ie.charCodeAt(0).toString(16).toUpperCase()}return pl.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(ie){return"\\x0"+Rt(ie)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ie){return"\\x"+Rt(ie)}).replace(/[\u0100-\u0FFF]/g,function(ie){return"\\u0"+Rt(ie)}).replace(/[\u1000-\uFFFF]/g,function(ie){return"\\u"+Rt(ie)})}var W=new Array(L.length),Hs,Us,lt;for(lt=0;lt<L.length;lt++)W[lt]=L[lt].description;return Hs=L.length>1?W.slice(0,-1).join(", ")+" or "+W[L.length-1]:W[0],Us=z?'"'+fe(z)+'"':"end of input","Expected "+Hs+" but "+Us+" found."}return a!==null&&v(a),new e(r!==null?r:_(a,p),a,p,u)}function As(){var r,a,p,u;for(r=c,a=[],p=w();p!==t;)a.push(p),p=w();return a!==t?(p=Dt(),p===t&&(p=null),p!==t?(u=Bt(),u!==t?(A=r,a=f(p,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r}function Dt(){var r,a,p,u;return r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=Wc(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=c,a=jr(),a!==t?(p=Lt(),p!==t?(u=Dt(),u!==t?(A=r,a=x(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=jr())),r}function jr(){var r,a,p,u;return r=c,a=xs(),a!==t?(p=Nt(),p!==t?(u=jr(),u!==t?(A=r,a=$(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=xs()),r}function xs(){var r,a,p;return r=c,a=Hr(),a!==t?(p=Cs(),p!==t?(A=r,a=E(p),r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=Cs()),r}function Cs(){var r,a,p,u,v,_;if(r=c,i.charCodeAt(c)===40?(a=C,c++):(a=t,g===0&&m(k)),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Dt(),u!==t?(v=Bt(),v!==t?(i.charCodeAt(c)===41?(_=N,c++):(_=t,g===0&&m(R)),_!==t?(A=r,a=M(u,v),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r===t&&(r=jc()),r}function jc(){var r,a,p,u,v,_,L,z,fe,W;if(r=c,a=Rr(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(c)===58?(u=G,c++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();if(v!==t)if(i.charCodeAt(c)===123?(_=Me,c++):(_=t,g===0&&m(kr)),_!==t){for(L=[],z=w();z!==t;)L.push(z),z=w();L!==t?(z=Dt(),z!==t?(fe=Bt(),fe!==t?(i.charCodeAt(c)===125?(W=Pr,c++):(W=t,g===0&&m(Tr)),W!==t?(A=r,a=Oa(a,z,fe),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r===t&&(r=Rc()),r}function Rc(){var r;return r=Mc(),r===t&&(r=Ic(),r===t&&(r=Hc())),r}function Rr(){var r;return g++,r=Ur(),g--,r===t&&g===0&&m(Da),r}function Mc(){var r,a,p,u,v,_;if(r=c,a=Rr(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(u=Ds(),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Ur(),_!==t?(A=r,a=La(a,u,_),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Ic(){var r,a,p,u,v,_;if(r=c,a=Rr(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(c)===58?(u=G,c++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Mr(),_!==t?(A=r,a=Na(a,_),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Hc(){var r,a;return r=c,a=Ps(),a!==t&&(A=r,a=za(a)),r=a,r}function Mr(){var r,a,p,u,v,_;if(r=c,i.charCodeAt(c)===40?(a=C,c++):(a=t,g===0&&m(k)),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Es(),u!==t?(v=Bt(),v!==t?(i.charCodeAt(c)===41?(_=N,c++):(_=t,g===0&&m(R)),_!==t?(A=r,a=Ba(u,v),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r===t&&(r=Ps()),r}function Es(){var r,a,p,u;return r=c,a=Ir(),a!==t?(p=Lt(),p!==t?(u=Es(),u!==t?(A=r,a=ja(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=Ir()),r}function Ir(){var r,a,p,u;return r=c,a=ks(),a!==t?(p=Nt(),p!==t?(u=Ir(),u!==t?(A=r,a=Ra(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=ks()),r}function ks(){var r,a,p;return r=c,a=Hr(),a!==t?(p=Mr(),p!==t?(A=r,a=Ma(p),r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=Mr()),r}function Ps(){var r,a;return g++,r=c,a=zt(),a!==t&&(A=r,a=Ha(a)),r=a,r===t&&(r=c,a=Ts(),a!==t&&(A=r,a=Ua(a)),r=a),g--,r===t&&(a=t,g===0&&m(Ia)),r}function Lt(){var r,a,p,u,v;if(g++,r=c,a=[],p=w(),p!==t)for(;p!==t;)a.push(p),p=w();else a=t;if(a!==t)if(i.substr(c,2).toLowerCase()===Bi?(p=i.substr(c,2),c+=2):(p=t,g===0&&m(ji)),p!==t){if(u=[],v=w(),v!==t)for(;v!==t;)u.push(v),v=w();else u=t;u!==t?(a=[a,p,u],r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r===t&&(r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=Ls(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t)),g--,r===t&&(a=t,g===0&&m(Fa)),r}function Nt(){var r,a,p,u,v;if(g++,r=c,a=[],p=w(),p!==t)for(;p!==t;)a.push(p),p=w();else a=t;if(a!==t)if(i.substr(c,3).toLowerCase()===Ri?(p=i.substr(c,3),c+=3):(p=t,g===0&&m(Mi)),p!==t){if(u=[],v=w(),v!==t)for(;v!==t;)u.push(v),v=w();else u=t;u!==t?(a=[a,p,u],r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r===t&&(r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=Ns(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t)),g--,r===t&&(a=t,g===0&&m(Qa)),r}function Hr(){var r,a,p,u;if(g++,r=c,i.substr(c,3).toLowerCase()===Ii?(a=i.substr(c,3),c+=3):(a=t,g===0&&m(Hi)),a!==t){if(p=[],u=w(),u!==t)for(;u!==t;)p.push(u),u=w();else p=t;p!==t?(a=[a,p],r=a):(c=r,r=t)}else c=r,r=t;return r===t&&(r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=zs(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t)),g--,r===t&&(a=t,g===0&&m(qa)),r}function Ur(){var r;return g++,r=zt(),r===t&&(r=Ts()),g--,r===t&&g===0&&m(Wa),r}function zt(){var r,a,p,u,v,_;if(r=c,i.charCodeAt(c)===34?(a=st,c++):(a=t,g===0&&m(nt)),a!==t){for(p=[],u=Ue();u!==t;)p.push(u),u=Ue();if(p!==t)if(u=ct(),u!==t){for(v=[],_=Ue();_!==t;)v.push(_),_=Ue();v!==t?(i.charCodeAt(c)===34?(_=st,c++):(_=t,g===0&&m(nt)),_!==t?(A=r,a=Or(p,u,v),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;if(r===t)if(r=c,i.charCodeAt(c)===34?(a=st,c++):(a=t,g===0&&m(nt)),a!==t){for(p=[],u=Ue();u!==t;)p.push(u),u=Ue();p!==t?(i.charCodeAt(c)===34?(u=st,c++):(u=t,g===0&&m(nt)),u!==t?(A=r,a=Va(p),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r}function Ue(){var r,a,p;return r=Fr(),r===t&&(r=c,i.charCodeAt(c)===92?(a=ot,c++):(a=t,g===0&&m(at)),a!==t?(Ya.test(i.charAt(c))?(p=i.charAt(c),c++):(p=t,g===0&&m(Za)),p!==t?(A=r,a=Ct(p),r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=c,a=c,g++,p=ct(),g--,p===t?a=void 0:(c=a,a=t),a!==t?(Ka.test(i.charAt(c))?(p=i.charAt(c),c++):(p=t,g===0&&m(Xa)),p!==t?(A=r,a=Ct(p),r=a):(c=r,r=t)):(c=r,r=t))),r}function Ts(){var r,a,p,u,v;for(r=c,a=[],p=Fe();p!==t;)a.push(p),p=Fe();if(a!==t)if(p=ct(),p!==t){for(u=[],v=Fe();v!==t;)u.push(v),v=Fe();u!==t?(A=r,a=Or(a,p,u),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;if(r===t){if(r=c,a=[],p=Fe(),p!==t)for(;p!==t;)a.push(p),p=Fe();else a=t;a!==t&&(A=r,a=Ga(a)),r=a}return r}function Fe(){var r,a,p,u,v;return r=Fr(),r===t&&(r=Fc(),r===t&&(r=Qc(),r===t&&(r=Uc(),r===t&&(r=c,a=c,g++,p=Os(),g--,p===t?a=void 0:(c=a,a=t),a!==t?(p=c,g++,u=qc(),g--,u===t?p=void 0:(c=p,p=t),p!==t?(u=c,g++,v=ct(),g--,v===t?u=void 0:(c=u,u=t),u!==t?(i.length>c?(v=i.charAt(c),c++):(v=t,g===0&&m(Ui)),v!==t?(A=r,a=Ct(v),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t))))),r}function Uc(){var r,a;return r=c,i.charCodeAt(c)===42?(a=Et,c++):(a=t,g===0&&m(kt)),a!==t&&(A=r,a=Ja()),r=a,r}function Bt(){var r,a,p,u,v;for(r=c,a=[],p=w();p!==t;)a.push(p),p=w();if(a!==t)if(p=ct(),p!==t){for(u=[],v=w();v!==t;)u.push(v),v=w();u!==t?(A=r,a=Or(a,p,u),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;if(r===t)for(r=[],a=w();a!==t;)r.push(a),a=w();return r}function Fr(){var r,a;return r=c,i.substr(c,2)===Fi?(a=Fi,c+=2):(a=t,g===0&&m(ec)),a!==t&&(A=r,a=tc()),r=a,r===t&&(r=c,i.substr(c,2)===Qi?(a=Qi,c+=2):(a=t,g===0&&m(rc)),a!==t&&(A=r,a=ic()),r=a,r===t&&(r=c,i.substr(c,2)===qi?(a=qi,c+=2):(a=t,g===0&&m(sc)),a!==t&&(A=r,a=nc()),r=a)),r}function Fc(){var r,a,p;return r=c,i.charCodeAt(c)===92?(a=ot,c++):(a=t,g===0&&m(at)),a!==t?(p=Os(),p!==t?(A=r,a=Ct(p),r=a):(c=r,r=t)):(c=r,r=t),r}function Qc(){var r,a,p;return r=c,i.charCodeAt(c)===92?(a=ot,c++):(a=t,g===0&&m(at)),a!==t?(i.substr(c,2).toLowerCase()===Bi?(p=i.substr(c,2),c+=2):(p=t,g===0&&m(ji)),p===t&&(i.substr(c,3).toLowerCase()===Ri?(p=i.substr(c,3),c+=3):(p=t,g===0&&m(Mi)),p===t&&(i.substr(c,3).toLowerCase()===Ii?(p=i.substr(c,3),c+=3):(p=t,g===0&&m(Hi)))),p!==t?(A=r,a=oc(p),r=a):(c=r,r=t)):(c=r,r=t),r}function qc(){var r;return r=Lt(),r===t&&(r=Nt(),r===t&&(r=Hr())),r}function Os(){var r;return ac.test(i.charAt(c))?(r=i.charAt(c),c++):(r=t,g===0&&m(cc)),r}function Ds(){var r,a;return r=c,i.substr(c,2)===Wi?(a=Wi,c+=2):(a=t,g===0&&m(lc)),a!==t&&(A=r,a=pc()),r=a,r===t&&(r=c,i.substr(c,2)===Vi?(a=Vi,c+=2):(a=t,g===0&&m(uc)),a!==t&&(A=r,a=hc()),r=a,r===t&&(r=c,i.charCodeAt(c)===60?(a=Yi,c++):(a=t,g===0&&m(Zi)),a!==t&&(A=r,a=dc()),r=a,r===t&&(r=c,i.charCodeAt(c)===62?(a=Ki,c++):(a=t,g===0&&m(Xi)),a!==t&&(A=r,a=fc()),r=a))),r}function w(){var r;return g++,vc.test(i.charAt(c))?(r=i.charAt(c),c++):(r=t,g===0&&m(bc)),g--,r===t&&g===0&&m(gc),r}function ct(){var r,a,p;return r=c,A=c,a=mc(),a?a=void 0:a=t,a!==t?(i.substr(c,14)===Gi?(p=Gi,c+=14):(p=t,g===0&&m(yc)),p!==t?(A=r,a=$c(),r=a):(c=r,r=t)):(c=r,r=t),r}function Ls(){var r,a,p,u,v;for(r=c,a=[],p=w();p!==t;)a.push(p),p=w();if(a!==t)if(i.substr(c,2)===Ji?(p=Ji,c+=2):(p=t,g===0&&m(wc)),p!==t){for(u=[],v=w();v!==t;)u.push(v),v=w();u!==t?(A=r,a=_c(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Ns(){var r,a,p,u,v;for(r=c,a=[],p=w();p!==t;)a.push(p),p=w();if(a!==t)if(i.substr(c,2)===es?(p=es,c+=2):(p=t,g===0&&m(Sc)),p!==t){for(u=[],v=w();v!==t;)u.push(v),v=w();u!==t?(A=r,a=ts(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r===t&&(r=c,i.charCodeAt(c)===43?(a=rs,c++):(a=t,g===0&&m(is)),a!==t&&(A=r,a=ts()),r=a),r}function zs(){var r,a;return r=c,i.charCodeAt(c)===45?(a=ss,c++):(a=t,g===0&&m(ns)),a!==t&&(A=r,a=os()),r=a,r===t&&(r=c,i.charCodeAt(c)===33?(a=as,c++):(a=t,g===0&&m(cs)),a!==t&&(A=r,a=os()),r=a),r}function Wc(){var r;return r=Vc(),r===t&&(r=Bs(),r===t&&(r=Yc())),r}function Vc(){var r,a,p,u,v,_;if(r=c,a=Qe(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(c)===58?(u=G,c++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Bs(),_!==t?(a=[a,p,u,v,_],r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Bs(){var r;return r=Zc(),r===t&&(r=Qr(),r===t&&(r=Kc(),r===t&&(r=Xc(),r===t&&(r=Gc(),r===t&&(r=Jc()))))),r}function Yc(){var r,a,p,u,v,_;if(r=c,i.substr(c,8)===ls?(a=ls,c+=8):(a=t,g===0&&m(Ac)),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();if(p!==t)if(i.charCodeAt(c)===58?(u=G,c++):(u=t,g===0&&m(U)),u!==t){for(v=[],_=w();_!==t;)v.push(_),_=w();v!==t?(_=Qe(),_!==t?(A=r,a=xc(),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Zc(){var r,a,p,u,v,_,L;if(r=c,a=Ds(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Qe(),u!==t?(A=r,a=ps(),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;if(r===t)if(r=c,a=rl(),a!==t){for(p=[],u=w();u!==t;)p.push(u),u=w();p!==t?(u=Qe(),u!==t?(v=Ms(),v!==t?(_=Qe(),_!==t?(L=il(),L!==t?(A=r,a=ps(),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r}function Qr(){var r,a,p,u,v;for(r=c,a=[],p=jt(),p===t&&(i.charCodeAt(c)===42?(p=Et,c++):(p=t,g===0&&m(kt)));p!==t;)a.push(p),p=jt(),p===t&&(i.charCodeAt(c)===42?(p=Et,c++):(p=t,g===0&&m(kt)));if(a!==t)if(i.charCodeAt(c)===63?(p=us,c++):(p=t,g===0&&m(hs)),p!==t){for(u=[],v=Qr();v!==t;)u.push(v),v=Qr();u!==t?(A=r,a=Cc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Kc(){var r,a,p,u;if(r=c,i.charCodeAt(c)===47?(a=Dr,c++):(a=t,g===0&&m(Lr)),a!==t){for(p=[],ds.test(i.charAt(c))?(u=i.charAt(c),c++):(u=t,g===0&&m(fs));u!==t;)p.push(u),ds.test(i.charAt(c))?(u=i.charAt(c),c++):(u=t,g===0&&m(fs));p!==t?(i.charCodeAt(c)===47?(u=Dr,c++):(u=t,g===0&&m(Lr)),u!==t?(A=r,a=Ec(),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r}function Xc(){var r,a,p,u,v;if(r=c,a=js(),a!==t)if(i.charCodeAt(c)===126?(p=Nr,c++):(p=t,g===0&&m(zr)),p!==t){for(u=[],Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));v!==t;)u.push(v),Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));u!==t?(A=r,a=kc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Gc(){var r,a,p,u,v;if(r=c,a=zt(),a!==t)if(i.charCodeAt(c)===126?(p=Nr,c++):(p=t,g===0&&m(zr)),p!==t){for(u=[],Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));v!==t;)u.push(v),Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));u!==t?(A=r,a=Pc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Jc(){var r,a,p,u,v;if(r=c,a=Qe(),a!==t)if(i.charCodeAt(c)===94?(p=gs,c++):(p=t,g===0&&m(vs)),p!==t){for(u=[],Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));v!==t;)u.push(v),Ie.test(i.charAt(c))?(v=i.charAt(c),c++):(v=t,g===0&&m(He));u!==t?(A=r,a=Tc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Qe(){var r;return r=zt(),r===t&&(r=js()),r}function js(){var r,a;if(r=[],a=jt(),a!==t)for(;a!==t;)r.push(a),a=jt();else r=t;return r}function jt(){var r,a,p,u;return r=Fr(),r===t&&(r=tl(),r===t&&(r=c,a=c,g++,p=Rs(),g--,p===t?a=void 0:(c=a,a=t),a!==t?(p=c,g++,u=el(),g--,u===t?p=void 0:(c=p,p=t),p!==t?(i.length>c?(u=i.charAt(c),c++):(u=t,g===0&&m(Ui)),u!==t?(a=[a,p,u],r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t))),r}function el(){var r;return r=Lt(),r===t&&(r=Nt(),r===t&&(r=Ls(),r===t&&(r=Ns(),r===t&&(r=zs(),r===t&&(r=Ms()))))),r}function tl(){var r,a,p;return r=c,i.charCodeAt(c)===92?(a=ot,c++):(a=t,g===0&&m(at)),a!==t?(p=Rs(),p!==t?(A=r,a=Oc(),r=a):(c=r,r=t)):(c=r,r=t),r}function Rs(){var r;return i.charCodeAt(c)===43?(r=rs,c++):(r=t,g===0&&m(is)),r===t&&(i.charCodeAt(c)===45?(r=ss,c++):(r=t,g===0&&m(ns)),r===t&&(i.charCodeAt(c)===61?(r=Dc,c++):(r=t,g===0&&m(Lc)),r===t&&(i.charCodeAt(c)===62?(r=Ki,c++):(r=t,g===0&&m(Xi)),r===t&&(i.charCodeAt(c)===60?(r=Yi,c++):(r=t,g===0&&m(Zi)),r===t&&(i.charCodeAt(c)===33?(r=as,c++):(r=t,g===0&&m(cs)),r===t&&(i.charCodeAt(c)===40?(r=C,c++):(r=t,g===0&&m(k)),r===t&&(i.charCodeAt(c)===41?(r=N,c++):(r=t,g===0&&m(R)),r===t&&(i.charCodeAt(c)===123?(r=Me,c++):(r=t,g===0&&m(kr)),r===t&&(i.charCodeAt(c)===125?(r=Pr,c++):(r=t,g===0&&m(Tr)),r===t&&(i.charCodeAt(c)===91?(r=bs,c++):(r=t,g===0&&m(ms)),r===t&&(i.charCodeAt(c)===93?(r=ys,c++):(r=t,g===0&&m($s)),r===t&&(i.charCodeAt(c)===94?(r=gs,c++):(r=t,g===0&&m(vs)),r===t&&(i.charCodeAt(c)===34?(r=st,c++):(r=t,g===0&&m(nt)),r===t&&(i.charCodeAt(c)===126?(r=Nr,c++):(r=t,g===0&&m(zr)),r===t&&(i.charCodeAt(c)===42?(r=Et,c++):(r=t,g===0&&m(kt)),r===t&&(i.charCodeAt(c)===63?(r=us,c++):(r=t,g===0&&m(hs)),r===t&&(i.charCodeAt(c)===58?(r=G,c++):(r=t,g===0&&m(U)),r===t&&(i.charCodeAt(c)===92?(r=ot,c++):(r=t,g===0&&m(at)),r===t&&(i.charCodeAt(c)===47?(r=Dr,c++):(r=t,g===0&&m(Lr))))))))))))))))))))),r}function Ms(){var r,a,p,u,v;if(r=c,a=[],p=w(),p!==t)for(;p!==t;)a.push(p),p=w();else a=t;if(a!==t)if(i.substr(c,2)===ws?(p=ws,c+=2):(p=t,g===0&&m(Nc)),p!==t){if(u=[],v=w(),v!==t)for(;v!==t;)u.push(v),v=w();else u=t;u!==t?(a=[a,p,u],r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function rl(){var r;return i.charCodeAt(c)===91?(r=bs,c++):(r=t,g===0&&m(ms)),r===t&&(i.charCodeAt(c)===123?(r=Me,c++):(r=t,g===0&&m(kr))),r}function il(){var r;return i.charCodeAt(c)===93?(r=ys,c++):(r=t,g===0&&m($s)),r===t&&(i.charCodeAt(c)===125?(r=Pr,c++):(r=t,g===0&&m(Tr))),r}const{errorOnLuceneSyntax:sl,parseCursor:nl,cursorSymbol:ol,allowLeadingWildcards:al=!0,helpers:{nodeTypes:Pe}}=o,ee=Pe.function.buildNodeWithArgumentNodes,de=Pe.literal.buildNode,cl=Pe.wildcard.buildNode,ll=Pe.namedArg.buildNode,{wildcardSymbol:Is}=Pe.wildcard;if(Tt=d(),Tt!==t&&c===i.length)return Tt;throw Tt!==t&&c<i.length&&m({type:"end",description:"end of input"}),Ss(null,Br,J<i.length?i.charAt(J):null,J<i.length?Ot(J,J+1):Ot(J,J))}return{SyntaxError:e,parse:n}}(),pr=(s,e={},n=$t)=>{if(typeof s>"u")throw new Error("expression must be a string, got undefined instead");return n(s,{...e,helpers:{nodeTypes:Z}})},ze=(s,e={})=>pr(s,{...e,startRule:"Literal"},$t),wt=(s,e={})=>{try{return pr(s,e,$t)}catch(n){throw n.name==="SyntaxError"?new $i(n,s):n}},Bn=s=>{try{return pr(s,{errorOnLuceneSyntax:!0},$t),!1}catch(e){return e.message.startsWith("Lucene")}},B=(s,e,n,i)=>(e=void 0,!s||!s.type||!Z[s.type]?B(Z.function.buildNode("and",[]),e):Z[s.type].toOpenSearchQuery(s,e,n,i)),re="@kuery-wildcard@";function jn(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rn(s){return s.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Mn(s){return s.includes(re)?{type:"wildcard",value:s}:ze(s)}function wi(s,e){const{value:n}=s,i=n.split(re).map(jn).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(e)}function In(s){const{value:e}=s;return e.split(re).join("*")}function ur(s){const{value:e}=s;return e.split(re).map(Rn).join("*")}function Hn(s){const{value:e}=s;return e.startsWith(re)&&e.replace(re,"").length>0}const Un=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Mn,hasLeadingWildcard:Hn,test:wi,toOpenSearchQuery:In,toQueryStringQuery:ur,wildcardSymbol:re},Symbol.toStringTag,{value:"Module"}));function hr(s,e){if(!e)return[];if(s.type==="literal"){const n=lr(s),i=e.fields.find(o=>o.name===n);return i?[i]:[]}else if(s.type==="wildcard")return e.fields.filter(i=>wi(s,i.name))}function hl(s){return s}function _i(s,e,n){const i={...s,value:n?`${n}.${s.value}`:s.value};if(!e||i.type==="wildcard"&&!n)return i;const t=hr(i,e).reduce((l,d)=>{const f=d.subType&&d.subType.nested?d.subType.nested.path:void 0;return n&&!f?[...l,`${d.name} is not a nested field but is in nested group "${n}" in the DQL expression.`]:f&&!n?[...l,`${d.name} is a nested field, but is not in a nested group in the DQL expression.`]:f!==n?[...l,`Nested field ${d.name} is being queried with the incorrect nested path. The correct path is ${d.subType.nested.path}.`]:l},[]);if(t.length>0)throw new Error(t.join(`
|
|
752
|
-
`));return i}function
|
|
774
|
+
`}return`Not yet implemented ${this.variant}`}},O([v({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"checked",2),O([v({type:String,reflect:!0})],h.SpectricInput.prototype,"placeholder",2),O([v({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"readonly",2),O([v({type:String,reflect:!0})],h.SpectricInput.prototype,"variant",2),O([v({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"disabled",2),O([v({type:String,reflect:!0})],h.SpectricInput.prototype,"label",2),O([v()],h.SpectricInput.prototype,"hidePasswordLabel",2),O([v()],h.SpectricInput.prototype,"showPasswordLabel",2),O([v({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"showPasswordVisibilityToggle",2),O([v({type:String,reflect:!0})],h.SpectricInput.prototype,"helperText",2),O([v({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"invalid",2),O([v({type:Boolean,reflect:!0})],h.SpectricInput.prototype,"required",2),O([v({type:String,reflect:!0})],h.SpectricInput.prototype,"invalidText",2),O([v()],h.SpectricInput.prototype,"name",2),O([v()],h.SpectricInput.prototype,"pattern",2),O([v({type:Number,reflect:!0})],h.SpectricInput.prototype,"maxCount",2),O([v({reflect:!0})],h.SpectricInput.prototype,"autocomplete",2),O([v({reflect:!0})],h.SpectricInput.prototype,"value",1),O([ue("input")],h.SpectricInput.prototype,"_input",2),O([we({capture:!0})],h.SpectricInput.prototype,"_handleChange",1),h.SpectricInput=O([T("spectric-input")],h.SpectricInput);const ze=n=>lr(n===""?void 0:n??void 0),jn="end of input",Rn={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class Si extends Error{constructor(e,s){let i=e.message;if(e.expected){const l=e.expected.map(d=>Rn[d.description]||d.description).join(", ");let f=e.found?`"${e.found}"`:jn;i=`Expected ${l} but ${f} found.`}const o=[i,s,"-".repeat(e.location.start.offset)+"^"].join(`
|
|
775
|
+
`);super(o),this.name="DQLSyntaxError",this.shortMessage=i}}function Ne(n){return{type:"literal",value:n}}function dr(n){return n.value}const In=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Ne,toOpenSearchQuery:dr},Symbol.toStringTag,{value:"Module"})),{SyntaxError:bl,parse:At}=function(){function n(i,o){function t(){this.constructor=i}t.prototype=o.prototype,i.prototype=new t}function e(i,o,t,l){this.message=i,this.expected=o,this.found=t,this.location=l,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)}n(e,Error);function s(i){var o=arguments.length>1?arguments[1]:{},t={},l={start:Ts,Literal:qr},f=Ts,d=function(r,a){return a.type==="cursor"?{...a,suggestionTypes:["conjunction"]}:r!==null?r:Te.function.buildNode("is","*","*")},y=function(){return pl},C=function(r,a){const p=[r,a].find(u=>u.type==="cursor");return p||se("or",[r,a])},$=function(r,a){const p=[r,a].find(u=>u.type==="cursor");return p||se("and",[r,a])},E=function(r){return r.type==="cursor"?r:se("not",[r])},x="(",k={type:"literal",value:"(",description:'"("'},D=")",I={type:"literal",value:")",description:'")"'},H=function(r,a){return a.type==="cursor"?{...a,suggestionTypes:["conjunction"]}:r},re=":",W={type:"literal",value:":",description:'":"'},Fe="{",Or={type:"literal",value:"{",description:'"{"'},Dr="}",Lr={type:"literal",value:"}",description:'"}"'},Ma=function(r,a,p){return a.type==="cursor"?{...a,nestedPath:a.nestedPath?`${r.value}.${a.nestedPath}`:r.value}:p.type==="cursor"?{...p,suggestionTypes:["conjunction"]}:se("nested",[r,a])},ja={type:"other",description:"fieldName"},Ra=function(r,a,p){if(p.type==="cursor")return{...p,suggestionTypes:["conjunction"]};const u=gl(a,p);return se("range",[r,u])},Ia=function(r,a){return a.type==="cursor"?{...a,fieldName:r.value,suggestionTypes:["value","conjunction"]}:a(r)},Ua=function(r){if(r.type==="cursor"){const p=`${r.prefix}${r.suffix}`.trim();return{...r,fieldName:p,suggestionTypes:["field","operator","conjunction"]}}const a=ge(null);return r(a)},Ha=function(r,a){return a.type==="cursor"?{...a,suggestionTypes:["conjunction"]}:r},Fa=function(r,a){const p=[r,a].find(u=>u.type==="cursor");return p?{...p,suggestionTypes:["value"]}:u=>se("or",[r(u),a(u)])},Qa=function(r,a){const p=[r,a].find(u=>u.type==="cursor");return p?{...p,suggestionTypes:["value"]}:u=>se("and",[r(u),a(u)])},qa=function(r){return r.type==="cursor"?{...list,suggestionTypes:["value"]}:a=>se("not",[r(a)])},Wa={type:"other",description:"value"},Va=function(r){if(r.type==="cursor")return r;const a=ge(!0);return p=>se("is",[p,r,a])},Ya=function(r){if(r.type==="cursor")return r;!dl&&r.type==="wildcard"&&Te.wildcard.hasLeadingWildcard(r)&&Y("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const a=ge(!1);return p=>se("is",[p,r,a])},Za={type:"other",description:"OR"},Hi="or",Fi={type:"literal",value:"or",description:'"or"'},Ka={type:"other",description:"AND"},Qi="and",qi={type:"literal",value:"and",description:'"and"'},Xa={type:"other",description:"NOT"},Wi="not",Vi={type:"literal",value:"not",description:'"not"'},Ga={type:"other",description:"literal"},pt='"',ut={type:"literal",value:'"',description:'"\\""'},zr=function(r,a,p){const{start:u,end:b}=Hc();return{type:"cursor",start:u.offset,end:b.offset-a.length,prefix:r.join(""),suffix:p.join(""),text:Uc().replace(a,"")}},Ja=function(r){return ge(r.join(""))},ht="\\",dt={type:"literal",value:"\\",description:'"\\\\"'},ec=/^[\\"]/,tc={type:"class",value:'[\\\\"]',description:'[\\\\"]'},Tt=function(r){return r},rc=/^[^"]/,ic={type:"class",value:'[^"]',description:'[^"]'},sc=function(r){const a=r.join("").trim();return a==="null"?ge(null):a==="true"?ge(!0):a==="false"?ge(!1):r.includes(Ws)?fl(a):ge(/^(-?[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)},Yi={type:"any",description:"any character"},Ot="*",Dt={type:"literal",value:"*",description:'"*"'},nc=function(){return Ws},Zi="\\t",oc={type:"literal",value:"\\t",description:'"\\\\t"'},ac=function(){return" "},Ki="\\r",cc={type:"literal",value:"\\r",description:'"\\\\r"'},lc=function(){return"\r"},Xi="\\n",pc={type:"literal",value:"\\n",description:'"\\\\n"'},uc=function(){return`
|
|
776
|
+
`},hc=function(r){return r},dc=/^[\\():<>"*{}]/,fc={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},Gi="<=",gc={type:"literal",value:"<=",description:'"<="'},vc=function(){return"lte"},Ji=">=",bc={type:"literal",value:">=",description:'">="'},mc=function(){return"gte"},es="<",ts={type:"literal",value:"<",description:'"<"'},yc=function(){return"lt"},rs=">",is={type:"literal",value:">",description:'">"'},$c=function(){return"gt"},wc={type:"other",description:"whitespace"},_c=/^[ \t\r\n]/,Sc={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},Ac=function(){return ul},ss="@kuery-cursor@",Cc={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},xc=function(){return hl},ns="||",Ec={type:"literal",value:"||",description:'"||"'},kc=function(){Y("LuceneOr")},os="&&",Pc={type:"literal",value:"&&",description:'"&&"'},as=function(){Y("LuceneAnd")},cs="+",ls={type:"literal",value:"+",description:'"+"'},ps="-",us={type:"literal",value:"-",description:'"-"'},hs=function(){Y("LuceneNot")},ds="!",fs={type:"literal",value:"!",description:'"!"'},gs="_exists_",Tc={type:"literal",value:"_exists_",description:'"_exists_"'},Oc=function(){Y("LuceneExists")},vs=function(){Y("LuceneRange")},bs="?",ms={type:"literal",value:"?",description:'"?"'},Dc=function(){Y("LuceneWildcard")},Nr="/",Br={type:"literal",value:"/",description:'"/"'},ys=/^[^\/]/,$s={type:"class",value:"[^/]",description:"[^/]"},Lc=function(){Y("LuceneRegex")},Mr="~",jr={type:"literal",value:"~",description:'"~"'},Qe=/^[0-9]/,qe={type:"class",value:"[0-9]",description:"[0-9]"},zc=function(){Y("LuceneFuzzy")},Nc=function(){Y("LuceneProximity")},ws="^",_s={type:"literal",value:"^",description:'"^"'},Bc=function(){Y("LuceneBoost")},Mc=function(){return char},jc="=",Rc={type:"literal",value:"=",description:'"="'},Ss="[",As={type:"literal",value:"[",description:'"["'},Cs="]",xs={type:"literal",value:"]",description:'"]"'},Es="TO",Ic={type:"literal",value:"TO",description:'"TO"'},c=0,A=0,Lt=[{line:1,column:1,seenCR:!1}],ie=0,Rr=[],g=0,zt;if("startRule"in o){if(!(o.startRule in l))throw new Error(`Can't start parsing from rule "`+o.startRule+'".');f=l[o.startRule]}function Uc(){return i.substring(A,c)}function Hc(){return Nt(A,c)}function Y(r){throw Ps(r,null,i.substring(A,c),Nt(A,c))}function ks(r){var a=Lt[r],p,u;if(a)return a;for(p=r-1;!Lt[p];)p--;for(a=Lt[p],a={line:a.line,column:a.column,seenCR:a.seenCR};p<r;)u=i.charAt(p),u===`
|
|
777
|
+
`?(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),p++;return Lt[r]=a,a}function Nt(r,a){var p=ks(r),u=ks(a);return{start:{offset:r,line:p.line,column:p.column},end:{offset:a,line:u.line,column:u.column}}}function m(r){c<ie||(c>ie&&(ie=c,Rr=[]),Rr.push(r))}function Ps(r,a,p,u){function b(L){var N=1;for(L.sort(function(ve,Z){return ve.description<Z.description?-1:ve.description>Z.description?1:0});N<L.length;)L[N-1]===L[N]?L.splice(N,1):N++}function S(L,N){function ve(vl){function Ht(ae){return ae.charCodeAt(0).toString(16).toUpperCase()}return vl.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(ae){return"\\x0"+Ht(ae)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(ae){return"\\x"+Ht(ae)}).replace(/[\u0100-\u0FFF]/g,function(ae){return"\\u0"+Ht(ae)}).replace(/[\u1000-\uFFFF]/g,function(ae){return"\\u"+Ht(ae)})}var Z=new Array(L.length),Vs,Ys,gt;for(gt=0;gt<L.length;gt++)Z[gt]=L[gt].description;return Vs=L.length>1?Z.slice(0,-1).join(", ")+" or "+Z[L.length-1]:Z[0],Ys=N?'"'+ve(N)+'"':"end of input","Expected "+Vs+" but "+Ys+" found."}return a!==null&&b(a),new e(r!==null?r:S(a,p),a,p,u)}function Ts(){var r,a,p,u;for(r=c,a=[],p=_();p!==t;)a.push(p),p=_();return a!==t?(p=Bt(),p===t&&(p=null),p!==t?(u=It(),u!==t?(A=r,a=d(p,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r}function Bt(){var r,a,p,u;return r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=Gc(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=c,a=Ir(),a!==t?(p=Mt(),p!==t?(u=Bt(),u!==t?(A=r,a=C(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=Ir())),r}function Ir(){var r,a,p,u;return r=c,a=Os(),a!==t?(p=jt(),p!==t?(u=Ir(),u!==t?(A=r,a=$(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=Os()),r}function Os(){var r,a,p;return r=c,a=Qr(),a!==t?(p=Ds(),p!==t?(A=r,a=E(p),r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=Ds()),r}function Ds(){var r,a,p,u,b,S;if(r=c,i.charCodeAt(c)===40?(a=x,c++):(a=t,g===0&&m(k)),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();p!==t?(u=Bt(),u!==t?(b=It(),b!==t?(i.charCodeAt(c)===41?(S=D,c++):(S=t,g===0&&m(I)),S!==t?(A=r,a=H(u,b),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r===t&&(r=Fc()),r}function Fc(){var r,a,p,u,b,S,L,N,ve,Z;if(r=c,a=Ur(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();if(p!==t)if(i.charCodeAt(c)===58?(u=re,c++):(u=t,g===0&&m(W)),u!==t){for(b=[],S=_();S!==t;)b.push(S),S=_();if(b!==t)if(i.charCodeAt(c)===123?(S=Fe,c++):(S=t,g===0&&m(Or)),S!==t){for(L=[],N=_();N!==t;)L.push(N),N=_();L!==t?(N=Bt(),N!==t?(ve=It(),ve!==t?(i.charCodeAt(c)===125?(Z=Dr,c++):(Z=t,g===0&&m(Lr)),Z!==t?(A=r,a=Ma(a,N,ve),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r===t&&(r=Qc()),r}function Qc(){var r;return r=qc(),r===t&&(r=Wc(),r===t&&(r=Vc())),r}function Ur(){var r;return g++,r=qr(),g--,r===t&&g===0&&m(ja),r}function qc(){var r,a,p,u,b,S;if(r=c,a=Ur(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();if(p!==t)if(u=js(),u!==t){for(b=[],S=_();S!==t;)b.push(S),S=_();b!==t?(S=qr(),S!==t?(A=r,a=Ra(a,u,S),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Wc(){var r,a,p,u,b,S;if(r=c,a=Ur(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();if(p!==t)if(i.charCodeAt(c)===58?(u=re,c++):(u=t,g===0&&m(W)),u!==t){for(b=[],S=_();S!==t;)b.push(S),S=_();b!==t?(S=Hr(),S!==t?(A=r,a=Ia(a,S),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Vc(){var r,a;return r=c,a=Ns(),a!==t&&(A=r,a=Ua(a)),r=a,r}function Hr(){var r,a,p,u,b,S;if(r=c,i.charCodeAt(c)===40?(a=x,c++):(a=t,g===0&&m(k)),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();p!==t?(u=Ls(),u!==t?(b=It(),b!==t?(i.charCodeAt(c)===41?(S=D,c++):(S=t,g===0&&m(I)),S!==t?(A=r,a=Ha(u,b),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r===t&&(r=Ns()),r}function Ls(){var r,a,p,u;return r=c,a=Fr(),a!==t?(p=Mt(),p!==t?(u=Ls(),u!==t?(A=r,a=Fa(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=Fr()),r}function Fr(){var r,a,p,u;return r=c,a=zs(),a!==t?(p=jt(),p!==t?(u=Fr(),u!==t?(A=r,a=Qa(a,u),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t),r===t&&(r=zs()),r}function zs(){var r,a,p;return r=c,a=Qr(),a!==t?(p=Hr(),p!==t?(A=r,a=qa(p),r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=Hr()),r}function Ns(){var r,a;return g++,r=c,a=Rt(),a!==t&&(A=r,a=Va(a)),r=a,r===t&&(r=c,a=Bs(),a!==t&&(A=r,a=Ya(a)),r=a),g--,r===t&&(a=t,g===0&&m(Wa)),r}function Mt(){var r,a,p,u,b;if(g++,r=c,a=[],p=_(),p!==t)for(;p!==t;)a.push(p),p=_();else a=t;if(a!==t)if(i.substr(c,2).toLowerCase()===Hi?(p=i.substr(c,2),c+=2):(p=t,g===0&&m(Fi)),p!==t){if(u=[],b=_(),b!==t)for(;b!==t;)u.push(b),b=_();else u=t;u!==t?(a=[a,p,u],r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r===t&&(r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=Rs(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t)),g--,r===t&&(a=t,g===0&&m(Za)),r}function jt(){var r,a,p,u,b;if(g++,r=c,a=[],p=_(),p!==t)for(;p!==t;)a.push(p),p=_();else a=t;if(a!==t)if(i.substr(c,3).toLowerCase()===Qi?(p=i.substr(c,3),c+=3):(p=t,g===0&&m(qi)),p!==t){if(u=[],b=_(),b!==t)for(;b!==t;)u.push(b),b=_();else u=t;u!==t?(a=[a,p,u],r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r===t&&(r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=Is(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t)),g--,r===t&&(a=t,g===0&&m(Ka)),r}function Qr(){var r,a,p,u;if(g++,r=c,i.substr(c,3).toLowerCase()===Wi?(a=i.substr(c,3),c+=3):(a=t,g===0&&m(Vi)),a!==t){if(p=[],u=_(),u!==t)for(;u!==t;)p.push(u),u=_();else p=t;p!==t?(a=[a,p],r=a):(c=r,r=t)}else c=r,r=t;return r===t&&(r=c,A=c,a=y(),a?a=void 0:a=t,a!==t?(p=Us(),p!==t?(a=[a,p],r=a):(c=r,r=t)):(c=r,r=t)),g--,r===t&&(a=t,g===0&&m(Xa)),r}function qr(){var r;return g++,r=Rt(),r===t&&(r=Bs()),g--,r===t&&g===0&&m(Ga),r}function Rt(){var r,a,p,u,b,S;if(r=c,i.charCodeAt(c)===34?(a=pt,c++):(a=t,g===0&&m(ut)),a!==t){for(p=[],u=We();u!==t;)p.push(u),u=We();if(p!==t)if(u=ft(),u!==t){for(b=[],S=We();S!==t;)b.push(S),S=We();b!==t?(i.charCodeAt(c)===34?(S=pt,c++):(S=t,g===0&&m(ut)),S!==t?(A=r,a=zr(p,u,b),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;if(r===t)if(r=c,i.charCodeAt(c)===34?(a=pt,c++):(a=t,g===0&&m(ut)),a!==t){for(p=[],u=We();u!==t;)p.push(u),u=We();p!==t?(i.charCodeAt(c)===34?(u=pt,c++):(u=t,g===0&&m(ut)),u!==t?(A=r,a=Ja(p),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r}function We(){var r,a,p;return r=Wr(),r===t&&(r=c,i.charCodeAt(c)===92?(a=ht,c++):(a=t,g===0&&m(dt)),a!==t?(ec.test(i.charAt(c))?(p=i.charAt(c),c++):(p=t,g===0&&m(tc)),p!==t?(A=r,a=Tt(p),r=a):(c=r,r=t)):(c=r,r=t),r===t&&(r=c,a=c,g++,p=ft(),g--,p===t?a=void 0:(c=a,a=t),a!==t?(rc.test(i.charAt(c))?(p=i.charAt(c),c++):(p=t,g===0&&m(ic)),p!==t?(A=r,a=Tt(p),r=a):(c=r,r=t)):(c=r,r=t))),r}function Bs(){var r,a,p,u,b;for(r=c,a=[],p=Ve();p!==t;)a.push(p),p=Ve();if(a!==t)if(p=ft(),p!==t){for(u=[],b=Ve();b!==t;)u.push(b),b=Ve();u!==t?(A=r,a=zr(a,p,u),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;if(r===t){if(r=c,a=[],p=Ve(),p!==t)for(;p!==t;)a.push(p),p=Ve();else a=t;a!==t&&(A=r,a=sc(a)),r=a}return r}function Ve(){var r,a,p,u,b;return r=Wr(),r===t&&(r=Zc(),r===t&&(r=Kc(),r===t&&(r=Yc(),r===t&&(r=c,a=c,g++,p=Ms(),g--,p===t?a=void 0:(c=a,a=t),a!==t?(p=c,g++,u=Xc(),g--,u===t?p=void 0:(c=p,p=t),p!==t?(u=c,g++,b=ft(),g--,b===t?u=void 0:(c=u,u=t),u!==t?(i.length>c?(b=i.charAt(c),c++):(b=t,g===0&&m(Yi)),b!==t?(A=r,a=Tt(b),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t))))),r}function Yc(){var r,a;return r=c,i.charCodeAt(c)===42?(a=Ot,c++):(a=t,g===0&&m(Dt)),a!==t&&(A=r,a=nc()),r=a,r}function It(){var r,a,p,u,b;for(r=c,a=[],p=_();p!==t;)a.push(p),p=_();if(a!==t)if(p=ft(),p!==t){for(u=[],b=_();b!==t;)u.push(b),b=_();u!==t?(A=r,a=zr(a,p,u),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;if(r===t)for(r=[],a=_();a!==t;)r.push(a),a=_();return r}function Wr(){var r,a;return r=c,i.substr(c,2)===Zi?(a=Zi,c+=2):(a=t,g===0&&m(oc)),a!==t&&(A=r,a=ac()),r=a,r===t&&(r=c,i.substr(c,2)===Ki?(a=Ki,c+=2):(a=t,g===0&&m(cc)),a!==t&&(A=r,a=lc()),r=a,r===t&&(r=c,i.substr(c,2)===Xi?(a=Xi,c+=2):(a=t,g===0&&m(pc)),a!==t&&(A=r,a=uc()),r=a)),r}function Zc(){var r,a,p;return r=c,i.charCodeAt(c)===92?(a=ht,c++):(a=t,g===0&&m(dt)),a!==t?(p=Ms(),p!==t?(A=r,a=Tt(p),r=a):(c=r,r=t)):(c=r,r=t),r}function Kc(){var r,a,p;return r=c,i.charCodeAt(c)===92?(a=ht,c++):(a=t,g===0&&m(dt)),a!==t?(i.substr(c,2).toLowerCase()===Hi?(p=i.substr(c,2),c+=2):(p=t,g===0&&m(Fi)),p===t&&(i.substr(c,3).toLowerCase()===Qi?(p=i.substr(c,3),c+=3):(p=t,g===0&&m(qi)),p===t&&(i.substr(c,3).toLowerCase()===Wi?(p=i.substr(c,3),c+=3):(p=t,g===0&&m(Vi)))),p!==t?(A=r,a=hc(p),r=a):(c=r,r=t)):(c=r,r=t),r}function Xc(){var r;return r=Mt(),r===t&&(r=jt(),r===t&&(r=Qr())),r}function Ms(){var r;return dc.test(i.charAt(c))?(r=i.charAt(c),c++):(r=t,g===0&&m(fc)),r}function js(){var r,a;return r=c,i.substr(c,2)===Gi?(a=Gi,c+=2):(a=t,g===0&&m(gc)),a!==t&&(A=r,a=vc()),r=a,r===t&&(r=c,i.substr(c,2)===Ji?(a=Ji,c+=2):(a=t,g===0&&m(bc)),a!==t&&(A=r,a=mc()),r=a,r===t&&(r=c,i.charCodeAt(c)===60?(a=es,c++):(a=t,g===0&&m(ts)),a!==t&&(A=r,a=yc()),r=a,r===t&&(r=c,i.charCodeAt(c)===62?(a=rs,c++):(a=t,g===0&&m(is)),a!==t&&(A=r,a=$c()),r=a))),r}function _(){var r;return g++,_c.test(i.charAt(c))?(r=i.charAt(c),c++):(r=t,g===0&&m(Sc)),g--,r===t&&g===0&&m(wc),r}function ft(){var r,a,p;return r=c,A=c,a=Ac(),a?a=void 0:a=t,a!==t?(i.substr(c,14)===ss?(p=ss,c+=14):(p=t,g===0&&m(Cc)),p!==t?(A=r,a=xc(),r=a):(c=r,r=t)):(c=r,r=t),r}function Rs(){var r,a,p,u,b;for(r=c,a=[],p=_();p!==t;)a.push(p),p=_();if(a!==t)if(i.substr(c,2)===ns?(p=ns,c+=2):(p=t,g===0&&m(Ec)),p!==t){for(u=[],b=_();b!==t;)u.push(b),b=_();u!==t?(A=r,a=kc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Is(){var r,a,p,u,b;for(r=c,a=[],p=_();p!==t;)a.push(p),p=_();if(a!==t)if(i.substr(c,2)===os?(p=os,c+=2):(p=t,g===0&&m(Pc)),p!==t){for(u=[],b=_();b!==t;)u.push(b),b=_();u!==t?(A=r,a=as(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r===t&&(r=c,i.charCodeAt(c)===43?(a=cs,c++):(a=t,g===0&&m(ls)),a!==t&&(A=r,a=as()),r=a),r}function Us(){var r,a;return r=c,i.charCodeAt(c)===45?(a=ps,c++):(a=t,g===0&&m(us)),a!==t&&(A=r,a=hs()),r=a,r===t&&(r=c,i.charCodeAt(c)===33?(a=ds,c++):(a=t,g===0&&m(fs)),a!==t&&(A=r,a=hs()),r=a),r}function Gc(){var r;return r=Jc(),r===t&&(r=Hs(),r===t&&(r=el())),r}function Jc(){var r,a,p,u,b,S;if(r=c,a=Ye(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();if(p!==t)if(i.charCodeAt(c)===58?(u=re,c++):(u=t,g===0&&m(W)),u!==t){for(b=[],S=_();S!==t;)b.push(S),S=_();b!==t?(S=Hs(),S!==t?(a=[a,p,u,b,S],r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function Hs(){var r;return r=tl(),r===t&&(r=Vr(),r===t&&(r=rl(),r===t&&(r=il(),r===t&&(r=sl(),r===t&&(r=nl()))))),r}function el(){var r,a,p,u,b,S;if(r=c,i.substr(c,8)===gs?(a=gs,c+=8):(a=t,g===0&&m(Tc)),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();if(p!==t)if(i.charCodeAt(c)===58?(u=re,c++):(u=t,g===0&&m(W)),u!==t){for(b=[],S=_();S!==t;)b.push(S),S=_();b!==t?(S=Ye(),S!==t?(A=r,a=Oc(),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;else c=r,r=t}else c=r,r=t;return r}function tl(){var r,a,p,u,b,S,L;if(r=c,a=js(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();p!==t?(u=Ye(),u!==t?(A=r,a=vs(),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;if(r===t)if(r=c,a=cl(),a!==t){for(p=[],u=_();u!==t;)p.push(u),u=_();p!==t?(u=Ye(),u!==t?(b=qs(),b!==t?(S=Ye(),S!==t?(L=ll(),L!==t?(A=r,a=vs(),r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r}function Vr(){var r,a,p,u,b;for(r=c,a=[],p=Ut(),p===t&&(i.charCodeAt(c)===42?(p=Ot,c++):(p=t,g===0&&m(Dt)));p!==t;)a.push(p),p=Ut(),p===t&&(i.charCodeAt(c)===42?(p=Ot,c++):(p=t,g===0&&m(Dt)));if(a!==t)if(i.charCodeAt(c)===63?(p=bs,c++):(p=t,g===0&&m(ms)),p!==t){for(u=[],b=Vr();b!==t;)u.push(b),b=Vr();u!==t?(A=r,a=Dc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function rl(){var r,a,p,u;if(r=c,i.charCodeAt(c)===47?(a=Nr,c++):(a=t,g===0&&m(Br)),a!==t){for(p=[],ys.test(i.charAt(c))?(u=i.charAt(c),c++):(u=t,g===0&&m($s));u!==t;)p.push(u),ys.test(i.charAt(c))?(u=i.charAt(c),c++):(u=t,g===0&&m($s));p!==t?(i.charCodeAt(c)===47?(u=Nr,c++):(u=t,g===0&&m(Br)),u!==t?(A=r,a=Lc(),r=a):(c=r,r=t)):(c=r,r=t)}else c=r,r=t;return r}function il(){var r,a,p,u,b;if(r=c,a=Fs(),a!==t)if(i.charCodeAt(c)===126?(p=Mr,c++):(p=t,g===0&&m(jr)),p!==t){for(u=[],Qe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=t,g===0&&m(qe));b!==t;)u.push(b),Qe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=t,g===0&&m(qe));u!==t?(A=r,a=zc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function sl(){var r,a,p,u,b;if(r=c,a=Rt(),a!==t)if(i.charCodeAt(c)===126?(p=Mr,c++):(p=t,g===0&&m(jr)),p!==t){for(u=[],Qe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=t,g===0&&m(qe));b!==t;)u.push(b),Qe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=t,g===0&&m(qe));u!==t?(A=r,a=Nc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function nl(){var r,a,p,u,b;if(r=c,a=Ye(),a!==t)if(i.charCodeAt(c)===94?(p=ws,c++):(p=t,g===0&&m(_s)),p!==t){for(u=[],Qe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=t,g===0&&m(qe));b!==t;)u.push(b),Qe.test(i.charAt(c))?(b=i.charAt(c),c++):(b=t,g===0&&m(qe));u!==t?(A=r,a=Bc(),r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function Ye(){var r;return r=Rt(),r===t&&(r=Fs()),r}function Fs(){var r,a;if(r=[],a=Ut(),a!==t)for(;a!==t;)r.push(a),a=Ut();else r=t;return r}function Ut(){var r,a,p,u;return r=Wr(),r===t&&(r=al(),r===t&&(r=c,a=c,g++,p=Qs(),g--,p===t?a=void 0:(c=a,a=t),a!==t?(p=c,g++,u=ol(),g--,u===t?p=void 0:(c=p,p=t),p!==t?(i.length>c?(u=i.charAt(c),c++):(u=t,g===0&&m(Yi)),u!==t?(a=[a,p,u],r=a):(c=r,r=t)):(c=r,r=t)):(c=r,r=t))),r}function ol(){var r;return r=Mt(),r===t&&(r=jt(),r===t&&(r=Rs(),r===t&&(r=Is(),r===t&&(r=Us(),r===t&&(r=qs()))))),r}function al(){var r,a,p;return r=c,i.charCodeAt(c)===92?(a=ht,c++):(a=t,g===0&&m(dt)),a!==t?(p=Qs(),p!==t?(A=r,a=Mc(),r=a):(c=r,r=t)):(c=r,r=t),r}function Qs(){var r;return i.charCodeAt(c)===43?(r=cs,c++):(r=t,g===0&&m(ls)),r===t&&(i.charCodeAt(c)===45?(r=ps,c++):(r=t,g===0&&m(us)),r===t&&(i.charCodeAt(c)===61?(r=jc,c++):(r=t,g===0&&m(Rc)),r===t&&(i.charCodeAt(c)===62?(r=rs,c++):(r=t,g===0&&m(is)),r===t&&(i.charCodeAt(c)===60?(r=es,c++):(r=t,g===0&&m(ts)),r===t&&(i.charCodeAt(c)===33?(r=ds,c++):(r=t,g===0&&m(fs)),r===t&&(i.charCodeAt(c)===40?(r=x,c++):(r=t,g===0&&m(k)),r===t&&(i.charCodeAt(c)===41?(r=D,c++):(r=t,g===0&&m(I)),r===t&&(i.charCodeAt(c)===123?(r=Fe,c++):(r=t,g===0&&m(Or)),r===t&&(i.charCodeAt(c)===125?(r=Dr,c++):(r=t,g===0&&m(Lr)),r===t&&(i.charCodeAt(c)===91?(r=Ss,c++):(r=t,g===0&&m(As)),r===t&&(i.charCodeAt(c)===93?(r=Cs,c++):(r=t,g===0&&m(xs)),r===t&&(i.charCodeAt(c)===94?(r=ws,c++):(r=t,g===0&&m(_s)),r===t&&(i.charCodeAt(c)===34?(r=pt,c++):(r=t,g===0&&m(ut)),r===t&&(i.charCodeAt(c)===126?(r=Mr,c++):(r=t,g===0&&m(jr)),r===t&&(i.charCodeAt(c)===42?(r=Ot,c++):(r=t,g===0&&m(Dt)),r===t&&(i.charCodeAt(c)===63?(r=bs,c++):(r=t,g===0&&m(ms)),r===t&&(i.charCodeAt(c)===58?(r=re,c++):(r=t,g===0&&m(W)),r===t&&(i.charCodeAt(c)===92?(r=ht,c++):(r=t,g===0&&m(dt)),r===t&&(i.charCodeAt(c)===47?(r=Nr,c++):(r=t,g===0&&m(Br))))))))))))))))))))),r}function qs(){var r,a,p,u,b;if(r=c,a=[],p=_(),p!==t)for(;p!==t;)a.push(p),p=_();else a=t;if(a!==t)if(i.substr(c,2)===Es?(p=Es,c+=2):(p=t,g===0&&m(Ic)),p!==t){if(u=[],b=_(),b!==t)for(;b!==t;)u.push(b),b=_();else u=t;u!==t?(a=[a,p,u],r=a):(c=r,r=t)}else c=r,r=t;else c=r,r=t;return r}function cl(){var r;return i.charCodeAt(c)===91?(r=Ss,c++):(r=t,g===0&&m(As)),r===t&&(i.charCodeAt(c)===123?(r=Fe,c++):(r=t,g===0&&m(Or))),r}function ll(){var r;return i.charCodeAt(c)===93?(r=Cs,c++):(r=t,g===0&&m(xs)),r===t&&(i.charCodeAt(c)===125?(r=Dr,c++):(r=t,g===0&&m(Lr))),r}const{errorOnLuceneSyntax:pl,parseCursor:ul,cursorSymbol:hl,allowLeadingWildcards:dl=!0,helpers:{nodeTypes:Te}}=o,se=Te.function.buildNodeWithArgumentNodes,ge=Te.literal.buildNode,fl=Te.wildcard.buildNode,gl=Te.namedArg.buildNode,{wildcardSymbol:Ws}=Te.wildcard;if(zt=f(),zt!==t&&c===i.length)return zt;throw zt!==t&&c<i.length&&m({type:"end",description:"end of input"}),Ps(null,Rr,ie<i.length?i.charAt(ie):null,ie<i.length?Nt(ie,ie+1):Nt(ie,ie))}return{SyntaxError:e,parse:s}}(),fr=(n,e={},s=At)=>{if(typeof n>"u")throw new Error("expression must be a string, got undefined instead");return s(n,{...e,helpers:{nodeTypes:J}})},Be=(n,e={})=>fr(n,{...e,startRule:"Literal"},At),Ct=(n,e={})=>{try{return fr(n,e,At)}catch(s){throw s.name==="SyntaxError"?new Si(s,n):s}},Un=n=>{try{return fr(n,{errorOnLuceneSyntax:!0},At),!1}catch(e){return e.message.startsWith("Lucene")}},B=(n,e,s,i)=>(e=void 0,!n||!n.type||!J[n.type]?B(J.function.buildNode("and",[]),e):J[n.type].toOpenSearchQuery(n,e,s,i)),oe="@kuery-wildcard@";function Hn(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Fn(n){return n.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Qn(n){return n.includes(oe)?{type:"wildcard",value:n}:Be(n)}function Ai(n,e){const{value:s}=n,i=s.split(oe).map(Hn).join("[\\s\\S]*");return new RegExp(`^${i}$`).test(e)}function qn(n){const{value:e}=n;return e.split(oe).join("*")}function gr(n){const{value:e}=n;return e.split(oe).map(Fn).join("*")}function Wn(n){const{value:e}=n;return e.startsWith(oe)&&e.replace(oe,"").length>0}const Vn=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Qn,hasLeadingWildcard:Wn,test:Ai,toOpenSearchQuery:qn,toQueryStringQuery:gr,wildcardSymbol:oe},Symbol.toStringTag,{value:"Module"}));function vr(n,e){if(!e)return[];if(n.type==="literal"){const s=dr(n),i=e.fields.find(o=>o.name===s);return i?[i]:[]}else if(n.type==="wildcard")return e.fields.filter(i=>Ai(n,i.name))}function ml(n){return n}function Ci(n,e,s){const i={...n,value:s?`${s}.${n.value}`:n.value};if(!e||i.type==="wildcard"&&!s)return i;const t=vr(i,e).reduce((l,f)=>{const d=f.subType&&f.subType.nested?f.subType.nested.path:void 0;return s&&!d?[...l,`${f.name} is not a nested field but is in nested group "${s}" in the DQL expression.`]:d&&!s?[...l,`${f.name} is a nested field, but is not in a nested group in the DQL expression.`]:d!==s?[...l,`Nested field ${f.name} is being queried with the incorrect nested path. The correct path is ${f.subType.nested.path}.`]:l},[]);if(t.length>0)throw new Error(t.join(`
|
|
778
|
+
`));return i}function Yn(n,e,s=!1){if(n===void 0)throw new Error("fieldName is a required argument");if(e===void 0)throw new Error("value is a required argument");const i=typeof n=="string"?Be(n):Ne(n),o=typeof e=="string"?Be(e):Ne(e),t=Ne(s);return{arguments:[i,o,t]}}function Zn(n,e,s={},i={}){const{arguments:[o,t,l]}=n,f=Ci(o,e,i!=null&&i.nested?i.nested.path:void 0),d=B(f),y=t!==void 0?B(t):t,C=l.value?"phrase":"best_fields";if(f.value===null)return t.type==="wildcard"?{query_string:{query:gr(t)}}:{multi_match:{type:C,query:y,lenient:!0}};const $=e?vr(f,e):[];$&&$.length===0&&$.push({name:B(f),scripted:!1,type:""});const E=t.type==="wildcard"&&y==="*",x=f.type==="wildcard"&&d==="*"||$&&e&&$.length===e.fields.length;return E&&x?{match_all:{}}:{bool:{should:$.reduce((I,H)=>{const re=W=>{var Fe;return f.type!=="wildcard"||!((Fe=H.subType)!=null&&Fe.nested)||i!=null&&i.nested?W:{nested:{path:H.subType.nested.path,query:W,score_mode:"none"}}};if(H.scripted)return[];if(E)return[...I,re({exists:{field:H.name}})];if(t.type==="wildcard")return[...I,re({query_string:{fields:[H.name],query:gr(t)}})];if(H.type==="date"){const W=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return[...I,re({range:{[H.name]:{gte:y,lte:y,...W}}})]}else{const W=C==="phrase"?"match_phrase":"match";return[...I,re({[W]:{[H.name]:y}})]}},[])||[],minimum_should_match:1}}}const Kn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Yn,toOpenSearchQuery:Zn},Symbol.toStringTag,{value:"Module"}));function Xn(n){return{arguments:n}}function Gn(n,e,s={},i={}){return{bool:{filter:(n.arguments||[]).map(t=>B(t,e,s,i))}}}const Jn=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Xn,toOpenSearchQuery:Gn},Symbol.toStringTag,{value:"Module"}));function eo(n){return{arguments:n}}function to(n,e,s={},i={}){return{bool:{should:(n.arguments||[]).map(t=>B(t,e,s,i)),minimum_should_match:1}}}const ro=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:eo,toOpenSearchQuery:to},Symbol.toStringTag,{value:"Module"}));function io(n){return{arguments:[n]}}function so(n,e,s={},i={}){const[o]=n.arguments;return{bool:{must_not:B(o,e,s,i)}}}const no=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:io,toOpenSearchQuery:so},Symbol.toStringTag,{value:"Module"}));function oo(n,...e){let s={};for(let i of e)s[i]=n[i];return s}function ao(n,e){const s=oo(e,"gt","lt","gte","lte","format"),i=typeof n=="string"?Be(n):J.literal.buildNode(n),o=Object.entries(s).map(t=>{let[l,f]=t;return J.namedArg.buildNode(l,f)});return{arguments:[i,...o]}}function co(n,e,s={},i={}){const[o,...t]=n.arguments,l=Ci(o,e,i!=null&&i.nested?i.nested.path:void 0),f=e?vr(l,e):[],d=lo(t),y=Object.fromEntries(Object.entries(d).map(([$,E])=>[$,B(E)]));return f&&f.length===0&&f.push({name:B(l),scripted:!1,type:""}),{bool:{should:f.map($=>{const E=x=>{var k;return l.type!=="wildcard"||!((k=$.subType)!=null&&k.nested)||i.nested?x:{nested:{path:$.subType.nested.path,query:x,score_mode:"none"}}};if($.scripted)return{};if($.type==="date"){const x=s.dateFormatTZ?{time_zone:s.dateFormatTZ}:{};return E({range:{[$.name]:{...y,...x}}})}return E({range:{[$.name]:y}})}),minimum_should_match:1}}}function lo(n){if(n.gt&&n.gte||n.lt&&n.lte)throw new Error("range ends cannot be both inclusive and exclusive");const e=["gte","lte","format"];return n.reduce((s,i,o)=>(i.type==="namedArg"?s[i.name]=i.value:s[e[o]]=i,s),{})}const po=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:ao,toOpenSearchQuery:co},Symbol.toStringTag,{value:"Module"}));function uo(n){return{arguments:[Ne(n)]}}function ho(n,e,s={},i={}){const{arguments:[o]}=n,t={...o,value:i!=null&&i.nested?`${i.nested.path}.${o.value}`:o.value},l=dr(t),f=((e==null?void 0:e.fields)||[]).find(d=>d.name===l);if(f&&f.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:l}}}const fo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:uo,toOpenSearchQuery:ho},Symbol.toStringTag,{value:"Module"}));function go(n,e){return{arguments:[typeof n=="string"?Be(n):Ne(n),e]}}function vo(n,e,s={},i={}){var d;const[o,t]=n.arguments,l=B(o),f=(d=i==null?void 0:i.nested)!=null&&d.path?`${i.nested.path}.${l}`:l;return{nested:{path:f,query:B(t,e,s,{...i,nested:{path:f}}),score_mode:"none"}}}const br={is:Kn,and:Jn,or:ro,not:no,range:po,exists:fo,nested:Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:go,toOpenSearchQuery:vo},Symbol.toStringTag,{value:"Module"}))};function bo(n,...e){const s=br[n];if(s===void 0)throw new Error(`Unknown function "${n}"`);return{type:"function",function:n,...s.buildNodeParams(...e)}}function mo(n,e){if(br[n]===void 0)throw new Error(`Unknown function "${n}"`);return{type:"function",function:n,arguments:e}}function yo(n,e,s,i){return br[n.function].toOpenSearchQuery(n,e,s,i)}const $o=Object.freeze(Object.defineProperty({__proto__:null,buildNode:bo,buildNodeWithArgumentNodes:mo,toOpenSearchQuery:yo},Symbol.toStringTag,{value:"Module"}));function wo(n,e){const s=e.type==="literal"?e:J.literal.buildNode(e);return{type:"namedArg",name:n,value:s}}function _o(n){return B(n.value)}const J={function:$o,literal:In,namedArg:Object.freeze(Object.defineProperty({__proto__:null,buildNode:wo,toOpenSearchQuery:_o},Symbol.toStringTag,{value:"Module"})),wildcard:Vn},So=oe,Ao=(n,e)=>"("+(n.arguments||[]).map(i=>Ee(i,e)).join(" AND ")+")",Co=(n,e)=>{var{arguments:[s,i,o]}=n;let t="=";i.type==="wildcard"&&(t="");let l=Ee(i);o=o.value||typeof l=="string",i.type==="literal"&&o&&(l=`'${l}'`),i.type==="literal"&&!o&&(l=`${l}`);let f=Ee(s);return f==null?e&&o?`(${e.filter(d=>d.type==="string").map(d=>`${d.name} ILIKE '%${i.value}%'`).join(" OR ")})`:e&&!o&&(i.value===!0||i.value===!1)?`(${e.filter(d=>d.type==="boolean").map(d=>`${d.name}=${i.value}`).join(" OR ")})`:"":f+t+l},xo=(n,e)=>"("+(n.arguments||[]).map(i=>Ee(i,e)).join(" OR ")+")",Eo=(n,e)=>{const[s]=n.arguments;return"NOT ("+Ee(s,e)+")"},ko={gt:">",lt:"<",gte:">=",lte:"<="},Po={is:Co,and:Ao,or:xo,not:Eo,range:n=>{const[e,s]=n.arguments;let i=s.value;const o=ko[s.name];let t=Ee(i);return i.type==="literal"&&(t=`${t}`),`${e.value} ${o} ${t}`},exists:n=>{const[e]=n.arguments;return`${e.value} IS NOT NULL`},nested:n=>(console.warn("Nested types dont exist in CQL",n),"")},To={function:(n,e)=>Po[n.function](n,e),literal:n=>n.value,wildcard:n=>{const{value:e}=n;return` LIKE '${e.split(So).join("%")}'`}},Ee=(n,e)=>{const s=To[n.type];return s(n,e)},Oo=oe,Do=n=>({$and:(n.arguments||[]).map(i=>he(i))}),Lo=n=>{const{arguments:[e,s]}=n;let i=he(s);if(s.type==="wildcard"&&s.value==="@kuery-wildcard@")return xi(n);let t={};return t[he(e)]={$eq:i},t},zo=n=>({$or:(n.arguments||[]).map(s=>he(s))}),No=n=>{const[e]=n.arguments;let s={};return s={$ne:he(e)},s},Bo={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},Mo=n=>{const[e,s]=n.arguments;let i=s.value;const o=Bo[s.name];let t=he(i),l={};return l[e.value]={},l[e.value][o]=t,l},xi=n=>{const[e]=n.arguments;return{[he(e)]:{$ne:null}}},jo={is:Lo,and:Do,or:zo,not:No,range:Mo,exists:xi,nested:n=>(console.warn("TODO Implement nested search",n),"")},Ro={function:n=>jo[n.function](n),literal:n=>n.value,wildcard:n=>{const{value:e}=n;return`/${e.split(Oo).join(".*")}/`}},he=(n,e)=>{const s=Ro[n.type];return s(n,e)},Io=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:Si,doesKueryExpressionHaveLuceneSyntaxError:Un,fromKueryExpression:Ct,fromLiteralExpression:Be,nodeTypes:J,parse:Ct,toCql:Ee,toDSL:B,toMongo:he,toOpenSearchQuery:B},Symbol.toStringTag,{value:"Module"})),Uo=F`
|
|
753
779
|
:host {
|
|
754
780
|
--dialog-padding: var(--spectric-dialog-padding, 5px);
|
|
755
781
|
--dialog-background:var(--spectric-background,rgb(246, 249, 252));
|
|
@@ -796,11 +822,11 @@ spectric-button{
|
|
|
796
822
|
right: 0;
|
|
797
823
|
top: 0;
|
|
798
824
|
}
|
|
799
|
-
`;var
|
|
825
|
+
`;var Ho=Object.defineProperty,Fo=Object.getOwnPropertyDescriptor,de=(n,e,s,i)=>{for(var o=i>1?void 0:i?Fo(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&Ho(e,s,o),o};const xt="spectric-dialog";h.DialogElement=class extends z{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async e=>{const s=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||s===e.target&&(this.open=!1)},this._handleKeyDown=e=>{this.closeOnEscape||e.preventDefault(),this.open&&this.closeOnEscape&&e.key==="Escape"&&(this.open=!1)},this._onClose=e=>{e.preventDefault(),e.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static display(e,s){let i=document.createElement(xt);i.addEventListener("close",()=>{i.remove()});for(let t in e)i[t]=e[t];let o=document.createDocumentFragment();return rt(s,o),i.appendChild(o),i.open=!0,document.body.appendChild(i),i}connectedCallback(){super.connectedCallback(),this.dialogElement.then(e=>e.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(e=>e.removeEventListener("keydown",this._handleKeyDown))}updated(e){e.has("open")&&this.dialogElement.then(s=>{this.open?s.showModal():s.close()})}render(){return w`
|
|
800
826
|
<dialog class=${this.hideBackdrop?"":"backdrop"} @close=${this._onClose} @click=${this.clickHandler}>
|
|
801
827
|
<spectric-panel>
|
|
802
828
|
<div class="modal">
|
|
803
|
-
${this.dismissable?
|
|
829
|
+
${this.dismissable?w`<spectric-button variant="text" size="small" @click=${()=>{this.open=!1}}>X</spectric-button>`:null}
|
|
804
830
|
<h3 >
|
|
805
831
|
<slot name="title">
|
|
806
832
|
${this.title.length?this.title:null}
|
|
@@ -812,33 +838,42 @@ spectric-button{
|
|
|
812
838
|
</div>
|
|
813
839
|
</spectric-panel>
|
|
814
840
|
</dialog>
|
|
815
|
-
`}},h.DialogElement.styles=
|
|
841
|
+
`}},h.DialogElement.styles=Uo,de([v({type:Boolean,reflect:!0})],h.DialogElement.prototype,"open",2),de([v({type:Boolean,reflect:!0})],h.DialogElement.prototype,"dismissable",2),de([v({type:Boolean,reflect:!0})],h.DialogElement.prototype,"hideBackdrop",2),de([v({type:String,reflect:!0})],h.DialogElement.prototype,"title",2),de([v({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnEscape",2),de([v({type:Boolean,reflect:!0})],h.DialogElement.prototype,"closeOnOutsideClick",2),de([st("dialog")],h.DialogElement.prototype,"dialogElement",2),h.DialogElement=de([T(xt)],h.DialogElement);var Qo=Object.defineProperty,qo=Object.getOwnPropertyDescriptor,ee=(n,e,s,i)=>{for(var o=i>1?void 0:i?qo(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&Qo(e,s,o),o},mr=(n=>(n.MONGO="toMongo",n.CQL="toCql",n.DSL="toDSL",n.AST="AST",n))(mr||{});const Ei={eq:{value:" : ",label:" equals some value"},gt:{value:" > ",label:" is greater than some value"},lt:{value:" < ",label:" is less than some value"},gte:{value:" >= ",label:" is greater than or equal to some value"},lte:{value:" <= ",label:" is less than or equal to some value"}},Wo={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},Vo=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}],Yo=Object.fromEntries(Object.entries(Ei).map(([n,e])=>[n,{value:e.value,label:(e.label||"").replace("value","date-time")}]));h.SpectricQuery=class extends z{constructor(){super(),this.placeholder="",this._value="",this.value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._parseQuery=(e=void 0)=>{let s;if(e&&(e!=null&&e.currentTarget)&&(this.value=e.currentTarget.value),this.value)try{e&&e.data=="("&&(this.value=this.value+" )",this._input.setSelectionRange(this.value.length-2,this.value.length-2));let t=this.value;this._input.selectionStart!==null&&(t=t.substring(0,this._input.selectionStart)+"@kuery-cursor@"+t.substring(this._input.selectionStart));let l=Ct(t,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(l)}catch{return}try{s=Ct(this.value,{allowLeadingWildcards:!1})}catch{return}let i;this.outputLanguage=="AST"?i=s:i=Io[this.outputLanguage](s,this.fields);let o=new CustomEvent("change",{detail:i});this.dispatchEvent(o)},this.getValuesForField=async(e,s)=>(console.log("getValuesForField isn't set no values returned",e,s),[]),this._selectCompletion=async()=>{if(!this.suggestion)return;let e=this.completions[this.completionIndex],s=this.value.substring(0,e.start)+e.value,i=s.length,o=this.value.substring(e.end);if(e.value.includes(o)?this.value=s:this.value=s+this.value.substring(e.end),this._input.value=this.value,this._input.setSelectionRange(i,i),e.onSelect){let t=await e.onSelect();t!==void 0&&(this.value+=t,setTimeout(()=>{this._input.focus()}))}this.completionIndex=0,this.completions=[],this._parseQuery(),this._input.focus()},this._handleArrows=e=>{var s;e.key==="Escape"&&(this.completions=[]),(e.key=="ArrowLeft"||e.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(e.key)&&this.suggestion&&(e.preventDefault(),(e.key==="ArrowDown"||e.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),e.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(s=this._asyncAutocomplete)==null||s.then(i=>{let o=i.querySelector(".option.active");o&&o.scrollIntoView({block:"nearest"})}),e.key==="Enter"&&this._selectCompletion())},this.uuid=crypto.randomUUID()}createRenderRoot(){return this}async autoComplete(e){var t;if(this.completions=[],e.type!=="cursor")return;let s=[];this.suggestion=e;let{start:i,end:o}=e;for(let l of e.suggestionTypes){if(l=="conjunction"&&e.text.endsWith(" ")&&s.push(...["and ","or "].map(f=>({type:l,value:f,start:o,end:o}))),l==="field"){let f=this.fields.filter(d=>d.name.includes(e.fieldName)||d.name.includes(e.prefix)).map(d=>[{type:l,value:d.name,start:i,end:o}]).flat();s.push(...f)}if(l==="operator"){let f=this.fields.find(d=>d.name===e.fieldName);f&&(f.type==="number"?s.push(...Object.values(Ei).map(d=>({type:l,...d,start:o,end:o}))):f.type==="string"?f.format==="date-time"?s.push(...Object.values(Yo).map(d=>({type:l,...d,start:o,end:o,onSelect:async()=>{let y=await this.getValuesForField(e.fieldName,e.prefix);y.length===0&&(y=["now-1m","now-1d","now-1M"]);let C,$=ot();return await new Promise(E=>{let x=h.DialogElement.display({},w`
|
|
816
842
|
<div class="query-bar-date-quick-select">
|
|
817
|
-
${
|
|
843
|
+
${y.map(k=>w`<a href="#" @click=${D=>{D.preventDefault(),C=`"${k}"`,E(C),x.open=!1}}>${k}</a>`)}
|
|
818
844
|
</div>
|
|
819
|
-
<spectric-input variant="datetime-local" @change=${
|
|
820
|
-
<spectric-button ${
|
|
821
|
-
`)}),
|
|
845
|
+
<spectric-input variant="datetime-local" @change=${k=>{if(!k.target)return;C=`"${new Date(k.target.value+":00.000Z").toISOString()}"`,$.value.disabled=C===void 0}}></spectric-input>
|
|
846
|
+
<spectric-button ${at($)} .disabled=${!0} @click=${()=>{E(C),x.open=!1}}>Submit</spectric-button>
|
|
847
|
+
`)}),C}}))):s.push(...Object.values(Wo).map(d=>({type:l,...d,start:o,end:o}))):f.type==="boolean"&&s.push(...Vo.map(d=>({type:l,...d,start:o,end:o}))))}if(l==="value"){let f=this.fields.find(d=>d.name===e.fieldName);if(f&&f.type=="boolean")s.push({type:l,value:"true",start:i,end:o},{type:l,value:"false",start:i,end:o});else{console.log(`invoke callback to get values for ${e.fieldName}`);let d=await this.getValuesForField(e.fieldName,e.prefix);(f==null?void 0:f.type)==="string"&&(d=d.map(y=>`"${y}"`)),s.push(...d.map(y=>({type:l,value:y,start:i,end:o})))}}}if(this.completions=s,this.completions.length&&this._autocomplete){let{width:l}=this._input.getBoundingClientRect();this._autocomplete.maxWidth=l,this._autocomplete.showPopover(),this._autocomplete.style.width=`${l-15}px`;let f=this._autocomplete.querySelector("[popover]");f&&(f.style.width=`${l-15}px`)}else(t=this._autocomplete)==null||t.hidePopover()}updated(e){e.has("outputLanguage")&&this._parseQuery()}render(){return w`
|
|
822
848
|
<spectric-input .value=${this.value} .placeholder=${this.placeholder} style=${`anchor-name:--${this.uuid};`} autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows} @change=${e=>e.stopPropagation()}></spectric-input>
|
|
823
|
-
<
|
|
824
|
-
|
|
825
|
-
|
|
849
|
+
<spectric-popover position="bottom" class="autocomplete" .text=${this.completions.map((e,s)=>w`<div @click=${()=>{this.completionIndex=s,this._selectCompletion()}}
|
|
850
|
+
class=${this.completionIndex==s?"option active":"option"}>
|
|
851
|
+
<span class="optiontype ${e.type}">${e.type}</span>
|
|
852
|
+
<span class="value">${e.value}</span>
|
|
853
|
+
<span class="label">${e.label}</span>
|
|
854
|
+
</div>
|
|
855
|
+
`)}>
|
|
856
|
+
|
|
857
|
+
</spectric-popover>
|
|
858
|
+
`}},ee([v({type:String,reflect:!0})],h.SpectricQuery.prototype,"placeholder",2),ee([v({type:String,reflect:!0})],h.SpectricQuery.prototype,"value",2),ee([v({type:String,reflect:!0})],h.SpectricQuery.prototype,"outputLanguage",2),ee([Q()],h.SpectricQuery.prototype,"completions",2),ee([Q()],h.SpectricQuery.prototype,"completionIndex",2),ee([v({type:Array,reflect:!0})],h.SpectricQuery.prototype,"fields",2),ee([ue(".autocomplete")],h.SpectricQuery.prototype,"_autocomplete",2),ee([st(".autocomplete")],h.SpectricQuery.prototype,"_asyncAutocomplete",2),ee([ue("spectric-input")],h.SpectricQuery.prototype,"_input",2),h.SpectricQuery=ee([T("spectric-query")],h.SpectricQuery);const ki=F`
|
|
859
|
+
--panel-color: var(--spectric-background,#f4f4f4);
|
|
860
|
+
--panel-color-inverse: var(--spectric-background-inverse,#ffffff);
|
|
826
861
|
border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), var(--spectric-input-color, #000000) 3%);
|
|
827
862
|
background-color: var(--panel-color,#0b0b0b);
|
|
828
|
-
--spectric-input-color: var(--
|
|
863
|
+
--spectric-input-color: var(--panel-color-inverse);
|
|
829
864
|
color:var(--text-secondary,#3c4c5b);
|
|
830
|
-
--spectric-text-primary:var(--text-primary);
|
|
831
|
-
--spectric-text-secondary:var(--text-secondary);
|
|
865
|
+
--spectric-text-primary:var(--text-primary,#161616);
|
|
866
|
+
--spectric-text-secondary:var(--text-secondary,#525252);
|
|
832
867
|
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-secondary, #3c4c5b), transparent 50%));
|
|
833
|
-
`,
|
|
868
|
+
`,Pi=F`
|
|
834
869
|
border-color: color-mix(in hsl, var(--panel-color-inverse,#f4f4f4), var(--spectric-input-color, #000000) 3%);
|
|
835
870
|
background-color: var(--panel-color-inverse,#0b0b0b);
|
|
836
871
|
color:var(--text-primary,#3c4c5b);
|
|
837
872
|
--spectric-input-color: var(--panel-color);
|
|
838
|
-
--spectric-text-primary:var(--text-secondary);
|
|
839
|
-
--spectric-text-secondary:var(--text-primary);
|
|
873
|
+
--spectric-text-primary:var(--text-secondary,#525252);
|
|
874
|
+
--spectric-text-secondary:var(--text-primary,#161616);
|
|
840
875
|
filter: drop-shadow(0px 1px 3px color-mix(in srgb, var(--text-primary, #3c4c5b), transparent 70%));
|
|
841
|
-
`,
|
|
876
|
+
`,Zo=F`
|
|
842
877
|
:host{
|
|
843
878
|
display:block;
|
|
844
879
|
border:2px solid black;
|
|
@@ -848,20 +883,20 @@ spectric-button{
|
|
|
848
883
|
|
|
849
884
|
}
|
|
850
885
|
:host(spectric-panel[level='0']) {
|
|
851
|
-
${
|
|
886
|
+
${ki};
|
|
852
887
|
}
|
|
853
888
|
|
|
854
889
|
:host(spectric-panel[level='1']) {
|
|
855
|
-
${
|
|
890
|
+
${Pi};
|
|
856
891
|
}
|
|
857
892
|
|
|
858
893
|
:host(spectric-panel[level='2']) {
|
|
859
|
-
${
|
|
894
|
+
${ki};
|
|
860
895
|
}
|
|
861
896
|
:host(spectric-panel[level='3']) {
|
|
862
|
-
${
|
|
897
|
+
${Pi};
|
|
863
898
|
}
|
|
864
|
-
`;var
|
|
899
|
+
`;var Ko=Object.defineProperty,Xo=Object.getOwnPropertyDescriptor,yr=(n,e,s,i)=>{for(var o=i>1?void 0:i?Xo(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&Ko(e,s,o),o};h.SpectricPanel=class extends K{constructor(){super(),this.level=0,this.addDisposableListener(this,"layer-add",()=>{this.layers=this.querySelectorAll("spectric-panel")},{capture:!0})}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new CustomEvent("layer-add",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}update(e){this.layers=this.querySelectorAll("spectric-panel"),this.layers.forEach(s=>{s.setAttribute("level",((this.level+1)%4).toString())}),super.update(e)}render(){return w` <slot></slot> `}},h.SpectricPanel.styles=Zo,yr([v({type:Number,reflect:!0})],h.SpectricPanel.prototype,"level",2),yr([v({attribute:!1})],h.SpectricPanel.prototype,"layers",2),h.SpectricPanel=yr([T("spectric-panel")],h.SpectricPanel);var Go=Object.defineProperty,Jo=Object.getOwnPropertyDescriptor,Ti=(n,e,s,i)=>{for(var o=i>1?void 0:i?Jo(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&Go(e,s,o),o};const Oi={"--primary":{control:"color"},"--secondary":{control:"color"},"--tertiary":{control:"color"},"--disabled":{control:"color"},"--background":{control:"color"},"--background-inverse":{control:"color"},"--text-primary":{control:"color"},"--text-secondary":{control:"color"},"--text-on-color":{control:"color"},"--border-radius":{control:"text"}},Di={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#cccccc","--text-secondary":"#cccccc","--text-on-color":"#ededed","--background":"#181818","--background-inverse":"#37373d"},Li={...Di,"--primary":"#ffd45a","--text-on-color":"#4f4f4f"},$r={undefined:{},light:{},dark:Di,spectric:Li,spectricFlat:{...Li,"--border-radius":"1px"}},zi=Object.fromEntries(Object.keys($r).map(n=>[n,n])),Ni=["--spectric-background","--spectric-background-hover","--spectric-background-inverse","--spectric-background-inverse-hover","--spectric-border-radius","--spectric-primary","--spectric-secondary","--spectric-tertiary","--spectric-disabled","--panel-color","--panel-color-inverse","--spectric-border-disabled","--spectric-input-color","--spectric-input-bottom","--spectric-text-on-color","--spectric-text-on-color-disabled","--spectric-text-placeholder","--spectric-text-primary","--spectric-text-secondary","--spectric-button-separator","--spectric-button-primary","--spectric-button-secondary","--spectric-button-tertiary","--spectric-button-danger-primary","--spectric-button-danger-secondary","--spectric-button-danger-active","--spectric-button-primary-active","--spectric-button-secondary-active","--spectric-button-tertiary-active","--spectric-button-danger-hover","--spectric-button-primary-hover","--spectric-button-secondary-hover","--spectric-button-tertiary-hover","--spectric-text-on-color-disabled"],ea=`
|
|
865
900
|
--spectric-background: var(--background,#ffffff);
|
|
866
901
|
--spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
|
|
867
902
|
--spectric-background-inverse: var(--background-inverse,#f4f4f4);
|
|
@@ -904,12 +939,12 @@ spectric-button{
|
|
|
904
939
|
--spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
|
|
905
940
|
--spectric-button-disabled: #c6c6c6;
|
|
906
941
|
color: var(--spectric-text-primary);
|
|
907
|
-
`;h.SpectricThemeProvider=class extends
|
|
908
|
-
`);return
|
|
909
|
-
${this.theme&&this.theme!=="light"?
|
|
942
|
+
`;h.SpectricThemeProvider=class extends z{constructor(){super(...arguments),this.theme="undefined"}updated(e){if(e.has("theme")&&this.theme!=e.get("theme")){const s={old:e.get("theme"),new:this.theme};this.dispatchEvent(new CustomEvent("theme-change",{detail:s,bubbles:!0,composed:!0}))}}render(){let e=Object.keys($r).includes(this.theme)?this.theme:"undefined",s=Object.entries($r[e]).map(i=>`${i[0]}:${i[1]};`).join(`
|
|
943
|
+
`);return w`
|
|
944
|
+
${this.theme&&this.theme!=="light"?w`
|
|
910
945
|
<style>:host{
|
|
911
|
-
${
|
|
912
|
-
${
|
|
946
|
+
${s};
|
|
947
|
+
${ea}
|
|
913
948
|
}
|
|
914
949
|
/* Webkit psudo elements don't pick up variables defined by the host */
|
|
915
950
|
::-webkit-scrollbar-thumb {
|
|
@@ -980,9 +1015,9 @@ spectric-button{
|
|
|
980
1015
|
}
|
|
981
1016
|
</style>`:null}
|
|
982
1017
|
<slot></slot>
|
|
983
|
-
`}},h.SpectricThemeProvider.styles=
|
|
1018
|
+
`}},h.SpectricThemeProvider.styles=F`:host{
|
|
984
1019
|
display:contents;
|
|
985
|
-
}`,
|
|
1020
|
+
}`,Ti([v({reflect:!0})],h.SpectricThemeProvider.prototype,"theme",2),h.SpectricThemeProvider=Ti([T("spectric-theme")],h.SpectricThemeProvider);const ta=F`
|
|
986
1021
|
:host {
|
|
987
1022
|
display: block;
|
|
988
1023
|
height: 100%;
|
|
@@ -1045,7 +1080,7 @@ spectric-button{
|
|
|
1045
1080
|
width: 5px;
|
|
1046
1081
|
cursor: ew-resize;
|
|
1047
1082
|
}
|
|
1048
|
-
`;var
|
|
1083
|
+
`;var ra=Object.defineProperty,ia=Object.getOwnPropertyDescriptor,q=(n,e,s,i)=>{for(var o=i>1?void 0:i?ia(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&ra(e,s,o),o},wr=(n=>(n.horizontal="horizontal",n.vertical="vertical",n))(wr||{});const _r="spectric-splitview";h.SplitView=class extends K{constructor(){super(),this.orientation="horizontal",this.percentage=50,this.invisible=!1,this.min=10,this.max=90,this.useSavedState=!0,this.isDragging=!1,this._error=!1,this._emitChange=()=>{let{percentage:s,orientation:i,invisible:o,min:t,max:l,useSavedState:f}=this,d=this.getAttribute("id");d&&this.useSavedState&&localStorage.setItem(`splitview-${d}`,String(s)),this.dispatchEvent(new CustomEvent("change",{detail:{orientation:i,percentage:s,invisible:o,min:t,max:l,useSavedState:f}}))},this._onMouseMove=ct(s=>{if(this.isDragging){const i=this.getBoundingClientRect();let o,t;this.orientation==="horizontal"?(o=s.clientX-i.left,t=o/i.width*100):(o=s.clientY-i.top,t=o/i.height*100),t=Math.min(Math.max(t,this.min),this.max),this.percentage=t,this._emitChange()}}),this._assignSlot=s=>{if(!s.target)return;let o=s.target.assignedNodes().filter(t=>t instanceof HTMLElement);o.length>2&&console.log("cannot assign more than 2 elements to a split view"),o.forEach(t=>{if(this._panel1.assignedNodes().length===0){t.slot="panel1";return}if(this._panel2.assignedNodes().length===0){t.slot="panel2";return}this._error="Too many element assigned to split view splitter can only have a maximum of 2 children",console.warn("Too many element assigned to split view splitter can only have a maximum of 2 children")})};let e=this.getAttribute("id");if(e&&this.useSavedState){let s=localStorage.getItem(`splitview-${e}`);s&&(this.percentage=parseFloat(s))}this.addDisposableListener(this._splitter,"mousedown",()=>{this.isDragging=!0}),this.addDisposableListener(this._splitter,"dblclick",()=>{this.percentage=50,this._emitChange()}),this.addDisposableListener(document.body,"mousemove",this._onMouseMove),this.addDisposableListener(document.body,"mouseup",()=>{this.isDragging=!1})}updated(e){e.has("percentage")&&(this.percentage=Math.min(Math.max(Number(this.percentage),this.min),this.max))}render(){return w`
|
|
1049
1084
|
<div class="split-view ${this.orientation} ${this._error?"error":""} ${this.isDragging?"active":""}" style="--split-percentage: ${this.percentage}%;">
|
|
1050
1085
|
<span class="error-display">${this._error}</span>
|
|
1051
1086
|
<div class="panel" style="${this.orientation==="horizontal"?"flex: var(--split-percentage, 50%)":"max-height: var(--split-percentage, 50%)"}">
|
|
@@ -1057,15 +1092,15 @@ spectric-button{
|
|
|
1057
1092
|
</div>
|
|
1058
1093
|
</div>
|
|
1059
1094
|
<slot @slotchange=${this._assignSlot} style="display:none"></slot>
|
|
1060
|
-
`}},h.SplitView.styles=
|
|
1095
|
+
`}},h.SplitView.styles=ta,q([v({type:String})],h.SplitView.prototype,"orientation",2),q([v({type:Number,reflect:!0})],h.SplitView.prototype,"percentage",2),q([v({type:Boolean})],h.SplitView.prototype,"invisible",2),q([v({type:Number,reflect:!0})],h.SplitView.prototype,"min",2),q([v({type:Number,reflect:!0})],h.SplitView.prototype,"max",2),q([v({type:Boolean,reflect:!0})],h.SplitView.prototype,"useSavedState",2),q([Q()],h.SplitView.prototype,"isDragging",2),q([Q()],h.SplitView.prototype,"_error",2),q([st(".splitter")],h.SplitView.prototype,"_splitter",2),q([ue("slot[name='panel1']")],h.SplitView.prototype,"_panel1",2),q([ue("slot[name='panel2']")],h.SplitView.prototype,"_panel2",2),h.SplitView=q([T(_r)],h.SplitView);var sa=Object.defineProperty,na=Object.getOwnPropertyDescriptor,ke=(n,e,s,i)=>{for(var o=i>1?void 0:i?na(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&sa(e,s,o),o};const Sr="spectric-pagination";h.PaginationElement=class extends z{constructor(){super(...arguments),this.page=1,this.pageSize=10,this.pageSizeOptions=[10,20,50,100,1e3],this.size="xsmall",this._handlePageUp=()=>{this.page+=1,this._emitChange()},this._handlePageDown=()=>{this.page-=1,this._emitChange()},this._handleSizeChange=e=>{e.stopPropagation(),e.preventDefault();let s=parseInt(e.target.value);this.pageSize=s,this._emitChange()},this._emitChange=()=>{let{page:e,pageSize:s}=this;this.dispatchEvent(new CustomEvent("change",{detail:{page:e,pageSize:s}}))}}createRenderRoot(){return this}update(e){e.has("pageSize")&&!this.pageSizeOptions.includes(this.pageSize)&&(this.pageSizeOptions=[...this.pageSizeOptions,this.pageSize].sort((s,i)=>s-i),requestAnimationFrame(()=>{this.select&&this.select.value!==String(this.pageSize)&&(this.select.value=String(this.pageSize))})),super.update(e)}render(){let e=this.page*this.pageSize,s=!0;this.totalItems&&e<this.totalItems&&(s=!1);let i="";return this.totalItems&&(i=`${this.page} of ${Math.ceil(this.totalItems/this.pageSize)}`),w`
|
|
1061
1096
|
<div class="spectric-pagination-container">
|
|
1062
1097
|
<div>
|
|
1063
1098
|
<!-- TODO/FIXME Make a select component and use it for cross browser styling-->
|
|
1064
1099
|
<select @change=${this._handleSizeChange} .value=${String(this.pageSize)}>
|
|
1065
|
-
${this.pageSizeOptions.map(o=>
|
|
1100
|
+
${this.pageSizeOptions.map(o=>w`<option .value=${String(o)} class=${String(o)===String(this.pageSize)?"selected":""}>${o}</option>`)}
|
|
1066
1101
|
</select>
|
|
1067
1102
|
</div>
|
|
1068
|
-
${this.totalItems?
|
|
1103
|
+
${this.totalItems?w`
|
|
1069
1104
|
<div class="spectric-pagination-text">${`Items ${(this.page-1)*this.pageSize}-${Math.min(this.page*this.pageSize,this.totalItems)} of ${this.totalItems}`}</div>
|
|
1070
1105
|
<div class="spectric-pagination-container">
|
|
1071
1106
|
<div>
|
|
@@ -1073,105 +1108,190 @@ spectric-button{
|
|
|
1073
1108
|
</div>
|
|
1074
1109
|
<div>
|
|
1075
1110
|
<spectric-button size=${this.size} ?disabled=${this.page===1} @click=${this._handlePageDown} icon>🠈</spectric-button>
|
|
1076
|
-
<spectric-button size=${this.size} ?disabled=${
|
|
1111
|
+
<spectric-button size=${this.size} ?disabled=${s} @click=${this._handlePageUp} icon>🠊</spectric-button>
|
|
1077
1112
|
</div>
|
|
1078
1113
|
</div>
|
|
1079
1114
|
`:null}
|
|
1080
1115
|
</div>
|
|
1081
|
-
`}},
|
|
1116
|
+
`}},ke([v({type:Number,reflect:!0})],h.PaginationElement.prototype,"page",2),ke([v({type:Number,reflect:!0})],h.PaginationElement.prototype,"pageSize",2),ke([v({type:Number,reflect:!0})],h.PaginationElement.prototype,"totalItems",2),ke([v({type:Array})],h.PaginationElement.prototype,"pageSizeOptions",2),ke([ue("select")],h.PaginationElement.prototype,"select",2),ke([v({type:String,reflect:!0})],h.PaginationElement.prototype,"size",2),h.PaginationElement=ke([T(Sr)],h.PaginationElement);const oa=Object.freeze(Object.defineProperty({__proto__:null,BitArray:cr,DisposableElement:K,getListeners:vi},Symbol.toStringTag,{value:"Module"}));var aa=Object.defineProperty,ca=Object.getOwnPropertyDescriptor,Ar=(n,e,s,i)=>{for(var o=i>1?void 0:i?ca(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&aa(e,s,o),o};const la="spectric-table-header";let Et=class extends K{constructor(){super(),this.columns=[],this._handleSortChange=n=>{this._resizeStart||(n=JSON.parse(JSON.stringify(n)),n.sortable&&(n.sortDirection===M.none||n.sortDirection===void 0?n.sortDirection=M.ascending:n.sortDirection===M.ascending?n.sortDirection=M.descending:n.sortDirection===M.descending&&(n.sortDirection=M.none),this.dispatchEvent(new CustomEvent("sortChange",{composed:!0,bubbles:!0,detail:n}))))},this._handleResizeStart=(n,e)=>{this._resizeStart={event:n,column:e}},this._handleResizeEnd=n=>{var s;if(!this._resizeStart)return;let e=n.pageX-((s=this._resizeStart)==null?void 0:s.event.pageX);if(this._resizeStart.column.width)this._resizeStart.column.width=this._resizeStart.column.width+e;else{let i=this._resizeStart.event.target.closest("td");this._resizeStart.column.width=i.getBoundingClientRect().width+e}this.dispatchEvent(new CustomEvent("columnResize",{detail:this._resizeStart.column})),requestAnimationFrame(()=>{if(this._resizeStart=void 0,window.getSelection){let i=window.getSelection();i&&i.removeAllRanges()}})},this.addDisposableListener(()=>document.body,"mouseup",this._handleResizeEnd)}createRenderRoot(){return this}render(){return w`
|
|
1082
1117
|
<tr>
|
|
1083
|
-
${this.columns.map(
|
|
1118
|
+
${this.columns.map(n=>this.renderCell(n))}
|
|
1084
1119
|
</tr>
|
|
1085
|
-
`}renderCell(
|
|
1120
|
+
`}renderCell(n){let e=["header-contents"];n.filterable,n.sortable&&e.push("sortable"),this._resizeStart&&e.push("resizing");let s=n.width?`min-width:${n.width}px;max-width:${n.width}px;`:"",i=n.sortDirection===M.ascending?"🠉":n.sortDirection==M.descending?"🠋":"",o=n.sortDirection||M.none,l=n.allowResize||n.allowResize===void 0?w`<div
|
|
1086
1121
|
class="header-resize-handle"
|
|
1087
|
-
@mousedown=${
|
|
1122
|
+
@mousedown=${f=>{this._handleResizeStart(f,n)}}
|
|
1088
1123
|
@mouseup=${this._handleResizeEnd}
|
|
1089
|
-
></div>`:null;return
|
|
1090
|
-
@click=${()=>this._handleSortChange(
|
|
1091
|
-
style="${
|
|
1124
|
+
></div>`:null;return w` <td
|
|
1125
|
+
@click=${()=>this._handleSortChange(n)}
|
|
1126
|
+
style="${s}"
|
|
1092
1127
|
>
|
|
1093
1128
|
${l}
|
|
1094
1129
|
<div class=${e.join(" ")}>
|
|
1095
|
-
${
|
|
1130
|
+
${n.title||n.key}
|
|
1096
1131
|
<span class="sort-direction ${o}">${i}</span>
|
|
1097
1132
|
</div>
|
|
1098
|
-
</td>`}};
|
|
1133
|
+
</td>`}};Ar([v({type:Array,attribute:!1})],Et.prototype,"columns",2),Ar([Q()],Et.prototype,"_resizeStart",2),Et=Ar([T(la)],Et);/**
|
|
1099
1134
|
* @license
|
|
1100
1135
|
* Copyright 2017 Google LLC
|
|
1101
1136
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1102
|
-
*/const
|
|
1137
|
+
*/const Bi=n=>vn(n)?n._$litType$.h:n.strings,pa=it(class extends mt{constructor(n){super(n),this.et=new WeakMap}render(n){return[n]}update(n,[e]){const s=mi(this.it)?Bi(this.it):null,i=mi(e)?Bi(e):null;if(s!==null&&(i===null||s!==i)){const o=nr(n).pop();let t=this.et.get(s);if(t===void 0){const l=document.createDocumentFragment();t=rt(P,l),t.setConnected(!1),this.et.set(s,t)}sr(t,[o]),_e(t,void 0,o)}if(i!==null){if(s===null||s!==i){const o=this.et.get(i);if(o!==void 0){const t=nr(o).pop();yn(n),_e(n,void 0,t),sr(n,[t])}}this.it=e}else this.it=void 0;return this.render(e)}});var ua=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,Me=(n,e,s,i)=>{for(var o=i>1?void 0:i?ha(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&ua(e,s,o),o};const da="spectric-table-cell";let Pe=class extends z{constructor(){super(...arguments),this.overflow="",this.styleRules={whiteSpace:"",width:""},this._handleFilterOut=()=>{let n;this.column.key&&typeof this.row=="object"&&(n=je(this.row,this.column.key)),this._emitFilter({include:!1,row:this.row,value:n,column:this.column})},this._handleFilterFor=()=>{let n;this.column.key&&typeof this.row=="object"&&(n=je(this.row,this.column.key)),this._emitFilter({include:!0,row:this.row,value:n,column:this.column})},this._displayTooltip=()=>{let n=this.querySelector("div.cell-contents"),e=this.querySelector("span");if(n&&e){let s=e.getBoundingClientRect(),i=n.getBoundingClientRect();s.width*s.height>i.width*i.height?(console.log("We need to show a tooltip witht he content because we are overflowing"),this.overflow=this.getRenderedValue(),this.updateComplete.then(()=>{let o=this.querySelector("spectric-tooltip");o&&o.showToolTip()})):this.overflow=""}}}createRenderRoot(){return this}updated(n){}_emitFilter(n){this.dispatchEvent(new CustomEvent("filter",{composed:!0,bubbles:!0,detail:n}))}getRenderedValue(){let n;return this.column.render?n=this.column.render(this.row,this.index,this.table):this.column.key&&typeof this.row=="object"?n=je(this.row,this.column.key):n=w`error`,n}render(){let n=this.getRenderedValue(),e=["cell-contents"];this.column.filterable&&e.push("filterable");let s=pa(this.column.filterable?w`<div class="table-cell-actions">
|
|
1103
1138
|
<spectric-button @click=${this._handleFilterOut} size="tiny" variant="text" icon tooltip="Filter Out Value">-</spectric-button>
|
|
1104
|
-
<spectric-button @click=${this._handleFilterFor} size="tiny" variant="text" icon tooltip="Filter For Value">+</spectric-button></div>`:null);return this.styleRules={width:this.column.width?this.column.width+"px":null,whiteSpace:this.column.whiteSpace||null},
|
|
1105
|
-
<td style=${
|
|
1106
|
-
${
|
|
1107
|
-
<div class=${e.join(" ")}>${this.overflow?
|
|
1139
|
+
<spectric-button @click=${this._handleFilterFor} size="tiny" variant="text" icon tooltip="Filter For Value">+</spectric-button></div>`:null);return this.styleRules={width:this.column.width?this.column.width+"px":null,whiteSpace:this.column.whiteSpace||null},w`
|
|
1140
|
+
<td style=${er(this.styleRules)} @mouseenter=${this._displayTooltip}>
|
|
1141
|
+
${s}
|
|
1142
|
+
<div class=${e.join(" ")}>${this.overflow?w`<spectric-tooltip .text=${this.overflow}></spectric-tooltip>`:null}<span>${n}</span></div>
|
|
1108
1143
|
</td>
|
|
1109
|
-
`}};
|
|
1144
|
+
`}};Me([v({type:Object,attribute:!1})],Pe.prototype,"row",2),Me([v({type:Number,attribute:!1})],Pe.prototype,"index",2),Me([v({type:Object,attribute:!1})],Pe.prototype,"column",2),Me([Q()],Pe.prototype,"overflow",2),Me([ue("td")],Pe.prototype,"td",2),Pe=Me([T(da)],Pe);const je=(n,e)=>{let s=e.split("."),i=n[s[0]];return i==null||s.length>1&&(i=je(i,s.slice(1).join("."))),i};/**
|
|
1110
1145
|
* @license
|
|
1111
1146
|
* Copyright 2017 Google LLC
|
|
1112
1147
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1113
|
-
*/const
|
|
1148
|
+
*/const Mi=(n,e,s)=>{const i=new Map;for(let o=e;o<=s;o++)i.set(n[o],o);return i},kt=it(class extends mt{constructor(n){if(super(n),n.type!==Jt.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,e,s){let i;s===void 0?s=e:e!==void 0&&(i=e);const o=[],t=[];let l=0;for(const f of n)o[l]=i?i(f,l):l,t[l]=s(f,l),l++;return{values:t,keys:o}}render(n,e,s){return this.dt(n,e,s).values}update(n,[e,s,i]){const o=nr(n),{values:t,keys:l}=this.dt(e,s,i);if(!Array.isArray(o))return this.ut=l,t;const f=this.ut??(this.ut=[]),d=[];let y,C,$=0,E=o.length-1,x=0,k=t.length-1;for(;$<=E&&x<=k;)if(o[$]===null)$++;else if(o[E]===null)E--;else if(f[$]===l[x])d[x]=Se(o[$],t[x]),$++,x++;else if(f[E]===l[k])d[k]=Se(o[E],t[k]),E--,k--;else if(f[$]===l[k])d[k]=Se(o[$],t[k]),_e(n,d[k+1],o[$]),$++,k--;else if(f[E]===l[x])d[x]=Se(o[E],t[x]),_e(n,o[$],o[E]),E--,x++;else if(y===void 0&&(y=Mi(l,x,k),C=Mi(f,$,E)),y.has(f[$]))if(y.has(f[E])){const D=C.get(l[x]),I=D!==void 0?o[D]:null;if(I===null){const H=_e(n,o[$]);Se(H,t[x]),d[x]=H}else d[x]=Se(I,t[x]),_e(n,o[$],I),o[D]=null;x++}else or(o[E]),E--;else or(o[$]),$++;for(;x<=k;){const D=_e(n,d[k+1]);Se(D,t[x]),d[x++]=D}for(;$<=E;){const D=o[$++];D!==null&&or(D)}return this.ut=l,sr(n,d),pe}});var fa=Object.defineProperty,ga=Object.getOwnPropertyDescriptor,Cr=(n,e,s,i)=>{for(var o=i>1?void 0:i?ga(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&fa(e,s,o),o};const va="spectric-table-body";let Pt=class extends z{constructor(){super(...arguments),this.data=[],this.columns=[]}createRenderRoot(){return this}firstUpdated(n){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 w`
|
|
1114
1149
|
<body>
|
|
1115
|
-
${
|
|
1150
|
+
${kt(this.data,(n,e)=>w`
|
|
1116
1151
|
<tr class="${e%2===0?"odd":""}">
|
|
1117
|
-
${
|
|
1152
|
+
${kt(this.columns,s=>w`<spectric-table-cell .column=${s} .index=${e} .row=${n} .columns=${this.columns}></spectric-table-cell>`)}
|
|
1118
1153
|
</tr>`)}
|
|
1119
1154
|
|
|
1120
1155
|
</body>
|
|
1121
|
-
`}};
|
|
1156
|
+
`}};Cr([v({type:Array,attribute:!1})],Pt.prototype,"data",2),Cr([v({type:Array,attribute:!1})],Pt.prototype,"columns",2),Pt=Cr([T(va)],Pt);var ba=Object.defineProperty,ma=Object.getOwnPropertyDescriptor,lt=(n,e,s,i)=>{for(var o=i>1?void 0:i?ma(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&ba(e,s,o),o};const ya="spectric-table-virtual-body";let Re=class extends K{constructor(){super(),this.data=[],this.columns=[],this.rowHeight=30,this.startIndex=0,this.columnsMeasured=!1,this.addDisposableListener(()=>this.table.querySelector(".table-wrapper"),"scroll",()=>{const n=this.table.querySelector(".table-wrapper").scrollTop;requestAnimationFrame(()=>{this.startIndex=Math.floor(n/this.rowHeight)})})}updated(){if(this.columnsMeasured===!1){let n=this.querySelector("tr"),e=n==null?void 0:n.querySelectorAll("spectric-table-cell td");n&&e&&e.length&&(this.columns.forEach((s,i)=>{if(!s.width||s.width===0){let o=e[i].getBoundingClientRect();o.width>0&&(this.columnsMeasured=!0,s.width=o.width-Ie)}}),this.columns=[...this.columns])}}createRenderRoot(){return this}render(){let n=this.data.length,e=10,s=this.table.querySelector("spectric-table-header").clientHeight,i=this.table.querySelector(".table-wrapper"),o=Math.max(this.startIndex,0);const t=Math.ceil((i.clientHeight-s)/this.rowHeight),l=Math.min(o+t+e,n),f=l-o;let d=n*this.rowHeight,y=o*this.rowHeight+(i.scrollTop-o*this.rowHeight);l===n&&(y=o*this.rowHeight);let C=f*this.rowHeight,$=d-y-C,E=o!=0?w`
|
|
1122
1157
|
<tr style="height:${y}px" class="virtual-scroll-spacer">
|
|
1123
|
-
<td colspan="${this.columns.length}"></td></tr>`:null,
|
|
1158
|
+
<td colspan="${this.columns.length}"></td></tr>`:null,x=w`
|
|
1124
1159
|
<tr style="height:${$}px" class="virtual-scroll-spacer">
|
|
1125
|
-
<td colspan="${this.columns.length}"></td></tr>`;return
|
|
1126
|
-
<div style="height:${
|
|
1160
|
+
<td colspan="${this.columns.length}"></td></tr>`;return w`
|
|
1161
|
+
<div style="height:${d}px;position: absolute;overflow-x: hidden;overflow-y: hidden;z-index:-1;width:1px;"></div>
|
|
1127
1162
|
<tbody>
|
|
1128
1163
|
${E}
|
|
1129
1164
|
</tbody>
|
|
1130
|
-
<div style="display:table-row-group;max-height:${
|
|
1165
|
+
<div style="display:table-row-group;max-height:${C}px; overflow:hidden;">
|
|
1131
1166
|
|
|
1132
|
-
${
|
|
1133
|
-
<tr class="${(
|
|
1134
|
-
${
|
|
1167
|
+
${kt(this.data.slice(Math.max(o,0),l),(k,D)=>w`
|
|
1168
|
+
<tr class="${(D+o)%2===0?"odd":""}">
|
|
1169
|
+
${kt(this.columns,I=>w`<spectric-table-cell .column=${I} .row=${k} .index=${D+o} .columns=${this.columns}></spectric-table-cell>`)}
|
|
1135
1170
|
</tr>`)}
|
|
1136
1171
|
</div>
|
|
1137
1172
|
<tbody>
|
|
1138
|
-
${$>0?
|
|
1173
|
+
${$>0?x:null}
|
|
1139
1174
|
</tbody>
|
|
1140
1175
|
|
|
1141
|
-
`}};
|
|
1142
|
-
<div class="table-wrapper" style="--rowHeight:${
|
|
1176
|
+
`}};lt([v({type:Array,attribute:!1})],Re.prototype,"data",2),lt([v({type:Array,attribute:!1})],Re.prototype,"columns",2),lt([v({type:Number,attribute:!1})],Re.prototype,"rowHeight",2),lt([v({type:Number,state:!0})],Re.prototype,"startIndex",2),Re=lt([T(ya)],Re);function ji(n){let e=!1,s;return function(...i){return e||(e=!0,s=n.apply(this,i)),s}}const $a=n=>n.map(({key:e,sortDirection:s,compareFn:i})=>(o,t)=>{if(!e)return;let l=je(o,e),f=je(t,e);if(i)return i(o,t);if(typeof l=="number"||typeof l=="bigint"||typeof l=="boolean"){let d=l-f;return s===M.descending&&(d=d*-1),d}else if(typeof l=="string")return l.localeCompare(f)*(s===M.descending?-1:1)});var wa=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,te=(n,e,s,i)=>{for(var o=i>1?void 0:i?_a(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&wa(e,s,o),o};const xr="spectric-table";var Er=(n=>(n.multi="multi",n.single="single",n.none="none",n))(Er||{}),kr=(n=>(n.multi="multi",n.single="single",n))(kr||{}),M=(n=>(n.ascending="ascending",n.descending="descending",n.none="none",n))(M||{});const Ie=4,Ri=Symbol("spectric-table-selection-column");h.SpectricTableElement=class extends z{constructor(){super(...arguments),this.data=[],this.columns=[],this.select="none",this.sort="single",this.sortOrder=[],this.rowHeight=25,this.fontSize=16,this._handlePaginationChange=e=>{if(this.pagination){let s={...this.pagination,...e.detail},{totalItems:i,page:o,pageSize:t}=s;i&&o&&t&&(o-1)*t>i&&(s.page=1),this.pagination=s}this.dispatchEvent(new CustomEvent("paginationChange",{detail:e.detail})),this._emitChange()},this._handleSortChange=e=>{let s=e.detail,i=this.columns.find(o=>o.key==s.key);if(!i||i.key===void 0){console.warn("Unable to find sort column");return}if(this.sort=="single"&&(this.columns.forEach(o=>{o.sortDirection="none"}),this.sortOrder=[]),i.sortDirection=s.sortDirection,!i.sortDirection||i.sortDirection==="none"){let o=this.sortOrder.findIndex(t=>t===i.key);o!==-1&&this.sortOrder.splice(o,1)}else this.sortOrder.findIndex(t=>t===i.key)===-1&&(this.sortOrder=[...this.sortOrder,i.key]);this.columns=[...this.columns],this._emitChange()},this._handleColumnResize=e=>{let s=e.detail,i=this.columns.findIndex(o=>o.key==s.key);this.columns[i]={...this.columns[i]},this.columns=[...this.columns],this._emitChange()},this._emitChange=()=>{let{pagination:e,columns:s,sortOrder:i}=this;this.dispatchEvent(new CustomEvent("change",{detail:{pagination:e,columns:s,sortOrder:i}}))},this.__DO_NOT_USE_filter=()=>{this.dispatchEvent(new CustomEvent("filter")),this.dispatchEvent(new CustomEvent("sortChange"))},this.selected=[],this._handleSelectAllChange=e=>{e.stopPropagation(),e.target.checked?this.selectAll():this.deselectAll()}}static getDefaultDataSorterAndPaginatior(e){return s=>{let i=(s.sortOrder||[]).map(f=>s.columns.find(d=>d.key===f)),o=[...e];if(i.length){let f=$a(i);o.sort((d,y)=>{for(let C of f){let $=C(d,y);if($)return $}return 0})}if(!s.pagination)return o;let{page:t,pageSize:l}=s.pagination;return!t||!l?o:s.pagination?o.slice((t-1)*l,t*l):o}}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(e){e.has("columns")&&this.select!=="none"&&(this.columns.find(s=>s[Ri])||this.columns.unshift({[Ri]:!0,title:this.select==="multi"?w`<spectric-input variant="checkbox" @change=${this._handleSelectAllChange} .helperText=${"Select All"}></spectric-input>`:null,render:s=>{let i=document.createElement("div"),o=this.selected.includes(s),t=w`<spectric-input variant="checkbox" class="table-checkbox-${this.select}" .helperText=${""} ${xe({checked:o})} @change=${l=>{l.stopPropagation();let f=this.selected.findIndex(d=>d===s);if(!(l.target.checked&&f!==-1)){{if(!l.target.checked&&f===-1)return;!l.target.checked&&f!==-1&&this.selected.splice(f,1)}l.target.checked&&(this.select==="single"&&(this.selected=[]),this.selected.push(s)),this.dispatchEvent(new CustomEvent("selected",{detail:[...this.selected]}))}}}></spectric-input>`;return rt(t,i),t}})),e.has("select")&&this.select==="single"&&this.selected.length>1&&(this.selected=[this.selected[0]],this.dispatchEvent(new CustomEvent("selected",{detail:[...this.selected]}))),super.update(e)}render(){let e=this.columns.filter(i=>!i.hidden),s=this.rowHeight-Ie;return s<this.fontSize+Ie&&(s=this.fontSize+Ie),w`
|
|
1177
|
+
<div class="table-wrapper" style="--rowHeight:${s}px;--fontSize:${this.fontSize}px;--lineClamp:${Math.floor(s/this.fontSize)}">
|
|
1143
1178
|
<div role="table">
|
|
1144
1179
|
<spectric-table-header .columns=${e} @sortChange=${this._handleSortChange} @columnResize=${this._handleColumnResize}></spectric-table-header>
|
|
1145
|
-
<spectric-table-virtual-body .columns=${e} .data=${this.data} .table=${this} .rowHeight=${
|
|
1180
|
+
<spectric-table-virtual-body .columns=${e} .data=${this.data} .table=${this} .rowHeight=${s}></spectric-table-virtual-body>
|
|
1146
1181
|
</div>
|
|
1147
1182
|
</div>
|
|
1148
|
-
${this.pagination?
|
|
1149
|
-
`}},
|
|
1183
|
+
${this.pagination?w`<spectric-pagination ${xe(this.pagination)} @change=${this._handlePaginationChange}></spectric-pagination>`:null}
|
|
1184
|
+
`}},te([v({type:Array,attribute:!1})],h.SpectricTableElement.prototype,"data",2),te([v({type:Object,attribute:!1})],h.SpectricTableElement.prototype,"pagination",2),te([v({attribute:!1})],h.SpectricTableElement.prototype,"columns",2),te([v({type:String,reflect:!0})],h.SpectricTableElement.prototype,"select",2),te([v({type:String,reflect:!0})],h.SpectricTableElement.prototype,"sort",2),te([v({type:Array,reflect:!1})],h.SpectricTableElement.prototype,"sortOrder",2),te([v({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"rowHeight",2),te([v({type:Number,reflect:!0})],h.SpectricTableElement.prototype,"fontSize",2),te([Q()],h.SpectricTableElement.prototype,"selected",2),h.SpectricTableElement=te([T(xr)],h.SpectricTableElement);var Sa=Object.defineProperty,Aa=Object.getOwnPropertyDescriptor,V=(n,e,s,i)=>{for(var o=i>1?void 0:i?Aa(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&Sa(e,s,o),o};const Ca="spectric-popover";let j=class extends K{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.mouseOffsetX=10,this.mouseOffsetY=0,this.portalTarget=document.body,this.open=!1,this._getMousePosition=n=>{this.mouseLocation={left:n.clientX,top:n.clientY},this.position=="mouse"&&this.open&&!this.mouseframe&&(this.mouseframe=requestAnimationFrame(()=>this.positionTooltip()))},this.applyStyle=n=>{Object.entries(n).forEach(([e,s])=>{this.portalElement.style.setProperty(e,s)})},this.positionTooltip=()=>{if(!this.target)return;let n={};const e=this.target.getBoundingClientRect(),s=this.portalElement.getBoundingClientRect();this.target!==document.body&&this.maxWidth&&this.maxWidth>0&&(s.width=Math.min(s.width,this.maxWidth));let i;this.position==="mouse"&&this.mouseLocation?(this.mouseframe=void 0,i={left:this.mouseLocation.left+this.mouseOffsetX+"px",top:this.mouseLocation.top+this.mouseOffsetY-s.height/2+"px"}):this.position==="top"?i={top:e.top-s.height+"px",left:e.left+e.width/2-s.width/2+"px"}:this.position==="bottom"?i={top:e.bottom+"px",left:e.left+e.width/2-s.width/2+"px"}:this.position==="left"?i={top:Math.max(0,e.top+e.height/2-s.height/2)+"px",left:e.left-s.width+"px"}:this.position==="right"?i={top:Math.max(0,e.top+e.height/2-s.height/2)+"px",left:e.right+"px"}:(i={left:"0px",top:"0px"},console.error("Unknown position... Maybe we sould implement auto?")),this.applyStyle({...n,...i}),this.position!=="mouse"&&this.portalElement.animate({opacity:[0,1]},{duration:this.animationDuration})},this.showPopover=this.showPopover.bind(this),this.hidePopover=this.hidePopover.bind(this),this.addDisposableListener(()=>this.target,"mousemove",this._getMousePosition)}isOpen(){return this.open}get target(){return this.triggerTarget||this.parentElement}createRenderRoot(){return this}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}hidePopover(){this.timer&&clearTimeout(this.timer),this.open=!1,this.portalElement.hidePopover()}async showPopover(){this.timer&&clearTimeout(this.timer),await new Promise(n=>{this.timer=window.setTimeout(n,this.delay)}),this.portalElement.showPopover(),this.open=!0,requestAnimationFrame(this.positionTooltip)}render(){return w`<!-- ToolTip -->
|
|
1185
|
+
<div class="spectric-popover-portal ${this.position}" popover>
|
|
1186
|
+
<div class="tooltip-container">
|
|
1150
1187
|
<span class="tooltip-caret"></span>
|
|
1151
|
-
<div class="tooltip-content">${this.text}
|
|
1152
|
-
</div
|
|
1188
|
+
<div class="tooltip-content">${this.text}<slot></slot></div>
|
|
1189
|
+
</div>
|
|
1190
|
+
</div>`}};j.styles=F`:host{max-height: 0px;
|
|
1153
1191
|
max-width: 0px;
|
|
1154
1192
|
display: none;
|
|
1155
|
-
pointer-events:none;}`,
|
|
1193
|
+
pointer-events:none;}`,V([v({type:Number,reflect:!0})],j.prototype,"delay",2),V([v({type:Number,reflect:!0})],j.prototype,"animationDuration",2),V([v({type:String,reflect:!1})],j.prototype,"text",2),V([v({type:String,reflect:!0})],j.prototype,"position",2),V([v({type:Number,reflect:!0})],j.prototype,"maxWidth",2),V([v({type:Number,reflect:!1})],j.prototype,"mouseOffsetX",2),V([v({type:Number,reflect:!1})],j.prototype,"mouseOffsetY",2),V([ue(".spectric-popover-portal")],j.prototype,"portalElement",2),V([v({attribute:!1})],j.prototype,"portalTarget",2),V([v({attribute:!1})],j.prototype,"triggerTarget",2),j=V([T(Ca)],j);var xa=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,fe=(n,e,s,i)=>{for(var o=i>1?void 0:i?Ea(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&xa(e,s,o),o};const Pr="spectric-tooltip";var Tr=(n=>(n.top="top",n.bottom="bottom",n.left="left",n.right="right",n.mouse="mouse",n))(Tr||{});h.TooltipElement=class extends j{constructor(){super(),this.delay=100,this.animationDuration=0,this.text="",this.position="right",this.maxWidth=300,this.portalTarget=document.body,this.open=!1,this.showToolTip=this.showToolTip.bind(this),this.addDisposableListener(()=>this.target,"mouseover",this.showToolTip),this.addDisposableListener(()=>this.target,"mouseleave",this.hidePopover)}async showToolTip(){await super.showPopover(),this.portalElement.classList.add("spectric-tooltip-portal")}},h.TooltipElement.styles=F`:host{max-height: 0px;
|
|
1156
1194
|
max-width: 0px;
|
|
1157
1195
|
display: none;
|
|
1158
|
-
pointer-events:none;}`,
|
|
1196
|
+
pointer-events:none;}`,fe([v({type:Number,reflect:!0})],h.TooltipElement.prototype,"delay",2),fe([v({type:Number,reflect:!0})],h.TooltipElement.prototype,"animationDuration",2),fe([v({type:String,reflect:!1})],h.TooltipElement.prototype,"text",2),fe([v({type:String,reflect:!0})],h.TooltipElement.prototype,"position",2),fe([v({type:Number,reflect:!0})],h.TooltipElement.prototype,"maxWidth",2),fe([v({attribute:!1})],h.TooltipElement.prototype,"portalTarget",2),fe([v({attribute:!1})],h.TooltipElement.prototype,"triggerTarget",2),h.TooltipElement=fe([T(Pr)],h.TooltipElement);var ka=Object.defineProperty,Pa=Object.getOwnPropertyDescriptor,U=(n,e,s,i)=>{for(var o=i>1?void 0:i?Pa(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&ka(e,s,o),o};let Ue;window.hasOwnProperty("EyeDropper")&&(Ue=new EyeDropper);let R=class extends z{constructor(){super(),this.value="#FF0000FF",this.showAlpha=!0,this.hue=0,this.alpha=1,this.saturation=1,this.lightness=1,this.canvas=ot(),this.sldown=!1,this._handleAlphaChange=this._handleAlphaChange.bind(this),this._handleHueChange=this._handleHueChange.bind(this),this._handleApply=this._handleApply.bind(this),this._cancel=this._cancel.bind(this),this._handleSaturationLightnessClick=this._handleSaturationLightnessClick.bind(this)}createRenderRoot(){return this}update(n){if(n.has("value")){let{h:e,s,l:i,a:o}=Ii(this.value);this.hue=e,this.saturation=s,this.lightness=i,this.alpha=o,this.renderHueSaturationGrid()}super.update(n)}renderHueSaturationGrid(){if(!this.canvas.value)return;let e=this.canvas.value.getContext("2d");if(!e)return;let s=this.canvas.value.width/100,i=this.canvas.value.height/100,o=0,t=0;for(let l of Oa(this.hue))e.fillStyle=l,e.fillRect(o,t,s,i),o+=s,o=o%(s*101),o||(t+=i)}_handleSaturationLightnessClick(n){if(!this.canvas.value)return;let{offsetX:e,offsetY:s}=n;this.saturation=e/this.canvas.value.width,this.lightness=(this.canvas.value.height-s)/this.canvas.value.height,this.updateValue()}_handleHueChange(n){n.stopPropagation(),this.hue=parseInt(String(n.target.value))/100*360,n.target.style.setProperty("accent-color",`hsl(${this.hue}deg 100% 50%)`),this.renderHueSaturationGrid(),this.updateValue()}updateValue(){let n=Da(this.hue,this.saturation*100,this.lightness*100)+Math.round(this.alpha*255).toString(16).padStart(2,"0");this.value=n}_handleAlphaChange(n){n.stopPropagation(),this.alpha=parseInt(String(n.target.value))/100,this.updateValue()}_handleApply(){var n;this.updateValue(),(n=this.querySelector("spectric-popover"))==null||n.hidePopover(),this.dispatchEvent(new Event("change",{bubbles:!0}))}_cancel(){var n;this.original&&(this.value=this.original),(n=this.querySelector("spectric-popover"))==null||n.hidePopover(),this.dispatchEvent(new Event("cancel"))}async _openPopover(){var e;let n=this.querySelector("spectric-popover");if(!(!n||n.isOpen())){for(this.original=this.value,(e=this.querySelector("spectric-popover"))==null||e.showPopover();!this.canvas.value;)await new Promise(s=>setTimeout(s,100));this.renderHueSaturationGrid()}}getPopover(){return w`
|
|
1159
1197
|
<spectric-input label="Hue" class="hue-gradient" variant="range" .value=${this.hue||0} style="accent-color:hsl(${this.hue}deg 100% 50%)" @change=${this._handleHueChange}></spectric-input>
|
|
1160
|
-
<canvas ${
|
|
1161
|
-
@mousedown=${
|
|
1162
|
-
@mouseup=${
|
|
1163
|
-
@mousemove=${
|
|
1198
|
+
<canvas ${at(this.canvas)} width=200 height=100 class="color-picker-saturation-lightness-grid" @click=${this._handleSaturationLightnessClick}
|
|
1199
|
+
@mousedown=${n=>{this.sldown=!0,n.preventDefault(),n.stopPropagation()}}
|
|
1200
|
+
@mouseup=${n=>{this.sldown=!1,n.preventDefault(),n.stopPropagation()}}
|
|
1201
|
+
@mousemove=${n=>{this.sldown&&this._handleSaturationLightnessClick(n)}}
|
|
1164
1202
|
></canvas>
|
|
1165
1203
|
<spectric-input class="alpha-gradient" ?hidden=${!this.showAlpha} label="Opacity" variant="range" .value=${(this.alpha||1)*100} @change=${this._handleAlphaChange}></spectric-input>
|
|
1166
1204
|
<div class="color-picker-footer">
|
|
1167
|
-
<spectric-button
|
|
1205
|
+
<spectric-button icon class="color-picker-eyedropper ${Ue===void 0?"hidden":""}" @click=${async()=>{if(Ue){let n=await(Ue==null?void 0:Ue.open()),{h:e,s,l:i,a:o}=Ii(n.sRGBHex);this.hue=e,this.saturation=s,this.lightness=i,this.alpha=o,this.updateValue()}}}>${Ta}</spectric-button>
|
|
1168
1206
|
<spectric-button @click=${this._handleApply}>Apply</spectric-button>
|
|
1169
1207
|
<spectric-button variant="secondary" @click=${this._cancel}>Cancel</spectric-button>
|
|
1170
1208
|
</div>
|
|
1171
|
-
`}render(){return
|
|
1172
|
-
<spectric-button variant="
|
|
1209
|
+
`}render(){return w`
|
|
1210
|
+
<spectric-button variant="secondary" @click=${this._openPopover} icon>
|
|
1173
1211
|
<spectric-popover .text=${this.getPopover()} icon variant="text"></spectric-popover>
|
|
1174
1212
|
<div style="width:15px;height:15px;background-color:${this.value}"></div>
|
|
1175
1213
|
</spectric-button>
|
|
1176
|
-
`}};
|
|
1214
|
+
`}};U([v({type:String,reflect:!0})],R.prototype,"value",2),U([v({type:Boolean,reflect:!0})],R.prototype,"showAlpha",2),U([Q()],R.prototype,"hue",2),U([Q()],R.prototype,"alpha",2),U([Q()],R.prototype,"saturation",2),U([Q()],R.prototype,"lightness",2),U([we({capture:!0})],R.prototype,"_handleSaturationLightnessClick",1),U([we({capture:!0})],R.prototype,"_handleHueChange",1),U([we({capture:!0})],R.prototype,"_handleAlphaChange",1),U([we({capture:!0})],R.prototype,"_handleApply",1),U([we({capture:!0})],R.prototype,"_cancel",1),U([we({capture:!0})],R.prototype,"_openPopover",1),R=U([T("spectric-colorpicker")],R);const Ta=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" height="15" width="15" fill="currentColor"><path d="M222,67.34a33.81,33.81,0,0,0-10.64-24.25C198.12,30.56,176.68,31,163.54,44.18L142.82,65l-.63-.63a22,22,0,0,0-31.11,0l-9,9a14,14,0,0,0,0,19.81l3.47,3.47L53.14,149.1a37.79,37.79,0,0,0-9.84,36.73l-8.31,19a11.68,11.68,0,0,0,2.46,13A13.91,13.91,0,0,0,47.32,222,14.15,14.15,0,0,0,53,220.82L71,212.92a37.92,37.92,0,0,0,35.84-10.07l52.44-52.46,3.47,3.48a14,14,0,0,0,19.8,0l9-9a22,22,0,0,0,0-31.12l-.66-.66L212,91.85A33.76,33.76,0,0,0,222,67.34Zm-123.61,127a26,26,0,0,1-26,6.47,6,6,0,0,0-4.16.24l-20,8.75a2,2,0,0,1-2.09-.31l9.12-20.9a5.94,5.94,0,0,0,.19-4.31,25.88,25.88,0,0,1,6.26-26.72l52.44-52.45,36.76,36.78Zm105.16-111L178.17,108.9a6,6,0,0,0,0,8.47l4.88,4.89a10,10,0,0,1,0,14.15l-9,9a2,2,0,0,1-2.82,0l-60.69-60.7a2,2,0,0,1,0-2.83l9-9a10,10,0,0,1,14.14,0l4.89,4.89a6,6,0,0,0,4.24,1.75h0a6,6,0,0,0,4.25-1.77L172,52.66c8.58-8.58,22.52-9,31.08-.85a22,22,0,0,1,.44,31.57Z"/></svg>`;function*Oa(n){for(let e=100;e>=0;e--)for(let s=0;s<=100;s++)yield`hsl(${n}, ${s}%, ${e}%)`}function Da(n,e,s){s/=100;const i=e*Math.min(s,1-s)/100,o=t=>{const l=(t+n/30)%12,f=s-i*Math.max(Math.min(l-3,9-l,1),-1);return Math.round(255*f).toString(16).padStart(2,"0")};return`#${o(0)}${o(8)}${o(4)}`}function Ii(n){let e=0,s=0,i=0,o=255;n.length===4||n.length===5?(e=parseInt(n[1]+n[1],16),s=parseInt(n[2]+n[2],16),i=parseInt(n[3]+n[3],16),n.length===5&&(o=parseInt(n[4]+n[4],16))):(n.length===7||n.length===9)&&(e=parseInt(n.substring(1,3),16),s=parseInt(n.substring(3,5),16),i=parseInt(n.substring(5,7),16),n.length===9&&(o=parseInt(n.substring(7,9),16))),e/=255,s/=255,i/=255,o/=255;const t=Math.max(e,s,i),l=Math.min(e,s,i);let f=0,d=0,y=(t+l)/2;if(t===l)f=0,d=0;else{const C=t-l;switch(d=y>.5?C/(2-t-l):C/(t+l),t){case e:f=(s-i)/C+(s<i?6:0);break;case s:f=(i-e)/C+2;break;case i:f=(e-s)/C+4;break}f/=6}return f=Math.round(f*360),{h:f,s:d,l:y,a:o}}const La=Object.freeze(Object.defineProperty({__proto__:null,SpreadPropsDirective:pr,debounce:_i,debounceAnimation:ct,once:ji,spreadProps:xe},Symbol.toStringTag,{value:"Module"}));var za=Object.defineProperty,Na=Object.getOwnPropertyDescriptor,He=(n,e,s,i)=>{for(var o=i>1?void 0:i?Na(e,s):e,t=n.length-1,l;t>=0;t--)(l=n[t])&&(o=(i?l(e,s,o):l(o))||o);return i&&o&&za(e,s,o),o};h.SpectricCalendar=class extends K{constructor(){super(),this.currentDate=new Date,this.date=new Date,this.popup=!1,this.disabled=!1,this.handleMouseMove=ct(async e=>{const s=await this.calendarElement,i=s.getBoundingClientRect(),o=(e.clientX-i.left)/i.width*100,t=(e.clientY-i.top)/i.height*100;s.style.setProperty("--x",`${o}%`),s.style.setProperty("--y",`${t}%`)}),this.resetMouseMove=async()=>{const e=await this.calendarElement;e.style.setProperty("--x","200%"),e.style.setProperty("--y","200%")},this.addDisposableListener(this.calendarElement,"mousemove",this.handleMouseMove),this.addDisposableListener(this.calendarElement,"mouseleave",this.resetMouseMove)}createRenderRoot(){return this}getMonthDays(e,s){const i=new Date(e,s,1),o=[],t=i.getUTCDay(),l=new Date(e,s+1,0).getUTCDate();for(let f=0;f<t;f++)o.push("");for(let f=1;f<=l;f++)o.push(f);return o}changeMonth(e){const s=new Date(this.date);s.setUTCMonth(s.getUTCMonth()+e),this.currentDate=s}changeYear(e){const s=parseInt(e.target.value,10),i=new Date(this.date);i.setUTCFullYear(s),this.currentDate=i}selectDay(e){let s=this.date.getUTCFullYear(),i=this.date.getUTCMonth(),o=this.date.getUTCHours(),t=this.date.getUTCMinutes(),l=this.date.getUTCSeconds(),f=this.date.getUTCMilliseconds(),d=new Date;d.setUTCFullYear(s,i,e),d.setUTCHours(o,t,l,f),console.log(d.toISOString(),s,i,e),this.date=d;let y=this.querySelector("spectric-popover");y&&y.hidePopover(),this.dispatchEvent(new CustomEvent("select",{detail:d}))}update(e){e.has("currentDate")&&(this.currentDate===void 0?this.date=new Date:this.date=new Date(this.currentDate)),super.update(e)}render(){const e=this.date.getUTCFullYear(),s=this.date.getUTCMonth(),i=this.date.getUTCDate();this.date.toUTCString();const o=new Date(e,s,i).toLocaleString("default",{month:"long"}),t=this.getMonthDays(e,s),l=Array.from({length:21},(d,y)=>e-10+y),f=w`<spectric-panel class="calendar">
|
|
1215
|
+
<div class="header">
|
|
1216
|
+
<spectric-button
|
|
1217
|
+
?disabled=${this.disabled}
|
|
1218
|
+
size="xsmall"
|
|
1219
|
+
icon
|
|
1220
|
+
variant="primary"
|
|
1221
|
+
@click=${()=>this.changeMonth(-1)}
|
|
1222
|
+
>🠈</spectric-button
|
|
1223
|
+
>
|
|
1224
|
+
<div class="month-year">
|
|
1225
|
+
<span>${o}</span>
|
|
1226
|
+
<select ?disabled=${this.disabled} @change=${this.changeYear}>
|
|
1227
|
+
${l.map(d=>w`<option value=${d} ?selected=${d===e}>${d}</option>`)}
|
|
1228
|
+
</select>
|
|
1229
|
+
</div>
|
|
1230
|
+
<spectric-button ?disabled=${this.disabled} size="xsmall" icon @click=${()=>this.changeMonth(1)}
|
|
1231
|
+
>🠊</spectric-button
|
|
1232
|
+
>
|
|
1233
|
+
</div>
|
|
1234
|
+
<div class="days">
|
|
1235
|
+
${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(d=>w`<div class="day">${d}</div>`)}
|
|
1236
|
+
${t.map(d=>d==""?w`<span></span>`:w`<spectric-button
|
|
1237
|
+
?disabled=${this.disabled}
|
|
1238
|
+
@click=${()=>this.selectDay(d)}
|
|
1239
|
+
.backgroundColor=${d===i?void 0:"var(--spectric-background,#f4f4f4)"}
|
|
1240
|
+
icon
|
|
1241
|
+
size="xsmall"
|
|
1242
|
+
class="date ${d===i?"active":""}"
|
|
1243
|
+
>${d}</spectric-button
|
|
1244
|
+
>`)}
|
|
1245
|
+
</div>
|
|
1246
|
+
</spectric-panel>`;return this.popup?w`
|
|
1247
|
+
<spectric-button
|
|
1248
|
+
class="input-button-right"
|
|
1249
|
+
icon
|
|
1250
|
+
size="small"
|
|
1251
|
+
variant="text"
|
|
1252
|
+
type="button"
|
|
1253
|
+
?disabled=${this.disabled}
|
|
1254
|
+
@click=${d=>{let y=this.querySelector("spectric-popover");y&&d.target&&(y.triggerTarget=d.target,y.showPopover())}}
|
|
1255
|
+
><svg
|
|
1256
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
1257
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
1258
|
+
viewBox="0 0 96 96"
|
|
1259
|
+
style="
|
|
1260
|
+
fill: var(--button-primary, #1ea7fd);
|
|
1261
|
+
"
|
|
1262
|
+
>
|
|
1263
|
+
<defs>
|
|
1264
|
+
<rect id="vcalendar-b" width="64" height="78" x="0" y="0"></rect>
|
|
1265
|
+
<filter
|
|
1266
|
+
id="vcalendar-a"
|
|
1267
|
+
width="110.9%"
|
|
1268
|
+
height="109%"
|
|
1269
|
+
x="-5.5%"
|
|
1270
|
+
y="-3.2%"
|
|
1271
|
+
filterUnits="objectBoundingBox"
|
|
1272
|
+
>
|
|
1273
|
+
<feOffset
|
|
1274
|
+
dy="1"
|
|
1275
|
+
in="SourceAlpha"
|
|
1276
|
+
result="shadowOffsetOuter1"
|
|
1277
|
+
></feOffset>
|
|
1278
|
+
<feGaussianBlur
|
|
1279
|
+
in="shadowOffsetOuter1"
|
|
1280
|
+
result="shadowBlurOuter1"
|
|
1281
|
+
stdDeviation="1"
|
|
1282
|
+
></feGaussianBlur>
|
|
1283
|
+
<feColorMatrix
|
|
1284
|
+
in="shadowBlurOuter1"
|
|
1285
|
+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"
|
|
1286
|
+
></feColorMatrix>
|
|
1287
|
+
</filter>
|
|
1288
|
+
</defs>
|
|
1289
|
+
<g fill-rule="evenodd">
|
|
1290
|
+
<path
|
|
1291
|
+
d="M36,36 L36,36.9983345 C36,38.642909 37.3431458,40 39,40 C40.6684055,40 42,38.6561086 42,36.9983345 L42,36 L54,36 L54,36.9983345 C54,38.642909 55.3431458,40 57,40 C58.6684055,40 60,38.6561086 60,36.9983345 L60,36 L64.0132046,36 C65.1104814,36 66,36.8892617 66,38.0017433 L66,65.9982567 C66,67.103789 65.1101074,68 64.0132046,68 L31.9867954,68 C30.8895186,68 30,67.1107383 30,65.9982567 L30,38.0017433 C30,36.896211 30.8898926,36 31.9867954,36 L36,36 Z M64,42 L32,42 L32,66 L64,66 L64,42 Z M50,56 L50,60 L46,60 L46,56 L50,56 Z M40,56 L40,60 L36,60 L36,56 L40,56 Z M60,56 L60,60 L56,60 L56,56 L60,56 Z M40,48 L40,52 L36,52 L36,48 L40,48 Z M50,48 L50,52 L46,52 L46,48 L50,48 Z M60,48 L60,52 L56,52 L56,48 L60,48 Z M39,32 C39.5522847,32 40,32.4509752 40,32.990778 L40,37.009222 C40,37.5173285 39.6172798,37.9361019 39.1173326,37.9933343 L39,38 C38.4477153,38 38,37.5490248 38,37.009222 L38,32.990778 C38,32.4826715 38.3827202,32.0638981 38.8826674,32.0066657 L39,32 Z M57,32 C57.5522847,32 58,32.4509752 58,32.990778 L58,37.009222 C58,37.5173285 57.6172798,37.9361019 57.1173326,37.9933343 L57,38 C56.4477153,38 56,37.5490248 56,37.009222 L56,32.990778 C56,32.4826715 56.3827202,32.0638981 56.8826674,32.0066657 L57,32 Z"
|
|
1292
|
+
></path>
|
|
1293
|
+
</g></svg>
|
|
1294
|
+
</spectric-button>
|
|
1295
|
+
<spectric-popover position="left" .text=${f}></spectric-popover>
|
|
1296
|
+
`:f}},He([st(".days")],h.SpectricCalendar.prototype,"calendarElement",2),He([v({attribute:!1})],h.SpectricCalendar.prototype,"currentDate",2),He([Q()],h.SpectricCalendar.prototype,"date",2),He([v({type:Boolean,reflect:!0})],h.SpectricCalendar.prototype,"popup",2),He([v({type:Boolean,reflect:!0})],h.SpectricCalendar.prototype,"disabled",2),h.SpectricCalendar=He([T("spectric-calendar")],h.SpectricCalendar);const Ba={...oa,...Object.freeze(Object.defineProperty({__proto__:null,get BitDisplayCanvas(){return h.BitDisplayCanvas},ButtonSizes:rr,ButtonVariants:ir,CSSPropsControls:Oi,get DialogElement(){return h.DialogElement},DialogElementTag:xt,ElementTag:_r,get Header(){return h.Header},InputVariants:hr,Orientations:wr,get PaginationElement(){return h.PaginationElement},PaginationElementTag:Sr,SPECTRIC_CSS_VARIABLES:Ni,get SpectricButton(){return h.SpectricButton},get SpectricCalendar(){return h.SpectricCalendar},get SpectricInput(){return h.SpectricInput},get SpectricPage(){return h.SpectricPage},get SpectricPanel(){return h.SpectricPanel},get SpectricQuery(){return h.SpectricQuery},get SpectricTableElement(){return h.SpectricTableElement},get SpectricThemeProvider(){return h.SpectricThemeProvider},get SplitView(){return h.SplitView},SupportedLanguages:mr,TD_BorderAndPadding:Ie,TableElementTag:xr,TableSelectOptions:Er,TableSortDirection:M,TableSortOption:kr,ThemeSelections:zi,get TooltipElement(){return h.TooltipElement},TooltipElementTag:Pr,TooltipPostions:Tr,nodeTypes:J},Symbol.toStringTag,{value:"Module"})),...La};h.BitArray=cr,h.ButtonSizes=rr,h.ButtonVariants=ir,h.CSSPropsControls=Oi,h.DialogElementTag=xt,h.DisposableElement=K,h.ElementTag=_r,h.InputVariants=hr,h.Orientations=wr,h.PaginationElementTag=Sr,h.SPECTRIC_CSS_VARIABLES=Ni,h.SpreadPropsDirective=pr,h.SupportedLanguages=mr,h.TD_BorderAndPadding=Ie,h.TableElementTag=xr,h.TableSelectOptions=Er,h.TableSortDirection=M,h.TableSortOption=kr,h.ThemeSelections=zi,h.TooltipElementTag=Pr,h.TooltipPostions=Tr,h.debounce=_i,h.debounceAnimation=ct,h.default=Ba,h.getListeners=vi,h.nodeTypes=J,h.once=ji,h.spreadProps=xe,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1177
1297
|
//# sourceMappingURL=index.umd.js.map
|