@nebula.js/sn-pie-chart 2.2.0 → 2.3.0

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * @nebula.js/sn-pie-chart v2.2.0
2
+ * @nebula.js/sn-pie-chart v2.3.0
3
3
  * Copyright (c) 2026 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
@@ -18,7 +18,7 @@ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.le
18
18
  * @license MIT
19
19
  * This source code is licensed under the MIT license found in the
20
20
  * LICENSE file in the root directory of this source tree.
21
- */const pb=[];function hb(e){return pb[0]=e,Rv(pb)}var mb=Object.freeze({__proto__:null,GlobalStyles:fb,StyledEngineProvider:function(e){const{injectFirst:t,enableCssLayer:n,children:r}=e,i=Mg.useMemo(()=>{const e=`${t}-${n}`;if("object"==typeof document&&db.has(e))return db.get(e);const r=function(e,t){const n=vv({key:"css",prepend:e});if(t){const e=n.insert;n.insert=(...t)=>(t[1].styles.match(/^@layer\s+[^{]*$/)||(t[1].styles=`@layer mui {${t[1].styles}}`),e(...t))}return n}(t,n);return db.set(e,r),r},[t,n]);return t||n?ub.jsx(Hv,{value:i,children:r}):r},ThemeContext:Bv,css:Jv,default:function(e,t){return ob(e,t)},internal_processStyles:(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},internal_serializeStyles:hb,keyframes:Qv});function gb(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function yb(e){if(Mg.isValidElement(e)||!gb(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=yb(e[n])}),t}function vb(e,t,n={clone:!0}){const r=n.clone?uy({},e):e;return gb(e)&&gb(t)&&Object.keys(t).forEach(i=>{Mg.isValidElement(t[i])?r[i]=t[i]:gb(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&gb(e[i])?r[i]=vb(e[i],t[i],n):n.clone?r[i]=gb(t[i])?yb(t[i]):t[i]:r[i]=t[i]}),r}var bb=Object.freeze({__proto__:null,default:vb,isPlainObject:gb});const xb=["values","unit","step"];function wb(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,i=dy(e,xb),o=(e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>uy({},e,{[t.key]:t.val}),{})})(t),a=Object.keys(o);function s(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n})`}function l(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-r/100}${n})`}function c(e,i){const o=a.indexOf(i);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==o&&"number"==typeof t[a[o]]?t[a[o]]:i)-r/100}${n})`}return uy({keys:a,values:o,up:s,down:l,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):s(e)},not:function(e){const t=a.indexOf(e);return 0===t?s(a[1]):t===a.length-1?l(a[t]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:n},i)}const Sb={borderRadius:4};function kb(e,t){return t?vb(e,t,{clone:!1}):e}const Mb={xs:0,sm:600,md:900,lg:1200,xl:1536},Cb={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Mb[e]}px)`};function Eb(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||Cb;return t.reduce((r,i,o)=>(r[e.up(e.keys[o])]=n(t[o]),r),{})}if("object"==typeof t){const e=r.breakpoints||Cb;return Object.keys(t).reduce((r,i)=>{if(-1!==Object.keys(e.values||Mb).indexOf(i)){r[e.up(i)]=n(t[i],i)}else{const e=i;r[e]=t[e]}return r},{})}return n(t)}function Db(e,t){return e.reduce((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e},t)}function _b(e){if("string"!=typeof e)throw new Error(sy(7));return e.charAt(0).toUpperCase()+e.slice(1)}var qb=Object.freeze({__proto__:null,default:_b});function Ab(e,t,n=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){const n=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=n)return n}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function Tb(e,t,n,r=n){let i;return i="function"==typeof e?e(n):Array.isArray(e)?e[n]||r:Ab(e,n)||r,t&&(i=t(i,r,e)),i}function Nb(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=e=>{if(null==e[t])return null;const o=e[t],a=Ab(e.theme,r)||{};return Eb(e,o,e=>{let r=Tb(a,i,e);return e===r&&"string"==typeof e&&(r=Tb(a,i,`${t}${"default"===e?"":_b(e)}`,e)),!1===n?r:{[n]:r}})};return o.propTypes={},o.filterProps=[t],o}const Ib={m:"margin",p:"padding"},Ob={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Rb={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Pb=function(e){const t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}(e=>{if(e.length>2){if(!Rb[e])return[e];e=Rb[e]}const[t,n]=e.split(""),r=Ib[t],i=Ob[n]||"";return Array.isArray(i)?i.map(e=>r+e):[r+i]}),Lb=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],zb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function Fb(e,t,n,r){var i;const o=null!=(i=Ab(e,t,!1))?i:n;return"number"==typeof o?e=>"string"==typeof e?e:o*e:Array.isArray(o)?e=>"string"==typeof e?e:o[e]:"function"==typeof o?o:()=>{}}function jb(e){return Fb(e,"spacing",8)}function Vb(e,t){if("string"==typeof t||null==t)return t;const n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:`-${n}`}function Hb(e,t,n,r){if(-1===t.indexOf(n))return null;const i=function(e,t){return n=>e.reduce((e,r)=>(e[r]=Vb(t,n),e),{})}(Pb(n),r);return Eb(e,e[n],i)}function $b(e,t){const n=jb(e.theme);return Object.keys(e).map(r=>Hb(e,t,r,n)).reduce(kb,{})}function Bb(e){return $b(e,Lb)}function Wb(e){return $b(e,zb)}function Ub(...e){const t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>Object.keys(e).reduce((n,r)=>t[r]?kb(n,t[r](e)):n,{});return n.propTypes={},n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function Yb(e){return"number"!=typeof e?e:`${e}px solid`}function Kb(e,t){return Nb({prop:e,themeKey:"borders",transform:t})}Bb.propTypes={},Bb.filterProps=Lb,Wb.propTypes={},Wb.filterProps=zb;const Xb=Kb("border",Yb),Gb=Kb("borderTop",Yb),Jb=Kb("borderRight",Yb),Qb=Kb("borderBottom",Yb),Zb=Kb("borderLeft",Yb),ex=Kb("borderColor"),tx=Kb("borderTopColor"),nx=Kb("borderRightColor"),rx=Kb("borderBottomColor"),ix=Kb("borderLeftColor"),ox=Kb("outline",Yb),ax=Kb("outlineColor"),sx=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=Fb(e.theme,"shape.borderRadius",4),n=e=>({borderRadius:Vb(t,e)});return Eb(e,e.borderRadius,n)}return null};sx.propTypes={},sx.filterProps=["borderRadius"],Ub(Xb,Gb,Jb,Qb,Zb,ex,tx,nx,rx,ix,sx,ox,ax);const lx=e=>{if(void 0!==e.gap&&null!==e.gap){const t=Fb(e.theme,"spacing",8),n=e=>({gap:Vb(t,e)});return Eb(e,e.gap,n)}return null};lx.propTypes={},lx.filterProps=["gap"];const cx=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=Fb(e.theme,"spacing",8),n=e=>({columnGap:Vb(t,e)});return Eb(e,e.columnGap,n)}return null};cx.propTypes={},cx.filterProps=["columnGap"];const ux=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=Fb(e.theme,"spacing",8),n=e=>({rowGap:Vb(t,e)});return Eb(e,e.rowGap,n)}return null};ux.propTypes={},ux.filterProps=["rowGap"];function dx(e,t){return"grey"===t?t:e}Ub(lx,cx,ux,Nb({prop:"gridColumn"}),Nb({prop:"gridRow"}),Nb({prop:"gridAutoFlow"}),Nb({prop:"gridAutoColumns"}),Nb({prop:"gridAutoRows"}),Nb({prop:"gridTemplateColumns"}),Nb({prop:"gridTemplateRows"}),Nb({prop:"gridTemplateAreas"}),Nb({prop:"gridArea"}));function fx(e){return e<=1&&0!==e?100*e+"%":e}Ub(Nb({prop:"color",themeKey:"palette",transform:dx}),Nb({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:dx}),Nb({prop:"backgroundColor",themeKey:"palette",transform:dx}));const px=Nb({prop:"width",transform:fx}),hx=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var n,r;const i=(null==(n=e.theme)||null==(n=n.breakpoints)||null==(n=n.values)?void 0:n[t])||Mb[t];return i?"px"!==(null==(r=e.theme)||null==(r=r.breakpoints)?void 0:r.unit)?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:fx(t)}};return Eb(e,e.maxWidth,t)}return null};hx.filterProps=["maxWidth"];const mx=Nb({prop:"minWidth",transform:fx}),gx=Nb({prop:"height",transform:fx}),yx=Nb({prop:"maxHeight",transform:fx}),vx=Nb({prop:"minHeight",transform:fx});Nb({prop:"size",cssProperty:"width",transform:fx}),Nb({prop:"size",cssProperty:"height",transform:fx});Ub(px,hx,mx,gx,yx,vx,Nb({prop:"boxSizing"}));const bx={border:{themeKey:"borders",transform:Yb},borderTop:{themeKey:"borders",transform:Yb},borderRight:{themeKey:"borders",transform:Yb},borderBottom:{themeKey:"borders",transform:Yb},borderLeft:{themeKey:"borders",transform:Yb},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Yb},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:sx},color:{themeKey:"palette",transform:dx},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:dx},backgroundColor:{themeKey:"palette",transform:dx},p:{style:Wb},pt:{style:Wb},pr:{style:Wb},pb:{style:Wb},pl:{style:Wb},px:{style:Wb},py:{style:Wb},padding:{style:Wb},paddingTop:{style:Wb},paddingRight:{style:Wb},paddingBottom:{style:Wb},paddingLeft:{style:Wb},paddingX:{style:Wb},paddingY:{style:Wb},paddingInline:{style:Wb},paddingInlineStart:{style:Wb},paddingInlineEnd:{style:Wb},paddingBlock:{style:Wb},paddingBlockStart:{style:Wb},paddingBlockEnd:{style:Wb},m:{style:Bb},mt:{style:Bb},mr:{style:Bb},mb:{style:Bb},ml:{style:Bb},mx:{style:Bb},my:{style:Bb},margin:{style:Bb},marginTop:{style:Bb},marginRight:{style:Bb},marginBottom:{style:Bb},marginLeft:{style:Bb},marginX:{style:Bb},marginY:{style:Bb},marginInline:{style:Bb},marginInlineStart:{style:Bb},marginInlineEnd:{style:Bb},marginBlock:{style:Bb},marginBlockStart:{style:Bb},marginBlockEnd:{style:Bb},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:lx},rowGap:{style:ux},columnGap:{style:cx},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:fx},maxWidth:{style:hx},minWidth:{transform:fx},height:{transform:fx},maxHeight:{transform:fx},minHeight:{transform:fx},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function xx(){function e(e,t,n,r){const i={[e]:t,theme:n},o=r[e];if(!o)return{[e]:t};const{cssProperty:a=e,themeKey:s,transform:l,style:c}=o;if(null==t)return null;if("typography"===s&&"inherit"===t)return{[e]:t};const u=Ab(n,s)||{};if(c)return c(i);return Eb(i,t,t=>{let n=Tb(u,l,t);return t===n&&"string"==typeof t&&(n=Tb(u,l,`${e}${"default"===t?"":_b(t)}`,t)),!1===a?n:{[a]:n}})}return function t(n){var r;const{sx:i,theme:o={},nested:a}=n||{};if(!i)return null;const s=null!=(r=o.unstable_sxConfig)?r:bx;function l(n){let r=n;if("function"==typeof n)r=n(o);else if("object"!=typeof n)return n;if(!r)return null;const i=function(e={}){var t;return(null==(t=e.keys)?void 0:t.reduce((t,n)=>(t[e.up(n)]={},t),{}))||{}}(o.breakpoints),l=Object.keys(i);let c=i;return Object.keys(r).forEach(n=>{const i=(a=r[n],l=o,"function"==typeof a?a(l):a);var a,l;if(null!=i)if("object"==typeof i)if(s[n])c=kb(c,e(n,i,o,s));else{const e=Eb({theme:o},i,e=>({[n]:e}));!function(...e){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),n=new Set(t);return e.every(e=>n.size===Object.keys(e).length)}(e,i)?c=kb(c,e):c[n]=t({sx:i,theme:o,nested:!0})}else c=kb(c,e(n,i,o,s))}),!a&&o.modularCssLayers?{"@layer sx":Db(l,c)}:Db(l,c)}return Array.isArray(i)?i.map(l):l(i)}}const wx=xx();function Sx(e,t){const n=this;if(n.vars&&"function"==typeof n.getColorSchemeSelector){const r=n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)");return{[r]:t}}return n.palette.mode===e?t:{}}wx.filterProps=["sx"];const kx=["breakpoints","palette","spacing","shape"];function Mx(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=e,a=dy(e,kx),s=wb(n),l=function(e=8){if(e.mui)return e;const t=jb({spacing:e}),n=(...e)=>(0===e.length?[1]:e).map(e=>{const n=t(e);return"number"==typeof n?`${n}px`:n}).join(" ");return n.mui=!0,n}(i);let c=vb({breakpoints:s,direction:"ltr",components:{},palette:uy({mode:"light"},r),spacing:l,shape:uy({},Sb,o)},a);return c.applyStyles=Sx,c=t.reduce((e,t)=>vb(e,t),c),c.unstable_sxConfig=uy({},bx,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return wx({sx:e,theme:this})},c}var Cx=Object.freeze({__proto__:null,default:Mx,private_createBreakpoints:wb,unstable_applyStyles:Sx});function Ex(e=null){const t=Mg.useContext(Bv);return t&&(n=t,0!==Object.keys(n).length)?t:e;var n}const Dx=Mx();function _x(e=Dx){return Ex(e)}function qx(e){const t=hb(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function Ax({styles:e,themeId:t,defaultTheme:n={}}){const r=_x(n),i=t&&r[t]||r;let o="function"==typeof e?e(i):e;return i.modularCssLayers&&(o=Array.isArray(o)?o.map(e=>qx("function"==typeof e?e(i):e)):qx(o)),ub.jsx(fb,{styles:o})}const Tx=["sx"];function Nx(e){const{sx:t}=e,n=dy(e,Tx),{systemProps:r,otherProps:i}=(e=>{var t,n;const r={systemProps:{},otherProps:{}},i=null!=(t=null==e||null==(n=e.theme)?void 0:n.unstable_sxConfig)?t:bx;return Object.keys(e).forEach(t=>{i[t]?r.systemProps[t]=e[t]:r.otherProps[t]=e[t]}),r})(n);let o;return o=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return gb(n)?uy({},r,n):r}:uy({},r,t),uy({},i,{sx:o})}var Ix=Object.freeze({__proto__:null,default:wx,extendSxProp:Nx,unstable_createStyleFunctionSx:xx,unstable_defaultSxConfig:bx});const Ox=e=>e,Rx=(()=>{let e=Ox;return{configure(t){e=t},generate:t=>e(t),reset(){e=Ox}}})();function Px(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Px(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Lx(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Px(e))&&(r&&(r+=" "),r+=t);return r}const zx={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Fx(e,t,n="Mui"){const r=zx[t];return r?`${n}-${r}`:`${Rx.generate(e)}-${t}`}function jx(e,t,n="Mui"){const r={};return t.forEach(t=>{r[t]=Fx(e,t,n)}),r}var Vx,Hx,$x={exports:{}},Bx={};function Wx(){if(Vx)return Bx;Vx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function h(p){if("object"==typeof p&&null!==p){var h=p.$$typeof;switch(h){case e:switch(p=p.type){case n:case i:case r:case l:case c:case f:return p;default:switch(p=p&&p.$$typeof){case a:case s:case d:case u:case o:return p;default:return h}}case t:return h}}}return Bx.ContextConsumer=o,Bx.ContextProvider=a,Bx.Element=e,Bx.ForwardRef=s,Bx.Fragment=n,Bx.Lazy=d,Bx.Memo=u,Bx.Portal=t,Bx.Profiler=i,Bx.StrictMode=r,Bx.Suspense=l,Bx.SuspenseList=c,Bx.isContextConsumer=function(e){return h(e)===o},Bx.isContextProvider=function(e){return h(e)===a},Bx.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},Bx.isForwardRef=function(e){return h(e)===s},Bx.isFragment=function(e){return h(e)===n},Bx.isLazy=function(e){return h(e)===d},Bx.isMemo=function(e){return h(e)===u},Bx.isPortal=function(e){return h(e)===t},Bx.isProfiler=function(e){return h(e)===i},Bx.isStrictMode=function(e){return h(e)===r},Bx.isSuspense=function(e){return h(e)===l},Bx.isSuspenseList=function(e){return h(e)===c},Bx.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===i||e===r||e===l||e===c||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===u||e.$$typeof===a||e.$$typeof===o||e.$$typeof===s||e.$$typeof===p||void 0!==e.getModuleId)},Bx.typeOf=h,Bx}function Ux(){return Hx||(Hx=1,$x.exports=Wx()),$x.exports}var Yx=Ux();const Kx=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Xx(e){const t=`${e}`.match(Kx);return t&&t[1]||""}function Gx(e,t=""){return e.displayName||e.name||Xx(e)||t}function Jx(e,t,n){const r=Gx(t);return e.displayName||(""!==r?`${n}(${r})`:n)}var Qx=Object.freeze({__proto__:null,default:function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return Gx(e,"Component");if("object"==typeof e)switch(e.$$typeof){case Yx.ForwardRef:return Jx(e,e.render,"ForwardRef");case Yx.Memo:return Jx(e,e.type,"memo");default:return}}},getFunctionName:Xx});function Zx(e,t){const n=uy({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=uy({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=e[r]||{},o=t[r];n[r]={},o&&Object.keys(o)?i&&Object.keys(i)?(n[r]=uy({},o),Object.keys(i).forEach(e=>{n[r][e]=Zx(i[e],o[e])})):n[r]=o:n[r]=i}else void 0===n[r]&&(n[r]=e[r])}),n}const ew="undefined"!=typeof window?Mg.useLayoutEffect:Mg.useEffect;var tw=Object.freeze({__proto__:null,default:function(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}});function nw(...e){return e.reduce((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function rw(e){return e&&e.ownerDocument||document}function iw(e){return rw(e).defaultView||window}function ow(e,t){"function"==typeof e?e(t):e&&(e.current=t)}let aw=0;const sw=Eg["useId".toString()];function lw(e){if(void 0!==sw){return sw()}return function(e){const[t,n]=Mg.useState(e),r=e||t;return Mg.useEffect(()=>{null==t&&(aw+=1,n(`mui-${aw}`))},[t]),r}(e)}function cw(e){const t=Mg.useRef(e);return ew(()=>{t.current=e}),Mg.useRef((...e)=>(0,t.current)(...e)).current}function uw(...e){return Mg.useMemo(()=>e.every(e=>null==e)?null:t=>{e.forEach(e=>{ow(e,t)})},e)}const dw={};const fw=[];class pw{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new pw}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}function hw(){const e=function(e,t){const n=Mg.useRef(dw);return n.current===dw&&(n.current=e(t)),n}(pw.create).current;return function(e){Mg.useEffect(e,fw)}(e.disposeEffect),e}let mw=!0,gw=!1;const yw=new pw,vw={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function bw(e){e.metaKey||e.altKey||e.ctrlKey||(mw=!0)}function xw(){mw=!1}function ww(){"hidden"===this.visibilityState&&gw&&(mw=!0)}function Sw(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(e){}return mw||function(e){const{type:t,tagName:n}=e;return!("INPUT"!==n||!vw[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function kw(){const e=Mg.useCallback(e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",bw,!0),t.addEventListener("mousedown",xw,!0),t.addEventListener("pointerdown",xw,!0),t.addEventListener("touchstart",xw,!0),t.addEventListener("visibilitychange",ww,!0))},[]),t=Mg.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!Sw(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(gw=!0,yw.start(100,()=>{gw=!1}),t.current=!1,!0)},ref:e}}function Mw(e,t,n=void 0){const r={};return Object.keys(e).forEach(i=>{r[i]=e[i].reduce((e,r)=>{if(r){const i=t(r);""!==i&&e.push(i),n&&n[r]&&e.push(n[r])}return e},[]).join(" ")}),r}function Cw(e){return"string"==typeof e}function Ew(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n}function Dw(e){if(void 0===e)return{};const t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t])).forEach(n=>{t[n]=e[n]}),t}const _w=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function qw(e){var t;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=e,a=dy(e,_w),s=o?{}:function(e,t,n){return"function"==typeof e?e(t,n):e}(r,i),{props:l,internalRef:c}=function(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const e=Lx(null==n?void 0:n.className,o,null==i?void 0:i.className,null==r?void 0:r.className),t=uy({},null==n?void 0:n.style,null==i?void 0:i.style,null==r?void 0:r.style),a=uy({},n,i,r);return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=Ew(uy({},i,r)),s=Dw(r),l=Dw(i),c=t(a),u=Lx(null==c?void 0:c.className,null==n?void 0:n.className,o,null==i?void 0:i.className,null==r?void 0:r.className),d=uy({},null==c?void 0:c.style,null==n?void 0:n.style,null==i?void 0:i.style,null==r?void 0:r.style),f=uy({},c,n,l,s);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}(uy({},a,{externalSlotProps:s})),u=function(e,t,n){return void 0===e||Cw(e)?t:uy({},t,{ownerState:uy({},t.ownerState,n)})}(n,uy({},l,{ref:uw(c,null==s?void 0:s.ref,null==(t=e.additionalProps)?void 0:t.ref)}),i);return u}function Aw(e){var t;return parseInt(Mg.version,10)>=19?(null==e||null==(t=e.props)?void 0:t.ref)||null:(null==e?void 0:e.ref)||null}const Tw=Mg.createContext(null);function Nw(){return Mg.useContext(Tw)}var Iw="function"==typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";function Ow(e){const{children:t,theme:n}=e,r=Nw(),i=Mg.useMemo(()=>{const e=null===r?n:function(e,t){if("function"==typeof t)return t(e);return uy({},e,t)}(r,n);return null!=e&&(e[Iw]=null!==r),e},[n,r]);return ub.jsx(Tw.Provider,{value:i,children:t})}const Rw=["value"],Pw=Mg.createContext();function Lw(e){let{value:t}=e,n=dy(e,Rw);return ub.jsx(Pw.Provider,uy({value:null==t||t},n))}const zw=Mg.createContext(void 0);function Fw({value:e,children:t}){return ub.jsx(zw.Provider,{value:e,children:t})}function jw({props:e,name:t}){return function(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?Zx(i.defaultProps,r):i.styleOverrides||i.variants?r:Zx(i,r)}({props:e,name:t,theme:{components:Mg.useContext(zw)}})}const Vw={};function Hw(e,t,n,r=!1){return Mg.useMemo(()=>{const i=e&&t[e]||t;if("function"==typeof n){const o=n(i),a=e?uy({},t,{[e]:o}):o;return r?()=>a:a}return uy({},t,e?{[e]:n}:n)},[e,t,n,r])}function $w(e){const{children:t,theme:n,themeId:r}=e,i=Ex(Vw),o=Nw()||Vw,a=Hw(r,i,n),s=Hw(r,o,n,!0),l="rtl"===a.direction,c=function(e){const t=Ex(),n=lw()||"",{modularCssLayers:r}=e;let i="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return i=r&&null===t?"string"==typeof r?r.replace(/mui(?!\.)/g,i):`@layer ${i};`:"",ew(()=>{const e=document.querySelector("head");if(!e)return;const t=e.firstChild;if(i){var r;if(t&&null!=(r=t.hasAttribute)&&r.call(t,"data-mui-layer-order")&&t.getAttribute("data-mui-layer-order")===n)return;const o=document.createElement("style");o.setAttribute("data-mui-layer-order",n),o.textContent=i,e.prepend(o)}else{var o;null==(o=e.querySelector(`style[data-mui-layer-order="${n}"]`))||o.remove()}},[i,n]),i?ub.jsx(Ax,{styles:i}):null}(a);return ub.jsx(Ow,{theme:s,children:ub.jsx(Bv.Provider,{value:a,children:ub.jsx(Lw,{value:l,children:ub.jsxs(Fw,{value:null==a?void 0:a.components,children:[c,t]})})})})}var Bw,Ww={},Uw={exports:{}};function Yw(){return Bw||(Bw=1,function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}(Uw)),Uw.exports}var Kw,Xw=i(ly),Gw=i(tw);function Jw(){if(Kw)return Ww;Kw=1;var e=Yw();Object.defineProperty(Ww,"__esModule",{value:!0}),Ww.alpha=u,Ww.blend=function(e,t,n,r=1){const i=(e,t)=>Math.round((e**(1/r)*(1-n)+t**(1/r)*n)**r),a=o(e),l=o(t),c=[i(a.values[0],l.values[0]),i(a.values[1],l.values[1]),i(a.values[2],l.values[2])];return s({type:"rgb",values:c})},Ww.colorChannel=void 0,Ww.darken=d,Ww.decomposeColor=o,Ww.emphasize=p,Ww.getContrastRatio=function(e,t){const n=c(e),r=c(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},Ww.getLuminance=c,Ww.hexToRgb=i,Ww.hslToRgb=l,Ww.lighten=f,Ww.private_safeAlpha=function(e,t,n){try{return u(e,t)}catch(t){return e}},Ww.private_safeColorChannel=void 0,Ww.private_safeDarken=function(e,t,n){try{return d(e,t)}catch(t){return e}},Ww.private_safeEmphasize=function(e,t,n){try{return p(e,t)}catch(t){return e}},Ww.private_safeLighten=function(e,t,n){try{return f(e,t)}catch(t){return e}},Ww.recomposeColor=s,Ww.rgbToHex=function(e){if(0===e.indexOf("#"))return e;const{values:t}=o(e);return`#${t.map((e,t)=>function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(3===t?Math.round(255*e):e)).join("")}`};var t=e(Xw),n=e(Gw);function r(e,t=0,r=1){return(0,n.default)(e,t,r)}function i(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map(e=>e+e)),n?`rgb${4===n.length?"a":""}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", ")})`:""}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(i(e));const n=e.indexOf("("),r=e.substring(0,n);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw new Error((0,t.default)(9,e));let a,s=e.substring(n+1,e.length-1);if("color"===r){if(s=s.split(" "),a=s.shift(),4===s.length&&"/"===s[3].charAt(0)&&(s[3]=s[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(a))throw new Error((0,t.default)(10,a))}else s=s.split(",");return s=s.map(e=>parseFloat(e)),{type:r,values:s,colorSpace:a}}const a=e=>{const t=o(e);return t.values.slice(0,3).map((e,n)=>-1!==t.type.indexOf("hsl")&&0!==n?`${e}%`:e).join(" ")};Ww.colorChannel=a;function s(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return-1!==t.indexOf("rgb")?r=r.map((e,t)=>t<3?parseInt(e,10):e):-1!==t.indexOf("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=-1!==t.indexOf("color")?`${n} ${r.join(" ")}`:`${r.join(", ")}`,`${t}(${r})`}function l(e){e=o(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),l=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1);let c="rgb";const u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),s({type:c,values:u})}function c(e){let t="hsl"===(e=o(e)).type||"hsla"===e.type?o(l(e)).values:e.values;return t=t.map(t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function u(e,t){return e=o(e),t=r(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,s(e)}function d(e,t){if(e=o(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return s(e)}function f(e,t){if(e=o(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return s(e)}function p(e,t=.15){return c(e)>.5?d(e,t):f(e,t)}return Ww.private_safeColorChannel=(e,t)=>{try{return a(e)}catch(t){return e}},Ww}var Qw=Jw();const Zw=["mode","contrastThreshold","tonalOffset"],eS={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Dg.white,default:Dg.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},tS={text:{primary:Dg.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Dg.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function nS(e,t,n,r){const i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Qw.lighten(e.main,i):"dark"===t&&(e.dark=Qw.darken(e.main,o)))}function rS(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=e,i=dy(e,Zw),o=e.primary||function(e="light"){return"dark"===e?{main:jg,light:Fg,dark:Vg}:{main:Hg,light:Vg,dark:$g}}(t),a=e.secondary||function(e="light"){return"dark"===e?{main:Og,light:Ig,dark:Pg}:{main:Lg,light:Rg,dark:zg}}(t),s=e.error||function(e="light"){return"dark"===e?{main:Ag,light:_g,dark:Tg}:{main:Tg,light:qg,dark:Ng}}(t),l=e.info||function(e="light"){return"dark"===e?{main:Wg,light:Bg,dark:Yg}:{main:Yg,light:Ug,dark:Kg}}(t),c=e.success||function(e="light"){return"dark"===e?{main:Gg,light:Xg,dark:Qg}:{main:Zg,light:Jg,dark:ey}}(t),u=e.warning||function(e="light"){return"dark"===e?{main:ny,light:ty,dark:iy}:{main:"#ed6c02",light:ry,dark:oy}}(t);function d(e){return Qw.getContrastRatio(e,tS.text.primary)>=n?tS.text.primary:eS.text.primary}const f=({color:e,name:t,mainShade:n=500,lightShade:i=300,darkShade:o=700})=>{if(!(e=uy({},e)).main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty("main"))throw new Error(sy(11,t?` (${t})`:"",n));if("string"!=typeof e.main)throw new Error(sy(12,t?` (${t})`:"",JSON.stringify(e.main)));return nS(e,"light",i,r),nS(e,"dark",o,r),e.contrastText||(e.contrastText=d(e.main)),e},p={dark:tS,light:eS};return vb(uy({common:uy({},Dg),mode:t,primary:f({color:o,name:"primary"}),secondary:f({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:s,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:ay,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r},p[t]),i)}const iS=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function oS(e){return Math.round(1e5*e)/1e5}const aS={textTransform:"uppercase"},sS='"Roboto", "Helvetica", "Arial", sans-serif';function lS(e,t){const n="function"==typeof t?t(e):t,{fontFamily:r=sS,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=n,f=dy(n,iS),p=i/14,h=d||(e=>e/c*p+"rem"),m=(e,t,n,i,o)=>uy({fontFamily:r,fontWeight:e,fontSize:h(t),lineHeight:n},r===sS?{letterSpacing:`${oS(i/t)}em`}:{},o,u),g={h1:m(o,96,1.167,-1.5),h2:m(o,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(s,14,1.75,.4,aS),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,aS),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return vb(uy({htmlFontSize:c,pxToRem:h,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},g),f,{clone:!1})}function cS(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const uS=["none",cS(0,2,1,-1,0,1,1,0,0,1,3,0),cS(0,3,1,-2,0,2,2,0,0,1,5,0),cS(0,3,3,-2,0,3,4,0,0,1,8,0),cS(0,2,4,-1,0,4,5,0,0,1,10,0),cS(0,3,5,-1,0,5,8,0,0,1,14,0),cS(0,3,5,-1,0,6,10,0,0,1,18,0),cS(0,4,5,-2,0,7,10,1,0,2,16,1),cS(0,5,5,-3,0,8,10,1,0,3,14,2),cS(0,5,6,-3,0,9,12,1,0,3,16,2),cS(0,6,6,-3,0,10,14,1,0,4,18,3),cS(0,6,7,-4,0,11,15,1,0,4,20,3),cS(0,7,8,-4,0,12,17,2,0,5,22,4),cS(0,7,8,-4,0,13,19,2,0,5,24,4),cS(0,7,9,-4,0,14,21,2,0,5,26,4),cS(0,8,9,-5,0,15,22,2,0,6,28,5),cS(0,8,10,-5,0,16,24,2,0,6,30,5),cS(0,8,11,-5,0,17,26,2,0,6,32,5),cS(0,9,11,-5,0,18,28,2,0,7,34,6),cS(0,9,12,-6,0,19,29,2,0,7,36,6),cS(0,10,13,-6,0,20,31,3,0,8,38,7),cS(0,10,13,-6,0,21,33,3,0,8,40,7),cS(0,10,14,-6,0,22,35,3,0,8,42,7),cS(0,11,14,-7,0,23,36,3,0,9,44,8),cS(0,11,15,-7,0,24,38,3,0,9,46,8)],dS=["duration","easing","delay"],fS={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},pS={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function hS(e){return`${Math.round(e)}ms`}function mS(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function gS(e){const t=uy({},fS,e.easing),n=uy({},pS,e.duration);return uy({getAutoHeightDuration:mS,create:(e=["all"],r={})=>{const{duration:i=n.standard,easing:o=t.easeInOut,delay:a=0}=r;return dy(r,dS),(Array.isArray(e)?e:[e]).map(e=>`${e} ${"string"==typeof i?i:hS(i)} ${o} ${"string"==typeof a?a:hS(a)}`).join(",")}},e,{easing:t,duration:n})}const yS={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},vS=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function bS(e={},...t){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=e,a=dy(e,vS);if(e.vars&&void 0===e.generateCssVars)throw new Error(sy(18));const s=rS(r),l=Mx(e);let c=vb(l,{mixins:(u=l.breakpoints,d=n,uy({toolbar:{minHeight:56,[u.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[u.up("sm")]:{minHeight:64}}},d)),palette:s,shadows:uS.slice(),typography:lS(s,o),transitions:gS(i),zIndex:uy({},yS)});var u,d;return c=vb(c,a),c=t.reduce((e,t)=>vb(e,t),c),c.unstable_sxConfig=uy({},bx,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return wx({sx:e,theme:this})},c}const xS=bS();function wS(){const e=_x(xS);return e[cy]||e}var SS,kS={},MS={exports:{}};var CS,ES={exports:{}};var DS,_S=i(mb),qS=i(bb),AS=i(qb),TS=i(Qx),NS=i(Cx),IS=i(Ix);function OS(){if(DS)return kS;DS=1;var e=Yw();Object.defineProperty(kS,"__esModule",{value:!0}),kS.default=function(e={}){const{themeId:o,defaultTheme:s=p,rootShouldForwardProp:l=d,slotShouldForwardProp:u=d}=e,f=e=>(0,a.default)((0,t.default)({},e,{theme:m((0,t.default)({},e,{defaultTheme:s,themeId:o}))}));return f.__mui_systemSx=!0,(e,a={})=>{(0,r.internal_processStyles)(e,e=>e.filter(e=>!(null!=e&&e.__mui_systemSx)));const{name:p,slot:v,skipVariantsResolver:b,skipSx:x,overridesResolver:w=g(h(v))}=a,S=(0,n.default)(a,c),k=p&&p.startsWith("Mui")||v?"components":"custom",M=void 0!==b?b:v&&"Root"!==v&&"root"!==v||!1,C=x||!1;let E=d;"Root"===v||"root"===v?E=l:v?E=u:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(E=void 0);const D=(0,r.default)(e,(0,t.default)({shouldForwardProp:E,label:undefined},S)),_=e=>"function"==typeof e&&e.__emotion_real!==e||(0,i.isPlainObject)(e)?n=>{const r=m({theme:n.theme,defaultTheme:s,themeId:o});return y(e,(0,t.default)({},n,{theme:r}),r.modularCssLayers?k:void 0)}:e,q=(n,...r)=>{let i=_(n);const a=r?r.map(_):[];p&&w&&a.push(e=>{const n=m((0,t.default)({},e,{defaultTheme:s,themeId:o}));if(!n.components||!n.components[p]||!n.components[p].styleOverrides)return null;const r=n.components[p].styleOverrides,i={};return Object.entries(r).forEach(([r,o])=>{i[r]=y(o,(0,t.default)({},e,{theme:n}),n.modularCssLayers?"theme":void 0)}),w(e,i)}),p&&!M&&a.push(e=>{var n;const r=m((0,t.default)({},e,{defaultTheme:s,themeId:o}));return y({variants:null==r||null==(n=r.components)||null==(n=n[p])?void 0:n.variants},(0,t.default)({},e,{theme:r}),r.modularCssLayers?"theme":void 0)}),C||a.push(f);const l=a.length-r.length;if(Array.isArray(n)&&l>0){const e=new Array(l).fill("");i=[...n,...e],i.raw=[...n.raw,...e]}const c=D(i,...a);return e.muiName&&(c.muiName=e.muiName),c};return D.withConfig&&(q.withConfig=D.withConfig),q}},kS.shouldForwardProp=d,kS.systemDefaultTheme=void 0;var t=e((SS||(SS=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(MS)),MS.exports)),n=e((CS||(CS=1,function(e){e.exports=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n},e.exports.__esModule=!0,e.exports.default=e.exports}(ES)),ES.exports)),r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(_S),i=qS;e(AS),e(TS);var o=e(NS),a=e(IS);const s=["ownerState"],l=["variants"],c=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function d(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function f(e,t){return t&&e&&"object"==typeof e&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}const p=kS.systemDefaultTheme=(0,o.default)(),h=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function m({defaultTheme:e,theme:t,themeId:n}){return r=t,0===Object.keys(r).length?e:t[n]||t;var r}function g(e){return e?(t,n)=>n[e]:null}function y(e,i,o){let{ownerState:a}=i,c=(0,n.default)(i,s);const u="function"==typeof e?e((0,t.default)({ownerState:a},c)):e;if(Array.isArray(u))return u.flatMap(e=>y(e,(0,t.default)({ownerState:a},c),o));if(u&&"object"==typeof u&&Array.isArray(u.variants)){const{variants:e=[]}=u;let i=(0,n.default)(u,l);return e.forEach(e=>{let n=!0;if("function"==typeof e.props?n=e.props((0,t.default)({ownerState:a},c,a)):Object.keys(e.props).forEach(t=>{(null==a?void 0:a[t])!==e.props[t]&&c[t]!==e.props[t]&&(n=!1)}),n){Array.isArray(i)||(i=[i]);const n="function"==typeof e.style?e.style((0,t.default)({ownerState:a},c,a)):e.style;i.push(o?f((0,r.internal_serializeStyles)(n),o):n)}}),i}return o?f((0,r.internal_serializeStyles)(u),o):u}return kS}const RS=e=>function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}(e)&&"classes"!==e,PS=r(OS())({themeId:cy,defaultTheme:xS,rootShouldForwardProp:RS}),LS=["theme"];function zS(e){let{theme:t}=e,n=dy(e,LS);const r=t[cy];let i=r||t;return"function"!=typeof t&&(r&&!r.vars?i=uy({},r,{vars:null}):t&&!t.vars&&(i=uy({},t,{vars:null}))),ub.jsx($w,uy({},n,{themeId:r?cy:void 0,theme:i}))}const FS=e=>{let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,(t/100).toFixed(2)};function jS(e){return jw(e)}function VS(e){return Fx("MuiSvgIcon",e)}jx("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const HS=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],$S=PS("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${_b(n.color)}`],t[`fontSize${_b(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,i,o,a,s,l,c,u,d,f,p,h;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(n=e.transitions)||null==(r=n.create)?void 0:r.call(n,"fill",{duration:null==(i=e.transitions)||null==(i=i.duration)?void 0:i.shorter}),fontSize:{inherit:"inherit",small:(null==(o=e.typography)||null==(a=o.pxToRem)?void 0:a.call(o,20))||"1.25rem",medium:(null==(s=e.typography)||null==(l=s.pxToRem)?void 0:l.call(s,24))||"1.5rem",large:(null==(c=e.typography)||null==(u=c.pxToRem)?void 0:u.call(c,35))||"2.1875rem"}[t.fontSize],color:null!=(d=null==(f=(e.vars||e).palette)||null==(f=f[t.color])?void 0:f.main)?d:{action:null==(p=(e.vars||e).palette)||null==(p=p.action)?void 0:p.active,disabled:null==(h=(e.vars||e).palette)||null==(h=h.action)?void 0:h.disabled,inherit:void 0}[t.color]}}),BS=Mg.forwardRef(function(e,t){const n=jS({props:e,name:"MuiSvgIcon"}),{children:r,className:i,color:o="inherit",component:a="svg",fontSize:s="medium",htmlColor:l,inheritViewBox:c=!1,titleAccess:u,viewBox:d="0 0 24 24"}=n,f=dy(n,HS),p=Mg.isValidElement(r)&&"svg"===r.type,h=uy({},n,{color:o,component:a,fontSize:s,instanceFontSize:e.fontSize,inheritViewBox:c,viewBox:d,hasSvgAsChild:p}),m={};c||(m.viewBox=d);const g=(e=>{const{color:t,fontSize:n,classes:r}=e;return Mw({root:["root","inherit"!==t&&`color${_b(t)}`,`fontSize${_b(n)}`]},VS,r)})(h);return ub.jsxs($S,uy({as:a,className:Lx(g.root,i),focusable:"false",color:l,"aria-hidden":!u||void 0,role:u?"img":void 0,ref:t},m,f,p&&r.props,{ownerState:h,children:[p?r.props.children:r,u?ub.jsx("title",{children:u}):null]}))});function WS(e,t){return WS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},WS(e,t)}function US(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,WS(e,t)}BS.muiName="SvgIcon";var YS,KS,XS,GS,JS={exports:{}},QS={},ZS={exports:{}},ek={};function tk(){return KS||(KS=1,ZS.exports=(YS||(YS=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>i(l,n))c<o&&0>i(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<o&&0>i(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))break;r(c),i.sortIndex=i.expirationTime,t(l,i)}i=n(c)}}function x(e){if(m=!1,b(e),!h)if(null!==n(l))h=!0,N(w);else{var t=n(c);null!==t&&I(x,t.startTime-e)}}function w(t,i){h=!1,m&&(m=!1,y(C),C=-1),p=!0;var o=f;try{for(b(i),d=n(l);null!==d&&(!(d.expirationTime>i)||t&&!_());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var s=a(d.expirationTime<=i);i=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),b(i)}else r(l);d=n(l)}if(null!==d)var u=!0;else{var g=n(c);null!==g&&I(x,g.startTime-i),u=!1}return u}finally{d=null,f=o,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,k=!1,M=null,C=-1,E=5,D=-1;function _(){return!(e.unstable_now()-D<E)}function q(){if(null!==M){var t=e.unstable_now();D=t;var n=!0;try{n=M(!0,t)}finally{n?S():(k=!1,M=null)}}else k=!1}if("function"==typeof v)S=function(){v(q)};else if("undefined"!=typeof MessageChannel){var A=new MessageChannel,T=A.port2;A.port1.onmessage=q,S=function(){T.postMessage(null)}}else S=function(){g(q,0)};function N(e){M=e,k||(k=!0,S())}function I(t,n){C=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||p||(h=!0,N(w))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:u++,callback:i,priorityLevel:r,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>a?(r.sortIndex=o,t(c,r),null===n(l)&&r===n(c)&&(m?(y(C),C=-1):m=!0,I(x,o-a))):(r.sortIndex=s,t(l,r),h||p||(h=!0,N(w))),r},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(ek)),ek)),ZS.exports}
21
+ */const pb=[];function hb(e){return pb[0]=e,Rv(pb)}var mb=Object.freeze({__proto__:null,GlobalStyles:fb,StyledEngineProvider:function(e){const{injectFirst:t,enableCssLayer:n,children:r}=e,i=Mg.useMemo(()=>{const e=`${t}-${n}`;if("object"==typeof document&&db.has(e))return db.get(e);const r=function(e,t){const n=vv({key:"css",prepend:e});if(t){const e=n.insert;n.insert=(...t)=>(t[1].styles.match(/^@layer\s+[^{]*$/)||(t[1].styles=`@layer mui {${t[1].styles}}`),e(...t))}return n}(t,n);return db.set(e,r),r},[t,n]);return t||n?ub.jsx(Hv,{value:i,children:r}):r},ThemeContext:Bv,css:Jv,default:function(e,t){return ob(e,t)},internal_processStyles:(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},internal_serializeStyles:hb,keyframes:Qv});function gb(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function yb(e){if(Mg.isValidElement(e)||!gb(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=yb(e[n])}),t}function vb(e,t,n={clone:!0}){const r=n.clone?uy({},e):e;return gb(e)&&gb(t)&&Object.keys(t).forEach(i=>{Mg.isValidElement(t[i])?r[i]=t[i]:gb(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&gb(e[i])?r[i]=vb(e[i],t[i],n):n.clone?r[i]=gb(t[i])?yb(t[i]):t[i]:r[i]=t[i]}),r}var bb=Object.freeze({__proto__:null,default:vb,isPlainObject:gb});const xb=["values","unit","step"];function wb(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,i=dy(e,xb),o=(e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>uy({},e,{[t.key]:t.val}),{})})(t),a=Object.keys(o);function s(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n})`}function l(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-r/100}${n})`}function c(e,i){const o=a.indexOf(i);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==o&&"number"==typeof t[a[o]]?t[a[o]]:i)-r/100}${n})`}return uy({keys:a,values:o,up:s,down:l,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):s(e)},not:function(e){const t=a.indexOf(e);return 0===t?s(a[1]):t===a.length-1?l(a[t]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:n},i)}const Sb={borderRadius:4};function kb(e,t){return t?vb(e,t,{clone:!1}):e}const Mb={xs:0,sm:600,md:900,lg:1200,xl:1536},Cb={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Mb[e]}px)`};function Eb(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||Cb;return t.reduce((r,i,o)=>(r[e.up(e.keys[o])]=n(t[o]),r),{})}if("object"==typeof t){const e=r.breakpoints||Cb;return Object.keys(t).reduce((r,i)=>{if(-1!==Object.keys(e.values||Mb).indexOf(i)){r[e.up(i)]=n(t[i],i)}else{const e=i;r[e]=t[e]}return r},{})}return n(t)}function Db(e,t){return e.reduce((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e},t)}function _b(e){if("string"!=typeof e)throw new Error(sy(7));return e.charAt(0).toUpperCase()+e.slice(1)}var qb=Object.freeze({__proto__:null,default:_b});function Ab(e,t,n=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){const n=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=n)return n}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function Tb(e,t,n,r=n){let i;return i="function"==typeof e?e(n):Array.isArray(e)?e[n]||r:Ab(e,n)||r,t&&(i=t(i,r,e)),i}function Nb(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=e=>{if(null==e[t])return null;const o=e[t],a=Ab(e.theme,r)||{};return Eb(e,o,e=>{let r=Tb(a,i,e);return e===r&&"string"==typeof e&&(r=Tb(a,i,`${t}${"default"===e?"":_b(e)}`,e)),!1===n?r:{[n]:r}})};return o.propTypes={},o.filterProps=[t],o}const Ib={m:"margin",p:"padding"},Ob={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Rb={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Pb=function(e){const t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}(e=>{if(e.length>2){if(!Rb[e])return[e];e=Rb[e]}const[t,n]=e.split(""),r=Ib[t],i=Ob[n]||"";return Array.isArray(i)?i.map(e=>r+e):[r+i]}),Lb=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],zb=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function Fb(e,t,n,r){var i;const o=null!=(i=Ab(e,t,!1))?i:n;return"number"==typeof o?e=>"string"==typeof e?e:o*e:Array.isArray(o)?e=>"string"==typeof e?e:o[e]:"function"==typeof o?o:()=>{}}function jb(e){return Fb(e,"spacing",8)}function Vb(e,t){if("string"==typeof t||null==t)return t;const n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:`-${n}`}function Hb(e,t,n,r){if(-1===t.indexOf(n))return null;const i=function(e,t){return n=>e.reduce((e,r)=>(e[r]=Vb(t,n),e),{})}(Pb(n),r);return Eb(e,e[n],i)}function $b(e,t){const n=jb(e.theme);return Object.keys(e).map(r=>Hb(e,t,r,n)).reduce(kb,{})}function Bb(e){return $b(e,Lb)}function Wb(e){return $b(e,zb)}function Ub(...e){const t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>Object.keys(e).reduce((n,r)=>t[r]?kb(n,t[r](e)):n,{});return n.propTypes={},n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function Yb(e){return"number"!=typeof e?e:`${e}px solid`}function Kb(e,t){return Nb({prop:e,themeKey:"borders",transform:t})}Bb.propTypes={},Bb.filterProps=Lb,Wb.propTypes={},Wb.filterProps=zb;const Xb=Kb("border",Yb),Gb=Kb("borderTop",Yb),Jb=Kb("borderRight",Yb),Qb=Kb("borderBottom",Yb),Zb=Kb("borderLeft",Yb),ex=Kb("borderColor"),tx=Kb("borderTopColor"),nx=Kb("borderRightColor"),rx=Kb("borderBottomColor"),ix=Kb("borderLeftColor"),ox=Kb("outline",Yb),ax=Kb("outlineColor"),sx=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=Fb(e.theme,"shape.borderRadius",4),n=e=>({borderRadius:Vb(t,e)});return Eb(e,e.borderRadius,n)}return null};sx.propTypes={},sx.filterProps=["borderRadius"],Ub(Xb,Gb,Jb,Qb,Zb,ex,tx,nx,rx,ix,sx,ox,ax);const lx=e=>{if(void 0!==e.gap&&null!==e.gap){const t=Fb(e.theme,"spacing",8),n=e=>({gap:Vb(t,e)});return Eb(e,e.gap,n)}return null};lx.propTypes={},lx.filterProps=["gap"];const cx=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=Fb(e.theme,"spacing",8),n=e=>({columnGap:Vb(t,e)});return Eb(e,e.columnGap,n)}return null};cx.propTypes={},cx.filterProps=["columnGap"];const ux=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=Fb(e.theme,"spacing",8),n=e=>({rowGap:Vb(t,e)});return Eb(e,e.rowGap,n)}return null};ux.propTypes={},ux.filterProps=["rowGap"];function dx(e,t){return"grey"===t?t:e}Ub(lx,cx,ux,Nb({prop:"gridColumn"}),Nb({prop:"gridRow"}),Nb({prop:"gridAutoFlow"}),Nb({prop:"gridAutoColumns"}),Nb({prop:"gridAutoRows"}),Nb({prop:"gridTemplateColumns"}),Nb({prop:"gridTemplateRows"}),Nb({prop:"gridTemplateAreas"}),Nb({prop:"gridArea"}));function fx(e){return e<=1&&0!==e?100*e+"%":e}Ub(Nb({prop:"color",themeKey:"palette",transform:dx}),Nb({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:dx}),Nb({prop:"backgroundColor",themeKey:"palette",transform:dx}));const px=Nb({prop:"width",transform:fx}),hx=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var n,r;const i=(null==(n=e.theme)||null==(n=n.breakpoints)||null==(n=n.values)?void 0:n[t])||Mb[t];return i?"px"!==(null==(r=e.theme)||null==(r=r.breakpoints)?void 0:r.unit)?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:fx(t)}};return Eb(e,e.maxWidth,t)}return null};hx.filterProps=["maxWidth"];const mx=Nb({prop:"minWidth",transform:fx}),gx=Nb({prop:"height",transform:fx}),yx=Nb({prop:"maxHeight",transform:fx}),vx=Nb({prop:"minHeight",transform:fx});Nb({prop:"size",cssProperty:"width",transform:fx}),Nb({prop:"size",cssProperty:"height",transform:fx});Ub(px,hx,mx,gx,yx,vx,Nb({prop:"boxSizing"}));const bx={border:{themeKey:"borders",transform:Yb},borderTop:{themeKey:"borders",transform:Yb},borderRight:{themeKey:"borders",transform:Yb},borderBottom:{themeKey:"borders",transform:Yb},borderLeft:{themeKey:"borders",transform:Yb},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Yb},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:sx},color:{themeKey:"palette",transform:dx},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:dx},backgroundColor:{themeKey:"palette",transform:dx},p:{style:Wb},pt:{style:Wb},pr:{style:Wb},pb:{style:Wb},pl:{style:Wb},px:{style:Wb},py:{style:Wb},padding:{style:Wb},paddingTop:{style:Wb},paddingRight:{style:Wb},paddingBottom:{style:Wb},paddingLeft:{style:Wb},paddingX:{style:Wb},paddingY:{style:Wb},paddingInline:{style:Wb},paddingInlineStart:{style:Wb},paddingInlineEnd:{style:Wb},paddingBlock:{style:Wb},paddingBlockStart:{style:Wb},paddingBlockEnd:{style:Wb},m:{style:Bb},mt:{style:Bb},mr:{style:Bb},mb:{style:Bb},ml:{style:Bb},mx:{style:Bb},my:{style:Bb},margin:{style:Bb},marginTop:{style:Bb},marginRight:{style:Bb},marginBottom:{style:Bb},marginLeft:{style:Bb},marginX:{style:Bb},marginY:{style:Bb},marginInline:{style:Bb},marginInlineStart:{style:Bb},marginInlineEnd:{style:Bb},marginBlock:{style:Bb},marginBlockStart:{style:Bb},marginBlockEnd:{style:Bb},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:lx},rowGap:{style:ux},columnGap:{style:cx},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:fx},maxWidth:{style:hx},minWidth:{transform:fx},height:{transform:fx},maxHeight:{transform:fx},minHeight:{transform:fx},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function xx(){function e(e,t,n,r){const i={[e]:t,theme:n},o=r[e];if(!o)return{[e]:t};const{cssProperty:a=e,themeKey:s,transform:l,style:c}=o;if(null==t)return null;if("typography"===s&&"inherit"===t)return{[e]:t};const u=Ab(n,s)||{};if(c)return c(i);return Eb(i,t,t=>{let n=Tb(u,l,t);return t===n&&"string"==typeof t&&(n=Tb(u,l,`${e}${"default"===t?"":_b(t)}`,t)),!1===a?n:{[a]:n}})}return function t(n){var r;const{sx:i,theme:o={},nested:a}=n||{};if(!i)return null;const s=null!=(r=o.unstable_sxConfig)?r:bx;function l(n){let r=n;if("function"==typeof n)r=n(o);else if("object"!=typeof n)return n;if(!r)return null;const i=function(e={}){var t;return(null==(t=e.keys)?void 0:t.reduce((t,n)=>(t[e.up(n)]={},t),{}))||{}}(o.breakpoints),l=Object.keys(i);let c=i;return Object.keys(r).forEach(n=>{const i=(a=r[n],l=o,"function"==typeof a?a(l):a);var a,l;if(null!=i)if("object"==typeof i)if(s[n])c=kb(c,e(n,i,o,s));else{const e=Eb({theme:o},i,e=>({[n]:e}));!function(...e){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),n=new Set(t);return e.every(e=>n.size===Object.keys(e).length)}(e,i)?c=kb(c,e):c[n]=t({sx:i,theme:o,nested:!0})}else c=kb(c,e(n,i,o,s))}),!a&&o.modularCssLayers?{"@layer sx":Db(l,c)}:Db(l,c)}return Array.isArray(i)?i.map(l):l(i)}}const wx=xx();function Sx(e,t){const n=this;if(n.vars&&"function"==typeof n.getColorSchemeSelector){const r=n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)");return{[r]:t}}return n.palette.mode===e?t:{}}wx.filterProps=["sx"];const kx=["breakpoints","palette","spacing","shape"];function Mx(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=e,a=dy(e,kx),s=wb(n),l=function(e=8){if(e.mui)return e;const t=jb({spacing:e}),n=(...e)=>(0===e.length?[1]:e).map(e=>{const n=t(e);return"number"==typeof n?`${n}px`:n}).join(" ");return n.mui=!0,n}(i);let c=vb({breakpoints:s,direction:"ltr",components:{},palette:uy({mode:"light"},r),spacing:l,shape:uy({},Sb,o)},a);return c.applyStyles=Sx,c=t.reduce((e,t)=>vb(e,t),c),c.unstable_sxConfig=uy({},bx,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return wx({sx:e,theme:this})},c}var Cx=Object.freeze({__proto__:null,default:Mx,private_createBreakpoints:wb,unstable_applyStyles:Sx});function Ex(e=null){const t=Mg.useContext(Bv);return t&&(n=t,0!==Object.keys(n).length)?t:e;var n}const Dx=Mx();function _x(e=Dx){return Ex(e)}function qx(e){const t=hb(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function Ax({styles:e,themeId:t,defaultTheme:n={}}){const r=_x(n),i=t&&r[t]||r;let o="function"==typeof e?e(i):e;return i.modularCssLayers&&(o=Array.isArray(o)?o.map(e=>qx("function"==typeof e?e(i):e)):qx(o)),ub.jsx(fb,{styles:o})}const Tx=["sx"];function Nx(e){const{sx:t}=e,n=dy(e,Tx),{systemProps:r,otherProps:i}=(e=>{var t,n;const r={systemProps:{},otherProps:{}},i=null!=(t=null==e||null==(n=e.theme)?void 0:n.unstable_sxConfig)?t:bx;return Object.keys(e).forEach(t=>{i[t]?r.systemProps[t]=e[t]:r.otherProps[t]=e[t]}),r})(n);let o;return o=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return gb(n)?uy({},r,n):r}:uy({},r,t),uy({},i,{sx:o})}var Ix=Object.freeze({__proto__:null,default:wx,extendSxProp:Nx,unstable_createStyleFunctionSx:xx,unstable_defaultSxConfig:bx});const Ox=e=>e,Rx=(()=>{let e=Ox;return{configure(t){e=t},generate:t=>e(t),reset(){e=Ox}}})();function Px(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Px(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Lx(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Px(e))&&(r&&(r+=" "),r+=t);return r}const zx={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Fx(e,t,n="Mui"){const r=zx[t];return r?`${n}-${r}`:`${Rx.generate(e)}-${t}`}function jx(e,t,n="Mui"){const r={};return t.forEach(t=>{r[t]=Fx(e,t,n)}),r}var Vx,Hx,$x={exports:{}},Bx={};function Wx(){if(Vx)return Bx;Vx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),p=Symbol.for("react.client.reference");function h(p){if("object"==typeof p&&null!==p){var h=p.$$typeof;switch(h){case e:switch(p=p.type){case n:case i:case r:case l:case c:case f:return p;default:switch(p=p&&p.$$typeof){case a:case s:case d:case u:case o:return p;default:return h}}case t:return h}}}return Bx.ContextConsumer=o,Bx.ContextProvider=a,Bx.Element=e,Bx.ForwardRef=s,Bx.Fragment=n,Bx.Lazy=d,Bx.Memo=u,Bx.Portal=t,Bx.Profiler=i,Bx.StrictMode=r,Bx.Suspense=l,Bx.SuspenseList=c,Bx.isContextConsumer=function(e){return h(e)===o},Bx.isContextProvider=function(e){return h(e)===a},Bx.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},Bx.isForwardRef=function(e){return h(e)===s},Bx.isFragment=function(e){return h(e)===n},Bx.isLazy=function(e){return h(e)===d},Bx.isMemo=function(e){return h(e)===u},Bx.isPortal=function(e){return h(e)===t},Bx.isProfiler=function(e){return h(e)===i},Bx.isStrictMode=function(e){return h(e)===r},Bx.isSuspense=function(e){return h(e)===l},Bx.isSuspenseList=function(e){return h(e)===c},Bx.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===i||e===r||e===l||e===c||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===u||e.$$typeof===a||e.$$typeof===o||e.$$typeof===s||e.$$typeof===p||void 0!==e.getModuleId)},Bx.typeOf=h,Bx}function Ux(){return Hx||(Hx=1,$x.exports=Wx()),$x.exports}var Yx=Ux();const Kx=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Xx(e){const t=`${e}`.match(Kx);return t&&t[1]||""}function Gx(e,t=""){return e.displayName||e.name||Xx(e)||t}function Jx(e,t,n){const r=Gx(t);return e.displayName||(""!==r?`${n}(${r})`:n)}var Qx=Object.freeze({__proto__:null,default:function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return Gx(e,"Component");if("object"==typeof e)switch(e.$$typeof){case Yx.ForwardRef:return Jx(e,e.render,"ForwardRef");case Yx.Memo:return Jx(e,e.type,"memo");default:return}}},getFunctionName:Xx});function Zx(e,t){const n=uy({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=uy({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=e[r]||{},o=t[r];n[r]={},o&&Object.keys(o)?i&&Object.keys(i)?(n[r]=uy({},o),Object.keys(i).forEach(e=>{n[r][e]=Zx(i[e],o[e])})):n[r]=o:n[r]=i}else void 0===n[r]&&(n[r]=e[r])}),n}const ew="undefined"!=typeof window?Mg.useLayoutEffect:Mg.useEffect;var tw=Object.freeze({__proto__:null,default:function(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}});function nw(...e){return e.reduce((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function rw(e){return e&&e.ownerDocument||document}function iw(e){return rw(e).defaultView||window}function ow(e,t){"function"==typeof e?e(t):e&&(e.current=t)}let aw=0;const sw=Eg["useId".toString()];function lw(e){if(void 0!==sw){return sw()}return function(e){const[t,n]=Mg.useState(e),r=e||t;return Mg.useEffect(()=>{null==t&&(aw+=1,n(`mui-${aw}`))},[t]),r}(e)}function cw(e){const t=Mg.useRef(e);return ew(()=>{t.current=e}),Mg.useRef((...e)=>(0,t.current)(...e)).current}function uw(...e){return Mg.useMemo(()=>e.every(e=>null==e)?null:t=>{e.forEach(e=>{ow(e,t)})},e)}const dw={};const fw=[];class pw{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new pw}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}function hw(){const e=function(e,t){const n=Mg.useRef(dw);return n.current===dw&&(n.current=e(t)),n}(pw.create).current;return function(e){Mg.useEffect(e,fw)}(e.disposeEffect),e}let mw=!0,gw=!1;const yw=new pw,vw={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function bw(e){e.metaKey||e.altKey||e.ctrlKey||(mw=!0)}function xw(){mw=!1}function ww(){"hidden"===this.visibilityState&&gw&&(mw=!0)}function Sw(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(e){}return mw||function(e){const{type:t,tagName:n}=e;return!("INPUT"!==n||!vw[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function kw(){const e=Mg.useCallback(e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",bw,!0),t.addEventListener("mousedown",xw,!0),t.addEventListener("pointerdown",xw,!0),t.addEventListener("touchstart",xw,!0),t.addEventListener("visibilitychange",ww,!0))},[]),t=Mg.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!Sw(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(gw=!0,yw.start(100,()=>{gw=!1}),t.current=!1,!0)},ref:e}}function Mw(e,t,n=void 0){const r={};return Object.keys(e).forEach(i=>{r[i]=e[i].reduce((e,r)=>{if(r){const i=t(r);""!==i&&e.push(i),n&&n[r]&&e.push(n[r])}return e},[]).join(" ")}),r}function Cw(e){return"string"==typeof e}function Ew(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n}function Dw(e){if(void 0===e)return{};const t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t])).forEach(n=>{t[n]=e[n]}),t}const _w=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function qw(e){var t;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=e,a=dy(e,_w),s=o?{}:function(e,t,n){return"function"==typeof e?e(t,n):e}(r,i),{props:l,internalRef:c}=function(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const e=Lx(null==n?void 0:n.className,o,null==i?void 0:i.className,null==r?void 0:r.className),t=uy({},null==n?void 0:n.style,null==i?void 0:i.style,null==r?void 0:r.style),a=uy({},n,i,r);return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=Ew(uy({},i,r)),s=Dw(r),l=Dw(i),c=t(a),u=Lx(null==c?void 0:c.className,null==n?void 0:n.className,o,null==i?void 0:i.className,null==r?void 0:r.className),d=uy({},null==c?void 0:c.style,null==n?void 0:n.style,null==i?void 0:i.style,null==r?void 0:r.style),f=uy({},c,n,l,s);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}(uy({},a,{externalSlotProps:s})),u=function(e,t,n){return void 0===e||Cw(e)?t:uy({},t,{ownerState:uy({},t.ownerState,n)})}(n,uy({},l,{ref:uw(c,null==s?void 0:s.ref,null==(t=e.additionalProps)?void 0:t.ref)}),i);return u}function Aw(e){var t;return parseInt(Mg.version,10)>=19?(null==e||null==(t=e.props)?void 0:t.ref)||null:(null==e?void 0:e.ref)||null}const Tw=Mg.createContext(null);function Nw(){return Mg.useContext(Tw)}var Iw="function"==typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";function Ow(e){const{children:t,theme:n}=e,r=Nw(),i=Mg.useMemo(()=>{const e=null===r?n:function(e,t){if("function"==typeof t)return t(e);return uy({},e,t)}(r,n);return null!=e&&(e[Iw]=null!==r),e},[n,r]);return ub.jsx(Tw.Provider,{value:i,children:t})}const Rw=["value"],Pw=Mg.createContext();function Lw(e){let{value:t}=e,n=dy(e,Rw);return ub.jsx(Pw.Provider,uy({value:null==t||t},n))}const zw=Mg.createContext(void 0);function Fw({value:e,children:t}){return ub.jsx(zw.Provider,{value:e,children:t})}function jw({props:e,name:t}){return function(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?Zx(i.defaultProps,r):i.styleOverrides||i.variants?r:Zx(i,r)}({props:e,name:t,theme:{components:Mg.useContext(zw)}})}const Vw={};function Hw(e,t,n,r=!1){return Mg.useMemo(()=>{const i=e&&t[e]||t;if("function"==typeof n){const o=n(i),a=e?uy({},t,{[e]:o}):o;return r?()=>a:a}return uy({},t,e?{[e]:n}:n)},[e,t,n,r])}function $w(e){const{children:t,theme:n,themeId:r}=e,i=Ex(Vw),o=Nw()||Vw,a=Hw(r,i,n),s=Hw(r,o,n,!0),l="rtl"===a.direction,c=function(e){const t=Ex(),n=lw()||"",{modularCssLayers:r}=e;let i="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return i=r&&null===t?"string"==typeof r?r.replace(/mui(?!\.)/g,i):`@layer ${i};`:"",ew(()=>{const e=document.querySelector("head");if(!e)return;const t=e.firstChild;if(i){var r;if(t&&null!=(r=t.hasAttribute)&&r.call(t,"data-mui-layer-order")&&t.getAttribute("data-mui-layer-order")===n)return;const o=document.createElement("style");o.setAttribute("data-mui-layer-order",n),o.textContent=i,e.prepend(o)}else{var o;null==(o=e.querySelector(`style[data-mui-layer-order="${n}"]`))||o.remove()}},[i,n]),i?ub.jsx(Ax,{styles:i}):null}(a);return ub.jsx(Ow,{theme:s,children:ub.jsx(Bv.Provider,{value:a,children:ub.jsx(Lw,{value:l,children:ub.jsxs(Fw,{value:null==a?void 0:a.components,children:[c,t]})})})})}var Bw,Ww={},Uw={exports:{}};function Yw(){return Bw||(Bw=1,function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}(Uw)),Uw.exports}var Kw,Xw=i(ly),Gw=i(tw);function Jw(){if(Kw)return Ww;Kw=1;var e=Yw();Object.defineProperty(Ww,"__esModule",{value:!0}),Ww.alpha=u,Ww.blend=function(e,t,n,r=1){const i=(e,t)=>Math.round((e**(1/r)*(1-n)+t**(1/r)*n)**r),a=o(e),l=o(t),c=[i(a.values[0],l.values[0]),i(a.values[1],l.values[1]),i(a.values[2],l.values[2])];return s({type:"rgb",values:c})},Ww.colorChannel=void 0,Ww.darken=d,Ww.decomposeColor=o,Ww.emphasize=p,Ww.getContrastRatio=function(e,t){const n=c(e),r=c(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},Ww.getLuminance=c,Ww.hexToRgb=i,Ww.hslToRgb=l,Ww.lighten=f,Ww.private_safeAlpha=function(e,t,n){try{return u(e,t)}catch(t){return e}},Ww.private_safeColorChannel=void 0,Ww.private_safeDarken=function(e,t,n){try{return d(e,t)}catch(t){return e}},Ww.private_safeEmphasize=function(e,t,n){try{return p(e,t)}catch(t){return e}},Ww.private_safeLighten=function(e,t,n){try{return f(e,t)}catch(t){return e}},Ww.recomposeColor=s,Ww.rgbToHex=function(e){if(0===e.indexOf("#"))return e;const{values:t}=o(e);return`#${t.map((e,t)=>function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(3===t?Math.round(255*e):e)).join("")}`};var t=e(Xw),n=e(Gw);function r(e,t=0,r=1){return(0,n.default)(e,t,r)}function i(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map(e=>e+e)),n?`rgb${4===n.length?"a":""}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", ")})`:""}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(i(e));const n=e.indexOf("("),r=e.substring(0,n);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw new Error((0,t.default)(9,e));let a,s=e.substring(n+1,e.length-1);if("color"===r){if(s=s.split(" "),a=s.shift(),4===s.length&&"/"===s[3].charAt(0)&&(s[3]=s[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(a))throw new Error((0,t.default)(10,a))}else s=s.split(",");return s=s.map(e=>parseFloat(e)),{type:r,values:s,colorSpace:a}}const a=e=>{const t=o(e);return t.values.slice(0,3).map((e,n)=>-1!==t.type.indexOf("hsl")&&0!==n?`${e}%`:e).join(" ")};Ww.colorChannel=a;function s(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return-1!==t.indexOf("rgb")?r=r.map((e,t)=>t<3?parseInt(e,10):e):-1!==t.indexOf("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=-1!==t.indexOf("color")?`${n} ${r.join(" ")}`:`${r.join(", ")}`,`${t}(${r})`}function l(e){e=o(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),l=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1);let c="rgb";const u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),s({type:c,values:u})}function c(e){let t="hsl"===(e=o(e)).type||"hsla"===e.type?o(l(e)).values:e.values;return t=t.map(t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function u(e,t){return e=o(e),t=r(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,s(e)}function d(e,t){if(e=o(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return s(e)}function f(e,t){if(e=o(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return s(e)}function p(e,t=.15){return c(e)>.5?d(e,t):f(e,t)}return Ww.private_safeColorChannel=(e,t)=>{try{return a(e)}catch(t){return e}},Ww}var Qw=Jw();const Zw=["mode","contrastThreshold","tonalOffset"],eS={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Dg.white,default:Dg.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},tS={text:{primary:Dg.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Dg.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function nS(e,t,n,r){const i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=Qw.lighten(e.main,i):"dark"===t&&(e.dark=Qw.darken(e.main,o)))}function rS(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=e,i=dy(e,Zw),o=e.primary||function(e="light"){return"dark"===e?{main:jg,light:Fg,dark:Vg}:{main:Hg,light:Vg,dark:$g}}(t),a=e.secondary||function(e="light"){return"dark"===e?{main:Og,light:Ig,dark:Pg}:{main:Lg,light:Rg,dark:zg}}(t),s=e.error||function(e="light"){return"dark"===e?{main:Ag,light:_g,dark:Tg}:{main:Tg,light:qg,dark:Ng}}(t),l=e.info||function(e="light"){return"dark"===e?{main:Wg,light:Bg,dark:Yg}:{main:Yg,light:Ug,dark:Kg}}(t),c=e.success||function(e="light"){return"dark"===e?{main:Gg,light:Xg,dark:Qg}:{main:Zg,light:Jg,dark:ey}}(t),u=e.warning||function(e="light"){return"dark"===e?{main:ny,light:ty,dark:iy}:{main:"#ed6c02",light:ry,dark:oy}}(t);function d(e){return Qw.getContrastRatio(e,tS.text.primary)>=n?tS.text.primary:eS.text.primary}const f=({color:e,name:t,mainShade:n=500,lightShade:i=300,darkShade:o=700})=>{if(!(e=uy({},e)).main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty("main"))throw new Error(sy(11,t?` (${t})`:"",n));if("string"!=typeof e.main)throw new Error(sy(12,t?` (${t})`:"",JSON.stringify(e.main)));return nS(e,"light",i,r),nS(e,"dark",o,r),e.contrastText||(e.contrastText=d(e.main)),e},p={dark:tS,light:eS};return vb(uy({common:uy({},Dg),mode:t,primary:f({color:o,name:"primary"}),secondary:f({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:s,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:ay,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r},p[t]),i)}const iS=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function oS(e){return Math.round(1e5*e)/1e5}const aS={textTransform:"uppercase"},sS='"Roboto", "Helvetica", "Arial", sans-serif';function lS(e,t){const n="function"==typeof t?t(e):t,{fontFamily:r=sS,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=n,f=dy(n,iS),p=i/14,h=d||(e=>e/c*p+"rem"),m=(e,t,n,i,o)=>uy({fontFamily:r,fontWeight:e,fontSize:h(t),lineHeight:n},r===sS?{letterSpacing:`${oS(i/t)}em`}:{},o,u),g={h1:m(o,96,1.167,-1.5),h2:m(o,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(s,14,1.75,.4,aS),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,aS),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return vb(uy({htmlFontSize:c,pxToRem:h,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},g),f,{clone:!1})}function cS(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const uS=["none",cS(0,2,1,-1,0,1,1,0,0,1,3,0),cS(0,3,1,-2,0,2,2,0,0,1,5,0),cS(0,3,3,-2,0,3,4,0,0,1,8,0),cS(0,2,4,-1,0,4,5,0,0,1,10,0),cS(0,3,5,-1,0,5,8,0,0,1,14,0),cS(0,3,5,-1,0,6,10,0,0,1,18,0),cS(0,4,5,-2,0,7,10,1,0,2,16,1),cS(0,5,5,-3,0,8,10,1,0,3,14,2),cS(0,5,6,-3,0,9,12,1,0,3,16,2),cS(0,6,6,-3,0,10,14,1,0,4,18,3),cS(0,6,7,-4,0,11,15,1,0,4,20,3),cS(0,7,8,-4,0,12,17,2,0,5,22,4),cS(0,7,8,-4,0,13,19,2,0,5,24,4),cS(0,7,9,-4,0,14,21,2,0,5,26,4),cS(0,8,9,-5,0,15,22,2,0,6,28,5),cS(0,8,10,-5,0,16,24,2,0,6,30,5),cS(0,8,11,-5,0,17,26,2,0,6,32,5),cS(0,9,11,-5,0,18,28,2,0,7,34,6),cS(0,9,12,-6,0,19,29,2,0,7,36,6),cS(0,10,13,-6,0,20,31,3,0,8,38,7),cS(0,10,13,-6,0,21,33,3,0,8,40,7),cS(0,10,14,-6,0,22,35,3,0,8,42,7),cS(0,11,14,-7,0,23,36,3,0,9,44,8),cS(0,11,15,-7,0,24,38,3,0,9,46,8)],dS=["duration","easing","delay"],fS={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},pS={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function hS(e){return`${Math.round(e)}ms`}function mS(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function gS(e){const t=uy({},fS,e.easing),n=uy({},pS,e.duration);return uy({getAutoHeightDuration:mS,create:(e=["all"],r={})=>{const{duration:i=n.standard,easing:o=t.easeInOut,delay:a=0}=r;return dy(r,dS),(Array.isArray(e)?e:[e]).map(e=>`${e} ${"string"==typeof i?i:hS(i)} ${o} ${"string"==typeof a?a:hS(a)}`).join(",")}},e,{easing:t,duration:n})}const yS={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},vS=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function bS(e={},...t){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=e,a=dy(e,vS);if(e.vars&&void 0===e.generateCssVars)throw new Error(sy(18));const s=rS(r),l=Mx(e);let c=vb(l,{mixins:(u=l.breakpoints,d=n,uy({toolbar:{minHeight:56,[u.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[u.up("sm")]:{minHeight:64}}},d)),palette:s,shadows:uS.slice(),typography:lS(s,o),transitions:gS(i),zIndex:uy({},yS)});var u,d;return c=vb(c,a),c=t.reduce((e,t)=>vb(e,t),c),c.unstable_sxConfig=uy({},bx,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return wx({sx:e,theme:this})},c}const xS=bS();function wS(){const e=_x(xS);return e[cy]||e}var SS,kS={},MS={exports:{}};var CS,ES={exports:{}};var DS,_S=i(mb),qS=i(bb),AS=i(qb),TS=i(Qx),NS=i(Cx),IS=i(Ix);function OS(){if(DS)return kS;DS=1;var e=Yw();Object.defineProperty(kS,"__esModule",{value:!0}),kS.default=function(e={}){const{themeId:o,defaultTheme:s=p,rootShouldForwardProp:l=d,slotShouldForwardProp:u=d}=e,f=e=>(0,a.default)((0,t.default)({},e,{theme:m((0,t.default)({},e,{defaultTheme:s,themeId:o}))}));return f.__mui_systemSx=!0,(e,a={})=>{(0,r.internal_processStyles)(e,e=>e.filter(e=>!(null!=e&&e.__mui_systemSx)));const{name:p,slot:v,skipVariantsResolver:b,skipSx:x,overridesResolver:w=g(h(v))}=a,S=(0,n.default)(a,c),k=p&&p.startsWith("Mui")||v?"components":"custom",M=void 0!==b?b:v&&"Root"!==v&&"root"!==v||!1,C=x||!1;let E=d;"Root"===v||"root"===v?E=l:v?E=u:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(E=void 0);const D=(0,r.default)(e,(0,t.default)({shouldForwardProp:E,label:void 0},S)),_=e=>"function"==typeof e&&e.__emotion_real!==e||(0,i.isPlainObject)(e)?n=>{const r=m({theme:n.theme,defaultTheme:s,themeId:o});return y(e,(0,t.default)({},n,{theme:r}),r.modularCssLayers?k:void 0)}:e,q=(n,...r)=>{let i=_(n);const a=r?r.map(_):[];p&&w&&a.push(e=>{const n=m((0,t.default)({},e,{defaultTheme:s,themeId:o}));if(!n.components||!n.components[p]||!n.components[p].styleOverrides)return null;const r=n.components[p].styleOverrides,i={};return Object.entries(r).forEach(([r,o])=>{i[r]=y(o,(0,t.default)({},e,{theme:n}),n.modularCssLayers?"theme":void 0)}),w(e,i)}),p&&!M&&a.push(e=>{var n;const r=m((0,t.default)({},e,{defaultTheme:s,themeId:o}));return y({variants:null==r||null==(n=r.components)||null==(n=n[p])?void 0:n.variants},(0,t.default)({},e,{theme:r}),r.modularCssLayers?"theme":void 0)}),C||a.push(f);const l=a.length-r.length;if(Array.isArray(n)&&l>0){const e=new Array(l).fill("");i=[...n,...e],i.raw=[...n.raw,...e]}const c=D(i,...a);return e.muiName&&(c.muiName=e.muiName),c};return D.withConfig&&(q.withConfig=D.withConfig),q}},kS.shouldForwardProp=d,kS.systemDefaultTheme=void 0;var t=e((SS||(SS=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(MS)),MS.exports)),n=e((CS||(CS=1,function(e){e.exports=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n},e.exports.__esModule=!0,e.exports.default=e.exports}(ES)),ES.exports)),r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(_S),i=qS;e(AS),e(TS);var o=e(NS),a=e(IS);const s=["ownerState"],l=["variants"],c=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function d(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function f(e,t){return t&&e&&"object"==typeof e&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}const p=kS.systemDefaultTheme=(0,o.default)(),h=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function m({defaultTheme:e,theme:t,themeId:n}){return r=t,0===Object.keys(r).length?e:t[n]||t;var r}function g(e){return e?(t,n)=>n[e]:null}function y(e,i,o){let{ownerState:a}=i,c=(0,n.default)(i,s);const u="function"==typeof e?e((0,t.default)({ownerState:a},c)):e;if(Array.isArray(u))return u.flatMap(e=>y(e,(0,t.default)({ownerState:a},c),o));if(u&&"object"==typeof u&&Array.isArray(u.variants)){const{variants:e=[]}=u;let i=(0,n.default)(u,l);return e.forEach(e=>{let n=!0;if("function"==typeof e.props?n=e.props((0,t.default)({ownerState:a},c,a)):Object.keys(e.props).forEach(t=>{(null==a?void 0:a[t])!==e.props[t]&&c[t]!==e.props[t]&&(n=!1)}),n){Array.isArray(i)||(i=[i]);const n="function"==typeof e.style?e.style((0,t.default)({ownerState:a},c,a)):e.style;i.push(o?f((0,r.internal_serializeStyles)(n),o):n)}}),i}return o?f((0,r.internal_serializeStyles)(u),o):u}return kS}const RS=e=>function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}(e)&&"classes"!==e,PS=r(OS())({themeId:cy,defaultTheme:xS,rootShouldForwardProp:RS}),LS=["theme"];function zS(e){let{theme:t}=e,n=dy(e,LS);const r=t[cy];let i=r||t;return"function"!=typeof t&&(r&&!r.vars?i=uy({},r,{vars:null}):t&&!t.vars&&(i=uy({},t,{vars:null}))),ub.jsx($w,uy({},n,{themeId:r?cy:void 0,theme:i}))}const FS=e=>{let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,(t/100).toFixed(2)};function jS(e){return jw(e)}function VS(e){return Fx("MuiSvgIcon",e)}jx("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const HS=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],$S=PS("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${_b(n.color)}`],t[`fontSize${_b(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,i,o,a,s,l,c,u,d,f,p,h;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(n=e.transitions)||null==(r=n.create)?void 0:r.call(n,"fill",{duration:null==(i=e.transitions)||null==(i=i.duration)?void 0:i.shorter}),fontSize:{inherit:"inherit",small:(null==(o=e.typography)||null==(a=o.pxToRem)?void 0:a.call(o,20))||"1.25rem",medium:(null==(s=e.typography)||null==(l=s.pxToRem)?void 0:l.call(s,24))||"1.5rem",large:(null==(c=e.typography)||null==(u=c.pxToRem)?void 0:u.call(c,35))||"2.1875rem"}[t.fontSize],color:null!=(d=null==(f=(e.vars||e).palette)||null==(f=f[t.color])?void 0:f.main)?d:{action:null==(p=(e.vars||e).palette)||null==(p=p.action)?void 0:p.active,disabled:null==(h=(e.vars||e).palette)||null==(h=h.action)?void 0:h.disabled,inherit:void 0}[t.color]}}),BS=Mg.forwardRef(function(e,t){const n=jS({props:e,name:"MuiSvgIcon"}),{children:r,className:i,color:o="inherit",component:a="svg",fontSize:s="medium",htmlColor:l,inheritViewBox:c=!1,titleAccess:u,viewBox:d="0 0 24 24"}=n,f=dy(n,HS),p=Mg.isValidElement(r)&&"svg"===r.type,h=uy({},n,{color:o,component:a,fontSize:s,instanceFontSize:e.fontSize,inheritViewBox:c,viewBox:d,hasSvgAsChild:p}),m={};c||(m.viewBox=d);const g=(e=>{const{color:t,fontSize:n,classes:r}=e;return Mw({root:["root","inherit"!==t&&`color${_b(t)}`,`fontSize${_b(n)}`]},VS,r)})(h);return ub.jsxs($S,uy({as:a,className:Lx(g.root,i),focusable:"false",color:l,"aria-hidden":!u||void 0,role:u?"img":void 0,ref:t},m,f,p&&r.props,{ownerState:h,children:[p?r.props.children:r,u?ub.jsx("title",{children:u}):null]}))});function WS(e,t){return WS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},WS(e,t)}function US(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,WS(e,t)}BS.muiName="SvgIcon";var YS,KS,XS,GS,JS={exports:{}},QS={},ZS={exports:{}},ek={};function tk(){return KS||(KS=1,ZS.exports=(YS||(YS=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>i(l,n))c<o&&0>i(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<o&&0>i(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,p=!1,h=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))break;r(c),i.sortIndex=i.expirationTime,t(l,i)}i=n(c)}}function x(e){if(m=!1,b(e),!h)if(null!==n(l))h=!0,N(w);else{var t=n(c);null!==t&&I(x,t.startTime-e)}}function w(t,i){h=!1,m&&(m=!1,y(C),C=-1),p=!0;var o=f;try{for(b(i),d=n(l);null!==d&&(!(d.expirationTime>i)||t&&!_());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var s=a(d.expirationTime<=i);i=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),b(i)}else r(l);d=n(l)}if(null!==d)var u=!0;else{var g=n(c);null!==g&&I(x,g.startTime-i),u=!1}return u}finally{d=null,f=o,p=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var S,k=!1,M=null,C=-1,E=5,D=-1;function _(){return!(e.unstable_now()-D<E)}function q(){if(null!==M){var t=e.unstable_now();D=t;var n=!0;try{n=M(!0,t)}finally{n?S():(k=!1,M=null)}}else k=!1}if("function"==typeof v)S=function(){v(q)};else if("undefined"!=typeof MessageChannel){var A=new MessageChannel,T=A.port2;A.port1.onmessage=q,S=function(){T.postMessage(null)}}else S=function(){g(q,0)};function N(e){M=e,k||(k=!0,S())}function I(t,n){C=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||p||(h=!0,N(w))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:u++,callback:i,priorityLevel:r,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>a?(r.sortIndex=o,t(c,r),null===n(l)&&r===n(c)&&(m?(y(C),C=-1):m=!0,I(x,o-a))):(r.sortIndex=s,t(l,r),h||p||(h=!0,N(w))),r},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(ek)),ek)),ZS.exports}
22
22
  /**
23
23
  * @license React
24
24
  * react-dom.production.min.js
@@ -106,4 +106,4 @@ var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toS
106
106
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
107
107
  var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return r_(c,"_invoke",function(n,r,i){var o,s,l,c=0,u=i||[],d=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,s=0,l=e,f.n=n,a}};function p(n,r){for(s=n,l=r,t=0;!d&&c&&!i&&t<u.length;t++){var i,o=u[t],p=f.p,h=o[2];n>3?(i=h===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((i=n<2&&p<o[1])?(s=0,f.v=r,f.n=o[1]):p<h&&(i=n<3||o[0]>r||r>h)&&(o[4]=n,o[5]=r,f.n=h,s=0))}if(i||n>1)return a;throw d=!0,r}return function(i,u,h){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,h),s=u,l=h;(t=s<2?e:l)||!d;){o||(s?s<3?(s>1&&(f.n=-1),p(s,l)):f.n=l:f.v=l);try{if(c=2,o){if(s||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),s=1);o=e}else if((t=(d=f.n<0)?l:n.call(r,f))!==a)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,i,o),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(r_(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,r_(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,r_(d,"constructor",c),r_(c,"constructor",l),l.displayName="GeneratorFunction",r_(c,i,"GeneratorFunction"),r_(d),r_(d,i,"Generator"),r_(d,r,function(){return this}),r_(d,"toString",function(){return"[object Generator]"}),(n_=function(){return{w:o,m:f}})()}function r_(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}r_=function(e,t,n,r){function o(t,n){r_(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},r_(e,t,n,r)}function i_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||s_(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o_(e){return function(e){if(Array.isArray(e))return XD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a_(e){return a_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a_(e)}function s_(e,t){if(e){if("string"==typeof e)return XD(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XD(e,t):void 0}}var l_,c_="top",u_="top-right",d_="right",f_="bottom-right",p_="bottom",h_="bottom-left",m_="left",g_="top-left";QD(QD(QD(QD(QD(QD(QD(QD(QD(QD(l_={},"equal-equal",[c_,p_]),"equal-higher",[p_,f_]),"equal-lower",[c_,u_]),"equal-void",[c_,p_]),"higher-equal",[m_,h_,c_,u_]),"higher-higher-acute",[p_,h_,m_,u_]),"higher-higher-obtuse",[p_,c_]),"higher-lower-negative",[c_,u_,d_]),"higher-lower-positive",[p_,h_,m_]),"higher-void",[c_]),QD(QD(QD(QD(QD(QD(QD(QD(QD(QD(l_,"lower-equal",[c_]),"lower-higher-negative",[c_,g_]),"lower-higher-positive",[f_]),"lower-lower-acute",[c_,g_,m_,u_,d_]),"lower-lower-obtuse",[c_,p_]),"lower-void",[c_]),"void-equal",[c_]),"void-higher",[c_,p_]),"void-lower",[c_,p_,m_]),"void-void",[c_]),QD(l_,"unclassified",[c_,p_,d_,m_,u_,f_,h_,g_]);var y_=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],v_=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var b_=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function x_(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,o_(new Set([r].concat(o_(a.map(function(e){return e.split(",").map(function(e){return e.trim()}).map(function(e){return e.replace(/\s+/g," ").trim()}).filter(Boolean).join(", ")})))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(o_(o.map(function(e){return b_(e)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],o_(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?v_:y_}(i).map(function(e){return b_(e)})))}function w_(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return x_({theme:t,translator:n,defaultValue:a(),flags:o})}}}var S_=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],k_=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function M_(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,o_(new Set([n].concat(o_(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(o_(r.map(function(e){return k_(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],o_(S_.map(function(e){return k_(e)})))}({theme:t,translator:n,defaultValue:o()})}}}function C_(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:w_({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:M_({theme:t,translator:n,id:r,path:i})}}var E_,D_,__=["__proto__","constructor"],q_=function(e){if(__.some(function(t){return e.includes(t)}))throw new Error("font-resolver: Forbidden property.")};function A_(e){return T_.apply(this,arguments)}function T_(){return(T_=JD(n_().m(function e(t){var n,r,i,o;return n_().w(function(e){for(;;)switch(e.n){case 0:if(n=t.app,r=t.items,n.evaluateEx){e.n=1;break}return e.a(2,r);case 1:return e.n=2,Promise.all(r.filter(function(e){var t;return!(null===(t=e.qCalcCondition)||void 0===t||null===(t=t.qCond)||void 0===t||!t.qv)}).map(function(e){var t=e.qCalcCondition.qCond.qv;return n.evaluateEx(t).then(function(t){return 0===t.qNumber?e.qDef.cId:void 0}).catch(function(){return e.qDef.cId})}));case 2:return i=e.v,o=i.filter(Boolean),e.a(2,r.filter(function(e){return!o.includes(e.qDef.cId)}))}},e)}))).apply(this,arguments)}function N_(e){var t=e.app,n=e.translator,r=e.dimension,i={id:r.qDef.cId,text:n.get("Object.ErrorMessage.MissingDimension"),meta:{}},o=r.qLibraryId;if(o)return t.getDimension?t.getDimension(o).then(function(e){return e.getLayout()}).catch(function(){}).then(function(e){if(!e)return i;var t=e.qDim,n=t.qGrouping,o=t.qLabelExpression,a="C"===n,s="H"===n,l="N"===n;return{id:r.qDef.cId,text:o&&l?o:e.qDim.title,meta:{isCyclic:a,isDrillDown:s,isNormal:l}}}):i;var a=r.qDef,s=a.cId,l=a.qLabelExpression,c=a.qFieldLabels,u=a.qFieldDefs,d={isCyclic:!1,isDrillDown:!1,isNormal:!0};return l?t.evaluate?t.evaluate(l).then(function(e){return{id:s,text:e,meta:d}}):i:{id:s,text:c[0]||u[0],meta:d}}function I_(e){return O_.apply(this,arguments)}function O_(){return(O_=JD(n_().m(function e(t){var n,r,i,o,a,s,l,c;return n_().w(function(e){for(;;)switch(e.n){case 0:if(r=t.app,i=t.translator,o=t.properties,a=(null==o||null===(n=o.qHyperCubeDef)||void 0===n||null===(n=n.qLayoutExclude)||void 0===n?void 0:n.qHyperCubeDef)||{},s=a.qDimensions,(l=void 0===s?[]:s).length){e.n=1;break}return e.a(2,Promise.resolve([]));case 1:return e.n=2,A_({app:r,items:l});case 2:return c=e.v,e.a(2,Promise.all(c.map(function(e){return N_({app:r,translator:i,dimension:e})})))}},e)}))).apply(this,arguments)}function R_(e){var t=e.app,n=e.translator,r=e.measure,i={id:r.qDef.cId,text:n.get("Object.ErrorMessage.MissingMeasure")},o=r.qLibraryId;if(o)return t.getMeasure?t.getMeasure(o).then(function(e){return e.getLayout()}).catch(function(){}).then(function(e){if(!e)return i;var t=e.qMeasure.qLabelExpression;return{id:r.qDef.cId,text:t||e.qMeasure.qLabel||e.qMeasure.qDef}}):i;var a=r.qDef,s=a.cId,l=a.qLabelExpression,c=a.qLabel,u=a.qDef;return l?t.evaluate?t.evaluate(l).then(function(e){return{id:s,text:e}}):i:{id:s,text:c||u}}function P_(e){return L_.apply(this,arguments)}function L_(){return(L_=JD(n_().m(function e(t){var n,r,i,o,a,s,l,c;return n_().w(function(e){for(;;)switch(e.n){case 0:if(r=t.app,i=t.translator,o=t.properties,a=(null==o||null===(n=o.qHyperCubeDef)||void 0===n||null===(n=n.qLayoutExclude)||void 0===n?void 0:n.qHyperCubeDef)||{},s=a.qMeasures,(l=void 0===s?[]:s).length){e.n=1;break}return e.a(2,Promise.resolve([]));case 1:return e.n=2,A_({app:r,items:l});case 2:return c=e.v,e.a(2,Promise.all(c.map(function(e){return R_({app:r,translator:i,measure:e})})))}},e)}))).apply(this,arguments)}var z_=function(){if(D_)return E_;D_=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return E_=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(h&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(h,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},E_}(),F_=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(z_);function j_(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map(function(e){return i[e.value%i.length]})},valueAccessor:e.value}}function V_(e,t){return{range:function(e){var n=e.resources,r=e.data,i=n.theme.palette("categorical",0===t?r.items.length:t);return r.items.map(function(e){return i[e.row.value%i.length]})},valueAccessor:e.value}}function H_(e,t,n,r,i){var o,a,s=i.byRow,l=i.byElemNo;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>((null===(a=(o=e.hc).qDataPages[0]||o.qStackedDataPages[0])||void 0===a?void 0:a.qArea.qHeight)||0)))return l(r,r.raw().qCardinal);if(r){var c=t.pic.extract({field:r.key(),trackBy:r.value}).length;return s(r,c)}return{}}function $_(e,t){var n=e.hc.qDimensionInfo,r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){var i=n[r.activeDimensionIndex];r=i.coloring&&i.coloring.colorMapRef?{type:"libraryItem",key:i.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function B_(e,t){var n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter(function(e){return"dimension"===e.type()})[t.activeDimensionIndex]:"libraryItem"===t.type?!1===(n=t.key?e.pic.field(function(e){return e.raw().colorMapRef===t.key}):void 0)&&(n=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})):"expression"===t.type&&(n=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})),n}function W_(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function U_(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Y_(){}var K_=1/.7,X_="\\s*([+-]?\\d+)\\s*",G_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",J_="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Q_=/^#([0-9a-f]{3,8})$/,Z_=new RegExp(`^rgb\\(${X_},${X_},${X_}\\)$`),eq=new RegExp(`^rgb\\(${J_},${J_},${J_}\\)$`),tq=new RegExp(`^rgba\\(${X_},${X_},${X_},${G_}\\)$`),nq=new RegExp(`^rgba\\(${J_},${J_},${J_},${G_}\\)$`),rq=new RegExp(`^hsl\\(${G_},${J_},${J_}\\)$`),iq=new RegExp(`^hsla\\(${G_},${J_},${J_},${G_}\\)$`),oq={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function aq(){return this.rgb().formatHex()}function sq(){return this.rgb().formatRgb()}function lq(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Q_.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?cq(t):3===n?new pq(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?uq(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?uq(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Z_.exec(e))?new pq(t[1],t[2],t[3],1):(t=eq.exec(e))?new pq(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=tq.exec(e))?uq(t[1],t[2],t[3],t[4]):(t=nq.exec(e))?uq(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=rq.exec(e))?bq(t[1],t[2]/100,t[3]/100,1):(t=iq.exec(e))?bq(t[1],t[2]/100,t[3]/100,t[4]):oq.hasOwnProperty(e)?cq(oq[e]):"transparent"===e?new pq(NaN,NaN,NaN,0):null}function cq(e){return new pq(e>>16&255,e>>8&255,255&e,1)}function uq(e,t,n,r){return r<=0&&(e=t=n=NaN),new pq(e,t,n,r)}function dq(e){return e instanceof Y_||(e=lq(e)),e?new pq((e=e.rgb()).r,e.g,e.b,e.opacity):new pq}function fq(e,t,n,r){return 1===arguments.length?dq(e):new pq(e,t,n,null==r?1:r)}function pq(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function hq(){return`#${vq(this.r)}${vq(this.g)}${vq(this.b)}`}function mq(){const e=gq(this.opacity);return`${1===e?"rgb(":"rgba("}${yq(this.r)}, ${yq(this.g)}, ${yq(this.b)}${1===e?")":`, ${e})`}`}function gq(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yq(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vq(e){return((e=yq(e))<16?"0":"")+e.toString(16)}function bq(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new wq(e,t,n,r)}function xq(e){if(e instanceof wq)return new wq(e.h,e.s,e.l,e.opacity);if(e instanceof Y_||(e=lq(e)),!e)return new wq;if(e instanceof wq)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new wq(a,s,l,e.opacity)}function wq(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Sq(e){return(e=(e||0)%360)<0?e+360:e}function kq(e){return Math.max(0,Math.min(1,e||0))}function Mq(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}W_(Y_,lq,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:aq,formatHex:aq,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return xq(this).formatHsl()},formatRgb:sq,toString:sq}),W_(pq,fq,U_(Y_,{brighter(e){return e=null==e?K_:Math.pow(K_,e),new pq(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new pq(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new pq(yq(this.r),yq(this.g),yq(this.b),gq(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:hq,formatHex:hq,formatHex8:function(){return`#${vq(this.r)}${vq(this.g)}${vq(this.b)}${vq(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:mq,toString:mq})),W_(wq,function(e,t,n,r){return 1===arguments.length?xq(e):new wq(e,t,n,null==r?1:r)},U_(Y_,{brighter(e){return e=null==e?K_:Math.pow(K_,e),new wq(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new wq(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new pq(Mq(e>=240?e-240:e+120,i,r),Mq(e,i,r),Mq(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new wq(Sq(this.h),kq(this.s),kq(this.l),gq(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=gq(this.opacity);return`${1===e?"hsl(":"hsla("}${Sq(this.h)}, ${100*kq(this.s)}%, ${100*kq(this.l)}%${1===e?")":`, ${e})`}`}}));const Cq=Math.PI/180,Eq=180/Math.PI,Dq=4/29,_q=6/29,qq=3*_q*_q;function Aq(e){if(e instanceof Tq)return new Tq(e.l,e.a,e.b,e.opacity);if(e instanceof Pq)return Lq(e);e instanceof pq||(e=dq(e));var t,n,r=Rq(e.r),i=Rq(e.g),o=Rq(e.b),a=Nq((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Nq((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Nq((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Tq(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Tq(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Nq(e){return e>.008856451679035631?Math.pow(e,1/3):e/qq+Dq}function Iq(e){return e>_q?e*e*e:qq*(e-Dq)}function Oq(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Rq(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Pq(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Lq(e){if(isNaN(e.h))return new Tq(e.l,0,0,e.opacity);var t=e.h*Cq;return new Tq(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}W_(Tq,function(e,t,n,r){return 1===arguments.length?Aq(e):new Tq(e,t,n,null==r?1:r)},U_(Y_,{brighter(e){return new Tq(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Tq(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,n=isNaN(this.b)?e:e-this.b/200;return new pq(Oq(3.1338561*(t=.96422*Iq(t))-1.6168667*(e=1*Iq(e))-.4906146*(n=.82521*Iq(n))),Oq(-.9787684*t+1.9161415*e+.033454*n),Oq(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),W_(Pq,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Pq)return new Pq(e.h,e.c,e.l,e.opacity);if(e instanceof Tq||(e=Aq(e)),0===e.a&&0===e.b)return new Pq(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Eq;return new Pq(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Pq(e,t,n,null==r?1:r)},U_(Y_,{brighter(e){return new Pq(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Pq(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Lq(this).rgb()}}));var zq=e=>()=>e;function Fq(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):zq(isNaN(e)?t:e)}var jq=function e(t){var n=function(e){return 1==(e=+e)?Fq:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):zq(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=fq(e)).r,(t=fq(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Fq(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Vq=/^class(-pyramid)?/,Hq=function(e,t,n,r){var i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max(),a=i,s=o,l=t.limits,c={},u="percent"===t.limitType?l.map(function(e){return i+(o-i)*e}):l,d=t.colors.map(function(t){return e.resolveUIColor(t)});if(i=Math.min.apply(Math,[i].concat(o_(u))),o=Math.max.apply(Math,[o].concat(o_(u))),c.min=i,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,function(e){var t=e.min,n=e.max,r=e.limits,i=e.range,o=[],a=[];if(r.length)if(r[r.length-1]<t)a.push(t,n),o.push(i[i.length-1],i[i.length-1],i[i.length-1]);else if(r[0]>n)a.push(t,n),o.push(i[0],i[0],i[0]);else{if(r[0]>t)a.push(t),o.push(i[0]);else{a.push(t);for(var s=0;s<r.length;s++)if(t<r[s]){o.push(i[s]);break}}for(var l=0;l<r.length;l++)t<r[l]&&r[l]<n&&(a.push(r[l]),o.push(i[l]));if(r[r.length-1]<n)a.push(n),o.push(i[r.length]),o.push(i[r.length]);else{a.push(n);for(var c=0;c<r.length;c++)if(r[c]>n){o.push(i[c]),o.push(i[c]);break}}}else o.push(i[0]);return{min:t,max:n,range:o,domain:a}}({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){var f=t.breakTypes;c.type="continuous",c.domain=[i],c.range=[d[0]];for(var p=0;p<u.length;p+=1)if(f[p]){var h=d[p],m=d[p+1],g=jq(h,m)(.5);c.range.push(g),c.domain.push(u[p]),p<u.length-1&&f[p+1]&&(c.range.push(d[p+1]),c.domain.push((u[p]+u[p+1])/2))}else c.range.push(d[p]),c.range.push(d[p+1]),c.domain.push(u[p]),c.domain.push(u[p]+Math.min(1e-6,(o-i)/1e6));c.range.push(d[d.length-1]),c.domain.push(o)}else c.domain=u,c.range=d;return c};function $q(e,t,n,r,i){var o,a,s,l=0,c=[],u=(e-t)/(r+1);if(0===u)return 1;for(o=0;o<n.length;o+=1)a=.99*(n[o]-t),s=n[o]>e?Math.floor(e/u):n[o]<t?0:Math.floor(a/u),Number.isNaN(s)||(c[s]?c[s]+=1:c[s]=1);for(o=0;o<c.length;o+=1)c[o]&&(l+=1);return l<=r||l>=i?Math.max(l,r):$q(e,t,n,r+1,i)}var Bq=function(e,t,n,r){var i,o,a=t.theme,s=t.hc,l=r.f,c={mode:"field",fieldType:"measure",field:l?l.key():void 0,reverse:n.input.reverseScheme||!1,type:"continuous",range:function(e){return e.resources.theme.palette("quant")}},u=[],d=!0;if(l){if(Number.isNaN(+l.min())||Number.isNaN(+l.max()))return{invalid:!0};(d=!("S"===(i=n.pic.raw()).qMode&&(i.qDataPages[0]&&i.qSize.qcy>i.qDataPages[0].qArea.qHeight||!i.qDataPages.length&&i.qSize.qcy>0)||"K"===i.qMode&&i.qStackedDataPages[0]&&i.qSize.qcy>i.qStackedDataPages[0].qArea.qHeight||"T"===i.qMode&&i.qSize.qcy>i.qTreeDataPages[0].qGroupSize))&&(u=n.pic.extract({field:0,props:{num:{field:l.key()},exclude:{fields:s.qDimensionInfo.map(function(e,t){return{field:"qDimensionInfo/".concat(t)}}),value:function(e){return Math.min.apply(Math,o_(e))<0}}}}).filter(function(e){return e.value>=0&&!e.exclude.value}).map(function(e){return e.num.value}).filter(function(e){return"number"==typeof e}))}if(!1===n.input.autoMinMax){if(c.min=n.input.measureMin,c.max=n.input.measureMax,c.max<c.min)return{invalid:!0}}else if(l&&!d)c.min=l.min(),c.max=l.max();else if(l){if(!u.length)return{invalid:!0};c.min=Math.min.apply(Math,o_(u)),c.max=Math.max.apply(Math,o_(u))}if(n.input.measureScheme&&(c.palettes={quant:n.input.measureScheme}),a){var f=a.getDataColorScales().filter(function(e){return e.key===n.input.measureScheme})[0];c.type=f&&Vq.test(f.type)?"categorical":"continuous","categorical"===c.type&&(o=f.colors.some(function(e){return Array.isArray(e)})?Math.max.apply(Math,o_(f.colors.map(function(e){return e?e.length:0}))):f.colors.length)}if("categorical"===c.type){for(var p=d?$q(c.max,c.min,u,1,o):o,h=(c.max-c.min)/p,m=[],g=0;g<p+1;g+=1)m.push(c.min+h*g);c.domain=m,c.range=function(e){for(var t=e.resources.theme.palette("quant",p),n=Math.max(1,Math.floor(t.length/p)),r=[],i=0;i<p;i+=1)r.push(t[i*n]);return[r[0]].concat(r,[r[r.length-1]])}}return c};function Wq(e,t){var n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter(function(e){return"measure"===e.type()})[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field(function(e){return e.raw().colorMapRef===t.key&&void 0!==t.key}):"expression"===t.type&&(n=e.pic.field(function(e){return"colorByAlternative"===e.raw().id})),n||(n=e.pic.field(function(e){return void 0!==e.raw().matchMeasure}))&&(n=e.pic.fields().filter(function(e){return"measure"===e.type()})[n.raw().matchMeasure]),n}function Uq(e){e.measureOverrides.every(function(e){return!e})&&(e.measureOverrides=null)}function Yq(e,t){for(var n=(null==t?void 0:t.domain)||[],r=(null==t?void 0:t.range)||[],i=[],o=0;o<e.length;++o){var a=e[o];if("constant"===(null==a?void 0:a.mode)){var s=n.indexOf(o);-1===s?(n.push(o),r.push(a.primary)):r[s]=a.primary,e[o]=null}else if(a){i.push(o);var l=n.indexOf(o);-1!==l&&(n.splice(l,1),r.splice(l,1))}}return{domain:n,range:r,exclude:i}}function Kq(e,t,n,r){var i,o=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,t,n){var r=t.theme,i=t.hc,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).getCField,a=void 0===o?Wq:o,s=n.input.byMeasureDef||{activeMeasureIndex:0},l=a(n,s),c=Bq(0,{theme:r,hc:i},n,{f:l});if(c.invalid)return c;"expression"===s.type&&(s.activeMeasureIndex<0||void 0===s.activeMeasureIndex)&&(c.label=s.label,l&&"color.altLabel"===l.raw().labelExpRef&&(c.label=n.input.altLabel)),!c.label&&l&&(c.label=l.title());var u=s.activeMeasureIndex>=0?l:null;if(!u&&l&&void 0!==l.raw().matchMeasure&&l.raw().matchMeasure>-1&&(u=n.pic.fields().filter(function(e){return"measure"===e.type()})[l.raw().matchMeasure]),n.input.useMeasureGradient&&"libraryItem"===s.type)if(u){var d=u.raw().coloring;d&&d.gradient&&F_(c,Hq(e,d.gradient,c,u))}else c.auxiliary=s;return c}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.getCDef,o=void 0===i?$_:i,a=r.getCByField,s=void 0===a?B_:a,l=r.getPersistence,c=void 0===l?H_:l,u=o(t,n),d=s(n,u),f=d?d.raw():{},p=n&&n.pic?n.pic.raw():{};if(f.qError||f.qSize&&0===f.qSize.qcy&&!p.qHasOtherValues)return{invalid:!0};var h={mode:"field",fieldType:"dimension",type:"categorical",field:d?d.key():void 0,isFieldLocked:f.qLocked};return("expression"===u.type||u.activeDimensionIndex<0)&&(h.label=u.label,"color.altLabel"===f.labelExpRef&&(h.label=n.input.altLabel)),!h.label&&d&&(h.label=d.title()),n.input.dimensionScheme&&(h.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===u.type&&(h.auxiliary=u),F_(h,c(t,n,u,d,{byRow:V_,byElemNo:j_})),h}(e,n,t);if("byExpression"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.pic.field(function(e){return"colorByExpression"===e.raw().id});if(!s||!s.raw().qFallbackTitle&&!n.input.colorExpression||!(Number.isFinite(s.raw().qMin)&&Number.isFinite(s.raw().qMax)||n.input.expressionIsColor))return{mode:"constant",type:"constant",primary:r.nil};if(n.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:s?s.key():void 0,type:"color"};var l=Bq(0,{hc:i,theme:o},n,{f:s});return l.invalid||(l.label=n.input.expressionLabel||a.get("Object.ChartTooltip.ColorExpression")),l}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,t,n,r){var i=t.hc,o=t.theme,a=t.translator,s=n.input.useBaseColors;if(("byMultiple"===n.input.mode||"primary"===n.input.mode&&"measure"===n.input.useBaseColors)&&i.qMeasureInfo.length>1&&(s="measure"),"measure"===s){var l=[],c=[];"measure"===n.input.useBaseColors&&i.qMeasureInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){l.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?c.push(r.primary):c.push(i)}});var u=n.input.dimensionScheme?{categorical:n.input.dimensionScheme}:void 0,d=o?o.getDataColorPalettes()[0]:void 0;return"measure"===n.input.useBaseColors&&d&&(u={categorical:d.key}),{mode:"measure",type:"categorical",palettes:u,label:a?a.get("Common.Measures"):void 0,explicit:l.length?{domain:l,range:c}:void 0}}if("dimension"===s){var f=[],p=[];return i.qDimensionInfo.forEach(function(t,n){if(t.baseColor||t.coloring&&t.coloring.baseColor){f.push(n);var i=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===i?p.push(r.primary):p.push(i)}}),{mode:"dimension",type:"categorical",field:f.length?f[0]:void 0,explicit:f.length?{domain:f,range:p}:void 0}}var h=r.primary;if(void 0!==n.input.paletteColor)n.input.paletteColor&&(h=e.resolveUIColor(n.input.paletteColor));else{var m=n.input.singleColor;"number"!=typeof m||Number.isNaN(m)||(h=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][m])}return{mode:"constant",type:"constant",primary:h}}(e,n,t,r)}return{}}(e,t,n,r);return null!==(i=t.input)&&void 0!==i&&i.measureOverrides?(o.measureOverrides=t.input.measureOverrides.map(function(n,i){return function(e){var t,n=e.cm,r=e.defaults,i=e.index,o=e.input,a=e.pic;if(!o||!o.on)return null;var s=null!==(t=o.mode)&&void 0!==t?t:"primary";return"primary"===s?function(e,t,n){var r=n.primary;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),e_(e_({},n),{},{mode:"constant",type:"constant",primary:r})}(n,o,r):"byExpression"===s?function(e,t,n){var r="qMeasureInfo/".concat(e,"/"),i=t.field(function(e){return e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id}),o=i;return e_(e_({},n),{},o?{mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{mode:"constant",type:"constant",primary:n.nil})}(i,a,r):null}({cm:e,input:n,defaults:r,index:i,pic:t.pic})}),function(e,t){var n,r,i,o=t.translator;if(Uq(e),1===(null===(n=e.measureOverrides)||void 0===n?void 0:n.length))return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Yq(e.measureOverrides,e.explicit),Uq(e)),null!==(r=e.measureOverrides)&&void 0!==r&&r.every(function(e){return"constant"===(null==e?void 0:e.mode)})){var a={mode:"measure",type:"categorical",label:null==o?void 0:o.get("Common.Measures")};return a.explicit=Yq(e.measureOverrides),a}return null!==(i=e.measureOverrides)&&void 0!==i&&i.every(function(e){return e})?{invalid:!0,measureOverrides:e.measureOverrides}:e}(o,n)):o}var Xq=function(e,t){var n=e.fieldType,r={};if(t)if("measure"===n){var i=t.coloring;i&&(r.measureGradient=i.gradient)}else if("dimension"===n){var o=t[0],a=t[1];o&&(r.legendDataPage=o),a&&(r.dimValsData=a.colorMap)}return r},Gq=function(e){throw e.isHandled=!0,e};function Jq(e){return function(t){return"object"===a_(t.datum[e])?t.datum[e].value:void 0}}function Qq(e){return"object"===a_(e.datum.isNull)?e.datum.isNull.value:-2===e.datum.value}function Zq(e){return-3===e.datum.value}var eA={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},tA={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"};function nA(e){var t=e.theme,n=e.key,r=e.styleOverrides,i={title:{color:eA.COLOR,fontSize:eA.FONT_SIZE,fontFamily:eA.FONT_FAMILY},label:{color:tA.COLOR,fontSize:tA.FONT_SIZE,fontFamily:tA.FONT_FAMILY}};if(!t&&!r)return i;var o=r||{},a=o.title,s=o.label,l=function(e){var t=e.theme,n=e.key;return function(e,r,i,o){return void 0!==e?e:t?t.getStyle(n,r,i):o}}({theme:t,key:n});return i.title.color=l(null==a?void 0:a.color,"legend.title","color",eA.COLOR),i.title.fontSize=l(null==a?void 0:a.fontSize,"legend.title","fontSize",eA.FONT_SIZE),i.title.fontFamily=l(null==a?void 0:a.fontFamily,"legend.title","fontFamily",eA.FONT_FAMILY),i.label.color=l(null==s?void 0:s.color,"legend.label","color",tA.COLOR),i.label.fontSize=l(null==s?void 0:s.fontSize,"legend.label","fontSize",tA.FONT_SIZE),i.label.fontFamily=l(null==s?void 0:s.fontFamily,"legend.label","fontFamily",tA.FONT_FAMILY),i}var rA=function(e,t,n){var r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){var i=t.element.getBoundingClientRect();if(i.height>i.width)return"bottom"}return n?"left":"right"},iA=function(e,t,n){return!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show)};function oA(e,t){var n=e.styleReference,r=e.styleOverrides,i=e.chart,o=e.rtl,a=t.legendProps,s=t.coloring,l=t.theme,c=t.hc,u=nA({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:rA(a,i,o)},show:"function"==typeof a.show?function(){return iA(a,c,s)}:iA(a,c,s),renderer:"svg",mounted:function(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}function aA(e,t,n){var r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){var r=oA(e,t);if(!r.show)return!1;var i,o=e.key,a=e.styleReference,s=e.styleOverrides,l=e.viewState,c=e.rtl,u=e.settings,d=e.style,f=t.scaleKey,p=t.theme,h=t.scales,m=nA({theme:p,key:a,styleOverrides:s}),g=r.layout.dock,y="left"===g||"right"===g?{maxLines:2,wordBreak:"break-word"}:{},v={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};"dimension"===t.coloring.fieldType&&(i=function(e){return e.datum.value>=0||-3===e.datum.value});var b="".concat(f,"Legend");return F_(!0,r,{type:"legend-cat",key:"".concat(o,"-cat"),scale:b in h?b:f,settings:{layout:{scrollOffset:function(){return l?l.get("legendScrollOffset"):void 0},size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:c?"rtl":"ltr",horizontal:20},item:{show:i,label:e_({fill:m.label.color,fontSize:m.label.fontSize,fontFamily:m.label.fontFamily},y)},navigation:{disabled:n,button:{content:function(e,t){var n=t.direction;return e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:v[n]})])])}}}},brush:{consume:[{context:"selection",data:["",o],style:{inactive:{opacity:.3}}}]}},{settings:u,style:d})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){var n,r=e.key,i=e.styleReference,o=e.styleOverrides,a=e.rtl,s=e.settings,l=e.style,c=t.scaleKey,u=t.theme,d="".concat(c,"Range"),f=oA(e,t);if(!f.show)return!1;var p=nA({theme:u,key:i,styleOverrides:o}),h=f.layout.dock,m="right"===h||"left"===h,g=null===(n=t.scales)||void 0===n?void 0:n[d];return m&&g&&(g.invert=!0),F_(!0,f,{type:"legend-seq",key:"".concat(r,"-seq"),settings:{fill:c,major:d,length:1,tick:{fill:p.label.color,fontSize:p.label.fontSize,fontFamily:p.label.fontFamily},title:{anchor:!a||"top"!==f.layout.dock&&"bottom"!==f.layout.dock?void 0:"right",padding:parseFloat(f.settings.title.fontSize)||16}}},{settings:s,style:l})}(e,t)}(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(function(e){var t=e.key,n=e.requireFailure,r=e.recognizeWith,i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:tap-".concat(t),type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"legendtap",interval:10,pointers:1,enable:function(e,n){var r;if(!n)return!0;if(null!=i&&null!==(r=i.interact)&&void 0!==r&&r.enabled&&!i.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(function(e){return e.key==="".concat(t,"-cat")}))return!1;var o=n.srcEvent.target;return!!(o&&o.hasAttribute("data-action")&&o.hasAttribute("data-component-key"))||!(!o||!o.childNodes[0]||"BUTTON"!==o.childNodes[0].nodeName)}},events:{legendtap:function(e){e.preventDefault();var t=e.srcEvent.target;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}}}(e,n)),i.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,n=e.key,r=e.requireFailure,i=e.recognizeWith,o=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).actions;return{key:"event:pan-".concat(n),type:"Pan",requireFailure:r,recognizeWith:i,options:{event:t,pointers:1,threshold:10,enable:function(e,r){var i;return this.started===t||!r||!(null!=o&&null!==(i=o.interact)&&void 0!==i&&i.enabled&&!o.interact.enabled())&&this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some(function(e){return e.key==="".concat(n,"-cat")})}},events:QD(QD(QD({},"".concat(t,"start"),function(e){e.preventDefault(),this.started!==t&&(this.started=t,this.chart.component("".concat(n,"-cat")).emit("panstart",e))}),"".concat(t,"move"),function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panmove",e)}),"".concat(t,"end"),function(e){e.preventDefault(),this.chart.component("".concat(n,"-cat")).emit("panend",e),this.started=!1})}}(e,n))),{interactions:i,components:r}}function sA(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.auto,n=function(e){var t=e_({hc:null,colorProps:null,layout:null,theme:null},e),n={},r={auto:function(){return{mode:"primary"}},getDimensionColorMap:function(){return Promise.reject()},getMeasure:function(){return Promise.reject()},getAttributeDimension:function(){return Promise.reject()}},i={auto:function(e){return e?(r.auto=e,i):r.auto},getDimensionColorMap:function(e){return e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap},getAttributeDimension:function(e){return e?(r.getAttributeDimension=e,i):r.getAttributeDimension},getMeasure:function(e){return e?(r.getMeasure=e,i):r.getMeasure},set:function(e){var i;if(!e.colorProps)throw new Error('Missing "colorProps"');if(F_(t,e),(n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps}).input.auto){var o=r.auto(e.layout);n.input=F_(!0,{},n.input,o,{auto:!1});var a=t.theme?t.theme.getDataColorPalettes():[];a[0]&&(n.input.dimensionScheme=a[0].key);var s=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(s=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[s]&&t.hc.qDimensionInfo[s].coloring&&t.hc.qDimensionInfo[s].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[s].coloring.colorMapRef)}null!==(i=n.input.measureOverrides)&&void 0!==i&&i.every(function(e){return!e||!e.on})&&(n.input=F_(!1,{},n.input,{measureOverrides:null}))},palettes:function(){if(!n.palettes){var e=t.theme,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach(function(e){r.push({key:"ui",colors:e.colors})}),n.palettes=r}return n.palettes},getAuxiliaryData:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/qHyperCubeDef";if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();var i=(e.auxiliary||{}).key;if("measure"===e.fieldType)return r.getMeasure(i,t).catch(function(){});if("dimension"===e.fieldType){var o="".concat(n,"/").concat(e.field).replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch(function(){}):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch(function(){}):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings:function(e,r){var i=this;return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then(function(r){if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){var o=n.pic.field(e.field);return Hq(i,r.coloring.gradient,e,o)}return{}}if("dimension"===e.fieldType){var a={nil:e.nil,others:e.others},s=r[0],l=r[1]?r[1].colorMap:null;if(s){var c=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:s,qInterColumnSortOrder:[0,1],qMode:"S"}});a.legendDataset=c}return l?function(e,t,n,r){var i=r.external,o=r.field,a=e_({},e);F_(a,j_(o,o.raw().qCardinal));var s=i.theme?i.theme.getDataColorPalettes()[0]:null;return t.nul&&(a.nil=n.resolveUIColor(t.nul)),t.oth&&(a.others=n.resolveUIColor(t.oth)),t.usePal?(a.palettes={categorical:t.pal},s&&!t.pal&&(a.palettes.categorical=s.key,F_(a,j_(o)))):!1===t.autoFill&&t.single?a.range=[n.resolveUIColor(t.single)]:t.autoFill&&(s&&(a.palettes={categorical:s.key}),F_(a,j_(o))),t.colors&&t.colors.length&&(a.explicit=function(e,t,n){for(var r={},i=0;i<e.length;i+=1)r[e[i].value]=e[i].baseColor;var o=[];return{domain:function(e){var i=e.data,a=[];o=[];for(var s=0;s<i.items.length;s++){var l=i.items[s],c=(l.text||l).label;r[c]&&-1===a.indexOf(l.value)&&(a.push(l.value),o.push(t.resolveUIColor(r[c])))}return a.push(-3,-2),o.push(n.others),o.push(n.nil),a},range:function(){return o}}}(t.colors,n,a)),a}(a,l,i,{external:t,field:n.pic.field(e.field)}):a}return{}})):Promise.resolve()},resolveUIColor:function(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter(function(e){return"ui"===e.key})[0]||!1),!n.uiPalette)return e.color;var t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings:function(){if(this.palettes(),!n.settings){var e={primary:"steelblue",others:"#aaa",nil:"#ddd"},r=t.theme;r&&(e=e_(e_({},e),r.getDataColorSpecials())),n.settings=F_(e,Kq(this,n,t,e))}return n.settings}};return i}(e.resources).auto(t||function(){return{mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}}).getDimensionColorMap(function(e,t){return function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:n.snapshotData.content.chartData.dimValsData}):Promise.reject():r&&r.getObject?r.getObject("ColorMapModel_".concat(e)).then(function(e){return e.getLayout()}):Promise.reject()}(e,{layout:t.layout,app:t.app})}).getMeasure(function(e,t){return function(e,t){var n=t.layout,r=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:n.snapshotData.content.chartData.measureGradient}}):Promise.reject():r&&r.getMeasure?r.getMeasure(e).then(function(e){return e.getMeasure()}):Promise.reject()}(e,{layout:t.layout,app:t.app})}).getAttributeDimension(function(e,t){return function(e,t){var n=t.layout,r=t.model,i=t.app;return n&&n.snapshotData?n.snapshotData.content&&n.snapshotData.content.chartData&&n.snapshotData.content.chartData.legendDataPage?Promise.resolve(n.snapshotData.content.chartData.legendDataPage):Promise.reject():r&&r.session&&i?r.getHyperCubeData(e,[{qHeight:100,qLeft:0,qTop:0,qWidth:2}]).catch(Gq):Promise.reject()}(e,{layout:t.layout,model:t.model,app:t.app})});return n.getSnapshotData=Xq,n}({resources:e}),n={},r={},i=function(e){return r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings},o={config:function(i){if(n=e_({},i),r={},!n.key)throw new Error("Missing key");t.set(e_(e_({},e),n))},auto:function(e){return e?(t.auto(e),o):t.auto()},getAuxiliarySettings:function(e){return r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then(function(e){return r.auxiliarySettings=e||{},r.settings=e_(e_({},r.settings),r.auxiliarySettings),r.scales=void 0,r.color=void 0,r.auxiliarySettings})},getAuxiliaryData:function(){return t.getAuxiliaryData(i())},getSnapshotData:function(e){var n=i();return t.getAuxiliaryData(n,e).then(function(e){return t.getSnapshotData(n,e)})},resolveUIColor:function(e){return t.resolveUIColor(e)},settings:function(){var e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure:function(e){var t;return(null===(t=i().measureOverrides)||void 0===t?void 0:t[e])||this.settings()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return function(e,t){var n=t.isMeasureSelectionLocked;return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||n)}(i(),{isMeasureSelectionLocked:t})},palettes:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.colorProps,n=e.coloring,r=e.theme,i=[];if(n&&n.palettes&&r){var o=n.palettes.categorical||t.dimensionScheme,a=r.getDataColorPalettes().filter(function(e){return e.key===o})[0]||r.getDataColorPalettes()[0];o&&a&&i.push({key:"categorical",colors:a.colors});var s=n.palettes.metric||t.measureScheme,l=r.getDataColorScales().filter(function(e){return e.key===s})[0]||r.getDataColorScales()[0];if(l){var c=l.colors[0]?l.colors:[[]].concat(o_(l.colors.slice(1)));c=Array.isArray(c[0])?c.map(function(e){return e.slice().reverse()}):c.slice().reverse(),i.push({key:"quant",colors:c})}}return i}({coloring:i(),colorProps:n.colorProps,theme:n.theme})},scales:function(){return r.scales=r.scales||function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.hc,n=e.coloring,r=e.rtl,i=e.key,o=e.source,a=e.picasso,s={},l=i;if(n){var c={override:!0,domain:n.explicit&&"function"==typeof n.explicit.domain?n.explicit.domain:[].concat(o_((n.explicit||{}).domain||[]),[-3,-2]),range:n.explicit&&"function"==typeof n.explicit.range?n.explicit.range:[].concat(o_((n.explicit||{}).range||[]),[n.others,n.nil])};if("field"===n.mode){if("dimension"===n.fieldType){var u,d=function(e){var t=e.hc,n=e.source,r=e.coloring,i={data:{extract:[{source:"dummy",field:0,filter:function(){return i.expando=t.qDataPages[0]?t.qDataPages[0].qArea.qTop:0,!1}},{source:n,field:r.field,trackBy:r.valueAccessor,reduce:"first",props:{row:{reduce:function(){return i.expando++}},text:{value:function(e){return e.qText},reduce:"first"}}}]},expando:0};return i}({hc:t,source:o,coloring:n}).data;if(n.legendDataset){var f=0,p={};a.data("q")({data:t}).extract({field:n.field,trackBy:n.valueAccessor,reduce:function(e){var t=e[0];return p[t]=f++,e[0]}}),u={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:function(e){return e.qElemNumber>=0},props:{row:{value:function(e){return p[e.qElemNumber]}}}}}}var h={data:d,range:n.range,domain:n.domain,explicit:c,type:"categorical-color",label:function(e){return e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label}};s[l]=h,u&&(s["".concat(l,"Legend")]=e_(e_({},h),{},{data:u})),t&&t.qHasOtherValues&&u&&((u||h.data).amend=[{label:t.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===n.fieldType){var m={data:{field:n.field},min:n.min,max:n.max};s[l]=F_({},m,{type:"categorical"===n.type?"threshold-color":"sequential-color",range:n.range,domain:n.domain,invert:n.reverse}),"sequential-color"===s[l].type&&(s["".concat(l,"Range")]=F_({},m,{invert:!!r}))}else if("color"!==n.type)throw new Error("UNUSED FIELD")}else if("dimension"===n.mode){var g={data:t.qDimensionInfo.map(function(e,t){return t}),label:function(e){return t.qDimensionInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=g}else if("measure"===n.mode){var y={data:t.qMeasureInfo.map(function(e,t){return t}).filter(function(e){var t;return!(null!==(t=n.explicit)&&void 0!==t&&null!==(t=t.exclude)&&void 0!==t&&t.includes(e))}),label:function(e){return t.qMeasureInfo[e.datum.value].qFallbackTitle},explicit:c,type:"categorical-color"};s[l]=y}}return s}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales},color:function(){return r.color=r.color||function(e){var t=e.coloring,n=e.scales,r=e.key,i=Jq(r),o=Jq("".concat(r,"IsAnOther")),a=function(e,t){var r=e.fieldType,a=e.invalid,s=e.mode,l=e.nil,c=e.others,u=e.primary,d=e.type;return a?function(e){return Zq(e)||o(e)?c:l}:n[t]?function(e){return Zq(e)?c:Qq(e)||-2===i(e)&&"dimension"===r||"NaN"===i(e)?l:o(e)?c:e.resources.scale(t)(i(e))||c}:"constant"===s?function(e){return Zq(e)||o(e)?c:Qq(e)?l:u}:"color"===d?function(e){return Zq(e)||o(e)?c:Qq(e)?l:i(e)||c}:null},s=a(t,r);if(t.measureOverrides){var l=Jq("".concat(r,"MeasureIdx")),c=t.measureOverrides.map(function(e){return e&&a(e)});return function(e){var t=l(e);return c[t]?c[t](e):s(e)}}return s}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps:function(e){return function(e){var t,n,r=e.hc,i=e.coloring,o=e.scales,a=e.key,s=e.addMeasureIx,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=a,u=i.nil;"field"===i.mode&&i.field?t=i.field:o[a]&&"field"===i.mode&&(t=o[a].data.field||i.field),t?(n={field:t,reduce:"first"},"color"===i.type&&(n.value=function(e){return"NaN"!==e.qNum?function(e){return"rgba(".concat([(16711680&e)>>16,(65280&e)>>8,255&e,((4278190080&e)>>>24)/255].join(","),")")}(e.qNum):e.qText&&lq(e.qText)?e.qText:u})):"dimension"===i.mode?n=void 0!==i.field?i.field:r.qDimensionInfo.length-1:"measure"===i.mode&&(n=l);var d=QD({},c,n);return r.qDimensionInfo.length>1&&(d["".concat(c,"IsAnOther")]={fields:r.qDimensionInfo.map(function(e,t){return{field:"qDimensionInfo/".concat(t)}}),value:function(e){return-1!==e.indexOf(-3)}}),s&&(d["".concat(c,"MeasureIdx")]=l),d}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data:function(){var e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.eventName,r=e.key,o=e.viewState,a=e.chart,s=e.rtl,l=e.styleReference,c=void 0===l?"object.legend":l,u=e.styleOverrides,d=e.settings,f=void 0===d?{}:d,p=e.style,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return aA({eventName:t,key:r,rtl:s,viewState:o,chart:a,styleReference:c,styleOverrides:u,settings:f,style:void 0===p?{}:p},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},h)}};return o}var lA=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function cA(e){var t=e.qHyperCube,n=t.qDimensionInfo,r=t.qMeasureInfo,i=n.some(lA),o=r.some(lA),a=e.color.useBaseColors;return"measure"===a&&!o||"dimension"===a&&!i?"off":a}var uA=function(e){return e.baseColor||e.coloring&&e.coloring.baseColor};function dA(e){var t,n=e.qHyperCube.qDimensionInfo.some(uA),r=e.qHyperCube.qMeasureInfo.some(uA),i=n?"dimension":void 0;return{mode:"primary",useBaseColors:null!==(t=null!=i?i:r?"measure":void 0)&&void 0!==t?t:"off",paletteColor:null}}var fA=function(){};function pA(e){var t,n,r,i,o=e.picasso,a=e.model,s=e.app,l=e.translator,c=e.layoutService,u=void 0===c?void 0:c,d=e.createConfig,f=void 0===d?fA:d,p=e.config,h=void 0===p?{}:p,m=e.custom,g=void 0===m?{}:m,y=h.localeInfo,v=h.key,b=h.theme,x=void 0===b?void 0:b,w=h.auto,S=void 0===w?void 0:w,k=h.definitionPath,M=null==u||null===(t=u.getLayout)||void 0===t?void 0:t.call(u),C={theme:x,key:v,localeInfo:y,layout:M,hc:null==u||null===(n=u.getHyperCube)||void 0===n?void 0:n.call(u),legendProps:null==u||null===(r=u.getLayoutValue)||void 0===r?void 0:r.call(u,"legend"),colorProps:e_(e_({},null==u||null===(i=u.getLayoutValue)||void 0===i?void 0:i.call(u,"color")),{},{useBaseColors:M?cA(M):void 0})},E=sA({picasso:o,model:a,app:s,translator:l,auto:S});!1!==S&&E.auto(function(e){return S?S({layout:e,defaultAuto:dA}):dA(e)});var D=!1,_={getColor:function(){return E.color()},getPaletteColor:function(e){var t=e.index,n=e.color;return E.resolveUIColor({index:t,color:n})},getData:function(){return E.data()},getDatumProps:function(e){return E.datumProps(e)},getSnapshotData:function(){return E.getSnapshotData(k)},getSettingsForMeasure:function(e){return E.settingsForMeasure(e)},getSettings:function(){return E.settings()},getLegend:function(e,t){return E.legend(e,t)},getScales:function(){return E.scales()},getPalettes:function(){return E.palettes()},isSelectionLocked:function(e){var t=e.isMeasureSelectionLocked;return E.isSelectionLocked({isMeasureSelectionLocked:t})},isInitialized:function(){return D},custom:e_({},g),initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createConfig,t=(void 0===e?f:e)({getUseBaseColors:cA}),n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e_(e_(e_({},e),t),{},{colorProps:e_(e_({},e.colorProps),t.colorProps||{})})}(C,t);return E.config(n),E.getAuxiliarySettings(k).then(function(){D=!0})}};return _}var hA="center",mA="bottom",gA=[{key:"NoDataExist",alignment:hA,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:hA,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:hA,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:hA},{key:"DataRangeIncludingZero",alignment:mA},{key:"LimitedData",alignment:mA},{key:"NegativeOrZeroValues",alignment:mA}].reduce(function(e,t){return e[t.key]=t,e},{}),yA=function(){return!1};function vA(e){var t,n=e.layout,r=e.config,i=void 0===r?{}:r,o={disclaimer:void 0,isSuppressing:!1,showDisclaimer:null!==(t=i.args)&&void 0!==t&&t.layoutService?i.args.layoutService.getLayoutValue("showDisclaimer"):null==n?void 0:n.showDisclaimer};return{initialize:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).args;o.disclaimer=function(e){var t=e.args,n=e.disclaimers,r=[];return Object.keys(n).forEach(function(e){var i=gA[e],o=n[e];o&&(o.condition||(null==i?void 0:i.condition)||yA)(t)&&r.push({key:(null==i?void 0:i.translationKey)||(null==i?void 0:i.key)||e,alignment:o.alignment||(null==i?void 0:i.alignment)||mA})}),r.find(function(e){return e.alignment===hA})||r[0]}({args:e_(e_({layout:n},i.args),e),disclaimers:i.disclaimers||{}}),o.isSuppressing=!(!o.disclaimer||o.disclaimer.alignment!==hA)},getDisclaimer:function(){return o.isSuppressing?o.disclaimer:!1===o.showDisclaimer?void 0:o.disclaimer},getHasSuppressingDisclaimer:function(){return o.isSuppressing}}}function bA(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}var xA=["__proto__","constructor"];function wA(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!xA.some(function(e){return r.includes(e)})){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function SA(){var e={};return{get:function(t){return e[t]},set:function(t,n){return e[t]=n,n},has:function(t){return t in e},remove:function(t){delete e[t]},empty:function(){e={}}}}function kA(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50;return function(){for(var r=this,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(t),t=setTimeout(function(){return e.apply(r,o)},n)}}function MA(e){var t=e.originalArray,n=e.newArray,r=e.matchKey;return Array.isArray(t)&&t.length?(n.forEach(function(e){var n=-1;t.some(function(t,i){return t[r]&&t[r]===e[r]&&(n=i),n}),n>-1?t[n]=e:t.push(e)}),t):n}function CA(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function EA(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 DA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?EA(Object(n),!0).forEach(function(t){CA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _A=Object.prototype.hasOwnProperty,qA=Object.prototype.toString,AA=Object.defineProperty,TA=Object.getOwnPropertyDescriptor,NA=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===qA.call(e)},IA=function(e){if(!e||"[object Object]"!==qA.call(e))return!1;var t,n=_A.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&_A.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||_A.call(e,t)},OA=function(e,t){AA&&"__proto__"===t.name?AA(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},RA=function(e,t){if("__proto__"===t){if(!_A.call(e,t))return;if(TA)return TA(e,t).value}return e[t]},PA=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=RA(s,n),s!==(i=RA(t,n))&&(u&&i&&(IA(i)||(o=NA(i)))?(o?(o=!1,a=r&&NA(r)?r:[]):a=r&&IA(r)?r:{},OA(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&OA(s,{name:n,newValue:i}));return s};function LA(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),s=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function zA(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function FA(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:c,targetProp:u,columnOrder:d}=e,f=r;if(i.field&&i.field!==n){const e=LA(i.field,o,{cache:t},d);if(-1===e)return;f=PA({qRow:a},e(s))}c[u]=zA(i,f,{key:l})}function jA(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:c,main:u}=r.normalizeConfig(i[e],t),d=Object.keys(c),f=!!i[e].trackBy,p=typeof i[e].trackBy,h={},m=[],g=[];for(let t=0;t<a.qDataPages.length;t++){const o=LA(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let y=0;y<a.qDataPages[t].qMatrix.length;y++){const v=a.qDataPages[t].qArea.qTop+y,b=PA({qRow:v},o(a.qDataPages[t].qMatrix[y])),x=zA(u,b,{key:s});if(!u.filter||u.filter(b)){for(let e=0;e<d.length;e++){const r=c[d[e]];let i=r.fields||[r];r.fields&&(x[d[e]]=[]);for(let o=0;o<i.length;o++)FA({cache:n,f:l,mainCell:b,p:i[o],prop:d[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[y],sourceKey:s,target:r.fields?x[d[e]]:x,targetProp:r.fields?o:d[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[d[e]].map(e=>e.value),n=x[d[e]].map(e=>e.label);x[d[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[d[e]].value)}}}f&&r.track({cfg:i[e],itemData:b,obj:x,target:m,tracker:h,trackType:p}),g.push(x)}}}const y=f?r.collect(m,{main:u,propsArr:d,props:c}):g;o=[...o,...y]}return o}function VA(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function HA(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=BA)):void 0===t&&(t=$A);for(var n,r,i,o,a,s=new YA(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new YA(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(UA)}function $A(e){return e.children}function BA(e){return Array.isArray(e)?e[1]:null}function WA(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function UA(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function YA(e){this.data=e,this.depth=this.height=0,this.parent=null}function KA(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}YA.prototype=HA.prototype={constructor:YA,count:function(){return this.eachAfter(VA)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return HA(this).eachBefore(WA)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var XA={depth:-1},GA={},JA={};function QA(e){return e.id}function ZA(e){return e.parentId}function eT(e){let t=e.length;if(t<2)return"";for(;--t>1&&!tT(e,t););return e.slice(0,t)}function tT(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function nT(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=nT(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=nT(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function rT(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...rT(e[i].children,t-1,n)]);return r}function iT(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>rT(e.children,r-1,n)}return!1}const oT=/^qDimensionInfo(?:\/(\d+))?/,aT=/^\/?qMeasureInfo\/(\d+)/,sT=/\/qAttrExprInfo\/(\d+)/,lT=/\/qAttrDimInfo\/(\d+)/;function cT(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function uT(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const f=n.qEffectiveInterColumnSortOrder,p=cT(n);return oT.test(d)&&(i=!0,o=+oT.exec(d)[1],d=r.replace(oT,"")),aT.test(d)&&("K"===n.qMode?c=+aT.exec(d)[1]:f&&-1!==f.indexOf(-1)?(c=+aT.exec(d)[1],u=0):u=+aT.exec(d)[1],d=d.replace(aT,"")),d&&(lT.exec(d)?s=+lT.exec(d)[1]:sT.exec(d)&&(a=+sT.exec(d)[1])),l=i?"S"===n.qMode?p[o]:f?f.indexOf(o):o:f&&-1!==f.indexOf(-1)?f.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function dT(e,t){let n,r,i=iT(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function fT(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function pT(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let f,p,h,m,g,y;if("primitive"===d.type?(h=d.value,y=String(d.value)):("function"==typeof d.value&&(f=e=>d.value(e,r)),"function"==typeof d.label&&(p=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),f&&(h=g.map(f),f=null),p&&(y=g.map(p),p=null),h=d.reduce?d.reduce(h):h,y=d.reduceLabel?d.reduceLabel(y,h):String(h)):(h=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=h)):(h=i,y=i)),s.fields){const e=f?f(h):h;c.push(e),u.push(p&&null!=y?p(y):null!=y?y:String(e))}else{const n=f?f(h):h;o[t[e]]={value:n,label:p?p(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const hT=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=nT(r,e);return o&&o[0]?(t.tree=HA(o[0],n.children||(e=>e[i])),t.tree):null};function mT(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),r=e.fields(),i=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(r.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(r.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=DA({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map(e=>a[e]);return function(){var e,t=QA,n=ZA;function r(r){var i,o,a,s,l,c,u,d,f=Array.from(r),p=t,h=n,m=new Map;if(null!=e){const t=f.map((t,n)=>function(e){let t=(e=`${e}`).length;return tT(e,t-1)&&!tT(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(eT),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(eT(e)),f.push(JA));p=(e,n)=>t[n],h=(e,t)=>n[t]}for(a=0,i=f.length;a<i;++a)o=f[a],c=f[a]=new YA(o),null!=(u=p(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?GA:c)),null!=(u=h(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=f[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===GA)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===JA&&1===s.children.length;)s=s.children[0],--i;for(let e=f.length-1;e>=0&&(c=f[e]).data===JA;--e)c.data=null}if(s.parent=XA,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(UA),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=KA(e),r):t},r.parentId=function(e){return arguments.length?(n=KA(e),r):n},r.path=function(t){return arguments.length?(e=KA(t),r):e},r}().id(e=>e.__id).parentId(e=>e.__parent)(l)}const gT=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=dT(o,uT(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function yT(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?mT(t):hT(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=cT(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const{props:s,main:c}=r.normalizeConfig(DA(DA({},e),{},{field:a?a.key():void 0}),t),u=Object.keys(s);l[o]={propsArr:u,props:s,main:c};const d=a?uT(a,{cube:i}):{fieldDepth:0};gT({propsArr:u,props:s,cube:i,cache:n,itemDepthObject:d,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],a=i.data,s=fT(r,a,{key:o});pT({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function vT(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!hT(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:u,main:d}=r.normalizeConfig(i[a],t),f=Object.keys(u),p=uT(c,{cube:s}),{nodeFn:h,attrFn:m,valueFn:g}=dT({fieldDepth:0},p);gT({propsArr:f,props:u,cube:s,cache:n,itemDepthObject:p,f:c});const y=!!i[a].trackBy,v=typeof i[a].trackBy,b={},x=[],w=h(n.tree),S=[];for(let e=0;e<w.length;e++){const t=w[e],n=m?m(g(t)):g(t);if(d.filter&&!d.filter(n))continue;const o=fT(d,n,{key:l});pT({propsArr:f,props:u,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:b,trackType:v}),S.push(o)}const k=y?r.collect(x,{main:d,propsArr:f,props:u}):S;o=[...o,...k]}return o}var bT,xT,wT=(bT=function(e){
108
108
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
109
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,p=e.search(/[0-9\-\+#]/),h=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(p,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}},bT(xT={exports:{}}),xT.exports);function ST(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const kT={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},MT=/%\)?$/,CT=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,ET=/^\(oct\)/i,DT=/^\(dec\)/i,_T=/^\(hex\)/i,qT=/^\(bin\)/i,AT=/^\(rom\)/i,TT=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,NT=/#|0/g;function IT(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function OT(e,t,n){const r=ST(e);return n?r:new RegExp(r||"",t)}function RT(e,t,n,r){let i,o,a,s,l,c,u,d,f,p=e.pattern;var h,m;r&&(e.abbreviate=!0),h=t,(m=n)&&(m=ST(m)),h&&(h=ST(h)),f=new RegExp("(?:[#0]+".concat(h,")?[#0]+(?:").concat(m,"[#0]+)?")),a=p.match(f),a=a?a[0]:"",s=a?p.substr(0,p.indexOf(a)):p,l=a?p.substring(p.indexOf(a)+a.length):"",a||(a=p?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(OT(c,"g"),t)),u=n,n=".",u&&(a=a.replace(OT(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=p.split(u);let y;g[1]&&(y=g[1].match(NT)),e.prefix=s||"",e.postfix=l||"",e.pattern=p,e.maxPrecision=y?y.length:2,e.percentage=MT.test(p),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(OT(t,null,!0),"|").concat(OT(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class PT{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return kT;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new PT(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],TT.test(e[0])&&(r.positive.isFunctional=!0),e[1]?TT.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?TT.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||RT(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&RT(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&RT(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",f="",p=e;if(isNaN(e))return"".concat(p);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=function(e,t,n){let r;return CT.test(t)?e=IT(e,Number(/\d{2}/.exec(t)[0]),t,n):ET.test(t)?e=IT(e,8,t,n):DT.test(t)?e=IT(e,10,t,n):_T.test(t)?e=IT(e,16,t,n):qT.test(t)?e=IT(e,2,t,n):AT.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=wT(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=wT(l,e)}e=e.replace(u.numericRegex,e=>e===a?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+f+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function LT(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function zT(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new PT(...t)}(i,e,t,n,r),a=LT(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const FT="D",jT="T",VT="TS",HT=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$T=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],BT=["January","February","March","April","May","June","July","August","September","October","November","December"],WT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function UT(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function YT(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class KT{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:HT,qDayNames:$T,qLongMonthNames:BT,qMonthNames:WT}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[jT]:r.qTimeFmt||"hh:mm:ss",[FT]:r.qDateFmt||"YYYY-MM-DD",[VT]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new KT(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){let n,r=function(e){const t=e,n=24*YT(t),r=60*YT(n),i=60*YT(r),o=1e3*YT(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:UT("".concat(a.year).slice(-2),2),YYY:UT("".concat(a.year).slice(-3),3),def:e=>UT("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:UT("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:UT("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>UT("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>UT("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>UT("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>UT("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r})}}function XT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new KT(...t)}function GT(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=XT(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=LT(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return"IV"!==t?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=XT(i,e,t),r=LT(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function JT(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return GT(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),zT(n,r,i,o,t)}(t,i),f="dimension"===s?"first":(e,t)=>d(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function QT(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:JT(PA({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=QT("qAttrDimInfo",t,n,a,PA({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=QT("qAttrExprInfo",t,n,a,PA({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=QT("qMeasureInfo",t,n,a,PA({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function ZT(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=ZT.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=vT,a.hierarchy=yT,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=jA,a.pages=i.qDataPages,a.hierarchy=yT):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,c="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...QT("qDimensionInfo",i,e,"",PA({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...QT("qMeasureInfo",i,e,"",PA({},a,{value:c,type:"measure"}))),r.fields=r.wrappedFields.map(e=>e.instance);const u=e=>{e.forEach(e=>{r.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)})};return u(r.wrappedFields),(n.virtualFields||[]).forEach(t=>{const n=s.field(t.from),i=JT(DA({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)}),r.allFields.push(...r.virtualFields),s}const eN=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],tN=/\/qDimensionInfo(?:\/(\d+))?/,nN=/\/qMeasureInfo\/(\d+)/,rN=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,iN=/\/qAttrExprInfo\/(\d+)/,oN=/\/?qHyperCube/,aN=/\/?qTreeData/,sN=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),lN=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function cN(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;oN.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=sN):aN.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=lN);let s=!0;if(tN.test(e)&&(r=+tN.exec(e)[1]),nN.test(e)&&(i=+nN.exec(e)[1]),rN.test(e)){i=-1,r=0;const e=+rN.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(iN.test(e)){const e=i;if(t){i=0;const a=nT(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+iN.exec(n)[1]}else r>-1?(r=-1,i=+iN.exec(n)[1]):i+=+iN.exec(n)[1]+1}return eN.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||s>=o)&&o>-1?n.forEach(e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})}):n.forEach(e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var c}function uN(e){ZT.util=e.data("matrix").util,e.data("q",ZT),e.formatter("q-number",zT),e.formatter("q-time",GT)}function dN(e){var t=bA(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function fN(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}uN.qBrushHelper=cN,uN.selections=cN;var pN="Shift";var hN=function(e,t){return t[e]?hN(e+1,t):e},mN=function(e,t){var n=t.reduce(function(e,t){return e[t]=!0,e},{});return e.reduce(function(e,t,r){var i=hN(r,n);return n[i]=!0,e[r]=i,e},{})};function gN(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:mN(a,r.dimensions||[]),measures:mN(l,r.measures||[])}}function yN(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if("selectHyperCubeValues"===r){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return"selectHyperCubeContinuousRange"===r&&i[1].forEach(function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)}),t}var vN=[],bN=0,xN=function(e){var t=vN.filter(function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()});t.length&&("Enter"===e.key?t.forEach(function(e){return e.selections.confirm()}):"Escape"!==e.key&&"Esc"!==e.key||t.forEach(function(e){return e.selections.cancel()}))};function wN(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,c=void 0===l?"rangeClear":l,u=r.event===i,d=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(u||!d)return!1;var f=t.component(o);return!!f&&(f.emit(c),"string"==typeof s&&t.brush(s).clear(),f)}var SN=["chart","document","selections","selectionInfo"],kN=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=t_(e,SN);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function MN(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function CN(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var c=i.reset,u=void 0===c?MN:c,d=i.clear,f=!1!==d&&function(e){var t=e.clear,n=void 0===t?kN:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(e_({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return wN({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}(e_(e_({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return wN({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}(e_(e_({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,c=void 0!==l&&l,u=e.brushName,d=wN({selectionInfo:t,chart:n,document:r,eventName:c?void 0:s,componentName:o,brushName:void 0!==u&&u});if(d){var f=d.settings.settings,p=f.scale,h=f.brush,m=n.scale(p).data().fields.map(function(e){return e.id()}),g=n.brush(h),y=g.brushes().filter(function(e){return"range"===e.type&&m.some(function(t){return t===e.id})});g&&y.length&&y.forEach(function(e){g.removeRanges(e.brush.ranges().map(function(t){return{key:e.id,range:t}}))})}}(e_(e_({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;wN({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}(e_(e_({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach(function(e){return t.brush(e).end()}))}}(e_(e_({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,c=e.cleared,u=void 0!==c&&c,d=e.brushName;wN({selectionInfo:t,chart:n,document:r,eventName:u?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}(e_(e_({},t),e))}},t))}}({clear:d,selections:s,selectionInfo:r,chart:n}),p=function(e){var t=e.chart,n=e.actions,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;r({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;r({e:e,lasso:void 0!==o&&o}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:f,reset:u,actions:a}),h={};Object.entries(p).forEach(function(e){var t=i_(e,2),n=t[0],r=t[1];h[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])});var m=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},c=function(e){return Object.assign(r,e||{})},u=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(e_(e_({},void 0===t?{}:t),{},{event:r,components:o.map(function(e){return e.key}).filter(Boolean)})),n()}({event:t,components:n,clear:i,selectionInfo:r,setSelectionInfo:c})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(e_(e_({defaultFunc:u({event:e,components:t}),setSelectionInfo:c,clear:i},l),{},{event:e,components:t}))}:function(e){u({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:r,clear:f,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",m),Object.entries(h).forEach(function(e){var t=i_(e,2),n=t[0],r=t[1];null==s||s.on(n,r)}),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",m),Object.entries(h).forEach(function(e){var t=i_(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)})}}var EN=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function DN(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,c=void 0===l?void 0:l,u=o.selectionActions,d=void 0===u?{}:u,f=d.clear,p=d.reset,h=o.selectionEvents,m=void 0===h?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:h,g=o.brushEvents,y=void 0===g?{}:g,v=o.brushName,b=void 0===v?"selection":v,x=o.brushMaxListeners,w=void 0===x?20:x,S=o.brushRanges,k=void 0!==S&&S,M=o.interceptors,C=void 0===M?{}:M,E=o.selectionsFn,D=void 0===E?i.selections:E,_=t.brush(b);if("number"==typeof w&&_.setMaxListeners(w),k){var q=!0===k?EN:k;_.configure({ranges:q})}var A={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},T=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var c=++bN,u=null,d={dimensions:[],measures:[]},f=[],p={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var h=function(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach(function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])});var l=e.filter(function(e){return-2!==e.value});if(l.length>1){var c=function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map(function(e){return e.key}))),a=[];return o.forEach(function(e){var t=dN({layout:n,path:e}),r=i.filter(function(t){return t.key===e}),o=t?[r.pop()]:r;a.push.apply(a,o_(o))}),a.filter(Boolean)}({layout:s,values:l});return c}return l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter(function(e){return"value"===e.type}).length?(t.clear([]),e):(r.forEach(function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])}),e)}}}({brush:r,getConfig:function(){return{layout:u,allowSimultaneous:f}}}),m=h.rangeInterceptor,g=h.interceptor;r.intercept("set-ranges",m),r.intercept("toggle-ranges",m),r.intercept("toggle-values",g),r.intercept("set-values",g),r.intercept("add-values",g),r.on("start",function(){return n.begin(l)});var y={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};!function(e,t){Object.keys(t).forEach(function(n){e.on(n,t[n])})}(n,y);var v=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(p=(e=o.select).getBrushOptions.apply(e,arguments))}),o.select.on("end",function(){var e=a(r,p,u),t=gN({layout:u,filtered:d});e.forEach(function(e){var r=yN({selection:e,fieldMap:t});(function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}})(r,o.select.brushSelectionIncludeMax,v),n.select(r)})})):r.on("update",function(){var e=a(r,p,u),t=gN({layout:u,filtered:d});e.forEach(function(e){n.select(yN({selection:e,fieldMap:t}))})}),0===vN.length&&document.addEventListener("keyup",xN),vN.push({key:c,selections:n}),{layout:function(e){u=e},filteredFields:function(e){d=e},allowSimultaneous:function(e){f=e},release:function(){u=null;var e=vN.indexOf(vN.filter(function(e){return e.key===c})[0]);-1!==e&&vN.splice(e,1),vN.length||document.removeEventListener("keyup",xN),function(e,t){Object.keys(t).forEach(function(n){e.removeListener(n,t[n])})}(n,y)}}}({brush:_,majorScale:c,actions:n,selections:r,picassoQ:i,selectionsFn:D});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach(function(e){var n=i_(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach(function(e){t.intercept(r,e)})})}({brush:_,interceptors:C});var N=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map(function(e){var i=i_(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]});return function(){a.forEach(function(e){var n=i_(e,2),r=n[0],i=n[1];t.removeListener(r,i)})}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),c=CN({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),u=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==pN||(t.lasso.action(!0),n=!0)},i=function(e){e.key===pN&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),c(),u()}}({chart:t,brush:_,actions:n,selections:r,selectionInfo:A.selectionInfo,selectionActions:{clear:f,reset:p},selectionEvents:m,brushEvents:y});if(s){var I=!0===s?o_(Array(15)).map(function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)}):s;T.allowSimultaneous(I)}return{unbindEvents:N,state:A,picassoSelections:T,brush:_}}var _N=["colorField","useLegendCube"];function qN(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=DN({chart:t,actions:i,selections:n,picassoQ:uN,config:a}),l=s.unbindEvents,c=s.state,u=s.picassoSelections,d=s.brush,f=a.custom,p=void 0===f?{}:f,h=a.legendAlias,m=void 0===h?void 0:h,g=a.setBrushAliases,y=void 0===g?fN:g;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return c.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter(function(e){return"object"===a_(e.data)&&Array.isArray(e.data.fields)}).every(function(e){return e.data.fields.every(function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)})});return t}(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c.singleSelectIndex;return c.singleSelectDimensions[e]},getCanSelect:function(){return c.canSelect},getSelectionsObject:function(){return n},getSelectionInfo:function(){return c.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,c=void 0===l?[]:l;return s.lockedDimensions=c.map(function(e){return!!e.qLocked}),s.singleSelectDimensions=c.map(function(e,t){return dN({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})}),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n,i=r.map(function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t}).filter(function(e){return"number"==typeof e});return null!==(t=i[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===c.length||c.some(function(e){return!e.qLocked}),s.dimensionLocked=!(null===(r=c[0])||void 0===r||!r.qLocked),s}({selections:n,picassoSelections:u,layout:e});Object.assign(c,t)},setFilteredFields:function(e){u.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=t_(e,_N),o=e_({useLegendCube:r,colorField:t,brush:d,legendAlias:m},i);y(e_(e_({},o),{},{defaultFunc:function(){return fN(o)}}))},destroy:function(){l(),u.release()},custom:e_({},p)}}var AN="'Source Sans Pro', 'Arial', 'sans-serif'",TN="#333333",NN="#595959",IN="#737373",ON="#cccccc",RN="#e6e6e6";function PN(e){var t={};return[].concat(o_(e),o_([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",NN],["object","axis.label.name","fontFamily",AN],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",ON],["object","axis.line.minor","color",RN],["object","axis.title","color"],["object","axis.title","fontFamily",AN],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",RN],["object","grid.line.major","color",ON],["object","grid.line.minor","color",RN],["object","label.value","color",NN],["object","label.value","fontFamily",AN],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",NN],[!1,"label.value","lightColor",RN],["object","outOfRange","color","#999"],["object","legend.title","color",TN],["object","legend.title","fontFamily",AN],["object","legend.title","fontSize","15px"],["object","legend.label","color",NN],["object","legend.label","fontFamily",AN],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",TN],["object","referenceLine.label.name","fontFamily",AN],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",RN],["object","referenceLine.outOfBounds","fontFamily",AN],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",IN,function(e){return"transparent"===e?IN:e}]])).reduce(function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e},[]).sort(function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)})}var LN=function(e){return e};function zN(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce(function(e,t){var n=i_(t,2),r=n[0],i=n[1];return e[r]=i,e},{});return o.forEach(function(e){var r=i_(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],d=void 0===u?function(e){return e}:u,f=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:c}),p=(s["".concat(o,".").concat(l)]||LN)(d(f));wA(a,[o,l].filter(Boolean).join("."),p)}),i.forEach(function(e){var t=i_(e,2),n=t[0],r=t[1];wA(a,n,r)}),a}var FN={NOOP:function(){},FALSE:function(){return!1},ARRAY:function(){return[]},OBJECT:function(){return{}}},jN="chart-modules-tooltip",VN="#".concat(jN);function HN(){if(!document.querySelector(VN)){var e=document.createElement("div");e.id=jN,e.setAttribute("data-qs-css",""),e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function $N(e){return{show:!0,key:e.key,type:"tooltip",layout:{displayOrder:3},beforeMount:function(){HN()},beforeUpdate:function(){HN()},destroyed:function(){var e;null!=(e=document.querySelector(VN))&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)},settings:{appendTo:function(){return document.querySelector(VN)},direction:e.rtl?"rtl":"ltr",duration:e.duration},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"'Source Sans Pro', 'Arial', 'sans-serif'","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}var BN="position",WN={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"},UN=function(e){return e.data.value},YN=function(e){var t,n=e.data;return null==n||null===(t=n.major)||void 0===t?void 0:t.value};function KN(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.collectConfig,o=e.collectibles,a=e.meta,s=i.from,l={chart:t,expando:n,nodes:r,collectConfig:i,collectibles:o,meta:a};switch("function"==typeof s?"custom":s){case"single":return function(e){var t=i_(e.nodes,1)[0];if("container"===t.type&&t.children[0]){var n=i_(t.children,1)[0];return n.key=t.key,[n]}return[t]}(l);case"position":return function(e){var t=e.collectibles,n=e.meta;return e.chart.shapesAt(n.position.absolute,{components:t.map(function(e){return{key:e.key}})})}(l);case"dimension":return function(e){var t=e.chart,n=e.nodes,r=e.collectConfig,i=e.collectibles,o=e.meta,a=i_(n,1)[0],s=r.filter,l=r.after,c="function"==typeof s?s:function(){return!0},u="function"==typeof l?l:function(){},d=i.reduce(function(e,n){var i=WN[n.type]||n.type;return e.push.apply(e,o_(t.findShapes(i).filter(function(e){return e.key===n.key&&e.data&&function(e){var t=e.meta,n=e.collectible,r=e.nodes,i=e.collectConfig.by,o=void 0===i?UN:i,a=n.major,s=void 0===a?YN:a,l=o({data:r.triggerer.data}),c=s({data:r.candidate.data,meta:t}),u=Array.isArray(l),d=Array.isArray(c);return u&&d?l.length===c.length&&l.every(function(e,t){return e===c[t]}):!u&&!d&&l===c}({collectConfig:r,meta:o,collectible:n,nodes:{triggerer:a,candidate:e}})}))),e},[]).filter(c);return u({collected:d,triggerer:a}),d}(l);case"radius":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=e.meta,o=i_(e.nodes,1)[0].localBounds,a=n.distance,s=n.filter,l="function"==typeof s?s:function(){return!0},c=r.map(function(e){return e.key});return t.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:a||Math.max(o.width,o.height)},{components:c.map(function(e){return{key:e}})}).filter(l)}(l);case"custom":return function(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.meta;return e.collectConfig.from({chart:t,expando:n,nodes:r,meta:i})}(l);default:return[]}}var XN=Number.MAX_VALUE;function GN(e){var t=e.nodes.filter(function(e){return e.bounds.height+e.bounds.width!==0}).reduce(function(e,t){var n=t.bounds;return e.xMin=Math.min(e.xMin,n.x,n.x+n.width),e.yMin=Math.min(e.yMin,n.y,n.y+n.height),e.xMax=Math.max(e.xMax,n.x,n.x+n.width),e.yMax=Math.max(e.yMax,n.y,n.y+n.height),e},{xMin:XN,xMax:-XN,yMin:XN,yMax:-XN}),n=t.xMin,r=t.xMax,i=t.yMin;return{x:n,y:i,width:r-n,height:t.yMax-i}}function JN(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.nodes;if(!o.length)return[];var a=i_(o,1)[0].key,s=n.main.collectibles.filter(function(e){return!e.if||e.if()});if(!s.length)return[];var l=n.main.triggers.find(function(e){return-1!==e.keys.indexOf(a)})||{},c=l.collect,u=l.placement;if(!c||!c.from||!u)return[];var d={triggerer:a,position:i.get(BN)},f=(KN({chart:t,expando:r,nodes:o,collectConfig:c,collectibles:s,meta:d})||[]).map(function(e){return e.children.length?e.children[0]:e});return f.length?function(e){var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=function(e){for(var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=i_(o,1)[0],c=Array.isArray(i)?i:[i],u={bounds:l.bounds,key:l.key},d=GN({nodes:a}),f=0;f<c.length;f++){var p=c[f];if("function"==typeof p){var h=p({chart:t,expando:r,hovered:o,collected:o_(a),meta:s,collectedBounds:d,combineBounds:GN});if(h)return h}if("trigger"===p)return u;if("collectible"===p){var m=n.main.placements.collectible;return{bounds:"function"==typeof m?m({collected:o_(a)}):d,key:a[0].key}}}return u}({chart:t,config:n,expando:r,placementConfig:i,hovered:o,collected:a,meta:s}),c=l.bounds,u=l.key,d=i_(a,1)[0].desc;return[{bounds:c,nodes:a,data:a.map(function(e){return e.data}),key:u,meta:s,desc:d}]}({chart:t,config:n,expando:r,placementConfig:u,hovered:o,collected:f,meta:d}):[]}var QN=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),ZN=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),eI=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),tI=function(e){return QN.test(e)},nI=function(e){return ZN.test(e)||eI.test(e)};function rI(e){for(var t=e?e.length:0,n=0;n<t;n++){var r=e[n];if(tI(r))return"ltr";if(nI(r))return"rtl"}return"ltr"}function iI(e){var t=e.config,n=e.h,r=e.context,i={section:function(e){return function(e){return{type:"section",content:e.content}}({content:e.content})},text:function(e){var n=e.value,r=e.style,i=e.survive,o=e.visibility;return function(e){var t=e.config,n=e.value,r=e.style,i=void 0===r?{}:r,o=i.bold,a=void 0!==o&&o,s=i.italic,l=e.survive,c=e.visibility;return{type:"text",content:[{content:n,style:{"font-weight":a?"bold":"normal","font-style":void 0!==s&&s?"italic":"normal","text-align":t.rtl?"right":"left",direction:rI(n),"white-space":"pre-wrap"},colspan:2}],survive:e_(e_({},{visibility:!1}),l),visibility:e_(e_({},{count:!0,force:!1}),c)}}({config:t,value:n,style:r,survive:i,visibility:o})},measure:function(e){var r=e.label,i=e.value,o=e.color,a=e.style,s=e.survive,l=e.visibility;return function(e){var t,n,r,i,o=e.h,a=e.label,s=e.value,l=e.color,c=e.style,u=e.survive,d=e.visibility,f=e.config.rtl,p=o("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{type:"measure",label:a,value:s,content:[{content:f?[":",a]:[a,":"],style:{"text-align":f?"right":"left","font-weight":null!=c&&null!==(t=c.label)&&void 0!==t&&t.bold?"bold":"normal","font-style":null!=c&&null!==(n=c.label)&&void 0!==n&&n.italic?"italic":"normal",direction:rI(a)}},{content:l?f?[s,p]:[p,s]:s,style:{"text-align":f?"left":"right","vertical-align":"middle","font-weight":null!=c&&null!==(r=c.value)&&void 0!==r&&r.bold?"bold":"normal","font-style":null!=c&&null!==(i=c.value)&&void 0!==i&&i.italic?"italic":"normal",direction:rI(s)}}],survive:e_(e_({},{color:!1,duplicate:!1,visibility:!1}),u),visibility:e_(e_({},{count:!0,force:!1}),d)}}({config:t,h:n,label:r,value:i,color:o,style:a,survive:s,visibility:l})},divider:function(){return function(e){var t=e.visibility;return{type:"divider",content:[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2}],survive:{visibility:!1},visibility:e_(e_({},{count:!1,force:!1}),t)}}({visibility:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).visibility})},row:function(e){return function(e){var t=e.survive,n=e.visibility;return{type:"row",content:[{content:e.content,style:e.style,colspan:e.colspan}],survive:e_(e_({},{visibility:!1}),t),visibility:e_(e_({},{count:!0}),n)}}({content:e.content,style:e.style,colspan:e.colspan,survive:e.survive,visibility:e.visibility})},raw:function(e){return function(e){var t=e.survive,n=e.visibility;return{type:"raw",content:e.value,survive:e_(e_({},{visibility:!1}),t),visibility:e_(e_({},{count:!0}),n)}}({value:e.value,survive:e.survive,visibility:e.visibility})},color:function(e){var i=e.nodes,o=e.property,a=e.filter,s=void 0===a||a,l=e.visibility,c=e.fillColor;return function(e){var t=e.config,n=e.h,r=e.context,i=e.nodes,o=e.property,a=e.filter,s=e.visibility,l=e.fillColor,c=t.rtl,u={type:"color",label:void 0,value:void 0,content:[],filter:a,survive:{visibility:!1},visibility:e_(e_({},{count:!0}),s)},d=t.getColorSettings();if("color"===d.type||!d.fieldType)return u;var f=i_(i,1)[0];if(u.value=function(e){var t=e.config,n=e.context,r=e.property,i=e.node,o=i.data[r];if(o){if(-3===i.data.value)return i.data.label;var a=n.resources.dataset(o.source.key).field(o.source.field).formatter(),s=o.value,l=o.label,c=t.getColorSettings();if(a&&"measure"===c.fieldType)return Number.isNaN(+s)?"-":a(o.value);var u=l||s;return void 0===u||Number.isNaN(u)||"NaN"===u?"-":u}}({config:t,context:r,property:o,node:f}),void 0===u.value)return u;u.label=function(e){var t=e.context,n=e.property,r=e.node,i=e.config.getColorSettings();if(i.label)return i.label;var o=r.data[n];if(o&&"color"!==i.type){var a=t.resources.dataset,s=o.source,l=s.key,c=s.field;return a(l).field(c).title()}}({config:t,context:r,property:o,node:f});var p=null!=l?l:function(e){var t=e.node.attrs;return(null==t?void 0:t.fill)||"#ddd"}({node:f}),h=n("div",{style:{display:"inline-block",width:10,height:10,"background-color":p,margin:"0 8px"}});return u.content.push({content:c?[":",u.label]:[u.label,":"],style:{"text-align":c?"right":"left",direction:rI(u.label)}},{content:c?[u.value,h]:[h,u.value],style:{"text-align":c?"left":"right","vertical-align":"middle",direction:rI(u.value)}}),u}({config:t,h:n,context:r,nodes:i,property:o,filter:s,visibility:l,fillColor:c})}};return i}function oI(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.h,a=e.data,s=e.style,l=i_(a,1)[0],c=function(e){var t=e.config,n=e.nodes.reduce(function(e,n){var r=t.main.getGroupByValue({data:n.data});return e[r]||(e[r]={sorting:Object.keys(e).length,items:[]}),e[r].items.push(n),e},{});return Object.keys(n).map(function(e){return n[e]}).sort(function(e,t){return e.sorting-t.sorting}).map(function(e){return e.items})}({config:r,nodes:l.node.nodes}),u=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.h,o=e.context,a=e.groups,s=o.node.meta,l=o.resources,c=l.dataset,u=l.formatter,d=iI({config:n,h:i,context:o}),f=function(e){var t=e.dataset;return{dataset:{title:function(e,n){return t(e).field(n).title()}}}}({dataset:c}),p=a.map(function(e){var t=d.section({content:o_((n.main.section({expando:r,h:i,nodes:e,dataset:c,formatter:u,meta:s,create:d,util:f})||[]).filter(function(e){var t;return null===(t=e.content)||void 0===t?void 0:t.length})).filter(Boolean)});return t.content=function(e){var t=e.config,n=e.content,r=n.find(function(e){return"color"===e.type&&e.filter}),i=r?n.filter(function(e){return"measure"!==e.type||e.survive.color||e.label!==r.label||e.value!==r.value}):n;return t.main.showDuplicateMeasures?i:i.reduce(function(e,t){var n=t.type,r=t.survive;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;var i="".concat(t.label,"-").concat(t.value);return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e},{memory:{},filtered:[]}).filtered}({config:n,content:t.content}),t});return n.main.sections({chart:t,expando:r,h:i,nodes:o.node.nodes,dataset:c,formatter:u,meta:s,create:d,util:f,sections:p}),p.filter(Boolean)}({chart:t,config:r,expando:i,h:o,context:l,groups:c}),d=function(e){var t=e.translator,n=e.config,r=e.context,i=e.templates,o=n.main.layout,a=o.rows,s=o.grouping,l=o.single,c=function(e){var t=e.limit,n=e.grouping,r=e.single,i={count:0,overflow:0,index:{started:void 0,group:void 0},single:{found:!1,index:0}};return{process:function(e){var o=e.survive,a=e.visibility,s=e.index;if(a.force)return!0;if(i.single.found||(i.single.found=!0,i.single.index=s),r&&s!==i.single.index)return n?(i.index.started!==s&&i.index.group!==s&&(i.overflow++,i.index.group=s),!1):(i.overflow++,!1);if(i.count>=t&&(null==o||!o.visibility)){if(!n)return i.overflow++,!1;if(i.index.started!==s)return i.index.group!==s&&(i.overflow++,i.index.group=s),!1}return a.count&&i.count++,n&&(i.index.started=s),!0},overflow:function(){return i.overflow}}}({limit:a,grouping:s,single:"function"==typeof l?l({meta:r.node.meta,sections:i}):l}),u=i.reduce(function(e,t,n){var r=t.type,o=t.content;"section"===r&&(void 0===o?[]:o).forEach(function(t){c.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content)});var a=n===i.length-1;return"divider"!==r||a||c.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content),e},[]).filter(function(e){return e.length}),d=c.overflow();return d&&u.push(function(e){var t=e.translator,n=e.config,r=e.count,i=t?t.get("Object.ChartTooltip.NMore",r):"+".concat(r," more"),o=rI(i);return[{content:i,style:{"font-weight":"bold","text-align":n.rtl?"right":"left",direction:o},colspan:2}]}({translator:t,config:n,count:d})),u}({translator:n,config:r,context:l,templates:u});return d.length?function(e){var t=e.h,n=e.style;return e.rows.map(function(e){return t("tr",{},e.map(function(e){var r={style:e_(e_({},n.cell||{}),e.style||{}),class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)}))})}({h:o,style:s,rows:d}):function(e){var t=e.h;return t("tr",{},t("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:o})}function aI(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.internal;if(!r.main.key)return!1;var a=SA(),s=$N({key:r.main.key,rtl:r.rtl,duration:r.duration}),l=r.main.events.tooltip,c=l.afterShow,u=l.afterHide,d=function(){var e=a.get("collected");return{expando:i,nodes:e.nodes,meta:e.meta}};return F_(!0,s,{settings:{filter:function(e){return JN({chart:t,config:r,expando:i,internal:o,nodes:e})},extract:function(e){return a.set("collected",e.node),e},content:function(e){var o=e.h,a=e.data,s=e.style;return oI({chart:t,translator:n,config:r,expando:i,h:o,data:a,style:s})},placement:function(e){var t=e.nodes;return r.main.placement({meta:t[0].meta})},afterShow:function(){return c(d())},afterHide:function(){return u(d())}},style:{arrow:{color:r.style.background},content:r.style}})}function sI(e){var t=e.config,n=t.legend.keys;if(!n.tooltip||!n.component)return!1;if("categorical"!==t.getColorSettings().type)return!1;var r=$N({key:n.tooltip,rtl:t.rtl,duration:t.duration});return F_(!0,r,{settings:{filter:function(e){return e.filter(function(e){return e.data&&e.key===n.component})},extract:function(e){return e},content:function(e){var t=e.h,n=e.data;return[t("tr",{},[t("td",{style:e_(e_({},e.style.cell||{}),{"font-weight":"bold","text-align":"left"}),colspan:2},n[0].node.data.label)])]},placement:"pointer"},style:{arrow:{color:t.style.background},content:t.style}})}function lI(e){var t=e.config.main.triggers.reduce(function(e,t){return t.keys.forEach(function(n){var r=t.distance||0;e.distance[n]=r,e.distances.includes(r)||e.distances.push(r),e.key[n]=!0,e.keys[r]||(e.keys[r]=[]),e.keys[r].push(n)}),e},{distance:{},distances:[],key:{},keys:{}});return function(e){return e.components.filter(function(e){return t.key[e.key]}).reduce(function(e,n){e.any=!0,e.components.push(n.key);var r=t.distance[n.key];return 0===r?e.position.push(n.key):(e.distances.includes(r)||(e.distances.push(r),e.distanceKeys[r]=[]),e.distanceKeys[r].push(n.key)),e},{any:!1,components:[],position:[],distances:[],distanceKeys:{}})}}var cI,uI,dI=function(){return!0};function fI(e){var t=e.config.main.triggers.reduce(function(e,t){var n=t.filter;return t.keys.forEach(function(t){e[t]="function"==typeof n?n:dI}),e},{});return function(e){var n=t[e.key];return!n||n(e)}}function pI(e){var t=e.chart,n=e.event,r=e.component,i={absolute:{x:0,y:0},relative:{x:0,y:0}},o=t.element.getBoundingClientRect(),a=o.left,s=o.top;i.absolute.x=(void 0===n.clientX?Math.floor(n.srcEvent.clientX):n.clientX)-a,i.absolute.y=(void 0===n.clientY?Math.floor(n.srcEvent.clientY):n.clientY)-s;var l=t.component(r);if(l){var c=l.rect.computedInner;i.relative.x=i.absolute.x-c.x,i.relative.y=i.absolute.y-c.y}return i}function hI(e){var t=e.chart,n=e.filter,r=e.hits,i=e.position,o=[];if(r.position.length&&o.push.apply(o,o_(t.shapesAt(i.absolute,{components:r.position.map(function(e){return{key:e}})}).filter(n))),!o.length&&r.distances.length){var a=[];r.distances.forEach(function(e){a.push.apply(a,o_(t.shapesAt({cx:i.absolute.x,cy:i.absolute.y,r:e},{components:r.distanceKeys[e].map(function(e){return{key:e}})}).filter(n)))}),a.length&&o.push(function(e){var t=e.nodes,n=e.origin,r=t.find(function(e){return"path"===e.type});if(r)return r;var i=function(e){var t=Math.abs(n.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(n.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(t*t+r*r)};return t.slice(1).reduce(function(e,t){var n=i(t);return n<e.distance&&(e.distance=n,e.node=t),e},{node:t[0],distance:i(t[0])}).node}({nodes:a,origin:i.relative}))}return o}function mI(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=n.delay.tap,s=lI({config:n}),l=fI({config:n}),c=n.main.triggers.reduce(function(e,t){return e.push.apply(e,o_(t.keys)),e},[]);return{key:"event:".concat("tooltipTap"),type:"Tap",options:{event:"tooltipTap",enable:function(e,r){return!r||!!n.enable({event:r})&&t.componentsFromPoint({x:r.center.x,y:r.center.y}).filter(function(e){return-1!==c.indexOf(e.key)}).length>0}},recognizeWith:"tap",events:QD({},"tooltipTap",function(e){if(e.preventDefault(),"mouse"!==e.pointerType&&!n.main.suppress({event:e})){var c=t.component(n.main.key);if(c&&c.show){var u=t.componentsFromPoint({x:e.center.x,y:e.center.y}),d=s({components:u});if(d.any){var f=i_(d.components,1)[0],p=pI({chart:t,event:e,component:f});i.set(BN,p);var h=hI({chart:t,filter:l,hits:d,position:p});if(h.length){var m=h[0].key;n.main.events.tooltip.beforeShow({expando:r,event:e,collectNodes:function(){return o.collectNodes({nodes:h})},meta:{triggerer:m,position:p}}).then(function(){c.emit("show",e,{nodes:h,delay:a})}).catch(function(){})}else c.emit("hide")}else c.emit("hide")}}})}}function gI(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=lI({config:n}),s=fI({config:n}),l=function(e){var t=e.config,n=e.expando,r=e.internal,i=e.facade,o=t.main.events.tooltip.beforeShow,a=t.delay.hover,s={ongoing:{},latest:void 0};return function(e){var t=e.event,l=e.tooltip,c=e.nodes,u=function(e){var t=e.nodes;return JSON.stringify(t.map(function(e){var t;return{key:e.key,bounds:e.bounds,value:null===(t=e.data)||void 0===t?void 0:t.value}}))}({nodes:c});if(!s.ongoing[u]){s.ongoing[u]=!0,s.latest=u;var d=c[0].key;o({expando:n,event:t,collectNodes:function(){return i.collectNodes({nodes:c})},meta:{triggerer:d,position:r.get(BN)}}).then(function(){u===s.latest&&l.emit("show",t,{nodes:c,delay:a})}).catch(function(){l.emit("show")}).finally(function(){delete s.ongoing[u],u===s.latest&&(s.latest=void 0)})}}}({config:n,expando:r,internal:i,facade:o}),c=[n.main.key,n.legend.keys.tooltip].filter(Boolean),u=function(){c.forEach(function(e){var n=t.component(e);null!=n&&n.show&&n.emit("hide")})};return{type:"native",events:{mousemove:function(e){if(n.enable({event:e})&&!n.main.suppress({event:e})){var r=t.componentsFromPoint({x:e.clientX,y:e.clientY}),o=t.component(n.main.key);if(o&&o.show){var c=a({components:r});if(c.any){var u=i_(c.components,1)[0],d=pI({chart:t,event:e,component:u});i.set(BN,d);var f=hI({chart:t,filter:s,hits:c,position:d});if(!f.length)return void o.emit("hide");l({event:e,tooltip:o,nodes:f})}else o.emit("hide")}var p=n.legend;if(p.keys.tooltip&&p.keys.component){var h=t.component(p.keys.tooltip);h&&h.show&&(r.some(function(e){return e.key===p.keys.component})?h.emit("show",e):h.emit("hide"))}}},mouseup:function(e){2===e.button&&u()},mouseleave:function(){n.main.events.interaction.mouseleave({expando:r}),u()},wheel:function(){u()}}}}function yI(e){var t=e.chart,n=e.translator,r=function(e){var t=e.config;return F_(!0,{},{rtl:!1,enable:FN.FALSE,getColorSettings:FN.OBJECT,style:{fontSize:void 0,fontFamily:void 0,color:void 0,background:void 0},delay:{hover:500,tap:0},duration:8e3,main:{key:void 0,suppress:FN.FALSE,getGroupByValue:FN.NOOP,collectibles:[],triggers:[],placement:function(){return{type:"bounds"}},placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:FN.ARRAY,sections:FN.NOOP,events:{tooltip:{beforeShow:function(){return Promise.resolve()},afterShow:FN.NOOP,afterHide:FN.NOOP},interaction:{mouseleave:FN.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},void 0===t?{}:t)}({config:e.config}),i=SA(),o=SA(),a={components:void 0,interactions:void 0};return{getComponents:function(){return a.components||(a.components=function(e){var t=e.config;return[aI({chart:e.chart,translator:e.translator,config:t,expando:e.expando,internal:e.internal}),sI({config:t})].filter(Boolean)}({chart:t,translator:n,config:r,expando:i,internal:o})),a.components},getInteractions:function(){return a.interactions||(a.interactions=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal;return{collectNodes:function(e){var o=e.nodes,a=i_(JN({chart:t,config:n,expando:r,internal:i,nodes:o}),1)[0];return(void 0===a?{nodes:[]}:a).nodes}}}({chart:t,config:n,expando:r,internal:i});return{gestures:[mI({chart:t,config:n,expando:r,internal:i,facade:o})],native:gI({chart:t,config:n,expando:r,internal:i,facade:o})}}({chart:t,config:r,expando:i,internal:o})),a.interactions},expando:i}}var vI=function(){if(uI)return cI;uI=1;var e={};function t(){t.init.call(this)}return e.isObject=function(e){return"object"==typeof e&&null!==e},e.isNumber=function(e){return"number"==typeof e},e.isUndefined=function(e){return void 0===e},e.isFunction=function(e){return"function"==typeof e},cI=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(t){if(!e.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},t.prototype.emit=function(t){var n,r,i,o,a,s;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(n=arguments[1])instanceof Error?n:Error('Uncaught, unspecified "error" event.');if(r=this._events[t],e.isUndefined(r))return!1;if(e.isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];r.apply(this,o)}else if(e.isObject(r)){for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];for(i=(s=r.slice()).length,a=0;a<i;a++)s[a].apply(this,o)}return!0},t.prototype.addListener=function(n,r){var i;if(!e.isFunction(r))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,e.isFunction(r.listener)?r.listener:r),this._events[n]?e.isObject(this._events[n])?this._events[n].push(r):this._events[n]=[this._events[n],r]:this._events[n]=r,e.isObject(this._events[n])&&!this._events[n].warned)&&((i=e.isUndefined(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[n].length>i&&(this._events[n].warned=!0,e.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[n].length),e.isFunction(console.trace)&&console.trace()));return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(t,n){if(!e.isFunction(n))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,n.apply(this,arguments))}return i.listener=n,this.on(t,i),this},t.prototype.removeListener=function(t,n){var r,i,o,a;if(!e.isFunction(n))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,i=-1,r===n||e.isFunction(r.listener)&&r.listener===n)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,n);else if(e.isObject(r)){for(a=o;a-- >0;)if(r[a]===n||r[a].listener&&r[a].listener===n){i=a;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,n)}return this},t.prototype.removeAllListeners=function(t){var n,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(n in this._events)"removeListener"!==n&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],e.isFunction(r))this.removeListener(t,r);else if(Array.isArray(r))for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},t.prototype.listeners=function(t){return this._events&&this._events[t]?e.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},t.listenerCount=function(t,n){return t._events&&t._events[n]?e.isFunction(t._events[n])?1:t._events[n].length:0},cI}(),bI=r(vI);function xI(){const e={};var t;return t=e,Object.keys(bI.prototype).forEach(e=>{t[e]=bI.prototype[e]}),bI.init(t),e.lasso={active:()=>!1},e.select={on:e.on,removeListener:e.removeListener},e}function wI({picasso:t}){const n=e.useOptions(),r=e.useElement(),i=e.useSelections(),[o,a]=e.useState(),s=xI(),l=e.useLayout(),c=e.useTranslator(),u=!!l.qSelectionInfo?.qInSelections,[d,f]=e.useState(!1);return s.lasso=function({layout:e,isInSelections:t,isLassoActionActive:n,setIsLassoActionActive:r,translator:i}){return{active:n,label:i.get(n?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),hidden:!t||!!e.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,action(e){r("boolean"==typeof e?e:!n)},icon:{shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]}}}({layout:l,isInSelections:u,isLassoActionActive:d,setIsLassoActionActive:f,translator:c}),e.useAction(()=>(o&&(o.interactions.lasso.active=()=>d),{...s.lasso}),[o,d,u,c.language()]),e.useEffect(()=>{r.style.overflow="hidden";const e=t({renderer:{prio:[n.renderer||"canvas"]}}),o=e.chart({element:r,data:[],settings:{}}),c=qN({chart:o,actions:s,selections:i,config:{selectionActions:!1}});c.setLayout(l),c.setBrushAliases({colorField:"qDimensionInfo/0/qAttrDimInfo/0"});const u=function(e){var t=e_({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({legendScrollOffset:0,rotation:0});u.intercept("rotation",e=>(u.get("rotation")+e)%(2*Math.PI)),u.onChanged("rotation",()=>{o.update({partialData:!0})});const d=SA();return s.on("selections-start",()=>{o.brush("selection").start()}),a({picasso:e,chart:o,selectionService:c,viewState:u,viewCache:d,interactions:s}),()=>{c.destroy(),o.destroy(),s.removeAllListeners(),delete s.select,u.intercept("rotation",void 0),u.onChanged("rotation",void 0)}},[]),o}var SI,kI;var MI=function(){if(kI)return SI;kI=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return SI=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(h&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(h,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},SI}(),CI=r(MI);const EI=[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]],DI={};EI.forEach(([e,{width:t,height:n}])=>{DI[e]={width:t,height:n}});const _I={getLayoutModes:()=>DI,getLayoutMode(e,t){let n;for(n=0;n<EI.length;++n)if(e>=EI[n][1].width&&t>=EI[n][1].height)return EI[n][0];return"SPARK"}};function qI(e,t){return{layoutModes:_I.getLayoutModes(),center:void 0!==t.minCenterRatio?{minWidthRatio:t.minCenterRatio,minHeightRatio:t.minCenterRatio}:void 0,logicalSize:t.logicalSize?{align:.5,preserveAspectRatio:!0,...t.logicalSize}:void 0}}const AI=/^[A-Z][A-z0-9_]*$/i,TI={getChar(e){let t=e,n=-1;return t>9?(n=65+t-10,n>90&&(n+=6)):t=`${t}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?this.getChar(t+1):String.fromCharCode(n)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}},NI={setValue:(e,t,n)=>{if(!t)return!1;const r=t.split("."),i=r[r.length-1];let o,a=e;for(o=0;o<r.length-1;++o)void 0===a[r[o]]&&(a[r[o]]=Number.isNaN(+r[o+1])?{}:[]),a=a[r[o]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||AI.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>TI.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)};function II(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const OI=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),RI=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),PI=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),LI={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>OI.test(e),isRtlChar:e=>RI.test(e)||PI.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],LI.isLtrChar(r))return"ltr";if(LI.isRtlChar(r))return"rtl"}return"ltr"}},zI={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,n){const r=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&r.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(r.fillTooltip.value):r.fillTooltip.label?r.fillTooltip.label:r.fillTooltip.value,!n.coloring.label){const e=o(r.fillTooltip.source.key).field(r.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===r._fillColor?zI.getNodeFillColor(t):r._fillColor,a},getMeasure:(e,t)=>({label:`${e(t.source.key).field(t.source.field).title()}`,value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some(e=>e.field===t.coloring.field),getTitleRow(e,t){const n=LI.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getDescriptionRow(e,t){const n=LI.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getNMoreRow(e,t,n){const r=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:r,style:{"font-weight":"bold","text-align":n?"right":"left",direction:LI.detectTextDirection(r)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2},{}],getColorRow(e,t,n){const r=LI.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=LI.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,zI.getColorSymbol(e,t)]:[zI.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,r,i=!1){const o=LI.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=LI.detectTextDirection(e.value);let l;return l=i?r?[e.value,zI.getColorSymbol(t,n)]:[zI.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":r?"right":"left",direction:o}},{content:l,style:{"text-align":r?"left":"right",direction:s,"vertical-align":"middle"}}]}};function FI(e){const t=parseInt(e,10);if(!isNaN(t))return t}const jI=e=>t=>e.getContrastingColorTo(t.node.attrs.fill);function VI(e,t){const n=e.styleService.label.value.getStyle();return{padding:10,placements:e.simplifiedPlacements.map(n=>function(e,t,n){const r=n.themeService.getStyles(),i=n.styleService.label.value.getStyle(),o=i.fill===r.label.value.color;return{position:e.position,justify:e.justify,fill:o&&!e.onBackground?jI(t):i.fill,overflow:e.overflow,padding:e.padding}}(n,t,e)),fontSize:FI(n.fontSize),fontFamily:n.fontFamily,label:e.label}}function HI(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var $I;1===($I=HI).length&&($I=function(e){return function(t,n){return HI(e(t),n)}}($I));var BI="$";function WI(){}function UI(e,t){var n=new WI;if(e instanceof WI)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function YI(){}WI.prototype=UI.prototype={constructor:WI,has:function(e){return BI+e in this},get:function(e){return this[BI+e]},set:function(e,t){return this[BI+e]=t,this},remove:function(e){var t=BI+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===BI&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===BI&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===BI&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===BI&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===BI&&++e;return e},empty:function(){for(var e in this)if(e[0]===BI)return!1;return!0},each:function(e){for(var t in this)t[0]===BI&&e(this[t],t.slice(1),this)}};var KI=UI.prototype;YI.prototype={constructor:YI,has:KI.has,add:function(e){return this[BI+(e+="")]=e,this},remove:KI.remove,clear:KI.clear,values:KI.keys,size:KI.size,empty:KI.empty,each:KI.each},CI.bind(null,!0);const XI=[[2,4,6],[2,4],[3]],GI=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function JI(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function QI(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)JI(e[r],t,n)}!function(){let e,t;for(QI(XI,1,10),e=0;e<GI.length;e++)if(GI[e])for(t=0;t<GI[e].length;t++)Array.isArray(GI[e][t])&&QI(GI[e][t])}();var ZI={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qAttrExprInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo","plugins[].validMeasureValue","plugins[].labelBackgroundColor","plugins[].labelColor","plugins[].hasBackground","plugins[].maxLabelWidth","plugins[].points[].validMeasureValue","plugins[].points[].labelBackgroundColor","plugins[].points[].labelColor","plugins[].points[].hasBackground","plugins[].points[].maxLabelWidth"]};function eO(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=CI(!0,{},{...n,qHyperCube:{...s}}),{dataRelatedPropertiesPaths:c}=ZI;function u(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==bA(e,t)&&wA(e,t,void 0));const r=t.substring(0,n),i=t.substring(n+2),o=i.startsWith(".")?i.substring(1):i;bA(e,r,[]).forEach(e=>{o&&u(e,o)})}return c.forEach(e=>{u(l,e)}),l}var tO={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){if("line"===i.type)return i.tickValue??"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter(e=>"text"===e.type).map(e=>e.text);return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,c=a.y-s.y,u=a.width-s.width,d=a.height-s.height;e?("left"===i&&o.forEach(e=>{"line"===e.type?(e.x1+=u,e.x2+=u):"text"===e.type&&(e.x+=u)}),"left"!==i&&"right"!==i||o.forEach(e=>{"line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type&&(e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))}),"top"!==i&&"bottom"!==i||o.forEach(e=>{"line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type&&(e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))})):t?o.forEach(e=>{"line"===e.type?e.y1===e.y2?e.x2+=u:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)}):n||r?o.forEach(e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+u)}):o.forEach(e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=c,e.y2+=c+d)})}}},bars:{trackBy:function(e){return e.data.typeIndex?`${e.data.value} ${e.data.typeIndex.value}`:e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{e.opacity=0})})}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)})},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){return"line"===e.type?e.value??Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;e.forEach(e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/e.minor.size;e.points.forEach(e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)})}})}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach(e=>{e.opacity=0})}},markers:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{switch(e.type){case"circle":e.cx-=r,e.cy-=i;break;case"rect":e.x-=r,e.y-=i;break;case"path":e.transform=`translate(${-r}, ${-i})`}})}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{"image"===e.type?(e.x-=r,e.y-=i):(e.cx-=r,e.cy-=i)})}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-r,l=-i;e.forEach(e=>{switch(e.dock){case"right":r>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}})}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=eO(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=eO(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};function nO(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}var rO=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},iO=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return rO.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return rO.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||rO.newInstanceIfNeeded(e,t,this._value)}},oO=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new iO);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};(()=>{const e=[],t=[],n=new oO;let r,i,o;for(r in e["&quot"]="34",e["&amp"]="38",e["&lt"]="60",e["&gt"]="62",e["&nbsp"]="160",e["&iexcl"]="161",e["&cent"]="162",e["&pound"]="163",e["&curren"]="164",e["&yen"]="165",e["&brvbar"]="166",e["&sect"]="167",e["&uml"]="168",e["&copy"]="169",e["&ordf"]="170",e["&laquo"]="171",e["&not"]="172",e["&shy"]="173",e["&reg"]="174",e["&macr"]="175",e["&deg"]="176",e["&plusmn"]="177",e["&sup2"]="178",e["&sup3"]="179",e["&acute"]="180",e["&micro"]="181",e["&para"]="182",e["&middot"]="183",e["&cedil"]="184",e["&sup1"]="185",e["&ordm"]="186",e["&raquo"]="187",e["&frac14"]="188",e["&frac12"]="189",e["&frac34"]="190",e["&iquest"]="191",e["&Agrave"]="192",e["&Aacute"]="193",e["&Acirc"]="194",e["&Atilde"]="195",e["&Auml"]="196",e["&Aring"]="197",e["&AElig"]="198",e["&Ccedil"]="199",e["&Egrave"]="200",e["&Eacute"]="201",e["&Ecirc"]="202",e["&Euml"]="203",e["&Igrave"]="204",e["&Iacute"]="205",e["&Icirc"]="206",e["&Iuml"]="207",e["&ETH"]="208",e["&Ntilde"]="209",e["&Ograve"]="210",e["&Oacute"]="211",e["&Ocirc"]="212",e["&Otilde"]="213",e["&Ouml"]="214",e["&times"]="215",e["&Oslash"]="216",e["&Ugrave"]="217",e["&Uacute"]="218",e["&Ucirc"]="219",e["&Uuml"]="220",e["&Yacute"]="221",e["&THORN"]="222",e["&szlig"]="223",e["&agrave"]="224",e["&aacute"]="225",e["&acirc"]="226",e["&atilde"]="227",e["&auml"]="228",e["&aring"]="229",e["&aelig"]="230",e["&ccedil"]="231",e["&egrave"]="232",e["&eacute"]="233",e["&ecirc"]="234",e["&euml"]="235",e["&igrave"]="236",e["&iacute"]="237",e["&icirc"]="238",e["&iuml"]="239",e["&eth"]="240",e["&ntilde"]="241",e["&ograve"]="242",e["&oacute"]="243",e["&ocirc"]="244",e["&otilde"]="245",e["&ouml"]="246",e["&divide"]="247",e["&oslash"]="248",e["&ugrave"]="249",e["&uacute"]="250",e["&ucirc"]="251",e["&uuml"]="252",e["&yacute"]="253",e["&thorn"]="254",e["&yuml"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["&notin"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)))})(),"undefined"!=typeof document&&document.createElement("div");for(let e=0;e<255;e++)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e.toString(16);const aO={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function sO(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const lO={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise(a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,c=o[t]*(n>l?1:n/l),u=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(c,n),width:Math.min(u,l)},r()):(e={height:c,width:u},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{i(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function cO(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,n,r,i,o,a;if(e&&(e.session?.options||e.enigmaModel?.session?.sessionConfig||e.session?.config?.url)){if(t=e.session.options||e.enigmaModel?.session.sessionConfig,!t){t=e.session?.config;const n=new URL(t.url);t.host=n.hostname,t.port=n.port,t.isSecure="wss:"===n.protocol}return a=void 0!==t.secure?t.secure:t.isSecure,n=a?"https://":"http://",r=t.host||"localhost",i=t.port?`:${t.port}`:"",o=t.prefix?t.prefix:"/","/"!==o[o.length-1]&&(o=`${o}/`),n+r+i+o}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await lO.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function uO(e,t,n,r){const{app:i,flags:o}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",c=s.type||"media";let u=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){u=e;break}const d=r.data?.customTooltipAttrExps?.value||[];let f;if(-1!==u&&d[u]&&(f=d[u]),"media"===c&&s.ref?.qStaticContentUrl?.qUrl)return cO(s,l,i);if("url"===c)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&sO(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await lO.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await lO.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(i,o,s,l,f);if(o.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===c&&f&&f.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(sO(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await lO.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(i,n[u],l,f)}return[]}const dO={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(uO(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},fO={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await dO.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>dO.checkIfPromisesExist({customTooltipModel:e})};const pO=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,r=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,o=t;return{qInfo:{qType:aO.CHART.CHART_PARENT_TYPE,qId:aO.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:o}},hO=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:aO.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const mO={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",r=aO.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:r,height:r,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:aO.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":r}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{const a=i,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await mO.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=aO.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const s=await async function({app:e,properties:t,customTooltipModel:n}){const r=n;r.miniChartToken.sessionObj?.id&&await e.destroySessionObject(r.miniChartToken.sessionObj.id);const i=aO.CHART.STATE,o=pO(t,i),a=await e.createSessionObject(o),s=hO(t);if(a.id!==aO.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);r.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(r.miniChartToken.sessionObj&&r.miniChartToken.sessionObj.id===a.id)return r.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:i});if(a.miniChartToken.alternateState&&a.miniChartToken.sessionObj&&s){const e=n.length>0&&void 0!==n[0].data?.value?[n[0].data?.value]:[],s=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){const e=n[0].data.selectionOuterDimension??n[0].data.selectionDimension;if(e?.source?.field){const t=e?.source?.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(aO.CHART.CONTAINER_ID),c={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await i.embed.render({element:l,model:a.miniChartToken.model,options:c,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch(t){await mO.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(mO.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(aO.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=aO.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{const t=e;"function"==typeof t.miniChartToken?.vis?.destroy&&(t.miniChartToken.vis.destroy(),t.miniChartToken.vis=void 0)}};function gO(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function yO(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=aO.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function vO(e){const t=yO();return e.filter(e=>t[e.id])}const bO={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const o=t.data?.selectionDimension??t.data;if(!o||t.data?.customTooltipAttrExps||i[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===o.value&&t.label===o.label});t.length>0&&(r=r.concat(t[0]))}}),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=bO.getAttrExprData(a);o.length||n.length?fO.handlePromises({customTooltipModel:i,nodes:bO.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else i?.miniChartToken?.alternateState&&mO.hide({app:r.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>fO.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,r=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[r]||(n[r]=[]),n[r]},getAttrExprData(e){let t=[],n="";const r=e.qHyperCube?.qDimensionInfo||[];if(r.length>0){const i=r.length-1;t=e.qHyperCube?.qDimensionInfo?.[i]?.qAttrExprInfo||[],n=`qDimensionInfo/${i}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[aO.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[aO.CUSTOM.QUARANTINE]=[],e.forEach(e=>{r.quarantine[aO.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=r}(vO(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[aO.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[aO.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=gO(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===vO(i).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...i,...t],o=e;o.qHyperCubeDef?o.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:o.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let r=[];const i=gO(e)||[];[...i,t].forEach(e=>{const t=vO(e.qAttributeExpressions||[]);t.length>0&&(r=t)});const o=yO(),a=i.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!o[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows:e=>e.tooltip?.hideBasic||0,DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:LI.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=LI.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function xO(e,t,n,r){const i=t.qHyperCube?.[n]?.[r]?.qAttrExprInfo||[],o=[],a=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return a?(i.forEach((e,t)=>{const i=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===i?"NaN":function(e,t){let n;switch(e.id){case aO.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case aO.CUSTOM.TITLE:case aO.CUSTOM.DESCRIPTION:case aO.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);o.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:s,value:"value"})}),o):o}const wO={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>xO(t,e,r,n)}}};const SO={getCustomAttrExps(e,t,n){const r={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},i=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(i))return r;return function(e,t,n,r){const i={[aO.CUSTOM.TITLE]:!0,[aO.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=bO.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach((e,o)=>{const s=t[o];if(e.id===aO.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===aO.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),r}(n,i.map(t=>zI.getMeasure(e,t)),e,r)}};function kO({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach(e=>{r.push(SO.getCustomAttrExps(n,e,t))}),r}(e,t,n);return r.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function MO(e){const t=aO.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function CO(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}const EO={migrateProperties(e){const t=CI(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let r=CO(t);return r=function(e,t){return t.concat(e.map(e=>MO(e)))}(n,r),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(r,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,r=function(e,t,n){let r=e.length;const i=[];return t.forEach(e=>{const t=MO(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++}),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(CO(e),t,n);return r},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){const n=new Promise(n=>{const r=t.qHyperCube?.qDimensionInfo||[],i=t.tooltip?.data?.qHyperCube||{},o=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(i,r)&&e.getEffectiveProperties().then(t=>{if(o){const r=this.migrateProperties(t);e.setProperties(r).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const r=this.getPatches(t);e.applyPatches(r,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)});return n}};var DO={attrExpr:EO};const{CUSTOM:_O}=aO;function qO({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:c}){const u={properties:void 0},d=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:bO,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),f="rtl"===c.direction,p=()=>{const e=!!u.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{u.properties=e},isEnabled:()=>p(),hideBasic:()=>p()&&bA(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const r=kO({dataset:e,nodes:n,layout:t});return{title:r.customTooltipInfoAttrExpsArr.find(e=>e.id===_O.TITLE)?.title,description:r.customTooltipInfoAttrExpsArr.find(e=>e.id===_O.DESCRIPTION)?.value,measures:r.customTooltipAttrExpsArr}},hasImages:()=>bO.checkIfPromisesExist({customTooltipModel:d}),createImageRow:({value:e,h:t})=>bO.getImageRow(e,{h:t,rtl:f}),addImages:({nodes:r})=>{const i=bO.getDataNodes(o,r),{attrExps:a}=bO.getAttrExprData(t);return fO.handlePromises({customTooltipModel:d,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(p()&&t.tooltip?.chart?.object?.refId&&l&&"function"==typeof r?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>mO.createContainer({layout:t,ctx:{h:e,rtl:f}}),createLimitationRow:()=>bO.getFooterRow(a.get("properties.tooltip.notselectedmessage"),f),show:({nodes:e,properties:t})=>mO.show({app:n,properties:t,selectedNodes:e,customTooltipModel:d,rtl:f}),hasAlternateState:()=>!!d.miniChartToken?.alternateState,hide:()=>mO.hide({app:n,customTooltipModel:d}),destroy:()=>mO.destroyVisualization({customTooltipModel:d})}}}function AO(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{DIMENSION_TITLE:"dimension-title",SLICES:"slices",PIE_LABELS:"pie-labels"}}}}function TO({flags:t,picasso:n,instance:r}){const i=e.useModel(),o=e.useApp(),a=e.useTranslator(),s=e.useElement(),[l,c]=e.useState(),u=e.useStaleLayout(),d=e.usePlugins(),f=e.useConstraints(),p=e.useOptions(),h=e.useTheme(),{qLocaleInfo:m}=e.useAppLayout(),g=e.useEmbed();return e.useEffect(()=>{if(!r)return;s.style.overflow="hidden";const e=function(e){var t,n=e.app,r=e.translator,i={initialized:!1,dimensions:[],measures:[]};return{initialize:(t=JD(n_().m(function e(t){var o,a,s,l,c,u,d;return n_().w(function(e){for(;;)switch(e.n){case 0:if(o=t.properties,!i.initialized){e.n=1;break}return e.a(2);case 1:return s=[I_(a={app:n,translator:r,properties:o}),P_(a)],e.n=2,Promise.all(s);case 2:l=e.v,c=i_(l,2),u=c[0],d=c[1],i.dimensions=u,i.measures=d,i.initialized=!0;case 3:return e.a(2)}},e)})),function(e){return t.apply(this,arguments)}),getAlternatives:function(){return{dimensions:o_(i.dimensions),measures:o_(i.measures)}}}}({app:o,translator:a}),l=pA({picasso:r.picasso,model:i,app:o,translator:a,config:{auto:!1,key:"fill"}}),y=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return JD(n_().m(function e(){var r,a,s,l;return n_().w(function(e){for(;;)switch(e.n){case 0:if(!o.initialized){e.n=1;break}return e.a(2);case 1:return a=Promise.all(n.filter(function(e){return"custom-component"===e.info.type}).map(function(){var e=JD(n_().m(function e(n){var r;return n_().w(function(e){for(;;)switch(e.n){case 0:if(n.info.componentName){e.n=1;break}throw new Error("plugin-service: Custom component is missing componentName");case 1:return e.n=2,n.fn(e_({},i));case 2:if("object"===a_(r=e.v)){e.n=3;break}throw new Error("plugin-service: Custom component needs to be an object");case 3:t.component(n.info.componentName,r);case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter(function(e){return"component-definition"===e.info.type}).map(function(e){return e.fn(e_({},i))})),e.n=2,Promise.all([a,s]);case 2:l=e.v,o.initialized=!0,(r=o.definitions).push.apply(r,o_(l[1]));case 3:return e.a(2)}},e)}))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach(function(t){var n=i_(e.filter(function(e){return e.key&&e.key===t.key}),1)[0];if(n){var r=F_(!0,{},n.brush);F_(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===a_(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=MA({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=MA({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)}),e):e}}}({picassoInstance:r.picasso,plugins:d,pluginArgs:AO(u)}),v=qO({flags:t,layout:u,app:o,model:i,picasso:n,chart:r.chart,translator:a,localeInfo:m,embed:g,options:p}),b=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,c=r.extend,u=void 0===c?[]:c,d={theme:t,matrix:PN(a),styles:void 0};return d.styles=zN({theme:t,id:i,transform:l,extend:u,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=zN({theme:e,id:i,transform:l,extend:u,matrix:d.matrix})}}}({theme:h,config:{id:"pieChart",resolve:[["object","label.name","color","#595959"],["object","label.name","fontFamily"],["object","label.name","fontSize","12px"]]}}),x=function({chart:e,translator:t,layout:n,constraints:r,options:i,themeService:o,colorService:a,custom:s}){const l=n.qHyperCube.qMeasureInfo.length>1,c="rtl"===i.direction,{fontFamily:u}=o.getStyles();return yI({chart:e,translator:t,config:{rtl:c,enable:()=>!r.passive,getColorSettings:()=>a.getSettings(),style:{fontFamily:u},main:{key:"tooltip",getGroupByValue:({data:e})=>e.value,collectibles:[{key:"slices",type:"slice",major:({data:e})=>e.value}],triggers:[{keys:["slices"],collect:{from:"single"},placement:"collectible"},{keys:["pie-labels","negative-indicators"],collect:{from:"dimension",by:({data:e})=>e.value},placement:"trigger"}],placement:({meta:e})=>({type:"slices"===e.triggerer?"slice":"bounds"}),section:({h:e,nodes:n,dataset:r,formatter:i,create:o,util:a})=>{const[c]=n,{title:u,description:d,measures:f}=s.isEnabled()?s.getAttributes({dataset:r,nodes:n}):{},p=[];u&&p.push(o.text({value:u,style:{bold:!0}})),d&&p.push(o.text({value:d}));const h=s.hideBasic();if(h&&!f.length&&(u||d)||p.push(o.text({value:c.data.label,style:{bold:!0}})),!h){p.push(o.color({nodes:n,property:"fill"}));const{num:e}=c.data;if(p.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label})),l){const{radius:e}=c.data;p.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label}))}p.push(o.measure({label:t?t.get("properties.dataPoints.labelmode.share"):"Share",value:i("share")(c.desc.share)}))}f&&p.push(...f.map(e=>o.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}}))),s.chart.isEnabled()&&(s.chart.hasLimitation()?(s.chart.destroy(),p.push(o.raw({value:s.chart.createLimitationRow()}))):p.push(o.raw({value:s.chart.createContainer({h:e})})));const{customTooltipImages:m}=c.data;return s.isEnabled()&&m&&p.push(...m.map(t=>o.raw({value:s.createImageRow({value:t,h:e})}))),p},layout:{grouping:!0},events:{tooltip:{beforeShow:({collectNodes:e})=>s.isEnabled()&&s.hasImages()?s.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{s.chart.isEnabled()&&!s.chart.hasLimitation()&&s.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{s.chart.isEnabled()&&s.chart.hasAlternateState()&&s.chart.hide()}}}},legend:{keys:{tooltip:"legend-color-cat",component:"legend-cat"}}}})}({chart:r.chart,translator:a,layout:u,constraints:f,options:p,themeService:b,colorService:l,custom:v}),w=function({layout:e,themeService:t,colorService:n,flags:r}){const i=t.getStyles(),o=t=>r.isEnabled("CLIENT_IM_3050")?e.components?.find(e=>e.key===t):void 0,a=(e,t)=>{const r=n.getPaletteColor;if(e?.color&&r){const n=r(e);return"none"===n&&e.index>0?e?.color??t:n??t}return t};return{axis:{title:{getStyle:()=>{const e=o("axis")?.axis?.title;return{fontFamily:e?.fontFamily??i.axis.title.fontFamily,fontSize:e?.fontSize??i.axis.title.fontSize,color:a(e?.color,i.axis.title.color)}}}},label:{name:{getStyle:()=>{const e=o("label")?.label?.name;return{fill:a(e?.color,i.label.name.color),fontSize:e?.fontSize??i.label.name.fontSize,fontFamily:e?.fontFamily??i.label.name.fontFamily}}},value:{getStyle:()=>{const e=o("label")?.label?.value;return{fill:a(e?.color,i.label.value.color),fontSize:e?.fontSize??i.label.value.fontSize,fontFamily:e?.fontFamily??i.label.value.fontFamily}}}},legend:{title:{getStyle:()=>{const e=o("legend")?.legend?.title;return{fontFamily:e?.fontFamily??i.legend.title.fontFamily,fontSize:e?.fontSize??i.legend.title.fontSize,color:a(e?.color,i.legend.title.color)}}},label:{getStyle:()=>{const e=o("legend")?.legend?.label;return{fontFamily:e?.fontFamily??i.legend.label.fontFamily,fontSize:e?.fontSize??i.legend.label.fontSize,color:a(e?.color,i.legend.label.color)}}}}}}({layout:u,themeService:b,colorService:l,flags:t}),S=function({layout:e}){const t=({ds:e,encodings:t})=>{const n={field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}};return t.slice.outerRadius&&(n.props.radius={field:t.slice.outerRadius}),e.extract(n)},n=({rows:e,encodings:t})=>t.slice.outerRadius?e.filter(e=>"NaN"!==e.num.value&&"NaN"!==e.radius.value):e.filter(e=>"NaN"!==e.num.value),r=({rows:t,encodings:n})=>n.slice.outerRadius&&!e.donut.showAsDonut?t.filter(e=>e.num.value>0&&e.radius.value>0):t.filter(e=>e.num.value>0);return vA({layout:e,config:{args:{},disclaimers:{NoDataExist:{condition:({ds:e,encodings:n})=>0===t({ds:e,encodings:n}).length},LimitedData:{condition:()=>{const t=NI.getValue(e,"qHyperCube.qSize.qcy");return NI.getValue(e,"qHyperCube.qDataPages.0.qArea.qHeight")<t}},OnlyNanData:{condition:({ds:e,encodings:r})=>{const i=t({ds:e,encodings:r});return 0===n({rows:i,encodings:r}).length}},OnlyNegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i});return 0===r({rows:a,encodings:i}).length}},NegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i}),s=a,l=r({rows:a,encodings:i});return s.length!==l.length}}}}})}({layout:u});c({alternativeService:e,colorService:l,disclaimerService:S,pluginService:y,themeService:b,tooltipService:x,styleService:w})},[i,o,r,u,a.language(),f,p.direction,h.name()]),l}const NO=e=>"[object Object]"===Object.prototype.toString.call(e),IO=e=>Array.isArray(e);function OO(e,t){if(e===t)return!0;if(IO(e)){if(!IO(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!OO(e[n],t[n]))return!1;return!0}if(NO(e)){if(!NO(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++){if(!Object.hasOwn(t,n[r]))return!1;if(!OO(e[n[r]],t[n[r]]))return!1}return!0}return e===t}function RO({enable:t=!0}={}){const n=e.useModel(),r=()=>Date.now().toString()+Math.random(),[i,o]=e.useState(r()),a={properties:void 0};return e.useEffect(()=>{if(!n||!n.getEffectiveProperties||!t)return()=>{};const e=()=>{n.getEffectiveProperties().then(e=>{const t=CI(!0,{},e);if(!a.properties)return void(a.properties=t);const n=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const r=CI(!0,{},e),i=CI(!0,{},t);return n.exclude=!OO(r.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete r.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!OO(r,i),n}(a.properties,t);a.properties=t,n.exclude&&!n.properties&&o(r())})};return n.on("changed",e),e(),()=>{n.removeListener("changed",e)}},[t]),i}function PO({scaleKey:e,legend:t,onEdited:n}){const{layout:r}=t,{dock:i}=r||{};return{type:"brush-range",key:"legendRangeBrush",layout:{dock:"@legend-seq"},on:n?{bubbleEnd(){n()}}:{},settings:{brush:"selection",scale:`${e}Range`,direction:"left"===i||"right"===i?"vertical":"horizontal",bubbles:{align:"left"===i||"top"===i?"end":"start",placement:"outside"},target:{selector:'[id="legend-seq-target"]',fillSelector:'[id="legend-seq-ticks"]',fill:"rgba(82,204,82,0.2)"}}}}const LO=.8,zO=.55,FO={CORNER_RADIUS:0,INNER_RADIUS:zO,STROKE:{COLOR:"#FFFFFF",WIDTH:{NONE:0,SMALL:2,MEDIUM:4,LARGE:6}}},jO=({layout:e},t,n)=>t.encodings.slice.outerRadius?{scale:"radius",fn:t=>{let r=LO,i=0;const o=n?.style?.innerRadius??zO;e.donut.showAsDonut&&(r=LO-o,i=o);return t.scale(Math.max(0,t.datum.radius.value))*r+i}}:LO,VO=({layout:e},t,n)=>{if(!e.donut.showAsDonut)return 0;const r=n?.style?.innerRadius??zO;return t.encodings.slice.outerRadius?{scale:"radius",fn:e=>{const t=LO-r,n=r;return e.scale(Math.min(0,e.datum.radius.value))*t+n}}:r},HO=({layout:e},t)=>{const n=t.colorService.getDatumProps(),r=n[Object.keys(n)[0]],i=r&&r.field?r.field:void 0,o="qDimensionInfo/0"===i,a=i?t.ds.field(i).raw():null,s=a&&(a.label||a.title||a.qFallbackTitle)||"",l=t.encodings.slice.outerRadius,{formatter:c}=t.chart,u=NI.getValue(e,"qHyperCube.qDimensionInfo",[]).length;function d(e,n){const r=t.ds.field(e).raw();return{field:e,label:!r.isCustomFormatted&&(r.qIsAutoFormat||"U"===r.qNumFormat.qType)?e=>c(n)(e.qNum):e=>e.qText}}const f=(e.components||[]).filter(e=>"slices"===e.key)[0];return{type:"pie",key:"slices",data:{extract:{field:"qDimensionInfo/0",props:{...n,num:d(t.encodings.slice.arc,"arc"),fillTooltip:i?{field:i,label:s,value:e=>o?e.qText||"-":void 0!==e.qNum&&"NaN"!==e.qNum?e.qText?e.qText:e.qNum:e.qText||"-"}:void 0,customTooltipAttrExps:0!==u?wO.getNode(e,{dimensionCount:u}):void 0,radius:l?d(l,"outerRadius"):void 0}}},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3},active:{stroke:"rgba(52, 52, 52, 0.7)",strokeWidth:2}}},{context:"highlight",data:[""],style:{inactive:{fill:"#BFDAD9"},active:{fill:"#68B2AF"}}}]},settings:{startAngle:()=>t.viewState.get("rotation"),endAngle:()=>t.viewState.get("rotation")+2*Math.PI,slice:{arc:{ref:"num"},innerRadius:VO({layout:e},t,f),fill:t.colorService.getColor(),strokeWidth:f?.style?.strokeWidth?FO.STROKE.WIDTH[f.style.strokeWidth.toUpperCase()]:FO.STROKE.WIDTH.NONE,stroke:f?.style?.strokeColor?.color??FO.STROKE.COLOR,outerRadius:jO({layout:e},t,f),cornerRadius:f?.style?.cornerRadius??0}},animations:{enabled:t.animations.enabled,isMainComponent:!0}}};function $O({layout:e},t){const n=(e.components||[]).filter(e=>"slices"===e.key)[0],r=n?.style?.innerRadius??zO,i=t.encodings.slice.outerRadius,o=t.themeService.getStyles();return!(!e.donut.showAsDonut||!i)&&{type:"pie",key:"zeroLine",data:{items:[1]},settings:{slice:{arc:1,fill:"transparent",innerRadius:0,strokeWidth:1,stroke:o.label.name.color,outerRadius:{scale:"radius",fn:e=>{const t=LO-r,n=r;return e.scale(0)*t+n}}}},animations:{enabled:t.animations.enabled}}}function BO(e){return{type:"pie-dividers",key:"pie-dividers",layout:{displayOrder:2},settings:{component:"slices",selector:"path"},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:e.animations.enabled,trackBy:()=>Math.random()}}}function WO({layout:e},t){if(e.donut.showAsDonut||!t.encodings.slice.outerRadius)return!1;return{type:"negative-indicators",key:"negative-indicators",layout:{displayOrder:2},settings:{component:"slices",selector:"path",offset:5,size:4,fill:t.themeService.getStyles().label.name.color},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:t.animations.enabled}}}function UO(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function YO(e){return e.node.data.num.label}function KO(e){return e.node.data.radius.label}function XO(e,t,n){if(e.dataPoint.auto)return n?YO:UO;if("share"===e.dataPoint.labelMode)return UO;if("value"===e.dataPoint.labelMode){return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?KO:YO}return null}function GO({data:e}){return e?e.label:""}function JO(e){const t=parseInt(e,10);if(!isNaN(t))return t}function QO(e){const t=((e&&e.components?e.components:void 0)||[]).filter(e=>"slices"===e.key)[0];return(t?.style?.innerRadius??zO)>.3}function ZO({node:e,data:t}){return CI({_share:e.desc.share,_fillColor:e.attrs.fill},t)}function eR(e,t,n){const r=t.styleService.label.name.getStyle(),i=[{padding:10,direction:t.encodings.slice.outerRadius?"rotate":"horizontal",placements:[{position:"outside",padding:t.encodings.slice.outerRadius?4:2,fill:r.fill}],fontSize:JO(r.fontSize),fontFamily:r.fontFamily,label:GO,linkData:({node:e,data:t})=>CI({_share:e.desc.share,_fillColor:e.attrs.fill,_showTooltip:!0},t)}];if(XO(e,t,!1)){const r=function(e,t,n){return{label:XO(e,t,!1),simplifiedPlacements:[{position:e.donut.showAsDonut&&QO(e)?"inside":"into",onBackground:e.donut.showAsDonut&&QO(e),padding:4}],theme:n.theme,themeId:"object.pieChart"}}(e,t,n),o=VI(CI(t,r),n.theme);o.linkData=ZO,i.push(o)}return{key:"pie-labels",type:"labels",renderer:nO(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"slice",settings:{labels:i}}}]},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}function tR({layout:e,context:t},n){return!1!==e.dataPoint.show&&(1===n.dataRowCount?function(e,t,n){const r=XO(e,t,!0),i=(o=n.theme,e=>o.getContrastingColorTo(e.node.attrs.fill));var o;const a=t.themeService.getStyles(),s=t.styleService.label.name.getStyle(),l=t.styleService.label.value.getStyle(),c=s.fill===a.label.name.color,u=l.fill===a.label.value.color;return{key:"pie-labels",type:"labels",renderer:nO(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"rows",settings:{align:.5,justify:.5,padding:10,labels:[{fontSize:JO(s.fontSize),fontFamily:s.fontFamily,fill:c&&!e.donut.showAsDonut?i:s.fill,label:GO,linkData:({data:e})=>e},{fontSize:JO(l.fontSize),fontFamily:l.fontFamily,fill:u&&!e.donut.showAsDonut?i:l.fill,label:r,linkData:({data:e})=>e}]}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}(e,n,t):eR(e,n,t))}const nR=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendRange",enable(t,n){if(this.started||!n)return!0;if(e.constraints.select||e.constraints.active)return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-seq"===e.type),i=(r||function(e){const{target:t}=e.srcEvent;return!(!t||!(t.hasAttribute("data-other-value")&&t.hasAttribute("data-idx")||"INPUT"===t.nodeName))}(n))&&!e.isLocked([this.chart.component("slices")]);return i||this.chart.component("legendRangeBrush").emit("rangeClear"),i}},events:{legendRangestart(t){t.preventDefault(),e.interactions.emit("selections-start"),this.chart.component("legendRangeBrush").emit("rangeStart",t),this.started=!0},legendRangemove(e){e.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeMove",e)},legendRangeend(t){t.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeEnd",t),e.onSelect(),this.started=!1}}});function rR(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}function iR(e,t){const n=t.component("slices");if(!n)return!1;const{x:r,y:i}=rR(e,t),o=n.rect.x+n.rect.margin.left+n.rect.width/2,a=n.rect.y+n.rect.margin.top+n.rect.height/2,s=Math.min(n.rect.width,n.rect.height)/2*LO;return(o-r)**2+(a-i)**2<=s**2}const oR=(e,t,{requireFailure:n,recognizeWith:r}={})=>({type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"tap",interval:10,pointers:1,enable(t,n){return!n||!e.constraints.select&&!e.constraints.active&&(this.components=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>"slices"===e.key||"legend-cat"===e.key||"pie-labels"===e.key),this.components.length)}},events:{tap(n){n.preventDefault();const{target:r}=n.srcEvent;if(r&&("INPUT"===r.nodeName||r.hasAttribute("data-other-value")))return void this.chart.component("legendRangeBrush").emit("bubbleStart",n);if(r&&r.hasAttribute("data-action")&&r.hasAttribute("data-component-key"))return void this.chart.component(r.getAttribute("data-component-key")).emit(r.getAttribute("data-action"));if(r&&r.children&&r.children[0]&&"legend-cat"===r.children[0].getAttribute("data-component-key"))return;if(e.isLocked(this.components))return;e.interactions.emit("selections-start");let i=rR(n,this.chart);this.components.some(e=>"legend-cat"===e.key)&&(i={cx:i.x,cy:i.y,r:5});const o=this.chart.shapesAt(i,{components:[{key:"slices",propagation:"stop"},{key:"legend-cat",propagation:"stop"},{key:"pie-labels",propagation:"stop"}],propagation:"stop"});o.length&&(this.chart.brushFromShapes(o,{components:[{key:o[0].key,action:n.srcEvent.ctrlKey||t?"set":"toggle",contexts:["selection"]}]}),e.onSelect())}}}),aR=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"lasso",enable(t,n){if(this.isStarted||!n)return!0;if(e.constraints.active||e.constraints.select||!e.interactions.lasso.active())return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return!e.isLocked(r)&&r.some(e=>"slices"===e.key)}},events:{lassostart(t){t.preventDefault(),e.constraints.select||e.constraints.active||this.isStarted||(e.interactions.emit("selections-start"),this.chart.component("lasso").emit("lassoStart",t),this.isStarted=!0)},lassomove(e){e.preventDefault(),this.chart.component("lasso").emit("lassoMove",e)},lassoend(t){t.preventDefault(),this.isStarted=!1,this.chart.component("lasso").emit("lassoEnd",t),e.onSelect()}}}),sR=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"areatap",pointers:2,enable(t,n){if(this.started||!n)return!0;if(e.constraints.active||e.constraints.select)return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return r.some(e=>"slices"===e.key)&&!e.isLocked(r)}},events:{areatap(t){const n=this.chart.component("area");n&&!this.started&&(e.interactions.emit("selections-start"),n.emit("areaStart",t.pointers[0]),n.emit("areaMove",t.pointers[1]),this.started=!0,setTimeout(()=>{n.emit("areaEnd"),e.onSelect(),this.started=!1},100)),t.preventDefault()}}});function lR(e){return{type:"native",key:"theusual",events:{wheel(t){let n=!1;if(!e.constraints.active&&iR(t,this.chart)){const r=Math.sign(-t.deltaY);e.viewState.set("rotation",r*(Math.PI/12)),n=!0}else if(!e.constraints.select&&!e.constraints.active){const e=this.chart.componentsFromPoint(t).filter(e=>"legend-cat"===e.key)[0];e&&(n=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,e))}n&&t.preventDefault()}}}}const cR=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"rotate",pointers:1,threshold:10,enable(t,n){return!(!this.started&&n)||!e.constraints.active&&!e.interactions.lasso.active()&&iR(n,this.chart)}},events:{rotatestart(e){e.preventDefault();const t=this.chart.component("slices").rect,n=this.chart.element.getBoundingClientRect();this.pieCenter={x:n.left+t.x+t.width/2,y:n.top+t.y+t.height/2},this.prevAngle=Math.atan2(e.center.y-this.pieCenter.y,e.center.x-this.pieCenter.x),this.started=!0},rotatemove(t){t.preventDefault();const n=Math.atan2(t.center.y-this.pieCenter.y,t.center.x-this.pieCenter.x);e.viewState.set("rotation",n-this.prevAngle),this.prevAngle=n},rotateend(e){e.preventDefault(),this.started=!1},rotatecancel(e){e.preventDefault(),this.started=!1}}}),uR=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendPan",pointers:1,threshold:10,enable(t,n){return!(!this.isStarted&&n)||!e.constraints.active&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-cat"===e.type)}},events:{legendPanstart(e){if(e.preventDefault(),!this.isStarted){this.components=this.chart.componentsFromPoint({x:e.center.x,y:e.center.y}),this.components.forEach(t=>{t.emit("panstart",e)}),this.isStarted=!0;const t=this.chart.component("tooltip");t&&t.show&&t.emit("hide")}},legendPanmove(e){this.components.forEach(t=>{t.emit("panmove",e)}),e.preventDefault()},legendPanend(e){e.preventDefault(),this.components.forEach(t=>{t.emit("panend",e)}),this.isStarted=!1}}}),dR=(e,t,n)=>({key:"hammered",type:"hammer",enable:!0,gestures:t?[cR(e,{}),oR(e,t,{}),...n]:[nR(e,{}),sR(e,{}),cR(e,{}),aR(e,{}),uR(e,{}),oR(e,t,{}),...n]});function fR(e,t,n){const r=e.getIsSingleSelect(0),{constraints:i}=n;if(i.active&&i.passive)return[];const o=t.tooltipService.getInteractions();return[dR(t,r,o.gestures),lR(t),o.native]}function pR({settings:e},t){const n={share:{type:"d3-number",format:".1%"},arc:{data:{field:t.encodings.slice.arc}},fill:e.scales.fill&&e.scales.fill.data&&e.scales.fill.data.field?{data:{field:e.scales.fill.data.field}}:{}};return t.encodings.slice.outerRadius&&(n.outerRadius={data:{field:t.encodings.slice.outerRadius}}),n}function hR({layout:e},t,n){if(!e.dimensionTitle)return!1;const r=t.alternativeService.getAlternatives(),i=t.styleService.axis.title.getStyle();return{key:"dimension-title",type:"axis-title",renderer:"react-qcm",layout:{dock:"top",minimumLayoutMode:"SMALL"},data:{infos:e.qHyperCube.qDimensionInfo,alternatives:r.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>n.constraints.active,isRTL:n.rtl,isSnapshot:!!e.snapshotData,noModelDependencies:!0,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize}}}}function mR({layout:e,context:t,selectionService:n},r={}){const i=function({layout:e}={},t={}){const n={};return CI(n,t.colorService.getScales()),t.encodings.slice.outerRadius&&CI(n,function({layout:e},t){const n={radius:{type:"linear",include:[0],data:{extract:{field:t.encodings.slice.outerRadius}}}};return e.donut.showAsDonut||(n.radius.min=0),n}({layout:e},t)),n}({layout:e},r),o={scales:i};let a=[];const s=function(e,t){const n=e.disclaimerService.getDisclaimer();if(!n)return!1;const{rtl:r}=t,{translator:i}=e,{fontFamily:o}=e.themeService.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:n.alignment},settings:{isRTL:r,label:i.get(`Object.Disclaimer.${n.key}`)},style:{fontFamily:o}}}(r,t);if(r.disclaimerService.getHasSuppressingDisclaimer())return{components:[s]};const l=t.constraints.select||t.constraints.active,c=r.colorService.getLegend({eventName:"legend",key:"legend",viewState:r.viewState,chart:r.chart,styleReference:"object.pieChart",styleOverrides:{title:r.styleService.legend.title.getStyle(),label:r.styleService.legend.label.getStyle()},rtl:t.rtl},{navigationDisabled:l});return i.fillRange&&c.components[0]&&("right"===c.components[0].layout.dock||"left"===c.components[0].layout.dock||t.rtl)&&(i.fillRange.invert=!0),a=[HO({layout:e},r),$O({layout:e},r),BO(r),WO({layout:e},r),hR({layout:e},r,t),...c.components,PO({scaleKey:"fill",legend:c.components[0]||{},onEdited:r.onSelect}),{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:[{key:"slices",contexts:["selection"]}]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}},{key:"area",type:"brush-area",settings:{brush:{components:[{key:"slices",contexts:["selection"],action:"add"}]}},style:{area:{fill:"transparent",strokeWidth:2,stroke:"black",strokeDasharray:"5 5",opacity:.7}}},tR({layout:{components:e.components,dataPoint:CI({},e.dataPoint,{show:!(e.effectPath&&e.snapshotData&&!1===e.dataPoint.show)}),donut:e.donut},context:t},r),...r.tooltipService.getComponents(),s],a=a.filter(e=>!1!==e),{interactions:fR(n,r,t),scales:i,components:r.pluginService.extendComponents(a),palettes:r.colorService.getPalettes(),formatters:pR({settings:o},r),strategy:qI(0,r)}}function gR({instance:t,services:n,picasso:r,env:i}){const{flags:o}=i,a=e.useOptions(),s=e.useModel(),l=e.useApp(),c=e.useTranslator(),u=e.useTheme(),d=e.useStaleLayout(),f=e.useSelections(),p=e.useConstraints(),{qLocaleInfo:h}=e.useAppLayout();i.localeInfo=h;const m=RO({enable:d&&!d.snapshotData}),[g]=e.usePromise(()=>{if(!n)return Promise.resolve();DO.attrExpr.updateProperties(s,d);const e=({getUseBaseColors:e})=>({theme:u,legendProps:d.legend,layout:d,localeInfo:h,hc:d.qHyperCube,colorProps:{...d.color,useBaseColors:e(d)}});return Promise.resolve(s&&!d.snapshotData?s.getEffectiveProperties():{}).then(async t=>Promise.all([n.colorService.initialize({createConfig:e}),Promise.resolve(t),n.pluginService.initialize(),n.alternativeService.initialize({properties:t})]))},[n,m]);e.useEffect(()=>{t?.selectionService&&t.selectionService.setLayout(d)},[d]),e.useEffect(()=>{if(!t||!g)return;const{chart:e,viewState:i,interactions:m,viewCache:y}=t,{alternativeService:v,colorService:b,disclaimerService:x,pluginService:w,themeService:S,tooltipService:k,styleService:M}=n,C=a.viewState||{};d.snapshotData||(i.preventSet("legendScrollOffset",C.legendScrollOffset||0),i.preventSet("rotation",C.rotation||0)),function(e,t){e&&e.snapshotData&&e.snapshotData.content&&e.snapshotData.content.chartData&&(t.preventSet("legendScrollOffset",e.snapshotData.content.chartData.legendScrollOffset),t.preventSet("rotation",e.snapshotData.content.chartData.rotation))}(d,i),k.expando.set("properties",g[1]);const E=r.data("q")({key:"qHyperCube",data:d.qHyperCube,config:{localeInfo:h}}),D=[{type:"q",key:"qHyperCube",data:d.qHyperCube,config:{localeInfo:h}},...b.getData()],_={slice:{arc:"qMeasureInfo/0"}};d.qHyperCube.qMeasureInfo.length>1&&(_.slice.outerRadius="qMeasureInfo/1"),x.initialize({args:{ds:E,encodings:_}});const q=function(e,t){if(t.slice.outerRadius)return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc},radius:{field:t.slice.outerRadius}}}).filter(e=>e.num.value>0&&"NaN"!==e.radius.value).length;return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}}).filter(e=>e.num.value>0).length}(r.data("q")({data:d.qHyperCube,config:{localeInfo:h}}),_),A=f?()=>{const t=e.brush("selection");hg.selections(t,{},d).forEach(e=>{f.select(e)})}:()=>{},T=d.snapshotData&&!a.freeResize?{width:(d.snapshotData.content.size||d.snapshotData.object.size).w,height:(d.snapshotData.content.size||d.snapshotData.object.size).h}:void 0,N=e=>t.selectionService.getIsSelectionLocked(e),I=()=>mR({layout:d,context:{rtl:"rtl"===a.direction,theme:u,constraints:p},selectionService:t.selectionService},{picasso:r,ds:E,model:s,app:l,chart:e,onSelect:A,isLocked:N,interactions:m,constraints:p,translator:c,viewState:i,dataRowCount:q,encodings:_,alternativeService:v,colorService:b,disclaimerService:x,pluginService:w,themeService:S,styleService:M,tooltipService:k,debouncer:kA,properties:g[1],selections:f,logicalSize:T,flags:o,viewCache:y,animations:{enabled:()=>function({viewState:e,options:t,viewCache:n,layout:r,chart:i}){return!1!==t.chartAnimations&&n.get("chartWidth")===i.element.clientWidth&&n.get("chartHeight")===i.element.clientHeight&&n.get("hasZeroLine")===!!i.component("zeroLine")&&0===e.get("rotation")&&!tO.propertiesHaveChanged({viewCache:n,layout:r})}({viewState:i,options:a,layout:d,viewCache:y,chart:e})}});t.generateSettings=I;const O=I();e.update({data:D,settings:O}),y.set("chartWidth",e.element.clientWidth),y.set("chartHeight",e.element.clientHeight),y.set("hasZeroLine",O.components.filter(e=>"zeroLine"===e.key).length>0),tO.cacheProperties({viewCache:y,layout:d}),a.effect&&d.effectProperties?a.effect.update(d,e,{encodings:_}):d.effectPath||e.brush("highlight").end()},[t,g,a.direction,a.effectProperties,p,u.name(),c.language()])}function yR({instance:t,services:n}){const r=e.useElement(),i=e.useStaleLayout();e.onTakeSnapshot(e=>{if(!(i.snapshotData&&i.snapshotData.content&&i.snapshotData.content.chartData)&&(function(e,t){const n=t.getBoundingClientRect();e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.size=e.snapshotData.content.size||{w:n.width,h:n.height}}(e,r),t&&n))return function({layout:e,chart:t,viewState:n,colorService:r}){return e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData={legendScrollOffset:II(t,"legend-cat"),rotation:n.get("rotation")},r.getSnapshotData().then(t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}}).catch(()=>{})}({layout:e,chart:t.chart,colorService:n.colorService,viewState:t.viewState})}),e.useImperativeHandle(()=>({getViewState:()=>({rotation:t.viewState.get("rotation"),legendScrollOffset:II(t.chart,"legend-cat")})}),[t])}var vR,bR={exports:{}};var xR=(vR||(vR=1,function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(h&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(h,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(h&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(h,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Te});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return s+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function p(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function h(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=v(u(r[0],i),h(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),f=u(r[1],i),p=h(0),m=h(1),g=v(d,p),y=v(f,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const S={isFullRange:d,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(p(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=h(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=h(0),f=h(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=h(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:p,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=w({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}var C=t().bind(null,!0),E={},D=Array.isArray;function _(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function q(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=q(e[n||t])?o:e[t],e=e[n||t]}}),e}function N(e,t){var n=!0;if(_(e)&&_(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){N(e[r],t[r])||(n=!1)}),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}E.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?C({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);N(o,a)||A(t,i)||(q(a)?r.push({op:"add",path:s,value:o}):_(o)&&_(a)?r=r.concat(E.generate(a,o,s)):D(o)&&D(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&q(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!q(t[0])&&q(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(E.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){q(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},E.apply=function(e,t){t.forEach(function(t){var n,r,i=T(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(D(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(D(a)&&D(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return k(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(_(a)&&_(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]}),C(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=T(e,t.from);D(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(D(i)?i.splice(+o,1):delete i[o])})},E.clone=function(e){return C({},e)},E.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},E.updateObject=function(e,t){Object.keys(e).length?E.apply(e,E.generate(e,t)):C(e,t)};const I=E,O=function(e,n,r){if(!e)return Promise.resolve();var i=I.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var R="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===R)return n[r]}function L(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===R)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var z={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=S.getNumStepComp(n,l),f=S.getAboveComp(n,l,u,d),p=S.getRangeComp("RangeSum",f);if(S.needDimension({modifier:n,properties:r,layout:i})){var h=S.getDimComp(c,1),m=S.getDimComp(c,0),g=S.getAggrComp(p,h,m);p=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return p},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,z)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(L(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(L(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(L(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(L(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(L(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(R))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function V(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function H(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const B={translationKey:"properties.modifier.movingAverage",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=s;void 0===c&&(c=S.getNumDimensions({properties:i,layout:a}));var u=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=S.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),p=S.getNumStepComp(r,c),h=S.getAboveComp(r,c,f,p);if(r.nullSuppression)t=S.getRangeComp("RangeAvg",h);else{var m=S.getRangeComp("RangeSum",h),g=function(e,t){var n=S.getRowNoComp(e,t);if(!S.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(S.needDimension({modifier:r,properties:i,layout:a})){var v=S.getDimComp(u,1),b=S.getDimComp(u,0),x=S.getAggrComp(y,v,b);y=r.showExcludedValues?S.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,$)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(H(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(H(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(H(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(H(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=V(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=V(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(H(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(H(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=V(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?S.generateTSDExpression(n,t,r):t},extractInputExpression:S.extractInputExpression,initModifier:function(e,t){S.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=S.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var G="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Q(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Z={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=S.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(S.needDimension({modifier:n,properties:r,layout:i})){var p=S.getDimComp(c,1),h=S.getDimComp(c,0),m=S.getAggrComp(f,p,h);f=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return f},initModifier:function(e){Object.keys(Z).forEach(function(t){void 0===e[t]&&(e[t]=Z[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Q(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Q(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Q(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(S.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(S.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),c=""===s&&""===l?"":s||l,u=le(i,o),d=ce(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=S.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(d," Aggr(").concat(c," ").concat(e,", ").concat(f,"))")}(u,d,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="qDef.base",fe="qDef.qDef",pe="qDef.base.qDef",he="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,pe);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,pe)?pe:fe},getLibraryIdRef:function(e){return o(e,me)?me:he},getLibraryId:function(e){return o(e,me)||o(e,he)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",Se="qDef.qLabelExpression",ke="qDef.base.qLabel",Me="qDef.base.qLabelExpression",Ce="qDef.qAggrFunc",Ee="qDef.base.qAggrFunc",De={initBase:function(e,t){(t||De.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,ke,o(e,we)),n(e,Me,o(e,Se)))},restoreBase:function(e){De.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,we,o(e,ke)),n(e,Se,o(e,Me)),o(e,Ce)&&o(e,Ee)&&n(e,Ce,o(e,Ee)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const _e=De;function qe(e){return qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(e)}var Ae={accumulation:F,movingAverage:B,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Te={modifiers:Ae,apply:Ie,applyModifiers:Oe,cleanUpMeasure:Re,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Pe,getActiveModifier:Le,initBase:_e.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ae[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=je(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Qe({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:ze};var Ne={};function Ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var c=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,r&&"object"===qe(r))return Oe({model:n,properties:r});var u=n?n.layout:void 0,d=o(u,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var f=o(u,"qHyperCube.qMeasureInfo"),p=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:f,layout:u})){var h=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:f,layout:u,model:n,lastReloadTime:p});return h||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:f,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);He(r);var i=Ze(r);return Ke({model:n}).then(function(t){return Xe({libraryIds:i,model:n}).then(function(i){return h&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===qe(e)&&!e.disabled){if(n++,"object"!==qe(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Be(t)&&S.simplifyExpression(t.qDef.base.qDef)!==S.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Oe({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===qe(e.base)})}(f)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Ze(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return Fe(r).forEach(function(e){return Re(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Oe(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),He(i);var f=Ze(i);return et({model:n,libraryIds:f,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach(function(e){return Re(e)}),Promise.resolve();var l=a?void 0:Ze(r);return Ke({model:i,dimensionAndFieldList:s}).then(function(e){return Xe({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;_e.isValid(n)||_e.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===qe(e)&&!e.disabled){if(s++,"object"!==qe(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ae[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Ae[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ae[r.type].updateModifier&&Ae[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Ae[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||ze(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&ze(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),$e(n)):Re(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Re(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some(function(e){return"object"===qe(e)&&!e.disabled&&!Ae[e.type]})}(e)?_e.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,$e(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ye({modifiers:je(e),properties:n,layout:r})})}function Le(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function ze(e){var t=Le(e);return!t||Ae[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ve(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function He(e){Fe(e).forEach(function(e){return function(e){var n=Le(e);n&&(void 0!==n.outputExpression&&Ve(n)!==e.qDef.qDef?delete e.qDef.base:!_e.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function $e(e){var t=je(e);Array.isArray(t)&&t.forEach(function(t){"object"===qe(t)&&(t.disabled||!Ae[t.type]&&Ve(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function Be(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=Be(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!We(t)&&Ye({modifiers:je(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==qe(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ke(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function Xe(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),Promise.all(s).then(function(){return a})}function Ge(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ge)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):O(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Qe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===qe(e)&&!e.disabled&&Ae[e.type]&&Ae[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Ze(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=je(t);if(Ye({modifiers:r,properties:e})){var o=We(t);o&&n.push(o),i=i||Qe({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(u(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!r[e]&&s.push(u(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Ie({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>He});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var f=n(8),p=n.n(f);const h=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach(function(e){p().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var w=n(909),S=n.n(w);function k(e,t){var n=S()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function M(e,t){return S()(!0,{},t,e)}function C(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var E=Math.pow(2,53)-1;function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const q=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},A=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},I=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=k(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var c=k(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},R=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=M(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var c=M(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=C(a.max,i.dimensions.length,E),l=C(a.min,i.dimensions.length,0);return{maxDimensions:C(o.max,s,E),minDimensions:C(o.min,l,0),maxMeasures:s,minMeasures:l}},L=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},z=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=S()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=S()(!0,{},n,i)).components&&(i.components=[]),i},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},V=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return D(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),r.dimensions.added(e,n)})}},H=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return _(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},$=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&p().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function B(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const W={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),h({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,f=void 0===d||d,p=e.isHCModifierSupported,h=void 0===p||p,m={qChildren:[]},g=z({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=P({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,w=b.minDimensions,S=b.maxMeasures,k=b.minMeasures,M=l.defaultDimension,C=void 0===M?N():M,E=l.defaultMeasure,D=void 0===E?I():E;v.qDimensions.length=0,v.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:S,minMeasures:k})&&j({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:S,minMeasures:k,newHyperCubeDef:v}),O({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:C}),R({exportFormat:t,maxMeasures:S,minMeasures:k,newHyperCubeDef:v,defaultMeasure:D}),V({newProperties:g,dataDefinition:a,hypercubePath:c}),H({newProperties:g,dataDefinition:a,hypercubePath:c}),L({exportFormat:t,newHyperCubeDef:v}),A("qMaxStackedCells",y,v),A("qNoOfLeftDims",y,v),T("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,v,"S"),T("qReductionMode",y,v,"N"),T("qSortbyYValue",y,v),T("qIndentMode",y,v),T("qShowTotalsAbove",y,v),q(g,t,r),m.qProperty=g;var _=o.getValue(u||{},"support.modifiers");return $({measures:v.qMeasures,modifierTypes:_}),f&&B(m.qProperty,"storedFilters"),"S"===v.qMode&&h&&B(m.qProperty,"dynamicScript"),m}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function K(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(Y(a,t,r,i),K(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},G={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>0&&G.getNumMeasures(e)<=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>0},expression:function(e){return G.getNumMeasures(e)>=1}}},Q={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}};var Z={scatterplot:Q,"sn-scatter-plot":Q,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)<=1},expression:function(e){return G.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>=1},expression:function(e){return G.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var p=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:p,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:p,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f})}n?(p.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(p)):l.qAttributeExpressions.push(p)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:p().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return p().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=G.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||G.wrapFieldName(t.name),key:G.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=X.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Z[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=X.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},fe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},pe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},he=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(a,[],"qAttributeDimensions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,f=o.getValue(d,"visualization"),p=o.getValue(d,"qHyperCubeDef.qDimensions",[]),h=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ce(d,f),y=ue({canColorBy:g,autoColor:m,colorMode:h,dimensions:p});return g[h]?pe({shouldUpdateColorBy:y,properties:d})&&he(d):me(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),fe(p),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?B(n,"unsupportedAutoMinMax")||S()(n.measureAxis,t.measureAxis):B(n,"supportedAutoMinMax")||S()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(a);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&S()(s,n.properties.measureAxes[t[0].axis])):S()(s,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Se={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),we(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function ke(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Me(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=ke(n,r,l);o.setValue(t,c,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}function Ce(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=ke(n,r,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}var Ee="qHyperCubeDef.qMeasures",De="conditionalColoring",_e="measures",qe="qDef.conditionalColoring";const Ae={quarantine:function(e){Me({properties:e,arrayPath:Ee,quarantineName:De,arrayName:_e,itemPath:qe})},unquarantine:function(e){Ce({properties:e,arrayPath:Ee,itemPath:qe,arrayName:_e,quarantineName:De})}};var Te="qHyperCubeDef.qMeasures",Ne="measures",Ie="qHyperCubeDef.qDimensions",Oe="dimensions",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",ze="alternativeDimensions",Fe="qCalcCondition",je="conditionalShowHide";const Ve={quarantine:function(e){Me({properties:e,arrayPath:Te,quarantineName:je,arrayName:Ne,itemPath:Fe}),Me({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Oe,itemPath:Fe})},unquarantine:function(e){Ce({properties:e,arrayPath:Te,quarantineName:je,arrayName:Ne,itemPath:Fe}),Ce({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Oe,itemPath:Fe})},quarantineAlternative:function(e){Me({properties:e,arrayPath:Re,quarantineName:je,arrayName:Pe,itemPath:Fe}),Me({properties:e,arrayPath:Le,quarantineName:je,arrayName:ze,itemPath:Fe})},unquarantineAlternative:function(e){Ce({properties:e,arrayPath:Re,quarantineName:je,arrayName:Pe,itemPath:Fe}),Ce({properties:e,arrayPath:Le,quarantineName:je,arrayName:ze,itemPath:Fe})}},He={hypercube:W,colorChart:ye,axisChart:Se,quarantineProperty:x,unquarantineProperty:B,quarantineArrayProp:Me,unquarantineArrayProp:Ce,conditionalColoring:Ae,conditionalShow:Ve}})(),r.default})()}(bR)),bR.exports),wR=r(xR);const SR={setValue(e,t,n){if(!t)return;const r=t.split(".");let i=e;const o=r[r.length-1];let a;for(a=0;a<r.length-1;++a)null==i[r[a]]&&(i[r[a]]=Number.isNaN(+r[a+1])?{}:[]),i=i[r[a]];void 0!==n?i[o]=n:delete i[o]},getValue(e,t,n){const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(null==o[r[i]])return n;o=o[r[i]]}return o}},kR={getDimensions:e=>SR.getValue(e,"qHyperCubeDef.qDimensions",[]),getNumDimensions:e=>SR.getValue(e,"qHyperCubeDef.qDimensions.length",0),getMeasures:e=>SR.getValue(e,"qHyperCubeDef.qMeasures",[]),getNumMeasures:e=>SR.getValue(e,"qHyperCubeDef.qMeasures.length",0),getDimensionLayouts(e,t){const n=SR.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qDimensionInfo:[]},getDimensionLayout(e,t,n){return this.getDimensionLayouts(t,n).filter(t=>e===t.cId)[0]},getMeasureLayouts(e,t){const n=SR.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qMeasureInfo:[]},getMeasureLayout(e,t,n){return this.getMeasureLayouts(t,n).filter(t=>e===t.cId)[0]}};const MR={colorModeOptions:{primary:()=>!0,dimension:()=>!0,multiColor:()=>!1,measure:()=>!0,expression:e=>kR.getNumMeasures(e)>=1},showLegend:e=>{const t=SR.getValue(e,"color.auto"),n=SR.getValue(e,"color.expressionIsColor"),r=SR.getValue(e,"color.mode");return!(!t&&"primary"===r||!t&&"byExpression"===r&&(n||void 0===n))},persistentColorsShow:e=>!SR.getValue(e,"color.auto")&&"byDimension"===SR.getValue(e,"color.mode"),useDimValColShow:e=>(void 0===SR.getValue(e,"color.useDimColVal")&&SR.setValue(e,"color.useDimColVal",!1),!SR.getValue(e,"color.auto")&&"byDimension"===SR.getValue(e,"color.mode")&&"libraryItem"===SR.getValue(e,"color.byDimDef.type"))},CR=function(e){const{colorModeOptions:t,persistentColorsShow:n,useDimValColShow:r,showLegend:i}=MR;this.color={colorMode:{options(n){const r=[];return"explore"===e&&r.push({value:"auto",translation:"Common.Auto"}),r.push({value:"primary",translation:"properties.colorMode.primary"}),r.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),r.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"}),t.expression(n)&&"explore"!==e&&r.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),r}},persistentColors:{show:e=>r(e)?n(e)&&!SR.getValue(e,"color.useDimColVal"):n(e)},useDimColVal:{show:r}},this.legend={show:i,showTitle:{show(e){const t=SR.getValue(e,"color.auto");return SR.getValue(e,"legend.show")&&i(e)&&(t||!function(e){return"byExpression"===SR.getValue(e,"color.mode")&&!0===SR.getValue(e,"color.expressionIsColor")}(e))}},dock:{show:e=>SR.getValue(e,"legend.show")&&i(e)}}};function ER(e){return new CR(e)}const DR={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"piechart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.PieChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{strokeSection:{translation:"properties.Outline",component:"items",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{translation:"LayerStyleEditor.style.strokeWidth",ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{component:"items",translation:"LayerStyleEditor.style.cornerRadius",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",translation:"LayerStyleEditor.style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"items",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",translation:"LayerStyleEditor.style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}}}},_R=(e,t,n)=>{const r=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.pieChart",e,"color")})}}}}},qR=(e,t,n,r)=>{const i=function(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,c={};l.forEach(function(e){var r=e.split(".");q_(r);for(var i=c,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=C_({theme:t,translator:n,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}});var u=function(e){var t=e.split(".");q_(t);for(var n=c,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}({theme:r,translator:n,flags:t,config:{id:"pieChart",paths:["axis.title","label.name","label.value","legend.title","legend.label"]}});return{component:"styling-panel",chartTitle:"Object.PieChart",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e,items:{strokeSection:{translation:"properties.Outline",component:"panel-section",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{translation:"LayerStyleEditor.style.cornerRadius",component:"panel-section",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"panel-section",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}},axisTitleSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionlabels",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:_R("axis.title",i,r)}}}:void 0,labelNameSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionValueLabel",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:_R("label.name",i,r)}}}:void 0,labelValueSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.value.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:_R("label.value",i,r)}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:_R("legend.title",i,r)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:_R("legend.label",i,r)}}}:void 0}}},AR=ER("hard");const TR=e=>{e.color?.auto||(wA(e,"color.mode","byDimension"),wA(e,"color.byDimDef.activeDimensionIndex",0),wA(e,"color.persistent",!1))},NR=e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];switch(e.color?.mode){case"byMultiple":t.push({value:"byMultiple",translation:"properties.colorMode.multicolored"});break;case"byMeasure":t.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"});break;case"byExpression":t.push({value:"byExpression",translation:"properties.colorMode.byExpression"})}return t},IR=e=>{const{flags:t,translator:n}=e||{},r=e?.sense?.theme,i=t?.isEnabled("SENSECLIENT_IM_2429_PIECHART_BG"),o=t?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),a={items:{simpleItems:{items:{autoColor:{label:e=>e.color?.auto?n.get("Simple.Color.Auto",n.get("properties.colorMode.byDimension")):n.get("Common.Custom"),change:TR},colorMode:{options:NR}}}}},s={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length},pointLabels:{component:"checkbox",ref:"dataPoint.auto",type:"boolean",defaultValue:!0,translation:"Simple.Label.Value",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,change(e){e.dataPoint.auto||wA(e,"dataPoint.labelMode","none")}},dimensionTitle:{component:"checkbox",ref:"dimensionTitle",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,convertFunctions:{get:(e,t,n,r)=>!r.dimensionTitle,set(e,t,n,r,i){i.dimensionTitle=!e}}}}}}},l={uses:"settings",items:{simpleStyling:DR,simpleLabels:s,general:{items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{sliceStyling:qR(i,t,n,r),showAsDonut:{ref:"donut.showAsDonut",type:"boolean",component:"item-selection-list",defaultValue:!1,horizontal:!0,items:[{icon:"pie_chart_pie",component:"icon-item",labelPlacement:"bottom",translation:"properties.pie",value:!1},{icon:"pie_chart_donut",component:"icon-item",labelPlacement:"bottom",translation:"properties.donut",value:!0}]},labels:{type:"items",snapshot:{tid:"property-labels"},items:{dimensionTitle:{ref:"dimensionTitle",type:"boolean",component:"switch",translation:"properties.dataPoints.dimensionlabels",defaultValue:!o,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",translation:"Common.None"},{value:"share",translation:"properties.dataPoints.labelmode.share"},{value:"value",translation:"properties.dataPoints.labelmode.value"}],defaultValue:"share",show:e=>!e.dataPoint.auto},labelValueMode:{ref:"dataPoint.labelValueMode",type:"string",component:"dropdown",translation:"properties.dataPoints.labelvaluemode",options:[{value:"arc",translation:"Visualizations.Descriptions.Angle"},{value:"radius",translation:"Visualizations.Descriptions.Radius"}],defaultValue:"arc",show:e=>!e.dataPoint.auto&&function(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qMeasures.length>1||e.qHyperCube&&e.qHyperCube.qMeasureInfo.length>1}(e)&&"value"===e.dataPoint.labelMode}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{colorMode:{options:AR.color.colorMode.options},persistentColors:{show:AR.color.persistentColors.show}}},simpleColors:a,legend:{show:AR.legend.show,items:{show:{defaultValue:!1,snapshot:{tid:"property-legend"}},showTitle:{show:AR.legend.showTitle.show},dock:{show:AR.legend.dock.show}}}}},tooltip:{uses:"tooltip"}}};return l},OR={uses:"data",items:{dimensions:{uses:"dimensions"},measures:{uses:"measures",items:{numberFormatting:{items:{percentOfPieMessage:{component:"text",translation:"properties.numberFormatting.pieMessage",show:(e,t,{properties:n}={})=>n&&(n.dataPoint.auto||"share"!==n.dataPoint.labelMode)}}}}}}},RR={uses:"sorting",items:{interColumnSorting:{reset:e=>{const{qDimensions:t,qMeasures:n,qInterColumnSortOrder:r}=e.qHyperCubeDef;if(1===t.length&&n.length>=1){const t=r.length,n=[...Array(t).keys()];[n[0],n[1]]=[n[1],n[0]],e.qHyperCubeDef.qInterColumnSortOrder=n}}}}},PR={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}}}};function LR(e){return{type:"items",component:"accordion",items:{data:OR,sorting:RR,addons:PR,settings:IR(e)}}}const zR=ER("explore"),FR=LR();var jR={type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sort"},presentation:{uses:"presentation",items:{showAsDonut:FR.items.settings.items.presentation.items.showAsDonut,labelMode:{type:"items",items:{labelMode:{type:"string",component:"radio-list",translation:"properties.dataPoints.labelmode",diffs:["dataPoint.auto:false","dataPoint.labelMode"],options:FR.items.settings.items.presentation.items.labels.items.labelMode.options,setPropertyValue(e,t){e.dataPoint.auto=!1,e.dataPoint.labelMode=t},getValue:e=>e.dataPoint.auto?"":e.dataPoint.labelMode}}}}},color:{uses:"color",items:{mode:{options:zR.color.colorMode.options},dimension:{items:{persistentColors:{show:e=>!(e.color&&"byDimension"===e.color.mode&&e.color.useDimColVal&&zR.color.useDimColVal.show(e))}}}}}}};const VR="slices";function HR(e,t){const n=e&&e.desc&&void 0!==e.desc.share?e.desc.share:void 0;return t("share")(n)}function $R(e){return e.data.num.label}function BR(e){return e.data.radius.label}function WR(e,t,n,r){return function(e,t){if(e.dataPoint.auto)return 1===e.qHyperCube.qSize.qcy?$R:HR;if("share"===e.dataPoint.labelMode)return HR;if("value"===e.dataPoint.labelMode)return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?BR:$R;return $R}(n,r)(e,t)}function UR(e){let t;return t=e.data.label?function(e,t){let n=e;return n.length>t&&(n=`${n.substr(0,t-3)}...`),n}(e.data.label,20):"",t}class YR{constructor({element:e,properties:t,effectHelper:n,Flag:r}){this.element=e,this.Flag=r,n.initFade(this.element);const i=e.find(".effectLayer");i.length>0&&i.remove(),e.append('<div class="effectLayer"></div>'),this.effectLayer=e.find(".effectLayer"),this._effectProperties=t,this.selectedIndex=t.selectedIndex,this.hasPropertiesPanel=!1,this.effectApplied=!0,n.fadeIn(this.element)}updateOrigSettings(e){return{dataPoint:e.dataPoint,legend:e.legend,dimensionTitle:e.dimensionTitle}}updateFlags(e,t){const n=this.chart.getAffectedShapes("highlight"),r=this.effectLayer[0].getBoundingClientRect(),i=n.map(n=>{const{start:i,end:o,outerRadius:a,offset:s}=n.desc.slice,{scaleRatio:l}=this.chart.component(n.key).rect,c=n.element.getBoundingClientRect(),u=(i+o)/2,d=c.left-r.left+l.x*(s.x+a*Math.sin(u)),f=c.top-r.top+l.y*(s.y-a*Math.cos(u)),p=Math.cos(u)>0?"top":"bottom",h=Math.sin(u)>0?"right":"left";return{title:UR(n),label:WR(n,this.chart.formatter,e,t),orientation:`${p}${h}`,position:{x:d,y:f}}});this.Flag.show(this.effectLayer,i)}init(e,t,n,r){return t.getProperties().then(e=>{if(!e.originalModelSettings){const t=CI(!0,{},e);e.originalModelSettings=this.updateOrigSettings(t)}e.effectProperties=r,e.effectPath=n,e.dataPoint.show=!1,e.legend.show=!1,e.dimensionTitle=!1,t.setProperties(e)})}remove(e,t,n){return e.options=CI(e.options,{effect:null}),n?t.getProperties().then(e=>CI(e,{effectPath:null,effectProperties:null,dataPoint:CI(!0,{},e.originalModelSettings.dataPoint),legend:CI(!0,{},e.originalModelSettings.legend),dimensionTitle:e.originalModelSettings.dimensionTitle})):Promise.resolve()}}class KR extends YR{init(e,t,n,r){return e.options=CI(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.max===r.max?Promise.resolve():super.init(e,t,n,r)}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(VR).data.items,n=e.effectProperties.min,r=e.effectProperties.max,i=[];let o=[1/0,-1],a=[-1/0,-1];t.forEach((e,t)=>{const i=e.num.value;n&&i<o[0]&&(o=[i,t]),r&&i>a[0]&&(a=[i,t])}),-1!==o[1]&&i.push(t[o[1]].value),-1!==a[1]&&i.push(t[a[1]].value),i.length&&this.chart.brush("highlight").setValues(i.map(e=>({key:"qHyperCube/qDimensionInfo/0",value:e})))}}class XR extends YR{constructor(e){super(e),this.hasPropertiesPanel=!0,this.propsTemplate=e.highlightValuePropsTemplate,this.effectHelper=e.effectHelper}onClick(e){if(!this.chart)return;const t=this.chart.shapesAt(function(e,t){const n=t.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}(e,this.chart),{propagation:"stop"});if(1!==t.length)return;const n=t[0],r=this.chart.component(VR).data.items.map(e=>e.value).indexOf(n.data.value);-1!==r&&(this.selectedIndex=r,this.effectHelper.updateSelectedPointIndex(this))}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateDataPoints(e,n),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(VR).data.items[e.effectProperties.selectedIndex];this.chart.brush("highlight").setValues([{key:"qHyperCube/qDimensionInfo/0",value:t.value}])}updateDataPoints(e,t){this.dataPoints=this.chart.findShapes("path").filter(e=>e.key===VR).map((n,r)=>{const i=WR(n,this.chart.formatter,e,t);return{text:`${UR(n)} (${i})`,value:r}})}init(e,t,n,r){return e.options=CI(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.selectedIndex===r.selectedIndex?Promise.resolve():super.init(e,t,n,r)}}const GR="/effects/highlight-value",JR="/effects/maxmin";var QR={isCompatible:({effectPath:e})=>e===JR||e===GR,create:e=>e.effectPath===JR?new KR(e):e.effectPath===GR?new XR(e):null};function ZR(e){const t={},{components:n,tooltip:r}=e,i=n?n.filter(e=>"slices"===e.key)[0]:void 0;if(i&&i.style&&Object.keys(i.style).forEach(e=>{t[`chart_style_${e}`]=i.style[e]}),r){t.chart_tooltip_custom=!r.auto;const e=r.chart?.object?.refId;!r.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}function eP(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))}function tP(e){e.qOtherTotalSpec.qOtherMode="OTHER_COUNTED",e.qOtherTotalSpec.qOtherCounted={qv:"10"}}function nP({translator:e}){return{dimensions:{min:1,max:1,description:()=>e.get("Visualizations.Descriptions.Slice"),add(e,t){tP(e),eP(t),bO.addCallbackCustomTooltip(t)},move(e,t){tP(e),eP(t),bO.moveCallbackCustomTooltip(t,e)},remove(e,t){bO.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){tP(e),eP(r),bO.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:2,description:(t,n)=>e.get(0===n?"Visualizations.Descriptions.Angle":"Visualizations.Descriptions.Radius"),add(e,t){eP(t)},remove(e,t){!function(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qMeasures,{mode:n}=e.color;"byExpression"===n&&0===t.length&&(e.color.mode="primary")}(t)}}}}const rP=e=>e.qMax<=0,iP=e=>!(!(e&&e.qHyperCube.qSize.qcy>0)||e.qHyperCube.qMeasureInfo.every(rP));function oP(e){const t={definition:LR(e),softDefinition:jR,support:{snapshot:iP,export:iP,exportData:!0,sharing:iP,viewData:!0,effects:!0},effects:QR,extendMetrics:ZR,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=wR.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:nP(e),defaultPropertyValues:a,hypercubePath:i});return s.qProperty.dataPoint&&!1===s.qProperty.dataPoint.show&&delete s.qProperty.dataPoint.show,s},exportProperties:(t,n,r,i)=>{const o=function(e){return(t,n,r,i)=>{const{flags:o,translator:a,localeInfo:s}=e||{},l=wR.colorChart.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r});if(r&&o?.isEnabled("QCB_31689_PIECHART_VIEWDATA")){const e=NI.getValue(l,"properties.qHyperCubeDef.qMeasures"),t=e[0],n=a?.get("properties.dataPoints.labelmode.share")||"Share",r=i||s,o=r?.qDecimalSep||".",c={qDef:{qDef:"=If(Column(1) >= 0, Column(1))",qLabel:n,qNumFormat:{qType:"F",qnDec:2,qUseThou:0,qFmt:`0${o}0%`,qDec:o,qThou:r?.qThousandSep||","},qAggrFunc:"Sum",qRelative:!0,qExpressions:[],qLabelExpression:"",cId:NI.generateId()},qLibraryId:"",qAttributeExpressions:[],qAttributeDimensions:[]},u=CI(!0,{},t,c);e.push(u);const d=NI.getValue(l,"data.0.measures",[]);if(d?.length>0){const e=d[0],t=CI(!0,{},e,c);d.push(t)}}return l}}(e);return o(t,n,r,i)}};return t}function aP(e){return{version:"2.2.0",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[{key:"slices",style:{strokeWidth:"none",strokeColor:{index:-1,color:FO.STROKE.COLOR},cornerRadius:FO.CORNER_RADIUS,innerRadius:FO.INNER_RADIUS}}],dataPoint:{auto:!0,labelMode:"share",labelValueMode:"arc"},dimensionTitle:!e.flags.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),donut:{showAsDonut:!1},footnote:"",legend:{dock:"auto",show:!e.flags.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),showTitle:!0},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:10,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1,qMode:"S"},showDetails:!0,showDisclaimer:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}}}function sP(e){return{properties:{...aP(e)},data:{targets:[nP(e)]},importProperties:({exportFormat:t,initialProperties:n,hypercubePath:r})=>{const i=wR.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:nP(e),hypercubePath:r});return i.qProperty.dataPoint&&!1===i.qProperty.dataPoint.show&&delete i.qProperty.dataPoint.show,i},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>wR.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}return t=>{const{flags:r}=t;!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(n).forEach(t=>{e.add(n[t])})}}(t.translator);const i=KD();return{qae:sP(t),ext:oP(t),component(){const n=wI({picasso:i}),o=TO({flags:r,picasso:i,instance:n});gR({instance:n,services:o,picasso:i,env:t}),function({instance:t}){const n=e.useStaleLayout(),r=e.useOptions(),i=e.useRect();e.useEffect(()=>{if(!t||!t.generateSettings)return;const{viewCache:e,chart:i,generateSettings:o}=t;i.update({settings:o()}),e.set("chartWidth",i.element.clientWidth),e.set("chartHeight",i.element.clientHeight),r.effect&&r.effect.update(n,i)},[i.width,i.height])}({instance:n}),yR({instance:n,services:o})}}}});
109
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,p=e.search(/[0-9\-\+#]/),h=p>0?e.substring(0,p):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(p,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0==+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),h+(n?"-":"")+r+x}},bT(xT={exports:{}}),xT.exports);function ST(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const kT={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},MT=/%\)?$/,CT=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,ET=/^\(oct\)/i,DT=/^\(dec\)/i,_T=/^\(hex\)/i,qT=/^\(bin\)/i,AT=/^\(rom\)/i,TT=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,NT=/#|0/g;function IT(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function OT(e,t,n){const r=ST(e);return n?r:new RegExp(r||"",t)}function RT(e,t,n,r){let i,o,a,s,l,c,u,d,f,p=e.pattern;var h,m;r&&(e.abbreviate=!0),h=t,(m=n)&&(m=ST(m)),h&&(h=ST(h)),f=new RegExp("(?:[#0]+".concat(h,")?[#0]+(?:").concat(m,"[#0]+)?")),a=p.match(f),a=a?a[0]:"",s=a?p.substr(0,p.indexOf(a)):p,l=a?p.substring(p.indexOf(a)+a.length):"",a||(a=p?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(OT(c,"g"),t)),u=n,n=".",u&&(a=a.replace(OT(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=p.split(u);let y;g[1]&&(y=g[1].match(NT)),e.prefix=s||"",e.postfix=l||"",e.pattern=p,e.maxPrecision=y?y.length:2,e.percentage=MT.test(p),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(OT(t,null,!0),"|").concat(OT(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class PT{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return kT;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new PT(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],TT.test(e[0])&&(r.positive.isFunctional=!0),e[1]?TT.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?TT.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||RT(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&RT(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&RT(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",f="",p=e;if(isNaN(e))return"".concat(p);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=function(e,t,n){let r;return CT.test(t)?e=IT(e,Number(/\d{2}/.exec(t)[0]),t,n):ET.test(t)?e=IT(e,8,t,n):DT.test(t)?e=IT(e,10,t,n):_T.test(t)?e=IT(e,16,t,n):qT.test(t)?e=IT(e,2,t,n):AT.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=wT(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=wT(l,e)}e=e.replace(u.numericRegex,e=>e===a?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+f+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function LT(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),c=0,u=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(c>=n&&(delete s[l[u]],delete l[u],c--,u++),s[e]=t,l[c]=e,c++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),c=0,u=0},o.size=()=>c,o}function zT(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new PT(...t)}(i,e,t,n,r),a=LT(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const FT="D",jT="T",VT="TS",HT=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$T=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],BT=["January","February","March","April","May","June","July","August","September","October","November","December"],WT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function UT(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function YT(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class KT{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:HT,qDayNames:$T,qLongMonthNames:BT,qMonthNames:WT}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[jT]:r.qTimeFmt||"hh:mm:ss",[FT]:r.qDateFmt||"YYYY-MM-DD",[VT]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new KT(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){let n,r=function(e){const t=e,n=24*YT(t),r=60*YT(n),i=60*YT(r),o=1e3*YT(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:UT("".concat(a.year).slice(-2),2),YYY:UT("".concat(a.year).slice(-3),3),def:e=>UT("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:UT("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:UT("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>UT("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>UT("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>UT("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>UT("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r})}}function XT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new KT(...t)}function GT(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=XT(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=LT(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return"IV"!==t?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=XT(i,e,t),r=LT(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function JT(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const c=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),u="dimension"===s?"first":"avg",d=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return GT(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),zT(n,r,i,o,t)}(t,i),f="dimension"===s?"first":(e,t)=>d(t),p={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(p)),e),min:()=>t.qMin,max:()=>t.qMax,value:c,label:e=>(null==e?void 0:e.qText)||"",reduce:u,reduceLabel:f,formatter:()=>d,tags:()=>t.qTags};return p}function QT(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:JT(PA({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=QT("qAttrDimInfo",t,n,a,PA({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=QT("qAttrExprInfo",t,n,a,PA({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=QT("qMeasureInfo",t,n,a,PA({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function ZT(){let{key:e,data:t,config:n={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},i=t;if(!i)throw new Error('Missing "data" input');if(!i.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const o=ZT.util,a={cache:r,cube:i,localeInfo:n.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:n.virtualFields},s={key:()=>e,raw:()=>i,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,a),fields:()=>r.fields.slice(),extract:e=>a.extractor(e,s,r,o),hierarchy:e=>a.hierarchy(e,s,r,o),_cache:()=>r};"K"===i.qMode||"T"===i.qMode||!i.qMode&&i.qNodesOnDim?(a.extractor=vT,a.hierarchy=yT,a.pages="K"===i.qMode?i.qStackedDataPages:i.qTreeDataPages):"S"===i.qMode?(a.extractor=jA,a.pages=i.qDataPages,a.hierarchy=yT):a.extractor=()=>[],a.fieldExtractor=e=>a.extractor({field:e},s,r,o);const l="S"===i.qMode?e=>e.qElemNumber:void 0,c="S"===i.qMode?e=>e.qNum:void 0;r.wrappedFields.push(...QT("qDimensionInfo",i,e,"",PA({},a,{value:l,type:"dimension"}))),r.wrappedFields.push(...QT("qMeasureInfo",i,e,"",PA({},a,{value:c,type:"measure"}))),r.fields=r.wrappedFields.map(e=>e.instance);const u=e=>{e.forEach(e=>{r.allFields.push(e.instance),u(e.measures),u(e.attrDims),u(e.attrExps)})};return u(r.wrappedFields),(n.virtualFields||[]).forEach(t=>{const n=s.field(t.from),i=JT(DA({meta:n.raw(),id:"".concat(e,"/").concat(t.key),sourceField:n,fieldExtractor:e=>a.extractor({field:e},s,r,o),key:t.key,type:n.type(),localeInfo:a.localeInfo,value:n.value},t.override||{}));r.virtualFields.push(i)}),r.allFields.push(...r.virtualFields),s}const eN=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],tN=/\/qDimensionInfo(?:\/(\d+))?/,nN=/\/qMeasureInfo\/(\d+)/,rN=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,iN=/\/qAttrExprInfo\/(\d+)/,oN=/\/?qHyperCube/,aN=/\/?qTreeData/,sN=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),lN=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function cN(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;oN.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=sN):aN.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=lN);let s=!0;if(tN.test(e)&&(r=+tN.exec(e)[1]),nN.test(e)&&(i=+nN.exec(e)[1]),rN.test(e)){i=-1,r=0;const e=+rN.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(iN.test(e)){const e=i;if(t){i=0;const a=nT(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+iN.exec(n)[1]}else r>-1?(r=-1,i=+iN.exec(n)[1]):i+=+iN.exec(n)[1]+1}return eN.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||s>=o)&&o>-1?n.forEach(e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})}):n.forEach(e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var c}function uN(e){ZT.util=e.data("matrix").util,e.data("q",ZT),e.formatter("q-number",zT),e.formatter("q-time",GT)}function dN(e){var t=bA(e.layout||{},e.path.split("/").join("."));if(!t)return!1;var n=t.qIsOneAndOnlyOne;return void 0!==n&&n}function fN(e){var t=e.brush,n=e.colorField,r=e.legendAlias,i=e.useLegendCube,o=void 0!==i&&i;!n||/qAttrDimInfo/.test(n)?(t.removeKeyAlias("attrDim/qDimensionInfo/0"),r&&t.removeKeyAlias(r),t.addKeyAlias("attrDim/qDimensionInfo/0","qHyperCube/".concat(n))):o&&t.addKeyAlias(r,"qHyperCube/".concat(n))}uN.qBrushHelper=cN,uN.selections=cN;var pN="Shift";var hN=function(e,t){return t[e]?hN(e+1,t):e},mN=function(e,t){var n=t.reduce(function(e,t){return e[t]=!0,e},{});return e.reduce(function(e,t,r){var i=hN(r,n);return n[i]=!0,e[r]=i,e},{})};function gN(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.layout,n=e.filtered,r=void 0===n?{}:n,i=(null==t?void 0:t.qHyperCube)||{},o=i.qDimensionInfo,a=void 0===o?[]:o,s=i.qMeasureInfo,l=void 0===s?[]:s;return{dimensions:mN(a,r.dimensions||[]),measures:mN(l,r.measures||[])}}function yN(e){var t=e.selection,n=e.fieldMap,r=t.method,i=t.params;if("selectHyperCubeValues"===r){var o=n.dimensions[i[1]];void 0!==o&&(i[1]=o)}return"selectHyperCubeContinuousRange"===r&&i[1].forEach(function(e){var t=n.dimensions[e.qDimIx];void 0!==t&&(e.qDimIx=t)}),t}var vN=[],bN=0,xN=function(e){var t=vN.filter(function(e){var t;return null===(t=e.selections)||void 0===t?void 0:t.isActive()});t.length&&("Enter"===e.key?t.forEach(function(e){return e.selections.confirm()}):"Escape"!==e.key&&"Esc"!==e.key||t.forEach(function(e){return e.selections.cancel()}))};function wN(e){var t=e.chart,n=e.document,r=e.selectionInfo,i=e.eventName,o=e.componentName,a=e.brushName,s=void 0===a?"selection":a,l=e.emit,c=void 0===l?"rangeClear":l,u=r.event===i,d=n.querySelector("[data-key='".concat(o,"-edge-0']"));if(u||!d)return!1;var f=t.component(o);return!!f&&(f.emit(c),"string"==typeof s&&t.brush(s).clear(),f)}var SN=["chart","document","selections","selectionInfo"],kN=function(e){e.chart,e.document,e.selections,e.selectionInfo;var t=t_(e,SN);t.clearDiscrete(),t.clearContinuous(),t.clearMinor(),t.clearRange(),t.clearTap(),t.clearLegend()};function MN(e){var t,n=e.lasso;null!=n&&null!==(t=n.active)&&void 0!==t&&t.call(n)&&(null==n||n.action(!1))}function CN(e){var t,n=e.chart,r=e.selectionInfo,i=e.selectionActions,o=e.actions,a=void 0===o?{}:o,s=e.selections,l=e.selectionEvents;if(!1===i||!1===l)return function(){};var c=i.reset,u=void 0===c?MN:c,d=i.clear,f=!1!==d&&function(e){var t=e.clear,n=void 0===t?kN:t,r=e.selections,i=e.selectionInfo,o=e.chart;return function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).cleared,t={selections:r,selectionInfo:i,chart:o,document:document,cleared:e};return n(e_({clearDiscrete:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"discreteRange":i,a=e.componentName,s=void 0===a?"discrete-range-brush":a,l=e.cleared;return wN({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,emit:"areaClear",brushName:e.brushName})}(e_(e_({},t),e))},clearContinuous:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.eventName,o=void 0===i?"continuousRange":i,a=e.componentName,s=void 0===a?"continuous-range-brush":a,l=e.cleared;return wN({selectionInfo:t,chart:n,document:r,eventName:void 0!==l&&l?void 0:o,componentName:s,brushName:e.brushName})}(e_(e_({},t),e))},clearMinor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.componentName,o=void 0===i?"minor-range-brush":i,a=e.eventName,s=void 0===a?"minorRange":a,l=e.cleared,c=void 0!==l&&l,u=e.brushName,d=wN({selectionInfo:t,chart:n,document:r,eventName:c?void 0:s,componentName:o,brushName:void 0!==u&&u});if(d){var f=d.settings.settings,p=f.scale,h=f.brush,m=n.scale(p).data().fields.map(function(e){return e.id()}),g=n.brush(h),y=g.brushes().filter(function(e){return"range"===e.type&&m.some(function(t){return t===e.id})});g&&y.length&&y.forEach(function(e){g.removeRanges(e.brush.ranges().map(function(t){return{key:e.id,range:t}}))})}}(e_(e_({},t),e))},clearRange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"xAxis":o,s=e.cleared;wN({selectionInfo:t,chart:n,document:r,eventName:void 0!==s&&s?void 0:a,componentName:"".concat(a,"-range-brush"),emit:"areaClear",brushName:!1})&&i.clear()}(e_(e_({},t),e))},clearTap:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.chart,n=e.selectionInfo,r=e.selections,i=e.events,o=void 0===i?["tap"]:i,a=e.brushNames,s=void 0===a?[]:a;if(n&&o.includes(n.event)){var l=n.currentComponent;n.previousComponent!==l&&(r.clear(),s.forEach(function(e){return t.brush(e).end()}))}}(e_(e_({},t),e))},clearLegend:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(e){var t=e.selectionInfo,n=e.chart,r=e.document,i=e.selections,o=e.eventName,a=void 0===o?"legendRange":o,s=e.componentName,l=void 0===s?"legend-range-brush":s,c=e.cleared,u=void 0!==c&&c,d=e.brushName;wN({selectionInfo:t,chart:n,document:r,eventName:u?void 0:a,componentName:l,brushName:void 0!==d&&d})&&i.clear()}(e_(e_({},t),e))}},t))}}({clear:d,selections:s,selectionInfo:r,chart:n}),p=function(e){var t=e.chart,n=e.actions,r=e.reset,i=e.clear,o=!1,a={deactivated:function(e){var t=(n||{}).lasso;r({e:e,lasso:void 0!==t&&t})},canceled:function(e){var o=(n||{}).lasso;r({e:e,lasso:void 0!==o&&o}),i({e:e,chart:t,document:document})},cleared:function(e){o||(o=!0,i({e:e,chart:t,document:document,cleared:!0}),o=!1)}};return!1===r&&delete a.deactivated,!1===i&&delete a.cleared,!1===r&&!1===i&&delete a.canceled,a}({chart:n,clear:f,reset:u,actions:a}),h={};Object.entries(p).forEach(function(e){var t=i_(e,2),n=t[0],r=t[1];h[n]=function(e,t){return t?function(n){return t({event:n,defaultFunc:e})}:e}(r,l[n])});var m=function(e){var t=e.selectionEvents,n=e.selections,r=e.selectionInfo,i=e.clear,o=e.chart,a=e.document,s=t.start,l={selections:n,selectionInfo:r,chart:o,document:a},c=function(e){return Object.assign(r,e||{})},u=function(e){var t=e.event,n=e.components;return function(){return function(e){var t=e.selectionInfo,n=e.clear,r=e.event,i=e.components,o=void 0===i?[]:i;(0,e.setSelectionInfo)(e_(e_({},void 0===t?{}:t),{},{event:r,components:o.map(function(e){return e.key}).filter(Boolean)})),n()}({event:t,components:n,clear:i,selectionInfo:r,setSelectionInfo:c})}};return"function"==typeof s?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];s(e_(e_({defaultFunc:u({event:e,components:t}),setSelectionInfo:c,clear:i},l),{},{event:e,components:t}))}:function(e){u({event:e,components:arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]})()}}({selectionEvents:l,selections:s,selectionInfo:r,clear:f,chart:n,document:document});return null==a||null===(t=a.select)||void 0===t||t.on("start",m),Object.entries(h).forEach(function(e){var t=i_(e,2),n=t[0],r=t[1];null==s||s.on(n,r)}),function(){var e;null==a||null===(e=a.select)||void 0===e||e.removeListener("start",m),Object.entries(h).forEach(function(e){var t=i_(e,2),n=t[0],r=t[1];null==s||s.removeListener(n,r)})}}var EN=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function DN(e){var t=e.chart,n=e.actions,r=e.selections,i=e.picassoQ,o=e.config,a=o.allowSimultaneous,s=void 0!==a&&a,l=o.majorScale,c=void 0===l?void 0:l,u=o.selectionActions,d=void 0===u?{}:u,f=d.clear,p=d.reset,h=o.selectionEvents,m=void 0===h?{deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0}:h,g=o.brushEvents,y=void 0===g?{}:g,v=o.brushName,b=void 0===v?"selection":v,x=o.brushMaxListeners,w=void 0===x?20:x,S=o.brushRanges,k=void 0!==S&&S,M=o.interceptors,C=void 0===M?{}:M,E=o.selectionsFn,D=void 0===E?i.selections:E,_=t.brush(b);if("number"==typeof w&&_.setMaxListeners(w),k){var q=!0===k?EN:k;_.configure({ranges:q})}var A={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},T=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.selections,r=t.brush,i=t.majorScale,o=t.actions,a=t.selectionsFn,s=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).path,l=void 0===s?"/qHyperCubeDef":s;if(!n)return{layout:function(){},filteredFields:function(){},allowSimultaneous:function(){},release:function(){}};var c=++bN,u=null,d={dimensions:[],measures:[]},f=[],p={};n.on=n.on.bind(n),n.isActive=n.isActive.bind(n),n.addListener=n.addListener.bind(n),n.removeListener=n.removeListener.bind(n);var h=function(e){var t=e.brush,n=e.getConfig;return{interceptor:function(e){var r=t.brushes(),i=n(),o=i.allowSimultaneous,a=i.layout,s=void 0===a?{}:a;r.forEach(function(n){var r,i,a;("range"===n.type||null!==(r=e[0])&&void 0!==r&&r.key&&(null===(i=e[0])||void 0===i?void 0:i.key)!==n.id&&0!==o.indexOf(null===(a=e[0])||void 0===a?void 0:a.key))&&t.clear([])});var l=e.filter(function(e){return-2!==e.value});if(l.length>1){var c=function(e){var t=e.layout,n=void 0===t?{}:t,r=e.values,i=void 0===r?[]:r;if(null==i||!i.length)return[];var o=Array.from(new Set(i.map(function(e){return e.key}))),a=[];return o.forEach(function(e){var t=dN({layout:n,path:e}),r=i.filter(function(t){return t.key===e}),o=t?[r.pop()]:r;a.push.apply(a,o_(o))}),a.filter(Boolean)}({layout:s,values:l});return c}return l},rangeInterceptor:function(e){var r=t.brushes(),i=n().allowSimultaneous;return r.filter(function(e){return"value"===e.type}).length?(t.clear([]),e):(r.forEach(function(n){var r=n.id===e[0].key||i.includes(n.id)&&i.includes(e[0].key);"range"!==n.type||r||t.clear([])}),e)}}}({brush:r,getConfig:function(){return{layout:u,allowSimultaneous:f}}}),m=h.rangeInterceptor,g=h.interceptor;r.intercept("set-ranges",m),r.intercept("toggle-ranges",m),r.intercept("toggle-values",g),r.intercept("set-values",g),r.intercept("add-values",g),r.on("start",function(){return n.begin(l)});var y={activate:function(){},deactivated:function(){return r.end()},cleared:function(){return r.clear()},canceled:function(){return r.end()}};!function(e,t){Object.keys(t).forEach(function(n){e.on(n,t[n])})}(n,y);var v=null==i||null===(e=i.max)||void 0===e?void 0:e.call(i);return null!=o&&o.select?(o.select.on("start",function(){var e;r.start(),"function"==typeof o.select.getBrushOptions&&(p=(e=o.select).getBrushOptions.apply(e,arguments))}),o.select.on("end",function(){var e=a(r,p,u),t=gN({layout:u,filtered:d});e.forEach(function(e){var r=yN({selection:e,fieldMap:t});(function(e,t,n){if(t&&void 0!==n&&"selectHyperCubeContinuousRange"===e.method){var r=e.params;if(r&&r[1]&&r[1][0]){var i=r[1][0],o=i.qDimIx,a=i.qRange;"undefined"!==o&&a&&!1===a.qMaxInclEq&&a.qMax>=n&&(a.qMaxInclEq=!0)}}})(r,o.select.brushSelectionIncludeMax,v),n.select(r)})})):r.on("update",function(){var e=a(r,p,u),t=gN({layout:u,filtered:d});e.forEach(function(e){n.select(yN({selection:e,fieldMap:t}))})}),0===vN.length&&document.addEventListener("keyup",xN),vN.push({key:c,selections:n}),{layout:function(e){u=e},filteredFields:function(e){d=e},allowSimultaneous:function(e){f=e},release:function(){u=null;var e=vN.indexOf(vN.filter(function(e){return e.key===c})[0]);-1!==e&&vN.splice(e,1),vN.length||document.removeEventListener("keyup",xN),function(e,t){Object.keys(t).forEach(function(n){e.removeListener(n,t[n])})}(n,y)}}}({brush:_,majorScale:c,actions:n,selections:r,picassoQ:i,selectionsFn:D});!function(e){var t=e.brush,n=e.interceptors,r=void 0===n?{}:n;Object.entries(r).forEach(function(e){var n=i_(e,2),r=n[0],i=n[1];(Array.isArray(i)?i:[i]).forEach(function(e){t.intercept(r,e)})})}({brush:_,interceptors:C});var N=function(e){var t=e.chart,n=e.selectionActions,r=e.brush,i=e.actions,o=e.selectionInfo,a=e.selections,s=e.selectionEvents,l=function(e){var t=e.brush,n=e.chart,r=e.selectionInfo,i=e.brushEvents,o=void 0===i?{}:i,a=Object.entries(o).map(function(e){var i=i_(e,2),o=i[0],a=i[1],s=function(){return a({chart:n,selectionInfo:r})};return t.on(o,s),[o,s]});return function(){a.forEach(function(e){var n=i_(e,2),r=n[0],i=n[1];t.removeListener(r,i)})}}({brush:r,chart:t,selectionInfo:o,brushEvents:e.brushEvents}),c=CN({chart:t,selectionInfo:o,selectionActions:n,actions:i,selections:a,selectionEvents:s}),u=function(e){var t=e.actions;if(null==t||!t.lasso)return function(){};var n=!1,r=function(e){n||e.key!==pN||(t.lasso.action(!0),n=!0)},i=function(e){e.key===pN&&(t.lasso.action(!1),n=!1)};return document.addEventListener("keydown",r),document.addEventListener("keyup",i),function(){document.removeEventListener("keydown",r),document.removeEventListener("keyup",i)}}({actions:i});return function(){l(),c(),u()}}({chart:t,brush:_,actions:n,selections:r,selectionInfo:A.selectionInfo,selectionActions:{clear:f,reset:p},selectionEvents:m,brushEvents:y});if(s){var I=!0===s?o_(Array(15)).map(function(e,t){return"qHyperCube/qMeasureInfo/".concat(t)}):s;T.allowSimultaneous(I)}return{unbindEvents:N,state:A,picassoSelections:T,brush:_}}var _N=["colorField","useLegendCube"];function qN(e){var t=e.chart,n=e.selections,r=e.actions,i=void 0!==r&&r,o=e.config,a=void 0===o?{}:o,s=DN({chart:t,actions:i,selections:n,picassoQ:uN,config:a}),l=s.unbindEvents,c=s.state,u=s.picassoSelections,d=s.brush,f=a.custom,p=void 0===f?{}:f,h=a.legendAlias,m=void 0===h?void 0:h,g=a.setBrushAliases,y=void 0===g?fN:g;return{getIsDimensionLocked:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return c.lockedDimensions[e]},getIsSelectionLocked:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return null!==(e=null==n||null===(t=n.isLocked)||void 0===t?void 0:t.call(n))&&void 0!==e?e:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(null==e||!e.length)return!1;var t=e.filter(function(e){return"object"===a_(e.data)&&Array.isArray(e.data.fields)}).every(function(e){return e.data.fields.every(function(e){var t=e.raw();return!(!t.qLocked&&t.qCardinal)})});return t}(r)},getIsSingleSelect:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c.singleSelectIndex;return c.singleSelectDimensions[e]},getCanSelect:function(){return c.canSelect},getSelectionsObject:function(){return n},getSelectionInfo:function(){return c.selectionInfo},setLayout:function(e){var t=function(e){var t,n,r,i=e.selections,o=e.picassoSelections,a=e.layout,s={lockedDimensions:[],singleSelectDimensions:[]};null!=i&&null!==(t=i.isModal)&&void 0!==t&&t.call(i)&&i.confirm(),o.layout(a);var l=(null!==(n=null==a?void 0:a.qHyperCube)&&void 0!==n?n:{}).qDimensionInfo,c=void 0===l?[]:l;return s.lockedDimensions=c.map(function(e){return!!e.qLocked}),s.singleSelectDimensions=c.map(function(e,t){return dN({layout:a,path:"qHyperCube/qDimensionInfo/".concat(t)})}),s.singleSelectIndex=function(e){var t,n=((null==e?void 0:e.qHyperCube)||{}).qDimensionInfo,r=void 0===n?[]:n,i=r.map(function(e,t){var n;return!(e.qLocked||(null===(n=e.qCardinalities)||void 0===n?void 0:n.qHypercubeCardinal)<=1)&&t}).filter(function(e){return"number"==typeof e});return null!==(t=i[0])&&void 0!==t?t:Math.max(r.length-1,0)}(a),s.canSelect=0===c.length||c.some(function(e){return!e.qLocked}),s.dimensionLocked=!(null===(r=c[0])||void 0===r||!r.qLocked),s}({selections:n,picassoSelections:u,layout:e});Object.assign(c,t)},setFilteredFields:function(e){u.filteredFields(e)},setBrushAliases:function(e){var t=e.colorField,n=e.useLegendCube,r=void 0!==n&&n,i=t_(e,_N),o=e_({useLegendCube:r,colorField:t,brush:d,legendAlias:m},i);y(e_(e_({},o),{},{defaultFunc:function(){return fN(o)}}))},destroy:function(){l(),u.release()},custom:e_({},p)}}var AN="'Source Sans Pro', 'Arial', 'sans-serif'",TN="#333333",NN="#595959",IN="#737373",ON="#cccccc",RN="#e6e6e6";function PN(e){var t={};return[].concat(o_(e),o_([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",NN],["object","axis.label.name","fontFamily",AN],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",ON],["object","axis.line.minor","color",RN],["object","axis.title","color"],["object","axis.title","fontFamily",AN],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",RN],["object","grid.line.major","color",ON],["object","grid.line.minor","color",RN],["object","label.value","color",NN],["object","label.value","fontFamily",AN],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",NN],[!1,"label.value","lightColor",RN],["object","outOfRange","color","#999"],["object","legend.title","color",TN],["object","legend.title","fontFamily",AN],["object","legend.title","fontSize","15px"],["object","legend.label","color",NN],["object","legend.label","fontFamily",AN],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",TN],["object","referenceLine.label.name","fontFamily",AN],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",RN],["object","referenceLine.outOfBounds","fontFamily",AN],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",IN,function(e){return"transparent"===e?IN:e}]])).reduce(function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e},[]).sort(function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)})}var LN=function(e){return e};function zN(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce(function(e,t){var n=i_(t,2),r=n[0],i=n[1];return e[r]=i,e},{});return o.forEach(function(e){var r=i_(e,5),i=r[0],o=r[1],l=r[2],c=r[3],u=r[4],d=void 0===u?function(e){return e}:u,f=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:c}),p=(s["".concat(o,".").concat(l)]||LN)(d(f));wA(a,[o,l].filter(Boolean).join("."),p)}),i.forEach(function(e){var t=i_(e,2),n=t[0],r=t[1];wA(a,n,r)}),a}var FN={NOOP:function(){},FALSE:function(){return!1},ARRAY:function(){return[]},OBJECT:function(){return{}}},jN="chart-modules-tooltip",VN="#".concat(jN);function HN(){if(!document.querySelector(VN)){var e=document.createElement("div");e.id=jN,e.setAttribute("data-qs-css",""),e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function $N(e){return{show:!0,key:e.key,type:"tooltip",layout:{displayOrder:3},beforeMount:function(){HN()},beforeUpdate:function(){HN()},destroyed:function(){var e;null!=(e=document.querySelector(VN))&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)},settings:{appendTo:function(){return document.querySelector(VN)},direction:e.rtl?"rtl":"ltr",duration:e.duration},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"'Source Sans Pro', 'Arial', 'sans-serif'","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}var BN="position",WN={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"},UN=function(e){return e.data.value},YN=function(e){var t,n=e.data;return null==n||null===(t=n.major)||void 0===t?void 0:t.value};function KN(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.collectConfig,o=e.collectibles,a=e.meta,s=i.from,l={chart:t,expando:n,nodes:r,collectConfig:i,collectibles:o,meta:a};switch("function"==typeof s?"custom":s){case"single":return function(e){var t=i_(e.nodes,1)[0];if("container"===t.type&&t.children[0]){var n=i_(t.children,1)[0];return n.key=t.key,[n]}return[t]}(l);case"position":return function(e){var t=e.collectibles,n=e.meta;return e.chart.shapesAt(n.position.absolute,{components:t.map(function(e){return{key:e.key}})})}(l);case"dimension":return function(e){var t=e.chart,n=e.nodes,r=e.collectConfig,i=e.collectibles,o=e.meta,a=i_(n,1)[0],s=r.filter,l=r.after,c="function"==typeof s?s:function(){return!0},u="function"==typeof l?l:function(){},d=i.reduce(function(e,n){var i=WN[n.type]||n.type;return e.push.apply(e,o_(t.findShapes(i).filter(function(e){return e.key===n.key&&e.data&&function(e){var t=e.meta,n=e.collectible,r=e.nodes,i=e.collectConfig.by,o=void 0===i?UN:i,a=n.major,s=void 0===a?YN:a,l=o({data:r.triggerer.data}),c=s({data:r.candidate.data,meta:t}),u=Array.isArray(l),d=Array.isArray(c);return u&&d?l.length===c.length&&l.every(function(e,t){return e===c[t]}):!u&&!d&&l===c}({collectConfig:r,meta:o,collectible:n,nodes:{triggerer:a,candidate:e}})}))),e},[]).filter(c);return u({collected:d,triggerer:a}),d}(l);case"radius":return function(e){var t=e.chart,n=e.collectConfig,r=e.collectibles,i=e.meta,o=i_(e.nodes,1)[0].localBounds,a=n.distance,s=n.filter,l="function"==typeof s?s:function(){return!0},c=r.map(function(e){return e.key});return t.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:a||Math.max(o.width,o.height)},{components:c.map(function(e){return{key:e}})}).filter(l)}(l);case"custom":return function(e){var t=e.chart,n=e.expando,r=e.nodes,i=e.meta;return e.collectConfig.from({chart:t,expando:n,nodes:r,meta:i})}(l);default:return[]}}var XN=Number.MAX_VALUE;function GN(e){var t=e.nodes.filter(function(e){return e.bounds.height+e.bounds.width!==0}).reduce(function(e,t){var n=t.bounds;return e.xMin=Math.min(e.xMin,n.x,n.x+n.width),e.yMin=Math.min(e.yMin,n.y,n.y+n.height),e.xMax=Math.max(e.xMax,n.x,n.x+n.width),e.yMax=Math.max(e.yMax,n.y,n.y+n.height),e},{xMin:XN,xMax:-XN,yMin:XN,yMax:-XN}),n=t.xMin,r=t.xMax,i=t.yMin;return{x:n,y:i,width:r-n,height:t.yMax-i}}function JN(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.nodes;if(!o.length)return[];var a=i_(o,1)[0].key,s=n.main.collectibles.filter(function(e){return!e.if||e.if()});if(!s.length)return[];var l=n.main.triggers.find(function(e){return-1!==e.keys.indexOf(a)})||{},c=l.collect,u=l.placement;if(!c||!c.from||!u)return[];var d={triggerer:a,position:i.get(BN)},f=(KN({chart:t,expando:r,nodes:o,collectConfig:c,collectibles:s,meta:d})||[]).map(function(e){return e.children.length?e.children[0]:e});return f.length?function(e){var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=function(e){for(var t=e.chart,n=e.config,r=e.expando,i=e.placementConfig,o=e.hovered,a=e.collected,s=e.meta,l=i_(o,1)[0],c=Array.isArray(i)?i:[i],u={bounds:l.bounds,key:l.key},d=GN({nodes:a}),f=0;f<c.length;f++){var p=c[f];if("function"==typeof p){var h=p({chart:t,expando:r,hovered:o,collected:o_(a),meta:s,collectedBounds:d,combineBounds:GN});if(h)return h}if("trigger"===p)return u;if("collectible"===p){var m=n.main.placements.collectible;return{bounds:"function"==typeof m?m({collected:o_(a)}):d,key:a[0].key}}}return u}({chart:t,config:n,expando:r,placementConfig:i,hovered:o,collected:a,meta:s}),c=l.bounds,u=l.key,d=i_(a,1)[0].desc;return[{bounds:c,nodes:a,data:a.map(function(e){return e.data}),key:u,meta:s,desc:d}]}({chart:t,config:n,expando:r,placementConfig:u,hovered:o,collected:f,meta:d}):[]}var QN=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),ZN=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),eI=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),tI=function(e){return QN.test(e)},nI=function(e){return ZN.test(e)||eI.test(e)};function rI(e){for(var t=e?e.length:0,n=0;n<t;n++){var r=e[n];if(tI(r))return"ltr";if(nI(r))return"rtl"}return"ltr"}function iI(e){var t=e.config,n=e.h,r=e.context,i={section:function(e){return function(e){return{type:"section",content:e.content}}({content:e.content})},text:function(e){var n=e.value,r=e.style,i=e.survive,o=e.visibility;return function(e){var t=e.config,n=e.value,r=e.style,i=void 0===r?{}:r,o=i.bold,a=void 0!==o&&o,s=i.italic,l=e.survive,c=e.visibility;return{type:"text",content:[{content:n,style:{"font-weight":a?"bold":"normal","font-style":void 0!==s&&s?"italic":"normal","text-align":t.rtl?"right":"left",direction:rI(n),"white-space":"pre-wrap"},colspan:2}],survive:e_(e_({},{visibility:!1}),l),visibility:e_(e_({},{count:!0,force:!1}),c)}}({config:t,value:n,style:r,survive:i,visibility:o})},measure:function(e){var r=e.label,i=e.value,o=e.color,a=e.style,s=e.survive,l=e.visibility;return function(e){var t,n,r,i,o=e.h,a=e.label,s=e.value,l=e.color,c=e.style,u=e.survive,d=e.visibility,f=e.config.rtl,p=o("div",{style:{display:"inline-block",width:10,height:10,"background-color":l,margin:"0 8px"}});return{type:"measure",label:a,value:s,content:[{content:f?[":",a]:[a,":"],style:{"text-align":f?"right":"left","font-weight":null!=c&&null!==(t=c.label)&&void 0!==t&&t.bold?"bold":"normal","font-style":null!=c&&null!==(n=c.label)&&void 0!==n&&n.italic?"italic":"normal",direction:rI(a)}},{content:l?f?[s,p]:[p,s]:s,style:{"text-align":f?"left":"right","vertical-align":"middle","font-weight":null!=c&&null!==(r=c.value)&&void 0!==r&&r.bold?"bold":"normal","font-style":null!=c&&null!==(i=c.value)&&void 0!==i&&i.italic?"italic":"normal",direction:rI(s)}}],survive:e_(e_({},{color:!1,duplicate:!1,visibility:!1}),u),visibility:e_(e_({},{count:!0,force:!1}),d)}}({config:t,h:n,label:r,value:i,color:o,style:a,survive:s,visibility:l})},divider:function(){return function(e){var t=e.visibility;return{type:"divider",content:[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2}],survive:{visibility:!1},visibility:e_(e_({},{count:!1,force:!1}),t)}}({visibility:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).visibility})},row:function(e){return function(e){var t=e.survive,n=e.visibility;return{type:"row",content:[{content:e.content,style:e.style,colspan:e.colspan}],survive:e_(e_({},{visibility:!1}),t),visibility:e_(e_({},{count:!0}),n)}}({content:e.content,style:e.style,colspan:e.colspan,survive:e.survive,visibility:e.visibility})},raw:function(e){return function(e){var t=e.survive,n=e.visibility;return{type:"raw",content:e.value,survive:e_(e_({},{visibility:!1}),t),visibility:e_(e_({},{count:!0}),n)}}({value:e.value,survive:e.survive,visibility:e.visibility})},color:function(e){var i=e.nodes,o=e.property,a=e.filter,s=void 0===a||a,l=e.visibility,c=e.fillColor;return function(e){var t=e.config,n=e.h,r=e.context,i=e.nodes,o=e.property,a=e.filter,s=e.visibility,l=e.fillColor,c=t.rtl,u={type:"color",label:void 0,value:void 0,content:[],filter:a,survive:{visibility:!1},visibility:e_(e_({},{count:!0}),s)},d=t.getColorSettings();if("color"===d.type||!d.fieldType)return u;var f=i_(i,1)[0];if(u.value=function(e){var t=e.config,n=e.context,r=e.property,i=e.node,o=i.data[r];if(o){if(-3===i.data.value)return i.data.label;var a=n.resources.dataset(o.source.key).field(o.source.field).formatter(),s=o.value,l=o.label,c=t.getColorSettings();if(a&&"measure"===c.fieldType)return Number.isNaN(+s)?"-":a(o.value);var u=l||s;return void 0===u||Number.isNaN(u)||"NaN"===u?"-":u}}({config:t,context:r,property:o,node:f}),void 0===u.value)return u;u.label=function(e){var t=e.context,n=e.property,r=e.node,i=e.config.getColorSettings();if(i.label)return i.label;var o=r.data[n];if(o&&"color"!==i.type){var a=t.resources.dataset,s=o.source,l=s.key,c=s.field;return a(l).field(c).title()}}({config:t,context:r,property:o,node:f});var p=null!=l?l:function(e){var t=e.node.attrs;return(null==t?void 0:t.fill)||"#ddd"}({node:f}),h=n("div",{style:{display:"inline-block",width:10,height:10,"background-color":p,margin:"0 8px"}});return u.content.push({content:c?[":",u.label]:[u.label,":"],style:{"text-align":c?"right":"left",direction:rI(u.label)}},{content:c?[u.value,h]:[h,u.value],style:{"text-align":c?"left":"right","vertical-align":"middle",direction:rI(u.value)}}),u}({config:t,h:n,context:r,nodes:i,property:o,filter:s,visibility:l,fillColor:c})}};return i}function oI(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.h,a=e.data,s=e.style,l=i_(a,1)[0],c=function(e){var t=e.config,n=e.nodes.reduce(function(e,n){var r=t.main.getGroupByValue({data:n.data});return e[r]||(e[r]={sorting:Object.keys(e).length,items:[]}),e[r].items.push(n),e},{});return Object.keys(n).map(function(e){return n[e]}).sort(function(e,t){return e.sorting-t.sorting}).map(function(e){return e.items})}({config:r,nodes:l.node.nodes}),u=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.h,o=e.context,a=e.groups,s=o.node.meta,l=o.resources,c=l.dataset,u=l.formatter,d=iI({config:n,h:i,context:o}),f=function(e){var t=e.dataset;return{dataset:{title:function(e,n){return t(e).field(n).title()}}}}({dataset:c}),p=a.map(function(e){var t=d.section({content:o_((n.main.section({expando:r,h:i,nodes:e,dataset:c,formatter:u,meta:s,create:d,util:f})||[]).filter(function(e){var t;return null===(t=e.content)||void 0===t?void 0:t.length})).filter(Boolean)});return t.content=function(e){var t=e.config,n=e.content,r=n.find(function(e){return"color"===e.type&&e.filter}),i=r?n.filter(function(e){return"measure"!==e.type||e.survive.color||e.label!==r.label||e.value!==r.value}):n;return t.main.showDuplicateMeasures?i:i.reduce(function(e,t){var n=t.type,r=t.survive;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;var i="".concat(t.label,"-").concat(t.value);return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e},{memory:{},filtered:[]}).filtered}({config:n,content:t.content}),t});return n.main.sections({chart:t,expando:r,h:i,nodes:o.node.nodes,dataset:c,formatter:u,meta:s,create:d,util:f,sections:p}),p.filter(Boolean)}({chart:t,config:r,expando:i,h:o,context:l,groups:c}),d=function(e){var t=e.translator,n=e.config,r=e.context,i=e.templates,o=n.main.layout,a=o.rows,s=o.grouping,l=o.single,c=function(e){var t=e.limit,n=e.grouping,r=e.single,i={count:0,overflow:0,index:{started:void 0,group:void 0},single:{found:!1,index:0}};return{process:function(e){var o=e.survive,a=e.visibility,s=e.index;if(a.force)return!0;if(i.single.found||(i.single.found=!0,i.single.index=s),r&&s!==i.single.index)return n?(i.index.started!==s&&i.index.group!==s&&(i.overflow++,i.index.group=s),!1):(i.overflow++,!1);if(i.count>=t&&(null==o||!o.visibility)){if(!n)return i.overflow++,!1;if(i.index.started!==s)return i.index.group!==s&&(i.overflow++,i.index.group=s),!1}return a.count&&i.count++,n&&(i.index.started=s),!0},overflow:function(){return i.overflow}}}({limit:a,grouping:s,single:"function"==typeof l?l({meta:r.node.meta,sections:i}):l}),u=i.reduce(function(e,t,n){var r=t.type,o=t.content;"section"===r&&(void 0===o?[]:o).forEach(function(t){c.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content)});var a=n===i.length-1;return"divider"!==r||a||c.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content),e},[]).filter(function(e){return e.length}),d=c.overflow();return d&&u.push(function(e){var t=e.translator,n=e.config,r=e.count,i=t?t.get("Object.ChartTooltip.NMore",r):"+".concat(r," more"),o=rI(i);return[{content:i,style:{"font-weight":"bold","text-align":n.rtl?"right":"left",direction:o},colspan:2}]}({translator:t,config:n,count:d})),u}({translator:n,config:r,context:l,templates:u});return d.length?function(e){var t=e.h,n=e.style;return e.rows.map(function(e){return t("tr",{},e.map(function(e){var r={style:e_(e_({},n.cell||{}),e.style||{}),class:e.class};return e.colspan&&(r.colspan=e.colspan),t("td",r,e.content)}))})}({h:o,style:s,rows:d}):function(e){var t=e.h;return t("tr",{},t("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:o})}function aI(e){var t=e.chart,n=e.translator,r=e.config,i=e.expando,o=e.internal;if(!r.main.key)return!1;var a=SA(),s=$N({key:r.main.key,rtl:r.rtl,duration:r.duration}),l=r.main.events.tooltip,c=l.afterShow,u=l.afterHide,d=function(){var e=a.get("collected");return{expando:i,nodes:e.nodes,meta:e.meta}};return F_(!0,s,{settings:{filter:function(e){return JN({chart:t,config:r,expando:i,internal:o,nodes:e})},extract:function(e){return a.set("collected",e.node),e},content:function(e){var o=e.h,a=e.data,s=e.style;return oI({chart:t,translator:n,config:r,expando:i,h:o,data:a,style:s})},placement:function(e){var t=e.nodes;return r.main.placement({meta:t[0].meta})},afterShow:function(){return c(d())},afterHide:function(){return u(d())}},style:{arrow:{color:r.style.background},content:r.style}})}function sI(e){var t=e.config,n=t.legend.keys;if(!n.tooltip||!n.component)return!1;if("categorical"!==t.getColorSettings().type)return!1;var r=$N({key:n.tooltip,rtl:t.rtl,duration:t.duration});return F_(!0,r,{settings:{filter:function(e){return e.filter(function(e){return e.data&&e.key===n.component})},extract:function(e){return e},content:function(e){var t=e.h,n=e.data;return[t("tr",{},[t("td",{style:e_(e_({},e.style.cell||{}),{"font-weight":"bold","text-align":"left"}),colspan:2},n[0].node.data.label)])]},placement:"pointer"},style:{arrow:{color:t.style.background},content:t.style}})}function lI(e){var t=e.config.main.triggers.reduce(function(e,t){return t.keys.forEach(function(n){var r=t.distance||0;e.distance[n]=r,e.distances.includes(r)||e.distances.push(r),e.key[n]=!0,e.keys[r]||(e.keys[r]=[]),e.keys[r].push(n)}),e},{distance:{},distances:[],key:{},keys:{}});return function(e){return e.components.filter(function(e){return t.key[e.key]}).reduce(function(e,n){e.any=!0,e.components.push(n.key);var r=t.distance[n.key];return 0===r?e.position.push(n.key):(e.distances.includes(r)||(e.distances.push(r),e.distanceKeys[r]=[]),e.distanceKeys[r].push(n.key)),e},{any:!1,components:[],position:[],distances:[],distanceKeys:{}})}}var cI,uI,dI=function(){return!0};function fI(e){var t=e.config.main.triggers.reduce(function(e,t){var n=t.filter;return t.keys.forEach(function(t){e[t]="function"==typeof n?n:dI}),e},{});return function(e){var n=t[e.key];return!n||n(e)}}function pI(e){var t=e.chart,n=e.event,r=e.component,i={absolute:{x:0,y:0},relative:{x:0,y:0}},o=t.element.getBoundingClientRect(),a=o.left,s=o.top;i.absolute.x=(void 0===n.clientX?Math.floor(n.srcEvent.clientX):n.clientX)-a,i.absolute.y=(void 0===n.clientY?Math.floor(n.srcEvent.clientY):n.clientY)-s;var l=t.component(r);if(l){var c=l.rect.computedInner;i.relative.x=i.absolute.x-c.x,i.relative.y=i.absolute.y-c.y}return i}function hI(e){var t=e.chart,n=e.filter,r=e.hits,i=e.position,o=[];if(r.position.length&&o.push.apply(o,o_(t.shapesAt(i.absolute,{components:r.position.map(function(e){return{key:e}})}).filter(n))),!o.length&&r.distances.length){var a=[];r.distances.forEach(function(e){a.push.apply(a,o_(t.shapesAt({cx:i.absolute.x,cy:i.absolute.y,r:e},{components:r.distanceKeys[e].map(function(e){return{key:e}})}).filter(n)))}),a.length&&o.push(function(e){var t=e.nodes,n=e.origin,r=t.find(function(e){return"path"===e.type});if(r)return r;var i=function(e){var t=Math.abs(n.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(n.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(t*t+r*r)};return t.slice(1).reduce(function(e,t){var n=i(t);return n<e.distance&&(e.distance=n,e.node=t),e},{node:t[0],distance:i(t[0])}).node}({nodes:a,origin:i.relative}))}return o}function mI(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=n.delay.tap,s=lI({config:n}),l=fI({config:n}),c=n.main.triggers.reduce(function(e,t){return e.push.apply(e,o_(t.keys)),e},[]);return{key:"event:".concat("tooltipTap"),type:"Tap",options:{event:"tooltipTap",enable:function(e,r){return!r||!!n.enable({event:r})&&t.componentsFromPoint({x:r.center.x,y:r.center.y}).filter(function(e){return-1!==c.indexOf(e.key)}).length>0}},recognizeWith:"tap",events:QD({},"tooltipTap",function(e){if(e.preventDefault(),"mouse"!==e.pointerType&&!n.main.suppress({event:e})){var c=t.component(n.main.key);if(c&&c.show){var u=t.componentsFromPoint({x:e.center.x,y:e.center.y}),d=s({components:u});if(d.any){var f=i_(d.components,1)[0],p=pI({chart:t,event:e,component:f});i.set(BN,p);var h=hI({chart:t,filter:l,hits:d,position:p});if(h.length){var m=h[0].key;n.main.events.tooltip.beforeShow({expando:r,event:e,collectNodes:function(){return o.collectNodes({nodes:h})},meta:{triggerer:m,position:p}}).then(function(){c.emit("show",e,{nodes:h,delay:a})}).catch(function(){})}else c.emit("hide")}else c.emit("hide")}}})}}function gI(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=e.facade,a=lI({config:n}),s=fI({config:n}),l=function(e){var t=e.config,n=e.expando,r=e.internal,i=e.facade,o=t.main.events.tooltip.beforeShow,a=t.delay.hover,s={ongoing:{},latest:void 0};return function(e){var t=e.event,l=e.tooltip,c=e.nodes,u=function(e){var t=e.nodes;return JSON.stringify(t.map(function(e){var t;return{key:e.key,bounds:e.bounds,value:null===(t=e.data)||void 0===t?void 0:t.value}}))}({nodes:c});if(!s.ongoing[u]){s.ongoing[u]=!0,s.latest=u;var d=c[0].key;o({expando:n,event:t,collectNodes:function(){return i.collectNodes({nodes:c})},meta:{triggerer:d,position:r.get(BN)}}).then(function(){u===s.latest&&l.emit("show",t,{nodes:c,delay:a})}).catch(function(){l.emit("show")}).finally(function(){delete s.ongoing[u],u===s.latest&&(s.latest=void 0)})}}}({config:n,expando:r,internal:i,facade:o}),c=[n.main.key,n.legend.keys.tooltip].filter(Boolean),u=function(){c.forEach(function(e){var n=t.component(e);null!=n&&n.show&&n.emit("hide")})};return{type:"native",events:{mousemove:function(e){if(n.enable({event:e})&&!n.main.suppress({event:e})){var r=t.componentsFromPoint({x:e.clientX,y:e.clientY}),o=t.component(n.main.key);if(o&&o.show){var c=a({components:r});if(c.any){var u=i_(c.components,1)[0],d=pI({chart:t,event:e,component:u});i.set(BN,d);var f=hI({chart:t,filter:s,hits:c,position:d});if(!f.length)return void o.emit("hide");l({event:e,tooltip:o,nodes:f})}else o.emit("hide")}var p=n.legend;if(p.keys.tooltip&&p.keys.component){var h=t.component(p.keys.tooltip);h&&h.show&&(r.some(function(e){return e.key===p.keys.component})?h.emit("show",e):h.emit("hide"))}}},mouseup:function(e){2===e.button&&u()},mouseleave:function(){n.main.events.interaction.mouseleave({expando:r}),u()},wheel:function(){u()}}}}function yI(e){var t=e.chart,n=e.translator,r=function(e){var t=e.config;return F_(!0,{},{rtl:!1,enable:FN.FALSE,getColorSettings:FN.OBJECT,style:{fontSize:void 0,fontFamily:void 0,color:void 0,background:void 0},delay:{hover:500,tap:0},duration:8e3,main:{key:void 0,suppress:FN.FALSE,getGroupByValue:FN.NOOP,collectibles:[],triggers:[],placement:function(){return{type:"bounds"}},placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:FN.ARRAY,sections:FN.NOOP,events:{tooltip:{beforeShow:function(){return Promise.resolve()},afterShow:FN.NOOP,afterHide:FN.NOOP},interaction:{mouseleave:FN.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},void 0===t?{}:t)}({config:e.config}),i=SA(),o=SA(),a={components:void 0,interactions:void 0};return{getComponents:function(){return a.components||(a.components=function(e){var t=e.config;return[aI({chart:e.chart,translator:e.translator,config:t,expando:e.expando,internal:e.internal}),sI({config:t})].filter(Boolean)}({chart:t,translator:n,config:r,expando:i,internal:o})),a.components},getInteractions:function(){return a.interactions||(a.interactions=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal,o=function(e){var t=e.chart,n=e.config,r=e.expando,i=e.internal;return{collectNodes:function(e){var o=e.nodes,a=i_(JN({chart:t,config:n,expando:r,internal:i,nodes:o}),1)[0];return(void 0===a?{nodes:[]}:a).nodes}}}({chart:t,config:n,expando:r,internal:i});return{gestures:[mI({chart:t,config:n,expando:r,internal:i,facade:o})],native:gI({chart:t,config:n,expando:r,internal:i,facade:o})}}({chart:t,config:r,expando:i,internal:o})),a.interactions},expando:i}}var vI=function(){if(uI)return cI;uI=1;var e={};function t(){t.init.call(this)}return e.isObject=function(e){return"object"==typeof e&&null!==e},e.isNumber=function(e){return"number"==typeof e},e.isUndefined=function(e){return void 0===e},e.isFunction=function(e){return"function"==typeof e},cI=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(t){if(!e.isNumber(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},t.prototype.emit=function(t){var n,r,i,o,a,s;if(this._events||(this._events={}),"error"===t&&!this._events.error)throw(n=arguments[1])instanceof Error?n:Error('Uncaught, unspecified "error" event.');if(r=this._events[t],e.isUndefined(r))return!1;if(e.isFunction(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];r.apply(this,o)}else if(e.isObject(r)){for(i=arguments.length,o=new Array(i-1),a=1;a<i;a++)o[a-1]=arguments[a];for(i=(s=r.slice()).length,a=0;a<i;a++)s[a].apply(this,o)}return!0},t.prototype.addListener=function(n,r){var i;if(!e.isFunction(r))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,e.isFunction(r.listener)?r.listener:r),this._events[n]?e.isObject(this._events[n])?this._events[n].push(r):this._events[n]=[this._events[n],r]:this._events[n]=r,e.isObject(this._events[n])&&!this._events[n].warned)&&((i=e.isUndefined(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&i>0&&this._events[n].length>i&&(this._events[n].warned=!0,e.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[n].length),e.isFunction(console.trace)&&console.trace()));return this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(t,n){if(!e.isFunction(n))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,n.apply(this,arguments))}return i.listener=n,this.on(t,i),this},t.prototype.removeListener=function(t,n){var r,i,o,a;if(!e.isFunction(n))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(o=(r=this._events[t]).length,i=-1,r===n||e.isFunction(r.listener)&&r.listener===n)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,n);else if(e.isObject(r)){for(a=o;a-- >0;)if(r[a]===n||r[a].listener&&r[a].listener===n){i=a;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,n)}return this},t.prototype.removeAllListeners=function(t){var n,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(n in this._events)"removeListener"!==n&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],e.isFunction(r))this.removeListener(t,r);else if(Array.isArray(r))for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},t.prototype.listeners=function(t){return this._events&&this._events[t]?e.isFunction(this._events[t])?[this._events[t]]:this._events[t].slice():[]},t.listenerCount=function(t,n){return t._events&&t._events[n]?e.isFunction(t._events[n])?1:t._events[n].length:0},cI}(),bI=r(vI);function xI(){const e={};var t;return t=e,Object.keys(bI.prototype).forEach(e=>{t[e]=bI.prototype[e]}),bI.init(t),e.lasso={active:()=>!1},e.select={on:e.on,removeListener:e.removeListener},e}function wI({picasso:t}){const n=e.useOptions(),r=e.useElement(),i=e.useSelections(),[o,a]=e.useState(),s=xI(),l=e.useLayout(),c=e.useTranslator(),u=!!l.qSelectionInfo?.qInSelections,[d,f]=e.useState(!1);return s.lasso=function({layout:e,isInSelections:t,isLassoActionActive:n,setIsLassoActionActive:r,translator:i}){return{active:n,label:i.get(n?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),hidden:!t||!!e.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,action(e){r("boolean"==typeof e?e:!n)},icon:{shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]}}}({layout:l,isInSelections:u,isLassoActionActive:d,setIsLassoActionActive:f,translator:c}),e.useAction(()=>(o&&(o.interactions.lasso.active=()=>d),{...s.lasso}),[o,d,u,c.language()]),e.useEffect(()=>{r.style.overflow="hidden";const e=t({renderer:{prio:[n.renderer||"canvas"]}}),o=e.chart({element:r,data:[],settings:{}}),c=qN({chart:o,actions:s,selections:i,config:{selectionActions:!1}});c.setLayout(l),c.setBrushAliases({colorField:"qDimensionInfo/0/qAttrDimInfo/0"});const u=function(e){var t=e_({},e),n={},r={},i=!1,o={get:function(e){return t[e]},set:function(e,o){var a=t[e];!i&&n[e]?t[e]=n[e](o,a):t[e]=o,!i&&r[e]&&r[e](t[e],a)},preventSet:function(e,t){i=!0,o.set(e,t),i=!1},intercept:function(e,t){n[e]=t},onChanged:function(e,t){r[e]=t}};return o}({legendScrollOffset:0,rotation:0});u.intercept("rotation",e=>(u.get("rotation")+e)%(2*Math.PI)),u.onChanged("rotation",()=>{o.update({partialData:!0})});const d=SA();return s.on("selections-start",()=>{o.brush("selection").start()}),a({picasso:e,chart:o,selectionService:c,viewState:u,viewCache:d,interactions:s}),()=>{c.destroy(),o.destroy(),s.removeAllListeners(),delete s.select,u.intercept("rotation",void 0),u.onChanged("rotation",void 0)}},[]),o}var SI,kI;var MI=function(){if(kI)return SI;kI=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return SI=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(h&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(h,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},SI}(),CI=r(MI);const EI=[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]],DI={};EI.forEach(([e,{width:t,height:n}])=>{DI[e]={width:t,height:n}});const _I={getLayoutModes:()=>DI,getLayoutMode(e,t){let n;for(n=0;n<EI.length;++n)if(e>=EI[n][1].width&&t>=EI[n][1].height)return EI[n][0];return"SPARK"}};function qI(e,t){return{layoutModes:_I.getLayoutModes(),center:void 0!==t.minCenterRatio?{minWidthRatio:t.minCenterRatio,minHeightRatio:t.minCenterRatio}:void 0,logicalSize:t.logicalSize?{align:.5,preserveAspectRatio:!0,...t.logicalSize}:void 0}}const AI=/^[A-Z][A-z0-9_]*$/i,TI={getChar(e){let t=e,n=-1;return t>9?(n=65+t-10,n>90&&(n+=6)):t=`${t}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?this.getChar(t+1):String.fromCharCode(n)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}},NI={setValue:(e,t,n)=>{if(!t)return!1;const r=t.split("."),i=r[r.length-1];let o,a=e;for(o=0;o<r.length-1;++o)void 0===a[r[o]]&&(a[r[o]]=Number.isNaN(+r[o+1])?{}:[]),a=a[r[o]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||AI.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>TI.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)};function II(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const OI=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),RI=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),PI=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),LI={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>OI.test(e),isRtlChar:e=>RI.test(e)||PI.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],LI.isLtrChar(r))return"ltr";if(LI.isRtlChar(r))return"rtl"}return"ltr"}},zI={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,n){const r=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&r.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(r.fillTooltip.value):r.fillTooltip.label?r.fillTooltip.label:r.fillTooltip.value,!n.coloring.label){const e=o(r.fillTooltip.source.key).field(r.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===r._fillColor?zI.getNodeFillColor(t):r._fillColor,a},getMeasure:(e,t)=>({label:`${e(t.source.key).field(t.source.field).title()}`,value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some(e=>e.field===t.coloring.field),getTitleRow(e,t){const n=LI.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getDescriptionRow(e,t){const n=LI.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getNMoreRow(e,t,n){const r=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:r,style:{"font-weight":"bold","text-align":n?"right":"left",direction:LI.detectTextDirection(r)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2},{}],getColorRow(e,t,n){const r=LI.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=LI.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,zI.getColorSymbol(e,t)]:[zI.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,r,i=!1){const o=LI.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=LI.detectTextDirection(e.value);let l;return l=i?r?[e.value,zI.getColorSymbol(t,n)]:[zI.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":r?"right":"left",direction:o}},{content:l,style:{"text-align":r?"left":"right",direction:s,"vertical-align":"middle"}}]}};function FI(e){const t=parseInt(e,10);if(!isNaN(t))return t}const jI=e=>t=>e.getContrastingColorTo(t.node.attrs.fill);function VI(e,t){const n=e.styleService.label.value.getStyle();return{padding:10,placements:e.simplifiedPlacements.map(n=>function(e,t,n){const r=n.themeService.getStyles(),i=n.styleService.label.value.getStyle(),o=i.fill===r.label.value.color;return{position:e.position,justify:e.justify,fill:o&&!e.onBackground?jI(t):i.fill,overflow:e.overflow,padding:e.padding}}(n,t,e)),fontSize:FI(n.fontSize),fontFamily:n.fontFamily,label:e.label}}function HI(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var $I;1===($I=HI).length&&($I=function(e){return function(t,n){return HI(e(t),n)}}($I));var BI="$";function WI(){}function UI(e,t){var n=new WI;if(e instanceof WI)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function YI(){}WI.prototype=UI.prototype={constructor:WI,has:function(e){return BI+e in this},get:function(e){return this[BI+e]},set:function(e,t){return this[BI+e]=t,this},remove:function(e){var t=BI+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===BI&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===BI&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===BI&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===BI&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===BI&&++e;return e},empty:function(){for(var e in this)if(e[0]===BI)return!1;return!0},each:function(e){for(var t in this)t[0]===BI&&e(this[t],t.slice(1),this)}};var KI=UI.prototype;YI.prototype={constructor:YI,has:KI.has,add:function(e){return this[BI+(e+="")]=e,this},remove:KI.remove,clear:KI.clear,values:KI.keys,size:KI.size,empty:KI.empty,each:KI.each},CI.bind(null,!0);const XI=[[2,4,6],[2,4],[3]],GI=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function JI(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function QI(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)JI(e[r],t,n)}!function(){let e,t;for(QI(XI,1,10),e=0;e<GI.length;e++)if(GI[e])for(t=0;t<GI[e].length;t++)Array.isArray(GI[e][t])&&QI(GI[e][t])}();var ZI={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qAttrExprInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo","plugins[].validMeasureValue","plugins[].labelBackgroundColor","plugins[].labelColor","plugins[].hasBackground","plugins[].maxLabelWidth","plugins[].points[].validMeasureValue","plugins[].points[].labelBackgroundColor","plugins[].points[].labelColor","plugins[].points[].hasBackground","plugins[].points[].maxLabelWidth"]};function eO(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,l=CI(!0,{},{...n,qHyperCube:{...s}}),{dataRelatedPropertiesPaths:c}=ZI;function u(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==bA(e,t)&&wA(e,t,void 0));const r=t.substring(0,n),i=t.substring(n+2),o=i.startsWith(".")?i.substring(1):i;bA(e,r,[]).forEach(e=>{o&&u(e,o)})}return c.forEach(e=>{u(l,e)}),l}var tO={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){if("line"===i.type)return i.tickValue??"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter(e=>"text"===e.type).map(e=>e.text);return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,c=a.y-s.y,u=a.width-s.width,d=a.height-s.height;e?("left"===i&&o.forEach(e=>{"line"===e.type?(e.x1+=u,e.x2+=u):"text"===e.type&&(e.x+=u)}),"left"!==i&&"right"!==i||o.forEach(e=>{"line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type&&(e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))}),"top"!==i&&"bottom"!==i||o.forEach(e=>{"line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type&&(e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))})):t?o.forEach(e=>{"line"===e.type?e.y1===e.y2?e.x2+=u:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)}):n||r?o.forEach(e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+u)}):o.forEach(e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=c,e.y2+=c+d)})}}},bars:{trackBy:function(e){return e.data.typeIndex?`${e.data.value} ${e.data.typeIndex.value}`:e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{e.opacity=0})})}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)})},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){return"line"===e.type?e.value??Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;e.forEach(e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/e.minor.size;e.points.forEach(e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)})}})}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach(e=>{e.opacity=0})}},markers:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{switch(e.type){case"circle":e.cx-=r,e.cy-=i;break;case"rect":e.x-=r,e.y-=i;break;case"path":e.transform=`translate(${-r}, ${-i})`}})}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{"image"===e.type?(e.x-=r,e.y-=i):(e.cx-=r,e.cy-=i)})}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-r,l=-i;e.forEach(e=>{switch(e.dock){case"right":r>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}})}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=eO(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=eO(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};function nO(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}var rO=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},iO=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return rO.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return rO.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||rO.newInstanceIfNeeded(e,t,this._value)}},oO=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new iO);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};(()=>{const e=[],t=[],n=new oO;let r,i,o;for(r in e["&quot"]="34",e["&amp"]="38",e["&lt"]="60",e["&gt"]="62",e["&nbsp"]="160",e["&iexcl"]="161",e["&cent"]="162",e["&pound"]="163",e["&curren"]="164",e["&yen"]="165",e["&brvbar"]="166",e["&sect"]="167",e["&uml"]="168",e["&copy"]="169",e["&ordf"]="170",e["&laquo"]="171",e["&not"]="172",e["&shy"]="173",e["&reg"]="174",e["&macr"]="175",e["&deg"]="176",e["&plusmn"]="177",e["&sup2"]="178",e["&sup3"]="179",e["&acute"]="180",e["&micro"]="181",e["&para"]="182",e["&middot"]="183",e["&cedil"]="184",e["&sup1"]="185",e["&ordm"]="186",e["&raquo"]="187",e["&frac14"]="188",e["&frac12"]="189",e["&frac34"]="190",e["&iquest"]="191",e["&Agrave"]="192",e["&Aacute"]="193",e["&Acirc"]="194",e["&Atilde"]="195",e["&Auml"]="196",e["&Aring"]="197",e["&AElig"]="198",e["&Ccedil"]="199",e["&Egrave"]="200",e["&Eacute"]="201",e["&Ecirc"]="202",e["&Euml"]="203",e["&Igrave"]="204",e["&Iacute"]="205",e["&Icirc"]="206",e["&Iuml"]="207",e["&ETH"]="208",e["&Ntilde"]="209",e["&Ograve"]="210",e["&Oacute"]="211",e["&Ocirc"]="212",e["&Otilde"]="213",e["&Ouml"]="214",e["&times"]="215",e["&Oslash"]="216",e["&Ugrave"]="217",e["&Uacute"]="218",e["&Ucirc"]="219",e["&Uuml"]="220",e["&Yacute"]="221",e["&THORN"]="222",e["&szlig"]="223",e["&agrave"]="224",e["&aacute"]="225",e["&acirc"]="226",e["&atilde"]="227",e["&auml"]="228",e["&aring"]="229",e["&aelig"]="230",e["&ccedil"]="231",e["&egrave"]="232",e["&eacute"]="233",e["&ecirc"]="234",e["&euml"]="235",e["&igrave"]="236",e["&iacute"]="237",e["&icirc"]="238",e["&iuml"]="239",e["&eth"]="240",e["&ntilde"]="241",e["&ograve"]="242",e["&oacute"]="243",e["&ocirc"]="244",e["&otilde"]="245",e["&ouml"]="246",e["&divide"]="247",e["&oslash"]="248",e["&ugrave"]="249",e["&uacute"]="250",e["&ucirc"]="251",e["&uuml"]="252",e["&yacute"]="253",e["&thorn"]="254",e["&yuml"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["&notin"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)))})(),"undefined"!=typeof document&&document.createElement("div");for(let e=0;e<255;e++)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e.toString(16);const aO={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function sO(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const lO={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise(a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,c=o[t]*(n>l?1:n/l),u=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(c,n),width:Math.min(u,l)},r()):(e={height:c,width:u},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{i(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function cO(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,n,r,i,o,a;if(e&&(e.session?.options||e.enigmaModel?.session?.sessionConfig||e.session?.config?.url)){if(t=e.session.options||e.enigmaModel?.session.sessionConfig,!t){t=e.session?.config;const n=new URL(t.url);t.host=n.hostname,t.port=n.port,t.isSecure="wss:"===n.protocol}return a=void 0!==t.secure?t.secure:t.isSecure,n=a?"https://":"http://",r=t.host||"localhost",i=t.port?`:${t.port}`:"",o=t.prefix?t.prefix:"/","/"!==o[o.length-1]&&(o=`${o}/`),n+r+i+o}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await lO.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function uO(e,t,n,r){const{app:i,flags:o}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",c=s.type||"media";let u=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){u=e;break}const d=r.data?.customTooltipAttrExps?.value||[];let f;if(-1!==u&&d[u]&&(f=d[u]),"media"===c&&s.ref?.qStaticContentUrl?.qUrl)return cO(s,l,i);if("url"===c)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&sO(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await lO.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await lO.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(i,o,s,l,f);if(o.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===c&&f&&f.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(sO(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await lO.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch(e){}return i}(i,n[u],l,f)}return[]}const dO={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(uO(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},fO={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await dO.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>dO.checkIfPromisesExist({customTooltipModel:e})};const pO=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,r=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,o=t;return{qInfo:{qType:aO.CHART.CHART_PARENT_TYPE,qId:aO.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:o}},hO=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:aO.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const mO={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",r=aO.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:r,height:r,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:aO.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":r}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{const a=i,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await mO.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=aO.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const s=await async function({app:e,properties:t,customTooltipModel:n}){const r=n;r.miniChartToken.sessionObj?.id&&await e.destroySessionObject(r.miniChartToken.sessionObj.id);const i=aO.CHART.STATE,o=pO(t,i),a=await e.createSessionObject(o),s=hO(t);if(a.id!==aO.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);r.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(r.miniChartToken.sessionObj&&r.miniChartToken.sessionObj.id===a.id)return r.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:i});if(a.miniChartToken.alternateState&&a.miniChartToken.sessionObj&&s){const e=n.length>0&&void 0!==n[0].data?.value?[n[0].data?.value]:[],s=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){const e=n[0].data.selectionOuterDimension??n[0].data.selectionDimension;if(e?.source?.field){const t=e?.source?.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(aO.CHART.CONTAINER_ID),c={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await i.embed.render({element:l,model:a.miniChartToken.model,options:c,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch(t){await mO.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(mO.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(aO.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=aO.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{const t=e;"function"==typeof t.miniChartToken?.vis?.destroy&&(t.miniChartToken.vis.destroy(),t.miniChartToken.vis=void 0)}};function gO(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function yO(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=aO.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function vO(e){const t=yO();return e.filter(e=>t[e.id])}const bO={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const o=t.data?.selectionDimension??t.data;if(!o||t.data?.customTooltipAttrExps||i[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===o.value&&t.label===o.label});t.length>0&&(r=r.concat(t[0]))}}),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=bO.getAttrExprData(a);o.length||n.length?fO.handlePromises({customTooltipModel:i,nodes:bO.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else i?.miniChartToken?.alternateState&&mO.hide({app:r.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>fO.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,r=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[r]||(n[r]=[]),n[r]},getAttrExprData(e){let t=[],n="";const r=e.qHyperCube?.qDimensionInfo||[];if(r.length>0){const i=r.length-1;t=e.qHyperCube?.qDimensionInfo?.[i]?.qAttrExprInfo||[],n=`qDimensionInfo/${i}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[aO.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[aO.CUSTOM.QUARANTINE]=[],e.forEach(e=>{r.quarantine[aO.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=r}(vO(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[aO.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[aO.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=gO(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===vO(i).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...i,...t],o=e;o.qHyperCubeDef?o.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:o.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let r=[];const i=gO(e)||[];[...i,t].forEach(e=>{const t=vO(e.qAttributeExpressions||[]);t.length>0&&(r=t)});const o=yO(),a=i.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!o[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows:e=>e.tooltip?.hideBasic||0,DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:LI.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=LI.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function xO(e,t,n,r){const i=t.qHyperCube?.[n]?.[r]?.qAttrExprInfo||[],o=[],a=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return a?(i.forEach((e,t)=>{const i=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===i?"NaN":function(e,t){let n;switch(e.id){case aO.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case aO.CUSTOM.TITLE:case aO.CUSTOM.DESCRIPTION:case aO.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);o.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:s,value:"value"})}),o):o}const wO={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>xO(t,e,r,n)}}};const SO={getCustomAttrExps(e,t,n){const r={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},i=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(i))return r;return function(e,t,n,r){const i={[aO.CUSTOM.TITLE]:!0,[aO.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=bO.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach((e,o)=>{const s=t[o];if(e.id===aO.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===aO.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),r}(n,i.map(t=>zI.getMeasure(e,t)),e,r)}};function kO({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach(e=>{r.push(SO.getCustomAttrExps(n,e,t))}),r}(e,t,n);return r.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function MO(e){const t=aO.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:r,qLabelExpression:i,cId:o}}function CO(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}const EO={migrateProperties(e){const t=CI(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let r=CO(t);return r=function(e,t){return t.concat(e.map(e=>MO(e)))}(n,r),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(r,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,r=function(e,t,n){let r=e.length;const i=[];return t.forEach(e=>{const t=MO(e),o=JSON.stringify(t);i.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${r}`,qOp:"add",qValue:o}),r++}),i.push({qPath:"/tooltip/data",qOp:"remove"}),i}(CO(e),t,n);return r},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){const n=new Promise(n=>{const r=t.qHyperCube?.qDimensionInfo||[],i=t.tooltip?.data?.qHyperCube||{},o=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(i,r)&&e.getEffectiveProperties().then(t=>{if(o){const r=this.migrateProperties(t);e.setProperties(r).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const r=this.getPatches(t);e.applyPatches(r,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)});return n}};var DO={attrExpr:EO};const{CUSTOM:_O}=aO;function qO({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:c}){const u={properties:void 0},d=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:bO,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),f="rtl"===c.direction,p=()=>{const e=!!u.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{u.properties=e},isEnabled:()=>p(),hideBasic:()=>p()&&bA(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const r=kO({dataset:e,nodes:n,layout:t});return{title:r.customTooltipInfoAttrExpsArr.find(e=>e.id===_O.TITLE)?.title,description:r.customTooltipInfoAttrExpsArr.find(e=>e.id===_O.DESCRIPTION)?.value,measures:r.customTooltipAttrExpsArr}},hasImages:()=>bO.checkIfPromisesExist({customTooltipModel:d}),createImageRow:({value:e,h:t})=>bO.getImageRow(e,{h:t,rtl:f}),addImages:({nodes:r})=>{const i=bO.getDataNodes(o,r),{attrExps:a}=bO.getAttrExprData(t);return fO.handlePromises({customTooltipModel:d,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(p()&&t.tooltip?.chart?.object?.refId&&l&&"function"==typeof r?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>mO.createContainer({layout:t,ctx:{h:e,rtl:f}}),createLimitationRow:()=>bO.getFooterRow(a.get("properties.tooltip.notselectedmessage"),f),show:({nodes:e,properties:t})=>mO.show({app:n,properties:t,selectedNodes:e,customTooltipModel:d,rtl:f}),hasAlternateState:()=>!!d.miniChartToken?.alternateState,hide:()=>mO.hide({app:n,customTooltipModel:d}),destroy:()=>mO.destroyVisualization({customTooltipModel:d})}}}function AO(e){return{layout:e,keys:{SCALE:{FILL:"fill"},COMPONENT:{DIMENSION_TITLE:"dimension-title",SLICES:"slices",PIE_LABELS:"pie-labels"}}}}function TO({flags:t,picasso:n,instance:r}){const i=e.useModel(),o=e.useApp(),a=e.useTranslator(),s=e.useElement(),[l,c]=e.useState(),u=e.useStaleLayout(),d=e.usePlugins(),f=e.useConstraints(),p=e.useOptions(),h=e.useTheme(),{qLocaleInfo:m}=e.useAppLayout(),g=e.useEmbed();return e.useEffect(()=>{if(!r)return;s.style.overflow="hidden";const e=function(e){var t,n=e.app,r=e.translator,i={initialized:!1,dimensions:[],measures:[]};return{initialize:(t=JD(n_().m(function e(t){var o,a,s,l,c,u,d;return n_().w(function(e){for(;;)switch(e.n){case 0:if(o=t.properties,!i.initialized){e.n=1;break}return e.a(2);case 1:return s=[I_(a={app:n,translator:r,properties:o}),P_(a)],e.n=2,Promise.all(s);case 2:l=e.v,c=i_(l,2),u=c[0],d=c[1],i.dimensions=u,i.measures=d,i.initialized=!0;case 3:return e.a(2)}},e)})),function(e){return t.apply(this,arguments)}),getAlternatives:function(){return{dimensions:o_(i.dimensions),measures:o_(i.measures)}}}}({app:o,translator:a}),l=pA({picasso:r.picasso,model:i,app:o,translator:a,config:{auto:!1,key:"fill"}}),y=function(e){var t=e.picassoInstance,n=e.plugins,r=e.pluginArgs,i=void 0===r?{}:r,o={initialized:!1,definitions:[]};return{initialize:function(){return JD(n_().m(function e(){var r,a,s,l;return n_().w(function(e){for(;;)switch(e.n){case 0:if(!o.initialized){e.n=1;break}return e.a(2);case 1:return a=Promise.all(n.filter(function(e){return"custom-component"===e.info.type}).map(function(){var e=JD(n_().m(function e(n){var r;return n_().w(function(e){for(;;)switch(e.n){case 0:if(n.info.componentName){e.n=1;break}throw new Error("plugin-service: Custom component is missing componentName");case 1:return e.n=2,n.fn(e_({},i));case 2:if("object"===a_(r=e.v)){e.n=3;break}throw new Error("plugin-service: Custom component needs to be an object");case 3:t.component(n.info.componentName,r);case 4:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}())),s=Promise.all(n.filter(function(e){return"component-definition"===e.info.type}).map(function(e){return e.fn(e_({},i))})),e.n=2,Promise.all([a,s]);case 2:l=e.v,o.initialized=!0,(r=o.definitions).push.apply(r,o_(l[1]));case 3:return e.a(2)}},e)}))()},extendComponents:function(e){return o.initialized?(o.definitions.filter(Boolean).forEach(function(t){var n=i_(e.filter(function(e){return e.key&&e.key===t.key}),1)[0];if(n){var r=F_(!0,{},n.brush);F_(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"===a_(e)&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=MA({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=MA({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(r,t.brush))}else e.push(t)}),e):e}}}({picassoInstance:r.picasso,plugins:d,pluginArgs:AO(u)}),v=qO({flags:t,layout:u,app:o,model:i,picasso:n,chart:r.chart,translator:a,localeInfo:m,embed:g,options:p}),b=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,c=r.extend,u=void 0===c?[]:c,d={theme:t,matrix:PN(a),styles:void 0};return d.styles=zN({theme:t,id:i,transform:l,extend:u,matrix:d.matrix}),{getStyles:function(){return d.styles},getTheme:function(){return d.theme},setTheme:function(e){d.theme=e,d.styles=zN({theme:e,id:i,transform:l,extend:u,matrix:d.matrix})}}}({theme:h,config:{id:"pieChart",resolve:[["object","label.name","color","#595959"],["object","label.name","fontFamily"],["object","label.name","fontSize","12px"]]}}),x=function({chart:e,translator:t,layout:n,constraints:r,options:i,themeService:o,colorService:a,custom:s}){const l=n.qHyperCube.qMeasureInfo.length>1,c="rtl"===i.direction,{fontFamily:u}=o.getStyles();return yI({chart:e,translator:t,config:{rtl:c,enable:()=>!r.passive,getColorSettings:()=>a.getSettings(),style:{fontFamily:u},main:{key:"tooltip",getGroupByValue:({data:e})=>e.value,collectibles:[{key:"slices",type:"slice",major:({data:e})=>e.value}],triggers:[{keys:["slices"],collect:{from:"single"},placement:"collectible"},{keys:["pie-labels","negative-indicators"],collect:{from:"dimension",by:({data:e})=>e.value},placement:"trigger"}],placement:({meta:e})=>({type:"slices"===e.triggerer?"slice":"bounds"}),section:({h:e,nodes:n,dataset:r,formatter:i,create:o,util:a})=>{const[c]=n,{title:u,description:d,measures:f}=s.isEnabled()?s.getAttributes({dataset:r,nodes:n}):{},p=[];u&&p.push(o.text({value:u,style:{bold:!0}})),d&&p.push(o.text({value:d}));const h=s.hideBasic();if(h&&!f.length&&(u||d)||p.push(o.text({value:c.data.label,style:{bold:!0}})),!h){p.push(o.color({nodes:n,property:"fill"}));const{num:e}=c.data;if(p.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label})),l){const{radius:e}=c.data;p.push(o.measure({label:a.dataset.title(e.source.key,e.source.field),value:e.label}))}p.push(o.measure({label:t?t.get("properties.dataPoints.labelmode.share"):"Share",value:i("share")(c.desc.share)}))}f&&p.push(...f.map(e=>o.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}}))),s.chart.isEnabled()&&(s.chart.hasLimitation()?(s.chart.destroy(),p.push(o.raw({value:s.chart.createLimitationRow()}))):p.push(o.raw({value:s.chart.createContainer({h:e})})));const{customTooltipImages:m}=c.data;return s.isEnabled()&&m&&p.push(...m.map(t=>o.raw({value:s.createImageRow({value:t,h:e})}))),p},layout:{grouping:!0},events:{tooltip:{beforeShow:({collectNodes:e})=>s.isEnabled()&&s.hasImages()?s.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{s.chart.isEnabled()&&!s.chart.hasLimitation()&&s.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{s.chart.isEnabled()&&s.chart.hasAlternateState()&&s.chart.hide()}}}},legend:{keys:{tooltip:"legend-color-cat",component:"legend-cat"}}}})}({chart:r.chart,translator:a,layout:u,constraints:f,options:p,themeService:b,colorService:l,custom:v}),w=function({layout:e,themeService:t,colorService:n,flags:r}){const i=t.getStyles(),o=t=>r.isEnabled("CLIENT_IM_3050")?e.components?.find(e=>e.key===t):void 0,a=(e,t)=>{const r=n.getPaletteColor;if(e?.color&&r){const n=r(e);return"none"===n&&e.index>0?e?.color??t:n??t}return t};return{axis:{title:{getStyle:()=>{const e=o("axis")?.axis?.title;return{fontFamily:e?.fontFamily??i.axis.title.fontFamily,fontSize:e?.fontSize??i.axis.title.fontSize,color:a(e?.color,i.axis.title.color)}}}},label:{name:{getStyle:()=>{const e=o("label")?.label?.name;return{fill:a(e?.color,i.label.name.color),fontSize:e?.fontSize??i.label.name.fontSize,fontFamily:e?.fontFamily??i.label.name.fontFamily}}},value:{getStyle:()=>{const e=o("label")?.label?.value;return{fill:a(e?.color,i.label.value.color),fontSize:e?.fontSize??i.label.value.fontSize,fontFamily:e?.fontFamily??i.label.value.fontFamily}}}},legend:{title:{getStyle:()=>{const e=o("legend")?.legend?.title;return{fontFamily:e?.fontFamily??i.legend.title.fontFamily,fontSize:e?.fontSize??i.legend.title.fontSize,color:a(e?.color,i.legend.title.color)}}},label:{getStyle:()=>{const e=o("legend")?.legend?.label;return{fontFamily:e?.fontFamily??i.legend.label.fontFamily,fontSize:e?.fontSize??i.legend.label.fontSize,color:a(e?.color,i.legend.label.color)}}}}}}({layout:u,themeService:b,colorService:l,flags:t}),S=function({layout:e}){const t=({ds:e,encodings:t})=>{const n={field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}};return t.slice.outerRadius&&(n.props.radius={field:t.slice.outerRadius}),e.extract(n)},n=({rows:e,encodings:t})=>t.slice.outerRadius?e.filter(e=>"NaN"!==e.num.value&&"NaN"!==e.radius.value):e.filter(e=>"NaN"!==e.num.value),r=({rows:t,encodings:n})=>n.slice.outerRadius&&!e.donut.showAsDonut?t.filter(e=>e.num.value>0&&e.radius.value>0):t.filter(e=>e.num.value>0);return vA({layout:e,config:{args:{},disclaimers:{NoDataExist:{condition:({ds:e,encodings:n})=>0===t({ds:e,encodings:n}).length},LimitedData:{condition:()=>{const t=NI.getValue(e,"qHyperCube.qSize.qcy");return NI.getValue(e,"qHyperCube.qDataPages.0.qArea.qHeight")<t}},OnlyNanData:{condition:({ds:e,encodings:r})=>{const i=t({ds:e,encodings:r});return 0===n({rows:i,encodings:r}).length}},OnlyNegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i});return 0===r({rows:a,encodings:i}).length}},NegativeOrZeroValues:{condition:({ds:e,encodings:i})=>{const o=t({ds:e,encodings:i}),a=n({rows:o,encodings:i}),s=a,l=r({rows:a,encodings:i});return s.length!==l.length}}}}})}({layout:u});c({alternativeService:e,colorService:l,disclaimerService:S,pluginService:y,themeService:b,tooltipService:x,styleService:w})},[i,o,r,u,a.language(),f,p.direction,h.name()]),l}const NO=e=>"[object Object]"===Object.prototype.toString.call(e),IO=e=>Array.isArray(e);function OO(e,t){if(e===t)return!0;if(IO(e)){if(!IO(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!OO(e[n],t[n]))return!1;return!0}if(NO(e)){if(!NO(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++){if(!Object.hasOwn(t,n[r]))return!1;if(!OO(e[n[r]],t[n[r]]))return!1}return!0}return e===t}function RO({enable:t=!0}={}){const n=e.useModel(),r=()=>Date.now().toString()+Math.random(),[i,o]=e.useState(r()),a={properties:void 0};return e.useEffect(()=>{if(!n||!n.getEffectiveProperties||!t)return()=>{};const e=()=>{n.getEffectiveProperties().then(e=>{const t=CI(!0,{},e);if(!a.properties)return void(a.properties=t);const n=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const r=CI(!0,{},e),i=CI(!0,{},t);return n.exclude=!OO(r.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete r.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!OO(r,i),n}(a.properties,t);a.properties=t,n.exclude&&!n.properties&&o(r())})};return n.on("changed",e),e(),()=>{n.removeListener("changed",e)}},[t]),i}function PO({scaleKey:e,legend:t,onEdited:n}){const{layout:r}=t,{dock:i}=r||{};return{type:"brush-range",key:"legendRangeBrush",layout:{dock:"@legend-seq"},on:n?{bubbleEnd(){n()}}:{},settings:{brush:"selection",scale:`${e}Range`,direction:"left"===i||"right"===i?"vertical":"horizontal",bubbles:{align:"left"===i||"top"===i?"end":"start",placement:"outside"},target:{selector:'[id="legend-seq-target"]',fillSelector:'[id="legend-seq-ticks"]',fill:"rgba(82,204,82,0.2)"}}}}const LO=.8,zO=.55,FO={CORNER_RADIUS:0,INNER_RADIUS:zO,STROKE:{COLOR:"#FFFFFF",WIDTH:{NONE:0,SMALL:2,MEDIUM:4,LARGE:6}}},jO=({layout:e},t,n)=>t.encodings.slice.outerRadius?{scale:"radius",fn:t=>{let r=LO,i=0;const o=n?.style?.innerRadius??zO;e.donut.showAsDonut&&(r=LO-o,i=o);return t.scale(Math.max(0,t.datum.radius.value))*r+i}}:LO,VO=({layout:e},t,n)=>{if(!e.donut.showAsDonut)return 0;const r=n?.style?.innerRadius??zO;return t.encodings.slice.outerRadius?{scale:"radius",fn:e=>{const t=LO-r,n=r;return e.scale(Math.min(0,e.datum.radius.value))*t+n}}:r},HO=({layout:e},t)=>{const n=t.colorService.getDatumProps(),r=n[Object.keys(n)[0]],i=r&&r.field?r.field:void 0,o="qDimensionInfo/0"===i,a=i?t.ds.field(i).raw():null,s=a&&(a.label||a.title||a.qFallbackTitle)||"",l=t.encodings.slice.outerRadius,{formatter:c}=t.chart,u=NI.getValue(e,"qHyperCube.qDimensionInfo",[]).length;function d(e,n){const r=t.ds.field(e).raw();return{field:e,label:!r.isCustomFormatted&&(r.qIsAutoFormat||"U"===r.qNumFormat.qType)?e=>c(n)(e.qNum):e=>e.qText}}const f=(e.components||[]).filter(e=>"slices"===e.key)[0];return{type:"pie",key:"slices",data:{extract:{field:"qDimensionInfo/0",props:{...n,num:d(t.encodings.slice.arc,"arc"),fillTooltip:i?{field:i,label:s,value:e=>o?e.qText||"-":void 0!==e.qNum&&"NaN"!==e.qNum?e.qText?e.qText:e.qNum:e.qText||"-"}:void 0,customTooltipAttrExps:0!==u?wO.getNode(e,{dimensionCount:u}):void 0,radius:l?d(l,"outerRadius"):void 0}}},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3},active:{stroke:"rgba(52, 52, 52, 0.7)",strokeWidth:2}}},{context:"highlight",data:[""],style:{inactive:{fill:"#BFDAD9"},active:{fill:"#68B2AF"}}}]},settings:{startAngle:()=>t.viewState.get("rotation"),endAngle:()=>t.viewState.get("rotation")+2*Math.PI,slice:{arc:{ref:"num"},innerRadius:VO({layout:e},t,f),fill:t.colorService.getColor(),strokeWidth:f?.style?.strokeWidth?FO.STROKE.WIDTH[f.style.strokeWidth.toUpperCase()]:FO.STROKE.WIDTH.NONE,stroke:f?.style?.strokeColor?.color??FO.STROKE.COLOR,outerRadius:jO({layout:e},t,f),cornerRadius:f?.style?.cornerRadius??0}},animations:{enabled:t.animations.enabled,isMainComponent:!0}}};function $O({layout:e},t){const n=(e.components||[]).filter(e=>"slices"===e.key)[0],r=n?.style?.innerRadius??zO,i=t.encodings.slice.outerRadius,o=t.themeService.getStyles();return!(!e.donut.showAsDonut||!i)&&{type:"pie",key:"zeroLine",data:{items:[1]},settings:{slice:{arc:1,fill:"transparent",innerRadius:0,strokeWidth:1,stroke:o.label.name.color,outerRadius:{scale:"radius",fn:e=>{const t=LO-r,n=r;return e.scale(0)*t+n}}}},animations:{enabled:t.animations.enabled}}}function BO(e){return{type:"pie-dividers",key:"pie-dividers",layout:{displayOrder:2},settings:{component:"slices",selector:"path"},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:e.animations.enabled,trackBy:()=>Math.random()}}}function WO({layout:e},t){if(e.donut.showAsDonut||!t.encodings.slice.outerRadius)return!1;return{type:"negative-indicators",key:"negative-indicators",layout:{displayOrder:2},settings:{component:"slices",selector:"path",offset:5,size:4,fill:t.themeService.getStyles().label.name.color},brush:{consume:[{context:"selection",style:{inactive:{opacity:.2}}}]},animations:{enabled:t.animations.enabled}}}function UO(e){const t=e.node.desc&&e.node.desc.share;return t?e.formatter("share")(t):""}function YO(e){return e.node.data.num.label}function KO(e){return e.node.data.radius.label}function XO(e,t,n){if(e.dataPoint.auto)return n?YO:UO;if("share"===e.dataPoint.labelMode)return UO;if("value"===e.dataPoint.labelMode){return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?KO:YO}return null}function GO({data:e}){return e?e.label:""}function JO(e){const t=parseInt(e,10);if(!isNaN(t))return t}function QO(e){const t=((e&&e.components?e.components:void 0)||[]).filter(e=>"slices"===e.key)[0];return(t?.style?.innerRadius??zO)>.3}function ZO({node:e,data:t}){return CI({_share:e.desc.share,_fillColor:e.attrs.fill},t)}function eR(e,t,n){const r=t.styleService.label.name.getStyle(),i=[{padding:10,direction:t.encodings.slice.outerRadius?"rotate":"horizontal",placements:[{position:"outside",padding:t.encodings.slice.outerRadius?4:2,fill:r.fill}],fontSize:JO(r.fontSize),fontFamily:r.fontFamily,label:GO,linkData:({node:e,data:t})=>CI({_share:e.desc.share,_fillColor:e.attrs.fill,_showTooltip:!0},t)}];if(XO(e,t,!1)){const r=function(e,t,n){return{label:XO(e,t,!1),simplifiedPlacements:[{position:e.donut.showAsDonut&&QO(e)?"inside":"into",onBackground:e.donut.showAsDonut&&QO(e),padding:4}],theme:n.theme,themeId:"object.pieChart"}}(e,t,n),o=VI(CI(t,r),n.theme);o.linkData=ZO,i.push(o)}return{key:"pie-labels",type:"labels",renderer:nO(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"slice",settings:{labels:i}}}]},brush:{consume:[{context:"selection",data:["","fill"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}function tR({layout:e,context:t},n){return!1!==e.dataPoint.show&&(1===n.dataRowCount?function(e,t,n){const r=XO(e,t,!0),i=(o=n.theme,e=>o.getContrastingColorTo(e.node.attrs.fill));var o;const a=t.themeService.getStyles(),s=t.styleService.label.name.getStyle(),l=t.styleService.label.value.getStyle(),c=s.fill===a.label.name.color,u=l.fill===a.label.value.color;return{key:"pie-labels",type:"labels",renderer:nO(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:"slices",selector:"path",strategy:{type:"rows",settings:{align:.5,justify:.5,padding:10,labels:[{fontSize:JO(s.fontSize),fontFamily:s.fontFamily,fill:c&&!e.donut.showAsDonut?i:s.fill,label:GO,linkData:({data:e})=>e},{fontSize:JO(l.fontSize),fontFamily:l.fontFamily,fill:u&&!e.donut.showAsDonut?i:l.fill,label:r,linkData:({data:e})=>e}]}}}]},animations:{enabled:t.animations.enabled,trackBy:()=>Math.random()}}}(e,n,t):eR(e,n,t))}const nR=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendRange",enable(t,n){if(this.started||!n)return!0;if(e.constraints.select||e.constraints.active)return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-seq"===e.type),i=(r||function(e){const{target:t}=e.srcEvent;return!(!t||!(t.hasAttribute("data-other-value")&&t.hasAttribute("data-idx")||"INPUT"===t.nodeName))}(n))&&!e.isLocked([this.chart.component("slices")]);return i||this.chart.component("legendRangeBrush").emit("rangeClear"),i}},events:{legendRangestart(t){t.preventDefault(),e.interactions.emit("selections-start"),this.chart.component("legendRangeBrush").emit("rangeStart",t),this.started=!0},legendRangemove(e){e.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeMove",e)},legendRangeend(t){t.preventDefault(),this.chart.component("legendRangeBrush").emit("rangeEnd",t),e.onSelect(),this.started=!1}}});function rR(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}function iR(e,t){const n=t.component("slices");if(!n)return!1;const{x:r,y:i}=rR(e,t),o=n.rect.x+n.rect.margin.left+n.rect.width/2,a=n.rect.y+n.rect.margin.top+n.rect.height/2,s=Math.min(n.rect.width,n.rect.height)/2*LO;return(o-r)**2+(a-i)**2<=s**2}const oR=(e,t,{requireFailure:n,recognizeWith:r}={})=>({type:"Tap",requireFailure:n,recognizeWith:r,options:{event:"tap",interval:10,pointers:1,enable(t,n){return!n||!e.constraints.select&&!e.constraints.active&&(this.components=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>"slices"===e.key||"legend-cat"===e.key||"pie-labels"===e.key),this.components.length)}},events:{tap(n){n.preventDefault();const{target:r}=n.srcEvent;if(r&&("INPUT"===r.nodeName||r.hasAttribute("data-other-value")))return void this.chart.component("legendRangeBrush").emit("bubbleStart",n);if(r&&r.hasAttribute("data-action")&&r.hasAttribute("data-component-key"))return void this.chart.component(r.getAttribute("data-component-key")).emit(r.getAttribute("data-action"));if(r&&r.children&&r.children[0]&&"legend-cat"===r.children[0].getAttribute("data-component-key"))return;if(e.isLocked(this.components))return;e.interactions.emit("selections-start");let i=rR(n,this.chart);this.components.some(e=>"legend-cat"===e.key)&&(i={cx:i.x,cy:i.y,r:5});const o=this.chart.shapesAt(i,{components:[{key:"slices",propagation:"stop"},{key:"legend-cat",propagation:"stop"},{key:"pie-labels",propagation:"stop"}],propagation:"stop"});o.length&&(this.chart.brushFromShapes(o,{components:[{key:o[0].key,action:n.srcEvent.ctrlKey||t?"set":"toggle",contexts:["selection"]}]}),e.onSelect())}}}),aR=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"lasso",enable(t,n){if(this.isStarted||!n)return!0;if(e.constraints.active||e.constraints.select||!e.interactions.lasso.active())return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return!e.isLocked(r)&&r.some(e=>"slices"===e.key)}},events:{lassostart(t){t.preventDefault(),e.constraints.select||e.constraints.active||this.isStarted||(e.interactions.emit("selections-start"),this.chart.component("lasso").emit("lassoStart",t),this.isStarted=!0)},lassomove(e){e.preventDefault(),this.chart.component("lasso").emit("lassoMove",e)},lassoend(t){t.preventDefault(),this.isStarted=!1,this.chart.component("lasso").emit("lassoEnd",t),e.onSelect()}}}),sR=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"areatap",pointers:2,enable(t,n){if(this.started||!n)return!0;if(e.constraints.active||e.constraints.select)return!1;const r=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y});return r.some(e=>"slices"===e.key)&&!e.isLocked(r)}},events:{areatap(t){const n=this.chart.component("area");n&&!this.started&&(e.interactions.emit("selections-start"),n.emit("areaStart",t.pointers[0]),n.emit("areaMove",t.pointers[1]),this.started=!0,setTimeout(()=>{n.emit("areaEnd"),e.onSelect(),this.started=!1},100)),t.preventDefault()}}});function lR(e){return{type:"native",key:"theusual",events:{wheel(t){let n=!1;if(!e.constraints.active&&iR(t,this.chart)){const r=Math.sign(-t.deltaY);e.viewState.set("rotation",r*(Math.PI/12)),n=!0}else if(!e.constraints.select&&!e.constraints.active){const e=this.chart.componentsFromPoint(t).filter(e=>"legend-cat"===e.key)[0];e&&(n=!0,function(e,t){const n=(Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY)>=0?"next":"prev";t.emit(n)}(t,e))}n&&t.preventDefault()}}}}const cR=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"rotate",pointers:1,threshold:10,enable(t,n){return!(!this.started&&n)||!e.constraints.active&&!e.interactions.lasso.active()&&iR(n,this.chart)}},events:{rotatestart(e){e.preventDefault();const t=this.chart.component("slices").rect,n=this.chart.element.getBoundingClientRect();this.pieCenter={x:n.left+t.x+t.width/2,y:n.top+t.y+t.height/2},this.prevAngle=Math.atan2(e.center.y-this.pieCenter.y,e.center.x-this.pieCenter.x),this.started=!0},rotatemove(t){t.preventDefault();const n=Math.atan2(t.center.y-this.pieCenter.y,t.center.x-this.pieCenter.x);e.viewState.set("rotation",n-this.prevAngle),this.prevAngle=n},rotateend(e){e.preventDefault(),this.started=!1},rotatecancel(e){e.preventDefault(),this.started=!1}}}),uR=(e,{requireFailure:t,recognizeWith:n}={})=>({type:"Pan",requireFailure:t,recognizeWith:n,options:{event:"legendPan",pointers:1,threshold:10,enable(t,n){return!(!this.isStarted&&n)||!e.constraints.active&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>"legend-cat"===e.type)}},events:{legendPanstart(e){if(e.preventDefault(),!this.isStarted){this.components=this.chart.componentsFromPoint({x:e.center.x,y:e.center.y}),this.components.forEach(t=>{t.emit("panstart",e)}),this.isStarted=!0;const t=this.chart.component("tooltip");t&&t.show&&t.emit("hide")}},legendPanmove(e){this.components.forEach(t=>{t.emit("panmove",e)}),e.preventDefault()},legendPanend(e){e.preventDefault(),this.components.forEach(t=>{t.emit("panend",e)}),this.isStarted=!1}}}),dR=(e,t,n)=>({key:"hammered",type:"hammer",enable:!0,gestures:t?[cR(e,{}),oR(e,t,{}),...n]:[nR(e,{}),sR(e,{}),cR(e,{}),aR(e,{}),uR(e,{}),oR(e,t,{}),...n]});function fR(e,t,n){const r=e.getIsSingleSelect(0),{constraints:i}=n;if(i.active&&i.passive)return[];const o=t.tooltipService.getInteractions();return[dR(t,r,o.gestures),lR(t),o.native]}function pR({settings:e},t){const n={share:{type:"d3-number",format:".1%"},arc:{data:{field:t.encodings.slice.arc}},fill:e.scales.fill&&e.scales.fill.data&&e.scales.fill.data.field?{data:{field:e.scales.fill.data.field}}:{}};return t.encodings.slice.outerRadius&&(n.outerRadius={data:{field:t.encodings.slice.outerRadius}}),n}function hR({layout:e},t,n){if(!e.dimensionTitle)return!1;const r=t.alternativeService.getAlternatives(),i=t.styleService.axis.title.getStyle();return{key:"dimension-title",type:"axis-title",renderer:"react-qcm",layout:{dock:"top",minimumLayoutMode:"SMALL"},data:{infos:e.qHyperCube.qDimensionInfo,alternatives:r.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>n.constraints.active,isRTL:n.rtl,isSnapshot:!!e.snapshotData,noModelDependencies:!0,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize}}}}function mR({layout:e,context:t,selectionService:n},r={}){const i=function({layout:e}={},t={}){const n={};return CI(n,t.colorService.getScales()),t.encodings.slice.outerRadius&&CI(n,function({layout:e},t){const n={radius:{type:"linear",include:[0],data:{extract:{field:t.encodings.slice.outerRadius}}}};return e.donut.showAsDonut||(n.radius.min=0),n}({layout:e},t)),n}({layout:e},r),o={scales:i};let a=[];const s=function(e,t){const n=e.disclaimerService.getDisclaimer();if(!n)return!1;const{rtl:r}=t,{translator:i}=e,{fontFamily:o}=e.themeService.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:n.alignment},settings:{isRTL:r,label:i.get(`Object.Disclaimer.${n.key}`)},style:{fontFamily:o}}}(r,t);if(r.disclaimerService.getHasSuppressingDisclaimer())return{components:[s]};const l=t.constraints.select||t.constraints.active,c=r.colorService.getLegend({eventName:"legend",key:"legend",viewState:r.viewState,chart:r.chart,styleReference:"object.pieChart",styleOverrides:{title:r.styleService.legend.title.getStyle(),label:r.styleService.legend.label.getStyle()},rtl:t.rtl},{navigationDisabled:l});return i.fillRange&&c.components[0]&&("right"===c.components[0].layout.dock||"left"===c.components[0].layout.dock||t.rtl)&&(i.fillRange.invert=!0),a=[HO({layout:e},r),$O({layout:e},r),BO(r),WO({layout:e},r),hR({layout:e},r,t),...c.components,PO({scaleKey:"fill",legend:c.components[0]||{},onEdited:r.onSelect}),{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:[{key:"slices",contexts:["selection"]}]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}},{key:"area",type:"brush-area",settings:{brush:{components:[{key:"slices",contexts:["selection"],action:"add"}]}},style:{area:{fill:"transparent",strokeWidth:2,stroke:"black",strokeDasharray:"5 5",opacity:.7}}},tR({layout:{components:e.components,dataPoint:CI({},e.dataPoint,{show:!(e.effectPath&&e.snapshotData&&!1===e.dataPoint.show)}),donut:e.donut},context:t},r),...r.tooltipService.getComponents(),s],a=a.filter(e=>!1!==e),{interactions:fR(n,r,t),scales:i,components:r.pluginService.extendComponents(a),palettes:r.colorService.getPalettes(),formatters:pR({settings:o},r),strategy:qI(0,r)}}function gR({instance:t,services:n,picasso:r,env:i}){const{flags:o}=i,a=e.useOptions(),s=e.useModel(),l=e.useApp(),c=e.useTranslator(),u=e.useTheme(),d=e.useStaleLayout(),f=e.useSelections(),p=e.useConstraints(),{qLocaleInfo:h}=e.useAppLayout();i.localeInfo=h;const m=RO({enable:d&&!d.snapshotData}),[g]=e.usePromise(()=>{if(!n)return Promise.resolve();DO.attrExpr.updateProperties(s,d);const e=({getUseBaseColors:e})=>({theme:u,legendProps:d.legend,layout:d,localeInfo:h,hc:d.qHyperCube,colorProps:{...d.color,useBaseColors:e(d)}});return Promise.resolve(s&&!d.snapshotData?s.getEffectiveProperties():{}).then(async t=>Promise.all([n.colorService.initialize({createConfig:e}),Promise.resolve(t),n.pluginService.initialize(),n.alternativeService.initialize({properties:t})]))},[n,m]);e.useEffect(()=>{t?.selectionService&&t.selectionService.setLayout(d)},[d]),e.useEffect(()=>{if(!t||!g)return;const{chart:e,viewState:i,interactions:m,viewCache:y}=t,{alternativeService:v,colorService:b,disclaimerService:x,pluginService:w,themeService:S,tooltipService:k,styleService:M}=n,C=a.viewState||{};d.snapshotData||(i.preventSet("legendScrollOffset",C.legendScrollOffset||0),i.preventSet("rotation",C.rotation||0)),function(e,t){e&&e.snapshotData&&e.snapshotData.content&&e.snapshotData.content.chartData&&(t.preventSet("legendScrollOffset",e.snapshotData.content.chartData.legendScrollOffset),t.preventSet("rotation",e.snapshotData.content.chartData.rotation))}(d,i),k.expando.set("properties",g[1]);const E=r.data("q")({key:"qHyperCube",data:d.qHyperCube,config:{localeInfo:h}}),D=[{type:"q",key:"qHyperCube",data:d.qHyperCube,config:{localeInfo:h}},...b.getData()],_={slice:{arc:"qMeasureInfo/0"}};d.qHyperCube.qMeasureInfo.length>1&&(_.slice.outerRadius="qMeasureInfo/1"),x.initialize({args:{ds:E,encodings:_}});const q=function(e,t){if(t.slice.outerRadius)return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc},radius:{field:t.slice.outerRadius}}}).filter(e=>e.num.value>0&&"NaN"!==e.radius.value).length;return e.extract({field:"qDimensionInfo/0",props:{num:{field:t.slice.arc}}}).filter(e=>e.num.value>0).length}(r.data("q")({data:d.qHyperCube,config:{localeInfo:h}}),_),A=f?()=>{const t=e.brush("selection");hg.selections(t,{},d).forEach(e=>{f.select(e)})}:()=>{},T=d.snapshotData&&!a.freeResize?{width:(d.snapshotData.content.size||d.snapshotData.object.size).w,height:(d.snapshotData.content.size||d.snapshotData.object.size).h}:void 0,N=e=>t.selectionService.getIsSelectionLocked(e),I=()=>mR({layout:d,context:{rtl:"rtl"===a.direction,theme:u,constraints:p},selectionService:t.selectionService},{picasso:r,ds:E,model:s,app:l,chart:e,onSelect:A,isLocked:N,interactions:m,constraints:p,translator:c,viewState:i,dataRowCount:q,encodings:_,alternativeService:v,colorService:b,disclaimerService:x,pluginService:w,themeService:S,styleService:M,tooltipService:k,debouncer:kA,properties:g[1],selections:f,logicalSize:T,flags:o,viewCache:y,animations:{enabled:()=>function({viewState:e,options:t,viewCache:n,layout:r,chart:i}){return!1!==t.chartAnimations&&n.get("chartWidth")===i.element.clientWidth&&n.get("chartHeight")===i.element.clientHeight&&n.get("hasZeroLine")===!!i.component("zeroLine")&&0===e.get("rotation")&&!tO.propertiesHaveChanged({viewCache:n,layout:r})}({viewState:i,options:a,layout:d,viewCache:y,chart:e})}});t.generateSettings=I;const O=I();e.update({data:D,settings:O}),y.set("chartWidth",e.element.clientWidth),y.set("chartHeight",e.element.clientHeight),y.set("hasZeroLine",O.components.filter(e=>"zeroLine"===e.key).length>0),tO.cacheProperties({viewCache:y,layout:d}),a.effect&&d.effectProperties?a.effect.update(d,e,{encodings:_}):d.effectPath||e.brush("highlight").end()},[t,g,a.direction,a.effectProperties,p,u.name(),c.language()])}function yR({instance:t,services:n}){const r=e.useElement(),i=e.useStaleLayout();e.onTakeSnapshot(e=>{if(!(i.snapshotData&&i.snapshotData.content&&i.snapshotData.content.chartData)&&(function(e,t){const n=t.getBoundingClientRect();e.snapshotData=e.snapshotData||{},e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.size=e.snapshotData.content.size||{w:n.width,h:n.height}}(e,r),t&&n))return function({layout:e,chart:t,viewState:n,colorService:r}){return e.snapshotData.content=e.snapshotData.content||{},e.snapshotData.content.chartData={legendScrollOffset:II(t,"legend-cat"),rotation:n.get("rotation")},r.getSnapshotData().then(t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}}).catch(()=>{})}({layout:e,chart:t.chart,colorService:n.colorService,viewState:t.viewState})}),e.useImperativeHandle(()=>({getViewState:()=>({rotation:t.viewState.get("rotation"),legendScrollOffset:II(t.chart,"legend-cat")})}),[t])}var vR,bR={exports:{}};var xR=(vR||(vR=1,function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(h&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(h,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,p=arguments.length,h=!1;for("boolean"==typeof d&&(h=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<p;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(h&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(h,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Te});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function c(e){return s+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function p(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function h(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=v(u(r[0],i),h(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),f=u(r[1],i),p=h(0),m=h(1),g=v(d,p),y=v(f,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const S={isFullRange:d,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(p(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=h(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=h(0),f=h(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=h(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:p,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=w({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:h,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}var C=t().bind(null,!0),E={},D=Array.isArray;function _(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function q(e){return void 0===e}function A(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=q(e[n||t])?o:e[t],e=e[n||t]}}),e}function N(e,t){var n=!0;if(_(e)&&_(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){N(e[r],t[r])||(n=!1)}),n);if(D(e)&&D(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}E.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?C({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);N(o,a)||A(t,i)||(q(a)?r.push({op:"add",path:s,value:o}):_(o)&&_(a)?r=r.concat(E.generate(a,o,s)):D(o)&&D(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&q(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!q(t[0])&&q(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(E.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){q(t[i])&&!A(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},E.apply=function(e,t){t.forEach(function(t){var n,r,i=T(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(D(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(D(a)&&D(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return k(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(_(a)&&_(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!A(n,e)&&delete n[e]}),C(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=T(e,t.from);D(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(D(i)?i.splice(+o,1):delete i[o])})},E.clone=function(e){return C({},e)},E.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},E.updateObject=function(e,t){Object.keys(e).length?E.apply(e,E.generate(e,t)):C(e,t)};const I=E,O=function(e,n,r){if(!e)return Promise.resolve();var i=I.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var R="accumulation";function P(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===R)return n[r]}function L(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===R)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var z={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=S.getNumStepComp(n,l),f=S.getAboveComp(n,l,u,d),p=S.getRangeComp("RangeSum",f);if(S.needDimension({modifier:n,properties:r,layout:i})){var h=S.getDimComp(c,1),m=S.getDimComp(c,0),g=S.getAggrComp(p,h,m);p=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return p},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,z)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(L(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(L(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(L(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(L(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(L(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(R))return!1;var o=P(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function V(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function H(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var $={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const B={translationKey:"properties.modifier.movingAverage",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=s;void 0===c&&(c=S.getNumDimensions({properties:i,layout:a}));var u=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=S.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),p=S.getNumStepComp(r,c),h=S.getAboveComp(r,c,f,p);if(r.nullSuppression)t=S.getRangeComp("RangeAvg",h);else{var m=S.getRangeComp("RangeSum",h),g=function(e,t){var n=S.getRowNoComp(e,t);if(!S.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(S.needDimension({modifier:r,properties:i,layout:a})){var v=S.getDimComp(u,1),b=S.getDimComp(u,0),x=S.getAggrComp(y,v,b);y=r.showExcludedValues?S.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:S.extractInputExpression,initModifier:function(e){S.initModifier(e,$)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(H(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(H(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(H(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(H(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=V(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=V(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(H(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(H(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=V(t,e);return o&&!o.disabled}};return n}};var W="timeSeriesDecomposition";function U(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?S.generateTSDExpression(n,t,r):t},extractInputExpression:S.extractInputExpression,initModifier:function(e,t){S.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=S.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=U(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=U(t,e);return n&&!n.fullRange}}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=U(t,e);return o&&!o.disabled}};return n}};var G="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===G)return n[r]}function Q(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===G)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Z={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:S.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=S.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(S.needDimension({modifier:n,properties:r,layout:i})){var p=S.getDimComp(c,1),h=S.getDimComp(c,0),m=S.getAggrComp(f,p,h);f=n.showExcludedValues?S.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return f},initModifier:function(e){Object.keys(Z).forEach(function(t){void 0===e[t]&&(e[t]=Z[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Q(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Q(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Q(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(G))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(S.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(S.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return S.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:S.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=S.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=S.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),c=""===s&&""===l?"":s||l,u=le(i,o),d=ce(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=S.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(d," Aggr(").concat(c," ").concat(e,", ").concat(f,"))")}(u,d,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!S.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return S.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="qDef.base",fe="qDef.qDef",pe="qDef.base.qDef",he="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,pe);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,pe)?pe:fe},getLibraryIdRef:function(e){return o(e,me)?me:he},getLibraryId:function(e){return o(e,me)||o(e,he)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",we="qDef.qLabel",Se="qDef.qLabelExpression",ke="qDef.base.qLabel",Me="qDef.base.qLabelExpression",Ce="qDef.qAggrFunc",Ee="qDef.base.qAggrFunc",De={initBase:function(e,t){(t||De.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,ke,o(e,we)),n(e,Me,o(e,Se)))},restoreBase:function(e){De.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,we,o(e,ke)),n(e,Se,o(e,Me)),o(e,Ce)&&o(e,Ee)&&n(e,Ce,o(e,Ee)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const _e=De;function qe(e){return qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(e)}var Ae={accumulation:F,movingAverage:B,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Te={modifiers:Ae,apply:Ie,applyModifiers:Oe,cleanUpMeasure:Re,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Pe,getActiveModifier:Le,initBase:_e.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ae[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=je(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Qe({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:ze};var Ne={};function Ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var c=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,r&&"object"===qe(r))return Oe({model:n,properties:r});var u=n?n.layout:void 0,d=o(u,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var f=o(u,"qHyperCube.qMeasureInfo"),p=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Pe({measures:f,layout:u})){var h=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ue({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:f,layout:u,model:n,lastReloadTime:p});return h||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:f,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);He(r);var i=Ze(r);return Ke({model:n}).then(function(t){return Xe({libraryIds:i,model:n}).then(function(i){return h&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(Ue({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===qe(e)&&!e.disabled){if(n++,"object"!==qe(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&Be(t)&&S.simplifyExpression(t.qDef.base.qDef)!==S.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Oe({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===qe(e.base)})}(f)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Ze(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return Fe(r).forEach(function(e){return Re(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Oe(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),He(i);var f=Ze(i);return et({model:n,libraryIds:f,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!Pe({measures:n,properties:r}))return n.forEach(function(e){return Re(e)}),Promise.resolve();var l=a?void 0:Ze(r);return Ke({model:i,dimensionAndFieldList:s}).then(function(e){return Xe({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;_e.isValid(n)||_e.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===qe(e)&&!e.disabled){if(s++,"object"!==qe(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ae[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Ae[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Ae[r.type].updateModifier&&Ae[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Ae[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||ze(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&ze(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),$e(n)):Re(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Re(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some(function(e){return"object"===qe(e)&&!e.disabled&&!Ae[e.type]})}(e)?_e.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,$e(e)}function Pe(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ye({modifiers:je(e),properties:n,layout:r})})}function Le(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function ze(e){var t=Le(e);return!t||Ae[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ve(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function He(e){Fe(e).forEach(function(e){return function(e){var n=Le(e);n&&(void 0!==n.outputExpression&&Ve(n)!==e.qDef.qDef?delete e.qDef.base:!_e.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function $e(e){var t=je(e);Array.isArray(t)&&t.forEach(function(t){"object"===qe(t)&&(t.disabled||!Ae[t.type]&&Ve(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function Be(e){return e.base||e.qDef&&e.qDef.base}function We(e){var t=Be(e);return e.qLibraryId||t&&t.qLibraryId}function Ue(e){var t=e.measure,n=e.properties,r=e.layout;return!We(t)&&Ye({modifiers:je(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==qe(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ke(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function Xe(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),Promise.all(s).then(function(){return a})}function Ge(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Ge)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ge);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):O(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Qe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===qe(e)&&!e.disabled&&Ae[e.type]&&Ae[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Ze(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=je(t);if(Ye({modifiers:r,properties:e})){var o=We(t);o&&n.push(o),i=i||Qe({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(u(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!r[e]&&s.push(u(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Ie({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>He});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var f=n(8),p=n.n(f);const h=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach(function(e){p().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var w=n(909),S=n.n(w);function k(e,t){var n=S()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function M(e,t){return S()(!0,{},t,e)}function C(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var E=Math.pow(2,53)-1;function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const q=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},A=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},I=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},O=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=k(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var c=k(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},R=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=M(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var c=M(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},P=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=C(a.max,i.dimensions.length,E),l=C(a.min,i.dimensions.length,0);return{maxDimensions:C(o.max,s,E),minDimensions:C(o.min,l,0),maxMeasures:s,minMeasures:l}},L=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},z=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=S()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=S()(!0,{},n,i)).components&&(i.components=[]),i},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},V=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return D(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?D(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),r.dimensions.added(e,n)})}},H=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return _(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},$=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&p().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function B(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const W={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),h({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,f=void 0===d||d,p=e.isHCModifierSupported,h=void 0===p||p,m={qChildren:[]},g=z({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=P({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,w=b.minDimensions,S=b.maxMeasures,k=b.minMeasures,M=l.defaultDimension,C=void 0===M?N():M,E=l.defaultMeasure,D=void 0===E?I():E;v.qDimensions.length=0,v.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:S,minMeasures:k})&&j({exportFormat:t,maxDimensions:x,minDimensions:w,maxMeasures:S,minMeasures:k,newHyperCubeDef:v}),O({exportFormat:t,maxDimensions:x,minDimensions:w,newHyperCubeDef:v,defaultDimension:C}),R({exportFormat:t,maxMeasures:S,minMeasures:k,newHyperCubeDef:v,defaultMeasure:D}),V({newProperties:g,dataDefinition:a,hypercubePath:c}),H({newProperties:g,dataDefinition:a,hypercubePath:c}),L({exportFormat:t,newHyperCubeDef:v}),A("qMaxStackedCells",y,v),A("qNoOfLeftDims",y,v),T("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,v,"S"),T("qReductionMode",y,v,"N"),T("qSortbyYValue",y,v),T("qIndentMode",y,v),T("qShowTotalsAbove",y,v),q(g,t,r),m.qProperty=g;var _=o.getValue(u||{},"support.modifiers");return $({measures:v.qMeasures,modifierTypes:_}),f&&B(m.qProperty,"storedFilters"),"S"===v.qMode&&h&&B(m.qProperty,"dynamicScript"),m}};var U={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function K(e,t){return e.length!==t}const X={create:function(e,t){if(!e||!U[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(Y(a,t,r,i),K(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},G={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>0&&G.getNumMeasures(e)<=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>0},expression:function(e){return G.getNumMeasures(e)>=1}}},Q={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}};var Z={scatterplot:Q,"sn-scatter-plot":Q,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)<=1},expression:function(e){return G.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return G.getNumDimensions(e)>=1},multiColor:function(e){return G.getNumMeasures(e)>1},measure:function(e){return G.getNumDimensions(e)>=1},expression:function(e){return G.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return G.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=X.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var p=X.create(X.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:p,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:p,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f})}n?(p.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(p)):l.qAttributeExpressions.push(p)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:p().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return p().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=G.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||G.wrapFieldName(t.name),key:G.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=X.IDMAP.COLOR_BY_ALTERNATIVE,a=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Z[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=X.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},fe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},pe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},he=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=W.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=X.IDMAP,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return X.moveByIdFromGroup(a,[],"qAttributeDimensions",c),X.moveByIdFromGroup(a,[],"qAttributeExpressions",c),X.moveByIdFromGroup(s,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=W.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,f=o.getValue(d,"visualization"),p=o.getValue(d,"qHyperCubeDef.qDimensions",[]),h=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ce(d,f),y=ue({canColorBy:g,autoColor:m,colorMode:h,dimensions:p});return g[h]?pe({shouldUpdateColorBy:y,properties:d})&&he(d):me(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),fe(p),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?B(n,"unsupportedAutoMinMax")||S()(n.measureAxis,t.measureAxis):B(n,"supportedAutoMinMax")||S()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(a);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&S()(s,n.properties.measureAxes[t[0].axis])):S()(s,n.properties.measureAxes[0])}},we=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},Se={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),we(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function ke(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Me(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var c=ke(n,r,l);o.setValue(t,c,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}function Ce(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=ke(n,r,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}var Ee="qHyperCubeDef.qMeasures",De="conditionalColoring",_e="measures",qe="qDef.conditionalColoring";const Ae={quarantine:function(e){Me({properties:e,arrayPath:Ee,quarantineName:De,arrayName:_e,itemPath:qe})},unquarantine:function(e){Ce({properties:e,arrayPath:Ee,itemPath:qe,arrayName:_e,quarantineName:De})}};var Te="qHyperCubeDef.qMeasures",Ne="measures",Ie="qHyperCubeDef.qDimensions",Oe="dimensions",Re="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Pe="alternativeMeasures",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",ze="alternativeDimensions",Fe="qCalcCondition",je="conditionalShowHide";const Ve={quarantine:function(e){Me({properties:e,arrayPath:Te,quarantineName:je,arrayName:Ne,itemPath:Fe}),Me({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Oe,itemPath:Fe})},unquarantine:function(e){Ce({properties:e,arrayPath:Te,quarantineName:je,arrayName:Ne,itemPath:Fe}),Ce({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Oe,itemPath:Fe})},quarantineAlternative:function(e){Me({properties:e,arrayPath:Re,quarantineName:je,arrayName:Pe,itemPath:Fe}),Me({properties:e,arrayPath:Le,quarantineName:je,arrayName:ze,itemPath:Fe})},unquarantineAlternative:function(e){Ce({properties:e,arrayPath:Re,quarantineName:je,arrayName:Pe,itemPath:Fe}),Ce({properties:e,arrayPath:Le,quarantineName:je,arrayName:ze,itemPath:Fe})}},He={hypercube:W,colorChart:ye,axisChart:Se,quarantineProperty:x,unquarantineProperty:B,quarantineArrayProp:Me,unquarantineArrayProp:Ce,conditionalColoring:Ae,conditionalShow:Ve}})(),r.default})()}(bR)),bR.exports),wR=r(xR);const SR={setValue(e,t,n){if(!t)return;const r=t.split(".");let i=e;const o=r[r.length-1];let a;for(a=0;a<r.length-1;++a)null==i[r[a]]&&(i[r[a]]=Number.isNaN(+r[a+1])?{}:[]),i=i[r[a]];void 0!==n?i[o]=n:delete i[o]},getValue(e,t,n){const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(null==o[r[i]])return n;o=o[r[i]]}return o}},kR={getDimensions:e=>SR.getValue(e,"qHyperCubeDef.qDimensions",[]),getNumDimensions:e=>SR.getValue(e,"qHyperCubeDef.qDimensions.length",0),getMeasures:e=>SR.getValue(e,"qHyperCubeDef.qMeasures",[]),getNumMeasures:e=>SR.getValue(e,"qHyperCubeDef.qMeasures.length",0),getDimensionLayouts(e,t){const n=SR.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qDimensionInfo:[]},getDimensionLayout(e,t,n){return this.getDimensionLayouts(t,n).filter(t=>e===t.cId)[0]},getMeasureLayouts(e,t){const n=SR.getValue(e,t?`${t}.qHyperCube`:"qHyperCube",null);return n?n.qMeasureInfo:[]},getMeasureLayout(e,t,n){return this.getMeasureLayouts(t,n).filter(t=>e===t.cId)[0]}};const MR={colorModeOptions:{primary:()=>!0,dimension:()=>!0,multiColor:()=>!1,measure:()=>!0,expression:e=>kR.getNumMeasures(e)>=1},showLegend:e=>{const t=SR.getValue(e,"color.auto"),n=SR.getValue(e,"color.expressionIsColor"),r=SR.getValue(e,"color.mode");return!(!t&&"primary"===r||!t&&"byExpression"===r&&(n||void 0===n))},persistentColorsShow:e=>!SR.getValue(e,"color.auto")&&"byDimension"===SR.getValue(e,"color.mode"),useDimValColShow:e=>(void 0===SR.getValue(e,"color.useDimColVal")&&SR.setValue(e,"color.useDimColVal",!1),!SR.getValue(e,"color.auto")&&"byDimension"===SR.getValue(e,"color.mode")&&"libraryItem"===SR.getValue(e,"color.byDimDef.type"))},CR=function(e){const{colorModeOptions:t,persistentColorsShow:n,useDimValColShow:r,showLegend:i}=MR;this.color={colorMode:{options(n){const r=[];return"explore"===e&&r.push({value:"auto",translation:"Common.Auto"}),r.push({value:"primary",translation:"properties.colorMode.primary"}),r.push({value:"byDimension",translation:"properties.colorMode.byDimension"}),r.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"}),t.expression(n)&&"explore"!==e&&r.push({value:"byExpression",translation:"properties.colorMode.byExpression"}),r}},persistentColors:{show:e=>r(e)?n(e)&&!SR.getValue(e,"color.useDimColVal"):n(e)},useDimColVal:{show:r}},this.legend={show:i,showTitle:{show(e){const t=SR.getValue(e,"color.auto");return SR.getValue(e,"legend.show")&&i(e)&&(t||!function(e){return"byExpression"===SR.getValue(e,"color.mode")&&!0===SR.getValue(e,"color.expressionIsColor")}(e))}},dock:{show:e=>SR.getValue(e,"legend.show")&&i(e)}}};function ER(e){return new CR(e)}const DR={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"piechart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.PieChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{strokeSection:{translation:"properties.Outline",component:"items",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{translation:"LayerStyleEditor.style.strokeWidth",ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{component:"items",translation:"LayerStyleEditor.style.cornerRadius",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",translation:"LayerStyleEditor.style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"items",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",translation:"LayerStyleEditor.style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}}}},_R=(e,t,n)=>{const r=`${e}.fontFamily`,i=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:r,options:()=>t.getOptions(r),defaultValue:()=>t.getDefaultValue(r)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.pieChart",e,"color")})}}}}},qR=(e,t,n,r)=>{const i=function(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,c={};l.forEach(function(e){var r=e.split(".");q_(r);for(var i=c,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=C_({theme:t,translator:n,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}});var u=function(e){var t=e.split(".");q_(t);for(var n=c,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return c.getDefaultValue=function(e){return u(e).getDefaultValue()},c.getOptions=function(e){return u(e).getOptions()},c}({theme:r,translator:n,flags:t,config:{id:"pieChart",paths:["axis.title","label.name","label.value","legend.title","legend.label"]}});return{component:"styling-panel",chartTitle:"Object.PieChart",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e,items:{strokeSection:{translation:"properties.Outline",component:"panel-section",items:{strokeItem:{component:"items",ref:"components",key:"slices",items:{strokeWrapper:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:9,show:!0,component:"dropdown",type:"string",options:[{value:"none",translation:"Common.None"},{value:"small",translation:"Common.Small"},{value:"medium",translation:"Common.Medium"},{value:"large",translation:"Common.Large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#FFFFFF"},schemaIgnore:!0,width:3,component:"color-picker"}}}}}}},cornerRadius:{translation:"LayerStyleEditor.style.cornerRadius",component:"panel-section",items:{cornerRadiusItem:{component:"items",ref:"components",key:"slices",items:{cornerRadiusSlider:{ref:"style.cornerRadius",component:"slider",min:0,max:40,step:.05,width:12,defaultValue:0,schemaIgnore:!0}}}}},innerRadius:{translation:"LayerStyleEditor.style.innerRadius",component:"panel-section",show:e=>e.donut.showAsDonut,items:{innerRadiusItem:{component:"items",ref:"components",key:"slices",items:{innerRadiusSlider:{ref:"style.innerRadius",component:"slider",min:.05,max:.75,step:.01,width:12,defaultValue:.55,schemaIgnore:!0}}}}},axisTitleSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionlabels",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:_R("axis.title",i,r)}}}:void 0,labelNameSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.dimensionValueLabel",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:_R("label.name",i,r)}}}:void 0,labelValueSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.value.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:_R("label.value",i,r)}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:_R("legend.title",i,r)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:_R("legend.label",i,r)}}}:void 0}}},AR=ER("hard");const TR=e=>{e.color?.auto||(wA(e,"color.mode","byDimension"),wA(e,"color.byDimDef.activeDimensionIndex",0),wA(e,"color.persistent",!1))},NR=e=>{const t=[{value:"primary",translation:"properties.colorMode.primary"},{value:"byDimension",translation:"properties.colorMode.byDimension"}];switch(e.color?.mode){case"byMultiple":t.push({value:"byMultiple",translation:"properties.colorMode.multicolored"});break;case"byMeasure":t.push({value:"byMeasure",translation:"properties.colorMode.byMeasure"});break;case"byExpression":t.push({value:"byExpression",translation:"properties.colorMode.byExpression"})}return t},IR=e=>{const{flags:t,translator:n}=e||{},r=e?.sense?.theme,i=t?.isEnabled("SENSECLIENT_IM_2429_PIECHART_BG"),o=t?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),a={items:{simpleItems:{items:{autoColor:{label:e=>e.color?.auto?n.get("Simple.Color.Auto",n.get("properties.colorMode.byDimension")):n.get("Common.Custom"),change:TR},colorMode:{options:NR}}}}},s={items:{labels:{items:{header:{show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length},pointLabels:{component:"checkbox",ref:"dataPoint.auto",type:"boolean",defaultValue:!0,translation:"Simple.Label.Value",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,change(e){e.dataPoint.auto||wA(e,"dataPoint.labelMode","none")}},dimensionTitle:{component:"checkbox",ref:"dimensionTitle",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:e=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length,convertFunctions:{get:(e,t,n,r)=>!r.dimensionTitle,set(e,t,n,r,i){i.dimensionTitle=!e}}}}}}},l={uses:"settings",items:{simpleStyling:DR,simpleLabels:s,general:{items:{showDisclaimer:{translation:"properties.showDisclaimer",type:"boolean",ref:"showDisclaimer",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Show"},{value:!1,translation:"properties.hide"}]}}},presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{sliceStyling:qR(i,t,n,r),showAsDonut:{ref:"donut.showAsDonut",type:"boolean",component:"item-selection-list",defaultValue:!1,horizontal:!0,items:[{icon:"pie_chart_pie",component:"icon-item",labelPlacement:"bottom",translation:"properties.pie",value:!1},{icon:"pie_chart_donut",component:"icon-item",labelPlacement:"bottom",translation:"properties.donut",value:!0}]},labels:{type:"items",snapshot:{tid:"property-labels"},items:{dimensionTitle:{ref:"dimensionTitle",type:"boolean",component:"switch",translation:"properties.dataPoints.dimensionlabels",defaultValue:!o,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},valuesAuto:{ref:"dataPoint.auto",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},labelMode:{ref:"dataPoint.labelMode",type:"string",component:"dropdown",options:[{value:"none",translation:"Common.None"},{value:"share",translation:"properties.dataPoints.labelmode.share"},{value:"value",translation:"properties.dataPoints.labelmode.value"}],defaultValue:"share",show:e=>!e.dataPoint.auto},labelValueMode:{ref:"dataPoint.labelValueMode",type:"string",component:"dropdown",translation:"properties.dataPoints.labelvaluemode",options:[{value:"arc",translation:"Visualizations.Descriptions.Angle"},{value:"radius",translation:"Visualizations.Descriptions.Radius"}],defaultValue:"arc",show:e=>!e.dataPoint.auto&&function(e){return e.qHyperCubeDef&&e.qHyperCubeDef.qMeasures.length>1||e.qHyperCube&&e.qHyperCube.qMeasureInfo.length>1}(e)&&"value"===e.dataPoint.labelMode}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{colorMode:{options:AR.color.colorMode.options},persistentColors:{show:AR.color.persistentColors.show}}},simpleColors:a,legend:{show:AR.legend.show,items:{show:{defaultValue:!1,snapshot:{tid:"property-legend"}},showTitle:{show:AR.legend.showTitle.show},dock:{show:AR.legend.dock.show}}}}},tooltip:{uses:"tooltip"}}};return l},OR={uses:"data",items:{dimensions:{uses:"dimensions"},measures:{uses:"measures",items:{numberFormatting:{items:{percentOfPieMessage:{component:"text",translation:"properties.numberFormatting.pieMessage",show:(e,t,{properties:n}={})=>n&&(n.dataPoint.auto||"share"!==n.dataPoint.labelMode)}}}}}}},RR={uses:"sorting",items:{interColumnSorting:{reset:e=>{const{qDimensions:t,qMeasures:n,qInterColumnSortOrder:r}=e.qHyperCubeDef;if(1===t.length&&n.length>=1){const t=r.length,n=[...Array(t).keys()];[n[0],n[1]]=[n[1],n[0]],e.qHyperCubeDef.qInterColumnSortOrder=n}}}}},PR={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{suppressZero:null,calcCond:{uses:"calcCond"}}}}};function LR(e){return{type:"items",component:"accordion",items:{data:OR,sorting:RR,addons:PR,settings:IR(e)}}}const zR=ER("explore"),FR=LR();var jR={type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sort"},presentation:{uses:"presentation",items:{showAsDonut:FR.items.settings.items.presentation.items.showAsDonut,labelMode:{type:"items",items:{labelMode:{type:"string",component:"radio-list",translation:"properties.dataPoints.labelmode",diffs:["dataPoint.auto:false","dataPoint.labelMode"],options:FR.items.settings.items.presentation.items.labels.items.labelMode.options,setPropertyValue(e,t){e.dataPoint.auto=!1,e.dataPoint.labelMode=t},getValue:e=>e.dataPoint.auto?"":e.dataPoint.labelMode}}}}},color:{uses:"color",items:{mode:{options:zR.color.colorMode.options},dimension:{items:{persistentColors:{show:e=>!(e.color&&"byDimension"===e.color.mode&&e.color.useDimColVal&&zR.color.useDimColVal.show(e))}}}}}}};const VR="slices";function HR(e,t){const n=e&&e.desc&&void 0!==e.desc.share?e.desc.share:void 0;return t("share")(n)}function $R(e){return e.data.num.label}function BR(e){return e.data.radius.label}function WR(e,t,n,r){return function(e,t){if(e.dataPoint.auto)return 1===e.qHyperCube.qSize.qcy?$R:HR;if("share"===e.dataPoint.labelMode)return HR;if("value"===e.dataPoint.labelMode)return t.encodings.slice.outerRadius&&"radius"===e.dataPoint.labelValueMode?BR:$R;return $R}(n,r)(e,t)}function UR(e){let t;return t=e.data.label?function(e,t){let n=e;return n.length>t&&(n=`${n.substr(0,t-3)}...`),n}(e.data.label,20):"",t}class YR{constructor({element:e,properties:t,effectHelper:n,Flag:r}){this.element=e,this.Flag=r,n.initFade(this.element);const i=e.find(".effectLayer");i.length>0&&i.remove(),e.append('<div class="effectLayer"></div>'),this.effectLayer=e.find(".effectLayer"),this._effectProperties=t,this.selectedIndex=t.selectedIndex,this.hasPropertiesPanel=!1,this.effectApplied=!0,n.fadeIn(this.element)}updateOrigSettings(e){return{dataPoint:e.dataPoint,legend:e.legend,dimensionTitle:e.dimensionTitle}}updateFlags(e,t){const n=this.chart.getAffectedShapes("highlight"),r=this.effectLayer[0].getBoundingClientRect(),i=n.map(n=>{const{start:i,end:o,outerRadius:a,offset:s}=n.desc.slice,{scaleRatio:l}=this.chart.component(n.key).rect,c=n.element.getBoundingClientRect(),u=(i+o)/2,d=c.left-r.left+l.x*(s.x+a*Math.sin(u)),f=c.top-r.top+l.y*(s.y-a*Math.cos(u)),p=Math.cos(u)>0?"top":"bottom",h=Math.sin(u)>0?"right":"left";return{title:UR(n),label:WR(n,this.chart.formatter,e,t),orientation:`${p}${h}`,position:{x:d,y:f}}});this.Flag.show(this.effectLayer,i)}init(e,t,n,r){return t.getProperties().then(e=>{if(!e.originalModelSettings){const t=CI(!0,{},e);e.originalModelSettings=this.updateOrigSettings(t)}e.effectProperties=r,e.effectPath=n,e.dataPoint.show=!1,e.legend.show=!1,e.dimensionTitle=!1,t.setProperties(e)})}remove(e,t,n){return e.options=CI(e.options,{effect:null}),n?t.getProperties().then(e=>CI(e,{effectPath:null,effectProperties:null,dataPoint:CI(!0,{},e.originalModelSettings.dataPoint),legend:CI(!0,{},e.originalModelSettings.legend),dimensionTitle:e.originalModelSettings.dimensionTitle})):Promise.resolve()}}class KR extends YR{init(e,t,n,r){return e.options=CI(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.max===r.max?Promise.resolve():super.init(e,t,n,r)}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(VR).data.items,n=e.effectProperties.min,r=e.effectProperties.max,i=[];let o=[1/0,-1],a=[-1/0,-1];t.forEach((e,t)=>{const i=e.num.value;n&&i<o[0]&&(o=[i,t]),r&&i>a[0]&&(a=[i,t])}),-1!==o[1]&&i.push(t[o[1]].value),-1!==a[1]&&i.push(t[a[1]].value),i.length&&this.chart.brush("highlight").setValues(i.map(e=>({key:"qHyperCube/qDimensionInfo/0",value:e})))}}class XR extends YR{constructor(e){super(e),this.hasPropertiesPanel=!0,this.propsTemplate=e.highlightValuePropsTemplate,this.effectHelper=e.effectHelper}onClick(e){if(!this.chart)return;const t=this.chart.shapesAt(function(e,t){const n=t.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}(e,this.chart),{propagation:"stop"});if(1!==t.length)return;const n=t[0],r=this.chart.component(VR).data.items.map(e=>e.value).indexOf(n.data.value);-1!==r&&(this.selectedIndex=r,this.effectHelper.updateSelectedPointIndex(this))}update(e,t,n){this.chart=t,this.updateHighlight(e),this.updateDataPoints(e,n),this.updateFlags(e,n)}updateHighlight(e){const t=this.chart.component(VR).data.items[e.effectProperties.selectedIndex];this.chart.brush("highlight").setValues([{key:"qHyperCube/qDimensionInfo/0",value:t.value}])}updateDataPoints(e,t){this.dataPoints=this.chart.findShapes("path").filter(e=>e.key===VR).map((n,r)=>{const i=WR(n,this.chart.formatter,e,t);return{text:`${UR(n)} (${i})`,value:r}})}init(e,t,n,r){return e.options=CI(!0,e.options,{effect:this}),t.layout.effectProperties&&t.layout.effectPath===n&&t.layout.effectProperties.selectedIndex===r.selectedIndex?Promise.resolve():super.init(e,t,n,r)}}const GR="/effects/highlight-value",JR="/effects/maxmin";var QR={isCompatible:({effectPath:e})=>e===JR||e===GR,create:e=>e.effectPath===JR?new KR(e):e.effectPath===GR?new XR(e):null};function ZR(e){const t={},{components:n,tooltip:r}=e,i=n?n.filter(e=>"slices"===e.key)[0]:void 0;if(i&&i.style&&Object.keys(i.style).forEach(e=>{t[`chart_style_${e}`]=i.style[e]}),r){t.chart_tooltip_custom=!r.auto;const e=r.chart?.object?.refId;!r.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}function eP(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures;1===t.length&&1===n.length&&(n[0].qSortBy.qSortByNumeric=-1,e.qHyperCubeDef.qInterColumnSortOrder.splice(0,e.qHyperCubeDef.qInterColumnSortOrder.length,1,0))}function tP(e){e.qOtherTotalSpec.qOtherMode="OTHER_COUNTED",e.qOtherTotalSpec.qOtherCounted={qv:"10"}}function nP({translator:e}){return{dimensions:{min:1,max:1,description:()=>e.get("Visualizations.Descriptions.Slice"),add(e,t){tP(e),eP(t),bO.addCallbackCustomTooltip(t)},move(e,t){tP(e),eP(t),bO.moveCallbackCustomTooltip(t,e)},remove(e,t){bO.removeCallbackCustomTooltip(t,e)},replace(e,t,n,r){tP(e),eP(r),bO.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:2,description:(t,n)=>e.get(0===n?"Visualizations.Descriptions.Angle":"Visualizations.Descriptions.Radius"),add(e,t){eP(t)},remove(e,t){!function(e){if(!e.qHyperCubeDef)return;const t=e.qHyperCubeDef.qMeasures,{mode:n}=e.color;"byExpression"===n&&0===t.length&&(e.color.mode="primary")}(t)}}}}const rP=e=>e.qMax<=0,iP=e=>!(!(e&&e.qHyperCube.qSize.qcy>0)||e.qHyperCube.qMeasureInfo.every(rP));function oP(e){const t={definition:LR(e),softDefinition:jR,support:{snapshot:iP,export:iP,exportData:!0,sharing:iP,viewData:!0,effects:!0},effects:QR,extendMetrics:ZR,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=wR.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:nP(e),defaultPropertyValues:a,hypercubePath:i});return s.qProperty.dataPoint&&!1===s.qProperty.dataPoint.show&&delete s.qProperty.dataPoint.show,s},exportProperties:(t,n,r,i)=>{const o=function(e){return(t,n,r,i)=>{const{translator:o,localeInfo:a}=e||{},s=wR.colorChart.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r});if(r){const e=NI.getValue(s,"properties.qHyperCubeDef.qMeasures");if(!e||0===e.length)return s;const t=e[0],n=o?.get("properties.dataPoints.labelmode.share")||"Share",r=i||a,l=r?.qDecimalSep||".",c={qDef:{qDef:"=If(Column(1) >= 0, Column(1))",qLabel:n,qNumFormat:{qType:"F",qnDec:2,qUseThou:0,qFmt:`0${l}0%`,qDec:l,qThou:r?.qThousandSep||","},qAggrFunc:"Sum",qRelative:!0,qExpressions:[],qLabelExpression:"",cId:NI.generateId()},qLibraryId:"",qAttributeExpressions:[],qAttributeDimensions:[]},u=CI(!0,{},t,c);e.push(u);const d=NI.getValue(s,"data.0.measures",[]);if(d?.length>0){const e=d[0],t=CI(!0,{},e,c);d.push(t)}}return s}}(e);return o(t,n,r,i)}};return t}function aP(e){return{version:"2.3.0",color:{auto:!0,autoMinMax:!0,byDimDef:void 0,byMeasureDef:void 0,colorExpression:void 0,dimensionScheme:"12",expressionIsColor:!0,expressionLabel:"",formatting:{numFormatFromTemplate:!0,isCustomFormatted:void 0},measureMin:void 0,measureMax:void 0,measureScheme:"sg",mode:"primary",paletteColor:{index:6},persistent:!1,reverseScheme:!1,singleColor:void 0,useBaseColors:"off",useDimColVal:!0,useMeasureGradient:!0},components:[{key:"slices",style:{strokeWidth:"none",strokeColor:{index:-1,color:FO.STROKE.COLOR},cornerRadius:FO.CORNER_RADIUS,innerRadius:FO.INNER_RADIUS}}],dataPoint:{auto:!0,labelMode:"share",labelValueMode:"arc"},dimensionTitle:!e.flags.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),donut:{showAsDonut:!1},footnote:"",legend:{dock:"auto",show:!e.flags.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),showTitle:!0},qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:10,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1,qMode:"S"},showDetails:!0,showDisclaimer:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}}}function sP(e){return{properties:{...aP(e)},data:{targets:[nP(e)]},importProperties:({exportFormat:t,initialProperties:n,hypercubePath:r})=>{const i=wR.colorChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:nP(e),hypercubePath:r});return i.qProperty.dataPoint&&!1===i.qProperty.dataPoint.show&&delete i.qProperty.dataPoint.show,i},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>wR.colorChart.exportProperties({propertyTree:e,hypercubePath:t,viewDataMode:n})}}return t=>{const{flags:r}=t;!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(n).forEach(t=>{e.add(n[t])})}}(t.translator);const i=KD();return{qae:sP(t),ext:oP(t),component(){const n=wI({picasso:i}),o=TO({flags:r,picasso:i,instance:n});gR({instance:n,services:o,picasso:i,env:t}),function({instance:t}){const n=e.useStaleLayout(),r=e.useOptions(),i=e.useRect();e.useEffect(()=>{if(!t||!t.generateSettings)return;const{viewCache:e,chart:i,generateSettings:o}=t;i.update({settings:o()}),e.set("chartWidth",i.element.clientWidth),e.set("chartHeight",i.element.clientHeight),r.effect&&r.effect.update(n,i)},[i.width,i.height])}({instance:n}),yR({instance:n,services:o})}}}});