@nebula.js/sn-bar-chart 2.1.0 → 2.2.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,7 +1,7 @@
1
1
  /*
2
- * @nebula.js/sn-bar-chart v2.1.0
2
+ * @nebula.js/sn-bar-chart v2.2.0
3
3
  * Copyright (c) 2026 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- System.register(["picasso.js","picasso-plugin-q","hammerjs","qlik-chart-modules","qlik-chart-modules/react","@nebula.js/stardust","qlik-object-conversion"],function(e){"use strict";var t,n,i,o,r,a,s,l,u,c,d,m,h,f,p,g,y,v,b,S,x,M,q,C,T,w,k,N,D,L,E,O,A,I,P,R,z,H,B,F,j,V,_,U,$,W,K,G;return{setters:[function(e){t=e.default},function(e){n=e.default},function(e){i=e.default},function(e){o=e.debouncer,r=e.throttler,a=e.getValue,s=e.setValue,l=e.createColor,u=e.pointLabelComponent,c=e.cache,d=e.storage,m=e.memoize,h=e.selectionService,f=e.colorService,p=e.tooltipService,g=e.disclaimerService,y=e.layoutService,v=e.dockService,b=e.themeService,S=e.alternativeService,x=e.pluginService,M=e.fontResolver},function(e){q=e.reactRenderer,C=e.disclaimerComponent,T=e.axisTitleComponent},function(e){w=e.useTranslator,k=e.useEmbed,N=e.useTheme,D=e.useState,L=e.useDeviceType,E=e.useAppLayout,O=e.useEffect,A=e.useElement,I=e.useOptions,P=e.useLayout,R=e.useAction,z=e.useStaleLayout,H=e.useModel,B=e.useApp,F=e.usePlugins,j=e.useSelections,V=e.useConstraints,_=e.useRect,U=e.usePromise,$=e.onTakeSnapshot,W=e.useImperativeHandle,K=e.useRenderState},function(e){G=e.default}],execute:function(){e("default",function(e){const s=function(){const e=t();return e.use(n),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",J(e))};return void e.interaction("hammer",J(Hammer))}(i)),e.use(tc),e.renderer("react-qcm",q),e.component("box-sliced-hat",Zu),e.component("box-out-of-bounds",Ku),e.component("disclaimer",C),e.component("scrollbar",Vu),e.component("scroll-hint",ms),e.component("reference-line-labels",gl),e.component("axis-overlay",Pr.picassoComponents.axisOverlay),e.component("time-axis",Pr.picassoComponents.timeAxis),e.component("space",Qu),e.component("axis-title",T),e.component("point-label",u),e.scale("q-time-axis",Pr.picassoScales.time),e}();return{qae:Hc(e),ext:ip(e),component(){const t=function({env:e}){const{flags:t}=e,n=e.anything?.sense?.isUnsupportedFeature,i=w();!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(Bc).forEach(t=>{e.add(Bc[t])})}}(e.translator);const o=k(),r=N(),[a,s]=D(),l=L(),u=E(),{qLocaleInfo:c}=u;return O(()=>{s({translator:i,theme:r,embed:o,deviceType:l,localeInfo:c,isUnsupportedFeature:n,flags:t})},[c,n,i.language(),r.name(),l]),a}({env:e}),{viewState:n,viewCache:i}=function(){const[e]=D(()=>c()),[t]=D(()=>d({viewRange:[0,1],scrollOffset:void 0}));return{viewCache:e,viewState:t}}(),l=function({picasso:e}){const t=A(),n=I(),[i,o]=D();return O(()=>{if(!e)return()=>{};t.style.overflow="hidden";const i=e({renderer:{prio:[n?.renderer||"canvas"]}}).chart({element:t,data:[],settings:{}});o(i);const{destroy:r}=i;return()=>{r()}},[n.renderer]),i}({picasso:s}),u=function({picasso:e,chart:t,environment:n,viewState:i,viewCache:o}){const s=z(),l=H(),u=B(),d=F(),m=j(),h=I(),[f,p]=D(),[g,M]=D(),[q,C]=D(),T=V(),k=function(){const[e]=D({}),[t]=D({}),n=function(){const e=P(),t=w(),n=!!e?.qSelectionInfo?.qInSelections,i=!!e?.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,[o,r]=D(!1),[a,s]=D(!1),[l,u]=D({key:"lasso",enabled:()=>!1,active:()=>!1,action:()=>!1}),c=e=>{s("boolean"==typeof e?e:!a)};return R(()=>(u({key:"lasso",action:c,enabled:()=>o,active:()=>a}),{key:"lasso",label:t.get(a?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:Gd,hidden:!o||!n||i,active:a,action:c}),[n,i,a,o,t.language()]),{get:()=>l,setAllows:e=>{r(!!e)}}}(),[i,o]=D();return O(()=>{const i={};i.scroll={key:"scroll",isActive:!0,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled(){const{layoutService:n,discrete:i}=e;return t.allowScroll&&(n?.meta.isContinuous||i?.query.getCanScroll())}},i.interact={key:"interact",isEnabled:!0,enabled:()=>t.allowInteract},i.tooltip={key:"tooltip",isActive:!0,isEnabled:!0,action(e){this.isActive=!!e},active(){return this.isActive},enabled:()=>t.allowTooltip},i.select={key:"select",isActive:!1,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled:()=>t.allowSelect},i.lasso=n.get(),Object.keys(i).forEach(e=>Yd(i[e])),o(i)},[]),O(()=>{i&&n&&(i.lasso={...i.lasso,...n.get()})},[n]),{get:()=>i,setAllows:e=>{Object.assign(t,e),n.setAllows(e?.allowSelect)},setContext:t=>{Object.assign(e,t)},destroy:()=>{Object.keys(i).forEach(e=>i[e].removeAllListeners())}}}();return O(()=>{if(!t)return()=>{};const e=k.get(),n=tm({chart:t,actions:e,selections:m});return M(e),C(n),()=>{n.destroy(),k.destroy()}},[t]),O(()=>{if(!T)return;const e={allowScroll:!T.active,allowInteract:!T.active,allowTooltip:!T.passive,allowSelect:!T.select&&!T.active};k.setAllows(e)},[T]),O(()=>{if(!q||!n)return;const{theme:m,translator:f,localeInfo:M,flags:C,embed:T}=n,{direction:w="ltr"}=h,N="rtl"===w,D=y({source:s,metaAdditionsFn:Qd(),experimental:{filter:!0}});q.setFilteredFields(D.meta.filteredFields);const L=function(e){return e.color.auto?e.qHyperCube.qDimensionInfo.length>1:"byDimension"===e.color.mode&&e.color.byDimDef&&e.color.byDimDef.activeDimensionIndex>-1}(D.getLayout())?y({source:D.getLayout()}):void 0,E=function({layout:e,options:t={}}){return!(!e?.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:s,options:h}),O=function({layoutService:e,viewCache:t,options:n}){const i={};return i.fields=function(e){const{meta:t}=e,n={majorGroup:t.isGroupedByDimension?"qDimensionInfo/0":void 0,majorStack:t.isStacked?"qDimensionInfo/0":void 0,major:t.isDimensionless?void 0:"qDimensionInfo/"+(t.dimensionCount-1),majors:e.getHyperCubeValue("qDimensionInfo").map((e,t)=>`qDimensionInfo/${t}`),minor:e.getHyperCubeValue("qMeasureInfo").map((e,t)=>`qMeasureInfo/${t}`)};return n.majorNumeric=`${t.isStackedByDimension?n.majorStack:n.major}:numeric`,n}(e),i.selectionDimensionIdx=nm(e.getHyperCube()),i.isDimensionLocked=t=>e.getHyperCube().qDimensionInfo[t].qLocked,i.selectionDimensionProp=e=>void 0===i.selectionDimensionIdx||void 0!==e&&i.selectionDimensionIdx!==e?{}:{selectionDimension:{field:i.selectionDimensionIdx}},i.animations={enabled:()=>!1!==n.chartAnimations&&(!(i.animations.isPartialUpdating||i.animations.isSizeChanging||i.animations.hasSlicedHats)&&!bl.propertiesHaveChanged({viewCache:t,layout:e.getLayout()})),isPartialUpdating:!1,isSizeChanging:!1,hasSlicedHats:!1},i}({layoutService:D,viewCache:o,options:h}),A=v({chart:t,layoutService:D,config:{logicalSize:E,rtl:N},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),I=lm({layoutService:D}),P=b({theme:m,config:{id:"barChart",transform:[["label.value.fontSize",e=>parseInt(e,10)]],resolve:[["object","plugins.label","fontFamily",'"Source Sans Pro", "Arial", "sans-serif"'],["object","plugins.label","fontSize","12px"]]}}),R=Pr.model({model:l,layoutService:D,viewCache:o,viewState:i}),z=function({enigma:e,layoutService:t,viewModel:n,definitionPath:i,reducedHyperCubePath:o},r={}){const a=function(e,t,n="/qHyperCubeDef"){return{fetch(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(Jr).then(e=>{const n=t.getHyperCubeValue("qMode"),i=t.getHyperCubeValue("qDimensionInfo"),o="K"===n&&i.length>1&&e[0]?.qIsReduced,r=e.slice(),a=t.getHyperCubeValue("qMeasureInfo"),s=o?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:r,qDimensionInfo:i.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:o?[a[0],a[0]]:a.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:s}}})}(e,t,this.settings())},settings(){const e=t.getHyperCubeValue("qDimensionInfo"),i=t.meta.isStacked&&e.length>1?1:0,o=t.getHyperCubeValue("qMeasureInfo");return{path:n,rect:{qTop:0,qLeft:i,qWidth:e.length+o.length+i,qHeight:Math.min(2e3,1e4/(o.length+1))},zoomLevel:-1,filter:"D1"}}}}(e,t,i),s=function(e,t="reducedHyperCube"){return{fetch:()=>Promise.resolve({reducedCube:e.getLayoutValue(t)||e.getHyperCube()})}}(t,o),l=function(e){return{fetch:()=>{const t=e.getHyperCube(),n={...t,qDataPages:t.qDataPages.slice()};return Promise.resolve({reducedCube:n})}}}(t),u=function({layoutService:e}){const{isSnapshot:t,isStackedByDimension:n}=e.meta,i=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return i.should=e=>t&&n&&1===e.qDimensionInfo.length,i}({layoutService:t}),c={mode:{isReduced:!1}};return{fetch(){if(t.meta.isSnapshot)return s.fetch();if(t.meta.isContinuous)return l.fetch();if(!t.meta.isStacked){if(t.getHyperCubeValue("qSize.qcy",NaN)===t.getHyperCubeValue("qDataPages.0.qArea.qHeight",NaN))return l.fetch()}return a.fetch()},model:()=>c,update(e){var i;u.should(e)&&u(e),c.mode=ne(c.mode,t.meta),c.mode.isReduced=e.qDataPages[0]&&e.qDataPages[0].qIsReduced,c.mode.isStackedByDimension=c.mode.isStacked&&(2===(i=e).qDimensionInfo.length&&2===i.qMeasureInfo.length),c.mode.isStackedByMeasure=c.mode.isStacked&&function(e){return e.qMeasureInfo.length>1&&1===e.qDimensionInfo.length}(e),c.fields={major:c.mode.isStackedByDimension?"qDimensionInfo/"+(e.qDimensionInfo.length-1):n.fields.major,majorGroup:n.fields.majorGroup,minor:c.mode.isStackedByDimension?e.qMeasureInfo.map((e,t)=>`qMeasureInfo/${t}`):n.fields.minor},c.scales={major:Jd.SCALE.REDUCED.MAJOR,minor:Jd.SCALE.REDUCED.MINOR},c.cube=e,r.qDataPages=e.qDataPages},fetchMinMaxData(){if(r.qDataPages)return Promise.resolve(r.qDataPages);let n=a.settings();const i="K"===t.getHyperCubeValue("qMode")?1:n.rect.qHeight;return n=ne(!0,{},n,{rect:{qHeight:i}}),e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).then(e=>e)},setSnapshotData(e){e.reducedHyperCube=c.cube}}}({enigma:l,layoutService:D,viewModel:O});!function({layoutService:e,viewState:t,viewStateOptions:n={}}){const i=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):n;t.preventSet("scrollOffset",i.scrollOffset),t.preventSet("legendScrollOffset",i.legendScrollOffset||0),i.zoom&&t.preventSet("zoom",i.zoom)}({layoutService:D,viewState:i,viewStateOptions:h?.viewState});const H=om({picasso:e,model:l,app:u,translator:f,localeInfo:M,theme:m,continuousDataModel:R,layoutService:D,legendLayoutService:L,reducedDataModel:z}),B=S({app:u,translator:f}),F=function({layoutService:e,themeService:t,colorService:n}){const i=t.getStyles(),o=t=>(e.getLayoutValue("components",[])||[]).find(e=>e.key===t),r=(e,t)=>{const i=n.getMain().getPaletteColor;if(e?.color&&i){const n=i(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:r(e?.color,i.axis.title.color)}}},label:{getStyle:()=>{const e=o("axis")?.axis?.label?.name;return{fill:r(e?.color,i.axis.label.name.color),fontSize:e?.fontSize??i.axis.label.name.fontSize,fontFamily:e?.fontFamily??i.axis.label.name.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:r(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:r(e?.color,i.legend.label.color)}}}},label:{getStyle:()=>{const e=o("label")?.label?.value;return{fill:r(e?.color,i.label.value.color),useContrastColor:e?.useContrastColor??!0,fontSize:e?.fontSize??i.label.value.fontSize,fontFamily:e?.fontFamily??i.label.value.fontFamily}}}}}({layoutService:D,themeService:P,colorService:H}),j=Ed({layoutService:D,viewState:i,colorModel:{settings:()=>H.getMain().getSettings(),resolveUIColor:e=>H.getMain().getPaletteColor(e)},chart:t,env:n,keys:{colorScale:Jd.SCALE.MAIN.COLOR},isEnabled:()=>!D.meta.isGroupedByDimension&&!D.meta.isDimensionless});Tc.attrExpr.updateProperties(l,s);const V=yc({layout:s,app:u,model:l,picasso:e,chart:t,translator:f,localeInfo:M,embed:T}),_=kc({app:u,chart:t,embed:T,flags:C,layout:D.getLayout(),localeInfo:M,model:l,options:{direction:h.direction},picasso:e,translator:f}),U=am({chart:t,actions:g,translator:f,rtl:N,viewState:i,viewModel:O,layoutService:D,dockService:A,colorService:H,themeService:P,trendLineModel:j,custom:_});let $;D.meta.isDiscrete&&($=function({chart:e,actions:t,componentKey:n,enigmaModel:i,layoutService:o,dockService:s,trendLineModel:l,itemWidths:u,viewState:d,rtl:m,options:{definitionPath:h="/qHyperCubeDef",getRect:f,axisKey:p,renderer:g,areaBuffer:y,processDataPage:v=()=>{}}={}}){const b=c(),S=function({qMode:e}){switch(e){case"K":return Gc;case"T":return Yc;default:return Kc}}({qMode:o.getHyperCubeValue("qMode")}),x=function({state:e,contains:t}){return e.set(Xc,[]),{add:t=>{const n=e.get(Xc);n.length=0,n.push(t)},getCurrent:()=>e.get(Xc)[0],getAll:()=>e.get(Xc),contains:n=>t(e.get(Xc)[0],n)}}({state:b,contains:S.contains});!function({layoutService:e,dataStore:t,composition:n}){const i=e.getDataPages()[0];if(!i)return;const o=n.patcher({layoutService:e});o.should(i)&&o(i);t.add(i)}({layoutService:o,dataStore:x,composition:S});const M=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:y}),q=function({dataStore:e,composition:t,enigmaModel:n,layoutService:i,trendLineModel:o=id,definitionPath:a,processDataPage:s}){const{slicer:l,cacheWarden:u,request:c}=t,d=function({dataStore:e,slice:t,warden:n,expand:i,request:o,process:r,connectionless:a,processDataPage:s}){const l=(l,{onProcessing:u}={})=>{if(e.contains(l)){const i=e.getCurrent();if(a)return Promise.resolve(t(i,l));const o=n.release(i.qArea,l),s=r.isProcessing();if(!o&&s&&r.cancel(),!o||s)return Promise.resolve(t(i,l))}if(a)return Promise.resolve(e.getCurrent());r.isProcessing()&&u&&u();const c=i(l);return r(o(c)).then(n=>(s(n),e.add(n),t(n,l)))};return l}({dataStore:e,slice:l,warden:u({bounds:{width:i.meta.size.x,height:i.meta.size.y}}),expand:td({layoutService:i}),request:c({definitionPath:a}),process:nd(n),connectionless:i.meta.isSnapshot,processDataPage:s}),m=r((e,{onProcessing:t,onData:n})=>{d(e,{onProcessing:t}).then(e=>n(e)).catch(e=>{if(e!==Fc)throw e})},Uc);return function(e,{onProcessing:t=jc,onDataPage:n=jc}={}){m(e,{onProcessing:t,onData:e=>{i.setDataPages(e?[e]:[]),o.command.update(),n(e)}})}}({dataStore:x,composition:S,enigmaModel:i,layoutService:o,trendLineModel:l,definitionPath:h,processDataPage:v}),C=function({chart:e,componentKey:t,state:n,dataStore:i,pageData:o,layoutService:r,dockService:a,itemWidths:s,getRect:l,axisKey:u,renderer:c,areaBuffer:d,viewState:m,rtl:h}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const f=function({chart:e,getRect:t,getDataPages:n,layoutService:i,dockService:o,getItemWidths:r,axisKey:a,renderer:s,areaBuffer:l,rtl:u}){const{inTotal:c,area:d,scaleRange:m}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:i}=e.meta;if(t)return od;if(!n)return rd;return i?ud:md}({layoutService:i}),h=()=>"horizontal"===o.meta.major.orientation?t().width:t().height,f=e=>e?h()/e:0,p=(e,t)=>-(e-t)*f(t);return{getItems(){const n=i.getLayoutValue("dimensionAxis"),l=c({layoutService:i});return{inTotal:l,inView:hd({chart:e,rect:t(),dockService:o,itemWidths:r(),axisKey:a,renderer:s,isGrouped:i.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(Vc/(i.meta.dimensionCount+i.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return f(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:i}=t,o=Math.min(0,Math.max(e,p(n,i))),r=i?Math.abs(i*o/h()):0;return{start:{pixel:o,item:r},end:{item:Math.min(r+(i||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return p(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:i}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:i}){const o=e/n*t,r=Math.abs(i)/o,a=Math.min(1,r+e/o);return[r,a]}({viewSize:h(),inTotal:n,inView:i,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>d({getDataPages:n,layoutService:i,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const r=m({getDataPages:n,layoutService:i,offsets:e,items:t,viewSize:h(),upperBound:p(t.inTotal,t.inView)});return"horizontal"===o.meta.major.orientation&&u?function(e){return[1-e[1],1-e[0]]}(r):r},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:i}=t;return e<=0&&e>=p(n,i)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,i=e*f(n);return Number.isFinite(i)?-i:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:i}=t;return-e*(f(i)*n)}}}}({chart:e,getRect:()=>n.get("rect"),getDataPages:i.getCurrent,layoutService:r,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:u,renderer:c,areaBuffer:d,rtl:h}),p=()=>{const e=f.getItems();return n.set("items",e),e},g=({pixelOffset:e,items:t})=>{const i=f.getOffsets({pixelOffset:e,items:t});return n.set("offsets",i),i},y=({items:e})=>{const t=r.getLayoutValue("scrollStartPos"),n=m.get("scrollOffset");if(void 0===n)return 1===t?f.getUpperBound({items:e}):0;if("number"==typeof n)return f.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:i,end:o}=n,a=1===t&&o?o-e.inView:i;return f.convert.itemToPixelOffset({itemOffset:a,items:e})},v=e=>{const[{qArea:t}]=r.getDataPages();return!!t&&Object.keys(e).every(n=>e[n]===t[n])},b=e=>{const t=Date.now(),i=p(),r=g({pixelOffset:e,items:i}),a=f.getArea({itemOffset:r.start.item,items:i});if(v(a))return void((f.validate.offset({pixelOffset:e,items:i})||m.get("scrollOffset").start!==r.start.item)&&(n.set("finished",t),n.set("scaleRange",f.getScaleRange({offsets:r.start,items:i})),m.preventSet("viewRange",f.getViewRange({pixelOffset:r.start.pixel,items:i})),m.set("scrollOffset",{start:r.start.item,end:r.end.item})));m.preventSet("viewRange",f.getViewRange({pixelOffset:r.start.pixel,items:i}));const s=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",f.getScaleRange({offsets:r.start,items:i})),m.set("scrollOffset",{start:r.start.item,end:r.end.item}))};o(a,{onProcessing:s,onDataPage:s})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const i=e.component(t);if(!i)return Promise.resolve();n.set("rect","function"==typeof l?l():i.rect),n.set("itemWidths","function"==typeof s?s():s);const r=p();n.set("itemSize",f.getItemSize({items:r}));const a=y({items:r}),u=g({pixelOffset:a,items:r});m.preventSet("viewRange",f.getViewRange({pixelOffset:u.start.pixel,items:r}));const c=f.getArea({itemOffset:u.start.item,items:r});return new Promise(e=>{o(c,{onDataPage:()=>{n.set("scaleRange",f.getScaleRange({offsets:u.start,items:r})),m.preventSet("scrollOffset",{start:u.start.item,end:u.end.item}),e()}})})},scroll(e){const t=n.get("offsets").start.pixel+e;b(t)},scrollToRelative(e){const t=n.get("items"),i=f.convert.relativeToPixelOffset({relativeOffset:e,items:t});b(i)}}}({chart:e,componentKey:n,state:b,dataStore:x,pageData:q,layoutService:o,dockService:s,itemWidths:u,getRect:f,axisKey:p,renderer:g,areaBuffer:M,viewState:d,rtl:m}),T=function({layoutService:e,dataStore:t}){return function(n){const i=a(n,`${e.refs.dataPages}`);i.length=0,i.push(t.getCurrent())}}({layoutService:o,dataStore:x}),w=function({chart:e,actions:t,componentKey:n,dockService:i,rtl:o,scroller:r}){return{gestures:[Qc({chart:e,actions:t,componentKey:n,dockService:i,rtl:o,scroller:r})],native:{type:"native",events:{wheel:ed({chart:e,actions:t,componentKey:n,scroller:r})}}}}({chart:e,actions:t,componentKey:n,dockService:s,rtl:m,scroller:C});return{interactions:w,query:{getCanScroll:()=>C.enabled(),getItemSize:()=>C.itemSize(),getScaleRange:()=>C.scaleRange(),getCurrentDataPage:()=>x.getCurrent()},command:{initialize:()=>C.initialize(),scrollTo:e=>C.scrollToRelative(e),setSnapshotData:e=>T(e)}}}({chart:t,actions:g,componentKey:Jd.COMPONENT.BAR,enigmaModel:l,layoutService:D,dockService:A,trendLineModel:j,itemWidths:Xd,viewState:i,rtl:N,options:{axisKey:Jd.COMPONENT.BAR_AXIS,renderer:e.renderer("svg")()}}));const W=function({layoutService:e,discreteModel:t}){const{isContinuous:n,canBeContinuous:i,isGroupedByDimension:o}=e.meta,r=e.getLayout(),a="K"===r.qHyperCube.qMode,s=Yr.dimensionless(r),l=Ys.getMeasureRefLines(r),u=Ys.getDimensionRefLines(r,s),c=Ys.getMeasureRefLineLabels(r),d=Ys.getDimensionRefLineLabels(r,s);let m={},h={};const f=t=>{if(i){const n=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:i,qMax:o}=n;return Ys.isOutOfRange({value:t,qMin:i,qMax:o})}return!1},p=t=>{if(!h[t])return!1;if(!n&&o){const n={valueInfo:h[t]},i="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",o=e.getHyperCubeValue(i);return Ys.isOutOfDataPages({label:n,dataPages:o})}return!0},g=()=>!(!u||!u.length)&&!u.every(t=>{const n=Ys.getInputValue({refLineLayout:t,layoutService:e});return f(n)||p(n)}),y={isKMode:a,canBeContinuous:i,measureRefLines:l,dimensionRefLines:u,measureRefLineLabels:c,dimensionRefLineLabels:d,dimensionRefLineInfo:h,dimensionValuesInfo:m,query:{getRefLines:e=>Ys.getRefLines(r,e),getRefLineLabels:e=>Ys.getRefLineLabels(r,e)},update:()=>{h=y.dimensionRefLineInfo,g()&&(m=Ys.getDimensionValuesInfo({layout:r,canBeContinuous:i,discreteModel:t,layoutService:e}),y.dimensionValuesInfo=m,u.forEach(t=>{const n=Ys.getInputValue({refLineLayout:t,layoutService:e});m[n]&&(h[n]?(h[n].innerValues=m[n].innerValues,h[n].minOrder=Math.min(h[n].minOrder,m[n].minOrder),h[n].maxOrder=Math.max(h[n].maxOrder,m[n].maxOrder),h[n].isMinOrderOk=h[n].isMinOrderOk||m[n].isMinOrderOk,h[n].isMaxOrderOk=h[n].isMaxOrderOk||m[n].isMaxOrderOk):h[n]={id:m[n].id,qText:m[n].qText,innerValues:m[n].innerValues,minOrder:m[n].minOrder,maxOrder:m[n].maxOrder,isMinOrderOk:m[n].isMinOrderOk,isMaxOrderOk:m[n].isMaxOrderOk},h[n].numInnerValues=(h[n].maxOrder||0)-(h[n].minOrder||0)+1)}))}};return y.update(),y}({layoutService:D,discreteModel:$}),K=function(e){const t={layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:Jd.SCALE.MAIN.MINOR,MAJOR:Jd.SCALE.MAIN.MAJOR}},COMPONENT:{BAR:Jd.COMPONENT.BAR,BAR_AXIS:Jd.COMPONENT.BAR_AXIS,Y_AXIS:"y-axis",MEASURE_TITLE:"measure-title",DIMENSION_TITLE:"dimension-title"},COLLECTION:{MAIN:Jd.COLLECTION.MAIN}}};return t}(D),G=x({picassoInstance:e,plugins:d||[],pluginArgs:K});k.setContext({discrete:$,layoutService:D}),p({alternativeService:B,discrete:$,continuous:Pr,legendLayoutService:L,layoutService:D,viewModel:O,dockService:A,themeService:P,styleService:F,continuousDataModel:R,reducedDataModel:z,colorService:H,trendLineModel:j,refLineModel:W,pluginService:G,customTooltipModel:V,tooltipService:U,selectionService:q,logicalSize:E,disclaimerService:I,customTooltipService:_})},[q,h,n,s]),f}({picasso:s,chart:l,environment:t,viewState:n,viewCache:i}),m=function({env:e,services:t}){const n=B(),i=H(),o=K(),r=function({enable:e=!0}={}){const t=H(),n=()=>Date.now().toString()+Math.random(),[i,o]=D(n()),r={properties:void 0};return O(()=>{if(!t||!t.getEffectiveProperties||!e)return()=>{};const i=()=>{t.getEffectiveProperties().then(e=>{const t=ne(!0,{},e);if(!r.properties)return void(r.properties=t);const i=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const i=ne(!0,{},e),o=ne(!0,{},t);return n.exclude=!Rf(i.qHyperCubeDef?.qLayoutExclude,o.qHyperCubeDef?.qLayoutExclude),delete i.qHyperCubeDef?.qLayoutExclude,delete o.qHyperCubeDef?.qLayoutExclude,n.properties=!Rf(i,o),n}(r.properties,t);r.properties=t,i.exclude&&!i.properties&&o(n())})};return t.on("changed",i),i(),()=>{t.removeListener("changed",i)}},[e]),i}({enable:!1===t?.layoutService?.meta?.isSnapshot}),[a,s]=U(async()=>{if(!e||!t)return Promise.resolve();const{layoutService:r}=t,{isSnapshot:a,isStacked:s,isContinuous:l}=r.meta,u=[];return a||u.push(i.getEffectiveProperties()),Promise.all(u).then(async e=>{const t=e[0]||void 0;if(t?.qHyperCubeDef){const e=r.getLayout(),a=ne(!0,{},t);if(zf({properties:t,layout:e,isStacked:s,isContinuous:l,model:i,layoutService:r}))return o.pending(),kl(e)?i.setProperties(t).then(()=>{n.clearUndoBuffer()}):void await wl(i,a,t);o.restore()}return{properties:t}})},[e,t,r]);if(s&&!s.isHandled)throw s;return a}({env:e,services:u});!function({picasso:e,chart:t,services:n,environment:i,viewState:r,viewCache:a,bootstrapped:s}){const{width:l,height:u}=_(),c=H(),d=j(),m=I(),[h,f]=D(),[p,g]=D(),[y,v]=D(),[b,S]=D(),x=B();function M(s={}){const{alternativeService:l,selectionService:u,refLineModel:f,discrete:p,reducedDataModel:g,continuousDataModel:y,trendLineModel:v,pluginService:b,colorService:S,viewModel:M,dockService:q,themeService:C,customTooltipModel:T,layoutService:w,logicalSize:k,styleService:N,disclaimerService:D,tooltipService:L}=n,E=u.custom.getActions(),O=e.data("q")(h.prepPicassoDataSet()),A={picasso:e,ds:O,rtl:"rtl"===m?.direction,model:c,app:x,chart:t,actions:E,localeInfo:i.localeInfo,logicalSize:k,flags:i.flags,translator:i.translator,selections:d,isLocked:u.getIsSelectionLocked,viewCache:a,viewState:r,alternativeService:l,layoutService:w,dockService:q,viewModel:M,colorService:S,selectionService:u,themeService:C,trendLineModel:v,discrete:p,continuousDataModel:y,reducedDataModel:g.model(),customTooltipModel:T,debouncer:o,refLineModel:f,pluginService:b,styleService:N,disclaimerService:D,tooltipService:L,...s};return Of(w.getLayout(),A,i)}function q(){if(!t.layoutComponents)return Promise.resolve();const{discrete:e,layoutService:i,viewModel:o}=n;a.set("isPreRender",!0);const r=M(p);h.extractDataPages(),t.layoutComponents({settings:r,data:y}),a.set("isPreRender",!1),h.insertDataPages(),o.animations.hasSlicedHats=r.components.filter(e=>"box-sliced-hat"===e.type).length>0;const s=[];return 1!==r.components.length&&i.meta.isDiscrete&&s.push(e.command.initialize()),Promise.all(s)}const[[C,T]=[]]=U(()=>{if(!(e&&t&&n&&i&&r&&a&&s))return Promise.resolve();const{alternativeService:o,layoutService:l,selectionService:u,refLineModel:c,discrete:d,continuous:m,reducedDataModel:h,continuousDataModel:f,trendLineModel:p,legendLayoutService:g,colorService:y,pluginService:v,viewModel:b,customTooltipModel:x,disclaimerService:M,customTooltipService:q,tooltipService:C}=n;if(!u?.custom?.getActions())return Promise.resolve();const{properties:T}=s,w=T?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);w&&(x.useCustomTooltip=!1);const k=()=>{S(Date.now()),b.animations.isPartialUpdating=!0},N=()=>{g&&g.setDataPages([d.query.getCurrentDataPage()]),c&&c.update(),k()};r.onChanged("scrollOffset",N),r.onChanged("legendScrollOffset",k),r.intercept("zoom",m.event.onZoomIntercept({viewCache:a})),r.onChanged("zoom",m.event.onZoomChange({layoutService:l,continuousDataModel:f},k)),u.setLayout(l.getLayout());const D=[];l.meta.isContinuous&&(f.update(l.getLayout()),D.push(f.initialFetch())),p.command.update(),D.push(h.fetch().then(({reducedCube:e})=>{h.update(e)})),q.setProperties(T),C.expando.set("properties",T),M.initialize(),D.push(Promise.resolve({properties:s.properties}));const L=()=>[v.initialize(),y.initialize(),o.initialize({properties:T}),Lm({reducedDataModel:h,layoutService:l,continuousDataModel:f,trendLineModel:p})];return Promise.all(D).then(e=>Promise.all(L()).then(t=>[e,t.pop()]))},[s]);O(()=>{if(!n?.colorService?.getMain()||!T)return;const{layoutService:e,selectionService:t,reducedDataModel:o,continuousDataModel:r,trendLineModel:s,legendLayoutService:l,colorService:u,viewModel:c}=n;a.set("minorMinMax",T);const d=()=>!e.meta.isContinuous&&(o.model().mode.isReduced||e.meta.isStacked)&&l,m=e.getHyperCube(),h=e.meta.isContinuous?r.getInitialCube():o.model().cube,{field:p}=u.getMain().getSettings(),y=d(),v=y?l.getHyperCube():void 0;t.setBrushAliases({colorField:p,useLegendCube:y,legendAlias:`legendCube/${p}`});const b=function({mainCube:e,miniCube:t,legendCube:n,localeInfo:i,layoutService:o,viewModel:r,trendLineModel:a}){const s=o.refs.dataPages.split(".").pop();let l=[],u=[];const c=o.meta.isContinuous?[{key:r.fields.majorNumeric,from:o.meta.isStackedByDimension?r.fields.majorStack:r.fields.major,override:{value:e=>e.qNum}}]:void 0;return{prepPicassoDataSet:()=>({key:"qHyperCube",data:e,config:{localeInfo:i,virtualFields:c}}),prepPicassoData(o){const r=[{type:"q",key:"qHyperCube",data:e,config:{localeInfo:i,virtualFields:c}},{type:"q",key:"miniCube",data:t,config:{localeInfo:i,virtualFields:c}},...o];return n&&r.push({type:"q",key:"legendCube",data:n,config:{localeInfo:i,virtualFields:c}}),a.query.hasTrendLines()&&r.push({key:"trend",data:a.query.getData()}),r},extractDataPages(){l=e[s],u=t.qDataPages,e[s]=[],t.qDataPages=[]},insertDataPages(){e[s]=l,t.qDataPages=u}}}({mainCube:m,miniCube:h,legendCube:v,localeInfo:i.localeInfo,layoutService:e,viewModel:c,trendLineModel:s}),S=C[C.length-1];g({localeInfo:i.localeInfo,...S}),f(b)},[T]),O(()=>{if(!n||!p||!h)return;const e=n.colorService.getMain();if(!e)return;h.prepPicassoDataSet();const t=h.prepPicassoData(e.getData());v(t)},[p]),O(()=>{n?.colorService?.getMain()&&t.update&&h&&y&&q().then(()=>{const{layoutService:e,discrete:i,legendLayoutService:o}=n;if(o){1===e.getLayoutValue("scrollStartPos")&&o.setDataPages([i.query.getCurrentDataPage()])}t.update(),bl.cacheProperties({viewCache:a,layout:e.getLayout()})})},[y]),O(()=>{if(!(l&&u&&h&&t?.update&&n?.colorService.getMain()))return;const{viewModel:e}=n;e.animations.isSizeChanging=!0;const{dockService:o,themeService:r}=n;o.update({width:l,height:u}),r.setTheme(i.theme),q().then(()=>{t.update&&t.update()})},[l,u]),O(()=>{if(!t?.update)return;const{viewModel:e}=n;t.update({partialData:!0,excludeFromUpdate:["mini-marker","dim-title","measure-title","ref-line","grid-line"]}),e.animations.isPartialUpdating=!1},[b])}({picasso:s,chart:l,services:u,environment:t,viewState:n,viewCache:i,bootstrapped:m}),Af({environment:t,services:u,chart:l,viewState:n,bootstrapped:m})}}});const Y={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function X(e){return Y[e]||e}function J(e){return function(t,n,i){let o,r,a,s,l=[],u=!0;function c(){"function"==typeof o.enable&&(o.enable=o.enable.bind(r)()),o.enable&&(o.gestures.forEach(t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(r));const n=X(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),a=a||new e.Manager(i),a.add(new e[n](t.options)),Object.keys(t.events).forEach(e=>{t.events[e]=t.events[e].bind(r),a.on(e,t.events[e])}),l.push(t))}),o.gestures.forEach(t=>{const n=X(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter(e=>""!==e)),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter(e=>""!==e)))}))}function d(){l.forEach(e=>{Object.keys(e.events).forEach(t=>{a.off(t,e.events[t])}),a.remove(e.options.event)}),l=[]}return{get key(){return s},set(e){!function(e){s=e.key,o=e,r={chart:t,mediator:n,settings:o},o.gestures=o.gestures||[],void 0===o.enable&&(o.enable=!0)}(e),d(),u&&c()},off(){u=!1,d()},on(){u=!0,0===l.length&&c()},destroy(){d(),a&&a.destroy(),a=null,r=null,o=null}}}}function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q,ee;var te=function(){if(ee)return Q;ee=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},r=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,o=e.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!r)return!1;for(i in n);return void 0===i||e.call(n,i)},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(i)return i(t,n).value}return t[n]};return Q=function e(){var t,n,i,l,u,c,d=arguments[0],m=1,h=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<h;++m)if(null!=(t=arguments[m]))for(n in t)i=s(d,n),d!==(l=s(t,n))&&(f&&l&&(r(l)||(u=o(l)))?(u?(u=!1,c=i&&o(i)?i:[]):c=i&&r(i)?i:{},a(d,{name:n,newValue:e(f,c,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},Q}(),ne=Z(te),ie={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:oe}=ie;function re({layoutService:e,largeDataService:t}){const{maxNumPoints:n=oe}=t?.meta||{},{qHyperCube:i}=e.getLayout();return i.qSize.qcy*i.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:ae}=ie,se=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=ae}=t?.meta||{},{qHyperCube:i}=e.getLayout();return i.qDimensionInfo.length>1&&!re({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:le}=ie,{MAX_NUM_POINTS:ue,DEFAULT_NUM_POINTS:ce,DEFAULT_NUM_LINES:de}=ie,{DEFAULT_NUM_POINTS:me}=ie,he=({layoutService:e,largeDataService:t})=>{if(!re({layoutService:e,largeDataService:t})){const{maxNumPoints:e=me}=t?.meta||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{const{dimensions:n=[]}=e?.meta?.size||{},{maxNumLines:i=de,maxNumPoints:o=ce,hasInjectedData:r=!1}=t?.meta||{};if(se({layoutService:e,largeDataService:t})*n[0]<=o)return n[0];const a=Math.max(1,Math.min(i,n[1])),s=o/a,l=Math.floor(n[0]<=s?s:s/4),u=2*a*(a+1);return r&&(a>de||o>ce)?Math.min(l,Math.ceil(ue/u)):l})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=le}=t?.meta||{},{measureCount:i=1}=e?.meta||{},o=4+2*(i-1);return Math.floor(n/(i*o))})({layoutService:e,largeDataService:t})};function fe({model:e,layoutService:t,largeDataService:n,definitionPath:i="/qHyperCubeDef"}){return{shouldFetchReduced:()=>re({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>he({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>se({layoutService:t,largeDataService:n}),fetch:(o,r)=>(({start:e,end:t,model:n,layoutService:i,largeDataService:o,definitionPath:r})=>{const a={qStart:e,qEnd:t,qNbrPoints:he({layoutService:i,largeDataService:o}),qMaxNbrTicks:300,qMaxNumberLines:se({layoutService:i,largeDataService:o})};return n.getHyperCubeContinuousData(r,a,!1)})({start:o,end:r,model:e,layoutService:t,largeDataService:n,definitionPath:i})}}function pe(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function ge({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let i=n+e,o=i+t;return 1===t&&0===e&&(i=n-.5,o=n+.5),{zoom:{min:i,max:o}}}(n,t.get("continuousMin"))}}}function ye(){const e=()=>{},t=[],n={};return e.set=(e,i)=>{const o=t.indexOf(e);o>-1&&t.splice(o,1),t.push(e),n[e]=i},e.forEach=e=>{t.forEach((t,i)=>e(n[t],i))},e.has=e=>e in n,e}function ve(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const i=[],o=ye(),r=ye();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?o.set(l,s):s[0].qNum>t&&(r.has(l)||r.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&i.push(s)}return o.forEach((e,t)=>i.splice(t,0,e)),r.forEach(e=>i.push(e)),i}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const i=[];let o,r;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?o=s:s[0].qNum>t&&(r||(r=s)),s[0].qNum>=e&&s[0].qNum<=t&&i.push(s)}return o&&i.unshift(o),r&&i.push(r),i}({start:e,end:t,matrix:n})}function be(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function Se(e,t,n){const i={qDataPages:(n.qDataPages||[]).map(n=>{const i=ve(e,t,n.qMatrix),o=be(n.qArea,i);return{...n,qArea:o,qMatrix:i}})};return n.qAxisData&&n.qAxisData.qAxis&&(i.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map(n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce((n,i)=>((i.qStart>=e&&i.qStart<=t||i.qEnd>=e&&i.qEnd<=t||i.qStart<e&&i.qEnd>t)&&n.push(i),n),[])}))}}(e,t,n.qAxisData)),i}const xe=2**.5,Me=1/xe,qe=Me**44;function Ce(e){return e.qIsOtherCell}function Te({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach(e=>{if(!e.some(Ce)){const n=e[0].qElemNumber;t[n]=void 0}}),Object.keys(t).length}(n):function(e){let t=0;return e.forEach(e=>{e.some(Ce)||t++}),t}(n)}const we={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var ke={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter(e=>!e.isMinor),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const i=t[e],o=t[e+1];i.data={},o||1===i.end?o?(i.data.start=i.value,i.data.end=o.value,i.end=o.position):(i.data.start=i.value,i.data.end=i.value):(i.data.start=i.value,i.data.end=n,i.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map(t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height}));if(t.length&&t[0].start>0){const i=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],i.data.start]},x:0,y:0,width:i.start*this.rect.width,height:this.rect.height})}return n}};function Ne(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function De(e,t){return e.x<t.x?e.x+e.width>=t.x:t.x+t.width>=e.x}function Le(e,t){const{localProps:{size:n},props:{anchor:i}}=t,o=function({props:e,localProps:{size:t},style:n,renderer:i}){const o=e.label.padding,r=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>i.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,i)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=i;e.start===e.end&&(d=u.width+2*o,1===e.end&&(c-=d));const m={x:c+o,y:o,width:d-2*o,height:t.height-2*o},h=s(`${l[0]}…`).width,f=Math.max(0,m.width-u.width),p=Math.max(0,m.height-u.height),g=r*f,y=a*p;return{show:m.width>=Math.min(h,u.width),text:l,dx:g,dy:y,rect:m,style:n.label,segment:{x:c+g,width:u.width+2*o},tickValue:e.value}}}}(t),r=function({localProps:{size:e},style:t,scale:n,props:i}){const[o,r]=n.domain(),a=Math.max(0,Math.min(1,i.guideLine.major.justify));return{resolve:(n,i)=>{const s=a*i.width,l=Ne(i.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=o&&n.value<=r,x1:l,y1:0,x2:l,y2:Ne(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map(e=>{const t=function(e,t,n){const i=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:i,height:t.height}}(e,n,i);return{rect:t,label:o.resolve(e,t),guideLine:r.resolve(e,t)}});return function(e,t){const n=e.length;if(n<2)return;const i=e[n-1],o=t[n-1].label;if(i&&i.start===i.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&!De(n.segment,o.segment)}}(e,a),a}function Ee(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:i=>{const o=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),r=Ne(i.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:r,y1:Ne(o,n.minorGuideLine.strokeWidth),x2:r,y2:Ne(t.guideLine.minor.size+o,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function Oe(e){return e.filter(e=>e.show).map(e=>ne({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue}))}var Ae={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter(e=>!e.isMinor),i=t.filter(e=>e.isMinor);this.state.line=function({localProps:{size:e},style:t,props:n}){const i=Ne(1,t.line.strokeWidth);return{show:n.line.show,x1:Ne(0,t.line.strokeWidth),y1:i,x2:Ne(e.width,t.line.strokeWidth),y2:i,style:t.line}}(this),this.state.major=Le(n,this),this.state.minor=Ee(i,this)},render(){return[...Oe([this.state.line]),...(e=this.state.major.map(e=>e.label),e.filter(e=>e.show).map(e=>ne({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue}))),...Oe(this.state.major.map(e=>e.guideLine)),...Oe(this.state.minor.map(e=>e.guideLine))];var e}};function Ie(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Pe(e){var t;return 1===e.length&&(t=e,e=function(e,n){return Ie(t(e),n)}),{left:function(t,n,i,o){for(null==i&&(i=0),null==o&&(o=t.length);i<o;){var r=i+o>>>1;e(t[r],n)<0?i=r+1:o=r}return i},right:function(t,n,i,o){for(null==i&&(i=0),null==o&&(o=t.length);i<o;){var r=i+o>>>1;e(t[r],n)>0?o=r:i=r+1}return i}}}var Re=Pe(Ie).right,ze=Math.sqrt(50),He=Math.sqrt(10),Be=Math.sqrt(2);function Fe(e,t,n){var i=(t-e)/Math.max(0,n),o=Math.floor(Math.log(i)/Math.LN10),r=i/Math.pow(10,o);return o>=0?(r>=ze?10:r>=He?5:r>=Be?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(r>=ze?10:r>=He?5:r>=Be?2:1)}function je(e,t,n){var i=Math.abs(t-e)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),r=i/o;return r>=ze?o*=10:r>=He?o*=5:r>=Be&&(o*=2),t<e?-o:o}function Ve(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var _e="$";function Ue(){}function $e(e,t){var n=new Ue;if(e instanceof Ue)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var i,o=-1,r=e.length;if(null==t)for(;++o<r;)n.set(o,e[o]);else for(;++o<r;)n.set(t(i=e[o],o,e),i)}else if(e)for(var a in e)n.set(a,e[a]);return n}function We(){}Ue.prototype=$e.prototype={constructor:Ue,has:function(e){return _e+e in this},get:function(e){return this[_e+e]},set:function(e,t){return this[_e+e]=t,this},remove:function(e){var t=_e+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===_e&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===_e&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===_e&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===_e&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===_e&&++e;return e},empty:function(){for(var e in this)if(e[0]===_e)return!1;return!0},each:function(e){for(var t in this)t[0]===_e&&e(this[t],t.slice(1),this)}};var Ke=$e.prototype;We.prototype={constructor:We,has:Ke.has,add:function(e){return this[_e+(e+="")]=e,this},remove:Ke.remove,clear:Ke.clear,values:Ke.keys,size:Ke.size,empty:Ke.empty,each:Ke.each};var Ge=Array.prototype,Ye=Ge.map,Xe=Ge.slice;function Je(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ze(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Qe(){}var et=.7,tt=1/et,nt="\\s*([+-]?\\d+)\\s*",it="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ot="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rt=/^#([0-9a-f]{3,8})$/,at=new RegExp("^rgb\\("+[nt,nt,nt]+"\\)$"),st=new RegExp("^rgb\\("+[ot,ot,ot]+"\\)$"),lt=new RegExp("^rgba\\("+[nt,nt,nt,it]+"\\)$"),ut=new RegExp("^rgba\\("+[ot,ot,ot,it]+"\\)$"),ct=new RegExp("^hsl\\("+[it,ot,ot]+"\\)$"),dt=new RegExp("^hsla\\("+[it,ot,ot,it]+"\\)$"),mt={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 ht(){return this.rgb().formatHex()}function ft(){return this.rgb().formatRgb()}function pt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=rt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?gt(t):3===n?new bt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?yt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?yt(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=at.exec(e))?new bt(t[1],t[2],t[3],1):(t=st.exec(e))?new bt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=lt.exec(e))?yt(t[1],t[2],t[3],t[4]):(t=ut.exec(e))?yt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ct.exec(e))?qt(t[1],t[2]/100,t[3]/100,1):(t=dt.exec(e))?qt(t[1],t[2]/100,t[3]/100,t[4]):mt.hasOwnProperty(e)?gt(mt[e]):"transparent"===e?new bt(NaN,NaN,NaN,0):null}function gt(e){return new bt(e>>16&255,e>>8&255,255&e,1)}function yt(e,t,n,i){return i<=0&&(e=t=n=NaN),new bt(e,t,n,i)}function vt(e,t,n,i){return 1===arguments.length?((o=e)instanceof Qe||(o=pt(o)),o?new bt((o=o.rgb()).r,o.g,o.b,o.opacity):new bt):new bt(e,t,n,null==i?1:i);var o}function bt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function St(){return"#"+Mt(this.r)+Mt(this.g)+Mt(this.b)}function xt(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function Mt(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function qt(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Tt(e,t,n,i)}function Ct(e){if(e instanceof Tt)return new Tt(e.h,e.s,e.l,e.opacity);if(e instanceof Qe||(e=pt(e)),!e)return new Tt;if(e instanceof Tt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,o=Math.min(t,n,i),r=Math.max(t,n,i),a=NaN,s=r-o,l=(r+o)/2;return s?(a=t===r?(n-i)/s+6*(n<i):n===r?(i-t)/s+2:(t-n)/s+4,s/=l<.5?r+o:2-r-o,a*=60):s=l>0&&l<1?0:a,new Tt(a,s,l,e.opacity)}function Tt(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function wt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function kt(e){return function(){return e}}function Nt(e){return 1===(e=+e)?Dt: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(i){return Math.pow(e+i*t,n)}}(t,n,e):kt(isNaN(t)?n:t)}}function Dt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):kt(isNaN(e)?t:e)}Je(Qe,pt,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:ht,formatHex:ht,formatHsl:function(){return Ct(this).formatHsl()},formatRgb:ft,toString:ft}),Je(bt,vt,Ze(Qe,{brighter:function(e){return e=null==e?tt:Math.pow(tt,e),new bt(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?et:Math.pow(et,e),new bt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){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:St,formatHex:St,formatRgb:xt,toString:xt})),Je(Tt,function(e,t,n,i){return 1===arguments.length?Ct(e):new Tt(e,t,n,null==i?1:i)},Ze(Qe,{brighter:function(e){return e=null==e?tt:Math.pow(tt,e),new Tt(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?et:Math.pow(et,e),new Tt(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,o=2*n-i;return new bt(wt(e>=240?e-240:e+120,o,i),wt(e,o,i),wt(e<120?e+240:e-120,o,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Lt=function e(t){var n=Nt(t);function i(e,t){var i=n((e=vt(e)).r,(t=vt(t)).r),o=n(e.g,t.g),r=n(e.b,t.b),a=Dt(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=o(t),e.b=r(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function Et(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,o=t.slice();return function(r){for(n=0;n<i;++n)o[n]=e[n]*(1-r)+t[n]*r;return o}}function Ot(e,t){var n,i=t?t.length:0,o=e?Math.min(i,e.length):0,r=new Array(o),a=new Array(i);for(n=0;n<o;++n)r[n]=Bt(e[n],t[n]);for(;n<i;++n)a[n]=t[n];return function(e){for(n=0;n<o;++n)a[n]=r[n](e);return a}}function At(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function It(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Pt(e,t){var n,i={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=Bt(e[n],t[n]):o[n]=t[n];return function(e){for(n in i)o[n]=i[n](e);return o}}var Rt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zt=new RegExp(Rt.source,"g");function Ht(e,t){var n,i,o,r=Rt.lastIndex=zt.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Rt.exec(e))&&(i=zt.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:It(n,i)})),r=zt.lastIndex;return r<t.length&&(o=t.slice(r),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)s[(n=l[i]).i]=n.x(e);return s.join("")})}function Bt(e,t){var n,i,o=typeof t;return null==t||"boolean"===o?kt(t):("number"===o?It:"string"===o?(n=pt(t))?(t=n,Lt):Ht:t instanceof pt?Lt:t instanceof Date?At:(i=t,!ArrayBuffer.isView(i)||i instanceof DataView?Array.isArray(t)?Ot:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Pt:It:Et))(e,t)}function Ft(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function jt(e){return+e}var Vt=[0,1];function _t(e){return e}function Ut(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function $t(e){var t,n=e[0],i=e[e.length-1];return n>i&&(t=n,n=i,i=t),function(e){return Math.max(n,Math.min(i,e))}}function Wt(e,t,n){var i=e[0],o=e[1],r=t[0],a=t[1];return o<i?(i=Ut(o,i),r=n(a,r)):(i=Ut(i,o),r=n(r,a)),function(e){return r(i(e))}}function Kt(e,t,n){var i=Math.min(e.length,t.length)-1,o=new Array(i),r=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)o[a]=Ut(e[a],e[a+1]),r[a]=n(t[a],t[a+1]);return function(t){var n=Re(e,t,1,i)-1;return r[n](o[n](t))}}function Gt(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Yt(e,t){return function(){var e,t,n,i,o,r,a=Vt,s=Vt,l=Bt,u=_t;function c(){return i=Math.min(a.length,s.length)>2?Kt:Wt,o=r=null,d}function d(t){return isNaN(t=+t)?n:(o||(o=i(a.map(e),s,l)))(e(u(t)))}return d.invert=function(n){return u(t((r||(r=i(s,a.map(e),It)))(n)))},d.domain=function(e){return arguments.length?(a=Ye.call(e,jt),u===_t||(u=$t(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Xe.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Xe.call(e),l=Ft,c()},d.clamp=function(e){return arguments.length?(u=e?$t(a):_t,d):u!==_t},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,i){return e=n,t=i,c()}}()(e,t)}function Xt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Jt(e){return(e=Xt(Math.abs(e)))?e[1]:NaN}var Zt,Qt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function en(e){if(!(t=Qt.exec(e)))throw new Error("invalid format: "+e);var t;return new tn({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function tn(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function nn(e,t){var n=Xt(e,t);if(!n)return e+"";var i=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}en.prototype=tn.prototype,tn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var on={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return nn(100*e,t)},r:nn,s:function(e,t){var n=Xt(e,t);if(!n)return e+"";var i=n[0],o=n[1],r=o-(Zt=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=i.length;return r===a?i:r>a?i+new Array(r-a+1).join("0"):r>0?i.slice(0,r)+"."+i.slice(r):"0."+new Array(1-r).join("0")+Xt(e,Math.max(0,t+r-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function rn(e){return e}var an,sn,ln,un=Array.prototype.map,cn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dn(e){var t=void 0===e.grouping||void 0===e.thousands?rn:function(e,t){return function(n,i){for(var o=n.length,r=[],a=0,s=e[0],l=0;o>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),r.push(n.substring(o-=s,o+s)),!((l+=s+1)>i));)s=e[a=(a+1)%e.length];return r.reverse().join(t)}}(un.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",o=e.decimal+"",r=void 0===e.numerals?rn:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(un.call(e.numerals,String)),a=void 0===e.percent?"%":e.percent+"",s=e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function u(e){var u=(e=en(e)).fill,c=e.align,d=e.sign,m=e.symbol,h=e.zero,f=e.width,p=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(p=!0,v="g"):on[v]||(void 0===g&&(g=12),y=!0,v="g"),(h||"0"===u&&"="===c)&&(h=!0,u="0",c="=");var b="$"===m?n:"#"===m&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",S="$"===m?i:/[%p]/.test(v)?a:"",x=on[v],M=/[defgprs%]/.test(v);function q(e){var n,i,a,m=b,q=S;if("c"===v)q=x(e)+q,e="";else{var C=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:x(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,i=1,o=-1;i<n;++i)switch(e[i]){case".":o=t=i;break;case"0":0===o&&(o=i),t=i;break;default:if(!+e[i])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),C&&0===+e&&"+"!==d&&(C=!1),m=(C?"("===d?d:s:"-"===d||"("===d?"":d)+m,q=("s"===v?cn[8+Zt/3]:"")+q+(C&&"("===d?")":""),M)for(n=-1,i=e.length;++n<i;)if(48>(a=e.charCodeAt(n))||a>57){q=(46===a?o+e.slice(n+1):e.slice(n))+q,e=e.slice(0,n);break}}p&&!h&&(e=t(e,1/0));var T=m.length+e.length+q.length,w=T<f?new Array(f-T+1).join(u):"";switch(p&&h&&(e=t(w+e,w.length?f-q.length:1/0),w=""),c){case"<":e=m+e+q+w;break;case"=":e=m+w+e+q;break;case"^":e=w.slice(0,T=w.length>>1)+m+e+q+w.slice(T);break;default:e=w+m+e+q}return r(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),q.toString=function(){return e+""},q}return{format:u,formatPrefix:function(e,t){var n=u(((e=en(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(Jt(t)/3))),o=Math.pow(10,-i),r=cn[8+i/3];return function(e){return n(o*e)+r}}}}function mn(e,t,n,i){var o,r=je(e,t,n);switch((i=en(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Jt(t)/3)))-Jt(Math.abs(e)))}(r,a))||(i.precision=o),ln(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jt(t)-Jt(e))+1}(r,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=function(e){return Math.max(0,-Jt(Math.abs(e)))}(r))||(i.precision=o-2*("%"===i.type))}return sn(i)}function hn(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var i,o,r,a,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((i=t<e)&&(o=e,e=t,t=o),0===(a=Fe(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),r=new Array(o=Math.ceil(t-e+1));++s<o;)r[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),r=new Array(o=Math.ceil(e-t+1));++s<o;)r[s]=(e-s)/a;return i&&r.reverse(),r}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return mn(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,o=t(),r=0,a=o.length-1,s=o[r],l=o[a];return l<s&&(i=s,s=l,l=i,i=r,r=a,a=i),(i=Fe(s,l,n))>0?i=Fe(s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i,n):i<0&&(i=Fe(s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i,n)),i>0?(o[r]=Math.floor(s/i)*i,o[a]=Math.ceil(l/i)*i,t(o)):i<0&&(o[r]=Math.ceil(s*i)/i,o[a]=Math.floor(l*i)/i,t(o)),e},e}function fn(){var e=Yt(_t,_t);return e.copy=function(){return Gt(e,fn())},Ve.apply(e,arguments),hn(e)}an=dn({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),sn=an.format,ln=an.formatPrefix;var pn=new Date,gn=new Date;function yn(e,t,n,i){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=function(t){return e(t=new Date(+t)),t},o.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},o.round=function(e){var t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},o.range=function(n,i,r){var a,s=[];if(n=o.ceil(n),r=null==r?1:Math.floor(r),!(n<i&&r>0))return s;do{s.push(a=new Date(+n)),t(n,r),e(n)}while(a<n&&n<i);return s},o.filter=function(n){return yn(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,i){if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})},n&&(o.count=function(t,i){return pn.setTime(+t),gn.setTime(+i),e(pn),e(gn),Math.floor(n(pn,gn))},o.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(i?function(t){return i(t)%e===0}:function(t){return o.count(0,t)%e===0}):o:null}),o}var vn=yn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});vn.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?yn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):vn:null},vn.range;var bn=6e4,Sn=36e5,xn=864e5,Mn=6048e5,qn=yn(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()});qn.range;var Cn=yn(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*bn)/xn},function(e){return e.getDate()-1});function Tn(e){return yn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*bn)/Mn})}Cn.range;var wn=Tn(0),kn=Tn(1),Nn=Tn(2),Dn=Tn(3),Ln=Tn(4),En=Tn(5),On=Tn(6);wn.range,kn.range,Nn.range,Dn.range,Ln.range,En.range,On.range;var An=yn(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});An.every=function(e){return isFinite(e=Math.floor(e))&&e>0?yn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null},An.range;var In=yn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*bn)},function(e,t){return(t-e)/bn},function(e){return e.getUTCMinutes()});In.range;var Pn=yn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*Sn)},function(e,t){return(t-e)/Sn},function(e){return e.getUTCHours()});Pn.range;var Rn=yn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/xn},function(e){return e.getUTCDate()-1});function zn(e){return yn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/Mn})}Rn.range;var Hn=zn(0),Bn=zn(1),Fn=zn(2),jn=zn(3),Vn=zn(4),_n=zn(5),Un=zn(6);Hn.range,Bn.range,Fn.range,jn.range,Vn.range,_n.range,Un.range;var $n=yn(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())},function(e){return e.getUTCMonth()});$n.range;var Wn=yn(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});function Kn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Gn(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Yn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}Wn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?yn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null},Wn.range;var Xn,Jn,Zn={"-":"",_:" ",0:"0"},Qn=/^\s*\d+/,ei=/^%/,ti=/[\\^$*+?|[\]().{}]/g;function ni(e,t,n){var i=e<0?"-":"",o=(i?-e:e)+"",r=o.length;return i+(r<n?new Array(n-r+1).join(t)+o:o)}function ii(e){return e.replace(ti,"\\$&")}function oi(e){return new RegExp("^(?:"+e.map(ii).join("|")+")","i")}function ri(e){for(var t={},n=-1,i=e.length;++n<i;)t[e[n].toLowerCase()]=n;return t}function ai(e,t,n){var i=Qn.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function si(e,t,n){var i=Qn.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function li(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function ui(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function ci(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function di(e,t,n){var i=Qn.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function mi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function hi(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function fi(e,t,n){var i=Qn.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function pi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function gi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function yi(e,t,n){var i=Qn.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function vi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function bi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function Si(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function xi(e,t,n){var i=Qn.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Mi(e,t,n){var i=Qn.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function qi(e,t,n){var i=ei.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Ci(e,t,n){var i=Qn.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function Ti(e,t,n){var i=Qn.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function wi(e,t){return ni(e.getDate(),t,2)}function ki(e,t){return ni(e.getHours(),t,2)}function Ni(e,t){return ni(e.getHours()%12||12,t,2)}function Di(e,t){return ni(1+Cn.count(An(e),e),t,3)}function Li(e,t){return ni(e.getMilliseconds(),t,3)}function Ei(e,t){return Li(e,t)+"000"}function Oi(e,t){return ni(e.getMonth()+1,t,2)}function Ai(e,t){return ni(e.getMinutes(),t,2)}function Ii(e,t){return ni(e.getSeconds(),t,2)}function Pi(e){var t=e.getDay();return 0===t?7:t}function Ri(e,t){return ni(wn.count(An(e)-1,e),t,2)}function zi(e){var t=e.getDay();return t>=4||0===t?Ln(e):Ln.ceil(e)}function Hi(e,t){return e=zi(e),ni(Ln.count(An(e),e)+(4===An(e).getDay()),t,2)}function Bi(e){return e.getDay()}function Fi(e,t){return ni(kn.count(An(e)-1,e),t,2)}function ji(e,t){return ni(e.getFullYear()%100,t,2)}function Vi(e,t){return ni((e=zi(e)).getFullYear()%100,t,2)}function _i(e,t){return ni(e.getFullYear()%1e4,t,4)}function Ui(e,t){var n=e.getDay();return ni((e=n>=4||0===n?Ln(e):Ln.ceil(e)).getFullYear()%1e4,t,4)}function $i(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ni(t/60|0,"0",2)+ni(t%60,"0",2)}function Wi(e,t){return ni(e.getUTCDate(),t,2)}function Ki(e,t){return ni(e.getUTCHours(),t,2)}function Gi(e,t){return ni(e.getUTCHours()%12||12,t,2)}function Yi(e,t){return ni(1+Rn.count(Wn(e),e),t,3)}function Xi(e,t){return ni(e.getUTCMilliseconds(),t,3)}function Ji(e,t){return Xi(e,t)+"000"}function Zi(e,t){return ni(e.getUTCMonth()+1,t,2)}function Qi(e,t){return ni(e.getUTCMinutes(),t,2)}function eo(e,t){return ni(e.getUTCSeconds(),t,2)}function to(e){var t=e.getUTCDay();return 0===t?7:t}function no(e,t){return ni(Hn.count(Wn(e)-1,e),t,2)}function io(e){var t=e.getUTCDay();return t>=4||0===t?Vn(e):Vn.ceil(e)}function oo(e,t){return e=io(e),ni(Vn.count(Wn(e),e)+(4===Wn(e).getUTCDay()),t,2)}function ro(e){return e.getUTCDay()}function ao(e,t){return ni(Bn.count(Wn(e)-1,e),t,2)}function so(e,t){return ni(e.getUTCFullYear()%100,t,2)}function lo(e,t){return ni((e=io(e)).getUTCFullYear()%100,t,2)}function uo(e,t){return ni(e.getUTCFullYear()%1e4,t,4)}function co(e,t){var n=e.getUTCDay();return ni((e=n>=4||0===n?Vn(e):Vn.ceil(e)).getUTCFullYear()%1e4,t,4)}function mo(){return"+0000"}function ho(){return"%"}function fo(e){return+e}function po(e){return Math.floor(+e/1e3)}!function(e){Xn=function(e){var t=e.dateTime,n=e.date,i=e.time,o=e.periods,r=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=oi(o),c=ri(o),d=oi(r),m=ri(r),h=oi(a),f=ri(a),p=oi(s),g=ri(s),y=oi(l),v=ri(l),b={a:function(e){return a[e.getDay()]},A:function(e){return r[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:wi,e:wi,f:Ei,g:Vi,G:Ui,H:ki,I:Ni,j:Di,L:Li,m:Oi,M:Ai,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:fo,s:po,S:Ii,u:Pi,U:Ri,V:Hi,w:Bi,W:Fi,x:null,X:null,y:ji,Y:_i,Z:$i,"%":ho},S={a:function(e){return a[e.getUTCDay()]},A:function(e){return r[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Wi,e:Wi,f:Ji,g:lo,G:co,H:Ki,I:Gi,j:Yi,L:Xi,m:Zi,M:Qi,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:fo,s:po,S:eo,u:to,U:no,V:oo,w:ro,W:ao,x:null,X:null,y:so,Y:uo,Z:mo,"%":ho},x={a:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=f[i[0].toLowerCase()],n+i[0].length):-1},A:function(e,t,n){var i=d.exec(t.slice(n));return i?(e.w=m[i[0].toLowerCase()],n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=v[i[0].toLowerCase()],n+i[0].length):-1},B:function(e,t,n){var i=p.exec(t.slice(n));return i?(e.m=g[i[0].toLowerCase()],n+i[0].length):-1},c:function(e,n,i){return C(e,t,n,i)},d:gi,e:gi,f:Mi,g:mi,G:di,H:vi,I:vi,j:yi,L:xi,m:pi,M:bi,p:function(e,t,n){var i=u.exec(t.slice(n));return i?(e.p=c[i[0].toLowerCase()],n+i[0].length):-1},q:fi,Q:Ci,s:Ti,S:Si,u:si,U:li,V:ui,w:ai,W:ci,x:function(e,t,i){return C(e,n,t,i)},X:function(e,t,n){return C(e,i,t,n)},y:mi,Y:di,Z:hi,"%":qi};function M(e,t){return function(n){var i,o,r,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(o=Zn[i=e.charAt(++s)])?i=e.charAt(++s):o="e"===i?" ":"0",(r=t[i])&&(i=r(n,o)),a.push(i),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function q(e,t){return function(n){var i,o,r=Yn(1900,void 0,1);if(C(r,e,n+="",0)!=n.length)return null;if("Q"in r)return new Date(r.Q);if("s"in r)return new Date(1e3*r.s+("L"in r?r.L:0));if(t&&!("Z"in r)&&(r.Z=0),"p"in r&&(r.H=r.H%12+12*r.p),void 0===r.m&&(r.m="q"in r?r.q:0),"V"in r){if(r.V<1||r.V>53)return null;"w"in r||(r.w=1),"Z"in r?(o=(i=Gn(Yn(r.y,0,1))).getUTCDay(),i=o>4||0===o?Bn.ceil(i):Bn(i),i=Rn.offset(i,7*(r.V-1)),r.y=i.getUTCFullYear(),r.m=i.getUTCMonth(),r.d=i.getUTCDate()+(r.w+6)%7):(o=(i=Kn(Yn(r.y,0,1))).getDay(),i=o>4||0===o?kn.ceil(i):kn(i),i=Cn.offset(i,7*(r.V-1)),r.y=i.getFullYear(),r.m=i.getMonth(),r.d=i.getDate()+(r.w+6)%7)}else("W"in r||"U"in r)&&("w"in r||(r.w="u"in r?r.u%7:"W"in r?1:0),o="Z"in r?Gn(Yn(r.y,0,1)).getUTCDay():Kn(Yn(r.y,0,1)).getDay(),r.m=0,r.d="W"in r?(r.w+6)%7+7*r.W-(o+5)%7:r.w+7*r.U-(o+6)%7);return"Z"in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Gn(r)):Kn(r)}}function C(e,t,n,i){for(var o,r,a=0,s=t.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(o=t.charCodeAt(a++))){if(o=t.charAt(a++),!(r=x[o in Zn?t.charAt(a++):o])||(i=r(e,n,i))<0)return-1}else if(o!=n.charCodeAt(i++))return-1}return i}return b.x=M(n,b),b.X=M(i,b),b.c=M(t,b),S.x=M(n,S),S.X=M(i,S),S.c=M(t,S),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=q(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",S);return t.toString=function(){return e},t},utcParse:function(e){var t=q(e+="",!0);return t.toString=function(){return e},t}}}(e),Xn.format,Xn.parse,Jn=Xn.utcFormat,Xn.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var go=1e3,yo=6e4,vo=36e5,bo=864e5,So=2592e6,xo=31536e6;function Mo(e){return new Date(e)}function qo(e){return e instanceof Date?+e:+new Date(+e)}function Co(e,t,n,i,o,r,a,s,l){var u=Yt(_t,_t),c=u.invert,d=u.domain,m=l(".%L"),h=l(":%S"),f=l("%I:%M"),p=l("%I %p"),g=l("%a %d"),y=l("%b %d"),v=l("%B"),b=l("%Y"),S=[[a,1,go],[a,5,5e3],[a,15,15e3],[a,30,3e4],[r,1,yo],[r,5,3e5],[r,15,9e5],[r,30,18e5],[o,1,vo],[o,3,108e5],[o,6,216e5],[o,12,432e5],[i,1,bo],[i,2,1728e5],[n,1,6048e5],[t,1,So],[t,3,7776e6],[e,1,xo]];function x(s){return(a(s)<s?m:r(s)<s?h:o(s)<s?f:i(s)<s?p:t(s)<s?n(s)<s?g:y:e(s)<s?v:b)(s)}function M(t,n,i,o){if(null==t&&(t=10),"number"==typeof t){var r=Math.abs(i-n)/t,a=Pe(function(e){return e[2]}).right(S,r);a===S.length?(o=je(n/xo,i/xo,t),t=e):a?(o=(a=S[r/S[a-1][2]<S[a][2]/r?a-1:a])[1],t=a[0]):(o=Math.max(je(n,i,t),1),t=s)}return null==o?t:t.every(o)}return u.invert=function(e){return new Date(c(e))},u.domain=function(e){return arguments.length?d(Ye.call(e,qo)):d().map(Mo)},u.ticks=function(e,t){var n,i=d(),o=i[0],r=i[i.length-1],a=r<o;return a&&(n=o,o=r,r=n),n=(n=M(e,o,r,t))?n.range(o,r+1):[],a?n.reverse():n},u.tickFormat=function(e,t){return null==t?x:l(t)},u.nice=function(e,t){var n=d();return(e=M(e,n[0],n[n.length-1],t))?d(function(e,t){var n,i=0,o=(e=e.slice()).length-1,r=e[i],a=e[o];return a<r&&(n=i,i=o,o=n,n=r,r=a,a=n),e[i]=t.floor(r),e[o]=t.ceil(a),e}(n,e)):u},u.copy=function(){return Gt(u,Co(e,t,n,i,o,r,a,s,l))},u}function To(){return Ve.apply(Co(Wn,$n,Hn,Rn,Pn,In,qn,vn,Jn).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function wo(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd)}function ko(e){return e.qTags.indexOf("$qualified")>-1}function No({qAxis:e}){const t=[],n=[];for(let i=0;i<e.length;i++){const o=i+1,r=e[i],a=e[o];wo(r,a)?(ko(a)?(t.push(o),n.push(i)):(t.push(i),n.push(o)),i++):(t.push(i),n.push(i))}return{qualified:t,nonQualified:n}}function Do({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let i,o=NaN,r=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const u=e[l];if(u.queries.outer(n)){const e=t[l+1];if(o=u.index,i=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(n)){r="auto",s=!0;break}if(e&&e.queries.inner(n)){r=e.index;const i=t[l+2];i&&i.queries.minor(n)&&(a=i.index);break}}}if(!Number.isNaN(o)&&Number.isNaN(r)&&"auto"!==r){r=o,o=NaN;const e=t[i+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(o)&&(o="auto",r="auto");return{outer:o,inner:r,minor:a,isDayOrShorter:s}}}}function Lo({qTicks:e,measureText:t=()=>({width:0}),cache:n={},scale:i}){const o=n;return{isDayOrShorter:()=>(o.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,o.isDayOrShorter),count:()=>e.length,maxRange:()=>(o.maxRange=e.length?Math.max(...e.map(e=>Math.abs(i(e.qStart)-i(e.qEnd)))):0,o.maxRange),rangeAndWidth(){const n=i.clamp();return i.clamp(!1),o.rangeAndWidth=e.map(e=>({range:Math.abs(i(e.qStart)-i(e.qEnd)),width:t(`${e.qText}`).width+16})),i.clamp(n),o.rangeAndWidth}}}function Eo({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),inner:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),minor:t=>e.maxRange()*t>=6,canFitHalfDayTicks:n=>n>=t*e.count()}}function Oo({qualified:e,nonQualified:t,qAxis:n,measureText:i,reqAutoFitWidth:o,scale:r},{attributesFactory:a=Lo,queryFactory:s=Eo}={attributesFactory:Lo,queryFactory:Eo}){const l=n.map((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:i,scale:r});return{data:e,index:t,attrs:l,queries:s({attrs:l,reqAutoFitWidth:o})}}(e,t)),u=e.map(e=>l[e]),c=t.map(e=>l[e]);return{qAxisMeta:l,qualifiedMeta:u,nonQualifiedMeta:c}}function Ao({qAxis:e=[],measureText:t=()=>({width:0}),cache:n={},reqAutoFitWidth:i=0,scale:o},{metaFactory:r=Oo,mapper:a=No,resolver:s=Do}={metaFactory:Oo,mapper:No,resolver:Do}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=r({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:i,scale:o}),m=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const i=n.key({distance:t});if(n.get(i))return n.get(i);if(function(e){return!Array.isArray(e)||0===e.length||e.every(e=>0===e.qTicks.length)}(e))return{outer:"auto",inner:"auto",minor:NaN,isDayOrShorter:!1};const o=m.resolve(t);return n.set(i,o),o}}}function Io(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}const Po=Io(0).getTime();function Ro(e){return(e.getTime()-Po)/86400/1e3}const zo=new Date,Ho=new Date;function Bo(e,t,n,i){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),o.round=e=>{const t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),o.range=(n,i,r)=>{const a=[];if(n=o.ceil(n),r=null==r?1:Math.floor(r),!(n<i&&r>0))return a;let s;do{a.push(s=new Date(+n)),t(n,r),e(n)}while(s<n&&n<i);return a},o.filter=n=>Bo(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););}),n&&(o.count=(t,i)=>(zo.setTime(+t),Ho.setTime(+i),e(zo),e(Ho),Math.floor(n(zo,Ho))),o.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(i?t=>i(t)%e===0:t=>o.count(0,t)%e===0):o:null)),o}const Fo=1e3,jo=6e4,Vo=36e5,_o=864e5,Uo=6048e5,$o=Bo(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Fo)},(e,t)=>(t-e)/Fo,e=>e.getUTCSeconds());$o.range;const Wo=Bo(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Fo)},(e,t)=>{e.setTime(+e+t*jo)},(e,t)=>(t-e)/jo,e=>e.getMinutes());Wo.range;const Ko=Bo(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*jo)},(e,t)=>(t-e)/jo,e=>e.getUTCMinutes());Ko.range;const Go=Bo(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Fo-e.getMinutes()*jo)},(e,t)=>{e.setTime(+e+t*Vo)},(e,t)=>(t-e)/Vo,e=>e.getHours());Go.range;const Yo=Bo(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Vo)},(e,t)=>(t-e)/Vo,e=>e.getUTCHours());Yo.range;const Xo=Bo(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jo)/_o,e=>e.getDate()-1);Xo.range;const Jo=Bo(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_o,e=>e.getUTCDate()-1);Jo.range;const Zo=Bo(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_o,e=>Math.floor(e/_o));function Qo(e){return Bo(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jo)/Uo)}Zo.range;const er=Qo(0),tr=Qo(1),nr=Qo(2),ir=Qo(3),or=Qo(4),rr=Qo(5),ar=Qo(6);function sr(e){return Bo(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/Uo)}er.range,tr.range,nr.range,ir.range,or.range,rr.range,ar.range;const lr=sr(0),ur=sr(1),cr=sr(2),dr=sr(3),mr=sr(4),hr=sr(5),fr=sr(6);lr.range,ur.range,cr.range,dr.range,mr.range,hr.range,fr.range;const pr=Bo(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());pr.range;const gr=Bo(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth());gr.range;const yr=Bo(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());yr.every=e=>isFinite(e=Math.floor(e))&&e>0?Bo(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,yr.range;const vr=Bo(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());vr.every=e=>isFinite(e=Math.floor(e))&&e>0?Bo(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,vr.range;const br=1,Sr=2,xr=3,Mr=4,qr=5,Cr=6;function Tr({timeScale:e,labels:t,distance:n,isDayOrShorter:i,cache:o,timeOnly:r,initialMin:a}){const[s,l]=e.domain(),u=o.key({distance:n});let c;o.get(u,1)?c=o.get(u,1):(c=function(e,t,n,i,o,r){function a(e){return vr.filter(t=>(t.getUTCFullYear()-r.getUTCFullYear())%e===0)}const s=$o.count(e,t),l=Ko.count(e,t),u=Yo.count(e,t),c=Jo.count(e,t),d=lr.count(e,t),m=gr.count(e,t),h=vr.count(e,t),f=n/i.second.width-1,p=n/i.minute.width-1,g=n/i.date.width-1,y=n/i.year.width-1,v={type:"year",desc:"year",count:h,interval:vr.every(1),formatter:i.year.formatter,offset:e=>vr.offset(e,-1),floor:vr.floor};if(s<=f)v.type=br,v.desc="second",v.count=s,v.interval=$o.every(1),v.formatter=i.second.formatter,v.offset=e=>$o.offset(e,-1),v.floor=$o.floor;else if(s/2<=f)v.type=br,v.desc="every other second",v.count=s/2,v.interval=$o.every(2),v.formatter=i.second.formatter,v.offset=e=>$o.offset(e,-2),v.floor=$o.floor;else if(s/5<=f)v.type=br,v.desc="every 5 second",v.count=s/5,v.interval=$o.every(5),v.formatter=i.second.formatter,v.offset=e=>$o.offset(e,-5),v.floor=$o.floor;else if(s/15<=f)v.type=br,v.desc="every 15 second",v.count=s/15,v.interval=$o.every(15),v.formatter=i.second.formatter,v.offset=e=>$o.offset(e,-15),v.floor=$o.floor;else if(s/30<=f)v.type=br,v.desc="every 30 second",v.count=s/30,v.interval=$o.every(30),v.formatter=i.second.formatter,v.offset=e=>$o.offset(e,-30),v.floor=$o.floor;else if(l<=p)v.type=Sr,v.desc="minute",v.count=l,v.interval=Ko.every(1),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-1),v.floor=Ko.floor;else if(l/2<=p)v.type=Sr,v.desc="every 2 minute",v.count=l/2,v.interval=Ko.every(2),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-2),v.floor=Ko.floor;else if(l/5<=p)v.type=Sr,v.desc="every 5 minute",v.count=l/5,v.interval=Ko.every(5),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-5),v.floor=Ko.floor;else if(l/10<=p)v.type=Sr,v.desc="every 10 minute",v.count=l/10,v.interval=Ko.every(10),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-10),v.floor=Ko.floor;else if(l/15<=p)v.type=Sr,v.desc="every 15 minute",v.count=l/15,v.interval=Ko.every(15),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-15),v.floor=Ko.floor;else if(l/30<=p)v.type=Sr,v.desc="every 30 minute",v.count=l/30,v.interval=Ko.every(30),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-30),v.floor=Ko.floor;else if(u<=p)v.type=xr,v.desc="hour",v.count=u,v.interval=Yo.every(1),v.formatter=i.minute.formatter,v.offset=e=>Yo.offset(e,-1),v.floor=Yo.floor;else if(u/2<=p)v.type=xr,v.desc="every 2 hour",v.count=u/2,v.interval=Yo.every(2),v.formatter=i.minute.formatter,v.offset=e=>Yo.offset(e,-2),v.floor=Yo.floor;else if(u/3<=p)v.type=xr,v.desc="every 3 hour",v.count=u/3,v.interval=Yo.every(3),v.formatter=i.minute.formatter,v.offset=e=>Yo.offset(e,-3),v.floor=Yo.floor;else if(u/6<=p)v.type=xr,v.desc="every 6 hour",v.count=u/6,v.interval=Yo.every(6),v.formatter=i.minute.formatter,v.offset=e=>Yo.offset(e,-6),v.floor=Yo.floor;else if(u/12<=p||o)v.type=xr,v.desc="every 12 hour",v.count=u/12,v.interval=Yo.every(12),v.formatter=i.minute.formatter,v.offset=e=>Yo.offset(e,-12),v.floor=Yo.floor;else if(c<=g)v.type=Mr,v.desc="day",v.count=c,v.interval=Jo.every(1),v.formatter=i.date.formatter,v.offset=e=>Jo.offset(e,-1),v.floor=Jo.floor;else if(c/2<=g)v.type=Mr,v.desc="every 2 day",v.count=c/2,v.interval=Jo.every(2),v.formatter=i.date.formatter,v.offset=e=>Jo.offset(e,-2),v.floor=Jo.floor;else if(c/3<=g)v.type=Mr,v.desc="every 3 day",v.count=c/3,v.interval=Jo.every(3),v.formatter=i.date.formatter,v.offset=e=>Jo.offset(e,-3),v.floor=Jo.floor;else if(d<=g)v.type=Mr,v.desc="week",v.count=d,v.interval=lr.every(1),v.formatter=i.date.formatter,v.offset=e=>lr.offset(e,-1),v.floor=Jo.floor;else if(d/2<=g)v.type=Mr,v.desc="every 2 week",v.count=d/2,v.interval=lr.every(2),v.formatter=i.date.formatter,v.offset=e=>lr.offset(e,-2),v.floor=Jo.floor;else if(m<=g)v.type=qr,v.desc="month",v.count=m,v.interval=gr.every(1),v.formatter=i.date.formatter,v.offset=e=>gr.offset(e,-1),v.floor=Jo.floor;else if(m/3<=g)v.type=qr,v.desc="quarter",v.count=m/3,v.interval=gr.every(3),v.formatter=i.date.formatter,v.offset=e=>gr.offset(e,-3),v.floor=Jo.floor;else if(m/6<=g)v.type=qr,v.desc="half year",v.count=m/6,v.interval=gr.every(6),v.formatter=i.date.formatter,v.offset=e=>gr.offset(e,-6),v.floor=Jo.floor;else if(h<=y)v.type=Cr,v.desc="year",v.count=h,v.interval=vr.every(1),v.formatter=i.year.formatter,v.offset=e=>vr.offset(e,-1),v.floor=vr.floor;else if(h/2<=y)v.type=Cr,v.desc="every 2 year",v.count=h/2,v.interval=a(2),v.formatter=i.year.formatter,v.offset=e=>vr.offset(e,-2),v.floor=vr.floor;else if(h/5<=y)v.type=Cr,v.desc="every 5 year",v.count=h/5,v.interval=a(5),v.formatter=i.year.formatter,v.offset=e=>vr.offset(e,-5),v.floor=vr.floor;else if(h/10<=y)v.type=Cr,v.desc="every 10 year",v.count=h/10,v.interval=a(10),v.formatter=i.year.formatter,v.offset=e=>vr.offset(e,-10),v.floor=vr.floor;else{const e=Math.max(1,Math.floor(h/y));v.type=Cr,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=i.year.formatter,v.offset=t=>vr.offset(t,-e),v.floor=vr.floor}return v}(s,l,n,t.all(),i,a),o.set(u,c,1));const d=e.ticks(c.interval);d.length?s.getTime()!==d[0].getTime()&&d.unshift(c.offset(d[0])):d.push(c.floor(s));const m=d.map((e,t,n)=>{const i=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:c.formatter}});let h=[];if(!r&&c.type<=xr){const n=t.getFormat("date"),i=e.ticks(Jo.every(1));i.length&&s.getUTCDate()!==i[0].getUTCDate()&&i.unshift(Jo.offset(i[0],-1)),h=(i.length?i:[Jo.floor(s)]).map((e,t,i)=>{const o=i[t+1]?i[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+o),formatter:n.formatter}})}return{inner:m,outer:h}}const wr=86400,kr=1440,Nr={};function Dr(e,t,n,i){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:i}}function Lr(e,t,n){const{generator:i,anchor:o,clamp:r,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(r);const[l,u]=e.domain(),c=To().domain([Io(l),Io(u)]);c.clamp(r),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof i?i:{type:i};let m;m="d3"===d.type?(e,o)=>Tr({timeScale:c,labels:n,distance:e,isDayOrShorter:o,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:Io(i.initialMin)}):e=>function(e,t,n,i,o,r=!1){if(Nr[[t,n,i,i,r]])return Nr[[t,n,i,i,r]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=Io(n),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=i-n,m=t/(o-i),h=m/1440,f=m/wr,p=366*m,g=3*m*30,y=a.second.width/f,v=a.minute.width/h,b=a.date.width/g,S=a.year.width/p;let x,M,q,C=0,T=0,w=null,k=null,N=null,D=null,L=null,E=null;const O={outer:[],inner:[]};for(y<1?(w=1,T=1/wr):y<2?(w=2,T=1/wr*2):y<5?(w=5,T=1/wr*5):y<10?(w=10,T=1/wr*10):y<30?(w=30,T=1/wr*30):v<1?(k=1,T=1/kr):v<2?(k=2,T=1/kr*2):v<5?(k=5,T=1/kr*5):v<10?(k=10,T=.006944444444444445):v<30?(k=30,T=.020833333333333336):v<60?(N=1,T=1/24):v<120?(N=2,T=2/24):v<360?(N=6,T=.25):v<720?(N=12,T=.5):b<1/90?(T=1,D=1):b<2/90?(T=2,D=2):b<7/90?(T=7,D=7):b<31/90?(L=1,T=31):b<1?(L=3,T=90):S<1?(E=1,T=366):S<2?(E=2,T=732):S<5?(E=5,T=1826.25):(E=10,T=3652.5),M=Math.floor((d+n%1)/T);C<o;){q=M+1,x=E?Dr("year",[l+M*E,0,1],[l+q*E,0,1],a.year.formatter):L?Dr("month",[l,u+M*L,1],[l,u+q*L,1],a.date.formatter):D?Dr("day",[l,u,c+M*D],[l,u,c+q*D],a.date.formatter):N?Dr("hour",[l,u,c,0+M*N],[l,u,c,0+q*N],a.minute.formatter):k?Dr("minute",[l,u,c,0,0+M*k],[l,u,c,0,0+q*k],a.minute.formatter):Dr("second",[l,u,c,0,0,0+M*w],[l,u,c,0,0,0+q*w],a.second.formatter),C=Ro(x.start),O.inner.push(x);const e=Math.floor(C);if(!(r||E||L||D)){const t={type:"day",start:Io(e),end:Io(e+1),formatter:a.date.formatter,qStart:e};O.outer[O.outer.length-1]&&O.outer[O.outer.length-1].qStart===t.qStart||O.outer.push(t)}M++}return O.min=i,O.max=o,Nr[[t,n,i,i,r]]=O,O}(n,e,d.min,l,u,"T"===s.qType);const h={transform:(t=[],{isMinor:n=!1}={})=>t.map(t=>{let i;i="start"===o?t.qStart:"end"===o?t.qEnd:(t.qStart+t.qEnd)/2;const r=e.clamp();n&&e.clamp(!1);const a=e(i),s=e(t.qStart),l=e(t.qEnd);return e.clamp(r),{value:i,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1),generate:(t=100,n)=>m(t,n)[a].map(t=>{let n;return n="start"===o?Ro(t.start):"end"===o?Ro(t.end):(Ro(t.start)+Ro(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:Ro(t.start),end:Ro(t.end),scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1)};return h}const Er=/t+/i;const Or={min:NaN,max:NaN,invert:!1,qAxis:[],field:void 0,formatter:{fn:()=>e=>e,measureText:()=>({width:0,height:0}),localeInfo:{},qNumFormat:{}},ticks:{generator:"d3",level:"outer",anchor:void 0,clamp:!1},cache:{get:()=>!1,set:()=>{},key:()=>""}};function Ar(e,t){e.instance||(e.instance=t.copy(),e.instance.domain(t.domain()),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}const Ir="continuousPan";var Pr={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:i=we,viewCache:o,viewState:r,definitionPath:a},s={}){const{engineFetcherFactory:l=fe,snapshotFetcherFactory:u=ge,cacheFetcherFactory:c=pe,cache:d={initial:{},merged:{}}}=s,m=l({model:e,layoutService:t,largeDataService:n,definitionPath:a}),h=u({layoutService:t,viewCache:o}),f=c({cache:d}),p=e=>{throw e.isHandled=!0,e};let g,y,v;return{update(e){var n,i;({initialMin:y,initialMax:v}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),o.set("continuousMin",y),o.set("continuousMax",v),o.set("minimiumZoomSpan",(n=y,i=v,Math.max(1e-6,(i-n)*qe))),g=t.meta.isSnapshot?h:m,t.meta.isSnapshot&&({zoom:{min:y,max:v}}=h.getSnapshotData()),r.preventSet("zoom",{min:y,max:v})},updateLayout(e){const{qDataPages:n,qAxisData:i}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",i),t.setHyperCubeValue("qMode","S"),t.setHyperCubeValue("qColumnOrder",[]),e},initialFetch(){return g.fetch(y,v).then(e=>{const t=function(e){return{qDataPages:e.qDataPages.map(e=>{const t=be(e.qArea,e.qMatrix);return{...e,qArea:t}}),qAxisData:e.qAxisData}}(e);return i.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),d.initial=t,d.merged=t,e}).then(e=>Se(y,v,e)).then(e=>this.updateLayout(e)).catch(p)},fetch:(e,t)=>g.fetch(e,t).then(e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map((e,n)=>{const i=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,i=t[t.length-1][0].qNum,o=[],r=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?o.push(e[t]):a.qNum>i&&r.push(e[t])}return[...o,...t,...r]}(e.qMatrix,t.qDataPages[n].qMatrix),o=be(e.qArea,i);return{...e,qArea:o,qMatrix:i}}),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every(e=>!e.qTicks.length))return e;const n=t.qAxis.map(e=>e.qName),i=t.qAxis.map(e=>({start:e.qTicks[0].qStart,end:e.qTicks[e.qTicks.length-1].qStart})),o=t.qAxis.map(e=>({qName:e.qName,qTags:[...e.qTags],qTicks:[...e.qTicks]}));for(let t=0,r=e.qAxis.length;t<r;t++){const r=e.qAxis[t],a=n.indexOf(r.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=i[a];for(let n=0,i=r.qTicks.length;n<i;n++){const i=r.qTicks[n];i.qStart<e?s.push(i):i.qStart>t&&l.push(i)}o[a].qTicks=[...s,...o[a].qTicks,...l]}}return{qAxis:o}}(e.qAxisData,t.qAxisData)),n}(d.initial,e)).then(e=>(i.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),d.merged=e,e)).then(n=>Se(e,t,n)).catch(p),fetchFromCache:(e,t)=>f.fetch(e,t).then(n=>Se(e,t,n)),fetchMinMaxData:()=>Promise.resolve(d.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return ne({},e,{...d.initial})},getInitialLayout(){const e=this.getInitialCube();return ne({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>Te(d.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=i.query.getShouldProcess()?[i.query.getFilteredDataPage({dataPage:d.merged.qDataPages[0]})]:d.merged.qDataPages;t.qDataPages=n,t.qAxisData=d.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:i}=e;function r(e,n,o){return i[e](n,o).then(e=>(i.updateLayout(e),t(),e))}const a=o((e,t)=>r("fetch",e,t),50);return({min:e,max:t},{min:i,max:o})=>!n.meta.isContinuous||e===i&&t===o?Promise.resolve(null):r("fetchFromCache",e,t).then(n=>(a(e,t),n))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,i=NaN;return(o,r)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),i=e.get("minimiumZoomSpan"),Math.abs(o.max-o.min)<i?r:{min:Math.min(o.max,Math.max(t,o.min)),max:Math.max(o.min,Math.min(n,o.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:i=50,rtl:o=!1,targetKey:a}){const s=e.get("continuousMin"),l=e.get("continuousMax");return r((e,i)=>{const r=(e=>n.componentsFromPoint(e).filter(e=>e.key===a)[0])(e);if(r){const a=function(e,t,n){let{x:i}=e;return i-=t.element.getBoundingClientRect().left,i-=n.rect.x,Math.max(0,Math.min(1,i/n.rect.width))}(e,n,r),u=o?1-a:a,{min:c,max:d}=t.get("zoom"),m=Math.abs(d-c),h=m-(i>0?Me:xe)*m,f=c+h*u,p=d-h*(1-u),g=f<s?s-f:0,y=p>l?p-l:0;t.set("zoom",{min:Math.max(f-y,s),max:Math.min(p+g,l)})}},i)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:i,viewCache:o}){return{type:"Pan",key:"continuous:pan",options:{event:Ir,pointers:1,threshold:10,enable(i,o){return this.started===Ir||!o||!!n.scroll.enabled()&&t.componentsFromPoint({x:o.center.x,y:o.center.y}).some(t=>t.key===e)}},events:{[`${Ir}start`](n){n.preventDefault(),this.started=Ir;const{min:o,max:r}=i.get("zoom");this[Ir]={min:o,max:r,size:t.component(e).rect.computedInner.width,span:r-o}},[`${Ir}move`](e){e.preventDefault();const{span:t,min:n,max:r,size:a}=this[Ir],s=-e.deltaX/a;i.set("zoom",{min:Math.min(n+s*t,o.get("continuousMax")-t),max:Math.max(r+s*t,o.get("continuousMin")+t)})},[`${Ir}end`](e){e.preventDefault(),this.started=!1},[`${Ir}cancel`](e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:ke,timeAxis:Ae},picassoScales:{time:function e(t,n={}){const i=function(e,t,n){const i={};return Object.keys(t).forEach(o=>{const r=e[o],a=typeof r;"function"===a?i[o]=r(n):"object"!==a||Array.isArray(r)?i[o]="undefined"===a?t[o]:r:i[o]=ne(!0,{},t[o],r)}),i}(t,Or,n),{qAxis:o}=i,r=fn(),s={instance:null,invert:!1},{min:l,max:u}=function(e,t){let n=+e.min,i=+e.max;return Number.isNaN(n)&&Number.isNaN(i)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map(e=>e.qStart)),i=Math.max(...t[t.length-1].qTicks.map(e=>e.qEnd))),n===i&&(n-=.5,i+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+i)?1:i}}(i,o);let c,d,m=[];const h=function(e){return Number.isNaN(+e)?NaN:r(e)};h.ticks=({distance:e,resolve:t=c.resolve}={})=>{const n=t(e),r=n[i.ticks.level];if(Number.isNaN(+r)||(m=d.transform(o[r].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=d.transform(o[n.minor].qTicks,{isMinor:!0});m=m.concat(e)}return"auto"===r&&(m=d.generate(e,n.isDayOrShorter)),m},h.invert=e=>r.invert(e),h.domain=e=>Array.isArray(e)?r.domain(e):r.domain(),h.range=e=>Array.isArray(e)?r.range(e):r.range(),h.norm=e=>(Ar(s,h),s.instance(e)),h.normInvert=e=>(Ar(s,h),s.instance.invert(e)),h.copy=()=>e(t,n),h.clamp=(e=!0)=>(r.clamp(e),r.clamp()),h.min=()=>Math.min(l,u),h.max=()=>Math.max(l,u),r.range(i.invert?[1,0]:[0,1]),r.domain([l,u]),s.invert=i.invert;const f=function(e){const t={},{measureText:n,fn:i,localeInfo:o}=e.formatter,r={second:{type:"second",pattern:"hh:mm:ss",width:60,formatter:void 0},minute:{type:"minute",pattern:"hh:mm",width:60,formatter:void 0},date:{type:"date",pattern:"YYYY-MM-DD",width:60,formatter:void 0},year:{type:"year",pattern:"YYYY",width:60,formatter:void 0}};return o&&Er.test(o.qTimestampFmt)&&(r.minute.pattern+=" tt",r.second.pattern+=" tt"),r.date.pattern=o&&o.qDateFmt?o.qDateFmt:r.date.pattern,Object.keys(r).forEach(e=>{r[e].formatter=i(r[e].pattern),r[e].width=Math.max(r[e].width,n(r[e].formatter(41000.2343433)).width+16)}),t.getFormat=e=>r[e],t.all=()=>r,t.getFormatFromTicks=e=>{const t=e.filter(e=>!e.isMinor),{length:n}=t;if(!n)return r.date;const i=Io(t[0].data.start),o=Io(t[n-1].data.start);return Jo.count(i,o)/n>=1?r.date:Yo.count(i,o)/n>0?r.minute:Ko.count(i,o)/n>0?r.second:r.date},t}(i);return d=Lr(r.copy(),i,f),c=Ao({qAxis:o,measureText:i.formatter.measureText,reqAutoFitWidth:2*f.getFormat("minute").width,cache:i.cache,scale:h}),h.data=()=>({fields:[{formatter:h.formatter,id:()=>`qHyperCube/${i.field}`,key:()=>i.field,raw:a(n,"fields.0.raw",()=>({}))}]}),h.formatter=()=>f.getFormatFromTicks(m).formatter,h}}};const Rr=[["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}]],zr={};Rr.forEach(([e,{width:t,height:n}])=>{zr[e]={width:t,height:n}});const Hr={getLayoutModes:()=>zr,getLayoutMode(e,t){let n;for(n=0;n<Rr.length;++n)if(e>=Rr[n][1].width&&t>=Rr[n][1].height)return Rr[n][0];return"SPARK"}};function Br(e,t){return{layoutModes:Hr.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 Fr=["$date","$timestamp","$time"],jr=["D","TS","T"],Vr={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some(e=>Fr.some(t=>t===e))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&jr.some(t=>t===e.qNumFormat.qType)),isTimeDimension:(e,t)=>!!(e&&t&&(Vr.hasTimeTag(t)&&Vr.hasUnknownFormat(t)||Vr.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&Vr.isTimeDimension(e,t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode)[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some(e=>"$numeric"===e))},canBeContinuous(e){const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode);return!((t?.length??0)<1)&&Vr.canBeContinuousDimension(t[0])},maxNumberOfLines:12},_r=/^[A-Z][A-z0-9_]*$/i,Ur={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,"")}},$r={setValue:(e,t,n)=>{if(!t)return!1;const i=t.split("."),o=i[i.length-1];let r,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){const e=a[o];return a[o]=n,{updated:n,previous:e}}return delete a[o],!1},getValue:(e,t,n)=>{const i=t.split(".");let o,r=e;if(void 0===r)return n;for(o=0;o<i.length;++o){if(void 0===r[i[o]])return n;r=r[i[o]]}return r},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||_r.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>Ur.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},Wr=e=>$r.getValue(e,"qHyperCube.qDimensionInfo",[]),Kr=e=>$r.getValue(e,"qHyperCube.qMeasureInfo",[]),Gr=e=>$r.getValue(e,"barGrouping.grouping"),Yr={continuous({layout:e,properties:t,auto:n}){if(!Vr.canBeContinuous(e))return!1;const i=t||e;return $r.getValue(i,"dimensionAxis.continuousAuto")?"function"==typeof n?n():!!n:!!i?.preferContinuousAxis},dimensionless:e=>!Wr(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===Gr(e)&&(Wr(e).length>1||Kr(e).length>1)&&!this.continuous({layout:e})},groupedByDimension(e){return this.grouped(e)&&Wr(e).length>1&&1===Kr(e).length},groupedByMeasure(e){return this.grouped(e)&&1===Wr(e).length&&Kr(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==Gr(e)&&"butterfly"!==Gr(e)||this.continuous({layout:e}))&&(Wr(e).length>1||Kr(e).length>1)},stackedByDimension(e){return this.stacked(e)&&Wr(e).length>1&&1===Kr(e).length},stackedByMeasure(e){return this.stacked(e)&&1===Wr(e).length&&Kr(e).length>1},simple:e=>0===Wr(e).length||1===Wr(e).length&&1===Kr(e).length,snapshot:e=>!!$r.getValue(e,"snapshotData")};function Xr(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const Jr=e=>{throw e.isHandled=!0,e};const Zr={getDockValue:e=>"near"===e||"left"===e||"top"===e?0:1,getOppositeDock(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top";case"near":default:return"far";case"far":return"near"}},getHorizontalDock:e=>"near"===e||"left"===e?"left":"right",getVerticalDock:e=>"near"===e||"bottom"===e?"bottom":"top",getDock:(e,t,n)=>"vertical"===e||"y"===e?Zr.getVerticalDock(t):n?Zr.getOppositeDock(Zr.getHorizontalDock(t)):Zr.getHorizontalDock(t),getInvertedOrientation:e=>"vertical"===e?"horizontal":"vertical",getMinorScaleAxis:e=>"vertical"===e?"y":"x",getMajorScaleAxis:e=>"vertical"===e?"x":"y",getAlignment:(e,t)=>"vertical"===e?"near"===t||"bottom"===t?1:0:"near"===t||"left"===t?0:1,getMeasureScaleInvert:(e,t)=>"vertical"===e||t,getDimensionScaleInvert:(e,t)=>"horizontal"===e&&t,getSize:(e,{width:t,height:n})=>"vertical"===e?t:n};var Qr=(e,t)=>{if("function"==typeof t.defaultValue)return t.defaultValue();if(void 0!==t.defaultValue)return t.defaultValue;if(Array.isArray(t.options))return t.options[0].value;switch(e){case"array":return[];case"string":return"";case"integer":case"number":return 0;case"boolean":return!1;default:return null}};const ea=166/26,ta=12/11,na={stringWidthOverMWidth:e=>(12*Math.min(e,3)+Math.max(e-3,0)*ea)/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),i=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,i=i?i.length:0;const o=t+n+i;return{latin:e.length-o,cjk:o}},getTotalCharacterRatios(e,t,n="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const i={latin:0,cjk:0};let o;void 0===t?e.forEach(e=>{o=na.getCharacterRatios(e[n]),i.latin+=o.latin,i.cjk+=o.cjk}):e.forEach(e=>{o=na.getCharacterRatios(e[t][n]),i.latin+=o.latin,i.cjk+=o.cjk});const r=Math.max(1,i.latin+i.cjk);return i.latinRatio=i.latin/r,i.cjkRatio=i.cjk/r,i},getAdjustedMaxGlyphCount(e,t,n,i="qText"){const o=na.getTotalCharacterRatios(t,n,i),r=o.latinRatio*e,a=o.cjkRatio*e;return Math.ceil(na.stringWidthOverMWidth(r)+a*ta)}},ia="#la-vie-tooltip";function oa(){if(!document.querySelector(ia)){const e=document.createElement("div");e.id="la-vie-tooltip",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 ra({key:e="tooltip",rtl:t}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){oa()},beforeUpdate(){oa()},destroyed(){!function(){const e=document.querySelector(ia);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(ia),content:({h:e,data:t,style:n})=>t[0].map(t=>e("tr",{},function(e,{h:t,style:n}){return e.map(e=>{const i={style:{...n.cell||{},...e.style||{}},class:e.class};return e.colspan&&(i.colspan=e.colspan),t("td",i,e.content)})}(t,{h:e,style:n}))),direction:t?"rtl":"ltr"},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"}}}}const aa=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),sa=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),la=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),ua={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>aa.test(e),isRtlChar:e=>sa.test(e)||la.test(e),detectTextDirection(e){const t=e?e.length:0;let n,i;for(n=0;n<t;n++){if(i=e[n],ua.isLtrChar(i))return"ltr";if(ua.isRtlChar(i))return"rtl"}return"ltr"}},ca={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 i=t.data,o=e.resources.formatter,r=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&i.fillTooltip){const e=o("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(i.fillTooltip.value):i.fillTooltip.label?i.fillTooltip.label:i.fillTooltip.value,!n.coloring.label){const e=r(i.fillTooltip.source.key).field(i.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===i._fillColor?ca.getNodeFillColor(t):i._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=ua.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=ua.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 i=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:i,style:{"font-weight":"bold","text-align":n?"right":"left",direction:ua.detectTextDirection(i)},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 i=ua.detectTextDirection(t.color.label),o=n?[":",t.color.label]:[t.color.label,":"],r=ua.detectTextDirection(t.color.value);return[{content:o,style:{"text-align":n?"right":"left",direction:i}},{content:n?[t.color.value,ca.getColorSymbol(e,t)]:[ca.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:r,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,i,o=!1){const r=ua.detectTextDirection(e.label),a=i?[":",e.label]:[e.label,":"],s=ua.detectTextDirection(e.value);let l;return l=o?i?[e.value,ca.getColorSymbol(t,n)]:[ca.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":i?"right":"left",direction:r}},{content:l,style:{"text-align":i?"left":"right",direction:s,"vertical-align":"middle"}}]}};function da(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ma(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ha(){}var fa=.7,pa=1/fa,ga="\\s*([+-]?\\d+)\\s*",ya="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",va="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ba=/^#([0-9a-f]{3,8})$/,Sa=new RegExp(`^rgb\\(${ga},${ga},${ga}\\)$`),xa=new RegExp(`^rgb\\(${va},${va},${va}\\)$`),Ma=new RegExp(`^rgba\\(${ga},${ga},${ga},${ya}\\)$`),qa=new RegExp(`^rgba\\(${va},${va},${va},${ya}\\)$`),Ca=new RegExp(`^hsl\\(${ya},${va},${va}\\)$`),Ta=new RegExp(`^hsla\\(${ya},${va},${va},${ya}\\)$`),wa={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 ka(){return this.rgb().formatHex()}function Na(){return this.rgb().formatRgb()}function Da(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ba.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?La(t):3===n?new Aa(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ea(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ea(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=Sa.exec(e))?new Aa(t[1],t[2],t[3],1):(t=xa.exec(e))?new Aa(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ma.exec(e))?Ea(t[1],t[2],t[3],t[4]):(t=qa.exec(e))?Ea(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ca.exec(e))?Ba(t[1],t[2]/100,t[3]/100,1):(t=Ta.exec(e))?Ba(t[1],t[2]/100,t[3]/100,t[4]):wa.hasOwnProperty(e)?La(wa[e]):"transparent"===e?new Aa(NaN,NaN,NaN,0):null}function La(e){return new Aa(e>>16&255,e>>8&255,255&e,1)}function Ea(e,t,n,i){return i<=0&&(e=t=n=NaN),new Aa(e,t,n,i)}function Oa(e){return e instanceof ha||(e=Da(e)),e?new Aa((e=e.rgb()).r,e.g,e.b,e.opacity):new Aa}function Aa(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Ia(){return`#${Ha(this.r)}${Ha(this.g)}${Ha(this.b)}`}function Pa(){const e=Ra(this.opacity);return`${1===e?"rgb(":"rgba("}${za(this.r)}, ${za(this.g)}, ${za(this.b)}${1===e?")":`, ${e})`}`}function Ra(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function za(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ha(e){return((e=za(e))<16?"0":"")+e.toString(16)}function Ba(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ja(e,t,n,i)}function Fa(e){if(e instanceof ja)return new ja(e.h,e.s,e.l,e.opacity);if(e instanceof ha||(e=Da(e)),!e)return new ja;if(e instanceof ja)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,o=Math.min(t,n,i),r=Math.max(t,n,i),a=NaN,s=r-o,l=(r+o)/2;return s?(a=t===r?(n-i)/s+6*(n<i):n===r?(i-t)/s+2:(t-n)/s+4,s/=l<.5?r+o:2-r-o,a*=60):s=l>0&&l<1?0:a,new ja(a,s,l,e.opacity)}function ja(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Va(e){return(e=(e||0)%360)<0?e+360:e}function _a(e){return Math.max(0,Math.min(1,e||0))}function Ua(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}da(ha,Da,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ka,formatHex:ka,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Fa(this).formatHsl()},formatRgb:Na,toString:Na}),da(Aa,function(e,t,n,i){return 1===arguments.length?Oa(e):new Aa(e,t,n,null==i?1:i)},ma(ha,{brighter(e){return e=null==e?pa:Math.pow(pa,e),new Aa(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?fa:Math.pow(fa,e),new Aa(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Aa(za(this.r),za(this.g),za(this.b),Ra(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:Ia,formatHex:Ia,formatHex8:function(){return`#${Ha(this.r)}${Ha(this.g)}${Ha(this.b)}${Ha(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Pa,toString:Pa})),da(ja,function(e,t,n,i){return 1===arguments.length?Fa(e):new ja(e,t,n,null==i?1:i)},ma(ha,{brighter(e){return e=null==e?pa:Math.pow(pa,e),new ja(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?fa:Math.pow(fa,e),new ja(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,i=n+(n<.5?n:1-n)*t,o=2*n-i;return new Aa(Ua(e>=240?e-240:e+120,o,i),Ua(e,o,i),Ua(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new ja(Va(this.h),_a(this.s),_a(this.l),Ra(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=Ra(this.opacity);return`${1===e?"hsl(":"hsla("}${Va(this.h)}, ${100*_a(this.s)}%, ${100*_a(this.l)}%${1===e?")":`, ${e})`}`}}));const $a=Math.PI/180,Wa=180/Math.PI,Ka=.96422,Ga=.82521,Ya=4/29,Xa=6/29,Ja=3*Xa*Xa,Za=Xa*Xa*Xa;function Qa(e){if(e instanceof es)return new es(e.l,e.a,e.b,e.opacity);if(e instanceof as)return ss(e);e instanceof Aa||(e=Oa(e));var t,n,i=os(e.r),o=os(e.g),r=os(e.b),a=ts((.2225045*i+.7168786*o+.0606169*r)/1);return i===o&&o===r?t=n=a:(t=ts((.4360747*i+.3850649*o+.1430804*r)/Ka),n=ts((.0139322*i+.0971045*o+.7141733*r)/Ga)),new es(116*a-16,500*(t-a),200*(a-n),e.opacity)}function es(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function ts(e){return e>Za?Math.pow(e,1/3):e/Ja+Ya}function ns(e){return e>Xa?e*e*e:Ja*(e-Ya)}function is(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function os(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function rs(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof as)return new as(e.h,e.c,e.l,e.opacity);if(e instanceof es||(e=Qa(e)),0===e.a&&0===e.b)return new as(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Wa;return new as(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new as(e,t,n,null==i?1:i)}function as(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function ss(e){if(isNaN(e.h))return new es(e.l,0,0,e.opacity);var t=e.h*$a;return new es(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}da(es,function(e,t,n,i){return 1===arguments.length?Qa(e):new es(e,t,n,null==i?1:i)},ma(ha,{brighter(e){return new es(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new es(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 Aa(is(3.1338561*(t=Ka*ns(t))-1.6168667*(e=1*ns(e))-.4906146*(n=Ga*ns(n))),is(-.9787684*t+1.9161415*e+.033454*n),is(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),da(as,rs,ma(ha,{brighter(e){return new as(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new as(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return ss(this).rgb()}}));var ls={isDark:function(e){return rs(e).l<70}};function us(e){const t=e.qDef;!0===t.autoSort&&t.qSortCriterias.forEach(e=>{e.qSortByNumeric=1,e.qSortByAscii=1})}const cs={horizontal:{major:"width",minor:"height",start:"left",end:"right",shadow:{startOffset:"12px 0",endOffset:"-12px 0"}},vertical:{major:"height",minor:"width",start:"top",end:"bottom",shadow:{startOffset:"0 12px",endOffset:"0 -12px"}}},ds=e=>`${e} 12px -12px inset rgba(0, 0, 0, 0.0625)`;var ms={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:n,rtl:i}=this.settings.settings,[o,r]=t(),a=Math.abs(o)<1e-15,s=Math.abs(r-1)<1e-15,l=(e=>{const t=cs[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:ds(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:ds(t.shadow.endOffset)}}})(n),u="horizontal"===n&&i,c=[];return a||c.push(e("div",{style:{...l.base,...u?l.towardsEnd:l.towardsStart},class:"scroll-hint--towards-start"})),s||c.push(e("div",{style:{...l.base,...u?l.towardsStart:l.towardsEnd},class:"scroll-hint--towards-end"})),c}};function hs({viewState:e,viewCache:t,layoutService:n,dockService:i,rtl:o}){return!n.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:i.meta.major.orientation,rtl:o,range:()=>function({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),i=t.get("continuousMin"),o=t.get("continuousMax");return[(n.min-i)/(o-i),(n.max-i)/(o-i)]}(t,n):function(e){return e.get("viewRange")}(t)}({layoutService:n,viewState:e,viewCache:t})}}}let fs;function ps(){fs=fs||document.createElement("canvas").getContext("2d")}const gs={measureTextWidth(e){ps();const{width:t}=fs.measureText(e);return t},lineWrap(e,t,n,i){let o,r;ps();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,d,m=e?e.split(/\s+/):[],h=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof i&&a.length>=i)return a.slice(0,i);for(n&&(fs.font=n),r=0;r<a.length;r++){for(d=a[r]||"",m=d.split(/\s+/),[h]=m,c="",o=1;o<m.length;o++)if(l=`${h} ${m[o]}`,u=gs.measureTextWidth(l),u>t&&("number"!=typeof i||i>s.length)?(s.push(h),h=m[o]):h=l,"number"==typeof i&&s.length>=i){c=m.slice(o+1).join(" ");break}"number"!=typeof i||s.length<i?s.push(h):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${h} ${c}`}return s},wordWrap(e,t,n,i,o){if(ps(),!e||!e.length)return[];n&&(fs.font=n);let r=[];const a=e.slice();let s,l,u,c;if(a.filter(e=>!!e),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++)u=a[c],l=null,u&&(u.length<=1||gs.measureTextWidth(u)<=t?r.push(u):(s=gs.splitWord(u,t,void 0,i-r.length),s.length<=1?r.push(s[0]):(l=s.pop(),r=r.concat(s),a[c+1]?gs.measureTextWidth(`${l} ${a[c+1]}`)>t&&r.length+a.length-c<=i?a.splice(c+1,0,l):a[c+1]=`${l} ${a[c+1]}`:a.push(l))));return r.forEach((e,t,n)=>{n[t]=e?e.trim():e}),r.length>i?(r=r.splice(0,i),r[r.length-1]=gs.truncate(r[r.length-1],t,n,o).text):(u=r[r.length-1],u&&u.length>1&&gs.measureTextWidth(u)>t&&(r[r.length-1]=gs.truncate(u,t,n,o).text)),r},truncate(e,t,n,i="…"){ps();let o,r,a,s,l=e;const u=gs.measureTextWidth("i"),c=Math.ceil(t/u);if(n&&(fs.font=n),e&&t){if(gs.measureTextWidth(l)>t){for(o=Math.min(c,l.length);o>0;o--)if(r=l.substring(0,o-1),a=r.trim()+i,gs.measureTextWidth(a)<=t){s=l.substring(o-1),l=a;break}o||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,i){let o;ps();let r,a=e,s="",l=[];if(gs.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/i);for(o=Math.min(e.length,u);o>0&&(a=e.substring(0,o),r=e.substring(o-1,o)," "===r?a=e.substring(0,o-1):a+="-",s=e.substring(o),!(gs.measureTextWidth(a)<=t));o--);return(!o&&!a||gs.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(gs.measureTextWidth(s)>t?(s=gs.explodeWord(s,t,n-1,i),l=l.concat(s)):l.push(s),l.filter(e=>""!==e.trim())):l},splitWord:(e,t,n,i)=>(ps(),e&&t?(n&&(fs.font=n),gs.explodeWord(e,t,i,Math.max(1,gs.measureTextWidth("i")))):[]),wrapText(e,t,n,i,o){let r;return Number.isNaN(t)?[e]:(r=i>1?gs.lineWrap(e,t,n,i):[e],r=gs.wordWrap(r,t,n,i,o),r)},getFontHeight:e=>(ps(),e&&(fs.font=e),1.5*gs.measureTextWidth("m")),tokenize(e,t,n,i,o,r,a=1){ps(),t&&(fs.font=t);const s=gs.getFontHeight(),l=a*s;let u=[],c=0,d=[];if(r<s)return[];const m=r?Math.max(1,Math.floor(r/l)):i||1;return Array.isArray(i)?(i.forEach(e=>{c+=Number.isNaN(e)||e<=0?0:e}),i.forEach(e=>{u.push(Number.isNaN(e)||e<=0?m-c:e)})):u=[Number.isNaN(i)||i<=0?m:Math.min(m,i)],Array.isArray(e)?e.forEach((e,n)=>{d.length<m&&(d=d.concat(gs.wrapText(e,o,t,u[n])))}):d=gs.wrapText(e,o,t,u[0],n),d}},ys={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:i,rendHeight:o,flipXY:r,symbol:a}){let s="x",l="y",u=i,c=o,d=t<.5?90:-90;return r&&(s="y",l="x",u=o,c=i,d=t<.5?180:0),a(ne({},e,{[s]:n*u,[l]:Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}},vs=ne.bind(null,!0),bs={},{isArray:Ss}=Array;function xs(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function Ms(e){return void 0===e}function qs(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Cs(e,t){const n=t.substring(1).split("/").slice(0,-1);let i;return n.forEach((t,o)=>{if(o===n.length)return;i=+t;const r=isNaN(i)?{}:[];e[i||t]=Ms(e[i||t])?r:e[t],e=e[i||t]}),e}function Ts(e,t){return t?Object.keys(e).filter(t=>void 0!==e[t]).length:Object.keys(e).length}function ws(e,t,n){let i=!0;if(xs(e)&&xs(t))return Ts(e,n)===Ts(t,n)&&(Object.keys(e).forEach(o=>{ws(e[o],t[o],n)||(i=!1)}),i);if(Ss(e)&&Ss(t)){if(e.length!==t.length)return!1;for(let i=0,o=e.length;i<o;i+=1)if(!ws(e[i],t[i],n))return!1;return!0}return e===t}bs.compare=ws,bs.generate=function(e,t,n){n=n||"";let i=[];return Object.keys(t).forEach(o=>{const r=function(e){return e?vs({},{val:e}).val:e}(t[o]),a=e[o],s=`${n}/${o}`;ws(r,a)||qs(t,o)||(Ms(a)?i.push({op:"add",path:s,value:r}):xs(r)&&xs(a)?i=i.concat(bs.generate(a,r,s)):Ss(r)&&Ss(a)?i=i.concat(function(e,t,n){let i=[];const o=e.slice();let r=-1;function a(e,t,n){if(e[n]&&Ms(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,i=e.length;n<i;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(ws(t,o))return i;if(!Ms(t[0])&&Ms(t[0].qInfo)||0===t.length)return i.push({op:"replace",path:n,value:t}),i;for(let e=o.length-1;e>=0;e-=1)r=a(t,o[e].qInfo&&o[e].qInfo.qId,e),-1===r?(i.push({op:"remove",path:`${n}/${e}`}),o.splice(e,1)):i=i.concat(bs.generate(o[e],t[r],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)r=a(o,t[e].qInfo&&t[e].qInfo.qId),-1===r?(i.push({op:"add",path:`${n}/${e}`,value:t[e]}),o.splice(e,0,t[e])):r!==e&&(i.push({op:"move",path:`${n}/${e}`,from:`${n}/${r}`}),o.splice(e,0,o.splice(r,1)[0]));return i}(a,r,s)):i.push({op:"replace",path:`${n}/${o}`,value:r}))}),Object.keys(e).forEach(o=>{Ms(t[o])&&!qs(e,o)&&i.push({op:"remove",path:`${n}/${o}`})}),i},bs.apply=function(e,t){t.forEach(t=>{let n=Cs(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&isNaN(+i)?n[i]:n[+i]||n;const r=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,o=e),"add"===t.op||"replace"===t.op)if(Ss(n))"-"===i&&(i=n.length),n.splice(+i,"add"===t.op?0:1,t.value);else if(Ss(o)&&Ss(t.value)){const e=t.value.slice();o.length=0,o.push(...e)}else if(xs(o)&&xs(t.value))a=o,Object.keys(a).forEach(e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!qs(a,e)&&delete a[e]}),vs(o,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[i]=t.value}else if("move"===t.op){const o=Cs(e,t.from);Ss(n)?n.splice(+i,0,o.splice(+r,1)[0]):(n[i]=o[r],delete o[r])}else"remove"===t.op&&(Ss(n)?n.splice(+i,1):delete n[i]);var a})},bs.clone=function(e){return vs({},e)},bs.createPatch=function(e,t,n){const i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},bs.updateObject=function(e,t){Object.keys(e).length?bs.apply(e,bs.generate(e,t)):vs(e,t)};const ks=Math.log(10);function Ns(e){return 10**e}const Ds={pow10:Ns,log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/ks,eliminateFloatingError(e){const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e},getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/ks),i=e/Ns(n);return t=i<=1?1:i<=2?2:i<=5?5:10,t*Ns(n)*(e<0?-1:1)},getSmallNiceNumber(e){let t,n;if(0===e)return 0;t=Math.floor(Math.log(Math.abs(e))/ks);const i=e/Ns(t);return i<1?(n=5,t--):n=i<2?1:i<5?2:5,n*Ns(t)*(e<0?-1:1)},getMagnitude(e){if(0===e)return 0;return Ns(Math.floor(Math.log(Math.abs(e))/ks))},getFraction(e){if(0===e)return 0;return e/Ns(Math.floor(Math.log(Math.abs(e))/ks))},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/ks),i=e/Ns(n);return t=Math.ceil(i),7!==t&&9!==t||t++,i>1&&i<=1.5?t=1.5:i>2&&i<=2.5&&(t=2.5),t*Ns(n)*(e<0?-1:1)},getValueWithOffset:(e,t=0)=>e+Math.abs(e)*t,isNumber:e=>"number"==typeof e&&!Number.isNaN(e)};const Ls={findMinPositiveDistance:function(e){if(e.length<2)return 0;e.sort((e,t)=>e-t);let t=1/0;for(let n=1;n<e.length;n++){const i=e[n]-e[n-1];i>0&&i<t&&(t=i)}return t===1/0?0:t}},Es=[[2,4,6],[2,4],[3]],Os=[,[,,[[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 As(e,t,n){const i=e?e.length:0;let o,r=void 0===t?Number.MAX_VALUE:e[0]/t;for(o=1;o<i;o++)r=Math.min(r,e[o]/e[o-1]);void 0!==n&&(r=Math.min(r,n/e[i-1])),e.splice(0,0,r)}function Is(e,t,n){let i;const o=e?e.length:0;for(i=0;i<o;i++)As(e[i],t,n)}!function(){let e,t;for(Is(Es,1,10),e=0;e<Os.length;e++)if(Os[e])for(t=0;t<Os[e].length;t++)Array.isArray(Os[e][t])&&Is(Os[e][t])}();const Ps={isInside(e,t,n,i){if(!i)return!0;const o=e.position-e.radius,r=e.position+e.radius;return o>=t&&r<=n},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const n=e.position<t.position?e:t,i=e.position<t.position?t:e;return i.position-i.radius-(n.position+n.radius)},findSegmentPositionMeetMax(e,t){const n=Math.max(0,e.max-t);return e.center-n},findSegmentPositionMeetMin(e,t){const n=Math.max(0,t-e.min);return e.center+n},findSegmentPositionMeetMinThenMax(e,t,n){const i=Ps.findSegmentPositionMeetMin(e,t);return Ps.findSegmentPositionMeetMax({center:i,max:i+e.radius},n)},findSegmentPositionMeetMaxThenMin(e,t,n){const i=Ps.findSegmentPositionMeetMax(e,n);return Ps.findSegmentPositionMeetMin({center:i,min:i-e.radius},t)},layoutPositionFromMin(e,t,n,i=0){const o=e.length-1;let r,a,s=t;for(let t=0;t<o;t++)r=e[t],a=e[t+1],r.position=Ps.findSegmentPositionMeetMaxThenMin(r,s,(r.center+a.center-i)/2),s=r.position+r.radius+i/2;a.position=Ps.findSegmentPositionMeetMaxThenMin(a,s,n)},adjustPositionFromMax(e,t,n,i=0){const o=e.length-1;let r,a,s;const l=Math.max(0,e[o].position+e[o].radius-n);if(0===l)return;let u,c=0;for(r=o;r>0&&(a=e[r],s=e[r-1],u=Math.max(0,Ps.getGap(s,a)-i),u-=Math.max(0,c+u-l),c+=u,a.move=u,!(c>=l));r--);for(c<l&&(u=Math.max(0,s.position-s.radius-t),u-=Math.max(0,c+u-l),c+=u,s.move=u),c=0,r=0;r<=o;r++)a=e[r],c+=a.move||0,a.move=c,a.position-=c},layout(e,t,n,i=0){const o=e.length-1;if(!(o<0)){if(0===o){const i=e[0];return void(i.position=Ps.findSegmentPositionMeetMaxThenMin(i,t,n))}Ps.layoutPositionFromMin(e,t,n,i),Ps.adjustPositionFromMax(e,t,n,i)}}},Rs=(e,t,n,i=1)=>{const o=e.bandwidth();return n?"start"===t?o:"end"===t?o*(1-i):o*(2-i)/2:"start"===t?0:"end"===t?o*i:o*i/2},zs=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,Hs=e=>e.filter(zs),Bs=(e,t)=>Hs($r.getValue(e,t,[])),Fs=e=>zs(e)&&(!1!==e.showValue||!1!==e.showLabel),js=e=>e.filter(Fs),Vs=(e,t)=>js($r.getValue(e,t,[])),_s=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,Us=(e,t,n)=>{const{dimensionRefLineInfo:i}=t;if(i[e])return i[e][n]},$s=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:i,qHeight:o}=n;return void 0!==i&&void 0!==o&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<i},Ws=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:i,qHeight:o}=n;return void 0!==i&&void 0!==o&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=i+o},Ks=({value:e,qMin:t})=>"NaN"!==t&&e<t,Gs=({value:e,qMax:t})=>"NaN"!==t&&e>t,Ys={isRefLineVisible:zs,getVisibleRefLines:Hs,getRefLines:Bs,getMeasureRefLines:e=>Bs(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:Bs(e,"refLine.dimRefLines"),isRefLineLabelVisible:Fs,getVisibleRefLineLabels:js,getRefLineLabels:Vs,getMeasureRefLineLabels:e=>Vs(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:Vs(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:n,valueInfo:i,align:o,invert:r=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=Rs(s,o,r,a.meta.groupSize??a.meta.measureCount),s([n,0])+l;if(a.meta.isGroupedByDimension){if(!i)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=i;let u;return l=Rs(s,o,r,t),e&&e.length&&(u=(({pxScale:e,value:t,innerValues:n,invert:i,minOrder:o})=>{const r=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:i});for(let i=0;i<n.length;i++){const{id:a,order:s}=n[i],l=e([t,a]);if(void 0!==l)return l-r*(s-o)}})({pxScale:s,value:n,innerValues:e,invert:r,minOrder:a})),(void 0===u?s(n):u)+l}return l=Rs(s,o,r),s(n)+l}return e(n)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:n,layoutService:i})=>{const{isGroupedByDimension:o}=i.meta,r={},a=$r.getValue(e,"qHyperCube"),s="K"===a.qMode,l=n?n.query.getCurrentDataPage():$r.getValue(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);if(void 0===l?.qArea?.qTop)return r;const u=s?"qData.0.qSubNodes":"qMatrix",c=$r.getValue(l,u,[]),d=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),m=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<c.length;e++){const t=c[e],n=e+m,i=t[d];r[i]||(r[i]={id:t.qElemNo,qText:t.qText,minOrder:n,maxOrder:n,dataNode:c[e]})}})():o?(()=>{let e;for(let t=0;t<c.length;t++){const n=c[t][0],i=c[t][1],o=t+m,a=n[d];r[a]?(r[a].minOrder=Math.min(r[a].minOrder,o),r[a].maxOrder=Math.max(r[a].maxOrder,o),r[a].innerValues[r[a].innerValues.length]={id:i.qElemNumber,order:o}):r[a]={id:n.qElemNumber,qText:n.qText,minOrder:o,maxOrder:o,innerValues:[{id:i.qElemNumber,order:o}],dataNode:c[t]},0===t?0===o&&(r[a].isMinOrderOk=!0):a!==e&&(r[a].isMinOrderOk=!0,r[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<c.length;e++){const t=c[e][0],n=e+m,i=t[d];r[i]||(r[i]={id:t.qElemNumber,qText:t.qText,minOrder:n,maxOrder:n,dataNode:c[e]})}})(),r},getInputValue:_s,extractInfoFromInputValue:Us,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const i=_s({refLineLayout:e,layoutService:n});return Us(i,t,"id")},isDiscreteMinOutOfBounds:$s,isDiscreteMaxOutOfBounds:Ws,isContinuousMinOutOfBounds:Ks,isContinuousMaxOutOfBounds:Gs,isOutOfRange:({value:e,qMin:t,qMax:n})=>Ks({value:e,qMin:t})||Gs({value:e,qMax:n}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&Ws({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&$s({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:n})=>"horizontal"===e?t:n},Xs=({label:e,labelStyle:t})=>[e?.fontStyle||t?.fontStyle,e?.fontWeight||t?.fontWeight,e?.fontSize||t?.fontSize,e?.fontFamily||t?.fontFamily].filter(e=>!!e).join(" ");function Js(e){return e.showValue?`… ${e.valueString}`:"…"}function Zs(e,t,n=70){for(let i=0;i<e.length;i++){const o=e[i],r=Xs({label:o,labelStyle:t});o.lines=gs.tokenize(o.title,r,Js(o),3,n),o.maxNumLines=o.lines.length}}function Qs({title:e,font:t,ellipsis:n,maxNumLines:i=5,maxWidth:o=200}){const r=gs.tokenize(e,t,n,i,o),a=r.length;let s="";if(a){[s]=r;for(let e=1;e<a;e++)s=`${s}\n${r[e]}`}return s}function el({oobs:e,font:t,ellipsis:n,maxNumLines:i=5,maxWidth:o=200}){const r=e.map(e=>Qs({title:e.title,font:t,ellipsis:`${n} ${e.valueString}`,maxNumLines:i,maxWidth:o})),a=r.length;let s="";if(a){[s]=r;for(let e=1;e<a;e++)s=`${s}\n\n${r[e]}`}return s}function tl(e,t="value"){e.sort((e,n)=>e[t]-n[t])}const nl=3,il=2;function ol({inputValue:e,inputValueLabel:t,localeInfo:n}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!n)return!0;const i=`+-${n.qDecimalSep||""}${n.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${i}]`,"g"),"").length>0||function(e){if(e.indexOf("e")>-1)return!1;const t=e.indexOf("-");return-1!==t&&(e.lastIndexOf("-")!==t||0!==t)}(t)}const rl=({label:e,dataPages:t,qMin:n,qMax:i})=>{if(void 0!==n&&void 0!==i){const{inputValue:t}=e;if(Ys.isContinuousMaxOutOfBounds({value:t,qMax:i}))return 1;if(Ys.isContinuousMinOutOfBounds({value:t,qMin:n}))return-1}return Ys.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:Ys.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},al={hasEngineFormat:ol,calculateLabelPositions({labels:e,scale:t,size:n,layoutService:i,orientation:o,rtl:r,isContinuous:a,isDimension:s}){const l=Ys.getInvert({orientation:o,rtl:r,isContinuous:a}),u="S"===i.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",c=i.getHyperCubeValue(u),{canBeContinuous:d}=i.meta;let m,h;if(s&&d){const e=i.getLayoutValue("qHyperCube.qDimensionInfo.0");m=e.qMin,h=e.qMax}for(let o=0;o<e.length;o++){const r=e[o],{value:s,align:u,valueInfo:d}=r,f=rl({label:r,dataPages:c,qMin:m,qMax:h});r.scaledValue=1===f?l?-.1:1.1:-1===f?l?1.1:-.1:Ys.getScaledPosition({scale:t,size:n,value:s,valueInfo:d,align:u,invert:l,layoutService:i,isContinuous:a}),r.center=r.scaledValue*n}},getTitle:e=>!1!==e.showValue?!1!==e.showLabel?`${e.text} ${e.valueString}`:e.valueString:!1!==e.showLabel?e.text:"",addLabelTitles({labels:e,formatter:t,isContinuous:n,canBeContinuous:i,localeInfo:o}){let r;if(n)for(let n=0;n<e.length;n++){const i=e[n],{value:a,inputValue:s,inputValueLabel:l}=i;r=ol({inputValue:s,inputValueLabel:l,localeInfo:o})?l:t?t(a):a,i.valueString=`${ua.lrm}(${r})${ua.lrm}`,i.title=al.getTitle(i)}else if(i)for(let t=0;t<e.length;t++){const n=e[t],{valueText:i,inputValue:a,inputValueLabel:s}=n;r=ol({inputValue:a,inputValueLabel:s,localeInfo:o})?s:i,n.valueString=`${ua.lrm}(${r})${ua.lrm}`,n.title=al.getTitle(n)}else for(let t=0;t<e.length;t++){const n=e[t];r=n.valueText,n.valueString=`${ua.lrm}(${r})${ua.lrm}`,n.title=al.getTitle(n)}},measureLabelsWidth(e,t){for(let n=0;n<e.length;n++){const i=e[n];i.totalWidth=t(i.title,i).width}},measureLabelMaxLineWidth:(e,t)=>Math.max(...e.lines.map(n=>t(n,e).width)),getMaxTextWidth(e){const t=e.map(e=>e.totalWidth);return Math.max(...t)},addLabelsNeighborInfo(e,t,n,i=0){const o=e.length-1;if(o<0)return;let r,a;if([r]=e,r.cMin=t,0!==o){for(let t=0;t<o;t++)r=e[t],a=e[t+1],r.cMax=(r.center+a.center-i)/2,a.cMin=r.cMax+i;a.cMax=n}else r.cMax=n},getTotalNumLines(e){let t=0;return e.forEach(e=>{t+=e.maxNumLines}),t},reduceLabelsHavingMaxNumLines(e,t,n){const i=t-1,o=e.filter(e=>e.maxNumLines===t),r=Math.min(n,o.length);for(let e=o.length-1;e>=o.length-r;e--)o[e].maxNumLines=i},reduceTotalMaxNumLines(e,t,n){const i=Math.floor(n/t);let o=3;do{const t=al.getTotalNumLines(e)-i;if(t<=0)return;al.reduceLabelsHavingMaxNumLines(e,o,t),o--}while(o>1)},reduceMaxNumLines(e,t,n=0){for(let i=0;i<e.length;i++){const o=e[i];o.maxNumLines=Math.max(1,Math.min(o.maxNumLines,Math.floor((Math.max(0,o.cMax-o.cMin)+n)/t)))}},addLabelsSize(e,t,n=15,i){for(let o=0;o<e.length;o++){const r=e[o];r.width=Math.min(t,al.measureLabelMaxLineWidth(r,i)),r.height=r.lines.length*n}},addLabelSegments(e,t){for(let n=0;n<e.length;n++){const i=e[n],{center:o}=i,r=i[t],a=r/2;i.segment={center:o,range:r,min:o-a,max:o+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:n,lowerLimit:i,upperLimit:o,gap:r,labelStyle:a,maxLabelWidth:s,lineHeight:l,majorDimension:u,orientation:c,measureText:d,rtl:m,layoutService:h,isContinuous:f,isDimension:p}){const g=e.map(e=>e),y=n;al.calculateLabelPositions({labels:e,scale:t,size:y,layoutService:h,orientation:c,rtl:m,isContinuous:f,isDimension:p}),tl(e,"center"),al.addLabelsNeighborInfo(e,i,o,r),Zs(e,a,s),al.reduceTotalMaxNumLines(g,l,o-(g.length-1)*r),"vertical"===c&&(al.reduceMaxNumLines(e,l,.05*r),function(e,t,n=70){for(let i=0;i<e.length;i++){const o=e[i],r=Xs({label:o,labelStyle:t});o.lines.length>o.maxNumLines&&(o.lines=gs.tokenize(o.title,r,Js(o),o.maxNumLines,n))}}(e,a,s)),al.addLabelsSize(e,s,l,d),al.addLabelSegments(e,u)},createLabels({labels:e,style:t,maxLabelWidth:n,areaProps:i,area:o,lineHeight:r=15,font:a}){const{majorAxis:s,minorAxis:l,dock:u}=i,{minorCenter:c}=o,{fontSize:d,fontFamily:m,fontStyle:h,fontWeight:f,textDecoration:p,background:g}=t;let y=[];return e.forEach(e=>{const{lines:t}=e,i=t.length,o=t.map((t,o)=>{const g={type:"text",text:t,title:Qs({title:e.title,font:a,ellipsis:Js(e)}),dx:0,dy:0,maxWidth:n,width:n,fontSize:e.fontSize||d,fontFamily:e.fontFamily||m,fontStyle:e.fontStyle||h,fontWeight:e.fontWeight||f,textDecoration:e.textDecoration||p,fill:e.fill,baseline:"central",anchor:"middle",value:e.value,dock:u};return g[l]=c,g[s]=e.segment.position,g.y+=(o-(i-1)/2)*r,g});e.background&&y.push(function({minorCenter:e,majorAxis:t,minorAxis:n,dock:i,label:o,lineHeight:r,background:a}){const{lines:s}=o,{borderRadius:l=nl,padding:u={}}=a,{top:c=il,bottom:d=il,left:m=il,right:h=il}=u,f=s.length,p={type:"rect",rx:l,ry:l,fill:o.background.fill,width:o.width+(m+h),height:o.height+(c+d),value:o.value,dock:i};return p[n]=e,p[t]=o.segment.position,p.x-=o.width/2+m,p.y-=f*r/2+c,p}({minorCenter:c,majorAxis:s,minorAxis:l,dock:u,label:e,lineHeight:r,background:g})),y=y.concat(o)}),y}};function sl(e,t,n){let i;const o=typeof t;if("string"===o||"object"===o)i=e.formatter(t);else if(void 0!==n&&n.data){const e=n.data()&&n.data().fields;i=e&&e[0]?e[0].formatter():null}return i}function ll(e,t,n){return"top"===e||"bottom"===e?function(e,t){const{lineHeight:n,top:i,bottom:o,maxLabelWidth:r}=t;let a=1;return al.getMaxTextWidth(e)>r&&(Zs(e,t,r),a=Math.max(...e.map(e=>e.lines.length))),a*n+i+o}(t,n):function(e,t){const{left:n,right:i,maxLabelWidth:o}=t;return Math.min(o,al.getMaxTextWidth(e))+n+i}(t,n)}function ul(e,t){return t?e.domain():[0,1]}function cl(e,t,n,i="value"){let o=e.filter(e=>e[i]>=t);o=o.filter(e=>e[i]<=n);const r=e.filter(e=>e[i]<t),a=e.filter(e=>e[i]>n);return{filteredLabels:o,minOobs:r,maxOobs:a,numMinOobs:r.length,numMaxOobs:a.length}}function dl(e){let t,n=0;for(let i=1;i<10;i++)t=e(i),n=Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[n,Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height))]}function ml(e,t){return e>9?t[1]:t[0]}function hl({alignment:e,dockValue:t,oobs:n,style:i,rect:o,symbol:r,position:a,areaProps:s,radius:l,font:u}){const c=n?n.length:0;if(c<1)return[];const{flipXY:d,majorAxis:m,minorAxis:h,minorDimension:f,dock:p}=s,g=o[f],y=ys.createOob({oob:ys.getDefaultSettings({size:i.size,fill:i.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:o.width,rendHeight:o.height,flipXY:d,symbol:r});y.dock=p;const v=`c${m}`,b=`c${h}`,S={type:"circle",r:l,stroke:"transparent",fill:i.text.background.fill,strokeWidth:0,dock:p};S[b]=g/2,S[v]=a;const x={type:"text",text:c>9?"9+":c,title:el({oobs:n,font:u,ellipsis:"…"}),dx:0,dy:0,maxWidth:g,width:g,fontSize:i.text.fontSize,fontFamily:i.text.fontFamily,fill:i.text.fill,baseline:"central",anchor:"middle",dock:p};return x[h]=g/2,x[m]=a,[y,S,x]}const fl=e=>{const t=Xs({labelStyle:e}),n=gs.getFontHeight(t)*(e.lineHeightMultiplicator||1),i=e.gap||12,o=e.maxWidth||75,r=e.padding.top||0,a=e.padding.bottom||0,s=e.padding.left||0,l=e.padding.right||0;return{...e,font:t,lineHeight:n,gap:i,maxLabelWidth:o,top:r,bottom:a,left:s,right:l}},pl=e=>e.map(e=>({...e,value:"function"==typeof e.value?e.value():e.value,valueText:"function"==typeof e.valueText?e.valueText():e.valueText,valueInfo:"function"==typeof e.valueInfo?e.valueInfo():e.valueInfo}));var gl={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:n,isContinuous:i,localeInfo:o}=this.settings,r=!!i||n.meta.canBeContinuous,a=pl(this.settings.labels),s=sl(this.chart,this.settings.formatter,e);al.addLabelTitles({labels:a,formatter:s,isContinuous:i,canBeContinuous:r,localeInfo:o});const{numMaxOobs:l,numMinOobs:u,filteredLabels:c}=(({labels:e,scale:t,isContinuous:n,canBeContinuous:i,layoutService:o})=>{if(n){const[i,o]=ul(t,n);return cl(e,i,o)}if(i){const t=o.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:i}=t;if("NaN"!==n&&"NaN"!==i)return cl(e,n,i,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:i,canBeContinuous:r,layoutService:n});let d;if(this.measureText=(e,n)=>{const{fontSize:i,fontFamily:o,fontWeight:r}=n||{};return this.renderer.measureText({text:e,fontWeight:r||t.label.fontWeight,fontSize:i||t.label.fontSize,fontFamily:o||t.label.fontFamily})},c&&c.length){const e=fl(t.label),{dock:n}=this.settings.layout;return al.measureLabelsWidth(c,this.measureText),d=ll(n,c,e),d}const m=dl(this.measureText),h=l?ml(l,m):0,f=u?ml(u,m):0;return d=Math.max(h,f),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:n,layoutService:i,theme:o,isContinuous:r,isDimension:a,localeInfo:s}=this.settings,l=!!r||i.meta.canBeContinuous,u=pl(this.settings.labels),{dock:c,rtl:d}=this.settings.layout,{padding:m}=n.label,h=function(e){return"left"===e||"right"===e?(e=>({dock:e,orientation:"vertical",majorAxis:"y",minorAxis:"x",majorDimension:"height",minorDimension:"width",flipXY:!1}))(e):(e=>({dock:e,orientation:"horizontal",majorAxis:"x",minorAxis:"y",majorDimension:"width",minorDimension:"height",flipXY:!0}))(e)}(c),f=function(e,t,n){const i=e[t.minorDimension];return{minorSize:i,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(i-n.right-n.left)/2+n.left:(i-n.top-n.bottom)/2+n.top}}(this.rect,h,m),{orientation:p,majorDimension:g}=h,{majorSize:y}=f,v=fl(n.label),{font:b,lineHeight:S,gap:x,maxLabelWidth:M}=v,q=sl(this.chart,this.settings.formatter,e),C=y;al.addLabelTitles({labels:u,formatter:q,isContinuous:r,canBeContinuous:l,localeInfo:s}),al.calculateLabelPositions({labels:u,scale:e,size:C,layoutService:i,orientation:p,rtl:d,isContinuous:r,isDimension:a});const[T,w]=ul(e,r),{filteredLabels:k,lowerOobs:N,upperOobs:D,lowerCircleSize:L,upperCircleSize:E,lowerOobSpace:O,upperOobSpace:A}=function({labels:e,minValue:t,maxValue:n,orientation:i,rtl:o,isContinuous:r,style:a,padding:s,measureText:l,prop:u="value"}){const{maxOobs:c,minOobs:d,filteredLabels:m}=cl(e,t,n,u),h="scaledValue"!==u&&Ys.getInvert({orientation:i,rtl:o,isContinuous:r}),f=function(e,t,n){return n?t:e}(d,c,h),p=function(e,t,n){return n?e:t}(d,c,h),g=f.length,y=p.length,v=dl(l),b=ml(g,v),S=ml(y,v),x=function(e,t,n,i,o){return("vertical"===i?o.top:o.left)+(e>0?t+n:0)}(g,a.oob.size,b,i,s),M=function(e,t,n,i,o){return("vertical"===i?o.bottom:o.right)+(e>0?t+n:0)}(y,a.oob.size,S,i,s);return{filteredLabels:m,lowerOobs:f,upperOobs:p,lowerCircleSize:b,upperCircleSize:S,lowerOobSpace:x,upperOobSpace:M}}({labels:u,minValue:T,maxValue:w,orientation:p,rtl:d,isContinuous:r,style:n,padding:m,measureText:this.measureText,prop:r?"value":"scaledValue"}),I=O,P=y-A;tl(N),tl(D);const R=hl({alignment:0,dockValue:0,oobs:N,style:n.oob,rect:this.rect,symbol:t,position:n.oob.size+L/2,areaProps:h,radius:L/2,font:b}),z=hl({alignment:1,dockValue:1,oobs:D,style:n.oob,rect:this.rect,symbol:t,position:y-(n.oob.size+E/2),areaProps:h,radius:E/2,font:b});al.addLabelsInfo({labels:k,scale:e,majorSize:y,lowerLimit:I,upperLimit:P,labelStyle:v,lineHeight:S,gap:x,maxLabelWidth:M,majorDimension:g,orientation:p,measureText:this.measureText,rtl:d,layoutService:i,isContinuous:r,isDimension:a}),Ps.layout(k.map(e=>e.segment),I,P,n.label.gap);const H=k.filter(e=>Ps.isInside(e.segment,I,P,r));return al.createLabels({labels:H,style:n.label,maxLabelWidth:M,areaProps:h,area:f,lineHeight:S,font:b,theme:o}).concat([...R,...z])}};var yl={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 vl(e){const{qHyperCube:t,...n}=e,{qAxisData:i,qDataPages:o,qStackedDataPages:r,qTreeDataPages:l,...u}=t,c=ne(!0,{},{...n,qHyperCube:{...u}}),{dataRelatedPropertiesPaths:d}=yl;function m(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==a(e,t)&&s(e,t,void 0));const i=t.substring(0,n),o=t.substring(n+2),r=o.startsWith(".")?o.substring(1):o;a(e,i,[]).forEach(e=>{r&&m(e,r)})}return d.forEach(e=>{m(c,e)}),c}var bl={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:i}){return o=>{if(e||t||n){if("line"===o.type)return o.tickValue??"axis";if("text"===o.type)return`${o.tickValue} ${o.text}`;if("container"===o.type){const e=o.children.filter(e=>"text"===e.type).map(e=>e.text);return`${o.data.value} ${e.join("")}`}return Math.random()}if(i){if("line"===o.type&&void 0===o.tickValue)return"axis";const e=o.transform&&o.transform.match(/rotate/gi)?"rotated":"horizontal";return`${o.data.group?`${o.data.group.value} `:""}${o.data.value} ${o.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:i,dock:o}){return({currentNodes:r,currentRect:a,previousRect:s})=>{const l=a.x-s.x,u=a.y-s.y,c=a.width-s.width,d=a.height-s.height;e?("left"===o&&r.forEach(e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)}),"left"!==o&&"right"!==o||r.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"!==o&&"bottom"!==o||r.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?r.forEach(e=>{"line"===e.type?e.y1===e.y2?e.x2+=c:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)}):n||i?r.forEach(e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+c)}):r.forEach(e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=u,e.y2+=u+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 i=t.x-n.x,o=t.y-n.y;0===i&&0===o||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=i,e.y-=o):e.transform=`translate(${-i}, ${-o})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x;0===t.y-n.y&&0===i||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 i=t.x-n.x,o=t.y-n.y;0===i&&0===o||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=o,e.y-=i):(e.x-=i,e.y-=o)})},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 i=t.x-n.x,o=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-=o,e.y2-=o):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=i,e.x2-=i);else{const t="x"===e.major.p?i/e.major.size:o/e.major.size,n="y"===e.minor.p?o/e.minor.size:i/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 i=t.x-n.x;0===t.y-n.y&&0===i||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 i=t.x-n.x,o=t.y-n.y;0===i&&0===o||e.forEach(e=>{switch(e.type){case"circle":e.cx-=i,e.cy-=o;break;case"rect":e.x-=i,e.y-=o;break;case"path":e.transform=`translate(${-i}, ${-o})`}})}},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 i=t.x-n.x,o=t.y-n.y;0===i&&0===o||e.forEach(e=>{"image"===e.type?(e.x-=i,e.y-=o):(e.cx-=i,e.cy-=o)})}},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 i=t.x-n.x,o=t.y-n.y,r=t.width-n.width,a=t.height-n.height;let s=-i,l=-o;e.forEach(e=>{switch(e.dock){case"right":i>0&&(s=t.width);break;case"left":r<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":o>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=vl(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=vl(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};const{getInputValue:Sl,extractInfoFromInputValue:xl,resolveValue:Ml}=Ys;var ql={resolveValue:Ml,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.isGroupedByDimension){const i=Sl({refLineLayout:e,layoutService:n});return xl(i,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.mode.K)return 0;const i=Sl({refLineLayout:e,layoutService:n});return xl(i,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const{dimensionValuesInfo:i}=t,{canBeContinuous:o}=n.meta,r=Sl({refLineLayout:e,layoutService:n});return i[r]&&o?i[r].qText:r},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const i=Sl({refLineLayout:e,layoutService:n}),{dimensionRefLineInfo:o}=t;return o[i]}};function Cl({isDimension:e,refLineModel:t={},layoutService:n,colorModel:i,dockService:o,animationsEnabled:r,chart:a,scale:s,axis:l,rtl:u,key:c,mainComponentKey:d,path:m,minimumLayoutMode:h}){const f=e?t.dimensionRefLines:m?t.query.getRefLines(m):t.measureRefLines;if(!f.length)return!1;const p={key:c,type:"ref-line",layout:{minimumLayoutMode:h},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),animations:{enabled:r,trackBy:bl.lines.trackBy,compensateForLayoutChanges:bl.lines.compensateForLayoutChanges}},g=!(!e||"horizontal"!==o.meta.major.orientation||!u),y=!e||n.meta.isContinuous;return f.forEach(r=>{p.lines[l].push((({isDimension:e,refLineLayout:t,refLineModel:n,layoutService:i,colorModel:o,dockService:r,chart:a,scale:s,axis:l,invert:u,component:c,isContinuous:d})=>{const m={dir:l,line:{strokeWidth:t?.style?.lineThickness||2,strokeDasharray:t?.style?.lineType,stroke:o.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||i.meta.isContinuous?(m.scale=s,m.value=t.refLineExpr.value):(m.valueInfo=ql.resolveValueInfo({refLineLayout:t,refLineModel:n,layoutService:i}),m.value=()=>{const e=Ys.getScaledPosition({scale:a.scale(s),value:ql.resolveValue({refLineLayout:t,refLineModel:n,layoutService:i}),valueInfo:m.valueInfo,size:a.component(c)?.rect["horizontal"===r.meta.major.orientation?"width":"height"],align:t.align,invert:u,layoutService:i,isContinuous:d});return Number.isNaN(e)?void 0:e}),m})({isDimension:e,refLineLayout:r,refLineModel:t,layoutService:n,colorModel:i,dockService:o,chart:a,scale:s,axis:l,invert:g,component:d,isContinuous:y}))}),p}function Tl({isDimension:e,refLineModel:t={},layoutService:n,colorModel:i,animationsEnabled:o,dock:r,scale:a,style:s,formatter:l,theme:u,localeInfo:c,rtl:d,key:m,path:h}){const f=e?t.dimensionRefLineLabels:h?t.query.getRefLineLabels(h):t.measureRefLineLabels;if(!f.length)return[];const p=[],g=!e||n.meta.isContinuous,y=f.map(e=>(({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:i,scale:o,theme:r,isContinuous:a})=>{const s=i.resolveUIColor(e.paletteColor||{index:e.color}),{align:l,style:u}=e,{fontSize:c,fontFamily:d,fontStyle:m,fontWeight:h,textDecoration:f}=u||{},p={align:l,text:e.label,fill:e.coloredBackground?r.getContrastingColorTo(s):s,fontSize:c,fontFamily:d,fontStyle:m,fontWeight:h,textDecoration:f,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(p.background={fill:s}),a?(p.scale=o,p.value=e.refLineExpr.value):(p.value=()=>ql.resolveValue({refLineLayout:e,refLineModel:t,layoutService:n}),p.valueText=()=>ql.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:n}),p.valueInfo=()=>ql.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:n})),p})({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:i,scale:a,theme:u,isContinuous:g}));return p.push((({isDimension:e,layoutService:t,animationsEnabled:n,style:i,labels:o,scale:r,formatter:a,dock:s,key:l,rtl:u,theme:c,isContinuous:d,localeInfo:m})=>({key:l,type:"reference-line-labels",renderer:"svg",labels:o,formatter:a,scale:r,layoutService:t,layout:{dock:s,rtl:u},theme:c,isContinuous:d,isDimension:e,localeInfo:m,style:{label:{fontFamily:i.referenceLine.label.name.fontFamily,fontSize:i.referenceLine.label.name.fontSize,fontStyle:i.referenceLine.label.name.fontStyle,fontWeight:i.referenceLine.label.name.fontWeight,textDecoration:i.referenceLine.label.name.textDecoration,padding:{top:2,bottom:2,left:u?2:4,right:u?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===s||"right"===s?10:16},oob:{size:8,fill:i.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:i.referenceLine.outOfBounds.fontFamily,fontSize:i.referenceLine.outOfBounds.fontSize,fill:i.referenceLine.outOfBounds.color,background:{fill:i.referenceLine.outOfBounds.backgroundColor}}}},animations:{enabled:n,trackBy:bl.refLineLabels.trackBy,compensateForLayoutChanges:bl.refLineLabels.compensateForLayoutChanges}}))({isDimension:e,rtl:d,style:s,dock:r,key:m,labels:y,scale:a,formatter:l,layoutService:n,animationsEnabled:o,theme:u,isContinuous:g,localeInfo:c})),p}const wl=(e,t,n)=>{if(!e)return Promise.resolve();let i=bs.generate(t,n);return ne(!0,t,n),i&&i.length?(i=i.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),e.applyPatches(i,!0)):Promise.resolve()},kl=e=>!(!e||e.qHasSoftPatches||e.qExtendsId||!((e.qMeta?.privileges||[]).indexOf("update")>-1));function Nl(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}const Dl={ref:null,refFn:e=>{const t=e.qHyperCubeDef.qMeasures?.findIndex(e=>"colorByExpression"===e.qAttributeExpressions?.[0]?.id);return`qHyperCubeDef.qMeasures.${-1===t?0:t}.qAttributeExpressions.0.qExpression`},change(e){const t=e.qHyperCubeDef?.qMeasures?.findIndex(e=>"colorByExpression"===e.qAttributeExpressions?.[0]?.id),n=$r.getValue(e,`qHyperCubeDef.qMeasures.${-1===t?0:t}.qAttributeExpressions.0`),i=$r.getValue(e,"color");n&&(n.id="colorByExpression",i&&(i.colorExpression=n.qExpression))}};function Ll({color:e,colorModel:t}){if(!e)return;const n=t.resolveUIColor(e);if("none"===n)return"transparent";const i=l(n);return i.setAlpha(e?.alpha>=0?e.alpha:1),i.isInvalid()?void 0:i.getRGBA()}function El({point:e,dimensionValueInfo:t,layoutService:n}){const{dimensionValue:i}=e,o=""===e.measureValue?void 0:+e.measureValue;if(Ds.isNumber(o))return o;const{dimensionCount:r,measureCount:a}=n.meta;if(2===r)return 0;const s=e.measureIndex?+e.measureIndex:0;return Ds.isNumber(s)&&!(s>=a||0===r)&&1===r?t[i]?.dataNode[s+1]?.qNum:void 0}const Ol={index:-1,color:"#595959"};function Al({chart:e,chartModel:t,discreteModel:n,colorService:i,themeService:o,layoutService:r,dockService:a,rtl:s,majorScale:u,minorScale:c,mainComponentKey:d,data:m,key:h}){if(!Array.isArray(m)||0===m.length)return!1;const f={resolveUIColor:i.getMain().getPaletteColor},p=o.getTheme(),g="horizontal"===a.meta.major.orientation,y=!(!g||!s),{canBeContinuous:v,isContinuous:b,isButterfly:S}=r.meta,x=r.getLayout(),M=function({layout:e,colorModel:t}){const n=e?.components?.find(e=>"general"===e.key);if(n?.bgColor?.useColorExpression){const e=l(n?.bgColor?.colorExpression);return e.isInvalid()?void 0:e.getRGBA()}const i=n?.bgColor?.color;return Ll({color:i,colorModel:t})}({layout:x,colorModel:f})??p.getStyle("object","","backgroundColor"),q=Ys.getDimensionValuesInfo({layout:x,canBeContinuous:v,discreteModel:n,layoutService:r}),C=b?m:m.filter(e=>!!q[e.dimensionValue]),T={};C.map(e=>e.dimensionValue).forEach(e=>{q[e]&&(T[e]?(T[e].innerValues=q[e].innerValues,T[e].minOrder=Math.min(T[e].minOrder,q[e].minOrder),T[e].maxOrder=Math.max(T[e].maxOrder,q[e].maxOrder),T[e].isMinOrderOk=T[e].isMinOrderOk||q[e].isMinOrderOk,T[e].isMaxOrderOk=T[e].isMaxOrderOk||q[e].isMaxOrderOk):T[e]={id:q[e].id,dataNode:q[e].dataNode,qText:q[e].qText,innerValues:q[e].innerValues,minOrder:q[e].minOrder,maxOrder:q[e].maxOrder,isMinOrderOk:q[e].isMinOrderOk,isMaxOrderOk:q[e].isMaxOrderOk},T[e].numInnerValues=(T[e].maxOrder||0)-(T[e].minOrder||0)+1)}),C.forEach(e=>{const t=El({point:e,dimensionValueInfo:T,layoutService:r});if(e.validMeasureValue=S&&1===e.measureIndex?-t:t,r?.meta?.isStacked){const t=T[e.dimensionValue]?.dataNode;if(Array.isArray(t)&&void 0!==e.measureIndex){const n=t.slice(0,e.measureIndex+2),i=t[e.measureIndex+1]?.qNum;if("number"==typeof i&&0!==i){const t=Math.sign(i);e.validMeasureValue=n.reduce((e,n)=>{const i=n.qNum;return"number"==typeof i&&Math.sign(i)===t?e+i:e},0)}}}const n=Ll({colorModel:f,color:e.style?.label?.color||Ol}),i=!!e.style?.label?.coloredBackground;e.labelBackgroundColor=i?n:void 0,e.labelColor=i?o.getTheme().getContrastingColorTo(n):n,e.hasBackground=i,e.maxLabelWidth=100});const w={scale:u,fn:({datum:t})=>{const n=e.scale(u),i=t.value.dimensionValue;if(b)return n("string"==typeof i?""===i?void 0:+i:i);if(void 0===T[i])return;return Ys.getScaledPosition({scale:n,value:T[i].id,valueInfo:T[i],size:e.component(d)?.rect[g?"width":"height"],align:"center",invert:y,layoutService:r,isContinuous:b})}},k={scale:c,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:h,type:"point",data:C,settings:{x:g?w:k,y:g?k:w,strokeWidth:({datum:e})=>e.value.style?.outlineWidth??e.value.style?.lineThickness??2,stroke:({datum:e})=>Ll({colorModel:f,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),fill:({datum:e})=>e.value.style?.fill?.color?Ll({colorModel:f,color:e.value.style?.fill}):M,size:({datum:e})=>`${e.value.style?.dataPointSize??12}px`,shape:({datum:e})=>e.value.style?.symbol||"circle"},animations:{enabled:t.query.animationsEnabled,trackBy:e=>e.data.value.cId,compensateForLayoutChanges:bl.points.compensateForLayoutChanges}}}const Il=e=>e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0,Pl=!0,Rl=!1,zl={index:0,color:"none"},Hl={index:-1,color:"#595959"},Bl={index:-1,color:"#595959"},Fl=e=>{!e.dimensionValue?.qValueExpression&&e.dimensionValue?.qStringExpression&&(e.dimensionValue.qValueExpression=e.dimensionValue.qStringExpression,delete e.dimensionValue.qStringExpression)},jl=e=>{e.dimensionValue?.qValueExpression&&!e.dimensionValue?.qStringExpression&&(e.dimensionValue.qStringExpression=e.dimensionValue.qValueExpression,delete e.dimensionValue.qValueExpression)},Vl=e=>{switch(e.type){case"image":break;case"point":delete e.points,delete e.style?.lineType,delete e.showPoints,delete e.style?.lineCurve;break;case"line":delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.dataPointSize,delete e.style?.fill,delete e.style?.symbol,delete e.style?.label;break;default:delete e.points,delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.lineType,delete e.style?.lineThickness,delete e.style?.lineColor,delete e.style?.dataPointSize,delete e.style?.fill}},_l=({translator:e})=>({label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},dimensionNumberValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>Vr.canBeContinuous(n.layout)},dimensionStringValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",component:"string",expression:"optional",defaultValue:"",show:(e,t,n)=>!Vr.canBeContinuous(n.layout)},measureInputType:{type:"number",component:"dropdown",translation:"properties.plugins.measureInputType",show:(e,t,n)=>1===Il(n.layout),convertFunctions:{get:(e,t,n,i)=>void 0===i.measureValue?1:0,set(e,t,n,i,o){0===e?(o.measureValue=0,delete o.measureIndex):(o.measureIndex=0,delete o.measureValue)}},options:[{value:0,translation:e.get("properties.plugins.measureInputType.measureValue")},{value:1,translation:e.get("properties.plugins.measureInputType.measureIndex")}]},measureValue:{ref:"measureValue",translation:"properties.plugins.measureInputType.measureValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,schemaIgnore:!0,show:(e,t,n)=>void 0!==e.measureValue||2===Il(n.layout)},measureIndex:{ref:"measureIndex",translation:"properties.plugins.measureInputType.measureIndex",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>void 0===e.measureValue&&1===Il(n.layout),invalid:(e,t,n)=>{return e.measureIndex<0||e.measureIndex>=(i=n.layout,i?.qHyperCube?.qMeasureInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0);var i}}}),Ul=e=>({symbol:{type:"string",component:"dropdown",ref:"style.symbol",translation:"Object.GridChart.Symbol",options:[{value:"circle",translation:"Object.GridChart.Symbol.Circle"},{value:"cross",translation:"Object.GridChart.Symbol.Cross"},{value:"diamond",translation:"Object.GridChart.Symbol.Diamond"},{value:"saltire",translation:"Object.GridChart.Symbol.Saltire"},{value:"square",translation:"Object.GridChart.Symbol.Square"},{value:"star",translation:"Object.GridChart.Symbol.Star"},{value:"triangle",translation:"Object.GridChart.Symbol.Triangle"}]},labelPlacement:{type:"string",component:"dropdown",ref:"label.placement",translation:"geo.properties.labelPosition",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"top",translation:"geo.properties.labelPosition.above"},{value:"bottom",translation:"geo.properties.labelPosition.below"}]},fillColor:{ref:"style.fill",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:zl},lineColor:{ref:"style.lineColor",translation:"LayerStyleEditor.style.strokeColor",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:Hl},labelColor:{ref:"style.label.color",translation:"properties.plugins.label.color",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:Bl},colorBackground:{ref:"style.label.coloredBackground",translation:"properties.referenceLines.coloredBackground",type:"boolean",defaultValue:!1,show:!0},outlineWidth:{component:"slider",type:"number",expression:"optional",ref:"style.outlineWidth",translation:"LayerStyleEditor.style.strokeWidth",show:!0,defaultValue:2,min:1,max:6,step:1},dataPointSize:{component:"slider",type:"number",expression:"optional",ref:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:e?12:10,min:3,max:30,step:1}}),$l=({translator:e,pluginOptions:t,supportNewStyles:n=!1})=>{const i={type:"array",ref:"plugins",filter:e=>e.filter(e=>["point","line"].includes(e.type)),translation:"properties.shapes",show:e=>(e?.qHyperCubeDef?.qDimensions||[]).length>0,itemTitleRef:e=>t.filter(t=>t.value===e.type)[0].translation+(e.label?.value?`: ${e.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,dialog:{ref:"type",options:t},add(e,t){void 0===t.plugins&&(t.plugins=[]),Vl(e)},addTranslation:"properties.shapes.addShape",globalChange:(e,t,n)=>{e.plugins&&(e.plugins.forEach(Vl),Vr.canBeContinuous(n.layout)?e.plugins.forEach(e=>{switch(e.type){case"point":Fl(e);break;case"line":t=e,t.points?.forEach(Fl)}var t}):e.plugins.forEach(e=>{switch(e.type){case"point":jl(e);break;case"line":t=e,t.points?.forEach(jl)}var t}))},items:{point:{component:"items",show:e=>"point"===e.type,items:{dataSection:{component:"items",items:_l({translator:e})},styleSection:{component:"items",items:Ul(n)}}},line:{type:"items",show:e=>"line"===e.type,items:{dataSection:{component:"items",items:{label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},points:{type:"array",ref:"points",titleTranslation:"properties.plugins.Points",itemTitleRef:(t,n)=>e.get("properties.plugins.Points.Point",n+1)+(t.label?.value?`: ${t.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,addTranslation:"properties.plugins.Points.addPoint",items:{dataSection:{component:"items",items:_l({translator:e})},styleSection:{component:"items",items:Ul(n),show:(e,t,n)=>{const i=((e,t)=>{if(!t)return null;for(let n=0;n<t.length;n+=1)if("line"===t[n].type&&t[n].points.includes(e))return t[n];return null})(e,n.properties.plugins);return i?.showPoints}}}}}},styleSection:{component:"items",items:{lineColor:{ref:"style.lineColor",translation:"Object.Table.Representation.MiniChart.Colors.Line",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:Hl},lineThickness:{component:"slider",type:"number",expression:"optional",ref:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:n?3:2,min:1,max:6,step:1},lineType:{component:"dropdown",type:"string",expression:"optional",ref:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"",options:[{value:"",translation:"LayerStyleEditor.style.solid"},{value:"8 4",translation:"LayerStyleEditor.style.dashed"}],convertFunctions:{get(e,t){const n=e(t.type);return void 0===n||""===n?"":"8 4"}}},lineCurve:{translation:"LayerStyleEditor.style.lineCurve",type:"string",ref:"style.lineCurve",component:"dropdown",defaultValue:n?"monotone":"linear",expression:"optional",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]}}},showPoints:{ref:"showPoints",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1}}}}};return i};var Wl=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,i=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=i.length):(n=arguments[1],t=arguments[2]),t&&i?(i.length>n&&(i=i.substr(0,n)),new e(i,t)):null}},Kl=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,i){let o,r;if(t.length===n)return r=this._value,this.setValue(i),r;const a=t.charAt(n);return this._nextMap?(o=this._nextMap[a],o||(o=new e,this._nextMap[a]=o)):(this._nextMap={},o=new e,this._nextMap[a]=o),o.put(t,n+1,i)}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 Wl.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return Wl.newInstanceIfNeeded(e,t,this._value);const i=n.getLongestMatch(e,t+1);return i||Wl.newInstanceIfNeeded(e,t,this._value)}},Gl=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 Kl);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 Gl;let i,o,r;for(i 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[i]&&e.hasOwnProperty(i)&&(t[e[i]]=i);for(o in t)"function"!=typeof t[o]&&t.hasOwnProperty(o)&&(r=t[o].toLowerCase().substr(1),n.put(r,String.fromCharCode(o)))})(),"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);var Yl={ATTRIBUTE:{FIRST_DIMENSION_DIFF:"firstDimensionDiff"},UNIT_MULTIPLIER:1,UNIT:{AUTO:"auto",SECONDS:"seconds",MINUTES:"minutes",HOURS:"hours",DAYS:"days",WEEKS:"weeks",MONTHS:"months",YEARS:"years",NUMBER:"number",NONE:"none"}};const Xl="cao.fieldPicker.tab.period",Jl={TITLE:"properties.forecast.stepSize.label",AUTO:"properties.axis.displaymode.auto",SECONDS:"properties.forecast.stepUnit.seconds",MINUTES:"properties.forecast.stepUnit.minutes",HOURS:"properties.forecast.stepUnit.hours",DAYS:"properties.forecast.stepUnit.days",WEEKS:"properties.forecast.stepUnit.weeks",MONTHS:"properties.forecast.stepUnit.months",YEARS:"properties.forecast.stepUnit.years",NUMBER:"properties.forecast.stepUnit.number",NONE:"properties.scrollbar.none"},Zl=(e,t,n)=>Yr.continuous({layout:n.layout,properties:n.properties}),Ql=(e,t,n)=>{const i=e?.qHyperCubeDef?.qDimensions?.[0]?.qDef?.continuous?.period;return Zl(0,0,n)&&i&&"none"!==i},{FIRST_DIMENSION_DIFF:eu}=Yl.ATTRIBUTE,tu=(e,t,n)=>{const i=e?.qHyperCubeDef?.qDimensions?.[0];if(i)if(Yr.continuous({layout:n.layout,properties:n.properties})&&"auto"===i.qDef?.continuous?.period){const e=i.qAttributeExpressions||[],t=e.find(e=>e.id===eu),n="Min(Aggr(If(RowNo() > 1, [$(=GetObjectField(0))] - Above([$(=GetObjectField(0))]), Null()),([$(=GetObjectField(0))], (Numeric, Ascending))))";t?(t.qExpression="",t.qLabelExpression=n,i.qAttribute=!0):(e.push({id:eu,qExpression:"",qLabelExpression:n,qAttribute:!0}),i.qAttributeExpressions=e)}else{const e=i.qAttributeExpressions||[],t=e.findIndex(e=>e.id===eu);-1!==t&&(e.splice(t,1),i.qAttributeExpressions=e)}},{UNIT:nu,UNIT_MULTIPLIER:iu}=Yl;const ou={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var ru={OPTIONS:ou,DEFAULT:ou.MINI_CHART};function au({layoutService:e,discrete:t}){return({h:n,rect:i,orientation:o,minThumbSize:r})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===o,u=i[l?"width":"height"];let c=a.qArea.qTop/s*u,d=a.qArea.qHeight/s*u;if(d<r){const e=(r-d)/2;c=c-e+(Math.max(0,0-(c-e))-Math.max(0,c+d+e-u)),d=r}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:c,width:d}:{top:c,left:0,height:d}}})}}function su({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),i=t.get("continuousMin"),o=t.get("continuousMax");return[(n.min-i)/(o-i),(n.max-i)/(o-i)]}(t,n):function(e){return e.get("viewRange")}(t)}const lu=e=>({miniChart:e===ru.OPTIONS.MINI_CHART.value,bar:e===ru.OPTIONS.BAR.value,none:e===ru.OPTIONS.NONE.value});function uu({layoutService:e,override:t}){const n=(({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return lu(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return lu(ru.DEFAULT.value);const i=e.getLayoutValue("dimensionAxis.continuousAuto"),o=e.getLayoutValue("preferContinuousAxis");return lu(!n&&(i||!i&&o)?ru.OPTIONS.NONE.value:ru.OPTIONS.MINI_CHART.value)})({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===ru.OPTIONS.MINI_CHART.value,n.bar=t.value===ru.OPTIONS.BAR.value,n.none=t.value===ru.OPTIONS.NONE.value),n}function cu({layoutService:e,dockService:t,discrete:n,continuousDataModel:i,viewState:o,viewCache:r,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=uu({layoutService:e,override:l});if(d.none)return!1;const{orientation:m}=t.meta.major,h={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===m?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?i.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:m,rtl:s,isContinuous:e.meta.isContinuous,range:()=>su({layoutService:e,viewState:o,viewCache:r})}};d.bar&&(h.settings.style="slim",h.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(h.settings.size.thumb={min:4}));const f=a.getStyles();return f.color&&(h.style={standard:{thumb:{"border-color":f.color,opacity:.4},before:{background:f.color,opacity:.1},after:{background:f.color,opacity:.1}}}),e.meta.isDiscrete&&u&&(h.settings.injections=()=>[au({layoutService:e,discrete:n})]),h}function du({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:r,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),m="horizontal"===r.meta.major.orientation,h=m?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,f=m?d.rect.computedInner.width:d.rect.computedInner.height,p=m&&a?f-h:h,g=Math.max(0,Math.min(p/f,1)),[y,v]=su({layoutService:o,viewState:n,viewCache:i}),b=g<y,S=g>v,x=!b&&!S;return{pixel:p,relative:g,thumb:x?p-y*f:0,beforeThumb:b,afterThumb:S,onThumb:x}}}function mu({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:r}){return()=>{const a=t.component(e),{orientation:s}=r.meta.major,{width:l,height:u}=a.rect.computedInner,c="horizontal"===s?l:u,[d,m]=su({layoutService:o,viewState:n,viewCache:i});return{size:c,thumbSize:(m-d)*c}}}function hu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l}){const u=du({componentKey:e,chart:t,viewState:i,viewCache:o,layoutService:r,dockService:a,rtl:l}),c=mu({componentKey:e,chart:t,viewState:i,viewCache:o,layoutService:r,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(i,o)=>!o||!!n.scroll.enabled()&&t.componentsFromPoint({x:o.center.x,y:o.center.y}).some(t=>t.key===e)},events:{scrollbarTap(n){n.preventDefault();const a=u(n);if(r.meta.isContinuous){const e=i.get("zoom"),t=e.max-e.min,n=o.get("continuousMin"),r=o.get("continuousMax"),s=n+(r-n)*a.relative;i.set("zoom",{min:Math.min(s-t/2,r-t),max:Math.max(s+t/2,n+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}const fu="data-scrollbar-handle";function pu({e:e}){return(e.srcEvent||e).srcElement.getAttribute(fu)||""}const gu="scrollbarResize";function yu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,rtl:s}){const l=du({componentKey:e,chart:t,viewState:i,viewCache:o,layoutService:r,dockService:a,rtl:s});return{type:"Pan",key:`event:${gu}`,options:{event:gu,threshold:0,enable(e,t){return!(!r.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[gu]=this[gu]||{},(e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)})(t)&&pu({e:t})&&(this[gu].panningEvent=t.srcEvent),!!this[gu].panningEvent))}},events:{[`${gu}start`](n){n.preventDefault(),this[gu]=this[gu]||{},this[gu].panningEvent&&t.component(e).emit("dragStart",this[gu].panningEvent)},[`${gu}move`](n){if(n.preventDefault(),this[gu]=this[gu]||{},!this[gu].panningEvent)return;const r=i.get("zoom"),a=o.get("continuousMin"),s=o.get("continuousMax"),u=o.get("minimiumZoomSpan"),c=(s-a)*l(n).relative+a,d=pu({e:this[gu].panningEvent});let m="start"===d?Math.min(c,r.max):r.min,h="end"===d?Math.max(c,r.min):r.max;m===h&&(m-="start"===d?u:0,h+="end"===d?u:0),i.set("zoom",{min:m,max:h}),t.component(e).emit("render")},[`${gu}end`](n){n.preventDefault(),this[gu]=this[gu]||{},delete this[gu].panningEvent,t.component(e).emit("dragEnd")},[`${gu}cancel`](n){n.preventDefault(),this[gu]=this[gu]||{},delete this[gu].panningEvent,t.component(e).emit("dragEnd")}}}}const vu="scrollbarPan";function bu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l}){const u=du({componentKey:e,chart:t,viewState:i,viewCache:o,layoutService:r,dockService:a,rtl:l}),c=mu({componentKey:e,chart:t,viewState:i,viewCache:o,layoutService:r,dockService:a});return{type:"Pan",key:`event:${vu}`,options:{event:vu,threshold:0,enable(i,o){return this[vu]=this[vu]||{},!(o&&!this[vu].isPanning)||!!n.scroll.enabled()&&((!o||o.target===t.element)&&t.componentsFromPoint({x:o.center.x,y:o.center.y}).some(t=>t.key===e))}},events:{[`${vu}start`](n){n.preventDefault();const a=u(n);if(this[vu]=this[vu]||{},this[vu].isPanning=!0,t.component(e).emit("lockState"),r.meta.isContinuous){const e=i.get("zoom"),t=e.max-e.min,n=o.get("continuousMin"),r=o.get("continuousMax"),s=n+(r-n)*a.relative;s<e.min?i.set("zoom",{min:Math.min(s,r-t),max:Math.max(s+t,n+t)}):s>e.max&&i.set("zoom",{min:Math.min(s-t,r-t),max:Math.max(s,n+t)}),this[vu].relative=a.relative,this[vu].zoom=i.get("zoom"),this[vu].zoom.span=this[vu].zoom.max-this[vu].zoom.min,this[vu].zoom.fullSpan=r-n}else if(a.onThumb)this[vu].offset=a.thumb;else{const e=c();this[vu].offset=a.beforeThumb?0:e.thumbSize}},[`${vu}move`](n){n.preventDefault();const a=u(n);if(this[vu]=this[vu]||{},r.meta.isContinuous){const e=a.relative-this[vu].relative,{fullSpan:t,span:n,min:r,max:s}=this[vu].zoom,l=o.get("continuousMin"),u=o.get("continuousMax");i.set("zoom",{min:Math.min(r+e*t,u-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[vu].offset||0),t=c(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},[`${vu}end`](n){n.preventDefault(),this[vu]=this[vu]||{},this[vu].isPanning=!1,t.component(e).emit("unlockState")},[`${vu}cancel`](n){n.preventDefault(),this[vu]=this[vu]||{},this[vu].isPanning=!1,t.component(e).emit("unlockState")}}}}function Su({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l}){return[hu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l}),yu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,rtl:l}),bu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l})]}function xu({componentKey:e,chart:t,actions:n,layoutService:i}){const o=(o,r)=>{if(!i.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(o,r)};return{type:"native",events:{mousemove:e=>o("hover",e),mouseleave:()=>o("leave")}}}function Mu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l}){return{gestures:[...Su({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l})],native:xu({componentKey:e,chart:t,actions:n,layoutService:r})}}const qu={background:"rgba(0, 0, 0, 0.1)"},Cu={top:-1,bottom:-1,width:6},Tu={width:2,background:"#595959"};var wu={before:qu,after:qu,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:Cu,endHandle:Cu,startHandleBorder:Tu,endHandleBorder:Tu};const ku={background:"rgba(0, 0, 0, 0.1)"},Nu={top:-1,bottom:-1,width:6},Du={width:2,background:"#595959"};var Lu={before:ku,after:ku,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:Nu,endHandle:Nu,startHandleBorder:Du,endHandleBorder:Du};const Eu={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},Ou={pointerEvents:"initial"},Au={pointerEvents:"none"};const Iu="ew-resize",Pu="default";function Ru(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,i=n?e.computedInner.width:e.computedInner.height,o=t.range(),r=n&&t.rtl;return{size:i,start:(r?1-o[1]:o[0])*i,end:(r?1-o[0]:o[1])*i}}function zu(){const e=this.state.hover.start||this.state.hover.end||this.state.drag.start||this.state.drag.end;this.renderer.element().ownerDocument.body.style.cursor=e?Iu:Pu}function Hu(e,t,n){const{min:i}=this.settings.settings.size.thumb;if(n-t<i){const o=(i-(n-t))/2,r=Math.max(0,0-(t-o))-Math.max(0,n+o-e);return{size:e,start:t-o+r,end:n+o+r}}return{size:e,start:t,end:n}}function Bu(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function Fu(){const{size:e,start:t,end:n}=Ru.call(this);this.renderer.render(this.elements(this.h,Hu.call(this,e,t,n)))}function ju(){const{state:e,settings:t,style:n}=this,i=t.settings.style;return e.style[i]||(e.style[i]=function({id:e,style:t}){const n="slim"===e?Lu:wu;return{container:{...Eu},before:{...Eu,...n.before,...t.before},after:{...Eu,...n.after,...t.after},thumb:{...Eu,...n.thumb,...t.thumb},startHandle:{...Eu,...Ou,...n.startHandle},endHandle:{...Eu,...Ou,...n.endHandle},startHandleBorder:{...Eu,...Au,...n.startHandleBorder},endHandleBorder:{...Eu,...Au,...n.endHandleBorder}}}({id:t.settings.style,style:n[i]})),e.style[i]}var Vu={require:["renderer"],defaultSettings:{settings:{style:"standard",size:{area:{min:30,max:40,ratio:1/8},thumb:{min:4}},orientation:"horizontal",rtl:!1,isContinuous:!1,range:()=>[0,1],injections:()=>[]},style:{standard:{before:{},thumb:{},after:{}},slim:{before:{},thumb:{},after:{}}}},renderer:"dom",on:{render(){Fu.call(this)},lockState(){this.state.locked=!0},unlockState(){this.state.locked=!1},hover(e){if(this.state.locked||this.state.drag.start||this.state.drag.end||!Bu.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=pu({e:e});t&&(this.state.hover[t]=!0),zu.call(this),Fu.call(this)},leave(){this.state.locked||(this.state.hover.reset(),zu.call(this),Fu.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=pu({e:e});t&&(this.state.drag[t]=!0),zu.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),zu.call(this),Fu.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:i}=this.settings.settings.size.area,o="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[o]*i))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:i}=Ru.call(this);return this.elements(e,Hu.call(this,t,n,i))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:i}){const{settings:o}=this.settings,r=o.injections().map(t=>t({h:e,rect:this.rect,orientation:o.orientation,minThumbSize:o.size.thumb.min}));return function({h:e,size:t,start:n,end:i,properties:o,startHandleActive:r,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[o.end]:t-n},m={[o.start]:i},h={left:-3},f={left:1},p={right:-3,left:"auto"},g={left:3},y=e("div",{style:{...s.before,...u?m:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...u?d:m},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...u?p:h},class:"scrollbar--start-handle",[fu]:"start"},r?e("div",{style:{...s.startHandleBorder,...u?g:f}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...u?h:p},class:"scrollbar--end-handle",[fu]:"end"},a?e("div",{style:{...s.endHandleBorder,...u?f:g}}):void 0);b.push(n)}const S=e("div",{style:{...s.thumb,[o.start]:n,[o.end]:t-i},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,S,v,...c])}({h:e,size:t,start:n,end:i,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:ju.call(this),continuous:o.isContinuous,invert:"horizontal"===o.orientation&&o.rtl,injections:r})}};const _u={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:i,rendHeight:o,flipXY:r,symbol:a}){let s="x",l="y",u=i,c=o,d=t<.5?90:-90;return r&&(s="y",l="x",u=o,c=i,d=t<.5?180:0),a(ne({},e,{[s]:n*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function Uu({i:e,width:t,height:n,resolved:i,keys:o,flipXY:r,calcKey:a="box"}){let s,l=null,u=null;void 0!==i.major.settings.binStart?(l=i.major.items[e].binStart,u=i.major.items[e].binEnd,s=i.major.settings.binStart.scale):(s=i.major.settings.major.scale,l=s?i.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=ne({},{major:l,majorEnd:u},i.minor.items[e]);o.forEach(t=>{d[t]=i[t].items[e]});const m=r?n:t,h=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:i,maxMajorWidth:o}){const r=e>=0?1:-1;let a=Math.min(r*e*t,Number.isNaN(Number(i))?o:i/o);return a=Number.isNaN(Number(n))?a:Math.max(n/o,a),a*r}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:m}),f=(c-h)/2,p=f+d.major+h/2;return{item:d,boxCenter:p,boxWidth:h,boxPadding:f,rendWidth:t,rendHeight:n}}function $u({keys:e,data:t,defaultSettings:n,style:i,settings:o,width:r,height:a,resolver:s}){const l=ne(!0,{},n||{},i||{}),u={major:"horizontal"===o.orientation?a:r,minor:"horizontal"===o.orientation?r:a},c=o.major;let d;d="object"==typeof c&&"object"==typeof c.ref&&void 0!==c.ref.start&&void 0!==c.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:ne(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof c&&void 0!==c.binStart&&void 0!==c.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:ne(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):s.resolve({data:t,scaled:u,defaults:{major:.5},settings:{major:o.major}});const m=o.minor||{};let h;const f={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:ne(!0,{},{start:{scale:m.scale,ref:"start"},end:{scale:m.scale,ref:"end"},min:{scale:m.scale,ref:"min"},max:{scale:m.scale,ref:"max"},med:{scale:m.scale,ref:"med"}},m)})};for(let n=0,i=e.length;n<i;n++)h=e[n],f[h]=s.resolve({data:t,defaults:l[h],settings:o[h],scaled:u});return f}const Wu=["oob"];const Ku={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,i="horizontal"===this.settings.settings.orientation,{data:o,style:r,resolver:a,symbol:s}=this,l=$u({keys:Wu,data:o,defaultSettings:{oob:_u.getDefaultSettings()},style:r,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:u,items:c}=l,d=function({width:e,height:t,flipXY:n,resolved:i,keys:o,symbol:r,dockValue:a,_calcItemRenderingOpts:s=Uu}){const l=[],{items:u}=i.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:m,rendWidth:h,rendHeight:f}=s({i:c,width:e,height:t,resolved:i,keys:o,flipXY:n,calcKey:"oob"}),p=u[c].data,g=[];if(d.oob.show){g.push(_u.createOob({oob:d.oob,dockValue:a,boxCenter:m,rendWidth:h,rendHeight:f,flipXY:n,symbol:r}));const e={type:"container",data:p,collider:{type:"bounds"},children:g};l.push(e)}}return l}({width:e,height:t,flipXY:i,resolved:l,keys:Wu,symbol:s,dockValue:n});return d}},Gu={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},Yu=["hat"];function Xu(e,t=!0){let n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?`M${i.x} ${i.y}`:`L${i.x} ${i.y}`,n+=" "}return t&&(n+="Z"),n}function Ju({item:e,boxWidth:t,boxPadding:n,rendWidth:i,rendHeight:o,flipXY:r}){let a="x",s="y",l=i,u=o,c=e.hat.alignment||0;r&&(a="y",s="x",l=o,u=i,c=1-c);const d=(n+e.major)*l;let m=[{[a]:d,[s]:0+u},{[a]:d+t*c*l,[s]:8},{[a]:d+t*l,[s]:0+u},{[a]:d+t*l,[s]:0+u+10},{[a]:d,[s]:0+u+10}];const h=ne({},e.hat,{type:"path",d:Xu(m)});m=[{[a]:d,[s]:0},{[a]:d+t*(1-c)*l,[s]:0+u-8},{[a]:d+t*l,[s]:0},{[a]:d+t*l,[s]:-10},{[a]:d,[s]:-10}];return[h,ne({},e.hat,{type:"path",d:Xu(m)})]}const Zu={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:r}=this,a=$u({keys:Yu,data:i,defaultSettings:Gu,style:o,settings:this.settings.settings,width:e,height:t,resolver:r}),{settings:s,items:l}=a,u=function({width:e,height:t,flipXY:n,resolved:i,keys:o,_calcItemRenderingOpts:r=Uu}){const a=[],{items:s}=i.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:h}=r({i:l,width:e,height:t,resolved:i,keys:o,flipXY:n,calcKey:"hat"}),f=s[l].data,p=[];u.hat.show&&p.push(...Ju({item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:h,flipXY:n}));const g={type:"container",data:f,collider:{type:"bounds"},children:p};a.push(g)}return a}({width:e,height:t,flipXY:n,resolved:a,keys:Yu});return u}};var Qu={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};function ec(e,t,n,i){const o=function(t){const n=String(t);return e(n)};return o.ticks=()=>t.map(t=>{const r=o([t.data.value,i?n-1:0]),a=o([t.data.value,i?0:n-1])+e.bandwidth();return{position:(r+a)/2,label:t.label,data:t.data,start:r,end:a}}),o.bandwidth=()=>e.bandwidth(),o.data=()=>e.data(),o.domain=()=>e.domain(),o.pxScale=function(i){const o=e.pxScale(i);return o===e?this:ec(o,t,n)},o}function tc(e){const t=e.scale("band");e.scale("group-by-measure",function(e={},n={},i={}){const o=t(e,n,i),r=o.domain(),a=o.ticks(),s=[],l=e.measureCount;return r.forEach((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)}),s.splice(-1),o.domain(s),ec(o,a,l,e.invert)})}const nc=()=>({version:"2.1.0",barGrouping:{grouping:"grouped"},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:[],dataPoint:{showLabels:!1,showSegmentLabels:!1,showTotalLabels:!0},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"vertical",preferContinuousAxis:!0,qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}}),ic={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 oc(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const rc={getImageSize(e,t){let n;function i(){n&&(clearTimeout(n),n=null)}function o(e){const t=e;t.onload=null,t.onerror=null,i()}const r={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,u=r[t]*(n>l?1:n/l),c=r[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},o(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},i()):(e={height:u,width:c},i()),a(e)},s.onerror=()=>{o(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{o(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function ac(e,t,n){let i=e.ref.qStaticContentUrl.qUrl;const o=function(e){let t,n,i,o,r,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://",i=t.host||"localhost",o=t.port?`:${t.port}`:"",r=t.prefix?t.prefix:"/","/"!==r[r.length-1]&&(r=`${r}/`),n+i+o+r}return""}(n);o&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(i,o),i=i.replace(/"/g,'\\"'),i=i.replace(/'/g,"\\'"),i=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(i,o));const{height:r,width:a,imageError:s}=await rc.getImageSize(i,t);return{src:i,size:t,height:r,width:a,imageError:s}}async function sc(e,t,n,i){const{app:o,flags:r}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",u=s.type||"media";let c=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){c=e;break}const d=i.data?.customTooltipAttrExps?.value||[];let m;if(-1!==c&&d[c]&&(m=d[c]),"media"===u&&s.ref?.qStaticContentUrl?.qUrl)return ac(s,l,o);if("url"===u)return async function(e,t,n,i,o){let r,a=n.ref;if(o&&o.label&&(a=o.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&oc(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:o,imageError:s}=await rc.getImageSize(t,i);r={src:t,size:i,height:n,width:o,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await rc.getImageSize(a,i);r={src:a,size:i,height:e,width:t,imageError:n}}return r}(o,r,s,l,m);if(r.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===u&&m&&m.label){return async function(e,t,n,i){let o;const r=i.label,a=`qmem://${t.qFallbackTitle}/${r}`;if(oc(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:i,width:r,imageError:a}=await rc.getImageSize(e,n);o={src:e,size:n,height:i,width:r,imageError:a}}}catch(e){}return o}(o,n[c],l,m)}return[]}const lc={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:i}){const o=t,r=[];for(let t=0;t<o.length;t++)r.push(sc(e,i,n,o[t]));const a=await Promise.all(r);for(let e=0;e<o.length;e++)o[e].data.customTooltipImages=[a[e]];return o},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},uc={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:i}){let o=t;return o=await lc.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:i}),o},checkIfPromisesExist:({customTooltipModel:e})=>lc.checkIfPromisesExist({customTooltipModel:e})};const cc=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,i=e?.qHyperCubeDef?.qMeasures,o=e?.qHyperCubeDef?.qInterColumnSortOrder,r=t;return{qInfo:{qType:ic.CHART.CHART_PARENT_TYPE,qId:ic.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:i,qInterColumnSortOrder:o,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:r}},dc=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:ic.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const mc={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",i=ic.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:i,height:i,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:ic.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":i}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:i,customTooltipModel:o,rtl:r})=>{const a=o,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await mc.hide({app:e,customTooltipModel:o});try{await async function({app:e,properties:t,customTooltipModel:n}){const i=n,o=ic.CHART.STATE,r=t.qStateName;i.miniChartToken.alternateState||(i.miniChartToken.alternateState=o,await e.addSessionAlternateState(o,r),i.miniChartToken.alternateState=o)}({app:e,properties:t,customTooltipModel:o});const s=await async function({app:e,properties:t,customTooltipModel:n}){const i=n;i.miniChartToken.sessionObj?.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=ic.CHART.STATE,r=cc(t,o),a=await e.createSessionObject(r),s=dc(t);if(a.id!==ic.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);i.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(i.miniChartToken.sessionObj&&i.miniChartToken.sessionObj.id===a.id)return i.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:o});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!==i?i:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===i&&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],i=void 0!==e.value?[e.value]:[];i.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),i,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(ic.CHART.CONTAINER_ID),u={direction:r?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await o.embed.render({element:l,model:a.miniChartToken.model,options:u,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch(t){await mc.hide({app:e,customTooltipModel:o})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(mc.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(ic.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,i=ic.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(i)}({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 hc(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function fc(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:i}=ic.CUSTOM,o={};return o[e]=!0,o[t]=!0,o[n]=!0,o[i]=!0,o}function pc(e){const t=fc();return e.filter(e=>t[e.id])}const gc={getNodes(e,t){const n=function(e,t){let n=0,i=0;e.center?(n+=e.center.x,i+=e.center.y):(n+=e.clientX,i+=e.clientY);const o=t.element.getBoundingClientRect();return{cx:n-o.left,cy:i-o.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,i=[];const o={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const r=t.data?.selectionDimension??t.data;if(!r||t.data?.customTooltipAttrExps||o[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],i.push(e)}}else{n||(n=[],Object.keys(o).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&o[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===r.value&&t.label===r.label});t.length>0&&(i=i.concat(t[0]))}}),i},displayTooltip(e,t,{nodes:n,opts:i={},customTooltipModel:o,extractedNodes:r=[],hide:a}){if(o&&!a){const{layout:a,chart:s}=o,{attrExps:l}=gc.getAttrExprData(a);r.length||n.length?uc.handlePromises({customTooltipModel:o,nodes:gc.getDataNodes(s,r.length>0?r:n),attrExps:l,opts:i}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else o?.miniChartToken?.alternateState&&mc.hide({app:i.app,customTooltipModel:o}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>uc.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,i=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[i]||(n[i]=[]),n[i]},getAttrExprData(e){let t=[],n="";const i=e.qHyperCube?.qDimensionInfo||[];if(i.length>0){const o=i.length-1;t=e.qHyperCube?.qDimensionInfo?.[o]?.qAttrExprInfo||[],n=`qDimensionInfo/${o}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[ic.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let i=n.qLayoutExclude;i||(n.qLayoutExclude={quarantine:{}},i=n.qLayoutExclude),i.quarantine||(i.quarantine={}),i.quarantine[ic.CUSTOM.QUARANTINE]=[],e.forEach(e=>{i.quarantine[ic.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=i}(pc(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[ic.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[ic.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=hc(e);if(!n)return;const i=void 0!==t?t:n.length-1;if(!n[i])return;const o=this.getAttrExps(e,n[i]);if(0===pc(o).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...o,...t],r=e;r.qHyperCubeDef?r.qHyperCubeDef.qDimensions[i].qAttributeExpressions=n:r.qHyperCube.qDimensionInfo[i].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let i=[];const o=hc(e)||[];[...o,t].forEach(e=>{const t=pc(e.qAttributeExpressions||[]);t.length>0&&(i=t)});const r=fc(),a=o.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!r[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(i));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:ua.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=ua.detectTextDirection(e.src),i=[],o={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){i.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;i.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),o.style["text-align"]="center",o.style["white-space"]="nowrap"}else o.style["background-size"]="contain",o.style["background-repeat"]="no-repeat",o.style["background-position"]="center",o.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",o,i),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function yc({layout:e,app:t,picasso:n,model:i,chart:o,translator:r,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:i,chart:o,translator:r,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:gc,miniChartToken:{},embed:s}}function vc(e,t,n,i){const o=t.qHyperCube?.[n]?.[i]?.qAttrExprInfo||[],r=[],a=e.qSubNodes&&e.qSubNodes[i]?e.qSubNodes[i].qAttrExps:e.qAttrExps;return a?(o.forEach((e,t)=>{const o=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===o?"NaN":function(e,t){let n;switch(e.id){case ic.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case ic.CUSTOM.TITLE:case ic.CUSTOM.DESCRIPTION:case ic.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,o);r.push({source:{key:"qHyperCube",field:`${n}/${i}/qAttrExprInfo/${t}`},label:s,value:"value"})}),r):r}const bc={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,i="qDimensionInfo";return{field:`${i}/${n}`,value:t=>vc(t,e,i,n)}}};const Sc={getCustomAttrExps(e,t,n){const i={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},o=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(o))return i;return function(e,t,n,i){const o={[ic.CUSTOM.TITLE]:!0,[ic.CUSTOM.DESCRIPTION]:!0},{attrExps:r,fieldPath:a}=gc.getAttrExprData(e);return 0===t.length||0===r.length||""===a||r.forEach((e,r)=>{const s=t[r];if(e.id===ic.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,o="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${r}`).formatter()(s.value);i.customTooltipAttrExpsArr.push({label:t,value:o})}else if(o[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&i.customTooltipInfoAttrExpsArr.push({...e.id===ic.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),i}(n,o.map(t=>ca.getMeasure(e,t)),e,i)}};function xc({nodes:e,layout:t,dataset:n}){const i=function(e,t,n){const i=[];return e.forEach(e=>{i.push(Sc.getCustomAttrExps(n,e,t))}),i}(e,t,n);return i.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function Mc(e){const t=ic.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:i,qLabelExpression:o,cId:r}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:i,qLabelExpression:o,cId:r}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:i,qLabelExpression:o,cId:r}}function qc(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}const Cc={migrateProperties(e){const t=ne(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let i=qc(t);return i=function(e,t){return t.concat(e.map(e=>Mc(e)))}(n,i),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(i,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,i=function(e,t,n){let i=e.length;const o=[];return t.forEach(e=>{const t=Mc(e),r=JSON.stringify(t);o.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${i}`,qOp:"add",qValue:r}),i++}),o.push({qPath:"/tooltip/data",qOp:"remove"}),o}(qc(e),t,n);return i},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){const n=new Promise(n=>{const i=t.qHyperCube?.qDimensionInfo||[],o=t.tooltip?.data?.qHyperCube||{},r=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(o,i)&&e.getEffectiveProperties().then(t=>{if(r){const i=this.migrateProperties(t);e.setProperties(i).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const i=this.getPatches(t);e.applyPatches(i,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)});return n}};var Tc={attrExpr:Cc};const{CUSTOM:wc}=ic;function kc({flags:e,layout:t,app:n,model:i,picasso:o,chart:r,translator:s,localeInfo:l,embed:u,options:c}){const d={properties:void 0},m=yc({layout:t,app:n,model:i,picasso:o,chart:r,translator:s,localeInfo:l,embed:u}),h="rtl"===c.direction,f=()=>{const e=!!d.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{d.properties=e},isEnabled:()=>f(),hideBasic:()=>f()&&a(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const i=xc({dataset:e,nodes:n,layout:t});return{title:i.customTooltipInfoAttrExpsArr.find(e=>e.id===wc.TITLE)?.title,description:i.customTooltipInfoAttrExpsArr.find(e=>e.id===wc.DESCRIPTION)?.value,measures:i.customTooltipAttrExpsArr}},hasImages:()=>gc.checkIfPromisesExist({customTooltipModel:m}),createImageRow:({value:e,h:t})=>gc.getImageRow(e,{h:t,rtl:h}),addImages:({nodes:i})=>{const o=gc.getDataNodes(r,i),{attrExps:a}=gc.getAttrExprData(t);return uc.handlePromises({customTooltipModel:m,nodes:o,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(f()&&t.tooltip?.chart?.object?.refId&&u&&"function"==typeof i?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>mc.createContainer({layout:t,ctx:{h:e,rtl:h}}),createLimitationRow:()=>gc.getFooterRow(s.get("properties.tooltip.notselectedmessage"),h),show:({nodes:e,properties:t})=>mc.show({app:n,properties:t,selectedNodes:e,customTooltipModel:m,rtl:h}),hasAlternateState:()=>!!m.miniChartToken?.alternateState,hide:()=>mc.hide({app:n,customTooltipModel:m}),destroy:()=>mc.destroyVisualization({customTooltipModel:m})}}}var Nc=7005;const Dc=e=>e.qError?.qErrorCode!==Nc,Lc=e=>{if(e.qHyperCubeDef.qDimensions.length>1&&1===e.qHyperCubeDef.qMeasures.length){const t=e.qHyperCubeDef.qInterColumnSortOrder.indexOf(0);0!==t&&$r.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,t,0)}},Ec=(e,t)=>{t>10?1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&$r.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0):0!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&$r.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0)},Oc=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))},Ac=(e,t)=>{const n=e.qHyperCubeDef.qDimensions,i=e.qHyperCubeDef.qMeasures;if(1===n.length&&1===i.length){const i=n[0];return i.qLibraryId?t.getDimension(i.qLibraryId).then(e=>e.getLayout()).then(t=>{if(t&&t.qDimInfos&&t.qDimInfos[0]){const n=t.qDimInfos[0].qCardinal;Ec(e,n)}return i}):t.getField(i.qDef.qFieldDefs[0]).then(t=>t.getCardinal().then(t=>(Ec(e,t),i)),()=>i)}return Lc(e),Promise.resolve()};function Ic(e){const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:i}}=e;t.length>1&&e.color?s(e,"color.persistent",!0):"byDimension"===i&&n.length>1?s(e,"color.mode","byMultiple"):"byExpression"===i&&0===n.length?s(e,"color.mode","primary"):0===t.length&&n.length>0&&(s(e,"color.byMeasureDef",void 0),s(e,"color.byDimDef",void 0),1===n.length&&"byExpression"!==i&&s(e,"color.mode","primary"))}const Pc=(e,t)=>{Ic(t),us(e),gc.addCallbackCustomTooltip(t)},Rc=e=>{Ic(e)};function zc({translator:e}){return{dimensions:{min:0,max:e=>e>1?1:2,description(t,n,i,o){let r;const a=o?.layout?o.layout.qHyperCube.qDimensionInfo.filter(e=>Dc(e)).length:t.qHyperCubeDef.qDimensions.length;return i.isAutoChart&&n>a-1?r="Visualizations.Descriptions.Color":a>1&&0===n?"stacked"===t.barGrouping.grouping?r="Visualizations.Descriptions.Stack":(r="Visualizations.Descriptions.Group",t.qHyperCubeDef.qColumnOrder=[0,1,2]):r="Visualizations.Descriptions.Bars",e.get(r)},add:(e,t,n)=>(t.qHyperCubeDef.qDimensions.length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),n?.app?Ac(t,n.app).then(()=>(Pc(e,t),e)):(Oc(t),Pc(e,t),e)),move(e,t,n){n.layout.qHyperCube.qDimensionInfo.filter(e=>Dc(e)).length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),Lc(t),Ic(t),gc.moveCallbackCustomTooltip(t,e)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Ic(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),gc.removeCallbackCustomTooltip(t,e)},replace(e,t,n,i){gc.replaceCallbackCustomTooltip(i,t)}},measures:{min:1,max:e=>e>1?1:15,description:()=>e.get("Visualizations.Descriptions.LengthBars"),add:(e,t,n)=>n?.app?Ac(t,n.app).then(()=>(e.qSortBy.qSortByNumeric=-1,Rc(t),e)):(Oc(t),Rc(t),e),move(e,t){Lc(t),Ic(t)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Ic(t),n.length>1&&"stacked"===t.barGrouping.grouping?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}function Hc(e){return{properties:nc(),data:{targets:[{path:"/qHyperCubeDef",...zc(e)}]}}}var Bc={Common_Measures:{id:"Common.Measures",locale:{"de-DE":"Kennzahlen","en-US":"Measures","es-ES":"Medidas","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","ru-RU":"Меры","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"de-DE":"Farbformel","en-US":"Color expression","es-ES":"Expresión de color","fr-FR":"Expression de couleur","it-IT":"Espressione colore","ja-JP":"カラー表現","ko-KR":"색상 표현식","nl-NL":"Kleuruitdrukking","pl-PL":"Wyrażenie koloru","pt-BR":"Expressão de cor","ru-RU":"Выражение для цвета","sv-SE":"Färguttryck","tr-TR":"Renk ifadesi","zh-CN":"颜色表达式","zh-TW":"色彩運算式"}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"de-DE":"+{0} mehr","en-US":"+{0} more","es-ES":"+{0} más","fr-FR":"+{0} plus","it-IT":"+{0} altre","ja-JP":"さらに +{0}","ko-KR":"{0} 이상","nl-NL":"+{0} meer","pl-PL":"Jeszcze {0}","pt-BR":"+{0} mais","ru-RU":"Еще +{0}","sv-SE":"Fler än {0} ytterligare","tr-TR":"+{0} daha","zh-CN":"+{0} 以上","zh-TW":"其他 +{0} 個"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"de-DE":"Summe negativer Werte","en-US":"Sum of negatives","es-ES":"Suma de negativos","fr-FR":"Somme des valeurs négatives","it-IT":"Somma valori negativi","ja-JP":"負の合計","ko-KR":"음수 합계","nl-NL":"Som negatieven","pl-PL":"Suma ujemnych","pt-BR":"Soma de negativos","ru-RU":"Сумма отрицательных значений","sv-SE":"Summan av negativa","tr-TR":"Negatif değerlerin toplamı","zh-CN":"负值总和","zh-TW":"負數總和"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"de-DE":"Summe positiver Werte","en-US":"Sum of positives","es-ES":"Suma de positivos","fr-FR":"Sommes des valeurs positives","it-IT":"Somma valori positivi","ja-JP":"正の合計","ko-KR":"양수 합계","nl-NL":"Som positieven","pl-PL":"Suma dodatnich","pt-BR":"Soma de positivos","ru-RU":"Сумма положительных значений","sv-SE":"Summan av positiva","tr-TR":"Pozitif değerlerin toplamı","zh-CN":"正值总和","zh-TW":"正數總和"}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","en-US":"Currently showing a limited data set.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","ja-JP":"現在、限定的なデータ セットを表示しています。","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","pt-BR":"Mostrando um conjunto de dados limitado.","ru-RU":"В настоящее время отображается ограниченный набор данных.","sv-SE":"Just nu visas en begränsad datauppsättning.","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","zh-CN":"当前正显示有限的数据集。","zh-TW":"目前顯示的是有限的資料集。"}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative or zero values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores cero o negativos que no se pueden mostrar en este gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。"}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","zh-CN":"数据集包含无法在此图表中显示的负值。","zh-TW":"資料集包含無法在此圖表中顯示的負值。"}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","en-US":"The selections generated no data for this chart.","es-ES":"Las selecciones no han generado datos para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ko-KR":"선택 내용으로 이 차트에 대한 데이터가 생성되지 않았습니다.","nl-NL":"De selecties hebben geen gegevens voor de diagram gegenereerd.","pl-PL":"Wymiary nie spowodowały wygenerowania danych dla tego wykresu.","pt-BR":"As seleções não geraram dados para este gráfico.","ru-RU":"В результате выборок данные для этой диаграммы не созданы.","sv-SE":"Urvalen genererade inga data för detta diagram.","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","zh-CN":"选择未生成此图表的数据。","zh-TW":"此選項無法產生任何適用於此圖表的資料。"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","en-US":"The data used to color this visualization only contains undefined values.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。"}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","en-US":"The chart is not displayed because it contains only undefined values.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości niezdefiniowane.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含未定义的值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。"}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","en-US":"The chart is not displayed because it contains only negative or zero values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos o valores cero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen negatieve waarden of nulwaarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne lub zerowe.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa värden eller nollvärden","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值或零值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。"}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","en-US":"The chart is not displayed because it contains only negative values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值。"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"de-DE":"Dimension nicht gefunden","en-US":"Dimension not found","es-ES":"No se ha encontrado la dimensión","fr-FR":"Dimension introuvable","it-IT":"Dimensione non trovata","ja-JP":"軸が見つかりません","ko-KR":"차원을 찾지 못했습니다.","nl-NL":"Dimensie niet gevonden","pl-PL":"Wymiar nie został znaleziony","pt-BR":"Dimensão não encontrada","ru-RU":"Измерение не найдено","sv-SE":"Dimensionen hittades inte","tr-TR":"Boyut bulunamadı","zh-CN":"未找到维度","zh-TW":"找不到維度"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"de-DE":"Kennzahl nicht gefunden","en-US":"Measure not found","es-ES":"No se ha encontrado la medida","fr-FR":"Mesure introuvable","it-IT":"Misura non trovata","ja-JP":"メジャーが見つかりません","ko-KR":"측정값을 찾지 못했습니다.","nl-NL":"Meting niet gevonden","pl-PL":"Miara nie została znaleziona","pt-BR":"Medida não encontrada","ru-RU":"Мера не найдена","sv-SE":"Måttet hittades inte","tr-TR":"Hesaplama bulunamadı","zh-CN":"未找到度量","zh-TW":"找不到量值"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"de-DE":"Lasso-Auswahl deaktivieren","en-US":"Turn off lasso selection","es-ES":"Desactivar la selección de contorno","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","ru-RU":"Выключить выбор лассо","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"de-DE":"Lasso-Auswahl aktivieren","en-US":"Turn on lasso selection","es-ES":"Activar la selección de contorno","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","ru-RU":"Включить выбор лассо","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取"}},Tooltip_dimensions_cyclic:{id:"Tooltip.dimensions.cyclic",locale:{"de-DE":"Zyklische Dimension","en-US":"Cyclic dimension","es-ES":"Dimensión cíclica","fr-FR":"Dimension cyclique","it-IT":"Dimensione ciclica","ja-JP":"サイクリック軸","ko-KR":"순환 차원","nl-NL":"Cyclische dimensie","pl-PL":"Wymiar cykliczny","pt-BR":"Dimensão cíclica","ru-RU":"Циклическое измерение","sv-SE":"Cyklisk dimension","tr-TR":"Döngüsel boyut","zh-CN":"循环维度","zh-TW":"循環維度"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"de-DE":"Drilldown-Dimension","en-US":"Drill-down dimension","es-ES":"Dimensión jerárquica","fr-FR":"Descendre dans la hiérarchie de la dimension","it-IT":"Dimensione di drill-down","ja-JP":"軸のドリルダウン","ko-KR":"드릴다운 차원","nl-NL":"Drill-downdimensie","pl-PL":"Wymiar hierarchiczny","pt-BR":"Dimensão da hierarquia","ru-RU":"Детализированное измерение","sv-SE":"Hierarkisk dimension","tr-TR":"Detaya inme boyutu","zh-CN":"下钻维度","zh-TW":"向下探查維度"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"de-DE":"Auswahlen sind für diese Dimension gesperrt","en-US":"Selections on this dimension are locked","es-ES":"Las selecciones de esta dimensión están bloqueadas.","fr-FR":"Sélections verrouillées pour cette dimension","it-IT":"Le selezioni in questa dimensione sono bloccate","ja-JP":"この軸での選択はロックされています","ko-KR":"이 차원의 선택은 잠겨 있습니다.","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","pl-PL":"Wybory dotyczące tego wymiaru są zablokowane","pt-BR":"Seleções estão bloqueadas nesta dimensão","ru-RU":"Выборки для данного измерения заблокированы","sv-SE":"Urval i den här dimensionen är låsta","tr-TR":"Bu boyuttaki seçimler kilitli","zh-CN":"相关维度的选择已锁定","zh-TW":"已鎖定此維度上的選項"}},Visualizations_Descriptions_Bars:{id:"Visualizations.Descriptions.Bars",locale:{"de-DE":"Balken","en-US":"Bars","es-ES":"Barras","fr-FR":"Barres","it-IT":"Barre","ja-JP":"棒","ko-KR":"막대","nl-NL":"Staven","pl-PL":"Słupki","pt-BR":"Barras","ru-RU":"Полосы","sv-SE":"Staplar","tr-TR":"Çubuklar","zh-CN":"条形","zh-TW":"長條"}},Visualizations_Descriptions_HeightLine:{id:"Visualizations.Descriptions.HeightLine",locale:{"de-DE":"Linienhöhe","en-US":"Height of line","es-ES":"Altura de línea","fr-FR":"Hauteur de ligne","it-IT":"Altezza della linea","ja-JP":"線の高さ","ko-KR":"선 높이","nl-NL":"Hoogte van lijn","pl-PL":"Wysokość linii","pt-BR":"Altura da linha","ru-RU":"Высота линии","sv-SE":"Linjens höjd","tr-TR":"Çizgi yüksekliği","zh-CN":"线高度","zh-TW":"折線高度"}},Visualizations_Descriptions_LengthBars:{id:"Visualizations.Descriptions.LengthBars",locale:{"de-DE":"Balkenlänge","en-US":"Length of bars","es-ES":"Longitud de barras","fr-FR":"Longueur des barres","it-IT":"Lunghezza delle barre","ja-JP":"棒の長さ","ko-KR":"막대 길이","nl-NL":"Lengte van staven","pl-PL":"Długość słupków","pt-BR":"Comprimento das barras","ru-RU":"Длина полос","sv-SE":"Staplarnas längd","tr-TR":"Çubuk uzunluğu","zh-CN":"条形长度","zh-TW":"長條長度"}},properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"de-DE":"Freigeben","en-US":"Share","es-ES":"Compartir","fr-FR":"Partage","it-IT":"Condividi","ja-JP":"共有","ko-KR":"공유","nl-NL":"Delen","pl-PL":"Udostępnij","pt-BR":"Compartilhar","ru-RU":"Совместное использование","sv-SE":"Dela","tr-TR":"Paylaş","zh-CN":"共享","zh-TW":"共用"}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"de-DE":"Durchschnitt","en-US":"Average","es-ES":"Media","fr-FR":"Moyenne","it-IT":"Media","ja-JP":"平均値","ko-KR":"평균","nl-NL":"Gemiddelde","pl-PL":"Średnia","pt-BR":"Média","ru-RU":"Среднее","sv-SE":"Medel","tr-TR":"Ortalama","zh-CN":"平均值","zh-TW":"平均值"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"de-DE":"Exponentiell","en-US":"Exponential","es-ES":"Exponencial","fr-FR":"Exponentiel","it-IT":"Esponenziale","ja-JP":"指数","ko-KR":"지수","nl-NL":"Exponentieel","pl-PL":"Wykładnicze","pt-BR":"Exponencial","ru-RU":"Экспоненциальный","sv-SE":"Exponentiell","tr-TR":"Üstel","zh-CN":"指数","zh-TW":"指數"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"de-DE":"Linear","en-US":"Linear","es-ES":"Lineal","fr-FR":"Linéaire","it-IT":"Lineare","ja-JP":"線形","ko-KR":"선형","nl-NL":"Lineair","pl-PL":"Liniowe","pt-BR":"Linear","ru-RU":"Линейный","sv-SE":"Linjär","tr-TR":"Doğrusal","zh-CN":"线性","zh-TW":"線性"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"de-DE":"Logarithmisch","en-US":"Logarithmic","es-ES":"Logarítmica","fr-FR":"Logarithmique","it-IT":"Logaritmica","ja-JP":"対数","ko-KR":"로그","nl-NL":"Logaritmisch","pl-PL":"Logarytmiczne","pt-BR":"Logarítmico","ru-RU":"Логарифмический","sv-SE":"Logaritmisk","tr-TR":"Logaritmik","zh-CN":"对数","zh-TW":"對數"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"de-DE":"Polynom zweiten Grades","en-US":"Second degree polynomial","es-ES":"Polinómica de segundo grado","fr-FR":"Polynomial du 2ème degré","it-IT":"Polinomio di secondo grado","ja-JP":"2 番目の角度の多項式近似","ko-KR":"2차 다항식","nl-NL":"Tweedegraadspolynoom","pl-PL":"Wielomianowe drugiego stopnia","pt-BR":"Polinômio de segundo grau","ru-RU":"Полиномиальный второй степени","sv-SE":"Polynomial, andra graden","tr-TR":"İkinci derece polinom","zh-CN":"二次多项式","zh-TW":"第二度多項式"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"de-DE":"Polynom dritten Grades","en-US":"Third degree polynomial","es-ES":"Polinómica de tercer grado","fr-FR":"Polynomial du 3ème degré","it-IT":"Polinomio di terzo grado","ja-JP":"3 番目の角度の多項式近似","ko-KR":"3차 다항식","nl-NL":"Derdegraadspolynoom","pl-PL":"Wielomianowe trzeciego stopnia","pt-BR":"Polinômio de terceiro grau","ru-RU":"Полиномиальный третьей степени","sv-SE":"Polynomial, tredje graden","tr-TR":"Üçüncü derece polinom","zh-CN":"三次多项式","zh-TW":"第三度多項式"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"de-DE":"Polynom vierten Grades","en-US":"Fourth degree polynomial","es-ES":"Polinómica de cuarto grado","fr-FR":"Polynomial du 4ème degré","it-IT":"Polinomio di quarto grado","ja-JP":"4 番目の角度の多項式近似","ko-KR":"4차 다항식","nl-NL":"Vierdegraadspolynoom","pl-PL":"Wielomianowe czwartego stopnia","pt-BR":"Polinômio de quarto grau","ru-RU":"Полиномиальный четвертой степени","sv-SE":"Polynomial, fjärde graden","tr-TR":"Dördüncü derece polinom","zh-CN":"四次多项式","zh-TW":"第四度多項式"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"de-DE":"Potenz","en-US":"Power","es-ES":"Potencia","fr-FR":"Puissance","it-IT":"Potenza","ja-JP":"累乗","ko-KR":"거듭제곱","nl-NL":"Macht","pl-PL":"Potęgowe","pt-BR":"Potência","ru-RU":"Степенной","sv-SE":"Potens","tr-TR":"Üs","zh-CN":"幂","zh-TW":"乘冪"}}};const Fc="REJECTED",jc=()=>{},Vc=1e4,_c={MULTIPLIER:2,MINIMUM:20,MAXIMUM:200},Uc=50,$c=10,Wc=100;var Kc={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),i=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),o=Math.max(t.qTop,e.qArea.qTop),r=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,o-e.qArea.qTop),s=Math.min(o+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,r-e.qArea.qLeft),u=Math.min(r+i-e.qArea.qLeft,e.qArea.qWidth),c={qArea:{qHeight:s-a,qWidth:u-l,qTop:o,qLeft:r},qMatrix:[]};for(let t=a;t<s;t++)c.qMatrix.push(e.qMatrix[t].slice(l,u));return c},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const i=n.qTop-$c<=t.qTop,o=n.qLeft+n.qWidth+$c>=t.qLeft+t.qWidth,r=n.qTop+n.qHeight+$c>=t.qTop+t.qHeight,a=n.qLeft-$c<=t.qLeft;return i&&t.qTop>0||o&&t.qLeft+t.qWidth<e.width||r&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var Gc={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),r=Math.max(0,i-e.qArea.qTop),a=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-i-(a-r),l={qArea:{qHeight:a-r,qWidth:e.qArea.qWidth,qTop:i,qLeft:o},qData:[{...e.qData[0],qUp:i,qDown:s,qSubNodes:[]}]};for(let t=r;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const i=n.qTop-$c<=t.qTop,o=n.qTop+n.qHeight+$c>=t.qTop+t.qHeight;return i&&t.qTop>0||o&&t.qTop+t.qHeight<e.height}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeStackData",args:[e,[t]]})}};var Yc={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const Xc="pages";const Jc="discretePan",Zc=10;function Qc({chart:e,actions:t,componentKey:n,dockService:i,rtl:o,scroller:r}){return{type:"Pan",key:"discrete:pan",options:{event:Jc,pointers:1,threshold:Zc,enable(i,o){return this.started===Jc||!o||!(!t.scroll.enabled()||!r.enabled())&&e.componentsFromPoint({x:o.center.x,y:o.center.y}).some(e=>e.key===n)}},events:{[`${Jc}start`](e){e.preventDefault(),this.started=Jc;const t="horizontal"===i.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-Zc:Zc},[`${Jc}move`](e){e.preventDefault();const t="horizontal"===i.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&o?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,r.scroll(s)},[`${Jc}end`](e){e.preventDefault(),this.started=!1},[`${Jc}cancel`](e){e.preventDefault(),this.started=!1}}}}function ed({chart:e,componentKey:t,actions:n,scroller:i}){return function(o){if(!n.scroll.enabled()||!i.enabled())return;const[r]=e.componentsFromPoint({x:o.clientX,y:o.clientY}).filter(e=>e.key===t);if(!r)return;o.preventDefault();const a=Math.abs(o.deltaY)>Math.abs(o.deltaX)?o.deltaY:o.deltaX,s=Math.sign(-a)*Wc;i.scroll(s)}}function td({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(Vc/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const i=Math.min(t,Math.max(_c.MAXIMUM,n));return{width:e,height:Math.max(_c.MINIMUM,Math.min(n*_c.MULTIPLIER,i))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:i,height:o}=t({width:e.qWidth,height:e.qHeight}),r=o?Math.ceil((o-e.qHeight)/2):0,a=i?Math.ceil((i-e.qWidth)/2):0;return{qHeight:o?Math.min(o,n.height):e.qHeight,qWidth:i?Math.min(i,n.width):e.qWidth,qTop:o?Math.max(0,Math.min(e.qTop-r,n.height-o)):e.qTop,qLeft:i?Math.max(0,Math.min(e.qLeft-a,n.width-i)):e.qLeft}}}function nd(e){let t,n;const i=o=>{t=o;const{method:r,args:a}=t.request;e[r](...a).then(e=>{if(t.canceled||n)return t.reject(Fc),t=null,void(n&&(i(n),n=null));t.resolve(e[0]),t=null})},o=e=>new Promise((o,r)=>{const a={request:e,resolve:o,reject:r,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(Fc),n=e})(a):i(a)});return o.isProcessing=()=>!!t,o.hasQueued=()=>!!n,o.cancel=()=>{o.isProcessing()&&t.cancel(),o.hasQueued()&&(n.reject(Fc),n=null)},o}const id={command:{update:()=>{}}};var od={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:i}){const{pixel:o}=t,r=e.getDataPages()[0],a=o/i;return[a,n.inView>=n.inTotal?a+1:a+r.qArea.qWidth/n.inView]}};var rd={inTotal:function({layoutService:e}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const[t]=e.getDataPages();if(t)return t.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:i}){const o=void 0===i?4:i,r=Math.max(0,Math.floor(t)-o/2);return{qTop:r,qHeight:Math.min(e.meta.size.y-r,Math.max(0,Math.ceil(n+o))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:i}){const{pixel:o}=t,r=e.getDataPages()[0],a=i/n.inView,s=(o+r.qArea.qTop*a)/i;return[s,n.inView>=n.inTotal?s+1:s+r.qArea.qHeight/n.inView]}};function ad(e){const{groupSize:t,measureCount:n}=e.meta;return t??n}function sd(e,t){const n=[];for(let i=0;i<e.length;i++){const o=t(e[i]);-1===n.indexOf(o)&&n.push(o)}return n.length}function ld(e){return sd(e.qMatrix,e=>e[0].qElemNumber)-1}var ud={inTotal:function({layoutService:e}){const t=ad(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:i}){const o=ad(e),r=void 0===i?o:i,a=t/(o+1),s=Math.max(0,Math.floor((t-a-r/2)/o));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+r)/o+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:i}){const o=ad(e),r=e.getDataPages()[0],a=i/n.inView,{pixel:s}=t,l=ld(r),u=r.qArea.qHeight*o+l,c=(s+(r.qArea.qTop*o+r.qArea.qTop)*a)/i;return[c,n.inView>=n.inTotal?c+1:c+u/n.inView]}};const cd=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function dd(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return cd(e,n);const i=((e,t)=>{const n={successful:!0,count:0};let i=Math.abs(Math.floor(t));const o=[];for(let t=0;t<=i;t++){if(!e[t])return n.successful=!1,n;const r=e[t][0].qElemNumber;-1===o.indexOf(r)&&(o.push(r),i--)}return n.count=o.length-1,n})(t.qMatrix,n);return i.successful?i.count:cd(e,n)},area(t,n,i){if(0!==t.qArea.qTop)return cd(e,n);return sd(t.qMatrix.slice(0,i.qTop+1),e=>e[0].qElemNumber)-1}}}var md={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:i}){const o=dd(t).itemOffset(e(),n),r=Math.max(0,Math.floor(n-o));return{qTop:r,qHeight:Math.min(t.meta.size.y-r,Math.max(0,Math.ceil(i+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:i,viewSize:o,upperBound:r}){const a=t.getDataPages()[0],s=o/i.inView,{item:l,pixel:u}=n,c=dd(t).area(e(),l,a.qArea),d=ld(a),m=a.qArea.qHeight+d,h=u===r?(i.inView-m)*s/o:(u+(a.qArea.qTop+c)*s)/o;return[h,i.inView>=i.inTotal?h+1:h+m/i.inView]}};function hd({chart:e,rect:t,dockService:n,itemWidths:i,axisKey:o,renderer:r,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:u,maxDataRows:c}){const{DEFAULT:d,SQUEEZE:m,LABELLESS:h}=i[n.meta.chart.mode],f="horizontal"===n.meta.major.orientation,{axisDisplayMode:p="auto",maxVisibleItems:g=10,label:y}=s,v=f?t.width:t.height,b=v/l>=m;switch(p){case"max":return Math.min(l,c);case"custom":return Math.min(g,c);default:return u?v/h:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:i={},isGrouped:o,itemSize:r,label:a}){if(o||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=i;if(!s||!l)return!0;const{fontFamily:u,fontSize:c,tiltAngle:d}=s.settings.settings.labels,{height:m}=l({fontFamily:u,fontSize:c,text:"M"});if(!t)return m>r;const h=(90-d)*(Math.PI/180);return m>Math.cos(h)*r}({chart:e,isHorizontal:f,axisKey:o,renderer:r,isGrouped:a,itemSize:m,label:y})?v/d:l:v/d}}var fd="AVERAGE",pd="LINEAR",gd="POLYNOMIAL2",yd="POLYNOMIAL3",vd="POLYNOMIAL4",bd="EXPONENTIAL",Sd="LOG",xd="POWER";function Md({dimValue:e,value:t,qTrendLine:n}){const{qType:i,qCoeff:o}=n,r={x:e,y:o[2]*t**2+o[1]*t+o[0]};switch(i){case yd:return r.y+=o[3]*t**3,r;case vd:return r.y+=o[4]*t**4+o[3]*t**3,r;default:return r}}var qd={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:Md,polynomial3:Md,polynomial4:Md,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};function Cd(e,t){const n=qd[t.qType.toLowerCase()],i=Math.max(1,e/500);let o=1/0,r=-1/0;for(let a=0;a<e;a+=i){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});o=Math.min(e,o),r=Math.max(e,r)}return{min:o,max:r}}function Td(e){return qd[e.qType.toLowerCase()]}function wd(e,t){return e.meta.isContinuous?function(e,t){return{generate:(n,i,o)=>{const r=[],a=Td(n),s=t.get("zoom"),l=n.start??s.min,u=n.end??s.max,c=(u-l)/100,d=e.meta.isButterfly&&o>0;if(c>0){const e=e=>{const t=a({dimValue:e,value:e,qTrendLine:n});d&&(t.y=-t.y),t.layerId=i,t.measureIndex=o,t.dimValue=e,r.push(t)};let t=l;for(let n=l;n<=u;n+=c)e(n),t=n;t!==u&&e(u)}return r},calculate:(e,t)=>Td(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map(({y:e})=>e);return{min:Math.min(...n),max:Math.max(...n)}}}}(e,t):e.meta.mode.K?function(e){return{generate:(t,n,i)=>{const o=[],r=e.getDataPages()[0],a=r.qData[0].qSubNodes,s=r.qArea.qTop,l=qd[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const r=a[e],u=l({dimValue:r.qElemNo,value:e+s+1,qTrendLine:t});u.layerId=n,u.measureIndex=i,u.dimValue=r.qText,o.push(u)}return o},findMinMax:Cd}}(e):function(e){return{generate:(t,n,i)=>{const o=[],r=e.getDataPages()[0],a=r.qMatrix,s=r.qArea.qTop,l=qd[t.qType.toLowerCase()],u=e.meta.isButterfly&&i>0;for(let e=0;e<a.length;e++){const r=a[e][0],c=e+s+1,d=l({dimValue:r.qElemNumber,value:c,qTrendLine:t});u&&(d.y=-d.y),d.layerId=n,d.measureIndex=i,d.dimValue=r.qText,o.push(d)}return o},calculate:(e,t,n)=>(0,qd[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:Cd}}(e)}var kd={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},Nd={color:"#f93f17",index:9};const{isDark:Dd}=ls,Ld={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},Ed=({layoutService:e,viewState:t,colorModel:n,chart:i,env:o,keys:{colorScale:r},isEnabled:a=()=>!1})=>{const{translator:s}=o,l=[Ld],u=[],c=[],d=wd(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach((e,t)=>{Array.isArray(e.qTrendLines)&&(u.push(...e.qTrendLines),c.push(...e.qTrendLines.map(()=>t)))});const h=m(e=>{const{style:t}=u[e]||{},o=n.settings();if(t.autoColor){if("measure"===o.mode){const t=c[e],n=i.scale(r)(t);return Dd(n)?function(e){const t=rs(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=rs(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(Nd)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"});return{query:{hasTrendLines:()=>!!u.length&&a(),getData:()=>l,getStroke:h,getLineDash:e=>{const{style:t}=u[e]||{};return t?.lineDash},getLineThickness:e=>{const{style:t}=u[e]||{};return t?.lineThickness??2},getLabel:e=>(u[e]||{}).label,getType:e=>{const{qType:t}=u[e]||{};return s.get(kd.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return u.forEach(i=>{const o=d.findMinMax(e.meta.size.y,i);t=Math.min(o.min,t),n=Math.max(o.max,n)}),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const i=u[e];return d.calculate(i,t,n)}},command:{update:()=>{l.length=0,u.forEach((e,t)=>{const n=d.generate(e,t,c[t]);l.push(...n)})}}}};var Od={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const Ad=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,Id=(e,{layoutService:t,trendLineModel:n,dockService:i,animationsEnabled:o})=>{if(!n.query.hasTrendLines())return[];const r=(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:i,dockService:o,animationsEnabled:r})=>{const a=Ad(i);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:Od,settings:{connect:!0,orientation:o.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:({datum:e})=>n.query.getLineThickness(e.layer.value),stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:r,trackBy:bl.nonUpdatingNode.trackBy,compensateForLayoutChanges:bl.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:i,animationsEnabled:o}),a=(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:i,dockService:o})=>{const r=Ad(i),a="horizontal"===o.meta.major.orientation,s={scale:e,fn:r},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:Od,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:i});return[r,a]};function Pd(e,t){const{getLabel:n,getType:i,getLineDash:o,getStroke:r}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:r(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":o(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:i(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}function Rd(e,{h:t,style:n}){return e.map(e=>{const i={style:{direction:"string"==typeof e.content?ua.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(i.colspan=e.colspan);const o=function(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map(t=>e("span",{style:t.style,direction:ua.detectTextDirection(t.content)},t.content))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:"16px",x2:"16px",y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},t)}(e):t.content}(t,e);return t("td",i,o)})}function zd(e,t){return({h:n,data:i,style:o})=>{const r=i[0].title,a=i.filter(e=>e.title===r),s=function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:ua.detectTextDirection(t)},t);return e("tr",{},n)}(n,r),l=[s];if(a.slice(0,2).forEach(e=>{l.push(n("tr",{},Rd(e.row,{h:n,style:o})))}),i.length>2){const o=i.length-2;l.push(...function(e,t,n,i){const o=t?t.get("Object.ChartTooltip.NMore",i):`+${i} more`,r=ua.detectTextDirection(o);return[e("tr",{},e("td",{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:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:r},colspan:3},o))]}(n,e,t,o))}return l}}function Hd(e,{trendLineModel:t,translator:n},i={}){if(!t.query.hasTrendLines())return!1;const{rtl:o}=i,r=ra({key:e.tooltip,rtl:o});return ne(!0,r,{settings:{extract:Pd(e,t),content:zd(n,o),placement:"pointer",direction:i.rtl?"rtl":"ltr"}})}function Bd(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function Fd(e,{chart:t,viewState:n,trendLineModel:i,layoutService:o,rtl:r}){const{isContinuous:a}=o.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=Bd(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:o}=i.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(i,a)=>{const l=Bd(i,t),u=t.shapesAt({cx:(c=l).x,cy:c.y,r:3},s);var c;if(u.length){const i=function(e,t,n,i){let o=(e.x-t.rect.computed.x)/t.rect.computed.width;o=i?1-o:o;const{min:r,max:a}=n.get("zoom");return r+(a-r)*o}(l,a,n,r),s=t.scale(e.majorInnerScale),c=(s?.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(i);u.forEach(e=>{e.data.dimValue.value=i,e.data.dimValue.label=c,e.data.minor.value=o(e.data.layer.value,i).y})}return u}}return n=>{const i=t.component(e.tooltip);if(i&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some(t=>t.key===e.tooltipOverlay))(n)){const e=l(n,i);return e.length?(i.emit("show",n,{nodes:e}),!0):(i.emit("hide"),!1)}return!1}}const jd=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},Vd=e=>{jd(e),e.qMultiDimMode="Sum",e.qXColIx=0};function _d(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:i=!1}=e;return{show:(e,t,{layout:n})=>!Yr.dimensionless(n)&&!Yr.groupedByDimension(n)&&(i||!Yr.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:kd.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(kd.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:kd.ADD_BUTTON,add:Vd,globalChange:e=>{const t=a(e,"qHyperCubeDef.qMeasures",[]).reduce((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e),[]),i=(e=>!a(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach(e=>{e.qContinuousXAxis=i}),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:kd.TYPE,options:[{value:fd,translation:kd.TYPES.AVERAGE},{value:pd,translation:kd.TYPES.LINEAR},{value:gd,translation:kd.TYPES.POLYNOMIAL2},{value:yd,translation:kd.TYPES.POLYNOMIAL3},{value:vd,translation:kd.TYPES.POLYNOMIAL4},{value:bd,translation:kd.TYPES.EXPONENTIAL},{value:Sd,translation:kd.TYPES.LOG},{value:xd,translation:kd.TYPES.POWER}],defaultValue:fd},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:Nd,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:kd.STYLE.DASHED,type:"boolean",defaultValue:!0,change:jd}}}}var Ud,$d;var Wd=function(){if($d)return Ud;$d=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},Ud=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,i,o,r,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(i=this._events[t],e.isUndefined(i))return!1;if(e.isFunction(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:for(o=arguments.length,r=new Array(o-1),a=1;a<o;a++)r[a-1]=arguments[a];i.apply(this,r)}else if(e.isObject(i)){for(o=arguments.length,r=new Array(o-1),a=1;a<o;a++)r[a-1]=arguments[a];for(o=(s=i.slice()).length,a=0;a<o;a++)s[a].apply(this,r)}return!0},t.prototype.addListener=function(n,i){var o;if(!e.isFunction(i))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,e.isFunction(i.listener)?i.listener:i),this._events[n]?e.isObject(this._events[n])?this._events[n].push(i):this._events[n]=[this._events[n],i]:this._events[n]=i,e.isObject(this._events[n])&&!this._events[n].warned)&&((o=e.isUndefined(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&o>0&&this._events[n].length>o&&(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 i=!1;function o(){this.removeListener(t,o),i||(i=!0,n.apply(this,arguments))}return o.listener=n,this.on(t,o),this},t.prototype.removeListener=function(t,n){var i,o,r,a;if(!e.isFunction(n))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=(i=this._events[t]).length,o=-1,i===n||e.isFunction(i.listener)&&i.listener===n)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,n);else if(e.isObject(i)){for(a=r;a-- >0;)if(i[a]===n||i[a].listener&&i[a].listener===n){o=a;break}if(o<0)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,n)}return this},t.prototype.removeAllListeners=function(t){var n,i;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(i=this._events[t],e.isFunction(i))this.removeListener(t,i);else if(Array.isArray(i))for(;i.length;)this.removeListener(t,i[i.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},Ud}(),Kd=Z(Wd);const Gd={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"}}]};const Yd=e=>(Object.keys(Kd.prototype).forEach(t=>{e[t]=Kd.prototype[t]}),Kd.init(e),e);var Xd={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}},Jd={SCALE:{MAIN:{MINOR:"minor",MAJOR:"major",MAJOR_INNER:"majorInner",COLOR:"fill"},REDUCED:{MINOR:"miniMinor",MAJOR:"miniMajor",COLOR:"reducedFill"}},COMPONENT:{BAR:"bar",MINI_BAR:"mini-marker",GHOST_BAR_OOB:"ghost-bar",BAR_AXIS:"bar-axis",GROUP_AXIS:"group-axis",BAR_OOB_MAX:"bar-oob-max",BAR_OOB_MIN:"bar-oob-min",STACK_TOTAL_BAR:"stack-total-bar",BASE_TOOLTIP:"tooltip-qcm",SPACE:"space",LEGEND_CAT_TOOLTIP:"legend-cat-tooltip",LEGEND_COLOR_CAT:"legend-color-cat",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay"},COLLECTION:{MAIN:"main-collection",MINI:"mini-collection",MINI_STACK:"mini-stack-collection",MINI_CONTINUOUS:"mini-continuous-collection",STACK_TOTAL:"stack-total-collection"},FORMATTER:{MINOR:"bar",COLOR:"fill"}};const Zd=({layout:e})=>{const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==Nc),n=e?.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==Nc);return 1===(t?.length??0)&&2===(n?.length??0)},Qd=e=>({layout:e})=>{const t=Vr.canBeContinuous(e),n=Yr.continuous({layout:e}),i=Yr.dimensionless(e),o=Zd({layout:e})&&"butterfly"===e?.barGrouping?.grouping;return{canBeContinuous:t,isDiscrete:!n,isContinuous:n,isTime:Vr.isTime(n,e),isDimensionless:i,isSimple:Yr.simple(e),isGrouped:!o&&Yr.grouped(e),isGroupedByMeasure:!o&&Yr.groupedByMeasure(e),isGroupedByDimension:!o&&Yr.groupedByDimension(e),isStacked:!o&&Yr.stacked(e),isStackedByDimension:!o&&Yr.stackedByDimension(e),isStackedByMeasure:!o&&Yr.stackedByMeasure(e),isSnapshot:Yr.snapshot(e),isButterfly:o}};function em({clearMinor:e,clearLegend:t,clearDiscrete:n,clearContinuous:i,selectionInfo:o}){t({componentName:"legendRangeBrush"}),e({eventName:"measureRange",componentName:"measureRangeBrush"}),n({eventName:"discreteRange",componentName:"discreteRangeBrush",brushName:!1}),"tap"!==o.event&&i({componentName:"continuousRangeBrush",brushName:!1})}function tm({chart:e,actions:t,selections:n}){const i=e.scale(Jd.SCALE.MAIN.MAJOR);return h({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:i,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,t.lasso.active()&&t.lasso.action(!1)},clear:em},custom:{getActions:()=>t},setBrushAliases({defaultFunc:e,brush:t}){e(),t.addKeyAlias("miniCube/qDimensionInfo/0","qHyperCube/qDimensionInfo/0"),t.addKeyAlias("miniCube/qDimensionInfo/1","qHyperCube/qDimensionInfo/1")}}})}const nm=e=>{const t=e.qDimensionInfo.length;for(let n=0;n<t;n++){const i=e.qDimensionInfo[n];if(!(i.qLocked||i.qCardinalities.qHypercubeCardinal<=1&&n<t-1))return n}};function im({layout:e,defaultAuto:t}){return e.qHyperCube.qDimensionInfo.length>1?{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}}:e.qHyperCube.qMeasureInfo.length>1?{mode:"primary",useBaseColors:"measure",paletteColor:null}:t(e)}function om({app:e,model:t,translator:n,picasso:i,localeInfo:o,theme:r,continuousDataModel:a,layoutService:s,legendLayoutService:l,reducedDataModel:u}){const{isContinuous:c,isStacked:d}=s.meta,m={main:void 0,mini:{getScales:()=>({}),getColor:()=>e=>e,getDatumProps:()=>({}),getAuxiliarySettings:()=>{}}};return{initialize:()=>{const h=[],{isReduced:p}=u.model().mode,g=c||p||d,y=!c&&(p||d)&&l?l.getHyperCube():void 0,v=y?"legendCube":void 0;return m.main=f({app:e,model:t,translator:n,picasso:i,layoutService:s,config:{localeInfo:o,auto:im,key:Jd.SCALE.MAIN.COLOR},createConfig:()=>({hc:g?y||s.getHyperCube():u.model().cube,source:g?v:"miniCube",theme:r})}),h.push(m.main.initialize()),c&&(m.mini=f({app:e,model:t,translator:n,picasso:i,layoutService:s,config:{localeInfo:o,auto:im,key:Jd.SCALE.REDUCED.COLOR},createConfig:()=>({layout:a.getInitialLayout(),hc:a.getInitialCube(),source:"miniCube",theme:r})}),h.push(m.mini.initialize())),Promise.all(h)},getMain:()=>m.main,getMini:()=>m.mini}}function rm({layoutService:e,node:t}){const{isGroupedByDimension:n,isStackedByDimension:i,isDimensionless:o}=e.meta;return n?`${t.data.label}, ${t.data.group.label}`:i?`${t.data.label}, ${t.data.stack.label}`:o?void 0:t.data.label}function am({chart:e,actions:t,translator:n,rtl:i,viewState:o,viewModel:r,layoutService:a,dockService:s,colorService:l,themeService:u,trendLineModel:c,custom:d}){const{isTwoDimensional:m,isStacked:h,isGroupedByDimension:f,isGroupedByMeasure:g,isStackedByDimension:y,isStackedByMeasure:v}=a.meta,{fontFamily:b}=u.getStyles(),S=function({layoutService:e,dockService:t}){const{BAR_AXIS:n,BAR_OOB_MIN:i,BAR_OOB_MAX:o,GROUP_AXIS:r}=Jd.COMPONENT,{isGrouped:a,isGroupedByDimension:s}=e.meta,{orientation:l}=t.meta.chart,u="vertical"===l;return[({chart:e,hovered:t,meta:l,collected:c,collectedBounds:d})=>{const[m]=t,{triggerer:h}=l;if(h===i||h===o)return{key:m.key,bounds:m.bounds};if(u&&(h===n||h===r)){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===i||e.key===o)&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:(e.key===i||e.key===o)&&e.data.value===m.data.value),r=e.findShapes("path").find(e=>s&&h===n?e.key===o&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:e.key===o&&e.data.value===m.data.value);if(t)return a?{key:r?r.key:Jd.COMPONENT.BAR,bounds:d}:{key:t.key,bounds:t.bounds}}if(!u&&!c.some(e=>e.bounds.height+e.bounds.width!==0)){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===i||e.key===o)&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:(e.key===i||e.key===o)&&e.data.value===m.data.value);if(t)return{key:t.key,bounds:t.bounds}}return!1},"collectible"]}({layoutService:a,dockService:s}),x=Fd({majorInnerScale:Jd.SCALE.MAIN.MAJOR_INNER,tooltip:Jd.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:Jd.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:e,viewState:o,trendLineModel:c,layoutService:a,rtl:i}),M=({collected:t,triggerer:n})=>{if(h){t.splice(0,t.length);e.findShapes("container").filter(e=>e.key===Jd.COMPONENT.BAR&&e.data?.stack.value===n.data.value).filter(e=>v?e.data?.value===n.data.value:e.data?.stack.value===n.data.value).forEach(e=>{if(e.children.length){const[n]=e.children;n.key=e.key,t.push(n)}else t.push(e)})}};return p({chart:e,translator:n,config:{rtl:i,enable:()=>t.tooltip.enabled(),getColorSettings:()=>l.getMain().getSettings(),style:{fontFamily:b},main:{key:Jd.COMPONENT.BASE_TOOLTIP,suppress:({event:e})=>x(e),getGroupByValue:({data:e})=>e.value,collectibles:[{key:Jd.COMPONENT.BAR,type:"bar",major:({data:e,meta:t})=>g?t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===Jd.COMPONENT.BAR_AXIS||t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX?[e.value,e.group.value]:e.group.value:y?e.stack.value:e.value},{key:`${Jd.COMPONENT.GHOST_BAR_OOB}-min`,type:"bar",if:()=>!v&&!y,major:({data:e,meta:t})=>g?t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX||t.triggerer===Jd.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value},{key:`${Jd.COMPONENT.GHOST_BAR_OOB}-max`,type:"bar",if:()=>!v&&!y,major:({data:e,meta:t})=>g?t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX||t.triggerer===Jd.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value}],triggers:[{keys:[Jd.COMPONENT.BAR],collect:{from:"single"},placement:S},{keys:[Jd.COMPONENT.BAR_AXIS],collect:{from:"dimension",by:({data:e})=>f?[e.value,e.group.value]:e.value,after:M},placement:S},{keys:[Jd.COMPONENT.BAR_OOB_MIN,Jd.COMPONENT.BAR_OOB_MAX],collect:{from:"dimension",by:({data:e})=>g?[e.value,e.measureIndex.value]:f?[e.value,e.group.value]:e.value,after:M},placement:S},{keys:[Jd.COMPONENT.GROUP_AXIS],collect:{from:"dimension",by:({data:e})=>e.group.value},placement:S}],layout:{grouping:m,single:()=>!(!d.isEnabled()||!d.hasImages())||d.chart.isEnabled()},section:({h:t,nodes:n,dataset:i,formatter:o,create:s,util:l})=>{const[u]=n,{title:c,description:m,measures:h}=d.isEnabled()?d.getAttributes({dataset:i,nodes:[u]}):{},f=[];c&&f.push(s.text({value:c,style:{bold:!0},survive:{visibility:!0},visibility:{count:!1}})),m&&f.push(s.text({value:m,survive:{visibility:!0},visibility:{count:!1}}));const p=d.hideBasic();if(p&&!h.length&&(c||m)||f.push(s.text({value:rm({layoutService:a,node:u}),style:{bold:!0}})),!p){const t=void 0!==u.data.fill?.value?e.scale(Jd.SCALE.MAIN.COLOR)(u.data.fill.value):void 0;f.push(s.color({nodes:n,property:Jd.SCALE.MAIN.COLOR,fillColor:t})),f.push(...n.map(e=>function({viewModel:e,layoutService:t,formatter:n,create:i,util:o,node:r}){const{isStacked:a,isStackedByDimension:s}=t.meta;if(a){const t=n(Jd.FORMATTER.MINOR),{segment:a}=r.data,l=s&&t?t(a.value):a.label;return i.measure({label:o.dataset.title(r.data.source.key,e.fields.minor[s?0:r.data.measureIndex.value]),value:!0===r.data.null?.value||"NaN"===l?"-":l})}const{data:l}=r,{end:u}=l,{key:c,field:d}=u.source;return i.measure({label:o.dataset.title(c,d),value:u.label})}({viewModel:r,layoutService:a,formatter:o,create:s,util:l,node:e})))}h&&f.push(...h.map(e=>s.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0,visibility:!0},visibility:{count:!1}}))),d.chart.isEnabled()&&(d.chart.hasLimitation()?(d.chart.destroy(),f.push(s.raw({value:d.chart.createLimitationRow(),survive:{visibility:!0},visibility:{count:!1}}))):f.push(s.raw({value:d.chart.createContainer({h:t}),survive:{visibility:!0},visibility:{count:!1}})));const{customTooltipImages:g}=u.data;return d.isEnabled()&&g&&f.push(...g.map(e=>s.raw({value:d.createImageRow({value:e,h:t}),survive:{visibility:!0},visibility:{count:!1}}))),f.filter(Boolean)},sections:({nodes:t,formatter:i,meta:o,create:r,sections:a})=>{if(!h||o.triggerer!==Jd.COMPONENT.BAR_AXIS)return;const[s]=t,[l]=e.findShapes("container").filter(e=>e.key===Jd.COMPONENT.STACK_TOTAL_BAR&&e.data&&e.data.value===s.data.stack.value);if(!l)return;const u=i(Jd.FORMATTER.MINOR),c=[];if(l.data.sumOfPositives.value>0){const{value:e}=l.data.sumOfPositives;c.push(r.measure({label:n?n.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives",value:u?u(e):e,visibility:{force:!0}}))}if(l.data.sumOfNegatives.value<0){const{value:e}=l.data.sumOfNegatives;c.push(r.measure({label:n?n.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives",value:u?u(e):e,visibility:{force:!0}}))}a.unshift(r.section({content:[r.text({value:l.data.label,style:{bold:!0},visibility:{force:!0}}),...c]}),r.divider({visibility:{force:!0}}))},events:{tooltip:{beforeShow:({collectNodes:e})=>d.isEnabled()&&d.hasImages()?d.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{d.chart.isEnabled()&&!d.chart.hasLimitation()&&d.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{d.chart.isEnabled()&&d.chart.hasAlternateState()&&d.chart.hide()}}}},legend:{keys:{tooltip:Jd.COMPONENT.LEGEND_CAT_TOOLTIP,component:Jd.COMPONENT.LEGEND_COLOR_CAT}}}})}const sm={getMaxGlyphCount(e,t){const{qDimensionInfo:n}=e,{qApprMaxGlyphCount:i}=n[t];return i},getDimensionSize(e){const t=e?.qCardinalities?.qHypercubeCardinal,{qLocked:n=0,qOption:i=0,qSelected:o=0}=e?.qStateCounts||{};return[void 0,0].includes(t)?n+i+o:t}};function lm({layoutService:e}){return g({config:{args:{layoutService:e},disclaimers:{NoDataExist:!0,OnlyNanDataMeasure:!0,OnlyNanDataDimensionContinuous:!0,LimitedData:{condition:()=>{const{isContinuous:t,isTwoDimensional:n}=e.meta;if(!t||!n)return!1;const i=e.getLayout().qHyperCube.qDimensionInfo[1];return sm.getDimensionSize(i)>Vr.maxNumberOfLines}},OnlyNegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.every(e=>{const{qMin:t,qMax:n}=e;return t<0&&n<0})}return!1},alignment:"center"},NegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.some(e=>{const{qMin:t}=e;return t<0})}return!1}}}}})}function um(e){return e.qIsOtherCell||-3===e.qElemNumber||-3===e.qElemNo}function cm(e){return e.some(um)}function dm(e,t){let n=NaN,i=NaN;return e.forEach(e=>{cm(e)||e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(n=Number.isNaN(n)?e.qNum:Math.min(e.qNum,n),i=Number.isNaN(i)?e.qNum:Math.max(e.qNum,i))})}),{min:n,max:i}}function mm(e){let t=NaN,n=NaN;if(!e.getLayoutValue("measureAxis.autoMinMax",!1)){const i=e.getLayoutValue("measureAxis.minMax");e.meta.isButterfly||"min"!==i&&"minMax"!==i||(t=+e.getLayoutValue("measureAxis.min")),"max"!==i&&"minMax"!==i||(n=+e.getLayoutValue("measureAxis.max"),e.meta.isButterfly&&(t=-n))}return{min:t,max:n,isExplicitMin:!Number.isNaN(t),isExplicitMax:!Number.isNaN(n)}}function hm(e,t){let n=NaN,i=NaN;return e.forEach(e=>{if(!cm(e)){let o=0,r=0;e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?r+=e.qNum:o+=e.qNum)}),n=Number.isNaN(n)?o:Math.min(o,n),i=Number.isNaN(i)?r:Math.max(r,i)}}),{min:n,max:i}}function fm(e,t){const n={};e.forEach(e=>{if(!cm(e)){const i=e[0].qElemNumber;n[i]=n[i]?n[i]:{min:0,max:0,cId:i},e.slice(t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?n[i].max+=e.qNum:n[i].min+=e.qNum)})}});let i=NaN,o=NaN;return Object.keys(n).forEach(e=>{i=Number.isNaN(i)?n[e].min:Math.min(n[e].min,i),o=Number.isNaN(o)?n[e].max:Math.max(n[e].max,o)}),{min:i,max:o}}function pm(e){return"number"==typeof e&&!Number.isNaN(e)}function gm(e){const{meta:t}=e,n=e.getHyperCubeValue("qMeasureInfo");return t.isButterfly?{min:Math.min(0,pm(n[1].qMax)?-n[1].qMax:0),max:Math.max(0,pm(n[0].qMax)?n[0].qMax:0)}:{min:Math.min(...n.filter(e=>pm(e.qMin)).map(e=>e.qMin)),max:Math.max(...n.filter(e=>pm(e.qMax)).map(e=>e.qMax))}}const{isNumber:ym}=Ds;function vm(e,t,n){for(let n=e.length-1;n>-1;n--)if(t(e[n]))return e[n];return n}function bm(e){return!Number.isNaN(+e.qNum)}function Sm(e){return e.qNum}function xm(e){return!Number.isNaN(+e.qNum)}function Mm(e){return e.qNum}function qm(e,t){return e.push(...t),e}const{getValueWithOffset:Cm,isNumber:Tm}=Ds,wm=5,km=.2;function Nm(e,t){return Math.abs(e/t)<wm||0===t}function Dm({layoutService:e,trendLineModel:t},n={}){const{stackedByMeasureExtractor:i=hm,stackedByDimensionExtractor:o=fm,straightExtractor:r=dm,measureInfoExtractor:s=gm,explicitExtractor:l=mm}=n,{meta:u}=e;return{extract({qDataPages:e,qStackedDataPages:n,others:i,count:o}){let r,a;if(Array.isArray(n)?({min:r,max:a}=this.extractFromStacked(n)):({min:r,max:a}=this.extractFromStraight(e,o)),t.query.hasTrendLines()){const{min:e,max:n}=t.query.getMinMax();r=Number.isFinite(e)?Math.min(r,e):r,a=Number.isFinite(n)?Math.max(a,n):a}const{min:s,max:l}=this.extractOthers(i),u=this.extractExplicit(),c=[0,r,a].filter(e=>Tm(e));let d=Math.min(...c),m=Math.max(...c);d=Nm(s,d)?Math.min(d,s):d,m=Nm(l,m)?Math.max(m,l):m;const h=[u.explicitMin,u.explicitMax,d,m].filter(e=>Tm(e));return r=Number.isNaN(u.explicitMin)?Math.min(...h):u.explicitMin,a=Number.isNaN(u.explicitMax)?Math.max(...h):u.explicitMax,r===a&&(Number.isNaN(u.explicitMin)?r=Cm(r,-km):Number.isNaN(u.explicitMax)&&(a=Cm(a,km))),{min:r,max:a,implicitMin:d,implicitMax:m,otherMin:s,otherMax:l,hasOtherMin:s<r,hasOtherMax:l>a,...u}},extractExplicit(){const{min:t,max:n,isExplicitMin:i,isExplicitMax:o}=l(e);return{hasExplicitMinMax:i||o,hasExplicitMin:i,hasExplicitMax:o,explicitMin:t,explicitMax:n}},extractFromStacked(e){const t=e.length?e[0].qData:[];return(n=t).length?{min:Math.min(...n[0].qSubNodes.filter(e=>ym(e.qMinNeg)).map(e=>e.qMinNeg)),max:Math.max(...n[0].qSubNodes.filter(e=>ym(e.qMaxPos)).map(e=>e.qMaxPos))}:{min:0,max:0};var n},extractFromStraight(t,n){const a=t.length?t[0].qMatrix:[];return u.isStackedByMeasure?i(a,n):u.isStackedByDimension?o(a,n):e.getHyperCubeValue("qHasOtherValues")?r(a,n):s(e)},extractOthers:e=>u.isStackedByDimension?function(e){const t=vm(a(e,"0.qData.0.qSubNodes",[]),um,{qMaxPos:0,qMinNeg:0});return{min:t.qMinNeg,max:t.qMaxPos}}(e):u.isGroupedByDimension?function(e){const t=a(e,"0.qMatrix",[]).filter(cm).reduce(qm,[]).filter(xm).map(Mm);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e):function(e){const t=vm(a(e,"0.qMatrix",[]),cm,[]).filter(bm).map(Sm);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e)}}function Lm(e){const t=function({reducedDataModel:e,layoutService:t,continuousDataModel:n}){const{meta:i,getHyperCubeValue:o}=t,r=e=>!e.length&&i.mode.K,a=e=>{const t=o("qStackedDataPages",[]);return{qStackedDataPages:t,others:e?t:[]}};return{resolve(){const t=o("qMeasureInfo").length,s=o("qDimensionInfo").length,l=o("qHasOtherValues");if(!i.isStacked&&!l)return Promise.resolve({qDataPages:[{}],count:t});if(i.isContinuous){const e=i.isStackedByDimension?s:t;return n.fetchMinMaxData().then(t=>({qDataPages:t,count:e}))}const u=i.isStackedByDimension?1:t;return e.fetchMinMaxData().then(e=>{if(r(e))return a(l);let t=[];return l&&(t=i.mode.K?o("qStackedDataPages",[]):o("qDataPages",[])),{qDataPages:e,count:u,others:t}})}}}(e),n=Dm(e);return t.resolve().then(e=>n.extract(e))}const Em="lasso",Om=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:i},o)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:i,options:{event:Em,enable(e,n){if(this.started===Em||!n)return!0;if(!o.actions.select.enabled()||!o.actions.lasso.enabled()||!o.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>e.key===t).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==Em&&(o.actions.select.emit("start",Em),this.chart.component(e).emit("lassoStart",t),this.started=Em)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),o.actions.select.emit("end",Em),"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});const Am=({targets:e,requireFailure:t,recognizeWith:n,components:i,eventName:o="tap"},r)=>{let a;const s=r.customTooltipModel?r.customTooltipModel.utils:void 0,l=s?r.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:o,interval:10,pointers:1,enable(t,n){return!n||!(!r.actions.select.enabled()&&!r.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(t=>-1!==e.indexOf(t.key)),a.length>0)}},events:{[o](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let i,o;return e.center?(({x:i}=e.center),({y:o}=e.center)):(i=e.clientX,o=e.clientY),{x:i-n.left,y:o-n.top}}(t,this.chart),u=r.hitRadius?r.hitRadius(a):0,c=u>0?{cx:n.x,cy:n.y,r:u}:n,d=r.shapesAt?r.shapesAt(c):this.chart.shapesAt(c,{components:e.map(e=>({key:e,propagation:"stop"})),propagation:"stop"}),m=this.chart.component("tooltip"),h="mouse"!==t.pointerType&&m&&m.show;if(!r.isLocked(a)&&!r.tooltipOnly&&r.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some(e=>"legend-cat"===e.type);if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,r.actions.select.brushSelectionIncludeMax=!1,r.actions.select.emit("start",o,e)),d.length&&i){this.chart.brushSelectionIncludeMax=!1,r.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof i?i(t,d):i;this.chart.brushFromShapes(d,{components:e}),r.actions.select.emit("end",o),(({largeDataService:e,chart:t})=>{(e?.meta||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:r.largeDataService,chart:this.chart})}}if(m&&r.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=r;if(e?.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,m,{nodes:n,opts:r,customTooltipModel:e})}else m.emit("show",t,{nodes:d})}else h&&m.emit("hide")}}}};const Im=({key:e,requireFailure:t,recognizeWith:n,eventName:i="tap"},o)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${i}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!o.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${i}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const Pm=({eventName:e,key:t,fillTargets:n=[],requireFailure:i,recognizeWith:o},r,a)=>({key:`event:${t}`,type:"Pan",requireFailure:i,recognizeWith:o,options:{event:e,enable(i,o){if(this.started===e||!o)return!0;if(!r.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:o.center.x,y:o.center.y}).filter(e=>-1!==n.indexOf(e.key)),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(o,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,r.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),r.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof r.updateOnMove&&r.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,r.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),r.actions.select.emit("end",e),this.started=!1,"function"==typeof r.updateOnEnd&&r.updateOnEnd()}}});function Rm(e,t){const n=function(e){const{key:t,targets:n,fillTargets:i,targetSelector:o,targetFillSelector:r,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:u=!1,multiple:c=!1,toLabel:d,onEdited:m}=e;return{key:t,type:"brush-range",layout:{dock:n.map(e=>`@${e}`).join(",")},on:m?{bubbleEnd(){m()}}:{},settings:{brush:u?{context:"selection",observe:!0}:"selection",scale:s,multiple:c,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:i,selector:o,fillSelector:r,fill:"rgba(82,204,82,0.2)"}}}}(e),i=Pm(e,t,"range");return{interactions:[e.onEdited?Im(e,t):null,i].filter(Boolean),components:[n]}}const zm={refLines:{minimumLayoutMode:"SPARK"},measureAxisTitle:{minimumLayoutMode:"XSMALL"},dimensionAxisTitle:{minimumLayoutMode:"XSMALL"},measureAxis:{minimumLayoutMode:"XSMALL"},dimensionAxis:{minimumLayoutMode:"XSMALL"},gridLines:{minimumLayoutMode:"XSMALL"},refLinesLabels:{minimumLayoutMode:"SMALL"},horizontalDimensionAxis:{minimumLayoutMode:{width:"XSMALL",height:"SMALL"}},verticalDimensionAxis:{minimumLayoutMode:{width:"SMALL",height:"XSMALL"}},horizontalDimensionAxisTitle:{minimumLayoutMode:{width:"XSMALL",height:"MEDIUM"}},verticalDimensionAxisTitle:{minimumLayoutMode:{width:"MEDIUM",height:"XSMALL"}}},Hm="inner-time-axis",Bm="outer-time-axis";const Fm={getMajorAxisMaxGlyphCount(e,t){let n=0;if(e.qDimensionInfo.length){const i=t?0:e.qDimensionInfo.length-1;n=sm.getMaxGlyphCount(e,i)}else e.qMeasureInfo.forEach(e=>{n=Math.max(n,e.qFallbackTitle.length)});return n},getAxisData(e,t){let n;return n=e.qDimensionInfo.length?a(e,t?"qStackedDataPages.0.qData.0.qSubNodes":"qDataPages.0.qMatrix"):e.qMeasureInfo,n},getBarAxisMaxGlyphCount(e,t){if(!e)return;const n=Fm.getAxisData(e,t),i=!e.qDimensionInfo.length,o=i||t?void 0:e.qDimensionInfo.length-1,r=Fm.getMajorAxisMaxGlyphCount(e,t),a=i?"qFallbackTitle":"qText";return na.getAdjustedMaxGlyphCount(r,n,o,a)},getGroupAxisMaxGlyphCount(e){if(!e)return;const t=Fm.getAxisData(e),n=sm.getMaxGlyphCount(e,0);return na.getAdjustedMaxGlyphCount(n,t,0)}};var jm=3,Vm=13;function _m(e,t,n,i){const{meta:o}=t.layoutService,r=[],a=!("none"===e.measureAxis.show),s=!("title"===e.measureAxis.show);o.isContinuous?r.push(...function(e,t,n,i){const{meta:o}=t.layoutService,{axis:r,grid:a}=t.themeService.getStyles(),s=t.styleService.axis.label.getStyle(),{auto:l,spacing:u}=t.layoutService.getLayoutValue("gridLine",{}),c=[],d="none"!==e.dimensionAxis.show&&"title"!==e.dimensionAxis.show,m=zm[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode,h={type:"grid-line",x:{},layout:{minimumLayoutMode:zm.gridLines.minimumLayoutMode},ticks:{stroke:a.line.major.color},minorTicks:{show:!1,stroke:a.line.minor.color},animations:{enabled:t.viewModel.animations.enabled,trackBy:bl.lines.trackBy,compensateForLayoutChanges:bl.lines.compensateForLayoutChanges}},f=!!e.showMiniChartForContinuousAxis&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:t.reducedDataModel.scales.major,brush:"selection",fill:"#6CB33F",opacity:.2}};if(o.isTime){if(d){const e=n?"end":"start",i=n?1:0,o="bottom"===t.dockService.meta.major.dock?0:1,a={label:{fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},majorGuideLine:{stroke:r.line.major.color},minorGuideLine:{stroke:r.line.minor.color}},d={type:"time-axis",renderer:"svg",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:m},preferredSize:()=>({size:2*parseFloat(s.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:e,label:{align:o,justify:i},guideLine:{major:{justify:i},minor:{align:o}}},style:a,animations:{enabled:t.viewModel.animations.enabled,trackBy:bl.axes.trackBy({isTime:!0}),compensateForLayoutChanges:bl.axes.compensateForLayoutChanges({isTime:!0})}};c.push(ne(!0,{},d,{key:Hm,scale:Jd.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!l&&0===u}},style:ne(!0,{},a,{line:{stroke:r.line.major.color},majorGuideLine:{stroke:r.line.minor.color},minorGuideLine:{stroke:r.line.major.color}})})),c.push(ne(!0,{},d,{key:Bm,scale:Jd.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})),c.push({type:"axis-overlay",key:"outer-axis-overlay",scale:Jd.SCALE.MAIN.MAJOR,layout:{dock:`@${Bm}`,minimumLayoutMode:m}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:Jd.SCALE.MAIN.MAJOR_INNER,layout:{dock:`@${Hm}`,minimumLayoutMode:m}}),c.push(f)}return c.push(ne(!0,{},h,{key:"inner-time-grid",x:{scale:Jd.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.line.minor.color}})),c.push(ne(!0,{},h,{key:"outer-time-grid",x:{scale:Jd.SCALE.MAIN.MAJOR}})),c}if(o.isContinuous){const e="continuous-axis";d&&(c.push({type:"axis",key:e,renderer:Nl(),scale:Jd.SCALE.MAIN.MAJOR,layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:m},settings:{labels:{align:0,offset:4,fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},ticks:{show:!0,stroke:r.line.major.color},line:{show:!i},minorTicks:{show:!1}},animations:{enabled:t.viewModel.animations.enabled,trackBy:bl.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:bl.axes.compensateForLayoutChanges({isContinuous:!0})}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:Jd.SCALE.MAIN.MAJOR,layout:{dock:`@${e}`,minimumLayoutMode:m}}),c.push(f)),c.push(ne(!0,{},h,{key:"continuous-grid",x:{scale:Jd.SCALE.MAIN.MAJOR},minorTicks:{show:!0}}))}return c}(e,t,n,i)):r.push(...function(e,t,n,i){if("none"===e.dimensionAxis.show)return[];const{meta:o}=t.layoutService,r=t.themeService.getStyles(),a=[],s=function(e,t){return!t.layoutService.meta.isGroupedByDimension||!e.legend.show||t.colorService.getMain().getSettings().field!==t.viewModel.fields.major}(e,t),l=function(e,t){return!(!t.layoutService.meta.isGroupedByDimension||e.legend.show&&t.colorService.getMain().getSettings().field===t.viewModel.fields.majorGroup)}(e,t),u="horizontal"===t.dockService.meta.major.orientation,c=u?e.dimensionAxis.label:"auto",d="horizontal"===c?void 0:t.dockService.meta.minor.size/4,m=t.styleService.axis.label.getStyle(),h={type:"axis",renderer:Nl(),layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:zm[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode},settings:{labels:{show:!("title"===e.dimensionAxis.show),mode:c,tiltAngle:n?-40:40,maxEdgeBleed:50,maxLengthPx:d,...m},line:{show:!i,stroke:r.axis.line.major.color}},brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.viewModel.animations.enabled,trackBy:bl.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:bl.axes.compensateForLayoutChanges({isHorizontal:u})}};l&&a.push(ne(!0,{},h,{key:"group-axis",scale:Jd.SCALE.MAIN.MAJOR_INNER,settings:{paddingEnd:s?10:4,labels:{mode:s?"horizontal":h.settings.labels.mode,maxGlyphCount:Fm.getGroupAxisMaxGlyphCount(e.qHyperCube),maxLengthPx:d},line:{show:(u||!s)&&h.settings.line.show}}}));const f=Fm.getBarAxisMaxGlyphCount(e.qHyperCube,o.isStackedByDimension);return s&&a.push(ne(!0,{},h,{key:Jd.COMPONENT.BAR_AXIS,scale:Jd.SCALE.MAIN.MAJOR,settings:{paddingEnd:4,labels:{maxGlyphCount:f,maxLengthPx:d,tiltThreshold:f>jm&&f<Vm?1:void 0},line:{show:!(u&&l)&&h.settings.line.show}}})),u||2!==a.length?a:[a[1],a[0]]}(e,t,n,i));const l=t.themeService.getStyles(),u=t.styleService.axis.label.getStyle();return a&&r.push({type:"axis",key:"y-axis",renderer:Nl(),formatter:Jd.FORMATTER.MINOR,layout:{dock:t.dockService.meta.minor.dock,minimumLayoutMode:zm.measureAxis.minimumLayoutMode},scale:Jd.SCALE.MAIN.MINOR,settings:{labels:{show:s,...u},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:t.viewModel.animations.enabled,trackBy:bl.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:bl.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.dockService.meta.minor.dock})}}),r}var Um={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}}};function $m({layoutService:e,discrete:t,flags:n}){const{isContinuous:i,isGrouped:o}=e.meta;if(i&&!n?.isEnabled("TLV_1060_CONTINUOUS_AXIS_BAR_WIDTH"))return 1;const r=(e.getLayoutValue("components",[])||[]).filter(e=>"bar"===e.key)[0];if(r?.style?.width){const{style:e}=r;return e.strokeWidth&&"none"!==e.strokeWidth&&!i?function(){const n=Um.BAR.STROKE.WIDTH[e.strokeWidth.toUpperCase()]/t.query.getItemSize(),i=e.width+n;return i>1?e.width-(i-1):e.width}:e.width}return o?.9:.7}const{isNumber:Wm}=Ds,Km=["$year","$yearquarter","$quarter","$yearmonth","$month","$weeknumber","$yearweek","$week","$weekday","$day","$date"],Gm={seconds:1/86400,minutes:1/1440,hours:1/24,days:1,weeks:7,months:365/12,quarters:91.25,years:365,number:1},Ym={$date:1,$day:1,$weekday:1,$week:1,$yearweek:7,$weeknumber:1,$month:1,$yearmonth:365/12,$quarter:1,$yearquarter:91.25,$year:365},Xm=({data:e,layout:t})=>{const n=t.qHyperCube?.qDimensionInfo?.[0]?.continuous?.period;if("auto"!==n)return Gm[n||"none"]||1;const i=t.qHyperCube?.qDimensionInfo?.[0]?.qTags||[];for(let e=0;e<Km.length;e+=1)if(-1!==i.indexOf(Km[e]))return Ym[Km[e]]||1;return(({data:e,layout:t})=>{const n=(t.qHyperCube?.qDimensionInfo?.[0]?.qAttrExprInfo||[]).find(e=>"firstDimensionDiff"===e.id);let i=Number(n?.qFallbackTitle);if(Wm(i))return i;const o=e.items.map(e=>e.timeStart.value);return i=Ls.findMinPositiveDistance(o),i})({data:e,layout:t})};function Jm({opts:e,MIN_BAR_WIDTH:t,isMiniChart:n=!1}){return({data:i,mainRect:o,maxBarWidth:r})=>{const{viewState:a,viewCache:s}=e,{min:l,max:u}=n?{min:s.get("continuousMin"),max:s.get("continuousMax")}:a.get("zoom"),c=Math.max(0,(({data:e,width:t,min:n,max:i,opts:o})=>{if(i===n)return t;const r=o.layoutService.getLayout(),a=(r.qHyperCube?.qDimensionInfo?.[0]?.continuous.stepSize||1)*Xm({data:e,layout:r});return a<=0?t:a/(i-n)*t})({data:i,width:o.width,min:l,max:u,opts:e}));return Math.max(t,Math.min(c,r))}}const Zm={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function Qm(e,t,n={}){const i=Jm({opts:e,MIN_BAR_WIDTH:2});return({data:o})=>{const{chart:r,viewState:a,viewCache:s,layoutService:l,discrete:u,flags:c}=e,d=r.component(t).rect;if(!o.items.length||!d)return 2;const{min:m,max:h}=a.get("zoom");if(n[[m,h]])return n[[m,h]];const f=l.getLayout();let p;n={};let g=Zm[Hr.getLayoutMode(d.width,Number.MAX_VALUE)];const y=f.qHyperCube.qDimensionInfo?.[0]?.continuous?.period;if(c.isEnabled("TLV_1060_CONTINUOUS_AXIS_BAR_WIDTH")&&y&&"none"!==y){g=d.width;p=$m({layoutService:l,discrete:u,flags:c})*i({data:o,mainRect:d,maxBarWidth:g})}else{const e=Math.abs(h-m),t=Math.abs(s.get("continuousMax")-s.get("continuousMin"));if(0===t)return g;const n=Math.min(e/t/.2,1),i=2*(1-(v=1-n))+g*v;p=Math.max(2,Math.min(g,i))}var v;return n[[m,h]]=p,n[[m,h]]}}function eh(e,t){const{hasExplicitMax:n,explicitMax:i}=t;return!!n&&e>i&&i<=0}function th(e,t){const{hasExplicitMin:n,explicitMin:i}=t;return!!n&&e<i&&i>=0}function nh(e,t){const{hasExplicitMax:n,explicitMax:i}=t;return!!n&&e>i&&i>0}function ih(e,t){const{hasExplicitMin:n,explicitMin:i}=t;return!!n&&e<i&&i<0}const oh="max",rh="min",ah={min:"Min",max:"Max"};function sh(e,t,n){return void 0===n?eh(e,t)||th(e,t):n===oh?eh(e,t):th(e,t)}function lh({minorMinMax:e,type:t}){return!(function({minorMinMax:e,type:t}){return!e[`hasExplicit${ah[t]}`]}({minorMinMax:e,type:t})||function({minorMinMax:e,type:t}){const n=t===oh?e.implicitMax:e.implicitMin;return!sh(Number(n.toFixed(13)),e,t)}({minorMinMax:e,type:t}))}function uh(e,{barComponent:t,type:n,isStacked:i}){const{viewCache:o,dockService:r,themeService:a}=e,s=o.get("minorMinMax");if(!s.hasExplicitMinMax)return!1;const l=n===oh?s.implicitMax:s.implicitMin;if(!sh(Number(l.toFixed(13)),s,n))return!1;const{orientation:u}=t.settings,c=n===oh?r.meta.minor.end:r.meta.minor.start;let d="end";i&&(d=n===oh?"sumOfPositives":"sumOfNegatives");const m=a.getStyles();return{type:"box-out-of-bounds",key:`bar-oob-${n}`,layout:{dock:c},data:t.data,brush:t.brush,settings:{orientation:u,major:t.settings.major,minor:t.settings.minor,dockValue:Zr.getDockValue(c),oob:ne({},t.settings.box,{fill:m.outOfRange.color,alignment:1,opacity:1,show:function(e){return!0!==e.datum.null?.value&&((!i||0!==e.datum[d].value)&&sh(e.datum[d].value,s,n))}})},animations:{enabled:e.viewModel.animations.enabled,compensateForLayoutChanges:bl.barOobs.compensateForLayoutChanges}}}function ch(e){return Math.min(Math.max(0,e),1)}const dh=(e,{chart:t,type:n,componentKey:i,collectionKey:o})=>{const{layoutService:r,dockService:a,viewCache:s}=e,{isStacked:l}=r.meta,u=s.get("minorMinMax"),{meta:c}=e.layoutService;if(!lh({minorMinMax:u,type:n}))return!1;let d;c.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:c.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);return{type:"box",key:`${Jd.COMPONENT.GHOST_BAR_OOB}-${n}`,data:{collection:o},settings:{orientation:a.meta.minor.orientation,major:{scale:Jd.SCALE.MAIN.MAJOR,fn:d},minor:{scale:Jd.SCALE.MAIN.MINOR,start:e=>ch(t.scale(Jd.SCALE.MAIN.MINOR)(e?.datum?.start?.value||0)),end(e){const i=t.scale(Jd.SCALE.MAIN.MINOR);let o="end";l&&(o="max"===n?"sumOfPositives":"sumOfNegatives");const r=e.datum[o]?e.datum[o].value:i[n]();return ch(i(r))}},box:{width:$m({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:2,fill:"none",stroke:"transparent",show:e=>{const i=t.scale(Jd.SCALE.MAIN.MINOR);let o="end";l&&(o="max"===n?"sumOfPositives":"sumOfNegatives");const r=e.datum[o]?e.datum[o].value:i.max();return"max"===n?r>i.max():r<i.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function mh(e,t){const{style:n,styleService:i,dockService:o}=t,r=i.label.getStyle(),a=r.useContrastColor&&!e.onBackground?function(e){return function(t){return ls.isDark(t.node.attrs.fill)?e.lightColor:e.darkColor}}(n):r.fill,s="horizontal"===o.meta.major.orientation,l=e.padding||{left:s?0:4,right:s?0:4,top:s?4:0,bottom:s?4:0};return{position:e.position,justify:e.justify,fill:a,overflow:e.overflow,background:e.background,padding:l}}function hh(e){return{placements:e.simplifiedPlacements.map(t=>mh(t,e)),label:e.label}}function fh(e,t){if(t){if(function(e,t){return eh(e,t)}(e,t))return-1;if(function(e,t){return th(e,t)}(e,t))return 1}return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}function ph(e,t,n,i){const o=fh(e,i);let r="up";return"vertical"===t&&o<0?r="down":"horizontal"===t&&(r=o>=0&&!n||o<0&&n?"right":"left"),r}function gh(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:i,isContinuous:o}=t.layoutService.meta;return!i||!o&&!!n.showSegmentLabels}function yh(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:i,isContinuous:o}=t.layoutService.meta;return!!i&&(!!o||!1!==n.showTotalLabels)}function vh(e,t,n,i){const o=[];return void 0!==e&&(o[e]={position:"outside",onBackground:!0,justify:0,overflow:i}),void 0!==t&&(o[t]={position:"inside",onBackground:!1,justify:n}),o}function bh({layout:e,component:t,minorScale:n},i,o){if(!gh(e,i))return!1;const{viewModel:r,ds:a,viewCache:s,layoutService:l,dockService:u,themeService:c}=i,{meta:d}=l,m=s.get("minorMinMax"),h=c.getStyles(),f=i.styleService.label.getStyle();let p;!d.isStacked&&(p=d.isStacked?1:0);const g=0===p?1:0,y=d.isStacked?.5:1,v=r.fields.minor[0],b=void 0===v?void 0:a.field(v).formatter();let S,x=-1;S=d.isStacked?d.isStackedByMeasure||!b?function(e){return e.data.segment.label}:function(e){return Math.abs(e.data.segment.value)>x?b(e.data.segment.value):""}:function(e){return e.data.end.label};const M={label:S,simplifiedPlacements:vh(p,g,y,d.isContinuous),style:h.label.value},q=[hh(ne(i,M))],C=[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>ph(e.data.end.value,u.meta.minor.orientation,o,m),labels:q,fontSize:parseInt(f.fontSize,10),fontFamily:f.fontFamily,linkData:bl.labels.linkData}}}],T={key:"bar-labels",type:"labels",renderer:Nl(),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:C},animations:{enabled:i.viewModel.animations.enabled,trackBy:bl.labels.trackBy,compensateForLayoutChanges:bl.labels.compensateForLayoutChanges}};return d.isStackedByDimension&&b&&(T.beforeRender=()=>{x=function(e,t,n){const i="vertical"===t.dockService.meta.minor.orientation?"height":"width",o=t.chart.component(e),r=o&&o.rect?o.rect[i]:1,a=n?n.min():0;return 9.999*((n?n.max():0)-a)/r}(t,i,n)}),T}function Sh(e,{fill:t}){return{[Jd.FORMATTER.MINOR]:{data:{fields:e.viewModel.fields.minor}},[Jd.FORMATTER.COLOR]:t&&t.data&&t.data.field?{data:{field:t.data.field}}:{}}}const xh=1,Mh=3;function qh(e){return e.getLayoutValue("gridLine.auto")}function Ch(e){return!qh(e)&&e.getLayoutValue("gridLine.spacing")===xh}function Th(e){return!qh(e)&&e.getLayoutValue("gridLine.spacing")===Mh}const wh=e=>({enabled:e.animations.enabled,trackBy:bl.lines.trackBy,compensateForLayoutChanges:bl.lines.compensateForLayoutChanges}),kh=(e,{themeService:t,layoutService:n,dockService:i,viewModel:o})=>{if(!qh(n)&&function(e){return!e.getLayoutValue("gridLine.spacing")}(n))return!1;const{grid:r}=t.getStyles(),a={key:"grid-line",type:"grid-line",layout:{minimumLayoutMode:zm.measureAxis.minimumLayoutMode},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!Ch(n)||((e,t)=>t%2==0),stroke:r.line.major.color},minorTicks:{show:Th(n),stroke:r.line.minor.color},animations:wh(o)};return a["horizontal"===i.meta.major.orientation?"y":"x"]=Jd.SCALE.MAIN.MINOR,a};function Nh(e,t){const n=[kh(0,t)];return n[0]&&n.push((({dockService:e,themeService:t,viewCache:n,viewModel:i})=>{const o=n.get("minorMinMax");if(o.min>0||o.max<0)return!1;const r=t.getStyles(),a={};return a["horizontal"===e.meta.minor.orientation?"x":"y"]=[{value:0,scale:Jd.SCALE.MAIN.MINOR,line:{stroke:r.grid.line.highContrast.color}}],{key:"high-contrast-grid-line",type:"ref-line",scale:Jd.SCALE.MAIN.MINOR,lines:a,animations:wh(i)}})(t)),n}const Dh="areaPan",Lh=e=>({type:"Pan",key:"panorama",options:{event:Dh,pointers:1,threshold:10,enable(t,n){return this.started===Dh||!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===Jd.COMPONENT.BAR)}},events:{areaPanstart(t){t.preventDefault(),this.started=Dh;const n=e.viewState.get("zoom");this[Dh]={min:n.min,max:n.max,size:e.chart.component(Jd.COMPONENT.BAR).rect.computedInner.width,span:n.max-n.min}},areaPanmove(t){t.preventDefault();const{span:n,min:i,max:o,size:r}=this[Dh],a=-t.deltaX/r;e.viewState.set("zoom",{min:Math.min(i+a*n,e.viewCache.get("continuousMax")-n),max:Math.max(o+a*n,e.viewCache.get("continuousMin")+n)})},areaPanend(e){e.preventDefault(),this.started=!1},areaPancancel(e){e.preventDefault(),this.started=!1}}});function Eh(e,t){if(e.layoutService.meta.isDiscrete)return{};const{viewCache:n,viewState:i,chart:o}=e,{rtl:r}=t,a=Pr.event.onZoom({viewCache:n,viewState:i,chart:o},{threshold:100,rtl:r,targetKey:Jd.COMPONENT.BAR}),s={last:0};return{type:"Pinch",key:"continuous-pinch-zoom",options:{event:"zoom",pointers:2,threshold:0,enable:(t,n)=>!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===Jd.COMPONENT.BAR)},events:{zoomstart(e){s.last=e.scale,e.preventDefault()},zoommove(e){const t=e.scale-s.last;(function(e){return Math.abs(e)>.01})(t)&&a(e.center,t>0?1:-1),e.preventDefault(),s.last=e.scale}}}}function Oh(e,t){const{viewCache:n,viewState:i,chart:o}=e,{rtl:r}=t,a=e.layoutService.meta.isContinuous?Pr.event.onZoom({viewCache:n,viewState:i,chart:o},{rtl:r,threshold:50,targetKey:Jd.COMPONENT.BAR}):void 0;return{type:"native",events:{wheel(t){let n,i=!1;if(e.actions.scroll.enabled()){const o={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(o).filter(e=>e.key===Jd.COMPONENT.BAR),n&&(e.layoutService.meta.isContinuous&&a(o,Math.sign(-t.deltaY)),i=!0)}!i&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter(e=>e.key===Jd.COMPONENT.LEGEND_COLOR_CAT),n&&(i=!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,n))),i&&t.preventDefault()}}}}const Ah=(e,t,n)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...Mu({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...n.gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[Lh(e),Eh(e,t)]]});function Ih(e,t){const n=e.tooltipService.getInteractions(),i=[Ah(e,t,n),Oh(e,t),Mu({...e,componentKey:"scrollbar",rtl:t.rtl}).native,n.native];return e.layoutService.meta.isDiscrete&&i.push(e.discrete.interactions.native),i}const Ph=e=>({enabled:e.animations.enabled,compensateForLayoutChanges:bl.bars.compensateForLayoutChanges});function Rh(e,t,{collectionKey:n}){const{continuousDataModel:i,reducedDataModel:o,colorService:r,layoutService:a,viewModel:s}=t,{meta:l}=a,u=a.getLayout(),c=u.qHyperCube.qDimensionInfo?.[0]?.continuous?.period,d=c&&"none"!==c,m=t.flags.isEnabled("TLV_1060_CONTINUOUS_AXIS_BAR_WIDTH")&&l.isContinuous&&d?function(e,t,n={}){const i=Jm({opts:e,MIN_BAR_WIDTH:2,isMiniChart:!0});return({data:o})=>{const{chart:r,viewCache:a,layoutService:s,discrete:l,flags:u}=e,c=r.component(t).rect;if(!o.items.length||!c)return 2;const d=a.get("continuousMin"),m=a.get("continuousMax");if(n[[d,m]])return n[[d,m]];const h=s.getLayout();let f;n={};let p=Zm[Hr.getLayoutMode(c.width,Number.MAX_VALUE)];const g=h.qHyperCube.qDimensionInfo?.[0]?.continuous?.period;return u.isEnabled("TLV_1060_CONTINUOUS_AXIS_BAR_WIDTH")&&g&&"none"!==g?(p=c.width,f=$m({layoutService:s,discrete:l,flags:u})*i({data:o,mainRect:c,maxBarWidth:p}),n[[d,m]]=f,n[[d,m]]):2}}(t,Jd.COMPONENT.MINI_BAR):2;return{type:"box",key:Jd.COMPONENT.MINI_BAR,layout:{dock:"@scrollbar"},show:()=>i.getDimensionCardinality()>1,data:{collection:n},settings:{box:ne(!0,{},e.settings.box,{minWidthPx:m,fill:r.getMini().getColor(),strokeWidth:0}),major:ne(!0,{},e.settings.major,{scale:o.scales.major}),minor:e.settings.minor,orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Ph(s)}}const zh=(e,t,{collectionKey:n})=>{if(!uu({layoutService:t.layoutService}).miniChart)return!1;if(t.reducedDataModel.mode.isContinuous)return Rh(e,t,{collectionKey:n});const{mode:i,scales:o}=t.reducedDataModel;let r;return i.isGroupedByDimension&&!i.isReduced?r=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:i.isGroupedByMeasure&&(r=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2),{type:"box",key:Jd.COMPONENT.MINI_BAR,layout:{dock:"@scrollbar"},show:()=>t.discrete.query.getCanScroll(),data:{collection:n},settings:{box:{...e.settings.box,fill:i.isReduced||i.isStackedByDimension?t.colorService.getMain().getSettings().others:t.colorService.getMain().getColor(),strokeWidth:0},major:{scale:o.major,fn:r},minor:{scale:o.minor},orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Ph(t.viewModel)}},{measureText:Hh}=t.renderer("svg")();function Bh(e,t,n){const i=function(e){const t=ne(!0,{},e);return delete t.data,t}(t.minor),o=function(e,t,{majorScaleInvert:n,maxPxStep:i,align:o,getProp:r}){let a={invert:n,data:{extract:e.mode.isDimensionless?e.fields.minor.map((e,t)=>({field:e,value:t})):{source:"miniCube",field:"qDimensionInfo/0"}},type:e.mode.isDimensionless?"band":void 0,maxPxStep:i,align:o};return e.mode.isStackedByDimension?a.data.extract.field="qDimensionInfo/1":e.mode.isGroupedByDimension?e.mode.isReduced||(a.data={source:"miniCube",hierarchy:{value:e=>e.qElemNumber}}):e.mode.isGroupedByMeasure?(a=ne(!0,{},t),a.data.extract.source="miniCube"):e.mode.isContinuous&&(a=ne(!0,{},t,{min:()=>r("continuousMin"),max:()=>r("continuousMax")})),a}(e,t.major,n);return{reducedMinor:i,reducedMajor:o}}const Fh=50,jh=100,Vh=200;function _h(e,t){const n=function(e){const t=e.getLayoutValue("measureAxis.spacing",1);switch(t){case.5:return Fh;case 1:return jh;case 2:return Vh;default:return 125*t}}(t);return Math.max(1,Math.round(e/n))}function Uh(e,t,n){return 0===t||t===Math.floor((n.length-1)/2)||t===n.length-1}function $h(e,t,n){return 0===t||0===e||t===n.length-1}function Wh(e){for(let t=1;t<e.length;t++)if(e[t]===e[t-1])return!0;return!1}function Kh(e,t,n,i,o){e.domain([t,n]),e.nice(10);const[r,a]=e.domain();let s=e.ticks(10);const l=function(e){return e.length%2==0}(s),u=function(e){const t=Math.round(.3*e.length),n=t,i=e.length-t;return e.slice(n,i).some(e=>0===e)}(s),c=u?$h:Uh;s=s.filter(c),l&&!u&&!i&&s.length>1&&(s=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const d=o?o.formatter(Jd.FORMATTER.MINOR):void 0;return Wh(d?s.map(d):s)&&(s=[s[0],s[s.length-1]]),{roundedMin:r,roundedMax:a,ticks:s}}function Gh(e,t,n,i,o,r,a,s){const l=r.formatter(Jd.FORMATTER.MINOR),u=s.getStyles(),c="horizontal"===a.meta.major.orientation?"height":"width",d=e=>Hh({text:e,fontSize:u.axis.label.name.fontSize,fontFamily:u.axis.label.name.fontFamily})[c];let[m,h]=e.domain(),f=e.ticks(i);function p(){const e=f.map(l);return!Wh(e)&&function(e){const t=o/f.length;return Math.max(...e.map(d))<=t}(e)}for(let o=i-1;o>0&&!p();o--)e.domain([t,n]),e.nice(o),[m,h]=e.domain(),f=e.ticks(o);return{roundedMin:m,roundedMax:h,ticks:f}}const Yh=(e,t)=>e.value-t.value,Xh=e=>({value:e,isMinor:!1}),Jh=e=>({value:e,isMinor:!0});function Zh(e,t,n){const i=Number.isNaN(t)&&Number.isNaN(n)?3:2;return e.filter(e=>(e=>Number.isNaN(t)||e>=t)(e)&&(e=>Number.isNaN(n)||e<=n)(e)).length<=i}function Qh({chart:e,viewCache:t,dockService:n,layoutService:i,themeService:o,viewModel:r,ds:a}){const{isButterfly:s}=i.meta,{explicitMin:l,explicitMax:u,hasExplicitMin:c,hasExplicitMax:d}=t.get("minorMinMax"),{min:h,max:f}=function(e){let{min:t,max:n}=e.get("minorMinMax");return t===n&&0===t&&(t-=1,n+=1),{min:t,max:n}}(t),p=s?Math.max(Math.abs(h),Math.abs(f)):f,g=s?-p:h,y=m(()=>{const s=function(e,t,n){let i;return e?i=n.meta.chart.size:({rect:i}=t.component(Jd.COMPONENT.BAR)),"horizontal"===n.meta.major.orientation?i.height:i.width}(t.get("isPreRender"),e,n),m=_h(s,i),h=function(e,t,n){const i=fn().domain([e,t]);return i.nice(n),i}(g,p,m);let f,y,v=[];"SPARK"===n.meta.chart.mode?({roundedMin:f,roundedMax:y}=function(e,t){return{roundedMin:e,roundedMax:t}}(g,p)):(({roundedMin:f,roundedMax:y,ticks:v}=Gh(h,g,p,m,s,e,n,o)),Zh(v,l,u)&&({roundedMin:f,roundedMax:y,ticks:v}=Kh(h,g,p,c||d,e)));const b=function(e,t){const n=[];for(let i=0;i<e.length-1;i++){const o=e[i],r=(e[i+1]-o)/(t+1);for(let e=1;e<=t;e++)n.push(o+r*e)}return n}(v,1);v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.unshift(t),n.filter(e=>e>=t)):n}(c,l,v),v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.push(t),n.filter(e=>e<=t)):n}(d,u,v);let S=function(e,t){return[...e.map(Xh),...t.map(Jh)].sort(Yh)}(v,b);if(i.meta.isButterfly){const e=r.fields.minor[0],t=void 0===e?void 0:a.field(e).formatter();"function"==typeof t&&(S=S.map(e=>({...e,label:t(Math.abs(e.value))})))}return{roundedMin:f,roundedMax:y,ticks:S}},()=>t.get("isPreRender"));return{values:()=>y().ticks,min:()=>c?l:y().roundedMin,max:()=>d?u:y().roundedMax}}function ef(e,{picasso:t,discrete:n,layoutService:i,dockService:o,viewModel:r,viewCache:a,reducedDataModel:s,colorService:l,themeService:u,viewState:c,chart:d,ds:m},{localeInfo:h,rtl:f}){const{meta:p}=i,{fields:g}=r,y=()=>{if("custom"!==i.getLayoutValue("dimensionAxis.axisDisplayMode"))return Math.min(200,o.meta.chart.size["horizontal"===o.meta.major.orientation?"height":"width"]/4)},v=!("none"===i.getLayoutValue("measureAxis.show"))?(b=o.meta.minor.orientation,S=o.meta.minor.dock,"vertical"===b?"near"===S||"left"===S?0:1:"near"===S||"bottom"===S?1:0):.5;var b,S;const x={},M="vertical"===o.meta.minor.orientation&&f,q=l.getMain().getScales(),C=l.getMini().getScales();if(Object.assign(x,q,{reducedFill:C.reducedFill}),x[Jd.SCALE.MAIN.MINOR]=function({chart:e,viewModel:{fields:t},dockService:n,viewCache:i,viewModel:o,layoutService:r,themeService:a,ds:s},{rtl:l}){const u=Qh({chart:e,dockService:n,viewCache:i,layoutService:r,themeService:a,viewModel:o,ds:s}),c={invert:"vertical"===n.meta.minor.orientation||l,ticks:{values:u.values},minorTicks:{count:1},min:u.min,max:u.max};return r.meta.isStacked||(c.data={source:"qHyperCube",fields:t.minor}),c}({chart:d,viewModel:r,dockService:o,viewCache:a,layoutService:i,themeService:u,ds:m},{rtl:f}),p.isGroupedByDimension)[Jd.SCALE.MAIN.MAJOR_INNER,Jd.SCALE.MAIN.MAJOR].forEach((e,t)=>{x[e]={invert:M,data:{source:"qHyperCube",hierarchy:{label:e=>e.qText?e.qText:"",value:e=>e.qElemNumber,props:{...r.selectionDimensionProp(t),group:p.isGroupedByDimension?{field:g.majorGroup}:void 0}}},label:({datum:e})=>e.label,ticks:{depth:t+1},maxPxStep:y,align:v}}),r.isDimensionLocked(0)||(x[Jd.SCALE.MAIN.MAJOR_INNER].data.hierarchy.props.axisSelectionDimension={field:0});else if(p.isGroupedByMeasure)x[Jd.SCALE.MAIN.MAJOR]={type:"group-by-measure",invert:M,data:{extract:{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},measureCount:e.qHyperCube.qMeasureInfo.length,maxPxStep:y,align:v};else if(p.isTime){const{innerTime:e,outerTime:n}=function(e,t){const{layoutService:n,viewModel:i,viewCache:o,picasso:r,viewState:a,localeInfo:s,themeService:l}=e,u=()=>n.getHyperCubeValue("qAxisData.qAxis",[]),c=r.formatter("q-time"),d=l.getStyles(),m=e=>Hh({text:e,fontSize:d.axis.label.name.fontSize,fontFamily:d.axis.label.name.fontFamily});o.set("qTimeAxisCache",[]);const h={get:(e,t=0)=>{const n=o.get("qTimeAxisCache");return n[t]&&n[t][0]===e?n[t][1]:void 0},set:(e,t,n=0)=>{o.get("qTimeAxisCache")[n]=[e,t]},key:({distance:e})=>{const{min:t,max:n}=a.get("zoom"),i=(n-t)/(o.get("continuousMax")-o.get("continuousMin")),r=u().map(e=>e.qName);return[e,Number.parseFloat(i).toFixed(12),...r].toString()}};return{innerTime:{data:{field:i.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:i.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:m},ticks:{generator:{type:"d3",initialMin:a.get("zoom").min},level:"inner",anchor:"start",clamp:!0},cache:h},outerTime:{data:{field:i.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:i.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:m},ticks:{generator:{type:"d3"},level:"outer",anchor:"start",clamp:!0},cache:h}}}({picasso:t,localeInfo:h,viewState:c,viewModel:r,viewCache:a,themeService:u,layoutService:i},f);x[Jd.SCALE.MAIN.MAJOR_INNER]=e,x[Jd.SCALE.MAIN.MAJOR]=n}else p.isContinuous?x[Jd.SCALE.MAIN.MAJOR]={type:"linear",invert:M,data:{extract:{key:"qHyperCube",field:g.majorNumeric}},ticks:{forceBounds:!0,count:c.get("zoom").min===c.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>c.get("zoom").min,max:()=>c.get("zoom").max}:x[Jd.SCALE.MAIN.MAJOR]={invert:M,data:{extract:p.isDimensionless?g.minor.map((t,n)=>({field:t,label:()=>e.qHyperCube.qMeasureInfo[n].qFallbackTitle,value:n})):{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},type:p.isDimensionless?"band":void 0,maxPxStep:y,align:v};const{reducedMinor:T,reducedMajor:w}=Bh(s,{major:x[Jd.SCALE.MAIN.MAJOR],minor:x[Jd.SCALE.MAIN.MINOR]},{majorScaleInvert:M,maxPxStep:y,align:v,getProp:a.get});return p.isDiscrete&&(x[Jd.SCALE.MAIN.MAJOR].range=n.query.getScaleRange,p.isGroupedByDimension&&(x[Jd.SCALE.MAIN.MAJOR_INNER].range=n.query.getScaleRange)),x[s.scales.major]=w,x[s.scales.minor]=T,x}function tf(e,t,n){const{layoutService:i,colorService:o}=e;return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[Am(e,t)],components:[]}}({targets:[i.meta.isStackedByDimension&&i.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?Jd.COMPONENT.STACK_TOTAL_BAR:Jd.COMPONENT.BAR,Jd.COMPONENT.BAR_AXIS,Jd.COMPONENT.GROUP_AXIS,"outer-axis-overlay","inner-axis-overlay",Jd.COMPONENT.LEGEND_COLOR_CAT],components(e,t){const i={action:e.srcEvent.ctrlKey||n?"set":"toggle",contexts:["selection"],key:t[0].key};return Jd.COMPONENT.BAR===t[0].key?[{...i,data:["selectionDimension"]}]:[Jd.COMPONENT.BAR_AXIS,Jd.COMPONENT.GROUP_AXIS].includes(t[0].key)?[{...i,data:["selectionDimension","axisSelectionDimension"]}]:[i]}},{...e,isLocked:n=>n.some(e=>e.key===Jd.COMPONENT.LEGEND_COLOR_CAT)?o.getMain().isSelectionLocked({isMeasureSelectionLocked:t}):e.isLocked(n)})}function nf(e){const t=e.layoutService.meta.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1;return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},i=(({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},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}}}))(n);return{interactions:[Om(n,t)],components:[i]}}({key:"lasso",componentTargetKey:Jd.COMPONENT.BAR,components:[t?{key:Jd.COMPONENT.STACK_TOTAL_BAR,contexts:["selection"],action:"add"}:{key:Jd.COMPONENT.BAR,contexts:["selection"],action:"add",data:["selectionDimension"]}]},e)}function of(e){return function(e,t){const n=function(e){const{key:t,targets:n,components:i,fillTargets:o,dock:r}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map(e=>`@${e}`).join(",")},settings:{multiple:!0,brush:{components:i},direction:"left"===r||"right"===r?"vertical":"horizontal",bubbles:{align:"left"===r||"top"===r?"end":"start",placement:"inside"},target:{components:o,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[Pm(e,t,"area")],components:[n]}}({eventName:"discreteRange",components:[{key:Jd.COMPONENT.BAR,contexts:["selection"],action:"set",data:["selectionDimension"]}],key:"discreteRangeBrush",targets:["group-axis",Jd.COMPONENT.BAR_AXIS,Jd.COMPONENT.BAR],fillTargets:["group-axis",Jd.COMPONENT.BAR_AXIS],dock:e.dockService.meta.major.dock},e)}function rf(e,t,n){const{selectionService:i}=e,{isUnsupportedFeature:o}=t,r=void 0===n,a=i.getIsSingleSelect(n),s=tf(e,r,a);if(r||a)return{components:[...s.components],gestures:[...s.interactions]};const l=nf(e),u=function(e,t){return e.layoutService.meta.isStacked||e.layoutService.meta.isButterfly||t?.("rangeSelections")?{components:[],interactions:[]}:Rm({eventName:"measureRange",key:"measureRangeBrush",targets:["y-axis",Jd.COMPONENT.BAR],fillTargets:["y-axis"],dock:e.dockService.meta.minor.dock,scale:Jd.SCALE.MAIN.MINOR,onEdited(){e.actions.select.emit("end","measureRange")}},e)}(e,o),c=function(e){return e.layoutService.meta.isContinuous?Rm({eventName:"continuousRange",key:"continuousRangeBrush",targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",Jd.COMPONENT.BAR]:["continuous-axis",Jd.COMPONENT.BAR],fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],observeBrush:!0,multiple:!0,dock:e.dockService.meta.major.dock,scale:e.layoutService.meta.isTime?Jd.SCALE.MAIN.MAJOR_INNER:Jd.SCALE.MAIN.MAJOR,toLabel({datum:t,data:n,scale:i}){const o=e.layoutService.meta.isTime?i.formatter():e.chart.formatter(Jd.FORMATTER.MINOR),r=e.chart&&e.chart.brushSelectionIncludeMax;return`${t!==Math.max(...n)||r?"":"<"}${o(t)}`}},e):{components:[],interactions:[]}}(e),d=of(e);return{components:[...s.components,...l.components,...u.components,...d.components,...c.components],gestures:[...l.interactions,...s.interactions,...u.interactions,...d.interactions,...c.interactions]}}const{isNumber:af}=Ds;function sf({layoutService:e,viewModel:t,dockService:n}){const{meta:i}=e;if(!i.isStackedByDimension||i.isContinuous)return!1;const{fields:o}=t,r=e.getLayoutValue("components",null),a=r?r.filter(e=>"bar"===e.key)[0]:null;return{key:"shadow-bar",type:"box",data:{extract:[{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.filter(e=>af(e.qMaxPos)).map(e=>e.qMaxPos).reduce((e,t)=>e+t,0).toFixed(13));var t}},end:{value:e=>af(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0}}},{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.filter(e=>af(e.qMinNeg)).map(e=>e.qMinNeg).reduce((e,t)=>e+t,0).toFixed(13));var t}},end:{value:e=>af(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0}}}]},settings:{major:{scale:Jd.SCALE.MAIN.MAJOR},minor:{scale:Jd.SCALE.MAIN.MINOR},orientation:n.meta.minor.orientation,box:{width:a?.style?.width&&a.style.width>0?a.style.width:.7,fill:()=>({type:"pattern",fill:"rgba(165, 165, 165, 0.8)",width:4,height:4,shapes:[{type:"rect",x:0,y:3,width:1,height:1},{type:"rect",x:1,y:2,width:1,height:1},{type:"rect",x:2,y:1,width:1,height:1},{type:"rect",x:3,y:0,width:1,height:1}]})},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:t.animations.enabled,trackBy:bl.shadowBars.trackBy,compensateForLayoutChanges:bl.bars.compensateForLayoutChanges}}}const lf={min:"Min",max:"Max"};function uf(e,t,n){const i=n?e.implicitMax:e.implicitMin;return!function(e,t,n){return void 0===n?nh(e,t)||ih(e,t):n===oh?nh(e,t):ih(e,t)}(Number(i.toFixed(13)),e,t)}function cf(e,{barComponent:t,type:n,isStacked:i}){const{viewCache:o,layoutService:r,dockService:a}=e,s=o.get("minorMinMax"),l=n===oh;if(function(e,t){return!e[`hasOther${lf[t]}`]}(s,n)){if(function(e,t){return!e[`hasExplicit${lf[t]}`]}(s,n))return!1;if(uf(s,n,l))return!1}if(function(e,t,n){const i=n?e=>e<0:e=>e>0;return e[`hasExplicit${lf[t]}`]&&i(e[`explicit${lf[t]}`])}(s,n,l))return!1;let u="end";i&&(u=l?"sumOfPositives":"sumOfNegatives");const c=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(()=>e.chart.scale(Jd.SCALE.MAIN.MINOR)[n]()),d=l?e=>e.datum[u].value>c():e=>e.datum[u].value<c(),m=Jd.COMPONENT.BAR,h=e.layoutService.getLayoutValue("components",[]),f=h?h.filter(e=>e.key===m)[0]:null;return{type:"box-sliced-hat",key:`sliced-hat-${n}`,layout:{dock:l?a.meta.minor.end:a.meta.minor.start},data:t.data,brush:t.brush,settings:{orientation:t.settings.orientation,major:t.settings.major,minor:t.settings.minor,hat:ne({},t.settings.box,{fill:r.meta.isStacked?"#999":t.settings.box.fill,alignment:1,opacity:1,show:d,width:$m({layoutService:e.layoutService,discrete:e.discrete}),strokeWidth:f?.style?.strokeWidth?Um.BAR.STROKE.WIDTH[f.style.strokeWidth.toUpperCase()]:Um.BAR.STROKE.WIDTH.NONE,stroke:f?.style?.strokeColor?.color??Um.BAR.STROKE.COLOR})}}}function df(e,{collectionKey:t},n){const{meta:i}=e.layoutService,{fields:o}=e.viewModel,r=i.isStackedByDimension&&!i.isContinuous?"qValue":"qNum";function a(t,n){const o=e.ds.field(t).raw(),a=e.ds.field(t).formatter(),s=$r.shouldUseFormat(o),l=i.isButterfly&&n>0;return{field:t,reduceLabel:"none",value:e=>{return"NaN"===e[r]?0:(t=e[r],l&&0!==t?-t:t);var t},label:e=>s?(e=>"NaN"===e[r]?"-":a(e[r]))(e):e.qText}}function s(e){if(!i.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[r]<0}}const l=i.isStackedByDimension?e=>"NaN"===e.qValue:e=>!!e.qIsNull;const u={key:t,data:{extract:o.minor.map((t,r)=>{const u=e.colorService.getMain().getDatumProps(r),c=e.colorService.getMini().getDatumProps(r),d=u[Object.keys(u)[0]],m=d?.field,h=m?{field:m,reduceLabel:"none",value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}:void 0,f={field:i.isDimensionless?t:o.major,props:{...e.viewModel.selectionDimensionProp(),axisSelectionDimension:{field:0},start:0,end:a(t,r),negative:s(t),null:(p=t,{field:p,reduceLabel:"none",reduce:"first",value:l}),segment:i.isStacked?a(t):void 0,group:i.isGroupedByDimension?{field:o.majorGroup}:void 0,stack:i.isStacked?{field:o.majorStack}:void 0,measureIndex:i.isGroupedByDimension||i.isStackedByDimension?void 0:r,timeStart:i.isContinuous?{field:o.majorNumeric}:void 0,timeEnd:i.isContinuous?{field:o.majorNumeric}:void 0,fillTooltip:h,...u,...c,id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${r}`},customTooltipAttrExps:0!==i.dimensionCount?bc.getNode(e.layoutService.getLayout(),i):void 0}};var p;return i.isDimensionless&&(f.value=r),void 0!==n&&(f.source=n),$r.deleteUndefinedProperties(f.props),f}),filter:i.isButterfly?e=>!e.negative.value:void 0}};return i.isStacked&&(u.data.stack={stackKey:e=>e.stack.value,value:e=>e.end.value,offset:"diverging"}),u}const{isNumber:mf}=Ds;function hf({layoutService:e,viewModel:t},{collectionKey:n}){const{meta:i}=e,{fields:o}=t;if(!i.isStacked)return!1;let r;return r=i.isStackedByMeasure?function(e,t){const n={field:0,props:{sumOfPositives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t>0?e+t:e,0),reduceLabel:"none"},sumOfNegatives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t<0?e+t:e,0),reduceLabel:"none"},null:{fields:t.minor.map(e=>({field:e})),value:e=>Array.isArray(e)&&e.every(e=>"NaN"===e),reduceLabel:"none"}}};if(e.isContinuous){const e={field:t.major,value:e=>e.qNum,reduceLabel:"none"};n.props.timeStart=e,n.props.timeEnd=e,n.value=e=>e.qNum}return n}(i,o):function(e,t){if(!e.isContinuous)return{field:t.majorStack,reduceLabel:"none",props:{sumOfPositives:{value:e=>mf(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0},sumOfNegatives:{value:e=>mf(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0},null:{value:e=>{const{qSubNodes:t=[]}=e;return t.every(e=>"NaN"===((e.qSubNodes||[])[0]||{}).qValue)}}}};const n={field:t.majors[0],value:e=>e.qNum,reduceLabel:"none"};return{field:t.majorStack,trackBy:e=>e.qNum,reduce:e=>e[0],props:{sumOfPositives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t>0?e+t:e,0)},sumOfNegatives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t<0?e+t:e,0)},timeStart:n,timeEnd:n}}}(i,o),{key:n,data:{extract:r}}}const ff="main-collection",pf="stack-total-collection";function gf(e,{collectionKey:t}){const{layoutService:n,colorService:i,reducedDataModel:{fields:o,mode:r}}=e,{meta:a}=n,s=a.isStackedByDimension&&!a.isContinuous?"qValue":"qNum";function l(e,t){if(!a.isButterfly)return{field:e};const n=t>0;return{field:e,value:e=>{return"NaN"===e[s]?0:(t=e[s],n&&0!==t?-t:t);var t}}}function u(e){if(!a.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[s]<0}}return{key:t,data:{extract:o.minor.map((e,t)=>{const n=r.isReduced?{}:i.getMain().getDatumProps(t),a={start:0,end:l(e,t),negative:u(e),group:{field:o.majorGroup},measureIndex:t,...n},s={source:"miniCube",field:r.isDimensionless?e:o.major,props:a};return r.isDimensionless&&(s.value=t),s}),filter:a.isButterfly?e=>!e.negative.value:void 0}}}const yf="mini-collection",vf="mini-stack-collection",bf="mini-continuous-collection",Sf="miniCube",xf=(e,t)=>{const n=(e=>{const t=[df(e,{collectionKey:ff})];return e.layoutService.meta.isStacked&&t.push(hf(e,{collectionKey:pf})),t})(t),i=((e,t)=>{const n=[];return uu({layoutService:t.layoutService}).miniChart&&(t.reducedDataModel.mode.isContinuous?n.push(df(t,{collectionKey:bf},Sf)):t.layoutService.meta.isStacked?n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:i,mode:o}}=e;return{key:t,data:{extract:i.minor.map((e,t)=>{const r={end:{field:e,reduceLabel:"none"},...o.isStackedByMeasure&&!o.isReduced?n.getMain().getDatumProps(t):{}};return o.isContinuous&&(r.timeStart={field:i.major,value:e=>e.qNum},r.timeEnd=r.timeStart),{source:"miniCube",field:i.major,props:r}}),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}}(t,{collectionKey:vf})):n.push(gf(t,{collectionKey:yf}))),n})(0,t);return n.concat(i)};function Mf(e,t,n,i){const o=[{position:e,onBackground:!0,justify:0,overflow:i}];if(t){const t={fill:"#e6e6e6",padding:{left:2,right:2,top:2,bottom:2}};o.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return o}function qf({layout:e,component:t},n,i){if(!yh(e,n))return!1;const{layoutService:o,chart:r,dockService:a,viewModel:s,themeService:l,styleService:u}=n,{meta:c}=o,d=!gh(e,n),m=l.getStyles(),h=u.label.getStyle(),f=h.useContrastColor;function p(e){const t=r.formatter(Jd.FORMATTER.MINOR);return t?t(e):e}const g={label:function(e){return 0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":p(e.data.sumOfPositives.value)},simplifiedPlacements:Mf("outside",d,f,c.isContinuous),style:m.label.value},y={label:function(e){return 0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":p(e.data.sumOfNegatives.value)},simplifiedPlacements:Mf("opposite",d,f,c.isContinuous),style:m.label.value},v=[hh(ne(n,g)),hh(ne(n,y))];return{key:"stack-total-labels",type:"labels",renderer:Nl(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>ph(e.data.sumOfPositives.value,a.meta.minor.orientation,i),labels:v,fontSize:parseInt(h.fontSize,10),fontFamily:h.fontFamily,linkData:bl.labels.linkData}}}]},animations:{enabled:s.animations.enabled,trackBy:bl.labels.trackBy,compensateForLayoutChanges:bl.labels.compensateForLayoutChanges}}}function Cf(e,t,n){const i=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return i.push({position:"inside",onBackground:!1,justify:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),i}function Tf({layout:e,type:t},n){const{layoutService:i,viewCache:o,themeService:r,styleService:a}=n,{meta:s}=i,{isStacked:l}=s;if(!l&&!gh(e,n)||l&&!yh(e,n))return!1;const u=o.get("minorMinMax");if(!u.hasExplicitMinMax||t===oh&&0===u.max||t===rh&&0===u.min)return!1;if(!sh(t===oh?u.implicitMax:u.implicitMin,u,t))return!1;const c=r.getStyles(),d=a.label.getStyle();let m=e=>e.data.end.label;s.isStacked&&(m=t===oh?function(e){if(sh(e.data.sumOfNegatives.value,u,t)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value,i=n.chart.formatter(Jd.FORMATTER.MINOR);return i?i(t):t}return""}:function(e){if(sh(e.data.sumOfPositives.value,u,t)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value,i=n.chart.formatter(Jd.FORMATTER.MINOR);return i?i(t):t}return""});const h={label:m,simplifiedPlacements:Cf("outside",0,s.isContinuous),styles:c},f={label:m,simplifiedPlacements:Cf("opposite",0,s.isContinuous),styles:c},p=[hh(ne(n,h)),hh(ne(n,f))],g="vertical"===n.dockService.meta.minor.orientation?"down":"right",y=[{component:`${Jd.COMPONENT.GHOST_BAR_OOB}-${t}`,selector:"rect",strategy:{type:"bar",settings:{direction:g,labels:p,fontSize:parseInt(d.fontSize,10),fontFamily:d.fontFamily,linkData:bl.labels.linkData}}}];return{key:`bar-oob-labels-${t}`,type:"labels",renderer:Nl(),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:y},animations:{enabled:n.viewModel.animations.enabled,trackBy:bl.labels.trackBy,compensateForLayoutChanges:bl.labels.compensateForLayoutChanges}}}function wf(e){return"all"===e||"title"===e}function kf(e,t,n){if(!wf(e.dimensionAxis.show)||t.layoutService.meta.isDimensionless)return!1;const i=t.alternativeService.getAlternatives(),{actions:o}=t,r=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"dimension-title",renderer:"react-qcm",layout:{minimumLayoutMode:zm[`${t.dockService.meta.major.orientation}DimensionAxisTitle`].minimumLayoutMode,dock:t.dockService.meta.major.dock},data:{infos:t.layoutService.getHyperCubeValue("qDimensionInfo"),alternatives:i.dimensions,filtered:t.layoutService.meta.filteredFields.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!o?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:r.color,fontFamily:r.fontFamily,fontSize:r.fontSize}}}}function Nf(e,t,n){if(!wf(e.measureAxis.show))return!1;const i=t.alternativeService.getAlternatives(),{actions:o}=t,r=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"measure-title",renderer:"react-qcm",layout:{minimumLayoutMode:"SMALL",dock:t.dockService.meta.minor.dock},data:{infos:t.layoutService.getHyperCubeValue("qMeasureInfo"),alternatives:i.measures,filtered:t.layoutService.meta.filteredFields.measures},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!o?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"measure"},style:{title:{color:r.color,fontFamily:r.fontFamily,fontSize:r.fontSize}}}}function Df({environment:e,rtl:t,refLineModel:n,layoutService:i,colorService:o,dockService:r,themeService:a,viewModel:s,chart:l}){const{theme:u,localeInfo:c}=e,d={resolveUIColor:o.getMain().getPaletteColor},m=a.getStyles(),h=s.animations.enabled;return[Cl({refLineModel:n,layoutService:i,colorModel:d,dockService:r,animationsEnabled:h,chart:l,scale:Jd.SCALE.MAIN.MINOR,axis:"horizontal"===r.meta.major.orientation?"y":"x",key:Jd.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:zm.refLines.minimumLayoutMode}),Cl({isDimension:!0,refLineModel:n,layoutService:i,colorModel:d,dockService:r,animationsEnabled:h,chart:l,scale:Jd.SCALE.MAIN.MAJOR,axis:"horizontal"===r.meta.major.orientation?"x":"y",rtl:t,key:Jd.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:Jd.COMPONENT.BAR,minimumLayoutMode:zm.refLines.minimumLayoutMode}),...Tl({refLineModel:n,layoutService:i,colorModel:d,animationsEnabled:h,dock:r.meta.minor.opposite,scale:Jd.SCALE.MAIN.MINOR,style:m,formatter:Jd.FORMATTER.MINOR,theme:u,localeInfo:c,rtl:t,key:Jd.COMPONENT.MEASURE_REF_LINE_LABEL}),...Tl({isDimension:!0,refLineModel:n,layoutService:i,colorModel:d,animationsEnabled:h,dock:r.meta.major.opposite,scale:Jd.SCALE.MAIN.MAJOR,style:m,theme:u,localeInfo:c,rtl:t,key:Jd.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function Lf({dockService:e,layoutService:t,discrete:n,continuousDataModel:i,viewModel:o}){if(!!uu({layoutService:t}).none)return!1;const{rtl:r}=e.config,a="horizontal"===e.meta.chart.orientation,s=!a,{dock:l}=e.meta.major,{show:u}=t.getLayoutValue("dimensionAxis",{}),c="none"!==u;if(s&&c&&"bottom"===l)return!1;if(a&&c){if(!r&&"right"===l)return!1;if(r&&"left"===l)return!1}const d=r?"left":"right";return{type:"space",key:Jd.COMPONENT.SPACE,layout:{dock:s?"bottom":d,minimumLayoutMode:"XSMALL"},show:()=>t.meta.isContinuous?i.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{size:Math.max(6,Math.min(16,Math.floor(.025*e.meta.minor.size)))},animations:{enabled:o.animations.enabled,trackBy:()=>Math.random()}}}function Ef({chart:e,chartModel:t,discreteModel:n,colorService:i,themeService:o,layoutService:r,dockService:a,context:s,resources:l,viewCache:u}){const c=[],d=r.getLayoutValue("plugins");if(!Array.isArray(d)||0===d.length)return c;!function(e){e.forEach(e=>{e&&!e.cId&&(e.cId=$r.generateId)})}(d);const m=[],h=function(e){const t=[];return e.forEach(e=>{e?.type!==t[t.length-1]?.[0]?.type||"point"!==e?.type&&("line"!==e?.type||e?.showPoints||t[t.length-1]?.[0]?.showPoints)?t.push([e]):t[t.length-1].push(e)}),t}(d);return h.forEach((u,d)=>{const h=`points-addon-${d}`,f=`lines-addon-${d}`;switch(u[0]?.type){case"point":c.push(Al({chart:e,chartModel:t,discreteModel:n,colorService:i,themeService:o,layoutService:r,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:Jd.SCALE.MAIN.MAJOR,minorScale:Jd.SCALE.MAIN.MINOR,mainComponentKey:Jd.COMPONENT.BAR,data:u,key:h})),m.push({key:h,lines:!1,labels:!0,fixed:!0,duplicates:!0});break;case"line":c.push(function({chart:e,chartModel:t,discreteModel:n,colorService:i,layoutService:o,dockService:r,rtl:a,majorScale:s,minorScale:l,mainComponentKey:u,data:c,key:d,scales:m={}}){if(!Array.isArray(c)||0===c.length)return!1;const h={resolveUIColor:i.getMain().getPaletteColor},f="horizontal"===r.meta.major.orientation,p=!(!f||!a),{canBeContinuous:g,isContinuous:y}=o.meta,v=o.getLayout(),b=Ys.getDimensionValuesInfo({layout:v,canBeContinuous:g,discreteModel:n,layoutService:o}),S=[];c.forEach((e,t)=>{const n=(e?.points??[]).map((n,i)=>({...n,lineId:t,style:0===i?e.style:void 0}));S.push(...n)});const x={},M=[];c.forEach(e=>M.push(...(e?.points??[]).map(e=>e.dimensionValue))),M.forEach(e=>{b[e]&&(x[e]?(x[e].innerValues=b[e].innerValues,x[e].minOrder=Math.min(x[e].minOrder,b[e].minOrder),x[e].maxOrder=Math.max(x[e].maxOrder,b[e].maxOrder),x[e].isMinOrderOk=x[e].isMinOrderOk||b[e].isMinOrderOk,x[e].isMaxOrderOk=x[e].isMaxOrderOk||b[e].isMaxOrderOk):x[e]={id:b[e].id,dataNode:b[e].dataNode,qText:b[e].qText,innerValues:b[e].innerValues,minOrder:b[e].minOrder,maxOrder:b[e].maxOrder,isMinOrderOk:b[e].isMinOrderOk,isMaxOrderOk:b[e].isMaxOrderOk},x[e].numInnerValues=(x[e].maxOrder||0)-(x[e].minOrder||0)+1)});const q=S[0];S.forEach(t=>{const n=El({point:t,dimensionValueInfo:x,layoutService:o}),i=t?.scale,r=q?.scale,a=o?.meta?.isButterfly,s=o?.meta?.isStacked,l=x[t.dimensionValue]?.dataNode;let u=n;const c=r&&i&&r!==i,d=a&&1===t.measureIndex,h=s&&Array.isArray(l);if(c)u=function(e,t,n){const i=t.min(),o=t.max(),r=n.min(),a=n.max();return o===i?r:r+(e-i)/(o-i)*(a-r)}(n,m[i]||e.scale(i),m[r]||e.scale(r));else if(d)u=-n;else if(h&&void 0!==t.measureIndex&&Array.isArray(l)){const e=l.slice(0,t.measureIndex+2),n=l[t.measureIndex+1]?.qNum;if("number"==typeof n&&0!==n){const t=Math.sign(n);u=e.reduce((e,n)=>{const i=n.qNum;return"number"==typeof i&&Math.sign(i)===t?e+i:e},0)}}t.validMeasureValue=u});const C={scale:s,fn:({datum:t})=>{const n=e.scale(s),i=t.value.dimensionValue;return y?n("string"==typeof i?""===i?void 0:+i:i):void 0!==x[i]?Ys.getScaledPosition({scale:n,value:x[i].id,valueInfo:x[i],size:e.component(u)?.rect[f?"width":"height"],align:"center",invert:p,layoutService:o,isContinuous:y}):void 0}},T={scale:l,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:d,type:"line",data:S,settings:{connect:!0,coordinates:{major:f?C:T,minor:f?T:C,layerId:({datum:e})=>e.value.lineId},layers:{curve:({datum:e})=>e.value.style?.lineCurve??"monotone",line:{strokeWidth:({datum:e})=>e.value.style?.lineThickness??3,stroke:({datum:e})=>Ll({colorModel:h,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),strokeDasharray:({datum:e})=>e.value.style?.lineType}}},animations:{enabled:t.query.animationsEnabled,trackBy:bl.nonUpdatingNode.trackBy,compensateForLayoutChanges:bl.lines.compensateForLayoutChanges}}}({chart:e,chartModel:t,discreteModel:n,colorService:i,layoutService:r,dockService:a,rtl:s.rtl,majorScale:Jd.SCALE.MAIN.MAJOR,minorScale:Jd.SCALE.MAIN.MINOR,mainComponentKey:Jd.COMPONENT.BAR,data:u,key:f})),u.forEach((u,d)=>{if(u?.showPoints&&u?.points){const h=`points-${d}-for-${f}`;c.push(Al({chart:e,chartModel:t,discreteModel:n,colorService:i,themeService:o,layoutService:r,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:Jd.SCALE.MAIN.MAJOR,minorScale:Jd.SCALE.MAIN.MINOR,mainComponentKey:Jd.COMPONENT.BAR,data:u.points,key:h})),m.push({key:h,lines:!0,labels:!0,duplicates:!0})}else u?.points&&m.push({key:f,lines:!0,labels:!1,duplicates:!0,points:u.points})})}}),c.push(function({layoutService:e,dockService:t,chartModel:n,themeService:i,configs:o,cache:r}){const a=e.getLayoutValue("plugins"),{rtl:s}=t.config,{orientation:l}=t.meta.major,{isOneDimensional:u,isStacked:c}=e.meta,d=i.getStyles();return{type:"point-label",key:"plugins-point-labels",renderer:Nl(),settings:{all:!0,cache:r,configs:o,label:e=>e.value?.label?.value?e.value?.label?.value:c?e.point?.label:e.end?.label,lineId:({data:e})=>{for(let t=0;t<a.length;t++){const n=a[t];switch(n.type){case"point":if(n.cId===e.value?.cId)return n.cId;break;case"line":if(n.points.some(t=>t.cId===e.value?.cId))return n.cId}}return e.value?.cId||e.line?.value},majorValue:e=>e.value?.dimensionValue?e.value.dimensionValue:u?e.value:e.major?.value,orientation:l,pointValue:e=>e.value?.validMeasureValue,rtl:s},style:d.plugins.label,animations:{enabled:n.query.animationsEnabled,trackBy:bl.nonUpdatingNode.trackBy,compensateForLayoutChanges:bl.labels.compensateForLayoutChanges}}}({layoutService:r,dockService:a,chartModel:t,themeService:o,configs:m,flags:l.flags,cache:u})),c}const Of=(e,t,n)=>{const{layoutService:i,dockService:o,colorService:r,chart:a,actions:s,discrete:l,continuousDataModel:u,reducedDataModel:c,viewModel:d,viewState:m,viewCache:h,themeService:f,refLineModel:p,pluginService:g,tooltipService:y,rtl:v,logicalSize:b,trendLineModel:S,disclaimerService:x}=t,{localeInfo:M}=n,q=function(e,t){const{disclaimerService:n,themeService:i,translator:o}=e,r=n.getDisclaimer();if(!r)return!1;const{fontFamily:a}=i.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:r.alignment},settings:{isRTL:t,label:o.get(`Object.Disclaimer.${r.key}`)},style:{fontFamily:a}}}(t,v);if(x.getHasSuppressingDisclaimer())return{components:[q]};const C=ef(e,t,{localeInfo:M,rtl:v}),T=!s?.interact?.enabled(),w=r.getMain().getLegend({eventName:"legend-c",key:"legend-color",viewState:m,chart:a,styleReference:"object.barChart",styleOverrides:{title:t.styleService.legend.title.getStyle(),label:t.styleService.legend.label.getStyle()},rtl:v,settings:{item:{shape:{size:10}}}},{actions:s,navigationDisabled:T}),k=w.components[0];if(k){const{dock:e}=k.layout;if(C.fillRange&&(["right","left"].includes(e)||v)&&(C.fillRange.invert=!0),"legend-seq"===k.type&&void 0!==d.selectionDimensionIdx&&C.fillRange&&C.fillRange.min<C.fillRange.max){const e=Rm({eventName:"legendRange",key:"legendRangeBrush",targets:[k.key],fillTargets:[k.key],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:k.layout.dock,scale:"fillRange",bubblesPlacement:"outside",onEdited:()=>{s.select.emit("end","legendRange")}},t);w.components.push(...e.components),w.interactions.unshift(...e.interactions)}}else C.fillRange&&v&&(C.fillRange.invert=!0);const N=((e,{componentKey:t,collectionKey:n})=>{const{layoutService:i,colorService:o,dockService:r,discrete:a,viewModel:s,flags:l}=e,{meta:u}=i,c=o.getMain().getPaletteColor;let d,m;u.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:u.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);let h=2;u.isContinuous?(m={start:"timeStart",end:"timeEnd"},h=Qm(e,t)):u.isStacked&&(m="stack");const f=u.isStackedByDimension&&i.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1,p=e=>!0===e.datum.null?.value,g=i.getLayoutValue("components",null),y=g?g.filter(e=>e.key===t)[0]:null,v=e=>{const t=e?.minWidthPx;return Ds.isNumber(t)?t<=5?0:Math.min(2,t/10):0};return{key:t,type:"box",data:{collection:n},preferredSize:u.isContinuous?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension","end","fill","timeEnd"],style:{active:{strokeWidth:(()=>{if(f)return 0;if(!u.isContinuous)return 2;if(!l.isEnabled("TLV_1060_CONTINUOUS_AXIS_BAR_WIDTH"))return 0;const e=i.getLayout(),t=e.qHyperCube?.qDimensionInfo?.[0]?.continuous?.period;return t&&"none"!==t?v:0})(),stroke:"#000"},inactive:{opacity:.3}}}]},settings:{major:{scale:Jd.SCALE.MAIN.MAJOR,fn:d,ref:m},minor:{scale:Jd.SCALE.MAIN.MINOR},orientation:r.meta.minor.orientation,box:{width:$m({layoutService:i,discrete:a,flags:l}),minWidthPx:h,fill:o.getMain().getColor(),opacity:e=>p(e)?0:void 0,minHeightPx:function(e){return u.isStacked?.1:p(e)?.01:.3},strokeWidth:y?.style?.strokeWidth?Um.BAR.STROKE.WIDTH[y.style.strokeWidth.toUpperCase()]:Um.BAR.STROKE.WIDTH.NONE,stroke:y?.style?.strokeColor?.color?c(y?.style?.strokeColor):Um.BAR.STROKE.COLOR},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:s.animations.enabled,isMainComponent:!0,trackBy:bl.bars.trackBy,compensateForLayoutChanges:bl.bars.compensateForLayoutChanges}}})(t,{componentKey:Jd.COMPONENT.BAR,collectionKey:Jd.COLLECTION.MAIN}),D=((e,{componentKey:t,collectionKey:n})=>{const{meta:i}=e.layoutService;if(!i.isStacked)return!1;let o=2;i.isContinuous&&(o=Qm(e,t));const r={key:t,type:"box",data:{collection:n},settings:{major:{scale:Jd.SCALE.MAIN.MAJOR},minor:{scale:Jd.SCALE.MAIN.MINOR,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:e.dockService.meta.minor.orientation,box:{width:$m({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:o,opacity:0,fill:"none"},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:{consume:[{context:"selection",data:[""],style:{active:{strokeWidth:2,stroke:"#000",opacity:e=>!0===e.data?.null?.value?0:1},inactive:{opacity:e=>!0===e.data?.null?.value?0:.3}}}]}};return i.isContinuous&&(r.settings.major.ref={start:"timeStart",end:"timeEnd"}),r})(t,{componentKey:Jd.COMPONENT.STACK_TOTAL_BAR,collectionKey:Jd.COLLECTION.STACK_TOTAL}),L=rf(t,n,d.selectionDimensionIdx),{isStacked:E}=i.meta;let O;O=c.mode.isContinuous?Jd.COLLECTION.MINI_CONTINUOUS:E?Jd.COLLECTION.MINI_STACK:Jd.COLLECTION.MINI;const A=E?D:N,I=Nh(0,t),P=[...I,cf(t,{barComponent:A,type:"max",isStacked:E}),cf(t,{barComponent:A,type:"min",isStacked:E}),uh(t,{barComponent:A,type:"max",isStacked:E}),uh(t,{barComponent:A,type:"min",isStacked:E}),dh(t,{chart:a,type:"max",collectionKey:E?Jd.COLLECTION.STACK_TOTAL:Jd.COLLECTION.MAIN}),dh(t,{chart:a,type:"min",collectionKey:E?Jd.COLLECTION.STACK_TOTAL:Jd.COLLECTION.MAIN}),..._m(e,t,v,!!I[0]),N,D,sf({layoutService:i,viewModel:d,dockService:o}),kf(e,t,v),Nf(e,t,v),...Df({environment:n,rtl:v,refLineModel:p,layoutService:i,colorService:r,dockService:o,themeService:f,viewModel:d,chart:a}),hs({viewState:m,viewCache:h,layoutService:i,dockService:o,rtl:v}),Lf({dockService:o,layoutService:i,discrete:l,continuousDataModel:u,viewModel:d}),zh(N,t,{collectionKey:O}),cu({layoutService:i,dockService:o,discrete:l,continuousDataModel:u,viewState:m,viewCache:h,themeService:f,rtl:v,deviceType:n.deviceType}),...Id({majorScale:Jd.SCALE.MAIN.MAJOR,minorScale:Jd.SCALE.MAIN.MINOR,tooltipOverlay:Jd.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:i,trendLineModel:S,dockService:o,animationsEnabled:d.animations.enabled}),...w.components,bh({layout:e,component:Jd.COMPONENT.BAR,minorScale:C.minor},t,v),qf({layout:e,component:Jd.COMPONENT.STACK_TOTAL_BAR},t,v),Tf({layout:e,type:"max"},t),Tf({layout:e,type:"min"},t),...L.components,...y.getComponents(),!1!==e.showDisclaimer&&q,Hd({tooltip:Jd.COMPONENT.TREND_LINES_TOOLTIP,formatter:Jd.FORMATTER.MINOR},t,{rtl:v}),...Ef({chart:a,chartModel:{query:{animationsEnabled:d.animations.enabled}},discreteModel:l,colorService:r,themeService:f,layoutService:i,dockService:o,context:{},resources:t,viewCache:h})].filter(Boolean);!function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(P);return{interactions:Ih(t,{rtl:v,hammer:{gestures:[...w.interactions,...L.gestures].sort((e,t)=>(t.prio||0)-(e.prio||0))}}),scales:C,palettes:r.getMain().getPalettes(),components:g.extendComponents(P),strategy:Br(0,{logicalSize:b,minCenterRatio:0}),formatters:Sh(t,C),collections:xf(0,t)}};const Af=({environment:e,services:t,chart:n,viewState:i,bootstrapped:o})=>{$(r=>{if(!e||!t||!o)return;const{layoutService:a,dockService:s,colorService:l,discrete:u,continuousDataModel:c,reducedDataModel:d}=t,{width:m,height:h}=s.meta.chart.size;if(r.snapshotData=r.snapshotData||{},r.snapshotData.content={size:{w:m,h:h}},a.meta.isSnapshot)return Promise.resolve();r.snapshotData.content.chartData={scrollOffset:i.get("scrollOffset"),zoom:i.get("zoom"),legendScrollOffset:Xr(n,Jd.COMPONENT.LEGEND_COLOR_CAT)};const{properties:f}=o,p=f?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return p&&(r.tooltip.auto=!0),a.meta.isDiscrete?(u.command.setSnapshotData(r),d.setSnapshotData(r)):c.setSnapshotData(r),l.getMain().getSnapshotData().then(e=>{r.snapshotData.content.chartData={...r.snapshotData.content.chartData,...e}}).catch(()=>{})}),W(()=>({getViewState(){if(i&&n)return{scrollOffset:i.get("scrollOffset"),zoom:i.get("zoom"),legendScrollOffset:Xr(n,Jd.COMPONENT.LEGEND_COLOR_CAT)}}}),[i,n])},If=e=>"[object Object]"===Object.prototype.toString.call(e),Pf=e=>Array.isArray(e);function Rf(e,t){if(e===t)return!0;if(Pf(e)){if(!Pf(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Rf(e[n],t[n]))return!1;return!0}if(If(e)){if(!If(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let i=0;i<n.length;i++){if(!Object.hasOwn(t,n[i]))return!1;if(!Rf(e[n[i]],t[n[i]]))return!1}return!0}return e===t}const zf=({properties:e,layout:t,isStacked:n,isContinuous:i,model:o,layoutService:r})=>{const a=t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode),s=t.qHyperCube.qMeasureInfo.filter(e=>7005!==e.qError?.qErrorCode),l=ne(!0,{},e);return((e,t,n)=>{const{color:{mode:i}}=n;e.length>1&&n.color?n.color.persistent=!0:"byDimension"===i&&t.length>1?n.color.mode="byMultiple":"byExpression"===i&&0===t.length?n.color.mode="primary":0===e.length&&t.length>0&&(n.color.byMeasureDef=void 0,n.color.byDimDef=void 0,1===t.length&&"byExpression"!==i&&(n.color.mode="primary"))})(a,s,e),a.length>1&&n&&!i&&"S"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="K"),a.length<2&&"K"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="S"),o.colorSupport?.colorByUpdater?.(e,"qHyperCubeDef.",t),function({properties:e,layoutService:t}){const{filteredFields:n}=t.meta;if(!(n.measures.length>0))return;const{mode:i}=e.color||{};if("byExpression"===i){const i=t.getLayout();if("colorByExpression"===i.qHyperCube.qMeasureInfo?.[0]?.qAttrExprInfo?.[0]?.id)return;const{current:o,target:r}=function({properties:e,filtered:t}){const{qMeasures:n}=e.qHyperCubeDef||[],{current:i,target:o}=n.reduce((e,n,i)=>("colorByExpression"===n.qAttributeExpressions[0]?.id&&(e.current=i),void 0!==e.target||t.includes(i)||(e.target=i),e),{current:void 0,target:void 0});return{current:i,target:o}}({properties:e,filtered:n.measures});if(void 0===o)return;const a=e.qHyperCubeDef.qMeasures[o].qAttributeExpressions[0];e.qHyperCubeDef.qMeasures[o].qAttributeExpressions.splice(0,1),e.qHyperCubeDef.qMeasures[r].qAttributeExpressions.splice(0,0,a)}}({properties:e,layoutService:r}),!bs.compare(l,e,!0)&&JSON.stringify(l)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)};function Hf(e,t){if("custom"===e.dimensionAxis.axisDisplayMode){const n=t.layout.qHyperCube.qMeasureInfo.filter(e=>e.qError?.qErrorCode!==Nc).length,i=t.layout.qHyperCube.qDimensionInfo.filter(e=>e.qError?.qErrorCode!==Nc).length,o=e.dimensionAxis.maxVisibleItems;o<1?e.dimensionAxis.maxVisibleItems=10:o>1e4/(i+n)&&(e.dimensionAxis.maxVisibleItems=Math.min(o,Math.floor(1e4/(i+n))))}}const Bf=[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],Ff=(e,t,n)=>{const i=`${e}.fontFamily`,o=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:o,options:()=>t.getOptions(o),defaultValue:()=>t.getDefaultValue(o)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.barChart",e,"color")})}}}}};function jf(e){return{classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"LayerStyleEditor.style.strokeWidth",component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:Object.keys(Bf).map(e=>Bf[e]),schemaIgnore:!0,defaultValue:Bf[0].value},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891",index:-1},width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"items",show:(e,t)=>!Yr.continuous({layout:t.layout}),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:(e,t,n)=>((e,t)=>{const n=t.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==Nc).length,i=t.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==Nc).length,o="grouped"===e.barGrouping?.grouping&&i>0&&n+i>2;return Yr.continuous({layout:t})?1:o?.9:.7})(n.properties,n.layout)}}}}},optionsSection:{translation:"LayerStyleEditor.label.Options",component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollbar:{ref:"scrollbar",translation:"properties.scrollbar",component:"dropdown",type:"string",options:Object.keys(ru.OPTIONS).map(e=>ru.OPTIONS[e]),schemaIgnore:!0,defaultValue:ru.DEFAULT.value},scrollAlignment:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",schemaIgnore:!0,defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},gridLines:{type:"items",items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}}}}}}}function Vf(e,t,n,i=!1){return i?jf(t):function(e,t,n){const i=M({theme:e,translator:n,config:{id:"barChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]},flags:t});return{component:"styling-panel",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:t?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:Object.keys(Bf).map(e=>Bf[e]),defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",show:(e,n)=>!Yr.continuous({layout:n.layout})||t?.isEnabled("TLV_1060_CONTINUOUS_AXIS_BAR_WIDTH"),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue(e,t,n){const{properties:i}=n,{barGrouping:o,qHyperCubeDef:r}=i,a=r.qMeasures.length,s=r.qDimensions.length,l="grouped"===o.grouping&&s>0&&a+s>2;return Yr.continuous({properties:i})?1:l?.9:.7},schemaIgnore:!0}}}}},axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:Ff("axis.title",i,e)}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{axisLabelItems:{component:"items",ref:"components",key:"axis",items:Ff("axis.label.name",i,e)}}},labelSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.labelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...Ff("label.value",i,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{legendTitleSection:{component:"items",ref:"components",key:"legend",items:Ff("legend.title",i,e)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{legendLabelSection:{component:"items",ref:"components",key:"legend",items:Ff("legend.label",i,e)}}}:void 0}}}(e,t,n)}const _f=e=>e.qError?.qErrorCode!==Nc,Uf=(e,t)=>e?.qHyperCube[t].filter(e=>_f(e)),$f=e=>{if(!e)return!1;const t=ne(!0,{},e);return t.qHyperCube.qMeasureInfo=Uf(e,"qMeasureInfo"),t.qHyperCube.qDimensionInfo=Uf(e,"qDimensionInfo"),t&&!Yr.continuous({layout:t})&&Yr.stacked(t)},Wf=({translator:e,flags:t,anything:n})=>{const i=(o=t?.isEnabled("TLV_1060_CONTINUOUS_AXIS_BAR_WIDTH"),o?{type:"items",show:Zl,items:{period:{translation:Xl,type:"string",component:"dropdown",ref:"qHyperCubeDef.qDimensions.0.qDef.continuous.period",show:Zl,globalChange:tu,options:[{value:nu.AUTO,translation:Jl.AUTO},{value:nu.SECONDS,translation:Jl.SECONDS},{value:nu.MINUTES,translation:Jl.MINUTES},{value:nu.HOURS,translation:Jl.HOURS},{value:nu.DAYS,translation:Jl.DAYS},{value:nu.WEEKS,translation:Jl.WEEKS},{value:nu.MONTHS,translation:Jl.MONTHS},{value:nu.YEARS,translation:Jl.YEARS},{value:nu.NUMBER,translation:Jl.NUMBER},{value:nu.NONE,translation:Jl.NONE}],undefinedValue:nu.NONE,defaultValue:nu.AUTO,schemaIgnore:!0},stepSize:{translation:Jl.TITLE,type:"number",defaultValue:iu,schemaIgnore:!0,show:Ql,ref:"qHyperCubeDef.qDimensions.0.qDef.continuous.stepSize",min:Number.EPSILON,rollbackInvalid:!0}}}:{show:!1,globalChange:e=>{(e?.qHyperCubeDef?.qDimensions||[]).forEach(e=>{delete e.qDef.continuous?.period,delete e.qDef.continuous?.stepSize})}});var o;const r=n?.sense?.isUnsupportedFeature?.("continuousData"),a={items:{labels:{items:{header:{show:(e,t,n)=>Uf(n.layout,"qMeasureInfo").length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:(e,t,n)=>!$f(t.layout)&&Uf(n.layout,"qMeasureInfo").length},segmentLabels:{component:"checkbox",ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",defaultValue:!1,show:(e,t)=>$f(t.layout),convertFunctions:{get:(e,t,n,i)=>i.dataPoint.showLabels&&i.dataPoint.showSegmentLabels,set(e,t,n,i,o){o.dataPoint.showSegmentLabels=e,o.dataPoint.showLabels=o.dataPoint.showSegmentLabels||o.dataPoint.showTotalLabels}}},totalLabels:{component:"checkbox",ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",defaultValue:!0,show:(e,t)=>$f(t.layout),convertFunctions:{get:(e,t,n,i)=>i.dataPoint.showLabels&&i.dataPoint.showTotalLabels,set(e,t,n,i,o){o.dataPoint.showTotalLabels=e,o.dataPoint.showLabels=o.dataPoint.showSegmentLabels||o.dataPoint.showTotalLabels}}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>Uf(n.layout,"qDimensionInfo").length&&Uf(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,i)=>"labels"===i.dimensionAxis.show||"none"===i.dimensionAxis.show,set(e,t,n,i,o){o.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>Uf(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,o){o.measureAxis.show=e?"labels":"all"}}}}}}},s=n?.sense?.theme,l={uses:"settings",items:{simpleStyling:Vf(s,t,e,!0),simpleLabels:a,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:{boxStyling:Vf(s,t,e,!1),grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:(e,t)=>{const n=[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}];return Zd({layout:t.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){const n=Uf(t.layout,"qMeasureInfo").length,i=Uf(t.layout,"qDimensionInfo").length;return i>0&&n+i>2},globalChange(e,t,n){"butterfly"!==e.barGrouping.grouping||Zd({layout:n.layout})||(e.barGrouping.grouping="stacked"),"butterfly"===e.barGrouping.grouping&&e.measureAxis&&"max"!==e.measureAxis.minMax&&!e.measureAxis.autoMinMax&&(e.measureAxis.minMax="max")},change(e,t,n){"butterfly"!==e.barGrouping.grouping||Zd({layout:n.layout})||(e.barGrouping.grouping="stacked"),Uf(t.layout,"qDimensionInfo").length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"},readOnly:(e,t,n)=>Yr.continuous({layout:n.layout}),convertFunctions:{get(e,t,n){const i="stacked";return"butterfly"===e(t.type)?Zd({layout:n.layout})?e(t.type):i:Yr.continuous({layout:n.layout})?i:e(t.type)},set(e,t,n){const i=Qr(n.type,n);t(n.type,e,i)}}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>Yr.continuous({layout:n.layout}),convertFunctions:(u="vertical",{get:(e,t,n)=>Yr.continuous({layout:n.layout})?u:e(t.type),set(e,t,n){const i=Qr(n.type,n);t(n.type,e,i)}})},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(ru.OPTIONS).map(e=>ru.OPTIONS[e]),defaultValue:ru.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!Yr.continuous({layout:n.layout})}}},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}},valueLabels:{type:"items",snapshot:{tid:"property-valueLabels"},items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,label:(t,n)=>((e,t,n)=>n&&n.get($f(t.layout)?"properties.on":"Common.Auto"))(0,n,e)},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&$f(n.layout)},showTotalLabels:{ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&$f(n.layout)}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{attributeExpression:Dl}},legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",items:{axisDisplaySettings:{components:"items",type:"items",show:(e,t,n)=>!Yr.continuous({layout:n.layout}),items:{axisDisplayMode:{ref:"dimensionAxis.axisDisplayMode",type:"string",translation:"properties.axis.displaymode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{ref:"dimensionAxis.maxVisibleItems",translation:"properties.axis.maxvisiblevalues",expression:"optional",type:"integer",invalid(e,t,n){const i=Uf(n.layout,"qMeasureInfo").length,o=Uf(n.layout,"qDimensionInfo").length,r=e.dimensionAxis.maxVisibleItems;return r<0||r>1e4/(o+i)},globalChange:Hf,defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null,continuousDimension:i},show:!r},othersGroup:{items:{label:{options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]}}}}},measureAxis:{uses:"axis.flippableMeasureAxis"},tooltip:{uses:"tooltip"}}};var u;return l.items.measureAxis={uses:"axis.flippableMeasureAxis",items:{minMax:{items:{minMax:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&!e.measureAxis.autoMinMax},min:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&["min","minMax"].includes(e.measureAxis.minMax)&&!e.measureAxis.autoMinMax},max:{invalid:e=>e.measureAxis&&"minMax"===e.measureAxis.minMax?e.measureAxis.min>=e.measureAxis.max:!(!e.measureAxis||"max"!==e.measureAxis.minMax||"butterfly"!==e.barGrouping.grouping)&&e.measureAxis.max<=0}}}}},l},Kf={uses:"sortingWithDisclaimer",items:{defaultSorting:{items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length&&0===e,items:{autoSort:{change(e){us(e)}}}},interColumnSorting:{reset:(e,t)=>{const{qDimensions:n,qMeasures:i,qInterColumnSortOrder:o}=e.qHyperCubeDef,{qCardinal:r}=t.layout.qHyperCube.qDimensionInfo[0],a=o.length,s=[...Array(a).keys()];1===n.length&&i.length>=1&&r>10&&([s[0],s[1]]=[s[1],s[0]]),e.qHyperCubeDef.qInterColumnSortOrder=s}}}}}},Gf=({translator:e,flags:t})=>({type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"},plugins:$l({translator:e,pluginOptions:[{value:"point",translation:e.get("Visualizations.Descriptions.Point")},{value:"line",translation:e.get("Visualizations.Descriptions.Line")}],supportNewStyles:t?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")})}}),Yf=({translator:e,anything:t})=>({uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,n,i){if(t?.sense?.isUnsupportedFeature?.("includeZeroValues"))return!1;const o=((e,t)=>{const n=t.layout?.qHyperCube?.qDimensionInfo?.findIndex(e=>_f(e));return t.properties?.qHyperCubeDef?.qDimensions?.[n]===e})(e,n),r=Yr.continuous({layout:i.layout});return!(o&&r)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},period:{type:"string",defaultValue:"auto",ref:"qDef.continuous.period",show:!1}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},trendLines:t?.sense?.isUnsupportedFeature?.("trendlines")?void 0:_d({translator:e,allowStackedByDimension:!0})}}}});function Xf({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:Yf({translator:e,anything:n}),sorting:Kf,addons:Gf({translator:e,flags:t}),settings:Wf({translator:e,flags:t,anything:n})}}}const Jf=e=>e.qError?.qErrorCode!==Nc;function Zf({flags:e}){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer",items:{sort:{items:{dimensions:{locked(e,t,n){const i=n.qHyperCube.qMeasureInfo.length,o=n.qHyperCube.qDimensionInfo.filter(e=>Jf(e)).length;return 1===i&&2===o&&0===e}}}}}},presentation:{uses:"presentation",items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:(e,t)=>{const n=[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}];return Zd({layout:t?.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){return t.qHyperCube.qMeasureInfo.filter(e=>Jf(e)).length+t.qHyperCube.qDimensionInfo.filter(e=>Jf(e)).length>2&&!Yr.continuous({layout:t})&&(n=t,!(n?.qHyperCube?.qDimensionInfo?.filter(e=>Jf(e)).length>1&&n?.qHyperCube?.isHCEnabled));var n},change(e){e.qHyperCubeDef.qDimensions.length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!Yr.continuous({layout:t})}}},color:{uses:"color"}}}}function Qf(e){const t={},n=a(e,"components"),i=a(e,"dimensionAxis.axisDisplayMode"),o=a(e,"dimensionAxis.maxVisibleItems"),r=n?n.filter(e=>"bar"===e.key)[0]:void 0,s=a(e,"tooltip");if(r&&r.style&&Object.keys(r.style).forEach(e=>{t[`chart_style_${e}`]=r.style[e]}),o&&(t.chart_dimaxis_maxVisibleItems=o),i&&(t.chart_dimaxis_axisDisplayMode=i),s){t.chart_tooltip_custom=!s.auto;const e=a(s,"chart.object.refId");!s.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const ep=e=>!!(e&&e.qHyperCube.qSize.qcy>0),tp={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization"};function np(){const e=[];return Object.keys(tp).forEach(t=>{e.push(tp[t])}),e}function ip(e){return{definition:Xf(e),softDefinition:Zf(e),support:{snapshot:ep,export:ep,exportData:!0,sharing:ep,viewData:!0,effects:!0,modifiers:np()},importProperties:(t,n,i,o)=>{const r={layout:{templateId:n.templateId}};i.mapProperties(r);const a={defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},s=G.axisChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:zc(e),defaultPropertyValues:a,hypercubePath:o,extension:i}),l=s.qProperty;return l.qHyperCubeDef.qDimensions.length>1&&"stacked"===l.barGrouping.grouping&&(l.qHyperCubeDef.qMode="K",l.qHyperCubeDef.qAlwaysFullyExpanded=!0),G.conditionalShow.unquarantine(l),G.conditionalShow.unquarantineAlternative(l),s},exportProperties:(e,t,n)=>{G.conditionalShow.quarantine(e.qProperty),G.conditionalShow.quarantineAlternative(e.qProperty);return G.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})},migrate:{properties:e=>(e.qExtendsId||(function(e){e.qHyperCubeDef.qDimensions.forEach(us),e.qHyperCubeDef.qLayoutExclude?.qHyperCubeDef?.qDimensions&&e.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(us)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:i,showMiniChartForContinuousAxis:o}=e;if(t||!1!==o)return;const{continuousAuto:r}=n;(r||!r&&i)&&(e.scrollbar=ru.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:Qf}}}}});
7
+ System.register(["picasso.js","picasso-plugin-q","hammerjs","qlik-chart-modules","qlik-chart-modules/react","@nebula.js/stardust","qlik-object-conversion"],function(e){"use strict";var t,n,i,o,r,a,s,l,u,c,d,m,h,f,p,g,y,v,b,x,S,M,q,C,w,T,k,N,D,L,E,O,A,I,P,R,z,H,B,F,j,V,_,U,$,W,K,G;return{setters:[function(e){t=e.default},function(e){n=e.default},function(e){i=e.default},function(e){o=e.debouncer,r=e.throttler,a=e.getValue,s=e.setValue,l=e.createColor,u=e.pointLabelComponent,c=e.cache,d=e.storage,m=e.memoize,h=e.selectionService,f=e.colorService,p=e.tooltipService,g=e.disclaimerService,y=e.layoutService,v=e.dockService,b=e.themeService,x=e.alternativeService,S=e.pluginService,M=e.fontResolver},function(e){q=e.reactRenderer,C=e.disclaimerComponent,w=e.axisTitleComponent},function(e){T=e.useTranslator,k=e.useEmbed,N=e.useTheme,D=e.useState,L=e.useDeviceType,E=e.useAppLayout,O=e.useEffect,A=e.useElement,I=e.useOptions,P=e.useLayout,R=e.useAction,z=e.useStaleLayout,H=e.useModel,B=e.useApp,F=e.usePlugins,j=e.useSelections,V=e.useConstraints,_=e.useRect,U=e.usePromise,$=e.onTakeSnapshot,W=e.useImperativeHandle,K=e.useRenderState},function(e){G=e.default}],execute:function(){e("default",function(e){const s=function(){const e=t();return e.use(n),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",J(e))};return void e.interaction("hammer",J(Hammer))}(i)),e.use(tc),e.renderer("react-qcm",q),e.component("box-sliced-hat",Zu),e.component("box-out-of-bounds",Ku),e.component("disclaimer",C),e.component("scrollbar",Vu),e.component("scroll-hint",ms),e.component("reference-line-labels",gl),e.component("axis-overlay",Pr.picassoComponents.axisOverlay),e.component("time-axis",Pr.picassoComponents.timeAxis),e.component("space",Qu),e.component("axis-title",w),e.component("point-label",u),e.scale("q-time-axis",Pr.picassoScales.time),e}();return{qae:Hc(e),ext:ip(e),component(){const t=function({env:e}){const{flags:t}=e,n=e.anything?.sense?.isUnsupportedFeature,i=T();!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(Bc).forEach(t=>{e.add(Bc[t])})}}(e.translator);const o=k(),r=N(),[a,s]=D(),l=L(),u=E(),{qLocaleInfo:c}=u;return O(()=>{s({translator:i,theme:r,embed:o,deviceType:l,localeInfo:c,isUnsupportedFeature:n,flags:t})},[c,n,i.language(),r.name(),l]),a}({env:e}),{viewState:n,viewCache:i}=function(){const[e]=D(()=>c()),[t]=D(()=>d({viewRange:[0,1],scrollOffset:void 0}));return{viewCache:e,viewState:t}}(),l=function({picasso:e}){const t=A(),n=I(),[i,o]=D();return O(()=>{if(!e)return()=>{};t.style.overflow="hidden";const i=e({renderer:{prio:[n?.renderer||"canvas"]}}).chart({element:t,data:[],settings:{}});o(i);const{destroy:r}=i;return()=>{r()}},[n.renderer]),i}({picasso:s}),u=function({picasso:e,chart:t,environment:n,viewState:i,viewCache:o}){const s=z(),l=H(),u=B(),d=F(),m=j(),h=I(),[f,p]=D(),[g,M]=D(),[q,C]=D(),w=V(),k=function(){const[e]=D({}),[t]=D({}),n=function(){const e=P(),t=T(),n=!!e?.qSelectionInfo?.qInSelections,i=!!e?.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne,[o,r]=D(!1),[a,s]=D(!1),[l,u]=D({key:"lasso",enabled:()=>!1,active:()=>!1,action:()=>!1}),c=e=>{s("boolean"==typeof e?e:!a)};return R(()=>(u({key:"lasso",action:c,enabled:()=>o,active:()=>a}),{key:"lasso",label:t.get(a?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:Gd,hidden:!o||!n||i,active:a,action:c}),[n,i,a,o,t.language()]),{get:()=>l,setAllows:e=>{r(!!e)}}}(),[i,o]=D();return O(()=>{const i={};i.scroll={key:"scroll",isActive:!0,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled(){const{layoutService:n,discrete:i}=e;return t.allowScroll&&(n?.meta.isContinuous||i?.query.getCanScroll())}},i.interact={key:"interact",isEnabled:!0,enabled:()=>t.allowInteract},i.tooltip={key:"tooltip",isActive:!0,isEnabled:!0,action(e){this.isActive=!!e},active(){return this.isActive},enabled:()=>t.allowTooltip},i.select={key:"select",isActive:!1,isEnabled:!0,action(){this.isActive=!this.isActive},active(){return this.isActive},enabled:()=>t.allowSelect},i.lasso=n.get(),Object.keys(i).forEach(e=>Yd(i[e])),o(i)},[]),O(()=>{i&&n&&(i.lasso={...i.lasso,...n.get()})},[n]),{get:()=>i,setAllows:e=>{Object.assign(t,e),n.setAllows(e?.allowSelect)},setContext:t=>{Object.assign(e,t)},destroy:()=>{Object.keys(i).forEach(e=>i[e].removeAllListeners())}}}();return O(()=>{if(!t)return()=>{};const e=k.get(),n=tm({chart:t,actions:e,selections:m});return M(e),C(n),()=>{n.destroy(),k.destroy()}},[t]),O(()=>{if(!w)return;const e={allowScroll:!w.active,allowInteract:!w.active,allowTooltip:!w.passive,allowSelect:!w.select&&!w.active};k.setAllows(e)},[w]),O(()=>{if(!q||!n)return;const{theme:m,translator:f,localeInfo:M,flags:C,embed:w}=n,{direction:T="ltr"}=h,N="rtl"===T,D=y({source:s,metaAdditionsFn:Qd(),experimental:{filter:!0}});q.setFilteredFields(D.meta.filteredFields);const L=function(e){return e.color.auto?e.qHyperCube.qDimensionInfo.length>1:"byDimension"===e.color.mode&&e.color.byDimDef&&e.color.byDimDef.activeDimensionIndex>-1}(D.getLayout())?y({source:D.getLayout()}):void 0,E=function({layout:e,options:t={}}){return!(!e?.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:s,options:h}),O=function({layoutService:e,viewCache:t,options:n}){const i={};return i.fields=function(e){const{meta:t}=e,n={majorGroup:t.isGroupedByDimension?"qDimensionInfo/0":void 0,majorStack:t.isStacked?"qDimensionInfo/0":void 0,major:t.isDimensionless?void 0:"qDimensionInfo/"+(t.dimensionCount-1),majors:e.getHyperCubeValue("qDimensionInfo").map((e,t)=>`qDimensionInfo/${t}`),minor:e.getHyperCubeValue("qMeasureInfo").map((e,t)=>`qMeasureInfo/${t}`)};return n.majorNumeric=`${t.isStackedByDimension?n.majorStack:n.major}:numeric`,n}(e),i.selectionDimensionIdx=nm(e.getHyperCube()),i.isDimensionLocked=t=>e.getHyperCube().qDimensionInfo[t].qLocked,i.selectionDimensionProp=e=>void 0===i.selectionDimensionIdx||void 0!==e&&i.selectionDimensionIdx!==e?{}:{selectionDimension:{field:i.selectionDimensionIdx}},i.animations={enabled:()=>!1!==n.chartAnimations&&(!(i.animations.isPartialUpdating||i.animations.isSizeChanging||i.animations.hasSlicedHats)&&!bl.propertiesHaveChanged({viewCache:t,layout:e.getLayout()})),isPartialUpdating:!1,isSizeChanging:!1,hasSlicedHats:!1},i}({layoutService:D,viewCache:o,options:h}),A=v({chart:t,layoutService:D,config:{logicalSize:E,rtl:N},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0}}),I=lm({layoutService:D}),P=b({theme:m,config:{id:"barChart",transform:[["label.value.fontSize",e=>parseInt(e,10)]],resolve:[["object","plugins.label","fontFamily",'"Source Sans Pro", "Arial", "sans-serif"'],["object","plugins.label","fontSize","12px"]]}}),R=Pr.model({model:l,layoutService:D,viewCache:o,viewState:i}),z=function({enigma:e,layoutService:t,viewModel:n,definitionPath:i,reducedHyperCubePath:o},r={}){const a=function(e,t,n="/qHyperCubeDef"){return{fetch(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(Jr).then(e=>{const n=t.getHyperCubeValue("qMode"),i=t.getHyperCubeValue("qDimensionInfo"),o="K"===n&&i.length>1&&e[0]?.qIsReduced,r=e.slice(),a=t.getHyperCubeValue("qMeasureInfo"),s=o?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:r,qDimensionInfo:i.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:o?[a[0],a[0]]:a.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:s}}})}(e,t,this.settings())},settings(){const e=t.getHyperCubeValue("qDimensionInfo"),i=t.meta.isStacked&&e.length>1?1:0,o=t.getHyperCubeValue("qMeasureInfo");return{path:n,rect:{qTop:0,qLeft:i,qWidth:e.length+o.length+i,qHeight:Math.min(2e3,1e4/(o.length+1))},zoomLevel:-1,filter:"D1"}}}}(e,t,i),s=function(e,t="reducedHyperCube"){return{fetch:()=>Promise.resolve({reducedCube:e.getLayoutValue(t)||e.getHyperCube()})}}(t,o),l=function(e){return{fetch:()=>{const t=e.getHyperCube(),n={...t,qDataPages:t.qDataPages.slice()};return Promise.resolve({reducedCube:n})}}}(t),u=function({layoutService:e}){const{isSnapshot:t,isStackedByDimension:n}=e.meta,i=e=>{e.qDimensionInfo.unshift({key:"dummy-patch-dimension"})};return i.should=e=>t&&n&&1===e.qDimensionInfo.length,i}({layoutService:t}),c={mode:{isReduced:!1}};return{fetch(){if(t.meta.isSnapshot)return s.fetch();if(t.meta.isContinuous)return l.fetch();if(!t.meta.isStacked){if(t.getHyperCubeValue("qSize.qcy",NaN)===t.getHyperCubeValue("qDataPages.0.qArea.qHeight",NaN))return l.fetch()}return a.fetch()},model:()=>c,update(e){var i;u.should(e)&&u(e),c.mode=ne(c.mode,t.meta),c.mode.isReduced=e.qDataPages[0]&&e.qDataPages[0].qIsReduced,c.mode.isStackedByDimension=c.mode.isStacked&&(2===(i=e).qDimensionInfo.length&&2===i.qMeasureInfo.length),c.mode.isStackedByMeasure=c.mode.isStacked&&function(e){return e.qMeasureInfo.length>1&&1===e.qDimensionInfo.length}(e),c.fields={major:c.mode.isStackedByDimension?"qDimensionInfo/"+(e.qDimensionInfo.length-1):n.fields.major,majorGroup:n.fields.majorGroup,minor:c.mode.isStackedByDimension?e.qMeasureInfo.map((e,t)=>`qMeasureInfo/${t}`):n.fields.minor},c.scales={major:Jd.SCALE.REDUCED.MAJOR,minor:Jd.SCALE.REDUCED.MINOR},c.cube=e,r.qDataPages=e.qDataPages},fetchMinMaxData(){if(r.qDataPages)return Promise.resolve(r.qDataPages);let n=a.settings();const i="K"===t.getHyperCubeValue("qMode")?1:n.rect.qHeight;return n=ne(!0,{},n,{rect:{qHeight:i}}),e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).then(e=>e)},setSnapshotData(e){e.reducedHyperCube=c.cube}}}({enigma:l,layoutService:D,viewModel:O});!function({layoutService:e,viewState:t,viewStateOptions:n={}}){const i=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):n;t.preventSet("scrollOffset",i.scrollOffset),t.preventSet("legendScrollOffset",i.legendScrollOffset||0),i.zoom&&t.preventSet("zoom",i.zoom)}({layoutService:D,viewState:i,viewStateOptions:h?.viewState});const H=om({picasso:e,model:l,app:u,translator:f,localeInfo:M,theme:m,continuousDataModel:R,layoutService:D,legendLayoutService:L,reducedDataModel:z}),B=x({app:u,translator:f}),F=function({layoutService:e,themeService:t,colorService:n}){const i=t.getStyles(),o=t=>(e.getLayoutValue("components",[])||[]).find(e=>e.key===t),r=(e,t)=>{const i=n.getMain().getPaletteColor;if(e?.color&&i){const n=i(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:r(e?.color,i.axis.title.color)}}},label:{getStyle:()=>{const e=o("axis")?.axis?.label?.name;return{fill:r(e?.color,i.axis.label.name.color),fontSize:e?.fontSize??i.axis.label.name.fontSize,fontFamily:e?.fontFamily??i.axis.label.name.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:r(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:r(e?.color,i.legend.label.color)}}}},label:{getStyle:()=>{const e=o("label")?.label?.value;return{fill:r(e?.color,i.label.value.color),useContrastColor:e?.useContrastColor??!0,fontSize:e?.fontSize??i.label.value.fontSize,fontFamily:e?.fontFamily??i.label.value.fontFamily}}}}}({layoutService:D,themeService:P,colorService:H}),j=Ed({layoutService:D,viewState:i,colorModel:{settings:()=>H.getMain().getSettings(),resolveUIColor:e=>H.getMain().getPaletteColor(e)},chart:t,env:n,keys:{colorScale:Jd.SCALE.MAIN.COLOR},isEnabled:()=>!D.meta.isGroupedByDimension&&!D.meta.isDimensionless});wc.attrExpr.updateProperties(l,s);const V=yc({layout:s,app:u,model:l,picasso:e,chart:t,translator:f,localeInfo:M,embed:w}),_=kc({app:u,chart:t,embed:w,flags:C,layout:D.getLayout(),localeInfo:M,model:l,options:{direction:h.direction},picasso:e,translator:f}),U=am({chart:t,actions:g,translator:f,rtl:N,viewState:i,viewModel:O,layoutService:D,dockService:A,colorService:H,themeService:P,trendLineModel:j,custom:_});let $;D.meta.isDiscrete&&($=function({chart:e,actions:t,componentKey:n,enigmaModel:i,layoutService:o,dockService:s,trendLineModel:l,itemWidths:u,viewState:d,rtl:m,options:{definitionPath:h="/qHyperCubeDef",getRect:f,axisKey:p,renderer:g,areaBuffer:y,processDataPage:v=()=>{}}={}}){const b=c(),x=function({qMode:e}){switch(e){case"K":return Gc;case"T":return Yc;default:return Kc}}({qMode:o.getHyperCubeValue("qMode")}),S=function({state:e,contains:t}){return e.set(Xc,[]),{add:t=>{const n=e.get(Xc);n.length=0,n.push(t)},getCurrent:()=>e.get(Xc)[0],getAll:()=>e.get(Xc),contains:n=>t(e.get(Xc)[0],n)}}({state:b,contains:x.contains});!function({layoutService:e,dataStore:t,composition:n}){const i=e.getDataPages()[0];if(!i)return;const o=n.patcher({layoutService:e});o.should(i)&&o(i);t.add(i)}({layoutService:o,dataStore:S,composition:x});const M=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:y}),q=function({dataStore:e,composition:t,enigmaModel:n,layoutService:i,trendLineModel:o=id,definitionPath:a,processDataPage:s}){const{slicer:l,cacheWarden:u,request:c}=t,d=function({dataStore:e,slice:t,warden:n,expand:i,request:o,process:r,connectionless:a,processDataPage:s}){const l=(l,{onProcessing:u}={})=>{if(e.contains(l)){const i=e.getCurrent();if(a)return Promise.resolve(t(i,l));const o=n.release(i.qArea,l),s=r.isProcessing();if(!o&&s&&r.cancel(),!o||s)return Promise.resolve(t(i,l))}if(a)return Promise.resolve(e.getCurrent());r.isProcessing()&&u&&u();const c=i(l);return r(o(c)).then(n=>(s(n),e.add(n),t(n,l)))};return l}({dataStore:e,slice:l,warden:u({bounds:{width:i.meta.size.x,height:i.meta.size.y}}),expand:td({layoutService:i}),request:c({definitionPath:a}),process:nd(n),connectionless:i.meta.isSnapshot,processDataPage:s}),m=r((e,{onProcessing:t,onData:n})=>{d(e,{onProcessing:t}).then(e=>n(e)).catch(e=>{if(e!==Fc)throw e})},Uc);return function(e,{onProcessing:t=jc,onDataPage:n=jc}={}){m(e,{onProcessing:t,onData:e=>{i.setDataPages(e?[e]:[]),o.command.update(),n(e)}})}}({dataStore:S,composition:x,enigmaModel:i,layoutService:o,trendLineModel:l,definitionPath:h,processDataPage:v}),C=function({chart:e,componentKey:t,state:n,dataStore:i,pageData:o,layoutService:r,dockService:a,itemWidths:s,getRect:l,axisKey:u,renderer:c,areaBuffer:d,viewState:m,rtl:h}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const f=function({chart:e,getRect:t,getDataPages:n,layoutService:i,dockService:o,getItemWidths:r,axisKey:a,renderer:s,areaBuffer:l,rtl:u}){const{inTotal:c,area:d,scaleRange:m}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:i}=e.meta;if(t)return od;if(!n)return rd;return i?ud:md}({layoutService:i}),h=()=>"horizontal"===o.meta.major.orientation?t().width:t().height,f=e=>e?h()/e:0,p=(e,t)=>-(e-t)*f(t);return{getItems(){const n=i.getLayoutValue("dimensionAxis"),l=c({layoutService:i});return{inTotal:l,inView:hd({chart:e,rect:t(),dockService:o,itemWidths:r(),axisKey:a,renderer:s,isGrouped:i.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(Vc/(i.meta.dimensionCount+i.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return f(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:i}=t,o=Math.min(0,Math.max(e,p(n,i))),r=i?Math.abs(i*o/h()):0;return{start:{pixel:o,item:r},end:{item:Math.min(r+(i||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return p(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:i}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:i}){const o=e/n*t,r=Math.abs(i)/o,a=Math.min(1,r+e/o);return[r,a]}({viewSize:h(),inTotal:n,inView:i,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>d({getDataPages:n,layoutService:i,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const r=m({getDataPages:n,layoutService:i,offsets:e,items:t,viewSize:h(),upperBound:p(t.inTotal,t.inView)});return"horizontal"===o.meta.major.orientation&&u?function(e){return[1-e[1],1-e[0]]}(r):r},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:i}=t;return e<=0&&e>=p(n,i)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,i=e*f(n);return Number.isFinite(i)?-i:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:i}=t;return-e*(f(i)*n)}}}}({chart:e,getRect:()=>n.get("rect"),getDataPages:i.getCurrent,layoutService:r,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:u,renderer:c,areaBuffer:d,rtl:h}),p=()=>{const e=f.getItems();return n.set("items",e),e},g=({pixelOffset:e,items:t})=>{const i=f.getOffsets({pixelOffset:e,items:t});return n.set("offsets",i),i},y=({items:e})=>{const t=r.getLayoutValue("scrollStartPos"),n=m.get("scrollOffset");if(void 0===n)return 1===t?f.getUpperBound({items:e}):0;if("number"==typeof n)return f.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:i,end:o}=n,a=1===t&&o?o-e.inView:i;return f.convert.itemToPixelOffset({itemOffset:a,items:e})},v=e=>{const[{qArea:t}]=r.getDataPages();return!!t&&Object.keys(e).every(n=>e[n]===t[n])},b=e=>{const t=Date.now(),i=p(),r=g({pixelOffset:e,items:i}),a=f.getArea({itemOffset:r.start.item,items:i});if(v(a))return void((f.validate.offset({pixelOffset:e,items:i})||m.get("scrollOffset").start!==r.start.item)&&(n.set("finished",t),n.set("scaleRange",f.getScaleRange({offsets:r.start,items:i})),m.preventSet("viewRange",f.getViewRange({pixelOffset:r.start.pixel,items:i})),m.set("scrollOffset",{start:r.start.item,end:r.end.item})));m.preventSet("viewRange",f.getViewRange({pixelOffset:r.start.pixel,items:i}));const s=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",f.getScaleRange({offsets:r.start,items:i})),m.set("scrollOffset",{start:r.start.item,end:r.end.item}))};o(a,{onProcessing:s,onDataPage:s})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const i=e.component(t);if(!i)return Promise.resolve();n.set("rect","function"==typeof l?l():i.rect),n.set("itemWidths","function"==typeof s?s():s);const r=p();n.set("itemSize",f.getItemSize({items:r}));const a=y({items:r}),u=g({pixelOffset:a,items:r});m.preventSet("viewRange",f.getViewRange({pixelOffset:u.start.pixel,items:r}));const c=f.getArea({itemOffset:u.start.item,items:r});return new Promise(e=>{o(c,{onDataPage:()=>{n.set("scaleRange",f.getScaleRange({offsets:u.start,items:r})),m.preventSet("scrollOffset",{start:u.start.item,end:u.end.item}),e()}})})},scroll(e){const t=n.get("offsets").start.pixel+e;b(t)},scrollToRelative(e){const t=n.get("items"),i=f.convert.relativeToPixelOffset({relativeOffset:e,items:t});b(i)}}}({chart:e,componentKey:n,state:b,dataStore:S,pageData:q,layoutService:o,dockService:s,itemWidths:u,getRect:f,axisKey:p,renderer:g,areaBuffer:M,viewState:d,rtl:m}),w=function({layoutService:e,dataStore:t}){return function(n){const i=a(n,`${e.refs.dataPages}`);i.length=0,i.push(t.getCurrent())}}({layoutService:o,dataStore:S}),T=function({chart:e,actions:t,componentKey:n,dockService:i,rtl:o,scroller:r}){return{gestures:[Qc({chart:e,actions:t,componentKey:n,dockService:i,rtl:o,scroller:r})],native:{type:"native",events:{wheel:ed({chart:e,actions:t,componentKey:n,scroller:r})}}}}({chart:e,actions:t,componentKey:n,dockService:s,rtl:m,scroller:C});return{interactions:T,query:{getCanScroll:()=>C.enabled(),getItemSize:()=>C.itemSize(),getScaleRange:()=>C.scaleRange(),getCurrentDataPage:()=>S.getCurrent()},command:{initialize:()=>C.initialize(),scrollTo:e=>C.scrollToRelative(e),setSnapshotData:e=>w(e)}}}({chart:t,actions:g,componentKey:Jd.COMPONENT.BAR,enigmaModel:l,layoutService:D,dockService:A,trendLineModel:j,itemWidths:Xd,viewState:i,rtl:N,options:{axisKey:Jd.COMPONENT.BAR_AXIS,renderer:e.renderer("svg")()}}));const W=function({layoutService:e,discreteModel:t}){const{isContinuous:n,canBeContinuous:i,isGroupedByDimension:o}=e.meta,r=e.getLayout(),a="K"===r.qHyperCube.qMode,s=Yr.dimensionless(r),l=Ys.getMeasureRefLines(r),u=Ys.getDimensionRefLines(r,s),c=Ys.getMeasureRefLineLabels(r),d=Ys.getDimensionRefLineLabels(r,s);let m={},h={};const f=t=>{if(i){const n=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:i,qMax:o}=n;return Ys.isOutOfRange({value:t,qMin:i,qMax:o})}return!1},p=t=>{if(!h[t])return!1;if(!n&&o){const n={valueInfo:h[t]},i="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",o=e.getHyperCubeValue(i);return Ys.isOutOfDataPages({label:n,dataPages:o})}return!0},g=()=>!(!u||!u.length)&&!u.every(t=>{const n=Ys.getInputValue({refLineLayout:t,layoutService:e});return f(n)||p(n)}),y={isKMode:a,canBeContinuous:i,measureRefLines:l,dimensionRefLines:u,measureRefLineLabels:c,dimensionRefLineLabels:d,dimensionRefLineInfo:h,dimensionValuesInfo:m,query:{getRefLines:e=>Ys.getRefLines(r,e),getRefLineLabels:e=>Ys.getRefLineLabels(r,e)},update:()=>{h=y.dimensionRefLineInfo,g()&&(m=Ys.getDimensionValuesInfo({layout:r,canBeContinuous:i,discreteModel:t,layoutService:e}),y.dimensionValuesInfo=m,u.forEach(t=>{const n=Ys.getInputValue({refLineLayout:t,layoutService:e});m[n]&&(h[n]?(h[n].innerValues=m[n].innerValues,h[n].minOrder=Math.min(h[n].minOrder,m[n].minOrder),h[n].maxOrder=Math.max(h[n].maxOrder,m[n].maxOrder),h[n].isMinOrderOk=h[n].isMinOrderOk||m[n].isMinOrderOk,h[n].isMaxOrderOk=h[n].isMaxOrderOk||m[n].isMaxOrderOk):h[n]={id:m[n].id,qText:m[n].qText,innerValues:m[n].innerValues,minOrder:m[n].minOrder,maxOrder:m[n].maxOrder,isMinOrderOk:m[n].isMinOrderOk,isMaxOrderOk:m[n].isMaxOrderOk},h[n].numInnerValues=(h[n].maxOrder||0)-(h[n].minOrder||0)+1)}))}};return y.update(),y}({layoutService:D,discreteModel:$}),K=function(e){const t={layout:e.getLayout(),keys:{SCALE:{MAIN:{MINOR:Jd.SCALE.MAIN.MINOR,MAJOR:Jd.SCALE.MAIN.MAJOR}},COMPONENT:{BAR:Jd.COMPONENT.BAR,BAR_AXIS:Jd.COMPONENT.BAR_AXIS,Y_AXIS:"y-axis",MEASURE_TITLE:"measure-title",DIMENSION_TITLE:"dimension-title"},COLLECTION:{MAIN:Jd.COLLECTION.MAIN}}};return t}(D),G=S({picassoInstance:e,plugins:d||[],pluginArgs:K});k.setContext({discrete:$,layoutService:D}),p({alternativeService:B,discrete:$,continuous:Pr,legendLayoutService:L,layoutService:D,viewModel:O,dockService:A,themeService:P,styleService:F,continuousDataModel:R,reducedDataModel:z,colorService:H,trendLineModel:j,refLineModel:W,pluginService:G,customTooltipModel:V,tooltipService:U,selectionService:q,logicalSize:E,disclaimerService:I,customTooltipService:_})},[q,h,n,s]),f}({picasso:s,chart:l,environment:t,viewState:n,viewCache:i}),m=function({env:e,services:t}){const n=B(),i=H(),o=K(),r=function({enable:e=!0}={}){const t=H(),n=()=>Date.now().toString()+Math.random(),[i,o]=D(n()),r={properties:void 0};return O(()=>{if(!t||!t.getEffectiveProperties||!e)return()=>{};const i=()=>{t.getEffectiveProperties().then(e=>{const t=ne(!0,{},e);if(!r.properties)return void(r.properties=t);const i=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const i=ne(!0,{},e),o=ne(!0,{},t);return n.exclude=!Rf(i.qHyperCubeDef?.qLayoutExclude,o.qHyperCubeDef?.qLayoutExclude),delete i.qHyperCubeDef?.qLayoutExclude,delete o.qHyperCubeDef?.qLayoutExclude,n.properties=!Rf(i,o),n}(r.properties,t);r.properties=t,i.exclude&&!i.properties&&o(n())})};return t.on("changed",i),i(),()=>{t.removeListener("changed",i)}},[e]),i}({enable:!1===t?.layoutService?.meta?.isSnapshot}),[a,s]=U(async()=>{if(!e||!t)return Promise.resolve();const{layoutService:r}=t,{isSnapshot:a,isStacked:s,isContinuous:l}=r.meta,u=[];return a||u.push(i.getEffectiveProperties()),Promise.all(u).then(async e=>{const t=e[0]||void 0;if(t?.qHyperCubeDef){const e=r.getLayout(),a=ne(!0,{},t);if(zf({properties:t,layout:e,isStacked:s,isContinuous:l,model:i,layoutService:r}))return o.pending(),kl(e)?i.setProperties(t).then(()=>{n.clearUndoBuffer()}):void await Tl(i,a,t);o.restore()}return{properties:t}})},[e,t,r]);if(s&&!s.isHandled)throw s;return a}({env:e,services:u});!function({picasso:e,chart:t,services:n,environment:i,viewState:r,viewCache:a,bootstrapped:s}){const{width:l,height:u}=_(),c=H(),d=j(),m=I(),[h,f]=D(),[p,g]=D(),[y,v]=D(),[b,x]=D(),S=B();function M(s={}){const{alternativeService:l,selectionService:u,refLineModel:f,discrete:p,reducedDataModel:g,continuousDataModel:y,trendLineModel:v,pluginService:b,colorService:x,viewModel:M,dockService:q,themeService:C,customTooltipModel:w,layoutService:T,logicalSize:k,styleService:N,disclaimerService:D,tooltipService:L}=n,E=u.custom.getActions(),O=e.data("q")(h.prepPicassoDataSet()),A={picasso:e,ds:O,rtl:"rtl"===m?.direction,model:c,app:S,chart:t,actions:E,localeInfo:i.localeInfo,logicalSize:k,flags:i.flags,translator:i.translator,selections:d,isLocked:u.getIsSelectionLocked,viewCache:a,viewState:r,alternativeService:l,layoutService:T,dockService:q,viewModel:M,colorService:x,selectionService:u,themeService:C,trendLineModel:v,discrete:p,continuousDataModel:y,reducedDataModel:g.model(),customTooltipModel:w,debouncer:o,refLineModel:f,pluginService:b,styleService:N,disclaimerService:D,tooltipService:L,...s};return Of(T.getLayout(),A,i)}function q(){if(!t.layoutComponents)return Promise.resolve();const{discrete:e,layoutService:i,viewModel:o}=n;a.set("isPreRender",!0);const r=M(p);h.extractDataPages(),t.layoutComponents({settings:r,data:y}),a.set("isPreRender",!1),h.insertDataPages(),o.animations.hasSlicedHats=r.components.filter(e=>"box-sliced-hat"===e.type).length>0;const s=[];return 1!==r.components.length&&i.meta.isDiscrete&&s.push(e.command.initialize()),Promise.all(s)}const[[C,w]=[]]=U(()=>{if(!(e&&t&&n&&i&&r&&a&&s))return Promise.resolve();const{alternativeService:o,layoutService:l,selectionService:u,refLineModel:c,discrete:d,continuous:m,reducedDataModel:h,continuousDataModel:f,trendLineModel:p,legendLayoutService:g,colorService:y,pluginService:v,viewModel:b,customTooltipModel:S,disclaimerService:M,customTooltipService:q,tooltipService:C}=n;if(!u?.custom?.getActions())return Promise.resolve();const{properties:w}=s,T=w?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);T&&(S.useCustomTooltip=!1);const k=()=>{x(Date.now()),b.animations.isPartialUpdating=!0},N=()=>{g&&g.setDataPages([d.query.getCurrentDataPage()]),c&&c.update(),k()};r.onChanged("scrollOffset",N),r.onChanged("legendScrollOffset",k),r.intercept("zoom",m.event.onZoomIntercept({viewCache:a})),r.onChanged("zoom",m.event.onZoomChange({layoutService:l,continuousDataModel:f},k)),u.setLayout(l.getLayout());const D=[];l.meta.isContinuous&&(f.update(l.getLayout()),D.push(f.initialFetch())),p.command.update(),D.push(h.fetch().then(({reducedCube:e})=>{h.update(e)})),q.setProperties(w),C.expando.set("properties",w),M.initialize(),D.push(Promise.resolve({properties:s.properties}));const L=()=>[v.initialize(),y.initialize(),o.initialize({properties:w}),Lm({reducedDataModel:h,layoutService:l,continuousDataModel:f,trendLineModel:p})];return Promise.all(D).then(e=>Promise.all(L()).then(t=>[e,t.pop()]))},[s]);O(()=>{if(!n?.colorService?.getMain()||!w)return;const{layoutService:e,selectionService:t,reducedDataModel:o,continuousDataModel:r,trendLineModel:s,legendLayoutService:l,colorService:u,viewModel:c}=n;a.set("minorMinMax",w);const d=()=>!e.meta.isContinuous&&(o.model().mode.isReduced||e.meta.isStacked)&&l,m=e.getHyperCube(),h=e.meta.isContinuous?r.getInitialCube():o.model().cube,{field:p}=u.getMain().getSettings(),y=d(),v=y?l.getHyperCube():void 0;t.setBrushAliases({colorField:p,useLegendCube:y,legendAlias:`legendCube/${p}`});const b=function({mainCube:e,miniCube:t,legendCube:n,localeInfo:i,layoutService:o,viewModel:r,trendLineModel:a}){const s=o.refs.dataPages.split(".").pop();let l=[],u=[];const c=o.meta.isContinuous?[{key:r.fields.majorNumeric,from:o.meta.isStackedByDimension?r.fields.majorStack:r.fields.major,override:{value:e=>e.qNum}}]:void 0;return{prepPicassoDataSet:()=>({key:"qHyperCube",data:e,config:{localeInfo:i,virtualFields:c}}),prepPicassoData(o){const r=[{type:"q",key:"qHyperCube",data:e,config:{localeInfo:i,virtualFields:c}},{type:"q",key:"miniCube",data:t,config:{localeInfo:i,virtualFields:c}},...o];return n&&r.push({type:"q",key:"legendCube",data:n,config:{localeInfo:i,virtualFields:c}}),a.query.hasTrendLines()&&r.push({key:"trend",data:a.query.getData()}),r},extractDataPages(){l=e[s],u=t.qDataPages,e[s]=[],t.qDataPages=[]},insertDataPages(){e[s]=l,t.qDataPages=u}}}({mainCube:m,miniCube:h,legendCube:v,localeInfo:i.localeInfo,layoutService:e,viewModel:c,trendLineModel:s}),x=C[C.length-1];g({localeInfo:i.localeInfo,...x}),f(b)},[w]),O(()=>{if(!n||!p||!h)return;const e=n.colorService.getMain();if(!e)return;h.prepPicassoDataSet();const t=h.prepPicassoData(e.getData());v(t)},[p]),O(()=>{n?.colorService?.getMain()&&t.update&&h&&y&&q().then(()=>{const{layoutService:e,discrete:i,legendLayoutService:o}=n;if(o){1===e.getLayoutValue("scrollStartPos")&&o.setDataPages([i.query.getCurrentDataPage()])}t.update(),bl.cacheProperties({viewCache:a,layout:e.getLayout()})})},[y]),O(()=>{if(!(l&&u&&h&&t?.update&&n?.colorService.getMain()))return;const{viewModel:e}=n;e.animations.isSizeChanging=!0;const{dockService:o,themeService:r}=n;o.update({width:l,height:u}),r.setTheme(i.theme),q().then(()=>{t.update&&t.update()})},[l,u]),O(()=>{if(!t?.update)return;const{viewModel:e}=n;t.update({partialData:!0,excludeFromUpdate:["mini-marker","dim-title","measure-title","ref-line","grid-line"]}),e.animations.isPartialUpdating=!1},[b])}({picasso:s,chart:l,services:u,environment:t,viewState:n,viewCache:i,bootstrapped:m}),Af({environment:t,services:u,chart:l,viewState:n,bootstrapped:m})}}});const Y={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function X(e){return Y[e]||e}function J(e){return function(t,n,i){let o,r,a,s,l=[],u=!0;function c(){"function"==typeof o.enable&&(o.enable=o.enable.bind(r)()),o.enable&&(o.gestures.forEach(t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(r));const n=X(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),a=a||new e.Manager(i),a.add(new e[n](t.options)),Object.keys(t.events).forEach(e=>{t.events[e]=t.events[e].bind(r),a.on(e,t.events[e])}),l.push(t))}),o.gestures.forEach(t=>{const n=X(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter(e=>""!==e)),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter(e=>""!==e)))}))}function d(){l.forEach(e=>{Object.keys(e.events).forEach(t=>{a.off(t,e.events[t])}),a.remove(e.options.event)}),l=[]}return{get key(){return s},set(e){!function(e){s=e.key,o=e,r={chart:t,mediator:n,settings:o},o.gestures=o.gestures||[],void 0===o.enable&&(o.enable=!0)}(e),d(),u&&c()},off(){u=!1,d()},on(){u=!0,0===l.length&&c()},destroy(){d(),a&&a.destroy(),a=null,r=null,o=null}}}}function Z(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Q,ee;var te=function(){if(ee)return Q;ee=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},r=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var i,o=e.call(n,"constructor"),r=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!o&&!r)return!1;for(i in n);return void 0===i||e.call(n,i)},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(i)return i(t,n).value}return t[n]};return Q=function e(){var t,n,i,l,u,c,d=arguments[0],m=1,h=arguments.length,f=!1;for("boolean"==typeof d&&(f=d,d=arguments[1]||{},m=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});m<h;++m)if(null!=(t=arguments[m]))for(n in t)i=s(d,n),d!==(l=s(t,n))&&(f&&l&&(r(l)||(u=o(l)))?(u?(u=!1,c=i&&o(i)?i:[]):c=i&&r(i)?i:{},a(d,{name:n,newValue:e(f,c,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},Q}(),ne=Z(te),ie={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:oe}=ie;function re({layoutService:e,largeDataService:t}){const{maxNumPoints:n=oe}=t?.meta||{},{qHyperCube:i}=e.getLayout();return i.qSize.qcy*i.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:ae}=ie,se=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=ae}=t?.meta||{},{qHyperCube:i}=e.getLayout();return i.qDimensionInfo.length>1&&!re({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:le}=ie,{MAX_NUM_POINTS:ue,DEFAULT_NUM_POINTS:ce,DEFAULT_NUM_LINES:de}=ie,{DEFAULT_NUM_POINTS:me}=ie,he=({layoutService:e,largeDataService:t})=>{if(!re({layoutService:e,largeDataService:t})){const{maxNumPoints:e=me}=t?.meta||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{const{dimensions:n=[]}=e?.meta?.size||{},{maxNumLines:i=de,maxNumPoints:o=ce,hasInjectedData:r=!1}=t?.meta||{};if(se({layoutService:e,largeDataService:t})*n[0]<=o)return n[0];const a=Math.max(1,Math.min(i,n[1])),s=o/a,l=Math.floor(n[0]<=s?s:s/4),u=2*a*(a+1);return r&&(a>de||o>ce)?Math.min(l,Math.ceil(ue/u)):l})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=le}=t?.meta||{},{measureCount:i=1}=e?.meta||{},o=4+2*(i-1);return Math.floor(n/(i*o))})({layoutService:e,largeDataService:t})};function fe({model:e,layoutService:t,largeDataService:n,definitionPath:i="/qHyperCubeDef"}){return{shouldFetchReduced:()=>re({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>he({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>se({layoutService:t,largeDataService:n}),fetch:(o,r)=>(({start:e,end:t,model:n,layoutService:i,largeDataService:o,definitionPath:r})=>{const a={qStart:e,qEnd:t,qNbrPoints:he({layoutService:i,largeDataService:o}),qMaxNbrTicks:300,qMaxNumberLines:se({layoutService:i,largeDataService:o})};return n.getHyperCubeContinuousData(r,a,!1)})({start:o,end:r,model:e,layoutService:t,largeDataService:n,definitionPath:i})}}function pe(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function ge({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let i=n+e,o=i+t;return 1===t&&0===e&&(i=n-.5,o=n+.5),{zoom:{min:i,max:o}}}(n,t.get("continuousMin"))}}}function ye(){const e=()=>{},t=[],n={};return e.set=(e,i)=>{const o=t.indexOf(e);o>-1&&t.splice(o,1),t.push(e),n[e]=i},e.forEach=e=>{t.forEach((t,i)=>e(n[t],i))},e.has=e=>e in n,e}function ve(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const i=[],o=ye(),r=ye();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?o.set(l,s):s[0].qNum>t&&(r.has(l)||r.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&i.push(s)}return o.forEach((e,t)=>i.splice(t,0,e)),r.forEach(e=>i.push(e)),i}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const i=[];let o,r;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?o=s:s[0].qNum>t&&(r||(r=s)),s[0].qNum>=e&&s[0].qNum<=t&&i.push(s)}return o&&i.unshift(o),r&&i.push(r),i}({start:e,end:t,matrix:n})}function be(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function xe(e,t,n){const i={qDataPages:(n.qDataPages||[]).map(n=>{const i=ve(e,t,n.qMatrix),o=be(n.qArea,i);return{...n,qArea:o,qMatrix:i}})};return n.qAxisData&&n.qAxisData.qAxis&&(i.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map(n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce((n,i)=>((i.qStart>=e&&i.qStart<=t||i.qEnd>=e&&i.qEnd<=t||i.qStart<e&&i.qEnd>t)&&n.push(i),n),[])}))}}(e,t,n.qAxisData)),i}const Se=2**.5,Me=1/Se,qe=Me**44;function Ce(e){return e.qIsOtherCell}function we({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach(e=>{if(!e.some(Ce)){const n=e[0].qElemNumber;t[n]=void 0}}),Object.keys(t).length}(n):function(e){let t=0;return e.forEach(e=>{e.some(Ce)||t++}),t}(n)}const Te={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var ke={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter(e=>!e.isMinor),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const i=t[e],o=t[e+1];i.data={},o||1===i.end?o?(i.data.start=i.value,i.data.end=o.value,i.end=o.position):(i.data.start=i.value,i.data.end=i.value):(i.data.start=i.value,i.data.end=n,i.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map(t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height}));if(t.length&&t[0].start>0){const i=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],i.data.start]},x:0,y:0,width:i.start*this.rect.width,height:this.rect.height})}return n}};function Ne(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function De(e,t){return e.x<t.x?e.x+e.width>=t.x:t.x+t.width>=e.x}function Le(e,t){const{localProps:{size:n},props:{anchor:i}}=t,o=function({props:e,localProps:{size:t},style:n,renderer:i}){const o=e.label.padding,r=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>i.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,i)=>{const l="string"==typeof e.label?e.label:"",u=s(l);let{x:c,width:d}=i;e.start===e.end&&(d=u.width+2*o,1===e.end&&(c-=d));const m={x:c+o,y:o,width:d-2*o,height:t.height-2*o},h=s(`${l[0]}…`).width,f=Math.max(0,m.width-u.width),p=Math.max(0,m.height-u.height),g=r*f,y=a*p;return{show:m.width>=Math.min(h,u.width),text:l,dx:g,dy:y,rect:m,style:n.label,segment:{x:c+g,width:u.width+2*o},tickValue:e.value}}}}(t),r=function({localProps:{size:e},style:t,scale:n,props:i}){const[o,r]=n.domain(),a=Math.max(0,Math.min(1,i.guideLine.major.justify));return{resolve:(n,i)=>{const s=a*i.width,l=Ne(i.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=o&&n.value<=r,x1:l,y1:0,x2:l,y2:Ne(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map(e=>{const t=function(e,t,n){const i=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:i,height:t.height}}(e,n,i);return{rect:t,label:o.resolve(e,t),guideLine:r.resolve(e,t)}});return function(e,t){const n=e.length;if(n<2)return;const i=e[n-1],o=t[n-1].label;if(i&&i.start===i.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&!De(n.segment,o.segment)}}(e,a),a}function Ee(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:i=>{const o=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),r=Ne(i.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:r,y1:Ne(o,n.minorGuideLine.strokeWidth),x2:r,y2:Ne(t.guideLine.minor.size+o,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function Oe(e){return e.filter(e=>e.show).map(e=>ne({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue}))}var Ae={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter(e=>!e.isMinor),i=t.filter(e=>e.isMinor);this.state.line=function({localProps:{size:e},style:t,props:n}){const i=Ne(1,t.line.strokeWidth);return{show:n.line.show,x1:Ne(0,t.line.strokeWidth),y1:i,x2:Ne(e.width,t.line.strokeWidth),y2:i,style:t.line}}(this),this.state.major=Le(n,this),this.state.minor=Ee(i,this)},render(){return[...Oe([this.state.line]),...(e=this.state.major.map(e=>e.label),e.filter(e=>e.show).map(e=>ne({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue}))),...Oe(this.state.major.map(e=>e.guideLine)),...Oe(this.state.minor.map(e=>e.guideLine))];var e}};function Ie(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Pe(e){var t;return 1===e.length&&(t=e,e=function(e,n){return Ie(t(e),n)}),{left:function(t,n,i,o){for(null==i&&(i=0),null==o&&(o=t.length);i<o;){var r=i+o>>>1;e(t[r],n)<0?i=r+1:o=r}return i},right:function(t,n,i,o){for(null==i&&(i=0),null==o&&(o=t.length);i<o;){var r=i+o>>>1;e(t[r],n)>0?o=r:i=r+1}return i}}}var Re=Pe(Ie).right,ze=Math.sqrt(50),He=Math.sqrt(10),Be=Math.sqrt(2);function Fe(e,t,n){var i=(t-e)/Math.max(0,n),o=Math.floor(Math.log(i)/Math.LN10),r=i/Math.pow(10,o);return o>=0?(r>=ze?10:r>=He?5:r>=Be?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(r>=ze?10:r>=He?5:r>=Be?2:1)}function je(e,t,n){var i=Math.abs(t-e)/Math.max(0,n),o=Math.pow(10,Math.floor(Math.log(i)/Math.LN10)),r=i/o;return r>=ze?o*=10:r>=He?o*=5:r>=Be&&(o*=2),t<e?-o:o}function Ve(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var _e="$";function Ue(){}function $e(e,t){var n=new Ue;if(e instanceof Ue)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var i,o=-1,r=e.length;if(null==t)for(;++o<r;)n.set(o,e[o]);else for(;++o<r;)n.set(t(i=e[o],o,e),i)}else if(e)for(var a in e)n.set(a,e[a]);return n}function We(){}Ue.prototype=$e.prototype={constructor:Ue,has:function(e){return _e+e in this},get:function(e){return this[_e+e]},set:function(e,t){return this[_e+e]=t,this},remove:function(e){var t=_e+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===_e&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===_e&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===_e&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===_e&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===_e&&++e;return e},empty:function(){for(var e in this)if(e[0]===_e)return!1;return!0},each:function(e){for(var t in this)t[0]===_e&&e(this[t],t.slice(1),this)}};var Ke=$e.prototype;We.prototype={constructor:We,has:Ke.has,add:function(e){return this[_e+(e+="")]=e,this},remove:Ke.remove,clear:Ke.clear,values:Ke.keys,size:Ke.size,empty:Ke.empty,each:Ke.each};var Ge=Array.prototype,Ye=Ge.map,Xe=Ge.slice;function Je(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ze(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Qe(){}var et=.7,tt=1/et,nt="\\s*([+-]?\\d+)\\s*",it="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",ot="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rt=/^#([0-9a-f]{3,8})$/,at=new RegExp("^rgb\\("+[nt,nt,nt]+"\\)$"),st=new RegExp("^rgb\\("+[ot,ot,ot]+"\\)$"),lt=new RegExp("^rgba\\("+[nt,nt,nt,it]+"\\)$"),ut=new RegExp("^rgba\\("+[ot,ot,ot,it]+"\\)$"),ct=new RegExp("^hsl\\("+[it,ot,ot]+"\\)$"),dt=new RegExp("^hsla\\("+[it,ot,ot,it]+"\\)$"),mt={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 ht(){return this.rgb().formatHex()}function ft(){return this.rgb().formatRgb()}function pt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=rt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?gt(t):3===n?new bt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?yt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?yt(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=at.exec(e))?new bt(t[1],t[2],t[3],1):(t=st.exec(e))?new bt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=lt.exec(e))?yt(t[1],t[2],t[3],t[4]):(t=ut.exec(e))?yt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ct.exec(e))?qt(t[1],t[2]/100,t[3]/100,1):(t=dt.exec(e))?qt(t[1],t[2]/100,t[3]/100,t[4]):mt.hasOwnProperty(e)?gt(mt[e]):"transparent"===e?new bt(NaN,NaN,NaN,0):null}function gt(e){return new bt(e>>16&255,e>>8&255,255&e,1)}function yt(e,t,n,i){return i<=0&&(e=t=n=NaN),new bt(e,t,n,i)}function vt(e,t,n,i){return 1===arguments.length?((o=e)instanceof Qe||(o=pt(o)),o?new bt((o=o.rgb()).r,o.g,o.b,o.opacity):new bt):new bt(e,t,n,null==i?1:i);var o}function bt(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function xt(){return"#"+Mt(this.r)+Mt(this.g)+Mt(this.b)}function St(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function Mt(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function qt(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new wt(e,t,n,i)}function Ct(e){if(e instanceof wt)return new wt(e.h,e.s,e.l,e.opacity);if(e instanceof Qe||(e=pt(e)),!e)return new wt;if(e instanceof wt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,o=Math.min(t,n,i),r=Math.max(t,n,i),a=NaN,s=r-o,l=(r+o)/2;return s?(a=t===r?(n-i)/s+6*(n<i):n===r?(i-t)/s+2:(t-n)/s+4,s/=l<.5?r+o:2-r-o,a*=60):s=l>0&&l<1?0:a,new wt(a,s,l,e.opacity)}function wt(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Tt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function kt(e){return function(){return e}}function Nt(e){return 1===(e=+e)?Dt: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(i){return Math.pow(e+i*t,n)}}(t,n,e):kt(isNaN(t)?n:t)}}function Dt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):kt(isNaN(e)?t:e)}Je(Qe,pt,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:ht,formatHex:ht,formatHsl:function(){return Ct(this).formatHsl()},formatRgb:ft,toString:ft}),Je(bt,vt,Ze(Qe,{brighter:function(e){return e=null==e?tt:Math.pow(tt,e),new bt(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?et:Math.pow(et,e),new bt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){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:xt,formatHex:xt,formatRgb:St,toString:St})),Je(wt,function(e,t,n,i){return 1===arguments.length?Ct(e):new wt(e,t,n,null==i?1:i)},Ze(Qe,{brighter:function(e){return e=null==e?tt:Math.pow(tt,e),new wt(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?et:Math.pow(et,e),new wt(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,o=2*n-i;return new bt(Tt(e>=240?e-240:e+120,o,i),Tt(e,o,i),Tt(e<120?e+240:e-120,o,i),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Lt=function e(t){var n=Nt(t);function i(e,t){var i=n((e=vt(e)).r,(t=vt(t)).r),o=n(e.g,t.g),r=n(e.b,t.b),a=Dt(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=o(t),e.b=r(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function Et(e,t){t||(t=[]);var n,i=e?Math.min(t.length,e.length):0,o=t.slice();return function(r){for(n=0;n<i;++n)o[n]=e[n]*(1-r)+t[n]*r;return o}}function Ot(e,t){var n,i=t?t.length:0,o=e?Math.min(i,e.length):0,r=new Array(o),a=new Array(i);for(n=0;n<o;++n)r[n]=Bt(e[n],t[n]);for(;n<i;++n)a[n]=t[n];return function(e){for(n=0;n<o;++n)a[n]=r[n](e);return a}}function At(e,t){var n=new Date;return e=+e,t=+t,function(i){return n.setTime(e*(1-i)+t*i),n}}function It(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Pt(e,t){var n,i={},o={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?i[n]=Bt(e[n],t[n]):o[n]=t[n];return function(e){for(n in i)o[n]=i[n](e);return o}}var Rt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zt=new RegExp(Rt.source,"g");function Ht(e,t){var n,i,o,r=Rt.lastIndex=zt.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Rt.exec(e))&&(i=zt.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:It(n,i)})),r=zt.lastIndex;return r<t.length&&(o=t.slice(r),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)s[(n=l[i]).i]=n.x(e);return s.join("")})}function Bt(e,t){var n,i,o=typeof t;return null==t||"boolean"===o?kt(t):("number"===o?It:"string"===o?(n=pt(t))?(t=n,Lt):Ht:t instanceof pt?Lt:t instanceof Date?At:(i=t,!ArrayBuffer.isView(i)||i instanceof DataView?Array.isArray(t)?Ot:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Pt:It:Et))(e,t)}function Ft(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function jt(e){return+e}var Vt=[0,1];function _t(e){return e}function Ut(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:(n=isNaN(t)?NaN:.5,function(){return n});var n}function $t(e){var t,n=e[0],i=e[e.length-1];return n>i&&(t=n,n=i,i=t),function(e){return Math.max(n,Math.min(i,e))}}function Wt(e,t,n){var i=e[0],o=e[1],r=t[0],a=t[1];return o<i?(i=Ut(o,i),r=n(a,r)):(i=Ut(i,o),r=n(r,a)),function(e){return r(i(e))}}function Kt(e,t,n){var i=Math.min(e.length,t.length)-1,o=new Array(i),r=new Array(i),a=-1;for(e[i]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<i;)o[a]=Ut(e[a],e[a+1]),r[a]=n(t[a],t[a+1]);return function(t){var n=Re(e,t,1,i)-1;return r[n](o[n](t))}}function Gt(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Yt(e,t){return function(){var e,t,n,i,o,r,a=Vt,s=Vt,l=Bt,u=_t;function c(){return i=Math.min(a.length,s.length)>2?Kt:Wt,o=r=null,d}function d(t){return isNaN(t=+t)?n:(o||(o=i(a.map(e),s,l)))(e(u(t)))}return d.invert=function(n){return u(t((r||(r=i(s,a.map(e),It)))(n)))},d.domain=function(e){return arguments.length?(a=Ye.call(e,jt),u===_t||(u=$t(a)),c()):a.slice()},d.range=function(e){return arguments.length?(s=Xe.call(e),c()):s.slice()},d.rangeRound=function(e){return s=Xe.call(e),l=Ft,c()},d.clamp=function(e){return arguments.length?(u=e?$t(a):_t,d):u!==_t},d.interpolate=function(e){return arguments.length?(l=e,c()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,i){return e=n,t=i,c()}}()(e,t)}function Xt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,i=e.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+e.slice(n+1)]}function Jt(e){return(e=Xt(Math.abs(e)))?e[1]:NaN}var Zt,Qt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function en(e){if(!(t=Qt.exec(e)))throw new Error("invalid format: "+e);var t;return new tn({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function tn(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function nn(e,t){var n=Xt(e,t);if(!n)return e+"";var i=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+i:i.length>o+1?i.slice(0,o+1)+"."+i.slice(o+1):i+new Array(o-i.length+2).join("0")}en.prototype=tn.prototype,tn.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var on={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return nn(100*e,t)},r:nn,s:function(e,t){var n=Xt(e,t);if(!n)return e+"";var i=n[0],o=n[1],r=o-(Zt=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=i.length;return r===a?i:r>a?i+new Array(r-a+1).join("0"):r>0?i.slice(0,r)+"."+i.slice(r):"0."+new Array(1-r).join("0")+Xt(e,Math.max(0,t+r-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function rn(e){return e}var an,sn,ln,un=Array.prototype.map,cn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dn(e){var t=void 0===e.grouping||void 0===e.thousands?rn:function(e,t){return function(n,i){for(var o=n.length,r=[],a=0,s=e[0],l=0;o>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),r.push(n.substring(o-=s,o+s)),!((l+=s+1)>i));)s=e[a=(a+1)%e.length];return r.reverse().join(t)}}(un.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",o=e.decimal+"",r=void 0===e.numerals?rn:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(un.call(e.numerals,String)),a=void 0===e.percent?"%":e.percent+"",s=e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function u(e){var u=(e=en(e)).fill,c=e.align,d=e.sign,m=e.symbol,h=e.zero,f=e.width,p=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(p=!0,v="g"):on[v]||(void 0===g&&(g=12),y=!0,v="g"),(h||"0"===u&&"="===c)&&(h=!0,u="0",c="=");var b="$"===m?n:"#"===m&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===m?i:/[%p]/.test(v)?a:"",S=on[v],M=/[defgprs%]/.test(v);function q(e){var n,i,a,m=b,q=x;if("c"===v)q=S(e)+q,e="";else{var C=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:S(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,i=1,o=-1;i<n;++i)switch(e[i]){case".":o=t=i;break;case"0":0===o&&(o=i),t=i;break;default:if(!+e[i])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),C&&0===+e&&"+"!==d&&(C=!1),m=(C?"("===d?d:s:"-"===d||"("===d?"":d)+m,q=("s"===v?cn[8+Zt/3]:"")+q+(C&&"("===d?")":""),M)for(n=-1,i=e.length;++n<i;)if(48>(a=e.charCodeAt(n))||a>57){q=(46===a?o+e.slice(n+1):e.slice(n))+q,e=e.slice(0,n);break}}p&&!h&&(e=t(e,1/0));var w=m.length+e.length+q.length,T=w<f?new Array(f-w+1).join(u):"";switch(p&&h&&(e=t(T+e,T.length?f-q.length:1/0),T=""),c){case"<":e=m+e+q+T;break;case"=":e=m+T+e+q;break;case"^":e=T.slice(0,w=T.length>>1)+m+e+q+T.slice(w);break;default:e=T+m+e+q}return r(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),q.toString=function(){return e+""},q}return{format:u,formatPrefix:function(e,t){var n=u(((e=en(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(Jt(t)/3))),o=Math.pow(10,-i),r=cn[8+i/3];return function(e){return n(o*e)+r}}}}function mn(e,t,n,i){var o,r=je(e,t,n);switch((i=en(null==i?",f":i)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=i.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Jt(t)/3)))-Jt(Math.abs(e)))}(r,a))||(i.precision=o),ln(i,a);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Jt(t)-Jt(e))+1}(r,Math.max(Math.abs(e),Math.abs(t))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=function(e){return Math.max(0,-Jt(Math.abs(e)))}(r))||(i.precision=o-2*("%"===i.type))}return sn(i)}function hn(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var i,o,r,a,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((i=t<e)&&(o=e,e=t,t=o),0===(a=Fe(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),r=new Array(o=Math.ceil(t-e+1));++s<o;)r[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),r=new Array(o=Math.ceil(e-t+1));++s<o;)r[s]=(e-s)/a;return i&&r.reverse(),r}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var i=t();return mn(i[0],i[i.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var i,o=t(),r=0,a=o.length-1,s=o[r],l=o[a];return l<s&&(i=s,s=l,l=i,i=r,r=a,a=i),(i=Fe(s,l,n))>0?i=Fe(s=Math.floor(s/i)*i,l=Math.ceil(l/i)*i,n):i<0&&(i=Fe(s=Math.ceil(s*i)/i,l=Math.floor(l*i)/i,n)),i>0?(o[r]=Math.floor(s/i)*i,o[a]=Math.ceil(l/i)*i,t(o)):i<0&&(o[r]=Math.ceil(s*i)/i,o[a]=Math.floor(l*i)/i,t(o)),e},e}function fn(){var e=Yt(_t,_t);return e.copy=function(){return Gt(e,fn())},Ve.apply(e,arguments),hn(e)}an=dn({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),sn=an.format,ln=an.formatPrefix;var pn=new Date,gn=new Date;function yn(e,t,n,i){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=function(t){return e(t=new Date(+t)),t},o.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},o.round=function(e){var t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},o.range=function(n,i,r){var a,s=[];if(n=o.ceil(n),r=null==r?1:Math.floor(r),!(n<i&&r>0))return s;do{s.push(a=new Date(+n)),t(n,r),e(n)}while(a<n&&n<i);return s},o.filter=function(n){return yn(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,i){if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););})},n&&(o.count=function(t,i){return pn.setTime(+t),gn.setTime(+i),e(pn),e(gn),Math.floor(n(pn,gn))},o.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(i?function(t){return i(t)%e===0}:function(t){return o.count(0,t)%e===0}):o:null}),o}var vn=yn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});vn.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?yn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):vn:null},vn.range;var bn=6e4,xn=36e5,Sn=864e5,Mn=6048e5,qn=yn(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()});qn.range;var Cn=yn(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*bn)/Sn},function(e){return e.getDate()-1});function wn(e){return yn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*bn)/Mn})}Cn.range;var Tn=wn(0),kn=wn(1),Nn=wn(2),Dn=wn(3),Ln=wn(4),En=wn(5),On=wn(6);Tn.range,kn.range,Nn.range,Dn.range,Ln.range,En.range,On.range;var An=yn(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});An.every=function(e){return isFinite(e=Math.floor(e))&&e>0?yn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null},An.range;var In=yn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*bn)},function(e,t){return(t-e)/bn},function(e){return e.getUTCMinutes()});In.range;var Pn=yn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*xn)},function(e,t){return(t-e)/xn},function(e){return e.getUTCHours()});Pn.range;var Rn=yn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/Sn},function(e){return e.getUTCDate()-1});function zn(e){return yn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/Mn})}Rn.range;var Hn=zn(0),Bn=zn(1),Fn=zn(2),jn=zn(3),Vn=zn(4),_n=zn(5),Un=zn(6);Hn.range,Bn.range,Fn.range,jn.range,Vn.range,_n.range,Un.range;var $n=yn(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())},function(e){return e.getUTCMonth()});$n.range;var Wn=yn(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});function Kn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Gn(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Yn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}Wn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?yn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null},Wn.range;var Xn,Jn,Zn={"-":"",_:" ",0:"0"},Qn=/^\s*\d+/,ei=/^%/,ti=/[\\^$*+?|[\]().{}]/g;function ni(e,t,n){var i=e<0?"-":"",o=(i?-e:e)+"",r=o.length;return i+(r<n?new Array(n-r+1).join(t)+o:o)}function ii(e){return e.replace(ti,"\\$&")}function oi(e){return new RegExp("^(?:"+e.map(ii).join("|")+")","i")}function ri(e){for(var t={},n=-1,i=e.length;++n<i;)t[e[n].toLowerCase()]=n;return t}function ai(e,t,n){var i=Qn.exec(t.slice(n,n+1));return i?(e.w=+i[0],n+i[0].length):-1}function si(e,t,n){var i=Qn.exec(t.slice(n,n+1));return i?(e.u=+i[0],n+i[0].length):-1}function li(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.U=+i[0],n+i[0].length):-1}function ui(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.V=+i[0],n+i[0].length):-1}function ci(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.W=+i[0],n+i[0].length):-1}function di(e,t,n){var i=Qn.exec(t.slice(n,n+4));return i?(e.y=+i[0],n+i[0].length):-1}function mi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function hi(e,t,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return i?(e.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function fi(e,t,n){var i=Qn.exec(t.slice(n,n+1));return i?(e.q=3*i[0]-3,n+i[0].length):-1}function pi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.m=i[0]-1,n+i[0].length):-1}function gi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.d=+i[0],n+i[0].length):-1}function yi(e,t,n){var i=Qn.exec(t.slice(n,n+3));return i?(e.m=0,e.d=+i[0],n+i[0].length):-1}function vi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.H=+i[0],n+i[0].length):-1}function bi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.M=+i[0],n+i[0].length):-1}function xi(e,t,n){var i=Qn.exec(t.slice(n,n+2));return i?(e.S=+i[0],n+i[0].length):-1}function Si(e,t,n){var i=Qn.exec(t.slice(n,n+3));return i?(e.L=+i[0],n+i[0].length):-1}function Mi(e,t,n){var i=Qn.exec(t.slice(n,n+6));return i?(e.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function qi(e,t,n){var i=ei.exec(t.slice(n,n+1));return i?n+i[0].length:-1}function Ci(e,t,n){var i=Qn.exec(t.slice(n));return i?(e.Q=+i[0],n+i[0].length):-1}function wi(e,t,n){var i=Qn.exec(t.slice(n));return i?(e.s=+i[0],n+i[0].length):-1}function Ti(e,t){return ni(e.getDate(),t,2)}function ki(e,t){return ni(e.getHours(),t,2)}function Ni(e,t){return ni(e.getHours()%12||12,t,2)}function Di(e,t){return ni(1+Cn.count(An(e),e),t,3)}function Li(e,t){return ni(e.getMilliseconds(),t,3)}function Ei(e,t){return Li(e,t)+"000"}function Oi(e,t){return ni(e.getMonth()+1,t,2)}function Ai(e,t){return ni(e.getMinutes(),t,2)}function Ii(e,t){return ni(e.getSeconds(),t,2)}function Pi(e){var t=e.getDay();return 0===t?7:t}function Ri(e,t){return ni(Tn.count(An(e)-1,e),t,2)}function zi(e){var t=e.getDay();return t>=4||0===t?Ln(e):Ln.ceil(e)}function Hi(e,t){return e=zi(e),ni(Ln.count(An(e),e)+(4===An(e).getDay()),t,2)}function Bi(e){return e.getDay()}function Fi(e,t){return ni(kn.count(An(e)-1,e),t,2)}function ji(e,t){return ni(e.getFullYear()%100,t,2)}function Vi(e,t){return ni((e=zi(e)).getFullYear()%100,t,2)}function _i(e,t){return ni(e.getFullYear()%1e4,t,4)}function Ui(e,t){var n=e.getDay();return ni((e=n>=4||0===n?Ln(e):Ln.ceil(e)).getFullYear()%1e4,t,4)}function $i(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ni(t/60|0,"0",2)+ni(t%60,"0",2)}function Wi(e,t){return ni(e.getUTCDate(),t,2)}function Ki(e,t){return ni(e.getUTCHours(),t,2)}function Gi(e,t){return ni(e.getUTCHours()%12||12,t,2)}function Yi(e,t){return ni(1+Rn.count(Wn(e),e),t,3)}function Xi(e,t){return ni(e.getUTCMilliseconds(),t,3)}function Ji(e,t){return Xi(e,t)+"000"}function Zi(e,t){return ni(e.getUTCMonth()+1,t,2)}function Qi(e,t){return ni(e.getUTCMinutes(),t,2)}function eo(e,t){return ni(e.getUTCSeconds(),t,2)}function to(e){var t=e.getUTCDay();return 0===t?7:t}function no(e,t){return ni(Hn.count(Wn(e)-1,e),t,2)}function io(e){var t=e.getUTCDay();return t>=4||0===t?Vn(e):Vn.ceil(e)}function oo(e,t){return e=io(e),ni(Vn.count(Wn(e),e)+(4===Wn(e).getUTCDay()),t,2)}function ro(e){return e.getUTCDay()}function ao(e,t){return ni(Bn.count(Wn(e)-1,e),t,2)}function so(e,t){return ni(e.getUTCFullYear()%100,t,2)}function lo(e,t){return ni((e=io(e)).getUTCFullYear()%100,t,2)}function uo(e,t){return ni(e.getUTCFullYear()%1e4,t,4)}function co(e,t){var n=e.getUTCDay();return ni((e=n>=4||0===n?Vn(e):Vn.ceil(e)).getUTCFullYear()%1e4,t,4)}function mo(){return"+0000"}function ho(){return"%"}function fo(e){return+e}function po(e){return Math.floor(+e/1e3)}!function(e){Xn=function(e){var t=e.dateTime,n=e.date,i=e.time,o=e.periods,r=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,u=oi(o),c=ri(o),d=oi(r),m=ri(r),h=oi(a),f=ri(a),p=oi(s),g=ri(s),y=oi(l),v=ri(l),b={a:function(e){return a[e.getDay()]},A:function(e){return r[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:Ti,e:Ti,f:Ei,g:Vi,G:Ui,H:ki,I:Ni,j:Di,L:Li,m:Oi,M:Ai,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:fo,s:po,S:Ii,u:Pi,U:Ri,V:Hi,w:Bi,W:Fi,x:null,X:null,y:ji,Y:_i,Z:$i,"%":ho},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return r[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Wi,e:Wi,f:Ji,g:lo,G:co,H:Ki,I:Gi,j:Yi,L:Xi,m:Zi,M:Qi,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:fo,s:po,S:eo,u:to,U:no,V:oo,w:ro,W:ao,x:null,X:null,y:so,Y:uo,Z:mo,"%":ho},S={a:function(e,t,n){var i=h.exec(t.slice(n));return i?(e.w=f[i[0].toLowerCase()],n+i[0].length):-1},A:function(e,t,n){var i=d.exec(t.slice(n));return i?(e.w=m[i[0].toLowerCase()],n+i[0].length):-1},b:function(e,t,n){var i=y.exec(t.slice(n));return i?(e.m=v[i[0].toLowerCase()],n+i[0].length):-1},B:function(e,t,n){var i=p.exec(t.slice(n));return i?(e.m=g[i[0].toLowerCase()],n+i[0].length):-1},c:function(e,n,i){return C(e,t,n,i)},d:gi,e:gi,f:Mi,g:mi,G:di,H:vi,I:vi,j:yi,L:Si,m:pi,M:bi,p:function(e,t,n){var i=u.exec(t.slice(n));return i?(e.p=c[i[0].toLowerCase()],n+i[0].length):-1},q:fi,Q:Ci,s:wi,S:xi,u:si,U:li,V:ui,w:ai,W:ci,x:function(e,t,i){return C(e,n,t,i)},X:function(e,t,n){return C(e,i,t,n)},y:mi,Y:di,Z:hi,"%":qi};function M(e,t){return function(n){var i,o,r,a=[],s=-1,l=0,u=e.length;for(n instanceof Date||(n=new Date(+n));++s<u;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(o=Zn[i=e.charAt(++s)])?i=e.charAt(++s):o="e"===i?" ":"0",(r=t[i])&&(i=r(n,o)),a.push(i),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function q(e,t){return function(n){var i,o,r=Yn(1900,void 0,1);if(C(r,e,n+="",0)!=n.length)return null;if("Q"in r)return new Date(r.Q);if("s"in r)return new Date(1e3*r.s+("L"in r?r.L:0));if(t&&!("Z"in r)&&(r.Z=0),"p"in r&&(r.H=r.H%12+12*r.p),void 0===r.m&&(r.m="q"in r?r.q:0),"V"in r){if(r.V<1||r.V>53)return null;"w"in r||(r.w=1),"Z"in r?(o=(i=Gn(Yn(r.y,0,1))).getUTCDay(),i=o>4||0===o?Bn.ceil(i):Bn(i),i=Rn.offset(i,7*(r.V-1)),r.y=i.getUTCFullYear(),r.m=i.getUTCMonth(),r.d=i.getUTCDate()+(r.w+6)%7):(o=(i=Kn(Yn(r.y,0,1))).getDay(),i=o>4||0===o?kn.ceil(i):kn(i),i=Cn.offset(i,7*(r.V-1)),r.y=i.getFullYear(),r.m=i.getMonth(),r.d=i.getDate()+(r.w+6)%7)}else("W"in r||"U"in r)&&("w"in r||(r.w="u"in r?r.u%7:"W"in r?1:0),o="Z"in r?Gn(Yn(r.y,0,1)).getUTCDay():Kn(Yn(r.y,0,1)).getDay(),r.m=0,r.d="W"in r?(r.w+6)%7+7*r.W-(o+5)%7:r.w+7*r.U-(o+6)%7);return"Z"in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,Gn(r)):Kn(r)}}function C(e,t,n,i){for(var o,r,a=0,s=t.length,l=n.length;a<s;){if(i>=l)return-1;if(37===(o=t.charCodeAt(a++))){if(o=t.charAt(a++),!(r=S[o in Zn?t.charAt(a++):o])||(i=r(e,n,i))<0)return-1}else if(o!=n.charCodeAt(i++))return-1}return i}return b.x=M(n,b),b.X=M(i,b),b.c=M(t,b),x.x=M(n,x),x.X=M(i,x),x.c=M(t,x),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=q(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=q(e+="",!0);return t.toString=function(){return e},t}}}(e),Xn.format,Xn.parse,Jn=Xn.utcFormat,Xn.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var go=1e3,yo=6e4,vo=36e5,bo=864e5,xo=2592e6,So=31536e6;function Mo(e){return new Date(e)}function qo(e){return e instanceof Date?+e:+new Date(+e)}function Co(e,t,n,i,o,r,a,s,l){var u=Yt(_t,_t),c=u.invert,d=u.domain,m=l(".%L"),h=l(":%S"),f=l("%I:%M"),p=l("%I %p"),g=l("%a %d"),y=l("%b %d"),v=l("%B"),b=l("%Y"),x=[[a,1,go],[a,5,5e3],[a,15,15e3],[a,30,3e4],[r,1,yo],[r,5,3e5],[r,15,9e5],[r,30,18e5],[o,1,vo],[o,3,108e5],[o,6,216e5],[o,12,432e5],[i,1,bo],[i,2,1728e5],[n,1,6048e5],[t,1,xo],[t,3,7776e6],[e,1,So]];function S(s){return(a(s)<s?m:r(s)<s?h:o(s)<s?f:i(s)<s?p:t(s)<s?n(s)<s?g:y:e(s)<s?v:b)(s)}function M(t,n,i,o){if(null==t&&(t=10),"number"==typeof t){var r=Math.abs(i-n)/t,a=Pe(function(e){return e[2]}).right(x,r);a===x.length?(o=je(n/So,i/So,t),t=e):a?(o=(a=x[r/x[a-1][2]<x[a][2]/r?a-1:a])[1],t=a[0]):(o=Math.max(je(n,i,t),1),t=s)}return null==o?t:t.every(o)}return u.invert=function(e){return new Date(c(e))},u.domain=function(e){return arguments.length?d(Ye.call(e,qo)):d().map(Mo)},u.ticks=function(e,t){var n,i=d(),o=i[0],r=i[i.length-1],a=r<o;return a&&(n=o,o=r,r=n),n=(n=M(e,o,r,t))?n.range(o,r+1):[],a?n.reverse():n},u.tickFormat=function(e,t){return null==t?S:l(t)},u.nice=function(e,t){var n=d();return(e=M(e,n[0],n[n.length-1],t))?d(function(e,t){var n,i=0,o=(e=e.slice()).length-1,r=e[i],a=e[o];return a<r&&(n=i,i=o,o=n,n=r,r=a,a=n),e[i]=t.floor(r),e[o]=t.ceil(a),e}(n,e)):u},u.copy=function(){return Gt(u,Co(e,t,n,i,o,r,a,s,l))},u}function wo(){return Ve.apply(Co(Wn,$n,Hn,Rn,Pn,In,qn,vn,Jn).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function To(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd)}function ko(e){return e.qTags.indexOf("$qualified")>-1}function No({qAxis:e}){const t=[],n=[];for(let i=0;i<e.length;i++){const o=i+1,r=e[i],a=e[o];To(r,a)?(ko(a)?(t.push(o),n.push(i)):(t.push(i),n.push(o)),i++):(t.push(i),n.push(i))}return{qualified:t,nonQualified:n}}function Do({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let i,o=NaN,r=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const u=e[l];if(u.queries.outer(n)){const e=t[l+1];if(o=u.index,i=l,u.attrs.isDayOrShorter()&&u.queries.canFitHalfDayTicks(n)){r="auto",s=!0;break}if(e&&e.queries.inner(n)){r=e.index;const i=t[l+2];i&&i.queries.minor(n)&&(a=i.index);break}}}if(!Number.isNaN(o)&&Number.isNaN(r)&&"auto"!==r){r=o,o=NaN;const e=t[i+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(o)&&(o="auto",r="auto");return{outer:o,inner:r,minor:a,isDayOrShorter:s}}}}function Lo({qTicks:e,measureText:t=()=>({width:0}),cache:n={},scale:i}){const o=n;return{isDayOrShorter:()=>(o.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,o.isDayOrShorter),count:()=>e.length,maxRange:()=>(o.maxRange=e.length?Math.max(...e.map(e=>Math.abs(i(e.qStart)-i(e.qEnd)))):0,o.maxRange),rangeAndWidth(){const n=i.clamp();return i.clamp(!1),o.rangeAndWidth=e.map(e=>({range:Math.abs(i(e.qStart)-i(e.qEnd)),width:t(`${e.qText}`).width+16})),i.clamp(n),o.rangeAndWidth}}}function Eo({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),inner:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),minor:t=>e.maxRange()*t>=6,canFitHalfDayTicks:n=>n>=t*e.count()}}function Oo({qualified:e,nonQualified:t,qAxis:n,measureText:i,reqAutoFitWidth:o,scale:r},{attributesFactory:a=Lo,queryFactory:s=Eo}={attributesFactory:Lo,queryFactory:Eo}){const l=n.map((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:i,scale:r});return{data:e,index:t,attrs:l,queries:s({attrs:l,reqAutoFitWidth:o})}}(e,t)),u=e.map(e=>l[e]),c=t.map(e=>l[e]);return{qAxisMeta:l,qualifiedMeta:u,nonQualifiedMeta:c}}function Ao({qAxis:e=[],measureText:t=()=>({width:0}),cache:n={},reqAutoFitWidth:i=0,scale:o},{metaFactory:r=Oo,mapper:a=No,resolver:s=Do}={metaFactory:Oo,mapper:No,resolver:Do}){const{qualified:l,nonQualified:u}=a({qAxis:e}),{qualifiedMeta:c,nonQualifiedMeta:d}=r({qAxis:e,qualified:l,nonQualified:u,measureText:t,reqAutoFitWidth:i,scale:o}),m=s({qualifiedMeta:c,nonQualifiedMeta:d});return{resolve:t=>{const i=n.key({distance:t});if(n.get(i))return n.get(i);if(function(e){return!Array.isArray(e)||0===e.length||e.every(e=>0===e.qTicks.length)}(e))return{outer:"auto",inner:"auto",minor:NaN,isDayOrShorter:!1};const o=m.resolve(t);return n.set(i,o),o}}}function Io(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}const Po=Io(0).getTime();function Ro(e){return(e.getTime()-Po)/86400/1e3}const zo=new Date,Ho=new Date;function Bo(e,t,n,i){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),o.round=e=>{const t=o(e),n=o.ceil(e);return e-t<n-e?t:n},o.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),o.range=(n,i,r)=>{const a=[];if(n=o.ceil(n),r=null==r?1:Math.floor(r),!(n<i&&r>0))return a;let s;do{a.push(s=new Date(+n)),t(n,r),e(n)}while(s<n&&n<i);return a},o.filter=n=>Bo(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,i)=>{if(e>=e)if(i<0)for(;++i<=0;)for(;t(e,-1),!n(e););else for(;--i>=0;)for(;t(e,1),!n(e););}),n&&(o.count=(t,i)=>(zo.setTime(+t),Ho.setTime(+i),e(zo),e(Ho),Math.floor(n(zo,Ho))),o.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(i?t=>i(t)%e===0:t=>o.count(0,t)%e===0):o:null)),o}const Fo=1e3,jo=6e4,Vo=36e5,_o=864e5,Uo=6048e5,$o=Bo(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Fo)},(e,t)=>(t-e)/Fo,e=>e.getUTCSeconds());$o.range;const Wo=Bo(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Fo)},(e,t)=>{e.setTime(+e+t*jo)},(e,t)=>(t-e)/jo,e=>e.getMinutes());Wo.range;const Ko=Bo(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*jo)},(e,t)=>(t-e)/jo,e=>e.getUTCMinutes());Ko.range;const Go=Bo(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Fo-e.getMinutes()*jo)},(e,t)=>{e.setTime(+e+t*Vo)},(e,t)=>(t-e)/Vo,e=>e.getHours());Go.range;const Yo=Bo(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Vo)},(e,t)=>(t-e)/Vo,e=>e.getUTCHours());Yo.range;const Xo=Bo(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jo)/_o,e=>e.getDate()-1);Xo.range;const Jo=Bo(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_o,e=>e.getUTCDate()-1);Jo.range;const Zo=Bo(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/_o,e=>Math.floor(e/_o));function Qo(e){return Bo(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jo)/Uo)}Zo.range;const er=Qo(0),tr=Qo(1),nr=Qo(2),ir=Qo(3),or=Qo(4),rr=Qo(5),ar=Qo(6);function sr(e){return Bo(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/Uo)}er.range,tr.range,nr.range,ir.range,or.range,rr.range,ar.range;const lr=sr(0),ur=sr(1),cr=sr(2),dr=sr(3),mr=sr(4),hr=sr(5),fr=sr(6);lr.range,ur.range,cr.range,dr.range,mr.range,hr.range,fr.range;const pr=Bo(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());pr.range;const gr=Bo(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth());gr.range;const yr=Bo(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());yr.every=e=>isFinite(e=Math.floor(e))&&e>0?Bo(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,yr.range;const vr=Bo(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());vr.every=e=>isFinite(e=Math.floor(e))&&e>0?Bo(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,vr.range;const br=1,xr=2,Sr=3,Mr=4,qr=5,Cr=6;function wr({timeScale:e,labels:t,distance:n,isDayOrShorter:i,cache:o,timeOnly:r,initialMin:a}){const[s,l]=e.domain(),u=o.key({distance:n});let c;o.get(u,1)?c=o.get(u,1):(c=function(e,t,n,i,o,r){function a(e){return vr.filter(t=>(t.getUTCFullYear()-r.getUTCFullYear())%e===0)}const s=$o.count(e,t),l=Ko.count(e,t),u=Yo.count(e,t),c=Jo.count(e,t),d=lr.count(e,t),m=gr.count(e,t),h=vr.count(e,t),f=n/i.second.width-1,p=n/i.minute.width-1,g=n/i.date.width-1,y=n/i.year.width-1,v={type:"year",desc:"year",count:h,interval:vr.every(1),formatter:i.year.formatter,offset:e=>vr.offset(e,-1),floor:vr.floor};if(s<=f)v.type=br,v.desc="second",v.count=s,v.interval=$o.every(1),v.formatter=i.second.formatter,v.offset=e=>$o.offset(e,-1),v.floor=$o.floor;else if(s/2<=f)v.type=br,v.desc="every other second",v.count=s/2,v.interval=$o.every(2),v.formatter=i.second.formatter,v.offset=e=>$o.offset(e,-2),v.floor=$o.floor;else if(s/5<=f)v.type=br,v.desc="every 5 second",v.count=s/5,v.interval=$o.every(5),v.formatter=i.second.formatter,v.offset=e=>$o.offset(e,-5),v.floor=$o.floor;else if(s/15<=f)v.type=br,v.desc="every 15 second",v.count=s/15,v.interval=$o.every(15),v.formatter=i.second.formatter,v.offset=e=>$o.offset(e,-15),v.floor=$o.floor;else if(s/30<=f)v.type=br,v.desc="every 30 second",v.count=s/30,v.interval=$o.every(30),v.formatter=i.second.formatter,v.offset=e=>$o.offset(e,-30),v.floor=$o.floor;else if(l<=p)v.type=xr,v.desc="minute",v.count=l,v.interval=Ko.every(1),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-1),v.floor=Ko.floor;else if(l/2<=p)v.type=xr,v.desc="every 2 minute",v.count=l/2,v.interval=Ko.every(2),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-2),v.floor=Ko.floor;else if(l/5<=p)v.type=xr,v.desc="every 5 minute",v.count=l/5,v.interval=Ko.every(5),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-5),v.floor=Ko.floor;else if(l/10<=p)v.type=xr,v.desc="every 10 minute",v.count=l/10,v.interval=Ko.every(10),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-10),v.floor=Ko.floor;else if(l/15<=p)v.type=xr,v.desc="every 15 minute",v.count=l/15,v.interval=Ko.every(15),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-15),v.floor=Ko.floor;else if(l/30<=p)v.type=xr,v.desc="every 30 minute",v.count=l/30,v.interval=Ko.every(30),v.formatter=i.minute.formatter,v.offset=e=>Ko.offset(e,-30),v.floor=Ko.floor;else if(u<=p)v.type=Sr,v.desc="hour",v.count=u,v.interval=Yo.every(1),v.formatter=i.minute.formatter,v.offset=e=>Yo.offset(e,-1),v.floor=Yo.floor;else if(u/2<=p)v.type=Sr,v.desc="every 2 hour",v.count=u/2,v.interval=Yo.every(2),v.formatter=i.minute.formatter,v.offset=e=>Yo.offset(e,-2),v.floor=Yo.floor;else if(u/3<=p)v.type=Sr,v.desc="every 3 hour",v.count=u/3,v.interval=Yo.every(3),v.formatter=i.minute.formatter,v.offset=e=>Yo.offset(e,-3),v.floor=Yo.floor;else if(u/6<=p)v.type=Sr,v.desc="every 6 hour",v.count=u/6,v.interval=Yo.every(6),v.formatter=i.minute.formatter,v.offset=e=>Yo.offset(e,-6),v.floor=Yo.floor;else if(u/12<=p||o)v.type=Sr,v.desc="every 12 hour",v.count=u/12,v.interval=Yo.every(12),v.formatter=i.minute.formatter,v.offset=e=>Yo.offset(e,-12),v.floor=Yo.floor;else if(c<=g)v.type=Mr,v.desc="day",v.count=c,v.interval=Jo.every(1),v.formatter=i.date.formatter,v.offset=e=>Jo.offset(e,-1),v.floor=Jo.floor;else if(c/2<=g)v.type=Mr,v.desc="every 2 day",v.count=c/2,v.interval=Jo.every(2),v.formatter=i.date.formatter,v.offset=e=>Jo.offset(e,-2),v.floor=Jo.floor;else if(c/3<=g)v.type=Mr,v.desc="every 3 day",v.count=c/3,v.interval=Jo.every(3),v.formatter=i.date.formatter,v.offset=e=>Jo.offset(e,-3),v.floor=Jo.floor;else if(d<=g)v.type=Mr,v.desc="week",v.count=d,v.interval=lr.every(1),v.formatter=i.date.formatter,v.offset=e=>lr.offset(e,-1),v.floor=Jo.floor;else if(d/2<=g)v.type=Mr,v.desc="every 2 week",v.count=d/2,v.interval=lr.every(2),v.formatter=i.date.formatter,v.offset=e=>lr.offset(e,-2),v.floor=Jo.floor;else if(m<=g)v.type=qr,v.desc="month",v.count=m,v.interval=gr.every(1),v.formatter=i.date.formatter,v.offset=e=>gr.offset(e,-1),v.floor=Jo.floor;else if(m/3<=g)v.type=qr,v.desc="quarter",v.count=m/3,v.interval=gr.every(3),v.formatter=i.date.formatter,v.offset=e=>gr.offset(e,-3),v.floor=Jo.floor;else if(m/6<=g)v.type=qr,v.desc="half year",v.count=m/6,v.interval=gr.every(6),v.formatter=i.date.formatter,v.offset=e=>gr.offset(e,-6),v.floor=Jo.floor;else if(h<=y)v.type=Cr,v.desc="year",v.count=h,v.interval=vr.every(1),v.formatter=i.year.formatter,v.offset=e=>vr.offset(e,-1),v.floor=vr.floor;else if(h/2<=y)v.type=Cr,v.desc="every 2 year",v.count=h/2,v.interval=a(2),v.formatter=i.year.formatter,v.offset=e=>vr.offset(e,-2),v.floor=vr.floor;else if(h/5<=y)v.type=Cr,v.desc="every 5 year",v.count=h/5,v.interval=a(5),v.formatter=i.year.formatter,v.offset=e=>vr.offset(e,-5),v.floor=vr.floor;else if(h/10<=y)v.type=Cr,v.desc="every 10 year",v.count=h/10,v.interval=a(10),v.formatter=i.year.formatter,v.offset=e=>vr.offset(e,-10),v.floor=vr.floor;else{const e=Math.max(1,Math.floor(h/y));v.type=Cr,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=i.year.formatter,v.offset=t=>vr.offset(t,-e),v.floor=vr.floor}return v}(s,l,n,t.all(),i,a),o.set(u,c,1));const d=e.ticks(c.interval);d.length?s.getTime()!==d[0].getTime()&&d.unshift(c.offset(d[0])):d.push(c.floor(s));const m=d.map((e,t,n)=>{const i=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:c.formatter}});let h=[];if(!r&&c.type<=Sr){const n=t.getFormat("date"),i=e.ticks(Jo.every(1));i.length&&s.getUTCDate()!==i[0].getUTCDate()&&i.unshift(Jo.offset(i[0],-1)),h=(i.length?i:[Jo.floor(s)]).map((e,t,i)=>{const o=i[t+1]?i[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+o),formatter:n.formatter}})}return{inner:m,outer:h}}const Tr=86400,kr=1440,Nr={};function Dr(e,t,n,i){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:i}}function Lr(e,t,n){const{generator:i,anchor:o,clamp:r,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(r);const[l,u]=e.domain(),c=wo().domain([Io(l),Io(u)]);c.clamp(r),c.range(t.invert?[1,0]:[0,1]);const d="object"==typeof i?i:{type:i};let m;m="d3"===d.type?(e,o)=>wr({timeScale:c,labels:n,distance:e,isDayOrShorter:o,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?c.domain()[0]:Io(i.initialMin)}):e=>function(e,t,n,i,o,r=!1){if(Nr[[t,n,i,i,r]])return Nr[[t,n,i,i,r]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=Io(n),l=s.getFullYear(),u=s.getMonth(),c=s.getDate(),d=i-n,m=t/(o-i),h=m/1440,f=m/Tr,p=366*m,g=3*m*30,y=a.second.width/f,v=a.minute.width/h,b=a.date.width/g,x=a.year.width/p;let S,M,q,C=0,w=0,T=null,k=null,N=null,D=null,L=null,E=null;const O={outer:[],inner:[]};for(y<1?(T=1,w=1/Tr):y<2?(T=2,w=1/Tr*2):y<5?(T=5,w=1/Tr*5):y<10?(T=10,w=1/Tr*10):y<30?(T=30,w=1/Tr*30):v<1?(k=1,w=1/kr):v<2?(k=2,w=1/kr*2):v<5?(k=5,w=1/kr*5):v<10?(k=10,w=.006944444444444445):v<30?(k=30,w=.020833333333333336):v<60?(N=1,w=1/24):v<120?(N=2,w=2/24):v<360?(N=6,w=.25):v<720?(N=12,w=.5):b<1/90?(w=1,D=1):b<2/90?(w=2,D=2):b<7/90?(w=7,D=7):b<31/90?(L=1,w=31):b<1?(L=3,w=90):x<1?(E=1,w=366):x<2?(E=2,w=732):x<5?(E=5,w=1826.25):(E=10,w=3652.5),M=Math.floor((d+n%1)/w);C<o;){q=M+1,S=E?Dr("year",[l+M*E,0,1],[l+q*E,0,1],a.year.formatter):L?Dr("month",[l,u+M*L,1],[l,u+q*L,1],a.date.formatter):D?Dr("day",[l,u,c+M*D],[l,u,c+q*D],a.date.formatter):N?Dr("hour",[l,u,c,0+M*N],[l,u,c,0+q*N],a.minute.formatter):k?Dr("minute",[l,u,c,0,0+M*k],[l,u,c,0,0+q*k],a.minute.formatter):Dr("second",[l,u,c,0,0,0+M*T],[l,u,c,0,0,0+q*T],a.second.formatter),C=Ro(S.start),O.inner.push(S);const e=Math.floor(C);if(!(r||E||L||D)){const t={type:"day",start:Io(e),end:Io(e+1),formatter:a.date.formatter,qStart:e};O.outer[O.outer.length-1]&&O.outer[O.outer.length-1].qStart===t.qStart||O.outer.push(t)}M++}return O.min=i,O.max=o,Nr[[t,n,i,i,r]]=O,O}(n,e,d.min,l,u,"T"===s.qType);const h={transform:(t=[],{isMinor:n=!1}={})=>t.map(t=>{let i;i="start"===o?t.qStart:"end"===o?t.qEnd:(t.qStart+t.qEnd)/2;const r=e.clamp();n&&e.clamp(!1);const a=e(i),s=e(t.qStart),l=e(t.qEnd);return e.clamp(r),{value:i,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1),generate:(t=100,n)=>m(t,n)[a].map(t=>{let n;return n="start"===o?Ro(t.start):"end"===o?Ro(t.end):(Ro(t.start)+Ro(t.end))/2,{position:c(t.start),start:c(t.start),end:c(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:Ro(t.start),end:Ro(t.end),scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1)};return h}const Er=/t+/i;const Or={min:NaN,max:NaN,invert:!1,qAxis:[],field:void 0,formatter:{fn:()=>e=>e,measureText:()=>({width:0,height:0}),localeInfo:{},qNumFormat:{}},ticks:{generator:"d3",level:"outer",anchor:void 0,clamp:!1},cache:{get:()=>!1,set:()=>{},key:()=>""}};function Ar(e,t){e.instance||(e.instance=t.copy(),e.instance.domain(t.domain()),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}const Ir="continuousPan";var Pr={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:i=Te,viewCache:o,viewState:r,definitionPath:a},s={}){const{engineFetcherFactory:l=fe,snapshotFetcherFactory:u=ge,cacheFetcherFactory:c=pe,cache:d={initial:{},merged:{}}}=s,m=l({model:e,layoutService:t,largeDataService:n,definitionPath:a}),h=u({layoutService:t,viewCache:o}),f=c({cache:d}),p=e=>{throw e.isHandled=!0,e};let g,y,v;return{update(e){var n,i;({initialMin:y,initialMax:v}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),o.set("continuousMin",y),o.set("continuousMax",v),o.set("minimiumZoomSpan",(n=y,i=v,Math.max(1e-6,(i-n)*qe))),g=t.meta.isSnapshot?h:m,t.meta.isSnapshot&&({zoom:{min:y,max:v}}=h.getSnapshotData()),r.preventSet("zoom",{min:y,max:v})},updateLayout(e){const{qDataPages:n,qAxisData:i}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",i),t.setHyperCubeValue("qMode","S"),t.setHyperCubeValue("qColumnOrder",[]),e},initialFetch(){return g.fetch(y,v).then(e=>{const t=function(e){return{qDataPages:e.qDataPages.map(e=>{const t=be(e.qArea,e.qMatrix);return{...e,qArea:t}}),qAxisData:e.qAxisData}}(e);return i.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),d.initial=t,d.merged=t,e}).then(e=>xe(y,v,e)).then(e=>this.updateLayout(e)).catch(p)},fetch:(e,t)=>g.fetch(e,t).then(e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map((e,n)=>{const i=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,i=t[t.length-1][0].qNum,o=[],r=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?o.push(e[t]):a.qNum>i&&r.push(e[t])}return[...o,...t,...r]}(e.qMatrix,t.qDataPages[n].qMatrix),o=be(e.qArea,i);return{...e,qArea:o,qMatrix:i}}),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every(e=>!e.qTicks.length))return e;const n=t.qAxis.map(e=>e.qName),i=t.qAxis.map(e=>({start:e.qTicks[0].qStart,end:e.qTicks[e.qTicks.length-1].qStart})),o=t.qAxis.map(e=>({qName:e.qName,qTags:[...e.qTags],qTicks:[...e.qTicks]}));for(let t=0,r=e.qAxis.length;t<r;t++){const r=e.qAxis[t],a=n.indexOf(r.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=i[a];for(let n=0,i=r.qTicks.length;n<i;n++){const i=r.qTicks[n];i.qStart<e?s.push(i):i.qStart>t&&l.push(i)}o[a].qTicks=[...s,...o[a].qTicks,...l]}}return{qAxis:o}}(e.qAxisData,t.qAxisData)),n}(d.initial,e)).then(e=>(i.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),d.merged=e,e)).then(n=>xe(e,t,n)).catch(p),fetchFromCache:(e,t)=>f.fetch(e,t).then(n=>xe(e,t,n)),fetchMinMaxData:()=>Promise.resolve(d.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return ne({},e,{...d.initial})},getInitialLayout(){const e=this.getInitialCube();return ne({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>we(d.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=i.query.getShouldProcess()?[i.query.getFilteredDataPage({dataPage:d.merged.qDataPages[0]})]:d.merged.qDataPages;t.qDataPages=n,t.qAxisData=d.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:i}=e;function r(e,n,o){return i[e](n,o).then(e=>(i.updateLayout(e),t(),e))}const a=o((e,t)=>r("fetch",e,t),50);return({min:e,max:t},{min:i,max:o})=>!n.meta.isContinuous||e===i&&t===o?Promise.resolve(null):r("fetchFromCache",e,t).then(n=>(a(e,t),n))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,i=NaN;return(o,r)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),i=e.get("minimiumZoomSpan"),Math.abs(o.max-o.min)<i?r:{min:Math.min(o.max,Math.max(t,o.min)),max:Math.max(o.min,Math.min(n,o.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:i=50,rtl:o=!1,targetKey:a}){const s=e.get("continuousMin"),l=e.get("continuousMax");return r((e,i)=>{const r=(e=>n.componentsFromPoint(e).filter(e=>e.key===a)[0])(e);if(r){const a=function(e,t,n){let{x:i}=e;return i-=t.element.getBoundingClientRect().left,i-=n.rect.x,Math.max(0,Math.min(1,i/n.rect.width))}(e,n,r),u=o?1-a:a,{min:c,max:d}=t.get("zoom"),m=Math.abs(d-c),h=m-(i>0?Me:Se)*m,f=c+h*u,p=d-h*(1-u),g=f<s?s-f:0,y=p>l?p-l:0;t.set("zoom",{min:Math.max(f-y,s),max:Math.min(p+g,l)})}},i)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:i,viewCache:o}){return{type:"Pan",key:"continuous:pan",options:{event:Ir,pointers:1,threshold:10,enable(i,o){return this.started===Ir||!o||!!n.scroll.enabled()&&t.componentsFromPoint({x:o.center.x,y:o.center.y}).some(t=>t.key===e)}},events:{[`${Ir}start`](n){n.preventDefault(),this.started=Ir;const{min:o,max:r}=i.get("zoom");this[Ir]={min:o,max:r,size:t.component(e).rect.computedInner.width,span:r-o}},[`${Ir}move`](e){e.preventDefault();const{span:t,min:n,max:r,size:a}=this[Ir],s=-e.deltaX/a;i.set("zoom",{min:Math.min(n+s*t,o.get("continuousMax")-t),max:Math.max(r+s*t,o.get("continuousMin")+t)})},[`${Ir}end`](e){e.preventDefault(),this.started=!1},[`${Ir}cancel`](e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:ke,timeAxis:Ae},picassoScales:{time:function e(t,n={}){const i=function(e,t,n){const i={};return Object.keys(t).forEach(o=>{const r=e[o],a=typeof r;"function"===a?i[o]=r(n):"object"!==a||Array.isArray(r)?i[o]="undefined"===a?t[o]:r:i[o]=ne(!0,{},t[o],r)}),i}(t,Or,n),{qAxis:o}=i,r=fn(),s={instance:null,invert:!1},{min:l,max:u}=function(e,t){let n=+e.min,i=+e.max;return Number.isNaN(n)&&Number.isNaN(i)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map(e=>e.qStart)),i=Math.max(...t[t.length-1].qTicks.map(e=>e.qEnd))),n===i&&(n-=.5,i+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+i)?1:i}}(i,o);let c,d,m=[];const h=function(e){return Number.isNaN(+e)?NaN:r(e)};h.ticks=({distance:e,resolve:t=c.resolve}={})=>{const n=t(e),r=n[i.ticks.level];if(Number.isNaN(+r)||(m=d.transform(o[r].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=d.transform(o[n.minor].qTicks,{isMinor:!0});m=m.concat(e)}return"auto"===r&&(m=d.generate(e,n.isDayOrShorter)),m},h.invert=e=>r.invert(e),h.domain=e=>Array.isArray(e)?r.domain(e):r.domain(),h.range=e=>Array.isArray(e)?r.range(e):r.range(),h.norm=e=>(Ar(s,h),s.instance(e)),h.normInvert=e=>(Ar(s,h),s.instance.invert(e)),h.copy=()=>e(t,n),h.clamp=(e=!0)=>(r.clamp(e),r.clamp()),h.min=()=>Math.min(l,u),h.max=()=>Math.max(l,u),r.range(i.invert?[1,0]:[0,1]),r.domain([l,u]),s.invert=i.invert;const f=function(e){const t={},{measureText:n,fn:i,localeInfo:o}=e.formatter,r={second:{type:"second",pattern:"hh:mm:ss",width:60,formatter:void 0},minute:{type:"minute",pattern:"hh:mm",width:60,formatter:void 0},date:{type:"date",pattern:"YYYY-MM-DD",width:60,formatter:void 0},year:{type:"year",pattern:"YYYY",width:60,formatter:void 0}};return o&&Er.test(o.qTimestampFmt)&&(r.minute.pattern+=" tt",r.second.pattern+=" tt"),r.date.pattern=o&&o.qDateFmt?o.qDateFmt:r.date.pattern,Object.keys(r).forEach(e=>{r[e].formatter=i(r[e].pattern),r[e].width=Math.max(r[e].width,n(r[e].formatter(41000.2343433)).width+16)}),t.getFormat=e=>r[e],t.all=()=>r,t.getFormatFromTicks=e=>{const t=e.filter(e=>!e.isMinor),{length:n}=t;if(!n)return r.date;const i=Io(t[0].data.start),o=Io(t[n-1].data.start);return Jo.count(i,o)/n>=1?r.date:Yo.count(i,o)/n>0?r.minute:Ko.count(i,o)/n>0?r.second:r.date},t}(i);return d=Lr(r.copy(),i,f),c=Ao({qAxis:o,measureText:i.formatter.measureText,reqAutoFitWidth:2*f.getFormat("minute").width,cache:i.cache,scale:h}),h.data=()=>({fields:[{formatter:h.formatter,id:()=>`qHyperCube/${i.field}`,key:()=>i.field,raw:a(n,"fields.0.raw",()=>({}))}]}),h.formatter=()=>f.getFormatFromTicks(m).formatter,h}}};const Rr=[["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}]],zr={};Rr.forEach(([e,{width:t,height:n}])=>{zr[e]={width:t,height:n}});const Hr={getLayoutModes:()=>zr,getLayoutMode(e,t){let n;for(n=0;n<Rr.length;++n)if(e>=Rr[n][1].width&&t>=Rr[n][1].height)return Rr[n][0];return"SPARK"}};function Br(e,t){return{layoutModes:Hr.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 Fr=["$date","$timestamp","$time"],jr=["D","TS","T"],Vr={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some(e=>Fr.some(t=>t===e))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&jr.some(t=>t===e.qNumFormat.qType)),isTimeDimension:(e,t)=>!!(e&&t&&(Vr.hasTimeTag(t)&&Vr.hasUnknownFormat(t)||Vr.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&Vr.isTimeDimension(e,t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode)[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some(e=>"$numeric"===e))},canBeContinuous(e){const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode);return!((t?.length??0)<1)&&Vr.canBeContinuousDimension(t[0])},maxNumberOfLines:12},_r=/^[A-Z][A-z0-9_]*$/i,Ur={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,"")}},$r={setValue:(e,t,n)=>{if(!t)return!1;const i=t.split("."),o=i[i.length-1];let r,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){const e=a[o];return a[o]=n,{updated:n,previous:e}}return delete a[o],!1},getValue:(e,t,n)=>{const i=t.split(".");let o,r=e;if(void 0===r)return n;for(o=0;o<i.length;++o){if(void 0===r[i[o]])return n;r=r[i[o]]}return r},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||_r.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>Ur.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},Wr=e=>$r.getValue(e,"qHyperCube.qDimensionInfo",[]),Kr=e=>$r.getValue(e,"qHyperCube.qMeasureInfo",[]),Gr=e=>$r.getValue(e,"barGrouping.grouping"),Yr={continuous({layout:e,properties:t,auto:n}){if(!Vr.canBeContinuous(e))return!1;const i=t||e;return $r.getValue(i,"dimensionAxis.continuousAuto")?"function"==typeof n?n():!!n:!!i?.preferContinuousAxis},dimensionless:e=>!Wr(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===Gr(e)&&(Wr(e).length>1||Kr(e).length>1)&&!this.continuous({layout:e})},groupedByDimension(e){return this.grouped(e)&&Wr(e).length>1&&1===Kr(e).length},groupedByMeasure(e){return this.grouped(e)&&1===Wr(e).length&&Kr(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==Gr(e)&&"butterfly"!==Gr(e)||this.continuous({layout:e}))&&(Wr(e).length>1||Kr(e).length>1)},stackedByDimension(e){return this.stacked(e)&&Wr(e).length>1&&1===Kr(e).length},stackedByMeasure(e){return this.stacked(e)&&1===Wr(e).length&&Kr(e).length>1},simple:e=>0===Wr(e).length||1===Wr(e).length&&1===Kr(e).length,snapshot:e=>!!$r.getValue(e,"snapshotData")};function Xr(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const Jr=e=>{throw e.isHandled=!0,e};const Zr={getDockValue:e=>"near"===e||"left"===e||"top"===e?0:1,getOppositeDock(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top";case"near":default:return"far";case"far":return"near"}},getHorizontalDock:e=>"near"===e||"left"===e?"left":"right",getVerticalDock:e=>"near"===e||"bottom"===e?"bottom":"top",getDock:(e,t,n)=>"vertical"===e||"y"===e?Zr.getVerticalDock(t):n?Zr.getOppositeDock(Zr.getHorizontalDock(t)):Zr.getHorizontalDock(t),getInvertedOrientation:e=>"vertical"===e?"horizontal":"vertical",getMinorScaleAxis:e=>"vertical"===e?"y":"x",getMajorScaleAxis:e=>"vertical"===e?"x":"y",getAlignment:(e,t)=>"vertical"===e?"near"===t||"bottom"===t?1:0:"near"===t||"left"===t?0:1,getMeasureScaleInvert:(e,t)=>"vertical"===e||t,getDimensionScaleInvert:(e,t)=>"horizontal"===e&&t,getSize:(e,{width:t,height:n})=>"vertical"===e?t:n};var Qr=(e,t)=>{if("function"==typeof t.defaultValue)return t.defaultValue();if(void 0!==t.defaultValue)return t.defaultValue;if(Array.isArray(t.options))return t.options[0].value;switch(e){case"array":return[];case"string":return"";case"integer":case"number":return 0;case"boolean":return!1;default:return null}};const ea=166/26,ta=12/11,na={stringWidthOverMWidth:e=>(12*Math.min(e,3)+Math.max(e-3,0)*ea)/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),i=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,i=i?i.length:0;const o=t+n+i;return{latin:e.length-o,cjk:o}},getTotalCharacterRatios(e,t,n="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const i={latin:0,cjk:0};let o;void 0===t?e.forEach(e=>{o=na.getCharacterRatios(e[n]),i.latin+=o.latin,i.cjk+=o.cjk}):e.forEach(e=>{o=na.getCharacterRatios(e[t][n]),i.latin+=o.latin,i.cjk+=o.cjk});const r=Math.max(1,i.latin+i.cjk);return i.latinRatio=i.latin/r,i.cjkRatio=i.cjk/r,i},getAdjustedMaxGlyphCount(e,t,n,i="qText"){const o=na.getTotalCharacterRatios(t,n,i),r=o.latinRatio*e,a=o.cjkRatio*e;return Math.ceil(na.stringWidthOverMWidth(r)+a*ta)}},ia="#la-vie-tooltip";function oa(){if(!document.querySelector(ia)){const e=document.createElement("div");e.id="la-vie-tooltip",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 ra({key:e="tooltip",rtl:t}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){oa()},beforeUpdate(){oa()},destroyed(){!function(){const e=document.querySelector(ia);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(ia),content:({h:e,data:t,style:n})=>t[0].map(t=>e("tr",{},function(e,{h:t,style:n}){return e.map(e=>{const i={style:{...n.cell||{},...e.style||{}},class:e.class};return e.colspan&&(i.colspan=e.colspan),t("td",i,e.content)})}(t,{h:e,style:n}))),direction:t?"rtl":"ltr"},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"}}}}const aa=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),sa=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),la=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),ua={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>aa.test(e),isRtlChar:e=>sa.test(e)||la.test(e),detectTextDirection(e){const t=e?e.length:0;let n,i;for(n=0;n<t;n++){if(i=e[n],ua.isLtrChar(i))return"ltr";if(ua.isRtlChar(i))return"rtl"}return"ltr"}},ca={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 i=t.data,o=e.resources.formatter,r=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&i.fillTooltip){const e=o("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(i.fillTooltip.value):i.fillTooltip.label?i.fillTooltip.label:i.fillTooltip.value,!n.coloring.label){const e=r(i.fillTooltip.source.key).field(i.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===i._fillColor?ca.getNodeFillColor(t):i._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=ua.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=ua.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 i=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:i,style:{"font-weight":"bold","text-align":n?"right":"left",direction:ua.detectTextDirection(i)},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 i=ua.detectTextDirection(t.color.label),o=n?[":",t.color.label]:[t.color.label,":"],r=ua.detectTextDirection(t.color.value);return[{content:o,style:{"text-align":n?"right":"left",direction:i}},{content:n?[t.color.value,ca.getColorSymbol(e,t)]:[ca.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:r,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,i,o=!1){const r=ua.detectTextDirection(e.label),a=i?[":",e.label]:[e.label,":"],s=ua.detectTextDirection(e.value);let l;return l=o?i?[e.value,ca.getColorSymbol(t,n)]:[ca.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":i?"right":"left",direction:r}},{content:l,style:{"text-align":i?"left":"right",direction:s,"vertical-align":"middle"}}]}};function da(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ma(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function ha(){}var fa=.7,pa=1/fa,ga="\\s*([+-]?\\d+)\\s*",ya="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",va="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ba=/^#([0-9a-f]{3,8})$/,xa=new RegExp(`^rgb\\(${ga},${ga},${ga}\\)$`),Sa=new RegExp(`^rgb\\(${va},${va},${va}\\)$`),Ma=new RegExp(`^rgba\\(${ga},${ga},${ga},${ya}\\)$`),qa=new RegExp(`^rgba\\(${va},${va},${va},${ya}\\)$`),Ca=new RegExp(`^hsl\\(${ya},${va},${va}\\)$`),wa=new RegExp(`^hsla\\(${ya},${va},${va},${ya}\\)$`),Ta={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 ka(){return this.rgb().formatHex()}function Na(){return this.rgb().formatRgb()}function Da(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ba.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?La(t):3===n?new Aa(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Ea(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Ea(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=xa.exec(e))?new Aa(t[1],t[2],t[3],1):(t=Sa.exec(e))?new Aa(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ma.exec(e))?Ea(t[1],t[2],t[3],t[4]):(t=qa.exec(e))?Ea(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ca.exec(e))?Ba(t[1],t[2]/100,t[3]/100,1):(t=wa.exec(e))?Ba(t[1],t[2]/100,t[3]/100,t[4]):Ta.hasOwnProperty(e)?La(Ta[e]):"transparent"===e?new Aa(NaN,NaN,NaN,0):null}function La(e){return new Aa(e>>16&255,e>>8&255,255&e,1)}function Ea(e,t,n,i){return i<=0&&(e=t=n=NaN),new Aa(e,t,n,i)}function Oa(e){return e instanceof ha||(e=Da(e)),e?new Aa((e=e.rgb()).r,e.g,e.b,e.opacity):new Aa}function Aa(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Ia(){return`#${Ha(this.r)}${Ha(this.g)}${Ha(this.b)}`}function Pa(){const e=Ra(this.opacity);return`${1===e?"rgb(":"rgba("}${za(this.r)}, ${za(this.g)}, ${za(this.b)}${1===e?")":`, ${e})`}`}function Ra(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function za(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ha(e){return((e=za(e))<16?"0":"")+e.toString(16)}function Ba(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ja(e,t,n,i)}function Fa(e){if(e instanceof ja)return new ja(e.h,e.s,e.l,e.opacity);if(e instanceof ha||(e=Da(e)),!e)return new ja;if(e instanceof ja)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,o=Math.min(t,n,i),r=Math.max(t,n,i),a=NaN,s=r-o,l=(r+o)/2;return s?(a=t===r?(n-i)/s+6*(n<i):n===r?(i-t)/s+2:(t-n)/s+4,s/=l<.5?r+o:2-r-o,a*=60):s=l>0&&l<1?0:a,new ja(a,s,l,e.opacity)}function ja(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Va(e){return(e=(e||0)%360)<0?e+360:e}function _a(e){return Math.max(0,Math.min(1,e||0))}function Ua(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}da(ha,Da,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ka,formatHex:ka,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Fa(this).formatHsl()},formatRgb:Na,toString:Na}),da(Aa,function(e,t,n,i){return 1===arguments.length?Oa(e):new Aa(e,t,n,null==i?1:i)},ma(ha,{brighter(e){return e=null==e?pa:Math.pow(pa,e),new Aa(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?fa:Math.pow(fa,e),new Aa(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Aa(za(this.r),za(this.g),za(this.b),Ra(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:Ia,formatHex:Ia,formatHex8:function(){return`#${Ha(this.r)}${Ha(this.g)}${Ha(this.b)}${Ha(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Pa,toString:Pa})),da(ja,function(e,t,n,i){return 1===arguments.length?Fa(e):new ja(e,t,n,null==i?1:i)},ma(ha,{brighter(e){return e=null==e?pa:Math.pow(pa,e),new ja(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?fa:Math.pow(fa,e),new ja(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,i=n+(n<.5?n:1-n)*t,o=2*n-i;return new Aa(Ua(e>=240?e-240:e+120,o,i),Ua(e,o,i),Ua(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new ja(Va(this.h),_a(this.s),_a(this.l),Ra(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=Ra(this.opacity);return`${1===e?"hsl(":"hsla("}${Va(this.h)}, ${100*_a(this.s)}%, ${100*_a(this.l)}%${1===e?")":`, ${e})`}`}}));const $a=Math.PI/180,Wa=180/Math.PI,Ka=.96422,Ga=.82521,Ya=4/29,Xa=6/29,Ja=3*Xa*Xa,Za=Xa*Xa*Xa;function Qa(e){if(e instanceof es)return new es(e.l,e.a,e.b,e.opacity);if(e instanceof as)return ss(e);e instanceof Aa||(e=Oa(e));var t,n,i=os(e.r),o=os(e.g),r=os(e.b),a=ts((.2225045*i+.7168786*o+.0606169*r)/1);return i===o&&o===r?t=n=a:(t=ts((.4360747*i+.3850649*o+.1430804*r)/Ka),n=ts((.0139322*i+.0971045*o+.7141733*r)/Ga)),new es(116*a-16,500*(t-a),200*(a-n),e.opacity)}function es(e,t,n,i){this.l=+e,this.a=+t,this.b=+n,this.opacity=+i}function ts(e){return e>Za?Math.pow(e,1/3):e/Ja+Ya}function ns(e){return e>Xa?e*e*e:Ja*(e-Ya)}function is(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function os(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function rs(e,t,n,i){return 1===arguments.length?function(e){if(e instanceof as)return new as(e.h,e.c,e.l,e.opacity);if(e instanceof es||(e=Qa(e)),0===e.a&&0===e.b)return new as(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Wa;return new as(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new as(e,t,n,null==i?1:i)}function as(e,t,n,i){this.h=+e,this.c=+t,this.l=+n,this.opacity=+i}function ss(e){if(isNaN(e.h))return new es(e.l,0,0,e.opacity);var t=e.h*$a;return new es(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}da(es,function(e,t,n,i){return 1===arguments.length?Qa(e):new es(e,t,n,null==i?1:i)},ma(ha,{brighter(e){return new es(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new es(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 Aa(is(3.1338561*(t=Ka*ns(t))-1.6168667*(e=1*ns(e))-.4906146*(n=Ga*ns(n))),is(-.9787684*t+1.9161415*e+.033454*n),is(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),da(as,rs,ma(ha,{brighter(e){return new as(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new as(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return ss(this).rgb()}}));var ls={isDark:function(e){return rs(e).l<70}};function us(e){const t=e.qDef;!0===t.autoSort&&t.qSortCriterias.forEach(e=>{e.qSortByNumeric=1,e.qSortByAscii=1})}const cs={horizontal:{major:"width",minor:"height",start:"left",end:"right",shadow:{startOffset:"12px 0",endOffset:"-12px 0"}},vertical:{major:"height",minor:"width",start:"top",end:"bottom",shadow:{startOffset:"0 12px",endOffset:"0 -12px"}}},ds=e=>`${e} 12px -12px inset rgba(0, 0, 0, 0.0625)`;var ms={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:n,rtl:i}=this.settings.settings,[o,r]=t(),a=Math.abs(o)<1e-15,s=Math.abs(r-1)<1e-15,l=(e=>{const t=cs[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:ds(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:ds(t.shadow.endOffset)}}})(n),u="horizontal"===n&&i,c=[];return a||c.push(e("div",{style:{...l.base,...u?l.towardsEnd:l.towardsStart},class:"scroll-hint--towards-start"})),s||c.push(e("div",{style:{...l.base,...u?l.towardsStart:l.towardsEnd},class:"scroll-hint--towards-end"})),c}};function hs({viewState:e,viewCache:t,layoutService:n,dockService:i,rtl:o}){return!n.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:i.meta.major.orientation,rtl:o,range:()=>function({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),i=t.get("continuousMin"),o=t.get("continuousMax");return[(n.min-i)/(o-i),(n.max-i)/(o-i)]}(t,n):function(e){return e.get("viewRange")}(t)}({layoutService:n,viewState:e,viewCache:t})}}}let fs;function ps(){fs=fs||document.createElement("canvas").getContext("2d")}const gs={measureTextWidth(e){ps();const{width:t}=fs.measureText(e);return t},lineWrap(e,t,n,i){let o,r;ps();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,u,c,d,m=e?e.split(/\s+/):[],h=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof i&&a.length>=i)return a.slice(0,i);for(n&&(fs.font=n),r=0;r<a.length;r++){for(d=a[r]||"",m=d.split(/\s+/),[h]=m,c="",o=1;o<m.length;o++)if(l=`${h} ${m[o]}`,u=gs.measureTextWidth(l),u>t&&("number"!=typeof i||i>s.length)?(s.push(h),h=m[o]):h=l,"number"==typeof i&&s.length>=i){c=m.slice(o+1).join(" ");break}"number"!=typeof i||s.length<i?s.push(h):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${h} ${c}`}return s},wordWrap(e,t,n,i,o){if(ps(),!e||!e.length)return[];n&&(fs.font=n);let r=[];const a=e.slice();let s,l,u,c;if(a.filter(e=>!!e),"number"!=typeof t||t<0)return e.slice();for(c=0;c<a.length;c++)u=a[c],l=null,u&&(u.length<=1||gs.measureTextWidth(u)<=t?r.push(u):(s=gs.splitWord(u,t,void 0,i-r.length),s.length<=1?r.push(s[0]):(l=s.pop(),r=r.concat(s),a[c+1]?gs.measureTextWidth(`${l} ${a[c+1]}`)>t&&r.length+a.length-c<=i?a.splice(c+1,0,l):a[c+1]=`${l} ${a[c+1]}`:a.push(l))));return r.forEach((e,t,n)=>{n[t]=e?e.trim():e}),r.length>i?(r=r.splice(0,i),r[r.length-1]=gs.truncate(r[r.length-1],t,n,o).text):(u=r[r.length-1],u&&u.length>1&&gs.measureTextWidth(u)>t&&(r[r.length-1]=gs.truncate(u,t,n,o).text)),r},truncate(e,t,n,i="…"){ps();let o,r,a,s,l=e;const u=gs.measureTextWidth("i"),c=Math.ceil(t/u);if(n&&(fs.font=n),e&&t){if(gs.measureTextWidth(l)>t){for(o=Math.min(c,l.length);o>0;o--)if(r=l.substring(0,o-1),a=r.trim()+i,gs.measureTextWidth(a)<=t){s=l.substring(o-1),l=a;break}o||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,i){let o;ps();let r,a=e,s="",l=[];if(gs.isNumber(n)&&n<=1)return[e];const u=Math.ceil(t/i);for(o=Math.min(e.length,u);o>0&&(a=e.substring(0,o),r=e.substring(o-1,o)," "===r?a=e.substring(0,o-1):a+="-",s=e.substring(o),!(gs.measureTextWidth(a)<=t));o--);return(!o&&!a||gs.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(gs.measureTextWidth(s)>t?(s=gs.explodeWord(s,t,n-1,i),l=l.concat(s)):l.push(s),l.filter(e=>""!==e.trim())):l},splitWord:(e,t,n,i)=>(ps(),e&&t?(n&&(fs.font=n),gs.explodeWord(e,t,i,Math.max(1,gs.measureTextWidth("i")))):[]),wrapText(e,t,n,i,o){let r;return Number.isNaN(t)?[e]:(r=i>1?gs.lineWrap(e,t,n,i):[e],r=gs.wordWrap(r,t,n,i,o),r)},getFontHeight:e=>(ps(),e&&(fs.font=e),1.5*gs.measureTextWidth("m")),tokenize(e,t,n,i,o,r,a=1){ps(),t&&(fs.font=t);const s=gs.getFontHeight(),l=a*s;let u=[],c=0,d=[];if(r<s)return[];const m=r?Math.max(1,Math.floor(r/l)):i||1;return Array.isArray(i)?(i.forEach(e=>{c+=Number.isNaN(e)||e<=0?0:e}),i.forEach(e=>{u.push(Number.isNaN(e)||e<=0?m-c:e)})):u=[Number.isNaN(i)||i<=0?m:Math.min(m,i)],Array.isArray(e)?e.forEach((e,n)=>{d.length<m&&(d=d.concat(gs.wrapText(e,o,t,u[n])))}):d=gs.wrapText(e,o,t,u[0],n),d}},ys={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:i,rendHeight:o,flipXY:r,symbol:a}){let s="x",l="y",u=i,c=o,d=t<.5?90:-90;return r&&(s="y",l="x",u=o,c=i,d=t<.5?180:0),a(ne({},e,{[s]:n*u,[l]:Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}},vs=ne.bind(null,!0),bs={},{isArray:xs}=Array;function Ss(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function Ms(e){return void 0===e}function qs(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Cs(e,t){const n=t.substring(1).split("/").slice(0,-1);let i;return n.forEach((t,o)=>{if(o===n.length)return;i=+t;const r=isNaN(i)?{}:[];e[i||t]=Ms(e[i||t])?r:e[t],e=e[i||t]}),e}function ws(e,t){return t?Object.keys(e).filter(t=>void 0!==e[t]).length:Object.keys(e).length}function Ts(e,t,n){let i=!0;if(Ss(e)&&Ss(t))return ws(e,n)===ws(t,n)&&(Object.keys(e).forEach(o=>{Ts(e[o],t[o],n)||(i=!1)}),i);if(xs(e)&&xs(t)){if(e.length!==t.length)return!1;for(let i=0,o=e.length;i<o;i+=1)if(!Ts(e[i],t[i],n))return!1;return!0}return e===t}bs.compare=Ts,bs.generate=function(e,t,n){n=n||"";let i=[];return Object.keys(t).forEach(o=>{const r=function(e){return e?vs({},{val:e}).val:e}(t[o]),a=e[o],s=`${n}/${o}`;Ts(r,a)||qs(t,o)||(Ms(a)?i.push({op:"add",path:s,value:r}):Ss(r)&&Ss(a)?i=i.concat(bs.generate(a,r,s)):xs(r)&&xs(a)?i=i.concat(function(e,t,n){let i=[];const o=e.slice();let r=-1;function a(e,t,n){if(e[n]&&Ms(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,i=e.length;n<i;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Ts(t,o))return i;if(!Ms(t[0])&&Ms(t[0].qInfo)||0===t.length)return i.push({op:"replace",path:n,value:t}),i;for(let e=o.length-1;e>=0;e-=1)r=a(t,o[e].qInfo&&o[e].qInfo.qId,e),-1===r?(i.push({op:"remove",path:`${n}/${e}`}),o.splice(e,1)):i=i.concat(bs.generate(o[e],t[r],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)r=a(o,t[e].qInfo&&t[e].qInfo.qId),-1===r?(i.push({op:"add",path:`${n}/${e}`,value:t[e]}),o.splice(e,0,t[e])):r!==e&&(i.push({op:"move",path:`${n}/${e}`,from:`${n}/${r}`}),o.splice(e,0,o.splice(r,1)[0]));return i}(a,r,s)):i.push({op:"replace",path:`${n}/${o}`,value:r}))}),Object.keys(e).forEach(o=>{Ms(t[o])&&!qs(e,o)&&i.push({op:"remove",path:`${n}/${o}`})}),i},bs.apply=function(e,t){t.forEach(t=>{let n=Cs(e,t.path),i=t.path.split("/").splice(-1)[0],o=i&&isNaN(+i)?n[i]:n[+i]||n;const r=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,o=e),"add"===t.op||"replace"===t.op)if(xs(n))"-"===i&&(i=n.length),n.splice(+i,"add"===t.op?0:1,t.value);else if(xs(o)&&xs(t.value)){const e=t.value.slice();o.length=0,o.push(...e)}else if(Ss(o)&&Ss(t.value))a=o,Object.keys(a).forEach(e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!qs(a,e)&&delete a[e]}),vs(o,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[i]=t.value}else if("move"===t.op){const o=Cs(e,t.from);xs(n)?n.splice(+i,0,o.splice(+r,1)[0]):(n[i]=o[r],delete o[r])}else"remove"===t.op&&(xs(n)?n.splice(+i,1):delete n[i]);var a})},bs.clone=function(e){return vs({},e)},bs.createPatch=function(e,t,n){const i={op:e.toLowerCase(),path:n};return"move"===i.op?i.from=t:void 0!==t&&(i.value=t),i},bs.updateObject=function(e,t){Object.keys(e).length?bs.apply(e,bs.generate(e,t)):vs(e,t)};const ks=Math.log(10);function Ns(e){return 10**e}const Ds={pow10:Ns,log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/ks,eliminateFloatingError(e){const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e},getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/ks),i=e/Ns(n);return t=i<=1?1:i<=2?2:i<=5?5:10,t*Ns(n)*(e<0?-1:1)},getSmallNiceNumber(e){let t,n;if(0===e)return 0;t=Math.floor(Math.log(Math.abs(e))/ks);const i=e/Ns(t);return i<1?(n=5,t--):n=i<2?1:i<5?2:5,n*Ns(t)*(e<0?-1:1)},getMagnitude(e){if(0===e)return 0;return Ns(Math.floor(Math.log(Math.abs(e))/ks))},getFraction(e){if(0===e)return 0;return e/Ns(Math.floor(Math.log(Math.abs(e))/ks))},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/ks),i=e/Ns(n);return t=Math.ceil(i),7!==t&&9!==t||t++,i>1&&i<=1.5?t=1.5:i>2&&i<=2.5&&(t=2.5),t*Ns(n)*(e<0?-1:1)},getValueWithOffset:(e,t=0)=>e+Math.abs(e)*t,isNumber:e=>"number"==typeof e&&!Number.isNaN(e)};const Ls={findMinPositiveDistance:function(e){if(e.length<2)return 0;e.sort((e,t)=>e-t);let t=1/0;for(let n=1;n<e.length;n++){const i=e[n]-e[n-1];i>0&&i<t&&(t=i)}return t===1/0?0:t}},Es=[[2,4,6],[2,4],[3]],Os=[,[,,[[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 As(e,t,n){const i=e?e.length:0;let o,r=void 0===t?Number.MAX_VALUE:e[0]/t;for(o=1;o<i;o++)r=Math.min(r,e[o]/e[o-1]);void 0!==n&&(r=Math.min(r,n/e[i-1])),e.splice(0,0,r)}function Is(e,t,n){let i;const o=e?e.length:0;for(i=0;i<o;i++)As(e[i],t,n)}!function(){let e,t;for(Is(Es,1,10),e=0;e<Os.length;e++)if(Os[e])for(t=0;t<Os[e].length;t++)Array.isArray(Os[e][t])&&Is(Os[e][t])}();const Ps={isInside(e,t,n,i){if(!i)return!0;const o=e.position-e.radius,r=e.position+e.radius;return o>=t&&r<=n},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const n=e.position<t.position?e:t,i=e.position<t.position?t:e;return i.position-i.radius-(n.position+n.radius)},findSegmentPositionMeetMax(e,t){const n=Math.max(0,e.max-t);return e.center-n},findSegmentPositionMeetMin(e,t){const n=Math.max(0,t-e.min);return e.center+n},findSegmentPositionMeetMinThenMax(e,t,n){const i=Ps.findSegmentPositionMeetMin(e,t);return Ps.findSegmentPositionMeetMax({center:i,max:i+e.radius},n)},findSegmentPositionMeetMaxThenMin(e,t,n){const i=Ps.findSegmentPositionMeetMax(e,n);return Ps.findSegmentPositionMeetMin({center:i,min:i-e.radius},t)},layoutPositionFromMin(e,t,n,i=0){const o=e.length-1;let r,a,s=t;for(let t=0;t<o;t++)r=e[t],a=e[t+1],r.position=Ps.findSegmentPositionMeetMaxThenMin(r,s,(r.center+a.center-i)/2),s=r.position+r.radius+i/2;a.position=Ps.findSegmentPositionMeetMaxThenMin(a,s,n)},adjustPositionFromMax(e,t,n,i=0){const o=e.length-1;let r,a,s;const l=Math.max(0,e[o].position+e[o].radius-n);if(0===l)return;let u,c=0;for(r=o;r>0&&(a=e[r],s=e[r-1],u=Math.max(0,Ps.getGap(s,a)-i),u-=Math.max(0,c+u-l),c+=u,a.move=u,!(c>=l));r--);for(c<l&&(u=Math.max(0,s.position-s.radius-t),u-=Math.max(0,c+u-l),c+=u,s.move=u),c=0,r=0;r<=o;r++)a=e[r],c+=a.move||0,a.move=c,a.position-=c},layout(e,t,n,i=0){const o=e.length-1;if(!(o<0)){if(0===o){const i=e[0];return void(i.position=Ps.findSegmentPositionMeetMaxThenMin(i,t,n))}Ps.layoutPositionFromMin(e,t,n,i),Ps.adjustPositionFromMax(e,t,n,i)}}},Rs=(e,t,n,i=1)=>{const o=e.bandwidth();return n?"start"===t?o:"end"===t?o*(1-i):o*(2-i)/2:"start"===t?0:"end"===t?o*i:o*i/2},zs=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,Hs=e=>e.filter(zs),Bs=(e,t)=>Hs($r.getValue(e,t,[])),Fs=e=>zs(e)&&(!1!==e.showValue||!1!==e.showLabel),js=e=>e.filter(Fs),Vs=(e,t)=>js($r.getValue(e,t,[])),_s=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,Us=(e,t,n)=>{const{dimensionRefLineInfo:i}=t;if(i[e])return i[e][n]},$s=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:i,qHeight:o}=n;return void 0!==i&&void 0!==o&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<i},Ws=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:i,qHeight:o}=n;return void 0!==i&&void 0!==o&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=i+o},Ks=({value:e,qMin:t})=>"NaN"!==t&&e<t,Gs=({value:e,qMax:t})=>"NaN"!==t&&e>t,Ys={isRefLineVisible:zs,getVisibleRefLines:Hs,getRefLines:Bs,getMeasureRefLines:e=>Bs(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:Bs(e,"refLine.dimRefLines"),isRefLineLabelVisible:Fs,getVisibleRefLineLabels:js,getRefLineLabels:Vs,getMeasureRefLineLabels:e=>Vs(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:Vs(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:n,valueInfo:i,align:o,invert:r=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=Rs(s,o,r,a.meta.groupSize??a.meta.measureCount),s([n,0])+l;if(a.meta.isGroupedByDimension){if(!i)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=i;let u;return l=Rs(s,o,r,t),e&&e.length&&(u=(({pxScale:e,value:t,innerValues:n,invert:i,minOrder:o})=>{const r=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:i});for(let i=0;i<n.length;i++){const{id:a,order:s}=n[i],l=e([t,a]);if(void 0!==l)return l-r*(s-o)}})({pxScale:s,value:n,innerValues:e,invert:r,minOrder:a})),(void 0===u?s(n):u)+l}return l=Rs(s,o,r),s(n)+l}return e(n)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:n,layoutService:i})=>{const{isGroupedByDimension:o}=i.meta,r={},a=$r.getValue(e,"qHyperCube"),s="K"===a.qMode,l=n?n.query.getCurrentDataPage():$r.getValue(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);if(void 0===l?.qArea?.qTop)return r;const u=s?"qData.0.qSubNodes":"qMatrix",c=$r.getValue(l,u,[]),d=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),m=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<c.length;e++){const t=c[e],n=e+m,i=t[d];r[i]||(r[i]={id:t.qElemNo,qText:t.qText,minOrder:n,maxOrder:n,dataNode:c[e]})}})():o?(()=>{let e;for(let t=0;t<c.length;t++){const n=c[t][0],i=c[t][1],o=t+m,a=n[d];r[a]?(r[a].minOrder=Math.min(r[a].minOrder,o),r[a].maxOrder=Math.max(r[a].maxOrder,o),r[a].innerValues[r[a].innerValues.length]={id:i.qElemNumber,order:o}):r[a]={id:n.qElemNumber,qText:n.qText,minOrder:o,maxOrder:o,innerValues:[{id:i.qElemNumber,order:o}],dataNode:c[t]},0===t?0===o&&(r[a].isMinOrderOk=!0):a!==e&&(r[a].isMinOrderOk=!0,r[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<c.length;e++){const t=c[e][0],n=e+m,i=t[d];r[i]||(r[i]={id:t.qElemNumber,qText:t.qText,minOrder:n,maxOrder:n,dataNode:c[e]})}})(),r},getInputValue:_s,extractInfoFromInputValue:Us,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const i=_s({refLineLayout:e,layoutService:n});return Us(i,t,"id")},isDiscreteMinOutOfBounds:$s,isDiscreteMaxOutOfBounds:Ws,isContinuousMinOutOfBounds:Ks,isContinuousMaxOutOfBounds:Gs,isOutOfRange:({value:e,qMin:t,qMax:n})=>Ks({value:e,qMin:t})||Gs({value:e,qMax:n}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&Ws({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&$s({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:n})=>"horizontal"===e?t:n},Xs=({label:e,labelStyle:t})=>[e?.fontStyle||t?.fontStyle,e?.fontWeight||t?.fontWeight,e?.fontSize||t?.fontSize,e?.fontFamily||t?.fontFamily].filter(e=>!!e).join(" ");function Js(e){return e.showValue?`… ${e.valueString}`:"…"}function Zs(e,t,n=70){for(let i=0;i<e.length;i++){const o=e[i],r=Xs({label:o,labelStyle:t});o.lines=gs.tokenize(o.title,r,Js(o),3,n),o.maxNumLines=o.lines.length}}function Qs({title:e,font:t,ellipsis:n,maxNumLines:i=5,maxWidth:o=200}){const r=gs.tokenize(e,t,n,i,o),a=r.length;let s="";if(a){[s]=r;for(let e=1;e<a;e++)s=`${s}\n${r[e]}`}return s}function el({oobs:e,font:t,ellipsis:n,maxNumLines:i=5,maxWidth:o=200}){const r=e.map(e=>Qs({title:e.title,font:t,ellipsis:`${n} ${e.valueString}`,maxNumLines:i,maxWidth:o})),a=r.length;let s="";if(a){[s]=r;for(let e=1;e<a;e++)s=`${s}\n\n${r[e]}`}return s}function tl(e,t="value"){e.sort((e,n)=>e[t]-n[t])}const nl=3,il=2;function ol({inputValue:e,inputValueLabel:t,localeInfo:n}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!n)return!0;const i=`+-${n.qDecimalSep||""}${n.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${i}]`,"g"),"").length>0||function(e){if(e.indexOf("e")>-1)return!1;const t=e.indexOf("-");return-1!==t&&(e.lastIndexOf("-")!==t||0!==t)}(t)}const rl=({label:e,dataPages:t,qMin:n,qMax:i})=>{if(void 0!==n&&void 0!==i){const{inputValue:t}=e;if(Ys.isContinuousMaxOutOfBounds({value:t,qMax:i}))return 1;if(Ys.isContinuousMinOutOfBounds({value:t,qMin:n}))return-1}return Ys.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:Ys.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},al={hasEngineFormat:ol,calculateLabelPositions({labels:e,scale:t,size:n,layoutService:i,orientation:o,rtl:r,isContinuous:a,isDimension:s}){const l=Ys.getInvert({orientation:o,rtl:r,isContinuous:a}),u="S"===i.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",c=i.getHyperCubeValue(u),{canBeContinuous:d}=i.meta;let m,h;if(s&&d){const e=i.getLayoutValue("qHyperCube.qDimensionInfo.0");m=e.qMin,h=e.qMax}for(let o=0;o<e.length;o++){const r=e[o],{value:s,align:u,valueInfo:d}=r,f=rl({label:r,dataPages:c,qMin:m,qMax:h});r.scaledValue=1===f?l?-.1:1.1:-1===f?l?1.1:-.1:Ys.getScaledPosition({scale:t,size:n,value:s,valueInfo:d,align:u,invert:l,layoutService:i,isContinuous:a}),r.center=r.scaledValue*n}},getTitle:e=>!1!==e.showValue?!1!==e.showLabel?`${e.text} ${e.valueString}`:e.valueString:!1!==e.showLabel?e.text:"",addLabelTitles({labels:e,formatter:t,isContinuous:n,canBeContinuous:i,localeInfo:o}){let r;if(n)for(let n=0;n<e.length;n++){const i=e[n],{value:a,inputValue:s,inputValueLabel:l}=i;r=ol({inputValue:s,inputValueLabel:l,localeInfo:o})?l:t?t(a):a,i.valueString=`${ua.lrm}(${r})${ua.lrm}`,i.title=al.getTitle(i)}else if(i)for(let t=0;t<e.length;t++){const n=e[t],{valueText:i,inputValue:a,inputValueLabel:s}=n;r=ol({inputValue:a,inputValueLabel:s,localeInfo:o})?s:i,n.valueString=`${ua.lrm}(${r})${ua.lrm}`,n.title=al.getTitle(n)}else for(let t=0;t<e.length;t++){const n=e[t];r=n.valueText,n.valueString=`${ua.lrm}(${r})${ua.lrm}`,n.title=al.getTitle(n)}},measureLabelsWidth(e,t){for(let n=0;n<e.length;n++){const i=e[n];i.totalWidth=t(i.title,i).width}},measureLabelMaxLineWidth:(e,t)=>Math.max(...e.lines.map(n=>t(n,e).width)),getMaxTextWidth(e){const t=e.map(e=>e.totalWidth);return Math.max(...t)},addLabelsNeighborInfo(e,t,n,i=0){const o=e.length-1;if(o<0)return;let r,a;if([r]=e,r.cMin=t,0!==o){for(let t=0;t<o;t++)r=e[t],a=e[t+1],r.cMax=(r.center+a.center-i)/2,a.cMin=r.cMax+i;a.cMax=n}else r.cMax=n},getTotalNumLines(e){let t=0;return e.forEach(e=>{t+=e.maxNumLines}),t},reduceLabelsHavingMaxNumLines(e,t,n){const i=t-1,o=e.filter(e=>e.maxNumLines===t),r=Math.min(n,o.length);for(let e=o.length-1;e>=o.length-r;e--)o[e].maxNumLines=i},reduceTotalMaxNumLines(e,t,n){const i=Math.floor(n/t);let o=3;do{const t=al.getTotalNumLines(e)-i;if(t<=0)return;al.reduceLabelsHavingMaxNumLines(e,o,t),o--}while(o>1)},reduceMaxNumLines(e,t,n=0){for(let i=0;i<e.length;i++){const o=e[i];o.maxNumLines=Math.max(1,Math.min(o.maxNumLines,Math.floor((Math.max(0,o.cMax-o.cMin)+n)/t)))}},addLabelsSize(e,t,n=15,i){for(let o=0;o<e.length;o++){const r=e[o];r.width=Math.min(t,al.measureLabelMaxLineWidth(r,i)),r.height=r.lines.length*n}},addLabelSegments(e,t){for(let n=0;n<e.length;n++){const i=e[n],{center:o}=i,r=i[t],a=r/2;i.segment={center:o,range:r,min:o-a,max:o+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:n,lowerLimit:i,upperLimit:o,gap:r,labelStyle:a,maxLabelWidth:s,lineHeight:l,majorDimension:u,orientation:c,measureText:d,rtl:m,layoutService:h,isContinuous:f,isDimension:p}){const g=e.map(e=>e),y=n;al.calculateLabelPositions({labels:e,scale:t,size:y,layoutService:h,orientation:c,rtl:m,isContinuous:f,isDimension:p}),tl(e,"center"),al.addLabelsNeighborInfo(e,i,o,r),Zs(e,a,s),al.reduceTotalMaxNumLines(g,l,o-(g.length-1)*r),"vertical"===c&&(al.reduceMaxNumLines(e,l,.05*r),function(e,t,n=70){for(let i=0;i<e.length;i++){const o=e[i],r=Xs({label:o,labelStyle:t});o.lines.length>o.maxNumLines&&(o.lines=gs.tokenize(o.title,r,Js(o),o.maxNumLines,n))}}(e,a,s)),al.addLabelsSize(e,s,l,d),al.addLabelSegments(e,u)},createLabels({labels:e,style:t,maxLabelWidth:n,areaProps:i,area:o,lineHeight:r=15,font:a}){const{majorAxis:s,minorAxis:l,dock:u}=i,{minorCenter:c}=o,{fontSize:d,fontFamily:m,fontStyle:h,fontWeight:f,textDecoration:p,background:g}=t;let y=[];return e.forEach(e=>{const{lines:t}=e,i=t.length,o=t.map((t,o)=>{const g={type:"text",text:t,title:Qs({title:e.title,font:a,ellipsis:Js(e)}),dx:0,dy:0,maxWidth:n,width:n,fontSize:e.fontSize||d,fontFamily:e.fontFamily||m,fontStyle:e.fontStyle||h,fontWeight:e.fontWeight||f,textDecoration:e.textDecoration||p,fill:e.fill,baseline:"central",anchor:"middle",value:e.value,dock:u};return g[l]=c,g[s]=e.segment.position,g.y+=(o-(i-1)/2)*r,g});e.background&&y.push(function({minorCenter:e,majorAxis:t,minorAxis:n,dock:i,label:o,lineHeight:r,background:a}){const{lines:s}=o,{borderRadius:l=nl,padding:u={}}=a,{top:c=il,bottom:d=il,left:m=il,right:h=il}=u,f=s.length,p={type:"rect",rx:l,ry:l,fill:o.background.fill,width:o.width+(m+h),height:o.height+(c+d),value:o.value,dock:i};return p[n]=e,p[t]=o.segment.position,p.x-=o.width/2+m,p.y-=f*r/2+c,p}({minorCenter:c,majorAxis:s,minorAxis:l,dock:u,label:e,lineHeight:r,background:g})),y=y.concat(o)}),y}};function sl(e,t,n){let i;const o=typeof t;if("string"===o||"object"===o)i=e.formatter(t);else if(void 0!==n&&n.data){const e=n.data()&&n.data().fields;i=e&&e[0]?e[0].formatter():null}return i}function ll(e,t,n){return"top"===e||"bottom"===e?function(e,t){const{lineHeight:n,top:i,bottom:o,maxLabelWidth:r}=t;let a=1;return al.getMaxTextWidth(e)>r&&(Zs(e,t,r),a=Math.max(...e.map(e=>e.lines.length))),a*n+i+o}(t,n):function(e,t){const{left:n,right:i,maxLabelWidth:o}=t;return Math.min(o,al.getMaxTextWidth(e))+n+i}(t,n)}function ul(e,t){return t?e.domain():[0,1]}function cl(e,t,n,i="value"){let o=e.filter(e=>e[i]>=t);o=o.filter(e=>e[i]<=n);const r=e.filter(e=>e[i]<t),a=e.filter(e=>e[i]>n);return{filteredLabels:o,minOobs:r,maxOobs:a,numMinOobs:r.length,numMaxOobs:a.length}}function dl(e){let t,n=0;for(let i=1;i<10;i++)t=e(i),n=Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[n,Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height))]}function ml(e,t){return e>9?t[1]:t[0]}function hl({alignment:e,dockValue:t,oobs:n,style:i,rect:o,symbol:r,position:a,areaProps:s,radius:l,font:u}){const c=n?n.length:0;if(c<1)return[];const{flipXY:d,majorAxis:m,minorAxis:h,minorDimension:f,dock:p}=s,g=o[f],y=ys.createOob({oob:ys.getDefaultSettings({size:i.size,fill:i.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:o.width,rendHeight:o.height,flipXY:d,symbol:r});y.dock=p;const v=`c${m}`,b=`c${h}`,x={type:"circle",r:l,stroke:"transparent",fill:i.text.background.fill,strokeWidth:0,dock:p};x[b]=g/2,x[v]=a;const S={type:"text",text:c>9?"9+":c,title:el({oobs:n,font:u,ellipsis:"…"}),dx:0,dy:0,maxWidth:g,width:g,fontSize:i.text.fontSize,fontFamily:i.text.fontFamily,fill:i.text.fill,baseline:"central",anchor:"middle",dock:p};return S[h]=g/2,S[m]=a,[y,x,S]}const fl=e=>{const t=Xs({labelStyle:e}),n=gs.getFontHeight(t)*(e.lineHeightMultiplicator||1),i=e.gap||12,o=e.maxWidth||75,r=e.padding.top||0,a=e.padding.bottom||0,s=e.padding.left||0,l=e.padding.right||0;return{...e,font:t,lineHeight:n,gap:i,maxLabelWidth:o,top:r,bottom:a,left:s,right:l}},pl=e=>e.map(e=>({...e,value:"function"==typeof e.value?e.value():e.value,valueText:"function"==typeof e.valueText?e.valueText():e.valueText,valueInfo:"function"==typeof e.valueInfo?e.valueInfo():e.valueInfo}));var gl={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:n,isContinuous:i,localeInfo:o}=this.settings,r=!!i||n.meta.canBeContinuous,a=pl(this.settings.labels),s=sl(this.chart,this.settings.formatter,e);al.addLabelTitles({labels:a,formatter:s,isContinuous:i,canBeContinuous:r,localeInfo:o});const{numMaxOobs:l,numMinOobs:u,filteredLabels:c}=(({labels:e,scale:t,isContinuous:n,canBeContinuous:i,layoutService:o})=>{if(n){const[i,o]=ul(t,n);return cl(e,i,o)}if(i){const t=o.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:i}=t;if("NaN"!==n&&"NaN"!==i)return cl(e,n,i,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:i,canBeContinuous:r,layoutService:n});let d;if(this.measureText=(e,n)=>{const{fontSize:i,fontFamily:o,fontWeight:r}=n||{};return this.renderer.measureText({text:e,fontWeight:r||t.label.fontWeight,fontSize:i||t.label.fontSize,fontFamily:o||t.label.fontFamily})},c&&c.length){const e=fl(t.label),{dock:n}=this.settings.layout;return al.measureLabelsWidth(c,this.measureText),d=ll(n,c,e),d}const m=dl(this.measureText),h=l?ml(l,m):0,f=u?ml(u,m):0;return d=Math.max(h,f),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:n,layoutService:i,theme:o,isContinuous:r,isDimension:a,localeInfo:s}=this.settings,l=!!r||i.meta.canBeContinuous,u=pl(this.settings.labels),{dock:c,rtl:d}=this.settings.layout,{padding:m}=n.label,h=function(e){return"left"===e||"right"===e?(e=>({dock:e,orientation:"vertical",majorAxis:"y",minorAxis:"x",majorDimension:"height",minorDimension:"width",flipXY:!1}))(e):(e=>({dock:e,orientation:"horizontal",majorAxis:"x",minorAxis:"y",majorDimension:"width",minorDimension:"height",flipXY:!0}))(e)}(c),f=function(e,t,n){const i=e[t.minorDimension];return{minorSize:i,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(i-n.right-n.left)/2+n.left:(i-n.top-n.bottom)/2+n.top}}(this.rect,h,m),{orientation:p,majorDimension:g}=h,{majorSize:y}=f,v=fl(n.label),{font:b,lineHeight:x,gap:S,maxLabelWidth:M}=v,q=sl(this.chart,this.settings.formatter,e),C=y;al.addLabelTitles({labels:u,formatter:q,isContinuous:r,canBeContinuous:l,localeInfo:s}),al.calculateLabelPositions({labels:u,scale:e,size:C,layoutService:i,orientation:p,rtl:d,isContinuous:r,isDimension:a});const[w,T]=ul(e,r),{filteredLabels:k,lowerOobs:N,upperOobs:D,lowerCircleSize:L,upperCircleSize:E,lowerOobSpace:O,upperOobSpace:A}=function({labels:e,minValue:t,maxValue:n,orientation:i,rtl:o,isContinuous:r,style:a,padding:s,measureText:l,prop:u="value"}){const{maxOobs:c,minOobs:d,filteredLabels:m}=cl(e,t,n,u),h="scaledValue"!==u&&Ys.getInvert({orientation:i,rtl:o,isContinuous:r}),f=function(e,t,n){return n?t:e}(d,c,h),p=function(e,t,n){return n?e:t}(d,c,h),g=f.length,y=p.length,v=dl(l),b=ml(g,v),x=ml(y,v),S=function(e,t,n,i,o){return("vertical"===i?o.top:o.left)+(e>0?t+n:0)}(g,a.oob.size,b,i,s),M=function(e,t,n,i,o){return("vertical"===i?o.bottom:o.right)+(e>0?t+n:0)}(y,a.oob.size,x,i,s);return{filteredLabels:m,lowerOobs:f,upperOobs:p,lowerCircleSize:b,upperCircleSize:x,lowerOobSpace:S,upperOobSpace:M}}({labels:u,minValue:w,maxValue:T,orientation:p,rtl:d,isContinuous:r,style:n,padding:m,measureText:this.measureText,prop:r?"value":"scaledValue"}),I=O,P=y-A;tl(N),tl(D);const R=hl({alignment:0,dockValue:0,oobs:N,style:n.oob,rect:this.rect,symbol:t,position:n.oob.size+L/2,areaProps:h,radius:L/2,font:b}),z=hl({alignment:1,dockValue:1,oobs:D,style:n.oob,rect:this.rect,symbol:t,position:y-(n.oob.size+E/2),areaProps:h,radius:E/2,font:b});al.addLabelsInfo({labels:k,scale:e,majorSize:y,lowerLimit:I,upperLimit:P,labelStyle:v,lineHeight:x,gap:S,maxLabelWidth:M,majorDimension:g,orientation:p,measureText:this.measureText,rtl:d,layoutService:i,isContinuous:r,isDimension:a}),Ps.layout(k.map(e=>e.segment),I,P,n.label.gap);const H=k.filter(e=>Ps.isInside(e.segment,I,P,r));return al.createLabels({labels:H,style:n.label,maxLabelWidth:M,areaProps:h,area:f,lineHeight:x,font:b,theme:o}).concat([...R,...z])}};var yl={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 vl(e){const{qHyperCube:t,...n}=e,{qAxisData:i,qDataPages:o,qStackedDataPages:r,qTreeDataPages:l,...u}=t,c=ne(!0,{},{...n,qHyperCube:{...u}}),{dataRelatedPropertiesPaths:d}=yl;function m(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==a(e,t)&&s(e,t,void 0));const i=t.substring(0,n),o=t.substring(n+2),r=o.startsWith(".")?o.substring(1):o;a(e,i,[]).forEach(e=>{r&&m(e,r)})}return d.forEach(e=>{m(c,e)}),c}var bl={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:i}){return o=>{if(e||t||n){if("line"===o.type)return o.tickValue??"axis";if("text"===o.type)return`${o.tickValue} ${o.text}`;if("container"===o.type){const e=o.children.filter(e=>"text"===e.type).map(e=>e.text);return`${o.data.value} ${e.join("")}`}return Math.random()}if(i){if("line"===o.type&&void 0===o.tickValue)return"axis";const e=o.transform&&o.transform.match(/rotate/gi)?"rotated":"horizontal";return`${o.data.group?`${o.data.group.value} `:""}${o.data.value} ${o.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:i,dock:o}){return({currentNodes:r,currentRect:a,previousRect:s})=>{const l=a.x-s.x,u=a.y-s.y,c=a.width-s.width,d=a.height-s.height;e?("left"===o&&r.forEach(e=>{"line"===e.type?(e.x1+=c,e.x2+=c):"text"===e.type&&(e.x+=c)}),"left"!==o&&"right"!==o||r.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"!==o&&"bottom"!==o||r.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?r.forEach(e=>{"line"===e.type?e.y1===e.y2?e.x2+=c:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)}):n||i?r.forEach(e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+c)}):r.forEach(e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=u,e.y2+=u+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 i=t.x-n.x,o=t.y-n.y;0===i&&0===o||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=i,e.y-=o):e.transform=`translate(${-i}, ${-o})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const i=t.x-n.x;0===t.y-n.y&&0===i||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 i=t.x-n.x,o=t.y-n.y;0===i&&0===o||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=o,e.y-=i):(e.x-=i,e.y-=o)})},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 i=t.x-n.x,o=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-=o,e.y2-=o):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=i,e.x2-=i);else{const t="x"===e.major.p?i/e.major.size:o/e.major.size,n="y"===e.minor.p?o/e.minor.size:i/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 i=t.x-n.x;0===t.y-n.y&&0===i||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 i=t.x-n.x,o=t.y-n.y;0===i&&0===o||e.forEach(e=>{switch(e.type){case"circle":e.cx-=i,e.cy-=o;break;case"rect":e.x-=i,e.y-=o;break;case"path":e.transform=`translate(${-i}, ${-o})`}})}},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 i=t.x-n.x,o=t.y-n.y;0===i&&0===o||e.forEach(e=>{"image"===e.type?(e.x-=i,e.y-=o):(e.cx-=i,e.cy-=o)})}},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 i=t.x-n.x,o=t.y-n.y,r=t.width-n.width,a=t.height-n.height;let s=-i,l=-o;e.forEach(e=>{switch(e.dock){case"right":i>0&&(s=t.width);break;case"left":r<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":o>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=vl(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=vl(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};const{getInputValue:xl,extractInfoFromInputValue:Sl,resolveValue:Ml}=Ys;var ql={resolveValue:Ml,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.isGroupedByDimension){const i=xl({refLineLayout:e,layoutService:n});return Sl(i,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.mode.K)return 0;const i=xl({refLineLayout:e,layoutService:n});return Sl(i,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const{dimensionValuesInfo:i}=t,{canBeContinuous:o}=n.meta,r=xl({refLineLayout:e,layoutService:n});return i[r]&&o?i[r].qText:r},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const i=xl({refLineLayout:e,layoutService:n}),{dimensionRefLineInfo:o}=t;return o[i]}};function Cl({isDimension:e,refLineModel:t={},layoutService:n,colorModel:i,dockService:o,animationsEnabled:r,chart:a,scale:s,axis:l,rtl:u,key:c,mainComponentKey:d,path:m,minimumLayoutMode:h}){const f=e?t.dimensionRefLines:m?t.query.getRefLines(m):t.measureRefLines;if(!f.length)return!1;const p={key:c,type:"ref-line",layout:{minimumLayoutMode:h},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),animations:{enabled:r,trackBy:bl.lines.trackBy,compensateForLayoutChanges:bl.lines.compensateForLayoutChanges}},g=!(!e||"horizontal"!==o.meta.major.orientation||!u),y=!e||n.meta.isContinuous;return f.forEach(r=>{p.lines[l].push((({isDimension:e,refLineLayout:t,refLineModel:n,layoutService:i,colorModel:o,dockService:r,chart:a,scale:s,axis:l,invert:u,component:c,isContinuous:d})=>{const m={dir:l,line:{strokeWidth:t?.style?.lineThickness||2,strokeDasharray:t?.style?.lineType,stroke:o.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||i.meta.isContinuous?(m.scale=s,m.value=t.refLineExpr.value):(m.valueInfo=ql.resolveValueInfo({refLineLayout:t,refLineModel:n,layoutService:i}),m.value=()=>{const e=Ys.getScaledPosition({scale:a.scale(s),value:ql.resolveValue({refLineLayout:t,refLineModel:n,layoutService:i}),valueInfo:m.valueInfo,size:a.component(c)?.rect["horizontal"===r.meta.major.orientation?"width":"height"],align:t.align,invert:u,layoutService:i,isContinuous:d});return Number.isNaN(e)?void 0:e}),m})({isDimension:e,refLineLayout:r,refLineModel:t,layoutService:n,colorModel:i,dockService:o,chart:a,scale:s,axis:l,invert:g,component:d,isContinuous:y}))}),p}function wl({isDimension:e,refLineModel:t={},layoutService:n,colorModel:i,animationsEnabled:o,dock:r,scale:a,style:s,formatter:l,theme:u,localeInfo:c,rtl:d,key:m,path:h}){const f=e?t.dimensionRefLineLabels:h?t.query.getRefLineLabels(h):t.measureRefLineLabels;if(!f.length)return[];const p=[],g=!e||n.meta.isContinuous,y=f.map(e=>(({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:i,scale:o,theme:r,isContinuous:a})=>{const s=i.resolveUIColor(e.paletteColor||{index:e.color}),{align:l,style:u}=e,{fontSize:c,fontFamily:d,fontStyle:m,fontWeight:h,textDecoration:f}=u||{},p={align:l,text:e.label,fill:e.coloredBackground?r.getContrastingColorTo(s):s,fontSize:c,fontFamily:d,fontStyle:m,fontWeight:h,textDecoration:f,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(p.background={fill:s}),a?(p.scale=o,p.value=e.refLineExpr.value):(p.value=()=>ql.resolveValue({refLineLayout:e,refLineModel:t,layoutService:n}),p.valueText=()=>ql.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:n}),p.valueInfo=()=>ql.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:n})),p})({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:i,scale:a,theme:u,isContinuous:g}));return p.push((({isDimension:e,layoutService:t,animationsEnabled:n,style:i,labels:o,scale:r,formatter:a,dock:s,key:l,rtl:u,theme:c,isContinuous:d,localeInfo:m})=>({key:l,type:"reference-line-labels",renderer:"svg",labels:o,formatter:a,scale:r,layoutService:t,layout:{dock:s,rtl:u},theme:c,isContinuous:d,isDimension:e,localeInfo:m,style:{label:{fontFamily:i.referenceLine.label.name.fontFamily,fontSize:i.referenceLine.label.name.fontSize,fontStyle:i.referenceLine.label.name.fontStyle,fontWeight:i.referenceLine.label.name.fontWeight,textDecoration:i.referenceLine.label.name.textDecoration,padding:{top:2,bottom:2,left:u?2:4,right:u?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===s||"right"===s?10:16},oob:{size:8,fill:i.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:i.referenceLine.outOfBounds.fontFamily,fontSize:i.referenceLine.outOfBounds.fontSize,fill:i.referenceLine.outOfBounds.color,background:{fill:i.referenceLine.outOfBounds.backgroundColor}}}},animations:{enabled:n,trackBy:bl.refLineLabels.trackBy,compensateForLayoutChanges:bl.refLineLabels.compensateForLayoutChanges}}))({isDimension:e,rtl:d,style:s,dock:r,key:m,labels:y,scale:a,formatter:l,layoutService:n,animationsEnabled:o,theme:u,isContinuous:g,localeInfo:c})),p}const Tl=(e,t,n)=>{if(!e)return Promise.resolve();let i=bs.generate(t,n);return ne(!0,t,n),i&&i.length?(i=i.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),e.applyPatches(i,!0)):Promise.resolve()},kl=e=>!(!e||e.qHasSoftPatches||e.qExtendsId||!((e.qMeta?.privileges||[]).indexOf("update")>-1));function Nl(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}const Dl={ref:null,refFn:e=>{const t=e.qHyperCubeDef.qMeasures?.findIndex(e=>"colorByExpression"===e.qAttributeExpressions?.[0]?.id);return`qHyperCubeDef.qMeasures.${-1===t?0:t}.qAttributeExpressions.0.qExpression`},change(e){const t=e.qHyperCubeDef?.qMeasures?.findIndex(e=>"colorByExpression"===e.qAttributeExpressions?.[0]?.id),n=$r.getValue(e,`qHyperCubeDef.qMeasures.${-1===t?0:t}.qAttributeExpressions.0`),i=$r.getValue(e,"color");n&&(n.id="colorByExpression",i&&(i.colorExpression=n.qExpression))}};function Ll({color:e,colorModel:t}){if(!e)return;const n=t.resolveUIColor(e);if("none"===n)return"transparent";const i=l(n);return i.setAlpha(e?.alpha>=0?e.alpha:1),i.isInvalid()?void 0:i.getRGBA()}function El({point:e,dimensionValueInfo:t,layoutService:n}){const{dimensionValue:i}=e,o=""===e.measureValue?void 0:+e.measureValue;if(Ds.isNumber(o))return o;const{dimensionCount:r,measureCount:a}=n.meta;if(2===r)return 0;const s=e.measureIndex?+e.measureIndex:0;return Ds.isNumber(s)&&!(s>=a||0===r)&&1===r?t[i]?.dataNode[s+1]?.qNum:void 0}const Ol={index:-1,color:"#595959"};function Al({chart:e,chartModel:t,discreteModel:n,colorService:i,themeService:o,layoutService:r,dockService:a,rtl:s,majorScale:u,minorScale:c,mainComponentKey:d,data:m,key:h}){if(!Array.isArray(m)||0===m.length)return!1;const f={resolveUIColor:i.getMain().getPaletteColor},p=o.getTheme(),g="horizontal"===a.meta.major.orientation,y=!(!g||!s),{canBeContinuous:v,isContinuous:b,isButterfly:x}=r.meta,S=r.getLayout(),M=function({layout:e,colorModel:t}){const n=e?.components?.find(e=>"general"===e.key);if(n?.bgColor?.useColorExpression){const e=l(n?.bgColor?.colorExpression);return e.isInvalid()?void 0:e.getRGBA()}const i=n?.bgColor?.color;return Ll({color:i,colorModel:t})}({layout:S,colorModel:f})??p.getStyle("object","","backgroundColor"),q=Ys.getDimensionValuesInfo({layout:S,canBeContinuous:v,discreteModel:n,layoutService:r}),C=b?m:m.filter(e=>!!q[e.dimensionValue]),w={};C.map(e=>e.dimensionValue).forEach(e=>{q[e]&&(w[e]?(w[e].innerValues=q[e].innerValues,w[e].minOrder=Math.min(w[e].minOrder,q[e].minOrder),w[e].maxOrder=Math.max(w[e].maxOrder,q[e].maxOrder),w[e].isMinOrderOk=w[e].isMinOrderOk||q[e].isMinOrderOk,w[e].isMaxOrderOk=w[e].isMaxOrderOk||q[e].isMaxOrderOk):w[e]={id:q[e].id,dataNode:q[e].dataNode,qText:q[e].qText,innerValues:q[e].innerValues,minOrder:q[e].minOrder,maxOrder:q[e].maxOrder,isMinOrderOk:q[e].isMinOrderOk,isMaxOrderOk:q[e].isMaxOrderOk},w[e].numInnerValues=(w[e].maxOrder||0)-(w[e].minOrder||0)+1)}),C.forEach(e=>{const t=El({point:e,dimensionValueInfo:w,layoutService:r});if(e.validMeasureValue=x&&1===e.measureIndex?-t:t,r?.meta?.isStacked){const t=w[e.dimensionValue]?.dataNode;if(Array.isArray(t)&&void 0!==e.measureIndex){const n=t.slice(0,e.measureIndex+2),i=t[e.measureIndex+1]?.qNum;if("number"==typeof i&&0!==i){const t=Math.sign(i);e.validMeasureValue=n.reduce((e,n)=>{const i=n.qNum;return"number"==typeof i&&Math.sign(i)===t?e+i:e},0)}}}const n=Ll({colorModel:f,color:e.style?.label?.color||Ol}),i=!!e.style?.label?.coloredBackground;e.labelBackgroundColor=i?n:void 0,e.labelColor=i?o.getTheme().getContrastingColorTo(n):n,e.hasBackground=i,e.maxLabelWidth=100});const T={scale:u,fn:({datum:t})=>{const n=e.scale(u),i=t.value.dimensionValue;if(b)return n("string"==typeof i?""===i?void 0:+i:i);if(void 0===w[i])return;return Ys.getScaledPosition({scale:n,value:w[i].id,valueInfo:w[i],size:e.component(d)?.rect[g?"width":"height"],align:"center",invert:y,layoutService:r,isContinuous:b})}},k={scale:c,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:h,type:"point",data:C,settings:{x:g?T:k,y:g?k:T,strokeWidth:({datum:e})=>e.value.style?.outlineWidth??e.value.style?.lineThickness??2,stroke:({datum:e})=>Ll({colorModel:f,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),fill:({datum:e})=>e.value.style?.fill?.color?Ll({colorModel:f,color:e.value.style?.fill}):M,size:({datum:e})=>`${e.value.style?.dataPointSize??12}px`,shape:({datum:e})=>e.value.style?.symbol||"circle"},animations:{enabled:t.query.animationsEnabled,trackBy:e=>e.data.value.cId,compensateForLayoutChanges:bl.points.compensateForLayoutChanges}}}const Il=e=>e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0,Pl=!0,Rl=!1,zl={index:0,color:"none"},Hl={index:-1,color:"#595959"},Bl={index:-1,color:"#595959"},Fl=e=>{!e.dimensionValue?.qValueExpression&&e.dimensionValue?.qStringExpression&&(e.dimensionValue.qValueExpression=e.dimensionValue.qStringExpression,delete e.dimensionValue.qStringExpression)},jl=e=>{e.dimensionValue?.qValueExpression&&!e.dimensionValue?.qStringExpression&&(e.dimensionValue.qStringExpression=e.dimensionValue.qValueExpression,delete e.dimensionValue.qValueExpression)},Vl=e=>{switch(e.type){case"image":break;case"point":delete e.points,delete e.style?.lineType,delete e.showPoints,delete e.style?.lineCurve;break;case"line":delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.dataPointSize,delete e.style?.fill,delete e.style?.symbol,delete e.style?.label;break;default:delete e.points,delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.lineType,delete e.style?.lineThickness,delete e.style?.lineColor,delete e.style?.dataPointSize,delete e.style?.fill}},_l=({translator:e})=>({label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},dimensionNumberValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>Vr.canBeContinuous(n.layout)},dimensionStringValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",component:"string",expression:"optional",defaultValue:"",show:(e,t,n)=>!Vr.canBeContinuous(n.layout)},measureInputType:{type:"number",component:"dropdown",translation:"properties.plugins.measureInputType",show:(e,t,n)=>1===Il(n.layout),convertFunctions:{get:(e,t,n,i)=>void 0===i.measureValue?1:0,set(e,t,n,i,o){0===e?(o.measureValue=0,delete o.measureIndex):(o.measureIndex=0,delete o.measureValue)}},options:[{value:0,translation:e.get("properties.plugins.measureInputType.measureValue")},{value:1,translation:e.get("properties.plugins.measureInputType.measureIndex")}]},measureValue:{ref:"measureValue",translation:"properties.plugins.measureInputType.measureValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,schemaIgnore:!0,show:(e,t,n)=>void 0!==e.measureValue||2===Il(n.layout)},measureIndex:{ref:"measureIndex",translation:"properties.plugins.measureInputType.measureIndex",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>void 0===e.measureValue&&1===Il(n.layout),invalid:(e,t,n)=>{return e.measureIndex<0||e.measureIndex>=(i=n.layout,i?.qHyperCube?.qMeasureInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0);var i}}}),Ul=e=>({symbol:{type:"string",component:"dropdown",ref:"style.symbol",translation:"Object.GridChart.Symbol",options:[{value:"circle",translation:"Object.GridChart.Symbol.Circle"},{value:"cross",translation:"Object.GridChart.Symbol.Cross"},{value:"diamond",translation:"Object.GridChart.Symbol.Diamond"},{value:"saltire",translation:"Object.GridChart.Symbol.Saltire"},{value:"square",translation:"Object.GridChart.Symbol.Square"},{value:"star",translation:"Object.GridChart.Symbol.Star"},{value:"triangle",translation:"Object.GridChart.Symbol.Triangle"}]},labelPlacement:{type:"string",component:"dropdown",ref:"label.placement",translation:"geo.properties.labelPosition",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"top",translation:"geo.properties.labelPosition.above"},{value:"bottom",translation:"geo.properties.labelPosition.below"}]},fillColor:{ref:"style.fill",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:zl},lineColor:{ref:"style.lineColor",translation:"LayerStyleEditor.style.strokeColor",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:Hl},labelColor:{ref:"style.label.color",translation:"properties.plugins.label.color",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:Bl},colorBackground:{ref:"style.label.coloredBackground",translation:"properties.referenceLines.coloredBackground",type:"boolean",defaultValue:!1,show:!0},outlineWidth:{component:"slider",type:"number",expression:"optional",ref:"style.outlineWidth",translation:"LayerStyleEditor.style.strokeWidth",show:!0,defaultValue:2,min:1,max:6,step:1},dataPointSize:{component:"slider",type:"number",expression:"optional",ref:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:e?12:10,min:3,max:30,step:1}}),$l=({translator:e,pluginOptions:t,supportNewStyles:n=!1})=>{const i={type:"array",ref:"plugins",filter:e=>e.filter(e=>["point","line"].includes(e.type)),translation:"properties.shapes",show:e=>(e?.qHyperCubeDef?.qDimensions||[]).length>0,itemTitleRef:e=>t.filter(t=>t.value===e.type)[0].translation+(e.label?.value?`: ${e.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,dialog:{ref:"type",options:t},add(e,t){void 0===t.plugins&&(t.plugins=[]),Vl(e)},addTranslation:"properties.shapes.addShape",globalChange:(e,t,n)=>{e.plugins&&(e.plugins.forEach(Vl),Vr.canBeContinuous(n.layout)?e.plugins.forEach(e=>{switch(e.type){case"point":Fl(e);break;case"line":t=e,t.points?.forEach(Fl)}var t}):e.plugins.forEach(e=>{switch(e.type){case"point":jl(e);break;case"line":t=e,t.points?.forEach(jl)}var t}))},items:{point:{component:"items",show:e=>"point"===e.type,items:{dataSection:{component:"items",items:_l({translator:e})},styleSection:{component:"items",items:Ul(n)}}},line:{type:"items",show:e=>"line"===e.type,items:{dataSection:{component:"items",items:{label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},points:{type:"array",ref:"points",titleTranslation:"properties.plugins.Points",itemTitleRef:(t,n)=>e.get("properties.plugins.Points.Point",n+1)+(t.label?.value?`: ${t.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,addTranslation:"properties.plugins.Points.addPoint",items:{dataSection:{component:"items",items:_l({translator:e})},styleSection:{component:"items",items:Ul(n),show:(e,t,n)=>{const i=((e,t)=>{if(!t)return null;for(let n=0;n<t.length;n+=1)if("line"===t[n].type&&t[n].points.includes(e))return t[n];return null})(e,n.properties.plugins);return i?.showPoints}}}}}},styleSection:{component:"items",items:{lineColor:{ref:"style.lineColor",translation:"Object.Table.Representation.MiniChart.Colors.Line",type:"object",component:"color-picker",disableNone:Rl,showAlpha:Pl,defaultValue:Hl},lineThickness:{component:"slider",type:"number",expression:"optional",ref:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:n?3:2,min:1,max:6,step:1},lineType:{component:"dropdown",type:"string",expression:"optional",ref:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"",options:[{value:"",translation:"LayerStyleEditor.style.solid"},{value:"8 4",translation:"LayerStyleEditor.style.dashed"}],convertFunctions:{get(e,t){const n=e(t.type);return void 0===n||""===n?"":"8 4"}}},lineCurve:{translation:"LayerStyleEditor.style.lineCurve",type:"string",ref:"style.lineCurve",component:"dropdown",defaultValue:n?"monotone":"linear",expression:"optional",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]}}},showPoints:{ref:"showPoints",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1}}}}};return i};var Wl=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,i=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=i.length):(n=arguments[1],t=arguments[2]),t&&i?(i.length>n&&(i=i.substr(0,n)),new e(i,t)):null}},Kl=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,i){let o,r;if(t.length===n)return r=this._value,this.setValue(i),r;const a=t.charAt(n);return this._nextMap?(o=this._nextMap[a],o||(o=new e,this._nextMap[a]=o)):(this._nextMap={},o=new e,this._nextMap[a]=o),o.put(t,n+1,i)}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 Wl.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return Wl.newInstanceIfNeeded(e,t,this._value);const i=n.getLongestMatch(e,t+1);return i||Wl.newInstanceIfNeeded(e,t,this._value)}},Gl=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 Kl);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 Gl;let i,o,r;for(i 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[i]&&e.hasOwnProperty(i)&&(t[e[i]]=i);for(o in t)"function"!=typeof t[o]&&t.hasOwnProperty(o)&&(r=t[o].toLowerCase().substr(1),n.put(r,String.fromCharCode(o)))})(),"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);var Yl={ATTRIBUTE:{FIRST_DIMENSION_DIFF:"firstDimensionDiff"},UNIT_MULTIPLIER:1,UNIT:{AUTO:"auto",SECONDS:"seconds",MINUTES:"minutes",HOURS:"hours",DAYS:"days",WEEKS:"weeks",MONTHS:"months",YEARS:"years",NUMBER:"number",NONE:"none"}};const Xl="cao.fieldPicker.tab.period",Jl={TITLE:"properties.forecast.stepSize.label",AUTO:"properties.axis.displaymode.auto",SECONDS:"properties.forecast.stepUnit.seconds",MINUTES:"properties.forecast.stepUnit.minutes",HOURS:"properties.forecast.stepUnit.hours",DAYS:"properties.forecast.stepUnit.days",WEEKS:"properties.forecast.stepUnit.weeks",MONTHS:"properties.forecast.stepUnit.months",YEARS:"properties.forecast.stepUnit.years",NUMBER:"properties.forecast.stepUnit.number",NONE:"properties.scrollbar.none"},Zl=(e,t,n)=>Yr.continuous({layout:n.layout,properties:n.properties}),Ql=(e,t,n)=>{const i=e?.qHyperCubeDef?.qDimensions?.[0]?.qDef?.continuous?.period;return Zl(0,0,n)&&i&&"none"!==i},{FIRST_DIMENSION_DIFF:eu}=Yl.ATTRIBUTE,tu=(e,t,n)=>{const i=e?.qHyperCubeDef?.qDimensions?.[0];if(i)if(Yr.continuous({layout:n.layout,properties:n.properties})&&"auto"===i.qDef?.continuous?.period){const e=i.qAttributeExpressions||[],t=e.find(e=>e.id===eu),n="Min(Aggr(If(RowNo() > 1, [$(=GetObjectField(0))] - Above([$(=GetObjectField(0))]), Null()),([$(=GetObjectField(0))], (Numeric, Ascending))))";t?(t.qExpression="",t.qLabelExpression=n,i.qAttribute=!0):(e.push({id:eu,qExpression:"",qLabelExpression:n,qAttribute:!0}),i.qAttributeExpressions=e)}else{const e=i.qAttributeExpressions||[],t=e.findIndex(e=>e.id===eu);-1!==t&&(e.splice(t,1),i.qAttributeExpressions=e)}},{UNIT:nu,UNIT_MULTIPLIER:iu}=Yl;const ou={MINI_CHART:{value:"miniChart",translation:"properties.scrollbar.miniChart"},BAR:{value:"bar",translation:"properties.scrollbar.bar"},NONE:{value:"none",translation:"properties.scrollbar.none"}};var ru={OPTIONS:ou,DEFAULT:ou.MINI_CHART};function au({layoutService:e,discrete:t}){return({h:n,rect:i,orientation:o,minThumbSize:r})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===o,u=i[l?"width":"height"];let c=a.qArea.qTop/s*u,d=a.qArea.qHeight/s*u;if(d<r){const e=(r-d)/2;c=c-e+(Math.max(0,0-(c-e))-Math.max(0,c+d+e-u)),d=r}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:c,width:d}:{top:c,left:0,height:d}}})}}function su({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),i=t.get("continuousMin"),o=t.get("continuousMax");return[(n.min-i)/(o-i),(n.max-i)/(o-i)]}(t,n):function(e){return e.get("viewRange")}(t)}const lu=e=>({miniChart:e===ru.OPTIONS.MINI_CHART.value,bar:e===ru.OPTIONS.BAR.value,none:e===ru.OPTIONS.NONE.value});function uu({layoutService:e,override:t}){const n=(({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return lu(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return lu(ru.DEFAULT.value);const i=e.getLayoutValue("dimensionAxis.continuousAuto"),o=e.getLayoutValue("preferContinuousAxis");return lu(!n&&(i||!i&&o)?ru.OPTIONS.NONE.value:ru.OPTIONS.MINI_CHART.value)})({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===ru.OPTIONS.MINI_CHART.value,n.bar=t.value===ru.OPTIONS.BAR.value,n.none=t.value===ru.OPTIONS.NONE.value),n}function cu({layoutService:e,dockService:t,discrete:n,continuousDataModel:i,viewState:o,viewCache:r,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:u=!1,deviceType:c}){const d=uu({layoutService:e,override:l});if(d.none)return!1;const{orientation:m}=t.meta.major,h={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===m?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?i.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:m,rtl:s,isContinuous:e.meta.isContinuous,range:()=>su({layoutService:e,viewState:o,viewCache:r})}};d.bar&&(h.settings.style="slim",h.settings.size={area:"touch"===c?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(h.settings.size.thumb={min:4}));const f=a.getStyles();return f.color&&(h.style={standard:{thumb:{"border-color":f.color,opacity:.4},before:{background:f.color,opacity:.1},after:{background:f.color,opacity:.1}}}),e.meta.isDiscrete&&u&&(h.settings.injections=()=>[au({layoutService:e,discrete:n})]),h}function du({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:r,rtl:a}){return s=>{const{x:l,y:u}=s.center,c=t.element.getBoundingClientRect(),d=t.component(e),m="horizontal"===r.meta.major.orientation,h=m?l-c.left-d.rect.computedInner.x:u-c.top-d.rect.computedInner.y,f=m?d.rect.computedInner.width:d.rect.computedInner.height,p=m&&a?f-h:h,g=Math.max(0,Math.min(p/f,1)),[y,v]=su({layoutService:o,viewState:n,viewCache:i}),b=g<y,x=g>v,S=!b&&!x;return{pixel:p,relative:g,thumb:S?p-y*f:0,beforeThumb:b,afterThumb:x,onThumb:S}}}function mu({componentKey:e,chart:t,viewState:n,viewCache:i,layoutService:o,dockService:r}){return()=>{const a=t.component(e),{orientation:s}=r.meta.major,{width:l,height:u}=a.rect.computedInner,c="horizontal"===s?l:u,[d,m]=su({layoutService:o,viewState:n,viewCache:i});return{size:c,thumbSize:(m-d)*c}}}function hu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l}){const u=du({componentKey:e,chart:t,viewState:i,viewCache:o,layoutService:r,dockService:a,rtl:l}),c=mu({componentKey:e,chart:t,viewState:i,viewCache:o,layoutService:r,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(i,o)=>!o||!!n.scroll.enabled()&&t.componentsFromPoint({x:o.center.x,y:o.center.y}).some(t=>t.key===e)},events:{scrollbarTap(n){n.preventDefault();const a=u(n);if(r.meta.isContinuous){const e=i.get("zoom"),t=e.max-e.min,n=o.get("continuousMin"),r=o.get("continuousMax"),s=n+(r-n)*a.relative;i.set("zoom",{min:Math.min(s-t/2,r-t),max:Math.max(s+t/2,n+t)})}else{const e=c(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}const fu="data-scrollbar-handle";function pu({e:e}){return(e.srcEvent||e).srcElement.getAttribute(fu)||""}const gu="scrollbarResize";function yu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,rtl:s}){const l=du({componentKey:e,chart:t,viewState:i,viewCache:o,layoutService:r,dockService:a,rtl:s});return{type:"Pan",key:`event:${gu}`,options:{event:gu,threshold:0,enable(e,t){return!(!r.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[gu]=this[gu]||{},(e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)})(t)&&pu({e:t})&&(this[gu].panningEvent=t.srcEvent),!!this[gu].panningEvent))}},events:{[`${gu}start`](n){n.preventDefault(),this[gu]=this[gu]||{},this[gu].panningEvent&&t.component(e).emit("dragStart",this[gu].panningEvent)},[`${gu}move`](n){if(n.preventDefault(),this[gu]=this[gu]||{},!this[gu].panningEvent)return;const r=i.get("zoom"),a=o.get("continuousMin"),s=o.get("continuousMax"),u=o.get("minimiumZoomSpan"),c=(s-a)*l(n).relative+a,d=pu({e:this[gu].panningEvent});let m="start"===d?Math.min(c,r.max):r.min,h="end"===d?Math.max(c,r.min):r.max;m===h&&(m-="start"===d?u:0,h+="end"===d?u:0),i.set("zoom",{min:m,max:h}),t.component(e).emit("render")},[`${gu}end`](n){n.preventDefault(),this[gu]=this[gu]||{},delete this[gu].panningEvent,t.component(e).emit("dragEnd")},[`${gu}cancel`](n){n.preventDefault(),this[gu]=this[gu]||{},delete this[gu].panningEvent,t.component(e).emit("dragEnd")}}}}const vu="scrollbarPan";function bu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l}){const u=du({componentKey:e,chart:t,viewState:i,viewCache:o,layoutService:r,dockService:a,rtl:l}),c=mu({componentKey:e,chart:t,viewState:i,viewCache:o,layoutService:r,dockService:a});return{type:"Pan",key:`event:${vu}`,options:{event:vu,threshold:0,enable(i,o){return this[vu]=this[vu]||{},!(o&&!this[vu].isPanning)||!!n.scroll.enabled()&&((!o||o.target===t.element)&&t.componentsFromPoint({x:o.center.x,y:o.center.y}).some(t=>t.key===e))}},events:{[`${vu}start`](n){n.preventDefault();const a=u(n);if(this[vu]=this[vu]||{},this[vu].isPanning=!0,t.component(e).emit("lockState"),r.meta.isContinuous){const e=i.get("zoom"),t=e.max-e.min,n=o.get("continuousMin"),r=o.get("continuousMax"),s=n+(r-n)*a.relative;s<e.min?i.set("zoom",{min:Math.min(s,r-t),max:Math.max(s+t,n+t)}):s>e.max&&i.set("zoom",{min:Math.min(s-t,r-t),max:Math.max(s,n+t)}),this[vu].relative=a.relative,this[vu].zoom=i.get("zoom"),this[vu].zoom.span=this[vu].zoom.max-this[vu].zoom.min,this[vu].zoom.fullSpan=r-n}else if(a.onThumb)this[vu].offset=a.thumb;else{const e=c();this[vu].offset=a.beforeThumb?0:e.thumbSize}},[`${vu}move`](n){n.preventDefault();const a=u(n);if(this[vu]=this[vu]||{},r.meta.isContinuous){const e=a.relative-this[vu].relative,{fullSpan:t,span:n,min:r,max:s}=this[vu].zoom,l=o.get("continuousMin"),u=o.get("continuousMax");i.set("zoom",{min:Math.min(r+e*t,u-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[vu].offset||0),t=c(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},[`${vu}end`](n){n.preventDefault(),this[vu]=this[vu]||{},this[vu].isPanning=!1,t.component(e).emit("unlockState")},[`${vu}cancel`](n){n.preventDefault(),this[vu]=this[vu]||{},this[vu].isPanning=!1,t.component(e).emit("unlockState")}}}}function xu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l}){return[hu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l}),yu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,rtl:l}),bu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l})]}function Su({componentKey:e,chart:t,actions:n,layoutService:i}){const o=(o,r)=>{if(!i.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(o,r)};return{type:"native",events:{mousemove:e=>o("hover",e),mouseleave:()=>o("leave")}}}function Mu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l}){return{gestures:[...xu({componentKey:e,chart:t,actions:n,viewState:i,viewCache:o,layoutService:r,dockService:a,discrete:s,rtl:l})],native:Su({componentKey:e,chart:t,actions:n,layoutService:r})}}const qu={background:"rgba(0, 0, 0, 0.1)"},Cu={top:-1,bottom:-1,width:6},wu={width:2,background:"#595959"};var Tu={before:qu,after:qu,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:Cu,endHandle:Cu,startHandleBorder:wu,endHandleBorder:wu};const ku={background:"rgba(0, 0, 0, 0.1)"},Nu={top:-1,bottom:-1,width:6},Du={width:2,background:"#595959"};var Lu={before:ku,after:ku,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:Nu,endHandle:Nu,startHandleBorder:Du,endHandleBorder:Du};const Eu={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},Ou={pointerEvents:"initial"},Au={pointerEvents:"none"};const Iu="ew-resize",Pu="default";function Ru(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,i=n?e.computedInner.width:e.computedInner.height,o=t.range(),r=n&&t.rtl;return{size:i,start:(r?1-o[1]:o[0])*i,end:(r?1-o[0]:o[1])*i}}function zu(){const e=this.state.hover.start||this.state.hover.end||this.state.drag.start||this.state.drag.end;this.renderer.element().ownerDocument.body.style.cursor=e?Iu:Pu}function Hu(e,t,n){const{min:i}=this.settings.settings.size.thumb;if(n-t<i){const o=(i-(n-t))/2,r=Math.max(0,0-(t-o))-Math.max(0,n+o-e);return{size:e,start:t-o+r,end:n+o+r}}return{size:e,start:t,end:n}}function Bu(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function Fu(){const{size:e,start:t,end:n}=Ru.call(this);this.renderer.render(this.elements(this.h,Hu.call(this,e,t,n)))}function ju(){const{state:e,settings:t,style:n}=this,i=t.settings.style;return e.style[i]||(e.style[i]=function({id:e,style:t}){const n="slim"===e?Lu:Tu;return{container:{...Eu},before:{...Eu,...n.before,...t.before},after:{...Eu,...n.after,...t.after},thumb:{...Eu,...n.thumb,...t.thumb},startHandle:{...Eu,...Ou,...n.startHandle},endHandle:{...Eu,...Ou,...n.endHandle},startHandleBorder:{...Eu,...Au,...n.startHandleBorder},endHandleBorder:{...Eu,...Au,...n.endHandleBorder}}}({id:t.settings.style,style:n[i]})),e.style[i]}var Vu={require:["renderer"],defaultSettings:{settings:{style:"standard",size:{area:{min:30,max:40,ratio:1/8},thumb:{min:4}},orientation:"horizontal",rtl:!1,isContinuous:!1,range:()=>[0,1],injections:()=>[]},style:{standard:{before:{},thumb:{},after:{}},slim:{before:{},thumb:{},after:{}}}},renderer:"dom",on:{render(){Fu.call(this)},lockState(){this.state.locked=!0},unlockState(){this.state.locked=!1},hover(e){if(this.state.locked||this.state.drag.start||this.state.drag.end||!Bu.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=pu({e:e});t&&(this.state.hover[t]=!0),zu.call(this),Fu.call(this)},leave(){this.state.locked||(this.state.hover.reset(),zu.call(this),Fu.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=pu({e:e});t&&(this.state.drag[t]=!0),zu.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),zu.call(this),Fu.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:i}=this.settings.settings.size.area,o="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[o]*i))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:i}=Ru.call(this);return this.elements(e,Hu.call(this,t,n,i))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:i}){const{settings:o}=this.settings,r=o.injections().map(t=>t({h:e,rect:this.rect,orientation:o.orientation,minThumbSize:o.size.thumb.min}));return function({h:e,size:t,start:n,end:i,properties:o,startHandleActive:r,endHandleActive:a,style:s,continuous:l,invert:u,injections:c}){const d={[o.end]:t-n},m={[o.start]:i},h={left:-3},f={left:1},p={right:-3,left:"auto"},g={left:3},y=e("div",{style:{...s.before,...u?m:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...u?d:m},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...u?p:h},class:"scrollbar--start-handle",[fu]:"start"},r?e("div",{style:{...s.startHandleBorder,...u?g:f}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...u?h:p},class:"scrollbar--end-handle",[fu]:"end"},a?e("div",{style:{...s.endHandleBorder,...u?f:g}}):void 0);b.push(n)}const x=e("div",{style:{...s.thumb,[o.start]:n,[o.end]:t-i},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,x,v,...c])}({h:e,size:t,start:n,end:i,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:ju.call(this),continuous:o.isContinuous,invert:"horizontal"===o.orientation&&o.rtl,injections:r})}};const _u={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:i,rendHeight:o,flipXY:r,symbol:a}){let s="x",l="y",u=i,c=o,d=t<.5?90:-90;return r&&(s="y",l="x",u=o,c=i,d=t<.5?180:0),a(ne({},e,{[s]:n*u,[l]:c-Math.max(e.size/2,Math.min(t*c,c-e.size/2)),startAngle:d}))}};function Uu({i:e,width:t,height:n,resolved:i,keys:o,flipXY:r,calcKey:a="box"}){let s,l=null,u=null;void 0!==i.major.settings.binStart?(l=i.major.items[e].binStart,u=i.major.items[e].binEnd,s=i.major.settings.binStart.scale):(s=i.major.settings.major.scale,l=s?i.major.items[e].major:0);let c=0;s?s.bandwidth?(c=s.bandwidth(),l-=c/2):c=u-l:c=1;const d=ne({},{major:l,majorEnd:u},i.minor.items[e]);o.forEach(t=>{d[t]=i[t].items[e]});const m=r?n:t,h=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:i,maxMajorWidth:o}){const r=e>=0?1:-1;let a=Math.min(r*e*t,Number.isNaN(Number(i))?o:i/o);return a=Number.isNaN(Number(n))?a:Math.max(n/o,a),a*r}({bandwidth:c,width:d[a].width,minWidthPx:d[a].minWidthPx,maxWidthPx:d[a].maxWidthPx,maxMajorWidth:m}),f=(c-h)/2,p=f+d.major+h/2;return{item:d,boxCenter:p,boxWidth:h,boxPadding:f,rendWidth:t,rendHeight:n}}function $u({keys:e,data:t,defaultSettings:n,style:i,settings:o,width:r,height:a,resolver:s}){const l=ne(!0,{},n||{},i||{}),u={major:"horizontal"===o.orientation?a:r,minor:"horizontal"===o.orientation?r:a},c=o.major;let d;d="object"==typeof c&&"object"==typeof c.ref&&void 0!==c.ref.start&&void 0!==c.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:ne(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof c&&void 0!==c.binStart&&void 0!==c.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:ne(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):s.resolve({data:t,scaled:u,defaults:{major:.5},settings:{major:o.major}});const m=o.minor||{};let h;const f={major:d,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:ne(!0,{},{start:{scale:m.scale,ref:"start"},end:{scale:m.scale,ref:"end"},min:{scale:m.scale,ref:"min"},max:{scale:m.scale,ref:"max"},med:{scale:m.scale,ref:"med"}},m)})};for(let n=0,i=e.length;n<i;n++)h=e[n],f[h]=s.resolve({data:t,defaults:l[h],settings:o[h],scaled:u});return f}const Wu=["oob"];const Ku={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,i="horizontal"===this.settings.settings.orientation,{data:o,style:r,resolver:a,symbol:s}=this,l=$u({keys:Wu,data:o,defaultSettings:{oob:_u.getDefaultSettings()},style:r,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:u,items:c}=l,d=function({width:e,height:t,flipXY:n,resolved:i,keys:o,symbol:r,dockValue:a,_calcItemRenderingOpts:s=Uu}){const l=[],{items:u}=i.major;for(let c=0,d=u.length;c<d;c++){const{item:d,boxCenter:m,rendWidth:h,rendHeight:f}=s({i:c,width:e,height:t,resolved:i,keys:o,flipXY:n,calcKey:"oob"}),p=u[c].data,g=[];if(d.oob.show){g.push(_u.createOob({oob:d.oob,dockValue:a,boxCenter:m,rendWidth:h,rendHeight:f,flipXY:n,symbol:r}));const e={type:"container",data:p,collider:{type:"bounds"},children:g};l.push(e)}}return l}({width:e,height:t,flipXY:i,resolved:l,keys:Wu,symbol:s,dockValue:n});return d}},Gu={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},Yu=["hat"];function Xu(e,t=!0){let n="";for(let t=0;t<e.length;t++){const i=e[t];n+=0===t?`M${i.x} ${i.y}`:`L${i.x} ${i.y}`,n+=" "}return t&&(n+="Z"),n}function Ju({item:e,boxWidth:t,boxPadding:n,rendWidth:i,rendHeight:o,flipXY:r}){let a="x",s="y",l=i,u=o,c=e.hat.alignment||0;r&&(a="y",s="x",l=o,u=i,c=1-c);const d=(n+e.major)*l;let m=[{[a]:d,[s]:0+u},{[a]:d+t*c*l,[s]:8},{[a]:d+t*l,[s]:0+u},{[a]:d+t*l,[s]:0+u+10},{[a]:d,[s]:0+u+10}];const h=ne({},e.hat,{type:"path",d:Xu(m)});m=[{[a]:d,[s]:0},{[a]:d+t*(1-c)*l,[s]:0+u-8},{[a]:d+t*l,[s]:0},{[a]:d+t*l,[s]:-10},{[a]:d,[s]:-10}];return[h,ne({},e.hat,{type:"path",d:Xu(m)})]}const Zu={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:r}=this,a=$u({keys:Yu,data:i,defaultSettings:Gu,style:o,settings:this.settings.settings,width:e,height:t,resolver:r}),{settings:s,items:l}=a,u=function({width:e,height:t,flipXY:n,resolved:i,keys:o,_calcItemRenderingOpts:r=Uu}){const a=[],{items:s}=i.major;for(let l=0,u=s.length;l<u;l++){const{item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:h}=r({i:l,width:e,height:t,resolved:i,keys:o,flipXY:n,calcKey:"hat"}),f=s[l].data,p=[];u.hat.show&&p.push(...Ju({item:u,boxWidth:c,boxPadding:d,rendWidth:m,rendHeight:h,flipXY:n}));const g={type:"container",data:f,collider:{type:"bounds"},children:p};a.push(g)}return a}({width:e,height:t,flipXY:n,resolved:a,keys:Yu});return u}};var Qu={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]};function ec(e,t,n,i){const o=function(t){const n=String(t);return e(n)};return o.ticks=()=>t.map(t=>{const r=o([t.data.value,i?n-1:0]),a=o([t.data.value,i?0:n-1])+e.bandwidth();return{position:(r+a)/2,label:t.label,data:t.data,start:r,end:a}}),o.bandwidth=()=>e.bandwidth(),o.data=()=>e.data(),o.domain=()=>e.domain(),o.pxScale=function(i){const o=e.pxScale(i);return o===e?this:ec(o,t,n)},o}function tc(e){const t=e.scale("band");e.scale("group-by-measure",function(e={},n={},i={}){const o=t(e,n,i),r=o.domain(),a=o.ticks(),s=[],l=e.measureCount;return r.forEach((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)}),s.splice(-1),o.domain(s),ec(o,a,l,e.invert)})}const nc=()=>({version:"2.2.0",barGrouping:{grouping:"grouped"},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:[],dataPoint:{showLabels:!1,showSegmentLabels:!1,showTotalLabels:!0},dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},footnote:"",gridLine:{auto:!0,spacing:2},legend:{dock:"auto",show:!0,showTitle:!0},measureAxis:{autoMinMax:!0,dock:"near",max:10,min:0,minMax:"min",show:"all",spacing:1},orientation:"vertical",preferContinuousAxis:!0,qHyperCubeDef:{qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},refLine:{refLines:[],dimRefLines:[]},scrollbar:"miniChart",scrollStartPos:0,showDetails:!0,showDisclaimer:!0,showMiniChartForContinuousAxis:!0,showTitles:!0,subtitle:"",title:"",tooltip:{auto:!0,hideBasic:!1,data:{qHyperCubeDef:void 0},chart:void 0,imageComponents:void 0}}),ic={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 oc(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const rc={getImageSize(e,t){let n;function i(){n&&(clearTimeout(n),n=null)}function o(e){const t=e;t.onload=null,t.onerror=null,i()}const r={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,u=r[t]*(n>l?1:n/l),c=r[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},o(s)):"original"===t?(e={height:Math.min(u,n),width:Math.min(c,l)},i()):(e={height:u,width:c},i()),a(e)},s.onerror=()=>{o(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{o(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function ac(e,t,n){let i=e.ref.qStaticContentUrl.qUrl;const o=function(e){let t,n,i,o,r,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://",i=t.host||"localhost",o=t.port?`:${t.port}`:"",r=t.prefix?t.prefix:"/","/"!==r[r.length-1]&&(r=`${r}/`),n+i+o+r}return""}(n);o&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(i,o),i=i.replace(/"/g,'\\"'),i=i.replace(/'/g,"\\'"),i=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(i,o));const{height:r,width:a,imageError:s}=await rc.getImageSize(i,t);return{src:i,size:t,height:r,width:a,imageError:s}}async function sc(e,t,n,i){const{app:o,flags:r}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",u=s.type||"media";let c=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){c=e;break}const d=i.data?.customTooltipAttrExps?.value||[];let m;if(-1!==c&&d[c]&&(m=d[c]),"media"===u&&s.ref?.qStaticContentUrl?.qUrl)return ac(s,l,o);if("url"===u)return async function(e,t,n,i,o){let r,a=n.ref;if(o&&o.label&&(a=o.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&oc(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:o,imageError:s}=await rc.getImageSize(t,i);r={src:t,size:i,height:n,width:o,imageError:s}}catch(e){}else{const{height:e,width:t,imageError:n}=await rc.getImageSize(a,i);r={src:a,size:i,height:e,width:t,imageError:n}}return r}(o,r,s,l,m);if(r.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===u&&m&&m.label){return async function(e,t,n,i){let o;const r=i.label,a=`qmem://${t.qFallbackTitle}/${r}`;if(oc(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:i,width:r,imageError:a}=await rc.getImageSize(e,n);o={src:e,size:n,height:i,width:r,imageError:a}}}catch(e){}return o}(o,n[c],l,m)}return[]}const lc={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:i}){const o=t,r=[];for(let t=0;t<o.length;t++)r.push(sc(e,i,n,o[t]));const a=await Promise.all(r);for(let e=0;e<o.length;e++)o[e].data.customTooltipImages=[a[e]];return o},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},uc={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:i}){let o=t;return o=await lc.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:i}),o},checkIfPromisesExist:({customTooltipModel:e})=>lc.checkIfPromisesExist({customTooltipModel:e})};const cc=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,i=e?.qHyperCubeDef?.qMeasures,o=e?.qHyperCubeDef?.qInterColumnSortOrder,r=t;return{qInfo:{qType:ic.CHART.CHART_PARENT_TYPE,qId:ic.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:i,qInterColumnSortOrder:o,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:r}},dc=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:ic.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const mc={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",i=ic.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:i,height:i,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:ic.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":i}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:i,customTooltipModel:o,rtl:r})=>{const a=o,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await mc.hide({app:e,customTooltipModel:o});try{await async function({app:e,properties:t,customTooltipModel:n}){const i=n,o=ic.CHART.STATE,r=t.qStateName;i.miniChartToken.alternateState||(i.miniChartToken.alternateState=o,await e.addSessionAlternateState(o,r),i.miniChartToken.alternateState=o)}({app:e,properties:t,customTooltipModel:o});const s=await async function({app:e,properties:t,customTooltipModel:n}){const i=n;i.miniChartToken.sessionObj?.id&&await e.destroySessionObject(i.miniChartToken.sessionObj.id);const o=ic.CHART.STATE,r=cc(t,o),a=await e.createSessionObject(r),s=dc(t);if(a.id!==ic.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);i.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(i.miniChartToken.sessionObj&&i.miniChartToken.sessionObj.id===a.id)return i.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:o});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!==i?i:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===i&&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],i=void 0!==e.value?[e.value]:[];i.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),i,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(ic.CHART.CONTAINER_ID),u={direction:r?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await o.embed.render({element:l,model:a.miniChartToken.model,options:u,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch(t){await mc.hide({app:e,customTooltipModel:o})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(mc.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(ic.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,i=ic.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(i)}({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 hc(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function fc(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:i}=ic.CUSTOM,o={};return o[e]=!0,o[t]=!0,o[n]=!0,o[i]=!0,o}function pc(e){const t=fc();return e.filter(e=>t[e.id])}const gc={getNodes(e,t){const n=function(e,t){let n=0,i=0;e.center?(n+=e.center.x,i+=e.center.y):(n+=e.clientX,i+=e.clientY);const o=t.element.getBoundingClientRect();return{cx:n-o.left,cy:i-o.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,i=[];const o={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const r=t.data?.selectionDimension??t.data;if(!r||t.data?.customTooltipAttrExps||o[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],i.push(e)}}else{n||(n=[],Object.keys(o).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&o[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===r.value&&t.label===r.label});t.length>0&&(i=i.concat(t[0]))}}),i},displayTooltip(e,t,{nodes:n,opts:i={},customTooltipModel:o,extractedNodes:r=[],hide:a}){if(o&&!a){const{layout:a,chart:s}=o,{attrExps:l}=gc.getAttrExprData(a);r.length||n.length?uc.handlePromises({customTooltipModel:o,nodes:gc.getDataNodes(s,r.length>0?r:n),attrExps:l,opts:i}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else o?.miniChartToken?.alternateState&&mc.hide({app:i.app,customTooltipModel:o}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>uc.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,i=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[i]||(n[i]=[]),n[i]},getAttrExprData(e){let t=[],n="";const i=e.qHyperCube?.qDimensionInfo||[];if(i.length>0){const o=i.length-1;t=e.qHyperCube?.qDimensionInfo?.[o]?.qAttrExprInfo||[],n=`qDimensionInfo/${o}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[ic.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let i=n.qLayoutExclude;i||(n.qLayoutExclude={quarantine:{}},i=n.qLayoutExclude),i.quarantine||(i.quarantine={}),i.quarantine[ic.CUSTOM.QUARANTINE]=[],e.forEach(e=>{i.quarantine[ic.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=i}(pc(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[ic.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[ic.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=hc(e);if(!n)return;const i=void 0!==t?t:n.length-1;if(!n[i])return;const o=this.getAttrExps(e,n[i]);if(0===pc(o).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...o,...t],r=e;r.qHyperCubeDef?r.qHyperCubeDef.qDimensions[i].qAttributeExpressions=n:r.qHyperCube.qDimensionInfo[i].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let i=[];const o=hc(e)||[];[...o,t].forEach(e=>{const t=pc(e.qAttributeExpressions||[]);t.length>0&&(i=t)});const r=fc(),a=o.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!r[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(i));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:ua.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=ua.detectTextDirection(e.src),i=[],o={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){i.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;i.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),o.style["text-align"]="center",o.style["white-space"]="nowrap"}else o.style["background-size"]="contain",o.style["background-repeat"]="no-repeat",o.style["background-position"]="center",o.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",o,i),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function yc({layout:e,app:t,picasso:n,model:i,chart:o,translator:r,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:i,chart:o,translator:r,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:gc,miniChartToken:{},embed:s}}function vc(e,t,n,i){const o=t.qHyperCube?.[n]?.[i]?.qAttrExprInfo||[],r=[],a=e.qSubNodes&&e.qSubNodes[i]?e.qSubNodes[i].qAttrExps:e.qAttrExps;return a?(o.forEach((e,t)=>{const o=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===o?"NaN":function(e,t){let n;switch(e.id){case ic.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case ic.CUSTOM.TITLE:case ic.CUSTOM.DESCRIPTION:case ic.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,o);r.push({source:{key:"qHyperCube",field:`${n}/${i}/qAttrExprInfo/${t}`},label:s,value:"value"})}),r):r}const bc={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,i="qDimensionInfo";return{field:`${i}/${n}`,value:t=>vc(t,e,i,n)}}};const xc={getCustomAttrExps(e,t,n){const i={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},o=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(o))return i;return function(e,t,n,i){const o={[ic.CUSTOM.TITLE]:!0,[ic.CUSTOM.DESCRIPTION]:!0},{attrExps:r,fieldPath:a}=gc.getAttrExprData(e);return 0===t.length||0===r.length||""===a||r.forEach((e,r)=>{const s=t[r];if(e.id===ic.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,o="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${r}`).formatter()(s.value);i.customTooltipAttrExpsArr.push({label:t,value:o})}else if(o[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&i.customTooltipInfoAttrExpsArr.push({...e.id===ic.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),i}(n,o.map(t=>ca.getMeasure(e,t)),e,i)}};function Sc({nodes:e,layout:t,dataset:n}){const i=function(e,t,n){const i=[];return e.forEach(e=>{i.push(xc.getCustomAttrExps(n,e,t))}),i}(e,t,n);return i.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}function Mc(e){const t=ic.CUSTOM.EXPRESSION,{qNumFormat:n,qLabel:i,qLabelExpression:o,cId:r}=e.qDef;return e.qLibraryId?{qLibraryId:e.qLibraryId,id:t,qNumFormat:n,qLabel:i,qLabelExpression:o,cId:r}:{qExpression:e.qDef.qDef,id:t,qNumFormat:n,qLabel:i,qLabelExpression:o,cId:r}}function qc(e){const t=e.qHyperCubeDef?.qDimensions;return t[t.length-1].qAttributeExpressions||[]}const Cc={migrateProperties(e){const t=ne(!0,{},e),n=t.tooltip?.data?.qHyperCubeDef?.qMeasures||[];let i=qc(t);return i=function(e,t){return t.concat(e.map(e=>Mc(e)))}(n,i),function(e,t){const n=t.qHyperCubeDef?.qDimensions;n[n.length-1].qAttributeExpressions=e}(i,t),delete t.tooltip?.data,t},getPatches(e){const t=e.tooltip?.data?.qHyperCubeDef?.qMeasures||[],n=e.qHyperCubeDef?.qDimensions.length-1,i=function(e,t,n){let i=e.length;const o=[];return t.forEach(e=>{const t=Mc(e),r=JSON.stringify(t);o.push({qPath:`/qHyperCubeDef/qDimensions/${n}/qAttributeExpressions/${i}`,qOp:"add",qValue:r}),i++}),o.push({qPath:"/tooltip/data",qOp:"remove"}),o}(qc(e),t,n);return i},checkForBackwardCompatibility:(e,t)=>(e.qMeasureInfo||[]).length>0&&t.length>0,updateProperties(e,t){const n=new Promise(n=>{const i=t.qHyperCube?.qDimensionInfo||[],o=t.tooltip?.data?.qHyperCube||{},r=t.qMeta?.privileges?.includes("update");e&&e.getEffectiveProperties&&this.checkForBackwardCompatibility(o,i)&&e.getEffectiveProperties().then(t=>{if(r){const i=this.migrateProperties(t);e.setProperties(i).then(()=>{e.app.clearUndoBuffer(),n(!0)})}else{const i=this.getPatches(t);e.applyPatches(i,!0).then(()=>{e.app.clearUndoBuffer(),n(!0)})}}),n(!1)});return n}};var wc={attrExpr:Cc};const{CUSTOM:Tc}=ic;function kc({flags:e,layout:t,app:n,model:i,picasso:o,chart:r,translator:s,localeInfo:l,embed:u,options:c}){const d={properties:void 0},m=yc({layout:t,app:n,model:i,picasso:o,chart:r,translator:s,localeInfo:l,embed:u}),h="rtl"===c.direction,f=()=>{const e=!!d.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{d.properties=e},isEnabled:()=>f(),hideBasic:()=>f()&&a(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const i=Sc({dataset:e,nodes:n,layout:t});return{title:i.customTooltipInfoAttrExpsArr.find(e=>e.id===Tc.TITLE)?.title,description:i.customTooltipInfoAttrExpsArr.find(e=>e.id===Tc.DESCRIPTION)?.value,measures:i.customTooltipAttrExpsArr}},hasImages:()=>gc.checkIfPromisesExist({customTooltipModel:m}),createImageRow:({value:e,h:t})=>gc.getImageRow(e,{h:t,rtl:h}),addImages:({nodes:i})=>{const o=gc.getDataNodes(r,i),{attrExps:a}=gc.getAttrExprData(t);return uc.handlePromises({customTooltipModel:m,nodes:o,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(f()&&t.tooltip?.chart?.object?.refId&&u&&"function"==typeof i?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>mc.createContainer({layout:t,ctx:{h:e,rtl:h}}),createLimitationRow:()=>gc.getFooterRow(s.get("properties.tooltip.notselectedmessage"),h),show:({nodes:e,properties:t})=>mc.show({app:n,properties:t,selectedNodes:e,customTooltipModel:m,rtl:h}),hasAlternateState:()=>!!m.miniChartToken?.alternateState,hide:()=>mc.hide({app:n,customTooltipModel:m}),destroy:()=>mc.destroyVisualization({customTooltipModel:m})}}}var Nc=7005;const Dc=e=>e.qError?.qErrorCode!==Nc,Lc=e=>{if(e.qHyperCubeDef.qDimensions.length>1&&1===e.qHyperCubeDef.qMeasures.length){const t=e.qHyperCubeDef.qInterColumnSortOrder.indexOf(0);0!==t&&$r.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,t,0)}},Ec=(e,t)=>{t>10?1!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&$r.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0):0!==e.qHyperCubeDef.qInterColumnSortOrder[0]&&$r.moveArrayElement(e.qHyperCubeDef.qInterColumnSortOrder,1,0)},Oc=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))},Ac=(e,t)=>{const n=e.qHyperCubeDef.qDimensions,i=e.qHyperCubeDef.qMeasures;if(1===n.length&&1===i.length){const i=n[0];return i.qLibraryId?t.getDimension(i.qLibraryId).then(e=>e.getLayout()).then(t=>{if(t&&t.qDimInfos&&t.qDimInfos[0]){const n=t.qDimInfos[0].qCardinal;Ec(e,n)}return i}):t.getField(i.qDef.qFieldDefs[0]).then(t=>t.getCardinal().then(t=>(Ec(e,t),i)),()=>i)}return Lc(e),Promise.resolve()};function Ic(e){const t=e.qHyperCubeDef.qDimensions,n=e.qHyperCubeDef.qMeasures,{color:{mode:i}}=e;t.length>1&&e.color?s(e,"color.persistent",!0):"byDimension"===i&&n.length>1?s(e,"color.mode","byMultiple"):"byExpression"===i&&0===n.length?s(e,"color.mode","primary"):0===t.length&&n.length>0&&(s(e,"color.byMeasureDef",void 0),s(e,"color.byDimDef",void 0),1===n.length&&"byExpression"!==i&&s(e,"color.mode","primary"))}const Pc=(e,t)=>{Ic(t),us(e),gc.addCallbackCustomTooltip(t)},Rc=e=>{Ic(e)};function zc({translator:e}){return{dimensions:{min:0,max:e=>e>1?1:2,description(t,n,i,o){let r;const a=o?.layout?o.layout.qHyperCube.qDimensionInfo.filter(e=>Dc(e)).length:t.qHyperCubeDef.qDimensions.length;return i.isAutoChart&&n>a-1?r="Visualizations.Descriptions.Color":a>1&&0===n?"stacked"===t.barGrouping.grouping?r="Visualizations.Descriptions.Stack":(r="Visualizations.Descriptions.Group",t.qHyperCubeDef.qColumnOrder=[0,1,2]):r="Visualizations.Descriptions.Bars",e.get(r)},add:(e,t,n)=>(t.qHyperCubeDef.qDimensions.length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),n?.app?Ac(t,n.app).then(()=>(Pc(e,t),e)):(Oc(t),Pc(e,t),e)),move(e,t,n){n.layout.qHyperCube.qDimensionInfo.filter(e=>Dc(e)).length>1&&"stacked"===t.barGrouping.grouping&&(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0),Lc(t),Ic(t),gc.moveCallbackCustomTooltip(t,e)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Ic(t),1===n.length&&(t.qHyperCubeDef.qMode="S"),gc.removeCallbackCustomTooltip(t,e)},replace(e,t,n,i){gc.replaceCallbackCustomTooltip(i,t)}},measures:{min:1,max:e=>e>1?1:15,description:()=>e.get("Visualizations.Descriptions.LengthBars"),add:(e,t,n)=>n?.app?Ac(t,n.app).then(()=>(e.qSortBy.qSortByNumeric=-1,Rc(t),e)):(Oc(t),Rc(t),e),move(e,t){Lc(t),Ic(t)},remove(e,t){const n=t.qHyperCubeDef.qDimensions;Ic(t),n.length>1&&"stacked"===t.barGrouping.grouping?(t.qHyperCubeDef.qMode="K",t.qHyperCubeDef.qAlwaysFullyExpanded=!0):1===n.length&&(t.qHyperCubeDef.qMode="S")}}}}function Hc(e){return{properties:nc(),data:{targets:[{path:"/qHyperCubeDef",...zc(e)}]}}}var Bc={Common_Measures:{id:"Common.Measures",locale:{"de-DE":"Kennzahlen","en-US":"Measures","es-ES":"Medidas","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","ru-RU":"Меры","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"de-DE":"Farbformel","en-US":"Color expression","es-ES":"Expresión de color","fr-FR":"Expression de couleur","it-IT":"Espressione colore","ja-JP":"カラー表現","ko-KR":"색상 표현식","nl-NL":"Kleuruitdrukking","pl-PL":"Wyrażenie koloru","pt-BR":"Expressão de cor","ru-RU":"Выражение для цвета","sv-SE":"Färguttryck","tr-TR":"Renk ifadesi","zh-CN":"颜色表达式","zh-TW":"色彩運算式"}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"de-DE":"+{0} mehr","en-US":"+{0} more","es-ES":"+{0} más","fr-FR":"+{0} plus","it-IT":"+{0} altre","ja-JP":"さらに +{0}","ko-KR":"{0} 이상","nl-NL":"+{0} meer","pl-PL":"Jeszcze {0}","pt-BR":"+{0} mais","ru-RU":"Еще +{0}","sv-SE":"Fler än {0} ytterligare","tr-TR":"+{0} daha","zh-CN":"+{0} 以上","zh-TW":"其他 +{0} 個"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"de-DE":"Summe negativer Werte","en-US":"Sum of negatives","es-ES":"Suma de negativos","fr-FR":"Somme des valeurs négatives","it-IT":"Somma valori negativi","ja-JP":"負の合計","ko-KR":"음수 합계","nl-NL":"Som negatieven","pl-PL":"Suma ujemnych","pt-BR":"Soma de negativos","ru-RU":"Сумма отрицательных значений","sv-SE":"Summan av negativa","tr-TR":"Negatif değerlerin toplamı","zh-CN":"负值总和","zh-TW":"負數總和"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"de-DE":"Summe positiver Werte","en-US":"Sum of positives","es-ES":"Suma de positivos","fr-FR":"Sommes des valeurs positives","it-IT":"Somma valori positivi","ja-JP":"正の合計","ko-KR":"양수 합계","nl-NL":"Som positieven","pl-PL":"Suma dodatnich","pt-BR":"Soma de positivos","ru-RU":"Сумма положительных значений","sv-SE":"Summan av positiva","tr-TR":"Pozitif değerlerin toplamı","zh-CN":"正值总和","zh-TW":"正數總和"}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","zh-CN":"对数刻度已替换为线性刻度,因为该数据范围包括零。","zh-TW":"對數刻度已遭線性刻度取代,因為資料範圍包含零。"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","en-US":"Currently showing a limited data set.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","ja-JP":"現在、限定的なデータ セットを表示しています。","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","pt-BR":"Mostrando um conjunto de dados limitado.","ru-RU":"В настоящее время отображается ограниченный набор данных.","sv-SE":"Just nu visas en begränsad datauppsättning.","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","zh-CN":"当前正显示有限的数据集。","zh-TW":"目前顯示的是有限的資料集。"}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative or zero values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores cero o negativos que no se pueden mostrar en este gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。"}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","zh-CN":"数据集包含无法在此图表中显示的负值。","zh-TW":"資料集包含無法在此圖表中顯示的負值。"}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","en-US":"The selections generated no data for this chart.","es-ES":"Las selecciones no han generado datos para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ko-KR":"선택 내용으로 이 차트에 대한 데이터가 생성되지 않았습니다.","nl-NL":"De selecties hebben geen gegevens voor de diagram gegenereerd.","pl-PL":"Wymiary nie spowodowały wygenerowania danych dla tego wykresu.","pt-BR":"As seleções não geraram dados para este gráfico.","ru-RU":"В результате выборок данные для этой диаграммы не созданы.","sv-SE":"Urvalen genererade inga data för detta diagram.","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","zh-CN":"选择未生成此图表的数据。","zh-TW":"此選項無法產生任何適用於此圖表的資料。"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","en-US":"The data used to color this visualization only contains undefined values.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。"}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","en-US":"The chart is not displayed because it contains only undefined values.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości niezdefiniowane.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含未定义的值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。"}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","en-US":"The chart is not displayed because it contains only negative or zero values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos o valores cero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen negatieve waarden of nulwaarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne lub zerowe.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa värden eller nollvärden","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值或零值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。"}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","en-US":"The chart is not displayed because it contains only negative values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表,因为它仅包含负值。","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值。"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"de-DE":"Dimension nicht gefunden","en-US":"Dimension not found","es-ES":"No se ha encontrado la dimensión","fr-FR":"Dimension introuvable","it-IT":"Dimensione non trovata","ja-JP":"軸が見つかりません","ko-KR":"차원을 찾지 못했습니다.","nl-NL":"Dimensie niet gevonden","pl-PL":"Wymiar nie został znaleziony","pt-BR":"Dimensão não encontrada","ru-RU":"Измерение не найдено","sv-SE":"Dimensionen hittades inte","tr-TR":"Boyut bulunamadı","zh-CN":"未找到维度","zh-TW":"找不到維度"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"de-DE":"Kennzahl nicht gefunden","en-US":"Measure not found","es-ES":"No se ha encontrado la medida","fr-FR":"Mesure introuvable","it-IT":"Misura non trovata","ja-JP":"メジャーが見つかりません","ko-KR":"측정값을 찾지 못했습니다.","nl-NL":"Meting niet gevonden","pl-PL":"Miara nie została znaleziona","pt-BR":"Medida não encontrada","ru-RU":"Мера не найдена","sv-SE":"Måttet hittades inte","tr-TR":"Hesaplama bulunamadı","zh-CN":"未找到度量","zh-TW":"找不到量值"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"de-DE":"Lasso-Auswahl deaktivieren","en-US":"Turn off lasso selection","es-ES":"Desactivar la selección de contorno","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","ru-RU":"Выключить выбор лассо","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"de-DE":"Lasso-Auswahl aktivieren","en-US":"Turn on lasso selection","es-ES":"Activar la selección de contorno","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","ru-RU":"Включить выбор лассо","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取"}},Tooltip_dimensions_cyclic:{id:"Tooltip.dimensions.cyclic",locale:{"de-DE":"Zyklische Dimension","en-US":"Cyclic dimension","es-ES":"Dimensión cíclica","fr-FR":"Dimension cyclique","it-IT":"Dimensione ciclica","ja-JP":"サイクリック軸","ko-KR":"순환 차원","nl-NL":"Cyclische dimensie","pl-PL":"Wymiar cykliczny","pt-BR":"Dimensão cíclica","ru-RU":"Циклическое измерение","sv-SE":"Cyklisk dimension","tr-TR":"Döngüsel boyut","zh-CN":"循环维度","zh-TW":"循環維度"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"de-DE":"Drilldown-Dimension","en-US":"Drill-down dimension","es-ES":"Dimensión jerárquica","fr-FR":"Descendre dans la hiérarchie de la dimension","it-IT":"Dimensione di drill-down","ja-JP":"軸のドリルダウン","ko-KR":"드릴다운 차원","nl-NL":"Drill-downdimensie","pl-PL":"Wymiar hierarchiczny","pt-BR":"Dimensão da hierarquia","ru-RU":"Детализированное измерение","sv-SE":"Hierarkisk dimension","tr-TR":"Detaya inme boyutu","zh-CN":"下钻维度","zh-TW":"向下探查維度"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"de-DE":"Auswahlen sind für diese Dimension gesperrt","en-US":"Selections on this dimension are locked","es-ES":"Las selecciones de esta dimensión están bloqueadas.","fr-FR":"Sélections verrouillées pour cette dimension","it-IT":"Le selezioni in questa dimensione sono bloccate","ja-JP":"この軸での選択はロックされています","ko-KR":"이 차원의 선택은 잠겨 있습니다.","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","pl-PL":"Wybory dotyczące tego wymiaru są zablokowane","pt-BR":"Seleções estão bloqueadas nesta dimensão","ru-RU":"Выборки для данного измерения заблокированы","sv-SE":"Urval i den här dimensionen är låsta","tr-TR":"Bu boyuttaki seçimler kilitli","zh-CN":"相关维度的选择已锁定","zh-TW":"已鎖定此維度上的選項"}},Visualizations_Descriptions_Bars:{id:"Visualizations.Descriptions.Bars",locale:{"de-DE":"Balken","en-US":"Bars","es-ES":"Barras","fr-FR":"Barres","it-IT":"Barre","ja-JP":"棒","ko-KR":"막대","nl-NL":"Staven","pl-PL":"Słupki","pt-BR":"Barras","ru-RU":"Полосы","sv-SE":"Staplar","tr-TR":"Çubuklar","zh-CN":"条形","zh-TW":"長條"}},Visualizations_Descriptions_HeightLine:{id:"Visualizations.Descriptions.HeightLine",locale:{"de-DE":"Linienhöhe","en-US":"Height of line","es-ES":"Altura de línea","fr-FR":"Hauteur de ligne","it-IT":"Altezza della linea","ja-JP":"線の高さ","ko-KR":"선 높이","nl-NL":"Hoogte van lijn","pl-PL":"Wysokość linii","pt-BR":"Altura da linha","ru-RU":"Высота линии","sv-SE":"Linjens höjd","tr-TR":"Çizgi yüksekliği","zh-CN":"线高度","zh-TW":"折線高度"}},Visualizations_Descriptions_LengthBars:{id:"Visualizations.Descriptions.LengthBars",locale:{"de-DE":"Balkenlänge","en-US":"Length of bars","es-ES":"Longitud de barras","fr-FR":"Longueur des barres","it-IT":"Lunghezza delle barre","ja-JP":"棒の長さ","ko-KR":"막대 길이","nl-NL":"Lengte van staven","pl-PL":"Długość słupków","pt-BR":"Comprimento das barras","ru-RU":"Длина полос","sv-SE":"Staplarnas längd","tr-TR":"Çubuk uzunluğu","zh-CN":"条形长度","zh-TW":"長條長度"}},properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"de-DE":"Freigeben","en-US":"Share","es-ES":"Compartir","fr-FR":"Partage","it-IT":"Condividi","ja-JP":"共有","ko-KR":"공유","nl-NL":"Delen","pl-PL":"Udostępnij","pt-BR":"Compartilhar","ru-RU":"Совместное использование","sv-SE":"Dela","tr-TR":"Paylaş","zh-CN":"共享","zh-TW":"共用"}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"de-DE":"Durchschnitt","en-US":"Average","es-ES":"Media","fr-FR":"Moyenne","it-IT":"Media","ja-JP":"平均値","ko-KR":"평균","nl-NL":"Gemiddelde","pl-PL":"Średnia","pt-BR":"Média","ru-RU":"Среднее","sv-SE":"Medel","tr-TR":"Ortalama","zh-CN":"平均值","zh-TW":"平均值"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"de-DE":"Exponentiell","en-US":"Exponential","es-ES":"Exponencial","fr-FR":"Exponentiel","it-IT":"Esponenziale","ja-JP":"指数","ko-KR":"지수","nl-NL":"Exponentieel","pl-PL":"Wykładnicze","pt-BR":"Exponencial","ru-RU":"Экспоненциальный","sv-SE":"Exponentiell","tr-TR":"Üstel","zh-CN":"指数","zh-TW":"指數"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"de-DE":"Linear","en-US":"Linear","es-ES":"Lineal","fr-FR":"Linéaire","it-IT":"Lineare","ja-JP":"線形","ko-KR":"선형","nl-NL":"Lineair","pl-PL":"Liniowe","pt-BR":"Linear","ru-RU":"Линейный","sv-SE":"Linjär","tr-TR":"Doğrusal","zh-CN":"线性","zh-TW":"線性"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"de-DE":"Logarithmisch","en-US":"Logarithmic","es-ES":"Logarítmica","fr-FR":"Logarithmique","it-IT":"Logaritmica","ja-JP":"対数","ko-KR":"로그","nl-NL":"Logaritmisch","pl-PL":"Logarytmiczne","pt-BR":"Logarítmico","ru-RU":"Логарифмический","sv-SE":"Logaritmisk","tr-TR":"Logaritmik","zh-CN":"对数","zh-TW":"對數"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"de-DE":"Polynom zweiten Grades","en-US":"Second degree polynomial","es-ES":"Polinómica de segundo grado","fr-FR":"Polynomial du 2ème degré","it-IT":"Polinomio di secondo grado","ja-JP":"2 番目の角度の多項式近似","ko-KR":"2차 다항식","nl-NL":"Tweedegraadspolynoom","pl-PL":"Wielomianowe drugiego stopnia","pt-BR":"Polinômio de segundo grau","ru-RU":"Полиномиальный второй степени","sv-SE":"Polynomial, andra graden","tr-TR":"İkinci derece polinom","zh-CN":"二次多项式","zh-TW":"第二度多項式"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"de-DE":"Polynom dritten Grades","en-US":"Third degree polynomial","es-ES":"Polinómica de tercer grado","fr-FR":"Polynomial du 3ème degré","it-IT":"Polinomio di terzo grado","ja-JP":"3 番目の角度の多項式近似","ko-KR":"3차 다항식","nl-NL":"Derdegraadspolynoom","pl-PL":"Wielomianowe trzeciego stopnia","pt-BR":"Polinômio de terceiro grau","ru-RU":"Полиномиальный третьей степени","sv-SE":"Polynomial, tredje graden","tr-TR":"Üçüncü derece polinom","zh-CN":"三次多项式","zh-TW":"第三度多項式"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"de-DE":"Polynom vierten Grades","en-US":"Fourth degree polynomial","es-ES":"Polinómica de cuarto grado","fr-FR":"Polynomial du 4ème degré","it-IT":"Polinomio di quarto grado","ja-JP":"4 番目の角度の多項式近似","ko-KR":"4차 다항식","nl-NL":"Vierdegraadspolynoom","pl-PL":"Wielomianowe czwartego stopnia","pt-BR":"Polinômio de quarto grau","ru-RU":"Полиномиальный четвертой степени","sv-SE":"Polynomial, fjärde graden","tr-TR":"Dördüncü derece polinom","zh-CN":"四次多项式","zh-TW":"第四度多項式"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"de-DE":"Potenz","en-US":"Power","es-ES":"Potencia","fr-FR":"Puissance","it-IT":"Potenza","ja-JP":"累乗","ko-KR":"거듭제곱","nl-NL":"Macht","pl-PL":"Potęgowe","pt-BR":"Potência","ru-RU":"Степенной","sv-SE":"Potens","tr-TR":"Üs","zh-CN":"幂","zh-TW":"乘冪"}}};const Fc="REJECTED",jc=()=>{},Vc=1e4,_c={MULTIPLIER:2,MINIMUM:20,MAXIMUM:200},Uc=50,$c=10,Wc=100;var Kc={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),i=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),o=Math.max(t.qTop,e.qArea.qTop),r=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,o-e.qArea.qTop),s=Math.min(o+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,r-e.qArea.qLeft),u=Math.min(r+i-e.qArea.qLeft,e.qArea.qWidth),c={qArea:{qHeight:s-a,qWidth:u-l,qTop:o,qLeft:r},qMatrix:[]};for(let t=a;t<s;t++)c.qMatrix.push(e.qMatrix[t].slice(l,u));return c},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const i=n.qTop-$c<=t.qTop,o=n.qLeft+n.qWidth+$c>=t.qLeft+t.qWidth,r=n.qTop+n.qHeight+$c>=t.qTop+t.qHeight,a=n.qLeft-$c<=t.qLeft;return i&&t.qTop>0||o&&t.qLeft+t.qWidth<e.width||r&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var Gc={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),r=Math.max(0,i-e.qArea.qTop),a=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-i-(a-r),l={qArea:{qHeight:a-r,qWidth:e.qArea.qWidth,qTop:i,qLeft:o},qData:[{...e.qData[0],qUp:i,qDown:s,qSubNodes:[]}]};for(let t=r;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const i=n.qTop-$c<=t.qTop,o=n.qTop+n.qHeight+$c>=t.qTop+t.qHeight;return i&&t.qTop>0||o&&t.qTop+t.qHeight<e.height}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeStackData",args:[e,[t]]})}};var Yc={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const Xc="pages";const Jc="discretePan",Zc=10;function Qc({chart:e,actions:t,componentKey:n,dockService:i,rtl:o,scroller:r}){return{type:"Pan",key:"discrete:pan",options:{event:Jc,pointers:1,threshold:Zc,enable(i,o){return this.started===Jc||!o||!(!t.scroll.enabled()||!r.enabled())&&e.componentsFromPoint({x:o.center.x,y:o.center.y}).some(e=>e.key===n)}},events:{[`${Jc}start`](e){e.preventDefault(),this.started=Jc;const t="horizontal"===i.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-Zc:Zc},[`${Jc}move`](e){e.preventDefault();const t="horizontal"===i.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&o?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,r.scroll(s)},[`${Jc}end`](e){e.preventDefault(),this.started=!1},[`${Jc}cancel`](e){e.preventDefault(),this.started=!1}}}}function ed({chart:e,componentKey:t,actions:n,scroller:i}){return function(o){if(!n.scroll.enabled()||!i.enabled())return;const[r]=e.componentsFromPoint({x:o.clientX,y:o.clientY}).filter(e=>e.key===t);if(!r)return;o.preventDefault();const a=Math.abs(o.deltaY)>Math.abs(o.deltaX)?o.deltaY:o.deltaX,s=Math.sign(-a)*Wc;i.scroll(s)}}function td({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(Vc/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const i=Math.min(t,Math.max(_c.MAXIMUM,n));return{width:e,height:Math.max(_c.MINIMUM,Math.min(n*_c.MULTIPLIER,i))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:i,height:o}=t({width:e.qWidth,height:e.qHeight}),r=o?Math.ceil((o-e.qHeight)/2):0,a=i?Math.ceil((i-e.qWidth)/2):0;return{qHeight:o?Math.min(o,n.height):e.qHeight,qWidth:i?Math.min(i,n.width):e.qWidth,qTop:o?Math.max(0,Math.min(e.qTop-r,n.height-o)):e.qTop,qLeft:i?Math.max(0,Math.min(e.qLeft-a,n.width-i)):e.qLeft}}}function nd(e){let t,n;const i=o=>{t=o;const{method:r,args:a}=t.request;e[r](...a).then(e=>{if(t.canceled||n)return t.reject(Fc),t=null,void(n&&(i(n),n=null));t.resolve(e[0]),t=null})},o=e=>new Promise((o,r)=>{const a={request:e,resolve:o,reject:r,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(Fc),n=e})(a):i(a)});return o.isProcessing=()=>!!t,o.hasQueued=()=>!!n,o.cancel=()=>{o.isProcessing()&&t.cancel(),o.hasQueued()&&(n.reject(Fc),n=null)},o}const id={command:{update:()=>{}}};var od={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:i}){const{pixel:o}=t,r=e.getDataPages()[0],a=o/i;return[a,n.inView>=n.inTotal?a+1:a+r.qArea.qWidth/n.inView]}};var rd={inTotal:function({layoutService:e}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const[t]=e.getDataPages();if(t)return t.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:i}){const o=void 0===i?4:i,r=Math.max(0,Math.floor(t)-o/2);return{qTop:r,qHeight:Math.min(e.meta.size.y-r,Math.max(0,Math.ceil(n+o))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:i}){const{pixel:o}=t,r=e.getDataPages()[0],a=i/n.inView,s=(o+r.qArea.qTop*a)/i;return[s,n.inView>=n.inTotal?s+1:s+r.qArea.qHeight/n.inView]}};function ad(e){const{groupSize:t,measureCount:n}=e.meta;return t??n}function sd(e,t){const n=[];for(let i=0;i<e.length;i++){const o=t(e[i]);-1===n.indexOf(o)&&n.push(o)}return n.length}function ld(e){return sd(e.qMatrix,e=>e[0].qElemNumber)-1}var ud={inTotal:function({layoutService:e}){const t=ad(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:i}){const o=ad(e),r=void 0===i?o:i,a=t/(o+1),s=Math.max(0,Math.floor((t-a-r/2)/o));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+r)/o+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:i}){const o=ad(e),r=e.getDataPages()[0],a=i/n.inView,{pixel:s}=t,l=ld(r),u=r.qArea.qHeight*o+l,c=(s+(r.qArea.qTop*o+r.qArea.qTop)*a)/i;return[c,n.inView>=n.inTotal?c+1:c+u/n.inView]}};const cd=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function dd(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return cd(e,n);const i=((e,t)=>{const n={successful:!0,count:0};let i=Math.abs(Math.floor(t));const o=[];for(let t=0;t<=i;t++){if(!e[t])return n.successful=!1,n;const r=e[t][0].qElemNumber;-1===o.indexOf(r)&&(o.push(r),i--)}return n.count=o.length-1,n})(t.qMatrix,n);return i.successful?i.count:cd(e,n)},area(t,n,i){if(0!==t.qArea.qTop)return cd(e,n);return sd(t.qMatrix.slice(0,i.qTop+1),e=>e[0].qElemNumber)-1}}}var md={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:i}){const o=dd(t).itemOffset(e(),n),r=Math.max(0,Math.floor(n-o));return{qTop:r,qHeight:Math.min(t.meta.size.y-r,Math.max(0,Math.ceil(i+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:i,viewSize:o,upperBound:r}){const a=t.getDataPages()[0],s=o/i.inView,{item:l,pixel:u}=n,c=dd(t).area(e(),l,a.qArea),d=ld(a),m=a.qArea.qHeight+d,h=u===r?(i.inView-m)*s/o:(u+(a.qArea.qTop+c)*s)/o;return[h,i.inView>=i.inTotal?h+1:h+m/i.inView]}};function hd({chart:e,rect:t,dockService:n,itemWidths:i,axisKey:o,renderer:r,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:u,maxDataRows:c}){const{DEFAULT:d,SQUEEZE:m,LABELLESS:h}=i[n.meta.chart.mode],f="horizontal"===n.meta.major.orientation,{axisDisplayMode:p="auto",maxVisibleItems:g=10,label:y}=s,v=f?t.width:t.height,b=v/l>=m;switch(p){case"max":return Math.min(l,c);case"custom":return Math.min(g,c);default:return u?v/h:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:i={},isGrouped:o,itemSize:r,label:a}){if(o||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=i;if(!s||!l)return!0;const{fontFamily:u,fontSize:c,tiltAngle:d}=s.settings.settings.labels,{height:m}=l({fontFamily:u,fontSize:c,text:"M"});if(!t)return m>r;const h=(90-d)*(Math.PI/180);return m>Math.cos(h)*r}({chart:e,isHorizontal:f,axisKey:o,renderer:r,isGrouped:a,itemSize:m,label:y})?v/d:l:v/d}}var fd="AVERAGE",pd="LINEAR",gd="POLYNOMIAL2",yd="POLYNOMIAL3",vd="POLYNOMIAL4",bd="EXPONENTIAL",xd="LOG",Sd="POWER";function Md({dimValue:e,value:t,qTrendLine:n}){const{qType:i,qCoeff:o}=n,r={x:e,y:o[2]*t**2+o[1]*t+o[0]};switch(i){case yd:return r.y+=o[3]*t**3,r;case vd:return r.y+=o[4]*t**4+o[3]*t**3,r;default:return r}}var qd={average:function({dimValue:e,qTrendLine:t}){return{x:e,y:t.qCoeff[0]}},linear:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]*t+n.qCoeff[0]}},polynomial2:Md,polynomial3:Md,polynomial4:Md,exponential:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:Math.exp(n.qCoeff[0]+t*n.qCoeff[1])}},log:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:n.qCoeff[1]+n.qCoeff[0]*Math.log(t)}},power:function({dimValue:e,value:t,qTrendLine:n}){return{x:e,y:10**(n.qCoeff[0]+n.qCoeff[1]*Math.log(t)*Math.LOG10E)}}};function Cd(e,t){const n=qd[t.qType.toLowerCase()],i=Math.max(1,e/500);let o=1/0,r=-1/0;for(let a=0;a<e;a+=i){const{y:e}=n({dimValue:null,value:a+1,qTrendLine:t});o=Math.min(e,o),r=Math.max(e,r)}return{min:o,max:r}}function wd(e){return qd[e.qType.toLowerCase()]}function Td(e,t){return e.meta.isContinuous?function(e,t){return{generate:(n,i,o)=>{const r=[],a=wd(n),s=t.get("zoom"),l=n.start??s.min,u=n.end??s.max,c=(u-l)/100,d=e.meta.isButterfly&&o>0;if(c>0){const e=e=>{const t=a({dimValue:e,value:e,qTrendLine:n});d&&(t.y=-t.y),t.layerId=i,t.measureIndex=o,t.dimValue=e,r.push(t)};let t=l;for(let n=l;n<=u;n+=c)e(n),t=n;t!==u&&e(u)}return r},calculate:(e,t)=>wd(e)({dimValue:t,value:t,qTrendLine:e}),findMinMax(e,t){const n=this.generate(t).map(({y:e})=>e);return{min:Math.min(...n),max:Math.max(...n)}}}}(e,t):e.meta.mode.K?function(e){return{generate:(t,n,i)=>{const o=[],r=e.getDataPages()[0],a=r.qData[0].qSubNodes,s=r.qArea.qTop,l=qd[t.qType.toLowerCase()];for(let e=0;e<a.length;e++){const r=a[e],u=l({dimValue:r.qElemNo,value:e+s+1,qTrendLine:t});u.layerId=n,u.measureIndex=i,u.dimValue=r.qText,o.push(u)}return o},findMinMax:Cd}}(e):function(e){return{generate:(t,n,i)=>{const o=[],r=e.getDataPages()[0],a=r.qMatrix,s=r.qArea.qTop,l=qd[t.qType.toLowerCase()],u=e.meta.isButterfly&&i>0;for(let e=0;e<a.length;e++){const r=a[e][0],c=e+s+1,d=l({dimValue:r.qElemNumber,value:c,qTrendLine:t});u&&(d.y=-d.y),d.layerId=n,d.measureIndex=i,d.dimValue=r.qText,o.push(d)}return o},calculate:(e,t,n)=>(0,qd[e.qType.toLowerCase()])({dimValue:n,value:t,qTrendLine:e}),findMinMax:Cd}}(e)}var kd={TYPES:{AVERAGE:"properties.trendlines.types.average",LINEAR:"properties.trendlines.types.linear",POLYNOMIAL2:"properties.trendlines.types.polynomial2",POLYNOMIAL3:"properties.trendlines.types.polynomial3",POLYNOMIAL4:"properties.trendlines.types.polynomial4",EXPONENTIAL:"properties.trendlines.types.exponential",LOG:"properties.trendlines.types.logarithmic",POWER:"properties.trendlines.types.power"},STYLE:{DASHED:"properties.trendlines.style.dashed"},TYPE:"properties.trendlines.type",HEADER:"properties.trendlines",ADD_BUTTON:"properties.trendlines.button.add"},Nd={color:"#f93f17",index:9};const{isDark:Dd}=ls,Ld={x:NaN,y:NaN,layerId:NaN,measureIndex:NaN},Ed=({layoutService:e,viewState:t,colorModel:n,chart:i,env:o,keys:{colorScale:r},isEnabled:a=()=>!1})=>{const{translator:s}=o,l=[Ld],u=[],c=[],d=Td(e,t);e.getLayoutValue("qHyperCube.qMeasureInfo",[]).forEach((e,t)=>{Array.isArray(e.qTrendLines)&&(u.push(...e.qTrendLines),c.push(...e.qTrendLines.map(()=>t)))});const h=m(e=>{const{style:t}=u[e]||{},o=n.settings();if(t.autoColor){if("measure"===o.mode){const t=c[e],n=i.scale(r)(t);return Dd(n)?function(e){const t=rs(e);return t.l<30?t.l+=15:t.l<50?t.l+=10:t.l+=5,t.toString()}(n):function(e){const t=rs(e);return t.l-=5,t.toString()}(n)}return n.resolveUIColor(Nd)}return t.paletteColor?n.resolveUIColor(t.paletteColor):"none"});return{query:{hasTrendLines:()=>!!u.length&&a(),getData:()=>l,getStroke:h,getLineDash:e=>{const{style:t}=u[e]||{};return t?.lineDash},getLineThickness:e=>{const{style:t}=u[e]||{};return t?.lineThickness??2},getLabel:e=>(u[e]||{}).label,getType:e=>{const{qType:t}=u[e]||{};return s.get(kd.TYPES[t])},getMinMax:()=>{let t=1/0,n=-1/0;return u.forEach(i=>{const o=d.findMinMax(e.meta.size.y,i);t=Math.min(o.min,t),n=Math.max(o.max,n)}),{min:t,max:n}},getCalculatedValue:(e,t,n)=>{const i=u[e];return d.calculate(i,t,n)}},command:{update:()=>{l.length=0,u.forEach((e,t)=>{const n=d.generate(e,t,c[t]);l.push(...n)})}}}};var Od={source:"trend",extract:{field:"x",props:{minor:{field:"y"},layer:{field:"layerId"},measureIndex:{field:"measureIndex"},dimValue:{field:"dimValue"}}}};const Ad=({meta:e})=>e.isContinuous?({scale:e,datum:t})=>e(t.value):e.isGroupedByMeasure?({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2:({scale:e,datum:t})=>e(t.value)+e.bandwidth()/2,Id=(e,{layoutService:t,trendLineModel:n,dockService:i,animationsEnabled:o})=>{if(!n.query.hasTrendLines())return[];const r=(({majorScale:e,minorScale:t},{trendLineModel:n,layoutService:i,dockService:o,animationsEnabled:r})=>{const a=Ad(i);return{key:"trend-lines",type:"line",layout:{dock:"center"},data:Od,settings:{connect:!0,orientation:o.meta.major.orientation,coordinates:{major:{scale:e,fn:a},minor:{scale:t},layerId:{ref:"layer"}},layers:{curve:"monotone",line:{strokeWidth:({datum:e})=>n.query.getLineThickness(e.layer.value),stroke:({datum:e})=>n.query.getStroke(e.layer.value),strokeDasharray:({datum:e})=>n.query.getLineDash(e.layer.value)}}},animations:{enabled:r,trackBy:bl.nonUpdatingNode.trackBy,compensateForLayoutChanges:bl.lines.compensateForLayoutChanges}}})(e,{trendLineModel:n,layoutService:t,dockService:i,animationsEnabled:o}),a=(({majorScale:e,minorScale:t,tooltipOverlay:n="trend-lines-tooltip-overlay"},{layoutService:i,dockService:o})=>{const r=Ad(i),a="horizontal"===o.meta.major.orientation,s={scale:e,fn:r},l={scale:t,ref:"minor"};return{key:n,type:"point",layout:{dock:"center"},data:Od,settings:{x:a?s:l,y:a?l:s,opacity:0,size:1,sizeLimits:{maxPx:8,minPx:8}}}})(e,{layoutService:t,dockService:i});return[r,a]};function Pd(e,t){const{getLabel:n,getType:i,getLineDash:o,getStroke:r}=t.query;return({node:t,resources:a})=>{const s={type:"icon",style:{stroke:r(t.data.layer.value),"min-width":"16px","vertical-align":"middle","stroke-dasharray":o(t.data.layer.value)}},l={content:[{content:n(t.data.layer.value),style:{"font-weight":"bold"}},{content:i(t.data.layer.value)}],style:{"min-width":"136px"}};return{title:t.data.dimValue.label,row:[s,l,{content:a.formatter(e.formatter)(t.data.minor.value)}]}}}function Rd(e,{h:t,style:n}){return e.map(e=>{const i={style:{direction:"string"==typeof e.content?ua.detectTextDirection(e.content):void 0,...n.cell||{},...e.style||{}},class:e.class};e.colspan&&(i.colspan=e.colspan);const o=function(e,t){return Array.isArray(t.content)?e("div",{style:{display:"flex","flex-direction":"column"}},t.content.map(t=>e("span",{style:t.style,direction:ua.detectTextDirection(t.content)},t.content))):"icon"===t.type?function(e){const t=e("line",{x1:"0px",y1:"16px",x2:"16px",y2:"0px","stroke-width":"3px"});return e("svg",{xlms:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16"},t)}(e):t.content}(t,e);return t("td",i,o)})}function zd(e,t){return({h:n,data:i,style:o})=>{const r=i[0].title,a=i.filter(e=>e.title===r),s=function(e,t){const n=e("td",{colspan:3,style:{"font-weight":"bold"},direction:ua.detectTextDirection(t)},t);return e("tr",{},n)}(n,r),l=[s];if(a.slice(0,2).forEach(e=>{l.push(n("tr",{},Rd(e.row,{h:n,style:o})))}),i.length>2){const o=i.length-2;l.push(...function(e,t,n,i){const o=t?t.get("Object.ChartTooltip.NMore",i):`+${i} more`,r=ua.detectTextDirection(o);return[e("tr",{},e("td",{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:3},"")),e("tr",{},e("td",{style:{"font-weight":"bold","text-align":n?"right":"left",direction:r},colspan:3},o))]}(n,e,t,o))}return l}}function Hd(e,{trendLineModel:t,translator:n},i={}){if(!t.query.hasTrendLines())return!1;const{rtl:o}=i,r=ra({key:e.tooltip,rtl:o});return ne(!0,r,{settings:{extract:Pd(e,t),content:zd(n,o),placement:"pointer",direction:i.rtl?"rtl":"ltr"}})}function Bd(e,t){const n=t.element.getBoundingClientRect();return{x:(e.center?e.center.x:e.clientX)-n.left,y:(e.center?e.center.y:e.clientY)-n.top}}function Fd(e,{chart:t,viewState:n,trendLineModel:i,layoutService:o,rtl:r}){const{isContinuous:a}=o.meta;let s={components:[{key:e.tooltipOverlay}],propagation:"stop"},l=e=>{const n=Bd(e,t);return t.shapesAt(n,s)};if(a){const{getCalculatedValue:o}=i.query;s={components:[{key:"trend-lines"}],propagation:"stop"},l=(i,a)=>{const l=Bd(i,t),u=t.shapesAt({cx:(c=l).x,cy:c.y,r:3},s);var c;if(u.length){const i=function(e,t,n,i){let o=(e.x-t.rect.computed.x)/t.rect.computed.width;o=i?1-o:o;const{min:r,max:a}=n.get("zoom");return r+(a-r)*o}(l,a,n,r),s=t.scale(e.majorInnerScale),c=(s?.formatter?s.formatter():t.formatter({data:{fields:["qDimensionInfo/0"]}}))(i);u.forEach(e=>{e.data.dimValue.value=i,e.data.dimValue.label=c,e.data.minor.value=o(e.data.layer.value,i).y})}return u}}return n=>{const i=t.component(e.tooltip);if(i&&(n=>t.componentsFromPoint({x:n.center?n.center.x:n.clientX,y:n.center?n.center.y:n.clientY}).some(t=>t.key===e.tooltipOverlay))(n)){const e=l(n,i);return e.length?(i.emit("show",n,{nodes:e}),!0):(i.emit("hide"),!1)}return!1}}const jd=e=>{e.style.dashed?e.style.lineDash="8, 4":e.style.lineDash=""},Vd=e=>{jd(e),e.qMultiDimMode="Sum",e.qXColIx=0};function _d(e={}){const{translator:t,events:n={onGlobalChange:()=>{}},allowStackedByDimension:i=!1}=e;return{show:(e,t,{layout:n})=>!Yr.dimensionless(n)&&!Yr.groupedByDimension(n)&&(i||!Yr.stackedByDimension(n)),type:"array",ref:"qTrendLines",titleTranslation:kd.HEADER,itemTitleRef:e=>{const n=typeof e.label;return"string"===n&&e.label?e.label:"object"===n?e.label.qStringExpression?e.label.qStringExpression.qExpr:e.label.qValueExpression.qExpr:t.get(kd.TYPES[e.qType])},max:8,allowAdd:!0,allowRemove:!0,allowMove:!1,addTranslation:kd.ADD_BUTTON,add:Vd,globalChange:e=>{const t=a(e,"qHyperCubeDef.qMeasures",[]).reduce((e,t)=>(Array.isArray(t.qTrendLines)&&e.push(...t.qTrendLines),e),[]),i=(e=>!a(e,"dimensionAxis.continuousAuto",!1)&&e.preferContinuousAxis)(e)?"Possible":"Never";t.forEach(e=>{e.qContinuousXAxis=i}),n.onGlobalChange(e,t)},items:{label:{ref:"label",type:"string",expression:"optional",translation:"Common.Label",defaultValue:""},type:{ref:"qType",type:"string",component:"dropdown",translation:kd.TYPE,options:[{value:fd,translation:kd.TYPES.AVERAGE},{value:pd,translation:kd.TYPES.LINEAR},{value:gd,translation:kd.TYPES.POLYNOMIAL2},{value:yd,translation:kd.TYPES.POLYNOMIAL3},{value:vd,translation:kd.TYPES.POLYNOMIAL4},{value:bd,translation:kd.TYPES.EXPONENTIAL},{value:xd,translation:kd.TYPES.LOG},{value:Sd,translation:kd.TYPES.POWER}],defaultValue:fd},autoColor:{ref:"style.autoColor",type:"boolean",translation:"properties.colors",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},paletteColor:{ref:"style.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:Nd,show:e=>!e.style.autoColor},dashed:{ref:"style.dashed",translation:kd.STYLE.DASHED,type:"boolean",defaultValue:!0,change:jd}}}}var Ud,$d;var Wd=function(){if($d)return Ud;$d=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},Ud=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,i,o,r,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(i=this._events[t],e.isUndefined(i))return!1;if(e.isFunction(i))switch(arguments.length){case 1:i.call(this);break;case 2:i.call(this,arguments[1]);break;case 3:i.call(this,arguments[1],arguments[2]);break;default:for(o=arguments.length,r=new Array(o-1),a=1;a<o;a++)r[a-1]=arguments[a];i.apply(this,r)}else if(e.isObject(i)){for(o=arguments.length,r=new Array(o-1),a=1;a<o;a++)r[a-1]=arguments[a];for(o=(s=i.slice()).length,a=0;a<o;a++)s[a].apply(this,r)}return!0},t.prototype.addListener=function(n,i){var o;if(!e.isFunction(i))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",n,e.isFunction(i.listener)?i.listener:i),this._events[n]?e.isObject(this._events[n])?this._events[n].push(i):this._events[n]=[this._events[n],i]:this._events[n]=i,e.isObject(this._events[n])&&!this._events[n].warned)&&((o=e.isUndefined(this._maxListeners)?t.defaultMaxListeners:this._maxListeners)&&o>0&&this._events[n].length>o&&(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 i=!1;function o(){this.removeListener(t,o),i||(i=!0,n.apply(this,arguments))}return o.listener=n,this.on(t,o),this},t.prototype.removeListener=function(t,n){var i,o,r,a;if(!e.isFunction(n))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=(i=this._events[t]).length,o=-1,i===n||e.isFunction(i.listener)&&i.listener===n)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,n);else if(e.isObject(i)){for(a=r;a-- >0;)if(i[a]===n||i[a].listener&&i[a].listener===n){o=a;break}if(o<0)return this;1===i.length?(i.length=0,delete this._events[t]):i.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,n)}return this},t.prototype.removeAllListeners=function(t){var n,i;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(i=this._events[t],e.isFunction(i))this.removeListener(t,i);else if(Array.isArray(i))for(;i.length;)this.removeListener(t,i[i.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},Ud}(),Kd=Z(Wd);const Gd={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"}}]};const Yd=e=>(Object.keys(Kd.prototype).forEach(t=>{e[t]=Kd.prototype[t]}),Kd.init(e),e);var Xd={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}},Jd={SCALE:{MAIN:{MINOR:"minor",MAJOR:"major",MAJOR_INNER:"majorInner",COLOR:"fill"},REDUCED:{MINOR:"miniMinor",MAJOR:"miniMajor",COLOR:"reducedFill"}},COMPONENT:{BAR:"bar",MINI_BAR:"mini-marker",GHOST_BAR_OOB:"ghost-bar",BAR_AXIS:"bar-axis",GROUP_AXIS:"group-axis",BAR_OOB_MAX:"bar-oob-max",BAR_OOB_MIN:"bar-oob-min",STACK_TOTAL_BAR:"stack-total-bar",BASE_TOOLTIP:"tooltip-qcm",SPACE:"space",LEGEND_CAT_TOOLTIP:"legend-cat-tooltip",LEGEND_COLOR_CAT:"legend-color-cat",MEASURE_REF_LINE:"mes-ref-line",DIMENSION_REF_LINE:"dim-ref-line",MEASURE_REF_LINE_LABEL:"mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label",TREND_LINES_TOOLTIP:"trend-lines-tooltip",TREND_LINES_TOOLTIP_OVERLAY:"trend-lines-tooltip-overlay"},COLLECTION:{MAIN:"main-collection",MINI:"mini-collection",MINI_STACK:"mini-stack-collection",MINI_CONTINUOUS:"mini-continuous-collection",STACK_TOTAL:"stack-total-collection"},FORMATTER:{MINOR:"bar",COLOR:"fill"}};const Zd=({layout:e})=>{const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==Nc),n=e?.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==Nc);return 1===(t?.length??0)&&2===(n?.length??0)},Qd=e=>({layout:e})=>{const t=Vr.canBeContinuous(e),n=Yr.continuous({layout:e}),i=Yr.dimensionless(e),o=Zd({layout:e})&&"butterfly"===e?.barGrouping?.grouping;return{canBeContinuous:t,isDiscrete:!n,isContinuous:n,isTime:Vr.isTime(n,e),isDimensionless:i,isSimple:Yr.simple(e),isGrouped:!o&&Yr.grouped(e),isGroupedByMeasure:!o&&Yr.groupedByMeasure(e),isGroupedByDimension:!o&&Yr.groupedByDimension(e),isStacked:!o&&Yr.stacked(e),isStackedByDimension:!o&&Yr.stackedByDimension(e),isStackedByMeasure:!o&&Yr.stackedByMeasure(e),isSnapshot:Yr.snapshot(e),isButterfly:o}};function em({clearMinor:e,clearLegend:t,clearDiscrete:n,clearContinuous:i,selectionInfo:o}){t({componentName:"legendRangeBrush"}),e({eventName:"measureRange",componentName:"measureRangeBrush"}),n({eventName:"discreteRange",componentName:"discreteRangeBrush",brushName:!1}),"tap"!==o.event&&i({componentName:"continuousRangeBrush",brushName:!1})}function tm({chart:e,actions:t,selections:n}){const i=e.scale(Jd.SCALE.MAIN.MAJOR);return h({chart:e,actions:t,selections:n,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:i,selectionActions:{reset(){e.brushSelectionIncludeMax=void 0,t.lasso.active()&&t.lasso.action(!1)},clear:em},custom:{getActions:()=>t},setBrushAliases({defaultFunc:e,brush:t}){e(),t.addKeyAlias("miniCube/qDimensionInfo/0","qHyperCube/qDimensionInfo/0"),t.addKeyAlias("miniCube/qDimensionInfo/1","qHyperCube/qDimensionInfo/1")}}})}const nm=e=>{const t=e.qDimensionInfo.length;for(let n=0;n<t;n++){const i=e.qDimensionInfo[n];if(!(i.qLocked||i.qCardinalities.qHypercubeCardinal<=1&&n<t-1))return n}};function im({layout:e,defaultAuto:t}){return e.qHyperCube.qDimensionInfo.length>1?{mode:"byDimension",useDimColVal:!0,useBaseColors:"dimension",byDimDef:{activeDimensionIndex:1}}:e.qHyperCube.qMeasureInfo.length>1?{mode:"primary",useBaseColors:"measure",paletteColor:null}:t(e)}function om({app:e,model:t,translator:n,picasso:i,localeInfo:o,theme:r,continuousDataModel:a,layoutService:s,legendLayoutService:l,reducedDataModel:u}){const{isContinuous:c,isStacked:d}=s.meta,m={main:void 0,mini:{getScales:()=>({}),getColor:()=>e=>e,getDatumProps:()=>({}),getAuxiliarySettings:()=>{}}};return{initialize:()=>{const h=[],{isReduced:p}=u.model().mode,g=c||p||d,y=!c&&(p||d)&&l?l.getHyperCube():void 0,v=y?"legendCube":void 0;return m.main=f({app:e,model:t,translator:n,picasso:i,layoutService:s,config:{localeInfo:o,auto:im,key:Jd.SCALE.MAIN.COLOR},createConfig:()=>({hc:g?y||s.getHyperCube():u.model().cube,source:g?v:"miniCube",theme:r})}),h.push(m.main.initialize()),c&&(m.mini=f({app:e,model:t,translator:n,picasso:i,layoutService:s,config:{localeInfo:o,auto:im,key:Jd.SCALE.REDUCED.COLOR},createConfig:()=>({layout:a.getInitialLayout(),hc:a.getInitialCube(),source:"miniCube",theme:r})}),h.push(m.mini.initialize())),Promise.all(h)},getMain:()=>m.main,getMini:()=>m.mini}}function rm({layoutService:e,node:t}){const{isGroupedByDimension:n,isStackedByDimension:i,isDimensionless:o}=e.meta;return n?`${t.data.label}, ${t.data.group.label}`:i?`${t.data.label}, ${t.data.stack.label}`:o?void 0:t.data.label}function am({chart:e,actions:t,translator:n,rtl:i,viewState:o,viewModel:r,layoutService:a,dockService:s,colorService:l,themeService:u,trendLineModel:c,custom:d}){const{isTwoDimensional:m,isStacked:h,isGroupedByDimension:f,isGroupedByMeasure:g,isStackedByDimension:y,isStackedByMeasure:v}=a.meta,{fontFamily:b}=u.getStyles(),x=function({layoutService:e,dockService:t}){const{BAR_AXIS:n,BAR_OOB_MIN:i,BAR_OOB_MAX:o,GROUP_AXIS:r}=Jd.COMPONENT,{isGrouped:a,isGroupedByDimension:s}=e.meta,{orientation:l}=t.meta.chart,u="vertical"===l;return[({chart:e,hovered:t,meta:l,collected:c,collectedBounds:d})=>{const[m]=t,{triggerer:h}=l;if(h===i||h===o)return{key:m.key,bounds:m.bounds};if(u&&(h===n||h===r)){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===i||e.key===o)&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:(e.key===i||e.key===o)&&e.data.value===m.data.value),r=e.findShapes("path").find(e=>s&&h===n?e.key===o&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:e.key===o&&e.data.value===m.data.value);if(t)return a?{key:r?r.key:Jd.COMPONENT.BAR,bounds:d}:{key:t.key,bounds:t.bounds}}if(!u&&!c.some(e=>e.bounds.height+e.bounds.width!==0)){const t=e.findShapes("path").find(e=>s&&h===n?(e.key===i||e.key===o)&&e.data.value===m.data.value&&e.data.group.value===m.data.group.value:(e.key===i||e.key===o)&&e.data.value===m.data.value);if(t)return{key:t.key,bounds:t.bounds}}return!1},"collectible"]}({layoutService:a,dockService:s}),S=Fd({majorInnerScale:Jd.SCALE.MAIN.MAJOR_INNER,tooltip:Jd.COMPONENT.TREND_LINES_TOOLTIP,tooltipOverlay:Jd.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{chart:e,viewState:o,trendLineModel:c,layoutService:a,rtl:i}),M=({collected:t,triggerer:n})=>{if(h){t.splice(0,t.length);e.findShapes("container").filter(e=>e.key===Jd.COMPONENT.BAR&&e.data?.stack.value===n.data.value).filter(e=>v?e.data?.value===n.data.value:e.data?.stack.value===n.data.value).forEach(e=>{if(e.children.length){const[n]=e.children;n.key=e.key,t.push(n)}else t.push(e)})}};return p({chart:e,translator:n,config:{rtl:i,enable:()=>t.tooltip.enabled(),getColorSettings:()=>l.getMain().getSettings(),style:{fontFamily:b},main:{key:Jd.COMPONENT.BASE_TOOLTIP,suppress:({event:e})=>S(e),getGroupByValue:({data:e})=>e.value,collectibles:[{key:Jd.COMPONENT.BAR,type:"bar",major:({data:e,meta:t})=>g?t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===Jd.COMPONENT.BAR_AXIS||t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX?[e.value,e.group.value]:e.group.value:y?e.stack.value:e.value},{key:`${Jd.COMPONENT.GHOST_BAR_OOB}-min`,type:"bar",if:()=>!v&&!y,major:({data:e,meta:t})=>g?t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX||t.triggerer===Jd.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value},{key:`${Jd.COMPONENT.GHOST_BAR_OOB}-max`,type:"bar",if:()=>!v&&!y,major:({data:e,meta:t})=>g?t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX?[e.value,e.measureIndex.value]:e.value:f?t.triggerer===Jd.COMPONENT.BAR_OOB_MIN||t.triggerer===Jd.COMPONENT.BAR_OOB_MAX||t.triggerer===Jd.COMPONENT.BAR_AXIS?[e.value,e.group.value]:e.group.value:e.value}],triggers:[{keys:[Jd.COMPONENT.BAR],collect:{from:"single"},placement:x},{keys:[Jd.COMPONENT.BAR_AXIS],collect:{from:"dimension",by:({data:e})=>f?[e.value,e.group.value]:e.value,after:M},placement:x},{keys:[Jd.COMPONENT.BAR_OOB_MIN,Jd.COMPONENT.BAR_OOB_MAX],collect:{from:"dimension",by:({data:e})=>g?[e.value,e.measureIndex.value]:f?[e.value,e.group.value]:e.value,after:M},placement:x},{keys:[Jd.COMPONENT.GROUP_AXIS],collect:{from:"dimension",by:({data:e})=>e.group.value},placement:x}],layout:{grouping:m,single:()=>!(!d.isEnabled()||!d.hasImages())||d.chart.isEnabled()},section:({h:t,nodes:n,dataset:i,formatter:o,create:s,util:l})=>{const[u]=n,{title:c,description:m,measures:h}=d.isEnabled()?d.getAttributes({dataset:i,nodes:[u]}):{},f=[];c&&f.push(s.text({value:c,style:{bold:!0},survive:{visibility:!0},visibility:{count:!1}})),m&&f.push(s.text({value:m,survive:{visibility:!0},visibility:{count:!1}}));const p=d.hideBasic();if(p&&!h.length&&(c||m)||f.push(s.text({value:rm({layoutService:a,node:u}),style:{bold:!0}})),!p){const t=void 0!==u.data.fill?.value?e.scale(Jd.SCALE.MAIN.COLOR)(u.data.fill.value):void 0;f.push(s.color({nodes:n,property:Jd.SCALE.MAIN.COLOR,fillColor:t})),f.push(...n.map(e=>function({viewModel:e,layoutService:t,formatter:n,create:i,util:o,node:r}){const{isStacked:a,isStackedByDimension:s}=t.meta;if(a){const t=n(Jd.FORMATTER.MINOR),{segment:a}=r.data,l=s&&t?t(a.value):a.label;return i.measure({label:o.dataset.title(r.data.source.key,e.fields.minor[s?0:r.data.measureIndex.value]),value:!0===r.data.null?.value||"NaN"===l?"-":l})}const{data:l}=r,{end:u}=l,{key:c,field:d}=u.source;return i.measure({label:o.dataset.title(c,d),value:u.label})}({viewModel:r,layoutService:a,formatter:o,create:s,util:l,node:e})))}h&&f.push(...h.map(e=>s.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0,visibility:!0},visibility:{count:!1}}))),d.chart.isEnabled()&&(d.chart.hasLimitation()?(d.chart.destroy(),f.push(s.raw({value:d.chart.createLimitationRow(),survive:{visibility:!0},visibility:{count:!1}}))):f.push(s.raw({value:d.chart.createContainer({h:t}),survive:{visibility:!0},visibility:{count:!1}})));const{customTooltipImages:g}=u.data;return d.isEnabled()&&g&&f.push(...g.map(e=>s.raw({value:d.createImageRow({value:e,h:t}),survive:{visibility:!0},visibility:{count:!1}}))),f.filter(Boolean)},sections:({nodes:t,formatter:i,meta:o,create:r,sections:a})=>{if(!h||o.triggerer!==Jd.COMPONENT.BAR_AXIS)return;const[s]=t,[l]=e.findShapes("container").filter(e=>e.key===Jd.COMPONENT.STACK_TOTAL_BAR&&e.data&&e.data.value===s.data.stack.value);if(!l)return;const u=i(Jd.FORMATTER.MINOR),c=[];if(l.data.sumOfPositives.value>0){const{value:e}=l.data.sumOfPositives;c.push(r.measure({label:n?n.get("Object.ChartTooltip.sumOfPositives"):"Sum of positives",value:u?u(e):e,visibility:{force:!0}}))}if(l.data.sumOfNegatives.value<0){const{value:e}=l.data.sumOfNegatives;c.push(r.measure({label:n?n.get("Object.ChartTooltip.sumOfNegatives"):"Sum of negatives",value:u?u(e):e,visibility:{force:!0}}))}a.unshift(r.section({content:[r.text({value:l.data.label,style:{bold:!0},visibility:{force:!0}}),...c]}),r.divider({visibility:{force:!0}}))},events:{tooltip:{beforeShow:({collectNodes:e})=>d.isEnabled()&&d.hasImages()?d.addImages({nodes:e()}):Promise.resolve(),afterShow:({expando:e,nodes:t})=>{d.chart.isEnabled()&&!d.chart.hasLimitation()&&d.chart.show({nodes:t,properties:e.get("properties")})}},interaction:{mouseleave:()=>{d.chart.isEnabled()&&d.chart.hasAlternateState()&&d.chart.hide()}}}},legend:{keys:{tooltip:Jd.COMPONENT.LEGEND_CAT_TOOLTIP,component:Jd.COMPONENT.LEGEND_COLOR_CAT}}}})}const sm={getMaxGlyphCount(e,t){const{qDimensionInfo:n}=e,{qApprMaxGlyphCount:i}=n[t];return i},getDimensionSize(e){const t=e?.qCardinalities?.qHypercubeCardinal,{qLocked:n=0,qOption:i=0,qSelected:o=0}=e?.qStateCounts||{};return[void 0,0].includes(t)?n+i+o:t}};function lm({layoutService:e}){return g({config:{args:{layoutService:e},disclaimers:{NoDataExist:!0,OnlyNanDataMeasure:!0,OnlyNanDataDimensionContinuous:!0,LimitedData:{condition:()=>{const{isContinuous:t,isTwoDimensional:n}=e.meta;if(!t||!n)return!1;const i=e.getLayout().qHyperCube.qDimensionInfo[1];return sm.getDimensionSize(i)>Vr.maxNumberOfLines}},OnlyNegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.every(e=>{const{qMin:t,qMax:n}=e;return t<0&&n<0})}return!1},alignment:"center"},NegativeValues:{condition:()=>{if(e.meta.isButterfly){const{qMeasureInfo:t}=e.getHyperCube();return t.some(e=>{const{qMin:t}=e;return t<0})}return!1}}}}})}function um(e){return e.qIsOtherCell||-3===e.qElemNumber||-3===e.qElemNo}function cm(e){return e.some(um)}function dm(e,t){let n=NaN,i=NaN;return e.forEach(e=>{cm(e)||e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(n=Number.isNaN(n)?e.qNum:Math.min(e.qNum,n),i=Number.isNaN(i)?e.qNum:Math.max(e.qNum,i))})}),{min:n,max:i}}function mm(e){let t=NaN,n=NaN;if(!e.getLayoutValue("measureAxis.autoMinMax",!1)){const i=e.getLayoutValue("measureAxis.minMax");e.meta.isButterfly||"min"!==i&&"minMax"!==i||(t=+e.getLayoutValue("measureAxis.min")),"max"!==i&&"minMax"!==i||(n=+e.getLayoutValue("measureAxis.max"),e.meta.isButterfly&&(t=-n))}return{min:t,max:n,isExplicitMin:!Number.isNaN(t),isExplicitMax:!Number.isNaN(n)}}function hm(e,t){let n=NaN,i=NaN;return e.forEach(e=>{if(!cm(e)){let o=0,r=0;e.slice(-t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?r+=e.qNum:o+=e.qNum)}),n=Number.isNaN(n)?o:Math.min(o,n),i=Number.isNaN(i)?r:Math.max(r,i)}}),{min:n,max:i}}function fm(e,t){const n={};e.forEach(e=>{if(!cm(e)){const i=e[0].qElemNumber;n[i]=n[i]?n[i]:{min:0,max:0,cId:i},e.slice(t).forEach(e=>{"NaN"!==e.qNum&&(e.qNum>=0?n[i].max+=e.qNum:n[i].min+=e.qNum)})}});let i=NaN,o=NaN;return Object.keys(n).forEach(e=>{i=Number.isNaN(i)?n[e].min:Math.min(n[e].min,i),o=Number.isNaN(o)?n[e].max:Math.max(n[e].max,o)}),{min:i,max:o}}function pm(e){return"number"==typeof e&&!Number.isNaN(e)}function gm(e){const{meta:t}=e,n=e.getHyperCubeValue("qMeasureInfo");return t.isButterfly?{min:Math.min(0,pm(n[1].qMax)?-n[1].qMax:0),max:Math.max(0,pm(n[0].qMax)?n[0].qMax:0)}:{min:Math.min(...n.filter(e=>pm(e.qMin)).map(e=>e.qMin)),max:Math.max(...n.filter(e=>pm(e.qMax)).map(e=>e.qMax))}}const{isNumber:ym}=Ds;function vm(e,t,n){for(let n=e.length-1;n>-1;n--)if(t(e[n]))return e[n];return n}function bm(e){return!Number.isNaN(+e.qNum)}function xm(e){return e.qNum}function Sm(e){return!Number.isNaN(+e.qNum)}function Mm(e){return e.qNum}function qm(e,t){return e.push(...t),e}const{getValueWithOffset:Cm,isNumber:wm}=Ds,Tm=5,km=.2;function Nm(e,t){return Math.abs(e/t)<Tm||0===t}function Dm({layoutService:e,trendLineModel:t},n={}){const{stackedByMeasureExtractor:i=hm,stackedByDimensionExtractor:o=fm,straightExtractor:r=dm,measureInfoExtractor:s=gm,explicitExtractor:l=mm}=n,{meta:u}=e;return{extract({qDataPages:e,qStackedDataPages:n,others:i,count:o}){let r,a;if(Array.isArray(n)?({min:r,max:a}=this.extractFromStacked(n)):({min:r,max:a}=this.extractFromStraight(e,o)),t.query.hasTrendLines()){const{min:e,max:n}=t.query.getMinMax();r=Number.isFinite(e)?Math.min(r,e):r,a=Number.isFinite(n)?Math.max(a,n):a}const{min:s,max:l}=this.extractOthers(i),u=this.extractExplicit(),c=[0,r,a].filter(e=>wm(e));let d=Math.min(...c),m=Math.max(...c);d=Nm(s,d)?Math.min(d,s):d,m=Nm(l,m)?Math.max(m,l):m;const h=[u.explicitMin,u.explicitMax,d,m].filter(e=>wm(e));return r=Number.isNaN(u.explicitMin)?Math.min(...h):u.explicitMin,a=Number.isNaN(u.explicitMax)?Math.max(...h):u.explicitMax,r===a&&(Number.isNaN(u.explicitMin)?r=Cm(r,-km):Number.isNaN(u.explicitMax)&&(a=Cm(a,km))),{min:r,max:a,implicitMin:d,implicitMax:m,otherMin:s,otherMax:l,hasOtherMin:s<r,hasOtherMax:l>a,...u}},extractExplicit(){const{min:t,max:n,isExplicitMin:i,isExplicitMax:o}=l(e);return{hasExplicitMinMax:i||o,hasExplicitMin:i,hasExplicitMax:o,explicitMin:t,explicitMax:n}},extractFromStacked(e){const t=e.length?e[0].qData:[];return(n=t).length?{min:Math.min(...n[0].qSubNodes.filter(e=>ym(e.qMinNeg)).map(e=>e.qMinNeg)),max:Math.max(...n[0].qSubNodes.filter(e=>ym(e.qMaxPos)).map(e=>e.qMaxPos))}:{min:0,max:0};var n},extractFromStraight(t,n){const a=t.length?t[0].qMatrix:[];return u.isStackedByMeasure?i(a,n):u.isStackedByDimension?o(a,n):e.getHyperCubeValue("qHasOtherValues")?r(a,n):s(e)},extractOthers:e=>u.isStackedByDimension?function(e){const t=vm(a(e,"0.qData.0.qSubNodes",[]),um,{qMaxPos:0,qMinNeg:0});return{min:t.qMinNeg,max:t.qMaxPos}}(e):u.isGroupedByDimension?function(e){const t=a(e,"0.qMatrix",[]).filter(cm).reduce(qm,[]).filter(Sm).map(Mm);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e):function(e){const t=vm(a(e,"0.qMatrix",[]),cm,[]).filter(bm).map(xm);return{min:Math.min(0,...t),max:Math.max(0,...t)}}(e)}}function Lm(e){const t=function({reducedDataModel:e,layoutService:t,continuousDataModel:n}){const{meta:i,getHyperCubeValue:o}=t,r=e=>!e.length&&i.mode.K,a=e=>{const t=o("qStackedDataPages",[]);return{qStackedDataPages:t,others:e?t:[]}};return{resolve(){const t=o("qMeasureInfo").length,s=o("qDimensionInfo").length,l=o("qHasOtherValues");if(!i.isStacked&&!l)return Promise.resolve({qDataPages:[{}],count:t});if(i.isContinuous){const e=i.isStackedByDimension?s:t;return n.fetchMinMaxData().then(t=>({qDataPages:t,count:e}))}const u=i.isStackedByDimension?1:t;return e.fetchMinMaxData().then(e=>{if(r(e))return a(l);let t=[];return l&&(t=i.mode.K?o("qStackedDataPages",[]):o("qDataPages",[])),{qDataPages:e,count:u,others:t}})}}}(e),n=Dm(e);return t.resolve().then(e=>n.extract(e))}const Em="lasso",Om=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:i},o)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:i,options:{event:Em,enable(e,n){if(this.started===Em||!n)return!0;if(!o.actions.select.enabled()||!o.actions.lasso.enabled()||!o.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>e.key===t).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==Em&&(o.actions.select.emit("start",Em),this.chart.component(e).emit("lassoStart",t),this.started=Em)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),o.actions.select.emit("end",Em),"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});const Am=({targets:e,requireFailure:t,recognizeWith:n,components:i,eventName:o="tap"},r)=>{let a;const s=r.customTooltipModel?r.customTooltipModel.utils:void 0,l=s?r.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:o,interval:10,pointers:1,enable(t,n){return!n||!(!r.actions.select.enabled()&&!r.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(t=>-1!==e.indexOf(t.key)),a.length>0)}},events:{[o](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let i,o;return e.center?(({x:i}=e.center),({y:o}=e.center)):(i=e.clientX,o=e.clientY),{x:i-n.left,y:o-n.top}}(t,this.chart),u=r.hitRadius?r.hitRadius(a):0,c=u>0?{cx:n.x,cy:n.y,r:u}:n,d=r.shapesAt?r.shapesAt(c):this.chart.shapesAt(c,{components:e.map(e=>({key:e,propagation:"stop"})),propagation:"stop"}),m=this.chart.component("tooltip"),h="mouse"!==t.pointerType&&m&&m.show;if(!r.isLocked(a)&&!r.tooltipOnly&&r.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some(e=>"legend-cat"===e.type);if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,r.actions.select.brushSelectionIncludeMax=!1,r.actions.select.emit("start",o,e)),d.length&&i){this.chart.brushSelectionIncludeMax=!1,r.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof i?i(t,d):i;this.chart.brushFromShapes(d,{components:e}),r.actions.select.emit("end",o),(({largeDataService:e,chart:t})=>{(e?.meta||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:r.largeDataService,chart:this.chart})}}if(m&&r.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=r;if(e?.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,m,{nodes:n,opts:r,customTooltipModel:e})}else m.emit("show",t,{nodes:d})}else h&&m.emit("hide")}}}};const Im=({key:e,requireFailure:t,recognizeWith:n,eventName:i="tap"},o)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${i}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!o.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${i}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const Pm=({eventName:e,key:t,fillTargets:n=[],requireFailure:i,recognizeWith:o},r,a)=>({key:`event:${t}`,type:"Pan",requireFailure:i,recognizeWith:o,options:{event:e,enable(i,o){if(this.started===e||!o)return!0;if(!r.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:o.center.x,y:o.center.y}).filter(e=>-1!==n.indexOf(e.key)),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(o,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,r.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),r.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof r.updateOnMove&&r.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,r.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),r.actions.select.emit("end",e),this.started=!1,"function"==typeof r.updateOnEnd&&r.updateOnEnd()}}});function Rm(e,t){const n=function(e){const{key:t,targets:n,fillTargets:i,targetSelector:o,targetFillSelector:r,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:u=!1,multiple:c=!1,toLabel:d,onEdited:m}=e;return{key:t,type:"brush-range",layout:{dock:n.map(e=>`@${e}`).join(",")},on:m?{bubbleEnd(){m()}}:{},settings:{brush:u?{context:"selection",observe:!0}:"selection",scale:s,multiple:c,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:i,selector:o,fillSelector:r,fill:"rgba(82,204,82,0.2)"}}}}(e),i=Pm(e,t,"range");return{interactions:[e.onEdited?Im(e,t):null,i].filter(Boolean),components:[n]}}const zm={refLines:{minimumLayoutMode:"SPARK"},measureAxisTitle:{minimumLayoutMode:"XSMALL"},dimensionAxisTitle:{minimumLayoutMode:"XSMALL"},measureAxis:{minimumLayoutMode:"XSMALL"},dimensionAxis:{minimumLayoutMode:"XSMALL"},gridLines:{minimumLayoutMode:"XSMALL"},refLinesLabels:{minimumLayoutMode:"SMALL"},horizontalDimensionAxis:{minimumLayoutMode:{width:"XSMALL",height:"SMALL"}},verticalDimensionAxis:{minimumLayoutMode:{width:"SMALL",height:"XSMALL"}},horizontalDimensionAxisTitle:{minimumLayoutMode:{width:"XSMALL",height:"MEDIUM"}},verticalDimensionAxisTitle:{minimumLayoutMode:{width:"MEDIUM",height:"XSMALL"}}},Hm="inner-time-axis",Bm="outer-time-axis";const Fm={getMajorAxisMaxGlyphCount(e,t){let n=0;if(e.qDimensionInfo.length){const i=t?0:e.qDimensionInfo.length-1;n=sm.getMaxGlyphCount(e,i)}else e.qMeasureInfo.forEach(e=>{n=Math.max(n,e.qFallbackTitle.length)});return n},getAxisData(e,t){let n;return n=e.qDimensionInfo.length?a(e,t?"qStackedDataPages.0.qData.0.qSubNodes":"qDataPages.0.qMatrix"):e.qMeasureInfo,n},getBarAxisMaxGlyphCount(e,t){if(!e)return;const n=Fm.getAxisData(e,t),i=!e.qDimensionInfo.length,o=i||t?void 0:e.qDimensionInfo.length-1,r=Fm.getMajorAxisMaxGlyphCount(e,t),a=i?"qFallbackTitle":"qText";return na.getAdjustedMaxGlyphCount(r,n,o,a)},getGroupAxisMaxGlyphCount(e){if(!e)return;const t=Fm.getAxisData(e),n=sm.getMaxGlyphCount(e,0);return na.getAdjustedMaxGlyphCount(n,t,0)}};var jm=3,Vm=13;function _m(e,t,n,i){const{meta:o}=t.layoutService,r=[],a=!("none"===e.measureAxis.show),s=!("title"===e.measureAxis.show);o.isContinuous?r.push(...function(e,t,n,i){const{meta:o}=t.layoutService,{axis:r,grid:a}=t.themeService.getStyles(),s=t.styleService.axis.label.getStyle(),{auto:l,spacing:u}=t.layoutService.getLayoutValue("gridLine",{}),c=[],d="none"!==e.dimensionAxis.show&&"title"!==e.dimensionAxis.show,m=zm[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode,h={type:"grid-line",x:{},layout:{minimumLayoutMode:zm.gridLines.minimumLayoutMode},ticks:{stroke:a.line.major.color},minorTicks:{show:!1,stroke:a.line.minor.color},animations:{enabled:t.viewModel.animations.enabled,trackBy:bl.lines.trackBy,compensateForLayoutChanges:bl.lines.compensateForLayoutChanges}},f=!!e.showMiniChartForContinuousAxis&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:t.reducedDataModel.scales.major,brush:"selection",fill:"#6CB33F",opacity:.2}};if(o.isTime){if(d){const e=n?"end":"start",i=n?1:0,o="bottom"===t.dockService.meta.major.dock?0:1,a={label:{fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},majorGuideLine:{stroke:r.line.major.color},minorGuideLine:{stroke:r.line.minor.color}},d={type:"time-axis",renderer:"svg",layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:m},preferredSize:()=>({size:2*parseFloat(s.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:e,label:{align:o,justify:i},guideLine:{major:{justify:i},minor:{align:o}}},style:a,animations:{enabled:t.viewModel.animations.enabled,trackBy:bl.axes.trackBy({isTime:!0}),compensateForLayoutChanges:bl.axes.compensateForLayoutChanges({isTime:!0})}};c.push(ne(!0,{},d,{key:Hm,scale:Jd.SCALE.MAIN.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!l&&0===u}},style:ne(!0,{},a,{line:{stroke:r.line.major.color},majorGuideLine:{stroke:r.line.minor.color},minorGuideLine:{stroke:r.line.major.color}})})),c.push(ne(!0,{},d,{key:Bm,scale:Jd.SCALE.MAIN.MAJOR,settings:{guideLine:{minor:{show:!1}},line:{show:!1}}})),c.push({type:"axis-overlay",key:"outer-axis-overlay",scale:Jd.SCALE.MAIN.MAJOR,layout:{dock:`@${Bm}`,minimumLayoutMode:m}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:Jd.SCALE.MAIN.MAJOR_INNER,layout:{dock:`@${Hm}`,minimumLayoutMode:m}}),c.push(f)}return c.push(ne(!0,{},h,{key:"inner-time-grid",x:{scale:Jd.SCALE.MAIN.MAJOR_INNER},ticks:{stroke:a.line.minor.color}})),c.push(ne(!0,{},h,{key:"outer-time-grid",x:{scale:Jd.SCALE.MAIN.MAJOR}})),c}if(o.isContinuous){const e="continuous-axis";d&&(c.push({type:"axis",key:e,renderer:Nl(),scale:Jd.SCALE.MAIN.MAJOR,layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:m},settings:{labels:{align:0,offset:4,fill:s.fill,fontSize:s.fontSize,fontFamily:s.fontFamily},ticks:{show:!0,stroke:r.line.major.color},line:{show:!i},minorTicks:{show:!1}},animations:{enabled:t.viewModel.animations.enabled,trackBy:bl.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:bl.axes.compensateForLayoutChanges({isContinuous:!0})}}),c.push({type:"axis-overlay",key:"inner-axis-overlay",scale:Jd.SCALE.MAIN.MAJOR,layout:{dock:`@${e}`,minimumLayoutMode:m}}),c.push(f)),c.push(ne(!0,{},h,{key:"continuous-grid",x:{scale:Jd.SCALE.MAIN.MAJOR},minorTicks:{show:!0}}))}return c}(e,t,n,i)):r.push(...function(e,t,n,i){if("none"===e.dimensionAxis.show)return[];const{meta:o}=t.layoutService,r=t.themeService.getStyles(),a=[],s=function(e,t){return!t.layoutService.meta.isGroupedByDimension||!e.legend.show||t.colorService.getMain().getSettings().field!==t.viewModel.fields.major}(e,t),l=function(e,t){return!(!t.layoutService.meta.isGroupedByDimension||e.legend.show&&t.colorService.getMain().getSettings().field===t.viewModel.fields.majorGroup)}(e,t),u="horizontal"===t.dockService.meta.major.orientation,c=u?e.dimensionAxis.label:"auto",d="horizontal"===c?void 0:t.dockService.meta.minor.size/4,m=t.styleService.axis.label.getStyle(),h={type:"axis",renderer:Nl(),layout:{dock:t.dockService.meta.major.dock,minimumLayoutMode:zm[`${t.dockService.meta.major.orientation}DimensionAxis`].minimumLayoutMode},settings:{labels:{show:!("title"===e.dimensionAxis.show),mode:c,tiltAngle:n?-40:40,maxEdgeBleed:50,maxLengthPx:d,...m},line:{show:!i,stroke:r.axis.line.major.color}},brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension"],style:{inactive:{opacity:.3}}}]},animations:{enabled:t.viewModel.animations.enabled,trackBy:bl.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:bl.axes.compensateForLayoutChanges({isHorizontal:u})}};l&&a.push(ne(!0,{},h,{key:"group-axis",scale:Jd.SCALE.MAIN.MAJOR_INNER,settings:{paddingEnd:s?10:4,labels:{mode:s?"horizontal":h.settings.labels.mode,maxGlyphCount:Fm.getGroupAxisMaxGlyphCount(e.qHyperCube),maxLengthPx:d},line:{show:(u||!s)&&h.settings.line.show}}}));const f=Fm.getBarAxisMaxGlyphCount(e.qHyperCube,o.isStackedByDimension);return s&&a.push(ne(!0,{},h,{key:Jd.COMPONENT.BAR_AXIS,scale:Jd.SCALE.MAIN.MAJOR,settings:{paddingEnd:4,labels:{maxGlyphCount:f,maxLengthPx:d,tiltThreshold:f>jm&&f<Vm?1:void 0},line:{show:!(u&&l)&&h.settings.line.show}}})),u||2!==a.length?a:[a[1],a[0]]}(e,t,n,i));const l=t.themeService.getStyles(),u=t.styleService.axis.label.getStyle();return a&&r.push({type:"axis",key:"y-axis",renderer:Nl(),formatter:Jd.FORMATTER.MINOR,layout:{dock:t.dockService.meta.minor.dock,minimumLayoutMode:zm.measureAxis.minimumLayoutMode},scale:Jd.SCALE.MAIN.MINOR,settings:{labels:{show:s,...u},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:t.viewModel.animations.enabled,trackBy:bl.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:bl.axes.compensateForLayoutChanges({isMeasure:!0,dock:t.dockService.meta.minor.dock})}}),r}var Um={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}}};function $m({layoutService:e,discrete:t}){const{isContinuous:n,isGrouped:i}=e.meta,o=(e.getLayoutValue("components",[])||[]).filter(e=>"bar"===e.key)[0];if(o?.style?.width){const{style:e}=o;return e.strokeWidth&&"none"!==e.strokeWidth&&!n?function(){const n=Um.BAR.STROKE.WIDTH[e.strokeWidth.toUpperCase()]/t.query.getItemSize(),i=e.width+n;return i>1?e.width-(i-1):e.width}:e.width}return i?.9:.7}const{isNumber:Wm}=Ds,Km=["$year","$yearquarter","$quarter","$yearmonth","$month","$weeknumber","$yearweek","$week","$weekday","$day","$date"],Gm={seconds:1/86400,minutes:1/1440,hours:1/24,days:1,weeks:7,months:365/12,quarters:91.25,years:365,number:1},Ym={$date:1,$day:1,$weekday:1,$week:1,$yearweek:7,$weeknumber:1,$month:1,$yearmonth:365/12,$quarter:1,$yearquarter:91.25,$year:365},Xm=({data:e,layout:t})=>{const n=t.qHyperCube?.qDimensionInfo?.[0]?.continuous?.period;if("auto"!==n)return Gm[n||"none"]||1;const i=t.qHyperCube?.qDimensionInfo?.[0]?.qTags||[];for(let e=0;e<Km.length;e+=1)if(-1!==i.indexOf(Km[e]))return Ym[Km[e]]||1;return(({data:e,layout:t})=>{const n=(t.qHyperCube?.qDimensionInfo?.[0]?.qAttrExprInfo||[]).find(e=>"firstDimensionDiff"===e.id);let i=Number(n?.qFallbackTitle);if(Wm(i))return i;const o=e.items.map(e=>e.timeStart.value);return i=Ls.findMinPositiveDistance(o),i})({data:e,layout:t})};function Jm({opts:e,MIN_BAR_WIDTH:t,isMiniChart:n=!1}){return({data:i,mainRect:o,maxBarWidth:r})=>{const{viewState:a,viewCache:s}=e,{min:l,max:u}=n?{min:s.get("continuousMin"),max:s.get("continuousMax")}:a.get("zoom"),c=Math.max(0,(({data:e,width:t,min:n,max:i,opts:o})=>{if(i===n)return t;const r=o.layoutService.getLayout(),a=(r.qHyperCube?.qDimensionInfo?.[0]?.continuous.stepSize||1)*Xm({data:e,layout:r});return a<=0?t:a/(i-n)*t})({data:i,width:o.width,min:l,max:u,opts:e}));return Math.max(t,Math.min(c,r))}}const Zm={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function Qm(e,t,n={}){const i=Jm({opts:e,MIN_BAR_WIDTH:2});return({data:o})=>{const{chart:r,viewState:a,viewCache:s,layoutService:l,discrete:u}=e,c=r.component(t).rect;if(!o.items.length||!c)return 2;const{min:d,max:m}=a.get("zoom");if(n[[d,m]])return n[[d,m]];const h=l.getLayout();let f;n={};let p=Zm[Hr.getLayoutMode(c.width,Number.MAX_VALUE)];const g=h.qHyperCube.qDimensionInfo?.[0]?.continuous?.period;if(g&&"none"!==g){p=c.width;f=$m({layoutService:l,discrete:u})*i({data:o,mainRect:c,maxBarWidth:p})}else{const e=Math.abs(m-d),t=Math.abs(s.get("continuousMax")-s.get("continuousMin"));if(0===t)return p;const n=Math.min(e/t/.2,1),i=2*(1-(y=1-n))+p*y;f=Math.max(2,Math.min(p,i))}var y;return n[[d,m]]=f,n[[d,m]]}}function eh(e,t){const{hasExplicitMax:n,explicitMax:i}=t;return!!n&&e>i&&i<=0}function th(e,t){const{hasExplicitMin:n,explicitMin:i}=t;return!!n&&e<i&&i>=0}function nh(e,t){const{hasExplicitMax:n,explicitMax:i}=t;return!!n&&e>i&&i>0}function ih(e,t){const{hasExplicitMin:n,explicitMin:i}=t;return!!n&&e<i&&i<0}const oh="max",rh="min",ah={min:"Min",max:"Max"};function sh(e,t,n){return void 0===n?eh(e,t)||th(e,t):n===oh?eh(e,t):th(e,t)}function lh({minorMinMax:e,type:t}){return!(function({minorMinMax:e,type:t}){return!e[`hasExplicit${ah[t]}`]}({minorMinMax:e,type:t})||function({minorMinMax:e,type:t}){const n=t===oh?e.implicitMax:e.implicitMin;return!sh(Number(n.toFixed(13)),e,t)}({minorMinMax:e,type:t}))}function uh(e,{barComponent:t,type:n,isStacked:i}){const{viewCache:o,dockService:r,themeService:a}=e,s=o.get("minorMinMax");if(!s.hasExplicitMinMax)return!1;const l=n===oh?s.implicitMax:s.implicitMin;if(!sh(Number(l.toFixed(13)),s,n))return!1;const{orientation:u}=t.settings,c=n===oh?r.meta.minor.end:r.meta.minor.start;let d="end";i&&(d=n===oh?"sumOfPositives":"sumOfNegatives");const m=a.getStyles();return{type:"box-out-of-bounds",key:`bar-oob-${n}`,layout:{dock:c},data:t.data,brush:t.brush,settings:{orientation:u,major:t.settings.major,minor:t.settings.minor,dockValue:Zr.getDockValue(c),oob:ne({},t.settings.box,{fill:m.outOfRange.color,alignment:1,opacity:1,show:function(e){return!0!==e.datum.null?.value&&((!i||0!==e.datum[d].value)&&sh(e.datum[d].value,s,n))}})},animations:{enabled:e.viewModel.animations.enabled,compensateForLayoutChanges:bl.barOobs.compensateForLayoutChanges}}}function ch(e){return Math.min(Math.max(0,e),1)}const dh=(e,{chart:t,type:n,componentKey:i,collectionKey:o})=>{const{layoutService:r,dockService:a,viewCache:s}=e,{isStacked:l}=r.meta,u=s.get("minorMinMax"),{meta:c}=e.layoutService;if(!lh({minorMinMax:u,type:n}))return!1;let d;c.isGroupedByDimension?d=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:c.isGroupedByMeasure&&(d=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);return{type:"box",key:`${Jd.COMPONENT.GHOST_BAR_OOB}-${n}`,data:{collection:o},settings:{orientation:a.meta.minor.orientation,major:{scale:Jd.SCALE.MAIN.MAJOR,fn:d},minor:{scale:Jd.SCALE.MAIN.MINOR,start:e=>ch(t.scale(Jd.SCALE.MAIN.MINOR)(e?.datum?.start?.value||0)),end(e){const i=t.scale(Jd.SCALE.MAIN.MINOR);let o="end";l&&(o="max"===n?"sumOfPositives":"sumOfNegatives");const r=e.datum[o]?e.datum[o].value:i[n]();return ch(i(r))}},box:{width:$m({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:2,fill:"none",stroke:"transparent",show:e=>{const i=t.scale(Jd.SCALE.MAIN.MINOR);let o="end";l&&(o="max"===n?"sumOfPositives":"sumOfNegatives");const r=e.datum[o]?e.datum[o].value:i.max();return"max"===n?r>i.max():r<i.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function mh(e,t){const{style:n,styleService:i,dockService:o}=t,r=i.label.getStyle(),a=r.useContrastColor&&!e.onBackground?function(e){return function(t){return ls.isDark(t.node.attrs.fill)?e.lightColor:e.darkColor}}(n):r.fill,s="horizontal"===o.meta.major.orientation,l=e.padding||{left:s?0:4,right:s?0:4,top:s?4:0,bottom:s?4:0};return{position:e.position,justify:e.justify,fill:a,overflow:e.overflow,background:e.background,padding:l}}function hh(e){return{placements:e.simplifiedPlacements.map(t=>mh(t,e)),label:e.label}}function fh(e,t){if(t){if(function(e,t){return eh(e,t)}(e,t))return-1;if(function(e,t){return th(e,t)}(e,t))return 1}return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}function ph(e,t,n,i){const o=fh(e,i);let r="up";return"vertical"===t&&o<0?r="down":"horizontal"===t&&(r=o>=0&&!n||o<0&&n?"right":"left"),r}function gh(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:i,isContinuous:o}=t.layoutService.meta;return!i||!o&&!!n.showSegmentLabels}function yh(e,t){const{dataPoint:n}=e;if(!n.showLabels)return!1;const{isStacked:i,isContinuous:o}=t.layoutService.meta;return!!i&&(!!o||!1!==n.showTotalLabels)}function vh(e,t,n,i){const o=[];return void 0!==e&&(o[e]={position:"outside",onBackground:!0,justify:0,overflow:i}),void 0!==t&&(o[t]={position:"inside",onBackground:!1,justify:n}),o}function bh({layout:e,component:t,minorScale:n},i,o){if(!gh(e,i))return!1;const{viewModel:r,ds:a,viewCache:s,layoutService:l,dockService:u,themeService:c}=i,{meta:d}=l,m=s.get("minorMinMax"),h=c.getStyles(),f=i.styleService.label.getStyle();let p;!d.isStacked&&(p=d.isStacked?1:0);const g=0===p?1:0,y=d.isStacked?.5:1,v=r.fields.minor[0],b=void 0===v?void 0:a.field(v).formatter();let x,S=-1;x=d.isStacked?d.isStackedByMeasure||!b?function(e){return e.data.segment.label}:function(e){return Math.abs(e.data.segment.value)>S?b(e.data.segment.value):""}:function(e){return e.data.end.label};const M={label:x,simplifiedPlacements:vh(p,g,y,d.isContinuous),style:h.label.value},q=[hh(ne(i,M))],C=[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>ph(e.data.end.value,u.meta.minor.orientation,o,m),labels:q,fontSize:parseInt(f.fontSize,10),fontFamily:f.fontFamily,linkData:bl.labels.linkData}}}],w={key:"bar-labels",type:"labels",renderer:Nl(),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:C},animations:{enabled:i.viewModel.animations.enabled,trackBy:bl.labels.trackBy,compensateForLayoutChanges:bl.labels.compensateForLayoutChanges}};return d.isStackedByDimension&&b&&(w.beforeRender=()=>{S=function(e,t,n){const i="vertical"===t.dockService.meta.minor.orientation?"height":"width",o=t.chart.component(e),r=o&&o.rect?o.rect[i]:1,a=n?n.min():0;return 9.999*((n?n.max():0)-a)/r}(t,i,n)}),w}function xh(e,{fill:t}){return{[Jd.FORMATTER.MINOR]:{data:{fields:e.viewModel.fields.minor}},[Jd.FORMATTER.COLOR]:t&&t.data&&t.data.field?{data:{field:t.data.field}}:{}}}const Sh=1,Mh=3;function qh(e){return e.getLayoutValue("gridLine.auto")}function Ch(e){return!qh(e)&&e.getLayoutValue("gridLine.spacing")===Sh}function wh(e){return!qh(e)&&e.getLayoutValue("gridLine.spacing")===Mh}const Th=e=>({enabled:e.animations.enabled,trackBy:bl.lines.trackBy,compensateForLayoutChanges:bl.lines.compensateForLayoutChanges}),kh=(e,{themeService:t,layoutService:n,dockService:i,viewModel:o})=>{if(!qh(n)&&function(e){return!e.getLayoutValue("gridLine.spacing")}(n))return!1;const{grid:r}=t.getStyles(),a={key:"grid-line",type:"grid-line",layout:{minimumLayoutMode:zm.measureAxis.minimumLayoutMode},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!Ch(n)||((e,t)=>t%2==0),stroke:r.line.major.color},minorTicks:{show:wh(n),stroke:r.line.minor.color},animations:Th(o)};return a["horizontal"===i.meta.major.orientation?"y":"x"]=Jd.SCALE.MAIN.MINOR,a};function Nh(e,t){const n=[kh(0,t)];return n[0]&&n.push((({dockService:e,themeService:t,viewCache:n,viewModel:i})=>{const o=n.get("minorMinMax");if(o.min>0||o.max<0)return!1;const r=t.getStyles(),a={};return a["horizontal"===e.meta.minor.orientation?"x":"y"]=[{value:0,scale:Jd.SCALE.MAIN.MINOR,line:{stroke:r.grid.line.highContrast.color}}],{key:"high-contrast-grid-line",type:"ref-line",scale:Jd.SCALE.MAIN.MINOR,lines:a,animations:Th(i)}})(t)),n}const Dh="areaPan",Lh=e=>({type:"Pan",key:"panorama",options:{event:Dh,pointers:1,threshold:10,enable(t,n){return this.started===Dh||!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===Jd.COMPONENT.BAR)}},events:{areaPanstart(t){t.preventDefault(),this.started=Dh;const n=e.viewState.get("zoom");this[Dh]={min:n.min,max:n.max,size:e.chart.component(Jd.COMPONENT.BAR).rect.computedInner.width,span:n.max-n.min}},areaPanmove(t){t.preventDefault();const{span:n,min:i,max:o,size:r}=this[Dh],a=-t.deltaX/r;e.viewState.set("zoom",{min:Math.min(i+a*n,e.viewCache.get("continuousMax")-n),max:Math.max(o+a*n,e.viewCache.get("continuousMin")+n)})},areaPanend(e){e.preventDefault(),this.started=!1},areaPancancel(e){e.preventDefault(),this.started=!1}}});function Eh(e,t){if(e.layoutService.meta.isDiscrete)return{};const{viewCache:n,viewState:i,chart:o}=e,{rtl:r}=t,a=Pr.event.onZoom({viewCache:n,viewState:i,chart:o},{threshold:100,rtl:r,targetKey:Jd.COMPONENT.BAR}),s={last:0};return{type:"Pinch",key:"continuous-pinch-zoom",options:{event:"zoom",pointers:2,threshold:0,enable:(t,n)=>!n||!!e.actions.scroll.enabled()&&e.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>e.key===Jd.COMPONENT.BAR)},events:{zoomstart(e){s.last=e.scale,e.preventDefault()},zoommove(e){const t=e.scale-s.last;(function(e){return Math.abs(e)>.01})(t)&&a(e.center,t>0?1:-1),e.preventDefault(),s.last=e.scale}}}}function Oh(e,t){const{viewCache:n,viewState:i,chart:o}=e,{rtl:r}=t,a=e.layoutService.meta.isContinuous?Pr.event.onZoom({viewCache:n,viewState:i,chart:o},{rtl:r,threshold:50,targetKey:Jd.COMPONENT.BAR}):void 0;return{type:"native",events:{wheel(t){let n,i=!1;if(e.actions.scroll.enabled()){const o={x:t.clientX,y:t.clientY};[n]=e.chart.componentsFromPoint(o).filter(e=>e.key===Jd.COMPONENT.BAR),n&&(e.layoutService.meta.isContinuous&&a(o,Math.sign(-t.deltaY)),i=!0)}!i&&e.actions.interact.enabled()&&([n]=e.chart.componentsFromPoint(t).filter(e=>e.key===Jd.COMPONENT.LEGEND_COLOR_CAT),n&&(i=!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,n))),i&&t.preventDefault()}}}}const Ah=(e,t,n)=>({type:"hammer",enable:!0,gestures:[...(t.hammer||{}).gestures||[],...Mu({...e,componentKey:"scrollbar",rtl:t.rtl}).gestures,...n.gestures,...e.layoutService.meta.isDiscrete?e.discrete.interactions.gestures:[Lh(e),Eh(e,t)]]});function Ih(e,t){const n=e.tooltipService.getInteractions(),i=[Ah(e,t,n),Oh(e,t),Mu({...e,componentKey:"scrollbar",rtl:t.rtl}).native,n.native];return e.layoutService.meta.isDiscrete&&i.push(e.discrete.interactions.native),i}const Ph=e=>({enabled:e.animations.enabled,compensateForLayoutChanges:bl.bars.compensateForLayoutChanges});function Rh(e,t,{collectionKey:n}){const{continuousDataModel:i,reducedDataModel:o,colorService:r,layoutService:a,viewModel:s}=t,{meta:l}=a,u=a.getLayout(),c=u.qHyperCube.qDimensionInfo?.[0]?.continuous?.period,d=c&&"none"!==c,m=l.isContinuous&&d?function(e,t,n={}){const i=Jm({opts:e,MIN_BAR_WIDTH:2,isMiniChart:!0});return({data:o})=>{const{chart:r,viewCache:a,layoutService:s,discrete:l}=e,u=r.component(t).rect;if(!o.items.length||!u)return 2;const c=a.get("continuousMin"),d=a.get("continuousMax");if(n[[c,d]])return n[[c,d]];const m=s.getLayout();let h;n={};let f=Zm[Hr.getLayoutMode(u.width,Number.MAX_VALUE)];const p=m.qHyperCube.qDimensionInfo?.[0]?.continuous?.period;return p&&"none"!==p?(f=u.width,h=$m({layoutService:s,discrete:l})*i({data:o,mainRect:u,maxBarWidth:f}),n[[c,d]]=h,n[[c,d]]):2}}(t,Jd.COMPONENT.MINI_BAR):2;return{type:"box",key:Jd.COMPONENT.MINI_BAR,layout:{dock:"@scrollbar"},show:()=>i.getDimensionCardinality()>1,data:{collection:n},settings:{box:ne(!0,{},e.settings.box,{minWidthPx:m,fill:r.getMini().getColor(),strokeWidth:0}),major:ne(!0,{},e.settings.major,{scale:o.scales.major}),minor:e.settings.minor,orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Ph(s)}}const zh=(e,t,{collectionKey:n})=>{if(!uu({layoutService:t.layoutService}).miniChart)return!1;if(t.reducedDataModel.mode.isContinuous)return Rh(e,t,{collectionKey:n});const{mode:i,scales:o}=t.reducedDataModel;let r;return i.isGroupedByDimension&&!i.isReduced?r=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:i.isGroupedByMeasure&&(r=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2),{type:"box",key:Jd.COMPONENT.MINI_BAR,layout:{dock:"@scrollbar"},show:()=>t.discrete.query.getCanScroll(),data:{collection:n},settings:{box:{...e.settings.box,fill:i.isReduced||i.isStackedByDimension?t.colorService.getMain().getSettings().others:t.colorService.getMain().getColor(),strokeWidth:0},major:{scale:o.major,fn:r},minor:{scale:o.minor},orientation:e.settings.orientation,oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:Ph(t.viewModel)}},{measureText:Hh}=t.renderer("svg")();function Bh(e,t,n){const i=function(e){const t=ne(!0,{},e);return delete t.data,t}(t.minor),o=function(e,t,{majorScaleInvert:n,maxPxStep:i,align:o,getProp:r}){let a={invert:n,data:{extract:e.mode.isDimensionless?e.fields.minor.map((e,t)=>({field:e,value:t})):{source:"miniCube",field:"qDimensionInfo/0"}},type:e.mode.isDimensionless?"band":void 0,maxPxStep:i,align:o};return e.mode.isStackedByDimension?a.data.extract.field="qDimensionInfo/1":e.mode.isGroupedByDimension?e.mode.isReduced||(a.data={source:"miniCube",hierarchy:{value:e=>e.qElemNumber}}):e.mode.isGroupedByMeasure?(a=ne(!0,{},t),a.data.extract.source="miniCube"):e.mode.isContinuous&&(a=ne(!0,{},t,{min:()=>r("continuousMin"),max:()=>r("continuousMax")})),a}(e,t.major,n);return{reducedMinor:i,reducedMajor:o}}const Fh=50,jh=100,Vh=200;function _h(e,t){const n=function(e){const t=e.getLayoutValue("measureAxis.spacing",1);switch(t){case.5:return Fh;case 1:return jh;case 2:return Vh;default:return 125*t}}(t);return Math.max(1,Math.round(e/n))}function Uh(e,t,n){return 0===t||t===Math.floor((n.length-1)/2)||t===n.length-1}function $h(e,t,n){return 0===t||0===e||t===n.length-1}function Wh(e){for(let t=1;t<e.length;t++)if(e[t]===e[t-1])return!0;return!1}function Kh(e,t,n,i,o){e.domain([t,n]),e.nice(10);const[r,a]=e.domain();let s=e.ticks(10);const l=function(e){return e.length%2==0}(s),u=function(e){const t=Math.round(.3*e.length),n=t,i=e.length-t;return e.slice(n,i).some(e=>0===e)}(s),c=u?$h:Uh;s=s.filter(c),l&&!u&&!i&&s.length>1&&(s=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const d=o?o.formatter(Jd.FORMATTER.MINOR):void 0;return Wh(d?s.map(d):s)&&(s=[s[0],s[s.length-1]]),{roundedMin:r,roundedMax:a,ticks:s}}function Gh(e,t,n,i,o,r,a,s){const l=r.formatter(Jd.FORMATTER.MINOR),u=s.getStyles(),c="horizontal"===a.meta.major.orientation?"height":"width",d=e=>Hh({text:e,fontSize:u.axis.label.name.fontSize,fontFamily:u.axis.label.name.fontFamily})[c];let[m,h]=e.domain(),f=e.ticks(i);function p(){const e=f.map(l);return!Wh(e)&&function(e){const t=o/f.length;return Math.max(...e.map(d))<=t}(e)}for(let o=i-1;o>0&&!p();o--)e.domain([t,n]),e.nice(o),[m,h]=e.domain(),f=e.ticks(o);return{roundedMin:m,roundedMax:h,ticks:f}}const Yh=(e,t)=>e.value-t.value,Xh=e=>({value:e,isMinor:!1}),Jh=e=>({value:e,isMinor:!0});function Zh(e,t,n){const i=Number.isNaN(t)&&Number.isNaN(n)?3:2;return e.filter(e=>(e=>Number.isNaN(t)||e>=t)(e)&&(e=>Number.isNaN(n)||e<=n)(e)).length<=i}function Qh({chart:e,viewCache:t,dockService:n,layoutService:i,themeService:o,viewModel:r,ds:a}){const{isButterfly:s}=i.meta,{explicitMin:l,explicitMax:u,hasExplicitMin:c,hasExplicitMax:d}=t.get("minorMinMax"),{min:h,max:f}=function(e){let{min:t,max:n}=e.get("minorMinMax");return t===n&&0===t&&(t-=1,n+=1),{min:t,max:n}}(t),p=s?Math.max(Math.abs(h),Math.abs(f)):f,g=s?-p:h,y=m(()=>{const s=function(e,t,n){let i;return e?i=n.meta.chart.size:({rect:i}=t.component(Jd.COMPONENT.BAR)),"horizontal"===n.meta.major.orientation?i.height:i.width}(t.get("isPreRender"),e,n),m=_h(s,i),h=function(e,t,n){const i=fn().domain([e,t]);return i.nice(n),i}(g,p,m);let f,y,v=[];"SPARK"===n.meta.chart.mode?({roundedMin:f,roundedMax:y}=function(e,t){return{roundedMin:e,roundedMax:t}}(g,p)):(({roundedMin:f,roundedMax:y,ticks:v}=Gh(h,g,p,m,s,e,n,o)),Zh(v,l,u)&&({roundedMin:f,roundedMax:y,ticks:v}=Kh(h,g,p,c||d,e)));const b=function(e,t){const n=[];for(let i=0;i<e.length-1;i++){const o=e[i],r=(e[i+1]-o)/(t+1);for(let e=1;e<=t;e++)n.push(o+r*e)}return n}(v,1);v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.unshift(t),n.filter(e=>e>=t)):n}(c,l,v),v=function(e,t,n){return e&&n.length&&!n.some(e=>e===t)?(n.push(t),n.filter(e=>e<=t)):n}(d,u,v);let x=function(e,t){return[...e.map(Xh),...t.map(Jh)].sort(Yh)}(v,b);if(i.meta.isButterfly){const e=r.fields.minor[0],t=void 0===e?void 0:a.field(e).formatter();"function"==typeof t&&(x=x.map(e=>({...e,label:t(Math.abs(e.value))})))}return{roundedMin:f,roundedMax:y,ticks:x}},()=>t.get("isPreRender"));return{values:()=>y().ticks,min:()=>c?l:y().roundedMin,max:()=>d?u:y().roundedMax}}function ef(e,{picasso:t,discrete:n,layoutService:i,dockService:o,viewModel:r,viewCache:a,reducedDataModel:s,colorService:l,themeService:u,viewState:c,chart:d,ds:m},{localeInfo:h,rtl:f}){const{meta:p}=i,{fields:g}=r,y=()=>{if("custom"!==i.getLayoutValue("dimensionAxis.axisDisplayMode"))return Math.min(200,o.meta.chart.size["horizontal"===o.meta.major.orientation?"height":"width"]/4)},v=!("none"===i.getLayoutValue("measureAxis.show"))?(b=o.meta.minor.orientation,x=o.meta.minor.dock,"vertical"===b?"near"===x||"left"===x?0:1:"near"===x||"bottom"===x?1:0):.5;var b,x;const S={},M="vertical"===o.meta.minor.orientation&&f,q=l.getMain().getScales(),C=l.getMini().getScales();if(Object.assign(S,q,{reducedFill:C.reducedFill}),S[Jd.SCALE.MAIN.MINOR]=function({chart:e,viewModel:{fields:t},dockService:n,viewCache:i,viewModel:o,layoutService:r,themeService:a,ds:s},{rtl:l}){const u=Qh({chart:e,dockService:n,viewCache:i,layoutService:r,themeService:a,viewModel:o,ds:s}),c={invert:"vertical"===n.meta.minor.orientation||l,ticks:{values:u.values},minorTicks:{count:1},min:u.min,max:u.max};return r.meta.isStacked||(c.data={source:"qHyperCube",fields:t.minor}),c}({chart:d,viewModel:r,dockService:o,viewCache:a,layoutService:i,themeService:u,ds:m},{rtl:f}),p.isGroupedByDimension)[Jd.SCALE.MAIN.MAJOR_INNER,Jd.SCALE.MAIN.MAJOR].forEach((e,t)=>{S[e]={invert:M,data:{source:"qHyperCube",hierarchy:{label:e=>e.qText?e.qText:"",value:e=>e.qElemNumber,props:{...r.selectionDimensionProp(t),group:p.isGroupedByDimension?{field:g.majorGroup}:void 0}}},label:({datum:e})=>e.label,ticks:{depth:t+1},maxPxStep:y,align:v}}),r.isDimensionLocked(0)||(S[Jd.SCALE.MAIN.MAJOR_INNER].data.hierarchy.props.axisSelectionDimension={field:0});else if(p.isGroupedByMeasure)S[Jd.SCALE.MAIN.MAJOR]={type:"group-by-measure",invert:M,data:{extract:{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},measureCount:e.qHyperCube.qMeasureInfo.length,maxPxStep:y,align:v};else if(p.isTime){const{innerTime:e,outerTime:n}=function(e,t){const{layoutService:n,viewModel:i,viewCache:o,picasso:r,viewState:a,localeInfo:s,themeService:l}=e,u=()=>n.getHyperCubeValue("qAxisData.qAxis",[]),c=r.formatter("q-time"),d=l.getStyles(),m=e=>Hh({text:e,fontSize:d.axis.label.name.fontSize,fontFamily:d.axis.label.name.fontFamily});o.set("qTimeAxisCache",[]);const h={get:(e,t=0)=>{const n=o.get("qTimeAxisCache");return n[t]&&n[t][0]===e?n[t][1]:void 0},set:(e,t,n=0)=>{o.get("qTimeAxisCache")[n]=[e,t]},key:({distance:e})=>{const{min:t,max:n}=a.get("zoom"),i=(n-t)/(o.get("continuousMax")-o.get("continuousMin")),r=u().map(e=>e.qName);return[e,Number.parseFloat(i).toFixed(12),...r].toString()}};return{innerTime:{data:{field:i.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:i.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:m},ticks:{generator:{type:"d3",initialMin:a.get("zoom").min},level:"inner",anchor:"start",clamp:!0},cache:h},outerTime:{data:{field:i.fields.majorNumeric},type:"q-time-axis",qAxis:u,field:i.fields.majorNumeric,min:()=>a.get("zoom").min,max:()=>a.get("zoom").max,invert:!!t,formatter:{fn:c,localeInfo:s,qNumFormat:n.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:m},ticks:{generator:{type:"d3"},level:"outer",anchor:"start",clamp:!0},cache:h}}}({picasso:t,localeInfo:h,viewState:c,viewModel:r,viewCache:a,themeService:u,layoutService:i},f);S[Jd.SCALE.MAIN.MAJOR_INNER]=e,S[Jd.SCALE.MAIN.MAJOR]=n}else p.isContinuous?S[Jd.SCALE.MAIN.MAJOR]={type:"linear",invert:M,data:{extract:{key:"qHyperCube",field:g.majorNumeric}},ticks:{forceBounds:!0,count:c.get("zoom").min===c.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>c.get("zoom").min,max:()=>c.get("zoom").max}:S[Jd.SCALE.MAIN.MAJOR]={invert:M,data:{extract:p.isDimensionless?g.minor.map((t,n)=>({field:t,label:()=>e.qHyperCube.qMeasureInfo[n].qFallbackTitle,value:n})):{source:"qHyperCube",field:"qDimensionInfo/0",props:{axisSelectionDimension:{field:0}}}},type:p.isDimensionless?"band":void 0,maxPxStep:y,align:v};const{reducedMinor:w,reducedMajor:T}=Bh(s,{major:S[Jd.SCALE.MAIN.MAJOR],minor:S[Jd.SCALE.MAIN.MINOR]},{majorScaleInvert:M,maxPxStep:y,align:v,getProp:a.get});return p.isDiscrete&&(S[Jd.SCALE.MAIN.MAJOR].range=n.query.getScaleRange,p.isGroupedByDimension&&(S[Jd.SCALE.MAIN.MAJOR_INNER].range=n.query.getScaleRange)),S[s.scales.major]=T,S[s.scales.minor]=w,S}function tf(e,t,n){const{layoutService:i,colorService:o}=e;return function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[Am(e,t)],components:[]}}({targets:[i.meta.isStackedByDimension&&i.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1?Jd.COMPONENT.STACK_TOTAL_BAR:Jd.COMPONENT.BAR,Jd.COMPONENT.BAR_AXIS,Jd.COMPONENT.GROUP_AXIS,"outer-axis-overlay","inner-axis-overlay",Jd.COMPONENT.LEGEND_COLOR_CAT],components(e,t){const i={action:e.srcEvent.ctrlKey||n?"set":"toggle",contexts:["selection"],key:t[0].key};return Jd.COMPONENT.BAR===t[0].key?[{...i,data:["selectionDimension"]}]:[Jd.COMPONENT.BAR_AXIS,Jd.COMPONENT.GROUP_AXIS].includes(t[0].key)?[{...i,data:["selectionDimension","axisSelectionDimension"]}]:[i]}},{...e,isLocked:n=>n.some(e=>e.key===Jd.COMPONENT.LEGEND_COLOR_CAT)?o.getMain().isSelectionLocked({isMeasureSelectionLocked:t}):e.isLocked(n)})}function nf(e){const t=e.layoutService.meta.isStackedByDimension&&e.layoutService.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1;return function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},i=(({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},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}}}))(n);return{interactions:[Om(n,t)],components:[i]}}({key:"lasso",componentTargetKey:Jd.COMPONENT.BAR,components:[t?{key:Jd.COMPONENT.STACK_TOTAL_BAR,contexts:["selection"],action:"add"}:{key:Jd.COMPONENT.BAR,contexts:["selection"],action:"add",data:["selectionDimension"]}]},e)}function of(e){return function(e,t){const n=function(e){const{key:t,targets:n,components:i,fillTargets:o,dock:r}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map(e=>`@${e}`).join(",")},settings:{multiple:!0,brush:{components:i},direction:"left"===r||"right"===r?"vertical":"horizontal",bubbles:{align:"left"===r||"top"===r?"end":"start",placement:"inside"},target:{components:o,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[Pm(e,t,"area")],components:[n]}}({eventName:"discreteRange",components:[{key:Jd.COMPONENT.BAR,contexts:["selection"],action:"set",data:["selectionDimension"]}],key:"discreteRangeBrush",targets:["group-axis",Jd.COMPONENT.BAR_AXIS,Jd.COMPONENT.BAR],fillTargets:["group-axis",Jd.COMPONENT.BAR_AXIS],dock:e.dockService.meta.major.dock},e)}function rf(e,t,n){const{selectionService:i}=e,{isUnsupportedFeature:o}=t,r=void 0===n,a=i.getIsSingleSelect(n),s=tf(e,r,a);if(r||a)return{components:[...s.components],gestures:[...s.interactions]};const l=nf(e),u=function(e,t){return e.layoutService.meta.isStacked||e.layoutService.meta.isButterfly||t?.("rangeSelections")?{components:[],interactions:[]}:Rm({eventName:"measureRange",key:"measureRangeBrush",targets:["y-axis",Jd.COMPONENT.BAR],fillTargets:["y-axis"],dock:e.dockService.meta.minor.dock,scale:Jd.SCALE.MAIN.MINOR,onEdited(){e.actions.select.emit("end","measureRange")}},e)}(e,o),c=function(e){return e.layoutService.meta.isContinuous?Rm({eventName:"continuousRange",key:"continuousRangeBrush",targets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis",Jd.COMPONENT.BAR]:["continuous-axis",Jd.COMPONENT.BAR],fillTargets:e.layoutService.meta.isTime?["outer-time-axis","inner-time-axis"]:["continuous-axis"],observeBrush:!0,multiple:!0,dock:e.dockService.meta.major.dock,scale:e.layoutService.meta.isTime?Jd.SCALE.MAIN.MAJOR_INNER:Jd.SCALE.MAIN.MAJOR,toLabel({datum:t,data:n,scale:i}){const o=e.layoutService.meta.isTime?i.formatter():e.chart.formatter(Jd.FORMATTER.MINOR),r=e.chart&&e.chart.brushSelectionIncludeMax;return`${t!==Math.max(...n)||r?"":"<"}${o(t)}`}},e):{components:[],interactions:[]}}(e),d=of(e);return{components:[...s.components,...l.components,...u.components,...d.components,...c.components],gestures:[...l.interactions,...s.interactions,...u.interactions,...d.interactions,...c.interactions]}}const{isNumber:af}=Ds;function sf({layoutService:e,viewModel:t,dockService:n}){const{meta:i}=e;if(!i.isStackedByDimension||i.isContinuous)return!1;const{fields:o}=t,r=e.getLayoutValue("components",null),a=r?r.filter(e=>"bar"===e.key)[0]:null;return{key:"shadow-bar",type:"box",data:{extract:[{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.filter(e=>af(e.qMaxPos)).map(e=>e.qMaxPos).reduce((e,t)=>e+t,0).toFixed(13));var t}},end:{value:e=>af(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0}}},{field:o.majorStack,filter:e=>0!==e.qDown||0!==e.qUp,props:{start:{value:e=>{return t=e.qSubNodes,Number(t.filter(e=>af(e.qMinNeg)).map(e=>e.qMinNeg).reduce((e,t)=>e+t,0).toFixed(13));var t}},end:{value:e=>af(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0}}}]},settings:{major:{scale:Jd.SCALE.MAIN.MAJOR},minor:{scale:Jd.SCALE.MAIN.MINOR},orientation:n.meta.minor.orientation,box:{width:a?.style?.width&&a.style.width>0?a.style.width:.7,fill:()=>({type:"pattern",fill:"rgba(165, 165, 165, 0.8)",width:4,height:4,shapes:[{type:"rect",x:0,y:3,width:1,height:1},{type:"rect",x:1,y:2,width:1,height:1},{type:"rect",x:2,y:1,width:1,height:1},{type:"rect",x:3,y:0,width:1,height:1}]})},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:t.animations.enabled,trackBy:bl.shadowBars.trackBy,compensateForLayoutChanges:bl.bars.compensateForLayoutChanges}}}const lf={min:"Min",max:"Max"};function uf(e,t,n){const i=n?e.implicitMax:e.implicitMin;return!function(e,t,n){return void 0===n?nh(e,t)||ih(e,t):n===oh?nh(e,t):ih(e,t)}(Number(i.toFixed(13)),e,t)}function cf(e,{barComponent:t,type:n,isStacked:i}){const{viewCache:o,layoutService:r,dockService:a}=e,s=o.get("minorMinMax"),l=n===oh;if(function(e,t){return!e[`hasOther${lf[t]}`]}(s,n)){if(function(e,t){return!e[`hasExplicit${lf[t]}`]}(s,n))return!1;if(uf(s,n,l))return!1}if(function(e,t,n){const i=n?e=>e<0:e=>e>0;return e[`hasExplicit${lf[t]}`]&&i(e[`explicit${lf[t]}`])}(s,n,l))return!1;let u="end";i&&(u=l?"sumOfPositives":"sumOfNegatives");const c=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(()=>e.chart.scale(Jd.SCALE.MAIN.MINOR)[n]()),d=l?e=>e.datum[u].value>c():e=>e.datum[u].value<c(),m=Jd.COMPONENT.BAR,h=e.layoutService.getLayoutValue("components",[]),f=h?h.filter(e=>e.key===m)[0]:null;return{type:"box-sliced-hat",key:`sliced-hat-${n}`,layout:{dock:l?a.meta.minor.end:a.meta.minor.start},data:t.data,brush:t.brush,settings:{orientation:t.settings.orientation,major:t.settings.major,minor:t.settings.minor,hat:ne({},t.settings.box,{fill:r.meta.isStacked?"#999":t.settings.box.fill,alignment:1,opacity:1,show:d,width:$m({layoutService:e.layoutService,discrete:e.discrete}),strokeWidth:f?.style?.strokeWidth?Um.BAR.STROKE.WIDTH[f.style.strokeWidth.toUpperCase()]:Um.BAR.STROKE.WIDTH.NONE,stroke:f?.style?.strokeColor?.color??Um.BAR.STROKE.COLOR})}}}function df(e,{collectionKey:t},n){const{meta:i}=e.layoutService,{fields:o}=e.viewModel,r=i.isStackedByDimension&&!i.isContinuous?"qValue":"qNum";function a(t,n){const o=e.ds.field(t).raw(),a=e.ds.field(t).formatter(),s=$r.shouldUseFormat(o),l=i.isButterfly&&n>0;return{field:t,reduceLabel:"none",value:e=>{return"NaN"===e[r]?0:(t=e[r],l&&0!==t?-t:t);var t},label:e=>s?(e=>"NaN"===e[r]?"-":a(e[r]))(e):e.qText}}function s(e){if(!i.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[r]<0}}const l=i.isStackedByDimension?e=>"NaN"===e.qValue:e=>!!e.qIsNull;const u={key:t,data:{extract:o.minor.map((t,r)=>{const u=e.colorService.getMain().getDatumProps(r),c=e.colorService.getMini().getDatumProps(r),d=u[Object.keys(u)[0]],m=d?.field,h=m?{field:m,reduceLabel:"none",value:e=>void 0!==e.qNum&&"NaN"!==e.qNum?e.qNum:e.qText||"-"}:void 0,f={field:i.isDimensionless?t:o.major,props:{...e.viewModel.selectionDimensionProp(),axisSelectionDimension:{field:0},start:0,end:a(t,r),negative:s(t),null:(p=t,{field:p,reduceLabel:"none",reduce:"first",value:l}),segment:i.isStacked?a(t):void 0,group:i.isGroupedByDimension?{field:o.majorGroup}:void 0,stack:i.isStacked?{field:o.majorStack}:void 0,measureIndex:i.isGroupedByDimension||i.isStackedByDimension?void 0:r,timeStart:i.isContinuous?{field:o.majorNumeric}:void 0,timeEnd:i.isContinuous?{field:o.majorNumeric}:void 0,fillTooltip:h,...u,...c,id:{value:e=>`r${e.qRow}e${e.qElemNumber}m${r}`},customTooltipAttrExps:0!==i.dimensionCount?bc.getNode(e.layoutService.getLayout(),i):void 0}};var p;return i.isDimensionless&&(f.value=r),void 0!==n&&(f.source=n),$r.deleteUndefinedProperties(f.props),f}),filter:i.isButterfly?e=>!e.negative.value:void 0}};return i.isStacked&&(u.data.stack={stackKey:e=>e.stack.value,value:e=>e.end.value,offset:"diverging"}),u}const{isNumber:mf}=Ds;function hf({layoutService:e,viewModel:t},{collectionKey:n}){const{meta:i}=e,{fields:o}=t;if(!i.isStacked)return!1;let r;return r=i.isStackedByMeasure?function(e,t){const n={field:0,props:{sumOfPositives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t>0?e+t:e,0),reduceLabel:"none"},sumOfNegatives:{fields:t.minor.map(e=>({field:e})),value:e=>e.reduce((e,t)=>t<0?e+t:e,0),reduceLabel:"none"},null:{fields:t.minor.map(e=>({field:e})),value:e=>Array.isArray(e)&&e.every(e=>"NaN"===e),reduceLabel:"none"}}};if(e.isContinuous){const e={field:t.major,value:e=>e.qNum,reduceLabel:"none"};n.props.timeStart=e,n.props.timeEnd=e,n.value=e=>e.qNum}return n}(i,o):function(e,t){if(!e.isContinuous)return{field:t.majorStack,reduceLabel:"none",props:{sumOfPositives:{value:e=>mf(e.qMaxPos)?Number(e.qMaxPos.toFixed(13)):0},sumOfNegatives:{value:e=>mf(e.qMinNeg)?Number(e.qMinNeg.toFixed(13)):0},null:{value:e=>{const{qSubNodes:t=[]}=e;return t.every(e=>"NaN"===((e.qSubNodes||[])[0]||{}).qValue)}}}};const n={field:t.majors[0],value:e=>e.qNum,reduceLabel:"none"};return{field:t.majorStack,trackBy:e=>e.qNum,reduce:e=>e[0],props:{sumOfPositives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t>0?e+t:e,0)},sumOfNegatives:{field:t.minor[0],reduceLabel:"none",reduce:e=>e.reduce((e,t)=>t<0?e+t:e,0)},timeStart:n,timeEnd:n}}}(i,o),{key:n,data:{extract:r}}}const ff="main-collection",pf="stack-total-collection";function gf(e,{collectionKey:t}){const{layoutService:n,colorService:i,reducedDataModel:{fields:o,mode:r}}=e,{meta:a}=n,s=a.isStackedByDimension&&!a.isContinuous?"qValue":"qNum";function l(e,t){if(!a.isButterfly)return{field:e};const n=t>0;return{field:e,value:e=>{return"NaN"===e[s]?0:(t=e[s],n&&0!==t?-t:t);var t}}}function u(e){if(!a.isButterfly)return;return{field:e,reduceLabel:"none",value:e=>e[s]<0}}return{key:t,data:{extract:o.minor.map((e,t)=>{const n=r.isReduced?{}:i.getMain().getDatumProps(t),a={start:0,end:l(e,t),negative:u(e),group:{field:o.majorGroup},measureIndex:t,...n},s={source:"miniCube",field:r.isDimensionless?e:o.major,props:a};return r.isDimensionless&&(s.value=t),s}),filter:a.isButterfly?e=>!e.negative.value:void 0}}}const yf="mini-collection",vf="mini-stack-collection",bf="mini-continuous-collection",xf="miniCube",Sf=(e,t)=>{const n=(e=>{const t=[df(e,{collectionKey:ff})];return e.layoutService.meta.isStacked&&t.push(hf(e,{collectionKey:pf})),t})(t),i=((e,t)=>{const n=[];return uu({layoutService:t.layoutService}).miniChart&&(t.reducedDataModel.mode.isContinuous?n.push(df(t,{collectionKey:bf},xf)):t.layoutService.meta.isStacked?n.push(function(e,{collectionKey:t}){const{colorService:n,reducedDataModel:{fields:i,mode:o}}=e;return{key:t,data:{extract:i.minor.map((e,t)=>{const r={end:{field:e,reduceLabel:"none"},...o.isStackedByMeasure&&!o.isReduced?n.getMain().getDatumProps(t):{}};return o.isContinuous&&(r.timeStart={field:i.major,value:e=>e.qNum},r.timeEnd=r.timeStart),{source:"miniCube",field:i.major,props:r}}),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}}(t,{collectionKey:vf})):n.push(gf(t,{collectionKey:yf}))),n})(0,t);return n.concat(i)};function Mf(e,t,n,i){const o=[{position:e,onBackground:!0,justify:0,overflow:i}];if(t){const t={fill:"#e6e6e6",padding:{left:2,right:2,top:2,bottom:2}};o.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return o}function qf({layout:e,component:t},n,i){if(!yh(e,n))return!1;const{layoutService:o,chart:r,dockService:a,viewModel:s,themeService:l,styleService:u}=n,{meta:c}=o,d=!gh(e,n),m=l.getStyles(),h=u.label.getStyle(),f=h.useContrastColor;function p(e){const t=r.formatter(Jd.FORMATTER.MINOR);return t?t(e):e}const g={label:function(e){return 0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":p(e.data.sumOfPositives.value)},simplifiedPlacements:Mf("outside",d,f,c.isContinuous),style:m.label.value},y={label:function(e){return 0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":p(e.data.sumOfNegatives.value)},simplifiedPlacements:Mf("opposite",d,f,c.isContinuous),style:m.label.value},v=[hh(ne(n,g)),hh(ne(n,y))];return{key:"stack-total-labels",type:"labels",renderer:Nl(),layout:{displayOrder:2,minimumLayoutMode:"XSMALL"},settings:{sources:[{component:t,selector:"rect",strategy:{type:"bar",settings:{direction:e=>ph(e.data.sumOfPositives.value,a.meta.minor.orientation,i),labels:v,fontSize:parseInt(h.fontSize,10),fontFamily:h.fontFamily,linkData:bl.labels.linkData}}}]},animations:{enabled:s.animations.enabled,trackBy:bl.labels.trackBy,compensateForLayoutChanges:bl.labels.compensateForLayoutChanges}}}function Cf(e,t,n){const i=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return i.push({position:"inside",onBackground:!1,justify:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),i}function wf({layout:e,type:t},n){const{layoutService:i,viewCache:o,themeService:r,styleService:a}=n,{meta:s}=i,{isStacked:l}=s;if(!l&&!gh(e,n)||l&&!yh(e,n))return!1;const u=o.get("minorMinMax");if(!u.hasExplicitMinMax||t===oh&&0===u.max||t===rh&&0===u.min)return!1;if(!sh(t===oh?u.implicitMax:u.implicitMin,u,t))return!1;const c=r.getStyles(),d=a.label.getStyle();let m=e=>e.data.end.label;s.isStacked&&(m=t===oh?function(e){if(sh(e.data.sumOfNegatives.value,u,t)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value,i=n.chart.formatter(Jd.FORMATTER.MINOR);return i?i(t):t}return""}:function(e){if(sh(e.data.sumOfPositives.value,u,t)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value,i=n.chart.formatter(Jd.FORMATTER.MINOR);return i?i(t):t}return""});const h={label:m,simplifiedPlacements:Cf("outside",0,s.isContinuous),styles:c},f={label:m,simplifiedPlacements:Cf("opposite",0,s.isContinuous),styles:c},p=[hh(ne(n,h)),hh(ne(n,f))],g="vertical"===n.dockService.meta.minor.orientation?"down":"right",y=[{component:`${Jd.COMPONENT.GHOST_BAR_OOB}-${t}`,selector:"rect",strategy:{type:"bar",settings:{direction:g,labels:p,fontSize:parseInt(d.fontSize,10),fontFamily:d.fontFamily,linkData:bl.labels.linkData}}}];return{key:`bar-oob-labels-${t}`,type:"labels",renderer:Nl(),layout:{minimumLayoutMode:"XSMALL"},settings:{sources:y},animations:{enabled:n.viewModel.animations.enabled,trackBy:bl.labels.trackBy,compensateForLayoutChanges:bl.labels.compensateForLayoutChanges}}}function Tf(e){return"all"===e||"title"===e}function kf(e,t,n){if(!Tf(e.dimensionAxis.show)||t.layoutService.meta.isDimensionless)return!1;const i=t.alternativeService.getAlternatives(),{actions:o}=t,r=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"dimension-title",renderer:"react-qcm",layout:{minimumLayoutMode:zm[`${t.dockService.meta.major.orientation}DimensionAxisTitle`].minimumLayoutMode,dock:t.dockService.meta.major.dock},data:{infos:t.layoutService.getHyperCubeValue("qDimensionInfo"),alternatives:i.dimensions,filtered:t.layoutService.meta.filteredFields.dimensions},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!o?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:r.color,fontFamily:r.fontFamily,fontSize:r.fontSize}}}}function Nf(e,t,n){if(!Tf(e.measureAxis.show))return!1;const i=t.alternativeService.getAlternatives(),{actions:o}=t,r=t.styleService.axis.title.getStyle();return{type:"axis-title",key:"measure-title",renderer:"react-qcm",layout:{minimumLayoutMode:"SMALL",dock:t.dockService.meta.minor.dock},data:{infos:t.layoutService.getHyperCubeValue("qMeasureInfo"),alternatives:i.measures,filtered:t.layoutService.meta.filteredFields.measures},resources:{app:t.app,cache:t.viewCache,model:t.model,selections:t.selections,translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!o?.interact?.enabled(),isRTL:n,isSnapshot:t.layoutService.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"measure"},style:{title:{color:r.color,fontFamily:r.fontFamily,fontSize:r.fontSize}}}}function Df({environment:e,rtl:t,refLineModel:n,layoutService:i,colorService:o,dockService:r,themeService:a,viewModel:s,chart:l}){const{theme:u,localeInfo:c}=e,d={resolveUIColor:o.getMain().getPaletteColor},m=a.getStyles(),h=s.animations.enabled;return[Cl({refLineModel:n,layoutService:i,colorModel:d,dockService:r,animationsEnabled:h,chart:l,scale:Jd.SCALE.MAIN.MINOR,axis:"horizontal"===r.meta.major.orientation?"y":"x",key:Jd.COMPONENT.MEASURE_REF_LINE,minimumLayoutMode:zm.refLines.minimumLayoutMode}),Cl({isDimension:!0,refLineModel:n,layoutService:i,colorModel:d,dockService:r,animationsEnabled:h,chart:l,scale:Jd.SCALE.MAIN.MAJOR,axis:"horizontal"===r.meta.major.orientation?"x":"y",rtl:t,key:Jd.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:Jd.COMPONENT.BAR,minimumLayoutMode:zm.refLines.minimumLayoutMode}),...wl({refLineModel:n,layoutService:i,colorModel:d,animationsEnabled:h,dock:r.meta.minor.opposite,scale:Jd.SCALE.MAIN.MINOR,style:m,formatter:Jd.FORMATTER.MINOR,theme:u,localeInfo:c,rtl:t,key:Jd.COMPONENT.MEASURE_REF_LINE_LABEL}),...wl({isDimension:!0,refLineModel:n,layoutService:i,colorModel:d,animationsEnabled:h,dock:r.meta.major.opposite,scale:Jd.SCALE.MAIN.MAJOR,style:m,theme:u,localeInfo:c,rtl:t,key:Jd.COMPONENT.DIMENSION_REF_LINE_LABEL})]}function Lf({dockService:e,layoutService:t,discrete:n,continuousDataModel:i,viewModel:o}){if(!!uu({layoutService:t}).none)return!1;const{rtl:r}=e.config,a="horizontal"===e.meta.chart.orientation,s=!a,{dock:l}=e.meta.major,{show:u}=t.getLayoutValue("dimensionAxis",{}),c="none"!==u;if(s&&c&&"bottom"===l)return!1;if(a&&c){if(!r&&"right"===l)return!1;if(r&&"left"===l)return!1}const d=r?"left":"right";return{type:"space",key:Jd.COMPONENT.SPACE,layout:{dock:s?"bottom":d,minimumLayoutMode:"XSMALL"},show:()=>t.meta.isContinuous?i.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{size:Math.max(6,Math.min(16,Math.floor(.025*e.meta.minor.size)))},animations:{enabled:o.animations.enabled,trackBy:()=>Math.random()}}}function Ef({chart:e,chartModel:t,discreteModel:n,colorService:i,themeService:o,layoutService:r,dockService:a,context:s,resources:l,viewCache:u}){const c=[],d=r.getLayoutValue("plugins");if(!Array.isArray(d)||0===d.length)return c;!function(e){e.forEach(e=>{e&&!e.cId&&(e.cId=$r.generateId)})}(d);const m=[],h=function(e){const t=[];return e.forEach(e=>{e?.type!==t[t.length-1]?.[0]?.type||"point"!==e?.type&&("line"!==e?.type||e?.showPoints||t[t.length-1]?.[0]?.showPoints)?t.push([e]):t[t.length-1].push(e)}),t}(d);return h.forEach((u,d)=>{const h=`points-addon-${d}`,f=`lines-addon-${d}`;switch(u[0]?.type){case"point":c.push(Al({chart:e,chartModel:t,discreteModel:n,colorService:i,themeService:o,layoutService:r,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:Jd.SCALE.MAIN.MAJOR,minorScale:Jd.SCALE.MAIN.MINOR,mainComponentKey:Jd.COMPONENT.BAR,data:u,key:h})),m.push({key:h,lines:!1,labels:!0,fixed:!0,duplicates:!0});break;case"line":c.push(function({chart:e,chartModel:t,discreteModel:n,colorService:i,layoutService:o,dockService:r,rtl:a,majorScale:s,minorScale:l,mainComponentKey:u,data:c,key:d,scales:m={}}){if(!Array.isArray(c)||0===c.length)return!1;const h={resolveUIColor:i.getMain().getPaletteColor},f="horizontal"===r.meta.major.orientation,p=!(!f||!a),{canBeContinuous:g,isContinuous:y}=o.meta,v=o.getLayout(),b=Ys.getDimensionValuesInfo({layout:v,canBeContinuous:g,discreteModel:n,layoutService:o}),x=[];c.forEach((e,t)=>{const n=(e?.points??[]).map((n,i)=>({...n,lineId:t,style:0===i?e.style:void 0}));x.push(...n)});const S={},M=[];c.forEach(e=>M.push(...(e?.points??[]).map(e=>e.dimensionValue))),M.forEach(e=>{b[e]&&(S[e]?(S[e].innerValues=b[e].innerValues,S[e].minOrder=Math.min(S[e].minOrder,b[e].minOrder),S[e].maxOrder=Math.max(S[e].maxOrder,b[e].maxOrder),S[e].isMinOrderOk=S[e].isMinOrderOk||b[e].isMinOrderOk,S[e].isMaxOrderOk=S[e].isMaxOrderOk||b[e].isMaxOrderOk):S[e]={id:b[e].id,dataNode:b[e].dataNode,qText:b[e].qText,innerValues:b[e].innerValues,minOrder:b[e].minOrder,maxOrder:b[e].maxOrder,isMinOrderOk:b[e].isMinOrderOk,isMaxOrderOk:b[e].isMaxOrderOk},S[e].numInnerValues=(S[e].maxOrder||0)-(S[e].minOrder||0)+1)});const q=x[0];x.forEach(t=>{const n=El({point:t,dimensionValueInfo:S,layoutService:o}),i=t?.scale,r=q?.scale,a=o?.meta?.isButterfly,s=o?.meta?.isStacked,l=S[t.dimensionValue]?.dataNode;let u=n;const c=r&&i&&r!==i,d=a&&1===t.measureIndex,h=s&&Array.isArray(l);if(c)u=function(e,t,n){const i=t.min(),o=t.max(),r=n.min(),a=n.max();return o===i?r:r+(e-i)/(o-i)*(a-r)}(n,m[i]||e.scale(i),m[r]||e.scale(r));else if(d)u=-n;else if(h&&void 0!==t.measureIndex&&Array.isArray(l)){const e=l.slice(0,t.measureIndex+2),n=l[t.measureIndex+1]?.qNum;if("number"==typeof n&&0!==n){const t=Math.sign(n);u=e.reduce((e,n)=>{const i=n.qNum;return"number"==typeof i&&Math.sign(i)===t?e+i:e},0)}}t.validMeasureValue=u});const C={scale:s,fn:({datum:t})=>{const n=e.scale(s),i=t.value.dimensionValue;return y?n("string"==typeof i?""===i?void 0:+i:i):void 0!==S[i]?Ys.getScaledPosition({scale:n,value:S[i].id,valueInfo:S[i],size:e.component(u)?.rect[f?"width":"height"],align:"center",invert:p,layoutService:o,isContinuous:y}):void 0}},w={scale:l,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:d,type:"line",data:x,settings:{connect:!0,coordinates:{major:f?C:w,minor:f?w:C,layerId:({datum:e})=>e.value.lineId},layers:{curve:({datum:e})=>e.value.style?.lineCurve??"monotone",line:{strokeWidth:({datum:e})=>e.value.style?.lineThickness??3,stroke:({datum:e})=>Ll({colorModel:h,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),strokeDasharray:({datum:e})=>e.value.style?.lineType}}},animations:{enabled:t.query.animationsEnabled,trackBy:bl.nonUpdatingNode.trackBy,compensateForLayoutChanges:bl.lines.compensateForLayoutChanges}}}({chart:e,chartModel:t,discreteModel:n,colorService:i,layoutService:r,dockService:a,rtl:s.rtl,majorScale:Jd.SCALE.MAIN.MAJOR,minorScale:Jd.SCALE.MAIN.MINOR,mainComponentKey:Jd.COMPONENT.BAR,data:u,key:f})),u.forEach((u,d)=>{if(u?.showPoints&&u?.points){const h=`points-${d}-for-${f}`;c.push(Al({chart:e,chartModel:t,discreteModel:n,colorService:i,themeService:o,layoutService:r,dockService:a,flags:l.flags,rtl:s.rtl,majorScale:Jd.SCALE.MAIN.MAJOR,minorScale:Jd.SCALE.MAIN.MINOR,mainComponentKey:Jd.COMPONENT.BAR,data:u.points,key:h})),m.push({key:h,lines:!0,labels:!0,duplicates:!0})}else u?.points&&m.push({key:f,lines:!0,labels:!1,duplicates:!0,points:u.points})})}}),c.push(function({layoutService:e,dockService:t,chartModel:n,themeService:i,configs:o,cache:r}){const a=e.getLayoutValue("plugins"),{rtl:s}=t.config,{orientation:l}=t.meta.major,{isOneDimensional:u,isStacked:c}=e.meta,d=i.getStyles();return{type:"point-label",key:"plugins-point-labels",renderer:Nl(),settings:{all:!0,cache:r,configs:o,label:e=>e.value?.label?.value?e.value?.label?.value:c?e.point?.label:e.end?.label,lineId:({data:e})=>{for(let t=0;t<a.length;t++){const n=a[t];switch(n.type){case"point":if(n.cId===e.value?.cId)return n.cId;break;case"line":if(n.points.some(t=>t.cId===e.value?.cId))return n.cId}}return e.value?.cId||e.line?.value},majorValue:e=>e.value?.dimensionValue?e.value.dimensionValue:u?e.value:e.major?.value,orientation:l,pointValue:e=>e.value?.validMeasureValue,rtl:s},style:d.plugins.label,animations:{enabled:n.query.animationsEnabled,trackBy:bl.nonUpdatingNode.trackBy,compensateForLayoutChanges:bl.labels.compensateForLayoutChanges}}}({layoutService:r,dockService:a,chartModel:t,themeService:o,configs:m,flags:l.flags,cache:u})),c}const Of=(e,t,n)=>{const{layoutService:i,dockService:o,colorService:r,chart:a,actions:s,discrete:l,continuousDataModel:u,reducedDataModel:c,viewModel:d,viewState:m,viewCache:h,themeService:f,refLineModel:p,pluginService:g,tooltipService:y,rtl:v,logicalSize:b,trendLineModel:x,disclaimerService:S}=t,{localeInfo:M}=n,q=function(e,t){const{disclaimerService:n,themeService:i,translator:o}=e,r=n.getDisclaimer();if(!r)return!1;const{fontFamily:a}=i.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:r.alignment},settings:{isRTL:t,label:o.get(`Object.Disclaimer.${r.key}`)},style:{fontFamily:a}}}(t,v);if(S.getHasSuppressingDisclaimer())return{components:[q]};const C=ef(e,t,{localeInfo:M,rtl:v}),w=!s?.interact?.enabled(),T=r.getMain().getLegend({eventName:"legend-c",key:"legend-color",viewState:m,chart:a,styleReference:"object.barChart",styleOverrides:{title:t.styleService.legend.title.getStyle(),label:t.styleService.legend.label.getStyle()},rtl:v,settings:{item:{shape:{size:10}}}},{actions:s,navigationDisabled:w}),k=T.components[0];if(k){const{dock:e}=k.layout;if(C.fillRange&&(["right","left"].includes(e)||v)&&(C.fillRange.invert=!0),"legend-seq"===k.type&&void 0!==d.selectionDimensionIdx&&C.fillRange&&C.fillRange.min<C.fillRange.max){const e=Rm({eventName:"legendRange",key:"legendRangeBrush",targets:[k.key],fillTargets:[k.key],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:k.layout.dock,scale:"fillRange",bubblesPlacement:"outside",onEdited:()=>{s.select.emit("end","legendRange")}},t);T.components.push(...e.components),T.interactions.unshift(...e.interactions)}}else C.fillRange&&v&&(C.fillRange.invert=!0);const N=((e,{componentKey:t,collectionKey:n})=>{const{layoutService:i,colorService:o,dockService:r,discrete:a,viewModel:s}=e,{meta:l}=i,u=o.getMain().getPaletteColor;let c,d;l.isGroupedByDimension?c=({scale:e,datum:t})=>e([t.group.value,t.value])+e.bandwidth([t.group.value,t.value])/2:l.isGroupedByMeasure&&(c=({scale:e,datum:t})=>e([t.value,t.measureIndex.value])+e.bandwidth()/2);let m=2;l.isContinuous?(d={start:"timeStart",end:"timeEnd"},m=Qm(e,t)):l.isStacked&&(d="stack");const h=l.isStackedByDimension&&i.getHyperCubeValue("qStackedDataPages.0.qArea.qHeight",NaN)>1,f=e=>!0===e.datum.null?.value,p=i.getLayoutValue("components",null),g=p?p.filter(e=>e.key===t)[0]:null,y=e=>{const t=e?.minWidthPx;return Ds.isNumber(t)?t<=5?0:Math.min(2,t/10):0};return{key:t,type:"box",data:{collection:n},preferredSize:l.isContinuous?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,brush:{consume:[{context:"selection",data:["selectionDimension","axisSelectionDimension","end","fill","timeEnd"],style:{active:{strokeWidth:(()=>{if(h)return 0;if(!l.isContinuous)return 2;const e=i.getLayout(),t=e.qHyperCube?.qDimensionInfo?.[0]?.continuous?.period;return t&&"none"!==t?y:0})(),stroke:"#000"},inactive:{opacity:.3}}}]},settings:{major:{scale:Jd.SCALE.MAIN.MAJOR,fn:c,ref:d},minor:{scale:Jd.SCALE.MAIN.MINOR},orientation:r.meta.minor.orientation,box:{width:$m({layoutService:i,discrete:a}),minWidthPx:m,fill:o.getMain().getColor(),opacity:e=>f(e)?0:void 0,minHeightPx:function(e){return l.isStacked?.1:f(e)?.01:.3},strokeWidth:g?.style?.strokeWidth?Um.BAR.STROKE.WIDTH[g.style.strokeWidth.toUpperCase()]:Um.BAR.STROKE.WIDTH.NONE,stroke:g?.style?.strokeColor?.color?u(g?.style?.strokeColor):Um.BAR.STROKE.COLOR},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},animations:{enabled:s.animations.enabled,isMainComponent:!0,trackBy:bl.bars.trackBy,compensateForLayoutChanges:bl.bars.compensateForLayoutChanges}}})(t,{componentKey:Jd.COMPONENT.BAR,collectionKey:Jd.COLLECTION.MAIN}),D=((e,{componentKey:t,collectionKey:n})=>{const{meta:i}=e.layoutService;if(!i.isStacked)return!1;let o=2;i.isContinuous&&(o=Qm(e,t));const r={key:t,type:"box",data:{collection:n},settings:{major:{scale:Jd.SCALE.MAIN.MAJOR},minor:{scale:Jd.SCALE.MAIN.MINOR,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:e.dockService.meta.minor.orientation,box:{width:$m({layoutService:e.layoutService,discrete:e.discrete}),minWidthPx:o,opacity:0,fill:"none"},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:{consume:[{context:"selection",data:[""],style:{active:{strokeWidth:2,stroke:"#000",opacity:e=>!0===e.data?.null?.value?0:1},inactive:{opacity:e=>!0===e.data?.null?.value?0:.3}}}]}};return i.isContinuous&&(r.settings.major.ref={start:"timeStart",end:"timeEnd"}),r})(t,{componentKey:Jd.COMPONENT.STACK_TOTAL_BAR,collectionKey:Jd.COLLECTION.STACK_TOTAL}),L=rf(t,n,d.selectionDimensionIdx),{isStacked:E}=i.meta;let O;O=c.mode.isContinuous?Jd.COLLECTION.MINI_CONTINUOUS:E?Jd.COLLECTION.MINI_STACK:Jd.COLLECTION.MINI;const A=E?D:N,I=Nh(0,t),P=[...I,cf(t,{barComponent:A,type:"max",isStacked:E}),cf(t,{barComponent:A,type:"min",isStacked:E}),uh(t,{barComponent:A,type:"max",isStacked:E}),uh(t,{barComponent:A,type:"min",isStacked:E}),dh(t,{chart:a,type:"max",collectionKey:E?Jd.COLLECTION.STACK_TOTAL:Jd.COLLECTION.MAIN}),dh(t,{chart:a,type:"min",collectionKey:E?Jd.COLLECTION.STACK_TOTAL:Jd.COLLECTION.MAIN}),..._m(e,t,v,!!I[0]),N,D,sf({layoutService:i,viewModel:d,dockService:o}),kf(e,t,v),Nf(e,t,v),...Df({environment:n,rtl:v,refLineModel:p,layoutService:i,colorService:r,dockService:o,themeService:f,viewModel:d,chart:a}),hs({viewState:m,viewCache:h,layoutService:i,dockService:o,rtl:v}),Lf({dockService:o,layoutService:i,discrete:l,continuousDataModel:u,viewModel:d}),zh(N,t,{collectionKey:O}),cu({layoutService:i,dockService:o,discrete:l,continuousDataModel:u,viewState:m,viewCache:h,themeService:f,rtl:v,deviceType:n.deviceType}),...Id({majorScale:Jd.SCALE.MAIN.MAJOR,minorScale:Jd.SCALE.MAIN.MINOR,tooltipOverlay:Jd.COMPONENT.TREND_LINES_TOOLTIP_OVERLAY},{layoutService:i,trendLineModel:x,dockService:o,animationsEnabled:d.animations.enabled}),...T.components,bh({layout:e,component:Jd.COMPONENT.BAR,minorScale:C.minor},t,v),qf({layout:e,component:Jd.COMPONENT.STACK_TOTAL_BAR},t,v),wf({layout:e,type:"max"},t),wf({layout:e,type:"min"},t),...L.components,...y.getComponents(),!1!==e.showDisclaimer&&q,Hd({tooltip:Jd.COMPONENT.TREND_LINES_TOOLTIP,formatter:Jd.FORMATTER.MINOR},t,{rtl:v}),...Ef({chart:a,chartModel:{query:{animationsEnabled:d.animations.enabled}},discreteModel:l,colorService:r,themeService:f,layoutService:i,dockService:o,context:{},resources:t,viewCache:h})].filter(Boolean);!function(e){if(e&&0!==e.length)for(let t=0;t<e.length;t++)e[t].layout=e[t].layout||{},e[t].layout.displayOrder=t}(P);return{interactions:Ih(t,{rtl:v,hammer:{gestures:[...T.interactions,...L.gestures].sort((e,t)=>(t.prio||0)-(e.prio||0))}}),scales:C,palettes:r.getMain().getPalettes(),components:g.extendComponents(P),strategy:Br(0,{logicalSize:b,minCenterRatio:0}),formatters:xh(t,C),collections:Sf(0,t)}};const Af=({environment:e,services:t,chart:n,viewState:i,bootstrapped:o})=>{$(r=>{if(!e||!t||!o)return;const{layoutService:a,dockService:s,colorService:l,discrete:u,continuousDataModel:c,reducedDataModel:d}=t,{width:m,height:h}=s.meta.chart.size;if(r.snapshotData=r.snapshotData||{},r.snapshotData.content={size:{w:m,h:h}},a.meta.isSnapshot)return Promise.resolve();r.snapshotData.content.chartData={scrollOffset:i.get("scrollOffset"),zoom:i.get("zoom"),legendScrollOffset:Xr(n,Jd.COMPONENT.LEGEND_COLOR_CAT)};const{properties:f}=o,p=f?.qHyperCubeDef.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return p&&(r.tooltip.auto=!0),a.meta.isDiscrete?(u.command.setSnapshotData(r),d.setSnapshotData(r)):c.setSnapshotData(r),l.getMain().getSnapshotData().then(e=>{r.snapshotData.content.chartData={...r.snapshotData.content.chartData,...e}}).catch(()=>{})}),W(()=>({getViewState(){if(i&&n)return{scrollOffset:i.get("scrollOffset"),zoom:i.get("zoom"),legendScrollOffset:Xr(n,Jd.COMPONENT.LEGEND_COLOR_CAT)}}}),[i,n])},If=e=>"[object Object]"===Object.prototype.toString.call(e),Pf=e=>Array.isArray(e);function Rf(e,t){if(e===t)return!0;if(Pf(e)){if(!Pf(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Rf(e[n],t[n]))return!1;return!0}if(If(e)){if(!If(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let i=0;i<n.length;i++){if(!Object.hasOwn(t,n[i]))return!1;if(!Rf(e[n[i]],t[n[i]]))return!1}return!0}return e===t}const zf=({properties:e,layout:t,isStacked:n,isContinuous:i,model:o,layoutService:r})=>{const a=t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode),s=t.qHyperCube.qMeasureInfo.filter(e=>7005!==e.qError?.qErrorCode),l=ne(!0,{},e);return((e,t,n)=>{const{color:{mode:i}}=n;e.length>1&&n.color?n.color.persistent=!0:"byDimension"===i&&t.length>1?n.color.mode="byMultiple":"byExpression"===i&&0===t.length?n.color.mode="primary":0===e.length&&t.length>0&&(n.color.byMeasureDef=void 0,n.color.byDimDef=void 0,1===t.length&&"byExpression"!==i&&(n.color.mode="primary"))})(a,s,e),a.length>1&&n&&!i&&"S"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="K"),a.length<2&&"K"===e.qHyperCubeDef.qMode&&(e.qHyperCubeDef.qMode="S"),o.colorSupport?.colorByUpdater?.(e,"qHyperCubeDef.",t),function({properties:e,layoutService:t}){const{filteredFields:n}=t.meta;if(!(n.measures.length>0))return;const{mode:i}=e.color||{};if("byExpression"===i){const i=t.getLayout();if("colorByExpression"===i.qHyperCube.qMeasureInfo?.[0]?.qAttrExprInfo?.[0]?.id)return;const{current:o,target:r}=function({properties:e,filtered:t}){const{qMeasures:n}=e.qHyperCubeDef||[],{current:i,target:o}=n.reduce((e,n,i)=>("colorByExpression"===n.qAttributeExpressions[0]?.id&&(e.current=i),void 0!==e.target||t.includes(i)||(e.target=i),e),{current:void 0,target:void 0});return{current:i,target:o}}({properties:e,filtered:n.measures});if(void 0===o)return;const a=e.qHyperCubeDef.qMeasures[o].qAttributeExpressions[0];e.qHyperCubeDef.qMeasures[o].qAttributeExpressions.splice(0,1),e.qHyperCubeDef.qMeasures[r].qAttributeExpressions.splice(0,0,a)}}({properties:e,layoutService:r}),!bs.compare(l,e,!0)&&JSON.stringify(l)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)};function Hf(e,t){if("custom"===e.dimensionAxis.axisDisplayMode){const n=t.layout.qHyperCube.qMeasureInfo.filter(e=>e.qError?.qErrorCode!==Nc).length,i=t.layout.qHyperCube.qDimensionInfo.filter(e=>e.qError?.qErrorCode!==Nc).length,o=e.dimensionAxis.maxVisibleItems;o<1?e.dimensionAxis.maxVisibleItems=10:o>1e4/(i+n)&&(e.dimensionAxis.maxVisibleItems=Math.min(o,Math.floor(1e4/(i+n))))}}const Bf=[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],Ff=(e,t,n)=>{const i=`${e}.fontFamily`,o=`${e}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:i,options:()=>t.getOptions(i),defaultValue:()=>t.getDefaultValue(i)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:o,options:()=>t.getOptions(o),defaultValue:()=>t.getDefaultValue(o)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:n.getStyle("object.barChart",e,"color")})}}}}};function jf(e){return{classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"LayerStyleEditor.style.strokeWidth",component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:Object.keys(Bf).map(e=>Bf[e]),schemaIgnore:!0,defaultValue:Bf[0].value},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891",index:-1},width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"items",show:(e,t)=>!Yr.continuous({layout:t.layout}),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:(e,t,n)=>((e,t)=>{const n=t.qHyperCube?.qMeasureInfo?.filter(e=>e.qError?.qErrorCode!==Nc).length,i=t.qHyperCube?.qDimensionInfo?.filter(e=>e.qError?.qErrorCode!==Nc).length,o="grouped"===e.barGrouping?.grouping&&i>0&&n+i>2;return Yr.continuous({layout:t})?1:o?.9:.7})(n.properties,n.layout)}}}}},optionsSection:{translation:"LayerStyleEditor.label.Options",component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollbar:{ref:"scrollbar",translation:"properties.scrollbar",component:"dropdown",type:"string",options:Object.keys(ru.OPTIONS).map(e=>ru.OPTIONS[e]),schemaIgnore:!0,defaultValue:ru.DEFAULT.value},scrollAlignment:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",schemaIgnore:!0,defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},gridLines:{type:"items",items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}}}}}}}function Vf(e,t,n,i=!1){return i?jf(t):function(e,t,n){const i=M({theme:e,translator:n,config:{id:"barChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]},flags:t});return{component:"styling-panel",show:!0,chartType:"barchart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.BarChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:t?.isEnabled("SENSECLIENT_IM_2428_BARCHART_BG"),items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:Object.keys(Bf).map(e=>Bf[e]),defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue(e,t,n){const{properties:i}=n,{barGrouping:o,qHyperCubeDef:r}=i,a=r.qMeasures.length,s=r.qDimensions.length,l="grouped"===o.grouping&&s>0&&a+s>2;return Yr.continuous({properties:i})?1:l?.9:.7},schemaIgnore:!0}}}}},axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:{axisTitleItems:{component:"items",ref:"components",key:"axis",items:Ff("axis.title",i,e)}}},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:{axisLabelItems:{component:"items",ref:"components",key:"axis",items:Ff("axis.label.name",i,e)}}},labelSection:t?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.labelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"label",items:{...Ff("label.value",i,e),contrastColor:{component:"checkbox",type:"boolean",ref:"label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0,legendTitleSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{legendTitleSection:{component:"items",ref:"components",key:"legend",items:Ff("legend.title",i,e)}}}:void 0,legendLabelSection:t?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{legendLabelSection:{component:"items",ref:"components",key:"legend",items:Ff("legend.label",i,e)}}}:void 0}}}(e,t,n)}const _f=e=>e.qError?.qErrorCode!==Nc,Uf=(e,t)=>e?.qHyperCube[t].filter(e=>_f(e)),$f=e=>{if(!e)return!1;const t=ne(!0,{},e);return t.qHyperCube.qMeasureInfo=Uf(e,"qMeasureInfo"),t.qHyperCube.qDimensionInfo=Uf(e,"qDimensionInfo"),t&&!Yr.continuous({layout:t})&&Yr.stacked(t)},Wf=({translator:e,flags:t,anything:n})=>{const i={type:"items",show:Zl,items:{period:{translation:Xl,type:"string",component:"dropdown",ref:"qHyperCubeDef.qDimensions.0.qDef.continuous.period",show:Zl,globalChange:tu,options:[{value:nu.AUTO,translation:Jl.AUTO},{value:nu.SECONDS,translation:Jl.SECONDS},{value:nu.MINUTES,translation:Jl.MINUTES},{value:nu.HOURS,translation:Jl.HOURS},{value:nu.DAYS,translation:Jl.DAYS},{value:nu.WEEKS,translation:Jl.WEEKS},{value:nu.MONTHS,translation:Jl.MONTHS},{value:nu.YEARS,translation:Jl.YEARS},{value:nu.NUMBER,translation:Jl.NUMBER},{value:nu.NONE,translation:Jl.NONE}],undefinedValue:nu.NONE,defaultValue:nu.AUTO,schemaIgnore:!0},stepSize:{translation:Jl.TITLE,type:"number",defaultValue:iu,schemaIgnore:!0,show:Ql,ref:"qHyperCubeDef.qDimensions.0.qDef.continuous.stepSize",min:Number.EPSILON,rollbackInvalid:!0}}},o=n?.sense?.isUnsupportedFeature?.("continuousData"),r={items:{labels:{items:{header:{show:(e,t,n)=>Uf(n.layout,"qMeasureInfo").length},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show:(e,t,n)=>!$f(t.layout)&&Uf(n.layout,"qMeasureInfo").length},segmentLabels:{component:"checkbox",ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",defaultValue:!1,show:(e,t)=>$f(t.layout),convertFunctions:{get:(e,t,n,i)=>i.dataPoint.showLabels&&i.dataPoint.showSegmentLabels,set(e,t,n,i,o){o.dataPoint.showSegmentLabels=e,o.dataPoint.showLabels=o.dataPoint.showSegmentLabels||o.dataPoint.showTotalLabels}}},totalLabels:{component:"checkbox",ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",defaultValue:!0,show:(e,t)=>$f(t.layout),convertFunctions:{get:(e,t,n,i)=>i.dataPoint.showLabels&&i.dataPoint.showTotalLabels,set(e,t,n,i,o){o.dataPoint.showTotalLabels=e,o.dataPoint.showLabels=o.dataPoint.showSegmentLabels||o.dataPoint.showTotalLabels}}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t,n)=>Uf(n.layout,"qDimensionInfo").length&&Uf(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,i)=>"labels"===i.dimensionAxis.show||"none"===i.dimensionAxis.show,set(e,t,n,i,o){o.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.Measure.Hide",defaultValue:"all",show:(e,t,n)=>Uf(n.layout,"qMeasureInfo").length,convertFunctions:{get:(e,t,n,i)=>"labels"===i.measureAxis.show||"none"===i.measureAxis.show,set(e,t,n,i,o){o.measureAxis.show=e?"labels":"all"}}}}}}},a=n?.sense?.theme,s={uses:"settings",items:{simpleStyling:Vf(a,t,e,!0),simpleLabels:r,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:{boxStyling:Vf(a,t,e,!1),grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:(e,t)=>{const n=[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}];return Zd({layout:t.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){const n=Uf(t.layout,"qMeasureInfo").length,i=Uf(t.layout,"qDimensionInfo").length;return i>0&&n+i>2},globalChange(e,t,n){"butterfly"!==e.barGrouping.grouping||Zd({layout:n.layout})||(e.barGrouping.grouping="stacked"),"butterfly"===e.barGrouping.grouping&&e.measureAxis&&"max"!==e.measureAxis.minMax&&!e.measureAxis.autoMinMax&&(e.measureAxis.minMax="max")},change(e,t,n){"butterfly"!==e.barGrouping.grouping||Zd({layout:n.layout})||(e.barGrouping.grouping="stacked"),Uf(t.layout,"qDimensionInfo").length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"},readOnly:(e,t,n)=>Yr.continuous({layout:n.layout}),convertFunctions:{get(e,t,n){const i="stacked";return"butterfly"===e(t.type)?Zd({layout:n.layout})?e(t.type):i:Yr.continuous({layout:n.layout})?i:e(t.type)},set(e,t,n){const i=Qr(n.type,n);t(n.type,e,i)}}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>Yr.continuous({layout:n.layout}),convertFunctions:(l="vertical",{get:(e,t,n)=>Yr.continuous({layout:n.layout})?l:e(t.type),set(e,t,n){const i=Qr(n.type,n);t(n.type,e,i)}})},scroll:{type:"items",items:{scrollbar:{type:"string",component:"dropdown",ref:"scrollbar",translation:"properties.scrollbar",options:Object.keys(ru.OPTIONS).map(e=>ru.OPTIONS[e]),defaultValue:ru.DEFAULT.value},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!Yr.continuous({layout:n.layout})}}},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}},valueLabels:{type:"items",snapshot:{tid:"property-valueLabels"},items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,label:(t,n)=>((e,t,n)=>n&&n.get($f(t.layout)?"properties.on":"Common.Auto"))(0,n,e)},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&$f(n.layout)},showTotalLabels:{ref:"dataPoint.showTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showLabels&&$f(n.layout)}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:{items:{attributeExpression:Dl}},legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",items:{axisDisplaySettings:{components:"items",type:"items",show:(e,t,n)=>!Yr.continuous({layout:n.layout}),items:{axisDisplayMode:{ref:"dimensionAxis.axisDisplayMode",type:"string",translation:"properties.axis.displaymode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{ref:"dimensionAxis.maxVisibleItems",translation:"properties.axis.maxvisiblevalues",expression:"optional",type:"integer",invalid(e,t,n){const i=Uf(n.layout,"qMeasureInfo").length,o=Uf(n.layout,"qDimensionInfo").length,r=e.dimensionAxis.maxVisibleItems;return r<0||r>1e4/(o+i)},globalChange:Hf,defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}},continuousGroup:{items:{miniChart:null,continuousDimension:i},show:!o},othersGroup:{items:{label:{options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]}}}}},measureAxis:{uses:"axis.flippableMeasureAxis"},tooltip:{uses:"tooltip"}}};var l;return s.items.measureAxis={uses:"axis.flippableMeasureAxis",items:{minMax:{items:{minMax:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&!e.measureAxis.autoMinMax},min:{show:e=>"butterfly"!==e.barGrouping.grouping&&e.measureAxis&&["min","minMax"].includes(e.measureAxis.minMax)&&!e.measureAxis.autoMinMax},max:{invalid:e=>e.measureAxis&&"minMax"===e.measureAxis.minMax?e.measureAxis.min>=e.measureAxis.max:!(!e.measureAxis||"max"!==e.measureAxis.minMax||"butterfly"!==e.barGrouping.grouping)&&e.measureAxis.max<=0}}}}},s},Kf={uses:"sortingWithDisclaimer",items:{defaultSorting:{items:{dimensions:{locked:(e,t,n)=>1===n.getMeasures().length&&2===n.getDimensions().length&&0===e,items:{autoSort:{change(e){us(e)}}}},interColumnSorting:{reset:(e,t)=>{const{qDimensions:n,qMeasures:i,qInterColumnSortOrder:o}=e.qHyperCubeDef,{qCardinal:r}=t.layout.qHyperCube.qDimensionInfo[0],a=o.length,s=[...Array(a).keys()];1===n.length&&i.length>=1&&r>10&&([s[0],s[1]]=[s[1],s[0]]),e.qHyperCubeDef.qInterColumnSortOrder=s}}}}}},Gf=({translator:e,flags:t})=>({type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},refLines:{uses:"reflines"},dimRefLines:{uses:"dimReflines"},plugins:$l({translator:e,pluginOptions:[{value:"point",translation:e.get("Visualizations.Descriptions.Point")},{value:"line",translation:e.get("Visualizations.Descriptions.Line")}],supportNewStyles:t?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")})}}),Yf=({translator:e,anything:t})=>({uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,n,i){if(t?.sense?.isUnsupportedFeature?.("includeZeroValues"))return!1;const o=((e,t)=>{const n=t.layout?.qHyperCube?.qDimensionInfo?.findIndex(e=>_f(e));return t.properties?.qHyperCubeDef?.qDimensions?.[n]===e})(e,n),r=Yr.continuous({layout:i.layout});return!(o&&r)}},visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Dimensions.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},period:{type:"string",defaultValue:"auto",ref:"qDef.continuous.period",show:!1}}},measures:{items:{visibilityCondition:{type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},trendLines:t?.sense?.isUnsupportedFeature?.("trendlines")?void 0:_d({translator:e,allowStackedByDimension:!0})}}}});function Xf({translator:e,flags:t,anything:n}){return{type:"items",component:"accordion",items:{data:Yf({translator:e,anything:n}),sorting:Kf,addons:Gf({translator:e,flags:t}),settings:Wf({translator:e,flags:t,anything:n})}}}const Jf=e=>e.qError?.qErrorCode!==Nc;function Zf({flags:e}){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer",items:{sort:{items:{dimensions:{locked(e,t,n){const i=n.qHyperCube.qMeasureInfo.length,o=n.qHyperCube.qDimensionInfo.filter(e=>Jf(e)).length;return 1===i&&2===o&&0===e}}}}}},presentation:{uses:"presentation",items:{showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:(e,t)=>{const n=[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}];return Zd({layout:t?.layout})&&n.push({icon:"bars_butterfly",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.butterfly",value:"butterfly"}),n},show(e,t){return t.qHyperCube.qMeasureInfo.filter(e=>Jf(e)).length+t.qHyperCube.qDimensionInfo.filter(e=>Jf(e)).length>2&&!Yr.continuous({layout:t})&&(n=t,!(n?.qHyperCube?.qDimensionInfo?.filter(e=>Jf(e)).length>1&&n?.qHyperCube?.isHCEnabled));var n},change(e){e.qHyperCubeDef.qDimensions.length>1&&"stacked"===e.barGrouping.grouping?(e.qHyperCubeDef.qMode="K",e.qHyperCubeDef.qAlwaysFullyExpanded=!0):e.qHyperCubeDef.qMode="S"}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!Yr.continuous({layout:t})}}},color:{uses:"color"}}}}function Qf(e){const t={},n=a(e,"components"),i=a(e,"dimensionAxis.axisDisplayMode"),o=a(e,"dimensionAxis.maxVisibleItems"),r=n?n.filter(e=>"bar"===e.key)[0]:void 0,s=a(e,"tooltip");if(r&&r.style&&Object.keys(r.style).forEach(e=>{t[`chart_style_${e}`]=r.style[e]}),o&&(t.chart_dimaxis_maxVisibleItems=o),i&&(t.chart_dimaxis_axisDisplayMode=i),s){t.chart_tooltip_custom=!s.auto;const e=a(s,"chart.object.refId");!s.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const ep=e=>!!(e&&e.qHyperCube.qSize.qcy>0),tp={ACCUMULATIONS:"accumulation",MOVING_AVERAGE:"movingAverage",DIFFERENCE:"difference",NORMALIZATION:"normalization"};function np(){const e=[];return Object.keys(tp).forEach(t=>{e.push(tp[t])}),e}function ip(e){return{definition:Xf(e),softDefinition:Zf(e),support:{snapshot:ep,export:ep,exportData:!0,sharing:ep,viewData:!0,effects:!0,modifiers:np()},importProperties:(t,n,i,o)=>{const r={layout:{templateId:n.templateId}};i.mapProperties(r);const a={defaultDimension:i.getDefaultDimensionProperties(),defaultMeasure:i.getDefaultMeasureProperties()},s=G.axisChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:zc(e),defaultPropertyValues:a,hypercubePath:o,extension:i}),l=s.qProperty;return l.qHyperCubeDef.qDimensions.length>1&&"stacked"===l.barGrouping.grouping&&(l.qHyperCubeDef.qMode="K",l.qHyperCubeDef.qAlwaysFullyExpanded=!0),G.conditionalShow.unquarantine(l),G.conditionalShow.unquarantineAlternative(l),s},exportProperties:(e,t,n)=>{G.conditionalShow.quarantine(e.qProperty),G.conditionalShow.quarantineAlternative(e.qProperty);return G.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})},migrate:{properties:e=>(e.qExtendsId||(function(e){e.qHyperCubeDef.qDimensions.forEach(us),e.qHyperCubeDef.qLayoutExclude?.qHyperCubeDef?.qDimensions&&e.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(us)}(e),function({properties:e}){const{scrollbar:t,dimensionAxis:n,preferContinuousAxis:i,showMiniChartForContinuousAxis:o}=e;if(t||!1!==o)return;const{continuousAuto:r}=n;(r||!r&&i)&&(e.scrollbar=ru.OPTIONS.NONE.value)}({properties:e})),e)},extendMetrics:Qf}}}}});