@luzmo/analytics-components-kit 2.0.0 → 2.0.1
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/angular/package.json +2 -2
- package/components/display-settings-period-over-period/display-settings-period-over-period.d.ts +4 -2
- package/components/display-settings-period-over-period/index.cjs +1 -1
- package/components/display-settings-period-over-period/index.js +1 -1
- package/components/{display-settings-period-over-period-DqeKcvdD.js → display-settings-period-over-period-DjB6sYEF.js} +40 -16
- package/components/{display-settings-period-over-period-86oxRHhk.cjs → display-settings-period-over-period-ikA0oE0C.cjs} +8 -4
- package/components/index.cjs +1 -1
- package/components/index.js +1 -1
- package/package.json +1 -1
- package/react/package.json +2 -2
- package/standalone/chunks/{display-settings-datetime-DhmVs5jK.js → display-settings-datetime-l8eZ7vwV.js} +1 -1
- package/standalone/chunks/{display-settings-numeric-CnKNRgjc.js → display-settings-numeric-BVSff_nN.js} +1 -1
- package/standalone/chunks/{display-settings-period-over-period-Di_2_DDX.js → display-settings-period-over-period-By9WHn3a.js} +8 -4
- package/standalone/chunks/en-COt1Na3D.js +2 -0
- package/standalone/chunks/en-GB-6byNwC81.js +2 -0
- package/standalone/chunks/en-US-COt1Na3D.js +2 -0
- package/standalone/chunks/{formula-codemirror-Dn_LEpVx.js → formula-codemirror-BqV2Lr6d.js} +1 -1
- package/standalone/chunks/{item-option-guidelines-BnLLvaFI.js → item-option-guidelines-CWaGOxXF.js} +1 -1
- package/standalone/chunks/{item-option-panel-BWQpttWc.js → item-option-panel-Ts7D8J7X.js} +2 -2
- package/standalone/chunks/{item-slot-picker-panel-BZsTEDns.js → item-slot-picker-panel-CqG-cZZW.js} +2 -2
- package/standalone/interactive-viz-item.js +1 -1
- package/standalone/manifest.json +10 -10
- package/standalone/chunks/en-Cu0ra3lJ.js +0 -2
- package/standalone/chunks/en-GB-B575630r.js +0 -2
- package/standalone/chunks/en-US-Cu0ra3lJ.js +0 -2
package/standalone/chunks/{item-slot-picker-panel-BZsTEDns.js → item-slot-picker-panel-CqG-cZZW.js}
RENAMED
|
@@ -3,7 +3,7 @@ import{n as e,r as t,t as n}from"./localized-mixin-CLvEZO1g.js";import{t as r}fr
|
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ar(e,t){return er(e)||tr(e,t)||rr(e,t)||ir()}var or=/* @__PURE__ */ ie((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bind=void 0;function t(e,t){var n=t.type,r=t.listener,i=t.options;return e.addEventListener(n,r,i),function(){e.removeEventListener(n,r,i)}}e.bind=t})),sr=/* @__PURE__ */ ie(((e,t,n)=>{var r=n&&n.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},r.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=void 0;var i=or();function a(e){if(e!==void 0)return typeof e==`boolean`?{capture:e}:e}function o(e,t){return t==null?e:r(r({},e),{options:r(r({},a(t)),a(e.options))})}function s(e,t,n){var r=t.map(function(t){var r=o(t,n);return(0,i.bind)(e,r)});return function(){r.forEach(function(e){return e()})}}e.bindAll=s})),cr=/* @__PURE__ */ ie((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.bindAll=e.bind=void 0;var t=or();Object.defineProperty(e,"bind",{enumerable:!0,get:function(){return t.bind}});var n=sr();Object.defineProperty(e,"bindAll",{enumerable:!0,get:function(){return n.bindAll}})}));function lr(e){"@babel/helpers - typeof";return lr=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},lr(e)}function ur(e,t){if(lr(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(lr(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dr(e){var t=ur(e,`string`);return lr(t)==`symbol`?t:t+``}function fr(e,t,n){return(t=dr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var pr=cr(),mr=2147483647,hr=`data-pdnd-honey-pot`;function gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gr(Object(n),!0).forEach(function(t){fr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var vr=2,yr=vr/2;function br(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function xr(e){return{x:e.x-yr,y:e.y-yr}}function Sr(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function Cr(e){return{x:Math.min(e.x,window.innerWidth-vr),y:Math.min(e.y,window.innerHeight-vr)}}function wr(e){var t=e.client,n=Cr(Sr(xr(br(t))));return DOMRect.fromRect({x:n.x,y:n.y,width:vr,height:vr})}function Tr(e){var t=e.clientRect;return{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`}}function Er(e){var t=e.client,n=e.clientRect;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function Dr(e){var t=e.initial,n=document.createElement(`div`);n.setAttribute(hr,`true`);var r=wr({client:t});Object.assign(n.style,_r(_r({backgroundColor:`transparent`,position:`fixed`,padding:0,margin:0,boxSizing:`border-box`},Tr({clientRect:r})),{},{pointerEvents:`auto`,zIndex:mr})),document.body.appendChild(n);var i=(0,pr.bind)(window,{type:`pointermove`,listener:function(e){r=wr({client:{x:e.clientX,y:e.clientY}}),Object.assign(n.style,Tr({clientRect:r}))},options:{capture:!0}});return function(e){var t=e.current;if(i(),Er({client:t,clientRect:r})){n.remove();return}function a(){o(),n.remove()}var o=(0,pr.bindAll)(window,[{type:`pointerdown`,listener:a},{type:`pointermove`,listener:a},{type:`focusin`,listener:a},{type:`focusout`,listener:a},{type:`dragstart`,listener:a},{type:`dragenter`,listener:a},{type:`dragover`,listener:a}],{capture:!0})}}function Or(){var e=null;function t(){return e=null,(0,pr.bind)(window,{type:`pointermove`,listener:function(t){e={x:t.clientX,y:t.clientY}},options:{capture:!0}})}function n(){var t=null;return function(n){var r=n.eventName,i=n.payload;if(r===`onDragStart`){var a=i.location.initial.input;t=Dr({initial:e??{x:a.clientX,y:a.clientY}})}if(r===`onDrop`){var o,s=i.location.current.input;(o=t)==null||o({current:{x:s.clientX,y:s.clientY}}),t=null,e=null}}}return{bindEvents:t,getOnPostDispatch:n}}function kr(e){if(Array.isArray(e))return nr(e)}function Ar(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function jr(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
4
4
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mr(e){return kr(e)||Ar(e)||rr(e)||jr()}function Nr(e){return e instanceof Element&&e.hasAttribute(`data-pdnd-honey-pot`)}function Pr(e){var t=ar(document.elementsFromPoint(e.x,e.y),2),n=t[0],r=t[1];return n?Nr(n)?r??null:n:null}function Fr(e){var t=null;return function(){if(!t){var n=[...arguments];t={result:e.apply(this,n)}}return t.result}}var Ir=Fr(function(){return navigator.userAgent.includes(`Firefox`)}),Lr=Fr(function(){var e=navigator.userAgent;return e.includes(`AppleWebKit`)&&!e.includes(`Chrome`)}),Rr={isLeavingWindow:Symbol(`leaving`),isEnteringWindow:Symbol(`entering`)};function zr(e){var t=e.dragLeave;return Lr()?t.hasOwnProperty(Rr.isLeavingWindow):!1}(function(){if(typeof window>`u`||!Lr())return;function e(){return{enterCount:0,isOverWindow:!1}}var t=e();function n(){t=e()}(0,pr.bindAll)(window,[{type:`dragstart`,listener:function(){t.enterCount=0,t.isOverWindow=!0}},{type:`drop`,listener:n},{type:`dragend`,listener:n},{type:`dragenter`,listener:function(e){!t.isOverWindow&&t.enterCount===0&&(e[Rr.isEnteringWindow]=!0),t.isOverWindow=!0,t.enterCount++}},{type:`dragleave`,listener:function(e){t.enterCount--,t.isOverWindow&&t.enterCount===0&&(e[Rr.isLeavingWindow]=!0,t.isOverWindow=!1)}}],{capture:!0})})();function Br(e){return`nodeName`in e}function Vr(e){return Br(e)&&e.ownerDocument!==document}function Hr(e){var t=e.dragLeave,n=t.type,r=t.relatedTarget;return n===`dragleave`?Lr()?zr({dragLeave:t}):r==null?!0:Ir()?Vr(r):r instanceof HTMLIFrameElement:!1}function Ur(e){var t=e.onDragEnd;return[{type:`pointermove`,listener:function(){var e=0;return function(){e<20?e++:t()}}()},{type:`pointerdown`,listener:t}]}function Wr(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var Gr=function(e){var t=[],n=null,r=function(){t=[...arguments],!n&&(n=requestAnimationFrame(function(){n=null,e.apply(void 0,t)}))};return r.cancel=function(){n&&=(cancelAnimationFrame(n),null)},r}(function(e){return e()}),Kr=function(){var e=null;function t(t){e={frameId:requestAnimationFrame(function(){e=null,t()}),fn:t}}function n(){e&&=(cancelAnimationFrame(e.frameId),e.fn(),null)}return{schedule:t,flush:n}}();function qr(e){var t=e.source,n=e.initial,r=e.dispatchEvent,i={dropTargets:[]};function a(e){r(e),i={dropTargets:e.payload.location.current.dropTargets}}return{start:function(e){var r=e.nativeSetDragImage,o={current:n,previous:i,initial:n};a({eventName:`onGenerateDragPreview`,payload:{source:t,location:o,nativeSetDragImage:r}}),Kr.schedule(function(){a({eventName:`onDragStart`,payload:{source:t,location:o}})})},dragUpdate:function(e){var r=e.current;Kr.flush(),Gr.cancel(),a({eventName:`onDropTargetChange`,payload:{source:t,location:{initial:n,previous:i,current:r}}})},drag:function(e){var r=e.current;Gr(function(){Kr.flush(),a({eventName:`onDrag`,payload:{source:t,location:{initial:n,previous:i,current:r}}})})},drop:function(e){var r=e.current,o=e.updatedSourcePayload;Kr.flush(),Gr.cancel(),a({eventName:`onDrop`,payload:{source:o??t,location:{current:r,previous:i,initial:n}}})}}}var Jr={isActive:!1};function Yr(){return!Jr.isActive}function Xr(e){return e.dataTransfer?e.dataTransfer.setDragImage.bind(e.dataTransfer):null}function Zr(e){var t=e.current,n=e.next;if(t.length!==n.length)return!0;for(var r=0;r<t.length;r++)if(t[r].element!==n[r].element)return!0;return!1}function Qr(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=e.dispatchEvent;if(!Yr())return;var a=ei({event:t,dragType:n,getDropTargetsOver:r});Jr.isActive=!0;var o={current:a};$r({event:t,current:a.dropTargets});var s=qr({source:n.payload,dispatchEvent:i,initial:a});function c(e){var t=Zr({current:o.current.dropTargets,next:e.dropTargets});o.current=e,t&&s.dragUpdate({current:o.current})}function l(e){var t=Wr(e),i=r({target:Nr(e.target)?Pr({x:t.clientX,y:t.clientY}):e.target,event:e,input:t,source:n.payload,current:o.current.dropTargets});i.length&&(e.cancelable&&e.preventDefault(),$r({event:e,current:i})),c({dropTargets:i,input:t})}function u(){o.current.dropTargets.length&&c({dropTargets:[],input:o.current.input}),s.drop({current:o.current,updatedSourcePayload:null}),d()}function d(){Jr.isActive=!1,f()}var f=(0,pr.bindAll)(window,[{type:`dragover`,listener:function(e){l(e),s.drag({current:o.current})}},{type:`dragenter`,listener:l},{type:`dragleave`,listener:function(e){Hr({dragLeave:e})&&(c({input:o.current.input,dropTargets:[]}),n.startedFrom===`external`&&u())}},{type:`drop`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:Wr(e)},o.current.dropTargets.length?(e.cancelable&&e.preventDefault(),$r({event:e,current:o.current.dropTargets}),s.drop({current:o.current,updatedSourcePayload:n.type===`external`?n.getDropPayload(e):null}),d()):u()}},{type:`dragend`,listener:function(e){o.current={dropTargets:o.current.dropTargets,input:Wr(e)},u()}}].concat(Mr(Ur({onDragEnd:u}))),{capture:!0});s.start({nativeSetDragImage:Xr(t)})}function $r(e){var t=e.event,n=e.current[0]?.dropEffect;n!=null&&t.dataTransfer&&(t.dataTransfer.dropEffect=n)}function ei(e){var t=e.event,n=e.dragType,r=e.getDropTargetsOver,i=Wr(t);return n.startedFrom===`external`?{input:i,dropTargets:[]}:{input:i,dropTargets:r({input:i,source:n.payload,target:t.target,event:t,current:[]})}}var ti={canStart:Yr,start:Qr},ni=/* @__PURE__ */ new Map;function ri(e){var t=e.typeKey,n=e.mount,r=ni.get(t);if(r)return r.usageCount++,r;var i={typeKey:t,unmount:n(),usageCount:1};return ni.set(t,i),i}function ii(e){var t=ri(e);return function(){t.usageCount--,!(t.usageCount>0)&&(t.unmount(),ni.delete(e.typeKey))}}function ai(){var e=[...arguments];return function(){e.forEach(function(e){return e()})}}function oi(e,t){var n=t.attribute,r=t.value;return e.setAttribute(n,r),function(){return e.removeAttribute(n)}}function si(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function B(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?si(Object(n),!0).forEach(function(t){fr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):si(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ci(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=li(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
5
5
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function li(e,t){if(e){if(typeof e==`string`)return ui(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ui(e,t):void 0}}function ui(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function di(e){return e.slice(0).reverse()}function fi(e){var t=e.typeKey,n=e.defaultDropEffect,r=/* @__PURE__ */ new WeakMap,i=`data-drop-target-for-${t}`,a=`[${i}]`;function o(e){return r.set(e.element,e),function(){return r.delete(e.element)}}function s(e){return ai(oi(e.element,{attribute:i,value:`true`}),o(e))}function c(e){var t=e.source,i=e.target,o=e.input,s=e.event,l=e.result,u=l===void 0?[]:l;if(s===void 0)return u;let d=s.composedPath();if(i=d.find(e=>e instanceof Element&&e.hasAttribute(`data-drop-target-for-element`)),i??=d[0],!(i instanceof Element))return i instanceof Node?c({source:t,target:i.parentElement,input:o,result:u}):u;var f=i.closest(a);if(f==null)return u;var p=r.get(f);if(p==null)return u;var m={input:o,source:t,element:p.element};if(p.canDrop&&!p.canDrop(m))return c({source:t,target:p.element.parentElement,input:o,result:u});var h=p.getData?.call(p,m)??{},g=p.getDropEffect?.call(p,m)??n,_={data:h,element:p.element,dropEffect:g,isActiveDueToStickiness:!1};return c({source:t,target:p.element.parentElement,input:o,result:[].concat(Mr(u),[_])})}function l(e){var t=e.eventName,n=e.payload,i=ci(n.location.current.dropTargets),a;try{for(i.s();!(a=i.n()).done;){var o,s=a.value,c=r.get(s.element),l=B(B({},n),{},{self:s});c==null||(o=c[t])==null||o.call(c,l)}}catch(e){i.e(e)}finally{i.f()}}var u={onGenerateDragPreview:l,onDrag:l,onDragStart:l,onDrop:l,onDropTargetChange:function(e){var t=e.payload,n=new Set(t.location.current.dropTargets.map(function(e){return e.element})),i=/* @__PURE__ */ new Set,a=ci(t.location.previous.dropTargets),o;try{for(a.s();!(o=a.n()).done;){var s,c=o.value;i.add(c.element);var l=r.get(c.element),u=n.has(c.element),d=B(B({},t),{},{self:c});if(l==null||(s=l.onDropTargetChange)==null||s.call(l,d),!u){var f;l==null||(f=l.onDragLeave)==null||f.call(l,d)}}}catch(e){a.e(e)}finally{a.f()}var p=ci(t.location.current.dropTargets),m;try{for(p.s();!(m=p.n()).done;){var h,g,_=m.value;if(!i.has(_.element)){var v=B(B({},t),{},{self:_}),y=r.get(_.element);y==null||(h=y.onDropTargetChange)==null||h.call(y,v),y==null||(g=y.onDragEnter)==null||g.call(y,v)}}}catch(e){p.e(e)}finally{p.f()}}};function d(e){u[e.eventName](e)}function f(e){var t=e.source,n=e.target,i=e.input,a=e.event,o=e.current,s=c({source:t,target:n,event:a,input:i});if(s.length>=o.length)return s;for(var l=di(o),u=di(s),d=[],f=0;f<l.length;f++){var p,m=l[f],h=u[f];if(h!=null)d.push(h);else{var g=d[f-1],_=l[f-1];if(g?.element!==_?.element)break;var v=r.get(m.element);if(!v)break;var y={input:i,source:t,element:v.element};if(v.canDrop&&!v.canDrop(y)||!((p=v.getIsSticky)!=null&&p.call(v,y)))break;d.push(B(B({},m),{},{isActiveDueToStickiness:!0}))}}return di(d)}return{dropTargetForConsumers:s,getIsOver:f,dispatchEvent:d}}function pi(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=mi(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
6
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function mi(e,t){if(e){if(typeof e==`string`)return hi(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hi(e,t):void 0}}function hi(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _i(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gi(Object(n),!0).forEach(function(t){fr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vi(){var e=/* @__PURE__ */ new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=_i({},r);return e.add(i),n(i),function(){e.delete(i),t&&t.active.delete(i)}}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:/* @__PURE__ */ new Set};var o=pi(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function yi(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=vi(),s=fi({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;ti.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:ti.canStart,start:l})}return ii({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var bi=Fr(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),xi=`pdnd:android-fallback`,Si=`text/plain`,Ci=`application/vnd.pdnd`,wi=/* @__PURE__ */ new WeakMap;function Ti(e){return wi.set(e.element,e),function(){wi.delete(e.element)}}var Ei=Or(),Di=yi({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return ai(Ei.bindEvents(),(0,pr.bind)(document,{type:`dragstart`,listener:function(t){if(!e.canStart(t)||t.defaultPrevented||!t.dataTransfer)return;let n=t.composedPath().find(e=>e instanceof HTMLElement&&wi.has(e));if(!n)return null;let r=wi.get(n);if(!r)return null;var i=Wr(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a))return t.preventDefault(),null;if(r.dragHandle){let e=(n.shadowRoot||document).elementFromPoint(i.clientX,i.clientY);if(!r.dragHandle.contains(e))return t.preventDefault(),null}var o=r.getInitialDataForExternal?.call(r,a)??null;if(o)for(var s=0,c=Object.entries(o);s<c.length;s++){var l=ar(c[s],2),u=l[0],d=l[1];t.dataTransfer.setData(u,d??``)}bi()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(Si,xi),t.dataTransfer.setData(Ci,``);var f={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:f})}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=wi.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:Ei.getOnPostDispatch()}),Oi=Di.dropTarget,ki=Di.monitor;function Ai(e){return ai(Di.registerUsage(),Ti(e),oi(e.element,{attribute:`draggable`,value:`true`}))}var ji=/* @__PURE__ */ ae({draggable:()=>Ai,dropTargetForElements:()=>Oi,monitorForElements:()=>ki}),Mi=Symbol.for(`@luzmo/analytics-components-kit/drag/element-adapter`),Ni=globalThis,Pi=Ni[Mi];Pi===void 0&&(Pi=ji,Ni[Mi]=ji);var{draggable:Fi,dropTargetForElements:Ii,monitorForElements:Li}=Pi;function Ri(e,t,n){return{icon:l({type:e?.type??`hierarchy`,subtype:e?.subtype,lowestLevel:e?.lowestLevel},`s`),label:e?x(e.name,t):n}}var V=String.raw`[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}`,zi=RegExp(`##EMPTYARG-(${V})##|{(${V}:${V})}|##AGGR-(${V})##`,`gm`),Bi=RegExp(`##EMPTYARG-(${V})##|{(${V}:${V})}`,`gm`),Vi=/((GROUPFULL|GROUPINEX)\()?(AVG|COUNT|COUNTD|COUNTR|MAX|MIN|SUM)\(/m,Hi=RegExp(`##AGGR-(${V})##`,`m`),Ui=/\[(.*?)\]/gm,Wi=RegExp(`{(${V}:${V})}`,`gm`),Gi=[`AVG`,`COUNT`,`COUNTD`,`COUNTR`,`MAX`,`MIN`,`SUM`];function Ki(){return{AVG:{arity:1,label:()=>t(`Average`,{desc:`Aggregation label`}),description:()=>t(`Calculates the average of the values.`,{desc:`Formula aggregation description for AVG`}),example:()=>`AVG(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},COUNT:{arity:1,label:()=>t(`Count`,{desc:`Aggregation label`}),description:()=>t(`Counts the number of non-empty values.`,{desc:`Formula aggregation description for COUNT`}),example:()=>`COUNT(⟨numeric⟩ Order Number)`,exampleHasIcons:!0},COUNTD:{arity:1,label:()=>t(`Count distinct`,{desc:`Aggregation label`}),description:()=>t(`Counts the number of distinct values.`,{desc:`Formula aggregation description for COUNTD`}),example:()=>`COUNTD(⟨numeric⟩ Customer ID)`,exampleHasIcons:!0},COUNTR:{arity:0,label:()=>t(`Count rows`,{desc:`Aggregation label`}),description:()=>t(`Counts the number of rows.`,{desc:`Formula aggregation description for COUNTR`}),example:()=>`COUNTR()`},MAX:{arity:1,label:()=>t(`Maximum`,{desc:`Aggregation label`}),description:()=>t(`Returns the largest value.`,{desc:`Formula aggregation description for MAX`}),example:()=>`MAX(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},MIN:{arity:1,label:()=>t(`Minimum`,{desc:`Aggregation label`}),description:()=>t(`Returns the smallest value.`,{desc:`Formula aggregation description for MIN`}),example:()=>`MIN(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},SUM:{arity:1,label:()=>t(`Sum`,{desc:`Aggregation label`}),description:()=>t(`Adds up all the values.`,{desc:`Formula aggregation description for SUM`}),example:()=>`SUM(⟨numeric⟩ Quantity Sold)`,exampleHasIcons:!0}}}var H=/* @__PURE__ */ function(e){return e.GROUP=``,e.GROUPFULL=`GROUPFULL`,e.GROUPINEX=`GROUPINEX`,e}({}),qi=[H.GROUP,H.GROUPFULL,H.GROUPINEX];function Ji(){return{[H.GROUP]:{label:()=>t(`Grouped`,{desc:`Formula aggregation grouping label for grouped scope`}),description:()=>t(`Aggregates within the current grouping of the chart.`,{desc:`Formula aggregation grouping description for grouped scope`}),icon:ce,color:`var(--luzmo-formula-grouping-color-grouped, #625df6)`},[H.GROUPFULL]:{label:()=>t(`Full`,{desc:`Formula aggregation grouping label for full scope`}),description:()=>t(`Aggregates across the entire dataset, ignoring the chart grouping.`,{desc:`Formula aggregation grouping description for full scope`}),icon:le,color:`var(--luzmo-formula-grouping-color-full, #0ca789)`},[H.GROUPINEX]:{label:()=>t(`Include / exclude`,{desc:`Formula aggregation grouping label for include/exclude scope`}),description:()=>t(`Aggregates over a custom grouping built from included and excluded columns.`,{desc:`Formula aggregation grouping description for include/exclude scope`}),icon:ue,color:`var(--luzmo-formula-grouping-color-include-exclude, #f00f65)`}}}var Yi=S(()=>import(`./formula-codemirror-Dn_LEpVx.js`));async function Xi(){await Yi.load()}function Zi(){return Yi.isLoaded()}var Qi={Category:()=>t(`Category`,{desc:`Category slot label`}),Measure:()=>t(`Measure`,{desc:`Measure slot label`}),Measures:()=>t(`Measures`,{desc:`Measures slot label`}),Legend:()=>t(`Legend`,{desc:`Legend slot label`}),"Group by":()=>t(`Group by`,{desc:`Group by slot label`}),"Y-Axis":()=>t(`Y-Axis`,{desc:`Y-Axis slot label`}),"X-Axis":()=>t(`X-Axis`,{desc:`X-Axis slot label`}),Dimension:()=>t(`Dimension`,{desc:`Dimension slot label`}),Datetime:()=>t(`Datetime`,{desc:`Datetime slot label`}),"Slider metric":()=>t(`Slider metric`,{desc:`Slider metric slot label`}),Bins:()=>t(`Bins`,{desc:`Bins slot label`}),Circles:()=>t(`Circles`,{desc:`Circles slot label`}),Close:()=>t(`Close`,{desc:`Close slot label`}),Color:()=>t(`Color`,{desc:`Color slot label`}),Columns:()=>t(`Columns`,{desc:`Columns slot label`}),Coordinates:()=>t(`Coordinates`,{desc:`Coordinates slot label`}),Destination:()=>t(`Destination`,{desc:`Destination slot label`}),Evolution:()=>t(`Evolution`,{desc:`Evolution slot label`}),Geography:()=>t(`Geography`,{desc:`Geography slot label`}),High:()=>t(`High`,{desc:`High slot label`}),Identifier:()=>t(`Identifier`,{desc:`Identifier slot label`}),Levels:()=>t(`Levels`,{desc:`Levels slot label`}),Low:()=>t(`Low`,{desc:`Low slot label`}),Name:()=>t(`Name`,{id:`slot-label-name`,desc:`Name slot label`}),Open:()=>t(`Open`,{desc:`Open slot label`}),Order:()=>t(`Order`,{desc:`Order slot label`}),Route:()=>t(`Route`,{desc:`Route slot label`}),Rows:()=>t(`Rows`,{desc:`Rows slot label`}),Size:()=>t(`Size`,{desc:`Size slot label`}),Source:()=>t(`Source`,{desc:`Source slot label`}),Target:()=>t(`Target`,{desc:`Target slot label`}),Time:()=>t(`Time`,{id:`slot-label-time`,desc:`Time slot label`})},$i=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=r??!1}};function ea(e){return e}var ta=class{constructor(e,t,n,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,t.context!==void 0){let e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&=(this.unsubscribe(),void 0)}dispatchRequest(){this.host.dispatchEvent(new $i(this.context,this.host,this.t,this.subscribe))}},na=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=/* @__PURE__ */ new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},ra=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},ia=class extends na{constructor(e,t,n){super(t.context===void 0?n:t.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context||(e.contextTarget??e.composedPath()[0])===this.host)return;let t=/* @__PURE__ */ new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new $i(this.context,n,e,!0)));e.stopPropagation()},this.host=e,this.context=t.context===void 0?t:t.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new ra(this.context,this.host))}};function aa({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new ta(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new ta(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var oa=[`datetime`,`hierarchy`,`numeric`,`spatial`,`array[datetime]`,`array[numeric]`,`array[hierarchy]`,`array[spatial]`],sa=ea(Symbol(`slot-store-context`)),ca=Object.defineProperty,la=(e,t,n)=>t in e?ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ua=(e,t,n)=>(la(e,typeof t==`symbol`?t:t+``,n),n),da=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},fa=(e,t)=>{if(Object(t)!==t)throw TypeError(`Cannot use the "in" operator on this value`);return e.has(t)},pa=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},ma=(e,t,n)=>(da(e,t,`access private method`),n);function ha(e,t){return Object.is(e,t)}var U=null,ga=!1,_a=1,va=/* @__PURE__ */ Symbol(`SIGNAL`);function ya(e){let t=U;return U=e,t}function ba(){return U}function xa(){return ga}var Sa={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Ca(e){if(ga)throw Error(typeof ngDevMode<`u`&&ngDevMode?`Assertion error: signal read during notification phase`:``);if(U===null)return;U.consumerOnSignalRead(e);let t=U.nextProducerIndex++;if(Fa(U),t<U.producerNode.length&&U.producerNode[t]!==e&&Pa(U)){let e=U.producerNode[t];Na(e,U.producerIndexOfThis[t])}U.producerNode[t]!==e&&(U.producerNode[t]=e,U.producerIndexOfThis[t]=Pa(U)?Ma(e,U,t):0),U.producerLastReadVersion[t]=e.version}function wa(){_a++}function Ta(e){(e.dirty||e.lastCleanEpoch!==_a)&&(!e.producerMustRecompute(e)&&!ja(e)?(e.dirty=!1,e.lastCleanEpoch=_a):(e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=_a))}function Ea(e){if(e.liveConsumerNode===void 0)return;let t=ga;ga=!0;try{for(let t of e.liveConsumerNode)t.dirty||Oa(t)}finally{ga=t}}function Da(){return U?.consumerAllowSignalWrites!==!1}function Oa(e){var t;e.dirty=!0,Ea(e),(t=e.consumerMarkedDirty)==null||t.call(e.wrapper??e)}function ka(e){return e&&(e.nextProducerIndex=0),ya(e)}function Aa(e,t){if(ya(t),e&&e.producerNode!==void 0&&e.producerIndexOfThis!==void 0&&e.producerLastReadVersion!==void 0){if(Pa(e))for(let t=e.nextProducerIndex;t<e.producerNode.length;t++)Na(e.producerNode[t],e.producerIndexOfThis[t]);for(;e.producerNode.length>e.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function ja(e){Fa(e);for(let t=0;t<e.producerNode.length;t++){let n=e.producerNode[t],r=e.producerLastReadVersion[t];if(r!==n.version||(Ta(n),r!==n.version))return!0}return!1}function Ma(e,t,n){var r;if(Ia(e),Fa(e),e.liveConsumerNode.length===0){(r=e.watched)==null||r.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)e.producerIndexOfThis[t]=Ma(e.producerNode[t],e,t)}return e.liveConsumerIndexOfThis.push(n),e.liveConsumerNode.push(t)-1}function Na(e,t){var n;if(Ia(e),Fa(e),typeof ngDevMode<`u`&&ngDevMode&&t>=e.liveConsumerNode.length)throw Error(`Assertion error: active consumer index ${t} is out of bounds of ${e.liveConsumerNode.length} consumers)`);if(e.liveConsumerNode.length===1){(n=e.unwatched)==null||n.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)Na(e.producerNode[t],e.producerIndexOfThis[t])}let r=e.liveConsumerNode.length-1;if(e.liveConsumerNode[t]=e.liveConsumerNode[r],e.liveConsumerIndexOfThis[t]=e.liveConsumerIndexOfThis[r],e.liveConsumerNode.length--,e.liveConsumerIndexOfThis.length--,t<e.liveConsumerNode.length){let n=e.liveConsumerIndexOfThis[t],r=e.liveConsumerNode[t];Fa(r),r.producerIndexOfThis[n]=t}}function Pa(e){return e.consumerIsAlwaysLive||(e?.liveConsumerNode?.length??0)>0}function Fa(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function Ia(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function La(e){if(Ta(e),Ca(e),e.value===Va)throw e.error;return e.value}function Ra(e){let t=Object.create(Ha);t.computation=e;let n=()=>La(t);return n[va]=t,n}var za=/* @__PURE__ */ Symbol(`UNSET`),Ba=/* @__PURE__ */ Symbol(`COMPUTING`),Va=/* @__PURE__ */ Symbol(`ERRORED`),Ha={...Sa,value:za,dirty:!0,error:null,equal:ha,producerMustRecompute(e){return e.value===za||e.value===Ba},producerRecomputeValue(e){if(e.value===Ba)throw Error(`Detected cycle in computations.`);let t=e.value;e.value=Ba;let n=ka(e),r,i=!1;try{r=e.computation.call(e.wrapper),i=t!==za&&t!==Va&&e.equal.call(e.wrapper,t,r)}catch(t){r=Va,e.error=t}finally{Aa(e,n)}i?e.value=t:(e.value=r,e.version++)}};function Ua(){throw Error()}var Wa=Ua;function Ga(){Wa()}function Ka(e){let t=Object.create(Ya);t.value=e;let n=()=>(Ca(t),t.value);return n[va]=t,n}function qa(){return Ca(this),this.value}function Ja(e,t){Da()||Ga(),e.equal.call(e.wrapper,e.value,t)||(e.value=t,Xa(e))}var Ya={...Sa,equal:ha,value:void 0};function Xa(e){e.version++,wa(),Ea(e)}var W=Symbol(`node`),G;(e=>{var t,n,r,i;class a{constructor(r,i={}){pa(this,n),ua(this,t);let a=Ka(r)[va];if(this[W]=a,a.wrapper=this,i){let t=i.equals;t&&(a.equal=t),a.watched=i[e.subtle.watched],a.unwatched=i[e.subtle.unwatched]}}get(){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.get`);return qa.call(this[W])}set(t){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.set`);if(xa())throw Error(`Writes to signals not permitted during Watcher callback`);let n=this[W];Ja(n,t)}}t=W,n=/* @__PURE__ */ new WeakSet,e.isState=e=>typeof e==`object`&&fa(n,e),e.State=a;class o{constructor(t,n){pa(this,i),ua(this,r);let a=Ra(t)[va];if(a.consumerAllowSignalWrites=!0,this[W]=a,a.wrapper=this,n){let t=n.equals;t&&(a.equal=t),a.watched=n[e.subtle.watched],a.unwatched=n[e.subtle.unwatched]}}get(){if(!(0,e.isComputed)(this))throw TypeError(`Wrong receiver type for Signal.Computed.prototype.get`);return La(this[W])}}r=W,i=/* @__PURE__ */ new WeakSet,e.isComputed=e=>typeof e==`object`&&fa(i,e),e.Computed=o,(t=>{var n,r,i,a;function o(e){let t,n=null;try{n=ya(null),t=e()}finally{ya(n)}return t}t.untrack=o;function s(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called introspectSources without a Computed or Watcher argument`);return t[W].producerNode?.map(e=>e.wrapper)??[]}t.introspectSources=s;function c(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called introspectSinks without a Signal argument`);return t[W].liveConsumerNode?.map(e=>e.wrapper)??[]}t.introspectSinks=c;function l(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called hasSinks without a Signal argument`);let n=t[W].liveConsumerNode;return n?n.length>0:!1}t.hasSinks=l;function u(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called hasSources without a Computed or Watcher argument`);let n=t[W].producerNode;return n?n.length>0:!1}t.hasSources=u;class d{constructor(e){pa(this,r),pa(this,i),ua(this,n);let t=Object.create(Sa);t.wrapper=this,t.consumerMarkedDirty=e,t.consumerIsAlwaysLive=!0,t.consumerAllowSignalWrites=!1,t.producerNode=[],this[W]=t}watch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);ma(this,i,a).call(this,t);let n=this[W];n.dirty=!1;let r=ya(n);for(let e of t)Ca(e[W]);ya(r)}unwatch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);ma(this,i,a).call(this,t);let n=this[W];Fa(n);for(let e=n.producerNode.length-1;e>=0;e--)if(t.includes(n.producerNode[e].wrapper)){Na(n.producerNode[e],n.producerIndexOfThis[e]);let t=n.producerNode.length-1;if(n.producerNode[e]=n.producerNode[t],n.producerIndexOfThis[e]=n.producerIndexOfThis[t],n.producerNode.length--,n.producerIndexOfThis.length--,n.nextProducerIndex--,e<n.producerNode.length){let t=n.producerIndexOfThis[e],r=n.producerNode[e];Ia(r),r.liveConsumerIndexOfThis[t]=e}}}getPending(){if(!(0,e.isWatcher)(this))throw TypeError(`Called getPending without Watcher receiver`);return this[W].producerNode.filter(e=>e.dirty).map(e=>e.wrapper)}}n=W,r=/* @__PURE__ */ new WeakSet,i=/* @__PURE__ */ new WeakSet,a=function(t){for(let n of t)if(!(0,e.isComputed)(n)&&!(0,e.isState)(n))throw TypeError(`Called watch/unwatch without a Computed or State argument`)},e.isWatcher=e=>fa(r,e),t.Watcher=d;function f(){return ba()?.wrapper}t.currentComputed=f,t.watched=Symbol(`watched`),t.unwatched=Symbol(`unwatched`)})(e.subtle||={})})(G||={});var Za=Symbol(`SignalWatcherBrand`),Qa=new FinalizationRegistry((({watcher:e,signal:t})=>{e.unwatch(t)})),$a=/* @__PURE__ */ new WeakMap;function eo(e){return!0===e[Za]?(console.warn(`SignalWatcher should not be applied to the same class more than once.`),e):class extends e{constructor(){super(...arguments),this._$St=new G.State(0),this._$Si=!1,this._$So=!0,this._$Sh=/* @__PURE__ */ new Set}_$Sl(){if(this._$Su!==void 0)return;this._$Sv=new G.Computed((()=>{this._$St.get(),super.performUpdate()}));let e=this._$Su=new G.subtle.Watcher((function(){let e=$a.get(this);e!==void 0&&(!1===e._$Si&&e.requestUpdate(),this.watch())}));$a.set(e,this),Qa.register(this,{watcher:e,signal:this._$Sv}),e.watch(this._$Sv)}_$Sp(){this._$Su!==void 0&&(this._$Su.unwatch(this._$Sv),this._$Sv=void 0,this._$Su=void 0)}performUpdate(){this.isUpdatePending&&(this._$Sl(),this._$Si=!0,this._$St.set(this._$St.get()+1),this._$Si=!1,this._$Sv.get())}update(e){try{this._$So?(this._$So=!1,super.update(e)):this._$Sh.forEach((e=>e.commit()))}finally{this.isUpdatePending=!1,this._$Sh.clear()}}requestUpdate(e,t,n){this._$So=!0,super.requestUpdate(e,t,n)}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask((()=>{!1===this.isConnected&&this._$Sp()}))}_(e){this._$Sh.add(e);let t=this._$So;this.requestUpdate(),this._$So=t}m(e){this._$Sh.delete(e)}}}ee(class extends w{_$Sl(){if(this._$Su!==void 0)return;this._$SW=new G.Computed((()=>this._$Sj?.get()));let e=this._$Su=new G.subtle.Watcher((()=>{var t;(t=this._$SO)==null||t._(this),e.watch()}));e.watch(this._$SW)}_$Sp(){var e;this._$Su!==void 0&&(this._$Su.unwatch(this._$SW),this._$SW=void 0,this._$Su=void 0,(e=this._$SO)==null||e.m(this))}commit(){this.setValue(G.subtle.untrack((()=>this._$SW?.get())))}render(e){return G.subtle.untrack((()=>e.get()))}update(e,[t]){return this._$SO??=e.options?.host,t!==this._$Sj&&this._$Sj!==void 0&&this._$Sp(),this._$Sj=t,this._$Sl(),G.subtle.untrack((()=>this._$SW.get()))}disconnected(){this._$Sp()}reconnected(){this._$Sl()}}),G.State,G.Computed;var K=(e,t)=>new G.State(e,t),to=(e,t)=>new G.Computed(e,t),no=class{constructor(){this.slotContents=K([]),this.slotsContents=K([]),this.periodOverPeriodUiType=K(null),this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn=K(!1),this.periodOverPeriodHidesPastValue=K(!1),this.linkedDataset=K([]),this.hasConnectedComparisonFilter=K(!1),this.itemType=K(void 0),this._popPeriodsWithoutDatetimeColumnItemTypes=[`kpi`],this._popWithoutPastValueItemTypes=[`kpi`],this.activeSlotContents=to(()=>this.slotContents.get()[this.activeIndex.get()]),this.activeIndex=K(0)}setPeriodOverPeriodCondition(e,t){this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn.set(this._popPeriodsWithoutDatetimeColumnItemTypes.includes(e)),this.periodOverPeriodHidesPastValue.set(this._popWithoutPastValueItemTypes.includes(e)),this.itemType.set(e),this.periodOverPeriodUiType.set(this.getUiConditionToApply())}getUiConditionToApply(){return Gn({slots:this.slotsContents.get(),itemType:this.itemType.get(),hasConnectedComparisonFilter:this.hasConnectedComparisonFilter.get(),hasRelatedDatetimeColumns:this.linkedDataset.get().some(({columns:e})=>e?.some(e=>e.type===`datetime`))})}setContents(e,t){if(this.slotContents.set(e),this.activeIndex.get()>=e.length&&this.activeIndex.set(e.length>0?e.length-1:0),t){let n=structuredClone(this.slotsContents.get())??[],r=n.find(e=>e.name===t);r&&(r.content=e),this.setFullContents(n)}}setFullContents(e){this.slotsContents.set(e)}updateActive(e){e>=0&&e<this.slotContents.get().length&&this.activeIndex.set(e)}updateContent(e,t=this.activeIndex.get()){if(t<0||t>=this.slotContents.get().length)return;let n=[...this.slotContents.get()];n[t]=structuredClone(e),this.slotContents.set(n)}removeContent(e){if(e<0||e>=this.slotContents.get().length)return;let t=this.slotContents.get().filter((t,n)=>n!==e);this.slotContents.set(t),this.activeIndex.get()>=t.length&&this.activeIndex.set(t.length>0?t.length-1:0)}},ro=e=>typeof e==`string`&&e.trim().length>0,io=e=>!(!e||!ro(e.formula)||e.formulaId||v(e.formula)),ao=e=>!(!e||!ro(e.expression)||e.columnId||e.column||e.formulaId||e.formula),oo=e=>ao(e)?e?.expression:io(e)?e?.formula:void 0,so=e=>e?.columnId??e?.formulaId??e?.column??e?.formula??e?.expression,q=(e,t)=>ao(e)?!0:!e||!io(e)?!1:$n({slotName:String(t.name??``),slotType:t.type,contentKind:Qn(e)})===`measure`,co=e=>{let n=io(e);return E`<span class="calculation-label">
|
|
6
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function mi(e,t){if(e){if(typeof e==`string`)return hi(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hi(e,t):void 0}}function hi(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function gi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _i(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gi(Object(n),!0).forEach(function(t){fr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vi(){var e=/* @__PURE__ */ new Set,t=null;function n(e){t&&(!e.canMonitor||e.canMonitor(t.canMonitorArgs))&&t.active.add(e)}function r(r){var i=_i({},r);return e.add(i),n(i),function(){e.delete(i),t&&t.active.delete(i)}}function i(r){var i=r.eventName,a=r.payload;if(i===`onGenerateDragPreview`){t={canMonitorArgs:{initial:a.location.initial,source:a.source},active:/* @__PURE__ */ new Set};var o=pi(e),s;try{for(o.s();!(s=o.n()).done;){var c=s.value;n(c)}}catch(e){o.e(e)}finally{o.f()}}if(t){for(var l=Array.from(t.active),u=0,d=l;u<d.length;u++){var f=d[u];if(t.active.has(f)){var p;(p=f[i])==null||p.call(f,a)}}i===`onDrop`&&(t.active.clear(),t=null)}}return{dispatchEvent:i,monitorForConsumers:r}}function yi(e){var t=e.typeKey,n=e.mount,r=e.dispatchEventToSource,i=e.onPostDispatch,a=e.defaultDropEffect,o=vi(),s=fi({typeKey:t,defaultDropEffect:a});function c(e){r?.(e),s.dispatchEvent(e),o.dispatchEvent(e),i?.(e)}function l(e){var t=e.event,n=e.dragType;ti.start({event:t,dragType:n,getDropTargetsOver:s.getIsOver,dispatchEvent:c})}function u(){function e(){return n({canStart:ti.canStart,start:l})}return ii({typeKey:t,mount:e})}return{registerUsage:u,dropTarget:s.dropTargetForConsumers,monitor:o.monitorForConsumers}}var bi=Fr(function(){return navigator.userAgent.toLocaleLowerCase().includes(`android`)}),xi=`pdnd:android-fallback`,Si=`text/plain`,Ci=`application/vnd.pdnd`,wi=/* @__PURE__ */ new WeakMap;function Ti(e){return wi.set(e.element,e),function(){wi.delete(e.element)}}var Ei=Or(),Di=yi({typeKey:`element`,defaultDropEffect:`move`,mount:function(e){return ai(Ei.bindEvents(),(0,pr.bind)(document,{type:`dragstart`,listener:function(t){if(!e.canStart(t)||t.defaultPrevented||!t.dataTransfer)return;let n=t.composedPath().find(e=>e instanceof HTMLElement&&wi.has(e));if(!n)return null;let r=wi.get(n);if(!r)return null;var i=Wr(t),a={element:r.element,dragHandle:r.dragHandle??null,input:i};if(r.canDrag&&!r.canDrag(a))return t.preventDefault(),null;if(r.dragHandle){let e=(n.shadowRoot||document).elementFromPoint(i.clientX,i.clientY);if(!r.dragHandle.contains(e))return t.preventDefault(),null}var o=r.getInitialDataForExternal?.call(r,a)??null;if(o)for(var s=0,c=Object.entries(o);s<c.length;s++){var l=ar(c[s],2),u=l[0],d=l[1];t.dataTransfer.setData(u,d??``)}bi()&&!t.dataTransfer.types.includes(`text/plain`)&&!t.dataTransfer.types.includes(`text/uri-list`)&&t.dataTransfer.setData(Si,xi),t.dataTransfer.setData(Ci,``);var f={type:`element`,payload:{element:r.element,dragHandle:r.dragHandle??null,data:r.getInitialData?.call(r,a)??{}},startedFrom:`internal`};e.start({event:t,dragType:f})}}))},dispatchEventToSource:function(e){var t,n,r=e.eventName,i=e.payload;(t=wi.get(i.source.element))==null||(n=t[r])==null||n.call(t,i)},onPostDispatch:Ei.getOnPostDispatch()}),Oi=Di.dropTarget,ki=Di.monitor;function Ai(e){return ai(Di.registerUsage(),Ti(e),oi(e.element,{attribute:`draggable`,value:`true`}))}var ji=/* @__PURE__ */ ae({draggable:()=>Ai,dropTargetForElements:()=>Oi,monitorForElements:()=>ki}),Mi=Symbol.for(`@luzmo/analytics-components-kit/drag/element-adapter`),Ni=globalThis,Pi=Ni[Mi];Pi===void 0&&(Pi=ji,Ni[Mi]=ji);var{draggable:Fi,dropTargetForElements:Ii,monitorForElements:Li}=Pi;function Ri(e,t,n){return{icon:l({type:e?.type??`hierarchy`,subtype:e?.subtype,lowestLevel:e?.lowestLevel},`s`),label:e?x(e.name,t):n}}var V=String.raw`[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}`,zi=RegExp(`##EMPTYARG-(${V})##|{(${V}:${V})}|##AGGR-(${V})##`,`gm`),Bi=RegExp(`##EMPTYARG-(${V})##|{(${V}:${V})}`,`gm`),Vi=/((GROUPFULL|GROUPINEX)\()?(AVG|COUNT|COUNTD|COUNTR|MAX|MIN|SUM)\(/m,Hi=RegExp(`##AGGR-(${V})##`,`m`),Ui=/\[(.*?)\]/gm,Wi=RegExp(`{(${V}:${V})}`,`gm`),Gi=[`AVG`,`COUNT`,`COUNTD`,`COUNTR`,`MAX`,`MIN`,`SUM`];function Ki(){return{AVG:{arity:1,label:()=>t(`Average`,{desc:`Aggregation label`}),description:()=>t(`Calculates the average of the values.`,{desc:`Formula aggregation description for AVG`}),example:()=>`AVG(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},COUNT:{arity:1,label:()=>t(`Count`,{desc:`Aggregation label`}),description:()=>t(`Counts the number of non-empty values.`,{desc:`Formula aggregation description for COUNT`}),example:()=>`COUNT(⟨numeric⟩ Order Number)`,exampleHasIcons:!0},COUNTD:{arity:1,label:()=>t(`Count distinct`,{desc:`Aggregation label`}),description:()=>t(`Counts the number of distinct values.`,{desc:`Formula aggregation description for COUNTD`}),example:()=>`COUNTD(⟨numeric⟩ Customer ID)`,exampleHasIcons:!0},COUNTR:{arity:0,label:()=>t(`Count rows`,{desc:`Aggregation label`}),description:()=>t(`Counts the number of rows.`,{desc:`Formula aggregation description for COUNTR`}),example:()=>`COUNTR()`},MAX:{arity:1,label:()=>t(`Maximum`,{desc:`Aggregation label`}),description:()=>t(`Returns the largest value.`,{desc:`Formula aggregation description for MAX`}),example:()=>`MAX(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},MIN:{arity:1,label:()=>t(`Minimum`,{desc:`Aggregation label`}),description:()=>t(`Returns the smallest value.`,{desc:`Formula aggregation description for MIN`}),example:()=>`MIN(⟨numeric⟩ Order Value)`,exampleHasIcons:!0},SUM:{arity:1,label:()=>t(`Sum`,{desc:`Aggregation label`}),description:()=>t(`Adds up all the values.`,{desc:`Formula aggregation description for SUM`}),example:()=>`SUM(⟨numeric⟩ Quantity Sold)`,exampleHasIcons:!0}}}var H=/* @__PURE__ */ function(e){return e.GROUP=``,e.GROUPFULL=`GROUPFULL`,e.GROUPINEX=`GROUPINEX`,e}({}),qi=[H.GROUP,H.GROUPFULL,H.GROUPINEX];function Ji(){return{[H.GROUP]:{label:()=>t(`Grouped`,{desc:`Formula aggregation grouping label for grouped scope`}),description:()=>t(`Aggregates within the current grouping of the chart.`,{desc:`Formula aggregation grouping description for grouped scope`}),icon:ce,color:`var(--luzmo-formula-grouping-color-grouped, #625df6)`},[H.GROUPFULL]:{label:()=>t(`Full`,{desc:`Formula aggregation grouping label for full scope`}),description:()=>t(`Aggregates across the entire dataset, ignoring the chart grouping.`,{desc:`Formula aggregation grouping description for full scope`}),icon:le,color:`var(--luzmo-formula-grouping-color-full, #0ca789)`},[H.GROUPINEX]:{label:()=>t(`Include / exclude`,{desc:`Formula aggregation grouping label for include/exclude scope`}),description:()=>t(`Aggregates over a custom grouping built from included and excluded columns.`,{desc:`Formula aggregation grouping description for include/exclude scope`}),icon:ue,color:`var(--luzmo-formula-grouping-color-include-exclude, #f00f65)`}}}var Yi=S(()=>import(`./formula-codemirror-BqV2Lr6d.js`));async function Xi(){await Yi.load()}function Zi(){return Yi.isLoaded()}var Qi={Category:()=>t(`Category`,{desc:`Category slot label`}),Measure:()=>t(`Measure`,{desc:`Measure slot label`}),Measures:()=>t(`Measures`,{desc:`Measures slot label`}),Legend:()=>t(`Legend`,{desc:`Legend slot label`}),"Group by":()=>t(`Group by`,{desc:`Group by slot label`}),"Y-Axis":()=>t(`Y-Axis`,{desc:`Y-Axis slot label`}),"X-Axis":()=>t(`X-Axis`,{desc:`X-Axis slot label`}),Dimension:()=>t(`Dimension`,{desc:`Dimension slot label`}),Datetime:()=>t(`Datetime`,{desc:`Datetime slot label`}),"Slider metric":()=>t(`Slider metric`,{desc:`Slider metric slot label`}),Bins:()=>t(`Bins`,{desc:`Bins slot label`}),Circles:()=>t(`Circles`,{desc:`Circles slot label`}),Close:()=>t(`Close`,{desc:`Close slot label`}),Color:()=>t(`Color`,{desc:`Color slot label`}),Columns:()=>t(`Columns`,{desc:`Columns slot label`}),Coordinates:()=>t(`Coordinates`,{desc:`Coordinates slot label`}),Destination:()=>t(`Destination`,{desc:`Destination slot label`}),Evolution:()=>t(`Evolution`,{desc:`Evolution slot label`}),Geography:()=>t(`Geography`,{desc:`Geography slot label`}),High:()=>t(`High`,{desc:`High slot label`}),Identifier:()=>t(`Identifier`,{desc:`Identifier slot label`}),Levels:()=>t(`Levels`,{desc:`Levels slot label`}),Low:()=>t(`Low`,{desc:`Low slot label`}),Name:()=>t(`Name`,{id:`slot-label-name`,desc:`Name slot label`}),Open:()=>t(`Open`,{desc:`Open slot label`}),Order:()=>t(`Order`,{desc:`Order slot label`}),Route:()=>t(`Route`,{desc:`Route slot label`}),Rows:()=>t(`Rows`,{desc:`Rows slot label`}),Size:()=>t(`Size`,{desc:`Size slot label`}),Source:()=>t(`Source`,{desc:`Source slot label`}),Target:()=>t(`Target`,{desc:`Target slot label`}),Time:()=>t(`Time`,{id:`slot-label-time`,desc:`Time slot label`})},$i=class extends Event{constructor(e,t,n,r){super(`context-request`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t,this.callback=n,this.subscribe=r??!1}};function ea(e){return e}var ta=class{constructor(e,t,n,r){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(e,t)=>{this.unsubscribe&&(this.unsubscribe!==t&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=e,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(e,t)),this.unsubscribe=t},this.host=e,t.context!==void 0){let e=t;this.context=e.context,this.callback=e.callback,this.subscribe=e.subscribe??!1}else this.context=t,this.callback=n,this.subscribe=r??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&=(this.unsubscribe(),void 0)}dispatchRequest(){this.host.dispatchEvent(new $i(this.context,this.host,this.t,this.subscribe))}},na=class{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,t=!1){let n=t||!Object.is(e,this.o);this.o=e,n&&this.updateObservers()}constructor(e){this.subscriptions=/* @__PURE__ */ new Map,this.updateObservers=()=>{for(let[e,{disposer:t}]of this.subscriptions)e(this.o,t)},e!==void 0&&(this.value=e)}addCallback(e,t,n){if(!n)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:t});let{disposer:r}=this.subscriptions.get(e);e(this.value,r)}clearCallbacks(){this.subscriptions.clear()}},ra=class extends Event{constructor(e,t){super(`context-provider`,{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=t}},ia=class extends na{constructor(e,t,n){super(t.context===void 0?n:t.initialValue),this.onContextRequest=e=>{if(e.context!==this.context)return;let t=e.contextTarget??e.composedPath()[0];t!==this.host&&(e.stopPropagation(),this.addCallback(e.callback,t,e.subscribe))},this.onProviderRequest=e=>{if(e.context!==this.context||(e.contextTarget??e.composedPath()[0])===this.host)return;let t=/* @__PURE__ */ new Set;for(let[e,{consumerHost:n}]of this.subscriptions)t.has(e)||(t.add(e),n.dispatchEvent(new $i(this.context,n,e,!0)));e.stopPropagation()},this.host=e,this.context=t.context===void 0?t:t.context,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(`context-request`,this.onContextRequest),this.host.addEventListener(`context-provider`,this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new ra(this.context,this.host))}};function aa({context:e,subscribe:t}){return(n,r)=>{typeof r==`object`?r.addInitializer((function(){new ta(this,{context:e,callback:e=>{n.set.call(this,e)},subscribe:t})})):n.constructor.addInitializer((n=>{new ta(n,{context:e,callback:e=>{n[r]=e},subscribe:t})}))}}var oa=[`datetime`,`hierarchy`,`numeric`,`spatial`,`array[datetime]`,`array[numeric]`,`array[hierarchy]`,`array[spatial]`],sa=ea(Symbol(`slot-store-context`)),ca=Object.defineProperty,la=(e,t,n)=>t in e?ca(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ua=(e,t,n)=>(la(e,typeof t==`symbol`?t:t+``,n),n),da=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},fa=(e,t)=>{if(Object(t)!==t)throw TypeError(`Cannot use the "in" operator on this value`);return e.has(t)},pa=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},ma=(e,t,n)=>(da(e,t,`access private method`),n);function ha(e,t){return Object.is(e,t)}var U=null,ga=!1,_a=1,va=/* @__PURE__ */ Symbol(`SIGNAL`);function ya(e){let t=U;return U=e,t}function ba(){return U}function xa(){return ga}var Sa={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Ca(e){if(ga)throw Error(typeof ngDevMode<`u`&&ngDevMode?`Assertion error: signal read during notification phase`:``);if(U===null)return;U.consumerOnSignalRead(e);let t=U.nextProducerIndex++;if(Fa(U),t<U.producerNode.length&&U.producerNode[t]!==e&&Pa(U)){let e=U.producerNode[t];Na(e,U.producerIndexOfThis[t])}U.producerNode[t]!==e&&(U.producerNode[t]=e,U.producerIndexOfThis[t]=Pa(U)?Ma(e,U,t):0),U.producerLastReadVersion[t]=e.version}function wa(){_a++}function Ta(e){(e.dirty||e.lastCleanEpoch!==_a)&&(!e.producerMustRecompute(e)&&!ja(e)?(e.dirty=!1,e.lastCleanEpoch=_a):(e.producerRecomputeValue(e),e.dirty=!1,e.lastCleanEpoch=_a))}function Ea(e){if(e.liveConsumerNode===void 0)return;let t=ga;ga=!0;try{for(let t of e.liveConsumerNode)t.dirty||Oa(t)}finally{ga=t}}function Da(){return U?.consumerAllowSignalWrites!==!1}function Oa(e){var t;e.dirty=!0,Ea(e),(t=e.consumerMarkedDirty)==null||t.call(e.wrapper??e)}function ka(e){return e&&(e.nextProducerIndex=0),ya(e)}function Aa(e,t){if(ya(t),e&&e.producerNode!==void 0&&e.producerIndexOfThis!==void 0&&e.producerLastReadVersion!==void 0){if(Pa(e))for(let t=e.nextProducerIndex;t<e.producerNode.length;t++)Na(e.producerNode[t],e.producerIndexOfThis[t]);for(;e.producerNode.length>e.nextProducerIndex;)e.producerNode.pop(),e.producerLastReadVersion.pop(),e.producerIndexOfThis.pop()}}function ja(e){Fa(e);for(let t=0;t<e.producerNode.length;t++){let n=e.producerNode[t],r=e.producerLastReadVersion[t];if(r!==n.version||(Ta(n),r!==n.version))return!0}return!1}function Ma(e,t,n){var r;if(Ia(e),Fa(e),e.liveConsumerNode.length===0){(r=e.watched)==null||r.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)e.producerIndexOfThis[t]=Ma(e.producerNode[t],e,t)}return e.liveConsumerIndexOfThis.push(n),e.liveConsumerNode.push(t)-1}function Na(e,t){var n;if(Ia(e),Fa(e),typeof ngDevMode<`u`&&ngDevMode&&t>=e.liveConsumerNode.length)throw Error(`Assertion error: active consumer index ${t} is out of bounds of ${e.liveConsumerNode.length} consumers)`);if(e.liveConsumerNode.length===1){(n=e.unwatched)==null||n.call(e.wrapper);for(let t=0;t<e.producerNode.length;t++)Na(e.producerNode[t],e.producerIndexOfThis[t])}let r=e.liveConsumerNode.length-1;if(e.liveConsumerNode[t]=e.liveConsumerNode[r],e.liveConsumerIndexOfThis[t]=e.liveConsumerIndexOfThis[r],e.liveConsumerNode.length--,e.liveConsumerIndexOfThis.length--,t<e.liveConsumerNode.length){let n=e.liveConsumerIndexOfThis[t],r=e.liveConsumerNode[t];Fa(r),r.producerIndexOfThis[n]=t}}function Pa(e){return e.consumerIsAlwaysLive||(e?.liveConsumerNode?.length??0)>0}function Fa(e){e.producerNode??=[],e.producerIndexOfThis??=[],e.producerLastReadVersion??=[]}function Ia(e){e.liveConsumerNode??=[],e.liveConsumerIndexOfThis??=[]}function La(e){if(Ta(e),Ca(e),e.value===Va)throw e.error;return e.value}function Ra(e){let t=Object.create(Ha);t.computation=e;let n=()=>La(t);return n[va]=t,n}var za=/* @__PURE__ */ Symbol(`UNSET`),Ba=/* @__PURE__ */ Symbol(`COMPUTING`),Va=/* @__PURE__ */ Symbol(`ERRORED`),Ha={...Sa,value:za,dirty:!0,error:null,equal:ha,producerMustRecompute(e){return e.value===za||e.value===Ba},producerRecomputeValue(e){if(e.value===Ba)throw Error(`Detected cycle in computations.`);let t=e.value;e.value=Ba;let n=ka(e),r,i=!1;try{r=e.computation.call(e.wrapper),i=t!==za&&t!==Va&&e.equal.call(e.wrapper,t,r)}catch(t){r=Va,e.error=t}finally{Aa(e,n)}i?e.value=t:(e.value=r,e.version++)}};function Ua(){throw Error()}var Wa=Ua;function Ga(){Wa()}function Ka(e){let t=Object.create(Ya);t.value=e;let n=()=>(Ca(t),t.value);return n[va]=t,n}function qa(){return Ca(this),this.value}function Ja(e,t){Da()||Ga(),e.equal.call(e.wrapper,e.value,t)||(e.value=t,Xa(e))}var Ya={...Sa,equal:ha,value:void 0};function Xa(e){e.version++,wa(),Ea(e)}var W=Symbol(`node`),G;(e=>{var t,n,r,i;class a{constructor(r,i={}){pa(this,n),ua(this,t);let a=Ka(r)[va];if(this[W]=a,a.wrapper=this,i){let t=i.equals;t&&(a.equal=t),a.watched=i[e.subtle.watched],a.unwatched=i[e.subtle.unwatched]}}get(){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.get`);return qa.call(this[W])}set(t){if(!(0,e.isState)(this))throw TypeError(`Wrong receiver type for Signal.State.prototype.set`);if(xa())throw Error(`Writes to signals not permitted during Watcher callback`);let n=this[W];Ja(n,t)}}t=W,n=/* @__PURE__ */ new WeakSet,e.isState=e=>typeof e==`object`&&fa(n,e),e.State=a;class o{constructor(t,n){pa(this,i),ua(this,r);let a=Ra(t)[va];if(a.consumerAllowSignalWrites=!0,this[W]=a,a.wrapper=this,n){let t=n.equals;t&&(a.equal=t),a.watched=n[e.subtle.watched],a.unwatched=n[e.subtle.unwatched]}}get(){if(!(0,e.isComputed)(this))throw TypeError(`Wrong receiver type for Signal.Computed.prototype.get`);return La(this[W])}}r=W,i=/* @__PURE__ */ new WeakSet,e.isComputed=e=>typeof e==`object`&&fa(i,e),e.Computed=o,(t=>{var n,r,i,a;function o(e){let t,n=null;try{n=ya(null),t=e()}finally{ya(n)}return t}t.untrack=o;function s(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called introspectSources without a Computed or Watcher argument`);return t[W].producerNode?.map(e=>e.wrapper)??[]}t.introspectSources=s;function c(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called introspectSinks without a Signal argument`);return t[W].liveConsumerNode?.map(e=>e.wrapper)??[]}t.introspectSinks=c;function l(t){if(!(0,e.isComputed)(t)&&!(0,e.isState)(t))throw TypeError(`Called hasSinks without a Signal argument`);let n=t[W].liveConsumerNode;return n?n.length>0:!1}t.hasSinks=l;function u(t){if(!(0,e.isComputed)(t)&&!(0,e.isWatcher)(t))throw TypeError(`Called hasSources without a Computed or Watcher argument`);let n=t[W].producerNode;return n?n.length>0:!1}t.hasSources=u;class d{constructor(e){pa(this,r),pa(this,i),ua(this,n);let t=Object.create(Sa);t.wrapper=this,t.consumerMarkedDirty=e,t.consumerIsAlwaysLive=!0,t.consumerAllowSignalWrites=!1,t.producerNode=[],this[W]=t}watch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);ma(this,i,a).call(this,t);let n=this[W];n.dirty=!1;let r=ya(n);for(let e of t)Ca(e[W]);ya(r)}unwatch(...t){if(!(0,e.isWatcher)(this))throw TypeError(`Called unwatch without Watcher receiver`);ma(this,i,a).call(this,t);let n=this[W];Fa(n);for(let e=n.producerNode.length-1;e>=0;e--)if(t.includes(n.producerNode[e].wrapper)){Na(n.producerNode[e],n.producerIndexOfThis[e]);let t=n.producerNode.length-1;if(n.producerNode[e]=n.producerNode[t],n.producerIndexOfThis[e]=n.producerIndexOfThis[t],n.producerNode.length--,n.producerIndexOfThis.length--,n.nextProducerIndex--,e<n.producerNode.length){let t=n.producerIndexOfThis[e],r=n.producerNode[e];Ia(r),r.liveConsumerIndexOfThis[t]=e}}}getPending(){if(!(0,e.isWatcher)(this))throw TypeError(`Called getPending without Watcher receiver`);return this[W].producerNode.filter(e=>e.dirty).map(e=>e.wrapper)}}n=W,r=/* @__PURE__ */ new WeakSet,i=/* @__PURE__ */ new WeakSet,a=function(t){for(let n of t)if(!(0,e.isComputed)(n)&&!(0,e.isState)(n))throw TypeError(`Called watch/unwatch without a Computed or State argument`)},e.isWatcher=e=>fa(r,e),t.Watcher=d;function f(){return ba()?.wrapper}t.currentComputed=f,t.watched=Symbol(`watched`),t.unwatched=Symbol(`unwatched`)})(e.subtle||={})})(G||={});var Za=Symbol(`SignalWatcherBrand`),Qa=new FinalizationRegistry((({watcher:e,signal:t})=>{e.unwatch(t)})),$a=/* @__PURE__ */ new WeakMap;function eo(e){return!0===e[Za]?(console.warn(`SignalWatcher should not be applied to the same class more than once.`),e):class extends e{constructor(){super(...arguments),this._$St=new G.State(0),this._$Si=!1,this._$So=!0,this._$Sh=/* @__PURE__ */ new Set}_$Sl(){if(this._$Su!==void 0)return;this._$Sv=new G.Computed((()=>{this._$St.get(),super.performUpdate()}));let e=this._$Su=new G.subtle.Watcher((function(){let e=$a.get(this);e!==void 0&&(!1===e._$Si&&e.requestUpdate(),this.watch())}));$a.set(e,this),Qa.register(this,{watcher:e,signal:this._$Sv}),e.watch(this._$Sv)}_$Sp(){this._$Su!==void 0&&(this._$Su.unwatch(this._$Sv),this._$Sv=void 0,this._$Su=void 0)}performUpdate(){this.isUpdatePending&&(this._$Sl(),this._$Si=!0,this._$St.set(this._$St.get()+1),this._$Si=!1,this._$Sv.get())}update(e){try{this._$So?(this._$So=!1,super.update(e)):this._$Sh.forEach((e=>e.commit()))}finally{this.isUpdatePending=!1,this._$Sh.clear()}}requestUpdate(e,t,n){this._$So=!0,super.requestUpdate(e,t,n)}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask((()=>{!1===this.isConnected&&this._$Sp()}))}_(e){this._$Sh.add(e);let t=this._$So;this.requestUpdate(),this._$So=t}m(e){this._$Sh.delete(e)}}}ee(class extends w{_$Sl(){if(this._$Su!==void 0)return;this._$SW=new G.Computed((()=>this._$Sj?.get()));let e=this._$Su=new G.subtle.Watcher((()=>{var t;(t=this._$SO)==null||t._(this),e.watch()}));e.watch(this._$SW)}_$Sp(){var e;this._$Su!==void 0&&(this._$Su.unwatch(this._$SW),this._$SW=void 0,this._$Su=void 0,(e=this._$SO)==null||e.m(this))}commit(){this.setValue(G.subtle.untrack((()=>this._$SW?.get())))}render(e){return G.subtle.untrack((()=>e.get()))}update(e,[t]){return this._$SO??=e.options?.host,t!==this._$Sj&&this._$Sj!==void 0&&this._$Sp(),this._$Sj=t,this._$Sl(),G.subtle.untrack((()=>this._$SW.get()))}disconnected(){this._$Sp()}reconnected(){this._$Sl()}}),G.State,G.Computed;var K=(e,t)=>new G.State(e,t),to=(e,t)=>new G.Computed(e,t),no=class{constructor(){this.slotContents=K([]),this.slotsContents=K([]),this.periodOverPeriodUiType=K(null),this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn=K(!1),this.periodOverPeriodHidesPastValue=K(!1),this.linkedDataset=K([]),this.hasConnectedComparisonFilter=K(!1),this.itemType=K(void 0),this._popPeriodsWithoutDatetimeColumnItemTypes=[`kpi`],this._popWithoutPastValueItemTypes=[`kpi`],this.activeSlotContents=to(()=>this.slotContents.get()[this.activeIndex.get()]),this.activeIndex=K(0)}setPeriodOverPeriodCondition(e,t){this.periodOverPeriodAllowsPeriodsWithoutDatetimeColumn.set(this._popPeriodsWithoutDatetimeColumnItemTypes.includes(e)),this.periodOverPeriodHidesPastValue.set(this._popWithoutPastValueItemTypes.includes(e)),this.itemType.set(e),this.periodOverPeriodUiType.set(this.getUiConditionToApply())}getUiConditionToApply(){return Gn({slots:this.slotsContents.get(),itemType:this.itemType.get(),hasConnectedComparisonFilter:this.hasConnectedComparisonFilter.get(),hasRelatedDatetimeColumns:this.linkedDataset.get().some(({columns:e})=>e?.some(e=>e.type===`datetime`))})}setContents(e,t){if(this.slotContents.set(e),this.activeIndex.get()>=e.length&&this.activeIndex.set(e.length>0?e.length-1:0),t){let n=structuredClone(this.slotsContents.get())??[],r=n.find(e=>e.name===t);r&&(r.content=e),this.setFullContents(n)}}setFullContents(e){this.slotsContents.set(e)}updateActive(e){e>=0&&e<this.slotContents.get().length&&this.activeIndex.set(e)}updateContent(e,t=this.activeIndex.get()){if(t<0||t>=this.slotContents.get().length)return;let n=[...this.slotContents.get()];n[t]=structuredClone(e),this.slotContents.set(n)}removeContent(e){if(e<0||e>=this.slotContents.get().length)return;let t=this.slotContents.get().filter((t,n)=>n!==e);this.slotContents.set(t),this.activeIndex.get()>=t.length&&this.activeIndex.set(t.length>0?t.length-1:0)}},ro=e=>typeof e==`string`&&e.trim().length>0,io=e=>!(!e||!ro(e.formula)||e.formulaId||v(e.formula)),ao=e=>!(!e||!ro(e.expression)||e.columnId||e.column||e.formulaId||e.formula),oo=e=>ao(e)?e?.expression:io(e)?e?.formula:void 0,so=e=>e?.columnId??e?.formulaId??e?.column??e?.formula??e?.expression,q=(e,t)=>ao(e)?!0:!e||!io(e)?!1:$n({slotName:String(t.name??``),slotType:t.type,contentKind:Qn(e)})===`measure`,co=e=>{let n=io(e);return E`<span class="calculation-label">
|
|
7
7
|
<span class="calculation-label-icon" aria-hidden="true">${f(n?s:c)}</span>
|
|
8
8
|
<span>${n?t(`Formula`,{desc:`Label for the formula type`}):t(`Expression`,{desc:`Label for the expression type`})}</span>
|
|
9
9
|
</span>`},lo=(e,t)=>{let n={type:e.type,datasetId:e.datasetId,set:e.datasetId};`columnId`in e&&!_(e.columnId)&&e.columnId!==``?(n.columnId=e.columnId,n.column=e.columnId):`formulaId`in e&&!_(e.formulaId)&&e.formulaId!==``?(n.formulaId=e.formulaId,n.formula=e.formulaId):`formula`in e&&typeof e.formula==`string`&&e.formula!==``&&(n.formula=e.formula);let r=e.type===`datetime`||e.type===`array[datetime]`,i={...e.name??{en:`Untitled`}},a=e.level;if(r&&(a=a??e.lowestLevel??9,t)){let e=Fn.shortLevels?.filter(e=>e!==`All`)??[],t=e[Math.max(0,Math.min(e.length-1,(a??1)-1))];if(t){let e=`(${t})`,n=Object.keys(i);for(let t of n)i[t]=`${i[t]} ${e}`}}return n.label=i,_(e.subtype)||(n.subtype=e.subtype),`lowestLevel`in e&&!_(e.lowestLevel)&&(n.lowestLevel=e.lowestLevel),_(e.format)||(n.format=e.format),_(a)||(n.level=a),_(e.lowestLevel)||(n.lowestLevel=e.lowestLevel),e.type===`numeric`&&e.subtype===`currency`&&e.currency?.symbol&&(n.currency=e.currency.symbol),Array.isArray(e.duration_levels)&&e.duration_format&&(n.duration={levels:e.duration_levels,format:e.duration_format}),n};function uo(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}function fo(e){return`##AGGR-${e}##`}function po(e,t){let{aggregationFunction:n,content:r,grouping:i,includedColumns:a,excludedColumns:o}=e??{},s=`${n}(${t[n]?.arity>0?r:``})`;switch(i){case H.GROUPFULL:return`GROUPFULL(${s})`;case H.GROUPINEX:return`GROUPINEX(${s}, [${a?.map(e=>`{${e}}`).join(`, `)||``}], [${o?.map(e=>`{${e}}`).join(`, `)||``}])`;default:return s}}function mo(e){let t=e.split(``),n=null;for(let e=0;e<t.length;e++){let r=t[e];n?r===n?n=null:t[e]=` `:(r===`'`||r===`"`)&&(n=r)}return t.join(``)}function ho(e,t=0){let n=0,r=-1,i=null;for(let a=t,o=e.length;a<o;a++){let t=e[a];if(i)t===i&&(i=null);else if(t===`'`||t===`"`)i=t;else if(t===`(`)n++;else if(t===`)`){if(n===0){r=a;break}n--}}return r}function go(e){let t=e.match(Ui),n=t?.[0],r=t?.[1];return{includedColumns:n?.match(Wi)?.map(e=>e.slice(1,-1))??[],excludedColumns:r?.match(Wi)?.map(e=>e.slice(1,-1))??[]}}function _o(e=`light`){return!e||e===`light`?[`#0E89E0`,`#F45000`,`#15BF49`,`#685AC2`,`#636363`]:[`#BDDCF9`,`#FFCFA1`,`#C1F3B7`,`#D7D7EF`,`#D7D7EF`]}function vo(e){let t=_o(`light`),n=e.length>1;return e.map((e,r)=>{let i=[];return`dataFields`in e&&Array.isArray(e.dataFields)&&e.dataFields.length>0?i=e.dataFields.filter(e=>!!e.columnId):`columns`in e&&Array.isArray(e.columns)&&(i=e.columns.map(t=>{let n=`columnId`in t&&typeof t.columnId==`string`?t.columnId:`id`in t&&typeof t.id==`string`?t.id:void 0;if(n)return{...t,columnId:n,datasetId:e.id}}).filter(e=>!!e)),{id:e.id,name:e.name,description:`description`in e?e.description:void 0,color:n?t[r%t.length]:void 0,columns:i}})}var J=class extends n(y(p,{validSizes:[`s`,`m`,`l`,`xl`]})){constructor(){super(),this.expression=``,this.datasetsDataFields=[],this.datasetIds=[],this.apiUrl=`https://api.luzmo.com`,this.showAggregations=!0,this.contentLanguage=`en`,this.multiStageAggregation=!0,this.nestedAggregation=!0,this._datasets=[],this._codeMirrorLoaded=Zi(),this._rootContent=``,this._lastEmittedExpression=null,this._applyingExternalExpression=!1,this._handleWidgetsChanged=()=>{this._recomputeExpression()},this._store=this._createStore()}connectedCallback(){super.connectedCallback(),this._store.addEventListener(`widgets-changed`,this._handleWidgetsChanged)}disconnectedCallback(){super.disconnectedCallback(),this._store.removeEventListener(`widgets-changed`,this._handleWidgetsChanged),this._emitTimer&&clearTimeout(this._emitTimer)}firstUpdated(e){super.firstUpdated(e),this._pushRootContent()}updated(e){super.updated(e),e.has(`_codeMirrorLoaded`)&&this._codeMirrorLoaded&&this._pushRootContent()}_pushRootContent(){this._rootContent&&this._codeMirrorElement?.setContent(this._rootContent)}get _codeMirrorElement(){return this.renderRoot?.querySelector(`luzmo-formula-codemirror`)}async _ensureCodeMirrorLoaded(){this._codeMirrorLoaded||=(await Xi(),!0)}willUpdate(e){super.willUpdate(e),this._shouldLoadInput()&&this._ensureCodeMirrorLoaded(),(e.has(`multiStageAggregation`)||e.has(`nestedAggregation`)||e.has(`contentLanguage`)||e.has(`size`))&&(this._store.multiStageAggregation=this.multiStageAggregation,this._store.nestedAggregation=this.nestedAggregation,this._store.contentLanguage=this.contentLanguage,this._store.size=this.size),(e.has(`datasetsDataFields`)||e.has(`datasetIds`)||e.has(`apiUrl`)||e.has(`authKey`)||e.has(`authToken`))&&this._loadDatasets(),e.has(`showAggregations`)&&this._rebuildAutoCompletion(),e.has(`expression`)&&this._applyExternalExpression()}async _loadDatasets(){if(this.datasetsDataFields.length===0&&this.datasetIds.length===0)this._datasets=[],this._store.datasets=[],this._store.refreshDecorations(),this._setLoading(!1),this._rebuildAutoCompletion();else if(this.datasetsDataFields.length>0)this._datasets=vo(this.datasetsDataFields),this._store.datasets=this._datasets,this._store.refreshDecorations(),this._setLoading(!1),this._rebuildAutoCompletion();else if(this.datasetIds.length>0){this._setLoading(!0);try{let e=await u(this.datasetIds,{dataBrokerConfig:{apiUrl:this.apiUrl,authKey:this.authKey,authToken:this.authToken}});this._datasets=vo(e),this._store.datasets=this._datasets,this._store.refreshDecorations(),this._rebuildAutoCompletion()}catch(e){console.warn(`[${this.localName}] Failed to load datasets:`,e),this.dispatchEvent(new CustomEvent(`luzmo-datasets-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}finally{this._setLoading(!1)}}}_rebuildAutoCompletion(){}_syncExpressionToStore(){return this.expression===this._lastEmittedExpression?null:(this._store.clearWidgets(),this._rootContent=this.multiStageAggregation?this._store.transformToAggregationWidgetSyntax(this.expression):this.expression,this._rootContent)}_applyExternalExpression(){this._applyingExternalExpression=!0;try{this._syncExpressionToStore()}finally{this._applyingExternalExpression=!1}}_recomputeExpression(){if(this._applyingExternalExpression||!this._canEmitExpression())return;let e=this.multiStageAggregation?this._store.transformToAggregationFunctionSyntax(this._rootContent):this._rootContent;this._emitTimer&&clearTimeout(this._emitTimer),this._emitTimer=setTimeout(()=>this._onExpressionComputed(e),this._emitDebounceMs)}_emitExpressionChanged(e){this._lastEmittedExpression=e,this.dispatchEvent(new CustomEvent(`luzmo-expression-changed`,{bubbles:!0,composed:!0,detail:{expression:e}}))}_shouldLoadInput(){return!0}_canEmitExpression(){return!0}get _emitDebounceMs(){return 300}_onExpressionComputed(e){e!==this._lastEmittedExpression&&this._emitExpressionChanged(e)}_setLoading(e){}};e([k({type:String})],J.prototype,`expression`,void 0),e([k({attribute:!1})],J.prototype,`datasetsDataFields`,void 0),e([k({type:Array,attribute:`dataset-ids`})],J.prototype,`datasetIds`,void 0),e([k({type:String,attribute:`api-url`})],J.prototype,`apiUrl`,void 0),e([k({type:String,attribute:`auth-key`})],J.prototype,`authKey`,void 0),e([k({type:String,attribute:`auth-token`})],J.prototype,`authToken`,void 0),e([k({type:Boolean,attribute:`show-aggregations`,reflect:!0})],J.prototype,`showAggregations`,void 0),e([k({type:String,attribute:`content-language`,reflect:!0})],J.prototype,`contentLanguage`,void 0),e([k({type:Boolean,attribute:`multi-stage-aggregation`})],J.prototype,`multiStageAggregation`,void 0),e([k({type:Boolean,attribute:`nested-aggregation`})],J.prototype,`nestedAggregation`,void 0),e([A()],J.prototype,`_datasets`,void 0),e([A()],J.prototype,`_codeMirrorLoaded`,void 0);function yo(){let e=2026;return{"+":{type:`infix`,arity:2,label:()=>t(`Addition`,{desc:`Formula function label for addition`}),description:()=>t(`Adds two numeric values.`,{desc:`Formula function description for addition operator`}),example:()=>`42.0 + ⟨numeric⟩ Average burrito price`,exampleHasIcons:!0},"-":{type:`infix`,arity:2,label:()=>t(`Difference`,{desc:`Formula function label for subtraction`}),description:()=>t(`Subtracts the second value from the first value.`,{desc:`Formula function description for subtraction operator`}),example:()=>`⟨numeric⟩ Burrito weight - 42`,exampleHasIcons:!0},"*":{type:`infix`,arity:2,label:()=>t(`Multiplication`,{desc:`Formula function label for multiplication`}),description:()=>t(`Multiplies two numeric values.`,{desc:`Formula function description for multiplication operator`}),example:()=>`⟨numeric⟩ Number of burritos * 2`,exampleHasIcons:!0},"/":{type:`infix`,arity:2,label:()=>t(`Division`,{desc:`Formula function label for division`}),description:()=>t(`Divides the first numeric value by the second numeric value.`,{desc:`Formula function description for division operator`}),example:()=>`⟨numeric⟩ Number of burritos / 2`,exampleHasIcons:!0},"%":{type:`infix`,arity:2,label:()=>t(`Modulo`,{desc:`Formula function label for modulo`}),description:()=>t(`Returns the remainder after dividing the first value by the second value.`,{desc:`Formula function description for modulo operator`}),example:()=>`5 % 2`},">":{type:`infix`,arity:2,label:()=>t(`Greater than`,{desc:`Formula function label for greater than comparison`}),description:()=>t(`Checks whether the first value is greater than the second value.`,{desc:`Formula function description for greater than operator`}),example:()=>`⟨numeric⟩ Burrito weight > 50`,exampleHasIcons:!0},"<":{type:`infix`,arity:2,label:()=>t(`Less than`,{desc:`Formula function label for less than comparison`}),description:()=>t(`Checks whether the first value is less than the second value.`,{desc:`Formula function description for less than operator`}),example:()=>`⟨numeric⟩ Burrito weight < 50`,exampleHasIcons:!0},">=":{type:`infix`,arity:2,label:()=>t(`Greater than or equal`,{desc:`Formula function label for greater than or equal comparison`}),description:()=>t(`Checks whether the first value is greater than or equal to the second value.`,{desc:`Formula function description for greater than or equal operator`}),example:()=>`⟨numeric⟩ Burrito weight >= 50`,exampleHasIcons:!0},"<=":{type:`infix`,arity:2,label:()=>t(`Less than or equal`,{desc:`Formula function label for less than or equal comparison`}),description:()=>t(`Checks whether the first value is less than or equal to the second value.`,{desc:`Formula function description for less than or equal operator`}),example:()=>`⟨numeric⟩ Burrito weight <= 50`,exampleHasIcons:!0},"=":{type:`infix`,arity:2,label:()=>t(`Equal`,{desc:`Formula function label for equality comparison`}),description:()=>t(`Checks whether both values are equal.`,{desc:`Formula function description for equality operator`}),example:()=>`⟨hierarchy⟩ Burrito type = 'Savoury'`,exampleHasIcons:!0},"<>":{type:`infix`,arity:2,label:()=>t(`Not equal`,{desc:`Formula function label for inequality comparison`}),description:()=>t(`Checks whether two values are different.`,{desc:`Formula function description for inequality operator`}),example:()=>`⟨hierarchy⟩ Burrito type <> 'Sweet'`,exampleHasIcons:!0},ABS:{type:`prefix`,arity:1,label:()=>t(`Absolute value`,{desc:`Formula function label for ABS`}),description:()=>t(`Returns the absolute value of a number.`,{desc:`Formula function description for ABS`}),example:()=>`ABS(-5.0)`},CEIL:{type:`prefix`,arity:1,label:()=>t(`Round up`,{desc:`Formula function label for CEIL`}),description:()=>t(`Rounds a number up to the nearest integer.`,{desc:`Formula function description for CEIL`}),example:()=>`CEIL(11.3)`},E:{type:`prefix`,arity:0,label:()=>t(`Euler's number`,{desc:`Formula function label for E`}),description:()=>t(`Returns Euler's constant e.`,{desc:`Formula function description for E`}),example:()=>`E()`},EXP:{type:`prefix`,arity:1,label:()=>t(`Exponential`,{desc:`Formula function label for EXP`}),description:()=>t(`Returns e raised to the specified power.`,{desc:`Formula function description for EXP`}),example:()=>`EXP(11.3)`},FLOOR:{type:`prefix`,arity:1,label:()=>t(`Round down`,{desc:`Formula function label for FLOOR`}),description:()=>t(`Rounds a number down to the nearest integer.`,{desc:`Formula function description for FLOOR`}),example:()=>`FLOOR(11.7)`},LN:{type:`prefix`,arity:1,label:()=>t(`Natural logarithm`,{desc:`Formula function label for LN`}),description:()=>t(`Returns the natural logarithm of a number.`,{desc:`Formula function description for LN`}),example:()=>`LN(11.7)`},LOG:{type:`prefix`,arity:2,label:()=>t(`Logarithm`,{desc:`Formula function label for LOG`}),description:()=>t(`Returns the logarithm of a number for a specific base.`,{desc:`Formula function description for LOG`}),example:()=>`LOG(3.6, 10)`},PI:{type:`prefix`,arity:0,label:()=>t(`Pi`,{desc:`Formula function label for PI`}),description:()=>t(`Returns the mathematical constant pi.`,{desc:`Formula function description for PI`}),example:()=>`PI()`},POW:{type:`prefix`,arity:2,label:()=>t(`Power`,{desc:`Formula function label for POW`}),description:()=>t(`Raises a number to a given power.`,{desc:`Formula function description for POW`}),example:()=>`POW(2.35, 2)`},RAND:{type:`prefix`,arity:0,label:()=>t(`Random number`,{desc:`Formula function label for RAND`}),description:()=>t(`Returns a random number between 0 and 1.`,{desc:`Formula function description for RAND`}),example:()=>`RAND()`},ROUND:{type:`prefix`,arity:2,label:()=>t(`Round`,{desc:`Formula function label for ROUND`}),description:()=>t(`Rounds a number to a specified number of decimal places.`,{desc:`Formula function description for ROUND`}),example:()=>`ROUND(4.567, 1)`},SQRT:{type:`prefix`,arity:1,label:()=>t(`Square root`,{desc:`Formula function label for SQRT`}),description:()=>t(`Returns the square root of a number.`,{desc:`Formula function description for SQRT`}),example:()=>`SQRT(4)`},CAST:{type:`prefix`,arity:2,label:()=>t(`Convert value`,{desc:`Formula function label for CAST`}),description:()=>t(`Converts the first argument to the type given by the second argument. Possible types are 'hierarchy', 'numeric', 'datetime' and 'boolean'.`,{desc:`Formula function description for CAST`}),example:()=>`CAST(⟨numeric⟩ Burrito weight, hierarchy)`,exampleHasIcons:!0},IF:{type:`prefix`,arity:3,label:()=>t(`If`,{desc:`Formula function label for IF`}),description:()=>t(`Returns one value when a condition is true and another value when false.`,{desc:`Formula function description for IF`}),example:()=>`IF(⟨numeric⟩ Burrito weight < 200,'Small','Large')`,exampleHasIcons:!0},COALESCE:{type:`prefix`,arity:2,label:()=>t(`Is empty`,{desc:`Formula function label for COALESCE`}),description:()=>t(`Returns the first non-null value from the provided arguments.`,{desc:`Formula function description for COALESCE`}),example:()=>`COALESCE(⟨hierarchy⟩ Burrito type, 'Unknown type')`,exampleHasIcons:!0},AND:{type:`infix`,arity:2,label:()=>t(`Logical and`,{desc:`Formula function label for AND`}),description:()=>t(`Returns true when both conditions are true.`,{desc:`Formula function description for AND`}),example:()=>`Burrito weight > 50 AND Burrito weight < 75`},OR:{type:`infix`,arity:2,label:()=>t(`Logical or`,{desc:`Formula function label for OR`}),description:()=>t(`Returns true when at least one condition is true.`,{desc:`Formula function description for OR`}),example:()=>`Burrito price > 10.1 OR Burrito weight >= 50`},NOT:{type:`prefix_op`,arity:1,label:()=>t(`Logical not`,{desc:`Formula function label for NOT`}),description:()=>t(`Negates a boolean condition.`,{desc:`Formula function description for NOT`}),example:()=>`NOT (Burrito type = 'Salty')`},SIN:{type:`prefix`,arity:1,label:()=>t(`Sine`,{desc:`Formula function label for SIN`}),description:()=>t(`Returns the sine of an angle in radians.`,{desc:`Formula function description for SIN`}),example:()=>`SIN(3.14)`},COS:{type:`prefix`,arity:1,label:()=>t(`Cosine`,{desc:`Formula function label for COS`}),description:()=>t(`Returns the cosine of an angle in radians.`,{desc:`Formula function description for COS`}),example:()=>`COS(3.14)`},TAN:{type:`prefix`,arity:1,label:()=>t(`Tangent`,{desc:`Formula function label for TAN`}),description:()=>t(`Returns the tangent of an angle in radians.`,{desc:`Formula function description for TAN`}),example:()=>`TAN(3.14)`},ASIN:{type:`prefix`,arity:1,label:()=>t(`Arcsine`,{desc:`Formula function label for ASIN`}),description:()=>t(`Returns the arcsine of a number.`,{desc:`Formula function description for ASIN`}),example:()=>`ASIN(3.14)`},ACOS:{type:`prefix`,arity:1,label:()=>t(`Arccosine`,{desc:`Formula function label for ACOS`}),description:()=>t(`Returns the arccosine of a number.`,{desc:`Formula function description for ACOS`}),example:()=>`ACOS(3.14)`},ATAN:{type:`prefix`,arity:1,label:()=>t(`Arctangent`,{desc:`Formula function label for ATAN`}),description:()=>t(`Returns the arctangent of a number.`,{desc:`Formula function description for ATAN`}),example:()=>`ATAN(3.14)`},SINH:{type:`prefix`,arity:1,label:()=>t(`Hyperbolic sine`,{desc:`Formula function label for SINH`}),description:()=>t(`Returns the hyperbolic sine of a number.`,{desc:`Formula function description for SINH`}),example:()=>`SINH(3.14)`},COSH:{type:`prefix`,arity:1,label:()=>t(`Hyperbolic cosine`,{desc:`Formula function label for COSH`}),description:()=>t(`Returns the hyperbolic cosine of a number.`,{desc:`Formula function description for COSH`}),example:()=>`COSH(3.14)`},TANH:{type:`prefix`,arity:1,label:()=>t(`Hyperbolic tangent`,{desc:`Formula function label for TANH`}),description:()=>t(`Returns the hyperbolic tangent of a number.`,{desc:`Formula function description for TANH`}),example:()=>`TANH(3.14)`},MEAN:{type:`prefix`,arity:1,label:()=>t(`Mean`,{desc:`Formula function label for MEAN`}),description:()=>t(`Returns the arithmetic mean of all values in a numeric column. The value is calculated over the entire dataset and does not change when filtering.`,{desc:`Formula function description for MEAN`}),example:()=>`MEAN(⟨numeric⟩ Burrito weight)`,exampleHasIcons:!0},STDDEV:{type:`prefix`,arity:1,label:()=>t(`Standard deviation`,{desc:`Aggregation label`}),description:()=>t(`Returns the sample standard deviation over all values in a numeric column. The value is calculated over the entire dataset and does not change when filtering.`,{desc:`Formula function description for STDDEV`}),example:()=>`STDDEV(⟨numeric⟩ Burrito weight)`,exampleHasIcons:!0},"||":{type:`infix`,arity:2,label:()=>t(`Concatenate`,{desc:`Formula function label for concatenate operator`}),description:()=>t(`Concatenates two strings.`,{desc:`Formula function description for concatenate operator`}),example:()=>`'Tasty' || ' burrito'`},LENGTH:{type:`prefix`,arity:1,label:()=>t(`String length`,{desc:`Formula function label for LENGTH`}),description:()=>t(`Returns the number of characters in a string.`,{desc:`Formula function description for LENGTH`}),example:()=>`LENGTH('Burrito')`},LOWER:{type:`prefix`,arity:1,label:()=>t(`Lowercase`,{desc:`Formula function label for LOWER`}),description:()=>t(`Converts a string to lowercase.`,{desc:`Formula function description for LOWER`}),example:()=>`LOWER('BURRITO')`},UPPER:{type:`prefix`,arity:1,label:()=>t(`Uppercase`,{desc:`Formula function label for UPPER`}),description:()=>t(`Converts a string to uppercase.`,{desc:`Formula function description for UPPER`}),example:()=>`UPPER('burrito')`},LTRIM:{type:`prefix`,arity:1,label:()=>t(`Trim left`,{desc:`Formula function label for LTRIM`}),description:()=>t(`Removes leading spaces from a string.`,{desc:`Formula function description for LTRIM`}),example:()=>`LTRIM(' Burrito')`},RTRIM:{type:`prefix`,arity:1,label:()=>t(`Trim right`,{desc:`Formula function label for RTRIM`}),description:()=>t(`Removes trailing spaces from a string.`,{desc:`Formula function description for RTRIM`}),example:()=>`RTRIM('Burrito ')`},TRIM:{type:`prefix`,arity:1,label:()=>t(`Trim`,{desc:`Formula function label for TRIM`}),description:()=>t(`Removes leading and trailing spaces from a string.`,{desc:`Formula function description for TRIM`}),example:()=>`TRIM('Burrito ')`},REPLACE:{type:`prefix`,arity:3,label:()=>t(`Replace text`,{desc:`Formula function label for REPLACE`}),description:()=>t(`Replaces occurrences of a substring with another substring.`,{desc:`Formula function description for REPLACE`}),example:()=>`REPLACE('Sweet burrito','Sweet', 'Savoury')`},STRPOS:{type:`prefix`,arity:2,label:()=>t(`Find substring`,{desc:`Formula function label for STRPOS`}),description:()=>t(`Returns the position of a substring in a string.`,{desc:`Formula function description for STRPOS`}),example:()=>`STRPOS('Sweet burrito','burrito')`},SUBSTR:{type:`prefix`,arity:3,label:()=>t(`Take substring`,{desc:`Formula function label for SUBSTR`}),description:()=>t(`Extracts part of a string. The first argument is the text, the second the starting position (the first character is 1; a negative position counts from the end), and the third the length.`,{desc:`Formula function description for SUBSTR`}),example:()=>`SUBSTR('Sweet burrito',7,3)`},SPLIT_PART:{type:`prefix`,arity:3,label:()=>t(`Split part`,{desc:`Formula function label for SPLIT_PART`}),description:()=>t(`Splits a string into parts using a delimiter. The first argument is the text to split, the second the delimiter, and the third the position of the part to return (starting from 1).`,{desc:`Formula function description for SPLIT_PART`}),example:()=>`SPLIT_PART('Sweet burrito', ' ', 2)`},NOW:{type:`prefix`,arity:0,label:()=>t(`Current date and time`,{desc:`Formula function label for NOW`}),description:()=>t(`Returns the current date and time.`,{desc:`Formula function description for NOW`}),example:()=>`NOW()`},YEAR:{type:`prefix`,arity:1,label:()=>t(`Year`,{desc:`Time unit`}),description:()=>t(`Extracts the year from a date value.`,{desc:`Formula function description for YEAR`}),example:()=>`YEAR('${e}-02-17')`},YEAR_UTC:{type:`prefix`,arity:1,label:()=>t(`Year (UTC)`,{desc:`Formula function label for YEAR_UTC`}),description:()=>t(`Extracts the year from a date value in UTC.`,{desc:`Formula function description for YEAR_UTC`}),example:()=>`YEAR_UTC('${e}-02-17')`},QUARTER:{type:`prefix`,arity:1,label:()=>t(`Quarter`,{desc:`Time unit`}),description:()=>t(`Extracts the quarter from a date value.`,{desc:`Formula function description for QUARTER`}),example:()=>`QUARTER('${e}-02-17')`},QUARTER_UTC:{type:`prefix`,arity:1,label:()=>t(`Quarter (UTC)`,{desc:`Formula function label for QUARTER_UTC`}),description:()=>t(`Extracts the quarter from a date value in UTC.`,{desc:`Formula function description for QUARTER_UTC`}),example:()=>`QUARTER_UTC('${e}-02-17')`},MONTH:{type:`prefix`,arity:1,label:()=>t(`Month`,{desc:`Time unit`}),description:()=>t(`Extracts the month from a date or datetime value.`,{desc:`Formula function description for MONTH`}),example:()=>`MONTH('${e}-02-17 15:36:59')`},MONTH_UTC:{type:`prefix`,arity:1,label:()=>t(`Month (UTC)`,{desc:`Formula function label for MONTH_UTC`}),description:()=>t(`Extracts the month from a date or datetime value in UTC.`,{desc:`Formula function description for MONTH_UTC`}),example:()=>`MONTH_UTC('${e}-02-17 15:36:59')`},WEEK:{type:`prefix`,arity:1,label:()=>t(`Week`,{desc:`Time unit`}),description:()=>t(`Extracts the ISO 8601 week number (1-53) from a date or datetime value.`,{desc:`Formula function description for WEEK`}),example:()=>`WEEK('${e}-02-17 15:36:59')`},WEEK_UTC:{type:`prefix`,arity:1,label:()=>t(`Week (UTC)`,{desc:`Formula function label for WEEK_UTC`}),description:()=>t(`Extracts the ISO 8601 week number (1-53) from a date or datetime value in UTC.`,{desc:`Formula function description for WEEK_UTC`}),example:()=>`WEEK_UTC('${e}-02-17 15:36:59')`},DAY:{type:`prefix`,arity:1,label:()=>t(`Day of month`,{desc:`Formula function label for DAY`}),description:()=>t(`Extracts the day of month from a date or datetime value.`,{desc:`Formula function description for DAY`}),example:()=>`DAY('${e}-02-17 15:36:59')`},DAY_UTC:{type:`prefix`,arity:1,label:()=>t(`Day of month (UTC)`,{desc:`Formula function label for DAY_UTC`}),description:()=>t(`Extracts the day of month from a date or datetime value in UTC.`,{desc:`Formula function description for DAY_UTC`}),example:()=>`DAY_UTC('${e}-02-17 15:36:59')`},DAY_OF_WEEK:{type:`prefix`,arity:1,label:()=>t(`Day of week`,{desc:`Formula function label for DAY_OF_WEEK`}),description:()=>t(`Extracts the day of week (1-7, where 1 is Monday) from a date or datetime value.`,{desc:`Formula function description for DAY_OF_WEEK`}),example:()=>`DAY_OF_WEEK('${e}-02-17 15:36:59')`},DAY_OF_WEEK_UTC:{type:`prefix`,arity:1,label:()=>t(`Day of week (UTC)`,{desc:`Formula function label for DAY_OF_WEEK_UTC`}),description:()=>t(`Extracts the day of week (1-7, where 1 is Monday) from a date or datetime value in UTC.`,{desc:`Formula function description for DAY_OF_WEEK_UTC`}),example:()=>`DAY_OF_WEEK_UTC('${e}-02-17 15:36:59')`},DAY_OF_YEAR:{type:`prefix`,arity:1,label:()=>t(`Day of year`,{desc:`Formula function label for DAY_OF_YEAR`}),description:()=>t(`Extracts the day of year from a date or datetime value.`,{desc:`Formula function description for DAY_OF_YEAR`}),example:()=>`DAY_OF_YEAR('${e}-02-17 15:36:59')`},DAY_OF_YEAR_UTC:{type:`prefix`,arity:1,label:()=>t(`Day of year (UTC)`,{desc:`Formula function label for DAY_OF_YEAR_UTC`}),description:()=>t(`Extracts the day of year from a date or datetime value in UTC.`,{desc:`Formula function description for DAY_OF_YEAR_UTC`}),example:()=>`DAY_OF_YEAR_UTC('${e}-02-17 15:36:59')`},YEAR_OF_WEEK:{type:`prefix`,arity:1,label:()=>t(`Year of ISO week`,{desc:`Formula function label for YEAR_OF_WEEK`}),description:()=>t(`Extracts the ISO week-numbering year from a date or datetime value.`,{desc:`Formula function description for YEAR_OF_WEEK`}),example:()=>`YEAR_OF_WEEK('${e}-02-17 15:36:59')`},YEAR_OF_WEEK_UTC:{type:`prefix`,arity:1,label:()=>t(`Year of ISO week (UTC)`,{desc:`Formula function label for YEAR_OF_WEEK_UTC`}),description:()=>t(`Extracts the ISO week-numbering year from a date or datetime value in UTC.`,{desc:`Formula function description for YEAR_OF_WEEK_UTC`}),example:()=>`YEAR_OF_WEEK_UTC('${e}-02-17 15:36:59')`},HOUR:{type:`prefix`,arity:1,label:()=>t(`Hour`,{desc:`Time unit`}),description:()=>t(`Extracts the hour from a datetime value.`,{desc:`Formula function description for HOUR`}),example:()=>`HOUR('${e}-02-17 15:36:59')`},HOUR_UTC:{type:`prefix`,arity:1,label:()=>t(`Hour (UTC)`,{desc:`Formula function label for HOUR_UTC`}),description:()=>t(`Extracts the hour from a datetime value in UTC.`,{desc:`Formula function description for HOUR_UTC`}),example:()=>`HOUR_UTC('${e}-02-17 15:36:59')`},MINUTE:{type:`prefix`,arity:1,label:()=>t(`Minute`,{desc:`Time unit`}),description:()=>t(`Extracts the minute from a datetime value.`,{desc:`Formula function description for MINUTE`}),example:()=>`MINUTE('${e}-02-17 15:36:59')`},MINUTE_UTC:{type:`prefix`,arity:1,label:()=>t(`Minute (UTC)`,{desc:`Formula function label for MINUTE_UTC`}),description:()=>t(`Extracts the minute from a datetime value in UTC.`,{desc:`Formula function description for MINUTE_UTC`}),example:()=>`MINUTE_UTC('${e}-02-17 15:36:59')`},SECOND:{type:`prefix`,arity:1,label:()=>t(`Second`,{desc:`Time unit`}),description:()=>t(`Extracts the second from a datetime value.`,{desc:`Formula function description for SECOND`}),example:()=>`SECOND('${e}-02-17 15:36:59')`},SECOND_UTC:{type:`prefix`,arity:1,label:()=>t(`Second (UTC)`,{desc:`Formula function label for SECOND_UTC`}),description:()=>t(`Extracts the second from a datetime value in UTC.`,{desc:`Formula function description for SECOND_UTC`}),example:()=>`SECOND_UTC('${e}-02-17 15:36:59')`},DATE_ADD:{type:`prefix`,arity:3,label:()=>t(`Add/subtract duration`,{desc:`Formula function label for DATE_ADD`}),description:()=>t(`Adds a duration to (or subtracts it from) a date or datetime value. The first argument is the unit ('millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter' or 'year'), the second the number of units to add (negative to subtract), and the third the date or datetime to start from.`,{desc:`Formula function description for DATE_ADD`}),example:()=>`DATE_ADD('hour', 2, ⟨datetime⟩ Arrival time)`,exampleHasIcons:!0},DATE_DIFF:{type:`prefix`,arity:3,label:()=>t(`Difference between dates`,{desc:`Formula function label for DATE_DIFF`}),description:()=>t(`Returns the difference between two dates or datetimes in the selected unit. The first argument is the unit ('millisecond', 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter' or 'year'); the difference is calculated from the second date towards the third date.`,{desc:`Formula function description for DATE_DIFF`}),example:()=>`DATE_DIFF('day', ⟨datetime⟩ Arrival date, '${e}-02-17 15:36:59')`,exampleHasIcons:!0},COORDS:{type:`prefix`,arity:3,label:()=>t(`Coordinates`,{id:`formula-function-label-coords`,desc:`Formula function label for COORDS`}),description:()=>t(`Builds a geography value from latitude, longitude, and spatial reference.`,{desc:`Formula function description for COORDS`}),example:()=>`COORDS(⟨numeric⟩ Latitude, ⟨numeric⟩ Longitude, 'wgs84')`,exampleHasIcons:!0}}}var bo=class extends EventTarget{constructor(...e){super(...e),this.functionDataMap=yo(),this.aggregationFunctionDataMap=Ki(),this.multiStageAggregation=!0,this.nestedAggregation=!0,this.readonly=!1,this.contentLanguage=`en`,this.size=`m`,this.datasets=[],this.loading=!1,this.lastFocusedAggregationWidgetId=null,this.lastFocusedEmptyArgumentId=null,this.pendingFocusAggregationWidgetId=null,this._aggregationWidgets=[]}get aggregationWidgets(){return this._aggregationWidgets}addWidgets(e){e&&e.length!==0&&(this._aggregationWidgets=[...this._aggregationWidgets,...e],this._notifyWidgetsChanged())}removeWidgets(e){this._aggregationWidgets=this._aggregationWidgets.filter(({widgetId:t})=>!e.includes(t)),this._notifyWidgetsChanged()}updateWidget(e){this._aggregationWidgets=this._aggregationWidgets.map(t=>t.widgetId===e.widgetId?e:t),this._notifyWidgetsChanged()}getWidget(e){return this._aggregationWidgets.find(t=>t.widgetId===e)}clearWidgets(){this._aggregationWidgets.length!==0&&(this._aggregationWidgets=[],this._notifyWidgetsChanged())}_notifyWidgetsChanged(){this.dispatchEvent(new CustomEvent(`widgets-changed`))}setReadonly(e){this.readonly!==e&&(this.readonly=e,this.dispatchEvent(new CustomEvent(`widgets-changed`)))}setLoading(e){this.loading!==e&&(this.loading=e,this.refreshDecorations())}refreshDecorations(){this.dispatchEvent(new CustomEvent(`refresh-decorations`))}_markAggregationForFocus(e){let t=e[0];t&&(this.aggregationFunctionDataMap[t.aggregationFunction]?.arity??0)>0&&(this.pendingFocusAggregationWidgetId=t.widgetId)}transformToAggregationWidgetSyntax(e){let t=mo(e).match(Vi);if(!t)return e;let n=!!t[1],r=t.index??0,i=ho(e,r+(n?t[1].length:t[0].length)-1+1),a=ho(e,r+t[0].length);if(i===-1)return e;let o=e.slice(r+t[0].length,a),s=this.transformToAggregationWidgetSyntax(o),c={widgetId:uo(),grouping:t[2]??H.GROUP,aggregationFunction:t[3],content:s};if(c.grouping===H.GROUPINEX){let{includedColumns:t,excludedColumns:n}=go(e.slice(a+1,i));c.includedColumns=t,c.excludedColumns=n}let l=fo(c.widgetId),u=`${e.slice(0,r)}${l}${e.slice(i+1)}`;return this.addWidgets([c]),this.transformToAggregationWidgetSyntax(u)}transformToAggregationFunctionSyntax(e){let t=e.match(Hi);if(!t)return e;let n=t.index??0,r=n+t[0].length-1,i=t[1],a=this.getWidget(i),o=a?this.transformToAggregationFunctionSyntax(po(a,this.aggregationFunctionDataMap)):``,s=`${e.slice(0,n)}${o}${e.slice(r+1)}`;return this.transformToAggregationFunctionSyntax(s)}},xo=`:host{box-sizing:border-box;font-family:var(--luzmo-font-family);color:var(--luzmo-font-color);display:inline-block}.formula-text{font-size:var(--luzmo-formula-font-size,var(--luzmo-font-size));white-space:pre-wrap;word-break:break-word;line-height:1.5}.formula-text-column{white-space:nowrap}.formula-text-column-icon{margin-inline-end:var(--luzmo-spacing-1)}.formula-pills{align-items:center;gap:var(--luzmo-spacing-1) 0;font-size:var(--luzmo-formula-font-size,var(--luzmo-font-size));flex-wrap:wrap;line-height:1.5;display:inline-flex}.formula-operator{white-space:pre-wrap}.column-pill-wrapper{vertical-align:middle;padding-inline-end:var(--luzmo-formula-column-pill-trailing-space,var(--luzmo-spacing-1));display:inline-flex}.column-pill{justify-content:center;align-items:center;gap:var(--luzmo-spacing-2);box-sizing:border-box;max-width:16rem;min-height:var(--luzmo-formula-control-height,1.375rem);padding:0 var(--luzmo-formula-column-pill-padding-inline,calc(var(--luzmo-spacing-2) + var(--luzmo-spacing-1)));border-radius:var(--luzmo-border-radius-s);background-color:var(--luzmo-formula-column-pill-background,var(--luzmo-background-color-highlight));color:var(--luzmo-font-color);white-space:nowrap;font-size:.85em;line-height:1.2;display:inline-flex}.column-pill-icon{flex:none;display:inline-flex}.column-pill-label{text-overflow:ellipsis;overflow:hidden}.column-pill-loading{--luzmo-progress-circle-size:1em;align-items:center;display:inline-flex}.agg-pill{padding-block:var(--luzmo-spacing-1);border-radius:var(--luzmo-border-radius);background-color:var(--agg-accent,var(--luzmo-primary));color:var(--luzmo-primary-inverse-color);font-size:var(--luzmo-formula-font-size,var(--luzmo-font-size));vertical-align:middle;padding-inline:0;display:inline-flex}.agg-pill-row{align-items:center;gap:var(--luzmo-spacing-1);min-height:var(--luzmo-formula-control-height,1.375rem);display:inline-flex}.agg-fn{text-transform:uppercase;padding-inline-start:var(--luzmo-spacing-3);padding-inline-end:var(--luzmo-spacing-3);font-size:.85em}.agg-value{min-height:var(--luzmo-formula-control-height,1.375rem);padding:0 var(--luzmo-spacing-2);border-radius:var(--luzmo-border-radius-s);background-color:var(--luzmo-background-color);color:var(--luzmo-font-color);--luzmo-formula-column-pill-background:transparent;--luzmo-formula-column-pill-padding-inline:0px;align-items:center;line-height:1;display:inline-flex}.agg-grouping{align-items:center;gap:var(--luzmo-spacing-1);padding-inline:var(--luzmo-spacing-2) var(--luzmo-spacing-3);font-size:var(--luzmo-formula-grouping-icon-size,var(--luzmo-icon-size-m));display:inline-flex}.agg-grouping--no-value{padding-inline-start:0}.agg-grouping-count{border-radius:var(--luzmo-border-radius-full,999rem);background:var(--luzmo-primary-inverse-color);min-width:1.25em;color:var(--agg-accent,var(--luzmo-primary));font-size:.6875rem;font-weight:var(--luzmo-font-weight-bold);justify-content:center;align-items:center;padding:0 .25em;line-height:1.4;display:inline-flex}:host{--luzmo-formula-font-size:var(--luzmo-font-size);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-m);--luzmo-formula-control-height:calc(var(--luzmo-component-height) - 2 * var(--luzmo-spacing-1))}:host([size=s]){--luzmo-formula-font-size:var(--luzmo-font-size-s);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-s);--luzmo-formula-control-height:calc(var(--luzmo-component-height-s) - 2 * var(--luzmo-spacing-1))}:host([size=l]){--luzmo-formula-font-size:var(--luzmo-font-size-l);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-l);--luzmo-formula-control-height:calc(var(--luzmo-component-height-l) - 2 * var(--luzmo-spacing-1))}:host([size=xl]){--luzmo-formula-font-size:var(--luzmo-font-size-xl);--luzmo-formula-grouping-icon-size:var(--luzmo-icon-size-xl);--luzmo-formula-control-height:calc(var(--luzmo-component-height-xl) - 2 * var(--luzmo-spacing-1))}`,So=class extends J{constructor(...e){super(...e),this.display=`rich`,this._groupingDataMap=Ji()}static{this.styles=j(xo)}_createStore(){return new bo}_shouldLoadInput(){return!1}_canEmitExpression(){return!1}_applyExternalExpression(){this.display===`text`?this._rootContent=``:(this._store.clearWidgets(),this._rootContent=this._store.transformToAggregationWidgetSyntax(this.expression??``))}willUpdate(e){super.willUpdate(e),e.has(`display`)&&!e.has(`expression`)&&this._applyExternalExpression()}render(){return this.display===`text`?this._renderTextFormula():this._renderPillFormula()}_renderPillFormula(){return E`<span class="formula-pills" part="formula">${this._renderPillNodes(this._rootContent)}</span>`}_renderPillNodes(e){let t=[],n=new RegExp(zi.source,`gm`),r=0,i;for(;(i=n.exec(e))!==null;){i.index>r&&t.push(this._renderOperatorText(e.slice(r,i.index)));let a=i[2],o=i[3];a?t.push(this._renderColumnPill(a)):o&&t.push(this._renderAggregationPill(o)),r=n.lastIndex}return r<e.length&&t.push(this._renderOperatorText(e.slice(r))),t}_renderOperatorText(e){return E`<span class="formula-operator">${e}</span>`}_renderColumnPill(e){let[n,r]=e.split(`:`),i=this._datasets.find(e=>e.id===n)?.columns.find(e=>e.columnId===r);if(this._store.loading&&!i){let e=t(`Loading column`,{desc:`Accessible label for a column pill whose label is still loading`});return E`<span class="column-pill-wrapper"
|
|
@@ -31,7 +31,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
31
31
|
</span>`}_renderTextFormula(){let e=this.expression??``,t=[],n=new RegExp(Wi.source,`g`),r=0,i;for(;(i=n.exec(e))!==null;){i.index>r&&t.push(e.slice(r,i.index));let[a,o]=i[1].split(`:`);t.push(this._renderColumnReference(a,o)),r=n.lastIndex}return r<e.length&&t.push(e.slice(r)),E`<span class="formula-text" part="formula-text">${t}</span>`}_renderColumnReference(e,t){let n=this._datasets.find(t=>t.id===e),r=n?.columns.find(e=>e.columnId===t),i=r?x(r.name,this.contentLanguage):t,a=n?x(n.name,this.contentLanguage):``,o=a?`${a} · ${i}`:i,s=l({type:r?.type??`hierarchy`},`s`);return E`<span class="formula-text-column" part="formula-text-column" title=${o}>
|
|
32
32
|
<span class="formula-text-column-icon">${f(s)}</span>
|
|
33
33
|
<span class="formula-text-column-name">${i}</span>
|
|
34
|
-
</span>`}};e([k({type:String,reflect:!0})],So.prototype,`display`,void 0),So=e([r()],So),customElements.get(`luzmo-formula`)||customElements.define(`luzmo-formula`,So);var Co=`:host{font-family:var(--luzmo-display-settings-font-family,var(--luzmo-font-family));font-size:var(--luzmo-display-settings-font-size,var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color,var(--luzmo-font-color))}.settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}.settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-gap,var(--display-settings-gap));display:flex}.label-container{align-items:center;gap:var(--luzmo-display-settings-gap,var(--display-settings-gap));min-width:0;display:flex}.label-container.stacked{flex-direction:column;flex:1;align-items:stretch;gap:0}.label-container.stacked luzmo-multi-language-field{width:100%}.calculation-preview luzmo-formula{max-block-size:6em;max-inline-size:var(--luzmo-display-settings-calculation-max-width,var(--display-settings-calculation-max-width));overflow-wrap:anywhere;align-items:flex-start;min-width:0;display:inline-flex;overflow-y:auto}.calculation-preview luzmo-formula::-webkit-scrollbar{width:var(--luzmo-scrollbar-size)}.calculation-preview luzmo-formula::-webkit-scrollbar-track{background:var(--luzmo-scrollbar-track-background);border-radius:var(--luzmo-scrollbar-track-border-radius)}.calculation-preview luzmo-formula::-webkit-scrollbar-thumb{background:var(--luzmo-scrollbar-thumb-background);border-radius:var(--luzmo-scrollbar-thumb-border-radius)}.calculation-preview luzmo-formula::-webkit-scrollbar-thumb:hover{background:var(--luzmo-scrollbar-thumb-hover-background)}.calculation-preview luzmo-formula{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-scrollbar-thumb-background) var(--luzmo-scrollbar-track-background)}luzmo-divider{margin:var(--luzmo-display-settings-ids-container-vertical-margin,var(--display-settings-ids-container-vertical-margin)) 0}luzmo-tooltip{--tooltip-font-size:var(--luzmo-display-settings-tooltip-font-size,var(--tooltip-font-size))}.setting{flex:1;align-items:flex-end;min-width:0;display:flex}.label-action-container{justify-content:space-between;align-items:center;gap:var(--luzmo-display-settings-info-to-remove-icon-gap,var(--display-settings-info-to-remove-icon-gap));display:flex}.label-action-container luzmo-action-button{margin-inline-start:var(--luzmo-spacing-2)}.ids-container{gap:var(--luzmo-display-settings-ids-container-gap,var(--luzmo-spacing-2));border-radius:50%;flex-direction:column;display:flex}.id-label{text-transform:var(--luzmo-display-settings-id-label-text-transform,var(--display-settings-id-label-text-transform));font-weight:var(--luzmo-display-settings-id-label-font-weight,var(--display-settings-id-label-font-weight));font-size:var(--luzmo-display-settings-id-label-font-size,var(--display-settings-id-label-font-size));color:var(--luzmo-display-settings-id-label-color,var(--display-settings-id-label-color))}.id-value{-webkit-user-select:text;user-select:text;cursor:text}.example-container{line-height:var(--luzmo-display-settings-example-height,var(--display-settings-example-height));font-size:var(--luzmo-display-settings-example-font-size,var(--display-settings-example-font-size));color:var(--luzmo-display-settings-example-color,var(--display-settings-example-color))}.example-container .example-label{font-weight:var(--luzmo-display-settings-example-label-font-weight,var(--display-settings-example-label-font-weight));color:var(--luzmo-display-settings-example-label-color,var(--display-settings-example-label-color))}.example-container .example-language{text-transform:uppercase;color:var(--luzmo-display-settings-example-language-color,var(--display-settings-example-language-color))}.example-container{gap:var(--luzmo-display-settings-example-container-gap,var(--luzmo-spacing-2))}:host{--display-settings-font-family:var(--luzmo-font-family);--display-settings-id-label-text-transform:none;--display-settings-id-label-font-weight:bold;--display-settings-id-label-color:var(--luzmo-primary);--display-settings-font-size:var(--luzmo-font-size);--display-settings-id-label-font-size:var(--luzmo-font-size);--display-settings-gap:var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-4);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:20rem}:host([size=s]){--display-settings-id-label-font-size:var(--luzmo-font-size-s);--display-settings-font-size:var(--luzmo-font-size-s);--display-settings-gap:var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-3);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:16rem}:host([size=l]){--display-settings-id-label-font-size:var(--luzmo-font-size);--display-settings-font-size:var(--luzmo-font-size-l);--display-settings-gap:var(--luzmo-spacing-4);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-5);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:24rem}:host([size=xl]){--display-settings-id-label-font-size:var(--luzmo-font-size-l);--display-settings-font-size:var(--luzmo-font-size-xl);--display-settings-gap:var(--luzmo-spacing-5);--display-settings-ids-container-vertical-margin:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:28rem}:host{--display-settings-example-font-size:var(--luzmo-font-size);--display-settings-example-color:var(--luzmo-font-color);--display-settings-example-label-font-weight:bold;--display-settings-example-label-color:var(--luzmo-primary);--display-settings-example-language-color:var(--luzmo-primary);--display-settings-example-height:var(--luzmo-component-height)}:host([size=s]){--display-settings-example-height:var(--luzmo-component-height-s);--display-settings-example-font-size:var(--luzmo-font-size-s)}:host([size=l]){--display-settings-example-height:var(--luzmo-component-height-l);--display-settings-example-font-size:var(--luzmo-font-size)}:host([size=xl]){--display-settings-example-height:var(--luzmo-component-height-xl);--display-settings-example-font-size:var(--luzmo-font-size-l)}`,Y=class extends eo(y(p,{validSizes:Object.values(h)})){constructor(...e){super(...e),this._loadDisplaySettings=new C(this,{task:async([e,t,n,r,i,a])=>{let o=[];a&&o.push(`grandTotals`),n&&o.push(`periodOverPeriod`),(e===`numeric`||e===`mixed`&&this._currentSlotContent?.type===`numeric`)&&o.push(`numeric`),e!==`numeric`&&this._currentSlotContent?.type===`datetime`&&o.push(`datetime`),![`numeric`,`mixed`].includes(e??``)&&this._currentSlotContent?.type===`numeric`&&!r&&o.push(`binning`),n&&!this._settingsTypeLoaded.periodOverPeriod&&(await import(`./display-settings-period-over-period-Di_2_DDX.js`),this._settingsTypeLoaded.periodOverPeriod=!0),o.length>0&&!t&&(o.includes(`numeric`)&&!this._settingsTypeLoaded.numeric?(await import(`./display-settings-numeric-CnKNRgjc.js`),this._settingsTypeLoaded.numeric=!0):o.includes(`datetime`)&&!this._settingsTypeLoaded.datetime&&i?(await import(`./display-settings-datetime-DhmVs5jK.js`),this._settingsTypeLoaded.datetime=!0):o.includes(`binning`)&&!this._settingsTypeLoaded.binning?(await import(`./display-settings-binning-5gaYqJVT.js`),this._settingsTypeLoaded.binning=!0):o.includes(`grandTotals`)&&!this._settingsTypeLoaded.grandTotals&&(await import(`./display-settings-grand-totals-B83suS2N.js`),this._settingsTypeLoaded.grandTotals=!0))},args:()=>[this.slotType,this.hideDisplaySettings,this._comparisonUiType,this.isBinningDisabled,this.areDatetimeOptionsEnabled,this.areGrandTotalsEnabled,this.slotContent]}),this.slotsContents=[],this.hasConnectedComparisonFilter=!1,this.language=`en`,this.contentLanguage=`en`,this.slotType=`numeric`,this.slotName=`measure`,this.slotContent={},this.datasetsDataFields=[],this.apiUrl=`https://api.luzmo.com`,this.authKey=``,this.authToken=``,this._showIds=!1,this.measureColumns=[],this._settingsTypeLoaded={binning:!1,datetime:!1,numeric:!1,grandTotals:!1,periodOverPeriod:!1,hierarchy:!0},this._currentSlotContent={}}static get styles(){return[j(Co)]}_datasetDatetimeColumns(){return(this._store?.linkedDataset.get()??this.datasetsDataFields).flatMap(e=>(e.columns??(`dataFields`in e?e.dataFields:[])??[]).filter(e=>e.type===`datetime`).map(t=>({...t,id:`columnId`in t?t.columnId:t.id,datasetId:e.id})))}get _comparisonUiType(){if(this._store)return this._store.periodOverPeriodUiType.get();if(this.periodOverPeriodUiType!==void 0)return this.periodOverPeriodUiType;let e=this.itemType===`kpi`?`comparison-measure`:`measure`,t=this._currentSlotContent;return this.slotName!==e||![`numeric`,`mixed`].includes(this.slotType??``)||t.type&&t.type!==`numeric`&&!t.type.startsWith(`array[`)||t.subtype===`duration`&&t.type?.startsWith(`array[`)?null:Gn({slots:this.slotsContents,itemType:this.itemType,hasConnectedComparisonFilter:this.hasConnectedComparisonFilter,hasRelatedDatetimeColumns:this._datasetDatetimeColumns().length>0})}willUpdate(e){let t=this._store?.activeSlotContents.get(),n=this._store?.periodOverPeriodUiType.get();if(this._store&&this.periodOverPeriodUiType!==n&&(this.periodOverPeriodUiType=n),this._store)t!==this._lastStoreContent&&(this._lastStoreContent=t,this._currentSlotContent=t?structuredClone(t):{});else if(e.has(`slotContent`)||Object.keys(this._currentSlotContent).length===0){let e=this.slotContent;e&&(this._currentSlotContent=structuredClone(e))}}get datasetId(){return this._currentSlotContent.datasetId??this._currentSlotContent.set}get formulaOrColumnId(){return this._currentSlotContent.formulaId??this._currentSlotContent.expression??this._currentSlotContent.formula??this._currentSlotContent.columnId??this._currentSlotContent.column}resetInfoVisibility(e){this._showIds&&this._toggleIds(e)}_onSlotContentChange(e){e.stopPropagation(),e.preventDefault(),this._currentSlotContent=structuredClone(e.detail.slotContent),this._sendEvent(),this.requestUpdate()}_onLabelChange(){this._currentSlotContent=structuredClone(this._currentSlotContent),this._currentSlotContent.label=this._multiLanguageFieldElement.value||{},this._sendEvent(),this.requestUpdate()}_sendEvent(){this._currentSlotContent=qn(this._currentSlotContent,this._store?.slotsContents.get()??this.slotsContents,this._store?.itemType.get()??this.itemType),this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:{...this._currentSlotContent}}})),this._store&&(this._store.updateContent({...this._currentSlotContent}),this._lastStoreContent=this._store.activeSlotContents.get())}_removeEvent(){this.dispatchEvent(new CustomEvent(`luzmo-remove-slot-content`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:this._currentSlotContent}}))}_toggleIds(e=!0){this._showIds=!this._showIds,e&&this.dispatchEvent(new CustomEvent(`luzmo-info-visibility-changed`,{detail:{isVisible:this._showIds,slotContent:{...this._currentSlotContent}}}))}_renderExampleRow(){let e=this.slotType===`numeric`||this.slotType===`mixed`&&this._currentSlotContent.type===`numeric`,n=this.slotType!==`datetime`&&this._currentSlotContent.type===`datetime`&&this.areDatetimeOptionsEnabled;if(!(e||n))return O;let r=!this._currentSlotContent.datetimeDisplayMode||this._currentSlotContent.datetimeDisplayMode==="default",i=e?1234.56:r?/* @__PURE__ */ new Date:1,a=Bn({...this._currentSlotContent,type:e?`numeric`:`datetime`},{locale:this.contentLanguage,level:this._currentSlotContent.level})(i);return E`<div class="settings-row example-container">
|
|
34
|
+
</span>`}};e([k({type:String,reflect:!0})],So.prototype,`display`,void 0),So=e([r()],So),customElements.get(`luzmo-formula`)||customElements.define(`luzmo-formula`,So);var Co=`:host{font-family:var(--luzmo-display-settings-font-family,var(--luzmo-font-family));font-size:var(--luzmo-display-settings-font-size,var(--display-settings-font-size));color:var(--luzmo-display-settings-font-color,var(--luzmo-font-color))}.settings-container{gap:var(--luzmo-display-settings-vertical-gap,var(--luzmo-spacing-2));flex-direction:column;display:flex}.settings-row{justify-content:flex-start;align-items:center;gap:var(--luzmo-display-settings-gap,var(--display-settings-gap));display:flex}.label-container{align-items:center;gap:var(--luzmo-display-settings-gap,var(--display-settings-gap));min-width:0;display:flex}.label-container.stacked{flex-direction:column;flex:1;align-items:stretch;gap:0}.label-container.stacked luzmo-multi-language-field{width:100%}.calculation-preview luzmo-formula{max-block-size:6em;max-inline-size:var(--luzmo-display-settings-calculation-max-width,var(--display-settings-calculation-max-width));overflow-wrap:anywhere;align-items:flex-start;min-width:0;display:inline-flex;overflow-y:auto}.calculation-preview luzmo-formula::-webkit-scrollbar{width:var(--luzmo-scrollbar-size)}.calculation-preview luzmo-formula::-webkit-scrollbar-track{background:var(--luzmo-scrollbar-track-background);border-radius:var(--luzmo-scrollbar-track-border-radius)}.calculation-preview luzmo-formula::-webkit-scrollbar-thumb{background:var(--luzmo-scrollbar-thumb-background);border-radius:var(--luzmo-scrollbar-thumb-border-radius)}.calculation-preview luzmo-formula::-webkit-scrollbar-thumb:hover{background:var(--luzmo-scrollbar-thumb-hover-background)}.calculation-preview luzmo-formula{scrollbar-width:var(--luzmo-scrollbar-width,thin);scrollbar-color:var(--luzmo-scrollbar-thumb-background) var(--luzmo-scrollbar-track-background)}luzmo-divider{margin:var(--luzmo-display-settings-ids-container-vertical-margin,var(--display-settings-ids-container-vertical-margin)) 0}luzmo-tooltip{--tooltip-font-size:var(--luzmo-display-settings-tooltip-font-size,var(--tooltip-font-size))}.setting{flex:1;align-items:flex-end;min-width:0;display:flex}.label-action-container{justify-content:space-between;align-items:center;gap:var(--luzmo-display-settings-info-to-remove-icon-gap,var(--display-settings-info-to-remove-icon-gap));display:flex}.label-action-container luzmo-action-button{margin-inline-start:var(--luzmo-spacing-2)}.ids-container{gap:var(--luzmo-display-settings-ids-container-gap,var(--luzmo-spacing-2));border-radius:50%;flex-direction:column;display:flex}.id-label{text-transform:var(--luzmo-display-settings-id-label-text-transform,var(--display-settings-id-label-text-transform));font-weight:var(--luzmo-display-settings-id-label-font-weight,var(--display-settings-id-label-font-weight));font-size:var(--luzmo-display-settings-id-label-font-size,var(--display-settings-id-label-font-size));color:var(--luzmo-display-settings-id-label-color,var(--display-settings-id-label-color))}.id-value{-webkit-user-select:text;user-select:text;cursor:text}.example-container{line-height:var(--luzmo-display-settings-example-height,var(--display-settings-example-height));font-size:var(--luzmo-display-settings-example-font-size,var(--display-settings-example-font-size));color:var(--luzmo-display-settings-example-color,var(--display-settings-example-color))}.example-container .example-label{font-weight:var(--luzmo-display-settings-example-label-font-weight,var(--display-settings-example-label-font-weight));color:var(--luzmo-display-settings-example-label-color,var(--display-settings-example-label-color))}.example-container .example-language{text-transform:uppercase;color:var(--luzmo-display-settings-example-language-color,var(--display-settings-example-language-color))}.example-container{gap:var(--luzmo-display-settings-example-container-gap,var(--luzmo-spacing-2))}:host{--display-settings-font-family:var(--luzmo-font-family);--display-settings-id-label-text-transform:none;--display-settings-id-label-font-weight:bold;--display-settings-id-label-color:var(--luzmo-primary);--display-settings-font-size:var(--luzmo-font-size);--display-settings-id-label-font-size:var(--luzmo-font-size);--display-settings-gap:var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-4);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:20rem}:host([size=s]){--display-settings-id-label-font-size:var(--luzmo-font-size-s);--display-settings-font-size:var(--luzmo-font-size-s);--display-settings-gap:var(--luzmo-spacing-3);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-3);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:16rem}:host([size=l]){--display-settings-id-label-font-size:var(--luzmo-font-size);--display-settings-font-size:var(--luzmo-font-size-l);--display-settings-gap:var(--luzmo-spacing-4);--display-settings-ids-container-vertical-margin:var(--luzmo-spacing-5);--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:24rem}:host([size=xl]){--display-settings-id-label-font-size:var(--luzmo-font-size-l);--display-settings-font-size:var(--luzmo-font-size-xl);--display-settings-gap:var(--luzmo-spacing-5);--display-settings-ids-container-vertical-margin:calc(var(--luzmo-spacing-5) + var(--luzmo-spacing-1));--display-settings-info-to-remove-icon-gap:var(--luzmo-spacing-1);--display-settings-calculation-max-width:28rem}:host{--display-settings-example-font-size:var(--luzmo-font-size);--display-settings-example-color:var(--luzmo-font-color);--display-settings-example-label-font-weight:bold;--display-settings-example-label-color:var(--luzmo-primary);--display-settings-example-language-color:var(--luzmo-primary);--display-settings-example-height:var(--luzmo-component-height)}:host([size=s]){--display-settings-example-height:var(--luzmo-component-height-s);--display-settings-example-font-size:var(--luzmo-font-size-s)}:host([size=l]){--display-settings-example-height:var(--luzmo-component-height-l);--display-settings-example-font-size:var(--luzmo-font-size)}:host([size=xl]){--display-settings-example-height:var(--luzmo-component-height-xl);--display-settings-example-font-size:var(--luzmo-font-size-l)}`,Y=class extends eo(y(p,{validSizes:Object.values(h)})){constructor(...e){super(...e),this._loadDisplaySettings=new C(this,{task:async([e,t,n,r,i,a])=>{let o=[];a&&o.push(`grandTotals`),n&&o.push(`periodOverPeriod`),(e===`numeric`||e===`mixed`&&this._currentSlotContent?.type===`numeric`)&&o.push(`numeric`),e!==`numeric`&&this._currentSlotContent?.type===`datetime`&&o.push(`datetime`),![`numeric`,`mixed`].includes(e??``)&&this._currentSlotContent?.type===`numeric`&&!r&&o.push(`binning`),n&&!this._settingsTypeLoaded.periodOverPeriod&&(await import(`./display-settings-period-over-period-By9WHn3a.js`),this._settingsTypeLoaded.periodOverPeriod=!0),o.length>0&&!t&&(o.includes(`numeric`)&&!this._settingsTypeLoaded.numeric?(await import(`./display-settings-numeric-BVSff_nN.js`),this._settingsTypeLoaded.numeric=!0):o.includes(`datetime`)&&!this._settingsTypeLoaded.datetime&&i?(await import(`./display-settings-datetime-l8eZ7vwV.js`),this._settingsTypeLoaded.datetime=!0):o.includes(`binning`)&&!this._settingsTypeLoaded.binning?(await import(`./display-settings-binning-5gaYqJVT.js`),this._settingsTypeLoaded.binning=!0):o.includes(`grandTotals`)&&!this._settingsTypeLoaded.grandTotals&&(await import(`./display-settings-grand-totals-B83suS2N.js`),this._settingsTypeLoaded.grandTotals=!0))},args:()=>[this.slotType,this.hideDisplaySettings,this._comparisonUiType,this.isBinningDisabled,this.areDatetimeOptionsEnabled,this.areGrandTotalsEnabled,this.slotContent]}),this.slotsContents=[],this.hasConnectedComparisonFilter=!1,this.language=`en`,this.contentLanguage=`en`,this.slotType=`numeric`,this.slotName=`measure`,this.slotContent={},this.datasetsDataFields=[],this.apiUrl=`https://api.luzmo.com`,this.authKey=``,this.authToken=``,this._showIds=!1,this.measureColumns=[],this._settingsTypeLoaded={binning:!1,datetime:!1,numeric:!1,grandTotals:!1,periodOverPeriod:!1,hierarchy:!0},this._currentSlotContent={}}static get styles(){return[j(Co)]}_datasetDatetimeColumns(){return(this._store?.linkedDataset.get()??this.datasetsDataFields).flatMap(e=>(e.columns??(`dataFields`in e?e.dataFields:[])??[]).filter(e=>e.type===`datetime`).map(t=>({...t,id:`columnId`in t?t.columnId:t.id,datasetId:e.id})))}get _comparisonUiType(){if(this._store)return this._store.periodOverPeriodUiType.get();if(this.periodOverPeriodUiType!==void 0)return this.periodOverPeriodUiType;let e=this.itemType===`kpi`?`comparison-measure`:`measure`,t=this._currentSlotContent;return this.slotName!==e||![`numeric`,`mixed`].includes(this.slotType??``)||t.type&&t.type!==`numeric`&&!t.type.startsWith(`array[`)||t.subtype===`duration`&&t.type?.startsWith(`array[`)?null:Gn({slots:this.slotsContents,itemType:this.itemType,hasConnectedComparisonFilter:this.hasConnectedComparisonFilter,hasRelatedDatetimeColumns:this._datasetDatetimeColumns().length>0})}willUpdate(e){let t=this._store?.activeSlotContents.get(),n=this._store?.periodOverPeriodUiType.get();if(this._store&&this.periodOverPeriodUiType!==n&&(this.periodOverPeriodUiType=n),this._store)t!==this._lastStoreContent&&(this._lastStoreContent=t,this._currentSlotContent=t?structuredClone(t):{});else if(e.has(`slotContent`)||Object.keys(this._currentSlotContent).length===0){let e=this.slotContent;e&&(this._currentSlotContent=structuredClone(e))}}get datasetId(){return this._currentSlotContent.datasetId??this._currentSlotContent.set}get formulaOrColumnId(){return this._currentSlotContent.formulaId??this._currentSlotContent.expression??this._currentSlotContent.formula??this._currentSlotContent.columnId??this._currentSlotContent.column}resetInfoVisibility(e){this._showIds&&this._toggleIds(e)}_onSlotContentChange(e){e.stopPropagation(),e.preventDefault(),this._currentSlotContent=structuredClone(e.detail.slotContent),this._sendEvent(),this.requestUpdate()}_onLabelChange(){this._currentSlotContent=structuredClone(this._currentSlotContent),this._currentSlotContent.label=this._multiLanguageFieldElement.value||{},this._sendEvent(),this.requestUpdate()}_sendEvent(){this._currentSlotContent=qn(this._currentSlotContent,this._store?.slotsContents.get()??this.slotsContents,this._store?.itemType.get()??this.itemType),this.dispatchEvent(new CustomEvent(`luzmo-slot-content-changed`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:{...this._currentSlotContent}}})),this._store&&(this._store.updateContent({...this._currentSlotContent}),this._lastStoreContent=this._store.activeSlotContents.get())}_removeEvent(){this.dispatchEvent(new CustomEvent(`luzmo-remove-slot-content`,{bubbles:!0,composed:!0,cancelable:!0,detail:{slotContent:this._currentSlotContent}}))}_toggleIds(e=!0){this._showIds=!this._showIds,e&&this.dispatchEvent(new CustomEvent(`luzmo-info-visibility-changed`,{detail:{isVisible:this._showIds,slotContent:{...this._currentSlotContent}}}))}_renderExampleRow(){let e=this.slotType===`numeric`||this.slotType===`mixed`&&this._currentSlotContent.type===`numeric`,n=this.slotType!==`datetime`&&this._currentSlotContent.type===`datetime`&&this.areDatetimeOptionsEnabled;if(!(e||n))return O;let r=!this._currentSlotContent.datetimeDisplayMode||this._currentSlotContent.datetimeDisplayMode==="default",i=e?1234.56:r?/* @__PURE__ */ new Date:1,a=Bn({...this._currentSlotContent,type:e?`numeric`:`datetime`},{locale:this.contentLanguage,level:this._currentSlotContent.level})(i);return E`<div class="settings-row example-container">
|
|
35
35
|
<span class="example-label"
|
|
36
36
|
>${t(`Example`,{desc:`Label for example`})}:</span
|
|
37
37
|
>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
import{n as e,r as t,t as n}from"./chunks/localized-mixin-CLvEZO1g.js";import{t as r}from"./chunks/luzmoAlignLeft-HA-XKPHy.js";import{S as i,a,b as o,c as s,d as c,i as l,l as u,n as d,o as f,r as p,s as m,t as h,u as g,x as _}from"./chunks/chart-helpers-CKlLA7d7.js";import"./chunks/embed-BL4OOcIV.js";import{n as v}from"./chunks/is-same-option-value-CfxEd5pG.js";import{t as y}from"./chunks/create-lazy-loader-DC0rJePE.js";import{html as b,nothing as x,property as S,query as C,state as w,unsafeCSS as T}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/popover.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/action-group.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/number-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/picker.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/tabs.js";var E={icon:[32,32,`M16 0a16 16 0 1 0 16 16A16 16 0 0 0 16 0m0 7q1.4 0 1.5 1.5c0 2-3 2-3 0 0-1 .8-1.5 1.5-1.5m0 5q.9 0 1 1v10c0 1.3-2 1.3-2 0V13q.1-1 1-1`],name:`info-circle`},D={icon:[32,32,`M18.05 5.11a1.5 1.5 0 1 1 2.9.8l-.29 1.02a13.67 13.67 0 0 1-1.54 3.56 1 1 0 0 0 .85 1.52H28a2 2 0 0 1 1.07 3.7 1 1 0 0 0-.33 1.32 2 2 0 0 1-.82 2.76 1 1 0 0 0-.33 1.5 1.99 1.99 0 0 1-.96 3.12 1 1 0 0 0-.67 1.17A2 2 0 0 1 24 28h-5.6c-.98 0-1.94-.3-2.77-.84l-2.4-1.6a4.94 4.94 0 0 1-1.4-1.42 1 1 0 0 0-1.4-.29 1 1 0 0 0-.28 1.4c.5.76 1.17 1.43 1.96 1.97l2.4 1.6a6.98 6.98 0 0 0 3.89 1.18H24a4 4 0 0 0 4-4v-.04a4 4 0 0 0 1.7-5 4 4 0 0 0 1.13-4.13A4 4 0 0 0 28 10h-6.35c.39-.82.7-1.67.94-2.56l.29-1.02a3.51 3.51 0 0 0-6.76-1.85l-.28 1.03a8.5 8.5 0 0 1-3.64 4.93l-.2.13a6.53 6.53 0 0 0-1.84 1.76 1 1 0 0 0 .25 1.4 1 1 0 0 0 1.4-.25c.33-.49.76-.9 1.27-1.22l.2-.13c2.2-1.4 3.8-3.57 4.49-6.1ZM2 14.01h4v14H2Zm-2 0v14c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V14a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2z`],name:`thumbs-up`},O={icon:[32,32,`M18.05 26.89a1.5 1.5 0 1 0 2.9-.8l-.29-1.02a13.66 13.66 0 0 0-1.54-3.56 1 1 0 0 1 .85-1.52H28a2 2 0 0 0 1.07-3.69 1 1 0 0 1-.33-1.33 2 2 0 0 0-.82-2.76 1 1 0 0 1-.33-1.5 1.99 1.99 0 0 0-.96-3.12 1 1 0 0 1-.67-1.16A2 2 0 0 0 24 4h-5.6c-.98 0-1.94.3-2.77.84l-2.4 1.6c-.57.38-1.04.86-1.4 1.41a1 1 0 0 1-1.67-1.1 7.03 7.03 0 0 1 1.95-1.97l2.4-1.6A6.98 6.98 0 0 1 18.4 2H24a4 4 0 0 1 4 4v.04a4 4 0 0 1 1.7 5 3.99 3.99 0 0 1 1.13 4.13A3.99 3.99 0 0 1 28 22h-6.35c.39.81.7 1.66.94 2.55l.28 1.03a3.5 3.5 0 0 1-6.75 1.84l-.28-1.03a8.5 8.5 0 0 0-3.64-4.93l-.2-.13a6.52 6.52 0 0 1-1.84-1.76 1 1 0 0 1 .25-1.4 1 1 0 0 1 1.4.26c.33.48.76.9 1.27 1.22l.2.12c2.2 1.4 3.8 3.57 4.49 6.1zM2 21.99h4V8H2Zm-2 0V8c0-1.1.9-2 2-2h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2z`],name:`thumbs-down`},k=`:host{box-sizing:border-box;display:block;container-type:inline-size}.answer{width:100%;display:block}.chart-actions-bar{justify-content:space-between;align-items:flex-start;gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));padding-block:var(--luzmo-interactive-viz-item-actions-padding-block,var(--interactive-viz-item-actions-padding-block));flex-wrap:nowrap;margin-block-start:var(--luzmo-interactive-viz-item-actions-margin-block-start,var(--interactive-viz-item-actions-margin-block-start));display:flex}.chart-actions-bar[hidden]{display:none}.chart-actions-primary{gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));flex-wrap:wrap;flex:1;align-items:center;min-width:0;display:flex}.ranking-content{gap:var(--luzmo-spacing-3);padding:var(--luzmo-spacing-3);flex-direction:column;display:flex}.ranking-row{gap:var(--luzmo-spacing-3);align-items:center;display:flex}.ranking-number{width:4rem}.icon-flipped{transform:scaleY(-1)}.chart-container{border-radius:var(--luzmo-interactive-viz-item-chart-border-radius,var(--interactive-viz-item-chart-border-radius));height:var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height));overflow:hidden}.chart-container luzmo-embed-viz-item{width:100%;height:100%;display:block}.feedback-row{padding-block:var(--luzmo-interactive-viz-item-feedback-padding-block,var(--interactive-viz-item-feedback-padding-block));justify-content:space-between;align-items:center;display:flex}.rating-btn-positive{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.rating-btn-negative{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.config-toggle{--luzmo-action-button-border-radius:32px;margin-inline-start:auto}.sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.config-panel{border:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));border-radius:var(--luzmo-interactive-viz-item-config-panel-border-radius,var(--interactive-viz-item-config-panel-border-radius));padding:var(--luzmo-interactive-viz-item-config-panel-padding,var(--interactive-viz-item-config-panel-padding));background:var(--luzmo-interactive-viz-item-config-panel-background,var(--interactive-viz-item-config-panel-background));margin-block-start:var(--luzmo-spacing-2)}.config-panel luzmo-tab-panel[selected]{padding-block-start:var(--luzmo-spacing-4);display:block}.config-panel luzmo-item-option-panel,.config-panel luzmo-item-slot-picker-panel,.config-panel luzmo-filters{width:100%;max-height:15rem;scrollbar-width:thin;scrollbar-color:var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color)) transparent;padding-inline-end:var(--luzmo-spacing-3);overflow-y:auto}.edit-grid{min-height:12.5rem;display:flex}.edit-column{gap:var(--luzmo-spacing-3);flex-direction:column;display:flex}.edit-column:first-child{flex-shrink:0;max-width:15rem}.edit-column-filters{border-inline-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));flex:1;min-width:18.75rem;padding-inline-start:var(--luzmo-spacing-5)}@container (width<=520px){.edit-grid{flex-direction:column}.edit-column,.edit-column:first-child{width:100%;min-width:0;max-width:100%}.edit-column-filters{border-inline-start:none;border-block-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));min-width:0;margin-block-start:var(--luzmo-spacing-3);padding-block-start:var(--luzmo-spacing-4);padding-inline-start:0}}@container (width<=768px){.chart-container{height:calc(var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height)) - var(--luzmo-interactive-viz-item-chart-narrow-offset,var(--interactive-viz-item-chart-narrow-offset)))}}:host{--interactive-viz-item-actions-gap:var(--luzmo-spacing-3);--interactive-viz-item-actions-padding-block:var(--luzmo-spacing-3);--interactive-viz-item-actions-margin-block-start:var(--luzmo-spacing-5);--interactive-viz-item-chart-height:20rem;--interactive-viz-item-chart-narrow-offset:2.5rem;--interactive-viz-item-chart-border-radius:var(--luzmo-border-radius);--interactive-viz-item-feedback-padding-block:var(--luzmo-spacing-4);--interactive-viz-item-config-panel-padding:var(--luzmo-spacing-5);--interactive-viz-item-config-panel-border-color:var(--luzmo-border-color);--interactive-viz-item-config-panel-border-radius:var(--luzmo-border-radius);--interactive-viz-item-config-panel-background:var(--luzmo-background-color);--interactive-viz-item-rating-positive-color:var(--luzmo-positive-color,#12855a);--interactive-viz-item-rating-negative-color:var(--luzmo-negative-color,#ca221c);--interactive-viz-item-rating-selected-background:var(--luzmo-background-color-focus,#0000000f)}:host([size=s]){--interactive-viz-item-chart-height:17.5rem}:host([size=l]){--interactive-viz-item-chart-height:22rem}:host([size=xl]){--interactive-viz-item-chart-height:24rem}`,A=y(()=>import(`./add-to-dashboard.js`)).load,j=[`luzmo-filters`,`luzmo-item-option-panel`,`luzmo-item-slot-picker-panel`],M=y(()=>Promise.all([import(`./chunks/filters-Dk7oDe_z.js`),import(`./chunks/item-option-panel-BWQpttWc.js`).then(e=>e.t),import(`./chunks/item-slot-picker-panel-BZsTEDns.js`).then(e=>e.t)])),N=M.load,P=()=>M.isLoaded()||j.every(e=>customElements.get(e)!==void 0),F=0,I={},L=(e,t)=>t!==null&&v(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),R=class extends n(_(i,{validSizes:Object.values(o)})){constructor(...e){super(...e),this.chart=null,this.feedback=null,this.messageId=``,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.contentLanguage=``,this.hideActions=!1,this.hideFeedback=!1,this.hideConfigPanel=!1,this.hideConfigOptions=!1,this.slotSelects=`multiple`,this.slotGrows=!1,this.slotsConfiguration=null,this.customOptionsConfiguration=null,this.customTranslations=null,this.chartRenderOptions=null,this.addToDashboard=!1,this.dashboardActions=null,this.controlled=!1,this.liveInteractions=!1,this._configPanelOpen=!1,this._actionsSlotHasContent=!1,this._configPanelPending=!1,this._configPanelLoadFailed=!1,this._rankingTriggerId=`interactive-viz-item-ranking-${++F}`,this._interactionGeneration=0,this._openInteractions=/* @__PURE__ */ new Map,this._ownCharts=[],this._handleActionsSlotChange=e=>{this._actionsSlotHasContent=e.target.assignedElements({flatten:!0}).length>0},this._handleSlotsChanged=e=>{this.chart&&this._emitChart({...this.chart,slots:e.detail.slotsContents})},this._handleFiltersChanged=e=>{this.chart&&this._emitChart({...this.chart,filters:e.detail.filters})},this._handleOptionsChanged=e=>{if(!this.chart)return;let{options:t,interaction:n}=e.detail;if(!t)return;if(n){let e=this._openInteractions.get(n.id);if(!e||!this._isCurrentContext(e)){e?.generation===this._interactionGeneration&&this._invalidateInteractions();return}}let r=this.chart.options.theme??{};this._emitChart({...this.chart,options:{...t,theme:r}},n)},this._handleInteractionStart=e=>{if(!this.chart)return;let t={chart:this.chart,generation:this._interactionGeneration,auth:this._auth};this._openInteractions.set(e.detail.id,t),this._dispatchInteraction(e,t)},this._handleInteractionClosed=e=>{let t=this._openInteractions.get(e.detail.id);this._openInteractions.delete(e.detail.id),this._openInteractions.size===0&&(this._ownCharts=this._ownCharts.slice(-1)),t&&this._dispatchInteraction(e,t)}}static get styles(){return[T(k)]}get _effectiveContentLanguage(){return this.contentLanguage||this.language}_dispatch(e,t){let n=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});this.dispatchEvent(n)}get _chartActions(){return this.chart?d(m(this.chart)):[]}get _rating(){return this.feedback?.rating??0}get _canShowConfigPanel(){return!this.chart||this.hideConfigPanel?!1:!this.chart.inlineData||l(m(this.chart).slots).length>0}async _toggleConfigPanel(){if(this._configPanelLoadFailed=!1,this._configPanelOpen)this.endInteraction(),this._configPanelOpen=!1;else if(!this._configPanelPending){if(!P()){this._configPanelPending=!0;try{await N()}catch(e){console.warn(`Failed to load the chart configuration panel:`,e),this._configPanelLoadFailed=!0;return}finally{this._configPanelPending=!1}}this.isConnected&&this._canShowConfigPanel&&(this._configPanelOpen=!0)}}async export(e){await this.updateComplete;let t=this._embed;if(this.chart&&t&&(t.chartElement||await this._waitForEmbedRendered(t)))return await t.export(e)}_waitForEmbedRendered(e){if(!this.isConnected)return Promise.resolve(!1);this._exportWaitAbort??=new AbortController;let t=this._exportWaitAbort.signal;return new Promise(n=>{let r=new AbortController,i=e=>{r.abort(),n(e)},{signal:a}=r;e.addEventListener(`rendered`,()=>i(!0),{signal:a}),e.addEventListener(`error`,()=>i(!1),{signal:a}),t.addEventListener(`abort`,()=>i(!1),{signal:a})})}_cancelExportWaits(){this._exportWaitAbort?.abort(),this._exportWaitAbort=void 0}endInteraction(){this.renderRoot?.querySelector(`luzmo-item-option-panel`)?.endInteraction?.()}disconnectedCallback(){super.disconnectedCallback(),this._cancelExportWaits()}willUpdate(e){super.willUpdate(e),e.has(`chart`)&&!this.chart&&this._cancelExportWaits(),this._openInteractions.size>0&&this._invalidatesInteractions(e)&&this._invalidateInteractions(),e.has(`addToDashboard`)&&this.addToDashboard&&A().catch(e=>console.warn(`Failed to load add to dashboard:`,e))}updated(e){super.updated(e),e.has(`hideConfigOptions`)&&this.hideConfigOptions&&this._configTabs&&(this._configTabs.selected=`data`)}_emitOptions(e){!this.controlled&&this.chart&&(this.chart={...this.chart,options:e}),this._dispatch(`luzmo-chart-options-changed`,{options:e})}_invalidatesInteractions(e){return e.has(`authKey`)||e.has(`authToken`)||e.has(`apiUrl`)||e.has(`hideConfigPanel`)?!0:e.has(`chart`)&&[...this._openInteractions.values()].some(e=>!this._isCurrentChart(e))}_invalidateInteractions(){this._interactionGeneration++,this.endInteraction()}get _auth(){return[this.authKey,this.authToken,this.apiUrl]}_isCurrentChart(e){let t=this.chart;return t===e.chart||this._ownCharts.some(e=>e===t)||[...this._ownCharts].reverse().some(e=>L(e,t))||L(e.chart,t)}_isCurrentContext(e){return e.generation===this._interactionGeneration&&e.auth.every((e,t)=>e===this._auth[t])&&this._isCurrentChart(e)}_emitChart(e,t){this._ownCharts=this._openInteractions.size>0?[...this._ownCharts,e]:[e],this.controlled||(this.chart=e),this._dispatch(`luzmo-chart-changed`,t?{chart:e,interaction:t}:{chart:e})}_handleDropdownChange(e,t){if(!this.chart)return;t.stopPropagation();let n=t.detail,r=typeof n==`string`?n:n?.value??t.target?.value;if(!r)return;let i=h({...m(this.chart),options:this.chart.options},{type:`chartAction`,actionType:e.mutationType,key:r});this._emitOptions(i.options)}_currentRanking(e){return e.ranking??{active:!1,number:5,direction:u.Top}}_currentSort(e){return e.sort??{direction:c.Desc,by:g.Measure}}_emitRankAndSort(e,t){this.chart&&this._emitOptions({...this.chart.options,ranking:e,sort:t})}_renderOptionDropdown(e){let t=e.values??[],n=e.currentValue||t[0]?.key||``;return b`
|
|
22
|
+
import{n as e,r as t,t as n}from"./chunks/localized-mixin-CLvEZO1g.js";import{t as r}from"./chunks/luzmoAlignLeft-HA-XKPHy.js";import{S as i,a,b as o,c as s,d as c,i as l,l as u,n as d,o as f,r as p,s as m,t as h,u as g,x as _}from"./chunks/chart-helpers-CKlLA7d7.js";import"./chunks/embed-BL4OOcIV.js";import{n as v}from"./chunks/is-same-option-value-CfxEd5pG.js";import{t as y}from"./chunks/create-lazy-loader-DC0rJePE.js";import{html as b,nothing as x,property as S,query as C,state as w,unsafeCSS as T}from"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/lit.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/action-button.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/icon.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/overlay.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/popover.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/progress-circle.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/action-group.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/field-label.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/number-field.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/picker.js";import"https://cdn.jsdelivr.net/npm/@luzmo/lucero@2.7.1/standalone/tabs.js";var E={icon:[32,32,`M16 0a16 16 0 1 0 16 16A16 16 0 0 0 16 0m0 7q1.4 0 1.5 1.5c0 2-3 2-3 0 0-1 .8-1.5 1.5-1.5m0 5q.9 0 1 1v10c0 1.3-2 1.3-2 0V13q.1-1 1-1`],name:`info-circle`},D={icon:[32,32,`M18.05 5.11a1.5 1.5 0 1 1 2.9.8l-.29 1.02a13.67 13.67 0 0 1-1.54 3.56 1 1 0 0 0 .85 1.52H28a2 2 0 0 1 1.07 3.7 1 1 0 0 0-.33 1.32 2 2 0 0 1-.82 2.76 1 1 0 0 0-.33 1.5 1.99 1.99 0 0 1-.96 3.12 1 1 0 0 0-.67 1.17A2 2 0 0 1 24 28h-5.6c-.98 0-1.94-.3-2.77-.84l-2.4-1.6a4.94 4.94 0 0 1-1.4-1.42 1 1 0 0 0-1.4-.29 1 1 0 0 0-.28 1.4c.5.76 1.17 1.43 1.96 1.97l2.4 1.6a6.98 6.98 0 0 0 3.89 1.18H24a4 4 0 0 0 4-4v-.04a4 4 0 0 0 1.7-5 4 4 0 0 0 1.13-4.13A4 4 0 0 0 28 10h-6.35c.39-.82.7-1.67.94-2.56l.29-1.02a3.51 3.51 0 0 0-6.76-1.85l-.28 1.03a8.5 8.5 0 0 1-3.64 4.93l-.2.13a6.53 6.53 0 0 0-1.84 1.76 1 1 0 0 0 .25 1.4 1 1 0 0 0 1.4-.25c.33-.49.76-.9 1.27-1.22l.2-.13c2.2-1.4 3.8-3.57 4.49-6.1ZM2 14.01h4v14H2Zm-2 0v14c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V14a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2z`],name:`thumbs-up`},O={icon:[32,32,`M18.05 26.89a1.5 1.5 0 1 0 2.9-.8l-.29-1.02a13.66 13.66 0 0 0-1.54-3.56 1 1 0 0 1 .85-1.52H28a2 2 0 0 0 1.07-3.69 1 1 0 0 1-.33-1.33 2 2 0 0 0-.82-2.76 1 1 0 0 1-.33-1.5 1.99 1.99 0 0 0-.96-3.12 1 1 0 0 1-.67-1.16A2 2 0 0 0 24 4h-5.6c-.98 0-1.94.3-2.77.84l-2.4 1.6c-.57.38-1.04.86-1.4 1.41a1 1 0 0 1-1.67-1.1 7.03 7.03 0 0 1 1.95-1.97l2.4-1.6A6.98 6.98 0 0 1 18.4 2H24a4 4 0 0 1 4 4v.04a4 4 0 0 1 1.7 5 3.99 3.99 0 0 1 1.13 4.13A3.99 3.99 0 0 1 28 22h-6.35c.39.81.7 1.66.94 2.55l.28 1.03a3.5 3.5 0 0 1-6.75 1.84l-.28-1.03a8.5 8.5 0 0 0-3.64-4.93l-.2-.13a6.52 6.52 0 0 1-1.84-1.76 1 1 0 0 1 .25-1.4 1 1 0 0 1 1.4.26c.33.48.76.9 1.27 1.22l.2.12c2.2 1.4 3.8 3.57 4.49 6.1zM2 21.99h4V8H2Zm-2 0V8c0-1.1.9-2 2-2h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2z`],name:`thumbs-down`},k=`:host{box-sizing:border-box;display:block;container-type:inline-size}.answer{width:100%;display:block}.chart-actions-bar{justify-content:space-between;align-items:flex-start;gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));padding-block:var(--luzmo-interactive-viz-item-actions-padding-block,var(--interactive-viz-item-actions-padding-block));flex-wrap:nowrap;margin-block-start:var(--luzmo-interactive-viz-item-actions-margin-block-start,var(--interactive-viz-item-actions-margin-block-start));display:flex}.chart-actions-bar[hidden]{display:none}.chart-actions-primary{gap:var(--luzmo-interactive-viz-item-actions-gap,var(--interactive-viz-item-actions-gap));flex-wrap:wrap;flex:1;align-items:center;min-width:0;display:flex}.ranking-content{gap:var(--luzmo-spacing-3);padding:var(--luzmo-spacing-3);flex-direction:column;display:flex}.ranking-row{gap:var(--luzmo-spacing-3);align-items:center;display:flex}.ranking-number{width:4rem}.icon-flipped{transform:scaleY(-1)}.chart-container{border-radius:var(--luzmo-interactive-viz-item-chart-border-radius,var(--interactive-viz-item-chart-border-radius));height:var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height));overflow:hidden}.chart-container luzmo-embed-viz-item{width:100%;height:100%;display:block}.feedback-row{padding-block:var(--luzmo-interactive-viz-item-feedback-padding-block,var(--interactive-viz-item-feedback-padding-block));justify-content:space-between;align-items:center;display:flex}.rating-btn-positive{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-positive-color,var(--interactive-viz-item-rating-positive-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.rating-btn-negative{--luzmo-action-button-content-color-default-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-hover-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-down-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-content-color-focus-selected:var(--luzmo-interactive-viz-item-rating-negative-color,var(--interactive-viz-item-rating-negative-color));--luzmo-action-button-background-color-default-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-hover-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-down-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background));--luzmo-action-button-background-color-focus-selected:var(--luzmo-interactive-viz-item-rating-selected-background,var(--interactive-viz-item-rating-selected-background))}.config-toggle{--luzmo-action-button-border-radius:32px;margin-inline-start:auto}.sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.config-panel{border:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));border-radius:var(--luzmo-interactive-viz-item-config-panel-border-radius,var(--interactive-viz-item-config-panel-border-radius));padding:var(--luzmo-interactive-viz-item-config-panel-padding,var(--interactive-viz-item-config-panel-padding));background:var(--luzmo-interactive-viz-item-config-panel-background,var(--interactive-viz-item-config-panel-background));margin-block-start:var(--luzmo-spacing-2)}.config-panel luzmo-tab-panel[selected]{padding-block-start:var(--luzmo-spacing-4);display:block}.config-panel luzmo-item-option-panel,.config-panel luzmo-item-slot-picker-panel,.config-panel luzmo-filters{width:100%;max-height:15rem;scrollbar-width:thin;scrollbar-color:var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color)) transparent;padding-inline-end:var(--luzmo-spacing-3);overflow-y:auto}.edit-grid{min-height:12.5rem;display:flex}.edit-column{gap:var(--luzmo-spacing-3);flex-direction:column;display:flex}.edit-column:first-child{flex-shrink:0;max-width:15rem}.edit-column-filters{border-inline-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));flex:1;min-width:18.75rem;padding-inline-start:var(--luzmo-spacing-5)}@container (width<=520px){.edit-grid{flex-direction:column}.edit-column,.edit-column:first-child{width:100%;min-width:0;max-width:100%}.edit-column-filters{border-inline-start:none;border-block-start:1px solid var(--luzmo-interactive-viz-item-config-panel-border-color,var(--interactive-viz-item-config-panel-border-color));min-width:0;margin-block-start:var(--luzmo-spacing-3);padding-block-start:var(--luzmo-spacing-4);padding-inline-start:0}}@container (width<=768px){.chart-container{height:calc(var(--luzmo-interactive-viz-item-chart-height,var(--interactive-viz-item-chart-height)) - var(--luzmo-interactive-viz-item-chart-narrow-offset,var(--interactive-viz-item-chart-narrow-offset)))}}:host{--interactive-viz-item-actions-gap:var(--luzmo-spacing-3);--interactive-viz-item-actions-padding-block:var(--luzmo-spacing-3);--interactive-viz-item-actions-margin-block-start:var(--luzmo-spacing-5);--interactive-viz-item-chart-height:20rem;--interactive-viz-item-chart-narrow-offset:2.5rem;--interactive-viz-item-chart-border-radius:var(--luzmo-border-radius);--interactive-viz-item-feedback-padding-block:var(--luzmo-spacing-4);--interactive-viz-item-config-panel-padding:var(--luzmo-spacing-5);--interactive-viz-item-config-panel-border-color:var(--luzmo-border-color);--interactive-viz-item-config-panel-border-radius:var(--luzmo-border-radius);--interactive-viz-item-config-panel-background:var(--luzmo-background-color);--interactive-viz-item-rating-positive-color:var(--luzmo-positive-color,#12855a);--interactive-viz-item-rating-negative-color:var(--luzmo-negative-color,#ca221c);--interactive-viz-item-rating-selected-background:var(--luzmo-background-color-focus,#0000000f)}:host([size=s]){--interactive-viz-item-chart-height:17.5rem}:host([size=l]){--interactive-viz-item-chart-height:22rem}:host([size=xl]){--interactive-viz-item-chart-height:24rem}`,A=y(()=>import(`./add-to-dashboard.js`)).load,j=[`luzmo-filters`,`luzmo-item-option-panel`,`luzmo-item-slot-picker-panel`],M=y(()=>Promise.all([import(`./chunks/filters-Dk7oDe_z.js`),import(`./chunks/item-option-panel-Ts7D8J7X.js`).then(e=>e.t),import(`./chunks/item-slot-picker-panel-CqG-cZZW.js`).then(e=>e.t)])),N=M.load,P=()=>M.isLoaded()||j.every(e=>customElements.get(e)!==void 0),F=0,I={},L=(e,t)=>t!==null&&v(JSON.parse(JSON.stringify(e)),JSON.parse(JSON.stringify(t))),R=class extends n(_(i,{validSizes:Object.values(o)})){constructor(...e){super(...e),this.chart=null,this.feedback=null,this.messageId=``,this.authKey=``,this.authToken=``,this.apiUrl=`https://api.luzmo.com`,this.appServer=`https://app.luzmo.com`,this.contentLanguage=``,this.hideActions=!1,this.hideFeedback=!1,this.hideConfigPanel=!1,this.hideConfigOptions=!1,this.slotSelects=`multiple`,this.slotGrows=!1,this.slotsConfiguration=null,this.customOptionsConfiguration=null,this.customTranslations=null,this.chartRenderOptions=null,this.addToDashboard=!1,this.dashboardActions=null,this.controlled=!1,this.liveInteractions=!1,this._configPanelOpen=!1,this._actionsSlotHasContent=!1,this._configPanelPending=!1,this._configPanelLoadFailed=!1,this._rankingTriggerId=`interactive-viz-item-ranking-${++F}`,this._interactionGeneration=0,this._openInteractions=/* @__PURE__ */ new Map,this._ownCharts=[],this._handleActionsSlotChange=e=>{this._actionsSlotHasContent=e.target.assignedElements({flatten:!0}).length>0},this._handleSlotsChanged=e=>{this.chart&&this._emitChart({...this.chart,slots:e.detail.slotsContents})},this._handleFiltersChanged=e=>{this.chart&&this._emitChart({...this.chart,filters:e.detail.filters})},this._handleOptionsChanged=e=>{if(!this.chart)return;let{options:t,interaction:n}=e.detail;if(!t)return;if(n){let e=this._openInteractions.get(n.id);if(!e||!this._isCurrentContext(e)){e?.generation===this._interactionGeneration&&this._invalidateInteractions();return}}let r=this.chart.options.theme??{};this._emitChart({...this.chart,options:{...t,theme:r}},n)},this._handleInteractionStart=e=>{if(!this.chart)return;let t={chart:this.chart,generation:this._interactionGeneration,auth:this._auth};this._openInteractions.set(e.detail.id,t),this._dispatchInteraction(e,t)},this._handleInteractionClosed=e=>{let t=this._openInteractions.get(e.detail.id);this._openInteractions.delete(e.detail.id),this._openInteractions.size===0&&(this._ownCharts=this._ownCharts.slice(-1)),t&&this._dispatchInteraction(e,t)}}static get styles(){return[T(k)]}get _effectiveContentLanguage(){return this.contentLanguage||this.language}_dispatch(e,t){let n=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});this.dispatchEvent(n)}get _chartActions(){return this.chart?d(m(this.chart)):[]}get _rating(){return this.feedback?.rating??0}get _canShowConfigPanel(){return!this.chart||this.hideConfigPanel?!1:!this.chart.inlineData||l(m(this.chart).slots).length>0}async _toggleConfigPanel(){if(this._configPanelLoadFailed=!1,this._configPanelOpen)this.endInteraction(),this._configPanelOpen=!1;else if(!this._configPanelPending){if(!P()){this._configPanelPending=!0;try{await N()}catch(e){console.warn(`Failed to load the chart configuration panel:`,e),this._configPanelLoadFailed=!0;return}finally{this._configPanelPending=!1}}this.isConnected&&this._canShowConfigPanel&&(this._configPanelOpen=!0)}}async export(e){await this.updateComplete;let t=this._embed;if(this.chart&&t&&(t.chartElement||await this._waitForEmbedRendered(t)))return await t.export(e)}_waitForEmbedRendered(e){if(!this.isConnected)return Promise.resolve(!1);this._exportWaitAbort??=new AbortController;let t=this._exportWaitAbort.signal;return new Promise(n=>{let r=new AbortController,i=e=>{r.abort(),n(e)},{signal:a}=r;e.addEventListener(`rendered`,()=>i(!0),{signal:a}),e.addEventListener(`error`,()=>i(!1),{signal:a}),t.addEventListener(`abort`,()=>i(!1),{signal:a})})}_cancelExportWaits(){this._exportWaitAbort?.abort(),this._exportWaitAbort=void 0}endInteraction(){this.renderRoot?.querySelector(`luzmo-item-option-panel`)?.endInteraction?.()}disconnectedCallback(){super.disconnectedCallback(),this._cancelExportWaits()}willUpdate(e){super.willUpdate(e),e.has(`chart`)&&!this.chart&&this._cancelExportWaits(),this._openInteractions.size>0&&this._invalidatesInteractions(e)&&this._invalidateInteractions(),e.has(`addToDashboard`)&&this.addToDashboard&&A().catch(e=>console.warn(`Failed to load add to dashboard:`,e))}updated(e){super.updated(e),e.has(`hideConfigOptions`)&&this.hideConfigOptions&&this._configTabs&&(this._configTabs.selected=`data`)}_emitOptions(e){!this.controlled&&this.chart&&(this.chart={...this.chart,options:e}),this._dispatch(`luzmo-chart-options-changed`,{options:e})}_invalidatesInteractions(e){return e.has(`authKey`)||e.has(`authToken`)||e.has(`apiUrl`)||e.has(`hideConfigPanel`)?!0:e.has(`chart`)&&[...this._openInteractions.values()].some(e=>!this._isCurrentChart(e))}_invalidateInteractions(){this._interactionGeneration++,this.endInteraction()}get _auth(){return[this.authKey,this.authToken,this.apiUrl]}_isCurrentChart(e){let t=this.chart;return t===e.chart||this._ownCharts.some(e=>e===t)||[...this._ownCharts].reverse().some(e=>L(e,t))||L(e.chart,t)}_isCurrentContext(e){return e.generation===this._interactionGeneration&&e.auth.every((e,t)=>e===this._auth[t])&&this._isCurrentChart(e)}_emitChart(e,t){this._ownCharts=this._openInteractions.size>0?[...this._ownCharts,e]:[e],this.controlled||(this.chart=e),this._dispatch(`luzmo-chart-changed`,t?{chart:e,interaction:t}:{chart:e})}_handleDropdownChange(e,t){if(!this.chart)return;t.stopPropagation();let n=t.detail,r=typeof n==`string`?n:n?.value??t.target?.value;if(!r)return;let i=h({...m(this.chart),options:this.chart.options},{type:`chartAction`,actionType:e.mutationType,key:r});this._emitOptions(i.options)}_currentRanking(e){return e.ranking??{active:!1,number:5,direction:u.Top}}_currentSort(e){return e.sort??{direction:c.Desc,by:g.Measure}}_emitRankAndSort(e,t){this.chart&&this._emitOptions({...this.chart.options,ranking:e,sort:t})}_renderOptionDropdown(e){let t=e.values??[],n=e.currentValue||t[0]?.key||``;return b`
|
|
23
23
|
<luzmo-picker
|
|
24
24
|
size=${this.size}
|
|
25
25
|
variant="highlight"
|
package/standalone/manifest.json
CHANGED
|
@@ -114,10 +114,10 @@
|
|
|
114
114
|
"chunks/default-Bi3Z4SMm.js",
|
|
115
115
|
"chunks/default-dark-C2ykXPQt.js",
|
|
116
116
|
"chunks/display-settings-binning-5gaYqJVT.js",
|
|
117
|
-
"chunks/display-settings-datetime-
|
|
117
|
+
"chunks/display-settings-datetime-l8eZ7vwV.js",
|
|
118
118
|
"chunks/display-settings-grand-totals-B83suS2N.js",
|
|
119
|
-
"chunks/display-settings-numeric-
|
|
120
|
-
"chunks/display-settings-period-over-period-
|
|
119
|
+
"chunks/display-settings-numeric-BVSff_nN.js",
|
|
120
|
+
"chunks/display-settings-period-over-period-By9WHn3a.js",
|
|
121
121
|
"chunks/donut-chart-options.config-re9dbce1.js",
|
|
122
122
|
"chunks/donut-chart-options.de-C1yjMc7p.js",
|
|
123
123
|
"chunks/donut-chart-options.en-CJSA_qMs.js",
|
|
@@ -133,9 +133,9 @@
|
|
|
133
133
|
"chunks/dropdown-filter-options.nl-BLAyit4D.js",
|
|
134
134
|
"chunks/dropdown-filter-slots.config-DkqLjilE.js",
|
|
135
135
|
"chunks/embed-BL4OOcIV.js",
|
|
136
|
-
"chunks/en-
|
|
137
|
-
"chunks/en-GB-
|
|
138
|
-
"chunks/en-US-
|
|
136
|
+
"chunks/en-COt1Na3D.js",
|
|
137
|
+
"chunks/en-GB-6byNwC81.js",
|
|
138
|
+
"chunks/en-US-COt1Na3D.js",
|
|
139
139
|
"chunks/es-CJnRT1YI.js",
|
|
140
140
|
"chunks/es-Dp1UuDDz.js",
|
|
141
141
|
"chunks/evolution-number-options.config-Brbyq_TD.js",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"chunks/evolution-number-slots.config-IqPfnCrw.js",
|
|
148
148
|
"chunks/fi-CLQ6vC7V.js",
|
|
149
149
|
"chunks/filters-Dk7oDe_z.js",
|
|
150
|
-
"chunks/formula-codemirror-
|
|
150
|
+
"chunks/formula-codemirror-BqV2Lr6d.js",
|
|
151
151
|
"chunks/fr-D8xrUEX4.js",
|
|
152
152
|
"chunks/fr-DqE0NP1j.js",
|
|
153
153
|
"chunks/funnel-chart-options.config-CW0RAyLR.js",
|
|
@@ -200,10 +200,10 @@
|
|
|
200
200
|
"chunks/item-option-color-palette-picker-waW4sAIj.js",
|
|
201
201
|
"chunks/item-option-color-picker-9e_3aSen.js",
|
|
202
202
|
"chunks/item-option-color-range-CWmg4Tdk.js",
|
|
203
|
-
"chunks/item-option-guidelines-
|
|
203
|
+
"chunks/item-option-guidelines-CWaGOxXF.js",
|
|
204
204
|
"chunks/item-option-multi-language-field-BN9u0rGs.js",
|
|
205
205
|
"chunks/item-option-number-field-D2gvKQN_.js",
|
|
206
|
-
"chunks/item-option-panel-
|
|
206
|
+
"chunks/item-option-panel-Ts7D8J7X.js",
|
|
207
207
|
"chunks/item-option-picker-BElgjysX.js",
|
|
208
208
|
"chunks/item-option-position-picker-B7FGJPTv.js",
|
|
209
209
|
"chunks/item-option-positions-number-field-CyCWqMby.js",
|
|
@@ -211,7 +211,7 @@
|
|
|
211
211
|
"chunks/item-option-slider-CJrobai6.js",
|
|
212
212
|
"chunks/item-option-switch-DTK0eRzd.js",
|
|
213
213
|
"chunks/item-option-text-field-B4-wMWpQ.js",
|
|
214
|
-
"chunks/item-slot-picker-panel-
|
|
214
|
+
"chunks/item-slot-picker-panel-CqG-cZZW.js",
|
|
215
215
|
"chunks/ja-CtDlXHD1.js",
|
|
216
216
|
"chunks/ko-CekuHU50.js",
|
|
217
217
|
"chunks/kpi-options.config-DGl2N2HJ.js",
|