@spectric/ui 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/assets/Banner-CZ3qKIQC.js +172 -0
  2. package/dist/assets/Banner.stories-BMf4MBpI.js +19 -0
  3. package/dist/assets/BitDisplay.stories-wztXxpxe.js +18 -0
  4. package/dist/assets/Bits-C_TSTjST.js +1 -0
  5. package/dist/assets/Button.stories-gHxjWwVf.js +142 -0
  6. package/dist/assets/Color-F6OSRLHC-AjFOL-zN.js +1 -0
  7. package/dist/assets/DocsRenderer-CFRXHY34-CvW79YxE.js +761 -0
  8. package/dist/assets/Header.stories-Bc09U6g1.js +25 -0
  9. package/dist/assets/Page.stories-DNJKhAFs.js +114 -0
  10. package/dist/assets/QueryBar.stories-Da5C-SV4.js +17 -0
  11. package/dist/assets/_commonjsHelpers-Cpj98o6Y.js +1 -0
  12. package/dist/assets/chunk-L4EGOTBX-AI5g0G5Z.js +2 -0
  13. package/dist/assets/data-CwENMT7L.js +3 -0
  14. package/dist/assets/dialog-CFHXbUTQ.js +611 -0
  15. package/dist/assets/directive-helpers-IbK5tOA8.js +5 -0
  16. package/dist/assets/entry-preview-Di-j0SPB.js +4 -0
  17. package/dist/assets/entry-preview-docs-CUBRpM7y.js +1 -0
  18. package/dist/assets/iframe-BQFuVTVZ.js +2 -0
  19. package/dist/assets/index-BCiKWbv6.js +1 -0
  20. package/dist/assets/index-BHYIh-Xd.js +8 -0
  21. package/dist/assets/index-DBGhiA-l.js +1 -0
  22. package/dist/assets/index-DrFu-skq.js +6 -0
  23. package/dist/assets/index-oFsFREWh.js +9 -0
  24. package/dist/assets/input.stories-Cgdv-5bN.js +58 -0
  25. package/dist/assets/lit-element-UdLzEcH-.js +19 -0
  26. package/dist/assets/preview-BWzBA1C2.js +396 -0
  27. package/dist/assets/preview-CGiTbRot.js +2 -0
  28. package/dist/assets/preview-D77C14du.js +34 -0
  29. package/dist/assets/preview-DEMzn_yN.js +1 -0
  30. package/dist/assets/preview-DFmD0pui.js +1 -0
  31. package/dist/assets/preview-DGUiP6tS.js +7 -0
  32. package/dist/assets/preview-DQVTHjv1.js +182 -0
  33. package/dist/assets/preview-aVwhiz9X.js +1 -0
  34. package/dist/assets/tiny-invariant-CopsF_GD.js +1 -0
  35. package/dist/classes/BitArray.d.ts +11 -0
  36. package/dist/classes/DisposibleElement.d.ts +21 -0
  37. package/dist/components/Banner.d.ts +51 -0
  38. package/dist/components/Bitdisplay.d.ts +91 -0
  39. package/dist/components/Button.d.ts +65 -0
  40. package/dist/components/Header.d.ts +70 -0
  41. package/dist/components/Page.d.ts +93 -0
  42. package/dist/components/Panel.d.ts +14 -0
  43. package/dist/components/ThemeProvider.d.ts +99 -0
  44. package/dist/components/button.css.d.ts +2 -0
  45. package/dist/components/configurations/classifications.d.ts +29 -0
  46. package/dist/components/dialog/dialog.css.d.ts +1 -0
  47. package/dist/components/dialog/dialog.d.ts +60 -0
  48. package/dist/components/dialog/index.d.ts +1 -0
  49. package/dist/components/header.css.d.ts +2 -0
  50. package/dist/components/index.d.ts +10 -0
  51. package/dist/components/input.css.d.ts +2 -0
  52. package/dist/components/input.d.ts +156 -0
  53. package/dist/components/page.css.d.ts +2 -0
  54. package/dist/components/panel.css.d.ts +2 -0
  55. package/dist/components/query_bar/QueryBar.d.ts +108 -0
  56. package/dist/components/query_bar/index.d.ts +2 -0
  57. package/dist/components/query_bar/querylanguage/kuery/ast/ast.d.ts +13 -0
  58. package/dist/components/query_bar/querylanguage/kuery/ast/index.d.ts +1 -0
  59. package/dist/components/query_bar/querylanguage/kuery/functions/and.d.ts +9 -0
  60. package/dist/components/query_bar/querylanguage/kuery/functions/exists.d.ts +10 -0
  61. package/dist/components/query_bar/querylanguage/kuery/functions/index.d.ts +1 -0
  62. package/dist/components/query_bar/querylanguage/kuery/functions/is.d.ts +34 -0
  63. package/dist/components/query_bar/querylanguage/kuery/functions/nested.d.ts +11 -0
  64. package/dist/components/query_bar/querylanguage/kuery/functions/not.d.ts +9 -0
  65. package/dist/components/query_bar/querylanguage/kuery/functions/or.d.ts +10 -0
  66. package/dist/components/query_bar/querylanguage/kuery/functions/range.d.ts +10 -0
  67. package/dist/components/query_bar/querylanguage/kuery/functions/utils/get_fields.d.ts +2 -0
  68. package/dist/components/query_bar/querylanguage/kuery/functions/utils/get_full_field_name_node.d.ts +2 -0
  69. package/dist/components/query_bar/querylanguage/kuery/index.d.ts +7 -0
  70. package/dist/components/query_bar/querylanguage/kuery/kuery_syntax_error.d.ts +13 -0
  71. package/dist/components/query_bar/querylanguage/kuery/node_types/function.d.ts +5 -0
  72. package/dist/components/query_bar/querylanguage/kuery/node_types/index.d.ts +3 -0
  73. package/dist/components/query_bar/querylanguage/kuery/node_types/literal.d.ts +3 -0
  74. package/dist/components/query_bar/querylanguage/kuery/node_types/named_arg.d.ts +4 -0
  75. package/dist/components/query_bar/querylanguage/kuery/node_types/types.d.ts +49 -0
  76. package/dist/components/query_bar/querylanguage/kuery/node_types/wildcard.d.ts +8 -0
  77. package/dist/components/query_bar/querylanguage/kuery/types.d.ts +18 -0
  78. package/dist/components/query_bar/querylanguage/outputTypes/toCQL.d.ts +14 -0
  79. package/dist/components/query_bar/querylanguage/outputTypes/toMongo.d.ts +20 -0
  80. package/dist/components/query_bar/querylanguage/utils.d.ts +1 -0
  81. package/dist/components/query_bar/types.d.ts +56 -0
  82. package/dist/components/splitview/index.d.ts +1 -0
  83. package/dist/components/splitview/splitview.css.d.ts +1 -0
  84. package/dist/components/splitview/splitview.d.ts +73 -0
  85. package/dist/components/types.d.ts +21 -0
  86. package/dist/custom-elements.json +1915 -0
  87. package/dist/favicon.svg +1 -0
  88. package/dist/iframe.html +639 -0
  89. package/dist/index.d.ts +1 -0
  90. package/dist/index.es.js +4136 -0
  91. package/dist/index.es.js.map +1 -0
  92. package/dist/index.html +190 -0
  93. package/dist/index.json +1 -0
  94. package/dist/index.umd.js +945 -0
  95. package/dist/index.umd.js.map +1 -0
  96. package/dist/nunito-sans-bold-italic.woff2 +0 -0
  97. package/dist/nunito-sans-bold.woff2 +0 -0
  98. package/dist/nunito-sans-italic.woff2 +0 -0
  99. package/dist/nunito-sans-regular.woff2 +0 -0
  100. package/dist/project.json +1 -0
  101. package/dist/sb-addons/chromatic-com-storybook-8/manager-bundle.js +333 -0
  102. package/dist/sb-addons/chromatic-com-storybook-8/manager-bundle.js.LEGAL.txt +40 -0
  103. package/dist/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
  104. package/dist/sb-addons/essentials-actions-2/manager-bundle.js.LEGAL.txt +0 -0
  105. package/dist/sb-addons/essentials-backgrounds-3/manager-bundle.js +12 -0
  106. package/dist/sb-addons/essentials-backgrounds-3/manager-bundle.js.LEGAL.txt +0 -0
  107. package/dist/sb-addons/essentials-controls-1/manager-bundle.js +391 -0
  108. package/dist/sb-addons/essentials-controls-1/manager-bundle.js.LEGAL.txt +0 -0
  109. package/dist/sb-addons/essentials-measure-6/manager-bundle.js +3 -0
  110. package/dist/sb-addons/essentials-measure-6/manager-bundle.js.LEGAL.txt +0 -0
  111. package/dist/sb-addons/essentials-outline-7/manager-bundle.js +3 -0
  112. package/dist/sb-addons/essentials-outline-7/manager-bundle.js.LEGAL.txt +0 -0
  113. package/dist/sb-addons/essentials-toolbars-5/manager-bundle.js +3 -0
  114. package/dist/sb-addons/essentials-toolbars-5/manager-bundle.js.LEGAL.txt +0 -0
  115. package/dist/sb-addons/essentials-viewport-4/manager-bundle.js +3 -0
  116. package/dist/sb-addons/essentials-viewport-4/manager-bundle.js.LEGAL.txt +0 -0
  117. package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
  118. package/dist/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
  119. package/dist/sb-common-assets/favicon.svg +1 -0
  120. package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
  121. package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
  122. package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
  123. package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
  124. package/dist/sb-manager/globals-module-info.js +1028 -0
  125. package/dist/sb-manager/globals-runtime.js +40861 -0
  126. package/dist/sb-manager/globals.js +48 -0
  127. package/dist/sb-manager/runtime.js +13338 -0
  128. package/dist/sb-preview/globals.js +33 -0
  129. package/dist/sb-preview/runtime.js +7174 -0
  130. package/dist/style.css +1 -0
  131. package/dist/utils/debounce.d.ts +2 -0
  132. package/dist/utils/spread.d.ts +32 -0
  133. package/package.json +6 -1
  134. package/.gitlab-ci.yml +0 -28
  135. package/.nvmrc +0 -1
  136. package/.storybook/analyze.sh +0 -4
  137. package/.storybook/main.ts +0 -55
  138. package/.storybook/preview.ts +0 -42
  139. package/.vscode/extensions.json +0 -5
  140. package/.vscode/settings.json +0 -41
  141. package/html-include.png +0 -0
  142. package/test/__init__.py +0 -9
  143. package/test/elastic.py +0 -9
  144. package/test/interface.py +0 -16
  145. package/tsconfig.json +0 -29
  146. package/vite.config.js +0 -34
  147. package/vue-example.png +0 -0
  148. package/vue-include.png +0 -0
