@nebula.js/sn-histogram 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/esm/index.js CHANGED
@@ -1,12 +1,10 @@
1
1
  /*
2
- * @nebula.js/sn-histogram v1.0.0
2
+ * @nebula.js/sn-histogram v1.0.2
3
3
  * Copyright (c) 2025 QlikTech International AB
4
4
  * Released under the MIT license.
5
5
  */
6
6
 
7
- import{useConstraints as e,useState as t,useLayout as n,useEffect as r,useAction as i,useRect as o,useOptions as a,usePromise as s,useApp as l,useAppLayout as u,useDeviceType as c,useTheme as p,useTranslator as d,useMemo as f,onTakeSnapshot as m,useImperativeHandle as h,useElement as g,useModel as b,useSelections as y,useStaleLayout as v,useRenderState as x}from"@nebula.js/stardust";import q from"jquery";import D from"picasso.js";import S from"picasso-plugin-q";import E from"picasso-plugin-hammer";import C from"hammerjs";import M from"extend";var w={"Visualization.Histogram.MeasureAxisLabel":{id:"Visualization.Histogram.MeasureAxisLabel",locale:{"en-US":"Frequency","zh-TW":"頻率","zh-CN":"频率","tr-TR":"Sıklık","sv-SE":"Frekvens","it-IT":"Frequenza","es-ES":"Frecuencia","de-DE":"Häufigkeit","pl-PL":"Częstotliwość","nl-NL":"Frequentie","ko-KR":"빈도","pt-BR":"Frequência","fr-FR":"Fréquence","ja-JP":"レコード数","ru-RU":"Частота"}},"waterfall.legend.positiveValue.label":{id:"waterfall.legend.positiveValue.label",locale:{"en-US":"Positive","zh-TW":"正值","zh-CN":"正","tr-TR":"Pozitif","sv-SE":"Positiv","it-IT":"Positivi","es-ES":"Positivo","de-DE":"Positiv","pl-PL":"Dodatnie","nl-NL":"Positief","ko-KR":"양수","pt-BR":"Positivo","fr-FR":"Positive","ja-JP":"正","ru-RU":"Положительное"}},"waterfall.legend.negativeValue.label":{id:"waterfall.legend.negativeValue.label",locale:{"en-US":"Negative","zh-TW":"負值","zh-CN":"负","tr-TR":"Negatif","sv-SE":"Negativ","it-IT":"Negativi","es-ES":"Negativo","de-DE":"Negativ","pl-PL":"Ujemne","nl-NL":"Negatief","ko-KR":"음수","pt-BR":"Negativo","fr-FR":"Négative","ja-JP":"負","ru-RU":"Отрицательное"}},"waterfall.legend.subtotal.label":{id:"waterfall.legend.subtotal.label",locale:{"en-US":"Subtotal","zh-TW":"小計","zh-CN":"小计","tr-TR":"Ara Toplam","sv-SE":"Deltotal","it-IT":"Subtotale","es-ES":"Subtotal","de-DE":"Teilsumme","pl-PL":"Suma częściowa","nl-NL":"Subtotaal","ko-KR":"소계","pt-BR":"Subtotal","fr-FR":"Sous-total","ja-JP":"小計","ru-RU":"Подытог"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_RequireNumericDimension:{id:"Object.Disclaimer.RequireNumericDimension",locale:{"en-US":"This visualization requires a numeric diemnsion."}},"properties.boxplot.calculationMode.tukey.elements.boxEnd":{id:"properties.boxplot.calculationMode.tukey.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.tukey.elements.boxMiddle":{id:"properties.boxplot.calculationMode.tukey.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Drittes Quartil","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.tukey.elements.boxStart":{id:"properties.boxplot.calculationMode.tukey.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.tukey.elements.firstWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.firstWhisker",locale:{"en-US":"Box start - {0} IQR","zh-TW":"方塊開始 - {0} IQR","zh-CN":"框开始 - {0} IQR","tr-TR":"Kutu başlangıcı - {0} IQR","sv-SE":"Rutans start - {0} IQR","it-IT":"Inizio scatola - {0} IQR","es-ES":"Inicio de caja - {0} IQR","de-DE":"Box-Beginn - {0} IQR","pl-PL":"Początek wykresu pudełkowego - {0} IQR","nl-NL":"Begin box - {0} IQR","ko-KR":"상자 시작 - {0} IQR","pt-BR":"Início da caixa - {0} IQR","fr-FR":"Début de la boîte - {0} IQR","ja-JP":"ボックス開始 - {0} IQR","ru-RU":"Начало поля - {0} IQR"}},"properties.boxplot.calculationMode.tukey.elements.lastWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.lastWhisker",locale:{"en-US":"Box end + {0} IQR","zh-TW":"方塊結束 + {0} IQR","zh-CN":"框结束 + {0} IQR","tr-TR":"Kutu bitişi + {0} IQR","sv-SE":"Rutans slut + {0} IQR","it-IT":"Fine scatola + {0} IQR","es-ES":"Fin de caja + {0} IQR","de-DE":"Box-Ende + {0} IQR","pl-PL":"Koniec wykresu pudełkowego - {0} IQR","nl-NL":"Einde box + {0} IQR","ko-KR":"상자 끝 + {0} IQR","pt-BR":"Fim da caixa + {0} IQR","fr-FR":"Fin de la boîte + {0} IQR","ja-JP":"ボックス終了 + {0} IQR","ru-RU":"Конец поля + {0} IQR"}},"properties.boxplot.calculationMode.stdDev.elements.boxEnd":{id:"properties.boxplot.calculationMode.stdDev.elements.boxEnd",locale:{"en-US":"Box middle + 1 standard deviation","zh-TW":"方塊中間 + 1 個標準差","zh-CN":"框中部 + 1 个标准偏差","tr-TR":"Kutu ortası + 1 standart sapma","sv-SE":"Rutans mitt + 1 standardavvikelse","it-IT":"Centro scatola + 1 deviazione standard","es-ES":"Mitad de la caja + 1 desviación estándar","de-DE":"Box-Mitte +1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego + 1 odch. stand","nl-NL":"Midden box + 1 standaardafwijking","ko-KR":"상자 중간 + 1개 표준 편차","pt-BR":"Meio da caixa + 1 desvio padrão","fr-FR":"Milieu de la boîte + 1 écart type","ja-JP":"ボックス中間 + 1 標準偏差","ru-RU":"Середина поля + 1 стандартное отклонение"}},"properties.boxplot.calculationMode.stdDev.elements.boxMiddle":{id:"properties.boxplot.calculationMode.stdDev.elements.boxMiddle",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},"properties.boxplot.calculationMode.stdDev.elements.boxStart":{id:"properties.boxplot.calculationMode.stdDev.elements.boxStart",locale:{"en-US":"Box middle - 1 standard deviation","zh-TW":"方塊中間 - 1 個標準差","zh-CN":"框中部 - 1 个标准偏差","tr-TR":"Kutu ortası - 1 standart sapma","sv-SE":"Rutans mitt - 1 standardavvikelse","it-IT":"Centro scatola - 1 deviazione standard","es-ES":"Mitad de la caja - {1} desviación estándar","de-DE":"Box-Mitte -1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego - 1 odch. stand","nl-NL":"Midden box - 1 standaardafwijking","ko-KR":"상자 중간 - 1개 표준 편차","pt-BR":"Середина поля - 1 стандартное отклонение","fr-FR":"Milieu de la boîte - 1 écart type","ja-JP":"ボックス中間 - 1 標準偏差","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.stdDev.elements.firstWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.firstWhisker",locale:{"en-US":"Box middle - {0} standard deviations","zh-TW":"方塊中間 - {0} 個標準差","zh-CN":"框中部 - {0} 个标准偏差","tr-TR":"Kutu ortası - {0} standart sapma","sv-SE":"Rutans mitt - {0} standardavvikelser","it-IT":"Centro scatola - {0} deviazioni standard","es-ES":"Mitad de la caja - {0} desviaciones estándar","de-DE":"Box-Mitte -{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego - {0} odch. stand","nl-NL":"Midden box - {0} standaardafwijkingen","ko-KR":"상자 중간 - {0}개 표준 편차","pt-BR":"Meio da caixa - {0} desvios padrão","fr-FR":"Milieu de la boîte - {0} écarts types","ja-JP":"ボックス中間 - {0} 標準偏差","ru-RU":"Середина поля - {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.stdDev.elements.lastWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.lastWhisker",locale:{"en-US":"Box middle + {0} standard deviations","zh-TW":"方塊中間 + {0} 個標準差","zh-CN":"框中部 + {0} 个标准偏差","tr-TR":"Kutu ortası + {0} standart sapma","sv-SE":"Rutans mitt + {0} standardavvikelser","it-IT":"Centro scatola + {0} deviazioni standard","es-ES":"Mitad de la caja + {0} desviaciones estándar","de-DE":"Box-Mitte +{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego + {0} odch. stand","nl-NL":"Midden box + {0} standaardafwijkingen","ko-KR":"상자 중간 + {0}개 표준 편차","pt-BR":"Meio da caixa + {0} desvios padrão","fr-FR":"Milieu de la boîte + {0} écarts types","ja-JP":"ボックス中間 + {0} 標準偏差","ru-RU":"Середина поля + {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.fractiles.elements.boxEnd":{id:"properties.boxplot.calculationMode.fractiles.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile<","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.boxMiddle":{id:"properties.boxplot.calculationMode.fractiles.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Median","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.fractiles.elements.boxStart":{id:"properties.boxplot.calculationMode.fractiles.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth",locale:{"en-US":"5th percentile","zh-TW":"第 5 個百分位數","zh-CN":"第 5 个百分位","tr-TR":"5. yüzdebirlik","sv-SE":"5:e percentilen","it-IT":"5° percentile","es-ES":"5º percentil","de-DE":"5. Perzentil","pl-PL":"5. percentyl","nl-NL":"5e percentiel","ko-KR":"5번째 백분위수","pt-BR":"5º percentil","fr-FR":"5e centile","ja-JP":"5 番目のパーセンタイル","ru-RU":"5-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first",locale:{"en-US":"1st percentile","zh-TW":"第 1 個百分位數","zh-CN":"第 1 个百分位","tr-TR":"1. yüzdebirlik","sv-SE":"1:e percentilen","it-IT":"1° percentile","es-ES":"1er percentil","de-DE":"1. Perzentil","pl-PL":"1. percentyl","nl-NL":"1e percentiel","ko-KR":"1번째 백분위수","pt-BR":"1º percentil","fr-FR":"1er centile","ja-JP":"1 番目のパーセンタイル","ru-RU":"1-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min",locale:{"en-US":"Minimum","zh-TW":"最小","zh-CN":"最小值","tr-TR":"En az","sv-SE":"Min","it-IT":"Minimo","es-ES":"Mínimo","de-DE":"Minimum","pl-PL":"Minimum","nl-NL":"Minimum","ko-KR":"최소","pt-BR":"Mínimo","fr-FR":"Minimale","ja-JP":"最小値","ru-RU":"Минимум"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth",locale:{"en-US":"10th percentile","zh-TW":"第 10 個百分位數","zh-CN":"第 10 个百分位","tr-TR":"10. yüzdebirlik","sv-SE":"10:e percentilen","it-IT":"10° percentile","es-ES":"10º percentil","de-DE":"10. Perzentil","pl-PL":"10. percentyl","nl-NL":"10e percentiel","ko-KR":"10번째 백분위수","pt-BR":"10º percentil","fr-FR":"10e centile","ja-JP":"10 番目のパーセンタイル","ru-RU":"10-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max",locale:{"en-US":"Maximum","zh-TW":"最大","zh-CN":"最大值","tr-TR":"En fazla","sv-SE":"Max","it-IT":"Massimo","es-ES":"Máximo","de-DE":"Maximum","pl-PL":"Maksimum","nl-NL":"Maximum","ko-KR":"최대","pt-BR":"Máximo","fr-FR":"Maximale","ja-JP":"最大値","ru-RU":"Максимум"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth",locale:{"en-US":"90th percentile","zh-TW":"第 90 個百分位數","zh-CN":"第 90 个百分位","tr-TR":"90. yüzdebirlik","sv-SE":"90:e percentilen","it-IT":"90° percentile","es-ES":"90º percentil","de-DE":"90. Perzentil","pl-PL":"90. percentyl","nl-NL":"90e percentiel","ko-KR":"90번째 백분위수","pt-BR":"90º percentil","fr-FR":"90e centile","ja-JP":"90 番目の百分位数","ru-RU":"90-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth",locale:{"en-US":"95th percentile","zh-TW":"第 95 個百分位數","zh-CN":"第 95 个百分位","tr-TR":"95. yüzdebirlik","sv-SE":"95:e percentilen","it-IT":"95° percentile","es-ES":"95º percentil","de-DE":"95. Perzentil","pl-PL":"95. percentyl","nl-NL":"95e percentiel","ko-KR":"95번째 백분위수","pt-BR":"95º percentil","fr-FR":"95e centile","ja-JP":"95 番目の百分位数","ru-RU":"95-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth",locale:{"en-US":"99th percentile","zh-TW":"第 99 個百分位數","zh-CN":"第 99 个百分位","tr-TR":"99. yüzdebirlik","sv-SE":"99:e percentilen","it-IT":"99° percentile","es-ES":"99º percentil","de-DE":"99. Perzentil","pl-PL":"99. percentyl","nl-NL":"99e percentiel","ko-KR":"99번째 백분위수","pt-BR":"99º percentil","fr-FR":"99e centile","ja-JP":"99 番目の百分位数","ru-RU":"99-й процентиль"}}};function A(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var I={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),a="center"===r?t:`* ${t}`,s="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:s,title:a},a))}};const k={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"}}]};var O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function N(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var L,T={exports:{}};var P=(L||(L=1,self,T.exports=(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}},645:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Oe});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function p(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function m(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function b(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function y(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(b("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(b("MaxString(".concat(t,")")),")'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=y(c(r[0],i),m(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var p=c(r[0],i),d=c(r[1],i),f=m(0),h=m(1),g=y(p,f),b=y(d,h);return"".concat(a,"({1<").concat(g,",").concat(b,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function q(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const D={isFullRange:p,getNumDimensions:q,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(f(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=m(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var p=m(0),d=m(1);return"If(Count(".concat(p,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return h(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===q({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=m(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach((function(n){void 0===e[n]&&(e[n]=t[n])}))},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=q({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:m,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find((function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null}));i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find((function(t){return t.value===e.decomposition}));return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find((function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n})),t}};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}var C=t().bind(null,!0),M={},w=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===E(e)}function I(e){return void 0===e}function k(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function O(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach((function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=I(e[n||t])?o:e[t],e=e[n||t]}})),e}function N(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach((function(r){N(e[r],t[r])||(n=!1)})),n);if(w(e)&&w(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}M.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach((function(i){var o=function(e){return e?C({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);N(o,a)||k(t,i)||(I(a)?r.push({op:"add",path:s,value:o}):A(o)&&A(a)?r=r.concat(M.generate(a,o,s)):w(o)&&w(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&I(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!I(t[0])&&I(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(M.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))})),Object.keys(e).forEach((function(i){I(t[i])&&!k(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})})),r},M.apply=function(e,t){t.forEach((function(t){var n,r,i=O(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(w(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(w(a)&&w(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(e)}(r=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(A(a)&&A(t.value))n=a,Object.keys(n).forEach((function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!k(n,e)&&delete n[e]})),C(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=O(e,t.from);w(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(w(i)?i.splice(+o,1):delete i[o])}))},M.clone=function(e){return C({},e)},M.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},M.updateObject=function(e,t){Object.keys(e).length?M.apply(e,M.generate(e,t)):C(e,t)};const L=M,T=function(e,n,r){if(!e)return Promise.resolve();var i=L.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map((function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}})),e.applyPatches(i,!0)):Promise.resolve()};var P="accumulation";function R(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)return n[r]}function F(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const _={translationKey:"properties.modifier.accumulation",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getNumStepComp(n,l),d=D.getAboveComp(n,l,c,p),f=D.getRangeComp("RangeSum",d);if(D.needDimension({modifier:n,properties:r,layout:i})){var m=D.getDimComp(u,1),h=D.getDimComp(u,0),g=D.getAggrComp(f,m,h);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(F(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(F(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(F(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(F(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=R(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=R(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(F(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(P))return!1;var o=R(t,e);return o&&!o.disabled}};return n}};var V="movingAverage";function j(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===V)return n[r]}function z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===V)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=D.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,d=D.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),f=D.getNumStepComp(r,u),m=D.getAboveComp(r,u,d,f);if(r.nullSuppression)t=D.getRangeComp("RangeAvg",m);else{var h=D.getRangeComp("RangeSum",m),g=function(e,t){var n=D.getRowNoComp(e,t);if(!D.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(h," / ").concat(g)}var b=t;if(D.needDimension({modifier:r,properties:i,layout:a})){var y=D.getDimComp(c,1),v=D.getDimComp(c,0),x=D.getAggrComp(b,y,v);b=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return b},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(z(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=j(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=j(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(z(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(V))return!1;var o=j(t,e);return o&&!o.disabled}};return n}};var U="timeSeriesDecomposition";function K(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function W(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===U)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var G={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const Y={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?D.generateTSDExpression(n,t,r):t},extractInputExpression:D.extractInputExpression,initModifier:function(e,t){D.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=D.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(W(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(W(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=K(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map((function(e){return e.qDef.modifiers.map((function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e})),e}))}},show:function(t){var n=K(t,e);return n&&!n.fullRange}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(U))return!1;var o=K(t,e);return o&&!o.disabled}};return n}};var J="difference";function Z(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===J)return n[r]}function Q(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===J)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var X={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getAboveComp(n,l,c),d="".concat(c," - ").concat(p);if(D.needDimension({modifier:n,properties:r,layout:i})){var f=D.getDimComp(u,1),m=D.getDimComp(u,0),h=D.getAggrComp(d,f,m);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return d},initModifier:function(e){Object.keys(X).forEach((function(t){void 0===e[t]&&(e[t]=X[t])}))},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Q(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Q(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Q(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(J))return!1;var o=Z(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(D.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(D.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),u=""===s&&""===l?"":s||l,c=le(i,o),p=ue(i,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=D.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(p," Aggr(").concat(u," ").concat(e,", ").concat(d,"))")}(c,p,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach((function(t){void 0===e[t]&&(e[t]=oe[t])}))},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then((function(e){return e.map((function(e){return{label:e.qName,value:e.qName}}))}))},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map((function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}}))},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var pe="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,he)?he:me},getLibraryId:function(e){return o(e,he)||o(e,me)},getLabelRef:function(e){return o(e,pe)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,pe)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var be="qDef.qDef",ye="qDef.base.qDef",ve="qLibraryId",xe="qDef.base.qLibraryId",qe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Ee="qDef.base.qLabelExpression",Ce="qDef.qAggrFunc",Me="qDef.base.qAggrFunc",we={initBase:function(e,t){(t||we.isValid(e))&&(n(e,ye,o(e,be)),n(e,xe,o(e,ve)),n(e,Se,o(e,qe)),n(e,Ee,o(e,De)))},restoreBase:function(e){we.isValid(e)&&(n(e,be,o(e,ye)),n(e,ve,o(e,xe)),n(e,qe,o(e,Se)),n(e,De,o(e,Ee)),o(e,Ce)&&o(e,Me)&&n(e,Ce,o(e,Me)),delete e.qDef.base)},isValid:function(e){var t=o(e,ye),n=o(e,xe);return void 0!==t||void 0!==n}};const Ae=we;function Ie(e){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(e)}var ke={accumulation:_,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:Y};const Oe={modifiers:ke,apply:Le,applyModifiers:Te,cleanUpMeasure:Pe,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Re,getActiveModifier:Fe,initBase:Ae.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some((function(e){return ke[e]}))},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return ke[e]&&ke[e].isApplicable({properties:n,layout:r})}))},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach((function(e){var t=Ve(e);We({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Qe({modifiers:t,properties:n,layout:r}))})),i&&!o},ifEnableTotalsFunction:He};var Ne={};function Le(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var u=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,r&&"object"===Ie(r))return Te({model:n,properties:r});var c=n?n.layout:void 0,p=o(c,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var d=o(c,"qHyperCube.qMeasureInfo"),f=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Re({measures:d,layout:c})){var m=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return Ke({measure:e,properties:n,layout:r})}))}({measures:t,layout:n})}({measures:d,layout:c,model:n,lastReloadTime:f});return m||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some((function(e){return function(e){var t=e.measure,n=e.layout;return We({modifiers:Ve(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})})))}({measures:d,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then((function(e){var r=t()(!0,{},e);ze(r);var i=Xe(r);return Ge({model:n}).then((function(t){return Ye({libraryIds:i,model:n}).then((function(i){return m&&function(e){var t=e.properties;_e(t).forEach((function(e){return function(e){var t=e.measure;if(Ke({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach((function(e){if("object"===Ie(e)&&!e.disabled){if(n++,"object"!==Ie(ke[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=ke[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&D.simplifyExpression(t.qDef.base.qDef)!==D.simplifyExpression(r)&&(t.qDef.base.qDef=r)}}))}}({measure:e,properties:t})}))}({properties:r}),Te({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})}))}))})):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some((function(e){return"object"===Ie(e.base)}))}(d)?n.getEffectiveProperties().then((function(e){return function(e){var n=e.model,r=e.properties,i=Xe(r);return et({model:n,libraryIds:i}).then((function(){var e=t()(!0,{},r);return _e(r).forEach((function(e){return Pe(e)})),Ze({oldProperties:e,newProperties:r,model:n})}))}({model:n,properties:e})})):Promise.resolve(l)}function Te(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,p=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),ze(i);var d=Xe(i);return et({model:n,libraryIds:d,masterItem:u}).then((function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=_e(r)),!n.length)return Promise.resolve();if(!Re({measures:n,properties:r}))return n.forEach((function(e){return Pe(e)})),Promise.resolve();var l=a?void 0:Xe(r);return Ge({model:i,dimensionAndFieldList:s}).then((function(e){return Ye({libraryIds:l,model:i,libraryItemsProps:a}).then((function(i){n.forEach((function(n){We({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ae.isValid(n)||Ae.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach((function(e){if("object"===Ie(e)&&!e.disabled){if(s++,"object"!==Ie(ke[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");ke[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:ke[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof ke[r.type].updateModifier&&ke[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:ke[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||He(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&He(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}}))}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Be(n)):Pe(n)}))}))}))}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:p}).then((function(){return l?Ze({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)}))}))}function Pe(e){!function(e){var t=Ve(e);return Array.isArray(t)&&t.some((function(e){return"object"===Ie(e)&&!e.disabled&&!ke[e.type]}))}(e)?Ae.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function Re(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some((function(e){return We({modifiers:Ve(e),properties:n,layout:r})}))}function Fe(e){var t=Ve(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(ke[r.type]&&!r.disabled)return r}}function He(e){var t=Fe(e);return!t||ke[t.type].enableTotalsFunction(e)}function _e(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Ve(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function je(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function ze(e){_e(e).forEach((function(e){return function(e){var n=Fe(e);n&&(void 0!==n.outputExpression&&je(n)!==e.qDef.qDef?delete e.qDef.base:!Ae.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)}))}function Be(e){var t=Ve(e);Array.isArray(t)&&t.forEach((function(t){"object"===Ie(t)&&(t.disabled||!ke[t.type]&&je(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)}))}function $e(e){return e.base||e.qDef&&e.qDef.base}function Ue(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ke(e){var t=e.measure,n=e.properties,r=e.layout;return!Ue(t)&&We({modifiers:Ve(t),properties:n,layout:r})}function We(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some((function(e){return!("object"!==Ie(e)||e.disabled||!ke[e.type])&&(void 0===i[e.type]&&(i[e.type]=ke[e.type].isApplicable({properties:n,layout:r})),i[e.type])}))}function Ge(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then((function(e){i.dimensionList=e}));r.push(o);var a=t.app.getFieldList().then((function(e){i.fieldList=e}));return r.push(a),Promise.all(r).then((function(){return i}))}function Ye(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach((function(e){var t=n.app.getMeasure(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),o.forEach((function(e){var t=n.app.getDimension(e).then((function(t){return t.getProperties().then((function(t){a[e]=t}))}));s.push(t)})),Promise.all(s).then((function(){return a}))}function Je(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ze(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Je)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):T(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then((function(){return i})):Promise.resolve(i)}function Qe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some((function(e){return"object"===Ie(e)&&!e.disabled&&ke[e.type]&&ke[e.type].needDimension({modifier:e,properties:n,layout:r})}))}function Xe(e){var t=_e(e),n=[],r=[],i=!1;return t.forEach((function(t){var r=Ve(t);if(We({modifiers:r,properties:e})){var o=Ue(t);o&&n.push(o),i=i||Qe({modifiers:r,properties:e})}})),o(e,"qHyperCubeDef.qDimensions",[]).forEach((function(e){var t=e.qLibraryId;t&&r.push(t)})),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach((function(n){t[n]=o(e,n)})),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then((function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}}))}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach((function(e){i[e]=!0})),a={},t.forEach((function(e){a[e]=!0}))}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach((function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])})),t.app&&(Object.keys(i).forEach((function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))})),Object.keys(a).forEach((function(e){a[e]&&!r[e]&&s.push(c(e,"getDimension"))}))),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach((function(e){r[e].listener.dispose()})),r={}}}}({model:t,callback:function(e){return Le({model:t,masterItem:e}).then((function(){return t.app.clearUndoBuffer()}))}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>ze});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const p={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c};var d=n(645),f=n.n(d);const m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},h=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&p.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},b=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach((function(e){t.properties[e]=n[e]}))},y=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach((function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])})),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach((function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)}))}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},v=function(e){e.forEach((function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)}))};function x(e,t,n){var r,i,a=o.getValue(e,t);if(!o.isAtomicValue(a))try{if((i=(i=(r=JSON.stringify(a)).match(/:\{/g))?i.length:0)>2)return;a=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var s=o.getValue(e,"qLayoutExclude.quarantine");s[n]||(s[n]={}),s[n][t]=a}var q=n(229),D=n.n(q);function S(e,t){var n=D()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function E(e,t){return D()(!0,{},t,e)}function C(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var M=Math.pow(2,53)-1;function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const I=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},k=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},O=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},L=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},T=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=S(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},P=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=E(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=E(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},R=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=C(a.max,i.dimensions.length,M),l=C(a.min,i.dimensions.length,0);return{maxDimensions:C(o.max,s,M),minDimensions:C(o.min,l,0),maxMeasures:s,minMeasures:l}},F=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.indexRemoved(n.qInterColumnSortOrder,o))},H=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach((function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=D()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some((function(e){return"general"===e.key}))}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]})),null===(i=D()(!0,{},n,i)).components&&(i.components=[]),i},_=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},V=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},j=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return w(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach((function(e){a.qDimensions.push(e),r.dimensions.added(e,n)}))}},z=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return A(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach((function(e){a.qMeasures.push(e),r.measures.added(e,n)}))}},B=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach((function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store}))};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach((function(t){o.setValue(e,t,n[t])})),delete e.qLayoutExclude.quarantine[t],!0)}const U={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),m({exportFormat:i,qHyperCubeDef:l}),h({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,b({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),y({exportFormat:i,properties:a}),r||v(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters"),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,p=e.supportedFilters,d=void 0===p||p,f=e.isHCModifierSupported,m=void 0===f||f,h={qChildren:[]},g=H({exportFormat:t,initialProperties:r,hypercubePath:u}),b=o.getValue(r,u||"").qHyperCubeDef,y=o.getValue(g,u||"").qHyperCubeDef,v=R({exportFormat:t,dataDefinition:a}),x=v.maxDimensions,q=v.minDimensions,D=v.maxMeasures,S=v.minMeasures,E=l.defaultDimension,C=void 0===E?N():E,M=l.defaultMeasure,w=void 0===M?L():M;y.qDimensions.length=0,y.qMeasures.length=0,_({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S})&&V({exportFormat:t,maxDimensions:x,minDimensions:q,maxMeasures:D,minMeasures:S,newHyperCubeDef:y}),T({exportFormat:t,maxDimensions:x,minDimensions:q,newHyperCubeDef:y,defaultDimension:C}),P({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:y,defaultMeasure:w}),j({newProperties:g,dataDefinition:a,hypercubePath:u}),z({newProperties:g,dataDefinition:a,hypercubePath:u}),F({exportFormat:t,newHyperCubeDef:y}),k("qMaxStackedCells",b,y),k("qNoOfLeftDims",b,y),O("qInitialDataFetch",b,y,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),O("qMode",b,y,"S"),O("qReductionMode",b,y,"N"),O("qSortbyYValue",b,y),O("qIndentMode",b,y),O("qShowTotalsAbove",b,y),I(g,t,r),h.qProperty=g;var A=o.getValue(c||{},"support.modifiers");return B({measures:y.qMeasures,modifierTypes:A}),d&&$(h.qProperty,"storedFilters"),"S"===y.qMode&&m&&$(h.qProperty,"dynamicScript"),h}};var K={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function W(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function G(e,t){return e.length!==t}const Y={create:function(e,t){if(!e||!K[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach((function(e){n[e]=t[e]})),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(W(a,t,r,i),G(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},J={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>0&&J.getNumMeasures(e)<=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>0},expression:function(e){return J.getNumMeasures(e)>=1}}},Q={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}};var X={scatterplot:Q,"sn-scatter-plot":Q,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)<=1},expression:function(e){return J.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>=1},expression:function(e){return J.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=p.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=Y.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})),t.forEach((function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}))}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=Y.create(Y.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=p.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=J.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||J.wrapFieldName(t.name),key:J.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=Y.IDMAP.COLOR_BY_ALTERNATIVE,a=p.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ue=function(e,t){var n={primary:!0};if(e){var r=(X[t]||Z).colorModeOptions||Z.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ce=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},pe=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=Y.IDMAP.COLOR_BY_ALTERNATIVE,s=p.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},de=function(e){e.forEach((function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode}))},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},me=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},he=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},be={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=U.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=Y.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return Y.moveByIdFromGroup(a,[],"qAttributeDimensions",u),Y.moveByIdFromGroup(a,[],"qAttributeExpressions",u),Y.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=U.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,d=o.getValue(p,"visualization"),f=o.getValue(p,"qHyperCubeDef.qDimensions",[]),m=o.getValue(p,"color.mode",""),h=o.getValue(p,"color.auto",""),g=ue(p,d),b=ce({canColorBy:g,autoColor:h,colorMode:m,dimensions:f});return g[m]?fe({shouldUpdateColorBy:b,properties:p})&&me(p):he(p),b&&pe(p,"qHyperCubeDef."),ge(p)&&le(p,"color.persistent",!0),de(f),c}};var ye=["bar","marker","line"];const ve=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||D()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||D()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach((function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ye.includes(r)&&t[i].type[r]++,t[i].type.total++}})),t}(a);l.length?(o&&(t=l.filter((function(e){return e.type[o]>0})).sort((function(e,t){return t.type[o]-e.type[o]}))),t&&t.length||(t=l.sort((function(e,t){return t.type.total-e.type.total}))),t&&t[0]&&D()(s,n.properties.measureAxes[t[0].axis])):D()(s,n.properties.measureAxes[0])}},qe=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},De={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=be.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=be.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty;return ve({initialProperties:n,properties:p}),xe({exportFormat:t,initialProperties:n,properties:p,measureType:a}),qe(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],c}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Se(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}function Ce(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach((function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Se(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})}))}var Me="qHyperCubeDef.qMeasures",we="conditionalColoring",Ae="measures",Ie="qDef.conditionalColoring";const ke={quarantine:function(e){Ee({properties:e,arrayPath:Me,quarantineName:we,arrayName:Ae,itemPath:Ie})},unquarantine:function(e){Ce({properties:e,arrayPath:Me,itemPath:Ie,arrayName:Ae,quarantineName:we})}};var Oe="qHyperCubeDef.qMeasures",Ne="measures",Le="qHyperCubeDef.qDimensions",Te="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Re="alternativeMeasures",Fe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",He="alternativeDimensions",_e="qCalcCondition",Ve="conditionalShowHide";const je={quarantine:function(e){Ee({properties:e,arrayPath:Oe,quarantineName:Ve,arrayName:Ne,itemPath:_e}),Ee({properties:e,arrayPath:Le,quarantineName:Ve,arrayName:Te,itemPath:_e})},unquarantine:function(e){Ce({properties:e,arrayPath:Oe,quarantineName:Ve,arrayName:Ne,itemPath:_e}),Ce({properties:e,arrayPath:Le,quarantineName:Ve,arrayName:Te,itemPath:_e})},quarantineAlternative:function(e){Ee({properties:e,arrayPath:Pe,quarantineName:Ve,arrayName:Re,itemPath:_e}),Ee({properties:e,arrayPath:Fe,quarantineName:Ve,arrayName:He,itemPath:_e})},unquarantineAlternative:function(e){Ce({properties:e,arrayPath:Pe,quarantineName:Ve,arrayName:Re,itemPath:_e}),Ce({properties:e,arrayPath:Fe,quarantineName:Ve,arrayName:He,itemPath:_e})}},ze={hypercube:U,colorChart:be,axisChart:De,quarantineProperty:x,unquarantineProperty:$,quarantineArrayProp:Ee,unquarantineArrayProp:Ce,conditionalColoring:ke,conditionalShow:je}})(),r.default})()),T.exports),R=N(P);const F={AUTO:!0,BIN_COUNT:10,BIN_SIZE:10,LABEL:"x",OFFSET:0,COUNT_DISTINCT:!1,BIN_MODE:"maxCount"};Object.freeze(F);const H={version:"1.0.0",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},bins:{auto:F.AUTO,binCount:"",binSize:F.BIN_SIZE,offset:F.OFFSET,countDistinct:F.COUNT_DISTINCT,binMode:F.BIN_MODE},color:{bar:{paletteColor:{index:6,color:"#4477aa"}}},dataPoint:{showLabels:!1},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",label:"",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function _(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>t.get("Visualization.Histogram.Binning")},measures:{min:0,max:0}}}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||B(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(e){return function(e){if(Array.isArray(e))return V(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||B(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,t){if(e){if("string"==typeof e)return V(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?V(e,t):void 0}}var $=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],U=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var K=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function W(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,z(new Set([r].concat(z(a.map((function(e){return e.split(",").map((function(e){return e.trim()})).map((function(e){return e.replace(/\s+/g," ").trim()})).filter(Boolean).join(", ")}))))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(z(o.map((function(e){return K(e)}))),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],z(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?U:$}(i).map((function(e){return K(e)}))))}function G(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return W({theme:t,translator:n,defaultValue:a(),flags:o})}}}var Y,J,Z=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],Q=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function X(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,z(new Set([n].concat(z(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(z(r.map((function(e){return Q(e)}))),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],z(Z.map((function(e){return Q(e)}))))}({theme:t,translator:n,defaultValue:o()})}}}function ee(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:G({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:X({theme:t,translator:n,id:r,path:i})}}function te(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,u={};l.forEach((function(e){for(var r=e.split("."),i=u,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=ee({theme:t,translator:n,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}}));var c=function(e){for(var t=e.split("."),n=u,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}var ne,re=function(){if(J)return Y;J=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return Y=function e(){var t,n,r,l,u,c,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},Y}();function ie(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function oe(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ae(){}(ne=re)&&ne.__esModule&&Object.prototype.hasOwnProperty.call(ne,"default")&&ne.default;var se=1/.7,le="\\s*([+-]?\\d+)\\s*",ue="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ce="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pe=/^#([0-9a-f]{3,8})$/,de=new RegExp(`^rgb\\(${le},${le},${le}\\)$`),fe=new RegExp(`^rgb\\(${ce},${ce},${ce}\\)$`),me=new RegExp(`^rgba\\(${le},${le},${le},${ue}\\)$`),he=new RegExp(`^rgba\\(${ce},${ce},${ce},${ue}\\)$`),ge=new RegExp(`^hsl\\(${ue},${ce},${ce}\\)$`),be=new RegExp(`^hsla\\(${ue},${ce},${ce},${ue}\\)$`),ye={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 ve(){return this.rgb().formatHex()}function xe(){return this.rgb().formatRgb()}function qe(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=pe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?De(t):3===n?new Me(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Se(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Se(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=de.exec(e))?new Me(t[1],t[2],t[3],1):(t=fe.exec(e))?new Me(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=me.exec(e))?Se(t[1],t[2],t[3],t[4]):(t=he.exec(e))?Se(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ge.exec(e))?Ne(t[1],t[2]/100,t[3]/100,1):(t=be.exec(e))?Ne(t[1],t[2]/100,t[3]/100,t[4]):ye.hasOwnProperty(e)?De(ye[e]):"transparent"===e?new Me(NaN,NaN,NaN,0):null}function De(e){return new Me(e>>16&255,e>>8&255,255&e,1)}function Se(e,t,n,r){return r<=0&&(e=t=n=NaN),new Me(e,t,n,r)}function Ee(e){return e instanceof ae||(e=qe(e)),e?new Me((e=e.rgb()).r,e.g,e.b,e.opacity):new Me}function Ce(e,t,n,r){return 1===arguments.length?Ee(e):new Me(e,t,n,null==r?1:r)}function Me(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function we(){return`#${Oe(this.r)}${Oe(this.g)}${Oe(this.b)}`}function Ae(){const e=Ie(this.opacity);return`${1===e?"rgb(":"rgba("}${ke(this.r)}, ${ke(this.g)}, ${ke(this.b)}${1===e?")":`, ${e})`}`}function Ie(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ke(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oe(e){return((e=ke(e))<16?"0":"")+e.toString(16)}function Ne(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Te(e,t,n,r)}function Le(e){if(e instanceof Te)return new Te(e.h,e.s,e.l,e.opacity);if(e instanceof ae||(e=qe(e)),!e)return new Te;if(e instanceof Te)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Te(a,s,l,e.opacity)}function Te(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Pe(e){return(e=(e||0)%360)<0?e+360:e}function Re(e){return Math.max(0,Math.min(1,e||0))}function Fe(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ie(ae,qe,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ve,formatHex:ve,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Le(this).formatHsl()},formatRgb:xe,toString:xe}),ie(Me,Ce,oe(ae,{brighter(e){return e=null==e?se:Math.pow(se,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Me(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Me(ke(this.r),ke(this.g),ke(this.b),Ie(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:we,formatHex:we,formatHex8:function(){return`#${Oe(this.r)}${Oe(this.g)}${Oe(this.b)}${Oe(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ae,toString:Ae})),ie(Te,(function(e,t,n,r){return 1===arguments.length?Le(e):new Te(e,t,n,null==r?1:r)}),oe(ae,{brighter(e){return e=null==e?se:Math.pow(se,e),new Te(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Te(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Me(Fe(e>=240?e-240:e+120,i,r),Fe(e,i,r),Fe(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Te(Pe(this.h),Re(this.s),Re(this.l),Ie(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=Ie(this.opacity);return`${1===e?"hsl(":"hsla("}${Pe(this.h)}, ${100*Re(this.s)}%, ${100*Re(this.l)}%${1===e?")":`, ${e})`}`}}));const He=Math.PI/180,_e=180/Math.PI,Ve=4/29,je=6/29,ze=3*je*je;function Be(e){if(e instanceof $e)return new $e(e.l,e.a,e.b,e.opacity);if(e instanceof Ye)return Je(e);e instanceof Me||(e=Ee(e));var t,n,r=Ge(e.r),i=Ge(e.g),o=Ge(e.b),a=Ue((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Ue((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Ue((.0139322*r+.0971045*i+.7141733*o)/.82521)),new $e(116*a-16,500*(t-a),200*(a-n),e.opacity)}function $e(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ue(e){return e>.008856451679035631?Math.pow(e,1/3):e/ze+Ve}function Ke(e){return e>je?e*e*e:ze*(e-Ve)}function We(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ge(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ye(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Je(e){if(isNaN(e.h))return new $e(e.l,0,0,e.opacity);var t=e.h*He;return new $e(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ie($e,(function(e,t,n,r){return 1===arguments.length?Be(e):new $e(e,t,n,null==r?1:r)}),oe(ae,{brighter(e){return new $e(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new $e(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 Me(We(3.1338561*(t=.96422*Ke(t))-1.6168667*(e=1*Ke(e))-.4906146*(n=.82521*Ke(n))),We(-.9787684*t+1.9161415*e+.033454*n),We(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ie(Ye,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Ye)return new Ye(e.h,e.c,e.l,e.opacity);if(e instanceof $e||(e=Be(e)),0===e.a&&0===e.b)return new Ye(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*_e;return new Ye(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Ye(e,t,n,null==r?1:r)}),oe(ae,{brighter(e){return new Ye(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Ye(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Je(this).rgb()}}));var Ze=e=>()=>e;function Qe(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Ze(isNaN(e)?t:e)}!function e(t){var n=function(e){return 1==(e=+e)?Qe:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Ze(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Ce(e)).r,(t=Ce(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Qe(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);var Xe="center",et="bottom";function tt(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}[{key:"NoDataExist",alignment:Xe,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Xe,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every((function(e){return"NaN"===e.qMin&&"NaN"===e.qMax}))}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Xe,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Xe},{key:"DataRangeIncludingZero",alignment:et},{key:"LimitedData",alignment:et},{key:"NegativeOrZeroValues",alignment:et}].reduce((function(e,t){return e[t.key]=t,e}),{});var nt,rt=["__proto__","constructor"];function it(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!rt.some((function(e){return r.includes(e)}))){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function ot(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function at(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=lt)):void 0===t&&(t=st);for(var n,r,i,o,a,s=new pt(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new pt(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(ct)}function st(e){return e.children}function lt(e){return Array.isArray(e)?e[1]:null}function ut(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function ct(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function pt(e){this.data=e,this.depth=this.height=0,this.parent=null}pt.prototype=at.prototype={constructor:pt,count:function(){return this.eachAfter(ot)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return at(this).eachBefore(ut)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},nt=function(e){
7
+ import{useConstraints as e,useState as t,useLayout as n,useEffect as r,useAction as i,useRect as o,useOptions as a,usePromise as s,useApp as l,useAppLayout as u,useDeviceType as c,useTheme as p,useTranslator as d,useMemo as f,onTakeSnapshot as m,useImperativeHandle as h,useElement as g,useModel as y,useSelections as b,useStaleLayout as v,useRenderState as q}from"@nebula.js/stardust";import x from"jquery";import D from"picasso.js";import S from"picasso-plugin-q";import M from"picasso-plugin-hammer";import E from"hammerjs";import C from"extend";var w={"Visualization.Histogram.MeasureAxisLabel":{id:"Visualization.Histogram.MeasureAxisLabel",locale:{"en-US":"Frequency","zh-TW":"頻率","zh-CN":"频率","tr-TR":"Sıklık","sv-SE":"Frekvens","it-IT":"Frequenza","es-ES":"Frecuencia","de-DE":"Häufigkeit","pl-PL":"Częstotliwość","nl-NL":"Frequentie","ko-KR":"빈도","pt-BR":"Frequência","fr-FR":"Fréquence","ja-JP":"レコード数","ru-RU":"Частота"}},"waterfall.legend.positiveValue.label":{id:"waterfall.legend.positiveValue.label",locale:{"en-US":"Positive","zh-TW":"正值","zh-CN":"正","tr-TR":"Pozitif","sv-SE":"Positiv","it-IT":"Positivi","es-ES":"Positivo","de-DE":"Positiv","pl-PL":"Dodatnie","nl-NL":"Positief","ko-KR":"양수","pt-BR":"Positivo","fr-FR":"Positive","ja-JP":"正","ru-RU":"Положительное"}},"waterfall.legend.negativeValue.label":{id:"waterfall.legend.negativeValue.label",locale:{"en-US":"Negative","zh-TW":"負值","zh-CN":"负","tr-TR":"Negatif","sv-SE":"Negativ","it-IT":"Negativi","es-ES":"Negativo","de-DE":"Negativ","pl-PL":"Ujemne","nl-NL":"Negatief","ko-KR":"음수","pt-BR":"Negativo","fr-FR":"Négative","ja-JP":"負","ru-RU":"Отрицательное"}},"waterfall.legend.subtotal.label":{id:"waterfall.legend.subtotal.label",locale:{"en-US":"Subtotal","zh-TW":"小計","zh-CN":"小计","tr-TR":"Ara Toplam","sv-SE":"Deltotal","it-IT":"Subtotale","es-ES":"Subtotal","de-DE":"Teilsumme","pl-PL":"Suma częściowa","nl-NL":"Subtotaal","ko-KR":"소계","pt-BR":"Subtotal","fr-FR":"Sous-total","ja-JP":"小計","ru-RU":"Подытог"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"en-US":"Currently showing a limited data set.","zh-TW":"目前顯示的是有限的資料集。","zh-CN":"当前正显示有限的数据集。","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","sv-SE":"Just nu visas en begränsad uppsättning data.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","pt-BR":"Mostrando um conjunto de dados limitado.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","ja-JP":"現在、限定的なデータ セットを表示しています。","ru-RU":"В настоящее время отображается ограниченный набор данных."}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"en-US":"The chart is not displayed because it contains only undefined values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含未定義的值。","zh-CN":"未显示图表,因为它仅包含未定义的值。","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości niezdefiniowane.","nl-NL":"De grafiek wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения."}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"en-US":"The chart is not displayed because it contains only negative or zero values.","zh-TW":"系統不會顯示圖表,因為該圖表僅包含負值或零值。","zh-CN":"未显示图表,因为它仅包含负值或零值。","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa eller nollvärden","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","es-ES":"El gráfico no se muestra porque sólo contiene valores negativos o valores cero.","de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wartości ujemne lub zerowe.","nl-NL":"De grafiek wordt niet weergegeven omdat het alleen negatieve waarden of nulwaarden bevat.","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения."}},Object_Disclaimer_RequireNumericDimension:{id:"Object.Disclaimer.RequireNumericDimension",locale:{"en-US":"This visualization requires a numeric diemnsion."}},"properties.boxplot.calculationMode.tukey.elements.boxEnd":{id:"properties.boxplot.calculationMode.tukey.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.tukey.elements.boxMiddle":{id:"properties.boxplot.calculationMode.tukey.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Drittes Quartil","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.tukey.elements.boxStart":{id:"properties.boxplot.calculationMode.tukey.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.tukey.elements.firstWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.firstWhisker",locale:{"en-US":"Box start - {0} IQR","zh-TW":"方塊開始 - {0} IQR","zh-CN":"框开始 - {0} IQR","tr-TR":"Kutu başlangıcı - {0} IQR","sv-SE":"Rutans start - {0} IQR","it-IT":"Inizio scatola - {0} IQR","es-ES":"Inicio de caja - {0} IQR","de-DE":"Box-Beginn - {0} IQR","pl-PL":"Początek wykresu pudełkowego - {0} IQR","nl-NL":"Begin box - {0} IQR","ko-KR":"상자 시작 - {0} IQR","pt-BR":"Início da caixa - {0} IQR","fr-FR":"Début de la boîte - {0} IQR","ja-JP":"ボックス開始 - {0} IQR","ru-RU":"Начало поля - {0} IQR"}},"properties.boxplot.calculationMode.tukey.elements.lastWhisker":{id:"properties.boxplot.calculationMode.tukey.elements.lastWhisker",locale:{"en-US":"Box end + {0} IQR","zh-TW":"方塊結束 + {0} IQR","zh-CN":"框结束 + {0} IQR","tr-TR":"Kutu bitişi + {0} IQR","sv-SE":"Rutans slut + {0} IQR","it-IT":"Fine scatola + {0} IQR","es-ES":"Fin de caja + {0} IQR","de-DE":"Box-Ende + {0} IQR","pl-PL":"Koniec wykresu pudełkowego - {0} IQR","nl-NL":"Einde box + {0} IQR","ko-KR":"상자 끝 + {0} IQR","pt-BR":"Fim da caixa + {0} IQR","fr-FR":"Fin de la boîte + {0} IQR","ja-JP":"ボックス終了 + {0} IQR","ru-RU":"Конец поля + {0} IQR"}},"properties.boxplot.calculationMode.stdDev.elements.boxEnd":{id:"properties.boxplot.calculationMode.stdDev.elements.boxEnd",locale:{"en-US":"Box middle + 1 standard deviation","zh-TW":"方塊中間 + 1 個標準差","zh-CN":"框中部 + 1 个标准偏差","tr-TR":"Kutu ortası + 1 standart sapma","sv-SE":"Rutans mitt + 1 standardavvikelse","it-IT":"Centro scatola + 1 deviazione standard","es-ES":"Mitad de la caja + 1 desviación estándar","de-DE":"Box-Mitte +1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego + 1 odch. stand","nl-NL":"Midden box + 1 standaardafwijking","ko-KR":"상자 중간 + 1개 표준 편차","pt-BR":"Meio da caixa + 1 desvio padrão","fr-FR":"Milieu de la boîte + 1 écart type","ja-JP":"ボックス中間 + 1 標準偏差","ru-RU":"Середина поля + 1 стандартное отклонение"}},"properties.boxplot.calculationMode.stdDev.elements.boxMiddle":{id:"properties.boxplot.calculationMode.stdDev.elements.boxMiddle",locale:{"en-US":"Average","zh-TW":"平均值","zh-CN":"平均值","tr-TR":"Ortalama","sv-SE":"Medel","it-IT":"Media","es-ES":"Media","de-DE":"Durchschnitt","pl-PL":"Średnia","nl-NL":"Gemiddelde","ko-KR":"평균","pt-BR":"Média","fr-FR":"Moyenne","ja-JP":"平均値","ru-RU":"Среднее"}},"properties.boxplot.calculationMode.stdDev.elements.boxStart":{id:"properties.boxplot.calculationMode.stdDev.elements.boxStart",locale:{"en-US":"Box middle - 1 standard deviation","zh-TW":"方塊中間 - 1 個標準差","zh-CN":"框中部 - 1 个标准偏差","tr-TR":"Kutu ortası - 1 standart sapma","sv-SE":"Rutans mitt - 1 standardavvikelse","it-IT":"Centro scatola - 1 deviazione standard","es-ES":"Mitad de la caja - {1} desviación estándar","de-DE":"Box-Mitte -1 Standardabweichung","pl-PL":"Środek wykresu pudełkowego - 1 odch. stand","nl-NL":"Midden box - 1 standaardafwijking","ko-KR":"상자 중간 - 1개 표준 편차","pt-BR":"Середина поля - 1 стандартное отклонение","fr-FR":"Milieu de la boîte - 1 écart type","ja-JP":"ボックス中間 - 1 標準偏差","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.stdDev.elements.firstWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.firstWhisker",locale:{"en-US":"Box middle - {0} standard deviations","zh-TW":"方塊中間 - {0} 個標準差","zh-CN":"框中部 - {0} 个标准偏差","tr-TR":"Kutu ortası - {0} standart sapma","sv-SE":"Rutans mitt - {0} standardavvikelser","it-IT":"Centro scatola - {0} deviazioni standard","es-ES":"Mitad de la caja - {0} desviaciones estándar","de-DE":"Box-Mitte -{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego - {0} odch. stand","nl-NL":"Midden box - {0} standaardafwijkingen","ko-KR":"상자 중간 - {0}개 표준 편차","pt-BR":"Meio da caixa - {0} desvios padrão","fr-FR":"Milieu de la boîte - {0} écarts types","ja-JP":"ボックス中間 - {0} 標準偏差","ru-RU":"Середина поля - {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.stdDev.elements.lastWhisker":{id:"properties.boxplot.calculationMode.stdDev.elements.lastWhisker",locale:{"en-US":"Box middle + {0} standard deviations","zh-TW":"方塊中間 + {0} 個標準差","zh-CN":"框中部 + {0} 个标准偏差","tr-TR":"Kutu ortası + {0} standart sapma","sv-SE":"Rutans mitt + {0} standardavvikelser","it-IT":"Centro scatola + {0} deviazioni standard","es-ES":"Mitad de la caja + {0} desviaciones estándar","de-DE":"Box-Mitte +{0} Standardabweichung","pl-PL":"Środek wykresu pudełkowego + {0} odch. stand","nl-NL":"Midden box + {0} standaardafwijkingen","ko-KR":"상자 중간 + {0}개 표준 편차","pt-BR":"Meio da caixa + {0} desvios padrão","fr-FR":"Milieu de la boîte + {0} écarts types","ja-JP":"ボックス中間 + {0} 標準偏差","ru-RU":"Середина поля + {0} стандартное(ых) отклонение(й)"}},"properties.boxplot.calculationMode.fractiles.elements.boxEnd":{id:"properties.boxplot.calculationMode.fractiles.elements.boxEnd",locale:{"en-US":"Third quartile","zh-TW":"第三四分位數","zh-CN":"第 3 个四分位","tr-TR":"Üçüncü çeyrek","sv-SE":"Tredje kvartilen","it-IT":"Terzo quartile<","es-ES":"Tercer cuartil","de-DE":"Drittes Quartil","pl-PL":"Trzeci kwartyl","nl-NL":"Derde kwartiel","ko-KR":"3번째 사분위수","pt-BR":"Terceiro quartil","fr-FR":"Troisième quartile","ja-JP":"第 3 四分位数","ru-RU":"Третий квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.boxMiddle":{id:"properties.boxplot.calculationMode.fractiles.elements.boxMiddle",locale:{"en-US":"Median","zh-TW":"中位數","zh-CN":"中间值","tr-TR":"Medyan","sv-SE":"Median","it-IT":"Mediana","es-ES":"Mediana","de-DE":"Median","pl-PL":"Mediana","nl-NL":"Mediaan","ko-KR":"중앙값","pt-BR":"Mediano","fr-FR":"Médiane","ja-JP":"中央値","ru-RU":"Медианное"}},"properties.boxplot.calculationMode.fractiles.elements.boxStart":{id:"properties.boxplot.calculationMode.fractiles.elements.boxStart",locale:{"en-US":"First quartile","zh-TW":"第一四分位數","zh-CN":"第 1 个四分位","tr-TR":"İlk çeyrek","sv-SE":"Första kvartilen","it-IT":"Primo quartile","es-ES":"Primer cuartil","de-DE":"Erstes Quartil","pl-PL":"Pierwszy kwartyl","nl-NL":"Eerste kwartiel","ko-KR":"1번째 사분위수","pt-BR":"Primeiro quartil","fr-FR":"Premier quartile","ja-JP":"第 1 四分位数","ru-RU":"Первый квартиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.fifth",locale:{"en-US":"5th percentile","zh-TW":"第 5 個百分位數","zh-CN":"第 5 个百分位","tr-TR":"5. yüzdebirlik","sv-SE":"5:e percentilen","it-IT":"5° percentile","es-ES":"5º percentil","de-DE":"5. Perzentil","pl-PL":"5. percentyl","nl-NL":"5e percentiel","ko-KR":"5번째 백분위수","pt-BR":"5º percentil","fr-FR":"5e centile","ja-JP":"5 番目のパーセンタイル","ru-RU":"5-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.first",locale:{"en-US":"1st percentile","zh-TW":"第 1 個百分位數","zh-CN":"第 1 个百分位","tr-TR":"1. yüzdebirlik","sv-SE":"1:e percentilen","it-IT":"1° percentile","es-ES":"1er percentil","de-DE":"1. Perzentil","pl-PL":"1. percentyl","nl-NL":"1e percentiel","ko-KR":"1번째 백분위수","pt-BR":"1º percentil","fr-FR":"1er centile","ja-JP":"1 番目のパーセンタイル","ru-RU":"1-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.min",locale:{"en-US":"Minimum","zh-TW":"最小","zh-CN":"最小值","tr-TR":"En az","sv-SE":"Min","it-IT":"Minimo","es-ES":"Mínimo","de-DE":"Minimum","pl-PL":"Minimum","nl-NL":"Minimum","ko-KR":"최소","pt-BR":"Mínimo","fr-FR":"Minimale","ja-JP":"最小値","ru-RU":"Минимум"}},"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth":{id:"properties.boxplot.calculationMode.fractiles.elements.firstWhisker.tenth",locale:{"en-US":"10th percentile","zh-TW":"第 10 個百分位數","zh-CN":"第 10 个百分位","tr-TR":"10. yüzdebirlik","sv-SE":"10:e percentilen","it-IT":"10° percentile","es-ES":"10º percentil","de-DE":"10. Perzentil","pl-PL":"10. percentyl","nl-NL":"10e percentiel","ko-KR":"10번째 백분위수","pt-BR":"10º percentil","fr-FR":"10e centile","ja-JP":"10 番目のパーセンタイル","ru-RU":"10-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.max",locale:{"en-US":"Maximum","zh-TW":"最大","zh-CN":"最大值","tr-TR":"En fazla","sv-SE":"Max","it-IT":"Massimo","es-ES":"Máximo","de-DE":"Maximum","pl-PL":"Maksimum","nl-NL":"Maximum","ko-KR":"최대","pt-BR":"Máximo","fr-FR":"Maximale","ja-JP":"最大値","ru-RU":"Максимум"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetieth",locale:{"en-US":"90th percentile","zh-TW":"第 90 個百分位數","zh-CN":"第 90 个百分位","tr-TR":"90. yüzdebirlik","sv-SE":"90:e percentilen","it-IT":"90° percentile","es-ES":"90º percentil","de-DE":"90. Perzentil","pl-PL":"90. percentyl","nl-NL":"90e percentiel","ko-KR":"90번째 백분위수","pt-BR":"90º percentil","fr-FR":"90e centile","ja-JP":"90 番目の百分位数","ru-RU":"90-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetyfifth",locale:{"en-US":"95th percentile","zh-TW":"第 95 個百分位數","zh-CN":"第 95 个百分位","tr-TR":"95. yüzdebirlik","sv-SE":"95:e percentilen","it-IT":"95° percentile","es-ES":"95º percentil","de-DE":"95. Perzentil","pl-PL":"95. percentyl","nl-NL":"95e percentiel","ko-KR":"95번째 백분위수","pt-BR":"95º percentil","fr-FR":"95e centile","ja-JP":"95 番目の百分位数","ru-RU":"95-й процентиль"}},"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth":{id:"properties.boxplot.calculationMode.fractiles.elements.lastWhisker.ninetynineth",locale:{"en-US":"99th percentile","zh-TW":"第 99 個百分位數","zh-CN":"第 99 个百分位","tr-TR":"99. yüzdebirlik","sv-SE":"99:e percentilen","it-IT":"99° percentile","es-ES":"99º percentil","de-DE":"99. Perzentil","pl-PL":"99. percentyl","nl-NL":"99e percentiel","ko-KR":"99번째 백분위수","pt-BR":"99º percentil","fr-FR":"99e centile","ja-JP":"99 番目の百分位数","ru-RU":"99-й процентиль"}}};function A(e){e.component("event-area",{mounted(e){e.classList.add("event-area"),e.style.pointerEvents="auto",e.style.zIndex=1},render:()=>[]})}var I={renderer:"dom",disableTriggers:!0,preferredSize:function(){return 22},render(e){const{settings:{label:t,rtl:n},layout:{dock:r}}=this.settings,i="top"!==r&&"bottom"!==r||!n?"ltr":"rtl",o=function(e,t){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#7b7a78",fontStyle:"italic",fontSize:"13px"};switch(e){case"left":n.width=`${t.height}px`,n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,n.transformOrigin="top left";break;case"right":n.width=`${t.height}px`,n.transform=`rotate(90deg) translate(0, -${t.width}px)`,n.transformOrigin="top left";break;case"center":n.width=`${t.width}px`,n.height=`${t.height}px`,n.color="#595959",n.fontStyle="normal",n.fontSize="1.2em",n.textAlign="center";break;default:n.justifyContent="flex-start",n.alignItems="flex-start"}return n}(r,this.rect),a="center"===r?t:`* ${t}`,s="center"!==r?{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}:{};return e("div",{style:o,dir:i},e("span",{ref:this.alignToRef,style:s,title:a},a))}};const O={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"}}]};var k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function N(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var T,L={exports:{}};var P=(T||(T=1,self,L.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,u,c,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=l(p,n),p!==(i=l(t,n))&&(m&&i&&(a(i)||(u=o(i)))?(u?(u=!1,c=r&&o(r)?r:[]):c=r&&a(r)?r:{},s(p,{name:n,newValue:e(m,c,i)})):void 0!==i&&s(p,{name:n,newValue:i}));return p}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>ke});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat(" "),l="".concat(" ",")").concat(" ");function u(e){return s+e+l}function c(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function p(e){return!(!e.fullAccumulation&&!e.fullRange)}function d(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function f(e){var t=function(e){return e?(e=function(e){return e.replace(/\/\*[^]*?\*\//g,"")}(e=function(e){return e.replace(/\/\/(.*)$/gm,"")}(e))).trim():""}(e),n=t.trim();return"="===n.substring(0,1)?n.substring(1).trim():n}function m(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function h(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function b(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function v(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var u=b(c(r[0],i),m(0));return"".concat(a,"({1<").concat(u,">}").concat(l,")")}if(r&&2===r.length){var p=c(r[0],i),d=c(r[1],i),f=m(0),h=m(1),g=b(p,f),y=b(d,h);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function q(e){return"".concat(e,"(")}function x(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const D={isFullRange:p,getNumDimensions:x,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=u(f(t));if(!n.showExcludedValues)return a;var s=v({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=m(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var p=m(0),d=m(1);return"If(Count(".concat(p,") * Count(").concat(d,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:d,getNumStepComp:function(e,t){if(!p(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return d(e,t)},getAboveCompPrefix:h,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return h(e,t)+n+g(r)},getFunctionPrefix:q,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return q(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:v,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===x({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=m(t);if(!n.qSortByExpression&&!n.qSortByNumeric&&!n.qSortByAscii)return r;var i=["Descending","Ascending"],o=n.qSortByNumeric?"(Numeric, ".concat(i[(n.qSortByNumeric+1)/2],")"):"",a=n.qSortByAscii?"(Text, ".concat(i[(n.qSortByAscii+1)/2],")"):"";return n.qSortByNumeric&&n.qSortByAscii?"(".concat(r,", ").concat(o,", ").concat(a,")"):n.qSortByNumeric?"(".concat(r,", ").concat(o,")"):n.qSortByAscii?"(".concat(r,", ").concat(a,")"):r},simplifyExpression:f,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:c,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=x({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:u,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:m,getFieldWithWrapper:function(e){var t=e?e.replace(/]/g,"]]"):e;return"[".concat(t,"]")},generateTSDExpression:function(e,t,n){var r=t||e.outputExpression;if(e.base&&e.base.qDef&&(r=t!==e.base.qDef?t:e.base.qDef),"observed"!==e.decomposition){var i=n.qHyperCubeDef.qMeasures.find(function(t){return t.qDef.base&&t.qDef.base.qLibraryId&&e.base&&e.base.qLibraryId?t.qDef.base.qLibraryId===e.base.qLibraryId:null});i&&t!==i.qDef.qLabel&&(r=i.qLibraryId||i.qDef.base.qLibraryId?"[".concat(i.qDef.qLabel,"]"):i.qDef.base.qDef);var o=function(e){var t=a.OPTIONS.find(function(t){return t.value===e.decomposition});return t?a.EXPRESSIONS[t.value]:""}(e);r=r.startsWith("=")?r.substr(1):r,r="".concat(o,"(").concat(r,", ").concat(e.steps,")")}return r},getDecomposition:function(e){var t="observed";return Object.values(a.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return a.EXPRESSIONS[n]&&r.includes(a.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}var E=t().bind(null,!0),C={},w=Array.isArray;function A(e){return null!=e&&!Array.isArray(e)&&"object"===M(e)}function I(e){return void 0===e}function O(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function k(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=I(e[n||t])?o:e[t],e=e[n||t]}}),e}function N(e,t){var n=!0;if(A(e)&&A(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){N(e[r],t[r])||(n=!1)}),n);if(w(e)&&w(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!N(e[r],t[r]))return!1;return!0}return e===t}C.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?E({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);N(o,a)||O(t,i)||(I(a)?r.push({op:"add",path:s,value:o}):A(o)&&A(a)?r=r.concat(C.generate(a,o,s)):w(o)&&w(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&I(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(var r=0,i=e.length;r<i;r+=1)if(e[r]&&e[r].qInfo.qId===t)return r;return-1}if(N(t,i))return r;if(!I(t[0])&&I(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(var s=i.length-1;s>=0;s-=1)-1===(o=a(t,i[s].qInfo&&i[s].qInfo.qId,s))?(r.push({op:"remove",path:"".concat(n,"/").concat(s)}),i.splice(s,1)):r=r.concat(C.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,u=t.length;l<u;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){I(t[i])&&!O(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},C.apply=function(e,t){t.forEach(function(t){var n,r,i=k(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(w(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(w(a)&&w(t.value)){var l,u=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return S(e)}(r=u)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(A(a)&&A(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!O(n,e)&&delete n[e]}),E(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var c=k(e,t.from);w(i)?i.splice(+o,0,c.splice(+s,1)[0]):(i[o]=c[s],delete c[s])}else"remove"===t.op&&(w(i)?i.splice(+o,1):delete i[o])})},C.clone=function(e){return E({},e)},C.createPatch=function(e,t,n){var r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},C.updateObject=function(e,t){Object.keys(e).length?C.apply(e,C.generate(e,t)):E(e,t)};const T=C,L=function(e,n,r){if(!e)return Promise.resolve();var i=T.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var P="accumulation";function R(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===P)return n[r]}function F(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===P)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const _={translationKey:"properties.modifier.accumulation",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getNumStepComp(n,l),d=D.getAboveComp(n,l,c,p),f=D.getRangeComp("RangeSum",d);if(D.needDimension({modifier:n,properties:r,layout:i})){var m=D.getDimComp(u,1),h=D.getDimComp(u,0),g=D.getAggrComp(f,m,h);f=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,valueComp:g}):g}return f},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(F(t,e),".accumulationDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.accumulation.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(F(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.accumulation.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(F(t,e),".fullAccumulation")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(F(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=R(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=R(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(F(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(P))return!1;var o=R(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function V(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===j)return n[r]}function z(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===j)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var B={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const $={translationKey:"properties.modifier.movingAverage",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var u=s;void 0===u&&(u=D.getNumDimensions({properties:i,layout:a}));var c=o(i,"qHyperCubeDef.qDimensions",[]),p=r.showExcludedValues&&r.nullSuppression,d=D.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:c,dimensionAndFieldList:l,treatMissingAsNull:p}),f=D.getNumStepComp(r,u),m=D.getAboveComp(r,u,d,f);if(r.nullSuppression)t=D.getRangeComp("RangeAvg",m);else{var h=D.getRangeComp("RangeSum",m),g=function(e,t){var n=D.getRowNoComp(e,t);if(!D.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,u);t="".concat(h," / ").concat(g)}var y=t;if(D.needDimension({modifier:r,properties:i,layout:a})){var b=D.getDimComp(c,1),v=D.getDimComp(c,0),q=D.getAggrComp(y,b,v);y=r.showExcludedValues?D.getExcludedComp({modifier:r,dimensions:c,dimensionAndFieldList:l,funcComp:"Only",valueComp:q}):q}return y},extractInputExpression:D.extractInputExpression,initModifier:function(e){D.initModifier(e,B)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.movingAverage.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(z(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.movingAverage.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},fullRange:{refFn:function(t){return"".concat(z(t,e),".fullRange")},type:"boolean",translation:t.range||"properties.modifier.range",component:"dropdown",schemaIgnore:!0,defaultValue:!1,options:[{value:!0,translation:t.rangeFull||"properties.modifier.range.full"},{value:!1,translation:t.rangeCustom||"properties.modifier.range.custom"}]},steps:{refFn:function(t){return"".concat(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=V(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=V(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(z(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(j))return!1;var o=V(t,e);return o&&!o.disabled}};return n}};var U="timeSeriesDecomposition";function K(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===U)return n[r]}function W(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===U)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Y={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const G={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?D.generateTSDExpression(n,t,r):t},extractInputExpression:D.extractInputExpression,initModifier:function(e,t){D.initModifier(e,Y),""===e.decomposition&&t&&(e.decomposition=D.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(W(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(W(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=K(t,e);if(r){var i=r.steps;r.steps="number"!=typeof i||Number.isNaN(i)?2:Math.abs(i),n.properties.qHyperCubeDef.qMeasures=n.properties.qHyperCubeDef.qMeasures.map(function(e){return e.qDef.modifiers.map(function(e){return"timeSeriesDecomposition"===e.type?e.steps=i:e.steps=e.steps,e}),e})}},show:function(t){var n=K(t,e);return n&&!n.fullRange}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(U))return!1;var o=K(t,e);return o&&!o.disabled}};return n}};var J="difference";function Z(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===J)return n[r]}function Q(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===J)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var X={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:D.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=D.getAboveComp(n,l,c),d="".concat(c," - ").concat(p);if(D.needDimension({modifier:n,properties:r,layout:i})){var f=D.getDimComp(u,1),m=D.getDimComp(u,0),h=D.getAggrComp(d,f,m);d=n.showExcludedValues?D.getExcludedComp({modifier:n,dimensions:u,dimensionAndFieldList:s,funcComp:"Only",valueComp:h}):h}return d},initModifier:function(e){Object.keys(X).forEach(function(t){void 0===e[t]&&(e[t]=X[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(Q(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.difference.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},crossAllDimensions:{refFn:function(t){return"".concat(Q(t,e),".crossAllDimensions")},type:"boolean",translation:t.crossAllDimensions||"properties.modifier.crossAllDimensions",title:{translation:t.crossAllDimensionsTooltip||"properties.modifier.difference.crossAllDimensions.tooltip"},schemaIgnore:!0,defaultValue:!1,show:function(e,t){return t.layout.qHyperCube.qDimensionInfo.length>1}},showExcludedValues:{refFn:function(t){return"".concat(Q(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(J))return!1;var o=Z(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(D.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ue(e,t,n){return 0===e&&t>1?"<".concat(D.getDimDefWithWrapper(n),">"):""}const ce={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return D.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:D.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,a=e.numDimensions,s=e.dimensionAndFieldList;if(!n)return t;var l=a;void 0===l&&(l=D.getNumDimensions({properties:r,layout:i}));var u=o(r,"qHyperCubeDef.qDimensions",[]),c=D.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:u,dimensionAndFieldList:s}),p=n.selectionScope,d=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),u=""===s&&""===l?"":s||l,c=le(i,o),p=ue(i,o,a),d=function(e){for(var t=[],n=0;n<e;n++)t[n]=D.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(u," ").concat(c).concat(p," Aggr(").concat(u," ").concat(e,", ").concat(d,"))")}(c,p,n.field,n.value,d,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!D.isApplicable({properties:t.properties})}},settings:{type:"items",items:{selectionScope:{refFn:function(t){return"".concat(re(t,e),".selectionScope")},type:"string",translation:t.modifierSelectionScope||"properties.modifier.selectionScope",title:{translation:t.modifierSelectionScopeTooltip||"properties.modifier.selectionScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,options:function(n){return function(e,t,n){var r=[{value:0,translation:t.selectionScopeCurrentSelection||"properties.modifier.selectionScope.currentSelection"},{value:1,translation:t.selectionScopeSpecificValue||"properties.modifier.selectionScope.selectAField"},{value:2,translation:t.selectionScopeTotal||"properties.modifier.selectionScope.total"}];return r=function(e,t){if(1===e){var n=ie(t,0);t.splice(n,1)}return t}(ne(e,n).dimensionalScope,r),r}(n,t,e)}},field:{refFn:function(t){return"".concat(re(t,e),".field")},type:"string",component:"expression-with-dropdown",translation:"Common.Field",defaultValue:"",dropdownOnly:!0,options:function(e,t,n){return n.app.getFieldList().then(function(e){return e.map(function(e){return{label:e.qName,value:e.qName}})})},show:function(t){return 1===ne(t,e).selectionScope}},value:{refFn:function(t){return"".concat(re(t,e),".value")},type:"string",ref:"value",component:"string",translation:"properties.value",expression:"optional",show:function(t){return 1===ne(t,e).selectionScope}},dimensionalScope:{refFn:function(t){return"".concat(re(t,e),".dimensionalScope")},type:"string",translation:t.modifierDimensionalScope||"properties.modifier.dimensionalScope",title:{translation:t.modifierDimensionalScopeTooltip||"properties.modifier.dimensionalScope.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:2,supportTooltip:!0,options:function(n,r){return function(e,t,n,r){var i=t.layout.qHyperCube.qDimensionInfo.length,o=[{value:0,translation:n.dimensionalScopeOneDimension||"properties.modifier.dimensionalScope.respectOneDimension",tooltipTranslation:n.dimensionalScopeOneDimensionTooltip||"properties.modifier.dimensionalScope.respectOneDimension.tooltip"},{value:1,translation:n.dimensionalScopeAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension"),tooltipTranslation:n.dimensionalScopeAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"respectAllDimensions":"respectDimension",".tooltip")},{value:2,translation:n.dimensionalScopeDisregardAllDimensions||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension"),tooltipTranslation:n.dimensionalScopeDisregardAllDimensionsTooltip||"properties.modifier.dimensionalScope.".concat(2===i?"disregardAllDimensions":"disregardDimension",".tooltip")}];return o=function(e,t){if(e<2){var n=ie(t,0);t.splice(n,1)}return t}(i,o),o=function(e,t){if(0===e){var n=ie(t,1);t.splice(n,1)}return t}(ne(e,r).selectionScope,o),o}(n,r,t,e)}},primaryDimension:{refFn:function(t){return"".concat(re(t,e),".primaryDimension")},type:"integer",translation:t.primaryDimension||"properties.modifier.primaryDimension",title:{translation:t.primaryDimensionTooltip||"properties.modifier.normalization.primaryDimension.tooltip"},component:"dropdown",schemaIgnore:!0,defaultValue:1,options:function(e,t){return t.layout.qHyperCube.qDimensionInfo.map(function(e,t){return{value:t,label:e.qGroupFallbackTitles[0]}})},show:function(t,n){return 0===(ne(t,e).dimensionalScope||0)&&n.layout.qHyperCube.qDimensionInfo.length>1}}},show:function(e,t){return D.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ue};var pe="qDef.base",de="qDef.qDef",fe="qDef.base.qDef",me="qLibraryId",he="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,fe);return void 0!==t?t:o(e,de)},getExpressionRef:function(e){return void 0!==o(e,fe)?fe:de},getLibraryIdRef:function(e){return o(e,he)?he:me},getLibraryId:function(e){return o(e,he)||o(e,me)},getLabelRef:function(e){return o(e,pe)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,pe)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",be="qDef.base.qDef",ve="qLibraryId",qe="qDef.base.qLibraryId",xe="qDef.qLabel",De="qDef.qLabelExpression",Se="qDef.base.qLabel",Me="qDef.base.qLabelExpression",Ee="qDef.qAggrFunc",Ce="qDef.base.qAggrFunc",we={initBase:function(e,t){(t||we.isValid(e))&&(n(e,be,o(e,ye)),n(e,qe,o(e,ve)),n(e,Se,o(e,xe)),n(e,Me,o(e,De)))},restoreBase:function(e){we.isValid(e)&&(n(e,ye,o(e,be)),n(e,ve,o(e,qe)),n(e,xe,o(e,Se)),n(e,De,o(e,Me)),o(e,Ee)&&o(e,Ce)&&n(e,Ee,o(e,Ce)),delete e.qDef.base)},isValid:function(e){var t=o(e,be),n=o(e,qe);return void 0!==t||void 0!==n}};const Ae=we;function Ie(e){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(e)}var Oe={accumulation:_,movingAverage:$,difference:ee,normalization:ce,timeSeriesDecomposition:G};const ke={modifiers:Oe,apply:Te,applyModifiers:Le,cleanUpMeasure:Pe,destroy:function(e){e&&Ne[e.id]&&Ne[e.id].masterItemSubscriber&&(Ne[e.id].masterItemSubscriber&&Ne[e.id].masterItemSubscriber.unsubscribe(),delete Ne[e.id])},hasActiveModifiers:Re,getActiveModifier:Fe,initBase:Ae.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Oe[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Oe[e]&&Oe[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=je(e);We({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Qe({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:He};var Ne={};function Te(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;Ne[n.id]=Ne[n.id]||{isFirstTime:!0};var u=Ne[n.id].isFirstTime;if(Ne[n.id].isFirstTime=!1,r&&"object"===Ie(r))return Le({model:n,properties:r});var c=n?n.layout:void 0,p=o(c,"qSelectionInfo.qInSelections");if(a||p)return Promise.resolve(l);var d=o(c,"qHyperCube.qMeasureInfo"),f=Ne[n.id].lastReloadTime;if(Ne[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),Re({measures:d,layout:c})){var m=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return o(e.model,"app.layout.qLastReloadTime")!==r&&function(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ke({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:d,layout:c,model:n,lastReloadTime:f});return m||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return We({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:d,layout:c,masterItem:s,isFirstTime:u})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);ze(r);var i=Xe(r);return Ye({model:n}).then(function(t){return Ge({libraryIds:i,model:n}).then(function(i){return m&&function(e){var t=e.properties;_e(t).forEach(function(e){return function(e){var t=e.measure;if(Ke({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Ie(e)&&!e.disabled){if(n++,"object"!==Ie(Oe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Oe[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&D.simplifyExpression(t.qDef.base.qDef)!==D.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Le({model:n,oldProperties:e,properties:r,runUpdateIfChange:!0,masterItem:s,libraryItemsProps:i,dimensionAndFieldList:t})})})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Ie(e.base)})}(d)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Xe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return _e(r).forEach(function(e){return Pe(e)}),Ze({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Le(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,u=e.masterItem,c=e.libraryItemsProps,p=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),ze(i);var d=Xe(i);return et({model:n,libraryIds:d,masterItem:u}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=_e(r)),!n.length)return Promise.resolve();if(!Re({measures:n,properties:r}))return n.forEach(function(e){return Pe(e)}),Promise.resolve();var l=a?void 0:Xe(r);return Ye({model:i,dimensionAndFieldList:s}).then(function(e){return Ge({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){We({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Ae.isValid(n)||Ae.initBase(n,!0);var l=n.qDef,u=l.modifiers,c=l.base;Array.isArray(u)&&u.forEach(function(e){if("object"===Ie(e)&&!e.disabled){if(s++,"object"!==Ie(Oe[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(s>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Oe[e.type].initModifier(e,n);var l=n.qLibraryId||c&&c.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Oe[r.type].generateExpression({expression:s,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=l,n.qDef.qDef=r.outputExpression,(n.qDef.qLabel||a.qMeasure.qLabel)&&(n.qDef.qLabel=a.qMeasure.qLabel),(n.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(n.qDef.qLabelExpression=a.qMeasure.qLabelExpression),n.qDef.quarantine&&n.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(n.qDef.qNumFormat=a.qMeasure.qNumFormat,n.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete n.qLibraryId,n.qDef.coloring=a.qMeasure.coloring,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,libraryId:l,properties:r,libraryItemsProps:i,dimensionAndFieldList:a}):function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList;"function"==typeof Oe[r.type].updateModifier&&Oe[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:Oe[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||He(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&He(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Be(n)):Pe(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:c,dimensionAndFieldList:p}).then(function(){return l?Ze({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Pe(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some(function(e){return"object"===Ie(e)&&!e.disabled&&!Oe[e.type]})}(e)?Ae.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Be(e)}function Re(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return We({modifiers:je(e),properties:n,layout:r})})}function Fe(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Oe[r.type]&&!r.disabled)return r}}function He(e){var t=Fe(e);return!t||Oe[t.type].enableTotalsFunction(e)}function _e(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function Ve(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function ze(e){_e(e).forEach(function(e){return function(e){var n=Fe(e);n&&(void 0!==n.outputExpression&&Ve(n)!==e.qDef.qDef?delete e.qDef.base:!Ae.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Be(e){var t=je(e);Array.isArray(t)&&t.forEach(function(t){"object"===Ie(t)&&(t.disabled||!Oe[t.type]&&Ve(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function $e(e){return e.base||e.qDef&&e.qDef.base}function Ue(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ke(e){var t=e.measure,n=e.properties,r=e.layout;return!Ue(t)&&We({modifiers:je(t),properties:n,layout:r})}function We(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Ie(e)||e.disabled||!Oe[e.type])&&(void 0===i[e.type]&&(i[e.type]=Oe[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ye(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function Ge(e){var t=e.libraryIds,n=e.model,r=e.libraryItemsProps;if(r)return Promise.resolve(r);var i=t.measureLibraryIds,o=t.dimensionLibraryIds,a={},s=[];return i.forEach(function(e){var t=n.app.getMeasure(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),o.forEach(function(e){var t=n.app.getDimension(e).then(function(t){return t.getProperties().then(function(t){a[e]=t})});s.push(t)}),Promise.all(s).then(function(){return a})}function Je(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ze(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Je)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Je);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&o(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):L(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Qe(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Ie(e)&&!e.disabled&&Oe[e.type]&&Oe[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Xe(e){var t=_e(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=je(t);if(We({modifiers:r,properties:e})){var o=Ue(t);o&&n.push(o),i=i||Qe({modifiers:r,properties:e})}}),o(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function et(e){var t=e.model,n=e.libraryIds;return!e.masterItem&&n&&(n.measureLibraryIds.length||n.dimensionLibraryIds.length)?(Ne[t.id].masterItemSubscriber=Ne[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function u(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function c(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(u),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(c(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!r[e]&&s.push(c(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Te({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}})(),t.default=i.default,Object.defineProperty(t,"__esModule",{value:!0})})()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};return(()=>{function e(t){var n,r=t;return r>9?(n=65+r-10)>90&&(n+=6):r="".concat(r).charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?e(r+1):String.fromCharCode(n)}function t(n){var r=e(n%62),i=Math.floor(n/62);return i>0?t(i)+r:r}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}n.d(r,{default:()=>ze});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const p={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:c};var d=n(8),f=n.n(d);const m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},h=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&p.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},b=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},v=function(e){e.forEach(function(e){f().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function q(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var x=n(909),D=n.n(x);function S(e,t){var n=D()(!0,{},t,e);return o.getValue(n,"qOtherTotalSpec.qOtherCounted")||o.setValue(n,"qOtherTotalSpec.qOtherCounted",{qv:"10"}),o.getValue(n,"qOtherTotalSpec.qOtherLimit")||o.setValue(n,"qOtherTotalSpec.qOtherLimit",{qv:"0"}),n.hasOwnProperty("othersLabel")||(n.othersLabel="Others"),n}function M(e,t){return D()(!0,{},t,e)}function E(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var C=Math.pow(2,53)-1;function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const I=function(e,t,n){var r="masterobject"===o.getValue(t,"properties.qInfo.qType")?"masterobject":o.getValue(n,"qInfo.qType");o.setValue(e,"qInfo.qType",r),e.visualization=n.visualization},O=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},k=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},N=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},T=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},L=function(e){var t,n=e.exportFormat,r=e.maxDimensions,i=e.minDimensions,o=e.newHyperCubeDef,a=e.defaultDimension,s=n.data[0];for(t=0;t<s.dimensions.length;++t){var l=S(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var u=S(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(u):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(u)}},P=function(e){var t,n=e.exportFormat,r=e.maxMeasures,i=e.minMeasures,o=e.newHyperCubeDef,a=e.defaultMeasure,s=n.data[0];for(t=0;t<s.measures.length;++t){var l=M(s.measures[t],a);o.qMeasures.length<r?o.qMeasures.push(l):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(l)}for(t=0;t<s.excludedMeasures.length;++t){var u=M(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(u):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(u)}},R=function(e){var t=e.exportFormat,n=e.dataDefinition,r=void 0===n?{}:n,i=t.data[0],o=r.dimensions||{max:0},a=r.measures||{max:0},s=E(a.max,i.dimensions.length,C),l=E(a.min,i.dimensions.length,0);return{maxDimensions:E(o.max,s,C),minDimensions:E(o.min,l,0),maxMeasures:s,minMeasures:l}},F=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(p.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,p.indexRemoved(n.qInterColumnSortOrder,o))},H=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=D()(!0,{},t.properties[e].quarantine)):"qHyperCubeDef"===e&&r?o.setValue(i,"".concat(r,".qHyperCubeDef"),t.properties.qHyperCubeDef):n.hasOwnProperty(e)||-1!==["qMetaDef","descriptionExpression","labelExpression"].indexOf(e)||function(e,t){return"components"===t&&Array.isArray(e[t])&&e[t].some(function(e){return"general"===e.key})}(t.properties,e)?i[e]=t.properties[e]:i.qLayoutExclude.disabled[e]=t.properties[e]}),null===(i=D()(!0,{},n,i)).components&&(i.components=[]),i},_=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},V=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.dimensions&&"function"==typeof r.dimensions.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return w(e)}(t=a.qDimensions)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),r.dimensions.added(e,n)})}},z=function(e){var t,n=e.newProperties,r=e.dataDefinition,i=e.hypercubePath;if(r.measures&&"function"==typeof r.measures.added){var a=o.getValue(n,i||"").qHyperCubeDef,s=function(e){if(Array.isArray(e))return A(e)}(t=a.qMeasures)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return A(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();a.qMeasures=[],s.forEach(function(e){a.qMeasures.push(e),r.measures.added(e,n)})}},B=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&f().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function $(e,t){var n=o.getValue(e,"qLayoutExclude.quarantine",{})[t];return!!n&&(Object.keys(n).forEach(function(t){o.setValue(e,t,n[t])}),delete e.qLayoutExclude.quarantine[t],!0)}const U={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t={data:[],properties:{}},n=0;n<e;++n)t.data.push({dimensions:[],measures:[],excludedDimensions:[],excludedMeasures:[],interColumnSortOrder:[]});return t}(),a=t.qProperty,s=o.getValue(a,n||""),l=s.qHyperCubeDef;return l.qInterColumnSortOrder||(l.qInterColumnSortOrder=[]),m({exportFormat:i,qHyperCubeDef:l}),h({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),b({exportFormat:i,properties:a}),r||v(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(q(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(q(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(q(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,u=e.hypercubePath,c=e.extension,p=e.supportedFilters,d=void 0===p||p,f=e.isHCModifierSupported,m=void 0===f||f,h={qChildren:[]},g=H({exportFormat:t,initialProperties:r,hypercubePath:u}),y=o.getValue(r,u||"").qHyperCubeDef,b=o.getValue(g,u||"").qHyperCubeDef,v=R({exportFormat:t,dataDefinition:a}),q=v.maxDimensions,x=v.minDimensions,D=v.maxMeasures,S=v.minMeasures,M=l.defaultDimension,E=void 0===M?N():M,C=l.defaultMeasure,w=void 0===C?T():C;b.qDimensions.length=0,b.qMeasures.length=0,_({exportFormat:t,maxDimensions:q,minDimensions:x,maxMeasures:D,minMeasures:S})&&j({exportFormat:t,maxDimensions:q,minDimensions:x,maxMeasures:D,minMeasures:S,newHyperCubeDef:b}),L({exportFormat:t,maxDimensions:q,minDimensions:x,newHyperCubeDef:b,defaultDimension:E}),P({exportFormat:t,maxMeasures:D,minMeasures:S,newHyperCubeDef:b,defaultMeasure:w}),V({newProperties:g,dataDefinition:a,hypercubePath:u}),z({newProperties:g,dataDefinition:a,hypercubePath:u}),F({exportFormat:t,newHyperCubeDef:b}),O("qMaxStackedCells",y,b),O("qNoOfLeftDims",y,b),k("qInitialDataFetch",y,b,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),k("qMode",y,b,"S"),k("qReductionMode",y,b,"N"),k("qSortbyYValue",y,b),k("qIndentMode",y,b),k("qShowTotalsAbove",y,b),I(g,t,r),h.qProperty=g;var A=o.getValue(c||{},"support.modifiers");return B({measures:b.qMeasures,modifierTypes:A}),d&&$(h.qProperty,"storedFilters"),"S"===b.qMode&&m&&$(h.qProperty,"dynamicScript"),h}};var K={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function W(e,t,n,r){t=t||[];var i=c(e,r,n),o=c(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function Y(e,t){return e.length!==t}const G={create:function(e,t){if(!e||!K[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(W(a,t,r,i),Y(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},J={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>0&&J.getNumMeasures(e)<=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>0},expression:function(e){return J.getNumMeasures(e)>=1}}},Q={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}};var X={scatterplot:Q,"sn-scatter-plot":Q,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)<=1},expression:function(e){return J.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return J.getNumDimensions(e)>=1},multiColor:function(e){return J.getNumMeasures(e)>1},measure:function(e){return J.getNumDimensions(e)>=1},expression:function(e){return J.getNumDimensions(e)>=1}}},distributionplot:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return J.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=p.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=G.IDMAP.COLOR_BY_ALTERNATIVE;e.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)}),t.forEach(function(e){ee(e,"qAttributeDimensions",n),ee(e,"qAttributeExpressions",n)})}function ne(e,t){if(t){var n="="===t.charAt(0);e.color.altLabel=n?{qStringExpression:{qExpr:t.substr(1)}}:t}}function re(e){var t=e.properties,n=e.isDimension,r=e.dimensions,i=e.excludedDimensions,a=e.measures,s=e.label;te(r,i);var l=r[r.length-1];if(l){var u=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),c=o.getValue(t,"color.formatting.qNumFormat"),d=o.getValue(t,"color.formatting.isCustomFormatted");if(u){var f=G.create(G.IDMAP.COLOR_BY_ALTERNATIVE);switch(u.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:f,label:s,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=p.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:f,measures:a,item:u,isDimension:n,qNumFormat:c,isCustomFormatted:d})}n?(f.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(f)):l.qAttributeExpressions.push(f)}}}function ie(e,t,n,r){var i,o,a,s={};switch(e){case"dimension":n.qLibraryId?(s.type="dimension",s.name=n.qLibraryId,s.id=n.qLibraryId):(s.type="field",t?(s.name=n.label||n.qDef,s.id=n.qDef):(s.name=n.qDef.qFieldDefs[0],s.label=(a=n.qDef).qLabelExpression?a.qLabelExpression:a.qFieldLabels&&a.qFieldLabels[0]?a.qFieldLabels[0]:a.qFieldDefs[0]));break;case"measure":i=function(e,t){return t?e.qLibraryId:f().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return f().hasActiveModifiers({measures:[e]})&&t?e.qDef.qDef:void 0}(n,r),o&&(s.expression=o)):(s.type="expression",t?(s.name=n.label||n.qExpression,s.id=n.qExpression):(s.name=n.qDef.qDef,s.label=function(e){var t=e.qDef;return t.qLabelExpression?t.qLabelExpression:t.qLabel?t.qLabel:t.qDef}(n)));break;default:throw new Error('columnType should be "dimension" or "measure"')}return s}const oe={useMasterNumberFormat:function(e){e.quarantine={qNumFormat:e.qNumFormat||{},isCustomFormatted:e.isCustomFormatted||!1},e.qNumFormat=null,e.isCustomFormatted=void 0}};function ae(e,t,n,r){var i=t.type,o=e.color,a=o.mode,s=J.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||J.wrapFieldName(t.name),key:J.wrapFieldName(t.name),type:"expression",activeDimensionIndex:t.activeDimensionIndex};break;case"expression":a="byMeasure",o.byMeasureDef={label:s,key:t.name,type:"expression",activeMeasureIndex:t.activeMeasureIndex};break;case"dimension":a="byDimension",o.byDimDef={label:t.name,key:t.id,type:"libraryItem",activeDimensionIndex:t.activeDimensionIndex};break;case"measure":a="byMeasure",o.byMeasureDef={label:t.name,key:t.id,expression:t.expression,type:"libraryItem",activeMeasureIndex:t.activeMeasureIndex},o.formatting&&oe.useMasterNumberFormat(o.formatting)}o.auto=!1,o.mode=a}function se(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byDimDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeDimensionIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"color.byDimDef");r.activeDimensionIndex=Math.min(r.activeDimensionIndex,n.length-1);var i=ie("dimension",!1,n[r.activeDimensionIndex]);i.activeDimensionIndex=r.activeDimensionIndex,ae(e,i)}(e,t);else if(function(e){return!e||!e.key}(a)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=n[function(e,t,n){var r=o.getValue(t,"visualization"),i=n.split("."),a=Number(i[1]),s=o.getValue(t,"layers.".concat(a,".type"));return 2===e.length&&"map"===r&&"point"===s}(n,e,t)?0:n.length-1],i=G.IDMAP.COLOR_BY_ALTERNATIVE,a=p.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ue=function(e,t){var n={primary:!0};if(e){var r=(X[t]||Z).colorModeOptions||Z.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ce=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},pe=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=G.IDMAP.COLOR_BY_ALTERNATIVE,s=p.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},de=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},fe=function(e){var t=e.shouldUpdateColorBy,n=e.properties,r=o.getValue(n,"qHyperCubeDef.qMeasures",[]),i=o.getValue(n,"color.mode","");return!t&&"byExpression"===i&&r.length>0},me=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},he=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=U.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),o=i.data[0],a=o.dimensions.concat(o.excludedDimensions),s=o.measures.concat(o.excludedMeasures),l=G.IDMAP,u=l.COLOR_BY_ALTERNATIVE,c=l.COLOR_BY_EXPRESSION;return G.moveByIdFromGroup(a,[],"qAttributeDimensions",u),G.moveByIdFromGroup(a,[],"qAttributeExpressions",u),G.moveByIdFromGroup(s,[],"qAttributeExpressions",c),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=U.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty,d=o.getValue(p,"visualization"),f=o.getValue(p,"qHyperCubeDef.qDimensions",[]),m=o.getValue(p,"color.mode",""),h=o.getValue(p,"color.auto",""),g=ue(p,d),y=ce({canColorBy:g,autoColor:h,colorMode:m,dimensions:f});return g[m]?fe({shouldUpdateColorBy:y,properties:p})&&me(p):he(p),y&&pe(p,"qHyperCubeDef."),ge(p)&&le(p,"color.persistent",!0),de(f),c}};var be=["bar","marker","line"];const ve=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?$(n,"unsupportedAutoMinMax")||D()(n.measureAxis,t.measureAxis):$(n,"supportedAutoMinMax")||D()(n.measureAxis,t.measureAxis)},qe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),be.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(a);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&D()(s,n.properties.measureAxes[t[0].axis])):D()(s,n.properties.measureAxes[0])}},xe=function(e){if(e.qDimensions.length>1){var t=e.qInterColumnSortOrder.indexOf(0);if(0!==t){var n=e.qInterColumnSortOrder[0];e.qInterColumnSortOrder[0]=0,e.qInterColumnSortOrder[t]=n}}},De={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(q(s,"measureAxis.min","supportedAutoMinMax"),q(s,"measureAxis.max","supportedAutoMinMax")):(q(s,"measureAxis.min","unsupportedAutoMinMax"),q(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,u=e.isHCModifierSupported,c=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:u}),p=c.qProperty;return ve({initialProperties:n,properties:p}),qe({exportFormat:t,initialProperties:n,properties:p,measureType:a}),xe(p.qHyperCubeDef),p.qHyperCubeDef.qColumnOrder=[],p.qHyperCubeDef.columnOrder=[],c}};function Se(e,t,n){return"qLayoutExclude.quarantine.".concat(e,".").concat(t,".").concat(n)}function Me(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,a);if(void 0!==s){var l=o.getValue(i,"qDef.cId");l||(l=o.generateId(),o.setValue(i,"qDef.cId",l));var u=Se(n,r,l);o.setValue(t,u,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}function Ee(e){var t=e.properties,n=e.arrayPath,r=e.quarantineName,i=e.arrayName,a=e.itemPath;o.getValue(t,n,[]).forEach(function(e){return function(e){var t=e.properties,n=e.quarantineName,r=e.arrayName,i=e.item,a=e.itemPath,s=o.getValue(i,"qDef.cId");if(s){var l=Se(n,r,s),u=o.getValue(t,l);void 0!==u&&(o.setValue(i,a,u),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}var Ce="qHyperCubeDef.qMeasures",we="conditionalColoring",Ae="measures",Ie="qDef.conditionalColoring";const Oe={quarantine:function(e){Me({properties:e,arrayPath:Ce,quarantineName:we,arrayName:Ae,itemPath:Ie})},unquarantine:function(e){Ee({properties:e,arrayPath:Ce,itemPath:Ie,arrayName:Ae,quarantineName:we})}};var ke="qHyperCubeDef.qMeasures",Ne="measures",Te="qHyperCubeDef.qDimensions",Le="dimensions",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",Re="alternativeMeasures",Fe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",He="alternativeDimensions",_e="qCalcCondition",je="conditionalShowHide";const Ve={quarantine:function(e){Me({properties:e,arrayPath:ke,quarantineName:je,arrayName:Ne,itemPath:_e}),Me({properties:e,arrayPath:Te,quarantineName:je,arrayName:Le,itemPath:_e})},unquarantine:function(e){Ee({properties:e,arrayPath:ke,quarantineName:je,arrayName:Ne,itemPath:_e}),Ee({properties:e,arrayPath:Te,quarantineName:je,arrayName:Le,itemPath:_e})},quarantineAlternative:function(e){Me({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Re,itemPath:_e}),Me({properties:e,arrayPath:Fe,quarantineName:je,arrayName:He,itemPath:_e})},unquarantineAlternative:function(e){Ee({properties:e,arrayPath:Pe,quarantineName:je,arrayName:Re,itemPath:_e}),Ee({properties:e,arrayPath:Fe,quarantineName:je,arrayName:He,itemPath:_e})}},ze={hypercube:U,colorChart:ye,axisChart:De,quarantineProperty:q,unquarantineProperty:$,quarantineArrayProp:Me,unquarantineArrayProp:Ee,conditionalColoring:Oe,conditionalShow:Ve}})(),r.default})()),L.exports),R=N(P);const F={AUTO:!0,BIN_COUNT:10,BIN_SIZE:10,LABEL:"x",OFFSET:0,COUNT_DISTINCT:!1,BIN_MODE:"maxCount"};Object.freeze(F);const H={version:"1.0.2",qHyperCubeDef:{qDimensions:[],qMeasures:[],qMode:"S",qAlwaysFullyExpanded:!0,qSuppressZero:!1,qSuppressMissing:!0},bins:{auto:F.AUTO,binCount:"",binSize:F.BIN_SIZE,offset:F.OFFSET,countDistinct:F.COUNT_DISTINCT,binMode:F.BIN_MODE},color:{bar:{paletteColor:{index:6,color:"#4477aa"}}},dataPoint:{showLabels:!1},dimensionAxis:{dock:"near",label:"auto",show:"all"},measureAxis:{autoMinMax:!0,dock:"near",label:"",max:10,min:0,minMax:"min",show:"all",spacing:1},gridlines:{auto:!0,spacing:2},refLine:{refLines:[]},sorting:{autoSort:!0},showTitles:!0,subtitle:"",title:"",footnote:""};function _(e){const{translator:t}=e;return{path:"/qHyperCubeDef",dimensions:{min:1,max:1,description:()=>t.get("Visualization.Histogram.Binning")},measures:{min:0,max:0}}}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function V(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||$(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){if(e){if("string"==typeof e)return j(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}var U,K="top",W="top-right",Y="right",G="bottom-right",J="bottom",Z="bottom-left",Q="left",X="top-left";V(V(V(V(V(V(V(V(V(V(U={},"equal-equal",[K,J]),"equal-higher",[J,G]),"equal-lower",[K,W]),"equal-void",[K,J]),"higher-equal",[Q,Z,K,W]),"higher-higher-acute",[J,Z,Q,W]),"higher-higher-obtuse",[J,K]),"higher-lower-negative",[K,W,Y]),"higher-lower-positive",[J,Z,Q]),"higher-void",[K]),V(V(V(V(V(V(V(V(V(V(U,"lower-equal",[K]),"lower-higher-negative",[K,X]),"lower-higher-positive",[G]),"lower-lower-acute",[K,X,Q,W,Y]),"lower-lower-obtuse",[K,J]),"lower-void",[K]),"void-equal",[K]),"void-higher",[K,J]),"void-lower",[K,J,Q]),"void-void",[K]),V(U,"unclassified",[K,J,Y,Q,W,G,Z,X]);var ee=["American Typewriter, serif","Andalé Mono, monospace","Arial Black, sans-serif","Arial, sans-serif","Bradley Hand, cursive","Brush Script MT, cursive","Comic Sans MS, cursive","Courier, monospace","Didot, serif","Georgia, serif","Impact, sans-serif","Lucida Console, monospace","Luminari, fantasy","Monaco, monospace","QlikView Sans, sans-serif","Source Sans Pro, sans-serif","Tahoma, sans-serif","Times New Roman, serif","Trebuchet MS, sans-serif","Verdana, sans-serif"],te=["Abril Fatface, serif","Bangers, fantasy","Bebas Neue, sans serif","EB Garamond, serif","Fredoka One, fantasy","Graduate, fantasy","Gravitas One, serif","Indie Flower, fantasy","Inter, sans-serif","Lobster, fantasy","Montserrat, sans-serif","Nixie One, sans-serif","Noto Sans, sans-serif","Open Sans, sans-serif","PT Serif, serif","Pacifico, cursive","Permanent Marker, fantasy","QlikView Sans, sans-serif","Raleway, sans-serif","Rammetto One, fantasy","Roboto, sans-serif","Source Sans Pro, sans-serif","Titan One, fantasy","Yanone Kaffeesatz, sans-serif"];var ne=function(e){return{value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}}};function re(e){var t=e.theme,n=e.translator,r=e.defaultValue,i=e.flags,o=[],a=t.getStyle("","","fontFamilies");return Array.isArray(a)&&a.length?o.push.apply(o,B(new Set([r].concat(B(a.map(function(e){return e.split(",").map(function(e){return e.trim()}).map(function(e){return e.replace(/\s+/g," ").trim()}).filter(Boolean).join(", ")})))))):o.push(r),[{value:"ThemeHeader",label:n.get("properties.themeFonts"),metaText:n.get("properties.theme"),groupHeader:!0}].concat(B(o.map(function(e){return ne(e)})),[{value:"DefaultHeader",label:n.get("properties.allFonts"),metaText:n.get("properties.default"),groupHeader:!0}],B(function(e){return null!=e&&e.isEnabled("PS_20852_WYSIWYG_FONT_SUPPORT")?te:ee}(i).map(function(e){return ne(e)})))}function ie(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=e.flags,a=function(){return t.getStyle(r,i,"fontFamily")};return{getDefaultValue:function(){return a()},getOptions:function(){return re({theme:t,translator:n,defaultValue:a(),flags:o})}}}var oe,ae,se=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"],le=function(e){return{value:e,label:e,groupHeader:!1,disabled:!1}};function ue(e){var t=e.theme,n=e.translator,r=e.id,i=e.path,o=function(){return t.getStyle(r,i,"fontSize")};return{getDefaultValue:function(){return o()},getOptions:function(){return function(e){var t=e.translator,n=e.defaultValue,r=[],i=e.theme.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push.apply(r,B(new Set([n].concat(B(i))))):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0}].concat(B(r.map(function(e){return le(e)})),[{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0}],B(se.map(function(e){return le(e)})))}({theme:t,translator:n,defaultValue:o()})}}}function ce(e){var t=e.theme,n=e.translator,r=e.id,i=e.path;return{fontFamily:ie({theme:t,translator:n,id:r,path:i,flags:e.flags}),fontSize:ue({theme:t,translator:n,id:r,path:i})}}function pe(e){var t=e.theme,n=e.translator,r=e.config,i=void 0===r?{}:r,o=e.flags,a=function(e){var t=e.config,n=void 0===t?{}:t,r=n.id,i=n.paths;return{id:void 0===r?"object":"".concat("object",".").concat(r),paths:Array.isArray(i)?i:[]}}({config:i}),s=a.id,l=a.paths,u={};l.forEach(function(e){for(var r=e.split("."),i=u,a=0;a<r.length;a++){var l=r[a];a===r.length-1?i[l]=ce({theme:t,translator:n,id:s,path:e,flags:o}):void 0===i[l]&&(i[l]={}),i=i[l]}});var c=function(e){for(var t=e.split("."),n=u,r=0;r<t.length;r++){var i=t[r];if(void 0===n[i])throw new Error("font-resolver: Path '".concat(e,"' could not be resolved."));n=n[i]}return n};return u.getDefaultValue=function(e){return c(e).getDefaultValue()},u.getOptions=function(e){return c(e).getOptions()},u}var de,fe=function(){if(ae)return oe;ae=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return oe=function e(){var t,n,r,l,u,c,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},oe}();function me(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function he(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ge(){}(de=fe)&&de.__esModule&&Object.prototype.hasOwnProperty.call(de,"default")&&de.default;var ye=1/.7,be="\\s*([+-]?\\d+)\\s*",ve="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xe=/^#([0-9a-f]{3,8})$/,De=new RegExp(`^rgb\\(${be},${be},${be}\\)$`),Se=new RegExp(`^rgb\\(${qe},${qe},${qe}\\)$`),Me=new RegExp(`^rgba\\(${be},${be},${be},${ve}\\)$`),Ee=new RegExp(`^rgba\\(${qe},${qe},${qe},${ve}\\)$`),Ce=new RegExp(`^hsl\\(${ve},${qe},${qe}\\)$`),we=new RegExp(`^hsla\\(${ve},${qe},${qe},${ve}\\)$`),Ae={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 Ie(){return this.rgb().formatHex()}function Oe(){return this.rgb().formatRgb()}function ke(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=xe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Ne(t):3===n?new Re(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Te(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Te(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=De.exec(e))?new Re(t[1],t[2],t[3],1):(t=Se.exec(e))?new Re(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Me.exec(e))?Te(t[1],t[2],t[3],t[4]):(t=Ee.exec(e))?Te(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ce.exec(e))?ze(t[1],t[2]/100,t[3]/100,1):(t=we.exec(e))?ze(t[1],t[2]/100,t[3]/100,t[4]):Ae.hasOwnProperty(e)?Ne(Ae[e]):"transparent"===e?new Re(NaN,NaN,NaN,0):null}function Ne(e){return new Re(e>>16&255,e>>8&255,255&e,1)}function Te(e,t,n,r){return r<=0&&(e=t=n=NaN),new Re(e,t,n,r)}function Le(e){return e instanceof ge||(e=ke(e)),e?new Re((e=e.rgb()).r,e.g,e.b,e.opacity):new Re}function Pe(e,t,n,r){return 1===arguments.length?Le(e):new Re(e,t,n,null==r?1:r)}function Re(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Fe(){return`#${Ve(this.r)}${Ve(this.g)}${Ve(this.b)}`}function He(){const e=_e(this.opacity);return`${1===e?"rgb(":"rgba("}${je(this.r)}, ${je(this.g)}, ${je(this.b)}${1===e?")":`, ${e})`}`}function _e(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function je(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ve(e){return((e=je(e))<16?"0":"")+e.toString(16)}function ze(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $e(e,t,n,r)}function Be(e){if(e instanceof $e)return new $e(e.h,e.s,e.l,e.opacity);if(e instanceof ge||(e=ke(e)),!e)return new $e;if(e instanceof $e)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new $e(a,s,l,e.opacity)}function $e(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ue(e){return(e=(e||0)%360)<0?e+360:e}function Ke(e){return Math.max(0,Math.min(1,e||0))}function We(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}me(ge,ke,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ie,formatHex:Ie,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Be(this).formatHsl()},formatRgb:Oe,toString:Oe}),me(Re,Pe,he(ge,{brighter(e){return e=null==e?ye:Math.pow(ye,e),new Re(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Re(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Re(je(this.r),je(this.g),je(this.b),_e(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:Fe,formatHex:Fe,formatHex8:function(){return`#${Ve(this.r)}${Ve(this.g)}${Ve(this.b)}${Ve(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:He,toString:He})),me($e,function(e,t,n,r){return 1===arguments.length?Be(e):new $e(e,t,n,null==r?1:r)},he(ge,{brighter(e){return e=null==e?ye:Math.pow(ye,e),new $e(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new $e(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Re(We(e>=240?e-240:e+120,i,r),We(e,i,r),We(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new $e(Ue(this.h),Ke(this.s),Ke(this.l),_e(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=_e(this.opacity);return`${1===e?"hsl(":"hsla("}${Ue(this.h)}, ${100*Ke(this.s)}%, ${100*Ke(this.l)}%${1===e?")":`, ${e})`}`}}));const Ye=Math.PI/180,Ge=180/Math.PI,Je=4/29,Ze=6/29,Qe=3*Ze*Ze;function Xe(e){if(e instanceof et)return new et(e.l,e.a,e.b,e.opacity);if(e instanceof ot)return at(e);e instanceof Re||(e=Le(e));var t,n,r=it(e.r),i=it(e.g),o=it(e.b),a=tt((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=tt((.4360747*r+.3850649*i+.1430804*o)/.96422),n=tt((.0139322*r+.0971045*i+.7141733*o)/.82521)),new et(116*a-16,500*(t-a),200*(a-n),e.opacity)}function et(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function tt(e){return e>.008856451679035631?Math.pow(e,1/3):e/Qe+Je}function nt(e){return e>Ze?e*e*e:Qe*(e-Je)}function rt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function it(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ot(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function at(e){if(isNaN(e.h))return new et(e.l,0,0,e.opacity);var t=e.h*Ye;return new et(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}me(et,function(e,t,n,r){return 1===arguments.length?Xe(e):new et(e,t,n,null==r?1:r)},he(ge,{brighter(e){return new et(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new et(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 Re(rt(3.1338561*(t=.96422*nt(t))-1.6168667*(e=1*nt(e))-.4906146*(n=.82521*nt(n))),rt(-.9787684*t+1.9161415*e+.033454*n),rt(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),me(ot,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof ot)return new ot(e.h,e.c,e.l,e.opacity);if(e instanceof et||(e=Xe(e)),0===e.a&&0===e.b)return new ot(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Ge;return new ot(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ot(e,t,n,null==r?1:r)},he(ge,{brighter(e){return new ot(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ot(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return at(this).rgb()}}));var st=e=>()=>e;function lt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):st(isNaN(e)?t:e)}!function e(t){var n=function(e){return 1==(e=+e)?lt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):st(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Pe(e)).r,(t=Pe(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=lt(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);var ut="center",ct="bottom";function pt(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}[{key:"NoDataExist",alignment:ut,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:ut,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:ut,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:ut},{key:"DataRangeIncludingZero",alignment:ct},{key:"LimitedData",alignment:ct},{key:"NegativeOrZeroValues",alignment:ct}].reduce(function(e,t){return e[t.key]=t,e},{});var dt,ft=["__proto__","constructor"];function mt(e,t,n){if(void 0!==e&&void 0!==t){var r=t.split("."),i=r[r.length-1];if(!ft.some(function(e){return r.includes(e)})){for(var o=e,a=0;a<r.length-1;++a){var s=r[a];void 0===o[s]&&(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}}}function ht(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function gt(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=bt)):void 0===t&&(t=yt);for(var n,r,i,o,a,s=new xt(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new xt(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(qt)}function yt(e){return e.children}function bt(e){return Array.isArray(e)?e[1]:null}function vt(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function qt(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function xt(e){this.data=e,this.depth=this.height=0,this.parent=null}xt.prototype=gt.prototype={constructor:xt,count:function(){return this.eachAfter(ht)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return gt(this).eachBefore(vt)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},dt=function(e){
8
8
  /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
9
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),b=d-g,y=e.substring(b,b+1),v=b+("."===y||","===y?1:0),x=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",b=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)h+=p.charAt(v),!((v-b+1)%l)&&v<d-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),m+(n?"-":"")+r+x}},nt({exports:{}});var dt="'Source Sans Pro', 'Arial', 'sans-serif'",ft="#333333",mt="#595959",ht="#737373",gt="#cccccc",bt="#e6e6e6";function yt(e){var t={};return[].concat(z(e),z([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",mt],["object","axis.label.name","fontFamily",dt],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",gt],["object","axis.line.minor","color",bt],["object","axis.title","color"],["object","axis.title","fontFamily",dt],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",bt],["object","grid.line.major","color",gt],["object","grid.line.minor","color",bt],["object","label.value","color",mt],["object","label.value","fontFamily",dt],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",mt],[!1,"label.value","lightColor",bt],["object","outOfRange","color","#999"],["object","legend.title","color",ft],["object","legend.title","fontFamily",dt],["object","legend.title","fontSize","15px"],["object","legend.label","color",mt],["object","legend.label","fontFamily",dt],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",ft],["object","referenceLine.label.name","fontFamily",dt],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",bt],["object","referenceLine.outOfBounds","fontFamily",dt],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",ht,function(e){return"transparent"===e?ht:e}]])).reduce((function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e}),[]).sort((function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)}))}var vt=function(e){return e};function xt(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce((function(e,t){var n=j(t,2),r=n[0],i=n[1];return e[r]=i,e}),{});return o.forEach((function(e){var r=j(e,5),i=r[0],o=r[1],l=r[2],u=r[3],c=r[4],p=void 0===c?function(e){return e}:c,d=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:u}),f=(s["".concat(o,".").concat(l)]||vt)(p(d));it(a,[o,l].filter(Boolean).join("."),f)})),i.forEach((function(e){var t=j(e,2),n=t[0],r=t[1];it(a,n,r)})),a}var qt=Object.prototype.hasOwnProperty,Dt=Object.prototype.toString,St=Object.defineProperty,Et=Object.getOwnPropertyDescriptor,Ct=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Dt.call(e)},Mt=function(e){if(!e||"[object Object]"!==Dt.call(e))return!1;var t,n=qt.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&qt.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||qt.call(e,t)},wt=function(e,t){St&&"__proto__"===t.name?St(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},At=function(e,t){if("__proto__"===t){if(!qt.call(e,t))return;if(Et)return Et(e,t).value}return e[t]};function It(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function kt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ot(){}!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}((function e(){var t,n,r,i,o,a,s=arguments[0],l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=At(s,n),s!==(i=At(t,n))&&(c&&i&&(Mt(i)||(o=Ct(i)))?(o?(o=!1,a=r&&Ct(r)?r:[]):a=r&&Mt(r)?r:{},wt(s,{name:n,newValue:e(c,a,i)})):void 0!==i&&wt(s,{name:n,newValue:i}));return s}));var Nt=1/.7,Lt="\\s*([+-]?\\d+)\\s*",Tt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Pt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Rt=/^#([0-9a-f]{3,8})$/,Ft=new RegExp(`^rgb\\(${Lt},${Lt},${Lt}\\)$`),Ht=new RegExp(`^rgb\\(${Pt},${Pt},${Pt}\\)$`),_t=new RegExp(`^rgba\\(${Lt},${Lt},${Lt},${Tt}\\)$`),Vt=new RegExp(`^rgba\\(${Pt},${Pt},${Pt},${Tt}\\)$`),jt=new RegExp(`^hsl\\(${Tt},${Pt},${Pt}\\)$`),zt=new RegExp(`^hsla\\(${Tt},${Pt},${Pt},${Tt}\\)$`),Bt={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 $t(){return this.rgb().formatHex()}function Ut(){return this.rgb().formatRgb()}function Kt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Rt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Wt(t):3===n?new Zt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Gt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Gt(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=Ft.exec(e))?new Zt(t[1],t[2],t[3],1):(t=Ht.exec(e))?new Zt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=_t.exec(e))?Gt(t[1],t[2],t[3],t[4]):(t=Vt.exec(e))?Gt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=jt.exec(e))?rn(t[1],t[2]/100,t[3]/100,1):(t=zt.exec(e))?rn(t[1],t[2]/100,t[3]/100,t[4]):Bt.hasOwnProperty(e)?Wt(Bt[e]):"transparent"===e?new Zt(NaN,NaN,NaN,0):null}function Wt(e){return new Zt(e>>16&255,e>>8&255,255&e,1)}function Gt(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zt(e,t,n,r)}function Yt(e){return e instanceof Ot||(e=Kt(e)),e?new Zt((e=e.rgb()).r,e.g,e.b,e.opacity):new Zt}function Jt(e,t,n,r){return 1===arguments.length?Yt(e):new Zt(e,t,n,null==r?1:r)}function Zt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Qt(){return`#${nn(this.r)}${nn(this.g)}${nn(this.b)}`}function Xt(){const e=en(this.opacity);return`${1===e?"rgb(":"rgba("}${tn(this.r)}, ${tn(this.g)}, ${tn(this.b)}${1===e?")":`, ${e})`}`}function en(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function nn(e){return((e=tn(e))<16?"0":"")+e.toString(16)}function rn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new an(e,t,n,r)}function on(e){if(e instanceof an)return new an(e.h,e.s,e.l,e.opacity);if(e instanceof Ot||(e=Kt(e)),!e)return new an;if(e instanceof an)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new an(a,s,l,e.opacity)}function an(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function sn(e){return(e=(e||0)%360)<0?e+360:e}function ln(e){return Math.max(0,Math.min(1,e||0))}function un(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}It(Ot,Kt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:$t,formatHex:$t,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return on(this).formatHsl()},formatRgb:Ut,toString:Ut}),It(Zt,Jt,kt(Ot,{brighter(e){return e=null==e?Nt:Math.pow(Nt,e),new Zt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Zt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zt(tn(this.r),tn(this.g),tn(this.b),en(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:Qt,formatHex:Qt,formatHex8:function(){return`#${nn(this.r)}${nn(this.g)}${nn(this.b)}${nn(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Xt,toString:Xt})),It(an,(function(e,t,n,r){return 1===arguments.length?on(e):new an(e,t,n,null==r?1:r)}),kt(Ot,{brighter(e){return e=null==e?Nt:Math.pow(Nt,e),new an(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new an(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Zt(un(e>=240?e-240:e+120,i,r),un(e,i,r),un(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new an(sn(this.h),ln(this.s),ln(this.l),en(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=en(this.opacity);return`${1===e?"hsl(":"hsla("}${sn(this.h)}, ${100*ln(this.s)}%, ${100*ln(this.l)}%${1===e?")":`, ${e})`}`}}));const cn=Math.PI/180,pn=180/Math.PI,dn=4/29,fn=6/29,mn=3*fn*fn;function hn(e){if(e instanceof gn)return new gn(e.l,e.a,e.b,e.opacity);if(e instanceof qn)return Dn(e);e instanceof Zt||(e=Yt(e));var t,n,r=xn(e.r),i=xn(e.g),o=xn(e.b),a=bn((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=bn((.4360747*r+.3850649*i+.1430804*o)/.96422),n=bn((.0139322*r+.0971045*i+.7141733*o)/.82521)),new gn(116*a-16,500*(t-a),200*(a-n),e.opacity)}function gn(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function bn(e){return e>.008856451679035631?Math.pow(e,1/3):e/mn+dn}function yn(e){return e>fn?e*e*e:mn*(e-dn)}function vn(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function xn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function qn(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function Dn(e){if(isNaN(e.h))return new gn(e.l,0,0,e.opacity);var t=e.h*cn;return new gn(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}It(gn,(function(e,t,n,r){return 1===arguments.length?hn(e):new gn(e,t,n,null==r?1:r)}),kt(Ot,{brighter(e){return new gn(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new gn(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 Zt(vn(3.1338561*(t=.96422*yn(t))-1.6168667*(e=1*yn(e))-.4906146*(n=.82521*yn(n))),vn(-.9787684*t+1.9161415*e+.033454*n),vn(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),It(qn,(function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof qn)return new qn(e.h,e.c,e.l,e.opacity);if(e instanceof gn||(e=hn(e)),0===e.a&&0===e.b)return new qn(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*pn;return new qn(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new qn(e,t,n,null==r?1:r)}),kt(Ot,{brighter(e){return new qn(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new qn(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return Dn(this).rgb()}}));var Sn,En=e=>()=>e;function Cn(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):En(isNaN(e)?t:e)}function Mn(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}function wn(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function An(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=kn)):void 0===t&&(t=In);for(var n,r,i,o,a,s=new Ln(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new Ln(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Nn)}function In(e){return e.children}function kn(e){return Array.isArray(e)?e[1]:null}function On(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Nn(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Ln(e){this.data=e,this.depth=this.height=0,this.parent=null}!function e(t){var n=function(e){return 1==(e=+e)?Cn:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):En(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Jt(e)).r,(t=Jt(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Cn(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),Ln.prototype=An.prototype={constructor:Ln,count:function(){return this.eachAfter(wn)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t},copy:function(){return An(this).eachBefore(On)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}},Sn=function(e){
10
- /*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
11
- e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),b=d-g,y=e.substring(b,b+1),v=b+("."===y||","===y?1:0),x=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",b=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)h+=p.charAt(v),!((v-b+1)%l)&&v<d-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),m+(n?"-":"")+r+x}},Sn({exports:{}});const Tn=/xyz/.test((()=>{}))?/\b_super\b/:/.*/,Pn=function(){};Pn.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&Tn.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o};const Rn={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},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,"")}};function Fn(){return Rn.id()}const Hn="scrollbar";function _n(e,t,n){return"y"===e?Vn(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function Vn(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var jn={getAxisDock:_n,getOppositeAxisDock:function(e,t,n){return _n(e,"far"===t?"near":"far",n)},getYAxisDock:Vn};const zn=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),Bn=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),$n=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Un(e){return zn.test(e)}function Kn(e){return Bn.test(e)||$n.test(e)}var Wn={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],Un(r))return"ltr";if(Kn(r))return"rtl"}return"ltr"}};var Gn={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return M(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),M(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${Wn.lrm}(${n})${Wn.lrm}`:`${Wn.lrm}(${n})${Wn.lrm}`:!1!==e.showLabel?t:""}};const Yn={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};Yn.DEFAULT_CHART_ORIENTATION=Yn.HORIZONTAL;function Jn(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||Yn.DEFAULT_CHART_ORIENTATION,a=o===Yn.HORIZONTAL,s=a?"x":"y",l=a?"y":"x",u=Yn.SHOW_AXIS_LABELS_OPTIONS,c=Yn.SHOW_TITLE_OPTIONS,p=u.includes(r.show),d=!!n.measureTitleText&&c.includes(r.show),f=n.includeDimensionAxis&&u.includes(i.show),m=n.includeDimensionAxis&&!!n.dimensionTitleText&&c.includes(i.show),h=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some((e=>e.show)),b=[];if(p&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=M(i,Yn.LAYOUTSETTINGS.measureAxis);const o=Qn(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,s,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=M(r,Yn.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return Qn(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,s),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=M(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=M(r,Yn.LAYOUTSETTINGS.dimensionAxis);const i=Xn(t,n);M(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),m&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=M(r,Yn.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return Xn(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===Yn.HORIZONTAL?Yn.VERTICAL:Yn.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),h&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=M(r,Yn.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,s),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},a=M({},Yn.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",a,o),Zn(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some((e=>e.settings.key===Hn))}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(Hn).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(Hn).emit("panStart",e)},pan(e){this.chart.component(Hn).emit("panMove",e)},panend(e){this.chart.component(Hn).emit("panEnd",e)},pancancel(e){this.chart.component(Hn).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,b,n,a),g&&function(e,t,n,r){const i=jn.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=M(o,Yn.LAYOUTSETTINGS.refLines);let a={key:`ref-line-labels-${Fn()}`,require:["renderer","chart"],dock:jn.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=a.lines.y.map((e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}})),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const s=12;return o.required+s>100?o.required+s:Math.min(o.wanted+s,100)},lines:{x:[],y:[]}};a=M(a,Yn.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach((r=>{if(!r.show)return;const s=r.refLineExpr&&r.refLineExpr.value,l=M(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),u=Gn.lineSettings({scale:"measure",dir:n,value:s},l);o.lines[n].push(u);const c=Gn.lineLabelSettings({scale:"measure",value:s,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?c.label.vAlign="near"===i?1:0:c.label.align="near"===i?0:1,a.lines[n].push(c)})),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",a,{})}(e,n,s,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",Yn.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=M(o,Yn.LAYOUTSETTINGS.rangeDim);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.dimRange||{},a,Xn(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=M(o,Yn.LAYOUTSETTINGS.rangeMeasure);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.measureRange||{},a,Qn(n,s).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=M(o,Yn.LAYOUTSETTINGS.rangeMinor);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,a)}(e,n.areaRange||{},a,Xn(n,l).dock,n.isRtl)}n.brushActions&&Zn(b,n.brushActions),b.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,b)}function Zn(e,t){t.forEach((t=>{e.push(t)}))}function Qn(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function Xn(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function er(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return M(!0,{},o,e||{})}function tr(e){var t;if(null!=e&&null!==(t=e.isEnabled)&&void 0!==t&&t.call(e,"IM_5791_SVG_LABEL_RENDERING"))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function nr(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.line.major","color"),s=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),u=t.theme.getStyle(n,"axis.label.name","color"),c=t.theme.getStyle(n,"axis.label.name","fontSize"),p=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:tr(t.flags),dock:jn.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:s,fontFamily:p,fill:l},line:{show:!0,strokeWidth:1,stroke:a},labels:{fill:u,fontSize:c,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:a},minorTicks:{stroke:a}}},m=M(!0,{},f,e||{});return m.brush.consume.forEach((e=>{e.style.active.strokeWidth=0})),m}function rr(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.title","fontSize"),s=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),u={key:"text",type:"text",dock:jn.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:a,fontFamily:l,fill:s}}};return M(!0,{},u,e||{})}er.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map((e=>({field:e})))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=er(M(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},er.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return er(M(!0,n,e||{}),t)},nr.xAxis=function(e,t){return nr(M(!0,{key:"x-axis",scale:"x"},e||{}),t)},nr.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:jn.getYAxisDock(n,r)};return nr(M(!0,i,e||{}),t)},rr.xAxisTitle=function(e,t){return rr(M(!0,{key:"x-axis-title"},e||{}),t)},rr.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:jn.getYAxisDock(n,r)||"left"};return rr(M(!0,i,e||{}),t)};var ir={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const or={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function ar(){return or}function sr(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}ar.getLayoutModeKeys=function(){const e=[];let t;for(t in or)e.push(t);return e};const lr={left:"left",right:"right",up:"top",down:"bottom"};function ur(e,t,n){switch(e){case"scale":return er(t,n);case"measure-scale":return er.measureScale(t,n);case"dimension-scale":return er.dimensionScale(t,n);case"axis":return nr(t,n);case"box-marker":return function(e){return M(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return M(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return M(!0,{},o,e||{})}(t,n);case"text":return rr(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach((e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})})),M(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,a=t&&t.isHorizontal,s=t&&t.dock,l=t&&t.isRtl,u={type:"brush-range",key:"range",displayOrder:99,dock:ir.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:ir.getBublesAlign(a,s,l)}}};return M(!0,{},u,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],a=t&&t.brushArea,s=t&&t.isHorizontal,l=t&&t.dock,u=t&&t.isRtl,c=t&&t.chartInstance;let p=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:ir.getDock(r,a),settings:{brush:{components:[]},direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:ir.getBublesAlign(s,l,u),label:e=>p?(p=!1,c.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(p=!0,c.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach((e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})})),M(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const a=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.title","fontFamily"),p=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:tr(t.flags),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${lr[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:u,fontFamily:p,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(u,10)/4}},title:{show:t.showTitle,fontSize:s,fontFamily:c,fill:a}}};return M(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),s=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.label","fontFamily");function p(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:p(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:a,fontFamily:s,fill:o},tick:{fill:l,fontSize:u,fontFamily:c}}};return M(!0,{},d,e)}(t,n);case"x-axis":return nr.xAxis(t,n);case"y-axis":return nr.yAxis(t,n);case"x-axis-title":return rr.xAxisTitle(t,n);case"y-axis-title":return rr.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return M(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return M(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return M(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return M(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),a={key:"labels",type:"labels",renderer:tr(t.flags),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:sr}]}}}]}};return M(!0,{},a,e||{})}(t,n);default:return}}function cr(e){this.options=e||{},this.settings={dockLayout:{layoutModes:ar()},components:[],scales:{}}}cr.prototype.addComponent=function(e,t,n){const r=ur(e,t,M(!0,{},this.options,n||{}));return this.settings.components.push(r),r},cr.prototype.addInteraction=function(e,t){const n=ur("interaction",e,M(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},cr.prototype.addScale=function(e,t,n){const r=ur(e,t,M(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},cr.prototype.getSettings=function(){return this.settings},cr.prototype.getComponent=function(e){return this.settings.components.filter((t=>t.key===e))[0]},cr.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");Jn(t,n)}(e,this,t)},cr.validateComponentKeys=function(e){const t={};return e.map((e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`})).filter((e=>!!e))},cr.create=function(e){return new cr(e)},cr.createComponent=ur;const pr={CENTER:0,BOTTOM:1};var dr={DISCLAIMERS:[{label:"NoDataExist",alignment:pr.CENTER,default:!0},{label:"RequireNumericDimension",alignment:pr.CENTER,default:!1},{label:"OnlyNanData",alignment:pr.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:pr.CENTER,default:!1},{label:"LimitedData",alignment:pr.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:pr.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:pr.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:pr.BOTTOM,default:!1}],ALIGNMENT:pr};const fr={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx==0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some((e=>e.qDown>0)):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some((e=>e.qMin<=0)),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every((e=>e.qMax<=0&&e.qMax>=e.qMin))||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every((e=>e.qMax<e.qMin||"NaN"===e.qMax)),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,a,s;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=0;r<n;r++)if(a=Math.min(a,t[r].qMin),s=Math.max(s,t[r].qMax),a<=0&&s>=0)return!0;return a=i?e.min:a,s=o?e.max:s,a<=0&&s>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,dr.DISCLAIMERS.forEach((e=>{r[e.label]=!1})),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function mr(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function hr(e,t){return e&&t&&t[e]}function gr(e){this.environment=e,this.clear()}mr.prototype.isValidAndSupported=function(e,t){return hr(e.label,this.dataAttributes)&&(e.default||hr(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},mr.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach((r=>{n.isValidAndSupported(r,e)&&(t=!0)})),t},mr.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach((i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)})),n},gr.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},gr._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach((e=>{void 0===n[e.label]&&(n[e.label]=e.default)})),n},gr.prototype.getComponentSettings=function(){var e;const{translator:t}=this.environment,n=M(!0,{},this.vizAttributes.supportedDisclaimers),r=new mr(dr.DISCLAIMERS,this.dataAttributes,n);let i,o;if(r.isAnyValidDisclaimer(dr.ALIGNMENT.CENTER))i=r.getMessage(dr.ALIGNMENT.CENTER,t),o="center";else{if(!r.isAnyValidDisclaimer(dr.ALIGNMENT.BOTTOM))return;i=r.getMessage(dr.ALIGNMENT.BOTTOM,t),o="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:o},settings:{label:i,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.direction)}}},gr.prototype.set=function(e){if(this.clear(),!e)throw new Error(gr.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=fr.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},gr.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const br=Pn.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new gr(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[cr.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then((e=>{t[r]=e}))}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),cr.validateComponentKeys(r.components).forEach((e=>{console.error(e)})),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=M(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},a=this._dataPaths.map((t=>({type:"q",key:t,config:{localeInfo:o},data:Mn(e,t.replace(/\//g,"."))})));this.colorService&&a.push(...this.colorService.getData()),this.chartInstance.update({data:a,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});var yr,vr={exports:{}};var xr=(yr||(yr=1,vr.exports=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function n(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function i(e){var t=r(e,"string");return"symbol"==typeof t?t:String(t)}var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},c=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=o.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&o.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||o.call(e,t)},p=function(e,t){s&&"__proto__"===t.name?s(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},d=function(e,t){if("__proto__"===t){if(!o.call(e,t))return;if(l)return l(e,t).value}return e[t]},f=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,f=arguments.length,m=!1;for("boolean"==typeof s&&(m=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<f;++l)if(null!=(t=arguments[l]))for(n in t)r=d(s,n),s!==(i=d(t,n))&&(m&&i&&(c(i)||(o=u(i)))?(o?(o=!1,a=r&&u(r)?r:[]):a=r&&c(r)?r:{},p(s,{name:n,newValue:e(m,a,i)})):void 0!==i&&p(s,{name:n,newValue:i}));return s};function m(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map((e=>e.instance)).indexOf(e),s=i.wrappedFields[t].attrExps.map((e=>e.instance)).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some(((e,t)=>e!==t))){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function h(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function g(e){let{cache:t,f:n,mainCell:r,p:i,prop:o,page:a,rowIdx:s,row:l,sourceKey:u,target:c,targetProp:p,columnOrder:d}=e,g=r;if(i.field&&i.field!==n){const e=m(i.field,a,{cache:t},d);if(-1===e)return;g=f({qRow:s},e(l))}c[p]=h(i,g,{key:u})}function b(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:u,main:c}=r.normalizeConfig(i[e],t),p=Object.keys(u),d=!!i[e].trackBy,b=typeof i[e].trackBy,y={},v=[],x=[];for(let t=0;t<a.qDataPages.length;t++){const o=m(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let m=0;m<a.qDataPages[t].qMatrix.length;m++){const q=a.qDataPages[t].qArea.qTop+m,D=f({qRow:q},o(a.qDataPages[t].qMatrix[m])),S=h(c,D,{key:s});if(!c.filter||c.filter(D)){for(let e=0;e<p.length;e++){const r=u[p[e]];let i=r.fields||[r];r.fields&&(S[p[e]]=[]);for(let o=0;o<i.length;o++)g({cache:n,f:l,mainCell:D,p:i[o],prop:p[e],props:u,page:a.qDataPages[t],rowIdx:q,row:a.qDataPages[t].qMatrix[m],sourceKey:s,target:r.fields?S[p[e]]:S,targetProp:r.fields?o:p[e],columnOrder:a.qColumnOrder});if(r.fields){const t=S[p[e]].map((e=>e.value)),n=S[p[e]].map((e=>e.label));S[p[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(S[p[e]].value)}}}d&&r.track({cfg:i[e],itemData:D,obj:S,target:v,tracker:y,trackType:b}),x.push(S)}}}const q=d?r.collect(v,{main:c,propsArr:p,props:u}):x;o=[...o,...q]}return o}function y(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function v(){return this.eachAfter(y)}function x(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function q(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function D(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this}function S(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function E(e){return this.eachAfter((function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n}))}function C(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))}function M(e){for(var t=this,n=w(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function w(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function A(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function I(){return Array.from(this)}function k(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e}function N(){var e=this,t=[];return e.each((function(n){n!==e&&t.push({source:n.parent,target:n})})),t}function*L(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}function T(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=F)):void 0===t&&(t=R);for(var n,r,i,o,a,s=new V(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new V(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(_)}function P(){return T(this).eachBefore(H)}function R(e){return e.children}function F(e){return Array.isArray(e)?e[1]:null}function H(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function _(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function V(e){this.data=e,this.depth=this.height=0,this.parent=null}function j(e){return null==e?null:z(e)}function z(e){if("function"!=typeof e)throw new Error;return e}V.prototype=T.prototype={constructor:V,count:v,each:x,eachAfter:D,eachBefore:q,find:S,sum:E,sort:C,path:M,ancestors:A,descendants:I,leaves:k,links:N,copy:P,[Symbol.iterator]:L};var B={depth:-1},$={},U={};function K(e){return e.id}function W(e){return e.parentId}function G(){var e,t=K,n=W;function r(r){var i,o,a,s,l,u,c,p,d=Array.from(r),f=t,m=n,h=new Map;if(null!=e){const t=d.map(((t,n)=>Y(e(t,n,r)))),n=t.map(J),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(J(e)),d.push(U));f=(e,n)=>t[n],m=(e,t)=>n[t]}for(a=0,i=d.length;a<i;++a)o=d[a],u=d[a]=new V(o),null!=(c=f(o,a,r))&&(c+="")&&(p=u.id=c,h.set(p,h.has(p)?$:u)),null!=(c=m(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=d[a]).parent){if(!(l=h.get(c)))throw new Error("missing: "+c);if(l===$)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===U&&1===s.children.length;)s=s.children[0],--i;for(let e=d.length-1;e>=0&&(u=d[e]).data===U;--e)u.data=null}if(s.parent=B,s.eachBefore((function(e){e.depth=e.parent.depth+1,--i})).eachBefore(_),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=j(e),r):t},r.parentId=function(e){return arguments.length?(n=j(e),r):n},r.path=function(t){return arguments.length?(e=j(t),r):e},r}function Y(e){let t=(e=`${e}`).length;return Z(e,t-1)&&!Z(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function J(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Z(e,t););return e.slice(0,t)}function Z(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Q(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Q(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Q(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function X(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...X(e[i].children,t-1,n)]);return r}function ee(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>X(e.children,r-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function ae(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map(((e,t)=>t))}function se(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map(((e,t)=>t))).filter((t=>t<e.qDimensionInfo.length))}function le(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=-1,p=r;const d=n.qEffectiveInterColumnSortOrder,f=se(n);return ne.test(p)&&(i=!0,o=+ne.exec(p)[1],p=r.replace(ne,"")),re.test(p)&&("K"===n.qMode?u=+re.exec(p)[1]:d&&-1!==d.indexOf(-1)?(u=+re.exec(p)[1],c=0):c=+re.exec(p)[1],p=p.replace(re,"")),p&&(oe.exec(p)?s=+oe.exec(p)[1]:ie.exec(p)&&(a=+ie.exec(p)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function ue(e,t){let n,r,i=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function ce(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function pe(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let u,c;s.fields&&(u=[],c=[]);for(let n=0;n<l.length;n++){const p=l[n];let d,f,m,h,g,b;if("primitive"===p.type?(m=p.value,b=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(h=p.accessor(r),Array.isArray(h)?(g=h.map(p.valueAccessor),p.attrAccessor&&(g=g.map(p.attrAccessor)),d&&(m=g.map(d),d=null),f&&(b=g.map(f),f=null),m=p.reduce?p.reduce(m):m,b=p.reduceLabel?p.reduceLabel(b,m):String(m)):(m=p.attrAccessor?p.attrAccessor(p.valueAccessor(h)):p.valueAccessor(h),b=m)):(m=i,b=i)),s.fields){const e=d?d(m):m;u.push(e),c.push(f&&null!=b?f(b):null!=b?b:String(e))}else{const n=d?d(m):m;o[t[e]]={value:n,label:f?f(b):null!=b?b:String(n)},p.field&&(o[t[e]].source={field:p.field.key(),key:a})}}u&&(o[t[e]]={value:"function"==typeof s.value?s.value(u,r):u,label:"function"==typeof s.label?s.label(c,r):c})}}const de=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Q(r,e);return o&&o[0]?(t.tree=T(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const n=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=ae(e),i=e.fields(),o=e.fields().filter((e=>"dimension"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),a=e.fields().filter((e=>"measure"===e.type())).map((e=>r.indexOf(i.indexOf(e)))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<n.length;e++){const r=n[e];let i="__root",u=!1;for(let e=0;e<o.length;e++){var l;const n=r[o[e]],a="".concat(i,"__").concat(null!==(l=n.qElemNumber)&&void 0!==l?l:n.qElemNo);s[a]||(s[a]=t({__id:a,__parent:i,qValues:[]},n),u=!0),i=a}if(u)for(let e=0;e<a.length;e++){const t=r[a[e]];s[i].qValues.push(t)}}const u=Object.keys(s).map((e=>s[e]));return G().id((e=>e.__id)).parentId((e=>e.__parent))(u)}const me=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields?s.fields:[s];for(let e=0;e<l.length;e++){const t=l[e];if(t.field!==a){const e=ue(o,le(t.field,{cube:r,cache:i}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function he(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=n.raw(),a=n.key(),s="S"===o.qMode?fe(n):de(o,r,e);if(!s)return null;const l=s.height,u=[];for(let a=0;a<=l;a++){let s=null;if(a>0)if("S"===o.qMode){let e=se(o)[a-1];s=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[a-1];a>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),s=r.fields[e]}const{props:l,main:c}=i.normalizeConfig(t(t({},e),{},{field:s?s.key():void 0}),n),p=Object.keys(l);u[a]={propsArr:p,props:l,main:c};const d=s?le(s,{cube:o,cache:r}):{fieldDepth:0};me({propsArr:p,props:l,cube:o,cache:r,itemDepthObject:d,f:s})}const c=s.copy().descendants(),p=s.descendants();for(let e=0;e<p.length;e++){const t=u[p[e].depth].propsArr,n=u[p[e].depth].props,r=u[p[e].depth].main,i=c[e],o=i.data,s=ce(r,o,{key:a});pe({propsArr:t,props:n,item:i,itemData:o,ret:s,sourceKey:a,isTree:!0}),p[e].data=s}return s}function ge(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!de(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:p}=r.normalizeConfig(i[a],t),d=Object.keys(c),f=le(u,{cube:s,cache:n}),{nodeFn:m,attrFn:h,valueFn:g}=ue({fieldDepth:0},f);me({propsArr:d,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const b=!!i[a].trackBy,y=typeof i[a].trackBy,v={},x=[],q=m(n.tree),D=[];for(let e=0;e<q.length;e++){const t=q[e],n=h?h(g(t)):g(t);if(p.filter&&!p.filter(n))continue;const o=ce(p,n,{key:l});pe({propsArr:d,props:c,item:t,itemData:n,ret:o,sourceKey:l}),b&&r.track({cfg:i[a],itemData:n,obj:o,target:x,tracker:v,trackType:y}),D.push(o)}const S=b?r.collect(x,{main:p,propsArr:d,props:c}):D;o=[...o,...S]}return o}function be(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==O||"undefined"!=typeof self&&self;var ye=be((function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),b=d-g,y=e.substring(b,b+1),v=b+("."===y||","===y?1:0),x=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",b=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)h+=p.charAt(v),!((v-b+1)%l)&&v<d-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),m+(n?"-":"")+r+x}},e.exports=t()}));const ve=1e-15;function xe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const qe={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},De=/%\)?$/,Se=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Ee=/^\(oct\)/i,Ce=/^\(dec\)/i,Me=/^\(hex\)/i,we=/^\(bin\)/i,Ae=/^\(rom\)/i,Ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,ke=/#|0/g;function Oe(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Ne(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Le(e,t,n){let r;return Se.test(t)?e=Oe(e,Number(/\d{2}/.exec(t)[0]),t,n):Ee.test(t)?e=Oe(e,8,t,n):Ce.test(t)?e=Oe(e,10,t,n):Me.test(t)?e=Oe(e,16,t,n):we.test(t)?e=Oe(e,2,t,n):Ae.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Ne(e,t)):t+r+e.toExponential(0)),e}function Te(e,t,n){const r=xe(e);return n?r:new RegExp(r||"",t)}function Pe(e,t){return t&&(t=xe(t)),e&&(e=xe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Re(e,t){if(!e||!e.qNumericalAbbreviation)return qe;const n={};return e.qNumericalAbbreviation.split(t).forEach((e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])})),n}function Fe(e,t,n,r){let i,o,a,s,l,u,c,p,d,f=e.pattern;r&&(e.abbreviate=!0),d=Pe(t,n),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(Te(u,"g"),t)),c=n,n=".",c&&(a=a.replace(Te(c,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const m=f.split(c);let h;m[1]&&(h=m[1].match(ke)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=h?h.length:2,e.percentage=De.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Te(t,null,!0),"|").concat(Te(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class He{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=Re(e,this.patternSeparator),this.prepare()}clone(){const e=new He(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Fe(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Fe(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Fe(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,p="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=Le(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map((e=>parseInt(e,10))).sort(((e,t)=>e-t));let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(p=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number(e.toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=ye(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+ve).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=ye(l,e)}e=e.replace(c.numericRegex,(e=>e===a?c.groupTemp:e===o?c.decTemp:"")),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+p+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function _e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new He(...t)}function Ve(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(u>=n&&(delete s[l[c]],delete l[c],u--,c++),s[e]=t,l[u]=e,u++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function je(e,t,n,r,i){const o=_e(i,e,t,n,r),a=Ve(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const ze={AUTO:"U",INTEGER:"I",NUMBER:"R",FIXED_TO:"F",MONEY:"M",DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Be=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ue=["January","February","March","April","May","June","July","August","September","October","November","December"],Ke=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],We=86400;function Ge(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Ye(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function Je(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Ze(e){const t=e,n=24*Je(t),r=60*Je(n),i=60*Je(r),o=1e3*Je(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Qe(e,t){let n,r=Ze(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(We*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0,u<0&&(u=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}function Xe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ge("".concat(t.year).slice(-2),2),YYY:Ge("".concat(t.year).slice(-3),3),def:e=>Ge("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ge("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ge("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ge("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ge("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ge("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ge("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Be,qDayNames:$e,qLongMonthNames:Ue,qMonthNames:Ke}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[ze.TIME]:r.qTimeFmt||"hh:mm:ss",[ze.DATE]:r.qDateFmt||"YYYY-MM-DD",[ze.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=Ye(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Qe(e,t));const i=Xe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g");return t.replace(a,(e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r}))}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=Ve(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==ze.INTERVAL?rt(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=tt(i,e,t),r=Ve(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),je(n,r,i,o,t)}function at(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c=e=>(null==e?void 0:e.qText)||"",p="dimension"===s?"first":"avg",d=ot(t,i),f={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:c,reduce:p,reduceLabel:"dimension"===s?"first":(e,t)=>d(t),formatter:()=>d,tags:()=>t.qTags};return f}function st(e,t,n,r,i){return(t[e]||[]).map(((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:at(f({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=st("qAttrDimInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=st("qAttrExprInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=st("qMeasureInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s}))}function lt(){let{key:e,data:n,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=n;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=lt.util,s={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,l,i,a),hierarchy:e=>s.hierarchy(e,l,i,a),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(s.extractor=ge,s.hierarchy=he,s.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(s.extractor=b,s.pages=o.qDataPages,s.hierarchy=he):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},l,i,a);const u="S"===o.qMode?e=>e.qElemNumber:void 0,c="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...st("qDimensionInfo",o,e,"",f({},s,{value:u,type:"dimension"}))),i.wrappedFields.push(...st("qMeasureInfo",o,e,"",f({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map((e=>e.instance));const p=e=>{e.forEach((e=>{i.allFields.push(e.instance),p(e.measures),p(e.attrDims),p(e.attrExps)}))};return p(i.wrappedFields),(r.virtualFields||[]).forEach((n=>{const r=l.field(n.from),o=at(t({meta:r.raw(),id:"".concat(e,"/").concat(n.key),sourceField:r,fieldExtractor:e=>s.extractor({field:e},l,i,a),key:n.key,type:r.type(),localeInfo:s.localeInfo,value:r.value},n.override||{}));i.virtualFields.push(o)})),i.allFields.push(...i.virtualFields),l}const ut=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ct=/\/qDimensionInfo(?:\/(\d+))?/,pt=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,mt=/\/?qHyperCube/,ht=/\/?qTreeData/,gt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),bt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function yt(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;mt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=gt):ht.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=bt);let s=!0;if(ct.test(e)&&(r=+ct.exec(e)[1]),pt.test(e)&&(i=+pt.exec(e)[1]),dt.test(e)){i=-1,r=0;const e=+dt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(ft.test(e)){const e=i;if(t){i=0;const a=Q(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce(((e,t)=>e+t.qAttrExprInfo.length),i),r=-1):(i=a.qDimensionInfo.reduce(((e,t)=>e+t.qAttrExprInfo.length),i),i=a.qMeasureInfo.slice(0,e).reduce(((e,t)=>e+t.qAttrExprInfo.length),i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ut.forEach((e=>{let[t,r]=e;n=n.replace(t,r)})),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach((e=>{const t=yt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach((e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach((e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}}))))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach((e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}}))))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));(0===o||s>=o)&&o>-1?n.forEach((e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})})):n.forEach((e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})})),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e))),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map((e=>+e)).filter((e=>!isNaN(e)));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}})),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(u=t.orMode)||void 0===u||u]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var u}function xt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",je),e.formatter("q-time",it)}return xt.qBrushHelper=vt,xt.selections=vt,xt}()),vr.exports),qr=N(xr);const Dr={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter((e=>"value"===e.type));let r=[];n.length&&n.forEach((e=>{r=r.concat(e.brush.values().map((t=>({key:e.id,value:t}))))}));return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let a=0;const s=[];return t.forEach((t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),a++):s.push({key:t.key,value:t.value}))})),{items:s,itemsAreLocked:a>0&&a===t.length,lockedFields:o}}}};const Sr={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function Er(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let a=[];const s={propertiesToRestore:{}};let l=!1;const u=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),qr.qBrushHelper(i).forEach((e=>{t.select(e)}))},r.toggleValues=function(r,i,o){const a=Dr.brushInterceptors.filterValues(e,r),s=a.items;return t.isActive()||a.itemsAreLocked||!(o||s.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),s},r}(t,n,i),c={};let p=!1;function d(e){16===e.keyCode&&e.shiftKey!==p&&(p=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function m(){a.forEach((e=>{e.listeners.update=function(t,n){e.sleep||u.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)}))}function h(){a.forEach((e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)}))}return n.on("cleared",(()=>{a.forEach((e=>{e.brush.clear(),e.dependentComponents.forEach((e=>{const n=t.component(e.id);n&&n.emit(e.clear)}))}))})),c.setUp=function(e){c.tearDown();const t=this.setUpBrush(e);return l&&m(),t},c.setUpBrush=function(e){const n=M(!0,{},Sr,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},s=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return s.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:u.toggleValues(e,s.brush,n.startOnEmptySelection)},s.brush.intercept("toggle-values",s.listeners.toggle),s.brush.intercept("add-values",s.listeners.toggle),s.brush.intercept("remove-values",s.listeners.toggle),s.brush.intercept("set-values",s.listeners.toggle),s.listeners.start=function(){a.length>1&&a.forEach((e=>{e!==s&&e.brush.end()}))},a.push(s),{trigger:i,consume:o}},c.setUpStart=function(){c.tearDown()},c.setUpDone=function(){l&&m()},c.tearDown=function(){l&&h(),a.forEach((e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)})),a=[]},c.pauseEngineCalls=function(e){a.forEach((t=>{t.id===e&&(t.sleep=!0)}))},c.resumeEngineCalls=function(e,t){a.forEach((n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))}))},c.addComponent=function(e,t){a.forEach((n=>{n.id===e&&n.dependentComponents.push(t)}))},c.on=function(){if(l)return;l=!0,m(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{a.forEach((e=>{e.brush.end()})),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),s.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),s.unbindActivated=()=>{n.removeListener("activated",t)}},c.isOn=()=>l,c.off=function(){l&&(l=!1,h(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),s.unbindActivated(),s.unbindDeactivated())},c.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},c.allFieldsLocked=function(){return function(){let e=r.map((e=>t.dataset(e).fields().filter((e=>"dimension"===e.type()))));return e=[].concat.apply([],e),e.length&&e.every((e=>e.raw().qLocked))}()},c}class Cr{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var Mr={create:e=>e.selectionsApi?Er(e):new Cr};function wr(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const a=e.brush(r),s={};function l(){if(o){e.component(i).emit("hide")}o=!1}return s.isOpen=function(){return o},s.closeTooltip=l,s.update=function(){const s=a.brushes(),u=e.getAffectedShapes(r,"and",n,t);s.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(u)):l()},s.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach((e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))})),n}return e},s}var Ar={create:(...e)=>wr(...e)},Ir={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const kr=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],a={rows:[]};if(e.labelData){const t=[],i=e.labelData;let s=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){s=!0;break}t.push(o.data[i[e]].value.qText)}if(s)return;a.header=e.headerResolver(t),a.rows=e.measureRows.map((t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)})).filter((e=>!!e));const l=Or(e,o);l&&a.rows.unshift(l),r.push(a)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function Or(e,t){var n,r,i;const o=t.data.color,a=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!a||"color"===a.type||!o||!a.fieldType)return;const s=[];e.data.forEach((e=>{const n=t.data[e];n&&s.push(n.value)}));const l=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(s),{translator:u}=e,c=a.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:c,value:-1!==l?u.get("properties.dimensionLimits.others"):o.label}}const Nr="dist-flow-tooltip",Lr=`#${Nr}`;function Tr(){if(!document.querySelector(Lr)){const e=document.createElement("div");e.id=Nr,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 Pr({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Tr()},beforeUpdate(){Tr()},destroyed(){!function(){const e=document.querySelector(Lr);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Lr),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:Rr}=Wn;const Fr={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:Ir.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,a=[],s=o?"right":"left";if(t.forEach((e=>{if(e.header){const t={...r.cell,textAlign:s,fontWeight:"bold",direction:Rr(e.header)};a.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach((e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:s,direction:Rr(e.label)},u={...r.cell,textAlign:o?"left":"right",direction:Rr(e.value)};a.push(n("tr",null,n("td",{style:l},i),n("td",{style:u},t)))}))})),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:s,direction:Rr(e)};a.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return a}};function Hr(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function a(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function s(){Object.keys(r).forEach((e=>{l(r[e])}))}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function u(){Object.keys(r).forEach((e=>{r[e].action.closeTooltip()}))}function c(){u();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=M(!0,{},Fr,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const s=function(e,t){return{brush:t.brush(e.contexts[0]),action:Ar.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=s,i&&a(s);const u=Pr({key:o.tooltipKey,rtl:"rtl"===s.direction,fontFamily:s.theme.getStyle(n,"tooltip","fontFamily"),filter:(c=s.filterShapes,e=>c?c(e):function(e){const t=[];return e.forEach((e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)})),t}(e)),content:kr(s,o.dataPath)});var c;return o.chartBuilder.getSettings().components.push(u),{trigger:{on:s.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map((e=>({context:e}))),component:u}},o.tearDown=function(){i&&s(),r=[]},o.closeTooltip=u,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach((e=>{a(r[e])})),t&&t.on("mouseleave",c))},o.off=function(){i&&(i=!1,s(),t&&t.off("mouseleave",c),u())},o}var _r={create:(e,t,n)=>Hr(e,t,n)};const Vr={generateHash:function(e){return function(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=Vr.generateHash(t)}};const jr={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach((e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then((e=>e.getProperties().then((e=>e.qMeasure.qDef))))}(e.qLibraryId,t)):n.push(Promise.resolve())})),Promise.all(n)}(e,n).then((e=>({drillLevel:Br(t),dimensionExpressions:zr(t),measureExpressions:e})))}};function zr(e){return e.qDimensionInfo.map((e=>e.qGroupFieldDefs))}function Br(e){const t=function(e){return Mn(e,"qDimensionInfo",[])}(e);return t.map((e=>e.qGroupPos))}const $r={},Ur=M.bind(null,!0);function Kr(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const Wr=Array.isArray,Gr=function(e){return void 0===e};function Yr(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function Jr(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach(((t,i)=>{i!==n.length&&(r=+t,e[r||t]=Gr(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])})),e}function Zr(e,t){if(Kr(e)&&Kr(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!Zr(e[n],t[n]))return!1;return!0}if(Wr(e)&&Wr(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!Zr(e[n],t[n]))return!1;return!0}return e===t}$r.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach((i=>{const o=function(e){return e&&(e=Ur({},{val:e}).val),e}(t[i]),a=e[i],s=`${n}/${i}`;Zr(o,a)||Yr(t,i)||(Gr(a)?r.push({op:"add",path:s,value:o}):Kr(o)&&Kr(a)?r=r.concat($r.generate(a,o,s)):Wr(o)&&Wr(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,a,s=-1;function l(e,t,n){if(e[n]&&Gr(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(Zr(t,i))return r;if(null===t[0]||!Gr(t[0])&&Gr(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)s=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===s?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat($r.generate(i[o],t[s],`${n}/${o}`));for(o=0,a=t.length;o<a;++o)s=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===s?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):s!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${s}`}),i.splice(o,0,i.splice(s,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))})),Object.keys(e).forEach((i=>{Gr(t[i])&&!Yr(e,i)&&r.push({op:"remove",path:`${n}/${i}`})})),r},$r.apply=function(e,t){t.forEach((t=>{const n=Jr(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(Wr(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Wr(i)&&Wr(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else Kr(i)&&Kr(t.value)?(a=i,Object.keys(a).forEach((e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Yr(a,e)&&delete a[e]})),Ur(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=Jr(e,t.from);Wr(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Wr(n)?n.splice(+r,1):delete n[r]);var a}))},$r.clone=function(e){return Ur({},e)},$r.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},$r.updateObject=function(e,t){Object.keys(e).length?$r.apply(e,$r.generate(e,t)):Ur(e,t)};class Qr{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=$r.generate(e,t);return M(!0,e,t),n&&n.length?(n=n.map((e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}))),this._model.applyPatches(n,!0).then((()=>!0))):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=$r.generate(n,r);$r.apply(n,i);const o=this;o._model.setProperties(n).then((()=>{o._model.clearSoftPatches()}))}}var Xr={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var ei={saveDerivedProperties:function(e,t,n,r){if(Xr.canModifyHardProperties(t))return e.setProperties(n);return new Qr(e).saveSoftProperties(r,n)}};var ti={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function ni(){this._generationInProgress=!1}function ri(e){ti.validate(e);const t=e.properties,n=Vr.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}ni.prototype.isDerivedUpToDate=ri,ni.prototype.updateDerivedProperties=function(e){if(ti.validate(e),this._generationInProgress)return Promise.resolve(!0);if(ri(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=M(!0,{},e.properties),o=M(!0,{},i);return this._generationInProgress=!0,Vr.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then((()=>ei.saveDerivedProperties(n,r,i,o).then((()=>(t._generationInProgress=!1,Promise.resolve(!0))))))},ni.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return jr.getDefaultHashDataForHyperCube(e,t,n).then((e=>M(!0,r,e)))};const ii={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const oi={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,a=e;for(const e in t)i=t[e],o=r.start+e+r.end,a=a.replace(ai(o,!0),i);return a},createRegExp:ai};function ai(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const si={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?ii.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach((t=>{const r=li(t,i,e);n[t]=r}))}return oi.replaceExpressionTokens(e,n)}};function li(e,t,n){if(""===t)return"";const r=oi.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach((e=>{o+=e!==n?e:t})),o}const ui={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,a;const s=[];let l;e.forEach((e=>{o=mi(e.match(fi("Dim"))),o.forEach((e=>{s.push(ci(t.qDimensions[e],r,e,n).then((t=>{i[`Dim[${e}]`]={value:t,wrap:!0}})))})),a=mi(e.match(fi("Mea"))),a.forEach((e=>{s.push(pi(t.qMeasures[e],r).then((t=>{i[`Mea[${e}]`]={value:t}})))}))})),l=s.length?Promise.all(s).then((()=>Promise.resolve(i))):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then((n=>{const r=M({},n,i),o=M(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach((e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${si.generateExpression(e,r)}`]}})})),e.measures.forEach((e=>{o.qMeasures.push({qDef:{qDef:si.generateExpression(e,r)}})})),o}))},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map(((e,r)=>ci(e,n,r,t))),i=e.qMeasures.map((e=>pi(e,n)));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function ci(e,t,n,r){if(e.qLibraryId)return di(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function pi(e,t){return e.qLibraryId?di(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function di(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then((e=>e.getProperties().then((e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))))}function fi(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function mi(e){return e?e.map((e=>e.substr(6,1))):[]}function hi(e){return!Number.isNaN(parseFloat(e))&&Number.isFinite(+e)}function gi(e){return!Number.isNaN(parseInt(e,10))&&parseFloat(e,10)===parseInt(e,10)}const bi={getBinSize:function(e){return tt(e,"bins.binSize",F.BIN_SIZE)},getDerivedBinSize:function(e){return tt(e,"qUndoExclude.bins.binSize",F.BIN_SIZE)},getDerivedBinOffset:function(e){return tt(e,"qUndoExclude.bins.offset",F.OFFSET)},getDerivedBinCount:function(e){const t=tt(e,"qUndoExclude.bins.binCount",F.BIN_COUNT);return hi(t)?t<1?1:gi(t)?t:Math.ceil(t):F.BIN_COUNT},getBinCount:function(e){return tt(e,"bins.binCount",void 0)},getBinOffset:function(e){return tt(e,"bins.offset",F.OFFSET)},isAutoBin:function(e){return tt(e,"bins.auto",F.AUTO)},isCountDistinct:function(e){return tt(e,"bins.countDistinct",F.COUNT_DISTINCT)},getBinMode:function(e){return tt(e,"bins.binMode",F.BIN_MODE)},isEmpty:function(e){return null==e||""===e}},yi=Math.log(10),vi=[1,1.5,2,3,4,5,6,10],xi=[1,2,4,5,6,8,10],qi=[2,4,5,10];function Di(e,t){if(0===e)return 0;let n;const r=Math.floor(Math.log(Math.abs(e))/yi),i=e/10**r;for(let e=0;e<t.length;e++)if(i<=t[e]){n=t[e];break}return(r>=0?n*10**r:n/10**-r)*(e<0?-1:1)}function Si(e,t,n,r,i,o){return Math.floor(Math.abs(e-i)/r)+Math.floor(Math.abs(o-t)/r)}const Ei={calculateBinSize:function(e,t,n){return function(e,t,n){if(!hi(e)||!hi(t)||!hi(n))throw Error("binSizeCalculator: One of the inputs is NOT numeric");if(e>t)throw Error("binSizeCalculator: The 'min' parameter is bigger than the 'max' parameter")}(e,t,n),function(e,t,n){let r,i,o,a,s,l,u,c,p,d,f,m,h=-1,g=vi;if(n=Math.max(1,n),t===e)if(0===t){if(a=1,1===n)return{min:e,max:t,nbrOfBins:n,rawBinSize:o/n,offset:-.5,newMax:.5,binSize:1,numEmptyBins:0}}else 1===n?(a=t+1e-9,g=xi):a=Math.abs(t/n);else o=(t+=1e-9)-e,a=o/n;do{if(c=1,f=0,h>=0)for(p=1/qi[h],d=1,g=[];d<=10;)g.push(Math.round(1e3*d)/1e3),d+=p;s=a;do{s=Di(s*c,g),l=Math.floor(Math.log(s)/yi),u=10**l,i=t===e?(Math.ceil(t/s)+Math.floor(n/2))*s:Math.ceil(t/s)*s,r=i-n*s;let o=0;for(m=u;(r>e||i<t)&&o<qi.length;)r=Math.floor(e/m)*m,i=r+n*s,m=u/qi[o++];l<1&&(u=10**(Math.abs(l)+1),i=Math.round(i*u)/u,r=Math.round(r*u)/u),c=1.1,f++}while((r>e||i<t)&&f<10);h++}while(Si(e,t,0,a,r,i)>0&&h<qi.length);return{binCount:n,offset:r,binSize:s}}(e,t,n=function(e){return e<1?1:gi(e)?e:Math.ceil(e)}(n))}};const Ci={getMappingValues:function(e){const t=bi.isAutoBin(e),n=bi.getBinMode(e);let r,i,o,a;const s=bi.isCountDistinct(e);return t||"maxCount"===n?(a=function(e){const t=tt(e,"qHyperCube.qDimensionInfo.0",{});let n=t.qMin,r=t.qMax;n=hi(n)?n:1,r=hi(r)?r:1;const i=bi.getDerivedBinCount(e);return Ei.calculateBinSize(n,r,i)}(e),r=a.binSize,i=a.offset,o=a.binCount):(r=bi.getBinSize(e),i=bi.getBinOffset(e)),{binSize:r,binOffset:i,binCount:o,distinct:s}},getMappings:function(e){const t={};return t.BinSize={value:`,${e.binSize}`},t.Label={value:0===e.binOffset?"":",'x'"},t.Offset={value:0===e.binOffset?"":`,${e.binOffset}`},t.Distinct={value:e.distinct?"Distinct ":""},t}};const Mi={generateHyperCubes:async function(e,t,n){const{app:r,translator:i}=n,o=Ci.getMappingValues(e),a=Ci.getMappings(o),s=ui.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,r),l=ui.generateHyperCubeDef({dimensions:["Class(aggr({{Dim[0]}},{{Dim[0]}}){{BinSize}}{{Label}}{{Offset}})"],measures:["Count({{Distinct}}{{Dim[0]}})"]},t.qHyperCubeDef,e.qHyperCube,r,a),u=await s,c=await l;let p;p=bi.isAutoBin(e)?{qValueExpression:{qExpr:si.generateExpression("=Ceil(Log10(Count({{Dim[0]}})) / Log10(2)) + 1",{"Dim[0]":{value:u.dimensions[0],wrap:!0}})}}:"maxCount"===bi.getBinMode(e)&&bi.isEmpty(t.bins.binCount)?bi.getDerivedBinCount(e):t.bins.binCount,it(c,"qDimensions.0.qDef.qSortCriterias",[{qSortByNumeric:1}]),it(c,"qDimensions.0.qDef.qFieldLabels",[e.qHyperCube.qDimensionInfo[0].qFallbackTitle]),it(c,"qMeasures.0.qDef.qLabel",e.measureAxis.label||i.get("Visualization.Histogram.MeasureAxisLabel")),it(t,"qUndoExclude.box.qHyperCubeDef",c),it(t,"qUndoExclude.bins.binSize",o.binSize),it(t,"qUndoExclude.bins.offset",o.binOffset),it(t,"qUndoExclude.bins.binCount",p)}};var wi={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>-1!==t.indexOf(e.settings.key)))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter((e=>e.settings.key===t.keys.componentKey))[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some((e=>e.settings.key===t))}};var Ai={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:C.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=wi.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((a=n.handlers).selectionHandler.lassoState()&&!a.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var a},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){wi.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var Ii={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?C.DIRECTION_HORIZONTAL:C.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const a="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=wi.isOnComponentForRange(o,a,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!s,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];wi.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function ki(e,t){let n;return n="x-axis"===e?"horizontal"===t?C.DIRECTION_VERTICAL:C.DIRECTION_HORIZONTAL:"horizontal"===t?C.DIRECTION_HORIZONTAL:C.DIRECTION_VERTICAL,n}var Oi={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:ki(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const a="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=wi.isOnComponentForRange(o,a,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!s,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];wi.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var Ni={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?C.DIRECTION_VERTICAL:C.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const a="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=wi.isOnComponentForRange(o,a,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!s,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];wi.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var Li={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?C.DIRECTION_VERTICAL:C.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter((e=>e.settings.key===n.keys.componentKey))[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var Ti={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&wi.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach((t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)}))}}}}};var Pi={create:function(e,t,n,r,i){const o={};t=t||"vertical";const a=r.lassoBrushKey||"select",s=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,u=r.areaBrushKey||null,c=r.legendBrushKey||null,p=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},m="horizontal"===t,h=m?"y-axis":"x-axis",g=m?"x-axis":"y-axis";function b(e,t,n){if(f.gesture===e)return;let r=a;const i=t||f.chart;switch(f.gesture){case"majorrange":y(i,"rangeDim","rangeClear",n),r=s;break;case"measurerange":y(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":y(i,"rangeMinor","areaClear",n),r=u}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function y(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let v=[];const x={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:y,switchTo:b,getBrushConfig:function(){return s?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},q={handlers:e,keys:r,isHorizontal:m,active:f,rangeSelStatus:i};function D(){b("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return p&&(v=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){b("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],v.unshift(Ti.callNavBtnGesture(x.isNavigationEnabled,c)),v.push(Ai.callLassoGesture(d,x,q)),s?l?(v.push(Ni.callDimensionRangeGesture(d,x,q,h)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),v.push(Ii.callMeasureRangeGesture(d,x,q,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(v.push(Ni.callDimensionRangeGesture(d,x,q,h)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),v.push(Oi.callAreaRangeGesture(d,x,q,g)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"})):(v.push(Ii.callMeasureRangeGesture(d,x,q,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),v.push(Oi.callAreaRangeGesture(d,x,q,h)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(v.push(Li.callDragGesture(d,x,q,p,n)),e.scrollHandler.getScrollApi().on("update",D)),o.gestures=v,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",D)},o}};const Ri=(e,t)=>(t.components||[]).find((t=>t.key===e)),Fi=(e,t,n)=>{var r,i,o,a;const s=null===(r=Ri("axis",n))||void 0===r?void 0:r.axis;return{text:{fontFamily:(null==s||null===(i=s.title)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==s||null===(o=s.title)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==s||null===(a=s.title)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"axis.title","color")}}},Hi=(e,t,n)=>{var r,i,o,a;const s=null===(r=Ri("axis",n))||void 0===r?void 0:r.axis;return{labels:{fontFamily:(null==s||null===(i=s.label)||void 0===i||null===(i=i.name)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==s||null===(o=s.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==s||null===(a=s.label)||void 0===a||null===(a=a.name)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"axis.label.name","color")}}};function _i(e){const t=tt(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0.qApprMaxGlyphCount",0);return Math.min(20,t)}const Vi={createSettings:function(e){return{settings:{labels:{maxGlyphCount:_i(e)}}}}};const ji={createSettings:function(e){const t=bi.isAutoBin(e),n=bi.getBinMode(e),r=bi.getDerivedBinSize(e);let i,o;if(t||"maxCount"===n){const t=bi.getDerivedBinOffset(e);i=t,o=t+bi.getDerivedBinCount(e)*r}else{const t=tt(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0",{});i=t.qMin||0,o=(t.qMax||0)+r}return{component:{type:"linear",min:i,max:o}}}},zi={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},Bi=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,$i=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,Ui=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,Ki=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,Wi=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,Gi=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,Yi=Math.floor,Ji=Math.round,Zi=Pn.extend({init(){let e,t,n,r,i,o,a,s,l,u,c,p,d=0,f=0,m=0,h=1;if(this._invalid=!1,arguments[0]instanceof Zi)d=arguments[0]._r,f=arguments[0]._g,m=arguments[0]._b,h=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(p=arguments[0],c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(p))d=parseInt(c[1],10),f=parseInt(c[2],10),m=parseInt(c[3],10);else if(c=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(p))d=parseInt(c[1],10),f=parseInt(c[2],10),m=parseInt(c[3],10),h=parseFloat(c[4]);else if(c=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(p))d=parseInt(c[1],16),f=parseInt(c[2],16),m=parseInt(c[3],16),h=1;else if(c=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(p))d=parseInt(c[1]+c[1],16),f=parseInt(c[2]+c[2],16),m=parseInt(c[3]+c[3],16),h=1;else if(c=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,m=l[2]+u,d=Ji(255*d),f=Ji(255*f),m=Ji(255*m),h=1}else if(c=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),h=parseFloat(c[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,m=l[2]+u,d=Ji(255*d),f=Ji(255*f),m=Ji(255*m)}else if(c=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),i=parseFloat(c[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=i-o,d=l[0]+u,f=l[1]+u,m=l[2]+u,d=Ji(255*d),f=Ji(255*f),m=Ji(255*m),h=1}else zi[p.toLowerCase()]?(n=p.toLowerCase(),d=zi[n].r,f=zi[n].g,m=zi[n].b,h="number"==typeof zi[n].a?zi[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(h=(4278190080&arguments[0])>>>24,h/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,m=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,m=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],m=arguments[2],h=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+m+h)&&(this._invalid=!0),this._r=Yi(d),this._g=Yi(f),this._b=Yi(m),this._a=h,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=Zi.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=Zi.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=Zi.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=Zi.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=Zi.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=Zi.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=Zi.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=Zi.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const a=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${a})`},isEqual(e){return e instanceof Zi||(e=new Zi(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[Yi(this._r+(e._r-this._r)*t),Yi(this._g+(e._g-this._g)*t),Yi(this._b+(e._b-this._b)*t),Yi(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new Zi(r)}});Zi.toRGB=function(e){if(e instanceof Zi)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=Zi.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},Zi.toRGBA=function(e,t){if(e instanceof Zi)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=Zi.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},Zi.toHex=function(e){let t,n,r;return e instanceof Zi?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=Zi.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},Zi.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Zi(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=Math.max(a,s,l),c=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(u+c)/2,u===c)n=0,o=0;else{switch(i=u-c,n=r>.5?i/(2-u-c):i/(u+c),u){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},Zi.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new Zi(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=e._a,c=Math.max(a,s,l),p=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(c+p)/2,c===p)n=0,o=0;else{switch(i=c-p,n=r>.5?i/(2-c-p):i/(c+p),c){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${u})`},Zi.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new Zi(e));const i=e._r/255,o=e._g/255,a=e._b/255,s=Math.max(i,o,a),l=Math.min(i,o,a),u=s;if(s===l)t=0,r=0;else{switch(n=s-l,t=0===n?0:n/u,s){case i:r=(o-a)/n+(o<a?6:0);break;case o:r=(a-i)/n+2;break;case a:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*u}},Zi.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof Zi)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},Zi.blend=function(e,t,n){const r=(16711680&(e=Zi.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=Zi.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},Zi.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,a=e._a+(t._a-e._a)*n;return new Zi(r,i,o,a)},Zi.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(Bi.test(e)||$i.test(e)||Ui.test(e)||Ki.test(e)||Wi.test(e)||Gi.test(e)||zi[e.toLowerCase()])},Zi.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},Zi.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},Zi.isDark=function(){const e={getLuminance:Zi.prototype.getLuminance,isInvalid:Zi.prototype.isInvalid};return Zi.prototype.init.apply(e,[].slice.call(arguments)),Zi.prototype.isDark.call(e)},Zi.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const Qi={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new Zi(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new Zi(e);return 0===t.getAlpha()?this.DARK_GREY:Zi.getBestContrast(t,new Zi(Qi.LIGHT_GREY),new Zi(Qi.DARK_GREY))},getBestContrast:(e,t,n)=>Zi.getBestContrast(new Zi(e),new Zi(t),new Zi(n)),getContrastingTransparent(e){const t=new Zi(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};const Xi={createSettings:function(e,t,n,r,i,o){const{theme:a}=e.environment,s=a.getColorPickerColor(t.color.bar.paletteColor),l=bi.getDerivedBinSize(t),u=[],c=[n.consume,r.consume,i.consume];return e._tooltipHandler.isOn()&&(u.push(o.box.trigger),c.push.apply(c,o.box.consume)),u.push(n.trigger),{key:"box-marker",settings:{box:{fill:s,stroke:Qi.getContrastingGrey(s).toHex(),strokeWidth:1,maxWidthPx:1/0,minWidthPx:NaN,minWidth:0},major:{scale:"dimension",ref:{start:"binStart",end:"binEnd"}},minor:{scale:"measure"},whiskers:!1,orientation:"vertical"},brush:{trigger:u,consume:c},data:{extract:{field:"qDimensionInfo/0",props:{start:0,end:{field:"qMeasureInfo/0"},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},binStart:{field:"qDimensionInfo/0",value:e=>e.qNum},binEnd:{field:"qDimensionInfo/0",value:e=>e.qNum+l},elemNo:{field:"qDimensionInfo/0"},bin:{field:"qDimensionInfo/0",value:e=>e}}}}}}};const eo={createSettings:function(e,t,n){const r=t.getStyles(),i=((e,t,n)=>{var r,i,o,a;const s=null===(r=Ri("value",n))||void 0===r?void 0:r.label,l=(null==s||null===(i=s.value)||void 0===i?void 0:i.fontFamily)||t.label.value.fontFamily;let u=(null==s||null===(o=s.value)||void 0===o?void 0:o.fontSize)||t.label.value.fontSize;return u=parseFloat(u),{fontFamily:l,fontSize:u,fill:null==s||null===(a=s.value)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color}})(0,r,e),o=i.fill||r.label.value.color;return{settings:{sources:[{strategy:{settings:{...i,labels:[{placements:[{fill:o},{fill:i.fill?o:e=>Zi.isDark(e.node.attrs.fill)?r.label.value.lightColor:r.label.value.darkColor}]}]}}}]}}}},to="object.histogram";function no(e){return tt(e,"qHyperCube.qDimensionInfo.0.qIsOneAndOnlyOne",!1)}const ro={createChartSettings:function(e,t){const n=e.isRtl(),r=tt(t,"qHyperCube.qDimensionInfo.0",{}).qFallbackTitle||"",{theme:i,translator:o}=e.environment,a=cr.create({chartID:to,theme:i,isRtl:n,flags:e.flags}),s=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,p={theme:t,matrix:yt(a),styles:void 0};return p.styles=xt({theme:t,id:i,transform:l,extend:c,matrix:p.matrix}),{getStyles:function(){return p.styles},getTheme:function(){return p.theme},setTheme:function(e){p.theme=e,p.styles=xt({theme:e,id:i,transform:l,extend:c,matrix:p.matrix})}}}({theme:i,config:{id:"histogram"}});let l={},u={},c={};e._selectionHandler.isOn()&&(e._selectionHandler.setUpStart(),l=e._selectionHandler.setUpBrush({contexts:["select"],data:["elemNo"],dataPath:"qUndoExclude/box"}),u=e._selectionHandler.setUpBrush({contexts:["select-dimension"],data:["elemNo"],dataPath:"qUndoExclude/box",isSingleSelect:no(t)}),c=e._selectionHandler.setUpBrush({dataPath:"qUndoExclude/box",contexts:["select-measure"],data:["end"]}),e._selectionHandler.setUpDone());const p={box:{}};e._tooltipHandler.isOn()&&(p.box=e._tooltipHandler.setUp({chartBuilder:a,environment:e.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",measureRows:["measure"],labelData:["bin"]}));const d=function(e){const t={};return e?(t.isOpenDim=!1,t.isOpenMea=!1):(t.isOpenDim=!0,t.isOpenMea=!0),t}(function(e){const t=e.qUndoExclude&&e.qUndoExclude.box&&e.qUndoExclude.box.qHyperCube&&e.qUndoExclude.box.qHyperCube.qDimensionInfo?e.qUndoExclude.box.qHyperCube.qDimensionInfo:void 0;return!!t&&!!t[0].qLocked}(t)),f={scrollHandler:null,selectionHandler:e._selectionHandler};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=Pi.create(f,"vertical",n,{componentKey:"box-marker",lassoBrushKey:"select",dimRangeBrushKey:null,measureRangeBrushKey:"select-measure",areaBrushKey:"select-dimension"},d),a.addPreset("dimension-measure-chart",{isRtl:n,includeDimensionAxis:!0,orientation:"vertical",selectionsEnabled:e._selectionHandler.isOn(),theme:i,measureSource:"qMeasureInfo/0",measureScaleSettings:{component:{expand:0,include:[0]}},enableLasso:!0,lasso:{brushKey:"select",brushComponents:["box-marker"]},enableMeasureRange:!0,measureRange:{brushKey:"select-measure",brushAxis:"y-axis",brushArea:"box-marker",brushScale:"measure"},enableAreaRange:!0,areaRange:{brushKey:"select-dimension",brushAxis:"x-axis",brushData:["elemNo"],brushArea:"box-marker",brushScale:"rangeSelSettings",brushComponents:["box-marker"],multiple:!0,chartInstance:e.chartInstance},brushActions:this._dependentActions.gestures,dimensionSource:"qDimensionInfo/0",dimensionScaleSettings:ji.createSettings(t),measureAxisProperties:t.measureAxis,measureTitleText:t.measureAxis.label||o.get("Visualization.Histogram.MeasureAxisLabel"),dimensionAxisProperties:t.dimensionAxis,dimensionAxisSettings:Vi.createSettings(t),dimensionTitleText:r,gridlines:t.gridlines,hasNavigation:!1,isNavigationEnabledFn:()=>!1,refLines:t.refLine&&t.refLine.refLines,axisTitleStyle:Fi(to,i,t),axisLabelStyle:Hi(to,i,t)});const m=a.getSettings(),h=Xi.createSettings(e,t,l,u,c,p);if(a.addComponent("box-marker",h),t.dataPoint&&t.dataPoint.showLabels){const e=eo.createSettings(t,s,to);a.addComponent("labels",e)}return e.addSnapshotChartSettings(m,t),m.scales.rangeSelSettings={type:"linear",min:m.scales.dimension.min,max:m.scales.dimension.max,source:"qDimensionInfo/0"},m}};const io=br.extend("Histogram",{namespace:".histogram",init:function({environment:e,flags:t,lasso:n,picasso:r,$element:i,backendApi:o,selectionsApi:a,renderState:s}){this._super(r,i,e,o,a),this.flags=t,this.renderState=s,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new ni,this._selectionHandler=Mr.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:a,selectPaths:["/qUndoExclude/box/qHyperCubeDef"],lasso:n}),this._tooltipHandler=_r.create(this.chartInstance,i,"object.histogram"),this.setDataPaths(["qUndoExclude/box/qHyperCube"])},updateConstraints:function(e){const t=!e.passive,n=!e.select&&!e.active;this._tooltipHandler[t?"on":"off"](),this._selectionHandler[n?"on":"off"]()},off:function(){this._tooltipHandler.off(),this._selectionHandler.off()},createChartSettings:function(e){return ro.createChartSettings(this,e)},setSnapshotData:function(e){return this._super(e),e.qUndoExclude.box.qHyperCube.qDataPages=this.layout.qUndoExclude.box.qHyperCube.qDataPages,Promise.resolve(e)},getDisclaimerAttributes:function(e){const t=function(){const t=tt(e,"qUndoExclude.box.qHyperCube.qDataPages.0.qMatrix",[]);return 1===t.length&&t[0][0]&&t[0][0].qIsNull}();return{data:e.qUndoExclude&&e.qUndoExclude.box,supportedDisclaimers:{LimitedData:!0,OnlyNanData:!0,OnlyNegativeOrZeroValues:!t,RequireNumericDimension:!0},options:{bottom:!0,supportNegative:!1,explicitOnlyNanData:t,explicitRequireNumericDimension:(n=e.qHyperCube,n.qDimensionInfo.length>0&&-1===n.qDimensionInfo[0].qTags.indexOf("$numeric"))}};var n},updateChart:function(e,t){if(!e.qUndoExclude)return Promise.resolve();this._super(e,t)},updateData:function(e){const t=this;return t._super(e).then((()=>{if(t._destroyed)return Promise.reject();e=t.layout;const n={height:Math.min(e.qHyperCube.qSize.qcy,1e3),width:2},r=t.backendApi.model;return!!this.layout.snapshotData?Promise.resolve():r.getEffectiveProperties().then((i=>t._destroyed?Promise.reject():t._derivedProperties.addDefaultHyperCubeHash(i.qHyperCubeDef,e.qHyperCube,t.environment.app,function(e,t){return{box:t.qHyperCubeDef,binMappings:Ci.getMappingValues(e),binProperties:t.bins,measureAxis:t.measureAxis,version:"2.0"}}(e,i)).then((o=>{if(t._destroyed)return Promise.reject();const a={layout:e,properties:i,model:r,hashData:o,generateDerivedProperties:(e,n)=>Mi.generateHyperCubes(e,n,t.environment)};return t._derivedProperties.isDerivedUpToDate(a)?e.qUndoExclude?(t.renderState.restore(),t.backendApi.updateCache(e.qUndoExclude.box),t.getData(t.backendApi,e.qUndoExclude.box.qHyperCube,n)):Promise.resolve():(t.renderState.pending(),t._derivedProperties.updateDerivedProperties(a))}))))}))},paint:function(){const e=this.layout.qUndoExclude;return e&&e.box&&e.box.qHyperCube.qDataPages.length?this._super():Promise.resolve(!1)},isLassoDisabled:function(){return!1}});class oo{constructor(e){this.model=e,this.path="/qUndoExclude/box/qHyperCubeDef"}setCacheOptions({maxStackedValues:e}){}updateCache(e){}getData(e){return this.model.getHyperCubeData(this.path,e)}}var ao={onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,r=null==e||null===(t=e.qUndoExclude)||void 0===t||null===(t=t.box)||void 0===t?void 0:t.qHyperCubeDef;n&&r&&(r.qCalcCond=n.qCalcCond,r.qCalcCondition=n.qCalcCondition)}};const so=(e,t)=>({component:"styling-panel",chartTitle:"Object.Histogram",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:t.getOptions("value","label.value")}}}),lo="maxCount",uo="size";function co(e){return!(e.bins&&e.bins.auto)}function po(e){return co(e)&&e.bins.binMode===lo}function fo(e){var t,n;const{translator:r,flags:i}=e,o=null==e||null===(t=e.flags)||void 0===t?void 0:t.isEnabled("SENSECLIENT_IM_2021_STYLINGPANEL_HISTOGRAM"),a=null==e||null===(n=e.flags)||void 0===n?void 0:n.isEnabled("SENSECLIENT_IM_2021_HISTOGRAM_BG"),s=e.anything.sense.theme,l={translation:"properties.colors",type:"items",items:{colors:{classification:{section:"color",tags:["simple"]},type:"items",items:{barColor:{ref:"color.bar.paletteColor",translation:"properties.histogram.barColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=s.getDataColorSpecials(),t=s.getDataColorPickerPalettes()[0].colors,n=t.indexOf(e);return{index:-1===n?Math.min(6,t.length-1):n}}}}}}},u="object.histogram",c=((e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}))(s,r,u,te,i),p=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(c,s,u),d={type:"items",translation:"properties.presentation",items:{stylingPanel:o&&so(a,p),gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}},showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},f={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.XAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.YAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},m={uses:"settings",items:{simpleLabels:f,presentation:d,colors:l,measureAxis:{uses:"axis.picasso.measureAxis",items:{label:{type:"string",expression:"optional",expressionType:"StringExpression",ref:"measureAxis.label",defaultValue:"",translation:"Common.Label",placeholderTranslation:"Visualization.Histogram.MeasureAxisLabel"}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{label:{show:!1}}}}}}},h={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:ao.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},g={uses:"data",items:{dimensions:{translation:"Common.Fields",alternativeTranslation:"properties.alternative.fields",items:{dimensionLimits:{show:!1,items:{otherMode:{readOnly:!1},otherSortMode:{show:e=>"OTHER_COUNTED"===tt(e,"qOtherTotalSpec.qOtherMode")},otherCounted:{show:e=>"OTHER_COUNTED"===tt(e,"qOtherTotalSpec.qOtherMode")},otherLimitMode:{show(e){const t=tt(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},otherLimit:{show(e){const t=tt(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},calculatedAgainstMessage:{show:!0,label(){const e=r.get("properties.histogram.staticMeasureName");return r.get("Properties.DimensionLimits.CalculatedAgainst",e)}}}},others:{show:!1,items:{suppressOther:{defaultValue:!0}}}}}}},b={ref:"bins.binMode",type:"string",component:"dropdown",options:[{value:lo,translation:"Visualization.Histogram.Binning.NumberOfBinsOption"},{value:uo,translation:"Visualization.Histogram.Binning.BarWidthOption"}],defaultValue:lo,show:e=>co(e)},y={translation:"Visualization.Histogram.Bins",type:"items",component:"items",items:{auto:{ref:"bins.auto",translation:"Visualization.Histogram.Binning",component:"switch",type:"boolean",defaultValue:!0,undefinedValue:!1,options:[{value:!0,translation:"Visualization.Histogram.Binning.Auto"},{value:!1,translation:"Visualization.Histogram.Binning.Custom"}]},autoMessage:{component:"text",translation:"Visualization.Histogram.Binning.AutoDescription",show:e=>!co(e)},mode:b,binCount:{ref:"bins.binCount",type:"number",expression:"optional",expressionType:"ValueExpression",translation:"Visualization.Histogram.Binning.BinCount",defaultValue:"",convertFunctions:{get(e,t,n){const r=n.properties.bins.binCount;return bi.isEmpty(r)?bi.getDerivedBinCount(n.layout):e(null)||""},set(e,t,n){t(n.type,e,void 0)}},show:po},binMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountRounding",show(e){const t=tt(e,"bins.binCount"),n="object"==typeof t;return po(e)&&!bi.isEmpty(t)&&!n&&!gi(t)&&t>0}},minBinMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountMin",show(e){const t=tt(e,"bins.binCount");return!!(po(e)&&!bi.isEmpty(t)&&t<=0)}},binSize:{ref:"bins.binSize",type:"number",expression:"optional",expressionType:"ValueExpression",defaultValue:10,show:e=>co(e)&&e.bins.binMode===uo,translation:"Visualization.Histogram.Binning.BinSize"},offset:{ref:"bins.offset",type:"number",expression:"optional",expressionType:"ValueExpression",show:e=>co(e)&&e.bins.binMode===uo,translation:"Visualization.Histogram.Binning.Offset"},distinct:{ref:"bins.countDistinct",type:"boolean",defaultValue:!1,component:"checkbox",translation:"Visualization.Histogram.CountDistinct"}}};return{type:"items",component:"accordion",items:{data:g,bins:y,addons:h,settings:m}}}var mo={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields"}}}}};var ho={getExportRawDataOptions:function(e,t,n){return e.addItem({translation:"contextMenu.export",tid:"export",select(){n.show(t.model,"/qUndoExclude/box/qHyperCubeDef")}}),Promise.resolve()}};const go="qUndoExclude.box";function bo(e){var t;if(null!==(t=e.anything)&&void 0!==t&&t.sense)return{definition:fo(e),softDefinition:mo,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties:(t,n,r,i)=>{const o=_(e);r.mapProperties();const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return R.hypercube.importProperties({exportFormat:t,initialProperties:n,dataDefinition:o,defaultPropertyValues:a,hypercubePath:i})},exportProperties:(e,t,n)=>R.hypercube.exportProperties({propertyTree:e,hyperCubePath:n?go:t,viewDataMode:n}),requireNumericDimension:!0,exportTableProperties(e){const t=go;return R.hypercube.exportProperties({propertyTree:e,hypercubePath:t,viewData:!0})},getExportRawDataOptions:ho.getExportRawDataOptions}}function yo(M){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(w).forEach((t=>{e.add(w[t])}))}}(M.translator);const O=_(M);return{qae:{properties:H,data:{targets:[O]},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>R.hypercube.exportProperties({propertyTree:e,hypercubePath:n?"qUndoExclude.box":t})},ext:bo(M),component(){const w=e(),O=g(),N=function(){const e=l(),t=u(),n=c(),r=a(),i=p(),o=d();return f((()=>({app:e,appLayout:t,deviceType:n,options:r,theme:i,translator:o})),[e,t,r.direction,r.freeResize,o.language(),i.name(),n])}(),L=N.options.renderer,T=f((()=>function(e){const t=D();return t.renderer.prio([e||"canvas"]),t.use(S),t.use(E(C)),t.use(A),t.component("disclaimer",I),t}(L)),[L]),P=function(){const o=e(),[a,s]=t(!1),[l,u]=t(!1),c=!!n().qSelectionInfo.qInSelections,[p]=t((()=>({toggle(){u((e=>!e))}})));return r((()=>{o&&s(!o.select&&!o.active)}),[o]),i((()=>({key:"lasso",label:"Lasso",icon:k,hidden:!a||!c,active:l,action(){u((e=>!e))}})),[c,l,a]),p.enabled=()=>a,p.active=()=>l,p}(),R=b(),F=y(),H=v(),_=x(),[V,j]=t();r((()=>{const e=q(O),t=new oo(R),n=F,r=new io({$element:e,backendApi:t,environment:N,flags:M.flags,lasso:P,picasso:T,selectionsApi:n,renderState:_});return j(r),()=>{r.destroy()}}),[]);const[,z]=s((async()=>{V&&(V.updateEnvironment(N),V.updateConstraints(w),await V.updateData(H),await V.paint())}),[H,V,N]);if(z)throw z;var B;!function(t){const n=o(),r=a(),i=e(),[,l]=s((async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())}),[n.width,n.height]);if(l)throw l}(V),B=V,m((e=>{if(B)return B.setSnapshotData(e)})),h((()=>({getViewState(){if(B)return B.getViewState()}})),[B])}}}export{yo as default};
9
+ e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=d-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),q=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)h+=p.charAt(v),!((v-y+1)%l)&&v<d-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),m+(n?"-":"")+r+q}},dt({exports:{}});var Dt="'Source Sans Pro', 'Arial', 'sans-serif'",St="#333333",Mt="#595959",Et="#737373",Ct="#cccccc",wt="#e6e6e6";function At(e){var t={};return[].concat(B(e),B([["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Mt],["object","axis.label.name","fontFamily",Dt],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",Ct],["object","axis.line.minor","color",wt],["object","axis.title","color"],["object","axis.title","fontFamily",Dt],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",wt],["object","grid.line.major","color",Ct],["object","grid.line.minor","color",wt],["object","label.value","color",Mt],["object","label.value","fontFamily",Dt],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Mt],[!1,"label.value","lightColor",wt],["object","outOfRange","color","#999"],["object","legend.title","color",St],["object","legend.title","fontFamily",Dt],["object","legend.title","fontSize","15px"],["object","legend.label","color",Mt],["object","legend.label","fontFamily",Dt],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",St],["object","referenceLine.label.name","fontFamily",Dt],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",wt],["object","referenceLine.outOfBounds","fontFamily",Dt],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Et,function(e){return"transparent"===e?Et:e}]])).reduce(function(e,n){var r="".concat(n[0],"-").concat(n[1],"-").concat(n[2],"}");return t[r]||(t[r]=!0,e.push(n)),e},[]).sort(function(e,t){return(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0)})}var It,Ot,kt=function(e){return e};function Nt(e){var t=e.theme,n=e.id,r=e.transform,i=e.extend,o=e.matrix,a={},s=r.reduce(function(e,t){var n=z(t,2),r=n[0],i=n[1];return e[r]=i,e},{});return o.forEach(function(e){var r=z(e,5),i=r[0],o=r[1],l=r[2],u=r[3],c=r[4],p=void 0===c?function(e){return e}:c,d=function(e){var t=e.theme,n=e.base,r=e.path,i=e.attribute,o=e.defaultValue,a=void 0===o?void 0:o;if(!t||!1===n)return a;var s=t.getStyle(n,r,i);return void 0===s?a:s}({theme:t,base:"object"===i&&n?"".concat("object",".").concat(n):i,path:o,attribute:l,defaultValue:u}),f=(s["".concat(o,".").concat(l)]||kt)(p(d));mt(a,[o,l].filter(Boolean).join("."),f)}),i.forEach(function(e){var t=z(e,2),n=t[0],r=t[1];mt(a,n,r)}),a}function Tt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lt=function(){if(Ot)return It;Ot=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},o=function(n){if(!n||"[object Object]"!==t.call(n))return!1;var r,i=e.call(n,"constructor"),o=n.constructor&&n.constructor.prototype&&e.call(n.constructor.prototype,"isPrototypeOf");if(n.constructor&&!i&&!o)return!1;for(r in n);return void 0===r||e.call(n,r)},a=function(e,t){n&&"__proto__"===t.name?n(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(r)return r(t,n).value}return t[n]};return It=function e(){var t,n,r,l,u,c,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=s(p,n),p!==(l=s(t,n))&&(m&&l&&(o(l)||(u=i(l)))?(u?(u=!1,c=r&&i(r)?r:[]):c=r&&o(r)?r:{},a(p,{name:n,newValue:e(m,c,l)})):void 0!==l&&a(p,{name:n,newValue:l}));return p},It}();function Pt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Rt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ft(){}Tt(Lt);var Ht=1/.7,_t="\\s*([+-]?\\d+)\\s*",jt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Vt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zt=/^#([0-9a-f]{3,8})$/,Bt=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),$t=new RegExp(`^rgb\\(${Vt},${Vt},${Vt}\\)$`),Ut=new RegExp(`^rgba\\(${_t},${_t},${_t},${jt}\\)$`),Kt=new RegExp(`^rgba\\(${Vt},${Vt},${Vt},${jt}\\)$`),Wt=new RegExp(`^hsl\\(${jt},${Vt},${Vt}\\)$`),Yt=new RegExp(`^hsla\\(${jt},${Vt},${Vt},${jt}\\)$`),Gt={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 Jt(){return this.rgb().formatHex()}function Zt(){return this.rgb().formatRgb()}function Qt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=zt.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Xt(t):3===n?new rn(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?en(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?en(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=Bt.exec(e))?new rn(t[1],t[2],t[3],1):(t=$t.exec(e))?new rn(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Ut.exec(e))?en(t[1],t[2],t[3],t[4]):(t=Kt.exec(e))?en(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Wt.exec(e))?cn(t[1],t[2]/100,t[3]/100,1):(t=Yt.exec(e))?cn(t[1],t[2]/100,t[3]/100,t[4]):Gt.hasOwnProperty(e)?Xt(Gt[e]):"transparent"===e?new rn(NaN,NaN,NaN,0):null}function Xt(e){return new rn(e>>16&255,e>>8&255,255&e,1)}function en(e,t,n,r){return r<=0&&(e=t=n=NaN),new rn(e,t,n,r)}function tn(e){return e instanceof Ft||(e=Qt(e)),e?new rn((e=e.rgb()).r,e.g,e.b,e.opacity):new rn}function nn(e,t,n,r){return 1===arguments.length?tn(e):new rn(e,t,n,null==r?1:r)}function rn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function on(){return`#${un(this.r)}${un(this.g)}${un(this.b)}`}function an(){const e=sn(this.opacity);return`${1===e?"rgb(":"rgba("}${ln(this.r)}, ${ln(this.g)}, ${ln(this.b)}${1===e?")":`, ${e})`}`}function sn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ln(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function un(e){return((e=ln(e))<16?"0":"")+e.toString(16)}function cn(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new dn(e,t,n,r)}function pn(e){if(e instanceof dn)return new dn(e.h,e.s,e.l,e.opacity);if(e instanceof Ft||(e=Qt(e)),!e)return new dn;if(e instanceof dn)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new dn(a,s,l,e.opacity)}function dn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function fn(e){return(e=(e||0)%360)<0?e+360:e}function mn(e){return Math.max(0,Math.min(1,e||0))}function hn(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Pt(Ft,Qt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Jt,formatHex:Jt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return pn(this).formatHsl()},formatRgb:Zt,toString:Zt}),Pt(rn,nn,Rt(Ft,{brighter(e){return e=null==e?Ht:Math.pow(Ht,e),new rn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new rn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new rn(ln(this.r),ln(this.g),ln(this.b),sn(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:on,formatHex:on,formatHex8:function(){return`#${un(this.r)}${un(this.g)}${un(this.b)}${un(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:an,toString:an})),Pt(dn,function(e,t,n,r){return 1===arguments.length?pn(e):new dn(e,t,n,null==r?1:r)},Rt(Ft,{brighter(e){return e=null==e?Ht:Math.pow(Ht,e),new dn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new dn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new rn(hn(e>=240?e-240:e+120,i,r),hn(e,i,r),hn(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new dn(fn(this.h),mn(this.s),mn(this.l),sn(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=sn(this.opacity);return`${1===e?"hsl(":"hsla("}${fn(this.h)}, ${100*mn(this.s)}%, ${100*mn(this.l)}%${1===e?")":`, ${e})`}`}}));const gn=Math.PI/180,yn=180/Math.PI,bn=4/29,vn=6/29,qn=3*vn*vn;function xn(e){if(e instanceof Dn)return new Dn(e.l,e.a,e.b,e.opacity);if(e instanceof wn)return An(e);e instanceof rn||(e=tn(e));var t,n,r=Cn(e.r),i=Cn(e.g),o=Cn(e.b),a=Sn((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Sn((.4360747*r+.3850649*i+.1430804*o)/.96422),n=Sn((.0139322*r+.0971045*i+.7141733*o)/.82521)),new Dn(116*a-16,500*(t-a),200*(a-n),e.opacity)}function Dn(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Sn(e){return e>.008856451679035631?Math.pow(e,1/3):e/qn+bn}function Mn(e){return e>vn?e*e*e:qn*(e-bn)}function En(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Cn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function wn(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function An(e){if(isNaN(e.h))return new Dn(e.l,0,0,e.opacity);var t=e.h*gn;return new Dn(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}Pt(Dn,function(e,t,n,r){return 1===arguments.length?xn(e):new Dn(e,t,n,null==r?1:r)},Rt(Ft,{brighter(e){return new Dn(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Dn(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 rn(En(3.1338561*(t=.96422*Mn(t))-1.6168667*(e=1*Mn(e))-.4906146*(n=.82521*Mn(n))),En(-.9787684*t+1.9161415*e+.033454*n),En(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),Pt(wn,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof wn)return new wn(e.h,e.c,e.l,e.opacity);if(e instanceof Dn||(e=xn(e)),0===e.a&&0===e.b)return new wn(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*yn;return new wn(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new wn(e,t,n,null==r?1:r)},Rt(Ft,{brighter(e){return new wn(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new wn(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return An(this).rgb()}}));var In=-.14861,On=1.78277,kn=-.29227,Nn=-.90649,Tn=1.97294,Ln=Tn*Nn,Pn=Tn*On,Rn=On*kn-Nn*In;function Fn(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Hn)return new Hn(e.h,e.s,e.l,e.opacity);e instanceof rn||(e=tn(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Rn*r+Ln*t-Pn*n)/(Rn+Ln-Pn),o=r-i,a=(Tn*(n-i)-kn*o)/Nn,s=Math.sqrt(a*a+o*o)/(Tn*i*(1-i)),l=s?Math.atan2(a,o)*yn-120:NaN;return new Hn(l<0?l+360:l,s,i,e.opacity)}(e):new Hn(e,t,n,null==r?1:r)}function Hn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Pt(Hn,Fn,Rt(Ft,{brighter(e){return e=null==e?Ht:Math.pow(Ht,e),new Hn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new Hn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*gn,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new rn(255*(t+n*(In*r+On*i)),255*(t+n*(kn*r+Nn*i)),255*(t+n*(Tn*r)),this.opacity)}}));var _n=e=>()=>e;function jn(e,t){return function(n){return e+n*t}}function Vn(e,t){var n=t-e;return n?jn(e,n):_n(isNaN(e)?t:e)}function zn(e){return((e=Math.exp(e))+1/e)/2}function Bn(e){return function t(n){function r(t,r){var i=e((t=Fn(t)).h,(r=Fn(r)).h),o=Vn(t.s,r.s),a=Vn(t.l,r.l),s=Vn(t.opacity,r.opacity);return function(e){return t.h=i(e),t.s=o(e),t.l=a(Math.pow(e,n)),t.opacity=s(e),t+""}}return n=+n,r.gamma=t,r}(1)}!function e(t){var n=function(e){return 1==(e=+e)?Vn:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):_n(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=nn(e)).r,(t=nn(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Vn(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=o(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1),function e(t,n,r){function i(e,i){var o,a,s=e[0],l=e[1],u=e[2],c=i[0],p=i[1],d=i[2],f=c-s,m=p-l,h=f*f+m*m;if(h<1e-12)a=Math.log(d/u)/t,o=function(e){return[s+e*f,l+e*m,u*Math.exp(t*e*a)]};else{var g=Math.sqrt(h),y=(d*d-u*u+r*h)/(2*u*n*g),b=(d*d-u*u-r*h)/(2*d*n*g),v=Math.log(Math.sqrt(y*y+1)-y),q=Math.log(Math.sqrt(b*b+1)-b);a=(q-v)/t,o=function(e){var r,i=e*a,o=zn(v),c=u/(n*g)*(o*(r=t*i+v,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(v));return[s+c*f,l+c*m,u*o/zn(t*i+v)]}}return o.duration=1e3*a*t/Math.SQRT2,o}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),Bn(function(e,t){var n=t-e;return n?jn(e,n>180||n<-180?n-360*Math.round(n/360):n):_n(isNaN(e)?t:e)}),Bn(Vn);var $n="center",Un="bottom";function Kn(e,t,n){if(void 0===e||void 0===t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(void 0===i[a])return n;i=i[a]}return i}[{key:"NoDataExist",alignment:$n,condition:function(e){var t=e.layoutService;if(!t)return!1;var n=t.meta.size;return n.x*n.y==0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:$n,condition:function(e){var t=e.layoutService;return!!t&&t.getHyperCubeValue("qMeasureInfo").every(function(e){return"NaN"===e.qMin&&"NaN"===e.qMax})}},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:$n,condition:function(e){var t=e.layoutService;if(!t)return!1;if(!t.meta.isContinuous)return!1;var n=t.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:$n},{key:"DataRangeIncludingZero",alignment:Un},{key:"LimitedData",alignment:Un},{key:"NegativeOrZeroValues",alignment:Un}].reduce(function(e,t){return e[t.key]=t,e},{});var Wn,Yn={exports:{}},Gn=Wn?Yn.exports:(Wn=1,Yn.exports=function(){function e(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!o)return!1;for(t in e);return void 0===t||r.call(e,t)},u=function(e,t){o&&"__proto__"===t.name?o(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;if(a)return a(e,t).value}return e[t]},p=function e(){var t,n,r,i,o,a,p=arguments[0],d=1,f=arguments.length,m=!1;for("boolean"==typeof p&&(m=p,p=arguments[1]||{},d=2),(null==p||"object"!=typeof p&&"function"!=typeof p)&&(p={});d<f;++d)if(null!=(t=arguments[d]))for(n in t)r=c(p,n),p!==(i=c(t,n))&&(m&&i&&(l(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&l(r)?r:{},u(p,{name:n,newValue:e(m,a,i)})):void 0!==i&&u(p,{name:n,newValue:i}));return p};function d(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),s=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function f(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function m(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:u,targetProp:c,columnOrder:m}=e,h=r;if(i.field&&i.field!==n){const e=d(i.field,o,{cache:t},m);if(-1===e)return;h=p({qRow:a},e(s))}u[c]=f(i,h,{key:l})}function h(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:u,main:c}=r.normalizeConfig(i[e],t),h=Object.keys(u),g=!!i[e].trackBy,y=typeof i[e].trackBy,b={},v=[],q=[];for(let t=0;t<a.qDataPages.length;t++){const o=d(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let d=0;d<a.qDataPages[t].qMatrix.length;d++){const x=a.qDataPages[t].qArea.qTop+d,D=p({qRow:x},o(a.qDataPages[t].qMatrix[d])),S=f(c,D,{key:s});if(!c.filter||c.filter(D)){for(let e=0;e<h.length;e++){const r=u[h[e]];let i=r.fields||[r];r.fields&&(S[h[e]]=[]);for(let o=0;o<i.length;o++)m({cache:n,f:l,mainCell:D,p:i[o],prop:h[e],page:a.qDataPages[t],rowIdx:x,row:a.qDataPages[t].qMatrix[d],sourceKey:s,target:r.fields?S[h[e]]:S,targetProp:r.fields?o:h[e],columnOrder:a.qColumnOrder});if(r.fields){const t=S[h[e]].map(e=>e.value),n=S[h[e]].map(e=>e.label);S[h[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(S[h[e]].value)}}}g&&r.track({cfg:i[e],itemData:D,obj:S,target:v,tracker:b,trackType:y}),q.push(S)}}}const x=g?r.collect(v,{main:c,propsArr:h,props:u}):q;o=[...o,...x]}return o}function g(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function y(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=v)):void 0===t&&(t=b);for(var n,r,i,o,a,s=new D(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new D(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(x)}function b(e){return e.children}function v(e){return Array.isArray(e)?e[1]:null}function q(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function x(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function D(e){this.data=e,this.depth=this.height=0,this.parent=null}function S(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}D.prototype=y.prototype={constructor:D,count:function(){return this.eachAfter(g)},each:function(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this},eachAfter:function(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this},eachBefore:function(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r},sum:function(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})},sort:function(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})},path:function(e){for(var t=this,n=function(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){return Array.from(this)},leaves:function(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e},links:function(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t},copy:function(){return y(this).eachBefore(q)},[Symbol.iterator]:function*(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}};var M={depth:-1},E={},C={};function w(e){return e.id}function A(e){return e.parentId}function I(){var e,t=w,n=A;function r(r){var i,o,a,s,l,u,c,p,d=Array.from(r),f=t,m=n,h=new Map;if(null!=e){const t=d.map((t,n)=>function(e){let t=(e=`${e}`).length;return k(e,t-1)&&!k(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(O),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(O(e)),d.push(C));f=(e,n)=>t[n],m=(e,t)=>n[t]}for(a=0,i=d.length;a<i;++a)o=d[a],u=d[a]=new D(o),null!=(c=f(o,a,r))&&(c+="")&&(p=u.id=c,h.set(p,h.has(p)?E:u)),null!=(c=m(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=d[a]).parent){if(!(l=h.get(c)))throw new Error("missing: "+c);if(l===E)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===C&&1===s.children.length;)s=s.children[0],--i;for(let e=d.length-1;e>=0&&(u=d[e]).data===C;--e)u.data=null}if(s.parent=M,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(x),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=S(e),r):t},r.parentId=function(e){return arguments.length?(n=S(e),r):n},r.path=function(t){return arguments.length?(e=S(t),r):e},r}function O(e){let t=e.length;if(t<2)return"";for(;--t>1&&!k(e,t););return e.slice(0,t)}function k(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function N(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=N(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=N(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function T(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...T(e[i].children,t-1,n)]);return r}function L(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>T(e.children,r-1,n)}return!1}const P=/^qDimensionInfo(?:\/(\d+))?/,R=/^\/?qMeasureInfo\/(\d+)/,F=/\/qAttrExprInfo\/(\d+)/,H=/\/qAttrDimInfo\/(\d+)/;function _(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function j(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=-1,p=r;const d=n.qEffectiveInterColumnSortOrder,f=_(n);return P.test(p)&&(i=!0,o=+P.exec(p)[1],p=r.replace(P,"")),R.test(p)&&("K"===n.qMode?u=+R.exec(p)[1]:d&&-1!==d.indexOf(-1)?(u=+R.exec(p)[1],c=0):c=+R.exec(p)[1],p=p.replace(R,"")),p&&(H.exec(p)?s=+H.exec(p)[1]:F.exec(p)&&(a=+F.exec(p)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function V(e,t){let n,r,i=L(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function z(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function B(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let u,c;s.fields&&(u=[],c=[]);for(let n=0;n<l.length;n++){const p=l[n];let d,f,m,h,g,y;if("primitive"===p.type?(m=p.value,y=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(h=p.accessor(r),Array.isArray(h)?(g=h.map(p.valueAccessor),p.attrAccessor&&(g=g.map(p.attrAccessor)),d&&(m=g.map(d),d=null),f&&(y=g.map(f),f=null),m=p.reduce?p.reduce(m):m,y=p.reduceLabel?p.reduceLabel(y,m):String(m)):(m=p.attrAccessor?p.attrAccessor(p.valueAccessor(h)):p.valueAccessor(h),y=m)):(m=i,y=i)),s.fields){const e=d?d(m):m;u.push(e),c.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(m):m;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},p.field&&(o[t[e]].source={field:p.field.key(),key:a})}}u&&(o[t[e]]={value:"function"==typeof s.value?s.value(u,r):u,label:"function"==typeof s.label?s.label(c,r):c})}}const $=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=N(r,e);return o&&o[0]?(t.tree=y(o[0],n.children||(e=>e[i])),t.tree):null};const U=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=V(o,j(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function K(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),a=t.key(),s="S"===o.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>r.indexOf(i.indexOf(e))),a=e.fields().filter(e=>"measure"===e.type()).map(e=>r.indexOf(i.indexOf(e))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",u=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],a="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);s[a]||(s[a]=n({__id:a,__parent:i,qValues:[]},t),u=!0),i=a}if(u)for(let e=0;e<a.length;e++){const t=r[a[e]];s[i].qValues.push(t)}}const u=Object.keys(s).map(e=>s[e]);return I().id(e=>e.__id).parentId(e=>e.__parent)(u)}(t):$(o,r,e);if(!s)return null;const l=s.height,u=[];for(let a=0;a<=l;a++){let s=null;if(a>0)if("S"===o.qMode){let e=_(o)[a-1];s=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[a-1];a>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),s=r.fields[e]}const{props:l,main:c}=i.normalizeConfig(n(n({},e),{},{field:s?s.key():void 0}),t),p=Object.keys(l);u[a]={propsArr:p,props:l,main:c};const d=s?j(s,{cube:o}):{fieldDepth:0};U({propsArr:p,props:l,cube:o,cache:r,itemDepthObject:d,f:s})}const c=s.copy().descendants(),p=s.descendants();for(let e=0;e<p.length;e++){const t=u[p[e].depth].propsArr,n=u[p[e].depth].props,r=u[p[e].depth].main,i=c[e],o=i.data,s=z(r,o,{key:a});B({propsArr:t,props:n,item:i,itemData:o,ret:s,sourceKey:a}),p[e].data=s}return s}function W(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!$(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:p}=r.normalizeConfig(i[a],t),d=Object.keys(c),f=j(u,{cube:s}),{nodeFn:m,attrFn:h,valueFn:g}=V({fieldDepth:0},f);U({propsArr:d,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const y=!!i[a].trackBy,b=typeof i[a].trackBy,v={},q=[],x=m(n.tree),D=[];for(let e=0;e<x.length;e++){const t=x[e],n=h?h(g(t)):g(t);if(p.filter&&!p.filter(n))continue;const o=z(p,n,{key:l});B({propsArr:d,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:q,tracker:v,trackType:b}),D.push(o)}const S=y?r.collect(q,{main:p,propsArr:d,props:c}):D;o=[...o,...S]}return o}var Y=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=d-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),q=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)h+=p.charAt(v),!((v-y+1)%l)&&v<d-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),m+(n?"-":"")+r+q}},e.exports=t()});function G(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const J={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},Z=/%\)?$/,Q=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,X=/^\(oct\)/i,ee=/^\(dec\)/i,te=/^\(hex\)/i,ne=/^\(bin\)/i,re=/^\(rom\)/i,ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,oe=/#|0/g;function ae(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function se(e,t,n){let r;return Q.test(t)?e=ae(e,Number(/\d{2}/.exec(t)[0]),t,n):X.test(t)?e=ae(e,8,t,n):ee.test(t)?e=ae(e,10,t,n):te.test(t)?e=ae(e,16,t,n):ne.test(t)?e=ae(e,2,t,n):re.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t)):t+r+e.toExponential(0)),e}function le(e,t,n){const r=G(e);return n?r:new RegExp(r||"",t)}function ue(e,t,n,r){let i,o,a,s,l,u,c,p,d,f=e.pattern;r&&(e.abbreviate=!0),d=function(e,t){return t&&(t=G(t)),e&&(e=G(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}(t,n),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(le(u,"g"),t)),c=n,n=".",c&&(a=a.replace(le(c,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const m=f.split(c);let h;m[1]&&(h=m[1].match(oe)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=h?h.length:2,e.percentage=Z.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(le(t,null,!0),"|").concat(le(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class ce{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=function(e,t){if(!e||!e.qNumericalAbbreviation)return J;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}(e,this.patternSeparator),this.prepare()}clone(){const e=new ce(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ue(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ue(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ue(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,p="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=se(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(p=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=Y(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=Y(l,e)}e=e.replace(c.numericRegex,e=>e===a?c.groupTemp:e===o?c.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+p+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function pe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(u>=n&&(delete s[l[c]],delete l[c],u--,c++),s[e]=t,l[u]=e,u++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function de(e,t,n,r,i){const o=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ce(...t)}(i,e,t,n,r),a=pe(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const fe="D",me="T",he="TS",ge="IV",ye=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],be=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ve=["January","February","March","April","May","June","July","August","September","October","November","December"],qe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function xe(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function De(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Se(e,t){let n,r=function(e){const t=e,n=24*De(t),r=60*De(n),i=60*De(r),o=1e3*De(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0,u<0&&(u=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}class Me{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:ye,qDayNames:be,qLongMonthNames:ve,qMonthNames:qe}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[me]:r.qTimeFmt||"hh:mm:ss",[fe]:r.qDateFmt||"YYYY-MM-DD",[he]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Me(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Se(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:xe("".concat(t.year).slice(-2),2),YYY:xe("".concat(t.year).slice(-3),3),def:e=>xe("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:xe("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:xe("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>xe("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>xe("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>xe("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>xe("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g");return t.replace(a,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r})}}function Ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Me(...t)}function Ce(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Ee(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=pe(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==ge?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=Ee(i,e,t),r=pe(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function we(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c="dimension"===s?"first":"avg",p=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Ce(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),de(n,r,i,o,t)}(t,i),d={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(d)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:c,reduceLabel:"dimension"===s?"first":(e,t)=>p(t),formatter:()=>p,tags:()=>t.qTags};return d}function Ae(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:we(p({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=Ae("qAttrDimInfo",t,n,a,p({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=Ae("qAttrExprInfo",t,n,a,p({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=Ae("qMeasureInfo",t,n,a,p({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function Ie(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=Ie.util,s={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>function(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}(e,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,l,i,a),hierarchy:e=>s.hierarchy(e,l,i,a),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(s.extractor=W,s.hierarchy=K,s.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(s.extractor=h,s.pages=o.qDataPages,s.hierarchy=K):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},l,i,a);const u="S"===o.qMode?e=>e.qElemNumber:void 0,c="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...Ae("qDimensionInfo",o,e,"",p({},s,{value:u,type:"dimension"}))),i.wrappedFields.push(...Ae("qMeasureInfo",o,e,"",p({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const d=e=>{e.forEach(e=>{i.allFields.push(e.instance),d(e.measures),d(e.attrDims),d(e.attrExps)})};return d(i.wrappedFields),(r.virtualFields||[]).forEach(t=>{const r=l.field(t.from),o=we(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>s.extractor({field:e},l,i,a),key:t.key,type:r.type(),localeInfo:s.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const Oe=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ke=/\/qDimensionInfo(?:\/(\d+))?/,Ne=/\/qMeasureInfo\/(\d+)/,Te=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,Le=/\/qAttrExprInfo\/(\d+)/,Pe=/\/?qHyperCube/,Re=/\/?qTreeData/,Fe=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),He=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function _e(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;Pe.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=Fe):Re.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=He);let s=!0;if(ke.test(e)&&(r=+ke.exec(e)[1]),Ne.test(e)&&(i=+Ne.exec(e)[1]),Te.test(e)){i=-1,r=0;const e=+Te.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(Le.test(e)){const e=i;if(t){i=0;const a=N(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+Le.exec(n)[1]}else r>-1?(r=-1,i=+Le.exec(n)[1]):i+=+Le.exec(n)[1]+1}return Oe.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||s>=o)&&o>-1?n.forEach(e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})}):n.forEach(e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(u=t.orMode)||void 0===u||u]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var u}function je(e){Ie.util=e.data("matrix").util,e.data("q",Ie),e.formatter("q-number",de),e.formatter("q-time",Ce)}return je.qBrushHelper=_e,je.selections=_e,je}());Tt(Gn);const Jn=/xyz/.test(()=>{})?/\b_super\b/:/.*/,Zn=function(){};Zn.extend=function e(t,n){const r=this.prototype;"string"!=typeof t&&(n=t,t="Class");const i=Object.create(this.prototype);for(const e in n)i[e]="function"==typeof n[e]&&"function"==typeof r[e]&&Jn.test(n[e])?function(e,t){return function(){const n=this._super;this._super=r[e];const i=t.apply(this,arguments);return this._super=n,i}}(e,n[e]):n[e];if(!/^[_a-z][_a-z\d]*$/i.test(t))throw new Error("Invalid subclass name. Alphanumericals only.");const o=new Function(`return (function ${t}(){ typeof this.init === 'function' && this.init.apply(this, [].slice.call(arguments)) });`)();return o.prototype=i,o.prototype.constructor=o,o.extend=e,o};const Qn={getChar(e){let t,n=e;return n>9?(t=65+n-10,t>90&&(t+=6)):n=`${n}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(t)>-1?this.getChar(n+1):String.fromCharCode(t)},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,"")}};function Xn(){return Qn.id()}const er="scrollbar";function tr(e,t,n){return"y"===e?nr(t,n):function(e){return"far"===e?"top":"bottom"}(t)}function nr(e,t){const n=e||"near";return t&&"near"===n||!t&&"far"===n?"right":"left"}var rr={getAxisDock:tr,getOppositeAxisDock:function(e,t,n){return tr(e,"far"===t?"near":"far",n)},getYAxisDock:nr};const ir=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗA-Za-zヲ-ᅵ]"),or=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),ar=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function sr(e){return ir.test(e)}function lr(e){return or.test(e)||ar.test(e)}var ur={lrm:String.fromCharCode(8206),detectTextDirection:function(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],sr(r))return"ltr";if(lr(r))return"rtl"}return"ltr"}};var cr={lineSettings:function(e,t){var n;const r={value:0,line:{stroke:void 0!==t.paletteColor?t.theme.getColorPickerColor(t.paletteColor):"transparent",strokeDasharray:null==t||null===(n=t.style)||void 0===n?void 0:n.lineType}};return C(!0,r,e||{})},lineLabelSettings:function(e,t){const n=t&&t.chartID;let r=t.theme.getStyle(n,"referenceLine.label.name","color");const i=t.theme.getStyle(n,"referenceLine.label.name","fontSize"),o=t.theme.getStyle(n,"referenceLine.label.name","fontFamily");return t.paletteColor?r=t.theme.getColorPickerColor(t.paletteColor):r||(r="transparent"),C(!0,{value:0,line:{stroke:"transparent"},label:{align:"center",vAlign:"middle",text:"",fill:r,fontFamily:o,fontSize:i,maxWidthPx:135}},e||{})},isVisible:e=>e&&!1!==e.show&&0!==e.show&&"0"!==e.show&&void 0!==e.refLineExpr,getRefLineTitle:function({refLine:e,label:t,valueString:n}){return!1!==e.showValue?!1!==e.showLabel?`${t} ${ur.lrm}(${n})${ur.lrm}`:`${ur.lrm}(${n})${ur.lrm}`:!1!==e.showLabel?t:""}};const pr={SHOW_AXIS_LABELS_OPTIONS:["all","labels"],SHOW_TITLE_OPTIONS:["all","title"],HORIZONTAL:"horizontal",VERTICAL:"vertical",LAYOUTSETTINGS:{lasso:{displayOrder:1e4},rangeDim:{displayOrder:1e4},rangeMeasure:{displayOrder:1e4},rangeMinor:{displayOrder:1e4},scrollBar:{minimumLayoutMode:"SPARK",prioOrder:-1,displayOrder:100},refLines:{layout:{minimumLayoutMode:"SPARK",prioOrder:60,displayOrder:1110}},measureAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},dimensionAxisTitle:{minimumLayoutMode:"XSMALL",prioOrder:30,displayOrder:90},measureAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},dimensionAxis:{minimumLayoutMode:"XSMALL",prioOrder:10,displayOrder:80},gridLines:{minimumLayoutMode:"XSMALL",displayOrder:-100},refLinesLabels:{minimumLayoutMode:"SMALL",prioOrder:60,displayOrder:0}}};pr.DEFAULT_CHART_ORIENTATION=pr.HORIZONTAL;function dr(e,t){const n=t||{},r=n.measureAxisProperties||{},i=n.dimensionAxisProperties||{},o=n.orientation||pr.DEFAULT_CHART_ORIENTATION,a=o===pr.HORIZONTAL,s=a?"x":"y",l=a?"y":"x",u=pr.SHOW_AXIS_LABELS_OPTIONS,c=pr.SHOW_TITLE_OPTIONS,p=u.includes(r.show),d=!!n.measureTitleText&&c.includes(r.show),f=n.includeDimensionAxis&&u.includes(i.show),m=n.includeDimensionAxis&&!!n.dimensionTitleText&&c.includes(i.show),h=n.gridlines&&!(!n.gridlines.auto&&0===n.gridlines.spacing),g=n.refLines&&n.refLines.some(e=>e.show),y=[];if(p&&function(e,t,n,r){let i={scale:"measure",settings:t.axisLabelStyle||{},forceBounds:r&&!r.autoMinMax&&r.showBounds};i=C(i,pr.LAYOUTSETTINGS.measureAxis);const o=mr(t,n);e.addComponent(`${n}-axis`,i,o)}(e,n,s,r),d&&function(e,t,n){let r={text:t.measureTitleText,style:t.axisTitleStyle||{}};r=C(r,pr.LAYOUTSETTINGS.measureAxisTitle);const i=function(e,t){return mr(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,s),function(e,t,n,r){let i=t.measureScaleSettings;const o={isRtl:t.isRtl,source:t.measureSource,orientation:n,measureAxisProperties:r};r&&r.spacing>0&&(i=C(!0,i||{},{component:{ticks:{distance:100*r.spacing}}}));e.addScale("measure-scale",i,o)}(e,n,o,r),f&&function(e,t,n){let r={scale:"dimension",settings:t.axisLabelStyle||{}};r=C(r,pr.LAYOUTSETTINGS.dimensionAxis);const i=hr(t,n);C(!0,r,t.dimensionAxisSettings||{}),e.addComponent(`${n}-axis`,r,i)}(e,n,l),m&&function(e,t,n){let r={text:t.dimensionTitleText,style:t.axisTitleStyle||{}};r=C(r,pr.LAYOUTSETTINGS.dimensionAxisTitle);const i=function(e,t){return hr(e,t)}(t,n);e.addComponent(`${n}-axis-title`,r,i)}(e,n,l),n.includeDimensionAxis&&function(e,t,n){const r={isRtl:t.isRtl,source:t.dimensionSource,orientation:n===pr.HORIZONTAL?pr.VERTICAL:pr.HORIZONTAL};e.addScale("dimension-scale",t.dimensionScaleSettings,r)}(e,n,o),h&&function(e,t,n){let r={ticks:{show:!0},minorTicks:{show:!t.auto&&!t.auto&&3===t.spacing}};r=C(r,pr.LAYOUTSETTINGS.gridLines),r[n]={scale:"measure"},e.addComponent("grid-line",r)}(e,n.gridlines,s),n.hasNavigation&&function(e,t,n,r){const i=e.getSettings();i.scroll={dimension:{viewSize:n.scrollSettings&&n.scrollSettings.viewSize||0,max:n.scrollSettings&&n.scrollSettings.max||0}};const o={isRtl:n.isRtl,chartID:n.chartID,isHorizontal:!r},a=C({},pr.LAYOUTSETTINGS.scrollBar);e.addComponent("scrollbar",a,o),fr(t,function(e){function t(t,n){if(!n||!e())return!1;const r={x:n.center.x-n.deltaX,y:n.center.y-n.deltaY};return this.chart.componentsFromPoint(r).some(e=>e.settings.key===er)}const n={type:"Tap",options:{enable:t},events:{tap(e){this.chart.component(er).emit("tap",e)}}},r={type:"Pan",options:{enable:t},events:{panstart(e){this.chart.component(er).emit("panStart",e)},pan(e){this.chart.component(er).emit("panMove",e)},panend(e){this.chart.component(er).emit("panEnd",e)},pancancel(e){this.chart.component(er).emit("panCancel",e)}}};return[n,r]}(n.isNavigationEnabledFn))}(e,y,n,a),g&&function(e,t,n,r){const i=rr.getAxisDock(n,r.dock,t.isRtl);let o={key:"ref-line",style:{oob:{show:!1}},lines:{x:[],y:[]}};o=C(o,pr.LAYOUTSETTINGS.refLines);let a={key:`ref-line-labels-${Xn()}`,require:["renderer","chart"],dock:rr.getOppositeAxisDock(n,r.dock,t.isRtl),preferredSize(){if("x"===n)return 26;const t=this.renderer.measureText,r=this.chart.formatter({data:e.settings.scales.measure.data}),i=a.lines.y.map(e=>{const n=!1!==e.label.showValue?`(${r(e.value)})`:"",i=`${e.label.text} ${n}`,o=e.label.text&&n?` ${n}`:n;return{wanted:t({text:i,fontSize:e.fontSize,fontFamily:e.fontFamily}).width,required:t({text:o,fontSize:e.fontSize,fontFamily:e.fontFamily}).width}}),o=i[0];for(let e=1;e<i.length;e++)i[e].wanted>o.wanted&&(o.wanted=i[e].wanted),i[e].required>o.required&&(o.required=i[e].required);const s=12;return o.required+s>100?o.required+s:Math.min(o.wanted+s,100)},lines:{x:[],y:[]}};a=C(a,pr.LAYOUTSETTINGS.refLinesLabels),t.refLines.forEach(r=>{if(!r.show)return;const s=r.refLineExpr&&r.refLineExpr.value,l=C(!0,{},t,{paletteColor:r.paletteColor,style:r.style,chartID:e.options.chartID}),u=cr.lineSettings({scale:"measure",dir:n,value:s},l);o.lines[n].push(u);const c=cr.lineLabelSettings({scale:"measure",value:s,label:{text:!1!==r.showLabel?r.label:"",showValue:!1!==r.showValue}},l);"x"===n?c.label.vAlign="near"===i?1:0:c.label.align="near"===i?0:1,a.lines[n].push(c)}),e.addComponent("ref-line",o,{}),e.addComponent("ref-line",a,{})}(e,n,s,r),n.enableLasso&&n.selectionsEnabled){!function(e,t){const n={brushKey:t.brushKey,brushComponents:t.brushComponents,brushData:t.brushData};e.addComponent("lasso",pr.LAYOUTSETTINGS.lasso,n)}(e,n.lasso||{})}if(n.enableDimRange&&n.includeDimensionAxis&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeDim"};o=C(o,pr.LAYOUTSETTINGS.rangeDim);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,isHorizontal:!n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.dimRange||{},a,hr(n,l).dock,n.isRtl)}if(n.enableMeasureRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMeasure"};o=C(o,pr.LAYOUTSETTINGS.rangeMeasure);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushArea:t.brushArea,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:n,dock:r,isRtl:i};e.addComponent("range",o,a)}(e,n.measureRange||{},a,mr(n,s).dock,n.isRtl)}if(n.enableAreaRange&&n.selectionsEnabled){!function(e,t,n,r,i){let o={key:"rangeMinor"};o=C(o,pr.LAYOUTSETTINGS.rangeMinor);const a={brushKey:t.brushKey,brushAxis:t.brushAxis,brushData:t.brushData,brushArea:t.brushArea,brushComponents:t.brushComponents,brushScale:t.brushScale,multiple:t.multiple,isHorizontal:"measure"===t.brushScale?n:!n,dock:r,isRtl:i,chartInstance:t.chartInstance};e.addComponent("range-area",o,a)}(e,n.areaRange||{},a,hr(n,l).dock,n.isRtl)}n.brushActions&&fr(y,n.brushActions),y.length&&function(e,t){e.addInteraction({},{gestures:t})}(e,y)}function fr(e,t){t.forEach(t=>{e.push(t)})}function mr(e,t){return{dock:e.measureAxisProperties&&e.measureAxisProperties.dock,direction:t,isRtl:e.isRtl}}function hr(e,t){return{dock:e.dimensionAxisProperties&&e.dimensionAxisProperties.dock,direction:t,isRtl:e.isRtl}}function gr(e,t){const n=t||{},r=!n.orientation||"horizontal"===n.orientation,i=!!n.isRtl,o={name:n.name||"scale",component:{invert:r&&i,minorTicks:{count:1},range:n.range||void 0,domain:n.domain||void 0,trackBy:n.trackBy||"id"}};return C(!0,{},o,e||{})}function yr(e){var t;if(null!=e&&null!==(t=e.isEnabled)&&void 0!==t&&t.call(e,"IM_5791_SVG_LABEL_RENDERING"))return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function br(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.line.major","color"),s=t.theme.getStyle(n,"axis.title","fontSize"),l=t.theme.getStyle(n,"axis.title","color"),u=t.theme.getStyle(n,"axis.label.name","color"),c=t.theme.getStyle(n,"axis.label.name","fontSize"),p=t.theme.getStyle(n,"axis.title","fontFamily"),d=t.theme.getStyle(n,"axis.label.name","fontFamily"),f={key:"axis",type:"axis",renderer:yr(t.flags),dock:rr.getAxisDock(i,r,o),brush:{trigger:[],consume:[]},settings:{title:{fontSize:s,fontFamily:p,fill:l},line:{show:!0,strokeWidth:1,stroke:a},labels:{fill:u,fontSize:c,fontFamily:d,tiltAngle:o?-40:40,maxEdgeBleed:75,maxSize:150,mode:"auto"},ticks:{stroke:a},minorTicks:{stroke:a}}},m=C(!0,{},f,e||{});return m.brush.consume.forEach(e=>{e.style.active.strokeWidth=0}),m}function vr(e,t){const n=t&&t.chartID,r=t&&t.dock,i=t&&t.direction,o=t&&t.isRtl,a=t.theme.getStyle(n,"axis.title","fontSize"),s=t.theme.getStyle(n,"axis.title","color"),l=t.theme.getStyle(n,"axis.title","fontFamily"),u={key:"text",type:"text",dock:rr.getAxisDock(i,r,o)||"bottom",displayOrder:0,style:{text:{fontSize:a,fontFamily:l,fill:s}}};return C(!0,{},u,e||{})}gr.measureScale=function(e,t){let n=(t||{}).source||[];"string"==typeof n&&(n=[n]);const r={name:"measure",component:{expand:.1,data:{fields:n.map(e=>({field:e}))}}},i=t&&t.measureAxisProperties;i&&!i.autoMinMax&&(["min","minMax"].includes(i.minMax)&&(r.component.min=i.min),["max","minMax"].includes(i.minMax)&&(r.component.max=i.max));const o=gr(C(!0,r,e||{}),t);return!(e&&e.component&&void 0!==e.component.invert)&&t&&"vertical"===t.orientation&&(o.component.invert=!o.component.invert),o},gr.dimensionScale=function(e,t){const n={name:"dimension",component:{trackBy:"id",type:"band",data:{extract:{field:t&&t.source||"",props:{label:e=>e.qText||""}}},label:e=>e.datum.label.value}};return gr(C(!0,n,e||{}),t)},br.xAxis=function(e,t){return br(C(!0,{key:"x-axis",scale:"x"},e||{}),t)},br.yAxis=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis",scale:"y",dock:rr.getYAxisDock(n,r)};return br(C(!0,i,e||{}),t)},vr.xAxisTitle=function(e,t){return vr(C(!0,{key:"x-axis-title"},e||{}),t)},vr.yAxisTitle=function(e,t){const n=t&&t.dock,r=t&&t.isRtl,i={key:"y-axis-title",dock:rr.getYAxisDock(n,r)||"left"};return vr(C(!0,i,e||{}),t)};var qr={getBublesAlign:function(e,t,n){let r=e&&"far"!==t||!e&&"far"===t;return!e&&n&&(r=!r),r?"start":"end"},getDock:function(e,t){const n=[];let r;return e&&n.push(`@${e}`),t&&n.push(`@${t}`),n.length&&(r=n.join(",")),r}};const xr={SPARK:{width:0,height:0},XSMALL:{width:150,height:75},SMALL:{width:300,height:150},MEDIUM:{width:400,height:220},FULL:{width:550,height:450}};function Dr(){return xr}function Sr(e){const t=e.data.end;return e.dataset(t.source.key).field(t.source.field).formatter()(t.value)}Dr.getLayoutModeKeys=function(){const e=[];let t;for(t in xr)e.push(t);return e};const Mr={left:"left",right:"right",up:"top",down:"bottom"};function Er(e,t,n){switch(e){case"scale":return gr(t,n);case"measure-scale":return gr.measureScale(t,n);case"dimension-scale":return gr.dimensionScale(t,n);case"axis":return br(t,n);case"box-marker":return function(e){return C(!0,{},{key:"box-marker",type:"box-marker",settings:{minor:{scale:"x"},orientation:"horizontal"},brush:{trigger:[],consume:[]}},e||{})}(t);case"point-marker":return function(e){return C(!0,{},{key:"point-marker",type:"point-marker",settings:{},brush:{trigger:[],consume:[]}},e||{})}(t);case"scrollbar":return function(e,t){const n=t&&t.isRtl,r=t&&t.chartID,i=t&&t.isHorizontal,o={key:"scrollbar",type:"scrollbar",scroll:"dimension",dock:i?"bottom":n?"left":"right",settings:{backgroundColor:t.theme.getStyle(r,"","backgroundColor"),invert:n&&i}};return C(!0,{},o,e||{})}(t,n);case"text":return vr(t,n);case"lasso":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushComponents?t.brushComponents:[],i=t&&t.brushData?t.brushData:["elemNo"],o={type:"brush-lasso",key:"lasso",displayOrder:99,settings:{brush:{components:[]},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"rgba(102,102,102,1)",strokeWidth:2,opacity:1,strokeDasharray:null},startPoint:{r:10,fill:"rgba(0, 152, 69, 1)",strokeWidth:0,opacity:1}}};return r.forEach(e=>{o.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:i})}),C(!0,{},o,e||{})}(t,n);case"range":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushArea,o=t&&t.brushScale,a=t&&t.isHorizontal,s=t&&t.dock,l=t&&t.isRtl,u={type:"brush-range",key:"range",displayOrder:99,dock:qr.getDock(r,i),settings:{brush:n,fill:"rgba(0, 0, 0, 0)",scale:o,multiple:!t||!1!==t.multiple||t.multiple,direction:a?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:qr.getBublesAlign(a,s,l)}}};return C(!0,{},u,e||{})}(t,n);case"range-area":return function(e,t){const n=t&&t.brushKey,r=t&&t.brushAxis,i=t&&t.brushComponents?t.brushComponents:[],o=t&&t.brushData?t.brushData:["elemNo"],a=t&&t.brushArea,s=t&&t.isHorizontal,l=t&&t.dock,u=t&&t.isRtl,c=t&&t.chartInstance;let p=!0;const d={type:"brush-area-dir",key:"area",displayOrder:99,dock:qr.getDock(r,a),settings:{brush:{components:[]},direction:s?"horizontal":"vertical",target:{component:r,fill:"rgba( 82, 204, 82, 0.2 )",fillActive:"rgba(82, 204, 82, 0.4)"},bubbles:{align:qr.getBublesAlign(s,l,u),label:e=>p?(p=!1,c.dataset(e.binStart.source.key).field(e.binStart.source.field).formatter()(e.binStart.value)):(p=!0,c.dataset(e.binEnd.source.key).field(e.binEnd.source.field).formatter()(e.binEnd.value))},multiple:!t||!1!==t.multiple||t.multiple}};return i.forEach(e=>{d.settings.brush.components.push({contexts:n?[n]:void 0,key:e,data:o,action:"add"})}),C(!0,{},d,e||{})}(t,n);case"categorical-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t&&t.dock||"auto";const o=t&&t.show;"auto"===i&&(i=t.chartHeight/t.chartWidth<1?r?"left":"right":"bottom");const a=t.theme.getStyle(n,"legend.title","color"),s=t.theme.getStyle(n,"legend.title","fontSize"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.title","fontFamily"),p=t.theme.getStyle(n,"legend.label","fontFamily"),d={key:"legend",type:"legend-cat",renderer:yr(t.flags),dock:i,show:o,scale:{type:"color"},settings:{title:{anchor:"middle"},layout:{direction:r?"rtl":"ltr",size:"top"===i||"bottom"===i?2:1,vertical:"top"===i||"bottom"===i?16:8},navigation:{button:{class:{"lui-fade-button":!0},content:(e,t)=>e("span",{style:{pointerEvents:"none"},class:["lui-button__icon","lui-icon",`lui-icon--triangle-${Mr[t.direction]}`].join(" ")})}}},style:{item:{label:{fontSize:u,fontFamily:p,fill:l,lineHeight:1,wordBreak:"break-word"},margin:{top:5,left:10,right:10,bottom:10},shape:{type:t.type?t.type:"square",size:3*parseInt(u,10)/4}},title:{show:t.showTitle,fontSize:s,fontFamily:c,fill:a}}};return C(!0,{},d,e)}(t,n);case"sequential-legend":return function(e,t){const n=t&&t.chartID,r=t&&t.isRtl;let i=t.dock||"auto";"auto"===i&&(i=t.chartHeight<t.chartWidth?r?"left":"right":"bottom");const o=t.theme.getStyle(n,"legend.title","color"),a=t.theme.getStyle(n,"legend.title","fontSize"),s=t.theme.getStyle(n,"legend.title","fontFamily"),l=t.theme.getStyle(n,"legend.label","color"),u=t.theme.getStyle(n,"legend.label","fontSize"),c=t.theme.getStyle(n,"legend.label","fontFamily");function p(e){switch(e){case"left":return 0;case"right":return 1;default:return.5}}const d={key:"seqlegend",type:"legend-seq",dock:i,displayOrder:200,minimumLayoutMode:"MEDIUM",prioOrder:0,settings:{align:p(r?"right":"left"),major:{invert:"left"===i||"right"===i||r},title:{show:t.showTitle,fontSize:a,fontFamily:s,fill:o},tick:{fill:l,fontSize:u,fontFamily:c}}};return C(!0,{},d,e)}(t,n);case"x-axis":return br.xAxis(t,n);case"y-axis":return br.yAxis(t,n);case"x-axis-title":return vr.xAxisTitle(t,n);case"y-axis-title":return vr.yAxisTitle(t,n);case"grid-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"grid.line.major","color");return C(!0,{},{displayOrder:-1,key:"grid-line",type:"grid-line",x:null,y:null,ticks:{stroke:r},minorTicks:{stroke:r}},e||{})}(t,n);case"interaction":return function(e,t){const n=t&&t.gestures||[];return C(!0,{},{type:"hammer",key:"hammered",gestures:n},e||{})}(t,n);case"ref-line":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"referenceLine.outOfBounds","color"),i=t.theme.getStyle(n,"referenceLine.outOfBounds","backgroundColor");return C(!0,{},{key:"ref-line",type:"ref-line",dock:"center",prioOrder:-1,lines:{x:[],y:[]},style:{oob:{width:7,fill:i,text:{fill:r},padding:{x:7,y:5}}}},e||{})}(t,n);case"event-area":return function(e){return C(!0,{},{type:"event-area",key:"event-area"},e||{})}(t);case"labels":return function(e,t){const n=t&&t.chartID,r=t.theme.getStyle(n,"label.value","color"),i=t.theme.getStyle(n,"label.value","fontSize"),o=t.theme.getStyle(n,"label.value","fontFamily"),a={key:"labels",type:"labels",renderer:yr(t.flags),displayOrder:1,settings:{sources:[{component:"box-marker",selector:"rect",strategy:{type:"bar",settings:{direction:"up",fontFamily:o,fontSize:parseFloat(i),align:.5,labels:[{placements:[{position:"outside",fill:r,justify:0},{position:"inside",fill:e&&e.settings.sources[0].strategy.settings.labels[0].placements[1].fill,justify:1}],label:Sr}]}}}]}};return C(!0,{},a,e||{})}(t,n);default:return}}function Cr(e){this.options=e||{},this.settings={dockLayout:{layoutModes:Dr()},components:[],scales:{}}}Cr.prototype.addComponent=function(e,t,n){const r=Er(e,t,C(!0,{},this.options,n||{}));return this.settings.components.push(r),r},Cr.prototype.addInteraction=function(e,t){const n=Er("interaction",e,C(!0,{},this.options,t||{}));return this.settings.interactions||(this.settings.interactions=[]),this.settings.interactions.push(n),n},Cr.prototype.addScale=function(e,t,n){const r=Er(e,t,C(!0,{},this.options,n||{}));this.settings.scales[r.name]=r.component},Cr.prototype.getSettings=function(){return this.settings},Cr.prototype.getComponent=function(e){return this.settings.components.filter(t=>t.key===e)[0]},Cr.prototype.addPreset=function(e,t){!function(e,t,n){if("dimension-measure-chart"!==e)throw Error("There is no chart preset with that type");dr(t,n)}(e,this,t)},Cr.validateComponentKeys=function(e){const t={};return e.map(e=>{const n=e.key;return n?t[n]?`Duplicate key for component ${e.type}`:(t[n]=!0,null):`Missing key for component ${e.type}`}).filter(e=>!!e)},Cr.create=function(e){return new Cr(e)},Cr.createComponent=Er;const wr={CENTER:0,BOTTOM:1};var Ar={DISCLAIMERS:[{label:"NoDataExist",alignment:wr.CENTER,default:!0},{label:"RequireNumericDimension",alignment:wr.CENTER,default:!1},{label:"OnlyNanData",alignment:wr.CENTER,default:!0},{label:"OnlyNegativeOrZeroValues",alignment:wr.CENTER,default:!1},{label:"LimitedData",alignment:wr.BOTTOM,default:!1},{label:"OnlyNanColor",alignment:wr.BOTTOM,default:!1},{label:"NegativeOrZeroValues",alignment:wr.BOTTOM,default:!1},{label:"DataRangeIncludingZero",alignment:wr.BOTTOM,default:!1}],ALIGNMENT:wr};const Ir={getNoDataExistAttribute:e=>e.qSize.qcy*e.qSize.qcx===0,getLimitedDataAttribute(e,t){let n,r=!1;var i;return e?void 0!==t.explicitLimitedData?r=!0===t.explicitLimitedData:e.qDataPages&&e.qDataPages[0]?r=!t.paging&&e.qSize.qcy>e.qDataPages[0].qMatrix.length:(i=e.qStackedDataPages)&&i[0]&&i[0].qData[0]&&i[0].qData[0].qSubNodes&&(n=t.maxNbrOfDimensions?t.maxNbrOfDimensions:2,r=e.qDimensionInfo.length>=n?e.qStackedDataPages[0].qData[0].qSubNodes.some(e=>e.qDown>0):e.qStackedDataPages[0].qData[0].qSubNodes.length<e.qStackedDataPages[0].qArea.qHeight):r=!0===t.explicitLimitedData,r},getNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.some(e=>e.qMin<=0),getOnlyNegativeOrZeroValuesAttribute:(e,t)=>!t.supportNegative&&e.qMeasureInfo.every(e=>e.qMax<=0&&e.qMax>=e.qMin)||0===e.qSize.qcy,getOnlyNanDataAttribute:(e,t)=>void 0!==t.explicitOnlyNanData?t.explicitOnlyNanData:e.qMeasureInfo.every(e=>e.qMax<e.qMin||"NaN"===e.qMax),getDataRangeIncludingZeroAttribute:(e,t)=>!t.supportRangeOverZero&&function(e,t){const n=t.length;let r,i,o,a,s;for(e&&(i=!(e.autoMinMax||"min"!==e.minMax&&"minMax"!==e.minMax||null===e.min||Number.isNaN(+e.min)),o=!(e.autoMinMax||"max"!==e.minMax&&"minMax"!==e.minMax||null===e.max||Number.isNaN(+e.max))),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=0;r<n;r++)if(a=Math.min(a,t[r].qMin),s=Math.max(s,t[r].qMax),a<=0&&s>=0)return!0;return a=i?e.min:a,s=o?e.max:s,a<=0&&s>=0}(e.measureAxis,e.qHyperCube.qMeasureInfo),applyAttributes(e,t){const n=e||{},r={};return n.supportNegative=void 0===n.supportNegative||n.supportNegative,n.supportRangeOverZero=void 0===n.supportRangeOverZero||n.supportRangeOverZero,Ar.DISCLAIMERS.forEach(e=>{r[e.label]=!1}),t&&t.qHyperCube?(r.NoDataExist=this.getNoDataExistAttribute(t.qHyperCube),r.NoDataExist?r:(r.RequireNumericDimension=n.explicitRequireNumericDimension,r.RequireNumericDimension||(r.LimitedData=this.getLimitedDataAttribute(t.qHyperCube,n),r.NegativeOrZeroValues=this.getNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNegativeOrZeroValues=this.getOnlyNegativeOrZeroValuesAttribute(t.qHyperCube,n),r.OnlyNanData=this.getOnlyNanDataAttribute(t.qHyperCube,n),r.DataRangeIncludingZero=this.getDataRangeIncludingZeroAttribute(t,n)),r)):r}};function Or(e,t,n){this.disclaimersConfig=e,this.dataAttributes=t,this.supportedDisclaimers=n}function kr(e,t){return e&&t&&t[e]}function Nr(e){this.environment=e,this.clear()}Or.prototype.isValidAndSupported=function(e,t){return kr(e.label,this.dataAttributes)&&(e.default||kr(e.label,this.supportedDisclaimers))&&void 0!==t&&e.alignment===t},Or.prototype.isAnyValidDisclaimer=function(e){let t=!1;const n=this;return this.disclaimersConfig.forEach(r=>{n.isValidAndSupported(r,e)&&(t=!0)}),t},Or.prototype.getMessage=function(e,t){let n="";const r=this;return t&&this.disclaimersConfig.forEach(i=>{r.isValidAndSupported(i,e)&&(n+=`${t.get(`Object.Disclaimer.${i.label}`)} `)}),n},Nr.ERRORS={SET:"Calling Disclaimer.set() without attributes",DISPLAY:"Calling Disclaimer.display() before attributes are applied"},Nr._applyDefaultSupport=function(e,t){let n=e;return n||(n={}),t.forEach(e=>{void 0===n[e.label]&&(n[e.label]=e.default)}),n},Nr.prototype.getComponentSettings=function(){var e;const{translator:t}=this.environment,n=C(!0,{},this.vizAttributes.supportedDisclaimers),r=new Or(Ar.DISCLAIMERS,this.dataAttributes,n);let i,o;if(r.isAnyValidDisclaimer(Ar.ALIGNMENT.CENTER))i=r.getMessage(Ar.ALIGNMENT.CENTER,t),o="center";else{if(!r.isAnyValidDisclaimer(Ar.ALIGNMENT.BOTTOM))return;i=r.getMessage(Ar.ALIGNMENT.BOTTOM,t),o="bottom"}return{key:"disclaimer",type:"disclaimer",layout:{displayOrder:1e3,dock:o},settings:{label:i,rtl:"rtl"===(null===(e=this.environment)||void 0===e||null===(e=e.options)||void 0===e?void 0:e.direction)}}},Nr.prototype.set=function(e){if(this.clear(),!e)throw new Error(Nr.ERRORS.SET);this.vizAttributes=e,this.dataAttributes=Ir.applyAttributes(this.vizAttributes.options,this.vizAttributes.data)},Nr.prototype.clear=function(){this.vizAttributes=null,this.dataAttributes=null};const Tr=Zn.extend({init(e,t,n,r,i){this.$element=t,this.environment=n,this.backendApi=r,this._selectionsApi=i,this._on=!1,this._disclaimer=new Nr(n),this._dataPaths=["qHyperCube"];const o=this;this.picassoElement=t[0],this.picassoElement.className+=" picasso-chart",this.chartInstance=e.chart({element:this.picassoElement,settings:{components:[Cr.createComponent("event-area",{mounted(e){o.dataAreaElem=e}})]}})},updateEnvironment(e){this.environment=e},isRtl(){var e;return"rtl"===(null===(e=this.environment.options)||void 0===e?void 0:e.direction)},setDataPaths(e){this._dataPaths=e},getData:(e,t,n)=>function(e,t,n){let r,i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};if(n){const e=n.width||t.qSize.qcx,r=Math.floor(1e4/e);i={qTop:n.top||0,qLeft:n.left||0,qWidth:e,qHeight:n.height?Math.min(n.height,r):r}}else i={qTop:0,qLeft:0,qWidth:t.qSize.qcx,qHeight:1e4/t.qSize.qcx};r="K"===t.qMode?"qStackedDataPages":"qDataPages";return e.getData([i],null,t).then(e=>{t[r]=e})}(e,t,n),hasValidData:()=>!0,paint(){if(this.hasValidData()){var e;this._disclaimer.set(this.getDisclaimerAttributes(this.layout));const t=this._disclaimer.getComponentSettings(),n="center"===(null==t||null===(e=t.layout)||void 0===e?void 0:e.dock),r=this.createChartSettings(this.layout);n?r.components=[t]:t&&r.components.push(t),Cr.validateComponentKeys(r.components).forEach(e=>{console.error(e)}),this.updateChart(this.layout,r),this._painted=!0}return Promise.resolve()},resize(){if(this.layout)return this.paint()},createChartSettings(){throw new Error('Subclass must implement "createChartSettings" function')},addSnapshotChartSettings(e,t){const{freeResize:n}=this.environment.options;!n&&t.snapshotData&&(e.dockLayout.logicalSize={width:t.snapshotData.content.size.w,height:t.snapshotData.content.size.h,preserveAspectRatio:!0})},updateData(e){return this._destroyed?Promise.reject():(this.layout=C(!0,{},e),this.layout.permissions=e.permissions,Promise.resolve())},updateChart(e,t,n){var r,i;const o=null!==(r=null===(i=this.environment.appLayout)||void 0===i?void 0:i.qLocaleInfo)&&void 0!==r?r:{},a=this._dataPaths.map(t=>({type:"q",key:t,config:{localeInfo:o},data:Kn(e,t.replace(/\//g,"."))}));this.colorService&&a.push(...this.colorService.getData()),this.chartInstance.update({data:a,settings:t,partialData:n});this.picassoElement.setAttribute("data-state",2)},destroy(){this._destroyed=!0,this.off(),this.chartInstance.destroy()},getViewState:()=>({}),isLassoDisabled:()=>!0,setSnapshotData(e){e.snapshotData||(e.snapshotData={}),e.snapshotData.content={chartData:{},size:{w:this.$element.width(),h:this.$element.height()}}},getDisclaimerAttributes:e=>({data:e})});var Lr,Pr={exports:{}};var Rr=(Lr||(Lr=1,Pr.exports=function(){function e(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){e(n,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function r(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function i(e){var t=r(e,"string");return"symbol"==typeof t?t:t+""}var o=Object.prototype.hasOwnProperty,a=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,u=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===a.call(e)},c=function(e){if(!e||"[object Object]"!==a.call(e))return!1;var t,n=o.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&o.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||o.call(e,t)},p=function(e,t){s&&"__proto__"===t.name?s(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},d=function(e,t){if("__proto__"===t){if(!o.call(e,t))return;if(l)return l(e,t).value}return e[t]},f=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,f=arguments.length,m=!1;for("boolean"==typeof s&&(m=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<f;++l)if(null!=(t=arguments[l]))for(n in t)r=d(s,n),s!==(i=d(t,n))&&(m&&i&&(c(i)||(o=u(i)))?(o?(o=!1,a=r&&u(r)?r:[]):a=r&&c(r)?r:{},p(s,{name:n,newValue:e(m,a,i)})):void 0!==i&&p(s,{name:n,newValue:i}));return s};function m(e,t,n,r){if(!e)return-1;const i=n.cache,o=e.origin?e.origin():null;o&&(e=o);let a=i.fields.indexOf(e),s=-1,l=-1;if(-1===a)for(let t=0;t<i.wrappedFields.length;t++)if(l=i.wrappedFields[t].attrDims.map(e=>e.instance).indexOf(e),s=i.wrappedFields[t].attrExps.map(e=>e.instance).indexOf(e),-1!==l||-1!==s){a=t;break}if(Array.isArray(r)&&r.some((e,t)=>e!==t)){const e=r.indexOf(a);-1!==e&&(a=e)}return a-=t.qArea.qLeft,a<0||a>=t.qArea.qWidth?-1:l>=0?e=>e[a].qAttrDims.qValues[l]:s>=0?e=>e[a].qAttrExps.qValues[s]:e=>e[a]}function h(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function g(e){let{cache:t,f:n,mainCell:r,p:i,page:o,rowIdx:a,row:s,sourceKey:l,target:u,targetProp:c,columnOrder:p}=e,d=r;if(i.field&&i.field!==n){const e=m(i.field,o,{cache:t},p);if(-1===e)return;d=f({qRow:a},e(s))}u[c]=h(i,d,{key:l})}function y(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let e=0;e<i.length;e++)if(void 0!==i[e].field){const a=t.raw(),s=t.key(),l="object"==typeof i[e].field?i[e].field:t.field(i[e].field),{props:u,main:c}=r.normalizeConfig(i[e],t),p=Object.keys(u),d=!!i[e].trackBy,y=typeof i[e].trackBy,b={},v=[],q=[];for(let t=0;t<a.qDataPages.length;t++){const o=m(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let m=0;m<a.qDataPages[t].qMatrix.length;m++){const x=a.qDataPages[t].qArea.qTop+m,D=f({qRow:x},o(a.qDataPages[t].qMatrix[m])),S=h(c,D,{key:s});if(!c.filter||c.filter(D)){for(let e=0;e<p.length;e++){const r=u[p[e]];let i=r.fields||[r];r.fields&&(S[p[e]]=[]);for(let o=0;o<i.length;o++)g({cache:n,f:l,mainCell:D,p:i[o],prop:p[e],page:a.qDataPages[t],rowIdx:x,row:a.qDataPages[t].qMatrix[m],sourceKey:s,target:r.fields?S[p[e]]:S,targetProp:r.fields?o:p[e],columnOrder:a.qColumnOrder});if(r.fields){const t=S[p[e]].map(e=>e.value),n=S[p[e]].map(e=>e.label);S[p[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(S[p[e]].value)}}}d&&r.track({cfg:i[e],itemData:D,obj:S,target:v,tracker:b,trackType:y}),q.push(S)}}}const x=d?r.collect(v,{main:c,propsArr:p,props:u}):q;o=[...o,...x]}return o}function b(e){var t=0,n=e.children,r=n&&n.length;if(r)for(;--r>=0;)t+=n[r].value;else t=1;e.value=t}function v(){return this.eachAfter(b)}function q(e,t){let n=-1;for(const r of this)e.call(t,r,++n,this);return this}function x(e,t){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(e.call(t,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this}function D(e,t){for(var n,r,i,o=this,a=[o],s=[],l=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)e.call(t,o,++l,this);return this}function S(e,t){let n=-1;for(const r of this)if(e.call(t,r,++n,this))return r}function M(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function E(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function C(e){for(var t=this,n=w(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function w(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function A(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function I(){return Array.from(this)}function O(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function N(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*T(){var e,t,n,r,i=this,o=[i];do{for(e=o.reverse(),o=[];i=e.pop();)if(yield i,t=i.children)for(n=0,r=t.length;n<r;++n)o.push(t[n])}while(o.length)}function L(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=F)):void 0===t&&(t=R);for(var n,r,i,o,a,s=new j(e),l=[s];n=l.pop();)if((i=t(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)l.push(r=i[o]=new j(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(_)}function P(){return L(this).eachBefore(H)}function R(e){return e.children}function F(e){return Array.isArray(e)?e[1]:null}function H(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function _(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function j(e){this.data=e,this.depth=this.height=0,this.parent=null}function V(e){return null==e?null:z(e)}function z(e){if("function"!=typeof e)throw new Error;return e}j.prototype=L.prototype={constructor:j,count:v,each:q,eachAfter:D,eachBefore:x,find:S,sum:M,sort:E,path:C,ancestors:A,descendants:I,leaves:O,links:N,copy:P,[Symbol.iterator]:T};var B={depth:-1},$={},U={};function K(e){return e.id}function W(e){return e.parentId}function Y(){var e,t=K,n=W;function r(r){var i,o,a,s,l,u,c,p,d=Array.from(r),f=t,m=n,h=new Map;if(null!=e){const t=d.map((t,n)=>G(e(t,n,r))),n=t.map(J),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(J(e)),d.push(U));f=(e,n)=>t[n],m=(e,t)=>n[t]}for(a=0,i=d.length;a<i;++a)o=d[a],u=d[a]=new j(o),null!=(c=f(o,a,r))&&(c+="")&&(p=u.id=c,h.set(p,h.has(p)?$:u)),null!=(c=m(o,a,r))&&(c+="")&&(u.parent=c);for(a=0;a<i;++a)if(c=(u=d[a]).parent){if(!(l=h.get(c)))throw new Error("missing: "+c);if(l===$)throw new Error("ambiguous: "+c);l.children?l.children.push(u):l.children=[u],u.parent=l}else{if(s)throw new Error("multiple roots");s=u}if(!s)throw new Error("no root");if(null!=e){for(;s.data===U&&1===s.children.length;)s=s.children[0],--i;for(let e=d.length-1;e>=0&&(u=d[e]).data===U;--e)u.data=null}if(s.parent=B,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(_),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=V(e),r):t},r.parentId=function(e){return arguments.length?(n=V(e),r):n},r.path=function(t){return arguments.length?(e=V(t),r):e},r}function G(e){let t=(e=`${e}`).length;return Z(e,t-1)&&!Z(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}function J(e){let t=e.length;if(t<2)return"";for(;--t>1&&!Z(e,t););return e.slice(0,t)}function Z(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function Q(e,t){"/"===e.charAt(0)&&(e=e.substring(1));const n=e.split("/");let r,i=t;for(let e=0;e<n.length;e++){if("*"===n[e]&&Array.isArray(i)){const t=[];r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++){let n=Q(r,i[e]);Array.isArray(n)?t.push(...n):t.push(n)}return t}if(!n[e]&&Array.isArray(i)){const t=new Array(i.length);r=n.slice(e+1).join("/");for(let e=0;e<i.length;e++)t[e]=Q(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function X(e,t,n){let r=[];if(!e||!e.length)return r;if(t<=0){const t=n>=0?[e[n]]:e;r=[...r,...t]}else for(let i=0;i<e.length;i++)e[i].children&&e[i].children.length&&(r=[...r,...X(e[i].children,t-1,n)]);return r}function ee(e,t,n){if(e===t)return e=>e;if(e>t){const n=Math.max(0,Math.min(100,e-t));return e=>{let t=e;for(let e=0;e<n;++e)t=t.parent;return t}}if(t>e){const r=Math.max(0,Math.min(100,t-e));return e=>X(e.children,r-1,n)}return!1}function te(e,t){let{cache:n}=t;if("number"==typeof e)return n.fields[e];const r=n.allFields;if("function"==typeof e){for(let t=0;t<r.length;t++)if(e(r[t]))return r[t];return!1}if("string"==typeof e){for(let t=0;t<r.length;t++)if(r[t].key()===e||r[t].title()===e)return r[t]}else if(e&&-1!==r.indexOf(e))return e;throw Error("Field not found: ".concat(e))}const ne=/^qDimensionInfo(?:\/(\d+))?/,re=/^\/?qMeasureInfo\/(\d+)/,ie=/\/qAttrExprInfo\/(\d+)/,oe=/\/qAttrDimInfo\/(\d+)/;function ae(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}function se(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function le(e,t){let{cube:n}=t;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,u=-1,c=-1,p=r;const d=n.qEffectiveInterColumnSortOrder,f=se(n);return ne.test(p)&&(i=!0,o=+ne.exec(p)[1],p=r.replace(ne,"")),re.test(p)&&("K"===n.qMode?u=+re.exec(p)[1]:d&&-1!==d.indexOf(-1)?(u=+re.exec(p)[1],c=0):c=+re.exec(p)[1],p=p.replace(re,"")),p&&(oe.exec(p)?s=+oe.exec(p)[1]:ie.exec(p)&&(a=+ie.exec(p)[1])),l=i?"S"===n.qMode?f[o]:d?d.indexOf(o):o:d&&-1!==d.indexOf(-1)?d.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:u,measureIdx:c,attrDimIdx:s,attrIdx:a}}function ue(e,t){let n,r,i=ee(e.fieldDepth,t.fieldDepth,t.pseudoMeasureIndex);return n=t.measureIdx>=0?e=>e.data.qValues[t.measureIdx]:e=>e.data,t.attrDimIdx>=0?r=e=>{var n;return null==e||null===(n=e.qAttrDims)||void 0===n?void 0:n.qValues[t.attrDimIdx]}:t.attrIdx>=0&&(r=e=>{var n;return null==e||null===(n=e.qAttrExps)||void 0===n?void 0:n.qValues[t.attrIdx]}),{nodeFn:i,attrFn:r,valueFn:n}}function ce(e,t,n){let{key:r}=n;const i={value:"function"==typeof e.value?e.value(t):void 0!==e.value?e.value:t};return i.label="function"==typeof e.label?e.label(t):void 0!==e.label?String(e.label):String(i.value),e.field&&(i.source={key:r,field:e.field.key()}),i}function pe(e){let{propsArr:t,props:n,item:r,itemData:i,ret:o,sourceKey:a}=e;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let u,c;s.fields&&(u=[],c=[]);for(let n=0;n<l.length;n++){const p=l[n];let d,f,m,h,g,y;if("primitive"===p.type?(m=p.value,y=String(p.value)):("function"==typeof p.value&&(d=e=>p.value(e,r)),"function"==typeof p.label&&(f=e=>p.label(e,r)),p.accessor?(h=p.accessor(r),Array.isArray(h)?(g=h.map(p.valueAccessor),p.attrAccessor&&(g=g.map(p.attrAccessor)),d&&(m=g.map(d),d=null),f&&(y=g.map(f),f=null),m=p.reduce?p.reduce(m):m,y=p.reduceLabel?p.reduceLabel(y,m):String(m)):(m=p.attrAccessor?p.attrAccessor(p.valueAccessor(h)):p.valueAccessor(h),y=m)):(m=i,y=i)),s.fields){const e=d?d(m):m;u.push(e),c.push(f&&null!=y?f(y):null!=y?y:String(e))}else{const n=d?d(m):m;o[t[e]]={value:n,label:f?f(y):null!=y?y:String(n)},p.field&&(o[t[e]].source={field:p.field.key(),key:a})}}u&&(o[t[e]]={value:"function"==typeof s.value?s.value(u,r):u,label:"function"==typeof s.label?s.label(c,r):c})}}const de=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=Q(r,e);return o&&o[0]?(t.tree=L(o[0],n.children||(e=>e[i])),t.tree):null};function fe(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],r=ae(e),i=e.fields(),o=e.fields().filter(e=>"dimension"===e.type()).map(e=>r.indexOf(i.indexOf(e))),a=e.fields().filter(e=>"measure"===e.type()).map(e=>r.indexOf(i.indexOf(e))),s={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const r=t[e];let i="__root",u=!1;for(let e=0;e<o.length;e++){var l;const t=r[o[e]],a="".concat(i,"__").concat(null!==(l=t.qElemNumber)&&void 0!==l?l:t.qElemNo);s[a]||(s[a]=n({__id:a,__parent:i,qValues:[]},t),u=!0),i=a}if(u)for(let e=0;e<a.length;e++){const t=r[a[e]];s[i].qValues.push(t)}}const u=Object.keys(s).map(e=>s[e]);return Y().id(e=>e.__id).parentId(e=>e.__parent)(u)}const me=e=>{let{propsArr:t,props:n,cube:r,cache:i,itemDepthObject:o,f:a}=e;for(let e=0;e<t.length;e++){const i=n[t[e]],s=i.fields?i.fields:[i];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==a){const e=ue(o,le(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function he(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;const o=t.raw(),a=t.key(),s="S"===o.qMode?fe(t):de(o,r,e);if(!s)return null;const l=s.height,u=[];for(let a=0;a<=l;a++){let s=null;if(a>0)if("S"===o.qMode){let e=se(o)[a-1];s=r.fields[e]}else{let e=o.qEffectiveInterColumnSortOrder[a-1];a>o.qEffectiveInterColumnSortOrder.length&&(e=o.qDimensionInfo.length),s=r.fields[e]}const{props:l,main:c}=i.normalizeConfig(n(n({},e),{},{field:s?s.key():void 0}),t),p=Object.keys(l);u[a]={propsArr:p,props:l,main:c};const d=s?le(s,{cube:o}):{fieldDepth:0};me({propsArr:p,props:l,cube:o,cache:r,itemDepthObject:d,f:s})}const c=s.copy().descendants(),p=s.descendants();for(let e=0;e<p.length;e++){const t=u[p[e].depth].propsArr,n=u[p[e].depth].props,r=u[p[e].depth].main,i=c[e],o=i.data,s=ce(r,o,{key:a});pe({propsArr:t,props:n,item:i,itemData:o,ret:s,sourceKey:a}),p[e].data=s}return s}function ge(e,t,n,r){const i=Array.isArray(e)?e:[e];let o=[];for(let a=0;a<i.length;a++)if(void 0!==i[a].field){const s=t.raw(),l=t.key();if(!de(s,n,e))continue;const u="object"==typeof i[a].field?i[a].field:t.field(i[a].field),{props:c,main:p}=r.normalizeConfig(i[a],t),d=Object.keys(c),f=le(u,{cube:s}),{nodeFn:m,attrFn:h,valueFn:g}=ue({fieldDepth:0},f);me({propsArr:d,props:c,cube:s,cache:n,itemDepthObject:f,f:u});const y=!!i[a].trackBy,b=typeof i[a].trackBy,v={},q=[],x=m(n.tree),D=[];for(let e=0;e<x.length;e++){const t=x[e],n=h?h(g(t)):g(t);if(p.filter&&!p.filter(n))continue;const o=ce(p,n,{key:l});pe({propsArr:d,props:c,item:t,itemData:n,ret:o,sourceKey:l}),y&&r.track({cfg:i[a],itemData:n,obj:o,target:q,tracker:v,trackType:b}),D.push(o)}const S=y?r.collect(q,{main:p,propsArr:d,props:c}):D;o=[...o,...S]}return o}function ye(e,t){return e(t={exports:{}},t.exports),t.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==k||"undefined"!=typeof self&&self;var be=ye(function(e){var t;t=function(){return function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,u,c,p,d=e.length,f=e.search(/[0-9\-\+#]/),m=f>0?e.substring(0,f):"",h=e.split("").reverse().join(""),g=h.search(/[0-9\-\+#]/),y=d-g,b=e.substring(y,y+1),v=y+("."===b||","===b?1:0),q=g>0?e.substring(v,d):"";if(n=(t="-"===(e=e.substring(f,v)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(u=t.split("."))[1]||u[1]&&u[1].length<=s)&&(t=(+t).toFixed(s+1)),c=e[0].split(o),e[0]=c.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;u[0].length<e[0].length-a;)u[0]="0"+u[0];else 0===+u[0]&&(u[0]="");if((t=t.split("."))[0]=u[0],l=c[1]&&c[c.length-1].length){for(h="",y=(p=t[0]).length%l,d=p.length,v=0;v<d;v++)h+=p.charAt(v),!((v-y+1)%l)&&v<d-l&&(h+=o);t[0]=h}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),m+(n?"-":"")+r+q}},e.exports=t()});const ve=1e-15;function qe(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const xe={3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",24:"Y","-3":"m","-6":"μ","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},De=/%\)?$/,Se=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,Me=/^\(oct\)/i,Ee=/^\(dec\)/i,Ce=/^\(hex\)/i,we=/^\(bin\)/i,Ae=/^\(rom\)/i,Ie=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Oe=/#|0/g;function ke(e,t,n,r){return e=e.toString(t),n[1]===n[1].toUpperCase()&&(e=e.toUpperCase()),e.length-e.indexOf(".")>10&&(e=e.slice(0,e.indexOf(".")+11)),e.replace(".",r||".")}function Ne(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}function Te(e,t,n){let r;return Se.test(t)?e=ke(e,Number(/\d{2}/.exec(t)[0]),t,n):Me.test(t)?e=ke(e,8,t,n):Ee.test(t)?e=ke(e,10,t,n):Ce.test(t)?e=ke(e,16,t,n):we.test(t)?e=ke(e,2,t,n):Ae.test(t)&&(r="",e<0&&(r="-",e=-e),e=0===(e=Math.floor(e))?"0":e<=5e5?r+(e=Ne(e,t)):t+r+e.toExponential(0)),e}function Le(e,t,n){const r=qe(e);return n?r:new RegExp(r||"",t)}function Pe(e,t){return t&&(t=qe(t)),e&&(e=qe(e)),new RegExp("(?:[#0]+".concat(e,")?[#0]+(?:").concat(t,"[#0]+)?"))}function Re(e,t){if(!e||!e.qNumericalAbbreviation)return xe;const n={};return e.qNumericalAbbreviation.split(t).forEach(e=>{let t=e.split(":");2===t.length&&(n[t[0]]=t[1])}),n}function Fe(e,t,n,r){let i,o,a,s,l,u,c,p,d,f=e.pattern;r&&(e.abbreviate=!0),d=Pe(t,n),a=f.match(d),a=a?a[0]:"",s=a?f.substr(0,f.indexOf(a)):f,l=a?f.substring(f.indexOf(a)+a.length):"",a||(a=f?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),u=t,t=/,/.test(n)?"¤":",",u&&(a=a.replace(Le(u,"g"),t)),c=n,n=".",c&&(a=a.replace(Le(c,"g"),n)),p=a.match(/#/g),p=p?p.length:0;const m=f.split(c);let h;m[1]&&(h=m[1].match(Oe)),e.prefix=s||"",e.postfix=l||"",e.pattern=f,e.maxPrecision=h?h.length:2,e.percentage=De.test(f),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Le(t,null,!0),"|").concat(Le(n,null,!0)),"g"),e.groupTemp=u,e.decTemp=c,e.t=t,e.d=n,e.temp=p}class He{constructor(e,t,n,r,i){this.localeInfo=e,this.pattern=t,this.thousandDelimiter=n||",",this.decimalDelimiter=r||".",this.type=i||"numeric",this.patternSeparator=";",this.abbreviations=Re(e,this.patternSeparator),this.prepare()}clone(){const e=new He(this.localeInfo,this.pattern,this.thousandDelimiter,this.decimalDelimiter,this.type);return e.subtype=this.subtype,e}format(e,t,n,r){return this.prepare(t,n,r),this.formatValue(e)}prepare(e,t,n){let r;if(void 0===e&&(e=this.pattern),void 0===t&&(t=this.thousandDelimiter),void 0===n&&(n=this.decimalDelimiter),!e)return void(this._prepared={pattern:!1});this._prepared={positive:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},negative:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""},zero:{d:n,t:t,abbreviate:!1,isFunctional:!1,prefix:"",postfix:""}},r=this._prepared,e=e.split(this.patternSeparator),r.positive.pattern=e[0],r.negative.pattern=e[1],r.zero.pattern=e[2],Ie.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Ie.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Ie.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Fe(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Fe(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Fe(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,u,c=this._prepared,p="",d="",f=e;if(isNaN(e))return"".concat(f);if(e=+e,!1===c.pattern)return e.toString();if(0===e&&c.zero)return c=c.zero,c.pattern;if(e<0&&c.negative?(c=c.negative,e=-e):c=c.positive,o=c.d,a=c.t,c.isFunctional)e=Te(e,c.pattern,o);else{if(c.percentage&&(e*=100),c.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=c.maxPrecision?i=o:r<=n&&!(o>0&&-n<=c.maxPrecision)&&(i=r)),i&&(p=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=c.temp,l=c.numericPattern,u=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,u||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+ve*(e<0?-1:1)).toFixed(Math.min(20,u?u.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=be(n,t)||"0",u){const t=Math.max(0,Math.min(14,u.length)),n=u.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+ve).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),d=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=be(l,e)}e=e.replace(c.numericRegex,e=>e===a?c.groupTemp:e===o?c.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return c.prefix+e+d+p+c.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function _e(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new He(...t)}function je(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{size:n=5e3,multipleArguments:r=!1,toKey:i=e=>e}=t;let o,a,s=Object.create(null),l=Object.create(null),u=0,c=0;return o=r?function(){return a=i(...arguments),o.has(a)?o.get(a):o.set(a,e(...arguments))}:t=>(a=i(t),o.has(a)?o.get(a):o.set(a,e(t))),o.set=(e,t)=>(u>=n&&(delete s[l[c]],delete l[c],u--,c++),s[e]=t,l[u]=e,u++,t),o.get=e=>s[e],o.has=e=>e in s,o.clear=()=>{s=Object.create(null),l=Object.create(null),u=0,c=0},o.size=()=>u,o}function Ve(e,t,n,r,i){const o=_e(i,e,t,n,r),a=je(o.formatValue.bind(o),{toKey:e=>isNaN(e)?e:+e});function s(e){return a(e)}return s.format=function(e,t,n,r){return a.clear(),o.format(t,e,n,r)},s.pattern=function(e){return e&&(a.clear(),o.pattern=e,o.prepare()),o.pattern},s}const ze={DATE:"D",TIME:"T",DATE_TIME:"TS",INTERVAL:"IV"},Be=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],$e=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ue=["January","February","March","April","May","June","July","August","September","October","November","December"],Ke=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],We=86400;function Ye(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Ge(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}function Je(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function Ze(e){const t=e,n=24*Je(t),r=60*Je(n),i=60*Je(r),o=1e3*Je(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}function Qe(e,t){let n,r=Ze(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,u=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(We*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(u=n?n.getDay()-1:0,u<0&&(u=6));let c="";return n&&(c=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:u,date:i,h:o,m:a,s:s,f:l,t:c}}function Xe(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:Ye("".concat(t.year).slice(-2),2),YYY:Ye("".concat(t.year).slice(-3),3),def:e=>Ye("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:Ye("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:Ye("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>Ye("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>Ye("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>Ye("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>Ye("".concat(t.s),e.length)},"f+|F+":{def(e){let n="".concat(t.f),r=e.length-n.length;if(r>0)for(let e=0;e<r;e++)n+="0";else r<0&&(n=n.slice(0,e.length));return n}},"t{1,2}|T{1,2}":{def(e){let n=t.t;return e[0].toUpperCase()===e[0]&&(n=n.toUpperCase()),n=n.slice(0,e.length),n}}}}class et{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:Be,qDayNames:$e,qLongMonthNames:Ue,qMonthNames:Ke}),this.localeInfo=r,this.locale_days=r.qCalendarStrings.qLongDayNames.slice(),this.locale_days_abbr=r.qCalendarStrings.qDayNames.slice(),this.locale_months=r.qCalendarStrings.qLongMonthNames.slice(),this.locale_months_abbr=r.qCalendarStrings.qMonthNames.slice(),t||(t={[ze.TIME]:r.qTimeFmt||"hh:mm:ss",[ze.DATE]:r.qDateFmt||"YYYY-MM-DD",[ze.DATE_TIME]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new et(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=Ge(e,n):(e<0&&(e=-e,t="-".concat(t)),r=Qe(e,t));const i=Xe(this,r),o=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&o.push(e);const a=new RegExp(o.join("|"),"g");return t.replace(a,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r})}}function tt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new et(...t)}const nt=864e5;function rt(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(nt*(e-Math.floor(e)))))}function it(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=tt(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=je(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==ze.INTERVAL?rt(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=tt(i,e,t),r=je(n.format.bind(n),{toKey:e=>"object"==typeof e?e.getTime():e}),this},o.qtype=function(e){return void 0!==e&&(t=e,r.clear()),t},o}function ot(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return it(e.qNumFormat.qFmt,e.qNumFormat.qType,t);let n="#",r=t&&void 0!==t.qThousandSep?t.qThousandSep:",",i=t&&void 0!==t.qDecimalSep?t.qDecimalSep:".",o="U",a=e&&!!e.qIsAutoFormat;return e&&e.qNumFormat?(n=e.qNumFormat.qFmt||n,r=e.qNumFormat.qThou||r,i=e.qNumFormat.qDec||i,o=e.qNumFormat.qType||o,a=a&&-1===["M"].indexOf(e.qNumFormat.qType)):a=!0,(a||"U"===o)&&(n="#".concat(i,"##"),o="U"),Ve(n,r,i,o,t)}function at(){let e,{meta:t,id:n,key:r,localeInfo:i,fieldExtractor:o,value:a,type:s,sourceField:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const u=a||("dimension"===s?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),c=e=>(null==e?void 0:e.qText)||"",p="dimension"===s?"first":"avg",d=ot(t,i),f={id:()=>n,key:()=>r,raw:()=>t,title:()=>t.qFallbackTitle||t.label,type:()=>s,origin:()=>l,items:()=>(e||(e=o(f)),e),min:()=>t.qMin,max:()=>t.qMax,value:u,label:c,reduce:p,reduceLabel:"dimension"===s?"first":(e,t)=>d(t),formatter:()=>d,tags:()=>t.qTags};return f}function st(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:at(f({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=st("qAttrDimInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=st("qAttrExprInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=st("qMeasureInfo",t,n,a,f({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function lt(){let{key:e,data:t,config:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},o=t;if(!o)throw new Error('Missing "data" input');if(!o.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const a=lt.util,s={cache:i,cube:o,localeInfo:r.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:r.virtualFields},l={key:()=>e,raw:()=>o,field:e=>te(e,s),fields:()=>i.fields.slice(),extract:e=>s.extractor(e,l,i,a),hierarchy:e=>s.hierarchy(e,l,i,a),_cache:()=>i};"K"===o.qMode||"T"===o.qMode||!o.qMode&&o.qNodesOnDim?(s.extractor=ge,s.hierarchy=he,s.pages="K"===o.qMode?o.qStackedDataPages:o.qTreeDataPages):"S"===o.qMode?(s.extractor=y,s.pages=o.qDataPages,s.hierarchy=he):s.extractor=()=>[],s.fieldExtractor=e=>s.extractor({field:e},l,i,a);const u="S"===o.qMode?e=>e.qElemNumber:void 0,c="S"===o.qMode?e=>e.qNum:void 0;i.wrappedFields.push(...st("qDimensionInfo",o,e,"",f({},s,{value:u,type:"dimension"}))),i.wrappedFields.push(...st("qMeasureInfo",o,e,"",f({},s,{value:c,type:"measure"}))),i.fields=i.wrappedFields.map(e=>e.instance);const p=e=>{e.forEach(e=>{i.allFields.push(e.instance),p(e.measures),p(e.attrDims),p(e.attrExps)})};return p(i.wrappedFields),(r.virtualFields||[]).forEach(t=>{const r=l.field(t.from),o=at(n({meta:r.raw(),id:"".concat(e,"/").concat(t.key),sourceField:r,fieldExtractor:e=>s.extractor({field:e},l,i,a),key:t.key,type:r.type(),localeInfo:s.localeInfo,value:r.value},t.override||{}));i.virtualFields.push(o)}),i.allFields.push(...i.virtualFields),l}const ut=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ct=/\/qDimensionInfo(?:\/(\d+))?/,pt=/\/qMeasureInfo\/(\d+)/,dt=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,ft=/\/qAttrExprInfo\/(\d+)/,mt=/\/?qHyperCube/,ht=/\/?qTreeData/,gt=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),yt=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function bt(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;mt.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=gt):ht.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=yt);let s=!0;if(ct.test(e)&&(r=+ct.exec(e)[1]),pt.test(e)&&(i=+pt.exec(e)[1]),dt.test(e)){i=-1,r=0;const e=+dt.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(ft.test(e)){const e=i;if(t){i=0;const a=Q(o,t);i+=(a.qMeasureInfo||[]).length,r>-1?(i=a.qDimensionInfo.slice(0,r).reduce((e,t)=>e+t.qAttrExprInfo.length,i),r=-1):(i=a.qDimensionInfo.reduce((e,t)=>e+t.qAttrExprInfo.length,i),i=a.qMeasureInfo.slice(0,e).reduce((e,t)=>e+t.qAttrExprInfo.length,i)),i+=+ft.exec(n)[1]}else r>-1?(r=-1,i=+ft.exec(n)[1]):i+=+ft.exec(n)[1]+1}return ut.forEach(e=>{let[t,r]=e;n=n.replace(t,r)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}function vt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const r=t.byCells,i=t.primarySource,o=[],a={},s=e.isActive();let l=!1;return e.brushes().forEach(e=>{const t=bt(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||s>=o)&&o>-1?n.forEach(e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})}):n.forEach(e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(u=t.orMode)||void 0===u||u]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var u}function qt(e){lt.util=e.data("matrix").util,e.data("q",lt),e.formatter("q-number",Ve),e.formatter("q-time",it)}return qt.qBrushHelper=vt,qt.selections=vt,qt}()),Pr.exports),Fr=N(Rr);const Hr={brushInterceptors:{DIM_VALUE_NULL:-2,DIM_VALUE_TOTAL:-3,brushOnlyOne:function(e,t){const n=e.brushes().filter(e=>"value"===e.type);let r=[];n.length&&n.forEach(e=>{r=r.concat(e.brush.values().map(t=>({key:e.id,value:t})))});return r.concat(t)},filterValues:function(e,t){const n=this;let r,i;const o=[];let a=0;const s=[];return t.forEach(t=>{t.value!==n.DIM_VALUE_NULL&&t.value!==n.DIM_VALUE_TOTAL&&(i=function(e,t){const n=t.key.indexOf("qHyperCube")+10,r=t.key.substr(0,n),i=t.key.substr(n+1);return e.dataset(r).field(i)}(e,t),r=i&&i.raw(),r.qLocked?(o.push(r),a++):s.push({key:t.key,value:t.value}))}),{items:s,itemsAreLocked:a>0&&a===t.length,lockedFields:o}}}};const _r={data:["elemNo"],contexts:["select"],startOnEmptySelection:!0,style:{active:{strokeWidth:2,stroke:"#333"},inactive:{opacity:.3}}};function jr(e){if(!e||!e.chartInstance||!e.selectionsApi)throw Error("Selections-handler: Missing input");const t=e.chartInstance,n=e.selectionsApi,r=e.dataPaths||[""],i=e.selectPaths,o=e.lasso;let a=[];const s={propertiesToRestore:{}};let l=!1;const u=function(e,t,n){function r(){}return r.update=function(e,r,i){t.isActive()||t.begin(n),Fr.qBrushHelper(i).forEach(e=>{t.select(e)})},r.toggleValues=function(r,i,o){const a=Hr.brushInterceptors.filterValues(e,r),s=a.items;return t.isActive()||a.itemsAreLocked||!(o||s.length>0)||(t.begin(n),i.start(),i.emit("update",[],[])),s},r}(t,n,i),c={};let p=!1;function d(e){16===e.keyCode&&e.shiftKey!==p&&(p=e.shiftKey,o.toggle())}function f(e){const t=e.keyCode;27===t?n.cancel():13===t&&n.confirm()}function m(){a.forEach(e=>{e.listeners.update=function(t,n){e.sleep||u.update(t,n,e.brush)},e.brush.on("update",e.listeners.update),e.brush.on("start",e.listeners.start)})}function h(){a.forEach(e=>{e.brush.removeListener("update",e.listeners.update),e.brush.removeListener("start",e.listeners.start)})}return n.on("cleared",()=>{a.forEach(e=>{e.brush.clear(),e.dependentComponents.forEach(e=>{const n=t.component(e.id);n&&n.emit(e.clear)})})}),c.setUp=function(e){c.tearDown();const t=this.setUpBrush(e);return l&&m(),t},c.setUpBrush=function(e){const n=C(!0,{},_r,e),i={on:"tap",action:t=>t.ctrlKey||e.isSingleSelect?"set":"toggle",contexts:n.contexts,data:n.data,globalPropagation:"stop"},o={context:n.contexts[0],data:n.data,style:n.style},s=function(e,t){return{brush:t.brush(e.contexts[0]),listeners:{},dependentComponents:[],id:e.contexts[0]}}(n,t);return s.listeners.toggle=function(e){if(!l)return[];const i=function(){const e=[];let n=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));n=[].concat.apply([],n);for(let t=0;t<n.length;t++)n[t].raw().qLocked&&e.push(n[t].raw());return{fields:e,areAllFieldsLocked:e.length&&e.length===n.length}}();return n.startOnEmptySelection&&0===e.length&&i.areAllFieldsLocked?[]:u.toggleValues(e,s.brush,n.startOnEmptySelection)},s.brush.intercept("toggle-values",s.listeners.toggle),s.brush.intercept("add-values",s.listeners.toggle),s.brush.intercept("remove-values",s.listeners.toggle),s.brush.intercept("set-values",s.listeners.toggle),s.listeners.start=function(){a.length>1&&a.forEach(e=>{e!==s&&e.brush.end()})},a.push(s),{trigger:i,consume:o}},c.setUpStart=function(){c.tearDown()},c.setUpDone=function(){l&&m()},c.tearDown=function(){l&&h(),a.forEach(e=>{e.brush.removeInterceptor("toggle-values",e.listeners.toggle),e.brush.removeInterceptor("add-values",e.listeners.toggle),e.brush.removeInterceptor("remove-values",e.listeners.toggle),e.brush.removeInterceptor("set-values",e.listeners.toggle)}),a=[]},c.pauseEngineCalls=function(e){a.forEach(t=>{t.id===e&&(t.sleep=!0)})},c.resumeEngineCalls=function(e,t){a.forEach(n=>{n.id===e&&(n.sleep=!1,t&&n.listeners.update([],[]))})},c.addComponent=function(e,t){a.forEach(n=>{n.id===e&&n.dependentComponents.push(t)})},c.on=function(){if(l)return;l=!0,m(),document.addEventListener("keydown",d),document.addEventListener("keyup",d);const e=()=>{a.forEach(e=>{e.brush.end()}),document.removeEventListener("keyup",f),o.active()&&o.toggle()};n.on("deactivated",e),s.unbindDeactivated=()=>{n.removeListener("deactivated",e)};const t=()=>{document.addEventListener("keyup",f)};n.on("activated",t),s.unbindActivated=()=>{n.removeListener("activated",t)}},c.isOn=()=>l,c.off=function(){l&&(l=!1,h(),document.removeEventListener("keydown",d),document.removeEventListener("keyup",d),document.removeEventListener("keyup",f),s.unbindActivated(),s.unbindDeactivated())},c.lassoState=function(){return o.active()&&!(e.isLassoDisabled&&e.isLassoDisabled())},c.allFieldsLocked=function(){return function(){let e=r.map(e=>t.dataset(e).fields().filter(e=>"dimension"===e.type()));return e=[].concat.apply([],e),e.length&&e.every(e=>e.raw().qLocked)}()},c}class Vr{isOn(){return!1}on(){console.warn("Can not turn on selections on this object")}off(){}}var zr={create:e=>e.selectionsApi?jr(e):new Vr};function Br(e,t,n,r,i){let o=!1;r=r||"tooltip",n=n||["self"];const a=e.brush(r),s={};function l(){if(o){e.component(i).emit("hide")}o=!1}return s.isOpen=function(){return o},s.closeTooltip=l,s.update=function(){const s=a.brushes(),u=e.getAffectedShapes(r,"and",n,t);s.length>=1?(o=!0,function(t){o=!0;const n={nodes:t};e.component(i).emit("show",{},n)}(u)):l()},s.toggleInterceptor=function(e){if(n.length>1){const t={},n=[];return e.forEach(e=>{t[e.key]||(t[e.key]={}),t[e.key][e.value]||(t[e.key][e.value]=!0,n.push(e))}),n}return e},s}var $r={create:(...e)=>Br(...e)},Ur={formatMeasureValue:function(e,t){if(e.raw().isCustomFormatted)return e.formatter()(t.value.qText);const n=void 0!==t.value.qNum?t.value.qNum:t.value.qValue;return e.formatter()(n)}};const Kr=e=>({h:t,data:n,style:r})=>{const i=function(e,t){const n=e.chartInstance.dataset(e.dataPath),r=[],i=t.length-5,o=Math.min(5,t.length);for(let i=0;i<o;i++){const o=t[i],a={rows:[]};if(e.labelData){const t=[],i=e.labelData;let s=!1;for(let e=0;e<i.length;e++){const n=o.data[i[e]].value;if(-2===n.qElemNo||-2===n.qElemNumber){s=!0;break}t.push(o.data[i[e]].value.qText)}if(s)return;a.header=e.headerResolver(t),a.rows=e.measureRows.map(t=>{const r=o.data;return e.rowResolver(n.field(r[t].source.field),r[t],r)}).filter(e=>!!e);const l=Wr(e,o);l&&a.rows.unshift(l),r.push(a)}}i>0&&(r.numberInExcess=i);return r.rowCount=r[0]?r.length*r[0].rows.length:0,r}(e,n),o={h:t,style:r,rtl:"rtl"===e.direction,translator:e.translator};return e.renderer(o,i)};function Wr(e,t){var n,r,i;const o=t.data.color,a=null===(n=e.colorService)||void 0===n||null===(r=n.getSettings)||void 0===r?void 0:r.call(n);if(!a||"color"===a.type||!o||!a.fieldType)return;const s=[];e.data.forEach(e=>{const n=t.data[e];n&&s.push(n.value)});const l=function(e){let t=-1;for(let n=0;n<e.length;n++)-3===e[n]&&(t=n);return t}(s),{translator:u}=e,c=a.label;return{color:null===(i=t.attrs)||void 0===i?void 0:i.fill,label:c,value:-1!==l?u.get("properties.dimensionLimits.others"):o.label}}const Yr="dist-flow-tooltip",Gr=`#${Yr}`;function Jr(){if(!document.querySelector(Gr)){const e=document.createElement("div");e.id=Yr,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 Zr({key:e="tooltip",rtl:t,fontFamily:n,filter:r,content:i}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){Jr()},beforeUpdate(){Jr()},destroyed(){!function(){const e=document.querySelector(Gr);e&&e.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(Gr),content:i,filter:r,extract:e=>e.node,direction:t?"rtl":"ltr",placement:"bounds"},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:n,"empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}const{detectTextDirection:Qr}=ur;const Xr={tooltipKey:"tooltip",data:[""],contexts:["tooltip"],headerResolver:e=>e.join(", "),rowResolver:(e,t)=>({value:Ur.formatMeasureValue(e,t),label:e.title()}),direction:"ltr",renderer:function(e,t){const{h:n,style:r,translator:i,rtl:o}=e,a=[],s=o?"right":"left";if(t.forEach(e=>{if(e.header){const t={...r.cell,textAlign:s,fontWeight:"bold",direction:Qr(e.header)};a.push(n("tr",null,n("td",{style:t,colSpan:2},e.header)))}e.rows.forEach(e=>{let t=e.value;if(e.color){const r={display:"inline-block",width:10,height:10,"background-color":e.color,margin:"0 8px"},i=n("div",{style:r});t=o?[e.value,i]:[i,e.value]}const i=o?[":",e.label]:[e.label,":"],l={...r.cell,textAlign:s,direction:Qr(e.label)},u={...r.cell,textAlign:o?"left":"right",direction:Qr(e.value)};a.push(n("tr",null,n("td",{style:l},i),n("td",{style:u},t)))})}),t.numberInExcess){const e=i.get("Object.ChartTooltip.NMore",t.numberInExcess),o={...r.cell,textAlign:s,direction:Qr(e)};a.push(n("tr",null,n("td",{style:o,colSpan:2},e)))}return a}};function ei(e,t,n){if(!e)throw Error("Tooltips-handler: Missing input");let r={},i=!1;const o={};function a(e){e.listeners.update=function(t,n){e.action.update(t,n,e)},e.listeners.end=function(){e.action.closeTooltip()},e.brush.on(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.on("end",e.listeners.end),e.brush.intercept("set-values",e.action.toggleInterceptor)}function s(){Object.keys(r).forEach(e=>{l(r[e])})}function l(e){e.brush.removeListener(e.treatAsDesktop?"update":"set-values",e.listeners.update),e.brush.removeListener("end",e.listeners.end),e.brush.removeInterceptor("set-values",e.action.toggleInterceptor)}function u(){Object.keys(r).forEach(e=>{r[e].action.closeTooltip()})}function c(){u();for(const e in r)r[e].brush.clear()}return o.setUp=function(t){const o=C(!0,{},Xr,t);if(!o.componentKey)throw Error("Tooltips-handler.setUp: Missing required input");r[o.contexts[0]]&&i&&l(r[o.contexts[0]]);const s=function(e,t){return{brush:t.brush(e.contexts[0]),action:$r.create(t,e.componentKey,e.data,e.contexts[0],e.tooltipKey),listeners:{},chartInstance:t,dataPath:e.dataPath,renderer:e.renderer,data:e.data,headerResolver:e.headerResolver,rowResolver:e.rowResolver,colorService:e.colorService,attrDimPath:e.attrDimPath,measureRows:e.measureRows,labelData:e.labelData,filterShapes:e.filterShapes,direction:e.environment.options.direction,theme:e.environment.theme,translator:e.environment.translator,treatAsDesktop:"touch"!==e.environment.deviceType}}(o,e);r[o.contexts[0]]=s,i&&a(s);const u=Zr({key:o.tooltipKey,rtl:"rtl"===s.direction,fontFamily:s.theme.getStyle(n,"tooltip","fontFamily"),filter:(c=s.filterShapes,e=>c?c(e):function(e){const t=[];return e.forEach(e=>{-1===t.indexOf(e)&&"container"!==e.type&&t.push(e)}),t}(e)),content:Kr(s,o.dataPath)});var c;return o.chartBuilder.getSettings().components.push(u),{trigger:{on:s.treatAsDesktop?"over":"tap",action:"set",contexts:o.contexts,data:o.data,globalPropagation:"stop"},consume:o.contexts.map(e=>({context:e})),component:u}},o.tearDown=function(){i&&s(),r=[]},o.closeTooltip=u,o.isOn=()=>i,o.on=function(){i||(i=!0,Object.keys(r).forEach(e=>{a(r[e])}),t&&t.on("mouseleave",c))},o.off=function(){i&&(i=!1,s(),t&&t.off("mouseleave",c),u())},o}var ti={create:(e,t,n)=>ei(e,t,n)};const ni={generateHash:function(e){return function(e){let t=0;if(!e||!e.length)return t;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return t}(JSON.stringify(e))},updateHash:function(e,t){e.qUndoExclude||(e.qUndoExclude={});e.qUndoExclude.hashCode=ni.generateHash(t)}};const ri={getDefaultHashDataForHyperCube:function(e,t,n){return function(e,t){const n=[];if(!e.qMeasures)return Promise.resolve(n);return e.qMeasures.forEach(e=>{e.qLibraryId?n.push(function(e,t){return t.getMeasure(e).then(e=>e.getProperties().then(e=>e.qMeasure.qDef))}(e.qLibraryId,t)):n.push(Promise.resolve())}),Promise.all(n)}(e,n).then(e=>({drillLevel:oi(t),dimensionExpressions:ii(t),measureExpressions:e}))}};function ii(e){return e.qDimensionInfo.map(e=>e.qGroupFieldDefs)}function oi(e){const t=function(e){return Kn(e,"qDimensionInfo",[])}(e);return t.map(e=>e.qGroupPos)}const ai={},si=C.bind(null,!0);function li(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}const ui=Array.isArray,ci=function(e){return void 0===e};function pi(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function di(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach((t,i)=>{i!==n.length&&(r=+t,e[r||t]=ci(e[r||t])?Number.isNaN(+r)?{}:[]:e[t],e=e[r||t])}),e}function fi(e,t){if(li(e)&&li(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n of Object.keys(e))if(!fi(e[n],t[n]))return!1;return!0}if(ui(e)&&ui(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n++)if(!fi(e[n],t[n]))return!1;return!0}return e===t}ai.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e&&(e=si({},{val:e}).val),e}(t[i]),a=e[i],s=`${n}/${i}`;fi(o,a)||pi(t,i)||(ci(a)?r.push({op:"add",path:s,value:o}):li(o)&&li(a)?r=r.concat(ai.generate(a,o,s)):ui(o)&&ui(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let o,a,s=-1;function l(e,t,n){if(e[n]&&ci(e[n].qInfo))return null;if(e[n]&&e[n].qInfo.qId===t)return n;for(let n=0,r=e.length;n<r;n++)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(fi(t,i))return r;if(null===t[0]||!ci(t[0])&&ci(t[0].qInfo))return r.push({op:"replace",path:n,value:t}),r;for(o=i.length-1;o>=0;--o)s=l(t,i[o]&&i[o].qInfo&&i[o].qInfo.qId,o),-1===s?(r.push({op:"remove",path:`${n}/${o}`}),i.splice(o,1)):r=r.concat(ai.generate(i[o],t[s],`${n}/${o}`));for(o=0,a=t.length;o<a;++o)s=l(i,t[o]&&t[o].qInfo&&t[o].qInfo.qId),-1===s?(r.push({op:"add",path:`${n}/${o}`,value:t[o]}),i.splice(o,0,t[o])):s!==o&&(r.push({op:"move",path:`${n}/${o}`,from:`${n}/${s}`}),i.splice(o,0,i.splice(s,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))}),Object.keys(e).forEach(i=>{ci(t[i])&&!pi(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r},ai.apply=function(e,t){t.forEach(t=>{const n=di(e,t.path);let r=t.path.split("/").splice(-1)[0];const i=r&&Number.isNaN(+r)?n[r]:n[+r]||n,o=t.from?t.from.split("/").splice(-1)[0]:null;if("add"===t.op||"replace"===t.op)if(ui(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(ui(i)&&ui(t.value)){const e=t.value.slice();i.length=0,i.push.apply(i,e)}else li(i)&&li(t.value)?(a=i,Object.keys(a).forEach(e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!pi(a,e)&&delete a[e]}),si(i,t.value)):n[r]=t.value;else if("move"===t.op){const i=di(e,t.from);ui(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(ui(n)?n.splice(+r,1):delete n[r]);var a})},ai.clone=function(e){return si({},e)},ai.createPatch=function(e,t,n){const r={op:e.toLowerCase(),path:n};return"move"===r.op?r.from=t:void 0!==t&&(r.value=t),r},ai.updateObject=function(e,t){Object.keys(e).length?ai.apply(e,ai.generate(e,t)):si(e,t)};class mi{constructor(e){this._model=e}setModel(e){this._model=e}saveSoftProperties(e,t){if(!this._model)return Promise.resolve(!1);let n=ai.generate(e,t);return C(!0,e,t),n&&n.length?(n=n.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),this._model.applyPatches(n,!0).then(()=>!0)):Promise.resolve(!1)}async mergeSoftPatches(){if(!this._model)return;const e=this._model.getProperties(),t=this._model.getEffectiveProperties(),n=await e,r=await t;if(n.qExtendsId)return;const i=ai.generate(n,r);ai.apply(n,i);const o=this;o._model.setProperties(n).then(()=>{o._model.clearSoftPatches()})}}var hi={canModifyHardProperties:function(e){if(e.qHasSoftPatches||e.qExtendsId)return!1;if(e.permissions)return e.permissions.update;return-1!==e.qMeta.privileges.indexOf("update")}};var gi={saveDerivedProperties:function(e,t,n,r){if(hi.canModifyHardProperties(t))return e.setProperties(n);return new mi(e).saveSoftProperties(r,n)}};var yi={validate:function(e){if(!(e&&e.layout&&e.properties&&e.model&&e.hashData&&e.generateDerivedProperties))throw Error("Derived-properties: Missing input")}};function bi(){this._generationInProgress=!1}function vi(e){yi.validate(e);const t=e.properties,n=ni.generateHash(e.hashData);return!(!t.qUndoExclude||t.qUndoExclude.hashCode!==n)}bi.prototype.isDerivedUpToDate=vi,bi.prototype.updateDerivedProperties=function(e){if(yi.validate(e),this._generationInProgress)return Promise.resolve(!0);if(vi(e)){const t=e.layout.qUndoExclude&&e.layout.qUndoExclude.hashCode===e.properties.qUndoExclude.hashCode;return Promise.resolve(!t)}const t=this,n=e.model,r=e.layout,i=C(!0,{},e.properties),o=C(!0,{},i);return this._generationInProgress=!0,ni.updateHash(i,e.hashData),e.generateDerivedProperties(r,i).then(()=>gi.saveDerivedProperties(n,r,i,o).then(()=>(t._generationInProgress=!1,Promise.resolve(!0))))},bi.prototype.addDefaultHyperCubeHash=function(e,t,n,r){return ri.getDefaultHashDataForHyperCube(e,t,n).then(e=>C(!0,r,e))};const qi={wrapExpression:function(e){const t=e.replace(/\]/g,"]]");return t?`[${t}]`:""}};const xi={replaceExpressionTokens:function(e,t,n){const r={start:n&&n.start||"{{",end:n&&n.end||"}}"};let i,o,a=e;for(const e in t)i=t[e],o=r.start+e+r.end,a=a.replace(Di(o,!0),i);return a},createRegExp:Di};function Di(e,t,n){const r=e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");const i=n?`(${r})`:r;return t?new RegExp(i,"g"):new RegExp(i)}const Si={generateExpression:function(e,t){const n={};if(t)for(const e in t){const r=t[e],i=r.wrap?qi.wrapExpression(r.value):r.value;n[e]=i;(r.variations||[]).forEach(t=>{const r=Mi(t,i,e);n[t]=r})}return xi.replaceExpressionTokens(e,n)}};function Mi(e,t,n){if(""===t)return"";const r=xi.createRegExp(n,!0,!0),i=e.split(r);let o="";return i.forEach(e=>{o+=e!==n?e:t}),o}const Ei={generateHyperCubeDef:function(e,t,n,r,i){return function(e,t,n,r){const i={};let o,a;const s=[];let l;e.forEach(e=>{o=Oi(e.match(Ii("Dim"))),o.forEach(e=>{s.push(Ci(t.qDimensions[e],r,e,n).then(t=>{i[`Dim[${e}]`]={value:t,wrap:!0}}))}),a=Oi(e.match(Ii("Mea"))),a.forEach(e=>{s.push(wi(t.qMeasures[e],r).then(t=>{i[`Mea[${e}]`]={value:t}}))})}),l=s.length?Promise.all(s).then(()=>Promise.resolve(i)):Promise.resolve(i);return l}(e.dimensions.concat(e.measures),t,n,r).then(n=>{const r=C({},n,i),o=C(!0,{},t);return o.qDimensions=[],o.qMeasures=[],e.dimensions.forEach(e=>{o.qDimensions.push({qDef:{qFieldDefs:[`=${Si.generateExpression(e,r)}`]}})}),e.measures.forEach(e=>{o.qMeasures.push({qDef:{qDef:Si.generateExpression(e,r)}})}),o})},getAllHyperCubeExpressions:async function(e,t,n){const r=e.qDimensions.map((e,r)=>Ci(e,n,r,t)),i=e.qMeasures.map(e=>wi(e,n));return{dimensions:await Promise.all(r),measures:await Promise.all(i)}}};function Ci(e,t,n,r){if(e.qLibraryId)return Ai(e.qLibraryId,"dimension",t,n,r);const i=r.qDimensionInfo[n].qGroupPos;return Promise.resolve(e.qDef.qFieldDefs[i])}function wi(e,t){return e.qLibraryId?Ai(e.qLibraryId,"measure",t):Promise.resolve(e.qDef.qDef)}function Ai(e,t,n,r,i){if(!n)return console.warn("No app provided, returning library id"),e;return n["dimension"===t?"getDimension":"getMeasure"](e).then(e=>e.getProperties().then(e=>"dimension"===t?e.qDim.qFieldDefs[i.qDimensionInfo[r].qGroupPos]:e.qMeasure.qDef))}function Ii(e){return new RegExp(`\\{\\{${e}\\[\\d\\]\\}\\}`,"g")}function Oi(e){return e?e.map(e=>e.substr(6,1)):[]}function ki(e){return!Number.isNaN(parseFloat(e))&&Number.isFinite(+e)}function Ni(e){return!Number.isNaN(parseInt(e,10))&&parseFloat(e,10)===parseInt(e,10)}const Ti={getBinSize:function(e){return pt(e,"bins.binSize",F.BIN_SIZE)},getDerivedBinSize:function(e){return pt(e,"qUndoExclude.bins.binSize",F.BIN_SIZE)},getDerivedBinOffset:function(e){return pt(e,"qUndoExclude.bins.offset",F.OFFSET)},getDerivedBinCount:function(e){const t=pt(e,"qUndoExclude.bins.binCount",F.BIN_COUNT);return ki(t)?t<1?1:Ni(t)?t:Math.ceil(t):F.BIN_COUNT},getBinCount:function(e){return pt(e,"bins.binCount",void 0)},getBinOffset:function(e){return pt(e,"bins.offset",F.OFFSET)},isAutoBin:function(e){return pt(e,"bins.auto",F.AUTO)},isCountDistinct:function(e){return pt(e,"bins.countDistinct",F.COUNT_DISTINCT)},getBinMode:function(e){return pt(e,"bins.binMode",F.BIN_MODE)},isEmpty:function(e){return null==e||""===e}},Li=Math.log(10),Pi=[1,1.5,2,3,4,5,6,10],Ri=[1,2,4,5,6,8,10],Fi=[2,4,5,10];function Hi(e,t){if(0===e)return 0;let n;const r=Math.floor(Math.log(Math.abs(e))/Li),i=e/10**r;for(let e=0;e<t.length;e++)if(i<=t[e]){n=t[e];break}return(r>=0?n*10**r:n/10**-r)*(e<0?-1:1)}function _i(e,t,n,r,i,o){return Math.floor(Math.abs(e-i)/r)+Math.floor(Math.abs(o-t)/r)}const ji={calculateBinSize:function(e,t,n){return function(e,t,n){if(!ki(e)||!ki(t)||!ki(n))throw Error("binSizeCalculator: One of the inputs is NOT numeric");if(e>t)throw Error("binSizeCalculator: The 'min' parameter is bigger than the 'max' parameter")}(e,t,n),function(e,t,n){let r,i,o,a,s,l,u,c,p,d,f,m,h=-1,g=Pi;if(n=Math.max(1,n),t===e)if(0===t){if(a=1,1===n)return{min:e,max:t,nbrOfBins:n,rawBinSize:o/n,offset:-.5,newMax:.5,binSize:1,numEmptyBins:0}}else 1===n?(a=t+1e-9,g=Ri):a=Math.abs(t/n);else o=(t+=1e-9)-e,a=o/n;do{if(c=1,f=0,h>=0)for(p=1/Fi[h],d=1,g=[];d<=10;)g.push(Math.round(1e3*d)/1e3),d+=p;s=a;do{s=Hi(s*c,g),l=Math.floor(Math.log(s)/Li),u=10**l,i=t===e?(Math.ceil(t/s)+Math.floor(n/2))*s:Math.ceil(t/s)*s,r=i-n*s;let o=0;for(m=u;(r>e||i<t)&&o<Fi.length;)r=Math.floor(e/m)*m,i=r+n*s,m=u/Fi[o++];l<1&&(u=10**(Math.abs(l)+1),i=Math.round(i*u)/u,r=Math.round(r*u)/u),c=1.1,f++}while((r>e||i<t)&&f<10);h++}while(_i(e,t,0,a,r,i)>0&&h<Fi.length);return{binCount:n,offset:r,binSize:s}}(e,t,n=function(e){return e<1?1:Ni(e)?e:Math.ceil(e)}(n))}};const Vi={getMappingValues:function(e){const t=Ti.isAutoBin(e),n=Ti.getBinMode(e);let r,i,o,a;const s=Ti.isCountDistinct(e);return t||"maxCount"===n?(a=function(e){const t=pt(e,"qHyperCube.qDimensionInfo.0",{});let n=t.qMin,r=t.qMax;n=ki(n)?n:1,r=ki(r)?r:1;const i=Ti.getDerivedBinCount(e);return ji.calculateBinSize(n,r,i)}(e),r=a.binSize,i=a.offset,o=a.binCount):(r=Ti.getBinSize(e),i=Ti.getBinOffset(e)),{binSize:r,binOffset:i,binCount:o,distinct:s}},getMappings:function(e){const t={};return t.BinSize={value:`,${e.binSize}`},t.Label={value:0===e.binOffset?"":",'x'"},t.Offset={value:0===e.binOffset?"":`,${e.binOffset}`},t.Distinct={value:e.distinct?"Distinct ":""},t}};const zi={generateHyperCubes:async function(e,t,n){const{app:r,translator:i}=n,o=Vi.getMappingValues(e),a=Vi.getMappings(o),s=Ei.getAllHyperCubeExpressions(t.qHyperCubeDef,e.qHyperCube,r),l=Ei.generateHyperCubeDef({dimensions:["Class(aggr({{Dim[0]}},{{Dim[0]}}){{BinSize}}{{Label}}{{Offset}})"],measures:["Count({{Distinct}}{{Dim[0]}})"]},t.qHyperCubeDef,e.qHyperCube,r,a),u=await s,c=await l;let p;p=Ti.isAutoBin(e)?{qValueExpression:{qExpr:Si.generateExpression("=Ceil(Log10(Count({{Dim[0]}})) / Log10(2)) + 1",{"Dim[0]":{value:u.dimensions[0],wrap:!0}})}}:"maxCount"===Ti.getBinMode(e)&&Ti.isEmpty(t.bins.binCount)?Ti.getDerivedBinCount(e):t.bins.binCount,mt(c,"qDimensions.0.qDef.qSortCriterias",[{qSortByNumeric:1}]),mt(c,"qDimensions.0.qDef.qFieldLabels",[e.qHyperCube.qDimensionInfo[0].qFallbackTitle]),mt(c,"qMeasures.0.qDef.qLabel",e.measureAxis.label||i.get("Visualization.Histogram.MeasureAxisLabel")),mt(t,"qUndoExclude.box.qHyperCubeDef",c),mt(t,"qUndoExclude.bins.binSize",o.binSize),mt(t,"qUndoExclude.bins.offset",o.binOffset),mt(t,"qUndoExclude.bins.binCount",p)}};var Bi={isOnComponentForRange:function(e,t,n){return!!e&&!!n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>-1!==t.indexOf(e.settings.key))[0]},isOnComponentForLasso:function(e,t,n){return e&&n.chart.componentsFromPoint({x:e.center.x,y:e.center.y}).filter(e=>e.settings.key===t.keys.componentKey)[0]},isOnComponentForNavBtn:function(e,t,n){return n.chart.componentsFromPoint(e.center).some(e=>e.settings.key===t)}};var $i={callLassoGesture:function(e,t,n){return{type:"Pan",options:{direction:E.DIRECTION_ALL,threshold:1,enable(r,i){if(e.lassoing)return t.isSelectionEnabled();const o=Bi.isOnComponentForLasso(i,n,this);return t.isSelectionEnabled()&&i&&((a=n.handlers).selectionHandler.lassoState()&&!a.selectionHandler.allFieldsLocked()||e.lassoing)&&o;var a},event:"lasso"},recognizeWith:n.handlers.scrollHandler?"drag":null,events:{lassostart(r){Bi.isOnComponentForLasso(r,n,this)&&(t.switchTo("lasso",this.chart,r),e.lassoing=!0,n.handlers.selectionHandler.pauseEngineCalls(n.keys.lassoBrushKey),r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoStart",r))},lassomove(n){e.lassoing&&(n.clientX=n.pointers[0].clientX,n.clientY=n.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoMove",n))},lassoend(r){e.lassoing&&(r.clientX=r.pointers[0].clientX,r.clientY=r.pointers[0].clientY,t.doEmit(this.chart,"lasso","lassoEnd",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!0),e.lassoing=!1)},lassocancel(r){e.lassoing=!1,t.doEmit(this.chart,"lasso","lassoCancel",r),n.handlers.selectionHandler.resumeEngineCalls(n.keys.lassoBrushKey,!1)}}}}};var Ui={callMeasureRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?E.DIRECTION_HORIZONTAL:E.DIRECTION_VERTICAL,event:"measurerange",enable(i,o){if(!n.rangeSelStatus.isOpenMea)return!1;if(e.measureSelecting)return t.isSelectionEnabled();const a="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=Bi.isOnComponentForRange(o,a,this);return e.measureSelecting=t.isSelectionEnabled()&&!!o&&!!s,e.measureSelecting&&!!n.keys.measureRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{measurerangestart(i){const o="measurerange"===n.active.gesture?[r,n.keys.componentKey]:[r];Bi.isOnComponentForRange(i,o,this)&&(e.measureSelecting=!0,t.switchTo("measurerange",this.chart,i),t.doEmit(this.chart,"rangeMeasure","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.measureRangeBrushKey))},measurerangemove(n){e.measureSelecting&&t.doEmit(this.chart,"rangeMeasure","rangeMove",n)},measurerangeend(r){e.measureSelecting&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!0),t.doEmit(this.chart,"rangeMeasure","rangeEnd",r),e.measureSelecting=!1)},measurerangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.measureRangeBrushKey,!1),e.measureSelecting=!1}}}}};function Ki(e,t){let n;return n="x-axis"===e?"horizontal"===t?E.DIRECTION_VERTICAL:E.DIRECTION_HORIZONTAL:"horizontal"===t?E.DIRECTION_HORIZONTAL:E.DIRECTION_VERTICAL,n}var Wi={callAreaRangeGesture:function(e,t,n,r){const i=n.keys.dimRangeBrushKey?"majorrange":"measurerange";return{type:"Pan",options:{direction:Ki(r,n.isHorizontal),event:"arearange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.minoring)return t.isSelectionEnabled();const a="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=Bi.isOnComponentForRange(o,a,this);return e.minoring=t.isSelectionEnabled()&&!!o&&!!s,e.minoring}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{arearangestart(i){const o="arearange"===n.active.gesture?[r,n.keys.componentKey]:[r];Bi.isOnComponentForRange(i,o,this)&&(e.minoring=!0,t.switchTo("arearange",this.chart,i),t.doEmit(this.chart,"rangeMinor","areaStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.areaBrushKey))},arearangemove(r){e.minoring&&(this.chart.brush(n.keys.areaBrushKey).clear(),t.doEmit(this.chart,"rangeMinor","areaMove",r))},arearangeend(r){e.minoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!0),t.doEmit(this.chart,"rangeMinor","areaEnd",r),e.minoring=!1)},arearangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.areaBrushKey,!1),e.minoring=!1}}}}};var Yi={callDimensionRangeGesture:function(e,t,n,r){const i=n.keys.measureRangeBrushKey?"measurerange":"arearange";return{type:"Pan",options:{direction:n.isHorizontal?E.DIRECTION_VERTICAL:E.DIRECTION_HORIZONTAL,event:"majorrange",enable(i,o){if(!n.rangeSelStatus.isOpenDim)return!1;if(e.majoring)return t.isSelectionEnabled();const a="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r],s=Bi.isOnComponentForRange(o,a,this);return e.majoring=t.isSelectionEnabled()&&!!o&&!!s,e.majoring&&!!n.keys.dimRangeBrushKey}},requireFailure:`lasso ${i}`,recognizeWith:n.handlers.scrollHandler?"drag":null,events:{majorrangestart(i){const o="majorrange"===n.active.gesture?[r,n.keys.componentKey]:[r];Bi.isOnComponentForRange(i,o,this)&&(e.majoring=!0,t.switchTo("majorrange",this.chart,i),t.doEmit(this.chart,"rangeDim","rangeStart",i),n.handlers.selectionHandler.pauseEngineCalls(n.keys.dimRangeBrushKey))},majorrangemove(n){e.majoring&&t.doEmit(this.chart,"rangeDim","rangeMove",n)},majorrangeend(r){e.majoring&&(n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!0),t.doEmit(this.chart,"rangeDim","rangeEnd",r),e.majoring=!1)},majorrangecancel(){n.handlers.selectionHandler.resumeEngineCalls(n.keys.dimRangeBrushKey,!1),e.majoring=!1}}}}};var Gi={callDragGesture:function(e,t,n,r,i){let o={};return{type:"Pan",options:{direction:n.isHorizontal?E.DIRECTION_VERTICAL:E.DIRECTION_HORIZONTAL,event:"drag",enable(r,i){return e.dragging?t.isNavigationEnabled():(e.dragging=t.isNavigationEnabled()&&!!i&&!!this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>e.settings.key===n.keys.componentKey)[0],e.dragging)}},requireFailure:r?`lasso ${t.getBrushConfig()}`:"",events:{dragstart(e){o={x:e.deltaX,y:e.deltaY};let t=-(n.isHorizontal?e.deltaY:e.deltaX)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(t=-t),n.handlers.scrollHandler.getScrollApi().move(t)},dragmove(t){if(!e.dragging)return;let r=-(n.isHorizontal?t.deltaY-o.y:t.deltaX-o.x)/n.handlers.scrollHandler.getItemSize();!n.isHorizontal&&i&&(r=-r),n.handlers.scrollHandler.getScrollApi().move(r),o={x:t.deltaX,y:t.deltaY}},dragend(){e.dragging&&(e.dragging=!1)},dragcancel(){e.dragging=!1}}}}};var Ji={callNavBtnGesture:function(e,t){return{type:"Tap",options:{event:"navBtnTap",enable(n,r){return!(!r||!e())&&Bi.isOnComponentForNavBtn(r,t,this)}},events:{navBtnTap(e){this.chart.componentsFromPoint(e.center).forEach(t=>{const n=e.target,r=n?n.getAttribute("data-action"):"";if(r)return t.emit(r)})}}}}};var Zi={create:function(e,t,n,r,i){const o={};t=t||"vertical";const a=r.lassoBrushKey||"select",s=r.dimRangeBrushKey||null,l=r.measureRangeBrushKey||null,u=r.areaBrushKey||null,c=r.legendBrushKey||null,p=!!e.selectionHandler&&e.selectionHandler.isOn(),d={dragging:!1,lassoing:!1,majoring:!1,minoring:!1,measureSelecting:!1},f={gesture:"",type:""},m="horizontal"===t,h=m?"y-axis":"x-axis",g=m?"x-axis":"y-axis";function y(e,t,n){if(f.gesture===e)return;let r=a;const i=t||f.chart;switch(f.gesture){case"majorrange":b(i,"rangeDim","rangeClear",n),r=s;break;case"measurerange":b(i,"rangeMeasure","rangeClear",n),r=l;break;case"arearange":b(i,"rangeMinor","areaClear",n),r=u}f.gesture=e;const o="range"===e?"range":"item";f.type&&f.type!==o&&i.brush(r).clear(),f.chart=t,f.type=o}function b(e,t,n,r){if(e){const i=e.component(t);i&&i.emit(n,r)}}let v=[];const q={isSelectionEnabled:()=>e.selectionHandler&&e.selectionHandler.isOn(),isNavigationEnabled:()=>e.scrollHandler&&e.scrollHandler.isOn(),doEmit:b,switchTo:y,getBrushConfig:function(){return s?l?"majorrange measurerange":"majorrange arearange":"measurerange arearange"}},x={handlers:e,keys:r,isHorizontal:m,active:f,rangeSelStatus:i};function D(){y("none"),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}return p&&(v=[{type:"Tap",options:{event:"rangeClearTap"},events:{rangeClearTap(e){y("none",this.chart,e),d.majoring=!1,d.measureSelecting=!1,d.minoring=!1}}}],v.unshift(Ji.callNavBtnGesture(q.isNavigationEnabled,c)),v.push($i.callLassoGesture(d,q,x)),s?l?(v.push(Yi.callDimensionRangeGesture(d,q,x,h)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),v.push(Ui.callMeasureRangeGesture(d,q,x,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"})):(v.push(Yi.callDimensionRangeGesture(d,q,x,h)),e.selectionHandler.addComponent(s,{id:"rangeDim",clear:"rangeClear"}),v.push(Wi.callAreaRangeGesture(d,q,x,g)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"})):(v.push(Ui.callMeasureRangeGesture(d,q,x,g)),e.selectionHandler.addComponent(l,{id:"rangeMeasure",clear:"rangeClear"}),v.push(Wi.callAreaRangeGesture(d,q,x,h)),e.selectionHandler.addComponent(u,{id:"rangeMinor",clear:"areaClear"}))),e.scrollHandler&&(v.push(Gi.callDragGesture(d,q,x,p,n)),e.scrollHandler.getScrollApi().on("update",D)),o.gestures=v,o.destroy=function(){e.scrollHandler&&e.scrollHandler.getScrollApi().removeListener("update",D)},o}};const Qi=(e,t)=>(t.components||[]).find(t=>t.key===e),Xi=(e,t,n)=>{var r,i,o,a;const s=null===(r=Qi("axis",n))||void 0===r?void 0:r.axis;return{text:{fontFamily:(null==s||null===(i=s.title)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.title","fontFamily"),fontSize:(null==s||null===(o=s.title)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.title","fontSize"),fill:(null==s||null===(a=s.title)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"axis.title","color")}}},eo=(e,t,n)=>{var r,i,o,a;const s=null===(r=Qi("axis",n))||void 0===r?void 0:r.axis;return{labels:{fontFamily:(null==s||null===(i=s.label)||void 0===i||null===(i=i.name)||void 0===i?void 0:i.fontFamily)||t.getStyle(e,"axis.label.name","fontFamily"),fontSize:(null==s||null===(o=s.label)||void 0===o||null===(o=o.name)||void 0===o?void 0:o.fontSize)||t.getStyle(e,"axis.label.name","fontSize"),fill:(null==s||null===(a=s.label)||void 0===a||null===(a=a.name)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color)||t.getStyle(e,"axis.label.name","color")}}};function to(e){const t=pt(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0.qApprMaxGlyphCount",0);return Math.min(20,t)}const no={createSettings:function(e){return{settings:{labels:{maxGlyphCount:to(e)}}}}};const ro={createSettings:function(e){const t=Ti.isAutoBin(e),n=Ti.getBinMode(e),r=Ti.getDerivedBinSize(e);let i,o;if(t||"maxCount"===n){const t=Ti.getDerivedBinOffset(e);i=t,o=t+Ti.getDerivedBinCount(e)*r}else{const t=pt(e,"qUndoExclude.box.qHyperCube.qDimensionInfo.0",{});i=t.qMin||0,o=(t.qMax||0)+r}return{component:{type:"linear",min:i,max:o}}}},io={aliceblue:{r:240,g:248,b:255},antiquewhite:{r:250,g:235,b:215},aqua:{r:0,g:255,b:255},aquamarine:{r:127,g:255,b:212},azure:{r:240,g:255,b:255},beige:{r:245,g:245,b:220},bisque:{r:255,g:228,b:196},black:{r:0,g:0,b:0},blanchedalmond:{r:255,g:235,b:205},blue:{r:0,g:0,b:255},blueviolet:{r:138,g:43,b:226},brown:{r:165,g:42,b:42},burlywood:{r:222,g:184,b:135},cadetblue:{r:95,g:158,b:160},chartreuse:{r:127,g:255,b:0},chocolate:{r:210,g:105,b:30},coral:{r:255,g:127,b:80},cornflowerblue:{r:100,g:149,b:237},cornsilk:{r:255,g:248,b:220},crimson:{r:220,g:20,b:60},cyan:{r:0,g:255,b:255},darkblue:{r:0,g:0,b:139},darkcyan:{r:0,g:139,b:139},darkgoldenrod:{r:184,g:134,b:11},darkgray:{r:169,g:169,b:169},darkgreen:{r:0,g:100,b:0},darkgrey:{r:169,g:169,b:169},darkkhaki:{r:189,g:183,b:107},darkmagenta:{r:139,g:0,b:139},darkolivegreen:{r:85,g:107,b:47},darkorange:{r:255,g:140,b:0},darkorchid:{r:153,g:50,b:204},darkred:{r:139,g:0,b:0},darksalmon:{r:233,g:150,b:122},darkseagreen:{r:143,g:188,b:143},darkslateblue:{r:72,g:61,b:139},darkslategray:{r:47,g:79,b:79},darkslategrey:{r:47,g:79,b:79},darkturquoise:{r:0,g:206,b:209},darkviolet:{r:148,g:0,b:211},deeppink:{r:255,g:20,b:147},deepskyblue:{r:0,g:191,b:255},dimgray:{r:105,g:105,b:105},dimgrey:{r:105,g:105,b:105},dodgerblue:{r:30,g:144,b:255},firebrick:{r:178,g:34,b:34},floralwhite:{r:255,g:250,b:240},forestgreen:{r:34,g:139,b:34},fuchsia:{r:255,g:0,b:255},gainsboro:{r:220,g:220,b:220},ghostwhite:{r:248,g:248,b:255},gold:{r:255,g:215,b:0},goldenrod:{r:218,g:165,b:32},gray:{r:128,g:128,b:128},green:{r:0,g:128,b:0},greenyellow:{r:173,g:255,b:47},grey:{r:128,g:128,b:128},honeydew:{r:240,g:255,b:240},hotpink:{r:255,g:105,b:180},indianred:{r:205,g:92,b:92},indigo:{r:75,g:0,b:130},ivory:{r:255,g:255,b:240},khaki:{r:240,g:230,b:140},lavender:{r:230,g:230,b:250},lavenderblush:{r:255,g:240,b:245},lawngreen:{r:124,g:252,b:0},lemonchiffon:{r:255,g:250,b:205},lightblue:{r:173,g:216,b:230},lightcoral:{r:240,g:128,b:128},lightcyan:{r:224,g:255,b:255},lightgoldenrodyellow:{r:250,g:250,b:210},lightgray:{r:211,g:211,b:211},lightgreen:{r:144,g:238,b:144},lightgrey:{r:211,g:211,b:211},lightpink:{r:255,g:182,b:193},lightsalmon:{r:255,g:160,b:122},lightseagreen:{r:32,g:178,b:170},lightskyblue:{r:135,g:206,b:250},lightslategray:{r:119,g:136,b:153},lightslategrey:{r:119,g:136,b:153},lightsteelblue:{r:176,g:196,b:222},lightyellow:{r:255,g:255,b:224},lime:{r:0,g:255,b:0},limegreen:{r:50,g:205,b:50},linen:{r:250,g:240,b:230},magenta:{r:255,g:0,b:255},maroon:{r:128,g:0,b:0},mediumaquamarine:{r:102,g:205,b:170},mediumblue:{r:0,g:0,b:205},mediumorchid:{r:186,g:85,b:211},mediumpurple:{r:147,g:112,b:219},mediumseagreen:{r:60,g:179,b:113},mediumslateblue:{r:123,g:104,b:238},mediumspringgreen:{r:0,g:250,b:154},mediumturquoise:{r:72,g:209,b:204},mediumvioletred:{r:199,g:21,b:133},midnightblue:{r:25,g:25,b:112},mintcream:{r:245,g:255,b:250},mistyrose:{r:255,g:228,b:225},moccasin:{r:255,g:228,b:181},navajowhite:{r:255,g:222,b:173},navy:{r:0,g:0,b:128},oldlace:{r:253,g:245,b:230},olive:{r:128,g:128,b:0},olivedrab:{r:107,g:142,b:35},orange:{r:255,g:165,b:0},orangered:{r:255,g:69,b:0},orchid:{r:218,g:112,b:214},palegoldenrod:{r:238,g:232,b:170},palegreen:{r:152,g:251,b:152},paleturquoise:{r:175,g:238,b:238},palevioletred:{r:219,g:112,b:147},papayawhip:{r:255,g:239,b:213},peachpuff:{r:255,g:218,b:185},peru:{r:205,g:133,b:63},pink:{r:255,g:192,b:203},plum:{r:221,g:160,b:221},powderblue:{r:176,g:224,b:230},purple:{r:128,g:0,b:128},red:{r:255,g:0,b:0},rosybrown:{r:188,g:143,b:143},royalblue:{r:65,g:105,b:225},saddlebrown:{r:139,g:69,b:19},salmon:{r:250,g:128,b:114},sandybrown:{r:244,g:164,b:96},seagreen:{r:46,g:139,b:87},seashell:{r:255,g:245,b:238},sienna:{r:160,g:82,b:45},silver:{r:192,g:192,b:192},skyblue:{r:135,g:206,b:235},slateblue:{r:106,g:90,b:205},slategray:{r:112,g:128,b:144},slategrey:{r:112,g:128,b:144},snow:{r:255,g:250,b:250},springgreen:{r:0,g:255,b:127},steelblue:{r:70,g:130,b:180},tan:{r:210,g:180,b:140},teal:{r:0,g:128,b:128},thistle:{r:216,g:191,b:216},tomato:{r:255,g:99,b:71},transparent:{r:255,g:255,b:255,a:0},turquoise:{r:64,g:224,b:208},violet:{r:238,g:130,b:238},wheat:{r:245,g:222,b:179},white:{r:255,g:255,b:255},whitesmoke:{r:245,g:245,b:245},yellow:{r:255,g:255,b:0},yellowgreen:{r:154,g:205,b:50}},oo=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i,ao=/^rgba\((\d{1,3}),(\d{1,3}),(\d{1,3}),(\d(\.\d+)?)\)$/i,so=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i,lo=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i,uo=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i,co=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i,po=Math.floor,fo=Math.round,mo=Zn.extend({init(){let e,t,n,r,i,o,a,s,l,u,c,p,d=0,f=0,m=0,h=1;if(this._invalid=!1,arguments[0]instanceof mo)d=arguments[0]._r,f=arguments[0]._g,m=arguments[0]._b,h=arguments[0]._a,this._invalid=arguments[0]._invalid;else if(arguments.length<3)if("string"==typeof arguments[0])if(p=arguments[0],c=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(p))d=parseInt(c[1],10),f=parseInt(c[2],10),m=parseInt(c[3],10);else if(c=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(p))d=parseInt(c[1],10),f=parseInt(c[2],10),m=parseInt(c[3],10),h=parseFloat(c[4]);else if(c=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(p))d=parseInt(c[1],16),f=parseInt(c[2],16),m=parseInt(c[3],16),h=1;else if(c=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(p))d=parseInt(c[1]+c[1],16),f=parseInt(c[2]+c[2],16),m=parseInt(c[3]+c[3],16),h=1;else if(c=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,m=l[2]+u,d=fo(255*d),f=fo(255*f),m=fo(255*m),h=1}else if(c=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),r=parseFloat(c[5]),h=parseFloat(c[7]),e%=360,t/=100,r/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,r=r<0?0:r>1?1:r,o=r<=.5?2*r*t:(2-2*r)*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=r-.5*o,d=l[0]+u,f=l[1]+u,m=l[2]+u,d=fo(255*d),f=fo(255*f),m=fo(255*m)}else if(c=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(p)){switch(e=parseFloat(c[1]),t=parseFloat(c[3]),i=parseFloat(c[5]),e%=360,t/=100,i/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,i=i<0?0:i>1?1:i,o=i*t,a=e/60,s=o*(1-Math.abs(a%2-1)),l=[],a=Math.floor(a),a){case 0:l=[o,s,0];break;case 1:l=[s,o,0];break;case 2:l=[0,o,s];break;case 3:l=[0,s,o];break;case 4:l=[s,0,o];break;case 5:l=[o,0,s];break;default:l=[0,0,0]}u=i-o,d=l[0]+u,f=l[1]+u,m=l[2]+u,d=fo(255*d),f=fo(255*f),m=fo(255*m),h=1}else io[p.toLowerCase()]?(n=p.toLowerCase(),d=io[n].r,f=io[n].g,m=io[n].b,h="number"==typeof io[n].a?io[n].a:1):this._invalid=!0;else"number"==typeof arguments[0]&&arguments[0]>=0&&"argb"===arguments[1]?(h=(4278190080&arguments[0])>>>24,h/=255,d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,m=255&arguments[0]):"number"==typeof arguments[0]&&arguments[0]>=0?(d=(16711680&arguments[0])>>16,f=(65280&arguments[0])>>8,m=255&arguments[0]):this._invalid=!0;else arguments.length>=3?(d=arguments[0],f=arguments[1],m=arguments[2],h=arguments.length>=4?arguments[3]:1):this._invalid=!0;Number.isNaN(+d+f+m+h)&&(this._invalid=!0),this._r=po(d),this._g=po(f),this._b=po(m),this._a=h,this._spaces={}},isInvalid(){return this._invalid},setAlpha(e){this._a=e,this._spaces={}},getAlpha(){return this._a},toRGB:function(){return this._spaces.rgb||(this._spaces.rgb=mo.toRGB(this)),this._spaces.rgb},toRGBA:function(){return this._spaces.rgba||(this._spaces.rgba=mo.toRGBA(this)),this._spaces.rgba},toString(){return this._spaces.rgb||(this._spaces.rgb=mo.toRGB(this)),this._spaces.rgb},toHex:function(){return this._spaces.hex||(this._spaces.hex=mo.toHex(this)),this._spaces.hex},toHSL:function(e){return this._spaces.hsl||(this._spaces.hsl=mo.toHSL(this,e)),this._spaces.hsl},toHSLA:function(e){return this._spaces.hsla||(this._spaces.hsla=mo.toHSLA(this,e)),this._spaces.hsla},toHSV(){const e=this.toHSVComponents();return`hsv(${e.h},${e.s},${e.v})`},toHSVComponents:function(){return this._spaces.hsvComp||(this._spaces.hsvComp=mo.toHSVComponents(this)),this._spaces.hsvComp},toNumber:function(){return this._spaces.num||(this._spaces.num=mo.toNumber(this)),this._spaces.num},isDark(){return this.isInvalid()||this.getLuminance()<125},getLuminance(){return void 0===this._lumi&&(this._lumi=.299*this._r+.587*this._g+.114*this._b),this._lumi},shiftLuminance(e){const t=this.toHSLA(),n=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,(\d(\.\d+)?)\)$/i.exec(t),r=parseFloat(n[1]),i=parseFloat(n[3]);let o=parseFloat(n[5]);const a=parseFloat(n[7]);return o+=e,o=Math.max(0,Math.min(o,100)),`hsla(${r},${i},${o},${a})`},isEqual(e){return e instanceof mo||(e=new mo(e)),this._r===e._r&&this._g===e._g&&this._b===e._b},blend(e,t){return`rgba(${[po(this._r+(e._r-this._r)*t),po(this._g+(e._g-this._g)*t),po(this._b+(e._b-this._b)*t),po(this._a+(e._a-this._a)*t)].join(",")})`},createShiftedColor(e){(void 0===e||Number.isNaN(+e))&&(e=1);const t=this.getLuminance(),n=this._g<126?1:1+this._g/512,r=this.shiftLuminance(20*(t*n<220?.8+1/(t+1)*4:-(.8+t/255*1))*e);return new mo(r)}});mo.toRGB=function(e){if(e instanceof mo)return`rgb(${[e._r,e._g,e._b].join(",")})`;"string"==typeof e&&(e=mo.toNumber(e));return`rgb(${(16711680&e)>>16},${(65280&e)>>8},${255&e})`},mo.toRGBA=function(e,t){if(e instanceof mo)return`rgba(${[e._r,e._g,e._b,void 0!==t?t:e._a].join(",")})`;"string"==typeof e&&(e=mo.toNumber(e));return`rgba(${(16711680&e)>>16},${(65280&e)>>8},${255&e},${void 0!==t?t:e._a})`},mo.toHex=function(e){let t,n,r;return e instanceof mo?(t=e._r.toString(16),n=e._g.toString(16),r=e._b.toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${[t,n,r].join("")}`):("string"==typeof e&&(e=mo.toNumber(e)),t=((16711680&e)>>16).toString(16),n=((65280&e)>>8).toString(16),r=(255&e).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`)},mo.toHSL=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new mo(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=Math.max(a,s,l),c=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(u+c)/2,u===c)n=0,o=0;else{switch(i=u-c,n=r>.5?i/(2-u-c):i/(u+c),u){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsl(${360*o},${100*n},${100*r})`},mo.toHSLA=function(e,t){let n,r,i,o=0;"string"==typeof e&&(e=new mo(e));const a=e._r/255,s=e._g/255,l=e._b/255,u=e._a,c=Math.max(a,s,l),p=Math.min(a,s,l);if(r=t?.21*a+.72*s+.07*l:(c+p)/2,c===p)n=0,o=0;else{switch(i=c-p,n=r>.5?i/(2-c-p):i/(c+p),c){case a:o=(s-l)/i+(s<l?6:0);break;case s:o=(l-a)/i+2;break;case l:o=(a-s)/i+4}o/=6}return`hsla(${360*o},${100*n},${100*r},${u})`},mo.toHSVComponents=function(e){let t,n,r=0;"string"==typeof e&&(e=new mo(e));const i=e._r/255,o=e._g/255,a=e._b/255,s=Math.max(i,o,a),l=Math.min(i,o,a),u=s;if(s===l)t=0,r=0;else{switch(n=s-l,t=0===n?0:n/u,s){case i:r=(o-a)/n+(o<a?6:0);break;case o:r=(a-i)/n+2;break;case a:r=(i-o)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*u}},mo.toNumber=function(){if(1===arguments.length&&arguments[0]instanceof mo)return(arguments[0]._r<<16)+(arguments[0]._g<<8)+arguments[0]._b;let e,t,n=0,r=0,i=0;return 1===arguments.length&&"string"==typeof arguments[0]&&(t=arguments[0],(e=/^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)$/i.exec(t))?(n=parseInt(e[1],10),r=parseInt(e[2],10),i=parseInt(e[3],10)):(e=/^#([A-f0-9]{2})([A-f0-9]{2})([A-f0-9]{2})$/i.exec(t))?(n=parseInt(e[1],16),r=parseInt(e[2],16),i=parseInt(e[3],16)):(e=/^#([A-f0-9])([A-f0-9])([A-f0-9])$/i.exec(t))&&(n=parseInt(e[1]+e[1],16),r=parseInt(e[2]+e[2],16),i=parseInt(e[3]+e[3],16))),(n<<16)+(r<<8)+i},mo.blend=function(e,t,n){const r=(16711680&(e=mo.toNumber(e)))>>16,i=(65280&e)>>8,o=255&e;return(r+(((16711680&(t=mo.toNumber(t)))>>16)-r)*n<<16)+(i+(((65280&t)>>8)-i)*n<<8)+(o+((255&t)-o)*n)},mo.getBlend=function(e,t,n){const r=e._r+(t._r-e._r)*n,i=e._g+(t._g-e._g)*n,o=e._b+(t._b-e._b)*n,a=e._a+(t._a-e._a)*n;return new mo(r,i,o,a)},mo.isCSSColor=function(e){return!(arguments.length>1||"string"!=typeof e)&&(oo.test(e)||ao.test(e)||so.test(e)||lo.test(e)||uo.test(e)||co.test(e)||io[e.toLowerCase()])},mo.getBestContrast=function(e,t,n){const r=e.getLuminance();return Math.abs(r-t.getLuminance())>Math.abs(r-n.getLuminance())?t:n},mo.getContrast=function(e,t){if(!e||!t)return;const n=e.getLuminance()/100,r=t.getLuminance()/100;return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},mo.isDark=function(){const e={getLuminance:mo.prototype.getLuminance,isInvalid:mo.prototype.isInvalid};return mo.prototype.init.apply(e,[].slice.call(arguments)),mo.prototype.isDark.call(e)},mo.useDarkLabel=function(e,t){return e._a>.5?!e.isDark():!t};const ho={TRANSPARENT_BLACK:"rgba( 0,0,0,0.2 )",TRANSPARENT_WHITE:"rgba( 255,255,255,0.7 )",LIGHT_GREY:"#ccc",DARK_GREY:"#666",BLACK:"#000",WHITE:"#fff",getInverse(e){const t=new mo(e);return 0===t.getAlpha()?this.BLACK:t.isDark()?this.WHITE:this.BLACK},getContrastingGrey(e){const t=new mo(e);return 0===t.getAlpha()?this.DARK_GREY:mo.getBestContrast(t,new mo(ho.LIGHT_GREY),new mo(ho.DARK_GREY))},getBestContrast:(e,t,n)=>mo.getBestContrast(new mo(e),new mo(t),new mo(n)),getContrastingTransparent(e){const t=new mo(e);return 0===t.getAlpha()||"none"===e?this.TRANSPARENT_BLACK:t.isDark()?this.TRANSPARENT_WHITE:this.TRANSPARENT_BLACK}};const go={createSettings:function(e,t,n,r,i,o){const{theme:a}=e.environment,s=a.getColorPickerColor(t.color.bar.paletteColor),l=Ti.getDerivedBinSize(t),u=[],c=[n.consume,r.consume,i.consume];return e._tooltipHandler.isOn()&&(u.push(o.box.trigger),c.push.apply(c,o.box.consume)),u.push(n.trigger),{key:"box-marker",settings:{box:{fill:s,stroke:ho.getContrastingGrey(s).toHex(),strokeWidth:1,maxWidthPx:1/0,minWidthPx:NaN,minWidth:0},major:{scale:"dimension",ref:{start:"binStart",end:"binEnd"}},minor:{scale:"measure"},whiskers:!1,orientation:"vertical"},brush:{trigger:u,consume:c},data:{extract:{field:"qDimensionInfo/0",props:{start:0,end:{field:"qMeasureInfo/0"},measure:{field:"qMeasureInfo/0",reduce:"first",value:e=>e,reduceLabel:"none"},binStart:{field:"qDimensionInfo/0",value:e=>e.qNum},binEnd:{field:"qDimensionInfo/0",value:e=>e.qNum+l},elemNo:{field:"qDimensionInfo/0"},bin:{field:"qDimensionInfo/0",value:e=>e}}}}}}};const yo={createSettings:function(e,t,n){const r=t.getStyles(),i=((e,t,n)=>{var r,i,o,a;const s=null===(r=Qi("value",n))||void 0===r?void 0:r.label,l=(null==s||null===(i=s.value)||void 0===i?void 0:i.fontFamily)||t.label.value.fontFamily;let u=(null==s||null===(o=s.value)||void 0===o?void 0:o.fontSize)||t.label.value.fontSize;return u=parseFloat(u),{fontFamily:l,fontSize:u,fill:null==s||null===(a=s.value)||void 0===a||null===(a=a.fontColor)||void 0===a?void 0:a.color}})(0,r,e),o=i.fill||r.label.value.color;return{settings:{sources:[{strategy:{settings:{...i,labels:[{placements:[{fill:o},{fill:i.fill?o:e=>mo.isDark(e.node.attrs.fill)?r.label.value.lightColor:r.label.value.darkColor}]}]}}}]}}}},bo="object.histogram";function vo(e){return pt(e,"qHyperCube.qDimensionInfo.0.qIsOneAndOnlyOne",!1)}const qo={createChartSettings:function(e,t){const n=e.isRtl(),r=pt(t,"qHyperCube.qDimensionInfo.0",{}).qFallbackTitle||"",{theme:i,translator:o}=e.environment,a=Cr.create({chartID:bo,theme:i,isRtl:n,flags:e.flags}),s=function(e){var t=e.theme,n=e.config,r=void 0===n?{}:n,i=r.id,o=r.resolve,a=void 0===o?[]:o,s=r.transform,l=void 0===s?[]:s,u=r.extend,c=void 0===u?[]:u,p={theme:t,matrix:At(a),styles:void 0};return p.styles=Nt({theme:t,id:i,transform:l,extend:c,matrix:p.matrix}),{getStyles:function(){return p.styles},getTheme:function(){return p.theme},setTheme:function(e){p.theme=e,p.styles=Nt({theme:e,id:i,transform:l,extend:c,matrix:p.matrix})}}}({theme:i,config:{id:"histogram"}});let l={},u={},c={};e._selectionHandler.isOn()&&(e._selectionHandler.setUpStart(),l=e._selectionHandler.setUpBrush({contexts:["select"],data:["elemNo"],dataPath:"qUndoExclude/box"}),u=e._selectionHandler.setUpBrush({contexts:["select-dimension"],data:["elemNo"],dataPath:"qUndoExclude/box",isSingleSelect:vo(t)}),c=e._selectionHandler.setUpBrush({dataPath:"qUndoExclude/box",contexts:["select-measure"],data:["end"]}),e._selectionHandler.setUpDone());const p={box:{}};e._tooltipHandler.isOn()&&(p.box=e._tooltipHandler.setUp({chartBuilder:a,environment:e.environment,data:[""],contexts:["boxTip"],componentKey:"box-marker",measureRows:["measure"],labelData:["bin"]}));const d=function(e){const t={};return e?(t.isOpenDim=!1,t.isOpenMea=!1):(t.isOpenDim=!0,t.isOpenMea=!0),t}(function(e){const t=e.qUndoExclude&&e.qUndoExclude.box&&e.qUndoExclude.box.qHyperCube&&e.qUndoExclude.box.qHyperCube.qDimensionInfo?e.qUndoExclude.box.qHyperCube.qDimensionInfo:void 0;return!!t&&!!t[0].qLocked}(t)),f={scrollHandler:null,selectionHandler:e._selectionHandler};this._dependentActions&&this._dependentActions.destroy(),this._dependentActions=Zi.create(f,"vertical",n,{componentKey:"box-marker",lassoBrushKey:"select",dimRangeBrushKey:null,measureRangeBrushKey:"select-measure",areaBrushKey:"select-dimension"},d),a.addPreset("dimension-measure-chart",{isRtl:n,includeDimensionAxis:!0,orientation:"vertical",selectionsEnabled:e._selectionHandler.isOn(),theme:i,measureSource:"qMeasureInfo/0",measureScaleSettings:{component:{expand:0,include:[0]}},enableLasso:!0,lasso:{brushKey:"select",brushComponents:["box-marker"]},enableMeasureRange:!0,measureRange:{brushKey:"select-measure",brushAxis:"y-axis",brushArea:"box-marker",brushScale:"measure"},enableAreaRange:!0,areaRange:{brushKey:"select-dimension",brushAxis:"x-axis",brushData:["elemNo"],brushArea:"box-marker",brushScale:"rangeSelSettings",brushComponents:["box-marker"],multiple:!0,chartInstance:e.chartInstance},brushActions:this._dependentActions.gestures,dimensionSource:"qDimensionInfo/0",dimensionScaleSettings:ro.createSettings(t),measureAxisProperties:t.measureAxis,measureTitleText:t.measureAxis.label||o.get("Visualization.Histogram.MeasureAxisLabel"),dimensionAxisProperties:t.dimensionAxis,dimensionAxisSettings:no.createSettings(t),dimensionTitleText:r,gridlines:t.gridlines,hasNavigation:!1,isNavigationEnabledFn:()=>!1,refLines:t.refLine&&t.refLine.refLines,axisTitleStyle:Xi(bo,i,t),axisLabelStyle:eo(bo,i,t)});const m=a.getSettings(),h=go.createSettings(e,t,l,u,c,p);if(a.addComponent("box-marker",h),t.dataPoint&&t.dataPoint.showLabels){const e=yo.createSettings(t,s,bo);a.addComponent("labels",e)}return e.addSnapshotChartSettings(m,t),m.scales.rangeSelSettings={type:"linear",min:m.scales.dimension.min,max:m.scales.dimension.max,source:"qDimensionInfo/0"},m}};const xo=Tr.extend("Histogram",{namespace:".histogram",init:function({environment:e,flags:t,lasso:n,picasso:r,$element:i,backendApi:o,selectionsApi:a,renderState:s}){this._super(r,i,e,o,a),this.flags=t,this.renderState=s,this.picassoElement.__do_not_use_findShapes=this.chartInstance.findShapes.bind(this.chartInstance),this._derivedProperties=new bi,this._selectionHandler=zr.create({model:o.model,chartInstance:this.chartInstance,selectionsApi:a,selectPaths:["/qUndoExclude/box/qHyperCubeDef"],lasso:n}),this._tooltipHandler=ti.create(this.chartInstance,i,"object.histogram"),this.setDataPaths(["qUndoExclude/box/qHyperCube"])},updateConstraints:function(e){const t=!e.passive,n=!e.select&&!e.active;this._tooltipHandler[t?"on":"off"](),this._selectionHandler[n?"on":"off"]()},off:function(){this._tooltipHandler.off(),this._selectionHandler.off()},createChartSettings:function(e){return qo.createChartSettings(this,e)},setSnapshotData:function(e){return this._super(e),e.qUndoExclude.box.qHyperCube.qDataPages=this.layout.qUndoExclude.box.qHyperCube.qDataPages,Promise.resolve(e)},getDisclaimerAttributes:function(e){const t=function(){const t=pt(e,"qUndoExclude.box.qHyperCube.qDataPages.0.qMatrix",[]);return 1===t.length&&t[0][0]&&t[0][0].qIsNull}();return{data:e.qUndoExclude&&e.qUndoExclude.box,supportedDisclaimers:{LimitedData:!0,OnlyNanData:!0,OnlyNegativeOrZeroValues:!t,RequireNumericDimension:!0},options:{bottom:!0,supportNegative:!1,explicitOnlyNanData:t,explicitRequireNumericDimension:(n=e.qHyperCube,n.qDimensionInfo.length>0&&-1===n.qDimensionInfo[0].qTags.indexOf("$numeric"))}};var n},updateChart:function(e,t){if(!e.qUndoExclude)return Promise.resolve();this._super(e,t)},updateData:function(e){const t=this;return t._super(e).then(()=>{if(t._destroyed)return Promise.reject();e=t.layout;const n={height:Math.min(e.qHyperCube.qSize.qcy,1e3),width:2},r=t.backendApi.model;return!!this.layout.snapshotData?Promise.resolve():r.getEffectiveProperties().then(i=>t._destroyed?Promise.reject():t._derivedProperties.addDefaultHyperCubeHash(i.qHyperCubeDef,e.qHyperCube,t.environment.app,function(e,t){return{box:t.qHyperCubeDef,binMappings:Vi.getMappingValues(e),binProperties:t.bins,measureAxis:t.measureAxis,version:"2.0"}}(e,i)).then(o=>{if(t._destroyed)return Promise.reject();const a={layout:e,properties:i,model:r,hashData:o,generateDerivedProperties:(e,n)=>zi.generateHyperCubes(e,n,t.environment)};return t._derivedProperties.isDerivedUpToDate(a)?e.qUndoExclude?(t.renderState.restore(),t.backendApi.updateCache(e.qUndoExclude.box),t.getData(t.backendApi,e.qUndoExclude.box.qHyperCube,n)):Promise.resolve():(t.renderState.pending(),t._derivedProperties.updateDerivedProperties(a))}))})},paint:function(){const e=this.layout.qUndoExclude;return e&&e.box&&e.box.qHyperCube.qDataPages.length?this._super():Promise.resolve(!1)},isLassoDisabled:function(){return!1}});class Do{constructor(e){this.model=e,this.path="/qUndoExclude/box/qHyperCubeDef"}setCacheOptions({maxStackedValues:e}){}updateCache(e){}getData(e){return this.model.getHyperCubeData(this.path,e)}}var So={onChangeCalcCond:function(e){var t;const n=null==e?void 0:e.qHyperCubeDef,r=null==e||null===(t=e.qUndoExclude)||void 0===t||null===(t=t.box)||void 0===t?void 0:t.qHyperCubeDef;n&&r&&(r.qCalcCond=n.qCalcCond,r.qCalcCondition=n.qCalcCondition)}};const Mo=(e,t)=>({component:"styling-panel",chartTitle:"Object.Histogram",translation:"LayerStyleEditor.component.styling",subtitle:"LayerStyleEditor.component.styling",ref:"components",useGeneral:!0,useBackground:e,items:{axisTitleSection:{translation:"properties.axis.title",component:"panel-section",items:t.getOptions("axis","axis.title")},axisLabelSection:{translation:"properties.axis.label",component:"panel-section",items:t.getOptions("axis","axis.label.name")},valueLabelSection:{translation:"properties.value.label",component:"panel-section",items:t.getOptions("value","label.value")}}}),Eo="maxCount",Co="size";function wo(e){return!(e.bins&&e.bins.auto)}function Ao(e){return wo(e)&&e.bins.binMode===Eo}function Io(e){var t,n;const{translator:r,flags:i}=e,o=null==e||null===(t=e.flags)||void 0===t?void 0:t.isEnabled("SENSECLIENT_IM_2021_STYLINGPANEL_HISTOGRAM"),a=null==e||null===(n=e.flags)||void 0===n?void 0:n.isEnabled("SENSECLIENT_IM_2021_HISTOGRAM_BG"),s=e.theme,l={translation:"properties.colors",type:"items",items:{colors:{classification:{section:"color",tags:["simple"]},type:"items",items:{barColor:{ref:"color.bar.paletteColor",translation:"properties.histogram.barColor",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=s.getDataColorSpecials(),t=s.getDataColorPickerPalettes()[0].colors,n=t.indexOf(e);return{index:-1===n?Math.min(6,t.length-1):n}}}}}}},u="object.histogram",c=((e,t,n,r,i)=>r({theme:e,translator:t,flags:i,config:{id:n,paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}}))(s,r,u,pe,i),p=((e,t,n)=>{const r={getOptions:(r,i)=>{const o=(e,t)=>({ref:`${i}.fontColor`,component:"color-picker",width:!1,defaultValue:()=>{const n=e.getStyle(t,`${i}.color`,"color");return{color:n,index:e.getDataColorPickerPalettes()[0].colors.indexOf(n)}}});return{labelSection:{component:"items",ref:"components",key:r,items:{fontFamily:{ref:`${i}.fontFamily`,component:"dropdown",options:()=>e.getOptions(`${i}.fontFamily`),defaultValue:()=>e.getDefaultValue(`${i}.fontFamily`)},...((t,n)=>({fontWrapper:{component:"inline-wrapper",items:{fontSize:{ref:`${i}.fontSize`,component:"dropdown",width:!0,options:()=>e.getOptions(`${i}.fontSize`),defaultValue:()=>e.getDefaultValue(`${i}.fontSize`)},fontColor:{...o(t,n)}}}}))(t,n)}}}}};return r})(c,s,u),d={type:"items",translation:"properties.presentation",items:{stylingPanel:o&&Mo(a,p),gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridlines.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridSpacing:{ref:"gridlines.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridlines&&!e.gridlines.auto}}},showLabels:{ref:"dataPoint.showLabels",type:"boolean",translation:"properties.dataPoints.labelmode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],snapshot:{tid:"property-dataPoints"}}}},f={items:{labels:{items:{header:{show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},pointLabels:{component:"checkbox",ref:"dataPoint.showLabels",type:"boolean",translation:"Simple.Label.Value",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.XAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.dimensionAxis.show||"none"===r.dimensionAxis.show,set(e,t,n,r,i){i.dimensionAxis.show=e?"labels":"all"}}},measureTitle:{component:"checkbox",ref:"measureAxis.show",type:"string",translation:"Simple.Label.YAxis.Hide",defaultValue:"all",show(e){var t;return null===(t=e.qHyperCubeDef.qDimensions)||void 0===t?void 0:t.length},convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxis.show||"none"===r.measureAxis.show,set(e,t,n,r,i){i.measureAxis.show=e?"labels":"all"}}}}}}},m={uses:"settings",items:{simpleLabels:f,presentation:d,colors:l,measureAxis:{uses:"axis.picasso.measureAxis",items:{label:{type:"string",expression:"optional",expressionType:"StringExpression",ref:"measureAxis.label",defaultValue:"",translation:"Common.Label",placeholderTranslation:"Visualization.Histogram.MeasureAxisLabel"}}},dimensionAxis:{uses:"axis.picasso.dimensionAxis",items:{othersGroup:{items:{label:{show:!1}}}}}}},h={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond",change:So.onChangeCalcCond}}},refLines:{uses:"reflines",items:{colorBackground:{show:!1}}}}},g={uses:"data",items:{dimensions:{translation:"Common.Fields",alternativeTranslation:"properties.alternative.fields",items:{dimensionLimits:{show:!1,items:{otherMode:{readOnly:!1},otherSortMode:{show:e=>"OTHER_COUNTED"===pt(e,"qOtherTotalSpec.qOtherMode")},otherCounted:{show:e=>"OTHER_COUNTED"===pt(e,"qOtherTotalSpec.qOtherMode")},otherLimitMode:{show(e){const t=pt(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},otherLimit:{show(e){const t=pt(e,"qOtherTotalSpec.qOtherMode");return"OTHER_ABS_LIMITED"===t||"OTHER_REL_LIMITED"===t}},calculatedAgainstMessage:{show:!0,label(){const e=r.get("properties.histogram.staticMeasureName");return r.get("Properties.DimensionLimits.CalculatedAgainst",e)}}}},others:{show:!1,items:{suppressOther:{defaultValue:!0}}}}}}},y={ref:"bins.binMode",type:"string",component:"dropdown",options:[{value:Eo,translation:"Visualization.Histogram.Binning.NumberOfBinsOption"},{value:Co,translation:"Visualization.Histogram.Binning.BarWidthOption"}],defaultValue:Eo,show:e=>wo(e)},b={translation:"Visualization.Histogram.Bins",type:"items",component:"items",items:{auto:{ref:"bins.auto",translation:"Visualization.Histogram.Binning",component:"switch",type:"boolean",defaultValue:!0,undefinedValue:!1,options:[{value:!0,translation:"Visualization.Histogram.Binning.Auto"},{value:!1,translation:"Visualization.Histogram.Binning.Custom"}]},autoMessage:{component:"text",translation:"Visualization.Histogram.Binning.AutoDescription",show:e=>!wo(e)},mode:y,binCount:{ref:"bins.binCount",type:"number",expression:"optional",expressionType:"ValueExpression",translation:"Visualization.Histogram.Binning.BinCount",defaultValue:"",convertFunctions:{get(e,t,n){const r=n.properties.bins.binCount;return Ti.isEmpty(r)?Ti.getDerivedBinCount(n.layout):e(null)||""},set(e,t,n){t(n.type,e,void 0)}},show:Ao},binMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountRounding",show(e){const t=pt(e,"bins.binCount"),n="object"==typeof t;return Ao(e)&&!Ti.isEmpty(t)&&!n&&!Ni(t)&&t>0}},minBinMessage:{component:"text",translation:"Visualization.Histogram.Binning.BinCountMin",show(e){const t=pt(e,"bins.binCount");return!!(Ao(e)&&!Ti.isEmpty(t)&&t<=0)}},binSize:{ref:"bins.binSize",type:"number",expression:"optional",expressionType:"ValueExpression",defaultValue:10,show:e=>wo(e)&&e.bins.binMode===Co,translation:"Visualization.Histogram.Binning.BinSize"},offset:{ref:"bins.offset",type:"number",expression:"optional",expressionType:"ValueExpression",show:e=>wo(e)&&e.bins.binMode===Co,translation:"Visualization.Histogram.Binning.Offset"},distinct:{ref:"bins.countDistinct",type:"boolean",defaultValue:!1,component:"checkbox",translation:"Visualization.Histogram.CountDistinct"}}};return{type:"items",component:"accordion",items:{data:g,bins:b,addons:h,settings:m}}}var Oo={type:"items",component:"accordion",items:{data:{uses:"data",items:{dimensions:{translation:"Common.Fields"}}}}};var ko={getExportRawDataOptions:function(e){return{model:e.model,exportDataPath:"/qUndoExclude/box/qHyperCubeDef"}}};const No="qUndoExclude.box";function To(e){return{definition:Io(e),softDefinition:Oo,support:{cssScaling:!1,snapshot:!0,export:!0,exportData:!0,sharing:!0,viewData:!0},importProperties:(t,n,r,i)=>{const o=_(e);r.mapProperties();const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()};return R.hypercube.importProperties({exportFormat:t,initialProperties:n,dataDefinition:o,defaultPropertyValues:a,hypercubePath:i})},exportProperties:(e,t,n)=>R.hypercube.exportProperties({propertyTree:e,hyperCubePath:n?No:t,viewDataMode:n}),requireNumericDimension:!0,exportTableProperties(e){const t=No;return R.hypercube.exportProperties({propertyTree:e,hypercubePath:t,viewData:!0})},getExportRawDataOptions:ko.getExportRawDataOptions}}function Lo(C){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(w).forEach(t=>{e.add(w[t])})}}(C.translator);const k=_(C);return{qae:{properties:H,data:{targets:[k]},exportProperties:({propertyTree:e,hypercubePath:t,viewDataMode:n})=>R.hypercube.exportProperties({propertyTree:e,hypercubePath:n?"qUndoExclude.box":t})},ext:To(C),component(){const w=e(),k=g(),N=function(){const e=l(),t=u(),n=c(),r=a(),i=p(),o=d();return f(()=>({app:e,appLayout:t,deviceType:n,options:r,theme:i,translator:o}),[e,t,r.direction,r.freeResize,o.language(),i.name(),n])}(),T=N.options.renderer,L=f(()=>function(e){const t=D();return t.renderer.prio([e||"canvas"]),t.use(S),t.use(M(E)),t.use(A),t.component("disclaimer",I),t}(T),[T]),P=function(){const o=e(),[a,s]=t(!1),[l,u]=t(!1),c=!!n().qSelectionInfo.qInSelections,[p]=t(()=>({toggle(){u(e=>!e)}}));return r(()=>{o&&s(!o.select&&!o.active)},[o]),i(()=>({key:"lasso",label:"Lasso",icon:O,hidden:!a||!c,active:l,action(){u(e=>!e)}}),[c,l,a]),p.enabled=()=>a,p.active=()=>l,p}(),R=y(),F=b(),H=v(),_=q(),[j,V]=t();r(()=>{const e=x(k),t=new Do(R),n=F,r=new xo({$element:e,backendApi:t,environment:N,flags:C.flags,lasso:P,picasso:L,selectionsApi:n,renderState:_});return V(r),()=>{r.destroy()}},[]);const[,z]=s(async()=>{j&&(j.updateEnvironment(N),j.updateConstraints(w),await j.updateData(H),await j.paint())},[H,j,N]);if(z)throw z;var B;!function(t){const n=o(),r=a(),i=e(),[,l]=s(async()=>{t&&(t.updateConstraints(i),t.options=r,await t.resize())},[n.width,n.height]);if(l)throw l}(j),B=j,m(e=>{if(B)return B.setSnapshotData(e)}),h(()=>({getViewState(){if(B)return B.getViewState()}}),[B])}}}export{Lo as default};
12
10
  //# sourceMappingURL=index.js.map