@@ -0,0 +1,611 @@
1
+ import{E as ze,i as z,r as V,x as w}from"./lit-element-UdLzEcH-.js";import{n as m,i as ki,b as Si,e as jr,t as ee}from"./Banner-CZ3qKIQC.js";import{f as Oi}from"./directive-helpers-IbK5tOA8.js";/**
2
+ * @license
3
+ * Copyright 2017 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */function Fr(i){return m({...i,state:!0,attribute:!1})}/**
6
+ * @license
7
+ * Copyright 2017 Google LLC
8
+ * SPDX-License-Identifier: BSD-3-Clause
9
+ */const Br=(i,n,l)=>(l.configurable=!0,l.enumerable=!0,Reflect.decorate&&typeof n!="object"&&Object.defineProperty(i,n,l),l);/**
10
+ * @license
11
+ * Copyright 2017 Google LLC
12
+ * SPDX-License-Identifier: BSD-3-Clause
13
+ */function yt(i,n){return(l,o,u)=>{const t=h=>{var y;return((y=h.renderRoot)==null?void 0:y.querySelector(i))??null};return Br(l,o,{get(){return t(this)}})}}/**
14
+ * @license
15
+ * Copyright 2017 Google LLC
16
+ * SPDX-License-Identifier: BSD-3-Clause
17
+ */function Dr(i){return(n,l)=>Br(n,l,{async get(){var o;return await this.updateComplete,((o=this.renderRoot)==null?void 0:o.querySelector(i))??null}})}/**
18
+ * @license
19
+ * Copyright 2017 Google LLC
20
+ * SPDX-License-Identifier: BSD-3-Clause
21
+ */const xe=(i,n)=>{var o;const l=i._$AN;if(l===void 0)return!1;for(const u of l)(o=u._$AO)==null||o.call(u,n,!1),xe(u,n);return!0},qe=i=>{let n,l;do{if((n=i._$AM)===void 0)break;l=n._$AN,l.delete(i),i=n}while((l==null?void 0:l.size)===0)},Qr=i=>{for(let n;n=i._$AM;i=n){let l=n._$AN;if(l===void 0)n._$AN=l=new Set;else if(l.has(i))break;l.add(i),Ei(n)}};function Li(i){this._$AN!==void 0?(qe(this),this._$AM=i,Qr(this)):this._$AM=i}function Ti(i,n=!1,l=0){const o=this._$AH,u=this._$AN;if(u!==void 0&&u.size!==0)if(n)if(Array.isArray(o))for(let t=l;t<o.length;t++)xe(o[t],!1),qe(o[t]);else o!=null&&(xe(o,!1),qe(o));else xe(this,i)}const Ei=i=>{i.type==Si.CHILD&&(i._$AP??(i._$AP=Ti),i._$AQ??(i._$AQ=Li))};class Rr extends ki{constructor(){super(...arguments),this._$AN=void 0}_$AT(n,l,o){super._$AT(n,l,o),Qr(this),this.isConnected=n._$AU}_$AO(n,l=!0){var o,u;n!==this.isConnected&&(this.isConnected=n,n?(o=this.reconnected)==null||o.call(this):(u=this.disconnected)==null||u.call(this)),l&&(xe(this,n),qe(this))}setValue(n){if(Oi(this._$Ct))this._$Ct._$AI(n,this);else{const l=[...this._$Ct._$AH];l[this._$Ci]=n,this._$Ct._$AI(l,this,0)}}disconnected(){}reconnected(){}}/**
22
+ * @license
23
+ * Copyright 2020 Google LLC
24
+ * SPDX-License-Identifier: BSD-3-Clause
25
+ */const ut=()=>new Ni;class Ni{}const pt=new WeakMap,ft=jr(class extends Rr{render(i){return ze}update(i,[n]){var o;const l=n!==this.Y;return l&&this.Y!==void 0&&this.rt(void 0),(l||this.lt!==this.ct)&&(this.Y=n,this.ht=(o=i.options)==null?void 0:o.host,this.rt(this.ct=i.element)),ze}rt(i){if(this.isConnected||(i=void 0),typeof this.Y=="function"){const n=this.ht??globalThis;let l=pt.get(n);l===void 0&&(l=new WeakMap,pt.set(n,l)),l.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),l.set(this.Y,i),i!==void 0&&this.Y.call(this.ht,i)}else this.Y.value=i}get lt(){var i,n;return typeof this.Y=="function"?(i=pt.get(this.ht??globalThis))==null?void 0:i.get(this.Y):(n=this.Y)==null?void 0:n.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),Pi=class{constructor(n){return this.buffer=n,this.u8=new Uint8Array(n),new Proxy(this,{get(l,o){return l[o]?l[o]:l.getBit(o)}})}getBit(n){var l=this.u8[n>>3],o=n&7;return l>>7-o&1}setBit(n,l){var o=n&7;l?this.u8[n>>3]|=128>>o:this.u8[n>>3]&=~(128>>o)}get length(){return this.u8.byteLength*8}set(n,l){for(let o=l||0,u=0,t=n.length;u<t;o++,u++)this.setBit(o,n[u])}subarray(n,l){let o=[];n=n||0,l=l||this.length,l=l>this.length?this.length:l;for(let u=n;u<l;u++)o.push(this.getBit(u));return o}};var ji=Object.defineProperty,Fi=Object.getOwnPropertyDescriptor,ge=(i,n,l,o)=>{for(var u=o>1?void 0:o?Fi(n,l):n,t=i.length-1,h;t>=0;t--)(h=i[t])&&(u=(o?h(n,l,u):h(u))||u);return o&&u&&ji(n,l,u),u};const Qe={width:200,height:200},Me={width:10,height:10};let X=class extends V{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:ut(),canvas:ut(),scrollDiv:ut()},this.color="#000000",this.onThemeChange=()=>{let i=getComputedStyle(this);console.log("HERE",i.color),this.color!=i.color&&(this.color=i.color,this.paint())},this.onResize=()=>{console.log("resize"),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()},this.resizeObserver=new ResizeObserver(this.onResize)}connectedCallback(){this.onResize(),super.connectedCallback(),this.resizeObserver.observe(this),document.body.addEventListener("theme-change",this.onThemeChange)}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver.disconnect(),document.body.removeEventListener("theme-change",this.onThemeChange)}updated(i){i.has("arrayBuffer")&&this.arrayBuffer&&(this._bitArray=new Pi(this.arrayBuffer));const n=["arrayBuffer","scale","frameWidth","width","height"];for(const l of n)if(i.has(l)){this.paint();return}}paint(){if(!this.refs.canvas.value||!this._bitArray)return;const{frameWidth:i,_bitArray:n}=this;if(i<=0)return;this.calculateViewport();const{width:l=Qe.width,height:o=Qe.height}=this,u=this.getPxPerBit(),t=this.refs.canvas.value.getContext("2d");if(!t)return;this.state.scale!=u&&(t.reset(),t.scale(u,u));let h=getComputedStyle(this);t.fillStyle=h.color,t.clearRect(0,0,l,o);let y=0;for(let $=this.yStart*i+this.xStart,S=n.length;$<S;$++){let M=$%i-this.xStart;if(!(M<0)){if(Math.floor(M*u)>l){y++,$=y*i+this.yStart*i+this.xStart-1;continue}if(Math.floor(y*u)>o)break;n.getBit($)===1&&t.fillRect(M,y,1,1),($+1)%i===0&&$>=i-1&&y++}}}getPxPerBit(){return this.scale>0?this.scale:1}calculateViewport(){const{frameWidth:i,_bitArray:n}=this;if(this.refs.scrollDiv.value){var l=this.getPxPerBit();const o=n.length/i*l,u=i*l,t=this.refs.scrollDiv.value;t.style.width=u+"px",t.style.height=o+"px"}}render(){const{height:i=Qe.height,width:n=Qe.width}=this;return w`
26
+ <div
27
+ id="viewport"
28
+ ${ft(this.refs.viewport)}
29
+ @scroll=${this.handleScroll}
30
+ style=${`width:${n}px;height:${i}px;overflow:auto;position:relative`}
31
+ >
32
+ <div
33
+ id="fakescrolldiv"
34
+ ${ft(this.refs.scrollDiv)}
35
+ >
36
+ </div>
37
+ </div>
38
+ <canvas
39
+ ${ft(this.refs.canvas)}
40
+ width=${n-Me.width}
41
+ height=${i-Me.height}
42
+ ></canvas>
43
+ `}};X.styles=z`
44
+ :host{
45
+ position: relative;
46
+ --border-radius: var(--spectric-border-radius,4em);
47
+ --scroll-color: var(--spectric-background-inverse,#393939);
48
+ --background-color: var(--spectric-background, #ffffff);
49
+ }
50
+ #viewport{
51
+ overflow: scroll;
52
+ position: absolute;
53
+ }
54
+ #fakescrolldiv {
55
+ position: relative;
56
+ overflow-x: hidden;
57
+ overflow-y: hidden;
58
+ }
59
+ canvas{
60
+ position: absolute;
61
+ left:0;
62
+ top:0;
63
+ background-color:var(--background-color);
64
+ }
65
+ ::-webkit-scrollbar {
66
+ height: ${Me.height}px;
67
+ width: ${Me.width}px;
68
+
69
+ }
70
+
71
+ /* Webkit psudo elements don't pick up variables defined by the host */
72
+ ::-webkit-scrollbar-thumb {
73
+ background: var(--spectric-background-inverse,#393939);
74
+ border-radius: var(--spectric-border-radius,4em);
75
+ -webkit-border-radius: var(--spectric-border-radius,4em);
76
+ padding-top: 1px;
77
+ padding-bottom: 1px;
78
+ }
79
+ ::-webkit-scrollbar-thumb:hover {
80
+ background: var(--spectric-background-inverse-hover,#474747);
81
+
82
+ }
83
+ ::-webkit-scrollbar-corner {
84
+ background: var(--spectric-background, #ffffff);
85
+ }
86
+ /* Buttons */
87
+
88
+ ::-webkit-scrollbar-button:single-button {
89
+ background-color: transparent;
90
+ display: block;
91
+ border-style: solid;
92
+ }
93
+ /* Up */
94
+ ::-webkit-scrollbar-button:single-button:vertical:decrement {
95
+ border-width: 0 5px 5px 5px;
96
+ border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff);
97
+ }
98
+ ::-webkit-scrollbar-button:single-button:vertical:decrement:hover {
99
+ border-color: var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747) var(--spectric-background, #ffffff);
100
+ }
101
+ /* Down */
102
+ ::-webkit-scrollbar-button:single-button:vertical:increment {
103
+ border-width: 5px 5px 0 5px;
104
+ border-color: var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
105
+ }
106
+
107
+ ::-webkit-scrollbar-button:vertical:single-button:increment:hover {
108
+ border-color: var(--spectric-background-inverse-hover,#474747) var(--spectric-background, #ffffff) transparent var(--spectric-background, #ffffff);
109
+ }
110
+
111
+ /* Left */
112
+ ::-webkit-scrollbar-button:single-button:horizontal:decrement {
113
+ border-width: 5px 5px 5px 0;
114
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
115
+
116
+ }
117
+
118
+ ::-webkit-scrollbar-button:single-button:horizontal:decrement:hover {
119
+ border-width: 5px 5px 5px 0;
120
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff);
121
+
122
+ }
123
+
124
+
125
+
126
+ /* Right */
127
+ ::-webkit-scrollbar-button:single-button:horizontal:increment {
128
+ border-width: 5px 0 5px 5px;
129
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse,#393939);
130
+
131
+ }
132
+
133
+ ::-webkit-scrollbar-button:single-button:horizontal:increment:hover {
134
+ border-width: 5px 0 5px 5px;
135
+ border-color:var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background, #ffffff) var(--spectric-background-inverse-hover,#474747);
136
+
137
+ }
138
+
139
+
140
+ `;ge([m({type:Object,attribute:!1})],X.prototype,"arrayBuffer",2);ge([m({type:Number})],X.prototype,"frameWidth",2);ge([m({type:Number})],X.prototype,"scale",2);ge([m({type:Number})],X.prototype,"width",2);ge([m({type:Number})],X.prototype,"height",2);X=ge([ee("spectric-bit-display")],X);const Bi=z`.spectric-header {
141
+ display: flex;
142
+ justify-content: space-between;
143
+ align-items: center;
144
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
145
+ padding: 15px 20px;
146
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
147
+ }
148
+
149
+ .spectric-header svg {
150
+ display: inline-block;
151
+ vertical-align: top;
152
+ }
153
+ .spectric-header slot {
154
+ display: inline-block;
155
+ vertical-align: middle;
156
+ }
157
+ .spectric-header h1 {
158
+ display: inline-block;
159
+ vertical-align: middle;
160
+ margin: 6px 0 6px 10px;
161
+ font-weight: 700;
162
+ font-size: 20px;
163
+ line-height: 1;
164
+ }
165
+
166
+ .spectric-header button + button {
167
+ margin-left: 10px;
168
+ }
169
+
170
+ .spectric-header .welcome {
171
+ margin-right: 10px;
172
+ color: #333;
173
+ font-size: 14px;
174
+ }
175
+ `;var Di=Object.defineProperty,Qi=Object.getOwnPropertyDescriptor,Ie=(i,n,l,o)=>{for(var u=o>1?void 0:o?Qi(n,l):n,t=i.length-1,h;t>=0;t--)(h=i[t])&&(u=(o?h(n,l,u):h(u))||u);return o&&u&&Di(n,l,u),u};let de=class extends V{constructor(){super(...arguments),this.showCreateAccount=!1,this.showLoginButton=!1,this.username="",this.onLogout=()=>{const i={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("logout",i))},this.onLogin=()=>{const i={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("login",i))},this.onCreateAccount=()=>{const i={bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("createAccount",i))}}render(){return console.log(this.showLoginButton,this.showCreateAccount),w`
176
+ <header>
177
+ <div class="spectric-header">
178
+ <div style="flex-grow:1;">
179
+ <slot name="branding"></slot>
180
+ <h1><slot name="name"></slot></h1>
181
+ <slot name="center"></slot>
182
+ </div>
183
+ ${this.showLoginButton!==!1?w`
184
+ <div>
185
+ ${this.username&&this.username!==""?w`<spectric-button variant="secondary" size="small" @click=${this.onLogout}>Log out</spectric-button>`:w`
186
+ ${this.showCreateAccount!==!1?w`<spectric-button variant="text" size="small" @click=${this.onCreateAccount}>Sign up</spectric-button>`:null}
187
+ <spectric-button variant="primary" size="small" @click=${this.onLogin}>Log in</spectric-button>`}
188
+
189
+
190
+ </div>`:null}
191
+ <slot name="end"></slot>
192
+ </div>
193
+ </header>
194
+ `}};de.styles=Bi;Ie([m({type:Boolean,reflect:!0})],de.prototype,"showCreateAccount",2);Ie([m({type:Boolean,reflect:!0})],de.prototype,"showLoginButton",2);Ie([m({type:String,reflect:!0})],de.prototype,"username",2);de=Ie([ee("spectric-header")],de);const Ri=z`
195
+
196
+ :host {
197
+ height:100vh;
198
+ width: 100%;
199
+ display: flex;
200
+ flex-direction: column;
201
+ font-size: 14px;
202
+ line-height: 24px;
203
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
204
+ --spectric-background: var(--background,#ffffff);
205
+ --spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
206
+ --spectric-background-inverse: var(--background-inverse,#f4f4f4);
207
+ --spectric-background-inverse-hover: var(--background-inverse-hover,#474747);
208
+ --spectric-border-radius: var(--border-radius,.4em);
209
+ --spectric-primary:var(--primary,#1ea7fd);
210
+ --spectric-secondary: var(--secondary,#77878b);
211
+ --spectric-tertiary: var(--tertiary,#0f62fe);
212
+ --spectric-disabled: var(--disabled,#c6c6c6);
213
+
214
+ /* panel */
215
+ --panel-color:var(--spectric-background-inverse);
216
+ --panel-color-inverse:var(--spectric-background);
217
+ --spectric-border-disabled: var(--disabled);
218
+
219
+ /*inputs*/
220
+ --spectric-input-color: var(--panel-color-inverse);
221
+ --spectric-input-bottom: var(--panel-color);
222
+
223
+ --spectric-text-on-color: var(--text-on-color,#ffffff);
224
+ --spectric-text-on-color-disabled: var(--text-on-color-disabled,#8d8d8d);
225
+ --spectric-text-placeholder: var(--text-placeholder,rgba(22, 22, 22, 0.4));
226
+ --spectric-text-primary: var(--text-primary,#161616);
227
+ --spectric-text-secondary: var(--text-secondary,#525252);
228
+ /* Buttons */
229
+ --spectric-button-separator: #e0e0e0;
230
+ --spectric-button-primary: var(--primary,#1ea7fd);
231
+ --spectric-button-secondary: var(--secondary,#77878b);
232
+ --spectric-button-tertiary: var(--tertiary);
233
+ --spectric-button-danger-primary: #da1e28;
234
+ --spectric-button-danger-secondary: #da1e28;
235
+ --spectric-button-danger-active: #750e13;
236
+ --spectric-button-primary-active: #002d9c;
237
+ --spectric-button-secondary-active: #6f6f6f;
238
+ --spectric-button-tertiary-active: #002d9c;
239
+ --spectric-button-danger-hover: #b81921;
240
+ --spectric-button-primary-hover: #0050e6;
241
+ --spectric-button-secondary-hover: #474747;
242
+ --spectric-button-tertiary-hover: #0050e6;
243
+ --spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
244
+ --spectric-button-disabled: #c6c6c6;
245
+ }
246
+ *{
247
+ color: var(--spectric-text-primary);
248
+ background-color: var(--spectric-background,rgb(255 255 255 / 60%));
249
+ }
250
+ article{
251
+ flex-grow:1;
252
+ overflow-y:auto;
253
+ padding-left: calc(var(--spectric-border-radius, 0.4em) + 2px);
254
+ padding-right: calc(var(--spectric-border-radius, 0.4em) + 2px);
255
+ }
256
+ h2 {
257
+ display: inline-block;
258
+ vertical-align: middle;
259
+ margin: 0 0 4px;
260
+ font-weight: 700;
261
+ font-size: 32px;
262
+ line-height: 1;
263
+ }
264
+
265
+ p {
266
+ margin: 1em 0;
267
+ }
268
+
269
+ a {
270
+ color: var(--primary);
271
+ text-decoration: var(--primary);
272
+ }
273
+
274
+ ul {
275
+ margin: 1em 0;
276
+ padding-left: 30px;
277
+ }
278
+
279
+ li {
280
+ margin-bottom: 8px;
281
+ }`;/**
282
+ * @license
283
+ * Copyright 2018 Google LLC
284
+ * SPDX-License-Identifier: BSD-3-Clause
285
+ */const ht=i=>i??ze;class zi extends Rr{constructor(){super(...arguments),this.prevData={}}render(n){return ze}update(n,[l]){var o;this.element!==n.element&&(this.element=n.element),this.host=((o=n.options)==null?void 0:o.host)||this.element,this.apply(l),this.groom(l),this.prevData={...l}}apply(n){if(!n)return;const{prevData:l,element:o}=this;for(const u in n){const t=n[u];t!==l[u]&&(o[u]=t)}}groom(n){const{prevData:l,element:o}=this;if(l)for(const u in l)(!n||!(u in n)&&o[u]===l[u])&&(o[u]=void 0)}}const dt=jr(zi);var gt=(i=>(i.None="none",i.Uscui="us.cui",i.Usclassified="us.classified",i.Usunclassified="us.unclassified",i.Usconfidential="us.confidential",i.Ussecret="us.secret",i.Ustopsecret="us.topsecret",i.UstopsecretSi="us.topsecret.si",i.Uknotset="uk.notset",i.Ukofficial="uk.official",i.Uksecret="uk.secret",i.Uktopsecret="uk.topsecret",i.Caprotected_a="ca.protected_a",i.Caprotected_b="ca.protected_b",i.Caprotected_c="ca.protected_c",i.Caconfidential="ca.confidential",i.Casecret="ca.secret",i.Catopsecret="ca.topsecret",i.Auunofficial="au.unofficial",i.Auofficial="au.official",i.Auofficialsensitive="au.officialsensitive",i.Auconfidential="au.confidential",i.Ausecret="au.secret",i.Autopsecret="au.topsecret",i))(gt||{});const Re={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 qi=Object.defineProperty,Mi=Object.getOwnPropertyDescriptor,q=(i,n,l,o)=>{for(var u=o>1?void 0:o?Mi(n,l):n,t=i.length-1,h;t>=0;t--)(h=i[t])&&(u=(o?h(n,l,u):h(u))||u);return o&&u&&qi(n,l,u),u};let T=class extends V{constructor(){super(...arguments),this.showHeader=!0,this.headerSticky=!0,this.classificationLevel=gt.None,this.classificationText="",this.notifications=[],this.showCreateAccount=!1,this.showLoginButton=!0,this.username=""}render(){this.classificationLevel&&!Re[this.classificationLevel]&&(console.warn("Unknown classification",this.classificationLevel),this.classificationLevel=gt.None);const i=this.classificationLevel?this.classificationText||Re[this.classificationLevel].content:"",n=this.showHeader?w`<spectric-header ?showCreateAccount=${this.showCreateAccount} .showLoginButton=${this.showLoginButton} username=${ht(this.username)}>
286
+ <slot name="branding" slot="branding"></slot>
287
+ <slot name="name" slot="name"></slot>
288
+ <slot name="center" slot="center"></slot>
289
+ <slot name="end" slot="end"></slot>
290
+ </spectric-header>`:null;return w`
291
+ ${this.classificationLevel&&i?w`
292
+ <!-- Classification Banner -->
293
+ <spectric-banner ${dt({text:i,headerStyle:Re[this.classificationLevel]})}></spectric-banner>
294
+ `:null}
295
+ <spectric-theme theme=${ht(this.theme)}>
296
+ ${this.notifications?this.notifications.map(l=>w`<spectric-banner ${dt(l)} ></spectric-banner>`):null}
297
+ ${this.headerSticky?n:null}
298
+ <article>
299
+ ${this.headerSticky?null:n}
300
+ <section class="spectric-page">
301
+ <slot name="content"></slot>
302
+ <slot></slot>
303
+ </section>
304
+ </article>
305
+ </spectric-theme>
306
+ ${this.classificationLevel&&i?w`<spectric-banner ${dt({text:i,headerStyle:Re[this.classificationLevel]})}></spectric-banner>`:null}
307
+
308
+ `}};T.styles=Ri;q([m({type:Boolean,reflect:!0})],T.prototype,"showHeader",2);q([m({type:Boolean,reflect:!0})],T.prototype,"headerSticky",2);q([m({type:String,reflect:!0})],T.prototype,"classificationLevel",2);q([m({type:String,reflect:!0})],T.prototype,"classificationText",2);q([m({type:Array,reflect:!0})],T.prototype,"notifications",2);q([m({type:Boolean,reflect:!0})],T.prototype,"showCreateAccount",2);q([m({type:Boolean,reflect:!0})],T.prototype,"showLoginButton",2);q([m({type:String,reflect:!0})],T.prototype,"username",2);q([m({type:String,reflect:!0})],T.prototype,"theme",2);T=q([ee("spectric-page")],T);const Ui=z`
309
+ :host{
310
+
311
+ --input-color: var(--spectric-input-color,#f4f4f4);
312
+ --border-radius: var(--spectric-border-radius, .4em);
313
+ --input-bottom: var(--spectric-input-bottom,var(--spectric-button-primary,#a8a8a8));
314
+ --input-bottom-focused: var(--primary,#1ea7fd);
315
+ --text-on-color: var(--spectric-text-on-color,#ffffff);
316
+ --text-on-color-disabled: var(--spectric-text-on-color-disabled,#8d8d8d);
317
+ --text-placeholder: rgba(22, 22, 22, 0.4);
318
+ --text-primary: var(--spectric-text-primary,#161616);
319
+ --text-secondary: var(--spectric-text-secondary,#525252);
320
+ }
321
+ .inputWrapper {
322
+ color:var(--text-secondary)
323
+ }
324
+ .inputWrapper input{
325
+ box-sizing: border-box;
326
+ margin: 0px;
327
+ vertical-align: baseline;
328
+ font-size: .875rem;
329
+ font-weight: 400;
330
+ line-height: 1.28572;
331
+ letter-spacing: .16px;
332
+ outline: transparent solid 2px;
333
+ outline-offset: -2px;
334
+ border: none;
335
+ padding: 0 1rem;
336
+ background-color: var(--input-color);
337
+ color: var(--text-primary, #161616);
338
+ font-family: inherit;
339
+ inline-size: 100%;
340
+ block-size:2.5rem;
341
+ }
342
+
343
+ .inputWrapper .inputContainer:active::after,.inputContainer:focus-within::after{
344
+ border-bottom-color:var(--input-bottom-focused)
345
+ }
346
+ .inputWrapper input:read-only{
347
+ background-color:transparent;
348
+ border-bottom-color:var(--border-disabled);
349
+ }
350
+ .inputContainer{
351
+ position: relative;
352
+ border-radius: var(--border-radius);
353
+ overflow: hidden;
354
+ }
355
+ .inputContainer::after{
356
+ content: "";
357
+ width: calc(100% - 5px);
358
+ transition: background-color 70ms cubic-bezier(0.2, 0, 0.38, 0.9), border-bottom-color 70ms cubic-bezier(0.2, 0, 0.38, 0.9);
359
+ border-bottom-color: var(--input-bottom);
360
+ border-bottom-style: solid;
361
+ border-bottom-width: 1px;
362
+ position: absolute;
363
+ left: 2.5px;
364
+ bottom: 0;
365
+ }
366
+ #helper-text{
367
+ height:18px;
368
+ }
369
+ spectric-button{
370
+ position: absolute;
371
+ right: 4px;
372
+ bottom: 3px;
373
+ }
374
+ `;var Wi=Object.defineProperty,Ii=Object.getOwnPropertyDescriptor,_=(i,n,l,o)=>{for(var u=o>1?void 0:o?Ii(n,l):n,t=i.length-1,h;t>=0;t--)(h=i[t])&&(u=(o?h(n,l,u):h(u))||u);return o&&u&&Wi(n,l,u),u},Hi=(i=>(i.Text="text",i.TextArea="text-area",i.number="number",i.color="color",i.date="date",i.datetime="datetime-local",i.email="email",i.file="file",i.hidden="hidden",i.password="password",i))(Hi||{});let x=class extends V{constructor(){super(...arguments),this.placeholder="",this.readonly=!1,this.variant="text",this.disabled=!1,this.label="",this.hidePasswordLabel="Hide",this.showPasswordLabel="Show",this.showPasswordVisibilityToggle=!0,this.helperText="",this.invalid=!1,this.required=!1,this.invalidText="",this.name="",this.pattern="",this.maxCount=0,this._value="",this._showPassword=!1,this.autocomplete="",this._handleInput=({target:i})=>{const n=i;this.value=n.value,this.invalid=!n.validity.valid},this.handleTogglePasswordVisibility=()=>{this._showPassword=!this._showPassword,this.requestUpdate()}}get selectionStart(){return this._input.selectionStart}get value(){return this._input?this.variant=="number"?parseFloat(this._input.value):this._input.value:this._value}set value(i){const n=this._value;this._value=i,this.requestUpdate("value",n),this._input&&(this._input.value=String(i))}setSelectionRange(i,n,l="none"){this._input.setSelectionRange(i,n,l)}render(){switch(this.variant){case"text":case"password":case"number":case"email":case"date":case"file":case"color":return w`
375
+ <div class="inputWrapper">
376
+ <div class="text-input__label-helper-wrapper">
377
+ <div class="--text-input__label-wrapper">
378
+ ${this.label} ${this.maxCount>0&&this._value?`${this._value.length}/${this.maxCount}`:null}
379
+ </div>
380
+ </div>
381
+ <div class="fieldwrapper">
382
+ <div ?data-invalid="${this.invalid}" class="inputContainer">
383
+ <input
384
+ ?data-invalid="${this.invalid}"
385
+ ?disabled="${this.disabled}"
386
+ aria-describedby="helper-text"
387
+ id="input"
388
+ name="${pe(this.name)}"
389
+ pattern="${pe(this.pattern)}"
390
+ placeholder="${pe(this.placeholder)}"
391
+ autocomplete="${pe(this.autocomplete)}"
392
+ ?readonly="${this.readonly}"
393
+ ?required="${this.required}"
394
+ type="${pe(this.variant!=="password"?this.variant:this._showPassword?"text":"password")}"
395
+ .value="${this._value}"
396
+ maxlength="${pe(this.maxCount>0?this.maxCount:void 0)}"
397
+ @input="${this._handleInput}"
398
+ @change=${()=>{this.dispatchEvent(new Event("change",{bubbles:!0}))}}
399
+ />
400
+
401
+ ${this.variant==="password"&&this.showPasswordVisibilityToggle?w`
402
+ <spectric-button
403
+ size="small"
404
+ type="button"
405
+ ?disabled="${this.disabled}"
406
+ @click=${this.handleTogglePasswordVisibility}>
407
+ ${this._showPassword?this.hidePasswordLabel:this.showPasswordLabel}
408
+ </spectric-button>
409
+ `:null}
410
+ </div>
411
+ <div
412
+ id="helper-text"
413
+ >
414
+ <slot name="helper-text"> ${this.invalid?this.invalidText:this.helperText} </slot>
415
+ </div>
416
+
417
+ </div>
418
+ </div>
419
+ `;case"hidden":return w`<input type="hidden"></input>`}return`Not yet implemented ${this.variant}`}};x.styles=Ui;_([m({type:String,reflect:!0})],x.prototype,"placeholder",2);_([m({type:Boolean,reflect:!0})],x.prototype,"readonly",2);_([m({type:String,reflect:!0})],x.prototype,"variant",2);_([m({type:Boolean,reflect:!0})],x.prototype,"disabled",2);_([m({type:String,reflect:!0})],x.prototype,"label",2);_([m()],x.prototype,"hidePasswordLabel",2);_([m()],x.prototype,"showPasswordLabel",2);_([m({type:Boolean,reflect:!0})],x.prototype,"showPasswordVisibilityToggle",2);_([m({type:String,reflect:!0})],x.prototype,"helperText",2);_([m({type:Boolean,reflect:!0})],x.prototype,"invalid",2);_([m({type:Boolean,reflect:!0})],x.prototype,"required",2);_([m({type:String,reflect:!0})],x.prototype,"invalidText",2);_([m()],x.prototype,"name",2);_([m()],x.prototype,"pattern",2);_([m({type:Number,reflect:!0})],x.prototype,"maxCount",2);_([m({reflect:!0})],x.prototype,"autocomplete",2);_([m({reflect:!0})],x.prototype,"value",1);_([yt("input")],x.prototype,"_input",2);x=_([ee("spectric-input")],x);const pe=i=>ht(i===""?void 0:i??void 0),Yi="end of input",Ki={fieldName:"field name",value:"value",literal:"literal",whitespace:"whitespace"};class zr extends Error{constructor(n,l){let o=n.message;if(n.expected){const h=n.expected.map($=>Ki[$.description]||$.description).join(", ");let y=n.found?`"${n.found}"`:Yi;o=`Expected ${h} but ${y} found.`}const u=[o,l,"-".repeat(n.location.start.offset)+"^"].join(`
420
+ `);super(u),this.name="DQLSyntaxError",this.shortMessage=o}}function fe(i){return{type:"literal",value:i}}function mt(i){return i.value}const Zi=Object.freeze(Object.defineProperty({__proto__:null,buildNode:fe,toOpenSearchQuery:mt},Symbol.toStringTag,{value:"Module"})),{SyntaxError:_n,parse:He}=function(){function i(o,u){function t(){this.constructor=o}t.prototype=u.prototype,o.prototype=new t}function n(o,u,t,h){this.message=o,this.expected=u,this.found=t,this.location=h,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,n)}i(n,Error);function l(o){var u=arguments.length>1?arguments[1]:{},t={},h={start:fr,Literal:ct},y=fr,$=function(e,r){return r.type==="cursor"?{...r,suggestionTypes:["conjunction"]}:e!==null?e:se.function.buildNode("is","*","*")},S=function(){return mi},M=function(e,r){const c=[e,r].find(a=>a.type==="cursor");return c||Q("or",[e,r])},C=function(e,r){const c=[e,r].find(a=>a.type==="cursor");return c||Q("and",[e,r])},U=function(e){return e.type==="cursor"?e:Q("not",[e])},j="(",re={type:"literal",value:"(",description:'"("'},Ae=")",Y={type:"literal",value:")",description:'")"'},F=function(e,r){return r.type==="cursor"?{...r,suggestionTypes:["conjunction"]}:e},B=":",L={type:"literal",value:":",description:'":"'},oe="{",Ye={type:"literal",value:"{",description:'"{"'},Ke="}",Ze={type:"literal",value:"}",description:'"}"'},Hr=function(e,r,c){return r.type==="cursor"?{...r,nestedPath:r.nestedPath?`${e.value}.${r.nestedPath}`:e.value}:c.type==="cursor"?{...c,suggestionTypes:["conjunction"]}:Q("nested",[e,r])},Yr={type:"other",description:"fieldName"},Kr=function(e,r,c){if(c.type==="cursor")return{...c,suggestionTypes:["conjunction"]};const a=Ai(r,c);return Q("range",[e,a])},Zr=function(e,r){return r.type==="cursor"?{...r,fieldName:e.value,suggestionTypes:["value","conjunction"]}:r(e)},Gr=function(e){if(e.type==="cursor"){const c=`${e.prefix}${e.suffix}`.trim();return{...e,fieldName:c,suggestionTypes:["field","operator","conjunction"]}}const r=K(null);return e(r)},Xr=function(e,r){return r.type==="cursor"?{...r,suggestionTypes:["conjunction"]}:e},Jr=function(e,r){const c=[e,r].find(a=>a.type==="cursor");return c?{...c,suggestionTypes:["value"]}:a=>Q("or",[e(a),r(a)])},Vr=function(e,r){const c=[e,r].find(a=>a.type==="cursor");return c?{...c,suggestionTypes:["value"]}:a=>Q("and",[e(a),r(a)])},es=function(e){return e.type==="cursor"?{...list,suggestionTypes:["value"]}:r=>Q("not",[e(r)])},ts={type:"other",description:"value"},rs=function(e){if(e.type==="cursor")return e;const r=K(!0);return c=>Q("is",[c,e,r])},ss=function(e){if(e.type==="cursor")return e;!xi&&e.type==="wildcard"&&se.wildcard.hasLeadingWildcard(e)&&E("Leading wildcards are disabled. See query:allowLeadingWildcards in Advanced Settings.");const r=K(!1);return c=>Q("is",[c,e,r])},is={type:"other",description:"OR"},At="or",Ct={type:"literal",value:"or",description:'"or"'},os={type:"other",description:"AND"},kt="and",St={type:"literal",value:"and",description:'"and"'},ns={type:"other",description:"NOT"},Ot="not",Lt={type:"literal",value:"not",description:'"not"'},cs={type:"other",description:"literal"},ve='"',be={type:"literal",value:'"',description:'"\\""'},Ge=function(e,r,c){const{start:a,end:f}=Xs();return{type:"cursor",start:a.offset,end:f.offset-r.length,prefix:e.join(""),suffix:c.join(""),text:Gs().replace(r,"")}},as=function(e){return K(e.join(""))},ye="\\",me={type:"literal",value:"\\",description:'"\\\\"'},ls=/^[\\"]/,us={type:"class",value:'[\\\\"]',description:'[\\\\"]'},Ce=function(e){return e},ps=/^[^"]/,fs={type:"class",value:'[^"]',description:'[^"]'},ds=function(e){const r=e.join("").trim();return r==="null"?K(null):r==="true"?K(!0):r==="false"?K(!1):e.includes(Or)?_i(r):K(/^(-?[1-9]+\d*([.]\d+)?)$|^(-?0[.]\d*[1-9]+)$|^0$|^0.0$|^[.]\d{1,}$/.test(r)?isFinite(r)&&(r>Number.MAX_SAFE_INTEGER||r<Number.MIN_SAFE_INTEGER)?BigInt(r):Number(r):r)},Tt={type:"any",description:"any character"},ke="*",Se={type:"literal",value:"*",description:'"*"'},hs=function(){return Or},Et="\\t",gs={type:"literal",value:"\\t",description:'"\\\\t"'},vs=function(){return" "},Nt="\\r",bs={type:"literal",value:"\\r",description:'"\\\\r"'},ys=function(){return"\r"},Pt="\\n",ms={type:"literal",value:"\\n",description:'"\\\\n"'},$s=function(){return`
421
+ `},ws=function(e){return e},xs=/^[\\():<>"*{}]/,_s={type:"class",value:'[\\\\():<>"*{}]',description:'[\\\\():<>"*{}]'},jt="<=",As={type:"literal",value:"<=",description:'"<="'},Cs=function(){return"lte"},Ft=">=",ks={type:"literal",value:">=",description:'">="'},Ss=function(){return"gte"},Bt="<",Dt={type:"literal",value:"<",description:'"<"'},Os=function(){return"lt"},Qt=">",Rt={type:"literal",value:">",description:'">"'},Ls=function(){return"gt"},Ts={type:"other",description:"whitespace"},Es=/^[ \t\r\n]/,Ns={type:"class",value:"[\\ \\t\\r\\n]",description:"[\\ \\t\\r\\n]"},Ps=function(){return $i},zt="@kuery-cursor@",js={type:"literal",value:"@kuery-cursor@",description:'"@kuery-cursor@"'},Fs=function(){return wi},qt="||",Bs={type:"literal",value:"||",description:'"||"'},Ds=function(){E("LuceneOr")},Mt="&&",Qs={type:"literal",value:"&&",description:'"&&"'},Ut=function(){E("LuceneAnd")},Wt="+",It={type:"literal",value:"+",description:'"+"'},Ht="-",Yt={type:"literal",value:"-",description:'"-"'},Kt=function(){E("LuceneNot")},Zt="!",Gt={type:"literal",value:"!",description:'"!"'},Xt="_exists_",Rs={type:"literal",value:"_exists_",description:'"_exists_"'},zs=function(){E("LuceneExists")},Jt=function(){E("LuceneRange")},Vt="?",er={type:"literal",value:"?",description:'"?"'},qs=function(){E("LuceneWildcard")},Xe="/",Je={type:"literal",value:"/",description:'"/"'},tr=/^[^\/]/,rr={type:"class",value:"[^/]",description:"[^/]"},Ms=function(){E("LuceneRegex")},Ve="~",et={type:"literal",value:"~",description:'"~"'},ne=/^[0-9]/,ce={type:"class",value:"[0-9]",description:"[0-9]"},Us=function(){E("LuceneFuzzy")},Ws=function(){E("LuceneProximity")},sr="^",ir={type:"literal",value:"^",description:'"^"'},Is=function(){E("LuceneBoost")},Hs=function(){return char},Ys="=",Ks={type:"literal",value:"=",description:'"="'},or="[",nr={type:"literal",value:"[",description:'"["'},cr="]",ar={type:"literal",value:"]",description:'"]"'},lr="TO",Zs={type:"literal",value:"TO",description:'"TO"'},s=0,b=0,Oe=[{line:1,column:1,seenCR:!1}],D=0,tt=[],p=0,Le;if("startRule"in u){if(!(u.startRule in h))throw new Error(`Can't start parsing from rule "`+u.startRule+'".');y=h[u.startRule]}function Gs(){return o.substring(b,s)}function Xs(){return Te(b,s)}function E(e){throw pr(e,null,o.substring(b,s),Te(b,s))}function ur(e){var r=Oe[e],c,a;if(r)return r;for(c=e-1;!Oe[c];)c--;for(r=Oe[c],r={line:r.line,column:r.column,seenCR:r.seenCR};c<e;)a=o.charAt(c),a===`
422
+ `?(r.seenCR||r.line++,r.column=1,r.seenCR=!1):a==="\r"||a==="\u2028"||a==="\u2029"?(r.line++,r.column=1,r.seenCR=!0):(r.column++,r.seenCR=!1),c++;return Oe[e]=r,r}function Te(e,r){var c=ur(e),a=ur(r);return{start:{offset:e,line:c.line,column:c.column},end:{offset:r,line:a.line,column:a.column}}}function d(e){s<D||(s>D&&(D=s,tt=[]),tt.push(e))}function pr(e,r,c,a){function f(A){var k=1;for(A.sort(function(Z,N){return Z.description<N.description?-1:Z.description>N.description?1:0});k<A.length;)A[k-1]===A[k]?A.splice(k,1):k++}function v(A,k){function Z(Ci){function De(W){return W.charCodeAt(0).toString(16).toUpperCase()}return Ci.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(W){return"\\x0"+De(W)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(W){return"\\x"+De(W)}).replace(/[\u0100-\u0FFF]/g,function(W){return"\\u0"+De(W)}).replace(/[\u1000-\uFFFF]/g,function(W){return"\\u"+De(W)})}var N=new Array(A.length),Lr,Tr,we;for(we=0;we<A.length;we++)N[we]=A[we].description;return Lr=A.length>1?N.slice(0,-1).join(", ")+" or "+N[A.length-1]:N[0],Tr=k?'"'+Z(k)+'"':"end of input","Expected "+Lr+" but "+Tr+" found."}return r!==null&&f(r),new n(e!==null?e:v(r,c),r,c,a)}function fr(){var e,r,c,a;for(e=s,r=[],c=g();c!==t;)r.push(c),c=g();return r!==t?(c=Ee(),c===t&&(c=null),c!==t?(a=Fe(),a!==t?(b=e,r=$(c,a),e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t),e}function Ee(){var e,r,c,a;return e=s,b=s,r=S(),r?r=void 0:r=t,r!==t?(c=ci(),c!==t?(r=[r,c],e=r):(s=e,e=t)):(s=e,e=t),e===t&&(e=s,r=rt(),r!==t?(c=Ne(),c!==t?(a=Ee(),a!==t?(b=e,r=M(r,a),e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t),e===t&&(e=rt())),e}function rt(){var e,r,c,a;return e=s,r=dr(),r!==t?(c=Pe(),c!==t?(a=rt(),a!==t?(b=e,r=C(r,a),e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t),e===t&&(e=dr()),e}function dr(){var e,r,c;return e=s,r=nt(),r!==t?(c=hr(),c!==t?(b=e,r=U(c),e=r):(s=e,e=t)):(s=e,e=t),e===t&&(e=hr()),e}function hr(){var e,r,c,a,f,v;if(e=s,o.charCodeAt(s)===40?(r=j,s++):(r=t,p===0&&d(re)),r!==t){for(c=[],a=g();a!==t;)c.push(a),a=g();c!==t?(a=Ee(),a!==t?(f=Fe(),f!==t?(o.charCodeAt(s)===41?(v=Ae,s++):(v=t,p===0&&d(Y)),v!==t?(b=e,r=F(a,f),e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;return e===t&&(e=Js()),e}function Js(){var e,r,c,a,f,v,A,k,Z,N;if(e=s,r=st(),r!==t){for(c=[],a=g();a!==t;)c.push(a),a=g();if(c!==t)if(o.charCodeAt(s)===58?(a=B,s++):(a=t,p===0&&d(L)),a!==t){for(f=[],v=g();v!==t;)f.push(v),v=g();if(f!==t)if(o.charCodeAt(s)===123?(v=oe,s++):(v=t,p===0&&d(Ye)),v!==t){for(A=[],k=g();k!==t;)A.push(k),k=g();A!==t?(k=Ee(),k!==t?(Z=Fe(),Z!==t?(o.charCodeAt(s)===125?(N=Ke,s++):(N=t,p===0&&d(Ze)),N!==t?(b=e,r=Hr(r,k,Z),e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;else s=e,e=t}else s=e,e=t;else s=e,e=t}else s=e,e=t;return e===t&&(e=Vs()),e}function Vs(){var e;return e=ei(),e===t&&(e=ti(),e===t&&(e=ri())),e}function st(){var e;return p++,e=ct(),p--,e===t&&p===0&&d(Yr),e}function ei(){var e,r,c,a,f,v;if(e=s,r=st(),r!==t){for(c=[],a=g();a!==t;)c.push(a),a=g();if(c!==t)if(a=$r(),a!==t){for(f=[],v=g();v!==t;)f.push(v),v=g();f!==t?(v=ct(),v!==t?(b=e,r=Kr(r,a,v),e=r):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;else s=e,e=t}else s=e,e=t;return e}function ti(){var e,r,c,a,f,v;if(e=s,r=st(),r!==t){for(c=[],a=g();a!==t;)c.push(a),a=g();if(c!==t)if(o.charCodeAt(s)===58?(a=B,s++):(a=t,p===0&&d(L)),a!==t){for(f=[],v=g();v!==t;)f.push(v),v=g();f!==t?(v=it(),v!==t?(b=e,r=Zr(r,v),e=r):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;else s=e,e=t}else s=e,e=t;return e}function ri(){var e,r;return e=s,r=br(),r!==t&&(b=e,r=Gr(r)),e=r,e}function it(){var e,r,c,a,f,v;if(e=s,o.charCodeAt(s)===40?(r=j,s++):(r=t,p===0&&d(re)),r!==t){for(c=[],a=g();a!==t;)c.push(a),a=g();c!==t?(a=gr(),a!==t?(f=Fe(),f!==t?(o.charCodeAt(s)===41?(v=Ae,s++):(v=t,p===0&&d(Y)),v!==t?(b=e,r=Xr(a,f),e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;return e===t&&(e=br()),e}function gr(){var e,r,c,a;return e=s,r=ot(),r!==t?(c=Ne(),c!==t?(a=gr(),a!==t?(b=e,r=Jr(r,a),e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t),e===t&&(e=ot()),e}function ot(){var e,r,c,a;return e=s,r=vr(),r!==t?(c=Pe(),c!==t?(a=ot(),a!==t?(b=e,r=Vr(r,a),e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t),e===t&&(e=vr()),e}function vr(){var e,r,c;return e=s,r=nt(),r!==t?(c=it(),c!==t?(b=e,r=es(c),e=r):(s=e,e=t)):(s=e,e=t),e===t&&(e=it()),e}function br(){var e,r;return p++,e=s,r=je(),r!==t&&(b=e,r=rs(r)),e=r,e===t&&(e=s,r=yr(),r!==t&&(b=e,r=ss(r)),e=r),p--,e===t&&(r=t,p===0&&d(ts)),e}function Ne(){var e,r,c,a,f;if(p++,e=s,r=[],c=g(),c!==t)for(;c!==t;)r.push(c),c=g();else r=t;if(r!==t)if(o.substr(s,2).toLowerCase()===At?(c=o.substr(s,2),s+=2):(c=t,p===0&&d(Ct)),c!==t){if(a=[],f=g(),f!==t)for(;f!==t;)a.push(f),f=g();else a=t;a!==t?(r=[r,c,a],e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;return e===t&&(e=s,b=s,r=S(),r?r=void 0:r=t,r!==t?(c=wr(),c!==t?(r=[r,c],e=r):(s=e,e=t)):(s=e,e=t)),p--,e===t&&(r=t,p===0&&d(is)),e}function Pe(){var e,r,c,a,f;if(p++,e=s,r=[],c=g(),c!==t)for(;c!==t;)r.push(c),c=g();else r=t;if(r!==t)if(o.substr(s,3).toLowerCase()===kt?(c=o.substr(s,3),s+=3):(c=t,p===0&&d(St)),c!==t){if(a=[],f=g(),f!==t)for(;f!==t;)a.push(f),f=g();else a=t;a!==t?(r=[r,c,a],e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;return e===t&&(e=s,b=s,r=S(),r?r=void 0:r=t,r!==t?(c=xr(),c!==t?(r=[r,c],e=r):(s=e,e=t)):(s=e,e=t)),p--,e===t&&(r=t,p===0&&d(os)),e}function nt(){var e,r,c,a;if(p++,e=s,o.substr(s,3).toLowerCase()===Ot?(r=o.substr(s,3),s+=3):(r=t,p===0&&d(Lt)),r!==t){if(c=[],a=g(),a!==t)for(;a!==t;)c.push(a),a=g();else c=t;c!==t?(r=[r,c],e=r):(s=e,e=t)}else s=e,e=t;return e===t&&(e=s,b=s,r=S(),r?r=void 0:r=t,r!==t?(c=_r(),c!==t?(r=[r,c],e=r):(s=e,e=t)):(s=e,e=t)),p--,e===t&&(r=t,p===0&&d(ns)),e}function ct(){var e;return p++,e=je(),e===t&&(e=yr()),p--,e===t&&p===0&&d(cs),e}function je(){var e,r,c,a,f,v;if(e=s,o.charCodeAt(s)===34?(r=ve,s++):(r=t,p===0&&d(be)),r!==t){for(c=[],a=ae();a!==t;)c.push(a),a=ae();if(c!==t)if(a=$e(),a!==t){for(f=[],v=ae();v!==t;)f.push(v),v=ae();f!==t?(o.charCodeAt(s)===34?(v=ve,s++):(v=t,p===0&&d(be)),v!==t?(b=e,r=Ge(c,a,f),e=r):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;else s=e,e=t}else s=e,e=t;if(e===t)if(e=s,o.charCodeAt(s)===34?(r=ve,s++):(r=t,p===0&&d(be)),r!==t){for(c=[],a=ae();a!==t;)c.push(a),a=ae();c!==t?(o.charCodeAt(s)===34?(a=ve,s++):(a=t,p===0&&d(be)),a!==t?(b=e,r=as(c),e=r):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;return e}function ae(){var e,r,c;return e=at(),e===t&&(e=s,o.charCodeAt(s)===92?(r=ye,s++):(r=t,p===0&&d(me)),r!==t?(ls.test(o.charAt(s))?(c=o.charAt(s),s++):(c=t,p===0&&d(us)),c!==t?(b=e,r=Ce(c),e=r):(s=e,e=t)):(s=e,e=t),e===t&&(e=s,r=s,p++,c=$e(),p--,c===t?r=void 0:(s=r,r=t),r!==t?(ps.test(o.charAt(s))?(c=o.charAt(s),s++):(c=t,p===0&&d(fs)),c!==t?(b=e,r=Ce(c),e=r):(s=e,e=t)):(s=e,e=t))),e}function yr(){var e,r,c,a,f;for(e=s,r=[],c=le();c!==t;)r.push(c),c=le();if(r!==t)if(c=$e(),c!==t){for(a=[],f=le();f!==t;)a.push(f),f=le();a!==t?(b=e,r=Ge(r,c,a),e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;if(e===t){if(e=s,r=[],c=le(),c!==t)for(;c!==t;)r.push(c),c=le();else r=t;r!==t&&(b=e,r=ds(r)),e=r}return e}function le(){var e,r,c,a,f;return e=at(),e===t&&(e=ii(),e===t&&(e=oi(),e===t&&(e=si(),e===t&&(e=s,r=s,p++,c=mr(),p--,c===t?r=void 0:(s=r,r=t),r!==t?(c=s,p++,a=ni(),p--,a===t?c=void 0:(s=c,c=t),c!==t?(a=s,p++,f=$e(),p--,f===t?a=void 0:(s=a,a=t),a!==t?(o.length>s?(f=o.charAt(s),s++):(f=t,p===0&&d(Tt)),f!==t?(b=e,r=Ce(f),e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t)):(s=e,e=t))))),e}function si(){var e,r;return e=s,o.charCodeAt(s)===42?(r=ke,s++):(r=t,p===0&&d(Se)),r!==t&&(b=e,r=hs()),e=r,e}function Fe(){var e,r,c,a,f;for(e=s,r=[],c=g();c!==t;)r.push(c),c=g();if(r!==t)if(c=$e(),c!==t){for(a=[],f=g();f!==t;)a.push(f),f=g();a!==t?(b=e,r=Ge(r,c,a),e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;if(e===t)for(e=[],r=g();r!==t;)e.push(r),r=g();return e}function at(){var e,r;return e=s,o.substr(s,2)===Et?(r=Et,s+=2):(r=t,p===0&&d(gs)),r!==t&&(b=e,r=vs()),e=r,e===t&&(e=s,o.substr(s,2)===Nt?(r=Nt,s+=2):(r=t,p===0&&d(bs)),r!==t&&(b=e,r=ys()),e=r,e===t&&(e=s,o.substr(s,2)===Pt?(r=Pt,s+=2):(r=t,p===0&&d(ms)),r!==t&&(b=e,r=$s()),e=r)),e}function ii(){var e,r,c;return e=s,o.charCodeAt(s)===92?(r=ye,s++):(r=t,p===0&&d(me)),r!==t?(c=mr(),c!==t?(b=e,r=Ce(c),e=r):(s=e,e=t)):(s=e,e=t),e}function oi(){var e,r,c;return e=s,o.charCodeAt(s)===92?(r=ye,s++):(r=t,p===0&&d(me)),r!==t?(o.substr(s,2).toLowerCase()===At?(c=o.substr(s,2),s+=2):(c=t,p===0&&d(Ct)),c===t&&(o.substr(s,3).toLowerCase()===kt?(c=o.substr(s,3),s+=3):(c=t,p===0&&d(St)),c===t&&(o.substr(s,3).toLowerCase()===Ot?(c=o.substr(s,3),s+=3):(c=t,p===0&&d(Lt)))),c!==t?(b=e,r=ws(c),e=r):(s=e,e=t)):(s=e,e=t),e}function ni(){var e;return e=Ne(),e===t&&(e=Pe(),e===t&&(e=nt())),e}function mr(){var e;return xs.test(o.charAt(s))?(e=o.charAt(s),s++):(e=t,p===0&&d(_s)),e}function $r(){var e,r;return e=s,o.substr(s,2)===jt?(r=jt,s+=2):(r=t,p===0&&d(As)),r!==t&&(b=e,r=Cs()),e=r,e===t&&(e=s,o.substr(s,2)===Ft?(r=Ft,s+=2):(r=t,p===0&&d(ks)),r!==t&&(b=e,r=Ss()),e=r,e===t&&(e=s,o.charCodeAt(s)===60?(r=Bt,s++):(r=t,p===0&&d(Dt)),r!==t&&(b=e,r=Os()),e=r,e===t&&(e=s,o.charCodeAt(s)===62?(r=Qt,s++):(r=t,p===0&&d(Rt)),r!==t&&(b=e,r=Ls()),e=r))),e}function g(){var e;return p++,Es.test(o.charAt(s))?(e=o.charAt(s),s++):(e=t,p===0&&d(Ns)),p--,e===t&&p===0&&d(Ts),e}function $e(){var e,r,c;return e=s,b=s,r=Ps(),r?r=void 0:r=t,r!==t?(o.substr(s,14)===zt?(c=zt,s+=14):(c=t,p===0&&d(js)),c!==t?(b=e,r=Fs(),e=r):(s=e,e=t)):(s=e,e=t),e}function wr(){var e,r,c,a,f;for(e=s,r=[],c=g();c!==t;)r.push(c),c=g();if(r!==t)if(o.substr(s,2)===qt?(c=qt,s+=2):(c=t,p===0&&d(Bs)),c!==t){for(a=[],f=g();f!==t;)a.push(f),f=g();a!==t?(b=e,r=Ds(),e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;return e}function xr(){var e,r,c,a,f;for(e=s,r=[],c=g();c!==t;)r.push(c),c=g();if(r!==t)if(o.substr(s,2)===Mt?(c=Mt,s+=2):(c=t,p===0&&d(Qs)),c!==t){for(a=[],f=g();f!==t;)a.push(f),f=g();a!==t?(b=e,r=Ut(),e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;return e===t&&(e=s,o.charCodeAt(s)===43?(r=Wt,s++):(r=t,p===0&&d(It)),r!==t&&(b=e,r=Ut()),e=r),e}function _r(){var e,r;return e=s,o.charCodeAt(s)===45?(r=Ht,s++):(r=t,p===0&&d(Yt)),r!==t&&(b=e,r=Kt()),e=r,e===t&&(e=s,o.charCodeAt(s)===33?(r=Zt,s++):(r=t,p===0&&d(Gt)),r!==t&&(b=e,r=Kt()),e=r),e}function ci(){var e;return e=ai(),e===t&&(e=Ar(),e===t&&(e=li())),e}function ai(){var e,r,c,a,f,v;if(e=s,r=ue(),r!==t){for(c=[],a=g();a!==t;)c.push(a),a=g();if(c!==t)if(o.charCodeAt(s)===58?(a=B,s++):(a=t,p===0&&d(L)),a!==t){for(f=[],v=g();v!==t;)f.push(v),v=g();f!==t?(v=Ar(),v!==t?(r=[r,c,a,f,v],e=r):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;else s=e,e=t}else s=e,e=t;return e}function Ar(){var e;return e=ui(),e===t&&(e=lt(),e===t&&(e=pi(),e===t&&(e=fi(),e===t&&(e=di(),e===t&&(e=hi()))))),e}function li(){var e,r,c,a,f,v;if(e=s,o.substr(s,8)===Xt?(r=Xt,s+=8):(r=t,p===0&&d(Rs)),r!==t){for(c=[],a=g();a!==t;)c.push(a),a=g();if(c!==t)if(o.charCodeAt(s)===58?(a=B,s++):(a=t,p===0&&d(L)),a!==t){for(f=[],v=g();v!==t;)f.push(v),v=g();f!==t?(v=ue(),v!==t?(b=e,r=zs(),e=r):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;else s=e,e=t}else s=e,e=t;return e}function ui(){var e,r,c,a,f,v,A;if(e=s,r=$r(),r!==t){for(c=[],a=g();a!==t;)c.push(a),a=g();c!==t?(a=ue(),a!==t?(b=e,r=Jt(),e=r):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;if(e===t)if(e=s,r=bi(),r!==t){for(c=[],a=g();a!==t;)c.push(a),a=g();c!==t?(a=ue(),a!==t?(f=Sr(),f!==t?(v=ue(),v!==t?(A=yi(),A!==t?(b=e,r=Jt(),e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t)):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;return e}function lt(){var e,r,c,a,f;for(e=s,r=[],c=Be(),c===t&&(o.charCodeAt(s)===42?(c=ke,s++):(c=t,p===0&&d(Se)));c!==t;)r.push(c),c=Be(),c===t&&(o.charCodeAt(s)===42?(c=ke,s++):(c=t,p===0&&d(Se)));if(r!==t)if(o.charCodeAt(s)===63?(c=Vt,s++):(c=t,p===0&&d(er)),c!==t){for(a=[],f=lt();f!==t;)a.push(f),f=lt();a!==t?(b=e,r=qs(),e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;return e}function pi(){var e,r,c,a;if(e=s,o.charCodeAt(s)===47?(r=Xe,s++):(r=t,p===0&&d(Je)),r!==t){for(c=[],tr.test(o.charAt(s))?(a=o.charAt(s),s++):(a=t,p===0&&d(rr));a!==t;)c.push(a),tr.test(o.charAt(s))?(a=o.charAt(s),s++):(a=t,p===0&&d(rr));c!==t?(o.charCodeAt(s)===47?(a=Xe,s++):(a=t,p===0&&d(Je)),a!==t?(b=e,r=Ms(),e=r):(s=e,e=t)):(s=e,e=t)}else s=e,e=t;return e}function fi(){var e,r,c,a,f;if(e=s,r=Cr(),r!==t)if(o.charCodeAt(s)===126?(c=Ve,s++):(c=t,p===0&&d(et)),c!==t){for(a=[],ne.test(o.charAt(s))?(f=o.charAt(s),s++):(f=t,p===0&&d(ce));f!==t;)a.push(f),ne.test(o.charAt(s))?(f=o.charAt(s),s++):(f=t,p===0&&d(ce));a!==t?(b=e,r=Us(),e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;return e}function di(){var e,r,c,a,f;if(e=s,r=je(),r!==t)if(o.charCodeAt(s)===126?(c=Ve,s++):(c=t,p===0&&d(et)),c!==t){for(a=[],ne.test(o.charAt(s))?(f=o.charAt(s),s++):(f=t,p===0&&d(ce));f!==t;)a.push(f),ne.test(o.charAt(s))?(f=o.charAt(s),s++):(f=t,p===0&&d(ce));a!==t?(b=e,r=Ws(),e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;return e}function hi(){var e,r,c,a,f;if(e=s,r=ue(),r!==t)if(o.charCodeAt(s)===94?(c=sr,s++):(c=t,p===0&&d(ir)),c!==t){for(a=[],ne.test(o.charAt(s))?(f=o.charAt(s),s++):(f=t,p===0&&d(ce));f!==t;)a.push(f),ne.test(o.charAt(s))?(f=o.charAt(s),s++):(f=t,p===0&&d(ce));a!==t?(b=e,r=Is(),e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;return e}function ue(){var e;return e=je(),e===t&&(e=Cr()),e}function Cr(){var e,r;if(e=[],r=Be(),r!==t)for(;r!==t;)e.push(r),r=Be();else e=t;return e}function Be(){var e,r,c,a;return e=at(),e===t&&(e=vi(),e===t&&(e=s,r=s,p++,c=kr(),p--,c===t?r=void 0:(s=r,r=t),r!==t?(c=s,p++,a=gi(),p--,a===t?c=void 0:(s=c,c=t),c!==t?(o.length>s?(a=o.charAt(s),s++):(a=t,p===0&&d(Tt)),a!==t?(r=[r,c,a],e=r):(s=e,e=t)):(s=e,e=t)):(s=e,e=t))),e}function gi(){var e;return e=Ne(),e===t&&(e=Pe(),e===t&&(e=wr(),e===t&&(e=xr(),e===t&&(e=_r(),e===t&&(e=Sr()))))),e}function vi(){var e,r,c;return e=s,o.charCodeAt(s)===92?(r=ye,s++):(r=t,p===0&&d(me)),r!==t?(c=kr(),c!==t?(b=e,r=Hs(),e=r):(s=e,e=t)):(s=e,e=t),e}function kr(){var e;return o.charCodeAt(s)===43?(e=Wt,s++):(e=t,p===0&&d(It)),e===t&&(o.charCodeAt(s)===45?(e=Ht,s++):(e=t,p===0&&d(Yt)),e===t&&(o.charCodeAt(s)===61?(e=Ys,s++):(e=t,p===0&&d(Ks)),e===t&&(o.charCodeAt(s)===62?(e=Qt,s++):(e=t,p===0&&d(Rt)),e===t&&(o.charCodeAt(s)===60?(e=Bt,s++):(e=t,p===0&&d(Dt)),e===t&&(o.charCodeAt(s)===33?(e=Zt,s++):(e=t,p===0&&d(Gt)),e===t&&(o.charCodeAt(s)===40?(e=j,s++):(e=t,p===0&&d(re)),e===t&&(o.charCodeAt(s)===41?(e=Ae,s++):(e=t,p===0&&d(Y)),e===t&&(o.charCodeAt(s)===123?(e=oe,s++):(e=t,p===0&&d(Ye)),e===t&&(o.charCodeAt(s)===125?(e=Ke,s++):(e=t,p===0&&d(Ze)),e===t&&(o.charCodeAt(s)===91?(e=or,s++):(e=t,p===0&&d(nr)),e===t&&(o.charCodeAt(s)===93?(e=cr,s++):(e=t,p===0&&d(ar)),e===t&&(o.charCodeAt(s)===94?(e=sr,s++):(e=t,p===0&&d(ir)),e===t&&(o.charCodeAt(s)===34?(e=ve,s++):(e=t,p===0&&d(be)),e===t&&(o.charCodeAt(s)===126?(e=Ve,s++):(e=t,p===0&&d(et)),e===t&&(o.charCodeAt(s)===42?(e=ke,s++):(e=t,p===0&&d(Se)),e===t&&(o.charCodeAt(s)===63?(e=Vt,s++):(e=t,p===0&&d(er)),e===t&&(o.charCodeAt(s)===58?(e=B,s++):(e=t,p===0&&d(L)),e===t&&(o.charCodeAt(s)===92?(e=ye,s++):(e=t,p===0&&d(me)),e===t&&(o.charCodeAt(s)===47?(e=Xe,s++):(e=t,p===0&&d(Je))))))))))))))))))))),e}function Sr(){var e,r,c,a,f;if(e=s,r=[],c=g(),c!==t)for(;c!==t;)r.push(c),c=g();else r=t;if(r!==t)if(o.substr(s,2)===lr?(c=lr,s+=2):(c=t,p===0&&d(Zs)),c!==t){if(a=[],f=g(),f!==t)for(;f!==t;)a.push(f),f=g();else a=t;a!==t?(r=[r,c,a],e=r):(s=e,e=t)}else s=e,e=t;else s=e,e=t;return e}function bi(){var e;return o.charCodeAt(s)===91?(e=or,s++):(e=t,p===0&&d(nr)),e===t&&(o.charCodeAt(s)===123?(e=oe,s++):(e=t,p===0&&d(Ye))),e}function yi(){var e;return o.charCodeAt(s)===93?(e=cr,s++):(e=t,p===0&&d(ar)),e===t&&(o.charCodeAt(s)===125?(e=Ke,s++):(e=t,p===0&&d(Ze))),e}const{errorOnLuceneSyntax:mi,parseCursor:$i,cursorSymbol:wi,allowLeadingWildcards:xi=!0,helpers:{nodeTypes:se}}=u,Q=se.function.buildNodeWithArgumentNodes,K=se.literal.buildNode,_i=se.wildcard.buildNode,Ai=se.namedArg.buildNode,{wildcardSymbol:Or}=se.wildcard;if(Le=y(),Le!==t&&s===o.length)return Le;throw Le!==t&&s<o.length&&d({type:"end",description:"end of input"}),pr(null,tt,D<o.length?o.charAt(D):null,D<o.length?Te(D,D+1):Te(D,D))}return{SyntaxError:n,parse:l}}(),$t=(i,n={},l=He)=>{if(typeof i>"u")throw new Error("expression must be a string, got undefined instead");return l(i,{...n,helpers:{nodeTypes:G}})},he=(i,n={})=>$t(i,{...n,startRule:"Literal"},He),Ue=(i,n={})=>{try{return $t(i,n,He)}catch(l){throw l.name==="SyntaxError"?new zr(l,i):l}},Gi=i=>{try{return $t(i,{errorOnLuceneSyntax:!0},He),!1}catch(n){return n.message.startsWith("Lucene")}},O=(i,n,l,o)=>(n=void 0,!i||!i.type||!G[i.type]?O(G.function.buildNode("and",[]),n):G[i.type].toOpenSearchQuery(i,n,l,o)),I="@kuery-wildcard@";function Xi(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ji(i){return i.replace(/[+-=&|><!(){}[\]^"~*?:\\/]/g,"\\$&")}function Vi(i){return i.includes(I)?{type:"wildcard",value:i}:he(i)}function qr(i,n){const{value:l}=i,o=l.split(I).map(Xi).join("[\\s\\S]*");return new RegExp(`^${o}$`).test(n)}function eo(i){const{value:n}=i;return n.split(I).join("*")}function vt(i){const{value:n}=i;return n.split(I).map(Ji).join("*")}function to(i){const{value:n}=i;return n.startsWith(I)&&n.replace(I,"").length>0}const ro=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Vi,hasLeadingWildcard:to,test:qr,toOpenSearchQuery:eo,toQueryStringQuery:vt,wildcardSymbol:I},Symbol.toStringTag,{value:"Module"}));function wt(i,n){if(!n)return[];if(i.type==="literal"){const l=mt(i),o=n.fields.find(u=>u.name===l);return o?[o]:[]}else if(i.type==="wildcard")return n.fields.filter(o=>qr(i,o.name))}function Mr(i,n,l){const o={...i,value:l?`${l}.${i.value}`:i.value};if(!n||o.type==="wildcard"&&!l)return o;const t=wt(o,n).reduce((h,y)=>{const $=y.subType&&y.subType.nested?y.subType.nested.path:void 0;return l&&!$?[...h,`${y.name} is not a nested field but is in nested group "${l}" in the DQL expression.`]:$&&!l?[...h,`${y.name} is a nested field, but is not in a nested group in the DQL expression.`]:$!==l?[...h,`Nested field ${y.name} is being queried with the incorrect nested path. The correct path is ${y.subType.nested.path}.`]:h},[]);if(t.length>0)throw new Error(t.join(`
423
+ `));return o}function so(i,n,l=!1){if(i===void 0)throw new Error("fieldName is a required argument");if(n===void 0)throw new Error("value is a required argument");const o=typeof i=="string"?he(i):fe(i),u=typeof n=="string"?he(n):fe(n),t=fe(l);return{arguments:[o,u,t]}}function io(i,n,l={},o={}){const{arguments:[u,t,h]}=i,y=Mr(u,n,o!=null&&o.nested?o.nested.path:void 0),$=O(y),S=t!==void 0?O(t):t,M=h.value?"phrase":"best_fields";if(y.value===null)return t.type==="wildcard"?{query_string:{query:vt(t)}}:{multi_match:{type:M,query:S,lenient:!0}};const C=n?wt(y,n):[];C&&C.length===0&&C.push({name:O(y),scripted:!1,type:""});const U=t.type==="wildcard"&&S==="*",j=y.type==="wildcard"&&$==="*"||C&&n&&C.length===n.fields.length;return U&&j?{match_all:{}}:{bool:{should:C.reduce((Y,F)=>{const B=L=>{var oe;return y.type!=="wildcard"||!((oe=F.subType)!=null&&oe.nested)||o!=null&&o.nested?L:{nested:{path:F.subType.nested.path,query:L,score_mode:"none"}}};if(F.scripted)return[];if(U)return[...Y,B({exists:{field:F.name}})];if(t.type==="wildcard")return[...Y,B({query_string:{fields:[F.name],query:vt(t)}})];if(F.type==="date"){const L=l.dateFormatTZ?{time_zone:l.dateFormatTZ}:{};return[...Y,B({range:{[F.name]:{gte:S,lte:S,...L}}})]}else{const L=M==="phrase"?"match_phrase":"match";return[...Y,B({[L]:{[F.name]:S}})]}},[])||[],minimum_should_match:1}}}const oo=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:so,toOpenSearchQuery:io},Symbol.toStringTag,{value:"Module"}));function no(i){return{arguments:i}}function co(i,n,l={},o={}){return{bool:{filter:(i.arguments||[]).map(t=>O(t,n,l,o))}}}const ao=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:no,toOpenSearchQuery:co},Symbol.toStringTag,{value:"Module"}));function lo(i){return{arguments:i}}function uo(i,n,l={},o={}){return{bool:{should:(i.arguments||[]).map(t=>O(t,n,l,o)),minimum_should_match:1}}}const po=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:lo,toOpenSearchQuery:uo},Symbol.toStringTag,{value:"Module"}));function fo(i){return{arguments:[i]}}function ho(i,n,l={},o={}){const[u]=i.arguments;return{bool:{must_not:O(u,n,l,o)}}}const go=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:fo,toOpenSearchQuery:ho},Symbol.toStringTag,{value:"Module"}));function vo(i,...n){let l={};for(let o of n)l[o]=i[o];return l}function bo(i,n){const l=vo(n,"gt","lt","gte","lte","format"),o=typeof i=="string"?he(i):G.literal.buildNode(i),u=Object.entries(l).map(t=>{let[h,y]=t;return G.namedArg.buildNode(h,y)});return{arguments:[o,...u]}}function yo(i,n,l={},o={}){const[u,...t]=i.arguments,h=Mr(u,n,o!=null&&o.nested?o.nested.path:void 0),y=n?wt(h,n):[],$=mo(t),S=Object.fromEntries(Object.entries($).map(([C,U])=>[C,O(U)]));return y&&y.length===0&&y.push({name:O(h),scripted:!1,type:""}),{bool:{should:y.map(C=>{const U=j=>{var re;return h.type!=="wildcard"||!((re=C.subType)!=null&&re.nested)||o.nested?j:{nested:{path:C.subType.nested.path,query:j,score_mode:"none"}}};if(C.scripted)return{};if(C.type==="date"){const j=l.dateFormatTZ?{time_zone:l.dateFormatTZ}:{};return U({range:{[C.name]:{...S,...j}}})}return U({range:{[C.name]:S}})}),minimum_should_match:1}}}function mo(i){if(i.gt&&i.gte||i.lt&&i.lte)throw new Error("range ends cannot be both inclusive and exclusive");const n=["gte","lte","format"];return i.reduce((l,o,u)=>(o.type==="namedArg"?l[o.name]=o.value:l[n[u]]=o,l),{})}const $o=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:bo,toOpenSearchQuery:yo},Symbol.toStringTag,{value:"Module"}));function wo(i){return{arguments:[fe(i)]}}function xo(i,n,l={},o={}){const{arguments:[u]}=i,t={...u,value:o!=null&&o.nested?`${o.nested.path}.${u.value}`:u.value},h=mt(t),y=((n==null?void 0:n.fields)||[]).find($=>$.name===h);if(y&&y.scripted)throw new Error("Exists query does not support scripted fields");return{exists:{field:h}}}const _o=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:wo,toOpenSearchQuery:xo},Symbol.toStringTag,{value:"Module"}));function Ao(i,n){return{arguments:[typeof i=="string"?he(i):fe(i),n]}}function Co(i,n,l={},o={}){var $;const[u,t]=i.arguments,h=O(u),y=($=o==null?void 0:o.nested)!=null&&$.path?`${o.nested.path}.${h}`:h;return{nested:{path:y,query:O(t,n,l,{...o,nested:{path:y}}),score_mode:"none"}}}const ko=Object.freeze(Object.defineProperty({__proto__:null,buildNodeParams:Ao,toOpenSearchQuery:Co},Symbol.toStringTag,{value:"Module"})),xt={is:oo,and:ao,or:po,not:go,range:$o,exists:_o,nested:ko};function So(i,...n){const l=xt[i];if(l===void 0)throw new Error(`Unknown function "${i}"`);return{type:"function",function:i,...l.buildNodeParams(...n)}}function Oo(i,n){if(xt[i]===void 0)throw new Error(`Unknown function "${i}"`);return{type:"function",function:i,arguments:n}}function Lo(i,n,l,o){return xt[i.function].toOpenSearchQuery(i,n,l,o)}const To=Object.freeze(Object.defineProperty({__proto__:null,buildNode:So,buildNodeWithArgumentNodes:Oo,toOpenSearchQuery:Lo},Symbol.toStringTag,{value:"Module"}));function Eo(i,n){const l=n.type==="literal"?n:G.literal.buildNode(n);return{type:"namedArg",name:i,value:l}}function No(i){return O(i.value)}const Po=Object.freeze(Object.defineProperty({__proto__:null,buildNode:Eo,toOpenSearchQuery:No},Symbol.toStringTag,{value:"Module"})),G={function:To,literal:Zi,namedArg:Po,wildcard:ro},jo=I,Fo=(i,n)=>"("+(i.arguments||[]).map(o=>ie(o,n)).join(" AND ")+")",Bo=(i,n)=>{var{arguments:[l,o,u]}=i;let t="=";o.type==="wildcard"&&(t="");let h=ie(o);u=u.value||typeof h=="string",o.type==="literal"&&u&&(h=`'${h}'`),o.type==="literal"&&!u&&(h=`${h}`);let y=ie(l);return y==null?n&&u?`(${n.filter($=>$.type==="string").map($=>`${$.name} ILIKE '%${o.value}%'`).join(" OR ")})`:n&&!u&&(o.value===!0||o.value===!1)?`(${n.filter($=>$.type==="boolean").map($=>`${$.name}=${o.value}`).join(" OR ")})`:"":y+t+h},Do=(i,n)=>"("+(i.arguments||[]).map(o=>ie(o,n)).join(" OR ")+")",Qo=(i,n)=>{const[l]=i.arguments;return"NOT ("+ie(l,n)+")"},Ro={gt:">",lt:"<",gte:">=",lte:"<="},zo=i=>{const[n,l]=i.arguments;let o=l.value;const u=Ro[l.name];let t=ie(o);return o.type==="literal"&&(t=`${t}`),`${n.value} ${u} ${t}`},qo=i=>{const[n]=i.arguments;return`${n.value} IS NOT NULL`},Mo=i=>(console.warn("Nested types dont exist in CQL",i),""),Uo={is:Bo,and:Fo,or:Do,not:Qo,range:zo,exists:qo,nested:Mo},Wo={function:(i,n)=>Uo[i.function](i,n),literal:i=>i.value,wildcard:i=>{const{value:n}=i;return` LIKE '${n.split(jo).join("%")}'`}},ie=(i,n)=>{const l=Wo[i.type];return l(i,n)},Io=I,Ho=i=>({$and:(i.arguments||[]).map(o=>J(o))}),Yo=i=>{const{arguments:[n,l]}=i;let o=J(l);if(l.type==="wildcard"&&l.value==="@kuery-wildcard@")return Ur(i);let t={};return t[J(n)]={$eq:o},t},Ko=i=>({$or:(i.arguments||[]).map(l=>J(l))}),Zo=i=>{const[n]=i.arguments;let l={};return l={$ne:J(n)},l},Go={gt:"$gt",lt:"$lt",gte:"$gte",lte:"$lte"},Xo=i=>{const[n,l]=i.arguments;let o=l.value;const u=Go[l.name];let t=J(o),h={};return h[n.value]={},h[n.value][u]=t,h},Ur=i=>{const[n]=i.arguments;return{[J(n)]:{$ne:null}}},Jo=i=>(console.warn("TODO Implement nested search",i),""),Vo={is:Yo,and:Ho,or:Ko,not:Zo,range:Xo,exists:Ur,nested:Jo},en={function:i=>Vo[i.function](i),literal:i=>i.value,wildcard:i=>{const{value:n}=i;return`/${n.split(Io).join(".*")}/`}},J=(i,n)=>{const l=en[i.type];return l(i,n)},tn=Object.freeze(Object.defineProperty({__proto__:null,DQLSyntaxError:zr,doesKueryExpressionHaveLuceneSyntaxError:Gi,fromKueryExpression:Ue,fromLiteralExpression:he,nodeTypes:G,parse:Ue,toCql:ie,toDSL:O,toMongo:J,toOpenSearchQuery:O},Symbol.toStringTag,{value:"Module"}));var rn=Object.defineProperty,sn=Object.getOwnPropertyDescriptor,H=(i,n,l,o)=>{for(var u=o>1?void 0:o?sn(n,l):n,t=i.length-1,h;t>=0;t--)(h=i[t])&&(u=(o?h(n,l,u):h(u))||u);return o&&u&&rn(n,l,u),u},on=(i=>(i.MONGO="toMongo",i.CQL="toCql",i.DSL="toDSL",i.AST="AST",i))(on||{});const nn={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"}},cn={eq:{value:": ",label:" equals some value"},exists:{value:": *",label:" exists in any form"}},an=[{value:": true",label:" value is true"},{value:": false",label:"value is false"}];let P=class extends V{constructor(){super(...arguments),this._value="",this.outputLanguage="AST",this.completions=[],this.completionIndex=0,this.fields=[],this._parseQuery=()=>{let i;if(this.value=="")return;try{let o=this.value;this._input.selectionStart!==null&&(o=o.substring(0,this._input.selectionStart)+"@kuery-cursor@"+o.substring(this._input.selectionStart));let u=Ue(o,{parseCursor:!0,cursorSymbol:"@kuery-cursor@",allowLeadingWildcards:!1});this.autoComplete(u),i=Ue(this.value,{allowLeadingWildcards:!1})}catch{return}let n;this.outputLanguage=="AST"?n=i:n=tn[this.outputLanguage](i,this.fields);let l=new CustomEvent("change",{detail:n});this.dispatchEvent(l)},this.getValuesForField=async(i,n)=>(console.log("getValuesForField isn't set no values returned",i,n),[]),this._selectCompletion=()=>{if(!this.suggestion)return;let i=this.completions[this.completionIndex],n=this.value.substring(0,i.start)+i.value,l=n.length;this.value=n+this.value.substring(i.end),this._input.setSelectionRange(l,l),this.completionIndex=0,this.completions=[],this._parseQuery()},this._handleArrows=i=>{var n;i.key==="Escape"&&(this.completions=[]),(i.key=="ArrowLeft"||i.key==="ArrowRight")&&setTimeout(this._parseQuery,100),this.completions.length&&["ArrowUp","ArrowDown","Enter","Tab"].includes(i.key)&&this.suggestion&&(i.preventDefault(),(i.key==="ArrowDown"||i.key==="Tab")&&(this.completionIndex+=1,this.completionIndex>this.completions.length-1&&(this.completionIndex=0)),i.key==="ArrowUp"&&(this.completionIndex-=1,this.completionIndex<0&&(this.completionIndex=this.completions.length-1)),(n=this._asyncAutocomplete)==null||n.then(l=>{let o=l.querySelector(".option.active");o&&o.scrollIntoView({block:"nearest"})}),i.key==="Enter"&&this._selectCompletion())}}get value(){return this._input?String(this._input.value):this._value}set value(i){const n=this._value;this._value=i,this.requestUpdate("value",n),this._input&&(this._input.value=String(i))}async autoComplete(i){if(this.completions=[],i.type!=="cursor")return;let n=[];this.suggestion=i;let{start:l,end:o}=i;for(let u of i.suggestionTypes){if(u=="conjunction"&&i.text.endsWith(" ")&&n.push(...["and ","or "].map(t=>({type:u,value:t,start:o,end:o}))),u==="field"){let t=this.fields.filter(h=>h.name.includes(i.fieldName)||h.name.includes(i.prefix)).map(h=>[{type:u,value:h.name,start:l,end:o}]).flat();n.push(...t)}if(u==="operator"){let t=this.fields.find(h=>h.name===i.fieldName);t&&(t.type==="number"?n.push(...Object.values(nn).map(h=>({type:u,...h,start:o,end:o}))):t.type==="string"?n.push(...Object.values(cn).map(h=>({type:u,...h,start:o,end:o}))):t.type==="boolean"&&n.push(...an.map(h=>({type:u,...h,start:o,end:o}))))}if(u==="value"){let t=this.fields.find(h=>h.name===i.fieldName);if(t&&t.type=="boolean")n.push({type:u,value:"true",start:l,end:o},{type:u,value:"false",start:l,end:o});else{console.log(`invoke callback to get values for ${i.fieldName}`);let h=await this.getValuesForField(i.fieldName,i.prefix);(t==null?void 0:t.type)==="string"&&(h=h.map(y=>`"${y}"`)),n.push(...h.map(y=>({type:u,value:y,start:l,end:o})))}}}if(this.completions=n,this.completions.length&&this._autocomplete){let{width:u}=this._input.getBoundingClientRect();this._autocomplete.showPopover(),this._autocomplete.style.width=`${u}px`}}updated(i){i.has("outputLanguage")&&this._parseQuery()}render(){return w`
424
+ <spectric-input autocomplete="off" @input=${this._parseQuery} @keydown=${this._handleArrows}></spectric-input>
425
+ <div class="autocomplete" popover>
426
+ ${this.completions.map((i,n)=>w`<div @click=${()=>{this.completionIndex=n,this._selectCompletion()}} class=${this.completionIndex==n?"option active":"option"}><span class="optiontype ${i.type}">${i.type}</span> <span class="value">${i.value}</span> <span class="label">${i.label}</span></span> </div></div>`)}
427
+ </div>`}};P.styles=z`
428
+ :host{
429
+ font-family:monospace
430
+ }
431
+ spectric-input{
432
+ anchor-name: --anchor-el;
433
+ }
434
+ .autocomplete{
435
+ color: var(--spectric-text-primary,#161616);
436
+ border-radius: .0em 0em var(--spectric-border-radius,.4em) var(--spectric-border-radius,.4em);
437
+ background-color: var(--spectric-background, #ffffff);
438
+ border: 1px solid var(--spectric-background-hover, rgba(141, 141, 141, 0.12));
439
+ max-height:300px;
440
+ border-top:0px;
441
+ margin:0px;
442
+ margin-top:-18px; //Input helper text is 18px we can cover that with the popover
443
+ position:fixed;
444
+ position-anchor: --anchor-el;
445
+ top: anchor(bottom);
446
+ justify-self: anchor-center;
447
+ text-align:center;
448
+ }
449
+ .autocomplete .optiontype{
450
+ float:left;
451
+ max-width:10px; //todo should we display an icon instead of text?
452
+ }
453
+ .autocomplete .label{
454
+ position:absolute;
455
+ right:0;
456
+ }
457
+ .autocomplete .option.active, .autocomplete .option:hover {
458
+ background-color: var(--spectric-background-hover, rgba(141, 141, 141, 0.12));
459
+ border-bottom: 1px solid var(--primary,#1ea7fd);
460
+ }
461
+ .autocomplete .option {
462
+ border-bottom: 1px solid transparent;
463
+ padding:8px;
464
+ }
465
+ `;H([m({type:String,reflect:!0})],P.prototype,"value",1);H([m({type:String,reflect:!0})],P.prototype,"outputLanguage",2);H([Fr()],P.prototype,"completions",2);H([Fr()],P.prototype,"completionIndex",2);H([m({type:Array,reflect:!0})],P.prototype,"fields",2);H([yt(".autocomplete")],P.prototype,"_autocomplete",2);H([Dr(".autocomplete")],P.prototype,"_asyncAutocomplete",2);H([yt("spectric-input")],P.prototype,"_input",2);P=H([ee("spectric-query")],P);const Er=z`
466
+ border-color: color-mix(in hsl, var(--panel-color,#0b0b0b), #000000 25%);
467
+ background-color: var(--panel-color,#0b0b0b);
468
+ --spectric-input-color: var(--spectric-background);
469
+ color:var(--text-secondary,#3c4c5b);
470
+ --spectric-text-primary:var(--text-primary);
471
+ --spectric-text-secondary:var(--text-secondary);
472
+ `,Nr=z`
473
+ border-color: color-mix(in hsl, var(--panel-color-inverse,#f4f4f4), #000 20%);
474
+ background-color: var(--panel-color-inverse,#0b0b0b);
475
+ color:var(--text-primary,#3c4c5b);
476
+ --spectric-input-color: var(--panel-color);
477
+ --spectric-text-primary:var(--text-secondary);
478
+ --spectric-text-secondary:var(--text-primary);
479
+ `,ln=z`
480
+ :host{
481
+ display:block;
482
+ border:1px solid black;
483
+ margin: 5px;
484
+ border-radius:var(--spectric-border-radius,0.4em);
485
+ padding: calc(var(--spectric-border-radius,0.4em) + 2px);
486
+
487
+ }
488
+ :host(spectric-panel[level='0']) {
489
+ ${Er}
490
+ }
491
+
492
+ :host(spectric-panel[level='1']) {
493
+ ${Nr}
494
+ }
495
+
496
+ :host(spectric-panel[level='2']) {
497
+ ${Er}
498
+ }
499
+ :host(spectric-panel[level='3']) {
500
+ ${Nr}
501
+ }
502
+ `;var un=Object.defineProperty,pn=Object.getOwnPropertyDescriptor,_t=(i,n,l,o)=>{for(var u=o>1?void 0:o?pn(n,l):n,t=i.length-1,h;t>=0;t--)(h=i[t])&&(u=(o?h(n,l,u):h(u))||u);return o&&u&&un(n,l,u),u};let _e=class extends V{constructor(){super(...arguments),this.level=0}updated(){this.layers||(this.layers=this.querySelectorAll("spectric-panel")),this.layers.forEach(i=>{i.setAttribute("level",((this.level+1)%4).toString())}),this.dispatchEvent(new CustomEvent("use-layer",{bubbles:!0,cancelable:!0,composed:!0,detail:{layer:this,level:this.level}}))}render(){return w` <slot></slot> `}};_e.styles=ln;_t([m({type:Number,reflect:!0})],_e.prototype,"level",2);_t([m({attribute:!1})],_e.prototype,"layers",2);_e=_t([ee("spectric-panel")],_e);var fn=Object.defineProperty,dn=Object.getOwnPropertyDescriptor,Wr=(i,n,l,o)=>{for(var u=o>1?void 0:o?dn(n,l):n,t=i.length-1,h;t>=0;t--)(h=i[t])&&(u=(o?h(n,l,u):h(u))||u);return o&&u&&fn(n,l,u),u};const An={"--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"}},Ir={"--secondary":"#77878b","--tertiary":"#c7c7c7","--disabled":"#000000","--text-primary":"#FFFFFF","--text-secondary":"#3C4C5B","--text-on-color":"#4f4f4f","--background":"#2c4547","--background-inverse":"#c6cdd5"},Pr={...Ir,"--primary":"#ffd45a"},bt={undefined:{},light:{},dark:Ir,spectric:Pr,spectricFlat:{...Pr,"--border-radius":"1px"}},Cn={...Object.fromEntries(Object.keys(bt).map(i=>[i,i]))},hn=`
503
+ --spectric-background: var(--background,#ffffff);
504
+ --spectric-background-hover:var(--background-hover,rgba(141, 141, 141, 0.12));
505
+ --spectric-background-inverse: var(--background-inverse,#f4f4f4);
506
+ --spectric-background-inverse-hover: var(--background-inverse-hover,#474747);
507
+ --spectric-border-radius: var(--border-radius,.4em);
508
+ --spectric-primary:var(--primary,#1ea7fd);
509
+ --spectric-secondary: var(--secondary,#77878b);
510
+ --spectric-tertiary: var(--tertiary,#0f62fe);
511
+ --spectric-disabled: var(--disabled,#c6c6c6);
512
+
513
+ /* panel */
514
+ --panel-color:var(--spectric-background-inverse);
515
+ --panel-color-inverse:var(--spectric-background);
516
+ --spectric-border-disabled: var(--disabled);
517
+
518
+ /*inputs*/
519
+ --spectric-input-color: var(--panel-color-inverse);
520
+ --spectric-input-bottom: var(--panel-color);
521
+
522
+ --spectric-text-on-color: var(--text-on-color,#ffffff);
523
+ --spectric-text-on-color-disabled: var(--text-on-color-disabled,#8d8d8d);
524
+ --spectric-text-placeholder: var(--text-placeholder,rgba(22, 22, 22, 0.4));
525
+ --spectric-text-primary: var(--text-primary,#161616);
526
+ --spectric-text-secondary: var(--text-secondary,#525252);
527
+ /* Buttons */
528
+ --spectric-button-separator: #e0e0e0;
529
+ --spectric-button-primary: var(--primary,#1ea7fd);
530
+ --spectric-button-secondary: var(--secondary,#77878b);
531
+ --spectric-button-tertiary: var(--tertiary);
532
+ --spectric-button-danger-primary: #da1e28;
533
+ --spectric-button-danger-secondary: #da1e28;
534
+ --spectric-button-danger-active: #750e13;
535
+ --spectric-button-primary-active: #002d9c;
536
+ --spectric-button-secondary-active: #6f6f6f;
537
+ --spectric-button-tertiary-active: #002d9c;
538
+ --spectric-button-danger-hover: #b81921;
539
+ --spectric-button-primary-hover: #0050e6;
540
+ --spectric-button-secondary-hover: #474747;
541
+ --spectric-button-tertiary-hover: #0050e6;
542
+ --spectric-text-on-color-disabled: var(--disabled,#c6c6c6)
543
+ --spectric-button-disabled: #c6c6c6;
544
+ color: var(--spectric-text-primary);`;let We=class extends V{constructor(){super(...arguments),this.theme="undefined"}updated(i){if(i.has("theme")&&this.theme!=i.get("theme")){const n={old:i.get("theme"),new:this.theme};this.dispatchEvent(new CustomEvent("theme-change",{detail:n,bubbles:!0,composed:!0}))}}render(){let i=Object.keys(bt).includes(this.theme)?this.theme:"undefined",n=Object.entries(bt[i]).map(l=>`${l[0]}:${l[1]};`).join(`
545
+ `);return w`
546
+ ${this.theme&&this.theme!=="light"?w`
547
+ <style>:host{
548
+ ${n}
549
+ ${hn}
550
+ }</style>`:null}
551
+ <slot></slot>
552
+ `}};We.styles=z`:host{
553
+ display:contents;
554
+ }`;Wr([m({reflect:!0})],We.prototype,"theme",2);We=Wr([ee("spectric-theme")],We);const gn=z`
555
+ :host {
556
+ --dialog-padding: var(--spectric-dialog-padding, 5px);
557
+ }
558
+ dialog {
559
+ border: 0px solid var(--background-inverse);
560
+ background-color: var(--spectric-background);
561
+ padding: 0;
562
+ border-radius: var(--spectric-border-radius);
563
+ }
564
+ spectric-panel{
565
+ margin:0px
566
+ }
567
+ dialog::backdrop {
568
+ background-color: transparent;
569
+ }
570
+ dialog.backdrop::backdrop {
571
+ background-color: rgba(0, 0, 0, 0.5);
572
+ }
573
+
574
+
575
+ h3 {
576
+ padding: 1em var(--dialog-padding);
577
+ margin: 0;
578
+ }
579
+ article {
580
+ border-color: color-mix(in hsl, var(--panel-color, #0b0b0b), #000000 25%);
581
+ background-color: var(--spectric-background, #0b0b0b);
582
+ color: var(--spectric-text-primary, #3c4c5b);
583
+ margin: 0;
584
+ border-radius: var(--spectric-border-radius, 0.4em);
585
+ padding: calc(var(--spectric-border-radius, 0.4em) + 2px);
586
+ }
587
+ article > * {
588
+ margin: var(--dialog-padding);
589
+ }
590
+ spectric-button{
591
+ position: absolute;
592
+ right: 0;
593
+ top: 0;
594
+ }
595
+ `;var vn=Object.defineProperty,bn=Object.getOwnPropertyDescriptor,te=(i,n,l,o)=>{for(var u=o>1?void 0:o?bn(n,l):n,t=i.length-1,h;t>=0;t--)(h=i[t])&&(u=(o?h(n,l,u):h(u))||u);return o&&u&&vn(n,l,u),u};const yn="spectric-dialog";let R=class extends V{constructor(){super(...arguments),this.open=!1,this.dismissable=!0,this.hideBackdrop=!1,this.title="",this.closeOnEscape=!0,this.closeOnOutsideClick=!0,this.clickHandler=async i=>{const n=await this.dialogElement;!this.dismissable||!this.closeOnOutsideClick||n===i.target&&(this.open=!1)},this._handleKeyDown=i=>{this.closeOnEscape||i.preventDefault(),this.open&&this.closeOnEscape&&i.key==="Escape"&&(this.open=!1)},this._onClose=i=>{i.preventDefault(),i.stopPropagation(),this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.dialogElement.then(i=>i.addEventListener("keydown",this._handleKeyDown))}disconnectedCallback(){super.disconnectedCallback(),this.dialogElement.then(i=>i.removeEventListener("keydown",this._handleKeyDown))}updated(i){i.has("open")&&this.dialogElement.then(n=>{this.open?n.showModal():n.close()})}render(){return w`
596
+ <dialog class=${this.hideBackdrop?"":"backdrop"} @close=${this._onClose} @click=${this.clickHandler}>
597
+ <spectric-panel>
598
+ <div>
599
+ ${this.dismissable?w`<spectric-button variant="text" size="small" @click=${()=>{this.open=!1}}>X</spectric-button>`:null}
600
+ <h3 >
601
+ <slot name="title">
602
+ ${this.title.length?this.title:null}
603
+ </slot>
604
+ </h3>
605
+
606
+ <slot></slot>
607
+
608
+ </div>
609
+ </spectric-panel>
610
+ </dialog>
611
+ `}};R.styles=gn;te([m({type:Boolean,reflect:!0})],R.prototype,"open",2);te([m({type:Boolean,reflect:!0})],R.prototype,"dismissable",2);te([m({type:Boolean,reflect:!0})],R.prototype,"hideBackdrop",2);te([m({type:String,reflect:!0})],R.prototype,"title",2);te([m({type:Boolean,reflect:!0})],R.prototype,"closeOnEscape",2);te([m({type:Boolean,reflect:!0})],R.prototype,"closeOnOutsideClick",2);te([Dr("dialog")],R.prototype,"dialogElement",2);R=te([ee(yn)],R);export{gt as C,Hi as I,on as S,Cn as T,An as a,ht as o,Fr as r};