/*
* @nebula.js/sn-combo-chart v1.47.0
* Copyright (c) 2026 QlikTech International AB
* Released under the MIT license.
*/

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@nebula.js/stardust")):"function"==typeof define&&define.amd?define(["@nebula.js/stardust"],t):(e="undefined"!=typeof globalThis?globalThis:e||self)["sn-combo-chart"]=t(e.stardust)}(this,function(e){"use strict";function t(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}var n,r,i={Common_Measures:{id:"Common.Measures",locale:{"de-DE":"Kennzahlen","en-US":"Measures","es-ES":"Medidas","fr-FR":"Mesures","it-IT":"Misure","ja-JP":"メジャー","ko-KR":"측정값","nl-NL":"Metingen","pl-PL":"Miary","pt-BR":"Medidas","ru-RU":"Меры","sv-SE":"Mått","tr-TR":"Hesaplamalar","zh-CN":"度量","zh-TW":"量值"}},Object_ChartTooltip_ColorExpression:{id:"Object.ChartTooltip.ColorExpression",locale:{"de-DE":"Farbformel","en-US":"Color expression","es-ES":"Expresión de color","fr-FR":"Expression de couleur","it-IT":"Espressione colore","ja-JP":"カラー表現","ko-KR":"색상 표현식","nl-NL":"Kleuruitdrukking","pl-PL":"Wyrażenie koloru","pt-BR":"Expressão de cor","ru-RU":"Выражение для цвета","sv-SE":"Färguttryck","tr-TR":"Renk ifadesi","zh-CN":"颜色表达式","zh-TW":"色彩運算式"}},Object_ChartTooltip_NMore:{id:"Object.ChartTooltip.NMore",locale:{"de-DE":"+{0} mehr","en-US":"+{0} more","es-ES":"+{0} más","fr-FR":"+{0} plus","it-IT":"+{0} altre","ja-JP":"さらに +{0}","ko-KR":"{0} 이상","nl-NL":"+{0} meer","pl-PL":"Jeszcze {0}","pt-BR":"+{0} mais","ru-RU":"Еще +{0}","sv-SE":"Fler än {0} ytterligare","tr-TR":"+{0} daha","zh-CN":"+{0} 以上","zh-TW":"其他 +{0} 個"}},Object_ChartTooltip_sumOfNegatives:{id:"Object.ChartTooltip.sumOfNegatives",locale:{"de-DE":"Summe negativer Werte","en-US":"Sum of negatives","es-ES":"Suma de negativos","fr-FR":"Somme des valeurs négatives","it-IT":"Somma valori negativi","ja-JP":"負の合計","ko-KR":"음수 합계","nl-NL":"Som negatieven","pl-PL":"Suma ujemnych","pt-BR":"Soma de negativos","ru-RU":"Сумма отрицательных значений","sv-SE":"Summan av negativa","tr-TR":"Negatif değerlerin toplamı","zh-CN":"负值总和","zh-TW":"負數總和"}},Object_ChartTooltip_sumOfPositives:{id:"Object.ChartTooltip.sumOfPositives",locale:{"de-DE":"Summe positiver Werte","en-US":"Sum of positives","es-ES":"Suma de positivos","fr-FR":"Sommes des valeurs positives","it-IT":"Somma valori positivi","ja-JP":"正の合計","ko-KR":"양수 합계","nl-NL":"Som positieven","pl-PL":"Suma dodatnich","pt-BR":"Soma de positivos","ru-RU":"Сумма положительных значений","sv-SE":"Summan av positiva","tr-TR":"Pozitif değerlerin toplamı","zh-CN":"正值总和","zh-TW":"正數總和"}},Object_Disclaimer_DataRangeIncludingZero:{id:"Object.Disclaimer.DataRangeIncludingZero",locale:{"de-DE":"Die logarithmische Skala wurde durch die lineare Skala ersetzt, weil der Datenbereich NULL enthält.","en-US":"The logarithmic scale has been replaced by a linear scale because the data range includes zero.","es-ES":"La escala logarítmica ha sido reemplazada por una escala lineal porque el rango de datos incluye cero.","fr-FR":"L'échelle logarithmique a été remplacée par une échelle linéaire, car la plage de données comprend la valeur zéro.","it-IT":"La scala logaritmica è stata sostituita da una scala lineare perché l'intervallo di dati include zero.","ja-JP":"データ範囲にゼロが含まれるため、Log スケールは Linear スケールで置換されています。","ko-KR":"데이터 범위에 0이 포함되어 있으므로 로그 눈금이 선형 눈금으로 바뀌었습니다.","nl-NL":"De logaritmische schaal is vervangen door een lineaire schaal omdat het gegevensbereik nullen bevat.","pl-PL":"Skala logarytmiczna została zastąpiona liniową, ponieważ zakres danych zawiera zero.","pt-BR":"A escala logarítmica foi substituída por uma escala linear, pois o intervalo de dados inclui zero.","ru-RU":"Логарифмический масштаб заменен линейным масштабом, поскольку диапазон данных включает ноль.","sv-SE":"Den logaritmiska skalan har ersatts av en linjär skala eftersom dataintervallet innehåller värdet noll.","tr-TR":"Veri aralığı sıfır değerini içerdiğinden, logaritmik ölçek yerine doğrusal ölçek kullanıldı.","zh-CN":"对数刻度已替换为线性刻度，因为该数据范围包括零。","zh-TW":"對數刻度已遭線性刻度取代，因為資料範圍包含零。"}},Object_Disclaimer_LimitedData:{id:"Object.Disclaimer.LimitedData",locale:{"de-DE":"Zurzeit wird nur ein beschränkter Datensatz angezeigt.","en-US":"Currently showing a limited data set.","es-ES":"Mostrando actualmente un conjunto limitado de datos.","fr-FR":"Affichage d'un ensemble de données limité pour l'instant.","it-IT":"Attualmente viene visualizzata una serie di dati limitata.","ja-JP":"現在、限定的なデータ セットを表示しています。","ko-KR":"현재 제한된 데이터 집합을 표시하고 있습니다.","nl-NL":"Momenteel wordt een beperkte gegevensverzameling getoond.","pl-PL":"Aktualnie przedstawiany jest ograniczony zestaw danych.","pt-BR":"Mostrando um conjunto de dados limitado.","ru-RU":"В настоящее время отображается ограниченный набор данных.","sv-SE":"Just nu visas en begränsad datauppsättning.","tr-TR":"Şu anda sınırlı bir veri kümesi gösteriliyor.","zh-CN":"当前正显示有限的数据集。","zh-TW":"目前顯示的是有限的資料集。"}},Object_Disclaimer_NegativeOrZeroValues:{id:"Object.Disclaimer.NegativeOrZeroValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen oder 0-Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative or zero values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores cero o negativos que no se pueden mostrar en este gráfico.","fr-FR":"L'ensemble de données contient des valeurs négatives ou égales à zéro impossibles à afficher dans ce graphique.","it-IT":"La serie di dati contiene valori negativi o uguali a zero che non possono essere visualizzati in questo grafico.","ja-JP":"データ セットには、本チャートに表示できない負の値またはゼロ値が含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값 또는 zero 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden of nulwaarden die niet kunnen worden weergegeven in deze diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne lub zerowe, których nie można przedstawić w tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos ou iguais a zero que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные или нулевые значения, которые невозможно показать в этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden eller nollvärden som inte kan visas i detta diagram.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif veya sıfır değerlerini içeriyor.","zh-CN":"数据集中包含无法在此图表中显示的负值或零值。","zh-TW":"資料集包含無法在此圖表中顯示的負值或零值。"}},Object_Disclaimer_NegativeValues:{id:"Object.Disclaimer.NegativeValues",locale:{"de-DE":"Die in den Datensätzen enthaltenen negativen Werte können nicht in diesem Diagramm dargestellt werden.","en-US":"The data set contains negative values that cannot be shown in this chart.","es-ES":"El conjunto de datos contiene valores negativos que no se pueden mostrar en este gráfico.","fr-FR":"Le jeu de données contient des valeurs négatives impossibles à afficher dans ce graphique.","it-IT":"Il set di dati contiene valori negativi che non possono essere visualizzati in questo grafico.","ja-JP":"このチャートには表示できない負の値がデータ セットに含まれています。","ko-KR":"데이터 집합에 해당 차트에 표시할 수 없는 음수 값이 포함되어 있습니다.","nl-NL":"De gegevensverzameling bevat negatieve waarden die niet kunnen worden weergegeven in dit diagram.","pl-PL":"Zestaw danych zawiera wartości ujemne, których nie można przedstawić na tym wykresie.","pt-BR":"O conjunto de dados contém valores negativos que não podem ser mostrados neste gráfico.","ru-RU":"Набор данных содержит отрицательные значения, которые нельзя отобразить на этой диаграмме.","sv-SE":"Datauppsättningen innehåller negativa värden som inte kan visas i det här diagrammet.","tr-TR":"Veri kümesi, bu grafikte gösterilemeyen negatif değerleri içeriyor.","zh-CN":"数据集包含无法在此图表中显示的负值。","zh-TW":"資料集包含無法在此圖表中顯示的負值。"}},Object_Disclaimer_NoDataExist:{id:"Object.Disclaimer.NoDataExist",locale:{"de-DE":"Die Auswahlen haben für dieses Diagramm keine Daten generiert.","en-US":"The selections generated no data for this chart.","es-ES":"Las selecciones no han generado datos para este gráfico.","fr-FR":"Les sélections n'ont pas généré de données pour ce graphique.","it-IT":"Le selezioni non hanno generato dati per questo grafico.","ja-JP":"このチャートには選択からデータが生成されませんでした。","ko-KR":"선택 내용으로 이 차트에 대한 데이터가 생성되지 않았습니다.","nl-NL":"De selecties hebben geen gegevens voor de diagram gegenereerd.","pl-PL":"Wymiary nie spowodowały wygenerowania danych dla tego wykresu.","pt-BR":"As seleções não geraram dados para este gráfico.","ru-RU":"В результате выборок данные для этой диаграммы не созданы.","sv-SE":"Urvalen genererade inga data för detta diagram.","tr-TR":"Seçimler bu grafik için hiç veri oluşturmadı.","zh-CN":"选择未生成此图表的数据。","zh-TW":"此選項無法產生任何適用於此圖表的資料。"}},Object_Disclaimer_OnlyNanColor:{id:"Object.Disclaimer.OnlyNanColor",locale:{"de-DE":"Die verwendeten Daten für die Farbgebung dieser Visualisierung enthalten undefinierte Werte.","en-US":"The data used to color this visualization only contains undefined values.","es-ES":"Los datos utilizados para colorear esta visualización solo contienen valores indefinidos.","fr-FR":"Les données utilisées pour colorer cette visualisation ne comportent que des valeurs non définies.","it-IT":"I dati utilizzati per colorare questa visualizzazione contengono solo valori non definiti.","ja-JP":"このビジュアライゼーションの色の割り当てに使用したデータには、未定義の値が含まれています。","ko-KR":"이 시각화에 색을 지정하는 데 사용된 데이터에는 정의되지 않은 값만 포함되어 있습니다.","nl-NL":"De gegevens die worden gebruikt om deze visualisatie kleur te geven bevatten uitsluitend ongedefinieerde waarden.","pl-PL":"Dane używane do kolorowania tej wizualizacji zawierają wyłącznie niezdefiniowane wartości.","pt-BR":"Os dados usados para colorir esse visualização contém somente valores indefinidos.","ru-RU":"Данные, используемые для выбора цвета визуализации, содержат только неопределенные значения.","sv-SE":"Data som används för att färgsätta denna visualisering innehåller enbart odefinierade värden.","tr-TR":"Bu görselleştirmeyi renklendirmek için kullanılan veriler yalnızca tanımlanmamış değerler içeriyor.","zh-CN":"用于将该可视化着色的数据仅包含未定义的值。","zh-TW":"用以定義此視覺化的色彩的資料只包含未定義的值。"}},Object_Disclaimer_OnlyNanData:{id:"Object.Disclaimer.OnlyNanData",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur nicht definierte Werte enthält.","en-US":"The chart is not displayed because it contains only undefined values.","es-ES":"El gráfico no se muestra porque solo contiene valores indefinidos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs non définies.","it-IT":"Il grafico non è visualizzato poiché contiene solo valori non definiti.","ja-JP":"未定義の値しか含まれていないため、チャートは表示されていません。","ko-KR":"정의되지 않은 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen ongedefinieerde waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości niezdefiniowane.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores não definidos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только неопределенные значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller odefinierade värden.","tr-TR":"Yalnızca tanımsız değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表，因为它仅包含未定义的值。","zh-TW":"系統不會顯示圖表，因為該圖表僅包含未定義的值。"}},Object_Disclaimer_OnlyNegativeOrZeroValues:{id:"Object.Disclaimer.OnlyNegativeOrZeroValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder 0-Werte enthält.","en-US":"The chart is not displayed because it contains only negative or zero values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos o valores cero.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives ou égales à zéro.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi o uguali a zero.","ja-JP":"チャートは負の値またはゼロ値しか含まれていないため、表示されていません。","ko-KR":"음수 또는 zero 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"De diagram wordt niet weergegeven omdat deze alleen negatieve waarden of nulwaarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne lub zerowe.","pt-BR":"O gráfico não foi exibido, porque contém apenas valores negativos ou zero.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные или нулевые значения.","sv-SE":"Diagrammet visas inte eftersom det enbart innehåller negativa värden eller nollvärden","tr-TR":"Yalnızca negatif veya sıfır değerlerini içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表，因为它仅包含负值或零值。","zh-TW":"系統不會顯示圖表，因為該圖表僅包含負值或零值。"}},Object_Disclaimer_OnlyNegativeValues:{id:"Object.Disclaimer.OnlyNegativeValues",locale:{"de-DE":"Das Diagramm wird nicht angezeigt, da es nur negative oder Werte enthält.","en-US":"The chart is not displayed because it contains only negative values.","es-ES":"El gráfico no se muestra porque solo contiene valores negativos.","fr-FR":"Le graphique n'est pas affiché, car il contient uniquement des valeurs négatives.","it-IT":"Il grafico non viene visualizzato poiché contiene solo valori negativi.","ja-JP":"負の値しか含まれていないため、チャートは表示されていません。","ko-KR":"음수 값만 포함되어 있으므로 차트가 표시되지 않습니다.","nl-NL":"Het diagram wordt niet weergegeven omdat deze alleen negatieve waarden bevat.","pl-PL":"Wykres nie jest wyświetlany, ponieważ zawiera wyłącznie wartości ujemne.","pt-BR":"O gráfico não é exibido porque contém apenas valores negativos.","ru-RU":"Диаграмма не отображается, поскольку она содержит только отрицательные значения.","sv-SE":"Diagrammet visas inte eftersom det endast innehåller negativa värden.","tr-TR":"Yalnızca negatif değerleri içermesi nedeniyle grafik görüntülenmiyor.","zh-CN":"未显示图表，因为它仅包含负值。","zh-TW":"系統不會顯示圖表，因為該圖表僅包含負值。"}},Object_ErrorMessage_MissingDimension:{id:"Object.ErrorMessage.MissingDimension",locale:{"de-DE":"Dimension nicht gefunden","en-US":"Dimension not found","es-ES":"No se ha encontrado la dimensión","fr-FR":"Dimension introuvable","it-IT":"Dimensione non trovata","ja-JP":"軸が見つかりません","ko-KR":"차원을 찾지 못했습니다.","nl-NL":"Dimensie niet gevonden","pl-PL":"Wymiar nie został znaleziony","pt-BR":"Dimensão não encontrada","ru-RU":"Измерение не найдено","sv-SE":"Dimensionen hittades inte","tr-TR":"Boyut bulunamadı","zh-CN":"未找到维度","zh-TW":"找不到維度"}},Object_ErrorMessage_MissingMeasure:{id:"Object.ErrorMessage.MissingMeasure",locale:{"de-DE":"Kennzahl nicht gefunden","en-US":"Measure not found","es-ES":"No se ha encontrado la medida","fr-FR":"Mesure introuvable","it-IT":"Misura non trovata","ja-JP":"メジャーが見つかりません","ko-KR":"측정값을 찾지 못했습니다.","nl-NL":"Meting niet gevonden","pl-PL":"Miara nie została znaleziona","pt-BR":"Medida não encontrada","ru-RU":"Мера не найдена","sv-SE":"Måttet hittades inte","tr-TR":"Hesaplama bulunamadı","zh-CN":"未找到度量","zh-TW":"找不到量值"}},Tooltip_ToggleOffLassoSelection:{id:"Tooltip.ToggleOffLassoSelection",locale:{"de-DE":"Lasso-Auswahl deaktivieren","en-US":"Turn off lasso selection","es-ES":"Desactivar la selección de contorno","fr-FR":"Désactiver la sélection au lasso","it-IT":"Disattiva selezione lazo","ja-JP":"囲み選択をオフにする","ko-KR":"올가미 선택 끄기","nl-NL":"Lassoselectie uitschakelen","pl-PL":"Wyłącz zaznaczenie lasso","pt-BR":"Desativar seleção de laço","ru-RU":"Выключить выбор лассо","sv-SE":"Stäng av lassourval","tr-TR":"Serbest seçimi kapat","zh-CN":"关闭套索选择方法","zh-TW":"關閉套索選取"}},Tooltip_ToggleOnLassoSelection:{id:"Tooltip.ToggleOnLassoSelection",locale:{"de-DE":"Lasso-Auswahl aktivieren","en-US":"Turn on lasso selection","es-ES":"Activar la selección de contorno","fr-FR":"Activer la sélection au lasso","it-IT":"Attiva selezione lazo","ja-JP":"囲み選択をオンにする","ko-KR":"올가미 선택 켜기","nl-NL":"Lassoselectie inschakelen","pl-PL":"Włącz zaznaczenie lasso","pt-BR":"Ativar seleção de laço","ru-RU":"Включить выбор лассо","sv-SE":"Slå på lassourval","tr-TR":"Serbest seçimi aç","zh-CN":"开启套索选择方法","zh-TW":"開啟套索選取"}},Tooltip_dimensions_cyclic:{id:"Tooltip.dimensions.cyclic",locale:{"de-DE":"Zyklische Dimension","en-US":"Cyclic dimension","es-ES":"Dimensión cíclica","fr-FR":"Dimension cyclique","it-IT":"Dimensione ciclica","ja-JP":"サイクリック軸","ko-KR":"순환 차원","nl-NL":"Cyclische dimensie","pl-PL":"Wymiar cykliczny","pt-BR":"Dimensão cíclica","ru-RU":"Циклическое измерение","sv-SE":"Cyklisk dimension","tr-TR":"Döngüsel boyut","zh-CN":"循环维度","zh-TW":"循環維度"}},Tooltip_dimensions_drilldown:{id:"Tooltip.dimensions.drilldown",locale:{"de-DE":"Drilldown-Dimension","en-US":"Drill-down dimension","es-ES":"Dimensión jerárquica","fr-FR":"Descendre dans la hiérarchie de la dimension","it-IT":"Dimensione di drill-down","ja-JP":"軸のドリルダウン","ko-KR":"드릴다운 차원","nl-NL":"Drill-downdimensie","pl-PL":"Wymiar hierarchiczny","pt-BR":"Dimensão da hierarquia","ru-RU":"Детализированное измерение","sv-SE":"Hierarkisk dimension","tr-TR":"Detaya inme boyutu","zh-CN":"下钻维度","zh-TW":"向下探查維度"}},Tooltip_selections_locked:{id:"Tooltip.selections.locked",locale:{"de-DE":"Auswahlen sind für diese Dimension gesperrt","en-US":"Selections on this dimension are locked","es-ES":"Las selecciones de esta dimensión están bloqueadas.","fr-FR":"Sélections verrouillées pour cette dimension","it-IT":"Le selezioni in questa dimensione sono bloccate","ja-JP":"この軸での選択はロックされています","ko-KR":"이 차원의 선택은 잠겨 있습니다.","nl-NL":"Selecties voor deze dimensie zijn vergrendeld","pl-PL":"Wybory dotyczące tego wymiaru są zablokowane","pt-BR":"Seleções estão bloqueadas nesta dimensão","ru-RU":"Выборки для данного измерения заблокированы","sv-SE":"Urval i den här dimensionen är låsta","tr-TR":"Bu boyuttaki seçimler kilitli","zh-CN":"相关维度的选择已锁定","zh-TW":"已鎖定此維度上的選項"}},Visualizations_Descriptions_Bars:{id:"Visualizations.Descriptions.Bars",locale:{"de-DE":"Balken","en-US":"Bars","es-ES":"Barras","fr-FR":"Barres","it-IT":"Barre","ja-JP":"棒","ko-KR":"막대","nl-NL":"Staven","pl-PL":"Słupki","pt-BR":"Barras","ru-RU":"Полосы","sv-SE":"Staplar","tr-TR":"Çubuklar","zh-CN":"条形","zh-TW":"長條"}},Visualizations_Descriptions_Group:{id:"Visualizations.Descriptions.Group",locale:{"de-DE":"Gruppe","en-US":"Group","es-ES":"Grupo","fr-FR":"Groupe","it-IT":"Gruppo","ja-JP":"グループ","ko-KR":"그룹","nl-NL":"Groep","pl-PL":"Grupa","pt-BR":"Grupo","ru-RU":"Группа","sv-SE":"Grupp","tr-TR":"Grup","zh-CN":"组","zh-TW":"群組"}},Visualizations_Descriptions_HeightLine:{id:"Visualizations.Descriptions.HeightLine",locale:{"de-DE":"Linienhöhe","en-US":"Height of line","es-ES":"Altura de línea","fr-FR":"Hauteur de ligne","it-IT":"Altezza della linea","ja-JP":"線の高さ","ko-KR":"선 높이","nl-NL":"Hoogte van lijn","pl-PL":"Wysokość linii","pt-BR":"Altura da linha","ru-RU":"Высота линии","sv-SE":"Linjens höjd","tr-TR":"Çizgi yüksekliği","zh-CN":"线高度","zh-TW":"折線高度"}},Visualizations_Descriptions_LengthBars:{id:"Visualizations.Descriptions.LengthBars",locale:{"de-DE":"Balkenlänge","en-US":"Length of bars","es-ES":"Longitud de barras","fr-FR":"Longueur des barres","it-IT":"Lunghezza delle barre","ja-JP":"棒の長さ","ko-KR":"막대 길이","nl-NL":"Lengte van staven","pl-PL":"Długość słupków","pt-BR":"Comprimento das barras","ru-RU":"Длина полос","sv-SE":"Staplarnas längd","tr-TR":"Çubuk uzunluğu","zh-CN":"条形长度","zh-TW":"長條長度"}},properties_dataPoints_labelmode_share:{id:"properties.dataPoints.labelmode.share",locale:{"de-DE":"Freigeben","en-US":"Share","es-ES":"Compartir","fr-FR":"Partage","it-IT":"Condividi","ja-JP":"共有","ko-KR":"공유","nl-NL":"Delen","pl-PL":"Udostępnij","pt-BR":"Compartilhar","ru-RU":"Совместное использование","sv-SE":"Dela","tr-TR":"Paylaş","zh-CN":"共享","zh-TW":"共用"}},properties_trendlines_types_average:{id:"properties.trendlines.types.average",locale:{"de-DE":"Durchschnitt","en-US":"Average","es-ES":"Media","fr-FR":"Moyenne","it-IT":"Media","ja-JP":"平均値","ko-KR":"평균","nl-NL":"Gemiddelde","pl-PL":"Średnia","pt-BR":"Média","ru-RU":"Среднее","sv-SE":"Medel","tr-TR":"Ortalama","zh-CN":"平均值","zh-TW":"平均值"}},properties_trendlines_types_exponential:{id:"properties.trendlines.types.exponential",locale:{"de-DE":"Exponentiell","en-US":"Exponential","es-ES":"Exponencial","fr-FR":"Exponentiel","it-IT":"Esponenziale","ja-JP":"指数","ko-KR":"지수","nl-NL":"Exponentieel","pl-PL":"Wykładnicze","pt-BR":"Exponencial","ru-RU":"Экспоненциальный","sv-SE":"Exponentiell","tr-TR":"Üstel","zh-CN":"指数","zh-TW":"指數"}},properties_trendlines_types_linear:{id:"properties.trendlines.types.linear",locale:{"de-DE":"Linear","en-US":"Linear","es-ES":"Lineal","fr-FR":"Linéaire","it-IT":"Lineare","ja-JP":"線形","ko-KR":"선형","nl-NL":"Lineair","pl-PL":"Liniowe","pt-BR":"Linear","ru-RU":"Линейный","sv-SE":"Linjär","tr-TR":"Doğrusal","zh-CN":"线性","zh-TW":"線性"}},properties_trendlines_types_logarithmic:{id:"properties.trendlines.types.logarithmic",locale:{"de-DE":"Logarithmisch","en-US":"Logarithmic","es-ES":"Logarítmica","fr-FR":"Logarithmique","it-IT":"Logaritmica","ja-JP":"対数","ko-KR":"로그","nl-NL":"Logaritmisch","pl-PL":"Logarytmiczne","pt-BR":"Logarítmico","ru-RU":"Логарифмический","sv-SE":"Logaritmisk","tr-TR":"Logaritmik","zh-CN":"对数","zh-TW":"對數"}},properties_trendlines_types_polynomial2:{id:"properties.trendlines.types.polynomial2",locale:{"de-DE":"Polynom zweiten Grades","en-US":"Second degree polynomial","es-ES":"Polinómica de segundo grado","fr-FR":"Polynomial du 2ème degré","it-IT":"Polinomio di secondo grado","ja-JP":"2 番目の角度の多項式近似","ko-KR":"2차 다항식","nl-NL":"Tweedegraadspolynoom","pl-PL":"Wielomianowe drugiego stopnia","pt-BR":"Polinômio de segundo grau","ru-RU":"Полиномиальный второй степени","sv-SE":"Polynomial, andra graden","tr-TR":"İkinci derece polinom","zh-CN":"二次多项式","zh-TW":"第二度多項式"}},properties_trendlines_types_polynomial3:{id:"properties.trendlines.types.polynomial3",locale:{"de-DE":"Polynom dritten Grades","en-US":"Third degree polynomial","es-ES":"Polinómica de tercer grado","fr-FR":"Polynomial du 3ème degré","it-IT":"Polinomio di terzo grado","ja-JP":"3 番目の角度の多項式近似","ko-KR":"3차 다항식","nl-NL":"Derdegraadspolynoom","pl-PL":"Wielomianowe trzeciego stopnia","pt-BR":"Polinômio de terceiro grau","ru-RU":"Полиномиальный третьей степени","sv-SE":"Polynomial, tredje graden","tr-TR":"Üçüncü derece polinom","zh-CN":"三次多项式","zh-TW":"第三度多項式"}},properties_trendlines_types_polynomial4:{id:"properties.trendlines.types.polynomial4",locale:{"de-DE":"Polynom vierten Grades","en-US":"Fourth degree polynomial","es-ES":"Polinómica de cuarto grado","fr-FR":"Polynomial du 4ème degré","it-IT":"Polinomio di quarto grado","ja-JP":"4 番目の角度の多項式近似","ko-KR":"4차 다항식","nl-NL":"Vierdegraadspolynoom","pl-PL":"Wielomianowe czwartego stopnia","pt-BR":"Polinômio de quarto grau","ru-RU":"Полиномиальный четвертой степени","sv-SE":"Polynomial, fjärde graden","tr-TR":"Dördüncü derece polinom","zh-CN":"四次多项式","zh-TW":"第四度多項式"}},properties_trendlines_types_power:{id:"properties.trendlines.types.power",locale:{"de-DE":"Potenz","en-US":"Power","es-ES":"Potencia","fr-FR":"Puissance","it-IT":"Potenza","ja-JP":"累乗","ko-KR":"거듭제곱","nl-NL":"Macht","pl-PL":"Potęgowe","pt-BR":"Potência","ru-RU":"Степенной","sv-SE":"Potens","tr-TR":"Üs","zh-CN":"幂","zh-TW":"乘冪"}}};function o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch(e){}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var s=function(){if(r)return n;r=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===t.call(e)},s=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)},l=function(e,t){i&&"__proto__"===t.name?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(t,n){if("__proto__"===n){if(!e.call(t,n))return;if(o)return o(t,n).value}return t[n]};return n=function e(){var t,n,r,i,o,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=c(d,n),d!==(i=c(t,n))&&(p&&i&&(s(i)||(o=a(i)))?(o?(o=!1,u=r&&a(r)?r:[]):u=r&&s(r)?r:{},l(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&l(d,{name:n,newValue:i}));return d},n}(),l=o(s);const c=[["FULL",{width:550,height:450}],["MEDIUM",{width:400,height:220}],["SMALL",{width:300,height:150}],["XSMALL",{width:150,height:75}],["SPARK",{width:0,height:0}]],u={};c.forEach(([e,{width:t,height:n}])=>{u[e]={width:t,height:n}});const d={getLayoutModes:()=>u,getLayoutMode(e,t){let n;for(n=0;n<c.length;++n)if(e>=c[n][1].width&&t>=c[n][1].height)return c[n][0];return"SPARK"}};const f=["$date","$timestamp","$time"],h=["D","TS","T"],p={hasTimeTag:e=>!!(e&&e.qTags&&e.qTags.some(e=>f.some(t=>t===e))),hasUnknownFormat:e=>!(!e||!e.qNumFormat||"U"!==e.qNumFormat.qType),hasTimeFormat:e=>!!(e&&e.qNumFormat&&h.some(t=>t===e.qNumFormat.qType)),isTimeDimension:(e,t)=>!!(e&&t&&(p.hasTimeTag(t)&&p.hasUnknownFormat(t)||p.hasTimeFormat(t))),isTime:(e,t)=>!!(t&&t.qHyperCube.qDimensionInfo&&t.qHyperCube.qDimensionInfo.length)&&(e&&p.isTimeDimension(e,t.qHyperCube.qDimensionInfo.filter(e=>7005!==e.qError?.qErrorCode)[0])),canBeContinuousDimension(e){if(!e)return!1;const t=e.qTags||[];return!(!e.qContinuousAxes||!t.some(e=>"$numeric"===e))},canBeContinuous(e){const t=e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode);return!((t?.length??0)<1)&&p.canBeContinuousDimension(t[0])},maxNumberOfLines:12},m=/^[A-Z][A-z0-9_]*$/i,g={getChar(e){let t=e,n=-1;return t>9?(n=65+t-10,n>90&&(n+=6)):t=`${t}`.charCodeAt(0),[48,111,79,105,73,108].indexOf(n)>-1?this.getChar(t+1):String.fromCharCode(n)},base62(e){const t=this.getChar(e%62),n=Math.floor(e/62);return n>0?this.base62(n)+t:t},id(){return this.base62(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}},y={setValue:(e,t,n)=>{if(!t)return!1;const r=t.split("."),i=r[r.length-1];let o,a=e;for(o=0;o<r.length-1;++o)void 0===a[r[o]]&&(a[r[o]]=Number.isNaN(+r[o+1])?{}:[]),a=a[r[o]];if(void 0!==n){const e=a[i];return a[i]=n,{updated:n,previous:e}}return delete a[i],!1},getValue:(e,t,n)=>{const r=t.split(".");let i,o=e;if(void 0===o)return n;for(i=0;i<r.length;++i){if(void 0===o[r[i]])return n;o=o[r[i]]}return o},moveArrayElement:(e,t,n)=>{if(n>=e.length){let t=n-e.length;for(;1+t--;)e.push(void 0)}e.splice(n,0,e.splice(t,1)[0])},escapeField:e=>{let t;return t=!e||"]"===e||m.test(e)?e:`[${e.replace(/\]/g,"]]")}]`,t},deleteUndefinedProperties:e=>{Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]})},generateId:()=>g.id(),shouldUseFormat:e=>!e.isCustomFormatted&&(e.qIsAutoFormat||"U"===e.qNumFormat.qType)},v=e=>y.getValue(e,"qHyperCube.qDimensionInfo",[]),b=e=>y.getValue(e,"qHyperCube.qMeasureInfo",[]),x=e=>y.getValue(e,"barGrouping.grouping"),S={continuous({layout:e,properties:t,auto:n}){if(!p.canBeContinuous(e))return!1;const r=t||e;return y.getValue(r,"dimensionAxis.continuousAuto")?"function"==typeof n?n():!!n:!!r?.preferContinuousAxis},dimensionless:e=>!v(e).length,grouped(e){return!this.dimensionless(e)&&"grouped"===x(e)&&(v(e).length>1||b(e).length>1)&&!this.continuous({layout:e})},groupedByDimension(e){return this.grouped(e)&&v(e).length>1&&1===b(e).length},groupedByMeasure(e){return this.grouped(e)&&1===v(e).length&&b(e).length>1},stacked(e){return(!this.dimensionless(e)&&"grouped"!==x(e)&&"butterfly"!==x(e)||this.continuous({layout:e}))&&(v(e).length>1||b(e).length>1)},stackedByDimension(e){return this.stacked(e)&&v(e).length>1&&1===b(e).length},stackedByMeasure(e){return this.stacked(e)&&1===v(e).length&&b(e).length>1},simple:e=>0===v(e).length||1===v(e).length&&1===b(e).length,snapshot:e=>!!y.getValue(e,"snapshotData")};function M(e,t){const n=e.component(t);return n&&n._DO_NOT_USE_getInfo&&n._DO_NOT_USE_getInfo().offset}const w=e=>{throw e.isHandled=!0,e};const E={getDockValue:e=>"near"===e||"left"===e||"top"===e?0:1,getOppositeDock(e){switch(e){case"left":return"right";case"right":return"left";case"top":return"bottom";case"bottom":return"top";case"near":default:return"far";case"far":return"near"}},getHorizontalDock:e=>"near"===e||"left"===e?"left":"right",getVerticalDock:e=>"near"===e||"bottom"===e?"bottom":"top",getDock:(e,t,n)=>"vertical"===e||"y"===e?E.getVerticalDock(t):n?E.getOppositeDock(E.getHorizontalDock(t)):E.getHorizontalDock(t),getInvertedOrientation:e=>"vertical"===e?"horizontal":"vertical",getMinorScaleAxis:e=>"vertical"===e?"y":"x",getMajorScaleAxis:e=>"vertical"===e?"x":"y",getAlignment:(e,t)=>"vertical"===e?"near"===t||"bottom"===t?1:0:"near"===t||"left"===t?0:1,getMeasureScaleInvert:(e,t)=>"vertical"===e||t,getDimensionScaleInvert:(e,t)=>"horizontal"===e&&t,getSize:(e,{width:t,height:n})=>"vertical"===e?t:n},k=166/26,C=12/11,A={stringWidthOverMWidth:e=>(12*Math.min(e,3)+Math.max(e-3,0)*k)/11,getCharacterRatios(e){if(!e)return{latin:0,cjk:0};let t=e.match(/[\u4E00-\u9FFF]/g),n=e.match(/[\u3040-\u309F]/g),r=e.match(/[\u30A0-\u30FF]/g);t=t?t.length:0,n=n?n.length:0,r=r?r.length:0;const i=t+n+r;return{latin:e.length-i,cjk:i}},getTotalCharacterRatios(e,t,n="qText"){if(!e)return{latinRatio:1,cjkRatio:0};const r={latin:0,cjk:0};let i;void 0===t?e.forEach(e=>{i=A.getCharacterRatios(e[n]),r.latin+=i.latin,r.cjk+=i.cjk}):e.forEach(e=>{i=A.getCharacterRatios(e[t][n]),r.latin+=i.latin,r.cjk+=i.cjk});const o=Math.max(1,r.latin+r.cjk);return r.latinRatio=r.latin/o,r.cjkRatio=r.cjk/o,r},getAdjustedMaxGlyphCount(e,t,n,r="qText"){const i=A.getTotalCharacterRatios(t,n,r),o=i.latinRatio*e,a=i.cjkRatio*e;return Math.ceil(A.stringWidthOverMWidth(o)+a*C)}},O=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗＡ-Ｚａ-ｚｦ-ￜ]"),N=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),D=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),T={lrm:String.fromCharCode(8206),rlm:String.fromCharCode(8207),isLtrChar:e=>O.test(e),isRtlChar:e=>N.test(e)||D.test(e),detectTextDirection(e){const t=e?e.length:0;let n,r;for(n=0;n<t;n++){if(r=e[n],T.isLtrChar(r))return"ltr";if(T.isRtlChar(r))return"rtl"}return"ltr"}},q={getColorSymbol:(e,t)=>e.h("div",{style:{display:"inline-block",width:"10px",height:"10px","background-color":t.color.fill,margin:"0 8px"}}),getNodeFillColor:e=>e.attrs&&void 0!==e.attrs.fill?e.attrs.fill:e.children&&e.children[0]&&e.children[0].attrs&&void 0!==e.children[0].attrs.fill?e.children[0].attrs.fill:void 0,getColor(e,t,n){const r=t.data,i=e.resources.formatter,o=e.resources.dataset,a={};if(n.coloring.label&&(a.label=`${n.coloring.label}`),"color"!==n.coloring.type&&r.fillTooltip){const e=i("fill"),t="measure"===n.coloring.fieldType;if(a.value=t&&e?e(r.fillTooltip.value):r.fillTooltip.label?r.fillTooltip.label:r.fillTooltip.value,!n.coloring.label){const e=o(r.fillTooltip.source.key).field(r.fillTooltip.source.field).title();a.label=`${e}`}}return a.fill=void 0===r._fillColor?q.getNodeFillColor(t):r._fillColor,a},getMeasure:(e,t)=>({label:`${e(t.source.key).field(t.source.field).title()}`,value:""===t.label||"NaN"===t.label?"-":t.label,field:t.source.field}),hideColorRow:(e,t)=>void 0===e.color.value||e.measures.some(e=>e.field===t.coloring.field),getTitleRow(e,t){const n=T.detectTextDirection(e.title);return[{content:e.title,style:{"font-weight":"bold","text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getDescriptionRow(e,t){const n=T.detectTextDirection(e.value);return[{content:e.value,style:{"text-align":t?"right":"left",direction:n,"white-space":"pre-wrap"},colspan:2},{}]},getNMoreRow(e,t,n){const r=t?t.get("Object.ChartTooltip.NMore",e):`+${e} more`;return[{content:r,style:{"font-weight":"bold","text-align":n?"right":"left",direction:T.detectTextDirection(r)},colspan:2},{}]},getSeparatorRow:()=>[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2},{}],getColorRow(e,t,n){const r=T.detectTextDirection(t.color.label),i=n?[":",t.color.label]:[t.color.label,":"],o=T.detectTextDirection(t.color.value);return[{content:i,style:{"text-align":n?"right":"left",direction:r}},{content:n?[t.color.value,q.getColorSymbol(e,t)]:[q.getColorSymbol(e,t),t.color.value],style:{"text-align":n?"left":"right",direction:o,"vertical-align":"middle"}}]},getMeasureRow(e,t,n,r,i=!1){const o=T.detectTextDirection(e.label),a=r?[":",e.label]:[e.label,":"],s=T.detectTextDirection(e.value);let l;return l=i?r?[e.value,q.getColorSymbol(t,n)]:[q.getColorSymbol(t,n),e.value]:[e.value],[{content:a,style:{"text-align":r?"right":"left",direction:o}},{content:l,style:{"text-align":r?"left":"right",direction:s,"vertical-align":"middle"}}]}};function I(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function R(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function L(){}var _=.7,P=1/_,z="\\s*([+-]?\\d+)\\s*",F="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",j="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",$=/^#([0-9a-f]{3,8})$/,B=new RegExp(`^rgb\\(${z},${z},${z}\\)$`),V=new RegExp(`^rgb\\(${j},${j},${j}\\)$`),H=new RegExp(`^rgba\\(${z},${z},${z},${F}\\)$`),U=new RegExp(`^rgba\\(${j},${j},${j},${F}\\)$`),W=new RegExp(`^hsl\\(${F},${j},${j}\\)$`),Y=new RegExp(`^hsla\\(${F},${j},${j},${F}\\)$`),K={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 G(){return this.rgb().formatHex()}function X(){return this.rgb().formatRgb()}function J(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=$.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Z(t):3===n?new ne(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Q(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Q(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=B.exec(e))?new ne(t[1],t[2],t[3],1):(t=V.exec(e))?new ne(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=H.exec(e))?Q(t[1],t[2],t[3],t[4]):(t=U.exec(e))?Q(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=W.exec(e))?le(t[1],t[2]/100,t[3]/100,1):(t=Y.exec(e))?le(t[1],t[2]/100,t[3]/100,t[4]):K.hasOwnProperty(e)?Z(K[e]):"transparent"===e?new ne(NaN,NaN,NaN,0):null}function Z(e){return new ne(e>>16&255,e>>8&255,255&e,1)}function Q(e,t,n,r){return r<=0&&(e=t=n=NaN),new ne(e,t,n,r)}function ee(e){return e instanceof L||(e=J(e)),e?new ne((e=e.rgb()).r,e.g,e.b,e.opacity):new ne}function te(e,t,n,r){return 1===arguments.length?ee(e):new ne(e,t,n,null==r?1:r)}function ne(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function re(){return`#${se(this.r)}${se(this.g)}${se(this.b)}`}function ie(){const e=oe(this.opacity);return`${1===e?"rgb(":"rgba("}${ae(this.r)}, ${ae(this.g)}, ${ae(this.b)}${1===e?")":`, ${e})`}`}function oe(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ae(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function se(e){return((e=ae(e))<16?"0":"")+e.toString(16)}function le(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ue(e,t,n,r)}function ce(e){if(e instanceof ue)return new ue(e.h,e.s,e.l,e.opacity);if(e instanceof L||(e=J(e)),!e)return new ue;if(e instanceof ue)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 ue(a,s,l,e.opacity)}function ue(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function de(e){return(e=(e||0)%360)<0?e+360:e}function fe(e){return Math.max(0,Math.min(1,e||0))}function he(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}I(L,J,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:G,formatHex:G,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ce(this).formatHsl()},formatRgb:X,toString:X}),I(ne,te,R(L,{brighter(e){return e=null==e?P:Math.pow(P,e),new ne(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?_:Math.pow(_,e),new ne(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ne(ae(this.r),ae(this.g),ae(this.b),oe(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:re,formatHex:re,formatHex8:function(){return`#${se(this.r)}${se(this.g)}${se(this.b)}${se(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ie,toString:ie})),I(ue,function(e,t,n,r){return 1===arguments.length?ce(e):new ue(e,t,n,null==r?1:r)},R(L,{brighter(e){return e=null==e?P:Math.pow(P,e),new ue(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?_:Math.pow(_,e),new ue(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 ne(he(e>=240?e-240:e+120,i,r),he(e,i,r),he(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new ue(de(this.h),fe(this.s),fe(this.l),oe(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=oe(this.opacity);return`${1===e?"hsl(":"hsla("}${de(this.h)}, ${100*fe(this.s)}%, ${100*fe(this.l)}%${1===e?")":`, ${e})`}`}}));const pe=Math.PI/180,me=180/Math.PI,ge=.96422,ye=.82521,ve=4/29,be=6/29,xe=3*be*be,Se=be*be*be;function Me(e){if(e instanceof we)return new we(e.l,e.a,e.b,e.opacity);if(e instanceof Ne)return De(e);e instanceof ne||(e=ee(e));var t,n,r=Ae(e.r),i=Ae(e.g),o=Ae(e.b),a=Ee((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=Ee((.4360747*r+.3850649*i+.1430804*o)/ge),n=Ee((.0139322*r+.0971045*i+.7141733*o)/ye)),new we(116*a-16,500*(t-a),200*(a-n),e.opacity)}function we(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function Ee(e){return e>Se?Math.pow(e,1/3):e/xe+ve}function ke(e){return e>be?e*e*e:xe*(e-ve)}function Ce(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Ae(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Oe(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof Ne)return new Ne(e.h,e.c,e.l,e.opacity);if(e instanceof we||(e=Me(e)),0===e.a&&0===e.b)return new Ne(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*me;return new Ne(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new Ne(e,t,n,null==r?1:r)}function Ne(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function De(e){if(isNaN(e.h))return new we(e.l,0,0,e.opacity);var t=e.h*pe;return new we(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}I(we,function(e,t,n,r){return 1===arguments.length?Me(e):new we(e,t,n,null==r?1:r)},R(L,{brighter(e){return new we(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new we(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 ne(Ce(3.1338561*(t=ge*ke(t))-1.6168667*(e=1*ke(e))-.4906146*(n=ye*ke(n))),Ce(-.9787684*t+1.9161415*e+.033454*n),Ce(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),I(Ne,Oe,R(L,{brighter(e){return new Ne(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new Ne(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return De(this).rgb()}}));var Te={isDark:function(e){return Oe(e).l<70}};function qe(e){const t=e.qDef;!0===t.autoSort&&t.qSortCriterias.forEach(e=>{e.qSortByNumeric=1,e.qSortByAscii=1})}function Ie(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Re(e){return 1===e.length&&(e=function(e){return function(t,n){return Ie(e(t),n)}}(e)),{left:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)<0?r=o+1:i=o}return r},right:function(t,n,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r<i;){var o=r+i>>>1;e(t[o],n)>0?i=o:r=o+1}return r}}}var Le=Re(Ie).right,_e=Math.sqrt(50),Pe=Math.sqrt(10),ze=Math.sqrt(2);function Fe(e,t,n){var r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Math.pow(10,i);return i>=0?(o>=_e?10:o>=Pe?5:o>=ze?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=_e?10:o>=Pe?5:o>=ze?2:1)}function je(e,t,n){var r=Math.abs(t-e)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=_e?i*=10:o>=Pe?i*=5:o>=ze&&(i*=2),t<e?-i:i}function $e(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}var Be="$";function Ve(){}function He(e,t){var n=new Ve;if(e instanceof Ve)e.each(function(e,t){n.set(t,e)});else if(Array.isArray(e)){var r,i=-1,o=e.length;if(null==t)for(;++i<o;)n.set(i,e[i]);else for(;++i<o;)n.set(t(r=e[i],i,e),r)}else if(e)for(var a in e)n.set(a,e[a]);return n}function Ue(){}Ve.prototype=He.prototype={constructor:Ve,has:function(e){return Be+e in this},get:function(e){return this[Be+e]},set:function(e,t){return this[Be+e]=t,this},remove:function(e){var t=Be+e;return t in this&&delete this[t]},clear:function(){for(var e in this)e[0]===Be&&delete this[e]},keys:function(){var e=[];for(var t in this)t[0]===Be&&e.push(t.slice(1));return e},values:function(){var e=[];for(var t in this)t[0]===Be&&e.push(this[t]);return e},entries:function(){var e=[];for(var t in this)t[0]===Be&&e.push({key:t.slice(1),value:this[t]});return e},size:function(){var e=0;for(var t in this)t[0]===Be&&++e;return e},empty:function(){for(var e in this)if(e[0]===Be)return!1;return!0},each:function(e){for(var t in this)t[0]===Be&&e(this[t],t.slice(1),this)}};var We=He.prototype;Ue.prototype={constructor:Ue,has:We.has,add:function(e){return this[Be+(e+="")]=e,this},remove:We.remove,clear:We.clear,values:We.keys,size:We.size,empty:We.empty,each:We.each};var Ye=Array.prototype,Ke=Ye.map,Ge=Ye.slice;function Xe(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Je(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ze(){}var Qe=.7,et=1/Qe,tt="\\s*([+-]?\\d+)\\s*",nt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",rt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",it=/^#([0-9a-f]{3,8})$/,ot=new RegExp("^rgb\\("+[tt,tt,tt]+"\\)$"),at=new RegExp("^rgb\\("+[rt,rt,rt]+"\\)$"),st=new RegExp("^rgba\\("+[tt,tt,tt,nt]+"\\)$"),lt=new RegExp("^rgba\\("+[rt,rt,rt,nt]+"\\)$"),ct=new RegExp("^hsl\\("+[nt,rt,rt]+"\\)$"),ut=new RegExp("^hsla\\("+[nt,rt,rt,nt]+"\\)$"),dt={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 ft(){return this.rgb().formatHex()}function ht(){return this.rgb().formatRgb()}function pt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=it.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?mt(t):3===n?new vt(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=ot.exec(e))?new vt(t[1],t[2],t[3],1):(t=at.exec(e))?new vt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=st.exec(e))?gt(t[1],t[2],t[3],t[4]):(t=lt.exec(e))?gt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=ct.exec(e))?Mt(t[1],t[2]/100,t[3]/100,1):(t=ut.exec(e))?Mt(t[1],t[2]/100,t[3]/100,t[4]):dt.hasOwnProperty(e)?mt(dt[e]):"transparent"===e?new vt(NaN,NaN,NaN,0):null}function mt(e){return new vt(e>>16&255,e>>8&255,255&e,1)}function gt(e,t,n,r){return r<=0&&(e=t=n=NaN),new vt(e,t,n,r)}function yt(e,t,n,r){return 1===arguments.length?function(e){return e instanceof Ze||(e=pt(e)),e?new vt((e=e.rgb()).r,e.g,e.b,e.opacity):new vt}(e):new vt(e,t,n,null==r?1:r)}function vt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function bt(){return"#"+St(this.r)+St(this.g)+St(this.b)}function xt(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function St(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function Mt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Et(e,t,n,r)}function wt(e){if(e instanceof Et)return new Et(e.h,e.s,e.l,e.opacity);if(e instanceof Ze||(e=pt(e)),!e)return new Et;if(e instanceof Et)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 Et(a,s,l,e.opacity)}function Et(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function kt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function Ct(e){return function(){return e}}function At(e){return 1===(e=+e)?Ot: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):Ct(isNaN(t)?n:t)}}function Ot(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Ct(isNaN(e)?t:e)}Xe(Ze,pt,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:ft,formatHex:ft,formatHsl:function(){return wt(this).formatHsl()},formatRgb:ht,toString:ht}),Xe(vt,yt,Je(Ze,{brighter:function(e){return e=null==e?et:Math.pow(et,e),new vt(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=null==e?Qe:Math.pow(Qe,e),new vt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bt,formatHex:bt,formatRgb:xt,toString:xt})),Xe(Et,function(e,t,n,r){return 1===arguments.length?wt(e):new Et(e,t,n,null==r?1:r)},Je(Ze,{brighter:function(e){return e=null==e?et:Math.pow(et,e),new Et(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=null==e?Qe:Math.pow(Qe,e),new Et(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new vt(kt(e>=240?e-240:e+120,i,r),kt(e,i,r),kt(e<120?e+240:e-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===e?")":", "+e+")")}}));var Nt=function e(t){var n=At(t);function r(e,t){var r=n((e=yt(e)).r,(t=yt(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Ot(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 Dt(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Tt(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=zt(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function qt(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function It(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Rt(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=zt(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var Lt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,_t=new RegExp(Lt.source,"g");function Pt(e,t){var n,r,i,o=Lt.lastIndex=_t.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=Lt.exec(e))&&(r=_t.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:It(n,r)})),o=_t.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function zt(e,t){var n,r=typeof t;return null==t||"boolean"===r?Ct(t):("number"===r?It:"string"===r?(n=pt(t))?(t=n,Nt):Pt:t instanceof pt?Nt:t instanceof Date?qt:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Dt:Array.isArray(t)?Tt:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Rt:It)(e,t)}function Ft(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function jt(e){return+e}var $t=[0,1];function Bt(e){return e}function Vt(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function Ht(e){var t,n=e[0],r=e[e.length-1];return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function Ut(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=Vt(i,r),o=n(a,o)):(r=Vt(r,i),o=n(o,a)),function(e){return o(r(e))}}function Wt(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=Vt(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Le(e,t,1,r)-1;return o[n](i[n](t))}}function Yt(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function Kt(e,t){return function(){var e,t,n,r,i,o,a=$t,s=$t,l=zt,c=Bt;function u(){return r=Math.min(a.length,s.length)>2?Wt:Ut,i=o=null,d}function d(t){return isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),It)))(n)))},d.domain=function(e){return arguments.length?(a=Ke.call(e,jt),c===Bt||(c=Ht(a)),u()):a.slice()},d.range=function(e){return arguments.length?(s=Ge.call(e),u()):s.slice()},d.rangeRound=function(e){return s=Ge.call(e),l=Ft,u()},d.clamp=function(e){return arguments.length?(c=e?Ht(a):Bt,d):c!==Bt},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}()(e,t)}function Gt(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Xt(e){return(e=Gt(Math.abs(e)))?e[1]:NaN}var Jt,Zt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Qt(e){if(!(t=Zt.exec(e)))throw new Error("invalid format: "+e);var t;return new en({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function en(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function tn(e,t){var n=Gt(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Qt.prototype=en.prototype,en.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var nn={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return tn(100*e,t)},r:tn,s:function(e,t){var n=Gt(e,t);if(!n)return e+"";var r=n[0],i=n[1],o=i-(Jt=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Gt(e,Math.max(0,t+o-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function rn(e){return e}var on,an,sn,ln=Array.prototype.map,cn=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function un(e){var t=void 0===e.grouping||void 0===e.thousands?rn:function(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}(ln.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=e.decimal+"",o=void 0===e.numerals?rn:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(ln.call(e.numerals,String)),a=void 0===e.percent?"%":e.percent+"",s=e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function c(e){var c=(e=Qt(e)).fill,u=e.align,d=e.sign,f=e.symbol,h=e.zero,p=e.width,m=e.comma,g=e.precision,y=e.trim,v=e.type;"n"===v?(m=!0,v="g"):nn[v]||(void 0===g&&(g=12),y=!0,v="g"),(h||"0"===c&&"="===u)&&(h=!0,c="0",u="=");var b="$"===f?n:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===f?r:/[%p]/.test(v)?a:"",S=nn[v],M=/[defgprs%]/.test(v);function w(e){var n,r,a,f=b,w=x;if("c"===v)w=S(e)+w,e="";else{var E=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:S(Math.abs(e),g),y&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),E&&0===+e&&"+"!==d&&(E=!1),f=(E?"("===d?d:s:"-"===d||"("===d?"":d)+f,w=("s"===v?cn[8+Jt/3]:"")+w+(E&&"("===d?")":""),M)for(n=-1,r=e.length;++n<r;)if(48>(a=e.charCodeAt(n))||a>57){w=(46===a?i+e.slice(n+1):e.slice(n))+w,e=e.slice(0,n);break}}m&&!h&&(e=t(e,1/0));var k=f.length+e.length+w.length,C=k<p?new Array(p-k+1).join(c):"";switch(m&&h&&(e=t(C+e,C.length?p-w.length:1/0),C=""),u){case"<":e=f+e+w+C;break;case"=":e=f+C+e+w;break;case"^":e=C.slice(0,k=C.length>>1)+f+e+w+C.slice(k);break;default:e=C+f+e+w}return o(e)}return g=void 0===g?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),w.toString=function(){return e+""},w}return{format:c,formatPrefix:function(e,t){var n=c(((e=Qt(e)).type="f",e)),r=3*Math.max(-8,Math.min(8,Math.floor(Xt(t)/3))),i=Math.pow(10,-r),o=cn[8+r/3];return function(e){return n(i*e)+o}}}}function dn(e,t,n,r){var i,o=je(e,t,n);switch((r=Qt(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Xt(t)/3)))-Xt(Math.abs(e)))}(o,a))||(r.precision=i),sn(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xt(t)-Xt(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-Xt(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return an(r)}function fn(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){var r,i,o,a,s=-1;if(n=+n,(e=+e)===(t=+t)&&n>0)return[e];if((r=t<e)&&(i=e,e=t,t=i),0===(a=Fe(e,t,n))||!isFinite(a))return[];if(a>0)for(e=Math.ceil(e/a),t=Math.floor(t/a),o=new Array(i=Math.ceil(t-e+1));++s<i;)o[s]=(e+s)*a;else for(e=Math.floor(e*a),t=Math.ceil(t*a),o=new Array(i=Math.ceil(e-t+1));++s<i;)o[s]=(e-s)/a;return r&&o.reverse(),o}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return dn(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i=t(),o=0,a=i.length-1,s=i[o],l=i[a];return l<s&&(r=s,s=l,l=r,r=o,o=a,a=r),(r=Fe(s,l,n))>0?r=Fe(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,n):r<0&&(r=Fe(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,n)),r>0?(i[o]=Math.floor(s/r)*r,i[a]=Math.ceil(l/r)*r,t(i)):r<0&&(i[o]=Math.ceil(s*r)/r,i[a]=Math.floor(l*r)/r,t(i)),e},e}function hn(){var e=Kt(Bt,Bt);return e.copy=function(){return Yt(e,hn())},$e.apply(e,arguments),fn(e)}!function(e){on=un(e),an=on.format,sn=on.formatPrefix}({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});var pn=new Date,mn=new Date;function gn(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=function(t){return e(t=new Date(+t)),t},i.ceil=function(n){return e(n=new Date(n-1)),t(n,1),e(n),n},i.round=function(e){var t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=function(e,n){return t(e=new Date(+e),null==n?1:Math.floor(n)),e},i.range=function(n,r,o){var a,s=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return s;do{s.push(a=new Date(+n)),t(n,o),e(n)}while(a<n&&n<r);return s},i.filter=function(n){return gn(function(t){if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););})},n&&(i.count=function(t,r){return pn.setTime(+t),mn.setTime(+r),e(pn),e(mn),Math.floor(n(pn,mn))},i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?function(t){return r(t)%e===0}:function(t){return i.count(0,t)%e===0}):i:null}),i}var yn=gn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});yn.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?gn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):yn:null},yn.range;var vn=6e4,bn=36e5,xn=864e5,Sn=6048e5,Mn=gn(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+1e3*t)},function(e,t){return(t-e)/1e3},function(e){return e.getUTCSeconds()});Mn.range;var wn=gn(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*vn)/xn},function(e){return e.getDate()-1});function En(e){return gn(function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*vn)/Sn})}wn.range;var kn=En(0),Cn=En(1),An=En(2),On=En(3),Nn=En(4),Dn=En(5),Tn=En(6);kn.range,Cn.range,An.range,On.range,Nn.range,Dn.range,Tn.range;var qn=gn(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});qn.every=function(e){return isFinite(e=Math.floor(e))&&e>0?gn(function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n*e)}):null},qn.range;var In=gn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*vn)},function(e,t){return(t-e)/vn},function(e){return e.getUTCMinutes()});In.range;var Rn=gn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*bn)},function(e,t){return(t-e)/bn},function(e){return e.getUTCHours()});Rn.range;var Ln=gn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/xn},function(e){return e.getUTCDate()-1});function _n(e){return gn(function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/Sn})}Ln.range;var Pn=_n(0),zn=_n(1),Fn=_n(2),jn=_n(3),$n=_n(4),Bn=_n(5),Vn=_n(6);Pn.range,zn.range,Fn.range,jn.range,$n.range,Bn.range,Vn.range;var Hn=gn(function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCMonth(e.getUTCMonth()+t)},function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())},function(e){return e.getUTCMonth()});Hn.range;var Un=gn(function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)},function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()},function(e){return e.getUTCFullYear()});function Wn(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function Yn(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function Kn(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}Un.every=function(e){return isFinite(e=Math.floor(e))&&e>0?gn(function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null},Un.range;var Gn,Xn,Jn={"-":"",_:" ",0:"0"},Zn=/^\s*\d+/,Qn=/^%/,er=/[\\^$*+?|[\]().{}]/g;function tr(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function nr(e){return e.replace(er,"\\$&")}function rr(e){return new RegExp("^(?:"+e.map(nr).join("|")+")","i")}function ir(e){for(var t={},n=-1,r=e.length;++n<r;)t[e[n].toLowerCase()]=n;return t}function or(e,t,n){var r=Zn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function ar(e,t,n){var r=Zn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function sr(e,t,n){var r=Zn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function lr(e,t,n){var r=Zn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function cr(e,t,n){var r=Zn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ur(e,t,n){var r=Zn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function dr(e,t,n){var r=Zn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function fr(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function hr(e,t,n){var r=Zn.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function pr(e,t,n){var r=Zn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function mr(e,t,n){var r=Zn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function gr(e,t,n){var r=Zn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function yr(e,t,n){var r=Zn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function vr(e,t,n){var r=Zn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function br(e,t,n){var r=Zn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function xr(e,t,n){var r=Zn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Sr(e,t,n){var r=Zn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Mr(e,t,n){var r=Qn.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function wr(e,t,n){var r=Zn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Er(e,t,n){var r=Zn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function kr(e,t){return tr(e.getDate(),t,2)}function Cr(e,t){return tr(e.getHours(),t,2)}function Ar(e,t){return tr(e.getHours()%12||12,t,2)}function Or(e,t){return tr(1+wn.count(qn(e),e),t,3)}function Nr(e,t){return tr(e.getMilliseconds(),t,3)}function Dr(e,t){return Nr(e,t)+"000"}function Tr(e,t){return tr(e.getMonth()+1,t,2)}function qr(e,t){return tr(e.getMinutes(),t,2)}function Ir(e,t){return tr(e.getSeconds(),t,2)}function Rr(e){var t=e.getDay();return 0===t?7:t}function Lr(e,t){return tr(kn.count(qn(e)-1,e),t,2)}function _r(e){var t=e.getDay();return t>=4||0===t?Nn(e):Nn.ceil(e)}function Pr(e,t){return e=_r(e),tr(Nn.count(qn(e),e)+(4===qn(e).getDay()),t,2)}function zr(e){return e.getDay()}function Fr(e,t){return tr(Cn.count(qn(e)-1,e),t,2)}function jr(e,t){return tr(e.getFullYear()%100,t,2)}function $r(e,t){return tr((e=_r(e)).getFullYear()%100,t,2)}function Br(e,t){return tr(e.getFullYear()%1e4,t,4)}function Vr(e,t){var n=e.getDay();return tr((e=n>=4||0===n?Nn(e):Nn.ceil(e)).getFullYear()%1e4,t,4)}function Hr(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+tr(t/60|0,"0",2)+tr(t%60,"0",2)}function Ur(e,t){return tr(e.getUTCDate(),t,2)}function Wr(e,t){return tr(e.getUTCHours(),t,2)}function Yr(e,t){return tr(e.getUTCHours()%12||12,t,2)}function Kr(e,t){return tr(1+Ln.count(Un(e),e),t,3)}function Gr(e,t){return tr(e.getUTCMilliseconds(),t,3)}function Xr(e,t){return Gr(e,t)+"000"}function Jr(e,t){return tr(e.getUTCMonth()+1,t,2)}function Zr(e,t){return tr(e.getUTCMinutes(),t,2)}function Qr(e,t){return tr(e.getUTCSeconds(),t,2)}function ei(e){var t=e.getUTCDay();return 0===t?7:t}function ti(e,t){return tr(Pn.count(Un(e)-1,e),t,2)}function ni(e){var t=e.getUTCDay();return t>=4||0===t?$n(e):$n.ceil(e)}function ri(e,t){return e=ni(e),tr($n.count(Un(e),e)+(4===Un(e).getUTCDay()),t,2)}function ii(e){return e.getUTCDay()}function oi(e,t){return tr(zn.count(Un(e)-1,e),t,2)}function ai(e,t){return tr(e.getUTCFullYear()%100,t,2)}function si(e,t){return tr((e=ni(e)).getUTCFullYear()%100,t,2)}function li(e,t){return tr(e.getUTCFullYear()%1e4,t,4)}function ci(e,t){var n=e.getUTCDay();return tr((e=n>=4||0===n?$n(e):$n.ceil(e)).getUTCFullYear()%1e4,t,4)}function ui(){return"+0000"}function di(){return"%"}function fi(e){return+e}function hi(e){return Math.floor(+e/1e3)}!function(e){Gn=function(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=rr(i),u=ir(i),d=rr(o),f=ir(o),h=rr(a),p=ir(a),m=rr(s),g=ir(s),y=rr(l),v=ir(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:kr,e:kr,f:Dr,g:$r,G:Vr,H:Cr,I:Ar,j:Or,L:Nr,m:Tr,M:qr,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:fi,s:hi,S:Ir,u:Rr,U:Lr,V:Pr,w:zr,W:Fr,x:null,X:null,y:jr,Y:Br,Z:Hr,"%":di},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:Ur,e:Ur,f:Xr,g:si,G:ci,H:Wr,I:Yr,j:Kr,L:Gr,m:Jr,M:Zr,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:fi,s:hi,S:Qr,u:ei,U:ti,V:ri,w:ii,W:oi,x:null,X:null,y:ai,Y:li,Z:ui,"%":di},S={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p[r[0].toLowerCase()],n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f[r[0].toLowerCase()],n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v[r[0].toLowerCase()],n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g[r[0].toLowerCase()],n+r[0].length):-1},c:function(e,n,r){return E(e,t,n,r)},d:mr,e:mr,f:Sr,g:dr,G:ur,H:yr,I:yr,j:gr,L:xr,m:pr,M:vr,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u[r[0].toLowerCase()],n+r[0].length):-1},q:hr,Q:wr,s:Er,S:br,u:ar,U:sr,V:lr,w:or,W:cr,x:function(e,t,r){return E(e,n,t,r)},X:function(e,t,n){return E(e,r,t,n)},y:dr,Y:ur,Z:fr,"%":Mr};function M(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=Jn[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function w(e,t){return function(n){var r,i,o=Kn(1900,void 0,1);if(E(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=Yn(Kn(o.y,0,1))).getUTCDay(),r=i>4||0===i?zn.ceil(r):zn(r),r=Ln.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=Wn(Kn(o.y,0,1))).getDay(),r=i>4||0===i?Cn.ceil(r):Cn(r),r=wn.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?Yn(Kn(o.y,0,1)).getUTCDay():Wn(Kn(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,Yn(o)):Wn(o)}}function E(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=S[i in Jn?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=M(n,b),b.X=M(r,b),b.c=M(t,b),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=w(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=w(e+="",!0);return t.toString=function(){return e},t}}}(e),Gn.format,Gn.parse,Xn=Gn.utcFormat,Gn.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var pi=1e3,mi=6e4,gi=36e5,yi=864e5,vi=2592e6,bi=31536e6;function xi(e){return new Date(e)}function Si(e){return e instanceof Date?+e:+new Date(+e)}function Mi(e,t,n,r,i,o,a,s,l){var c=Kt(Bt,Bt),u=c.invert,d=c.domain,f=l(".%L"),h=l(":%S"),p=l("%I:%M"),m=l("%I %p"),g=l("%a %d"),y=l("%b %d"),v=l("%B"),b=l("%Y"),x=[[a,1,pi],[a,5,5e3],[a,15,15e3],[a,30,3e4],[o,1,mi],[o,5,3e5],[o,15,9e5],[o,30,18e5],[i,1,gi],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,yi],[r,2,1728e5],[n,1,6048e5],[t,1,vi],[t,3,7776e6],[e,1,bi]];function S(s){return(a(s)<s?f:o(s)<s?h:i(s)<s?p:r(s)<s?m:t(s)<s?n(s)<s?g:y:e(s)<s?v:b)(s)}function M(t,n,r,i){if(null==t&&(t=10),"number"==typeof t){var o=Math.abs(r-n)/t,a=Re(function(e){return e[2]}).right(x,o);a===x.length?(i=je(n/bi,r/bi,t),t=e):a?(i=(a=x[o/x[a-1][2]<x[a][2]/o?a-1:a])[1],t=a[0]):(i=Math.max(je(n,r,t),1),t=s)}return null==i?t:t.every(i)}return c.invert=function(e){return new Date(u(e))},c.domain=function(e){return arguments.length?d(Ke.call(e,Si)):d().map(xi)},c.ticks=function(e,t){var n,r=d(),i=r[0],o=r[r.length-1],a=o<i;return a&&(n=i,i=o,o=n),n=(n=M(e,i,o,t))?n.range(i,o+1):[],a?n.reverse():n},c.tickFormat=function(e,t){return null==t?S:l(t)},c.nice=function(e,t){var n=d();return(e=M(e,n[0],n[n.length-1],t))?d(function(e,t){var n,r=0,i=(e=e.slice()).length-1,o=e[r],a=e[i];return a<o&&(n=r,r=i,i=n,n=o,o=a,a=n),e[r]=t.floor(o),e[i]=t.ceil(a),e}(n,e)):c},c.copy=function(){return Yt(c,Mi(e,t,n,r,i,o,a,s,l))},c}function wi(){return $e.apply(Mi(Un,Hn,Pn,Ln,Rn,In,Mn,yn,Xn).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}const Ei={horizontal:{major:"width",minor:"height",start:"left",end:"right",shadow:{startOffset:"12px 0",endOffset:"-12px 0"}},vertical:{major:"height",minor:"width",start:"top",end:"bottom",shadow:{startOffset:"0 12px",endOffset:"0 -12px"}}},ki=e=>`${e} 12px -12px inset rgba(0, 0, 0, 0.0625)`;var Ci={defaultSettings:{settings:{orientation:"horizontal",rtl:!1,range:()=>[0,1]}},renderer:"dom",render(e){const{range:t,orientation:n,rtl:r}=this.settings.settings,[i,o]=t(),a=Math.abs(i)<1e-15,s=Math.abs(o-1)<1e-15,l=(e=>{const t=Ei[e];return{base:{position:"absolute",[t.major]:12,[t.minor]:"100%"},towardsStart:{[t.start]:0,[t.end]:"auto",boxShadow:ki(t.shadow.startOffset)},towardsEnd:{[t.start]:"auto",[t.end]:0,boxShadow:ki(t.shadow.endOffset)}}})(n),c="horizontal"===n&&r,u=[];return a||u.push(e("div",{style:{...l.base,...c?l.towardsEnd:l.towardsStart},class:"scroll-hint--towards-start"})),s||u.push(e("div",{style:{...l.base,...c?l.towardsStart:l.towardsEnd},class:"scroll-hint--towards-end"})),u}};function Ai({viewState:e,viewCache:t,layoutService:n,dockService:r,rtl:i}){return!n.meta.isSnapshot&&{key:"scroll-hint",type:"scroll-hint",settings:{orientation:r.meta.major.orientation,rtl:i,range:()=>function({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}({layoutService:n,viewState:e,viewCache:t})}}}let Oi;function Ni(){Oi=Oi||document.createElement("canvas").getContext("2d")}const Di={measureTextWidth(e){Ni();const{width:t}=Oi.measureText(e);return t},lineWrap(e,t,n,r){let i,o;Ni();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,c,u,d,f=e?e.split(/\s+/):[],h=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&a.length>=r)return a.slice(0,r);for(n&&(Oi.font=n),o=0;o<a.length;o++){for(d=a[o]||"",f=d.split(/\s+/),[h]=f,u="",i=1;i<f.length;i++)if(l=`${h} ${f[i]}`,c=Di.measureTextWidth(l),c>t&&("number"!=typeof r||r>s.length)?(s.push(h),h=f[i]):h=l,"number"==typeof r&&s.length>=r){u=f.slice(i+1).join(" ");break}"number"!=typeof r||s.length<r?s.push(h):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${h} ${u}`}return s},wordWrap(e,t,n,r,i){if(Ni(),!e||!e.length)return[];n&&(Oi.font=n);let o=[];const a=e.slice();let s,l,c,u;if(a.filter(e=>!!e),"number"!=typeof t||t<0)return e.slice();for(u=0;u<a.length;u++)c=a[u],l=null,c&&(c.length<=1||Di.measureTextWidth(c)<=t?o.push(c):(s=Di.splitWord(c,t,void 0,r-o.length),s.length<=1?o.push(s[0]):(l=s.pop(),o=o.concat(s),a[u+1]?Di.measureTextWidth(`${l} ${a[u+1]}`)>t&&o.length+a.length-u<=r?a.splice(u+1,0,l):a[u+1]=`${l} ${a[u+1]}`:a.push(l))));return o.forEach((e,t,n)=>{n[t]=e?e.trim():e}),o.length>r?(o=o.splice(0,r),o[o.length-1]=Di.truncate(o[o.length-1],t,n,i).text):(c=o[o.length-1],c&&c.length>1&&Di.measureTextWidth(c)>t&&(o[o.length-1]=Di.truncate(c,t,n,i).text)),o},truncate(e,t,n,r="…"){Ni();let i,o,a,s,l=e;const c=Di.measureTextWidth("i"),u=Math.ceil(t/c);if(n&&(Oi.font=n),e&&t){if(Di.measureTextWidth(l)>t){for(i=Math.min(u,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+r,Di.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,r){let i;Ni();let o,a=e,s="",l=[];if(Di.isNumber(n)&&n<=1)return[e];const c=Math.ceil(t/r);for(i=Math.min(e.length,c);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(Di.measureTextWidth(a)<=t));i--);return(!i&&!a||Di.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(Di.measureTextWidth(s)>t?(s=Di.explodeWord(s,t,n-1,r),l=l.concat(s)):l.push(s),l.filter(e=>""!==e.trim())):l},splitWord:(e,t,n,r)=>(Ni(),e&&t?(n&&(Oi.font=n),Di.explodeWord(e,t,r,Math.max(1,Di.measureTextWidth("i")))):[]),wrapText(e,t,n,r,i){let o;return Number.isNaN(t)?[e]:(o=r>1?Di.lineWrap(e,t,n,r):[e],o=Di.wordWrap(o,t,n,r,i),o)},getFontHeight:e=>(Ni(),e&&(Oi.font=e),1.5*Di.measureTextWidth("m")),tokenize(e,t,n,r,i,o,a=1){Ni(),t&&(Oi.font=t);const s=Di.getFontHeight(),l=a*s;let c=[],u=0,d=[];if(o<s)return[];const f=o?Math.max(1,Math.floor(o/l)):r||1;return Array.isArray(r)?(r.forEach(e=>{u+=Number.isNaN(e)||e<=0?0:e}),r.forEach(e=>{c.push(Number.isNaN(e)||e<=0?f-u:e)})):c=[Number.isNaN(r)||r<=0?f:Math.min(f,r)],Array.isArray(e)?e.forEach((e,n)=>{d.length<f&&(d=d.concat(Di.wrapText(e,i,t,c[n])))}):d=Di.wrapText(e,i,t,c[0],n),d}},Ti={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",c="y",u=r,d=i,f=t<.5?90:-90;return o&&(s="y",c="x",u=i,d=r,f=t<.5?180:0),a(l({},e,{[s]:n*u,[c]:Math.max(e.size/2,Math.min(t*d,d-e.size/2)),startAngle:f}))}},qi=l.bind(null,!0),Ii={},{isArray:Ri}=Array;function Li(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function _i(e){return void 0===e}function Pi(e,t){return function(e){return"function"==typeof e}(e[t])||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function zi(e,t){const n=t.substring(1).split("/").slice(0,-1);let r;return n.forEach((t,i)=>{if(i===n.length)return;r=+t;const o=isNaN(r)?{}:[];e[r||t]=_i(e[r||t])?o:e[t],e=e[r||t]}),e}function Fi(e,t){return t?Object.keys(e).filter(t=>void 0!==e[t]).length:Object.keys(e).length}function ji(e,t,n){let r=!0;if(Li(e)&&Li(t))return Fi(e,n)===Fi(t,n)&&(Object.keys(e).forEach(i=>{ji(e[i],t[i],n)||(r=!1)}),r);if(Ri(e)&&Ri(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r+=1)if(!ji(e[r],t[r],n))return!1;return!0}return e===t}Ii.compare=ji,Ii.generate=function(e,t,n){n=n||"";let r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e?qi({},{val:e}).val:e}(t[i]),a=e[i],s=`${n}/${i}`;ji(o,a)||Pi(t,i)||(_i(a)?r.push({op:"add",path:s,value:o}):Li(o)&&Li(a)?r=r.concat(Ii.generate(a,o,s)):Ri(o)&&Ri(a)?r=r.concat(function(e,t,n){let r=[];const i=e.slice();let 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(let n=0,r=e.length;n<r;n+=1)if(e[n]&&e[n].qInfo.qId===t)return n;return-1}if(ji(t,i))return r;if(!_i(t[0])&&_i(t[0].qInfo)||0===t.length)return r.push({op:"replace",path:n,value:t}),r;for(let e=i.length-1;e>=0;e-=1)o=a(t,i[e].qInfo&&i[e].qInfo.qId,e),-1===o?(r.push({op:"remove",path:`${n}/${e}`}),i.splice(e,1)):r=r.concat(Ii.generate(i[e],t[o],`${n}/${e}`));for(let e=0,s=t.length;e<s;e+=1)o=a(i,t[e].qInfo&&t[e].qInfo.qId),-1===o?(r.push({op:"add",path:`${n}/${e}`,value:t[e]}),i.splice(e,0,t[e])):o!==e&&(r.push({op:"move",path:`${n}/${e}`,from:`${n}/${o}`}),i.splice(e,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:`${n}/${i}`,value:o}))}),Object.keys(e).forEach(i=>{_i(t[i])&&!Pi(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r},Ii.apply=function(e,t){t.forEach(t=>{let n=zi(e,t.path),r=t.path.split("/").splice(-1)[0],i=r&&isNaN(+r)?n[r]:n[+r]||n;const o=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(n=null,i=e),"add"===t.op||"replace"===t.op)if(Ri(n))"-"===r&&(r=n.length),n.splice(+r,"add"===t.op?0:1,t.value);else if(Ri(i)&&Ri(t.value)){const e=t.value.slice();i.length=0,i.push(...e)}else if(Li(i)&&Li(t.value))a=i,Object.keys(a).forEach(e=>{Object.getOwnPropertyDescriptor(a,e).configurable&&!Pi(a,e)&&delete a[e]}),qi(i,t.value);else{if(!n)throw new Error("Patchee is not an object we can patch");n[r]=t.value}else if("move"===t.op){const i=zi(e,t.from);Ri(n)?n.splice(+r,0,i.splice(+o,1)[0]):(n[r]=i[o],delete i[o])}else"remove"===t.op&&(Ri(n)?n.splice(+r,1):delete n[r]);var a})},Ii.clone=function(e){return qi({},e)},Ii.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},Ii.updateObject=function(e,t){Object.keys(e).length?Ii.apply(e,Ii.generate(e,t)):qi(e,t)};const $i=Math.log(10);function Bi(e){return 10**e}const Vi={pow10:Bi,log:(e,t)=>e<=0||t<=0?NaN:Math.log(e)/Math.log(t),log10:e=>e<=0?NaN:Math.log(e)/$i,eliminateFloatingError(e){const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e},getNiceNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/$i),r=e/Bi(n);return t=r<=1?1:r<=2?2:r<=5?5:10,t*Bi(n)*(e<0?-1:1)},getSmallNiceNumber(e){let t,n;if(0===e)return 0;t=Math.floor(Math.log(Math.abs(e))/$i);const r=e/Bi(t);return r<1?(n=5,t--):n=r<2?1:r<5?2:5,n*Bi(t)*(e<0?-1:1)},getMagnitude(e){if(0===e)return 0;return Bi(Math.floor(Math.log(Math.abs(e))/$i))},getFraction(e){if(0===e)return 0;return e/Bi(Math.floor(Math.log(Math.abs(e))/$i))},getGoodNumber(e){let t;if(0===e)return 0;const n=Math.floor(Math.log(Math.abs(e))/$i),r=e/Bi(n);return t=Math.ceil(r),7!==t&&9!==t||t++,r>1&&r<=1.5?t=1.5:r>2&&r<=2.5&&(t=2.5),t*Bi(n)*(e<0?-1:1)},getValueWithOffset:(e,t=0)=>e+Math.abs(e)*t,isNumber:e=>"number"==typeof e&&!Number.isNaN(e)},Hi=[[2,4,6],[2,4],[3]],Ui=[,[,,[[1,2]],[[1,2,3],[1,3]],[[1,2,4],[1,4]],[[1,2,4],[1,5]],[[1,2,4,6],[2,4,6],[1,3,6],[1,6]],[[1,2,4,6],[2,4,6],[1,3,6],[1,7]],[[1,2,4,8],[2,4,8],[1,8]],[[1,2,4,8],[2,4,8],[1,3,9],[1,9]],[[1,2,4,6,10],[1,2,4,10],[1,3,10],[3,10],[1,10]]],[,,,[[2,3]],[[2,3,4],[2,4]],[[2,3,4],[2,4],[2,5]],[[2,4,6],[2,6]],[[2,4,6],[2,6],[2,7]],[[2,4,8],[2,8]],[[2,4,8],[2,8],[2,9]],[[2,4,6,10],[2,4,10],[5,10],[3,10]]],[,,,,[[3,4]],[[3,4,5],[3,5]],[[3,4,5,6],[3,6]],[[3,4,5,6],[3,5,7],[3,7]],[[3,4,5,6,8],[3,5,7],[4,8],[3,8]],[[3,4,5,6,8],[3,4,6,9],[3,4,6,8],[3,6,9],[4,8],[3,9]],[[4,6,10],[5,10],[3,10]]],[,,,,,[[4,5]],[[4,5,6],[4,6]],[[4,5,6,7],[4,5,6],[4,6]],[[4,5,6,7,8],[4,5,6,7],[4,6,8],[4,8]],[[4,5,6,7,8],[4,6,9],[4,6,8],[4,8]],[[4,6,10],[5,7,9],[5,10],[4,10]]],[,,,,,,[[5,6]],[[5,6,7],[5,7]],[[5,6,7,8],[5,6,7],[6,8]],[[5,6,7,8,9],[5,6,7,8],[5,7,9],[5,9]],[[6,8,10],[5,10]]],[,,,,,,,[[6,7]],[[6,7,8],[6,8]],[[6,7,8,9],[6,7,8],[6,9]],[[6,7,8,9,10],[6,8,10],[6,10]]],[,,,,,,,,[[7,8]],[[7,8,9],[7,9]],[[7,8,9,10],[8,10],[7,10],[7,9]]],[,,,,,,,,,[[8,9]],[[8,9,10],[8,10]]],[,,,,,,,,,,[[9,10]]]];function Wi(e,t,n){const r=e?e.length:0;let i,o=void 0===t?Number.MAX_VALUE:e[0]/t;for(i=1;i<r;i++)o=Math.min(o,e[i]/e[i-1]);void 0!==n&&(o=Math.min(o,n/e[r-1])),e.splice(0,0,o)}function Yi(e,t,n){let r;const i=e?e.length:0;for(r=0;r<i;r++)Wi(e[r],t,n)}!function(){let e,t;for(Yi(Hi,1,10),e=0;e<Ui.length;e++)if(Ui[e])for(t=0;t<Ui[e].length;t++)Array.isArray(Ui[e][t])&&Yi(Ui[e][t])}();const Ki={isInside(e,t,n,r){if(!r)return!0;const i=e.position-e.radius,o=e.position+e.radius;return i>=t&&o<=n},getCenterDistance:(e,t)=>Math.abs(e.center-t.center),getGap(e,t){const n=e.position<t.position?e:t,r=e.position<t.position?t:e;return r.position-r.radius-(n.position+n.radius)},findSegmentPositionMeetMax(e,t){const n=Math.max(0,e.max-t);return e.center-n},findSegmentPositionMeetMin(e,t){const n=Math.max(0,t-e.min);return e.center+n},findSegmentPositionMeetMinThenMax(e,t,n){const r=Ki.findSegmentPositionMeetMin(e,t);return Ki.findSegmentPositionMeetMax({center:r,max:r+e.radius},n)},findSegmentPositionMeetMaxThenMin(e,t,n){const r=Ki.findSegmentPositionMeetMax(e,n);return Ki.findSegmentPositionMeetMin({center:r,min:r-e.radius},t)},layoutPositionFromMin(e,t,n,r=0){const i=e.length-1;let o,a,s=t;for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.position=Ki.findSegmentPositionMeetMaxThenMin(o,s,(o.center+a.center-r)/2),s=o.position+o.radius+r/2;a.position=Ki.findSegmentPositionMeetMaxThenMin(a,s,n)},adjustPositionFromMax(e,t,n,r=0){const i=e.length-1;let o,a,s;const l=Math.max(0,e[i].position+e[i].radius-n);if(0===l)return;let c,u=0;for(o=i;o>0&&(a=e[o],s=e[o-1],c=Math.max(0,Ki.getGap(s,a)-r),c-=Math.max(0,u+c-l),u+=c,a.move=c,!(u>=l));o--);for(u<l&&(c=Math.max(0,s.position-s.radius-t),c-=Math.max(0,u+c-l),u+=c,s.move=c),u=0,o=0;o<=i;o++)a=e[o],u+=a.move||0,a.move=u,a.position-=u},layout(e,t,n,r=0){const i=e.length-1;if(!(i<0)){if(0===i){const r=e[0];return void(r.position=Ki.findSegmentPositionMeetMaxThenMin(r,t,n))}Ki.layoutPositionFromMin(e,t,n,r),Ki.adjustPositionFromMax(e,t,n,r)}}},Gi=(e,t,n,r=1)=>{const i=e.bandwidth();return n?"start"===t?i:"end"===t?i*(1-r):i*(2-r)/2:"start"===t?0:"end"===t?i*r:i*r/2},Xi=e=>!1!==e.show&&0!==e.show&&"0"!==e.show,Ji=e=>e.filter(Xi),Zi=(e,t)=>Ji(y.getValue(e,t,[])),Qi=e=>Xi(e)&&(!1!==e.showValue||!1!==e.showLabel),eo=e=>e.filter(Qi),to=(e,t)=>eo(y.getValue(e,t,[])),no=({refLineLayout:e,layoutService:t})=>t.meta.canBeContinuous?e.refLineExpr.value:e.refLineExpr.stringValue,ro=(e,t,n)=>{const{dimensionRefLineInfo:r}=t;if(r[e])return r[e][n]},io=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.maxOrder<r},oo=({label:e,dataPages:t})=>{const{qArea:n={}}=t||{},{qTop:r,qHeight:i}=n;return void 0!==r&&void 0!==i&&void 0!==e.valueInfo&&e.valueInfo.minOrder>=r+i},ao=({value:e,qMin:t})=>"NaN"!==t&&e<t,so=({value:e,qMax:t})=>"NaN"!==t&&e>t,lo={isRefLineVisible:Xi,getVisibleRefLines:Ji,getRefLines:Zi,getMeasureRefLines:e=>Zi(e,"refLine.refLines"),getDimensionRefLines:(e,t)=>t?[]:Zi(e,"refLine.dimRefLines"),isRefLineLabelVisible:Qi,getVisibleRefLineLabels:eo,getRefLineLabels:to,getMeasureRefLineLabels:e=>to(e,"refLine.refLines"),getDimensionRefLineLabels:(e,t)=>t?[]:to(e,"refLine.dimRefLines"),getScaledPosition:({scale:e,size:t,value:n,valueInfo:r,align:i,invert:o=!1,layoutService:a,isContinuous:s})=>{if(!s){const s=e.pxScale(t);let l;if(a.meta.isGroupedByMeasure)return l=Gi(s,i,o,a.meta.groupSize??a.meta.measureCount),s([n,0])+l;if(a.meta.isGroupedByDimension){if(!r)return NaN;const{innerValues:e,numInnerValues:t,minOrder:a}=r;let c;return l=Gi(s,i,o,t),e&&e.length&&(c=(({pxScale:e,value:t,innerValues:n,invert:r,minOrder:i})=>{const o=(({pxScale:e,invert:t})=>e.bandwidth()*(t?-1:1))({pxScale:e,invert:r});for(let r=0;r<n.length;r++){const{id:a,order:s}=n[r],l=e([t,a]);if(void 0!==l)return l-o*(s-i)}})({pxScale:s,value:n,innerValues:e,invert:o,minOrder:a})),(void 0===c?s(n):c)+l}return l=Gi(s,i,o),s(n)+l}return e(n)},getDimensionValuesInfo:({layout:e,canBeContinuous:t,discreteModel:n,layoutService:r})=>{const{isGroupedByDimension:i}=r.meta,o={},a=y.getValue(e,"qHyperCube"),s="K"===a.qMode,l=n?n.query.getCurrentDataPage():y.getValue(a,"S"===a.qMode?"qDataPages.0":"qStackedDataPages.0",[]);if(void 0===l?.qArea?.qTop)return o;const c=s?"qData.0.qSubNodes":"qMatrix",u=y.getValue(l,c,[]),d=((e,t)=>e?t?"qValue":"qNum":"qText")(t,s),f=(e=>e.qArea.qTop)(l);return s?(()=>{for(let e=0;e<u.length;e++){const t=u[e],n=e+f,r=t[d];o[r]||(o[r]={id:t.qElemNo,qText:t.qText,minOrder:n,maxOrder:n,dataNode:u[e]})}})():i?(()=>{let e;for(let t=0;t<u.length;t++){const n=u[t][0],r=u[t][1],i=t+f,a=n[d];o[a]?(o[a].minOrder=Math.min(o[a].minOrder,i),o[a].maxOrder=Math.max(o[a].maxOrder,i),o[a].innerValues[o[a].innerValues.length]={id:r.qElemNumber,order:i}):o[a]={id:n.qElemNumber,qText:n.qText,minOrder:i,maxOrder:i,innerValues:[{id:r.qElemNumber,order:i}],dataNode:u[t]},0===t?0===i&&(o[a].isMinOrderOk=!0):a!==e&&(o[a].isMinOrderOk=!0,o[e].isMaxOrderOk=!0),e=a}})():(()=>{for(let e=0;e<u.length;e++){const t=u[e][0],n=e+f,r=t[d];o[r]||(o[r]={id:t.qElemNumber,qText:t.qText,minOrder:n,maxOrder:n,dataNode:u[e]})}})(),o},getInputValue:no,extractInfoFromInputValue:ro,resolveValue:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=no({refLineLayout:e,layoutService:n});return ro(r,t,"id")},isDiscreteMinOutOfBounds:io,isDiscreteMaxOutOfBounds:oo,isContinuousMinOutOfBounds:ao,isContinuousMaxOutOfBounds:so,isOutOfRange:({value:e,qMin:t,qMax:n})=>ao({value:e,qMin:t})||so({value:e,qMax:n}),isOutOfDataPages:({label:e,dataPages:t})=>e.valueInfo.isMinOrderOk&&oo({label:e,dataPages:t})||e.valueInfo.isMaxOrderOk&&io({label:e,dataPages:t}),getInvert:({orientation:e,rtl:t,isContinuous:n})=>"horizontal"===e?t:n},co=({label:e,labelStyle:t})=>[e?.fontStyle||t?.fontStyle,e?.fontWeight||t?.fontWeight,e?.fontSize||t?.fontSize,e?.fontFamily||t?.fontFamily].filter(e=>!!e).join(" ");function uo(e){return e.showValue?`… ${e.valueString}`:"…"}function fo(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r],o=co({label:i,labelStyle:t});i.lines=Di.tokenize(i.title,o,uo(i),3,n),i.maxNumLines=i.lines.length}}function ho({title:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=Di.tokenize(e,t,n,r,i),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n${o[e]}`}return s}function po({oobs:e,font:t,ellipsis:n,maxNumLines:r=5,maxWidth:i=200}){const o=e.map(e=>ho({title:e.title,font:t,ellipsis:`${n} ${e.valueString}`,maxNumLines:r,maxWidth:i})),a=o.length;let s="";if(a){[s]=o;for(let e=1;e<a;e++)s=`${s}\n\n${o[e]}`}return s}function mo(e,t="value"){e.sort((e,n)=>e[t]-n[t])}const go=3,yo=2;function vo({inputValue:e,inputValueLabel:t,localeInfo:n}){if(void 0===e||void 0===t||e.toString()===t)return!1;if(!n)return!0;const r=`+-${n.qDecimalSep||""}${n.qThousandSep||""}`.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");return t.replace(new RegExp(`[0-9e${r}]`,"g"),"").length>0||function(e){if(e.indexOf("e")>-1)return!1;const t=e.indexOf("-");return-1!==t&&(e.lastIndexOf("-")!==t||0!==t)}(t)}const bo=({label:e,dataPages:t,qMin:n,qMax:r})=>{if(void 0!==n&&void 0!==r){const{inputValue:t}=e;if(lo.isContinuousMaxOutOfBounds({value:t,qMax:r}))return 1;if(lo.isContinuousMinOutOfBounds({value:t,qMin:n}))return-1}return lo.isDiscreteMaxOutOfBounds({label:e,dataPages:t})?1:lo.isDiscreteMinOutOfBounds({label:e,dataPages:t})?-1:0},xo={hasEngineFormat:vo,calculateLabelPositions({labels:e,scale:t,size:n,layoutService:r,orientation:i,rtl:o,isContinuous:a,isDimension:s}){const l=lo.getInvert({orientation:i,rtl:o,isContinuous:a}),c="S"===r.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",u=r.getHyperCubeValue(c),{canBeContinuous:d}=r.meta;let f,h;if(s&&d){const e=r.getLayoutValue("qHyperCube.qDimensionInfo.0");f=e.qMin,h=e.qMax}for(let i=0;i<e.length;i++){const o=e[i],{value:s,align:c,valueInfo:d}=o,p=bo({label:o,dataPages:u,qMin:f,qMax:h});o.scaledValue=1===p?l?-.1:1.1:-1===p?l?1.1:-.1:lo.getScaledPosition({scale:t,size:n,value:s,valueInfo:d,align:c,invert:l,layoutService:r,isContinuous:a}),o.center=o.scaledValue*n}},getTitle:e=>!1!==e.showValue?!1!==e.showLabel?`${e.text} ${e.valueString}`:e.valueString:!1!==e.showLabel?e.text:"",addLabelTitles({labels:e,formatter:t,isContinuous:n,canBeContinuous:r,localeInfo:i}){let o;if(n)for(let n=0;n<e.length;n++){const r=e[n],{value:a,inputValue:s,inputValueLabel:l}=r;o=vo({inputValue:s,inputValueLabel:l,localeInfo:i})?l:t?t(a):a,r.valueString=`${T.lrm}(${o})${T.lrm}`,r.title=xo.getTitle(r)}else if(r)for(let t=0;t<e.length;t++){const n=e[t],{valueText:r,inputValue:a,inputValueLabel:s}=n;o=vo({inputValue:a,inputValueLabel:s,localeInfo:i})?s:r,n.valueString=`${T.lrm}(${o})${T.lrm}`,n.title=xo.getTitle(n)}else for(let t=0;t<e.length;t++){const n=e[t];o=n.valueText,n.valueString=`${T.lrm}(${o})${T.lrm}`,n.title=xo.getTitle(n)}},measureLabelsWidth(e,t){for(let n=0;n<e.length;n++){const r=e[n];r.totalWidth=t(r.title,r).width}},measureLabelMaxLineWidth(e,t){const n=Math.max(...e.lines.map(n=>t(n,e).width));return n},getMaxTextWidth(e){const t=e.map(e=>e.totalWidth);return Math.max(...t)},addLabelsNeighborInfo(e,t,n,r=0){const i=e.length-1;if(i<0)return;let o,a;if([o]=e,o.cMin=t,0!==i){for(let t=0;t<i;t++)o=e[t],a=e[t+1],o.cMax=(o.center+a.center-r)/2,a.cMin=o.cMax+r;a.cMax=n}else o.cMax=n},getTotalNumLines(e){let t=0;return e.forEach(e=>{t+=e.maxNumLines}),t},reduceLabelsHavingMaxNumLines(e,t,n){const r=t-1,i=e.filter(e=>e.maxNumLines===t),o=Math.min(n,i.length);for(let e=i.length-1;e>=i.length-o;e--)i[e].maxNumLines=r},reduceTotalMaxNumLines(e,t,n){const r=Math.floor(n/t);let i=3;do{const t=xo.getTotalNumLines(e)-r;if(t<=0)return;xo.reduceLabelsHavingMaxNumLines(e,i,t),i--}while(i>1)},reduceMaxNumLines(e,t,n=0){for(let r=0;r<e.length;r++){const i=e[r];i.maxNumLines=Math.max(1,Math.min(i.maxNumLines,Math.floor((Math.max(0,i.cMax-i.cMin)+n)/t)))}},addLabelsSize(e,t,n=15,r){for(let i=0;i<e.length;i++){const o=e[i];o.width=Math.min(t,xo.measureLabelMaxLineWidth(o,r)),o.height=o.lines.length*n}},addLabelSegments(e,t){for(let n=0;n<e.length;n++){const r=e[n],{center:i}=r,o=r[t],a=o/2;r.segment={center:i,range:o,min:i-a,max:i+a,radius:a}}},addLabelsInfo({labels:e,scale:t,majorSize:n,lowerLimit:r,upperLimit:i,gap:o,labelStyle:a,maxLabelWidth:s,lineHeight:l,majorDimension:c,orientation:u,measureText:d,rtl:f,layoutService:h,isContinuous:p,isDimension:m}){const g=e.map(e=>e),y=n;xo.calculateLabelPositions({labels:e,scale:t,size:y,layoutService:h,orientation:u,rtl:f,isContinuous:p,isDimension:m}),mo(e,"center"),xo.addLabelsNeighborInfo(e,r,i,o),fo(e,a,s),xo.reduceTotalMaxNumLines(g,l,i-(g.length-1)*o),"vertical"===u&&(xo.reduceMaxNumLines(e,l,.05*o),function(e,t,n=70){for(let r=0;r<e.length;r++){const i=e[r],o=co({label:i,labelStyle:t});i.lines.length>i.maxNumLines&&(i.lines=Di.tokenize(i.title,o,uo(i),i.maxNumLines,n))}}(e,a,s)),xo.addLabelsSize(e,s,l,d),xo.addLabelSegments(e,c)},createLabels({labels:e,style:t,maxLabelWidth:n,areaProps:r,area:i,lineHeight:o=15,font:a}){const{majorAxis:s,minorAxis:l,dock:c}=r,{minorCenter:u}=i,{fontSize:d,fontFamily:f,fontStyle:h,fontWeight:p,textDecoration:m,background:g}=t;let y=[];return e.forEach(e=>{const{lines:t}=e,r=t.length,i=t.map((t,i)=>{const g={type:"text",text:t,title:ho({title:e.title,font:a,ellipsis:uo(e)}),dx:0,dy:0,maxWidth:n,width:n,fontSize:e.fontSize||d,fontFamily:e.fontFamily||f,fontStyle:e.fontStyle||h,fontWeight:e.fontWeight||p,textDecoration:e.textDecoration||m,fill:e.fill,baseline:"central",anchor:"middle",value:e.value,dock:c};return g[l]=u,g[s]=e.segment.position,g.y+=(i-(r-1)/2)*o,g});e.background&&y.push(function({minorCenter:e,majorAxis:t,minorAxis:n,dock:r,label:i,lineHeight:o,background:a}){const{lines:s}=i,{borderRadius:l=go,padding:c={}}=a,{top:u=yo,bottom:d=yo,left:f=yo,right:h=yo}=c,p=s.length,m={type:"rect",rx:l,ry:l,fill:i.background.fill,width:i.width+(f+h),height:i.height+(u+d),value:i.value,dock:r};return m[n]=e,m[t]=i.segment.position,m.x-=i.width/2+f,m.y-=p*o/2+u,m}({minorCenter:u,majorAxis:s,minorAxis:l,dock:c,label:e,lineHeight:o,background:g})),y=y.concat(i)}),y}};function So(e,t,n){let r;const i=typeof t;if("string"===i||"object"===i)r=e.formatter(t);else if(void 0!==n&&n.data){const e=n.data()&&n.data().fields;r=e&&e[0]?e[0].formatter():null}return r}function Mo(e,t,n){return"top"===e||"bottom"===e?function(e,t){const{lineHeight:n,top:r,bottom:i,maxLabelWidth:o}=t;let a=1;return xo.getMaxTextWidth(e)>o&&(fo(e,t,o),a=Math.max(...e.map(e=>e.lines.length))),a*n+r+i}(t,n):function(e,t){const{left:n,right:r,maxLabelWidth:i}=t;return Math.min(i,xo.getMaxTextWidth(e))+n+r}(t,n)}function wo(e,t){return t?e.domain():[0,1]}function Eo(e,t,n,r="value"){let i=e.filter(e=>e[r]>=t);i=i.filter(e=>e[r]<=n);const o=e.filter(e=>e[r]<t),a=e.filter(e=>e[r]>n);return{filteredLabels:i,minOobs:o,maxOobs:a,numMinOobs:o.length,numMaxOobs:a.length}}function ko(e){let t,n=0;for(let r=1;r<10;r++)t=e(r),n=Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height));return t=e("9+"),[n,Math.max(n,Math.sqrt(t.width*t.width+t.height*t.height))]}function Co(e,t){return e>9?t[1]:t[0]}function Ao({alignment:e,dockValue:t,oobs:n,style:r,rect:i,symbol:o,position:a,areaProps:s,radius:l,font:c}){const u=n?n.length:0;if(u<1)return[];const{flipXY:d,majorAxis:f,minorAxis:h,minorDimension:p,dock:m}=s,g=i[p],y=Ti.createOob({oob:Ti.getDefaultSettings({size:r.size,fill:r.fill,alignment:e}),dockValue:t,boxCenter:.5,rendWidth:i.width,rendHeight:i.height,flipXY:d,symbol:o});y.dock=m;const v=`c${f}`,b=`c${h}`,x={type:"circle",r:l,stroke:"transparent",fill:r.text.background.fill,strokeWidth:0,dock:m};x[b]=g/2,x[v]=a;const S={type:"text",text:u>9?"9+":u,title:po({oobs:n,font:c,ellipsis:"…"}),dx:0,dy:0,maxWidth:g,width:g,fontSize:r.text.fontSize,fontFamily:r.text.fontFamily,fill:r.text.fill,baseline:"central",anchor:"middle",dock:m};return S[h]=g/2,S[f]=a,[y,x,S]}const Oo=e=>{const t=co({labelStyle:e}),n=Di.getFontHeight(t)*(e.lineHeightMultiplicator||1),r=e.gap||12,i=e.maxWidth||75,o=e.padding.top||0,a=e.padding.bottom||0,s=e.padding.left||0,l=e.padding.right||0;return{...e,font:t,lineHeight:n,gap:r,maxLabelWidth:i,top:o,bottom:a,left:s,right:l}},No=e=>e.map(e=>({...e,value:"function"==typeof e.value?e.value():e.value,valueText:"function"==typeof e.valueText?e.valueText():e.valueText,valueInfo:"function"==typeof e.valueInfo?e.valueInfo():e.valueInfo}));var Do={require:["renderer","chart","symbol"],defaultSettings:{layout:{displayOrder:0,prioOrder:0}},preferredSize(){const{scale:e}=this,{style:t,layoutService:n,isContinuous:r,localeInfo:i}=this.settings,o=!!r||n.meta.canBeContinuous,a=No(this.settings.labels),s=So(this.chart,this.settings.formatter,e);xo.addLabelTitles({labels:a,formatter:s,isContinuous:r,canBeContinuous:o,localeInfo:i});const{numMaxOobs:l,numMinOobs:c,filteredLabels:u}=(({labels:e,scale:t,isContinuous:n,canBeContinuous:r,layoutService:i})=>{if(n){const[r,i]=wo(t,n);return Eo(e,r,i)}if(r){const t=i.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:n,qMax:r}=t;if("NaN"!==n&&"NaN"!==r)return Eo(e,n,r,"inputValue")}return{filteredLabels:e}})({labels:a,scale:e,isContinuous:r,canBeContinuous:o,layoutService:n});let d;if(this.measureText=(e,n)=>{const{fontSize:r,fontFamily:i,fontWeight:o}=n||{};return this.renderer.measureText({text:e,fontWeight:o||t.label.fontWeight,fontSize:r||t.label.fontSize,fontFamily:i||t.label.fontFamily})},u&&u.length){const e=Oo(t.label),{dock:n}=this.settings.layout;return xo.measureLabelsWidth(u,this.measureText),d=Mo(n,u,e),d}const f=ko(this.measureText),h=l?Co(l,f):0,p=c?Co(c,f):0;return d=Math.max(h,p),d},render(){const{scale:e}=this;if(!e.domain().length)return;const{symbol:t}=this,{style:n,layoutService:r,theme:i,isContinuous:o,isDimension:a,localeInfo:s}=this.settings,l=!!o||r.meta.canBeContinuous,c=No(this.settings.labels),{dock:u,rtl:d}=this.settings.layout,{padding:f}=n.label,h=function(e){return"left"===e||"right"===e?(e=>({dock:e,orientation:"vertical",majorAxis:"y",minorAxis:"x",majorDimension:"height",minorDimension:"width",flipXY:!1}))(e):(e=>({dock:e,orientation:"horizontal",majorAxis:"x",minorAxis:"y",majorDimension:"width",minorDimension:"height",flipXY:!0}))(e)}(u),p=function(e,t,n){const r=e[t.minorDimension];return{minorSize:r,majorSize:e[t.majorDimension],minorCenter:"vertical"===t.orientation?(r-n.right-n.left)/2+n.left:(r-n.top-n.bottom)/2+n.top}}(this.rect,h,f),{orientation:m,majorDimension:g}=h,{majorSize:y}=p,v=Oo(n.label),{font:b,lineHeight:x,gap:S,maxLabelWidth:M}=v,w=So(this.chart,this.settings.formatter,e),E=y;xo.addLabelTitles({labels:c,formatter:w,isContinuous:o,canBeContinuous:l,localeInfo:s}),xo.calculateLabelPositions({labels:c,scale:e,size:E,layoutService:r,orientation:m,rtl:d,isContinuous:o,isDimension:a});const[k,C]=wo(e,o),{filteredLabels:A,lowerOobs:O,upperOobs:N,lowerCircleSize:D,upperCircleSize:T,lowerOobSpace:q,upperOobSpace:I}=function({labels:e,minValue:t,maxValue:n,orientation:r,rtl:i,isContinuous:o,style:a,padding:s,measureText:l,prop:c="value"}){const{maxOobs:u,minOobs:d,filteredLabels:f}=Eo(e,t,n,c),h="scaledValue"!==c&&lo.getInvert({orientation:r,rtl:i,isContinuous:o}),p=function(e,t,n){return n?t:e}(d,u,h),m=function(e,t,n){return n?e:t}(d,u,h),g=p.length,y=m.length,v=ko(l),b=Co(g,v),x=Co(y,v),S=function(e,t,n,r,i){return("vertical"===r?i.top:i.left)+(e>0?t+n:0)}(g,a.oob.size,b,r,s),M=function(e,t,n,r,i){return("vertical"===r?i.bottom:i.right)+(e>0?t+n:0)}(y,a.oob.size,x,r,s);return{filteredLabels:f,lowerOobs:p,upperOobs:m,lowerCircleSize:b,upperCircleSize:x,lowerOobSpace:S,upperOobSpace:M}}({labels:c,minValue:k,maxValue:C,orientation:m,rtl:d,isContinuous:o,style:n,padding:f,measureText:this.measureText,prop:o?"value":"scaledValue"}),R=q,L=y-I;mo(O),mo(N);const _=Ao({alignment:0,dockValue:0,oobs:O,style:n.oob,rect:this.rect,symbol:t,position:n.oob.size+D/2,areaProps:h,radius:D/2,font:b}),P=Ao({alignment:1,dockValue:1,oobs:N,style:n.oob,rect:this.rect,symbol:t,position:y-(n.oob.size+T/2),areaProps:h,radius:T/2,font:b});xo.addLabelsInfo({labels:A,scale:e,majorSize:y,lowerLimit:R,upperLimit:L,labelStyle:v,lineHeight:x,gap:S,maxLabelWidth:M,majorDimension:g,orientation:m,measureText:this.measureText,rtl:d,layoutService:r,isContinuous:o,isDimension:a}),Ki.layout(A.map(e=>e.segment),R,L,n.label.gap);const z=A.filter(e=>Ki.isInside(e.segment,R,L,o));return xo.createLabels({labels:z,style:n.label,maxLabelWidth:M,areaProps:h,area:p,lineHeight:x,font:b,theme:i}).concat([..._,...P])}};function To(e){return null!==e&&"object"==typeof e&&"r"in e&&"number"==typeof e.r&&"g"in e&&"number"==typeof e.g&&"b"in e&&"number"==typeof e.b&&("number"==typeof e.a||void 0===e.a)}function qo(e){if("object"==typeof e&&To(e))return(e.r<<16)+(e.g<<8)+e.b;let t=0,n=0,r=0;if("string"==typeof e){let i;(i=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(e))?(t=parseInt(i[1],10),n=parseInt(i[2],10),r=parseInt(i[3],10)):(i=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(e))?(t=parseInt(i[1],16),n=parseInt(i[2],16),r=parseInt(i[3],16)):(i=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(e))&&(t=parseInt(i[1]+i[1],16),n=parseInt(i[2]+i[2],16),r=parseInt(i[3]+i[3],16))}return(t<<16)+(n<<8)+r}const 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:0,g:0,b:0,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}},Ro="qcm-color";function Lo(...e){const t={type:Ro,r:0,g:0,b:0,a:1,invalid:!1,spaces:{}};let n=0,r=0,i=0,o=1;if(null!==(a=e[0])&&"object"==typeof a&&"type"in a&&a.type===Ro)({r:n,g:r,b:i,a:o}=e[0]),t.invalid=e[0].invalid,t.spaces={...e[0].spaces};else if(To(e[0]))({r:n,g:r,b:i}=e[0]),"a"in e[0]&&({a:o}=e[0]);else if(e.length<3)if("string"==typeof e[0]){const a=e[0];let s;if(s=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(a))n=parseInt(s[1],10),r=parseInt(s[2],10),i=parseInt(s[3],10);else if(s=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(a))n=parseInt(s[1],10),r=parseInt(s[2],10),i=parseInt(s[3],10),o=parseFloat(s[4]);else if(s=/^ARGB\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i.exec(a))o=parseInt(s[1],10)/255,n=parseInt(s[2],10),r=parseInt(s[3],10),i=parseInt(s[4],10);else if(s=/^#([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})([A-Fa-f0-9]{2})$/i.exec(a))n=parseInt(s[1],16),r=parseInt(s[2],16),i=parseInt(s[3],16),o=1;else if(s=/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i.exec(a))n=parseInt(s[1]+s[1],16),r=parseInt(s[2]+s[2],16),i=parseInt(s[3]+s[3],16),o=1;else if(s=/^hsl\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a<=.5?2*a*t:(2-2*a)*t;let c=e/60;const u=l*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[l,u,0];break;case 1:d=[u,l,0];break;case 2:d=[0,l,u];break;case 3:d=[0,u,l];break;case 4:d=[u,0,l];break;case 5:d=[l,0,u];break;default:d=[0,0,0]}const f=a-.5*l;n=d[0]+f,r=d[1]+f,i=d[2]+f,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i),o=1}else if(s=/^hsla\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d(\.\d+)?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);o=parseFloat(s[7]),e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a<=.5?2*a*t:(2-2*a)*t;let c=e/60;const u=l*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[l,u,0];break;case 1:d=[u,l,0];break;case 2:d=[0,l,u];break;case 3:d=[0,u,l];break;case 4:d=[u,0,l];break;case 5:d=[l,0,u];break;default:d=[0,0,0]}const f=a-.5*l;n=d[0]+f,r=d[1]+f,i=d[2]+f,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i)}else if(s=/^hsv\(\s*(\d+(\.\d+)?)\s*,\s*(\d+(\.\d+)?%?)\s*,\s*(\d+(\.\d+)?%?)\s*\)$/i.exec(a)){let e=parseFloat(s[1]),t=parseFloat(s[3]),a=parseFloat(s[5]);e%=360,t/=100,a/=100,e=e<0?0:e>360?360:e,t=t<0?0:t>1?1:t,a=a<0?0:a>1?1:a;const l=a*t;let c=e/60;const u=l*(1-Math.abs(c%2-1));let d=[];switch(c=Math.floor(c),c){case 0:d=[l,u,0];break;case 1:d=[u,l,0];break;case 2:d=[0,l,u];break;case 3:d=[0,u,l];break;case 4:d=[u,0,l];break;case 5:d=[l,0,u];break;default:d=[0,0,0]}const f=a-l;n=d[0]+f,r=d[1]+f,i=d[2]+f,n=Math.round(255*n),r=Math.round(255*r),i=Math.round(255*i),o=1}else{const e=a.toLowerCase();if(function(e){return e in Io}(e)){const t=Io[e];({r:n,g:r,b:i}=t),o="a"in t?t.a:1}else t.invalid=!0}}else"number"==typeof e[0]&&e[0]>=0&&"argb"===e[1]?(o=(4278190080&e[0])>>>24,o/=255,n=(16711680&e[0])>>16,r=(65280&e[0])>>8,i=255&e[0]):"number"==typeof e[0]&&e[0]>=0?(n=(16711680&e[0])>>16,r=(65280&e[0])>>8,i=255&e[0]):t.invalid=!0;else 3===e.length||4===e.length?(n=e[0],r=e[1],i=e[2],o=4===e.length?e[3]:1):t.invalid=!0;var a;return Number.isNaN(+n+r+i+o)&&(t.invalid=!0),t.r=Math.floor(n),t.g=Math.floor(r),t.b=Math.floor(i),t.a=o,t}function _o(e){let t,n,r=0;const i="string"==typeof e?Lo(e):e,o=i.r/255,a=i.g/255,s=i.b/255,{a:l}=i,c=Math.max(o,a,s),u=Math.min(o,a,s),d=(c+u)/2;if(c===u)t=0,r=0;else{switch(n=c-u,t=d>.5?n/(2-c-u):n/(c+u),c){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return{h:360*r,s:100*t,l:100*d,a:l}}function Po(e){let t,n,r=0;const i="string"==typeof e?Lo(e):e,o=i.r/255,a=i.g/255,s=i.b/255,l=Math.max(o,a,s),c=Math.min(o,a,s),u=l;if(l===c)t=0,r=0;else{switch(n=l-c,t=0===n?0:n/u,l){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return{h:360*r%360,s:100*t,v:100*u}}function zo(e){if(To(e))return`rgb(${e.r}, ${e.g}, ${e.b})`;const t="string"==typeof e?qo(e):e;return`rgb(${(16711680&t)>>16}, ${(65280&t)>>8}, ${255&t})`}function Fo(e,t){return To(e)?`rgba(${e.r}, ${e.g}, ${e.b}, ${e.a})`:Fo(Lo(e))}function jo(e){return To(e)?1===e.a?zo(e):Fo(e):jo(Lo(e))}const $o=e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};function Bo(...e){const t=Lo(...e);return t.invalid||function(e){return.2126*$o(e.r)+.7152*$o(e.g)+.0722*$o(e.b)}(t)<.4}function Vo(...e){const t=Lo(...e),n={type:t.type,r:t.r,g:t.g,b:t.b,a:t.a,invalid:t.invalid,spaces:t.spaces},r=()=>(n.spaces.hslaObject||(n.spaces.hslaObject=_o(n)),n.spaces.hslaObject),i=e=>{const t=r(),{h:n,s:i,l:o,a:a}=t;return`hsla(${n}, ${i}, ${Math.max(0,Math.min(o+e,100))}, ${a})`};return{get type(){return n.type},isInvalid:()=>n.invalid,get r(){return n.r},get g(){return n.g},get b(){return n.b},get a(){return n.a},getR:()=>n.r,getG:()=>n.g,getB:()=>n.b,getAlpha:()=>n.a,setAlpha:e=>{n.a=e,n.spaces={}},isEqualTo:e=>{let t;if("string"==typeof e)t=Lo(e);else{if(e.type!==n.type)return!1;t=e}return t.r===n.r&&t.g===n.g&&t.b===n.b&&t.a===n.a},isDark:()=>Bo(n),getRGB:()=>(n.spaces.rgb||(n.spaces.rgb=zo(n)),n.spaces.rgb),getRGBA:()=>(n.spaces.rgba||(n.spaces.rgba=Fo(n)),n.spaces.rgba),getString:()=>(n.spaces.string||(n.spaces.string=jo(n)),n.spaces.string),getHex:()=>(n.spaces.hex||(n.spaces.hex=function(e){let t,n,r;if(To(e))return 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("")}`;const i="string"==typeof e?qo(e):e;return t=((16711680&i)>>16).toString(16),n=((65280&i)>>8).toString(16),r=(255&i).toString(16),1===t.length&&(t=`0${t}`),1===n.length&&(n=`0${n}`),1===r.length&&(r=`0${r}`),`#${t}${n}${r}`}(n)),n.spaces.hex),getHSL:()=>(n.spaces.hsl||(n.spaces.hsl=function(e){let t,n,r=0;const i="string"==typeof e?Lo(e):e,o=i.r/255,a=i.g/255,s=i.b/255,l=Math.max(o,a,s),c=Math.min(o,a,s),u=(l+c)/2;if(l===c)t=0,r=0;else{switch(n=l-c,t=u>.5?n/(2-l-c):n/(l+c),l){case o:r=(a-s)/n+(a<s?6:0);break;case a:r=(s-o)/n+2;break;case s:r=(o-a)/n+4}r/=6}return`hsl(${360*r}, ${100*t}, ${100*u})`}(n)),n.spaces.hsl),getHSLA:()=>(n.spaces.hsla||(n.spaces.hsla=function(e){const{h:t,s:n,l:r,a:i}=_o(e);return`hsla(${t}, ${n}, ${r}, ${i})`}(n)),n.spaces.hsla),getHSLAObject:r,getShiftedHSLA:i,getHSV:()=>(n.spaces.hsv||(n.spaces.hsv=function(e){const{h:t,s:n,v:r}=Po(e);return`hsv(${t}, ${n}, ${r})`}(n)),n.spaces.hsv),getHSVObject:()=>(n.spaces.hsvObject||(n.spaces.hsvObject=Po(n)),n.spaces.hsvObject),blend:(e,t)=>`rgba(${Math.floor(n.r+(e.r-n.r)*t)}, ${Math.floor(n.g+(e.g-n.g)*t)}, ${Math.floor(n.b+(e.b-n.b)*t)}, ${Math.floor(n.a+(e.getAlpha()-n.a)*t)})`,getBrightenedColor:(e=1)=>Vo(i(18*e)),getDarkenedColor:(e=1)=>Vo(i(18*-e))}}const Ho="point-label-cross-placement";var Uo="unclassified",Wo="equal-equal",Yo="equal-higher",Ko="equal-lower",Go="equal-void",Xo="higher-equal",Jo="higher-higher-acute",Zo="higher-higher-obtuse",Qo="higher-lower-negative",ea="higher-lower-positive",ta="higher-void",na="lower-equal",ra="lower-higher-negative",ia="lower-higher-positive",oa="lower-lower-acute",aa="lower-lower-obtuse",sa="lower-void",la="void-equal",ca="void-higher",ua="void-lower",da="void-void";function fa(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*(180/Math.PI)}function ha(e,t,n){const r=Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2),i=Math.sqrt((t.x-n.x)**2+(t.y-n.y)**2),o=Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2);return Math.acos((i*i+r*r-o*o)/(2*i*r))*(180/Math.PI)}function pa({previous:e,current:t,next:n}){const r=e&&e.value,i=t&&t.value,o=n&&n.value;return e||n?e?n?r===i?i===o?Wo:i<o?Yo:Ko:i===o?r>i?Xo:na:r>i?i<o?ha(e,t,n)>90?Zo:Jo:fa(e,t)>fa(e,n)?ea:Qo:i>o?ha(e,t,n)>90?aa:oa:fa(e,t)>fa(e,n)?ia:ra:r===i?Go:r>i?ta:sa:i===o?la:i<o?ca:ua:da}var ma={TOP:"top",TOP_RIGHT:"top-right",RIGHT:"right",BOTTOM_RIGHT:"bottom-right",BOTTOM:"bottom",BOTTOM_LEFT:"bottom-left",LEFT:"left",TOP_LEFT:"top-left"};function ga({bounds:e,size:t}){const{x:n,y:r,width:i,height:o}=e,{insideStrategy:a}=t;return"center"===a?Math.floor(n+i/2)>=0&&Math.ceil(n+i/2)<=t.width&&Math.floor(r+o/2)>=0&&Math.ceil(r+o/2)<=t.height:Math.floor(n+i)>0&&Math.ceil(n)<t.width&&Math.floor(r+o/2)>=0&&Math.ceil(r+o/2)<=t.height}let ya;function va(){ya=ya||document.createElement("canvas").getContext("2d")}const ba={measureTextWidth(e){va();const{width:t}=ya.measureText(e);return t},lineWrap(e,t,n,r){let i,o;va();const a=e?e.split(/\n+|\r+|\r\n/):[],s=[];let l,c,u,d,f=e?e.split(/\s+/):[],h=a[0];if("number"!=typeof t||t<=0)return[e];if("number"==typeof r&&a.length>=r)return a.slice(0,r);for(n&&(ya.font=n),o=0;o<a.length;o++){for(d=a[o]||"",f=d.split(/\s+/),[h]=f,u="",i=1;i<f.length;i++)if(l=`${h} ${f[i]}`,c=ba.measureTextWidth(l),c>t&&("number"!=typeof r||r>s.length)?(s.push(h),h=f[i]):h=l,"number"==typeof r&&s.length>=r){u=f.slice(i+1).join(" ");break}"number"!=typeof r||s.length<r?s.push(h):s[Math.max(0,s.length-1)]=`${s[Math.max(0,s.length-1)]||""} ${h} ${u}`}return s},wordWrap(e,t,n,r,i){if(va(),!e||!e.length)return[];n&&(ya.font=n);let o=[];const a=e.slice();let s,l,c,u;if(a.filter(e=>!!e),"number"!=typeof t||t<0)return e.slice();for(u=0;u<a.length;u++)c=a[u],l=null,c&&(c.length<=1||ba.measureTextWidth(c)<=t?o.push(c):(s=ba.splitWord(c,t,void 0,r-o.length),s.length<=1?o.push(s[0]):(l=s.pop(),o=o.concat(s),a[u+1]?ba.measureTextWidth(`${l} ${a[u+1]}`)>t&&o.length+a.length-u<=r?a.splice(u+1,0,l):a[u+1]=`${l} ${a[u+1]}`:a.push(l))));return o.forEach((e,t,n)=>{n[t]=e?e.trim():e}),o.length>r?(o=o.splice(0,r),o[o.length-1]=ba.truncate(o[o.length-1],t,n,i).text):(c=o[o.length-1],c&&c.length>1&&ba.measureTextWidth(c)>t&&(o[o.length-1]=ba.truncate(c,t,n,i).text)),o},truncate(e,t,n,r="…"){va();let i,o,a,s,l=e;const c=ba.measureTextWidth("i"),u=Math.ceil(t/c);if(n&&(ya.font=n),e&&t){if(ba.measureTextWidth(l)>t){for(i=Math.min(u,l.length);i>0;i--)if(o=l.substring(0,i-1),a=o.trim()+r,ba.measureTextWidth(a)<=t){s=l.substring(i-1),l=a;break}i||(s=l,l="…")}}else s=void 0;return{text:l,rest:s}},isNumber:e=>"number"==typeof e&&Number.isFinite(e),explodeWord(e,t,n,r){let i;va();let o,a=e,s="",l=[];if(ba.isNumber(n)&&n<=1)return[e];const c=Math.ceil(t/r);for(i=Math.min(e.length,c);i>0&&(a=e.substring(0,i),o=e.substring(i-1,i)," "===o?a=e.substring(0,i-1):a+="-",s=e.substring(i),!(ba.measureTextWidth(a)<=t));i--);return(!i&&!a||ba.measureTextWidth(a)>t)&&(a=e.substring(0,1),s=e.substring(1)),l.push(a),s?(ba.measureTextWidth(s)>t?(s=ba.explodeWord(s,t,n-1,r),l=l.concat(s)):l.push(s),l.filter(e=>""!==e.trim())):l},splitWord:(e,t,n,r)=>(va(),e&&t?(n&&(ya.font=n),ba.explodeWord(e,t,r,Math.max(1,ba.measureTextWidth("i")))):[]),wrapText(e,t,n,r,i){let o;return Number.isNaN(t)?[e]:(o=r>1?ba.lineWrap(e,t,n,r):[e],o=ba.wordWrap(o,t,n,r,i),o)},getFontHeight:e=>(va(),e&&(ya.font=e),1.5*ba.measureTextWidth("m")),tokenize(e,t,n,r,i,o,a=1){va(),t&&(ya.font=t);const s=ba.getFontHeight(),l=a*s;let c=[],u=0,d=[];if(o<s)return[];const f=o?Math.max(1,Math.floor(o/l)):r||1;return Array.isArray(r)?(r.forEach(e=>{u+=Number.isNaN(e)||e<=0?0:e}),r.forEach(e=>{c.push(Number.isNaN(e)||e<=0?f-u:e)})):c=[Number.isNaN(r)||r<=0?f:Math.min(f,r)],Array.isArray(e)?e.forEach((e,n)=>{d.length<f&&(d=d.concat(ba.wrapText(e,i,t,c[n])))}):d=ba.wrapText(e,i,t,c[0],n),d}};function xa({config:e,crossPlacements:t,node:n,line:r,groupIndex:i,extract:o,style:a,measureText:s,size:l,horizontal:c,rtl:u,meta:d,showLabel:f}){const h=o.label(n.data);if("string"!=typeof h&&"number"!=typeof h||""===h)return!1;const p=(()=>{const e=s({fontFamily:a.fontFamily,fontSize:a.fontSize,text:h});if(!n.data?.value?.maxLabelWidth||e.width<=n.data?.value?.maxLabelWidth)return e;const t=`${a.fontSize} ${a.fontFamily}`,r=ba.tokenize(h,t,"…",3,n.data.value.maxLabelWidth);return e.lines=r.map(e=>({text:e,size:s({fontFamily:a.fontFamily,fontSize:a.fontSize,text:e})})),e.width=Math.max(...e.lines.map(e=>e.size.width)),e.height*=r.length,e})(),{localBounds:m}=n,{"stroke-width":g}=n.attrs,y=o.pointValue(n.data),v=!!n.data?.value?.hasBackground,b=v?{X:3,Y:2}:{X:1,Y:0},x=v?{X:2,Y:2}:{X:0,Y:0},S={x:m.x+m.width/2,y:m.y+m.height/2,width:p.width+2*b.X+2*x.X,height:p.height+2*b.Y+2*x.Y},M=`${S.x}-${S.y}`,w=!c&&!u,E=c?l.height:l.width,k=(c?S.y:S.x)/E,C=(w?1-k:k)<=(E<=200?.25:.1),A=n.data?.value?.label?.placement,O=Object.keys(ma).map(e=>ma[e]),N={key:M,config:e,node:n,line:r,group:i,value:y,labelMeasurements:p,bounds:S,inside:ga({bounds:m,size:l}),border:g?g/2:0,classification:Uo,setClassification(e){N.classification=e},preferences:[],setPreferences(e){N.preferences.push(...e)},fixedPlacement:O.includes(A)?A:void 0,placement:void 0,setPlacement(e){N.placement=e,t.setPlacement(e)},duplicate:!1,setDuplicate(){N.duplicate=!0},extreme:d.getExtreme(M),elite:C,show:e.labels&&f(n)};return N}var Sa={[Wo]:[ma.TOP,ma.BOTTOM],[Yo]:[ma.BOTTOM,ma.BOTTOM_RIGHT],[Ko]:[ma.TOP,ma.TOP_RIGHT],[Go]:[ma.TOP,ma.BOTTOM],[Xo]:[ma.LEFT,ma.BOTTOM_LEFT,ma.TOP,ma.TOP_RIGHT],[Jo]:[ma.BOTTOM,ma.BOTTOM_LEFT,ma.LEFT,ma.TOP_RIGHT],[Zo]:[ma.BOTTOM,ma.TOP],[Qo]:[ma.TOP,ma.TOP_RIGHT,ma.RIGHT],[ea]:[ma.BOTTOM,ma.BOTTOM_LEFT,ma.LEFT],[ta]:[ma.TOP],[na]:[ma.TOP],[ra]:[ma.TOP,ma.TOP_LEFT],[ia]:[ma.BOTTOM_RIGHT],[oa]:[ma.TOP,ma.TOP_LEFT,ma.LEFT,ma.TOP_RIGHT,ma.RIGHT],[aa]:[ma.TOP,ma.BOTTOM],[sa]:[ma.TOP],[la]:[ma.TOP],[ca]:[ma.TOP,ma.BOTTOM],[ua]:[ma.TOP,ma.BOTTOM,ma.LEFT],[da]:[ma.TOP],[Uo]:[ma.TOP,ma.BOTTOM,ma.RIGHT,ma.LEFT,ma.TOP_RIGHT,ma.BOTTOM_RIGHT,ma.BOTTOM_LEFT,ma.TOP_LEFT]};function Ma({configs:e,crossPlacements:t,nodes:n,extract:r,style:i,measureText:o,size:a,horizontal:s,rtl:l,showLabel:c}){const u=function({configs:e,crossPlacements:t,nodes:n,extract:r,style:i,measureText:o,size:a,horizontal:s,rtl:l,showLabel:c}){const u=function({nodes:e}){const t={top:[],right:[],bottom:[],left:[]},n=e.map(e=>{const{localBounds:t}=e,n={x:t.x+t.width/2,y:t.y+t.height/2};return{key:`${n.x}-${n.y}`,center:n}}),r=n.reduce((e,t)=>((!e.top||t.center.y<e.top.center.y)&&(e.top=t),(!e.right||t.center.x>e.right.center.x)&&(e.right=t),(!e.bottom||t.center.y>e.bottom.center.y)&&(e.bottom=t),(!e.left||t.center.x<e.left.center.x)&&(e.left=t),e),{});return t.top=n.filter(e=>e.center.y===r.top.center.y).map(e=>e.key),t.right=n.filter(e=>e.center.x===r.right.center.x).map(e=>e.key),t.bottom=n.filter(e=>e.center.y===r.bottom.center.y).map(e=>e.key),t.left=n.filter(e=>e.center.x===r.left.center.x).map(e=>e.key),{getExtrema:e=>({top:-1!==t.top.indexOf(e),right:-1!==t.right.indexOf(e),bottom:-1!==t.bottom.indexOf(e),left:-1!==t.left.indexOf(e)}),getExtreme:e=>{const{top:n,right:r,bottom:i,left:o}=t;return[n,r,i,o].some(t=>-1!==t.indexOf(e))}}}({nodes:n}),d=function({nodes:e,by:t,lineId:n}){const r=e.reduce((e,r,i)=>{const o=t(r.data);return e[o]||(e[o]={items:[],index:i}),e[o].items.push({node:r,line:n(r)}),e},{});return Object.keys(r).map(e=>r[e]).sort((e,t)=>e.index-t.index).map(e=>e.items)}({nodes:n,by:r.majorValue,lineId:r.lineId}).map((n,d)=>n.map(n=>({line:n.line,item:xa({config:e.get(n.node.key),crossPlacements:t,node:n.node,line:n.line,groupIndex:d,extract:r,style:i,measureText:o,size:a,horizontal:s,rtl:l,meta:u,showLabel:c})})).filter(e=>e.item).reduce((e,t)=>(e[t.line]=t.item,e),{}));return d.filter(e=>Object.keys(e).length)}({configs:e,crossPlacements:t,nodes:n,extract:r,style:i,measureText:o,size:a,horizontal:s,rtl:l,showLabel:c}),d=[...u.reduce((e,t)=>(e.push(...Object.keys(t).map(e=>t[e])),e),[])],[f]=d,h=function({groups:e,threshold:t}){const n=e.map(e=>Object.keys(e).map(t=>e[t])),r={};for(let e=0;e<=n.length;e++){const t=n[e];if(t)for(let e=0;e<t.length;e++){const n=t[e];if(n.config.lines){const{line:e}=n;r[e]||(r[e]=[]),r[e].push(n.bounds)}}}const i=Object.keys(r).map(e=>r[e]),o=[];for(let e=0;e<i.length;e++)for(let n=0;n<i[e].length-1;n++){const r=i[e][n],a=i[e][n+1],s={x1:r.x,y1:r.y,x2:a.x,y2:a.y},l=s.x1-s.x2,c=s.y1-s.y2;Math.sqrt(l*l+c*c)>t&&o.push(s)}return o}({groups:u,threshold:f?.node.localBounds.height}),p={getItems:()=>d,getLines:()=>h};return function({groups:e}){for(let t=0;t<e.length;t++){const n=Object.keys(e[t]).map(n=>e[t][n]);for(let r=0;r<n.length;r++){const i=n[r];if(!i.config.fixed){const n=pa({previous:e[t-1]&&e[t-1][i.line],current:i,next:e[t+1]&&e[t+1][i.line]});i.setClassification(n)}}}}({groups:u}),p.getItems().forEach(e=>{e.setPreferences(Sa[e.classification])}),p}function wa({item:e,placement:t,size:n}){return t.x>=0-n.edgeBleed.left&&t.x<=n.width-e.bounds.width+n.edgeBleed.right&&t.y>=0-n.edgeBleed.top&&t.y<=n.height-e.bounds.height}function Ea({line1:e,line2:t}){const n=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(0===n)return!1;const r=((t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1))/n,i=((e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1))/n;return r>=0&&r<=1&&i>=0&&i<=1}const ka={x:0,width:0,y:0,height:0},Ca=({item:e})=>({x:e.bounds.x-e.bounds.width/2,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border}),Aa=({item:e})=>({x:e.bounds.x,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border}),Oa=({item:e})=>({x:e.bounds.x+e.node.localBounds.width/2+e.border,y:e.bounds.y-e.bounds.height/2}),Na=({item:e})=>({x:e.bounds.x,y:e.bounds.y+e.node.localBounds.height/2+e.border}),Da=({item:e})=>({x:e.bounds.x-e.bounds.width/2,y:e.bounds.y+e.node.localBounds.height/2+e.border}),Ta=({item:e})=>({x:e.bounds.x-e.bounds.width,y:e.bounds.y+e.node.localBounds.height/2+e.border}),qa=({item:e})=>({x:e.bounds.x-e.bounds.width-e.node.localBounds.width/2-e.border,y:e.bounds.y-e.bounds.height/2}),Ia=({item:e})=>({x:e.bounds.x-e.bounds.width,y:e.bounds.y-e.bounds.height-e.node.localBounds.height/2-e.border});const Ra=[ma.TOP,ma.TOP_LEFT,ma.TOP_RIGHT],La=[ma.BOTTOM,ma.BOTTOM_LEFT,ma.BOTTOM_RIGHT];function _a({position:e}){const t={x:2.5,width:-5,y:0,height:0},n=Ra.indexOf(e)>-1,r=La.indexOf(e)>-1;return n&&(t.y=4,t.height=-4),r&&(t.height=-4),t}function Pa({cx:e,cy:t,r:n,degrees:r}){const i=r*(Math.PI/180);return{x:Math.round(e+n*Math.sin(i)),y:Math.round(t+n*-Math.cos(i))}}function za({coordinates:e,degrees:t,item:n}){const r={x:e.x,y:e.y};return t<=90?r.y-=n.bounds.height:t>180&&t<=270?r.x-=n.bounds.width:t>270&&(r.y-=n.bounds.height,r.x-=n.bounds.width),r}const Fa=void 0;function ja({item:e,validator:t,force:n=!1}){const r={[ma.TOP]:Ca,[ma.TOP_RIGHT]:Aa,[ma.RIGHT]:Oa,[ma.BOTTOM_RIGHT]:Na,[ma.BOTTOM]:Da,[ma.BOTTOM_LEFT]:Ta,[ma.LEFT]:qa,[ma.TOP_LEFT]:Ia};if(e.fixedPlacement)return r[e.fixedPlacement]({item:e});const i=[...e.preferences,...Object.keys(ma).map(e=>ma[e]).filter(t=>-1===e.preferences.indexOf(t))],o=[];for(let a=0;a<i.length;a++){const s=i[a],l=r[s]({item:e}),c=_a({position:s}),u=t({item:e,placement:l,adjustment:c,ignoreLines:n});if(n&&u.inside&&o.push(l),u.valid)return l}const a=()=>function({item:e,validator:t,force:n=!1}){const r=function({item:e}){return[e.node.localBounds.height/2*Math.sqrt(2)]}({item:e}),i=e.bounds.x,o=e.bounds.y;for(let a=0;a<r.length;a++){const s=r[a];for(let r=40;r<=180;r+=15){const a=za({coordinates:Pa({cx:i,cy:o,r:s,degrees:r}),degrees:r,item:e});if(t({item:e,placement:a,ignoreLines:n}).valid)return a}for(let r=320;r>180;r-=15){const a=za({coordinates:Pa({cx:i,cy:o,r:s,degrees:r}),degrees:r,item:e});if(t({item:e,placement:a,ignoreLines:n}).valid)return a}}return!1}({item:e,validator:t,force:n});if(n){return a()||o[0]||Fa}return(e.extreme||e.elite)&&a()||Fa}function $a({configs:e,crossPlacements:t,model:n,size:r,all:i}){const o={},a=n.getItems(),s=[...a.map(e=>({x:e.node.localBounds.x-e.border+1,y:e.node.localBounds.y-e.border+1,height:e.node.localBounds.height+2*e.border-2,width:e.node.localBounds.width+2*e.border-2})),...t.getPlacements({configs:e})],l=[],c=n.getLines();a.forEach(e=>{const{data:t}=e.node;if(!e.show||!e.inside||t.null&&t.null.value||t.interpolated&&t.interpolated.value)return;const{key:n}=e;if(o[n]&&!e.config.duplicates)return void e.setDuplicate();o[n]=!0;const a=function({size:e,lines:t,placements:n}){return function({item:r,placement:i,adjustment:o=ka,ignoreLines:a=!1}){const s={inside:wa({item:r,placement:i,size:e}),collides:!0,valid:!1};return s.inside?(s.collides=function({candidate:e,lines:t,rects:n}){return!!n.some(t=>function({rect1:e,rect2:t}){return!(t.x>e.x+e.width||t.x+t.width<e.x||t.y>e.y+e.height||t.y+t.height<e.y)}({rect1:t,rect2:e}))||t.some(t=>function({line:e,rect:t}){const n={x:t.x,y:t.y},r={x:t.x+t.width,y:t.y},i={x:t.x+t.width,y:t.y+t.height},o={x:t.x,y:t.y+t.height},a={x1:r.x,y1:r.y,x2:i.x,y2:i.y},s={x1:i.x,y1:i.y,x2:o.x,y2:o.y},l={x1:o.x,y1:o.y,x2:n.x,y2:n.y};return Ea({line1:e,line2:{x1:n.x,y1:n.y,x2:r.x,y2:r.y}})||Ea({line1:e,line2:a})||Ea({line1:e,line2:s})||Ea({line1:e,line2:l})}({line:t,rect:e}))}({candidate:{x:i.x+o.x,y:i.y+o.y,width:r.bounds.width+o.width,height:r.bounds.height+o.height},lines:a?[]:t,rects:n}),s.valid=!s.collides,s):s}}({size:r,lines:c,placements:s}),u=ja({item:e,validator:a});u?(u.height=e.bounds.height,u.width=e.bounds.width,s.push(u),e.setPlacement(u)):i&&l.push({item:e,validator:a})}),l.forEach(e=>{const{item:t,validator:n}=e,r=ja({item:t,validator:n,force:!0});r&&(r.height=t.bounds.height,r.width=t.bounds.width,s.push(r),t.setPlacement(r))})}var Ba={require:["chart","renderer"],defaultSettings:{settings:{orientation:"horizontal",rtl:!1,all:!1,label:()=>{},showLabel:()=>!0,pointValue:()=>{},majorValue:()=>{},lineId:()=>{},enabled:()=>!0,configs:[],insideStrategy:"edge",labelSpace:{use:()=>!1,size:10},cache:void 0},style:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"',fontSize:"12px",fill:"#333"}},created(){this.crossPlacements=function({cache:e,key:t}){const n={isPrimary:!1};return e?.has?.(Ho)||(n.isPrimary=!0,e?.set?.(Ho,{})),{reset:()=>{const r=e?.get?.(Ho);r&&(n.isPrimary&&Object.keys(r).forEach(e=>delete r[e]),r[t]=[])},setPlacement:n=>{const r=e?.get?.(Ho);r&&r[t].push(n)},getPlacements:({configs:n})=>{const r=e?.get?.(Ho);if(!r)return[];const i=[],o=n.getCollection().filter(e=>!e.labels&&!!e.labelKeys.length).reduce((e,t)=>(e.push(...t.labelKeys),e),[]);return Object.keys(r).forEach(e=>{e!==t&&o.some(t=>t===e)&&i.push(...r[e])}),i}}}({cache:this.settings.settings.cache,key:this.settings.key})},preferredSize(){const e={edgeBleed:{top:0,right:0,left:0}},{orientation:t,rtl:n,labelSpace:r}=this.settings.settings,{use:i,size:o}=r;if(i()){const r="horizontal"===t;e.edgeBleed.top=r?o:0,e.edgeBleed[n?"left":"right"]=r?0:o}return e},render(){this.crossPlacements.reset();const{settings:e}=this.settings,{enabled:t}=e;if(!t())return[];const n=function({configs:e=[]}={}){const t={},n=[];return e.forEach(e=>{const{key:r}=e;t[r]={labels:void 0===e.labels||e.labels,labelKeys:Array.isArray(e.labelKeys)?e.labelKeys:[],lines:void 0===e.lines||e.lines,fixed:void 0!==e.fixed&&e.fixed,duplicates:void 0!==e.duplicates&&e.duplicates},n.push(t[r])}),{meta:{allKeys:e.map(e=>e.key)},getCollection:()=>n,get:e=>t[e],getFirstLabelKey:()=>e.find(e=>e.labels)?.key}}({configs:e.configs}),r=n.getFirstLabelKey();if(!r)return[];if(!this.chart.component(r))return[];const i=this.chart.findShapes("circle, path, rect").filter(e=>n.meta.allKeys.includes(e.key));if(!i.length)return[];const o="horizontal"===e.orientation,a=o?"x":"y";i.sort((e,t)=>e.localBounds[a]-t.localBounds[a]);const s={label:e.label,pointValue:e.pointValue,majorValue:e.majorValue,lineId:e.lineId},{height:l,width:c,edgeBleed:u}=this.rect,d={height:l,width:c,edgeBleed:u,insideStrategy:e.insideStrategy},{crossPlacements:f,style:h}=this,p=Ma({configs:n,crossPlacements:f,nodes:i,extract:s,style:h,measureText:this.renderer.measureText,size:d,horizontal:o,rtl:e.rtl,showLabel:e.showLabel});!function({model:e}){e.getItems().sort((e,t)=>e.extreme===t.extreme?0:e.extreme&&!t.extreme?-1:1)}({model:p}),$a({configs:n,crossPlacements:f,model:p,size:d,all:e.all});const m=p.getItems(),g=[];return m.filter(e=>e.placement).forEach(e=>{const t=e.node.data.value?.hasBackground?2:0,n=e.node.data.value?.hasBackground?2:0,r=e.node.data.value?.style?.label?.fontSize||h.fontSize,i=e.node.data.value?.style?.label?.fontFamily||h.fontFamily,o=e.node.data.value?.labelColor||h.fill;e.labelMeasurements.lines?e.labelMeasurements.lines.forEach((a,s)=>{g.push({type:"text",x:e.placement.x+e.placement.width/2,y:e.placement.y+(s+.5)*a.size.height+t+n,fontSize:r,fontFamily:i,fill:o,text:a.text,data:e.node.data.value,baseline:"central",anchor:"middle"})}):g.push({type:"text",x:e.placement.x+e.placement.width/2,y:e.placement.y+e.labelMeasurements.height/2+t+n,fontSize:r,fontFamily:i,fill:o,text:s.label(e.node.data),data:e.node.data.value,baseline:"central",anchor:"middle"})}),[...m.filter(e=>e.placement&&e.node.data.value?.hasBackground).map(e=>({type:"rect",x:e.placement.x+2,y:e.placement.y+2,rx:3,ry:3,fill:e.node.data.value?.labelBackgroundColor,width:e.placement.width-4,height:e.placement.height-4,data:e.node.data.value})),...g]}};const Va={ACTIONS:{select:{enabled:()=>!1}},COMPONENT_KEY:"area-range-component",COMPONENTS:[],DOCK:"bottom",ENABLE:()=>!0,EVENT_KEY:"area-range",EVENTS:()=>{},FILL_TARGETS:[],TARGETS:[]},Ha={area:"area",continuous:"range"};function Ua({config:e,type:t="continuous"}){const{actions:n,componentKey:r,enable:i,eventKey:o,events:a,fillTargets:s}=e;return{key:`event:${r}`,type:"Pan",requireFailure:void 0,recognizeWith:void 0,options:{event:o,enable(e,t){if(!i())return!1;if(this.started===o||!t)return!0;if(!n.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}).filter(e=>-1!==s.indexOf(e.key)),l=0===a.length&&((e,t)=>{const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))})(t,r);return l?(this.started=o,!0):a.length>0}},events:{[`${o}start`](e){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,n.select.brushSelectionIncludeMax=!0),e.preventDefault(),n.select.emit("start",o),this.chart.component(r).emit(`${Ha[t]}Start`,e),this.started=o,a.onRangeStart({chart:this.chart})},[`${o}move`](e){e.preventDefault(),this.chart.component(r).emit(`${Ha[t]}Move`,e),a.onRangeMove({chart:this.chart})},[`${o}end`](e){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,n.select.brushSelectionIncludeMax=!0),e.preventDefault(),this.chart.component(r).emit(`${Ha[t]}End`,e),n.select.emit("end",o),this.started=!1,a.onRangeEnd({chart:this.chart})}}}}function Wa(e){return Ua({config:e,type:"continuous"})}const Ya={ACTIONS:{select:{enabled:()=>!1}},BUBBLES_PLACEMENT:"inside",COMPONENT_KEY:"continuous-range-component",DOCK:"bottom",ENABLE:()=>!0,EVENT_KEY:"continuous-range",EVENTS:()=>{},FILL_TARGETS:[],MULTIPLE:!1,OBSERVE_BRUSH:!1,SCALE:"scale",TARGETS:[]};function Ka(e){const{actions:t,componentKey:n,eventKey:r,onEdited:i}=e;if(!i)return!1;const o=`${n}-${r}-tap`;return{prio:1,key:`event:${n}-tap`,type:"Tap",requireFailure:void 0,recognizeWith:void 0,options:{event:o,interval:10,pointers:1,enable:(e,r)=>!!r&&!!t.select.enabled()&&("INPUT"===r.target?.nodeName||!!r.target?.hasAttribute("data-other-value")&&(r.target.getAttribute("data-key")||"").split("-bubble")[0]===n)},events:{[o](e){(e.target.getAttribute("data-key")||"").split("-bubble")[0]&&(e.preventDefault(),this.chart.component(n).emit("bubbleStart",e))}}}}function Ga(e){const t=function(e={}){return{actions:e.actions??Ya.ACTIONS,bubblesPlacement:e.bubblesPlacement??Ya.BUBBLES_PLACEMENT,componentKey:e.componentKey??Ya.COMPONENT_KEY,dock:e.dock??Ya.DOCK,enable:e.enable??Ya.ENABLE,eventKey:e.eventKey??Ya.EVENT_KEY,events:{onRangeStart:e.events?.onRangeStart??Ya.EVENTS,onRangeMove:e.events?.onRangeMove??Ya.EVENTS,onRangeEnd:e.events?.onRangeEnd??Ya.EVENTS},fillTargets:e.fillTargets??Ya.FILL_TARGETS,multiple:e.multiple??Ya.MULTIPLE,observeBrush:e.observeBrush??Ya.OBSERVE_BRUSH,onEdited:e.onEdited,scale:e.scale??Ya.SCALE,targetFillSelector:e.targetFillSelector,targetSelector:e.targetSelector,targets:e.targets??Ya.TARGETS,toLabel:e.toLabel}}(e),n=[Wa(t),Ka(t)].filter(Boolean),r=function(e){const{bubblesPlacement:t,componentKey:n,dock:r,fillTargets:i,multiple:o,observeBrush:a,onEdited:s,scale:l,targetFillSelector:c,targets:u,targetSelector:d,toLabel:f}=e;return{key:n,type:"brush-range",layout:{dock:u.map(e=>`@${e}`).join(",")},on:s?{bubbleEnd(){s()}}:{},settings:{brush:a?{context:"selection",observe:!0}:"selection",scale:l,multiple:o,direction:"left"===r||"right"===r?"vertical":"horizontal",bubbles:{align:"left"===r||"top"===r?"end":"start",placement:t,label:f},target:{components:i,selector:d,fillSelector:c,fill:"rgba(82,204,82,0.2)"}}}}(t);return{interactions:n,components:[r]}}const Xa={ACTIONS:{lasso:{enabled:()=>!1,active:()=>!1},select:{enabled:()=>!1}},COMPONENT_KEY:"lasso",COMPONENTS:[],EVENTS:()=>{},TARGET_KEYS:[]},Ja="lasso";const Za={ACTIONS:{select:{enabled:()=>!1}},COMPONENTS:[],EVENTS:()=>{},HIT_RADIUS:0,IS_LOCKED:()=>!1,TARGETS:[]},Qa="tap";function es(e){const{actions:t,components:n,events:r,hitRadius:i,isLocked:o,shapesAt:a,targets:s}=e,l={targetComponents:[]};return{key:"event:tap",type:"Tap",requireFailure:void 0,recognizeWith:void 0,options:{event:Qa,interval:10,pointers:1,enable(e,n){return!n||!!t.select.enabled()&&(l.targetComponents=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>-1!==s.indexOf(e.key)),l.targetComponents.length>0)}},events:{[Qa](e){if(e.preventDefault(),o(l.targetComponents)||!t.select.enabled())return;const c=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=void 0===e.clientX?Math.floor(e.srcEvent.clientX):e.clientX,i=void 0===e.clientY?Math.floor(e.srcEvent.clientY):e.clientY),{x:r-n.left,y:i-n.top}}(e,this.chart),u="function"==typeof i?i(l.targetComponents):i,d=u>0?{cx:c.x,cy:c.y,r:u}:c,f=a?a(d):this.chart.shapesAt(d,{components:s.map(e=>({key:e}))}),h=this.chart.componentsFromPoint({x:e.center.x,y:e.center.y}),p=h.some(e=>"legend-cat"===e.type);if(!f.length&&p||(this.chart.brushSelectionIncludeMax=!1,t.select.brushSelectionIncludeMax=!1,t.select.emit("start",Qa,h),r.onSelectStart()),f.length&&n){this.chart.brushSelectionIncludeMax=!1,t.select.brushSelectionIncludeMax=!1;const i="function"==typeof n?n(e,f):n;this.chart.brushFromShapes(f,{components:i}),t.select.emit("end",Qa),r.onSelectEnd({chart:this.chart})}}}}}const ts="object",ns=["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"];const rs=e=>({value:e,label:e.charAt(0).toUpperCase()+e.slice(1),groupHeader:!1,disabled:!1,styles:{fontFamily:e}});function is({theme:e,translator:t,id:n,path:r}){const i=()=>e.getStyle(n,r,"fontFamily");return{getDefaultValue:()=>i(),getOptions:()=>function({theme:e,translator:t,defaultValue:n}){const r=[],i=e.getStyle("","","fontFamilies");return Array.isArray(i)&&i.length?r.push(...new Set([n,...i.map(e=>e.split(",").map(e=>e.trim()).map(e=>e.replace(/\s+/g," ").trim()).filter(Boolean).join(", "))])):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFonts"),metaText:t.get("properties.theme"),groupHeader:!0},...r.map(e=>rs(e)),{value:"DefaultHeader",label:t.get("properties.allFonts"),metaText:t.get("properties.default"),groupHeader:!0},...ns.map(e=>rs(e))]}({theme:e,translator:t,defaultValue:i()})}}var os=["10px","11px","12px","13px","14px","15px","16px","17px","18px","19px","20px","21px","22px","23px","24px"];const as=e=>({value:e,label:e,groupHeader:!1,disabled:!1});function ss({theme:e,translator:t,id:n,path:r}){const i=()=>e.getStyle(n,r,"fontSize");return{getDefaultValue:()=>i(),getOptions:()=>function({theme:e,translator:t,defaultValue:n}){const r=[],i=e.getStyle("","","fontSizes");return Array.isArray(i)&&i.length?r.push(...new Set([n,...i])):r.push(n),[{value:"ThemeHeader",label:t.get("properties.themeFontSizes"),metaText:t.get("properties.theme"),groupHeader:!0},...r.map(e=>as(e)),{value:"DefaultHeader",label:t.get("properties.allFontSizes"),metaText:t.get("properties.default"),groupHeader:!0},...os.map(e=>as(e))]}({theme:e,translator:t,defaultValue:i()})}}function ls({theme:e,translator:t,id:n,path:r}){return{fontFamily:is({theme:e,translator:t,id:n,path:r}),fontSize:ss({theme:e,translator:t,id:n,path:r})}}const cs=["__proto__","constructor"],us=e=>{if(cs.some(t=>e.includes(t)))throw new Error("font-resolver: Forbidden property.")};async function ds({app:e,items:t}){if(!e.evaluateEx)return t;const n=(await Promise.all(t.filter(e=>!!e.qCalcCondition?.qCond?.qv).map(t=>{const{qv:n}=t.qCalcCondition.qCond;return e.evaluateEx(n).then(e=>0===e.qNumber?t.qDef.cId:void 0).catch(()=>t.qDef.cId)}))).filter(Boolean);return t.filter(e=>!n.includes(e.qDef.cId))}async function fs({app:e,translator:t,properties:n}){const{qDimensions:r=[]}=n?.qHyperCubeDef?.qLayoutExclude?.qHyperCubeDef||{};if(!r.length)return Promise.resolve([]);const i=await ds({app:e,items:r});return Promise.all(i.map(n=>function({app:e,translator:t,dimension:n}){const r={id:n.qDef.cId,text:t.get("Object.ErrorMessage.MissingDimension"),meta:{}},{qLibraryId:i}=n;if(i)return e.getDimension?e.getDimension(i).then(e=>e.getLayout()).catch(()=>{}).then(e=>{if(!e)return r;const{qGrouping:t,qLabelExpression:i}=e.qDim,o="C"===t,a="H"===t,s="N"===t;return{id:n.qDef.cId,text:i&&s?i:e.qDim.title,meta:{isCyclic:o,isDrillDown:a,isNormal:s}}}):r;const{cId:o,qLabelExpression:a,qFieldLabels:s,qFieldDefs:l}=n.qDef,c={isCyclic:!1,isDrillDown:!1,isNormal:!0};return a?e.evaluate?e.evaluate(a).then(e=>({id:o,text:e,meta:c})):r:{id:o,text:s[0]||l[0],meta:c}}({app:e,translator:t,dimension:n})))}async function hs({app:e,translator:t,properties:n}){const{qMeasures:r=[]}=n?.qHyperCubeDef?.qLayoutExclude?.qHyperCubeDef||{};if(!r.length)return Promise.resolve([]);const i=await ds({app:e,items:r});return Promise.all(i.map(n=>function({app:e,translator:t,measure:n}){const r={id:n.qDef.cId,text:t.get("Object.ErrorMessage.MissingMeasure")},{qLibraryId:i}=n;if(i)return e.getMeasure?e.getMeasure(i).then(e=>e.getLayout()).catch(()=>{}).then(e=>{if(!e)return r;const{qLabelExpression:t}=e.qMeasure;return{id:n.qDef.cId,text:t||e.qMeasure.qLabel||e.qMeasure.qDef}}):r;const{cId:o,qLabelExpression:a,qLabel:s,qDef:l}=n.qDef;return a?e.evaluate?e.evaluate(a).then(e=>({id:o,text:e})):r:{id:o,text:s||l}}({app:e,translator:t,measure:n})))}var ps,ms,gs=function(){if(ms)return ps;ms=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 ps=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},ps}(),ys=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(gs);function vs(e,t){return{range:({resources:e,data:n})=>{const r=e.theme.palette("categorical",0===t?n.items.length:t);return n.items.map(e=>r[e.value%r.length])},valueAccessor:e.value}}function bs(e,t){return{range:({resources:e,data:n})=>{const r=e.theme.palette("categorical",0===t?n.items.length:t);return n.items.map(e=>r[e.row.value%r.length])},valueAccessor:e.value}}function xs(e,t,n,r,{byRow:i,byElemNo:o}){var a;if(r&&(t.input.persistent||e.hc.qDimensionInfo.length>1||void 0===n.activeDimensionIndex&&e.hc.qSize.qcy>(a=e.hc,(a.qDataPages[0]||a.qStackedDataPages[0])?.qArea.qHeight||0)))return o(r,r.raw().qCardinal);if(r){const e=t.pic.extract({field:r.key(),trackBy:r.value}).length;return i(r,e)}return{}}function Ss(e,t){const{hc:{qDimensionInfo:n}}=e;let r=t.input.byDimDef||{activeDimensionIndex:n.length-1};if(r.activeDimensionIndex>=0){const e=n[r.activeDimensionIndex];r=e.coloring&&e.coloring.colorMapRef?{type:"libraryItem",key:e.coloring.colorMapRef,activeDimensionIndex:r.activeDimensionIndex}:{activeDimensionIndex:r.activeDimensionIndex}}return r}function Ms(e,t){let n;return t.activeDimensionIndex>=0?n=e.pic.fields().filter(e=>"dimension"===e.type())[t.activeDimensionIndex]:"libraryItem"===t.type?(n=t.key?e.pic.field(e=>e.raw().colorMapRef===t.key):void 0,!1===n&&(n=e.pic.field(e=>"colorByAlternative"===e.raw().id))):"expression"===t.type&&(n=e.pic.field(e=>"colorByAlternative"===e.raw().id)),n}function ws(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Es(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ks(){}var Cs=.7,As=1/Cs,Os="\\s*([+-]?\\d+)\\s*",Ns="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ds="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ts=/^#([0-9a-f]{3,8})$/,qs=new RegExp(`^rgb\\(${Os},${Os},${Os}\\)$`),Is=new RegExp(`^rgb\\(${Ds},${Ds},${Ds}\\)$`),Rs=new RegExp(`^rgba\\(${Os},${Os},${Os},${Ns}\\)$`),Ls=new RegExp(`^rgba\\(${Ds},${Ds},${Ds},${Ns}\\)$`),_s=new RegExp(`^hsl\\(${Ns},${Ds},${Ds}\\)$`),Ps=new RegExp(`^hsla\\(${Ns},${Ds},${Ds},${Ns}\\)$`),zs={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 Fs(){return this.rgb().formatHex()}function js(){return this.rgb().formatRgb()}function $s(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ts.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Bs(t):3===n?new Ws(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Vs(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Vs(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=qs.exec(e))?new Ws(t[1],t[2],t[3],1):(t=Is.exec(e))?new Ws(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Rs.exec(e))?Vs(t[1],t[2],t[3],t[4]):(t=Ls.exec(e))?Vs(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=_s.exec(e))?Zs(t[1],t[2]/100,t[3]/100,1):(t=Ps.exec(e))?Zs(t[1],t[2]/100,t[3]/100,t[4]):zs.hasOwnProperty(e)?Bs(zs[e]):"transparent"===e?new Ws(NaN,NaN,NaN,0):null}function Bs(e){return new Ws(e>>16&255,e>>8&255,255&e,1)}function Vs(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ws(e,t,n,r)}function Hs(e){return e instanceof ks||(e=$s(e)),e?new Ws((e=e.rgb()).r,e.g,e.b,e.opacity):new Ws}function Us(e,t,n,r){return 1===arguments.length?Hs(e):new Ws(e,t,n,null==r?1:r)}function Ws(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ys(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}`}function Ks(){const e=Gs(this.opacity);return`${1===e?"rgb(":"rgba("}${Xs(this.r)}, ${Xs(this.g)}, ${Xs(this.b)}${1===e?")":`, ${e})`}`}function Gs(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Js(e){return((e=Xs(e))<16?"0":"")+e.toString(16)}function Zs(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new el(e,t,n,r)}function Qs(e){if(e instanceof el)return new el(e.h,e.s,e.l,e.opacity);if(e instanceof ks||(e=$s(e)),!e)return new el;if(e instanceof el)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 el(a,s,l,e.opacity)}function el(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function tl(e){return(e=(e||0)%360)<0?e+360:e}function nl(e){return Math.max(0,Math.min(1,e||0))}function rl(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}ws(ks,$s,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Fs,formatHex:Fs,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Qs(this).formatHsl()},formatRgb:js,toString:js}),ws(Ws,Us,Es(ks,{brighter(e){return e=null==e?As:Math.pow(As,e),new Ws(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Cs:Math.pow(Cs,e),new Ws(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ws(Xs(this.r),Xs(this.g),Xs(this.b),Gs(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:Ys,formatHex:Ys,formatHex8:function(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}${Js(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ks,toString:Ks})),ws(el,function(e,t,n,r){return 1===arguments.length?Qs(e):new el(e,t,n,null==r?1:r)},Es(ks,{brighter(e){return e=null==e?As:Math.pow(As,e),new el(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Cs:Math.pow(Cs,e),new el(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 Ws(rl(e>=240?e-240:e+120,i,r),rl(e,i,r),rl(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new el(tl(this.h),nl(this.s),nl(this.l),Gs(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=Gs(this.opacity);return`${1===e?"hsl(":"hsla("}${tl(this.h)}, ${100*nl(this.s)}%, ${100*nl(this.l)}%${1===e?")":`, ${e})`}`}}));const il=Math.PI/180,ol=180/Math.PI,al=.96422,sl=.82521,ll=4/29,cl=6/29,ul=3*cl*cl,dl=cl*cl*cl;function fl(e){if(e instanceof hl)return new hl(e.l,e.a,e.b,e.opacity);if(e instanceof vl)return bl(e);e instanceof Ws||(e=Hs(e));var t,n,r=yl(e.r),i=yl(e.g),o=yl(e.b),a=pl((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?t=n=a:(t=pl((.4360747*r+.3850649*i+.1430804*o)/al),n=pl((.0139322*r+.0971045*i+.7141733*o)/sl)),new hl(116*a-16,500*(t-a),200*(a-n),e.opacity)}function hl(e,t,n,r){this.l=+e,this.a=+t,this.b=+n,this.opacity=+r}function pl(e){return e>dl?Math.pow(e,1/3):e/ul+ll}function ml(e){return e>cl?e*e*e:ul*(e-ll)}function gl(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function yl(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function vl(e,t,n,r){this.h=+e,this.c=+t,this.l=+n,this.opacity=+r}function bl(e){if(isNaN(e.h))return new hl(e.l,0,0,e.opacity);var t=e.h*il;return new hl(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}ws(hl,function(e,t,n,r){return 1===arguments.length?fl(e):new hl(e,t,n,null==r?1:r)},Es(ks,{brighter(e){return new hl(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new hl(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 Ws(gl(3.1338561*(t=al*ml(t))-1.6168667*(e=1*ml(e))-.4906146*(n=sl*ml(n))),gl(-.9787684*t+1.9161415*e+.033454*n),gl(.0719453*t-.2289914*e+1.4052427*n),this.opacity)}})),ws(vl,function(e,t,n,r){return 1===arguments.length?function(e){if(e instanceof vl)return new vl(e.h,e.c,e.l,e.opacity);if(e instanceof hl||(e=fl(e)),0===e.a&&0===e.b)return new vl(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*ol;return new vl(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new vl(e,t,n,null==r?1:r)},Es(ks,{brighter(e){return new vl(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new vl(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return bl(this).rgb()}}));var xl=e=>()=>e;function Sl(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):xl(isNaN(e)?t:e)}var Ml=function e(t){var n=function(e){return 1===(e=+e)?Sl: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):xl(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Us(e)).r,(t=Us(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=Sl(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);const wl=/^class(-pyramid)?/,El=(e,t,n,r)=>{let i=void 0!==n.min?n.min:r.min(),o=void 0!==n.max?n.max:r.max();const a=i,s=o,{limits:l}=t,c={},u="percent"===t.limitType?l.map(e=>i+(o-i)*e):l,d=t.colors.map(t=>e.resolveUIColor(t));if(i=Math.min(i,...u),o=Math.max(o,...u),c.min=i,c.max=o,t.breakTypes&&-1===t.breakTypes.indexOf(!0))c.type="categorical",Object.assign(c,(({min:e,max:t,limits:n,range:r})=>{const i=[],o=[];if(n.length)if(n[n.length-1]<e)o.push(e,t),i.push(r[r.length-1],r[r.length-1],r[r.length-1]);else if(n[0]>t)o.push(e,t),i.push(r[0],r[0],r[0]);else{if(n[0]>e)o.push(e),i.push(r[0]);else{o.push(e);for(let t=0;t<n.length;t++)if(e<n[t]){i.push(r[t]);break}}for(let a=0;a<n.length;a++)e<n[a]&&n[a]<t&&(o.push(n[a]),i.push(r[a]));if(n[n.length-1]<t)o.push(t),i.push(r[n.length]),i.push(r[n.length]);else{o.push(t);for(let e=0;e<n.length;e++)if(n[e]>t){i.push(r[e]),i.push(r[e]);break}}}else i.push(r[0]);return{min:e,max:t,range:i,domain:o}})({min:"percent"===t.limitType?i:a,max:"percent"===t.limitType?o:s,range:d,limits:"percent"===t.limitType?u:l}));else if(t.breakTypes){const e=t.breakTypes;c.type="continuous",c.domain=[i],c.range=[d[0]];for(let t=0;t<u.length;t+=1)if(e[t]){const n=d[t],r=d[t+1],i=Ml(n,r)(.5);c.range.push(i),c.domain.push(u[t]),t<u.length-1&&e[t+1]&&(c.range.push(d[t+1]),c.domain.push((u[t]+u[t+1])/2))}else c.range.push(d[t]),c.range.push(d[t+1]),c.domain.push(u[t]),c.domain.push(u[t]+Math.min(1e-6,(o-i)/1e6));c.range.push(d[d.length-1]),c.domain.push(o)}else c.domain=u,c.range=d;return c};function kl(e,t,n,r,i){let o=0;const a=[];let s,l,c;const u=(e-t)/(r+1);if(0===u)return 1;for(s=0;s<n.length;s+=1)l=.99*(n[s]-t),c=n[s]>e?Math.floor(e/u):n[s]<t?0:Math.floor(l/u),Number.isNaN(c)||(a[c]?a[c]+=1:a[c]=1);for(s=0;s<a.length;s+=1)a[s]&&(o+=1);return o<=r||o>=i?Math.max(o,r):kl(e,t,n,r+1,i)}const Cl=(e,{theme:t,hc:n},r,{f:i})=>{const o={mode:"field",fieldType:"measure",field:i?i.key():void 0,reverse:r.input.reverseScheme||!1,type:"continuous",range:({resources:e})=>e.theme.palette("quant")};let a=[],s=!0;if(i){if(Number.isNaN(+i.min())||Number.isNaN(+i.max()))return{invalid:!0};s=!("S"===(l=r.pic.raw()).qMode&&(l.qDataPages[0]&&l.qSize.qcy>l.qDataPages[0].qArea.qHeight||!l.qDataPages.length&&l.qSize.qcy>0)||"K"===l.qMode&&l.qStackedDataPages[0]&&l.qSize.qcy>l.qStackedDataPages[0].qArea.qHeight||"T"===l.qMode&&l.qSize.qcy>l.qTreeDataPages[0].qGroupSize),s&&(a=r.pic.extract({field:0,props:{num:{field:i.key()},exclude:{fields:n.qDimensionInfo.map((e,t)=>({field:`qDimensionInfo/${t}`})),value:e=>Math.min(...e)<0}}}).filter(e=>e.value>=0&&!e.exclude.value).map(e=>e.num.value).filter(e=>"number"==typeof e))}var l;if(!1===r.input.autoMinMax){if(o.min=r.input.measureMin,o.max=r.input.measureMax,o.max<o.min)return{invalid:!0}}else if(i&&!s)o.min=i.min(),o.max=i.max();else if(i){if(!a.length)return{invalid:!0};o.min=Math.min(...a),o.max=Math.max(...a)}let c;if(r.input.measureScheme&&(o.palettes={quant:r.input.measureScheme}),t){const e=t.getDataColorScales().filter(e=>e.key===r.input.measureScheme)[0];o.type=e&&wl.test(e.type)?"categorical":"continuous","categorical"===o.type&&(c=e.colors.some(e=>Array.isArray(e))?Math.max(...e.colors.map(e=>e?e.length:0)):e.colors.length)}if("categorical"===o.type){const e=s?kl(o.max,o.min,a,1,c):c,t=(o.max-o.min)/e,n=[];for(let r=0;r<e+1;r+=1)n.push(o.min+t*r);o.domain=n,o.range=({resources:t})=>{const n=t.theme.palette("quant",e),r=Math.max(1,Math.floor(n.length/e)),i=[];for(let t=0;t<e;t+=1)i.push(n[t*r]);return[i[0],...i,i[i.length-1]]}}return o};function Al(e,t){let n;return t.activeMeasureIndex>=0?n=e.pic.fields().filter(e=>"measure"===e.type())[t.activeMeasureIndex]:"libraryItem"===t.type?n=e.pic.field(e=>e.raw().colorMapRef===t.key&&void 0!==t.key):"expression"===t.type&&(n=e.pic.field(e=>"colorByAlternative"===e.raw().id)),n||(n=e.pic.field(e=>void 0!==e.raw().matchMeasure),n&&(n=e.pic.fields().filter(e=>"measure"===e.type())[n.raw().matchMeasure])),n}function Ol(e){e.measureOverrides.every(e=>!e)&&(e.measureOverrides=null)}function Nl(e,t){const n=t?.domain||[],r=t?.range||[],i=[];for(let t=0;t<e.length;++t){const o=e[t];if("constant"===o?.mode){const i=n.indexOf(t);-1===i?(n.push(t),r.push(o.primary)):r[i]=o.primary,e[t]=null}else if(o){i.push(t);const e=n.indexOf(t);-1!==e&&(n.splice(e,1),r.splice(e,1))}}return{domain:n,range:r,exclude:i}}function Dl(e,t,n,r){const i=function(e,t,n,r){if(t.input&&!t.input.auto){if("byMeasure"===t.input.mode)return function(e,{theme:t,hc:n},r,{getCField:i=Al}={}){const o=r.input.byMeasureDef||{activeMeasureIndex:0},a=i(r,o),s=Cl(0,{theme:t,hc:n},r,{f:a});if(s.invalid)return s;"expression"===o.type&&(o.activeMeasureIndex<0||void 0===o.activeMeasureIndex)&&(s.label=o.label,a&&"color.altLabel"===a.raw().labelExpRef&&(s.label=r.input.altLabel)),!s.label&&a&&(s.label=a.title());let l=o.activeMeasureIndex>=0?a:null;if(!l&&a&&void 0!==a.raw().matchMeasure&&a.raw().matchMeasure>-1&&(l=r.pic.fields().filter(e=>"measure"===e.type())[a.raw().matchMeasure]),r.input.useMeasureGradient&&"libraryItem"===o.type)if(l){const t=l.raw().coloring;t&&t.gradient&&ys(s,El(e,t.gradient,s,l))}else s.auxiliary=o;return s}(e,n,t);if("byDimension"===t.input.mode)return function(e,t,n,{getCDef:r=Ss,getCByField:i=Ms,getPersistence:o=xs}={}){const a=r(t,n),s=i(n,a),l=s?s.raw():{},c=n&&n.pic?n.pic.raw():{};if(l.qError||l.qSize&&0===l.qSize.qcy&&!c.qHasOtherValues)return{invalid:!0};const u={mode:"field",fieldType:"dimension",type:"categorical",field:s?s.key():void 0,isFieldLocked:l.qLocked};return("expression"===a.type||a.activeDimensionIndex<0)&&(u.label=a.label,"color.altLabel"===l.labelExpRef&&(u.label=n.input.altLabel)),!u.label&&s&&(u.label=s.title()),n.input.dimensionScheme&&(u.palettes={categorical:n.input.dimensionScheme}),n.input.useDimColVal&&"libraryItem"===a.type&&(u.auxiliary=a),ys(u,o(t,n,a,s,{byRow:bs,byElemNo:vs})),u}(0,n,t);if("byExpression"===t.input.mode)return function(e,{hc:t,theme:n,translator:r},i,o){const a=i.pic.field(e=>"colorByExpression"===e.raw().id);if(!a||!a.raw().qFallbackTitle&&!i.input.colorExpression||!(Number.isFinite(a.raw().qMin)&&Number.isFinite(a.raw().qMax)||i.input.expressionIsColor))return{mode:"constant",type:"constant",primary:o.nil};if(i.input.expressionIsColor)return{mode:"field",fieldType:"expression",field:a?a.key():void 0,type:"color"};const s=Cl(0,{hc:t,theme:n},i,{f:a});return s.invalid||(s.label=i.input.expressionLabel||r.get("Object.ChartTooltip.ColorExpression")),s}(0,n,t,r);if("byMultiple"===t.input.mode||"primary"===t.input.mode)return function(e,{hc:t,theme:n,translator:r},i,o){let a=i.input.useBaseColors;if(("byMultiple"===i.input.mode||"primary"===i.input.mode&&"measure"===i.input.useBaseColors)&&t.qMeasureInfo.length>1&&(a="measure"),"measure"===a){const a=[],s=[];"measure"===i.input.useBaseColors&&t.qMeasureInfo.forEach((t,n)=>{if(t.baseColor||t.coloring&&t.coloring.baseColor){a.push(n);const r=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===r?s.push(o.primary):s.push(r)}});let l=i.input.dimensionScheme?{categorical:i.input.dimensionScheme}:void 0;const c=n?n.getDataColorPalettes()[0]:void 0;return"measure"===i.input.useBaseColors&&c&&(l={categorical:c.key}),{mode:"measure",type:"categorical",palettes:l,label:r?r.get("Common.Measures"):void 0,explicit:a.length?{domain:a,range:s}:void 0}}if("dimension"===a){const n=[],r=[];return t.qDimensionInfo.forEach((t,i)=>{if(t.baseColor||t.coloring&&t.coloring.baseColor){n.push(i);const a=e.resolveUIColor(t.baseColor||t.coloring.baseColor);"none"===a?r.push(o.primary):r.push(a)}}),{mode:"dimension",type:"categorical",field:n.length?n[0]:void 0,explicit:n.length?{domain:n,range:r}:void 0}}let s=o.primary;if(void 0!==i.input.paletteColor)i.input.paletteColor&&(s=e.resolveUIColor(i.input.paletteColor));else{const{singleColor:e}=i.input;"number"!=typeof e||Number.isNaN(e)||(s=["#b0afae","#7b7a78","#545352","#4477aa","#7db8da","#b6d7ea","#46c646","#f93f17","#ffcf02","#276e27","#ffffff","#000000"][e])}return{mode:"constant",type:"constant",primary:s}}(e,n,t,r)}return{}}(e,t,n,r);return t.input?.measureOverrides?(i.measureOverrides=t.input.measureOverrides.map((n,i)=>function({cm:e,defaults:t,index:n,input:r,pic:i}){if(!r||!r.on)return null;const o=r.mode??"primary";return"primary"===o?function(e,t,n){let{primary:r}=n;return void 0!==t.paletteColor&&t.paletteColor&&(r=e.resolveUIColor(t.paletteColor)),{...n,mode:"constant",type:"constant",primary:r}}(e,r,t):"byExpression"===o?function(e,t,n){const r=`qMeasureInfo/${e}/`,i=t.field(e=>e.id().startsWith(r)&&"colorByMeasureExpression"===e.raw().id);return i?{...n,mode:"field",fieldType:"expression",field:i?i.key():void 0,type:"color"}:{...n,mode:"constant",type:"constant",primary:n.nil}}(n,i,t):null}({cm:e,input:n,defaults:r,index:i,pic:t.pic})),function(e,{translator:t}){if(Ol(e),1===e.measureOverrides?.length)return e.measureOverrides[0];if("measure"===e.mode&&e.measureOverrides&&(e.explicit=Nl(e.measureOverrides,e.explicit),Ol(e)),e.measureOverrides?.every(e=>"constant"===e?.mode)){const n={mode:"measure",type:"categorical",label:t?.get("Common.Measures")};return n.explicit=Nl(e.measureOverrides),n}return e.measureOverrides?.every(e=>e)?{invalid:!0,measureOverrides:e.measureOverrides}:e}(i,n)):i}const Tl=(e,t)=>{const n=e.fieldType,r={};if(t)if("measure"===n){const e=t.coloring;e&&(r.measureGradient=e.gradient)}else if("dimension"===n){const e=t[0],n=t[1];e&&(r.legendDataPage=e),n&&(r.dimValsData=n.colorMap)}return r},ql=e=>{throw e.isHandled=!0,e};function Il({auto:e,resources:t}={}){const n=function(e){const t={hc:null,colorProps:null,layout:null,theme:null,...e};let n={};const r={auto:()=>({mode:"primary"}),getDimensionColorMap:()=>Promise.reject(),getMeasure:()=>Promise.reject(),getAttributeDimension:()=>Promise.reject()},i={auto:e=>e?(r.auto=e,i):r.auto,getDimensionColorMap:e=>e?(r.getDimensionColorMap=e,i):r.getDimensionColorMap,getAttributeDimension:e=>e?(r.getAttributeDimension=e,i):r.getAttributeDimension,getMeasure:e=>e?(r.getMeasure=e,i):r.getMeasure,set(e){if(!e.colorProps)throw new Error('Missing "colorProps"');if(ys(t,e),n={pic:t.picasso.data("q")({data:t.hc,config:{localeInfo:t.localeInfo}}),input:t.colorProps},n.input.auto){const i=r.auto(e.layout);n.input=ys(!0,{},n.input,i,{auto:!1});const o=t.theme?t.theme.getDataColorPalettes():[];o[0]&&(n.input.dimensionScheme=o[0].key);let a=0;n.input.byDimDef&&+n.input.byDimDef.activeDimensionIndex>=0&&(a=+n.input.byDimDef.activeDimensionIndex),t.hc&&t.hc.qDimensionInfo[a]&&t.hc.qDimensionInfo[a].coloring&&t.hc.qDimensionInfo[a].coloring.colorMapRef&&n.input.byDimDef&&(n.input.byDimDef.type="libraryItem",n.input.byDimDef.key=t.hc.qDimensionInfo[a].coloring.colorMapRef)}n.input.measureOverrides?.every(e=>!e||!e.on)&&(n.input=ys(!1,{},n.input,{measureOverrides:null}))},palettes(){if(!n.palettes){const{theme:e}=t,r=[];(e&&e.getDataColorPickerPalettes()||[]).forEach(e=>{r.push({key:"ui",colors:e.colors})}),n.palettes=r}return n.palettes},getAuxiliaryData(e,n="/qHyperCubeDef"){if(!e.auxiliary&&!/qAttrDimInfo/.test(e.field))return Promise.resolve();const{key:i}=e.auxiliary||{};if("measure"===e.fieldType)return r.getMeasure(i,t).catch(()=>{});if("dimension"===e.fieldType){const o=`${n}/${e.field}`.replace("qDimensionInfo","qDimensions").replace("qAttrDimInfo","qAttributeDimensions");return Promise.all([/qAttrDimInfo/.test(e.field)?r.getAttributeDimension(o,t).catch(()=>{}):Promise.resolve(),i?r.getDimensionColorMap(i,t).catch(()=>{}):Promise.resolve()])}return Promise.resolve()},getAuxiliarySettings(e,r){return e.auxiliary||/qAttrDimInfo/.test(e.field)?(this.palettes(),this.getAuxiliaryData(e,r).then(r=>{if(!r)return{};if("measure"===e.fieldType){if(r.coloring&&r.coloring.gradient){const t=n.pic.field(e.field);return El(this,r.coloring.gradient,e,t)}return{}}if("dimension"===e.fieldType){const i={nil:e.nil,others:e.others},o=r[0],a=r[1]?r[1].colorMap:null;if(o){const r=t.picasso.data("q")({data:{qDimensionInfo:[n.pic.field(e.field).raw(),n.pic.field(e.field).raw()],qMeasureInfo:[],qDataPages:o,qInterColumnSortOrder:[0,1],qMode:"S"}});i.legendDataset=r}return a?((e,t,n,{external:r,field:i})=>{const o={...e};ys(o,vs(i,i.raw().qCardinal));const a=r.theme?r.theme.getDataColorPalettes()[0]:null;return t.nul&&(o.nil=n.resolveUIColor(t.nul)),t.oth&&(o.others=n.resolveUIColor(t.oth)),t.usePal?(o.palettes={categorical:t.pal},a&&!t.pal&&(o.palettes.categorical=a.key,ys(o,vs(i)))):!1===t.autoFill&&t.single?o.range=[n.resolveUIColor(t.single)]:t.autoFill&&(a&&(o.palettes={categorical:a.key}),ys(o,vs(i))),t.colors&&t.colors.length&&(o.explicit=((e,t,n)=>{const r={};for(let t=0;t<e.length;t+=1)r[e[t].value]=e[t].baseColor;let i=[];return{domain({data:e}){const o=[];i=[];for(let n=0;n<e.items.length;n++){const a=e.items[n],s=(a.text||a).label;r[s]&&-1===o.indexOf(a.value)&&(o.push(a.value),i.push(t.resolveUIColor(r[s])))}return o.push(-3,-2),i.push(n.others),i.push(n.nil),o},range:()=>i}})(t.colors,n,o)),o})(i,a,this,{external:t,field:n.pic.field(e.field)}):i}return{}})):Promise.resolve()},resolveUIColor(e){if(e.index<0||void 0===e.index)return e.color;if(void 0===n.uiPalette&&(n.uiPalette=this.palettes().filter(e=>"ui"===e.key)[0]||!1),!n.uiPalette)return e.color;const t="none"===n.uiPalette.colors[0]?e.index:e.index-1;return void 0===n.uiPalette.colors[t]?e.color:n.uiPalette.colors[t]},settings(){if(this.palettes(),!n.settings){let e={primary:"steelblue",others:"#aaa",nil:"#ddd"};const{theme:r}=t;r&&(e={...e,...r.getDataColorSpecials()}),n.settings=ys(e,Dl(this,n,t,e))}return n.settings}};return i}(t).auto(e||(()=>({mode:"byDimension",persistent:!1,useDimColVal:!0,byDimDef:{activeDimensionIndex:0,type:"expression",label:""}}))).getDimensionColorMap((e,{layout:t,app:n})=>((e,{layout:t,app:n})=>t&&t.snapshotData?t.snapshotData.content&&t.snapshotData.content.chartData&&t.snapshotData.content.chartData.dimValsData?Promise.resolve({colorMap:t.snapshotData.content.chartData.dimValsData}):Promise.reject():n&&n.getObject?n.getObject(`ColorMapModel_${e}`).then(e=>e.getLayout()):Promise.reject())(e,{layout:t,app:n})).getMeasure((e,{layout:t,app:n})=>((e,{layout:t,app:n})=>t&&t.snapshotData?t.snapshotData.content&&t.snapshotData.content.chartData&&t.snapshotData.content.chartData.measureGradient?Promise.resolve({coloring:{gradient:t.snapshotData.content.chartData.measureGradient}}):Promise.reject():n&&n.getMeasure?n.getMeasure(e).then(e=>e.getMeasure()):Promise.reject())(e,{layout:t,app:n})).getAttributeDimension((e,{layout:t,model:n,app:r})=>((e,{layout:t,model:n,app:r})=>{if(t&&t.snapshotData)return t.snapshotData.content&&t.snapshotData.content.chartData&&t.snapshotData.content.chartData.legendDataPage?Promise.resolve(t.snapshotData.content.chartData.legendDataPage):Promise.reject();if(n&&n.session&&r){const t=[{qHeight:100,qLeft:0,qTop:0,qWidth:2}];return n.getHyperCubeData(e,t).catch(ql)}return Promise.reject()})(e,{layout:t,model:n,app:r}));return n.getSnapshotData=Tl,n}function Rl(e){return t=>"object"==typeof t.datum[e]?t.datum[e].value:void 0}function Ll(e){return"object"==typeof e.datum.isNull?e.datum.isNull.value:-2===e.datum.value}function _l(e){return-3===e.datum.value}const Pl={COLOR:void 0,FONT_SIZE:"16px",FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},zl={COLOR:void 0,FONT_SIZE:void 0,FONT_FAMILY:"'Source Sans Pro', 'Arial', 'sans-serif'"},Fl="legend.title",jl="legend.label";function $l({theme:e,key:t,styleOverrides:n}){const r={title:{color:Pl.COLOR,fontSize:Pl.FONT_SIZE,fontFamily:Pl.FONT_FAMILY},label:{color:zl.COLOR,fontSize:zl.FONT_SIZE,fontFamily:zl.FONT_FAMILY}};if(!e&&!n)return r;const{title:i,label:o}=n||{},a=(({theme:e,key:t})=>(n,r,i,o)=>void 0!==n?n:e?e.getStyle(t,r,i):o)({theme:e,key:t});return r.title.color=a(i?.color,Fl,"color",Pl.COLOR),r.title.fontSize=a(i?.fontSize,Fl,"fontSize",Pl.FONT_SIZE),r.title.fontFamily=a(i?.fontFamily,Fl,"fontFamily",Pl.FONT_FAMILY),r.label.color=a(o?.color,jl,"color",zl.COLOR),r.label.fontSize=a(o?.fontSize,jl,"fontSize",zl.FONT_SIZE),r.label.fontFamily=a(o?.fontFamily,jl,"fontFamily",zl.FONT_FAMILY),r}const Bl=(e,t,n)=>{const r=e&&e.dock||void 0;if("auto"!==r)return r||"right";if(t){const e=t.element.getBoundingClientRect();if(e.height>e.width)return"bottom"}return n?"left":"right"},Vl=(e,t,n)=>!(n.invalid||"color"===n.type||"measure"===n.mode&&t.qMeasureInfo.length<=1||"dimension"===n.mode)&&("function"==typeof e.show?e.show():!1!==e.show);function Hl(e,t){const{styleReference:n,styleOverrides:r,chart:i,rtl:o}=e,{legendProps:a,coloring:s,theme:l,hc:c}=t,u=$l({theme:l,key:n,styleOverrides:r});return{layout:{minimumLayoutMode:"MEDIUM",dock:Bl(a,i,o)},show:"function"==typeof a.show?()=>Vl(a,c,s):Vl(a,c,s),renderer:"svg",mounted(e){e.childNodes[0].style.pointerEvents="none",e.style.overflow="hidden"},settings:{title:{show:!1!==a.showTitle,wordBreak:"break-word",maxLines:2,lineHeight:1.2,text:s.label||"",fill:u.title.color,fontSize:u.title.fontSize,fontFamily:u.title.fontFamily}}}}const Ul=({eventName:e,key:t,requireFailure:n,recognizeWith:r}={},{actions:i}={})=>({key:`event:pan-${t}`,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:e,pointers:1,threshold:10,enable(n,r){return this.started===e||!r||!(i?.interact?.enabled&&!i.interact.enabled())&&this.chart.componentsFromPoint({x:r.center.x,y:r.center.y}).some(e=>e.key===`${t}-cat`)}},events:{[`${e}start`](n){n.preventDefault(),this.started!==e&&(this.started=e,this.chart.component(`${t}-cat`).emit("panstart",n))},[`${e}move`](e){e.preventDefault(),this.chart.component(`${t}-cat`).emit("panmove",e)},[`${e}end`](e){e.preventDefault(),this.chart.component(`${t}-cat`).emit("panend",e),this.started=!1}}}),Wl=({key:e,requireFailure:t,recognizeWith:n},{actions:r}={})=>({key:`event:tap-${e}`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:"legendtap",interval:10,pointers:1,enable(t,n){if(!n)return!0;if(r?.interact?.enabled&&!r.interact.enabled())return!1;if(!this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(t=>t.key===`${e}-cat`))return!1;const{target:i}=n.srcEvent;return!!(i&&i.hasAttribute("data-action")&&i.hasAttribute("data-component-key"))||!(!i||!i.childNodes[0]||"BUTTON"!==i.childNodes[0].nodeName)}},events:{legendtap(e){e.preventDefault();const{target:t}=e.srcEvent;t&&t.hasAttribute("data-action")&&t.hasAttribute("data-component-key")&&this.chart.component(t.getAttribute("data-component-key")).emit(t.getAttribute("data-action"))}}});function Yl(e){const t=Il({resources:e});let n={},r={};const i=e=>(r.settings||(e||console.warn("settings() called before auxiliarySettings()"),r.settings=t.settings()),r.settings),o={config(i){if(n={...i},r={},!n.key)throw new Error("Missing key");t.set({...e,...n})},auto:e=>e?(t.auto(e),o):t.auto(),getAuxiliarySettings:e=>r.auxiliarySettings?Promise.resolve(r.auxiliarySettings):t.getAuxiliarySettings(i(!0),e).then(e=>(r.auxiliarySettings=e||{},r.settings={...r.settings,...r.auxiliarySettings},r.scales=void 0,r.color=void 0,r.auxiliarySettings)),getAuxiliaryData:()=>t.getAuxiliaryData(i()),getSnapshotData(e){const n=i();return t.getAuxiliaryData(n,e).then(e=>t.getSnapshotData(n,e))},resolveUIColor:e=>t.resolveUIColor(e),settings(){const e=i();return{mode:e.mode,type:e.type,label:e.label,field:e.field,fieldType:e.fieldType,nil:e.nil,others:e.others,primary:e.primary}},settingsForMeasure(e){const t=i(),n=t.measureOverrides?.[e];return n||this.settings()},isSelectionLocked:({isMeasureSelectionLocked:e})=>function(e,{isMeasureSelectionLocked:t}){return"field"!==e.mode||("dimension"===e.fieldType?e.isFieldLocked:"measure"!==e.fieldType||t)}(i(),{isMeasureSelectionLocked:e}),palettes:()=>function({colorProps:e,coloring:t,theme:n}={}){const r=[];if(t&&t.palettes&&n){const i=t.palettes.categorical||e.dimensionScheme,o=n.getDataColorPalettes().filter(e=>e.key===i)[0]||n.getDataColorPalettes()[0];i&&o&&r.push({key:"categorical",colors:o.colors});const a=t.palettes.metric||e.measureScheme,s=n.getDataColorScales().filter(e=>e.key===a)[0]||n.getDataColorScales()[0];if(s){let e=s.colors[0]?s.colors:[[],...s.colors.slice(1)];e=Array.isArray(e[0])?e.map(e=>e.slice().reverse()):e.slice().reverse(),r.push({key:"quant",colors:e})}}return r}({coloring:i(),colorProps:n.colorProps,theme:n.theme}),scales:()=>(r.scales=r.scales||function({hc:e,coloring:t,rtl:n,key:r,source:i,picasso:o}={}){const a={},s=r;if(t){const r={override:!0,domain:t.explicit&&"function"==typeof t.explicit.domain?t.explicit.domain:[...(t.explicit||{}).domain||[],-3,-2],range:t.explicit&&"function"==typeof t.explicit.range?t.explicit.range:[...(t.explicit||{}).range||[],t.others,t.nil]};if("field"===t.mode){if("dimension"===t.fieldType){const{data:n}=function({hc:e,source:t,coloring:n}){const r={data:{extract:[{source:"dummy",field:0,filter:()=>(r.expando=e.qDataPages[0]?e.qDataPages[0].qArea.qTop:0,!1)},{source:t,field:n.field,trackBy:n.valueAccessor,reduce:"first",props:{row:{reduce:()=>r.expando++},text:{value:e=>e.qText,reduce:"first"}}}]},expando:0};return r}({hc:e,source:i,coloring:t});let l;if(t.legendDataset){let n=0;const r={};o.data("q")({data:e}).extract({field:t.field,trackBy:t.valueAccessor,reduce:e=>{const t=e[0];return r[t]=n++,e[0]}}),l={source:"attrDim",extract:{field:"qDimensionInfo/0",filter:e=>e.qElemNumber>=0,props:{row:{value:e=>r[e.qElemNumber]}}}}}const c={data:n,range:t.range,domain:t.domain,explicit:r,type:"categorical-color",label:e=>e.datum.text&&e.datum.text.value?e.datum.text.value:e.datum.label};a[s]=c,l&&(a[`${s}Legend`]={...c,data:l}),e&&e.qHasOtherValues&&l&&((l||c.data).amend=[{label:e.qDimensionInfo[0].othersLabel,source:{key:"qHyperCube",field:"qDimensionInfo/0"},row:{value:-3},value:-3}])}else if("measure"===t.fieldType){const e={data:{field:t.field},min:t.min,max:t.max};a[s]=ys({},e,{type:"categorical"===t.type?"threshold-color":"sequential-color",range:t.range,domain:t.domain,invert:t.reverse}),"sequential-color"===a[s].type&&(a[`${s}Range`]=ys({},e,{invert:!!n}))}else if("color"!==t.type)throw new Error("UNUSED FIELD")}else if("dimension"===t.mode){const t={data:e.qDimensionInfo.map((e,t)=>t),label:t=>e.qDimensionInfo[t.datum.value].qFallbackTitle,explicit:r,type:"categorical-color"};a[s]=t}else if("measure"===t.mode){const n={data:e.qMeasureInfo.map((e,t)=>t).filter(e=>!t.explicit?.exclude?.includes(e)),label:t=>e.qMeasureInfo[t.datum.value].qFallbackTitle,explicit:r,type:"categorical-color"};a[s]=n}}return a}({hc:n.hc,coloring:i(),key:n.key,source:n.source,picasso:e.picasso}),r.scales),color(){return r.color=r.color||function({coloring:e,scales:t,key:n}){const r=Rl(n),i=Rl(`${n}IsAnOther`),o=({fieldType:e,invalid:n,mode:o,nil:a,others:s,primary:l,type:c},u)=>n?e=>_l(e)||i(e)?s:a:t[u]?t=>_l(t)?s:Ll(t)||-2===r(t)&&"dimension"===e||"NaN"===r(t)?a:i(t)?s:t.resources.scale(u)(r(t))||s:"constant"===o?e=>_l(e)||i(e)?s:Ll(e)?a:l:"color"===c?e=>_l(e)||i(e)?s:Ll(e)?a:r(e)||s:null,a=o(e,n);if(e.measureOverrides){const t=Rl(`${n}MeasureIdx`),r=e.measureOverrides.map(e=>e&&o(e));return e=>{const n=t(e);return r[n]?r[n](e):a(e)}}return a}({coloring:i(),scales:this.scales(),key:n.key}),r.color},datumProps(e){return function({hc:e,coloring:t,scales:n,key:r,addMeasureIx:i},o=0){let a,s;const l=r,{nil:c}=t;"field"===t.mode&&t.field?a=t.field:n[r]&&"field"===t.mode&&(a=n[r].data.field||t.field),a?(s={field:a,reduce:"first"},"color"===t.type&&(s.value=e=>{return"NaN"!==e.qNum?`rgba(${[(16711680&(t=e.qNum))>>16,(65280&t)>>8,255&t,((4278190080&t)>>>24)/255].join(",")})`:e.qText&&$s(e.qText)?e.qText:c;var t})):"dimension"===t.mode?s=void 0!==t.field?t.field:e.qDimensionInfo.length-1:"measure"===t.mode&&(s=o);const u={[l]:s};return e.qDimensionInfo.length>1&&(u[`${l}IsAnOther`]={fields:e.qDimensionInfo.map((e,t)=>({field:`qDimensionInfo/${t}`})),value:e=>-1!==e.indexOf(-3)}),i&&(u[`${l}MeasureIdx`]=o),u}({coloring:this.settingsForMeasure(e),scales:this.scales(),key:n.key,hc:n.hc,addMeasureIx:i().measureOverrides},e)},data(){const e=i(),t={key:"dummy",data:[["field"],["a"]]};return e.legendDataset?[t,{type:"q",key:"attrDim",data:e.legendDataset.raw(),config:{localeInfo:n.localeInfo}}]:[t]},legend({eventName:e,key:t,viewState:r,chart:o,rtl:a,styleReference:s="object.legend",styleOverrides:l,settings:c={},style:u={}}={},d={}){return function(e,t,n){const r=[],i=[],o=function(e,t,n){return"categorical"===t.coloring.type?function(e,t,n){const r=Hl(e,t);if(!r.show)return!1;const{key:i,styleReference:o,styleOverrides:a,viewState:s,rtl:l,settings:c,style:u}=e,{scaleKey:d,theme:f,scales:h}=t,p=$l({theme:f,key:o,styleOverrides:a}),{dock:m}=r.layout,g="left"===m||"right"===m?{maxLines:2,wordBreak:"break-word"}:{},y={up:"M13.6,11 L2.4,11 C2.28954305,11 2.2,10.9104569 2.2,10.8 C2.2,10.756726 2.21403557,10.7146192 2.24,10.68 L7.84,3.21333333 C7.90627417,3.12496777 8.03163444,3.10705916 8.12,3.17333333 C8.13516113,3.18470418 8.14862915,3.1981722 8.16,3.21333333 L13.76,10.68 C13.8262742,10.7683656 13.8083656,10.8937258 13.72,10.96 C13.6853808,10.9859644 13.643274,11 13.6,11 Z",down:"M2.4,4 L13.6,4 C13.7104569,4 13.8,4.08954305 13.8,4.2 C13.8,4.24327404 13.7859644,4.28538077 13.76,4.32 L8.16,11.7866667 C8.09372583,11.8750322 7.96836556,11.8929408 7.88,11.8266667 C7.86483887,11.8152958 7.85137085,11.8018278 7.84,11.7866667 L2.24,4.32 C2.17372583,4.23163444 2.19163444,4.10627417 2.28,4.04 C2.31461923,4.01403557 2.35672596,4 2.4,4 Z",left:"M11,2.4 L11,13.6 C11,13.7104569 10.9104569,13.8 10.8,13.8 C10.756726,13.8 10.7146192,13.7859644 10.68,13.76 L3.21333333,8.16 C3.12496777,8.09372583 3.10705916,7.96836556 3.17333333,7.88 C3.18470418,7.86483887 3.1981722,7.85137085 3.21333333,7.84 L10.68,2.24 C10.7683656,2.17372583 10.8937258,2.19163444 10.96,2.28 C10.9859644,2.31461923 11,2.35672596 11,2.4 Z",right:"M4,13.6 L4,2.4 C4,2.28954305 4.08954305,2.2 4.2,2.2 C4.24327404,2.2 4.28538077,2.21403557 4.32,2.24 L11.7866667,7.84 C11.8750322,7.90627417 11.8929408,8.03163444 11.8266667,8.12 C11.8152958,8.13516113 11.8018278,8.14862915 11.7866667,8.16 L4.32,13.76 C4.23163444,13.8262742 4.10627417,13.8083656 4.04,13.72 C4.01403557,13.6853808 4,13.643274 4,13.6 Z"};let v;"dimension"===t.coloring.fieldType&&(v=e=>e.datum.value>=0||-3===e.datum.value);const b=`${d}Legend`;return ys(!0,r,{type:"legend-cat",key:`${i}-cat`,scale:b in h?b:d,settings:{layout:{scrollOffset:()=>s?s.get("legendScrollOffset"):void 0,size:-1!==["top","bottom"].indexOf(r.layout.dock)?2:1,direction:l?"rtl":"ltr",horizontal:20},item:{show:v,label:{fill:p.label.color,fontSize:p.label.fontSize,fontFamily:p.label.fontFamily,...g}},navigation:{disabled:n,button:{content:(e,{direction:t})=>e("i",{style:{"pointer-events":"none",fontSize:"12px",display:"inline-block",fontStyle:"normal",lineHeight:"0",textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizelegibility",margin:"0px"}},[e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor"},[e("path",{d:y[t]})])])}}},brush:{consume:[{context:"selection",data:["",i],style:{inactive:{opacity:.3}}}]}},{settings:c,style:u})}(e,t,n):"continuous"===t.coloring.type&&function(e,t){const{key:n,styleReference:r,styleOverrides:i,rtl:o,settings:a,style:s}=e,{scaleKey:l,theme:c}=t,u=`${l}Range`,d=Hl(e,t);if(!d.show)return!1;const f=$l({theme:c,key:r,styleOverrides:i}),{dock:h}=d.layout,p="right"===h||"left"===h,m=t.scales?.[u];return p&&m&&(m.invert=!0),ys(!0,d,{type:"legend-seq",key:`${n}-seq`,settings:{fill:l,major:u,length:1,tick:{fill:f.label.color,fontSize:f.label.fontSize,fontFamily:f.label.fontFamily},title:{anchor:!o||"top"!==d.layout.dock&&"bottom"!==d.layout.dock?void 0:"right",padding:parseFloat(d.settings.title.fontSize)||16}}},{settings:a,style:s})}(e,t)}(e,t,n&&n.navigationDisabled);return r.push(o),o&&"legend-cat"===o.type&&(i.push(Wl(e,n)),i.push(Ul(e,n))),{interactions:i,components:r}}({eventName:e,key:t,rtl:a,viewState:r,chart:o,styleReference:s,styleOverrides:l,settings:c,style:u},{legendProps:n.legendProps,scaleKey:n.key,coloring:i(),theme:n.theme,hc:n.hc,scales:this.scales()},d)}};return o}const Kl=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function Gl(e){const{qDimensionInfo:t,qMeasureInfo:n}=e.qHyperCube,r=t.some(Kl),i=n.some(Kl),o=e.color.useBaseColors;return"measure"===o&&!i||"dimension"===o&&!r?"off":o}const Xl=e=>e.baseColor||e.coloring&&e.coloring.baseColor;function Jl(e){const t=e.qHyperCube.qDimensionInfo.some(Xl),n=e.qHyperCube.qMeasureInfo.some(Xl);return{mode:"primary",useBaseColors:(t?"dimension":void 0)??(n?"measure":void 0)??"off",paletteColor:null}}const Zl=()=>{};var Ql="center",ec="bottom",tc=[{key:"NoDataExist",alignment:Ql,condition:({layoutService:e})=>{if(!e)return!1;const{x:t,y:n}=e.meta.size;return t*n===0}},{key:"OnlyNanDataMeasure",translationKey:"OnlyNanData",alignment:Ql,condition:({layoutService:e})=>!!e&&e.getHyperCubeValue("qMeasureInfo").every(e=>"NaN"===e.qMin&&"NaN"===e.qMax)},{key:"OnlyNanDataDimensionContinuous",translationKey:"OnlyNanData",alignment:Ql,condition:({layoutService:e})=>{if(!e)return!1;const{isContinuous:t}=e.meta;if(!t)return!1;const n=e.getHyperCubeValue("qDimensionInfo.0");return n&&(n.qMax<n.qMin||"NaN"===n.qMax)}},{key:"OnlyNegativeOrZeroValues",alignment:Ql},{key:"DataRangeIncludingZero",alignment:ec},{key:"LimitedData",alignment:ec},{key:"NegativeOrZeroValues",alignment:ec}].reduce((e,t)=>(e[t.key]=t,e),{});const nc=()=>!1;function rc({chart:e,logicalSize:t}){if(t)return t;const n=e?e.element.getBoundingClientRect():{};return{width:n.width,height:n.height}}const ic=[{key:"FULL",size:{width:550,height:450}},{key:"MEDIUM",size:{width:400,height:220}},{key:"SMALL",size:{width:300,height:150}},{key:"XSMALL",size:{width:150,height:75}}];function oc({width:e,height:t}){const n=ic.filter(n=>e>=n.size.width&&t>=n.size.height).shift();return n?n.key:"SPARK"}const ac={left:"right",right:"left",top:"bottom",bottom:"top",near:"far",far:"near"};function sc({orientation:e,dock:t,btt:n,rtl:r}){const i="horizontal"===e?(e=>"bottom"===e||"near"===e?"bottom":"top")(t):((e,t)=>{const n="left"===e||"near"===e?"left":"right";return t?ac[n]:n})(t,r),o=((e,t,n)=>"vertical"===e?t?"bottom":"top":n?"right":"left")(e,n,r);return{current:i,opposite:ac[i],start:o,end:ac[o]}}function lc({chart:e,layoutService:t,config:n={}}){const{logicalSize:r=!1,rtl:i=!1}=n,o={chart:{size:void 0,mode:void 0},x:{dock:void 0,opposite:void 0,size:void 0},y:{dock:void 0,opposite:void 0,size:void 0}},a={type:"x-y",config:{...n},meta:o,update:e=>{o.chart.size={width:e.width,height:e.height},o.chart.mode=oc(e);const{current:n,opposite:r}=sc({orientation:"horizontal",dock:t.getLayoutValue("xAxis.dock"),btt:!1,rtl:i});o.x.dock=n,o.x.opposite=r,o.x.size=e.width;const{current:a,opposite:s}=sc({orientation:"vertical",dock:t.getLayoutValue("yAxis.dock"),btt:!0,rtl:i});o.y.dock=a,o.y.opposite=s,o.y.size=e.height}};return a.update(rc({chart:e,logicalSize:r})),a}var cc="vertical",uc="horizontal";function dc({chart:e,layoutService:t,config:n={},typeConfig:r={}}){const{logicalSize:i=!1,rtl:o=!1}=n,a=r.fallback===cc?cc:uc,s=!!r.invert,l=r.measureAxes||[{ref:"measureAxis",name:"minor"}],c={chart:{orientation:void 0,size:void 0,mode:void 0},major:{orientation:void 0,dock:void 0,opposite:void 0,size:void 0}},u={type:"major-minor",config:{...n},meta:c,update:e=>{c.chart.orientation=t.getLayoutValue("orientation",a),c.chart.size={width:e.width,height:e.height},c.chart.mode=oc(e),c.major.orientation=function({layoutService:e,chartOrientation:t,invert:n}){const{isContinuous:r}=e.meta;return r?uc:n?t===cc?uc:cc:t}({layoutService:t,chartOrientation:c.chart.orientation,invert:s});const{current:n,opposite:r}=sc({orientation:c.major.orientation,dock:t.getLayoutValue("dimensionAxis.dock"),btt:!1,rtl:o});c.major.dock=n,c.major.opposite=r,c.major.size=c.major.orientation===cc?e.height:e.width,l.forEach(n=>{const r={};r.orientation=c.major.orientation===cc?uc:cc;const{current:i,opposite:a,start:s,end:l}=sc({orientation:r.orientation,dock:t.getLayoutValue(`${n.ref}.dock`),btt:!0,rtl:o});r.dock=i,r.opposite=a,r.start=s,r.end=l,r.size=r.orientation===cc?e.height:e.width,c[n.name]=r})}};return u.update(rc({chart:e,logicalSize:i})),u}function fc({chart:e,layoutService:t,config:n={},typeConfig:r={}}){return("x-y"===r.type?lc:dc)({chart:e,layoutService:t,config:n,typeConfig:r})}function hc(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}const pc=["__proto__","constructor"];function mc(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];if(pc.some(e=>r.includes(e)))return;let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}function gc(){let e={};return{get:t=>e[t],set:(t,n)=>(e[t]=n,n),has:t=>t in e,remove(t){delete e[t]},empty(){e={}}}}function yc(e,t=50){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}function vc(e,t=50){let n,r,i,o=0;return function(...a){n=this,r=a;const s=Date.now()-o,l=()=>{o=Date.now(),i=0,e.apply(n,r)};i||(s>=t?l():i=setTimeout(l,t-s))}}const bc={ERROR_CODES:[7005],DIMENSION:"qDimensionInfo",MEASURE:"qMeasureInfo"},xc=(e,t)=>e[t].reduce((e,t,n)=>{var r;return r=t,bc.ERROR_CODES.some(e=>e===r.qError?.qErrorCode)?e.filtered.push(n):e.reduced.push(t),e},{reduced:[],filtered:[]});function Sc(e){return(e?.qHyperCube?.qDimensionInfo||[]).map(e=>{const t=e.qCardinalities?.qHypercubeCardinal;if(t)return t;const{qLocked:n=0,qOption:r=0,qSelected:i=0}=e.qStateCounts||{};return n+r+i})}function Mc(e){switch(e.qHyperCube.qMode){case"S":return function(e){const{qcx:t,qcy:n}=e.qHyperCube.qSize;return{refs:{dataPages:"qHyperCube.qDataPages"},size:{x:t,y:n,dimensions:Sc(e)}}}(e);case"K":return function(e){const t=Sc(e);return{refs:{dataPages:"qHyperCube.qStackedDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);case"T":return function(e){const t=Sc(e);return{refs:{dataPages:"qHyperCube.qTreeDataPages"},size:{x:e.qHyperCube.qSize.qcx,y:t[0],dimensions:t}}}(e);default:throw new Error("Mode not supported")}}function wc({originalArray:e,newArray:t,matchKey:n}){return Array.isArray(e)&&e.length?(t.forEach(t=>{let r=-1;e.some((e,i)=>(e[n]&&e[n]===t[n]&&(r=i),r)),r>-1?e[r]=t:e.push(t)}),e):t}function Ec(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 kc(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 Cc(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 Ac(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cc(Object(n),!0).forEach(function(t){kc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Oc=Object.prototype.hasOwnProperty,Nc=Object.prototype.toString,Dc=Object.defineProperty,Tc=Object.getOwnPropertyDescriptor,qc=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Nc.call(e)},Ic=function(e){if(!e||"[object Object]"!==Nc.call(e))return!1;var t,n=Oc.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Oc.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Oc.call(e,t)},Rc=function(e,t){Dc&&"__proto__"===t.name?Dc(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Lc=function(e,t){if("__proto__"===t){if(!Oc.call(e,t))return;if(Tc)return Tc(e,t).value}return e[t]},_c=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=Lc(s,n),s!==(i=Lc(t,n))&&(u&&i&&(Ic(i)||(o=qc(i)))?(o?(o=!1,a=r&&qc(r)?r:[]):a=r&&Ic(r)?r:{},Rc(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&Rc(s,{name:n,newValue:i}));return s};function Pc(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 zc(e,t,n){let r=n.key;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 Fc(e){let t=e.cache,n=e.f,r=e.mainCell,i=e.p,o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,c=e.target,u=e.targetProp,d=e.columnOrder,f=r;if(i.field&&i.field!==n){const e=Pc(i.field,o,{cache:t},d);if(-1===e)return;f=_c({qRow:a},e(s))}c[u]=zc(i,f,{key:l})}function jc(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),c=r.normalizeConfig(i[e],t),u=c.props,d=c.main,f=Object.keys(u),h=!!i[e].trackBy,p=typeof i[e].trackBy,m={},g=[],y=[];for(let t=0;t<a.qDataPages.length;t++){const o=Pc(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let c=0;c<a.qDataPages[t].qMatrix.length;c++){const v=a.qDataPages[t].qArea.qTop+c,b=_c({qRow:v},o(a.qDataPages[t].qMatrix[c])),x=zc(d,b,{key:s});if(!d.filter||d.filter(b)){for(let e=0;e<f.length;e++){const r=u[f[e]];let i=r.fields||[r];r.fields&&(x[f[e]]=[]);for(let o=0;o<i.length;o++)Fc({cache:n,f:l,mainCell:b,p:i[o],prop:f[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[c],sourceKey:s,target:r.fields?x[f[e]]:x,targetProp:r.fields?o:f[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[f[e]].map(e=>e.value),n=x[f[e]].map(e=>e.label);x[f[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[f[e]].value)}}}h&&r.track({cfg:i[e],itemData:b,obj:x,target:g,tracker:m,trackType:p}),y.push(x)}}}const v=h?r.collect(g,{main:d,propsArr:f,props:u}):y;o=[...o,...v]}return o}function $c(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 Bc(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=Hc)):void 0===t&&(t=Vc);for(var n,r,i,o,a,s=new Yc(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 Yc(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Wc)}function Vc(e){return e.children}function Hc(e){return Array.isArray(e)?e[1]:null}function Uc(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function Wc(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function Yc(e){this.data=e,this.depth=this.height=0,this.parent=null}function Kc(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}Yc.prototype=Bc.prototype={constructor:Yc,count:function(){return this.eachAfter($c)},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 Bc(this).eachBefore(Uc)},[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 Gc={depth:-1},Xc={},Jc={};function Zc(e){return e.id}function Qc(e){return e.parentId}function eu(e){let t=e.length;if(t<2)return"";for(;--t>1&&!tu(e,t););return e.slice(0,t)}function tu(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function nu(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=nu(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]=nu(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function ru(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,...ru(e[i].children,t-1,n)]);return r}function iu(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=>ru(e.children,r-1,n)}return!1}const ou=/^qDimensionInfo(?:\/(\d+))?/,au=/^\/?qMeasureInfo\/(\d+)/,su=/\/qAttrExprInfo\/(\d+)/,lu=/\/qAttrDimInfo\/(\d+)/;function cu(e){return(e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t)).filter(t=>t<e.qDimensionInfo.length)}function uu(e,t){let n=t.cube;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const f=n.qEffectiveInterColumnSortOrder,h=cu(n);return ou.test(d)&&(i=!0,o=+ou.exec(d)[1],d=r.replace(ou,"")),au.test(d)&&("K"===n.qMode?c=+au.exec(d)[1]:f&&-1!==f.indexOf(-1)?(c=+au.exec(d)[1],u=0):u=+au.exec(d)[1],d=d.replace(au,"")),d&&(lu.exec(d)?s=+lu.exec(d)[1]:su.exec(d)&&(a=+su.exec(d)[1])),l=i?"S"===n.qMode?h[o]:f?f.indexOf(o):o:f&&-1!==f.indexOf(-1)?f.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function du(e,t){let n,r,i=iu(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 fu(e,t,n){let r=n.key;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 hu(e){let t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let f,h,p,m,g,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(f=e=>d.value(e,r)),"function"==typeof d.label&&(h=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),f&&(p=g.map(f),f=null),h&&(y=g.map(h),h=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=p)):(p=i,y=i)),s.fields){const e=f?f(p):p;c.push(e),u.push(h&&null!=y?h(y):null!=y?y:String(e))}else{const n=f?f(p):p;o[t[e]]={value:n,label:h?h(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const pu=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=nu(r,e);return o&&o[0]?(t.tree=Bc(o[0],n.children||(e=>e[i])),t.tree):null},mu=e=>{let t=e.propsArr,n=e.props,r=e.cube;e.cache;let i=e.itemDepthObject,o=e.f;for(let e=0;e<t.length;e++){const a=n[t[e]],s=a.fields?a.fields:[a];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==o){const e=du(i,uu(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function gu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),r=e.fields(),i=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(r.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(r.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=Ac({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map(e=>a[e]);return function(){var e,t=Zc,n=Qc;function r(r){var i,o,a,s,l,c,u,d,f=Array.from(r),h=t,p=n,m=new Map;if(null!=e){const t=f.map((t,n)=>function(e){let t=(e=`${e}`).length;return tu(e,t-1)&&!tu(e,t-2)&&(e=e.slice(0,-1)),"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(eu),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(eu(e)),f.push(Jc));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=f.length;a<i;++a)o=f[a],c=f[a]=new Yc(o),null!=(u=h(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?Xc:c)),null!=(u=p(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=f[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===Xc)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===Jc&&1===s.children.length;)s=s.children[0],--i;for(let e=f.length-1;e>=0&&(c=f[e]).data===Jc;--e)c.data=null}if(s.parent=Gc,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(Wc),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=Kc(e),r):t},r.parentId=function(e){return arguments.length?(n=Kc(e),r):n},r.path=function(t){return arguments.length?(e=Kc(t),r):e},r}().id(e=>e.__id).parentId(e=>e.__parent)(l)}(t):pu(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=cu(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const s=r.normalizeConfig(Ac(Ac({},e),{},{field:a?a.key():void 0}),t),c=s.props,u=s.main,d=Object.keys(c);l[o]={propsArr:d,props:c,main:u};const f=a?uu(a,{cube:i}):{fieldDepth:0};mu({propsArr:d,props:c,cube:i,cache:n,itemDepthObject:f,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],a=i.data,s=fu(r,a,{key:o});hu({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function yu(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(!pu(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),u=r.normalizeConfig(i[a],t),d=u.props,f=u.main,h=Object.keys(d),p=uu(c,{cube:s}),m=du({fieldDepth:0},p),g=m.nodeFn,y=m.attrFn,v=m.valueFn;mu({propsArr:h,props:d,cube:s,cache:n,itemDepthObject:p,f:c});const b=!!i[a].trackBy,x=typeof i[a].trackBy,S={},M=[],w=g(n.tree),E=[];for(let e=0;e<w.length;e++){const t=w[e],n=y?y(v(t)):v(t);if(f.filter&&!f.filter(n))continue;const o=fu(f,n,{key:l});hu({propsArr:h,props:d,item:t,itemData:n,ret:o,sourceKey:l}),b&&r.track({cfg:i[a],itemData:n,obj:o,target:M,tracker:S,trackType:x}),E.push(o)}const k=b?r.collect(M,{main:f,propsArr:h,props:d}):E;o=[...o,...k]}return o}var vu,bu,xu=(vu=function(e){
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,h=e.search(/[0-9\-\+#]/),p=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(h,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}},vu(bu={exports:{}}),bu.exports);function Su(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const Mu={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"},wu=/%\)?$/,Eu=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,ku=/^\(oct\)/i,Cu=/^\(dec\)/i,Au=/^\(hex\)/i,Ou=/^\(bin\)/i,Nu=/^\(rom\)/i,Du=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,Tu=/#|0/g;function qu(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 Iu(e,t,n){const r=Su(e);return n?r:new RegExp(r||"",t)}function Ru(e,t,n,r){let i,o,a,s,l,c,u,d,f,h=e.pattern;var p,m;r&&(e.abbreviate=!0),p=t,(m=n)&&(m=Su(m)),p&&(p=Su(p)),f=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),a=h.match(f),a=a?a[0]:"",s=a?h.substr(0,h.indexOf(a)):h,l=a?h.substring(h.indexOf(a)+a.length):"",a||(a=h?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(Iu(c,"g"),t)),u=n,n=".",u&&(a=a.replace(Iu(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=h.split(u);let y;g[1]&&(y=g[1].match(Tu)),e.prefix=s||"",e.postfix=l||"",e.pattern=h,e.maxPrecision=y?y.length:2,e.percentage=wu.test(h),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(Iu(t,null,!0),"|").concat(Iu(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class Lu{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 Mu;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 Lu(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],Du.test(e[0])&&(r.positive.isFunctional=!0),e[1]?Du.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?Du.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||Ru(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&Ru(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&Ru(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",f="",h=e;if(isNaN(e))return"".concat(h);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=function(e,t,n){let r;return Eu.test(t)?e=qu(e,Number(/\d{2}/.exec(t)[0]),t,n):ku.test(t)?e=qu(e,8,t,n):Cu.test(t)?e=qu(e,10,t,n):Au.test(t)?e=qu(e,16,t,n):Ou.test(t)?e=qu(e,2,t,n):Nu.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=xu(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=xu(l,e)}e=e.replace(u.numericRegex,e=>e===a?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+f+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function _u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.size,r=void 0===n?5e3:n,i=t.multipleArguments,o=void 0!==i&&i,a=t.toKey,s=void 0===a?e=>e:a;let l,c,u=Object.create(null),d=Object.create(null),f=0,h=0;return l=o?function(){return c=s(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=s(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(f>=r&&(delete u[d[h]],delete d[h],f--,h++),u[e]=t,d[f]=e,f++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),d=Object.create(null),f=0,h=0},l.size=()=>f,l}function Pu(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 Lu(...t)}(i,e,t,n,r),a=_u(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 zu="D",Fu="T",ju="TS",$u=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Bu=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Vu=["January","February","March","April","May","June","July","August","September","October","November","December"],Hu=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Uu(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function Wu(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}class Yu{constructor(e,t,n){const r=e||{};r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:$u,qDayNames:Bu,qLongMonthNames:Vu,qMonthNames:Hu}),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={[Fu]:r.qTimeFmt||"hh:mm:ss",[zu]:r.qDateFmt||"YYYY-MM-DD",[ju]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]),this.pattern=t}clone(){const e=new Yu(this.localeInfo,this.pattern);return e.subtype=this.subtype,e}format(e,t){t||(t=this.pattern?this.pattern:"YYYY-MM-DD hh:mm:ss"),t=t.replace(/\[.+]|\[|]/g,"");const n=/t+/gi.test(t);let r;e instanceof Date?r=function(e,t){let n=e.getUTCHours(),r=e.getUTCDay()-1;return t&&(n%=12,n||(n=12)),r<0&&(r=6),{year:e.getUTCFullYear(),month:e.getUTCMonth(),day:r,date:e.getUTCDate(),h:n,m:e.getUTCMinutes(),s:e.getUTCSeconds(),f:e.getUTCMilliseconds(),t:e.getUTCHours()>=12?"pm":"am"}}(e,n):(e<0&&(e=-e,t="-".concat(t)),r=function(e,t){let n,r=function(e){const t=e,n=24*Wu(t),r=60*Wu(n),i=60*Wu(r),o=1e3*Wu(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}(e,t));const i=(o=this,a=r,{"Y+|y+":{Y:"".concat(Number("".concat(a.year).slice(-2))),YY:Uu("".concat(a.year).slice(-2),2),YYY:Uu("".concat(a.year).slice(-3),3),def:e=>Uu("".concat(a.year),e.length)},"M+":{M:a.month+1,MM:Uu("".concat(a.month+1),2),MMM:o.locale_months_abbr[a.month],def:o.locale_months[a.month]},"W+|w+":{W:a.day,WW:Uu("".concat(a.day),2),WWW:o.locale_days_abbr[a.day],def:o.locale_days[a.day]},"D+|d+":{D:a.date,def:e=>Uu("".concat(a.date),e.length)},"h+|H+":{h:a.h,def:e=>Uu("".concat(a.h),e.length)},"m+":{m:a.m,def:e=>Uu("".concat(a.m),e.length)},"s+|S+":{s:a.s,def:e=>Uu("".concat(a.s),e.length)},"f+|F+":{def(e){let t="".concat(a.f),n=e.length-t.length;if(n>0)for(let e=0;e<n;e++)t+="0";else n<0&&(t=t.slice(0,e.length));return t}},"t{1,2}|T{1,2}":{def(e){let t=a.t;return e[0].toUpperCase()===e[0]&&(t=t.toUpperCase()),t=t.slice(0,e.length),t}}});var o,a;const s=[];for(const e in i)Object.prototype.hasOwnProperty.call(i,e)&&s.push(e);const l=new RegExp(s.join("|"),"g");return t.replace(l,e=>{let t,n,r;for(n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&(t=new RegExp(n),t.test(e)))break;if(!t)return"";for(const t in i[n])if(t===e||t.toLowerCase()===e){r=i[n][t],void 0===r&&(r=i[n][t.toLowerCase()]);break}return void 0===r&&(r=i[n].def),"function"==typeof r&&(r=r(e)),r})}}function Ku(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new Yu(...t)}function Gu(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=Ku(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=_u(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return"IV"!==t?function(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}(e):e}function o(e){return e=i(e),r(e)}return o.format=function(e,t){return r.clear(),t=i(t),n.format(t,e)},o.locale=function(i){return n=Ku(i,e,t),r=_u(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 Xu(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,c=t.sourceField;const u=s||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),d="dimension"===l?"first":"avg",f=function(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return Gu(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"),Pu(n,r,i,o,t)}(n,o),h={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=a(h)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:d,reduceLabel:"dimension"===l?"first":(e,t)=>f(t),formatter:()=>f,tags:()=>n.qTags};return h}function Ju(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:Xu(_c({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=Ju("qAttrDimInfo",t,n,a,_c({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=Ju("qAttrExprInfo",t,n,a,_c({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=Ju("qMeasureInfo",t,n,a,_c({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function Zu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i=void 0===r?{}:r;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},a=n;if(!a)throw new Error('Missing "data" input');if(!a.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=Zu.util,l={cache:o,cube:a,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},c={key:()=>t,raw:()=>a,field:e=>function(e,t){let n=t.cache;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,l),fields:()=>o.fields.slice(),extract:e=>l.extractor(e,c,o,s),hierarchy:e=>l.hierarchy(e,c,o,s),_cache:()=>o};"K"===a.qMode||"T"===a.qMode||!a.qMode&&a.qNodesOnDim?(l.extractor=yu,l.hierarchy=gu,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=jc,l.pages=a.qDataPages,l.hierarchy=gu):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,s);const u="S"===a.qMode?e=>e.qElemNumber:void 0,d="S"===a.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...Ju("qDimensionInfo",a,t,"",_c({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...Ju("qMeasureInfo",a,t,"",_c({},l,{value:d,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const f=e=>{e.forEach(e=>{o.allFields.push(e.instance),f(e.measures),f(e.attrDims),f(e.attrExps)})};return f(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=Xu(Ac({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,s),key:e.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},e.override||{}));o.virtualFields.push(r)}),o.allFields.push(...o.virtualFields),c}const Qu=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],ed=/\/qDimensionInfo(?:\/(\d+))?/,td=/\/qMeasureInfo\/(\d+)/,nd=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,rd=/\/qAttrExprInfo\/(\d+)/,id=/\/?qHyperCube/,od=/\/?qTreeData/,ad=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),sd=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function ld(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;id.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=ad):od.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=sd);let s=!0;if(ed.test(e)&&(r=+ed.exec(e)[1]),td.test(e)&&(i=+td.exec(e)[1]),nd.test(e)){i=-1,r=0;const e=+nd.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(rd.test(e)){const e=i;if(t){i=0;const a=nu(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+=+rd.exec(n)[1]}else r>-1?(r=-1,i=+rd.exec(n)[1]):i+=+rd.exec(n)[1]+1}return Qu.forEach(e=>{let t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ec(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)?Ec(e,t):void 0}}(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.")}()}(e,2),r=t[0],i=t[1];n=n.replace(r,i)}),s&&(n=a(n)),n&&"/"!==n[0]&&(n="/".concat(n)),{measureIdx:i,dimensionIdx:r,path:n}}(e.id,n);if("range"===e.type&&t.measureIdx>-1&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.multiRangeSelectTreeDataValues||(a.multiRangeSelectTreeDataValues={path:t.path,ranges:[]}),n.forEach(e=>a.multiRangeSelectTreeDataValues.ranges.push({qMeasureIx:t.measureIdx,qDimensionIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}else{if("range"===e.type&&t.measureIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.rangeSelectHyperCubeValues||(a.rangeSelectHyperCubeValues={path:t.path,ranges:[]}),n.forEach(e=>a.rangeSelectHyperCubeValues.ranges.push({qMeasureIx:t.measureIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!0}})))}if("range"===e.type&&t.dimensionIdx>-1){const n=e.brush.ranges();n.length&&(l=!0,a.selectHyperCubeContinuousRange||(a.selectHyperCubeContinuousRange={path:t.path,ranges:[]}),n.forEach(e=>a.selectHyperCubeContinuousRange.ranges.push({qDimIx:t.dimensionIdx,qRange:{qMin:e.min,qMax:e.max,qMinInclEq:!0,qMaxInclEq:!1}})))}if("value"===e.type&&t.dimensionIdx>-1)if(r)if(n&&n.qHyperCube&&("P"===n.qHyperCube.qMode||"T"===n.qHyperCube.qMode||"K"===n.qHyperCube.qMode)){const r=n.qHyperCube,o=r.qNoOfLeftDims,s=r.qEffectiveInterColumnSortOrder.indexOf(t.dimensionIdx);if(a.selectPivotCells||(a.selectPivotCells={path:t.path,cells:[]}),e.id===i||!i){const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));(0===o||s>=o)&&o>-1?n.forEach(e=>{a.selectPivotCells.cells.push({qType:"T",qCol:e,qRow:s-o})}):n.forEach(e=>{a.selectPivotCells.cells.push({qType:"L",qCol:t.dimensionIdx,qRow:e})}),l=!!a.selectPivotCells.cells.length}}else a.selectHyperCubeCells||(a.selectHyperCubeCells={path:t.path,cols:[]}),a.selectHyperCubeCells.cols.push(t.dimensionIdx),e.id!==i&&(i||a.selectHyperCubeCells.values)||(a.selectHyperCubeCells.values=e.brush.values().map(e=>+e).filter(e=>!isNaN(e)),l=!!a.selectHyperCubeCells.values.length);else{const n=e.brush.values().map(e=>+e).filter(e=>!isNaN(e));l=!!n.length,o.push({params:[t.path,t.dimensionIdx,n,!1],method:"selectHyperCubeValues"})}}}),!l&&s?[{method:"resetMadeSelections",params:[]}]:(a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]}),a.selectHyperCubeContinuousRange&&o.push({method:"selectHyperCubeContinuousRange",params:[a.selectHyperCubeContinuousRange.path,a.selectHyperCubeContinuousRange.ranges]}),a.selectHyperCubeCells&&o.push({method:"selectHyperCubeCells",params:[a.selectHyperCubeCells.path,a.selectHyperCubeCells.values,a.selectHyperCubeCells.cols]}),a.selectPivotCells&&o.push({method:"selectPivotCells",params:[a.selectPivotCells.path,a.selectPivotCells.cells]}),a.multiRangeSelectTreeDataValues&&o.push({method:"multiRangeSelectTreeDataValues",params:[a.multiRangeSelectTreeDataValues.path,a.multiRangeSelectTreeDataValues.ranges]}),o);var c}function cd(e){Zu.util=e.data("matrix").util,e.data("q",Zu),e.formatter("q-number",Pu),e.formatter("q-time",Gu)}function ud({layout:e,path:t}){const n=hc(e||{},t.split("/").join("."));if(!n)return!1;const{qIsOneAndOnlyOne:r=!1}=n;return r}function dd({brush:e,colorField:t,legendAlias:n,useLegendCube:r=!1}){!t||/qAttrDimInfo/.test(t)?(e.removeKeyAlias("attrDim/qDimensionInfo/0"),n&&e.removeKeyAlias(n),e.addKeyAlias("attrDim/qDimensionInfo/0",`qHyperCube/${t}`)):r&&e.addKeyAlias(n,`qHyperCube/${t}`)}cd.qBrushHelper=ld,cd.selections=ld;const fd="Shift";const hd=(e,t)=>t[e]?hd(e+1,t):e,pd=(e,t)=>{const n=t.reduce((e,t)=>(e[t]=!0,e),{});return e.reduce((e,t,r)=>{const i=hd(r,n);return n[i]=!0,e[r]=i,e},{})};function md({layout:e,filtered:t={}}={}){const{qDimensionInfo:n=[],qMeasureInfo:r=[]}=e?.qHyperCube||{};return{dimensions:pd(n,t.dimensions||[]),measures:pd(r,t.measures||[])}}function gd({selection:e,fieldMap:t}){const{method:n,params:r}=e;if("selectHyperCubeValues"===n){const e=t.dimensions[r[1]];void 0!==e&&(r[1]=e)}return"selectHyperCubeContinuousRange"===n&&r[1].forEach(e=>{const n=t.dimensions[e.qDimIx];void 0!==n&&(e.qDimIx=n)}),e}const yd=[];let vd=0;const bd=e=>{const t=yd.filter(e=>e.selections?.isActive());t.length&&("Enter"===e.key?t.forEach(e=>e.selections.confirm()):"Escape"!==e.key&&"Esc"!==e.key||t.forEach(e=>e.selections.cancel()))};function xd({selections:e,brush:t,majorScale:n,actions:r,selectionsFn:i}={},{path:o="/qHyperCubeDef"}={}){if(!e)return{layout:()=>{},filteredFields:()=>{},allowSimultaneous:()=>{},release:()=>{}};const a=++vd;let s=null,l={dimensions:[],measures:[]},c=[],u={};e.on=e.on.bind(e),e.isActive=e.isActive.bind(e),e.addListener=e.addListener.bind(e),e.removeListener=e.removeListener.bind(e);const{rangeInterceptor:d,interceptor:f}=function({brush:e,getConfig:t}){return{interceptor:n=>{const r=e.brushes(),{allowSimultaneous:i,layout:o={}}=t();r.forEach(t=>{("range"===t.type||n[0]?.key&&n[0]?.key!==t.id&&0!==i.indexOf(n[0]?.key))&&e.clear([])});const a=n.filter(e=>-2!==e.value);if(a.length>1){const e=function({layout:e={},values:t=[]}){if(!t?.length)return[];const n=Array.from(new Set(t.map(e=>e.key))),r=[];return n.forEach(n=>{const i=ud({layout:e,path:n}),o=t.filter(e=>e.key===n),a=i?[o.pop()]:o;r.push(...a)}),r.filter(Boolean)}({layout:o,values:a});return e}return a},rangeInterceptor:n=>{const r=e.brushes(),{allowSimultaneous:i}=t();return r.filter(e=>"value"===e.type).length?(e.clear([]),n):(r.forEach(t=>{const r=t.id===n[0].key||i.includes(t.id)&&i.includes(n[0].key);"range"!==t.type||r||e.clear([])}),n)}}}({brush:t,getConfig:()=>({layout:s,allowSimultaneous:c})});t.intercept("set-ranges",d),t.intercept("toggle-ranges",d),t.intercept("toggle-values",f),t.intercept("set-values",f),t.intercept("add-values",f),t.on("start",()=>e.begin(o));const h={activate:()=>{},deactivated:()=>t.end(),cleared:()=>t.clear(),canceled:()=>t.end()};var p,m;p=e,m=h,Object.keys(m).forEach(e=>{p.on(e,m[e])});const g=n?.max?.();return r?.select?(r.select.on("start",(...e)=>{t.start(),"function"==typeof r.select.getBrushOptions&&(u=r.select.getBrushOptions(...e))}),r.select.on("end",()=>{const n=i(t,u,s),o=md({layout:s,filtered:l});n.forEach(t=>{const n=gd({selection:t,fieldMap:o});!function(e,t,n){if(!t||void 0===n||"selectHyperCubeContinuousRange"!==e.method)return;const{params:r}=e;if(!r||!r[1]||!r[1][0])return;const{qDimIx:i,qRange:o}=r[1][0];"undefined"!==i&&o&&!1===o.qMaxInclEq&&o.qMax>=n&&(o.qMaxInclEq=!0)}(n,r.select.brushSelectionIncludeMax,g),e.select(n)})})):t.on("update",()=>{const n=i(t,u,s),r=md({layout:s,filtered:l});n.forEach(t=>{e.select(gd({selection:t,fieldMap:r}))})}),0===yd.length&&document.addEventListener("keyup",bd),yd.push({key:a,selections:e}),{layout:e=>{s=e},filteredFields:e=>{l=e},allowSimultaneous:e=>{c=e},release:()=>{s=null;const t=yd.indexOf(yd.filter(e=>e.key===a)[0]);-1!==t&&yd.splice(t,1),yd.length||document.removeEventListener("keyup",bd),((e,t)=>{Object.keys(t).forEach(n=>{e.removeListener(n,t[n])})})(e,h)}}}function Sd({chart:e,document:t,selectionInfo:n,eventName:r,componentName:i,brushName:o="selection",emit:a="rangeClear"}){const s=n.event===r,l=t.querySelector(`[data-key='${i}-edge-0']`);if(s||!l)return!1;const c=e.component(i);return!!c&&(c.emit(a),"string"==typeof o&&e.brush(o).clear(),c)}const Md=({chart:e,document:t,selections:n,selectionInfo:r,...i})=>{i.clearDiscrete(),i.clearContinuous(),i.clearMinor(),i.clearRange(),i.clearTap(),i.clearLegend()};function wd({lasso:e}){e?.active?.()&&e?.action(!1)}function Ed({chart:e,selectionInfo:t,selectionActions:n,actions:r={},selections:i,selectionEvents:o}){if(!1===n||!1===o)return()=>{};const{reset:a=wd,clear:s}=n,l=!1!==s&&function({clear:e=Md,selections:t,selectionInfo:n,chart:r}){return({cleared:i}={})=>{const o={selections:t,selectionInfo:n,chart:r,document:document,cleared:i};return e({clearDiscrete:(e={})=>function({selectionInfo:e,chart:t,document:n,eventName:r="discreteRange",componentName:i="discrete-range-brush",cleared:o=!1,brushName:a}){return Sd({selectionInfo:e,chart:t,document:n,eventName:o?void 0:r,componentName:i,emit:"areaClear",brushName:a})}({...o,...e}),clearContinuous:(e={})=>function({selectionInfo:e,chart:t,document:n,eventName:r="continuousRange",componentName:i="continuous-range-brush",cleared:o=!1,brushName:a}){return Sd({selectionInfo:e,chart:t,document:n,eventName:o?void 0:r,componentName:i,brushName:a})}({...o,...e}),clearMinor:(e={})=>function({selectionInfo:e,chart:t,document:n,componentName:r="minor-range-brush",eventName:i="minorRange",cleared:o=!1,brushName:a=!1}){const s=Sd({selectionInfo:e,chart:t,document:n,eventName:o?void 0:i,componentName:r,brushName:a});if(!s)return;const{scale:l,brush:c}=s.settings.settings,u=t.scale(l).data().fields.map(e=>e.id()),d=t.brush(c),f=d.brushes().filter(e=>"range"===e.type&&u.some(t=>t===e.id));d&&f.length&&f.forEach(e=>{d.removeRanges(e.brush.ranges().map(t=>({key:e.id,range:t})))})}({...o,...e}),clearRange:(e={})=>function({selectionInfo:e,chart:t,document:n,selections:r,eventName:i="xAxis",cleared:o=!1}){Sd({selectionInfo:e,chart:t,document:n,eventName:o?void 0:i,componentName:`${i}-range-brush`,emit:"areaClear",brushName:!1})&&r.clear()}({...o,...e}),clearTap:(e={})=>function({chart:e,selectionInfo:t,selections:n,events:r=["tap"],brushNames:i=[]}){if(!t||!r.includes(t.event))return;const{currentComponent:o,previousComponent:a}=t;a!==o&&(n.clear(),i.forEach(t=>e.brush(t).end()))}({...o,...e}),clearLegend:(e={})=>function({selectionInfo:e,chart:t,document:n,selections:r,eventName:i="legendRange",componentName:o="legend-range-brush",cleared:a=!1,brushName:s=!1}){Sd({selectionInfo:e,chart:t,document:n,eventName:a?void 0:i,componentName:o,brushName:s})&&r.clear()}({...o,...e}),...o})}}({clear:s,selections:i,selectionInfo:t,chart:e}),c=function({chart:e,actions:t,reset:n,clear:r}){let i=!1;const o={deactivated(e){const{lasso:r=!1}=t||{};n({e:e,lasso:r})},canceled(i){const{lasso:o=!1}=t||{};n({e:i,lasso:o}),r({e:i,chart:e,document:document})},cleared(t){i||(i=!0,r({e:t,chart:e,document:document,cleared:!0}),i=!1)}};return!1===n&&delete o.deactivated,!1===r&&delete o.cleared,!1===n&&!1===r&&delete o.canceled,o}({chart:e,clear:l,reset:a,actions:r}),u={};Object.entries(c).forEach(([e,t])=>{u[e]=((e,t)=>t?n=>t({event:n,defaultFunc:e}):e)(t,o[e])});const d=function({selectionEvents:e,selections:t,selectionInfo:n,clear:r,chart:i,document:o}){const{start:a}=e,s={selections:t,selectionInfo:n,chart:i,document:o},l=e=>Object.assign(n,e||{}),c=({event:e,components:t})=>()=>(({selectionInfo:e={},setSelectionInfo:t,clear:n,event:r,components:i=[]})=>{t({...e,event:r,components:i.map(e=>e.key).filter(Boolean)}),n()})({event:e,components:t,clear:r,selectionInfo:n,setSelectionInfo:l});return"function"==typeof a?(e,t=[])=>{a({defaultFunc:c({event:e,components:t}),setSelectionInfo:l,clear:r,...s,event:e,components:t})}:(e,t=[])=>{c({event:e,components:t})()}}({selectionEvents:o,selections:i,selectionInfo:t,clear:l,chart:e,document:document});return r?.select?.on("start",d),Object.entries(u).forEach(([e,t])=>{i?.on(e,t)}),function(){r?.select?.removeListener("start",d),Object.entries(u).forEach(([e,t])=>{i?.removeListener(e,t)})}}const kd=[{key:"qHyperCube/qDimensionInfo/0:numeric",includeMax:!1}];function Cd({chart:e,actions:t,selections:n,picassoQ:r,config:i}){const{allowSimultaneous:o=!1,majorScale:a,selectionActions:{clear:s,reset:l}={},selectionEvents:c={deactivated:void 0,canceled:void 0,cleared:void 0,start:void 0},brushEvents:u={},brushName:d="selection",brushMaxListeners:f=20,brushRanges:h=!1,interceptors:p={},selectionsFn:m=r.selections}=i,g=e.brush(d);if("number"==typeof f&&g.setMaxListeners(f),h){const e=!0===h?kd:h;g.configure({ranges:e})}const y={canSelect:!0,getIsSelectionLocked:!1,isInnerDimensionLocked:!1,lockedDimensions:[],singleSelectIndex:0,selectionInfo:{colorField:void 0,components:[],event:void 0,currentComponent:void 0,previousComponent:void 0}},v=xd({brush:g,majorScale:a,actions:t,selections:n,selectionsFn:m});!function({brush:e,interceptors:t={}}){Object.entries(t).forEach(([t,n])=>{(Array.isArray(n)?n:[n]).forEach(n=>{e.intercept(t,n)})})}({brush:g,interceptors:p});const b=function({chart:e,selectionActions:t,brush:n,actions:r,selectionInfo:i,selections:o,selectionEvents:a,brushEvents:s}){const l=function({brush:e,chart:t,selectionInfo:n,brushEvents:r={}}){const i=Object.entries(r).map(([r,i])=>{const o=()=>i({chart:t,selectionInfo:n});return e.on(r,o),[r,o]});return function(){i.forEach(([t,n])=>{e.removeListener(t,n)})}}({brush:n,chart:e,selectionInfo:i,brushEvents:s}),c=Ed({chart:e,selectionInfo:i,selectionActions:t,actions:r,selections:o,selectionEvents:a}),u=function({actions:e}){if(!e?.lasso)return()=>{};let t=!1;const n=n=>{t||n.key!==fd||(e.lasso.action(!0),t=!0)},r=n=>{n.key===fd&&(e.lasso.action(!1),t=!1)};return document.addEventListener("keydown",n),document.addEventListener("keyup",r),function(){document.removeEventListener("keydown",n),document.removeEventListener("keyup",r)}}({actions:r});return function(){l(),c(),u()}}({chart:e,brush:g,actions:t,selections:n,selectionInfo:y.selectionInfo,selectionActions:{clear:s,reset:l},selectionEvents:c,brushEvents:u});if(o){const e=!0===o?[...Array(15)].map((e,t)=>`qHyperCube/qMeasureInfo/${t}`):o;v.allowSimultaneous(e)}return{unbindEvents:b,state:y,picassoSelections:v,brush:g}}function Ad({chart:e,selections:t,actions:n=!1,config:r={}}){const{unbindEvents:i,state:o,picassoSelections:a,brush:s}=Cd({chart:e,actions:n,selections:t,picassoQ:cd,config:r}),{custom:l={},legendAlias:c,setBrushAliases:u=dd}=r;return{getIsDimensionLocked:(e=0)=>o.lockedDimensions[e],getIsSelectionLocked:(e=[])=>t?.isLocked?.()??function(e=[]){return!!e?.length&&e.filter(e=>"object"==typeof e.data&&Array.isArray(e.data.fields)).every(e=>e.data.fields.every(e=>{const t=e.raw();return!(!t.qLocked&&t.qCardinal)}))}(e),getIsSingleSelect:(e=o.singleSelectIndex)=>o.singleSelectDimensions[e],getCanSelect:()=>o.canSelect,getSelectionsObject:()=>t,getSelectionInfo:()=>o.selectionInfo,setLayout:e=>{const n=function({selections:e,picassoSelections:t,layout:n}){const r={lockedDimensions:[],singleSelectDimensions:[]};e?.isModal?.()&&e.confirm(),t.layout(n);const{qDimensionInfo:i=[]}=n?.qHyperCube??{};return r.lockedDimensions=i.map(e=>!!e.qLocked),r.singleSelectDimensions=i.map((e,t)=>ud({layout:n,path:`qHyperCube/qDimensionInfo/${t}`})),r.singleSelectIndex=function(e){const{qDimensionInfo:t=[]}=e?.qHyperCube||{},n=t.map((e,t)=>!(e.qLocked||e.qCardinalities?.qHypercubeCardinal<=1)&&t).filter(e=>"number"==typeof e);return n[0]??Math.max(t.length-1,0)}(n),r.canSelect=0===i.length||i.some(e=>!e.qLocked),r.dimensionLocked=!!i[0]?.qLocked,r}({selections:t,picassoSelections:a,layout:e});Object.assign(o,n)},setFilteredFields:e=>{a.filteredFields(e)},setBrushAliases:({colorField:e,useLegendCube:t=!1,...n})=>{const r={useLegendCube:t,colorField:e,brush:s,legendAlias:c,...n};u({...r,defaultFunc:()=>dd(r)})},destroy:()=>{i(),a.release()},custom:{...l}}}const Od="'Source Sans Pro', 'Arial', 'sans-serif'",Nd="#333333",Dd="#595959",Td="#737373",qd="#cccccc",Id="#e6e6e6";function Rd(e){const t={};return[...e,["","","color"],["object","","fontFamily"],["object","axis.label.name","color",Dd],["object","axis.label.name","fontFamily",Od],["object","axis.label.name","fontSize","12px"],["object","axis.line.major","color",qd],["object","axis.line.minor","color",Id],["object","axis.title","color"],["object","axis.title","fontFamily",Od],["object","axis.title","fontSize","13px"],["object","grid.line.highContrast","color",Id],["object","grid.line.major","color",qd],["object","grid.line.minor","color",Id],["object","label.value","color",Dd],["object","label.value","fontFamily",Od],["object","label.value","fontSize","12px"],[!1,"label.value","darkColor",Dd],[!1,"label.value","lightColor",Id],["object","outOfRange","color","#999"],["object","legend.title","color",Nd],["object","legend.title","fontFamily",Od],["object","legend.title","fontSize","15px"],["object","legend.label","color",Dd],["object","legend.label","fontFamily",Od],["object","legend.label","fontSize","13px"],["object","referenceLine.label.name","color",Nd],["object","referenceLine.label.name","fontFamily",Od],["object","referenceLine.label.name","fontSize","12px"],["object","referenceLine.outOfBounds","color",Id],["object","referenceLine.outOfBounds","fontFamily",Od],["object","referenceLine.outOfBounds","fontSize","12px"],["object","referenceLine.outOfBounds","backgroundColor",Td,e=>"transparent"===e?Td:e]].reduce((e,n)=>{const r=`${n[0]}-${n[1]}-${n[2]}}`;return t[r]||(t[r]=!0,e.push(n)),e},[]).sort((e,t)=>(e[0].split?e[0].split(".").length:0)-(t[0].split?t[0].split(".").length:0))}const Ld="object",_d=e=>e;function Pd({theme:e,id:t,transform:n,extend:r,matrix:i}){const o={},a=n.reduce((e,t)=>{const[n,r]=t;return e[n]=r,e},{});return i.forEach(n=>{const[r,i,s,l,c=e=>e]=n,u=function({theme:e,base:t,path:n,attribute:r,defaultValue:i}){if(!e||!1===t)return i;const o=e.getStyle(t,n,r);return void 0===o?i:o}({theme:e,base:r===Ld&&t?`${Ld}.${t}`:r,path:i,attribute:s,defaultValue:l}),d=(a[`${i}.${s}`]||_d)(c(u));mc(o,[i,s].filter(Boolean).join("."),d)}),r.forEach(e=>{const[t,n]=e;mc(o,t,n)}),o}const zd={NOOP:()=>{},FALSE:()=>!1,ARRAY:()=>[],OBJECT:()=>({})},Fd="chart-modules-tooltip",jd=`#${Fd}`;function $d(){if(!document.querySelector(jd)){const e=document.createElement("div");e.id=Fd,e.setAttribute("data-qs-css",""),e.style.overflow="hidden",e.style.position="fixed",e.style.pointerEvents="none",e.style.left="0px",e.style.top="0px",e.style.width="100%",e.style.height="100%",e.style.zIndex=1020,document.body.appendChild(e)}}function Bd({key:e,rtl:t,duration:n}){return{show:!0,key:e,type:"tooltip",layout:{displayOrder:3},beforeMount(){$d()},beforeUpdate(){$d()},destroyed(){!function(){const e=document.querySelector(jd);e?.parentElement&&e.childElementCount<1&&e.parentElement.removeChild(e)}()},settings:{appendTo:()=>document.querySelector(jd),direction:t?"rtl":"ltr",duration:n},style:{arrow:{color:"#404040"},content:{display:"table","border-spacing":"4px",background:"rgba(64, 64, 64, 0.9)",opacity:"1",fontSize:"13px",fontFamily:"'Source Sans Pro', 'Arial', 'sans-serif'","empty-cells":"show"},cell:{"max-width":"180px","word-break":"break-word","word-wrap":"break-word","overflow-wrap":"break-word",hyphens:"auto"}}}}var Vd="position",Hd={bar:"rect",diamond:"path",point:"circle",square:"rect",triangle:"path","n-polygon":"path",slice:"path"};const Ud=({data:e})=>e.value,Wd=({data:e})=>e?.major?.value;function Yd({chart:e,expando:t,nodes:n,collectConfig:r,collectibles:i,meta:o}){const{from:a}=r,s={chart:e,expando:t,nodes:n,collectConfig:r,collectibles:i,meta:o};switch("function"==typeof a?"custom":a){case"single":return function({nodes:e}){const[t]=e;if("container"===t.type&&t.children[0]){const[e]=t.children;return e.key=t.key,[e]}return[t]}(s);case"position":return function({chart:e,collectibles:t,meta:n}){return e.shapesAt(n.position.absolute,{components:t.map(e=>({key:e.key}))})}(s);case"dimension":return function({chart:e,nodes:t,collectConfig:n,collectibles:r,meta:i}){const[o]=t,{filter:a,after:s}=n,l="function"==typeof a?a:()=>!0,c="function"==typeof s?s:()=>{},u=r.reduce((t,r)=>{const a=Hd[r.type]||r.type;return t.push(...e.findShapes(a).filter(e=>e.key===r.key&&e.data&&function({collectConfig:e,meta:t,collectible:n,nodes:r}){const{by:i=Ud}=e,{major:o=Wd}=n,a=i({data:r.triggerer.data}),s=o({data:r.candidate.data,meta:t}),l=Array.isArray(a),c=Array.isArray(s);return l&&c?a.length===s.length&&a.every((e,t)=>e===s[t]):!l&&!c&&a===s}({collectConfig:n,meta:i,collectible:r,nodes:{triggerer:o,candidate:e}}))),t},[]).filter(l);return c({collected:u,triggerer:o}),u}(s);case"radius":return function({chart:e,nodes:t,collectConfig:n,collectibles:r,meta:i}){const[o]=t,{localBounds:a}=o,{distance:s,filter:l}=n,c="function"==typeof l?l:()=>!0,u=r.map(e=>e.key);return e.shapesAt({cx:i.position.absolute.x,cy:i.position.absolute.y,r:s||Math.max(a.width,a.height)},{components:u.map(e=>({key:e}))}).filter(c)}(s);case"custom":return function({chart:e,expando:t,nodes:n,collectConfig:r,meta:i}){return r.from({chart:e,expando:t,nodes:n,meta:i})}(s);default:return[]}}const{MAX_VALUE:Kd}=Number;function Gd({nodes:e}){const{xMin:t,xMax:n,yMin:r,yMax:i}=e.filter(e=>e.bounds.height+e.bounds.width!==0).reduce((e,t)=>{const{bounds:n}=t;return e.xMin=Math.min(e.xMin,n.x,n.x+n.width),e.yMin=Math.min(e.yMin,n.y,n.y+n.height),e.xMax=Math.max(e.xMax,n.x,n.x+n.width),e.yMax=Math.max(e.yMax,n.y,n.y+n.height),e},{xMin:Kd,xMax:-Kd,yMin:Kd,yMax:-Kd});return{x:t,y:r,width:n-t,height:i-r}}function Xd({chart:e,config:t,expando:n,internal:r,nodes:i}){if(!i.length)return[];const[o]=i,{key:a}=o,s=t.main.collectibles.filter(e=>!e.if||e.if());if(!s.length)return[];const{triggers:l}=t.main,{collect:c,placement:u}=l.find(e=>-1!==e.keys.indexOf(a))||{};if(!c||!c.from||!u)return[];const d={triggerer:a,position:r.get(Vd)},f=(Yd({chart:e,expando:n,nodes:i,collectConfig:c,collectibles:s,meta:d})||[]).map(e=>e.children.length?e.children[0]:e);return f.length?function({chart:e,config:t,expando:n,placementConfig:r,hovered:i,collected:o,meta:a}){const{bounds:s,key:l}=function({chart:e,config:t,expando:n,placementConfig:r,hovered:i,collected:o,meta:a}){const[s]=i,l=Array.isArray(r)?r:[r],c={bounds:s.bounds,key:s.key},u=Gd({nodes:o});for(let r=0;r<l.length;r++){const s=l[r];if("function"==typeof s){const t=s({chart:e,expando:n,hovered:i,collected:[...o],meta:a,collectedBounds:u,combineBounds:Gd});if(t)return t}if("trigger"===s)return c;if("collectible"===s){const{collectible:e}=t.main.placements;return{bounds:"function"==typeof e?e({collected:[...o]}):u,key:o[0].key}}}return c}({chart:e,config:t,expando:n,placementConfig:r,hovered:i,collected:o,meta:a}),[{desc:c}]=o;return[{bounds:s,nodes:o,data:o.map(e=>e.data),key:l,meta:a,desc:c}]}({chart:e,config:t,expando:n,placementConfig:u,hovered:i,collected:f,meta:d}):[]}const Jd=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗＡ-Ｚａ-ｚｦ-ￜ]"),Zd=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),Qd=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]"),ef=e=>Jd.test(e),tf=e=>Zd.test(e)||Qd.test(e);function nf(e){const t=e?e.length:0;for(let n=0;n<t;n++){const t=e[n];if(ef(t))return"ltr";if(tf(t))return"rtl"}return"ltr"}function rf({config:e,h:t,context:n}){const r={section:({content:e})=>function({content:e}){return{type:"section",content:e}}({content:e}),text:({value:t,style:n,survive:r,visibility:i})=>function({config:e,value:t,style:{bold:n=!1,italic:r=!1}={},survive:i,visibility:o}){const{rtl:a}=e;return{type:"text",content:[{content:t,style:{"font-weight":n?"bold":"normal","font-style":r?"italic":"normal","text-align":a?"right":"left",direction:nf(t),"white-space":"pre-wrap"},colspan:2}],survive:{visibility:!1,...i},visibility:{count:!0,force:!1,...o}}}({config:e,value:t,style:n,survive:r,visibility:i}),measure:({label:n,value:r,color:i,style:o,survive:a,visibility:s})=>function({config:e,h:t,label:n,value:r,color:i,style:o,survive:a,visibility:s}){const{rtl:l}=e,c=t("div",{style:{display:"inline-block",width:10,height:10,"background-color":i,margin:"0 8px"}});return{type:"measure",label:n,value:r,content:[{content:l?[":",n]:[n,":"],style:{"text-align":l?"right":"left","font-weight":o?.label?.bold?"bold":"normal","font-style":o?.label?.italic?"italic":"normal",direction:nf(n)}},{content:i?l?[r,c]:[c,r]:r,style:{"text-align":l?"left":"right","vertical-align":"middle","font-weight":o?.value?.bold?"bold":"normal","font-style":o?.value?.italic?"italic":"normal",direction:nf(r)}}],survive:{color:!1,duplicate:!1,visibility:!1,...a},visibility:{count:!0,force:!1,...s}}}({config:e,h:t,label:n,value:r,color:i,style:o,survive:a,visibility:s}),divider:({visibility:e}={})=>function({visibility:e}){return{type:"divider",content:[{content:"",style:{"background-image":"linear-gradient(transparent 8px, rgba(255, 255, 255, 0.4) 8px, rgba(255, 255, 255, 0.4) 9.2px, transparent 9.2px)",height:"17px"},colspan:2}],survive:{visibility:!1},visibility:{count:!1,force:!1,...e}}}({visibility:e}),row:({content:e,style:t,colspan:n,survive:r,visibility:i})=>function({content:e,style:t,colspan:n,survive:r,visibility:i}){return{type:"row",content:[{content:e,style:t,colspan:n}],survive:{visibility:!1,...r},visibility:{count:!0,...i}}}({content:e,style:t,colspan:n,survive:r,visibility:i}),raw:({value:e,survive:t,visibility:n})=>function({value:e,survive:t,visibility:n}){return{type:"raw",content:e,survive:{visibility:!1,...t},visibility:{count:!0,...n}}}({value:e,survive:t,visibility:n}),color:({nodes:r,property:i,filter:o=!0,visibility:a,fillColor:s})=>function({config:e,h:t,context:n,nodes:r,property:i,filter:o,visibility:a,fillColor:s}){const{rtl:l}=e,c={type:"color",label:void 0,value:void 0,content:[],filter:o,survive:{visibility:!1},visibility:{count:!0,...a}},u=e.getColorSettings();if("color"===u.type||!u.fieldType)return c;const[d]=r;if(c.value=function({config:e,context:t,property:n,node:r}){const i=r.data[n];if(!i)return;if(-3===r.data.value)return r.data.label;const o=t.resources.dataset(i.source.key).field(i.source.field).formatter(),{value:a,label:s}=i,l=e.getColorSettings();if(o&&"measure"===l.fieldType)return Number.isNaN(+a)?"-":o(i.value);const c=s||a;return void 0===c||Number.isNaN(c)||"NaN"===c?"-":c}({config:e,context:n,property:i,node:d}),void 0===c.value)return c;c.label=function({config:e,context:t,property:n,node:r}){const i=e.getColorSettings();if(i.label)return i.label;const o=r.data[n];if(!o||"color"===i.type)return;const{dataset:a}=t.resources,{key:s,field:l}=o.source;return a(s).field(l).title()}({config:e,context:n,property:i,node:d});const f=s??function({node:e}){const{attrs:t}=e;return t?.fill||"#ddd"}({node:d}),h=t("div",{style:{display:"inline-block",width:10,height:10,"background-color":f,margin:"0 8px"}});return c.content.push({content:l?[":",c.label]:[c.label,":"],style:{"text-align":l?"right":"left",direction:nf(c.label)}},{content:l?[c.value,h]:[h,c.value],style:{"text-align":l?"left":"right","vertical-align":"middle",direction:nf(c.value)}}),c}({config:e,h:t,context:n,nodes:r,property:i,filter:o,visibility:a,fillColor:s})};return r}function of({chart:e,translator:t,config:n,expando:r,h:i,data:o,style:a}){const[s]=o,{nodes:l}=s.node,c=function({config:e,nodes:t}){const n=t.reduce((t,n)=>{const r=e.main.getGroupByValue({data:n.data});return t[r]||(t[r]={sorting:Object.keys(t).length,items:[]}),t[r].items.push(n),t},{});return Object.keys(n).map(e=>n[e]).sort((e,t)=>e.sorting-t.sorting).map(e=>e.items)}({config:n,nodes:l}),u=function({chart:e,config:t,expando:n,h:r,context:i,groups:o}){const{meta:a}=i.node,{dataset:s,formatter:l}=i.resources,c=rf({config:t,h:r,context:i}),u=function({dataset:e}){return{dataset:{title:(t,n)=>e(t).field(n).title()}}}({dataset:s}),d=o.map(e=>{const i=c.section({content:[...(t.main.section({expando:n,h:r,nodes:e,dataset:s,formatter:l,meta:a,create:c,util:u})||[]).filter(e=>e.content?.length)].filter(Boolean)});return i.content=function({config:e,content:t}){const n=t.find(e=>"color"===e.type&&e.filter),r=n?t.filter(e=>"measure"!==e.type||e.survive.color||e.label!==n.label||e.value!==n.value):t;return e.main.showDuplicateMeasures?r:r.reduce((e,t)=>{const{type:n,survive:r}=t;if("measure"!==n||r.duplicate)return e.filtered.push(t),e;const i=`${t.label}-${t.value}`;return e.memory[i]||(e.memory[i]=!0,e.filtered.push(t)),e},{memory:{},filtered:[]}).filtered}({config:t,content:i.content}),i});return t.main.sections({chart:e,expando:n,h:r,nodes:i.node.nodes,dataset:s,formatter:l,meta:a,create:c,util:u,sections:d}),d.filter(Boolean)}({chart:e,config:n,expando:r,h:i,context:s,groups:c}),d=function({translator:e,config:t,context:n,templates:r}){const{rows:i,grouping:o,single:a}=t.main.layout,s=function({limit:e,grouping:t,single:n}){const r={count:0,overflow:0,index:{started:void 0,group:void 0},single:{found:!1,index:0}};return{process:({survive:i,visibility:o,index:a})=>{if(o.force)return!0;if(r.single.found||(r.single.found=!0,r.single.index=a),n&&a!==r.single.index)return t?(r.index.started!==a&&r.index.group!==a&&(r.overflow++,r.index.group=a),!1):(r.overflow++,!1);if(r.count>=e&&!i?.visibility){if(!t)return r.overflow++,!1;if(r.index.started!==a)return r.index.group!==a&&(r.overflow++,r.index.group=a),!1}return o.count&&r.count++,t&&(r.index.started=a),!0},overflow:()=>r.overflow}}({limit:i,grouping:o,single:"function"==typeof a?a({meta:n.node.meta,sections:r}):a}),l=r.reduce((e,t,n)=>{const{type:i,content:o=[]}=t;"section"===i&&o.forEach(t=>{s.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content)});const a=n===r.length-1;return"divider"!==i||a||s.process({survive:t.survive,visibility:t.visibility,index:n})&&e.push(t.content),e},[]).filter(e=>e.length),c=s.overflow();return c&&l.push(function({translator:e,config:t,count:n}){const r=e?e.get("Object.ChartTooltip.NMore",n):`+${n} more`,i=nf(r);return[{content:r,style:{"font-weight":"bold","text-align":t.rtl?"right":"left",direction:i},colspan:2}]}({translator:e,config:t,count:c})),l}({translator:t,config:n,context:s,templates:u});return d.length?function({h:e,style:t,rows:n}){return n.map(n=>e("tr",{},n.map(n=>{const r={style:{...t.cell||{},...n.style||{}},class:n.class};return n.colspan&&(r.colspan=n.colspan),e("td",r,n.content)})))}({h:i,style:a,rows:d}):function({h:e}){return e("tr",{},e("td",{style:{fontStyle:"italic",opacity:.75}},"Empty"))}({h:i})}const af="collected";function sf({chart:e,translator:t,config:n,expando:r,internal:i}){const{key:o}=n.main;if(!o)return!1;const a=gc(),s=Bd({key:n.main.key,rtl:n.rtl,duration:n.duration}),{afterShow:l,afterHide:c}=n.main.events.tooltip,u=()=>{const e=a.get(af);return{expando:r,nodes:e.nodes,meta:e.meta}};return ys(!0,s,{settings:{filter:t=>Xd({chart:e,config:n,expando:r,internal:i,nodes:t}),extract:e=>(a.set(af,e.node),e),content:({h:i,data:o,style:a})=>of({chart:e,translator:t,config:n,expando:r,h:i,data:o,style:a}),placement:({nodes:e})=>n.main.placement({meta:e[0].meta}),afterShow:()=>l(u()),afterHide:()=>c(u())},style:{arrow:{color:n.style.background},content:n.style}})}function lf({config:e}){const{keys:t}=e.legend;if(!t.tooltip||!t.component)return!1;const{type:n}=e.getColorSettings();if("categorical"!==n)return!1;const r=Bd({key:t.tooltip,rtl:e.rtl,duration:e.duration});return ys(!0,r,{settings:{filter:e=>e.filter(e=>e.data&&e.key===t.component),extract:e=>e,content:({h:e,data:t,style:n})=>[e("tr",{},[e("td",{style:{...n.cell||{},"font-weight":"bold","text-align":"left"},colspan:2},t[0].node.data.label)])],placement:"pointer"},style:{arrow:{color:e.style.background},content:e.style}})}function cf({config:e}){const t=e.main.triggers.reduce((e,t)=>(t.keys.forEach(n=>{const r=t.distance||0;e.distance[n]=r,e.distances.includes(r)||e.distances.push(r),e.key[n]=!0,e.keys[r]||(e.keys[r]=[]),e.keys[r].push(n)}),e),{distance:{},distances:[],key:{},keys:{}});return function({components:e}){return e.filter(e=>t.key[e.key]).reduce((e,n)=>{e.any=!0,e.components.push(n.key);const r=t.distance[n.key];return 0===r?e.position.push(n.key):(e.distances.includes(r)||(e.distances.push(r),e.distanceKeys[r]=[]),e.distanceKeys[r].push(n.key)),e},{any:!1,components:[],position:[],distances:[],distanceKeys:{}})}}const uf=()=>!0;function df({config:e}){const t=e.main.triggers.reduce((e,t)=>{const{filter:n}=t;return t.keys.forEach(t=>{e[t]="function"==typeof n?n:uf}),e},{});return e=>{const n=t[e.key];return!n||n(e)}}function ff({chart:e,event:t,component:n}){const r={absolute:{x:0,y:0},relative:{x:0,y:0}},{left:i,top:o}=e.element.getBoundingClientRect();r.absolute.x=(void 0===t.clientX?Math.floor(t.srcEvent.clientX):t.clientX)-i,r.absolute.y=(void 0===t.clientY?Math.floor(t.srcEvent.clientY):t.clientY)-o;const a=e.component(n);if(a){const{computedInner:e}=a.rect;r.relative.x=r.absolute.x-e.x,r.relative.y=r.absolute.y-e.y}return r}function hf({chart:e,filter:t,hits:n,position:r}){const i=[];if(n.position.length&&i.push(...e.shapesAt(r.absolute,{components:n.position.map(e=>({key:e}))}).filter(t)),!i.length&&n.distances.length){const o=[];n.distances.forEach(i=>{o.push(...e.shapesAt({cx:r.absolute.x,cy:r.absolute.y,r:i},{components:n.distanceKeys[i].map(e=>({key:e}))}).filter(t))}),o.length&&i.push(function({nodes:e,origin:t}){const n=e.find(e=>"path"===e.type);if(n)return n;const r=e=>{const n=Math.abs(t.x-(e.localBounds.x+e.localBounds.width/2)),r=Math.abs(t.y-(e.localBounds.y+e.localBounds.height/2));return Math.sqrt(n*n+r*r)};return e.slice(1).reduce((e,t)=>{const n=r(t);return n<e.distance&&(e.distance=n,e.node=t),e},{node:e[0],distance:r(e[0])}).node}({nodes:o,origin:r.relative}))}return i}const pf="tooltipTap";function mf({chart:e,config:t,expando:n,internal:r,facade:i}){const{tap:o}=t.delay,a=cf({config:t}),s=df({config:t}),l=t.main.triggers.reduce((e,t)=>(e.push(...t.keys),e),[]);return{key:`event:${pf}`,type:"Tap",options:{event:pf,enable:(n,r)=>!r||!!t.enable({event:r})&&e.componentsFromPoint({x:r.center.x,y:r.center.y}).filter(e=>-1!==l.indexOf(e.key)).length>0},recognizeWith:"tap",events:{[pf](l){if(l.preventDefault(),"mouse"===l.pointerType||t.main.suppress({event:l}))return;const c=e.component(t.main.key);if(!c||!c.show)return;const u=e.componentsFromPoint({x:l.center.x,y:l.center.y}),d=a({components:u});if(!d.any)return void c.emit("hide");const[f]=d.components,h=ff({chart:e,event:l,component:f});r.set(Vd,h);const p=hf({chart:e,filter:s,hits:d,position:h});if(!p.length)return void c.emit("hide");const{key:m}=p[0];t.main.events.tooltip.beforeShow({expando:n,event:l,collectNodes:()=>i.collectNodes({nodes:p}),meta:{triggerer:m,position:h}}).then(()=>{c.emit("show",l,{nodes:p,delay:o})}).catch(()=>{})}}}}function gf({chart:e,config:t,expando:n,internal:r,facade:i}){const o=cf({config:t}),a=df({config:t}),s=function({config:e,expando:t,internal:n,facade:r}){const{beforeShow:i}=e.main.events.tooltip,{hover:o}=e.delay,a={ongoing:{},latest:void 0};return function({event:e,tooltip:s,nodes:l}){const c=function({nodes:e}){return JSON.stringify(e.map(e=>({key:e.key,bounds:e.bounds,value:e.data?.value})))}({nodes:l});if(!a.ongoing[c]){a.ongoing[c]=!0,a.latest=c;const{key:u}=l[0];i({expando:t,event:e,collectNodes:()=>r.collectNodes({nodes:l}),meta:{triggerer:u,position:n.get(Vd)}}).then(()=>{c===a.latest&&s.emit("show",e,{nodes:l,delay:o})}).catch(()=>{s.emit("show")}).finally(()=>{delete a.ongoing[c],c===a.latest&&(a.latest=void 0)})}}}({config:t,expando:n,internal:r,facade:i}),l=[t.main.key,t.legend.keys.tooltip].filter(Boolean),c=()=>{l.forEach(t=>{const n=e.component(t);n?.show&&n.emit("hide")})};return{type:"native",events:{mousemove(n){if(!t.enable({event:n})||t.main.suppress({event:n}))return;const i=e.componentsFromPoint({x:n.clientX,y:n.clientY}),l=e.component(t.main.key);if(l&&l.show){const t=o({components:i});if(t.any){const[i]=t.components,o=ff({chart:e,event:n,component:i});r.set(Vd,o);const c=hf({chart:e,filter:a,hits:t,position:o});if(!c.length)return void l.emit("hide");s({event:n,tooltip:l,nodes:c})}else l.emit("hide")}const{legend:c}=t;if(c.keys.tooltip&&c.keys.component){const t=e.component(c.keys.tooltip);t&&t.show&&(i.some(e=>e.key===c.keys.component)?t.emit("show",n):t.emit("hide"))}},mouseup(e){2===e.button&&c()},mouseleave(){t.main.events.interaction.mouseleave({expando:n}),c()},wheel(){c()}}}}function yf({chart:e,translator:t,config:n}){const r=function({config:e={}}){return ys(!0,{},{rtl:!1,enable:zd.FALSE,getColorSettings:zd.OBJECT,style:{fontSize:void 0,fontFamily:void 0,color:void 0,background:void 0},delay:{hover:500,tap:0},duration:8e3,main:{key:void 0,suppress:zd.FALSE,getGroupByValue:zd.NOOP,collectibles:[],triggers:[],placement:()=>({type:"bounds"}),placements:{collectible:"combine"},showDuplicateMeasures:!1,layout:{rows:7,grouping:!1,single:!1},section:zd.ARRAY,sections:zd.NOOP,events:{tooltip:{beforeShow:()=>Promise.resolve(),afterShow:zd.NOOP,afterHide:zd.NOOP},interaction:{mouseleave:zd.NOOP}}},legend:{keys:{tooltip:void 0,component:void 0}}},e)}({config:n}),i=gc(),o=gc(),a={components:void 0,interactions:void 0};return{getComponents:()=>(a.components||(a.components=function({chart:e,translator:t,config:n,expando:r,internal:i}){return[sf({chart:e,translator:t,config:n,expando:r,internal:i}),lf({config:n})].filter(Boolean)}({chart:e,translator:t,config:r,expando:i,internal:o})),a.components),getInteractions:()=>(a.interactions||(a.interactions=function({chart:e,config:t,expando:n,internal:r}){const i=function({chart:e,config:t,expando:n,internal:r}){return{collectNodes:({nodes:i})=>{const[{nodes:o}={nodes:[]}]=Xd({chart:e,config:t,expando:n,internal:r,nodes:i});return o}}}({chart:e,config:t,expando:n,internal:r});return{gestures:[mf({chart:e,config:t,expando:n,internal:r,facade:i})],native:gf({chart:e,config:t,expando:n,internal:r,facade:i})}}({chart:e,config:r,expando:i,internal:o})),a.interactions),expando:i}}var vf={dataRelatedPropertiesPaths:["qHyperCube.qGrandTotalRow","qHyperCube.qHasOtherValues","qHyperCube.qSize","qHyperCube.qDimensionInfo[].qAttrDimInfo","qHyperCube.qDimensionInfo[].qAttrExprInfo","qHyperCube.qDimensionInfo[].qCardinalities","qHyperCube.qDimensionInfo[].qMax","qHyperCube.qDimensionInfo[].qMin","qHyperCube.qDimensionInfo[].qStateCounts","qHyperCube.qMeasureInfo[].qApprMaxGlyphCount","qHyperCube.qMeasureInfo[].qAttrExprInfo","qHyperCube.qMeasureInfo[].qMax","qHyperCube.qMeasureInfo[].qMin","qHyperCube.qMeasureInfo[].qTrendLines","qHyperCube.qTreeNodesOnDim","qSelectionInfo","plugins[].validMeasureValue","plugins[].labelBackgroundColor","plugins[].labelColor","plugins[].hasBackground","plugins[].maxLabelWidth","plugins[].points[].validMeasureValue","plugins[].points[].labelBackgroundColor","plugins[].points[].labelColor","plugins[].points[].hasBackground","plugins[].points[].maxLabelWidth"]};function bf(e){const{qHyperCube:t,...n}=e,{qAxisData:r,qDataPages:i,qStackedDataPages:o,qTreeDataPages:a,...s}=t,c=l(!0,{},{...n,qHyperCube:{...s}}),{dataRelatedPropertiesPaths:u}=vf;function d(e,t){const n=t.indexOf("[]");if(-1===n)return void(void 0!==hc(e,t)&&mc(e,t,void 0));const r=t.substring(0,n),i=t.substring(n+2),o=i.startsWith(".")?i.substring(1):i;hc(e,r,[]).forEach(e=>{o&&d(e,o)})}return u.forEach(e=>{d(c,e)}),c}var xf={axes:{trackBy:function({isTime:e,isContinuous:t,isMeasure:n,isMajor:r}){return i=>{if(e||t||n){if("line"===i.type)return i.tickValue??"axis";if("text"===i.type)return`${i.tickValue} ${i.text}`;if("container"===i.type){const e=i.children.filter(e=>"text"===e.type).map(e=>e.text);return`${i.data.value} ${e.join("")}`}return Math.random()}if(r){if("line"===i.type&&void 0===i.tickValue)return"axis";const e=i.transform&&i.transform.match(/rotate/gi)?"rotated":"horizontal";return`${i.data.group?`${i.data.group.value} `:""}${i.data.value} ${i.text} ${e}`}return Math.random()}},compensateForLayoutChanges:function({isMeasure:e,isTime:t,isContinuous:n,isHorizontal:r,dock:i}){return({currentNodes:o,currentRect:a,previousRect:s})=>{const l=a.x-s.x,c=a.y-s.y,u=a.width-s.width,d=a.height-s.height;e?("left"===i&&o.forEach(e=>{"line"===e.type?(e.x1+=u,e.x2+=u):"text"===e.type&&(e.x+=u)}),"left"!==i&&"right"!==i||o.forEach(e=>{"line"===e.type&&(e.x1===e.x2?(e.y1=a.y,e.y2=e.y1+a.height):(Math.round(e.y1)<a.y||e.y1>a.y+a.height)&&(e.strokeWidth=0)),"text"===e.type&&(e.y<a.y||e.y>a.y+a.height)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))}),"top"!==i&&"bottom"!==i||o.forEach(e=>{"line"===e.type&&(e.y1===e.y2?(e.x1=a.x,e.x2=e.x1+a.width):(Math.round(e.x1)<a.x||e.x1>a.x+a.width)&&(e.strokeWidth=0)),"text"===e.type&&(e.x<a.x||e.x>a.x+a.width)&&(e.fontSize="1px","#"===e.fill?.[0]&&(e.fill=`${e.fill.slice(0,1)}00${e.fill.slice(1)}`))})):t?o.forEach(e=>{"line"===e.type?e.y1===e.y2?e.x2+=u:e.x1===e.x2&&(e.x1-=l,e.x2-=l):"text"===e.type&&(e.x-=l)}):n||r?o.forEach(e=>{"line"===e.type&&e.y1===e.y2&&(e.x1+=l,e.x2+=l+u)}):o.forEach(e=>{"line"===e.type&&e.x1===e.x2&&(e.y1+=c,e.y2+=c+d)})}}},bars:{trackBy:function(e){return e.data.typeIndex?`${e.data.value} ${e.data.typeIndex.value}`:e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{void 0!==e.x&&void 0!==e.y?(e.x-=r,e.y-=i):e.transform=`translate(${-r}, ${-i})`})})}},barOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach(e=>{e.children&&e.children.length>0&&e.children.forEach(e=>{e.opacity=0})})}},labels:{trackBy:function(e){if("rect"===e.type)return"-3"===e.data?Math.random():`${e.type} ${e.data} ${e.rotation}`;const t=e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal";return`${e.type} ${e.data} ${e.text} ${t}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{e.transform&&e.transform.match(/rotate\(-90/gi)?(e.x+=i,e.y-=r):(e.x-=r,e.y-=i)})},linkData:function(e){return e.data.measureIndex?`${e.data.value} ${e.data.measureIndex.value}`:e.data.group?`${e.data.value} ${e.data.group.value}`:e.data.stack?`${e.data.value} ${e.data.stack.value}`:`${e.data.value}`}},lines:{trackBy:function(e){return"line"===e.type?e.value??Math.random():"path"===e.type?`${e.generatorType} ${e.layerObj.id} ${e.data.source.key}`:Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;e.forEach(e=>{if(void 0!==e.x1&&void 0!==e.y1)e.y1===e.y2?(e.x2=e.x1+t.width,e.y1-=i,e.y2-=i):e.x1===e.x2&&(e.y2=e.y1+t.height,e.x1-=r,e.x2-=r);else{const t="x"===e.major.p?r/e.major.size:i/e.major.size,n="y"===e.minor.p?i/e.minor.size:r/e.minor.size;e.points.forEach(e=>{e.modified||(e.major-=t,e.minor-=n,e.minor0-=n,e.modified=!0)})}})}},lineOobs:{compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x;0===t.y-n.y&&0===r||e.forEach(e=>{e.opacity=0})}},markers:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{switch(e.type){case"circle":e.cx-=r,e.cy-=i;break;case"rect":e.x-=r,e.y-=i;break;case"path":e.transform=`translate(${-r}, ${-i})`}})}},points:{trackBy:function(e){return e.data.line?`${e.data.line.value} ${e.data.major.value}`:`${e.data.major.value}`},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y;0===r&&0===i||e.forEach(e=>{"image"===e.type?(e.x-=r,e.y-=i):(e.cx-=r,e.cy-=i)})}},refLineLabels:{trackBy:function(e){if(void 0!==e.value){if("rect"===e.type)return`${e.value}`;if("text"===e.type)return`${e.value} ${e.text}`}return Math.random()},compensateForLayoutChanges:function({currentNodes:e,currentRect:t,previousRect:n}){const r=t.x-n.x,i=t.y-n.y,o=t.width-n.width,a=t.height-n.height;let s=-r,l=-i;e.forEach(e=>{switch(e.dock){case"right":r>0&&(s=t.width);break;case"left":o<0&&(s=-n.width);break;case"top":a<0&&(l=-n.height);break;case"bottom":i>0&&(l=t.height)}switch(e.type){case"text":case"rect":e.x+=s,e.y+=l;break;case"circle":e.cx+=s,e.cy+=l;break;case"path":e.transform=`translate(${s}, ${l})`}})}},shadowBars:{trackBy:function(){return Math.random()}},cacheProperties:function({viewCache:e,layout:t}){const n=bf(t);e.set("dataIndependentProperties",JSON.stringify(n))},propertiesHaveChanged:function({viewCache:e,layout:t}){const n=bf(t);return e.get("dataIndependentProperties")!==JSON.stringify(n)},nonUpdatingNode:{trackBy:function(){return Math.random()}}};const{getInputValue:Sf,extractInfoFromInputValue:Mf,resolveValue:wf}=lo;var Ef={resolveValue:wf,resolveInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.isGroupedByDimension){const r=Sf({refLineLayout:e,layoutService:n});return Mf(r,t,"innerValues")}},resolveNumInnerValues:({refLineLayout:e,refLineModel:t,layoutService:n})=>{if(n.meta.mode.K)return 0;const r=Sf({refLineLayout:e,layoutService:n});return Mf(r,t,"numInnerValues")||0},resolveValueText:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const{dimensionValuesInfo:r}=t,{canBeContinuous:i}=n.meta,o=Sf({refLineLayout:e,layoutService:n});return r[o]&&i?r[o].qText:o},resolveValueInfo:({refLineLayout:e,refLineModel:t,layoutService:n})=>{const r=Sf({refLineLayout:e,layoutService:n}),{dimensionRefLineInfo:i}=t;return i[r]}};function kf({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,dockService:i,animationsEnabled:o,chart:a,scale:s,axis:l,rtl:c,key:u,mainComponentKey:d,path:f,minimumLayoutMode:h}){const p=e?t.dimensionRefLines:f?t.query.getRefLines(f):t.measureRefLines;if(!p.length)return!1;const m={key:u,type:"ref-line",layout:{minimumLayoutMode:h},lines:{y:[],x:[]},style:{oob:{show:!1}},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),animations:{enabled:o,trackBy:xf.lines.trackBy,compensateForLayoutChanges:xf.lines.compensateForLayoutChanges}},g=!(!e||"horizontal"!==i.meta.major.orientation||!c),y=!e||n.meta.isContinuous;return p.forEach(o=>{m.lines[l].push((({isDimension:e,refLineLayout:t,refLineModel:n,layoutService:r,colorModel:i,dockService:o,chart:a,scale:s,axis:l,invert:c,component:u,isContinuous:d})=>{const f={dir:l,line:{strokeWidth:t?.style?.lineThickness||2,strokeDasharray:t?.style?.lineType,stroke:i.resolveUIColor(t.paletteColor||{index:t.color})}};return!e||r.meta.isContinuous?(f.scale=s,f.value=t.refLineExpr.value):(f.valueInfo=Ef.resolveValueInfo({refLineLayout:t,refLineModel:n,layoutService:r}),f.value=()=>{const e=lo.getScaledPosition({scale:a.scale(s),value:Ef.resolveValue({refLineLayout:t,refLineModel:n,layoutService:r}),valueInfo:f.valueInfo,size:a.component(u)?.rect["horizontal"===o.meta.major.orientation?"width":"height"],align:t.align,invert:c,layoutService:r,isContinuous:d});return Number.isNaN(e)?void 0:e}),f})({isDimension:e,refLineLayout:o,refLineModel:t,layoutService:n,colorModel:r,dockService:i,chart:a,scale:s,axis:l,invert:g,component:d,isContinuous:y}))}),m}function Cf({isDimension:e,refLineModel:t={},layoutService:n,colorModel:r,animationsEnabled:i,dock:o,scale:a,style:s,formatter:l,theme:c,localeInfo:u,rtl:d,key:f,path:h}){const p=e?t.dimensionRefLineLabels:h?t.query.getRefLineLabels(h):t.measureRefLineLabels;if(!p.length)return[];const m=[],g=!e||n.meta.isContinuous,y=p.map(e=>(({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:i,theme:o,isContinuous:a})=>{const s=r.resolveUIColor(e.paletteColor||{index:e.color}),{align:l,style:c}=e,{fontSize:u,fontFamily:d,fontStyle:f,fontWeight:h,textDecoration:p}=c||{},m={align:l,text:e.label,fill:e.coloredBackground?o.getContrastingColorTo(s):s,fontSize:u,fontFamily:d,fontStyle:f,fontWeight:h,textDecoration:p,showValue:!1!==e.showValue,showLabel:!1!==e.showLabel,inputValue:e.refLineExpr.value,inputValueLabel:e.refLineExpr.label};return e.coloredBackground&&(m.background={fill:s}),a?(m.scale=i,m.value=e.refLineExpr.value):(m.value=()=>Ef.resolveValue({refLineLayout:e,refLineModel:t,layoutService:n}),m.valueText=()=>Ef.resolveValueText({refLineLayout:e,refLineModel:t,layoutService:n}),m.valueInfo=()=>Ef.resolveValueInfo({refLineLayout:e,refLineModel:t,layoutService:n})),m})({refLineLayout:e,refLineModel:t,layoutService:n,colorModel:r,scale:a,theme:c,isContinuous:g}));return m.push((({isDimension:e,layoutService:t,animationsEnabled:n,style:r,labels:i,scale:o,formatter:a,dock:s,key:l,rtl:c,theme:u,isContinuous:d,localeInfo:f})=>({key:l,type:"reference-line-labels",renderer:"svg",labels:i,formatter:a,scale:o,layoutService:t,layout:{dock:s,rtl:c},theme:u,isContinuous:d,isDimension:e,localeInfo:f,style:{label:{fontFamily:r.referenceLine.label.name.fontFamily,fontSize:r.referenceLine.label.name.fontSize,fontStyle:r.referenceLine.label.name.fontStyle,fontWeight:r.referenceLine.label.name.fontWeight,textDecoration:r.referenceLine.label.name.textDecoration,padding:{top:2,bottom:2,left:c?2:4,right:c?4:2},background:{padding:{top:1,bottom:1,left:2,right:2}},maxWidth:100,gap:"left"===s||"right"===s?10:16},oob:{size:8,fill:r.referenceLine.outOfBounds.backgroundColor,text:{fontFamily:r.referenceLine.outOfBounds.fontFamily,fontSize:r.referenceLine.outOfBounds.fontSize,fill:r.referenceLine.outOfBounds.color,background:{fill:r.referenceLine.outOfBounds.backgroundColor}}}},animations:{enabled:n,trackBy:xf.refLineLabels.trackBy,compensateForLayoutChanges:xf.refLineLabels.compensateForLayoutChanges}}))({isDimension:e,rtl:d,style:s,dock:o,key:f,labels:y,scale:a,formatter:l,layoutService:n,animationsEnabled:i,theme:c,isContinuous:g,localeInfo:u})),m}function Af({layoutService:e,discreteModel:t}){const{isContinuous:n,canBeContinuous:r,isGroupedByDimension:i}=e.meta,o=e.getLayout(),a="K"===o.qHyperCube.qMode,s=S.dimensionless(o),l=lo.getMeasureRefLines(o),c=lo.getDimensionRefLines(o,s),u=lo.getMeasureRefLineLabels(o),d=lo.getDimensionRefLineLabels(o,s);let f={},h={};const p=()=>!(!c||!c.length)&&!c.every(t=>{const o=lo.getInputValue({refLineLayout:t,layoutService:e});return(t=>{if(r){const n=e.getLayoutValue("qHyperCube.qDimensionInfo.0"),{qMin:r,qMax:i}=n;return lo.isOutOfRange({value:t,qMin:r,qMax:i})}return!1})(o)||(t=>{if(!h[t])return!1;if(!n&&i){const n={valueInfo:h[t]},r="S"===e.getHyperCubeValue("qMode")?"qDataPages.0":"qStackedDataPages.0",i=e.getHyperCubeValue(r);return lo.isOutOfDataPages({label:n,dataPages:i})}return!0})(o)}),m={isKMode:a,canBeContinuous:r,measureRefLines:l,dimensionRefLines:c,measureRefLineLabels:u,dimensionRefLineLabels:d,dimensionRefLineInfo:h,dimensionValuesInfo:f,query:{getRefLines:e=>lo.getRefLines(o,e),getRefLineLabels:e=>lo.getRefLineLabels(o,e)},update:()=>{h=m.dimensionRefLineInfo,p()&&(f=lo.getDimensionValuesInfo({layout:o,canBeContinuous:r,discreteModel:t,layoutService:e}),m.dimensionValuesInfo=f,c.forEach(t=>{const n=lo.getInputValue({refLineLayout:t,layoutService:e});f[n]&&(h[n]?(h[n].innerValues=f[n].innerValues,h[n].minOrder=Math.min(h[n].minOrder,f[n].minOrder),h[n].maxOrder=Math.max(h[n].maxOrder,f[n].maxOrder),h[n].isMinOrderOk=h[n].isMinOrderOk||f[n].isMinOrderOk,h[n].isMaxOrderOk=h[n].isMaxOrderOk||f[n].isMaxOrderOk):h[n]={id:f[n].id,qText:f[n].qText,innerValues:f[n].innerValues,minOrder:f[n].minOrder,maxOrder:f[n].maxOrder,isMinOrderOk:f[n].isMinOrderOk,isMaxOrderOk:f[n].isMaxOrderOk},h[n].numInnerValues=(h[n].maxOrder||0)-(h[n].minOrder||0)+1)}))}};return m.update(),m}function Of(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?void 0:"svg"}function Nf({color:e,colorModel:t}){if(!e)return;const n=t.resolveUIColor(e);if("none"===n)return"transparent";const r=Vo(n);return r.setAlpha(e?.alpha>=0?e.alpha:1),r.isInvalid()?void 0:r.getRGBA()}function Df({point:e,dimensionValueInfo:t,layoutService:n}){const{dimensionValue:r}=e,i=""===e.measureValue?void 0:+e.measureValue;if(Vi.isNumber(i))return i;const{dimensionCount:o,measureCount:a}=n.meta;if(2===o)return 0;const s=e.measureIndex?+e.measureIndex:0;return Vi.isNumber(s)&&!(s>=a||0===o)&&1===o?t[r]?.dataNode[s+1]?.qNum:void 0}const Tf={index:-1,color:"#595959"};function qf({chart:e,chartModel:t,discreteModel:n,colorService:r,themeService:i,layoutService:o,dockService:a,rtl:s,majorScale:l,minorScale:c,mainComponentKey:u,data:d,key:f}){if(!Array.isArray(d)||0===d.length)return!1;const h={resolveUIColor:r.getMain().getPaletteColor},p=i.getTheme(),m="horizontal"===a.meta.major.orientation,g=!(!m||!s),{canBeContinuous:y,isContinuous:v,isButterfly:b}=o.meta,x=o.getLayout(),S=function({layout:e,colorModel:t}){const n=e?.components?.find(e=>"general"===e.key);if(n?.bgColor?.useColorExpression){const e=Vo(n?.bgColor?.colorExpression);return e.isInvalid()?void 0:e.getRGBA()}const r=n?.bgColor?.color;return Nf({color:r,colorModel:t})}({layout:x,colorModel:h})??p.getStyle("object","","backgroundColor"),M=lo.getDimensionValuesInfo({layout:x,canBeContinuous:y,discreteModel:n,layoutService:o}),w=v?d:d.filter(e=>!!M[e.dimensionValue]),E={},k=w.map(e=>e.dimensionValue);k.forEach(e=>{M[e]&&(E[e]?(E[e].innerValues=M[e].innerValues,E[e].minOrder=Math.min(E[e].minOrder,M[e].minOrder),E[e].maxOrder=Math.max(E[e].maxOrder,M[e].maxOrder),E[e].isMinOrderOk=E[e].isMinOrderOk||M[e].isMinOrderOk,E[e].isMaxOrderOk=E[e].isMaxOrderOk||M[e].isMaxOrderOk):E[e]={id:M[e].id,dataNode:M[e].dataNode,qText:M[e].qText,innerValues:M[e].innerValues,minOrder:M[e].minOrder,maxOrder:M[e].maxOrder,isMinOrderOk:M[e].isMinOrderOk,isMaxOrderOk:M[e].isMaxOrderOk},E[e].numInnerValues=(E[e].maxOrder||0)-(E[e].minOrder||0)+1)}),w.forEach(e=>{const t=Df({point:e,dimensionValueInfo:E,layoutService:o});if(e.validMeasureValue=b&&1===e.measureIndex?-t:t,o?.meta?.isStacked){const t=E[e.dimensionValue]?.dataNode;if(Array.isArray(t)&&void 0!==e.measureIndex){const n=t.slice(0,e.measureIndex+2),r=t[e.measureIndex+1]?.qNum;if("number"==typeof r&&0!==r){const t=Math.sign(r);e.validMeasureValue=n.reduce((e,n)=>{const r=n.qNum;return"number"==typeof r&&Math.sign(r)===t?e+r:e},0)}}}const n=Nf({colorModel:h,color:e.style?.label?.color||Tf}),r=!!e.style?.label?.coloredBackground;e.labelBackgroundColor=r?n:void 0,e.labelColor=r?i.getTheme().getContrastingColorTo(n):n,e.hasBackground=r,e.maxLabelWidth=100});const C={scale:l,fn:({datum:t})=>{const n=e.scale(l),r=t.value.dimensionValue;if(v)return n("string"==typeof r?""===r?void 0:+r:r);if(void 0===E[r])return;return lo.getScaledPosition({scale:n,value:E[r].id,valueInfo:E[r],size:e.component(u)?.rect[m?"width":"height"],align:"center",invert:g,layoutService:o,isContinuous:v})}},A={scale:c,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)},O={key:f,type:"point",data:w,settings:{x:m?C:A,y:m?A:C,strokeWidth:({datum:e})=>e.value.style?.outlineWidth??e.value.style?.lineThickness??2,stroke:({datum:e})=>Nf({colorModel:h,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),fill:({datum:e})=>e.value.style?.fill?.color?Nf({colorModel:h,color:e.value.style?.fill}):S,size:({datum:e})=>`${e.value.style?.dataPointSize??12}px`,shape:({datum:e})=>e.value.style?.symbol||"circle"},animations:{enabled:t.query.animationsEnabled,trackBy:e=>e.data.value.cId,compensateForLayoutChanges:xf.points.compensateForLayoutChanges}};return O}const If=e=>e?.qHyperCube?.qDimensionInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0,Rf=!0,Lf=!1,_f={index:0,color:"none"},Pf={index:-1,color:"#595959"},zf={index:-1,color:"#595959"},Ff=e=>{!e.dimensionValue?.qValueExpression&&e.dimensionValue?.qStringExpression&&(e.dimensionValue.qValueExpression=e.dimensionValue.qStringExpression,delete e.dimensionValue.qStringExpression)},jf=e=>{e.dimensionValue?.qValueExpression&&!e.dimensionValue?.qStringExpression&&(e.dimensionValue.qStringExpression=e.dimensionValue.qValueExpression,delete e.dimensionValue.qValueExpression)},$f=e=>{switch(e.type){case"image":break;case"point":delete e.points,delete e.style?.lineType,delete e.showPoints,delete e.style?.lineCurve;break;case"line":delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.dataPointSize,delete e.style?.fill,delete e.style?.symbol,delete e.style?.label;break;default:delete e.points,delete e.dimensionValue,delete e.measureValue,delete e.measureIndex,delete e.style?.lineType,delete e.style?.lineThickness,delete e.style?.lineColor,delete e.style?.dataPointSize,delete e.style?.fill}},Bf=({translator:e})=>({label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},dimensionNumberValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>p.canBeContinuous(n.layout)},dimensionStringValue:{ref:"dimensionValue",translation:"properties.dimensionReferenceLines.dimensionValue",component:"string",expression:"optional",defaultValue:"",show:(e,t,n)=>!p.canBeContinuous(n.layout)},measureInputType:{type:"number",component:"dropdown",translation:"properties.plugins.measureInputType",show:(e,t,n)=>1===If(n.layout),convertFunctions:{get:(e,t,n,r)=>void 0===r.measureValue?1:0,set(e,t,n,r,i){0===e?(i.measureValue=0,delete i.measureIndex):(i.measureIndex=0,delete i.measureValue)}},options:[{value:0,translation:e.get("properties.plugins.measureInputType.measureValue")},{value:1,translation:e.get("properties.plugins.measureInputType.measureIndex")}]},measureValue:{ref:"measureValue",translation:"properties.plugins.measureInputType.measureValue",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,schemaIgnore:!0,show:(e,t,n)=>void 0!==e.measureValue||2===If(n.layout)},measureIndex:{ref:"measureIndex",translation:"properties.plugins.measureInputType.measureIndex",type:"number",expressionType:"ValueExpression",expression:"optional",defaultValue:0,show:(e,t,n)=>void 0===e.measureValue&&1===If(n.layout),invalid:(e,t,n)=>e.measureIndex<0||e.measureIndex>=(e=>e?.qHyperCube?.qMeasureInfo?.filter(e=>7005!==e.qError?.qErrorCode).length||0)(n.layout)}}),Vf=e=>({symbol:{type:"string",component:"dropdown",ref:"style.symbol",translation:"Object.GridChart.Symbol",options:[{value:"circle",translation:"Object.GridChart.Symbol.Circle"},{value:"cross",translation:"Object.GridChart.Symbol.Cross"},{value:"diamond",translation:"Object.GridChart.Symbol.Diamond"},{value:"saltire",translation:"Object.GridChart.Symbol.Saltire"},{value:"square",translation:"Object.GridChart.Symbol.Square"},{value:"star",translation:"Object.GridChart.Symbol.Star"},{value:"triangle",translation:"Object.GridChart.Symbol.Triangle"}]},labelPlacement:{type:"string",component:"dropdown",ref:"label.placement",translation:"geo.properties.labelPosition",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"top",translation:"geo.properties.labelPosition.above"},{value:"bottom",translation:"geo.properties.labelPosition.below"}]},fillColor:{ref:"style.fill",translation:"properties.distributionPlot.pointColor",type:"object",component:"color-picker",disableNone:Lf,showAlpha:Rf,defaultValue:_f},lineColor:{ref:"style.lineColor",translation:"LayerStyleEditor.style.strokeColor",type:"object",component:"color-picker",disableNone:Lf,showAlpha:Rf,defaultValue:Pf},labelColor:{ref:"style.label.color",translation:"properties.plugins.label.color",type:"object",component:"color-picker",disableNone:Lf,showAlpha:Rf,defaultValue:zf},colorBackground:{ref:"style.label.coloredBackground",translation:"properties.referenceLines.coloredBackground",type:"boolean",defaultValue:!1,show:!0},outlineWidth:{component:"slider",type:"number",expression:"optional",ref:"style.outlineWidth",translation:"LayerStyleEditor.style.strokeWidth",show:!0,defaultValue:2,min:1,max:6,step:1},dataPointSize:{component:"slider",type:"number",expression:"optional",ref:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",show:!0,defaultValue:e?12:10,min:3,max:30,step:1}}),Hf=({translator:e,pluginOptions:t,supportNewStyles:n=!1})=>{const r={type:"array",ref:"plugins",filter:e=>e.filter(e=>["point","line"].includes(e.type)),translation:"properties.shapes",show:e=>(e?.qHyperCubeDef?.qDimensions||[]).length>0,itemTitleRef:e=>t.filter(t=>t.value===e.type)[0].translation+(e.label?.value?`: ${e.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,dialog:{ref:"type",options:t},add(e,t){void 0===t.plugins&&(t.plugins=[]),$f(e)},addTranslation:"properties.shapes.addShape",globalChange:(e,t,n)=>{e.plugins&&(e.plugins.forEach($f),p.canBeContinuous(n.layout)?e.plugins.forEach(e=>{switch(e.type){case"point":Ff(e);break;case"line":(e=>{e.points?.forEach(Ff)})(e)}}):e.plugins.forEach(e=>{switch(e.type){case"point":jf(e);break;case"line":(e=>{e.points?.forEach(jf)})(e)}}))},items:{point:{component:"items",show:e=>"point"===e.type,items:{dataSection:{component:"items",items:Bf({translator:e})},styleSection:{component:"items",items:Vf(n)}}},line:{type:"items",show:e=>"line"===e.type,items:{dataSection:{component:"items",items:{label:{ref:"label.value",translation:"Common.Label",component:"string",expression:"optional",defaultValue:""},points:{type:"array",ref:"points",titleTranslation:"properties.plugins.Points",itemTitleRef:(t,n)=>e.get("properties.plugins.Points.Point",n+1)+(t.label?.value?`: ${t.label.value}`:""),allowAdd:!0,allowRemove:!0,allowMove:!0,allowDuplicate:!0,addTranslation:"properties.plugins.Points.addPoint",items:{dataSection:{component:"items",items:Bf({translator:e})},styleSection:{component:"items",items:Vf(n),show:(e,t,n)=>{const r=((e,t)=>{if(!t)return null;for(let n=0;n<t.length;n+=1)if("line"===t[n].type&&t[n].points.includes(e))return t[n];return null})(e,n.properties.plugins);return r?.showPoints}}}}}},styleSection:{component:"items",items:{lineColor:{ref:"style.lineColor",translation:"Object.Table.Representation.MiniChart.Colors.Line",type:"object",component:"color-picker",disableNone:Lf,showAlpha:Rf,defaultValue:Pf},lineThickness:{component:"slider",type:"number",expression:"optional",ref:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",show:!0,defaultValue:n?3:2,min:1,max:6,step:1},lineType:{component:"dropdown",type:"string",expression:"optional",ref:"style.lineType",translation:"LayerStyleEditor.style.lineType",show:!0,defaultValue:"",options:[{value:"",translation:"LayerStyleEditor.style.solid"},{value:"8 4",translation:"LayerStyleEditor.style.dashed"}],convertFunctions:{get(e,t){const n=e(t.type);return void 0===n||""===n?"":"8 4"}}},lineCurve:{translation:"LayerStyleEditor.style.lineCurve",type:"string",ref:"style.lineCurve",component:"dropdown",defaultValue:n?"monotone":"linear",expression:"optional",options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}]}}},showPoints:{ref:"showPoints",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1}}}}};return r};var Uf=class e{constructor(e,t){this._key=e,this._value=t}getKey(){return this._key}getValue(){return this._value}equals(t){return t instanceof e&&(this._key===t._key&&this._value===t._value)}static newInstanceIfNeeded(){let t,n,r=arguments[0];return"string"==typeof arguments[1]?(t=arguments[1],n=r.length):(n=arguments[1],t=arguments[2]),t&&r?(r.length>n&&(r=r.substr(0,n)),new e(r,t)):null}},Wf=class e{setValue(e){this._nextMap=null,this._value=e}getNextNode(e){return this._nextMap?this._nextMap[e]:null}put(t,n,r){let i,o;if(t.length===n)return o=this._value,this.setValue(r),o;const a=t.charAt(n);return this._nextMap?(i=this._nextMap[a],i||(i=new e,this._nextMap[a]=i)):(this._nextMap={},i=new e,this._nextMap[a]=i),i.put(t,n+1,r)}get(e,t){if(e.length<=t)return this._value;const n=this.getNextNode(e.charAt(t));return n?n.get(e,t+1):null}getLongestMatch(e,t){if(e.length<=t)return Uf.newInstanceIfNeeded(e,this._value);const n=this.getNextNode(e.charAt(t));if(!n)return Uf.newInstanceIfNeeded(e,t,this._value);const r=n.getLongestMatch(e,t+1);return r||Uf.newInstanceIfNeeded(e,t,this._value)}},Yf=class{constructor(){this.clear()}getLongestMatch(e){return this.root&&e?this.root.getLongestMatch(e,0):null}getMaxKeyLength(){return this.maxKeyLen}clear(){this.root=null,this.maxKeyLen=0,this.size=0}put(e,t){this.root||(this.root=new Wf);const n=this.root.put(e,0,t);return n||(e.length>this.maxKeyLen&&(this.maxKeyLen=e.length),this.size++,null)}};(()=>{const e=[],t=[],n=new Yf;let r,i,o;for(r in e["&quot"]="34",e["&amp"]="38",e["&lt"]="60",e["&gt"]="62",e["&nbsp"]="160",e["&iexcl"]="161",e["&cent"]="162",e["&pound"]="163",e["&curren"]="164",e["&yen"]="165",e["&brvbar"]="166",e["&sect"]="167",e["&uml"]="168",e["&copy"]="169",e["&ordf"]="170",e["&laquo"]="171",e["&not"]="172",e["&shy"]="173",e["&reg"]="174",e["&macr"]="175",e["&deg"]="176",e["&plusmn"]="177",e["&sup2"]="178",e["&sup3"]="179",e["&acute"]="180",e["&micro"]="181",e["&para"]="182",e["&middot"]="183",e["&cedil"]="184",e["&sup1"]="185",e["&ordm"]="186",e["&raquo"]="187",e["&frac14"]="188",e["&frac12"]="189",e["&frac34"]="190",e["&iquest"]="191",e["&Agrave"]="192",e["&Aacute"]="193",e["&Acirc"]="194",e["&Atilde"]="195",e["&Auml"]="196",e["&Aring"]="197",e["&AElig"]="198",e["&Ccedil"]="199",e["&Egrave"]="200",e["&Eacute"]="201",e["&Ecirc"]="202",e["&Euml"]="203",e["&Igrave"]="204",e["&Iacute"]="205",e["&Icirc"]="206",e["&Iuml"]="207",e["&ETH"]="208",e["&Ntilde"]="209",e["&Ograve"]="210",e["&Oacute"]="211",e["&Ocirc"]="212",e["&Otilde"]="213",e["&Ouml"]="214",e["&times"]="215",e["&Oslash"]="216",e["&Ugrave"]="217",e["&Uacute"]="218",e["&Ucirc"]="219",e["&Uuml"]="220",e["&Yacute"]="221",e["&THORN"]="222",e["&szlig"]="223",e["&agrave"]="224",e["&aacute"]="225",e["&acirc"]="226",e["&atilde"]="227",e["&auml"]="228",e["&aring"]="229",e["&aelig"]="230",e["&ccedil"]="231",e["&egrave"]="232",e["&eacute"]="233",e["&ecirc"]="234",e["&euml"]="235",e["&igrave"]="236",e["&iacute"]="237",e["&icirc"]="238",e["&iuml"]="239",e["&eth"]="240",e["&ntilde"]="241",e["&ograve"]="242",e["&oacute"]="243",e["&ocirc"]="244",e["&otilde"]="245",e["&ouml"]="246",e["&divide"]="247",e["&oslash"]="248",e["&ugrave"]="249",e["&uacute"]="250",e["&ucirc"]="251",e["&uuml"]="252",e["&yacute"]="253",e["&thorn"]="254",e["&yuml"]="255",e["&OElig"]="338",e["&oelig"]="339",e["&Scaron"]="352",e["&scaron"]="353",e["&Yuml"]="376",e["&fnof"]="402",e["&circ"]="710",e["&tilde"]="732",e["&Alpha"]="913",e["&Beta"]="914",e["&Gamma"]="915",e["&Delta"]="916",e["&Epsilon"]="917",e["&Zeta"]="918",e["&Eta"]="919",e["&Theta"]="920",e["&Iota"]="921",e["&Kappa"]="922",e["&Lambda"]="923",e["&Mu"]="924",e["&Nu"]="925",e["&Xi"]="926",e["&Omicron"]="927",e["&Pi"]="928",e["&Rho"]="929",e["&Sigma"]="931",e["&Tau"]="932",e["&Upsilon"]="933",e["&Phi"]="934",e["&Chi"]="935",e["&Psi"]="936",e["&Omega"]="937",e["&alpha"]="945",e["&beta"]="946",e["&gamma"]="947",e["&delta"]="948",e["&epsilon"]="949",e["&zeta"]="950",e["&eta"]="951",e["&theta"]="952",e["&iota"]="953",e["&kappa"]="954",e["&lambda"]="955",e["&mu"]="956",e["&nu"]="957",e["&xi"]="958",e["&omicron"]="959",e["&pi"]="960",e["&rho"]="961",e["&sigmaf"]="962",e["&sigma"]="963",e["&tau"]="964",e["&upsilon"]="965",e["&phi"]="966",e["&chi"]="967",e["&psi"]="968",e["&omega"]="969",e["&thetasym"]="977",e["&upsih"]="978",e["&piv"]="982",e["&ensp"]="8194",e["&emsp"]="8195",e["&thinsp"]="8201",e["&zwnj"]="8204",e["&zwj"]="8205",e["&lrm"]="8206",e["&rlm"]="8207",e["&ndash"]="8211",e["&mdash"]="8212",e["&lsquo"]="8216",e["&rsquo"]="8217",e["&sbquo"]="8218",e["&ldquo"]="8220",e["&rdquo"]="8221",e["&bdquo"]="8222",e["&dagger"]="8224",e["&Dagger"]="8225",e["&bull"]="8226",e["&hellip"]="8230",e["&permil"]="8240",e["&prime"]="8242",e["&Prime"]="8243",e["&lsaquo"]="8249",e["&rsaquo"]="8250",e["&oline"]="8254",e["&frasl"]="8260",e["&euro"]="8364",e["&image"]="8365",e["&weierp"]="8472",e["&real"]="8476",e["&trade"]="8482",e["&alefsym"]="8501",e["&larr"]="8592",e["&uarr"]="8593",e["&rarr"]="8594",e["&darr"]="8595",e["&harr"]="8596",e["&crarr"]="8629",e["&lArr"]="8656",e["&uArr"]="8657",e["&rArr"]="8658",e["&dArr"]="8659",e["&hArr"]="8660",e["&forall"]="8704",e["&part"]="8706",e["&exist"]="8707",e["&empty"]="8709",e["&nabla"]="8711",e["&isin"]="8712",e["&notin"]="8713",e["&ni"]="8715",e["&prod"]="8719",e["&sum"]="8721",e["&minus"]="8722",e["&lowast"]="8727",e["&radic"]="8730",e["&prop"]="8733",e["&infin"]="8734",e["&ang"]="8736",e["&and"]="8743",e["&or"]="8744",e["&cap"]="8745",e["&cup"]="8746",e["&int"]="8747",e["&there4"]="8756",e["&sim"]="8764",e["&cong"]="8773",e["&asymp"]="8776",e["&ne"]="8800",e["&equiv"]="8801",e["&le"]="8804",e["&ge"]="8805",e["&sub"]="8834",e["&sup"]="8835",e["&nsub"]="8836",e["&sube"]="8838",e["&supe"]="8839",e["&oplus"]="8853",e["&otimes"]="8855",e["&perp"]="8869",e["&sdot"]="8901",e["&lceil"]="8968",e["&rceil"]="8969",e["&lfloor"]="8970",e["&rfloor"]="8971",e["&lang"]="9001",e["&rang"]="9002",e["&loz"]="9674",e["&spades"]="9824",e["&clubs"]="9827",e["&hearts"]="9829",e["&diams"]="9830",e)"function"!=typeof e[r]&&e.hasOwnProperty(r)&&(t[e[r]]=r);for(i in t)"function"!=typeof t[i]&&t.hasOwnProperty(i)&&(o=t[i].toLowerCase().substr(1),n.put(o,String.fromCharCode(i)))})(),"undefined"!=typeof document&&document.createElement("div");for(let e=0;e<255;e++)e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e.toString(16);var Kf={DATA:{MAIN:"qHyperCube",REDUCED:"reduced-data"},SCALE:{MAJOR:"main-major",MAJOR_INNER:"major-inner",MINOR:{PRIMARY:"minor-primary",SECONDARY:"minor-secondary",REDUCED_PRIMARY:"reduced-minor-primary",REDUCED_SECONDARY:"reduced-minor-secondary"},COLOR:"color",REDUCED:"reduced-major"},COMPONENT:{BAR:"bar-series",BAR_LABEL:"bar-label",BAR_OOB_LABEL:"bar-oob-label",STACK_BAR:"stack-bar",STACK_BAR_LABEL:"stack-bar-label",AXIS:{MAJOR:"major-axis",MAJOR_CONTINUOUS:"major-axis-continuous",TIME_INNER:"major-axis-time-inner",TIME_OUTER:"major-axis-time-outer",MINOR:{PRIMARY:"minor-primary-axis",SECONDARY:"minor-secondary-axis"}},AXIS_OVERLAY:{TIME_INNER:"axis-overlay-time-inner",TIME_OUTER:"axis-overlay-time-outer",CONTINUOUS:"axis-overlay-continuous"},AXIS_TITLE:{MAJOR:"major-axis-title",MINOR:{PRIMARY:"minor-primary-axis-title",SECONDARY:"minor-secondary-axis-title"}},MARKER:"marker-series",MARKER_LABEL:"marker-label",LINE:"line-series",POINT:"point-component",LABEL_SPACE:"label-space-component",POINT_LABEL:"point-label",GRID_LINE:"grid-line",ZERO_LINE:"zero-line",LEGEND:"legend",LEGEND_CATEGORICAL:"legend-cat",LEGEND_TOOLTIP:"legend-tooltip",TOOLTIP:"tooltip-qcm",MINI_CHART:{BAR:"mini-chart-bar-series",LINE:"mini-chart-line-series",MARKER:"mini-chart-marker-series"},BAR_OOB:"bar-oob",GHOST_BAR_OOB:"ghost-bar-oob",SLICED_HAT:"sliced-hat",DATA_OOB_MARKER:"data-out-of-bounds-marker",PRIMARY_MEASURE_AXIS_REF_LINE:"primary-mes-axis-ref-line",SECONDARY_MEASURE_AXIS_REF_LINE:"secondary-mes-axis-ref-line",DIMENSION_REF_LINE:"dim-ref-line",PRIMARY_MEASURE_AXIS_REF_LINE_LABEL:"primary-mes-ref-line-label",SECONDARY_MEASURE_AXIS_REF_LINE_LABEL:"secondary-mes-ref-line-label",DIMENSION_REF_LINE_LABEL:"dim-ref-line-label"},COLLECTION:{PRIMARY:"primary-collection",SECONDARY:"secondary-collection",PRIMARY_LINE:"stacked-collection-primary-line",SECONDARY_LINE:"stacked-collection-secondary-line",STACKED_PRIMARY:"stacked-collection-primary",STACKED_SECONDARY:"stacked-collection-secondary",STACKED_TOTAL_PRIMARY:"stacked-total-collection-primary",STACKED_TOTAL_SECONDARY:"stacked-total-collection-secondary",REDUCED:"reduced-collection",REDUCED_PRIMARY:"reduced-collection-primary",REDUCED_SECONDARY:"reduced-collection-secondary",REDUCED_PRIMARY_LINE:"reduced-collection-primary-line",REDUCED_SECONDARY_LINE:"reduced-collection-secondary-line",REDUCED_STACKED_PRIMARY:"reduced-collection-stacked-primary",REDUCED_STACKED_SECONDARY:"reduced-collection-stacked-secondary",LINE:"line-collection"},FORMATTER:{PRIMARY:"primary-formatter",SECONDARY:"secondary-formatter"}},Gf={LINE:"line",BAR:"bar",MARKER:"marker"},Xf={PRIMARY:0,SECONDARY:1},Jf={type:"bar",axis:0};const Zf={CUSTOM:{EXPRESSION:"customTooltipExpression",TITLE:"customTooltipTitle",DESCRIPTION:"customTooltipDescription",QUARANTINE:"customTooltip",IMAGES:"customTooltipImages"},CHART:{CONTAINER_ID:"tooltipContainerId",STATE:"customTooltipSessionState",CHART_OBJECT_ID:"customTooltipSessionObjectId",CHART_PARENT_TYPE:"TooltipChartParent",CHART_CHILD_TYPE:"TooltipChart",STYLE:{small:"140px",medium:"200px",large:"340px"}}};function Qf(e){const t=e.split("/");return"qmem:"===t[0]&&""===t[1]}const eh={getImageSize(e,t){let n;function r(){n&&(clearTimeout(n),n=null)}function i(e){const t=e;t.onload=null,t.onerror=null,r()}const o={small:50,medium:200,large:340,original:340};return new Promise(a=>{const s=new Image;s.referrerPolicy="no-referrer",s.onload=()=>{let e;const{height:n,width:l}=s,c=o[t]*(n>l?1:n/l),u=o[t]*(l>n?1:l/n);!n||!l||0===n&&0===l?(e={height:20,width:20,imageError:!0},i(s)):"original"===t?(e={height:Math.min(c,n),width:Math.min(u,l)},r()):(e={height:c,width:u},r()),a(e)},s.onerror=()=>{i(s),a({height:20,width:20,imageError:!0})},s.src=e,n=setTimeout(()=>{i(s),a({height:20,width:20,imageError:!0})},3e3)})}};async function th(e,t,n){let r=e.ref.qStaticContentUrl.qUrl;const i=function(e){let t,n,r,i,o,a;if(e&&(e.session?.options||e.enigmaModel?.session?.sessionConfig||e.session?.config?.url)){if(t=e.session.options||e.enigmaModel?.session.sessionConfig,!t){t=e.session?.config;const n=new URL(t.url);t.host=n.hostname,t.port=n.port,t.isSecure="wss:"===n.protocol}return a=void 0!==t.secure?t.secure:t.isSecure,n=a?"https://":"http://",r=t.host||"localhost",i=t.port?`:${t.port}`:"",o=t.prefix?t.prefix:"/","/"!==o[o.length-1]&&(o=`${o}/`),n+r+i+o}return""}(n);i&&(!function(e,t){const n=e.replace(t,"").replace(/^\.\.\//i,"/");n[0]}(r,i),r=r.replace(/"/g,'\\"'),r=r.replace(/'/g,"\\'"),r=function(e,t){return t+("/"===e[0]?e.substr(1):e)}(r,i));const{height:o,width:a,imageError:s}=await eh.getImageSize(r,t);return{src:r,size:t,height:o,width:a,imageError:s}}async function nh(e,t,n,r){const{app:i,flags:o}=t,a=e.layout?.tooltip?.imageComponents;if(!a)return[];const[s]=a,l=s.size||"small",c=s.type||"media";let u=-1;for(let e=0;e<n.length;e++)if(n[e].cId===s.cId){u=e;break}const d=r.data?.customTooltipAttrExps?.value||[];let f;if(-1!==u&&d[u]&&(f=d[u]),"media"===c&&s.ref?.qStaticContentUrl?.qUrl)return th(s,l,i);if("url"===c)return async function(e,t,n,r,i){let o,a=n.ref;if(i&&i.label&&(a=i.label),t.isEnabled("IMAGE_BUNDLE_LOAD")&&e?.getImage&&Qf(a))try{const t=`data:image/png;base64, ${await e.getImage(a)}`,{height:n,width:i,imageError:s}=await eh.getImageSize(t,r);o={src:t,size:r,height:n,width:i,imageError:s}}catch{}else{const{height:e,width:t,imageError:n}=await eh.getImageSize(a,r);o={src:a,size:r,height:e,width:t,imageError:n}}return o}(i,o,s,l,f);if(o.isEnabled("IMAGE_BUNDLE_LOAD")&&"field"===c&&f&&f.label){return async function(e,t,n,r){let i;const o=r.label,a=`qmem://${t.qFallbackTitle}/${o}`;if(Qf(a))try{const t=await e.getImage(a);if(t){const e=`data:image/png;base64, ${t}`,{height:r,width:o,imageError:a}=await eh.getImageSize(e,n);i={src:e,size:n,height:r,width:o,imageError:a}}}catch{}return i}(i,n[u],l,f)}return[]}const rh={async addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){const i=t,o=[];for(let t=0;t<i.length;t++)o.push(nh(e,r,n,i[t]));const a=await Promise.all(o);for(let e=0;e<i.length;e++)i[e].data.customTooltipImages=[a[e]];return i},checkIfPromisesExist({customTooltipModel:e}){const t=e.layout?.tooltip?.imageComponents;return!!t&&t.length>0}},ih={async handlePromises({customTooltipModel:e,nodes:t,attrExps:n,opts:r}){let i=t;return i=await rh.addImagesToTheNodes({customTooltipModel:e,nodes:t,attrExps:n,opts:r}),i},checkIfPromisesExist:({customTooltipModel:e})=>rh.checkIfPromisesExist({customTooltipModel:e})};const oh=(e,t)=>{const n=e?.qHyperCubeDef?.qDimensions,r=e?.qHyperCubeDef?.qMeasures,i=e?.qHyperCubeDef?.qInterColumnSortOrder,o=t;return{qInfo:{qType:Zf.CHART.CHART_PARENT_TYPE,qId:Zf.CHART.CHART_OBJECT_ID},qHyperCubeDef:{qDimensions:n,qMeasures:r,qInterColumnSortOrder:i,qInitialDataFetch:[{qWidth:0,qHeight:0}]},qStateName:o}},ah=e=>{const t=e.tooltip?.chart?.object?.refId;return{qInfo:{qType:Zf.CHART.CHART_CHILD_TYPE},qExtendsId:t}};const sh={createContainer:({ctx:e,layout:t})=>{if(!(t.qHyperCube?.qDimensionInfo?.length<=0))return function(e,t){const n=t.tooltip?.chart?.style?.size??"medium",r=Zf.CHART.STYLE[n];return[{content:[e.h("div",{style:{display:"flex",width:r,height:r,backgroundColor:"#FFFFFF",borderRadius:"5px",padding:"2px",color:"#595959"},colspan:2,id:Zf.CHART.CONTAINER_ID})],colspan:2,style:{"text-align":e.rtl?"right":"left","max-width":r}},{}]}(e,t)},show:async({app:e,properties:t,selectedNodes:n,dimIndex:r,customTooltipModel:i,rtl:o})=>{const a=i,s=t?.tooltip?.chart?.object?.refId;if(a?.embed&&e.removeSessionAlternateState&&e.addSessionAlternateState&&s&&!(t.qHyperCubeDef.qDimensions.length<=0)){await sh.hide({app:e,customTooltipModel:i});try{await async function({app:e,properties:t,customTooltipModel:n}){const r=n,i=Zf.CHART.STATE,o=t.qStateName;r.miniChartToken.alternateState||(r.miniChartToken.alternateState=i,await e.addSessionAlternateState(i,o),r.miniChartToken.alternateState=i)}({app:e,properties:t,customTooltipModel:i});const s=await async function({app:e,properties:t,customTooltipModel:n}){const r=n;r.miniChartToken.sessionObj?.id&&await e.destroySessionObject(r.miniChartToken.sessionObj.id);const i=Zf.CHART.STATE,o=oh(t,i),a=await e.createSessionObject(o),s=ah(t);if(a.id!==Zf.CHART.CHART_OBJECT_ID)return void e.destroySessionObject(a.id);r.miniChartToken.sessionObj=a;const l=await a.createChild(s);if(r.miniChartToken.sessionObj&&r.miniChartToken.sessionObj.id===a.id)return r.miniChartToken.model=l,l;e.destroySessionObject(a.id)}({app:e,properties:t,customTooltipModel:i});if(a.miniChartToken.alternateState&&a.miniChartToken.sessionObj&&s){const e=n.length>0&&void 0!==n[0].data?.value?[n[0].data?.value]:[],s=void 0!==r?r:t.qHyperCubeDef.qDimensions.length-1;if(2===t.qHyperCubeDef.qDimensions.length&&void 0===r&&n.length>0){const e=n[0].data.selectionOuterDimension??n[0].data.selectionDimension;if(e?.source?.field){const t=e?.source?.field.split("/"),n=t[t.length-1],r=void 0!==e.value?[e.value]:[];r.length>0&&void 0!==n&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",Number(n),r,!1)}}e.length>0&&a.miniChartToken.sessionObj.selectHyperCubeValues("/qHyperCubeDef",s,e,!1);const l=document.getElementById(Zf.CHART.CONTAINER_ID),c={direction:o?"rtl":"ltr",isReadonly:!0,isPopover:!0,navigation:!1,selections:!1};a.miniChartToken.vis=await i.embed.render({element:l,model:a.miniChartToken.model,options:c,id:a.miniChartToken.model?.id,type:a.miniChartToken.model?.genericType})}}catch{await sh.hide({app:e,customTooltipModel:i})}}},hide:async({app:e,customTooltipModel:t})=>{const n=t;n?.embed&&(sh.destroyVisualization({customTooltipModel:t}),await e.destroySessionObject(Zf.CHART.CHART_OBJECT_ID),n.miniChartToken.sessionObj=void 0,await async function({app:e,customTooltipModel:t}){const n=t,r=Zf.CHART.STATE;n.miniChartToken.alternateState=void 0,await e.removeSessionAlternateState(r)}({app:e,customTooltipModel:t}))},destroyVisualization:({customTooltipModel:e})=>{const t=e;"function"==typeof t.miniChartToken?.vis?.destroy&&(t.miniChartToken.vis.destroy(),t.miniChartToken.vis=void 0)}};function lh(e){const t=e.qHyperCubeDef?e.qHyperCubeDef.qDimensions:e.qHyperCube.qDimensionInfo;if(t&&t.length>0)return t}function ch(){const{EXPRESSION:e,TITLE:t,DESCRIPTION:n,IMAGES:r}=Zf.CUSTOM,i={};return i[e]=!0,i[t]=!0,i[n]=!0,i[r]=!0,i}function uh(e){const t=ch();return e.filter(e=>t[e.id])}const dh={getNodes(e,t){const n=function(e,t){let n=0,r=0;e.center?(n+=e.center.x,r+=e.center.y):(n+=e.clientX,r+=e.clientY);const i=t.element.getBoundingClientRect();return{cx:n-i.left,cy:r-i.top}}(e,t);return t.shapesAt({x:n.cx,y:n.cy})},getDataNodes(e,t){let n,r=[];const i={container:{bar:!0,"bullet-axis":!0},circle:{"point-component":!0}};return t.forEach(t=>{const o=t.data?.selectionDimension??t.data;if(!o||t.data?.customTooltipAttrExps||i[t.type]){if(t.data?.customTooltipAttrExps&&!t.data.customTooltipImages){const e=t;e.data.customTooltipImages=[],r.push(e)}}else{n||(n=[],Object.keys(i).forEach(t=>{n=n.concat(e.findShapes(t).filter(e=>e.data&&e.data.customTooltipAttrExps&&!e.data.customTooltipImages&&i[t][e.key]))}));const t=n.filter(e=>{const t=e.data.stack??e.data.selectionOuterDimension??e.data.selectionDimension;return t&&t.value===o.value&&t.label===o.label});t.length>0&&(r=r.concat(t[0]))}}),r},displayTooltip(e,t,{nodes:n,opts:r={},customTooltipModel:i,extractedNodes:o=[],hide:a}){if(i&&!a){const{layout:a,chart:s}=i,{attrExps:l}=dh.getAttrExprData(a);o.length||n.length?ih.handlePromises({customTooltipModel:i,nodes:dh.getDataNodes(s,o.length>0?o:n),attrExps:l,opts:r}).then(()=>{t.emit("show",e,n.length?{nodes:n}:void 0)}):t.emit("show",e,n.length?{nodes:n}:void 0)}else i?.miniChartToken?.alternateState&&sh.hide({app:r.app,customTooltipModel:i}),t.emit("hide")},checkIfPromisesExist:({customTooltipModel:e})=>ih.checkIfPromisesExist({customTooltipModel:e}),getAttrExps(e,t){const n=t,r=e.qHyperCubeDef?.qDimensions?"qAttributeExpressions":"qAttrExprInfo";return n[r]||(n[r]=[]),n[r]},getAttrExprData(e){let t=[],n="";const r=e.qHyperCube?.qDimensionInfo||[];if(r.length>0){const i=r.length-1;t=e.qHyperCube?.qDimensionInfo?.[i]?.qAttrExprInfo||[],n=`qDimensionInfo/${i}/qAttrExprInfo`}return{attrExps:t,fieldPath:n}},quarantineCustomTooltipAttrs(e,t={}){const n=e.qLayoutExclude?.quarantine?.[Zf.CUSTOM.QUARANTINE];if(!n){!function(e,t){const n=t;let r=n.qLayoutExclude;r||(n.qLayoutExclude={quarantine:{}},r=n.qLayoutExclude),r.quarantine||(r.quarantine={}),r.quarantine[Zf.CUSTOM.QUARANTINE]=[],e.forEach(e=>{r.quarantine[Zf.CUSTOM.QUARANTINE].push(e)}),n.qLayoutExclude=r}(uh(t.qAttributeExpressions||[]),e)}},unquarantineCustomTooltipAttrs(e){const t=e,n=e.qLayoutExclude?.quarantine?.[Zf.CUSTOM.QUARANTINE];n&&delete t.qLayoutExclude.quarantine[Zf.CUSTOM.QUARANTINE]},setAttrsFromQuarantine(e,t){const n=lh(e);if(!n)return;const r=void 0!==t?t:n.length-1;if(!n[r])return;const i=this.getAttrExps(e,n[r]);if(0===uh(i).length){const t=e.qLayoutExclude?.quarantine?.customTooltip||[],n=[...i,...t],o=e;o.qHyperCubeDef?o.qHyperCubeDef.qDimensions[r].qAttributeExpressions=n:o.qHyperCube.qDimensionInfo[r].qAttrExprInfo=n}},moveCustomTooltipAttrs(e,t={},n=void 0){let r=[];const i=lh(e)||[];[...i,t].forEach(e=>{const t=uh(e.qAttributeExpressions||[]);t.length>0&&(r=t)});const o=ch(),a=i.map(e=>{const t=e,n=e.qAttributeExpressions||[];return t.qAttributeExpressions=n.filter(e=>!o[e.id]),t}),s=void 0!==n?n:a.length-1;a.length>0&&(a[s].qAttributeExpressions=a[s].qAttributeExpressions.concat(r));const l=e;e.qHyperCubeDef?l.qHyperCubeDef.qDimensions=a:l.qHyperCube.qDimensionInfo=a},addCallbackCustomTooltip(e){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e):(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},moveCallbackCustomTooltip(e,t){1===e.qHyperCubeDef.qDimensions.length&&(this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e)),e.qHyperCubeDef.qDimensions.length>1&&this.moveCustomTooltipAttrs(e,t)},removeCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>0?this.moveCustomTooltipAttrs(e,t):this.quarantineCustomTooltipAttrs(e,t)},replaceCallbackCustomTooltip(e,t){e.qHyperCubeDef.qDimensions.length>1?this.moveCustomTooltipAttrs(e,t):(this.quarantineCustomTooltipAttrs(e,t),this.setAttrsFromQuarantine(e),this.unquarantineCustomTooltipAttrs(e))},shouldIgnoreDefaultRows:e=>e.tooltip?.hideBasic||0,DEBOUNCE_THRESHOLD:50,getFooterRow:(e,t)=>[{content:e,style:{"font-style":"italic","font-size":"12px","line-height":"16px",color:"rgba(255, 255, 255, 0.6)","text-align":t?"right":"left",direction:T.detectTextDirection(e)},colspan:2},{}],getImageRow(e,t){const n=T.detectTextDirection(e.src),r=[],i={style:{display:"block","margin-left":"auto","margin-right":"auto",overflow:"hidden",width:e.width,height:e.height}};if("original"===e.size||e.imageError){r.push(t.h("span",{style:{display:"inline-block",height:"100%","vertical-align":"middle"}}));const n=e.imageError?`${e.src}?${Math.random()}`:e.src;r.push(t.h("img",{style:{"max-width":e.width,"max-height":e.height,"vertical-align":"middle"},src:n,referrerpolicy:"no-referrer"})),i.style["text-align"]="center",i.style["white-space"]="nowrap"}else i.style["background-size"]="contain",i.style["background-repeat"]="no-repeat",i.style["background-position"]="center",i.style["background-image"]=`url('${e.src}')`;return[{content:[t.h("div",i,r),""],style:{"text-align":t.rtl?"right":"left",direction:n,"max-width":e.width},colspan:2},{}]}};function fh(e,t,n,r){const i=t.qHyperCube?.[n]?.[r]?.qAttrExprInfo||[],o=[],a=e.qSubNodes&&e.qSubNodes[r]?e.qSubNodes[r].qAttrExps:e.qAttrExps;return a?(i.forEach((e,t)=>{const i=a.qValues&&a.qValues[t]?a.qValues[t]:void 0,s=void 0===i?"NaN":function(e,t){let n;switch(e.id){case Zf.CUSTOM.EXPRESSION:n="NaN"===t.qNum||e.isCustomFormatted?void 0===t.qText?"NaN":t.qText:t.qNum;break;case Zf.CUSTOM.TITLE:case Zf.CUSTOM.DESCRIPTION:case Zf.CUSTOM.IMAGES:n=void 0===t.qText?e.qFallbackTitle:t.qText;break;default:n="NaN"}return n}(e,i);o.push({source:{key:"qHyperCube",field:`${n}/${r}/qAttrExprInfo/${t}`},label:s,value:"value"})}),o):o}const hh={getNode(e,{dimensionCount:t}){if(!t||t<1)return;const n=t-1,r="qDimensionInfo";return{field:`${r}/${n}`,value:t=>fh(t,e,r,n)}}};const ph={getCustomAttrExps(e,t,n){const r={customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]},i=t.data?.customTooltipAttrExps?.value||[];if(Number.isNaN(i))return r;return function(e,t,n,r){const i={[Zf.CUSTOM.TITLE]:!0,[Zf.CUSTOM.DESCRIPTION]:!0},{attrExps:o,fieldPath:a}=dh.getAttrExprData(e);return 0===t.length||0===o.length||""===a||o.forEach((e,o)=>{const s=t[o];if(e.id===Zf.CUSTOM.EXPRESSION&&s){const t=e.qFallbackTitle,i="NaN"===s.value||e.isCustomFormatted?s.value:n("qHyperCube").field(`${a}/${o}`).formatter()(s.value);r.customTooltipAttrExpsArr.push({label:t,value:i})}else if(i[e.id]&&s){const t="-"!==s.value&&"NaN"!==s.value?s.value:s.label;t&&"undefined"!==t&&r.customTooltipInfoAttrExpsArr.push({...e.id===Zf.CUSTOM.TITLE&&{title:t},value:t,id:e.id})}}),r}(n,i.map(t=>q.getMeasure(e,t)),e,r)}};function mh({nodes:e,layout:t,dataset:n}){const r=function(e,t,n){const r=[];return e.forEach(e=>{r.push(ph.getCustomAttrExps(n,e,t))}),r}(e,t,n);return r.reduce((e,t)=>({customTooltipAttrExpsArr:e.customTooltipAttrExpsArr.concat(t.customTooltipAttrExpsArr),customTooltipInfoAttrExpsArr:e.customTooltipInfoAttrExpsArr.concat(t.customTooltipInfoAttrExpsArr)}),{customTooltipAttrExpsArr:[],customTooltipInfoAttrExpsArr:[]})}const{CUSTOM:gh}=Zf;function yh({flags:e,layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l,options:c}){const u={properties:void 0},d=function({layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,embed:s}){return{layout:e,app:t,picasso:n,model:r,chart:i,translator:o,localeInfo:a,useCustomTooltip:e.tooltip&&!e.tooltip.auto,utils:dh,miniChartToken:{},embed:s}}({layout:t,app:n,model:r,picasso:i,chart:o,translator:a,localeInfo:s,embed:l}),f="rtl"===c.direction,h=()=>{const e=!!u.properties?.qHyperCubeDef?.qDimensions.some(e=>e.qCalcCondition?.qCond?.qv);return!(!t.tooltip||t.tooltip.auto||e)};return{setProperties:e=>{u.properties=e},isEnabled:()=>h(),hideBasic:()=>h()&&hc(t,"tooltip.hideBasic",!1),getAttributes:({dataset:e,nodes:n})=>{const r=mh({dataset:e,nodes:n,layout:t});return{title:r.customTooltipInfoAttrExpsArr.find(e=>e.id===gh.TITLE)?.title,description:r.customTooltipInfoAttrExpsArr.find(e=>e.id===gh.DESCRIPTION)?.value,measures:r.customTooltipAttrExpsArr}},hasImages:()=>dh.checkIfPromisesExist({customTooltipModel:d}),createImageRow:({value:e,h:t})=>dh.getImageRow(e,{h:t,rtl:f}),addImages:({nodes:r})=>{const i=dh.getDataNodes(o,r),{attrExps:a}=dh.getAttrExprData(t);return ih.handlePromises({customTooltipModel:d,nodes:i,attrExps:a,opts:{flags:e,app:n}})},chart:{isEnabled:()=>!!(h()&&t.tooltip?.chart?.object?.refId&&l&&"function"==typeof r?.getEffectiveProperties),hasLimitation:()=>!!n?.isInModalSelection?.(),createContainer:({h:e})=>sh.createContainer({layout:t,ctx:{h:e,rtl:f}}),createLimitationRow:()=>dh.getFooterRow(a.get("properties.tooltip.notselectedmessage"),f),show:({nodes:e,properties:t})=>sh.show({app:n,properties:t,selectedNodes:e,customTooltipModel:d,rtl:f}),hasAlternateState:()=>!!d.miniChartToken?.alternateState,hide:()=>sh.hide({app:n,customTooltipModel:d}),destroy:()=>sh.destroyVisualization({customTooltipModel:d})}}}function vh({key:e,source:t,layoutService:n,fieldModel:r,colorService:i,series:o}){const{meta:a}=n;if(a.isBarSeriesStacked){const{major:a,majorNumeric:s}=r.main,l=o.filter(e=>e.type===Gf.BAR),c=n.meta.isContinuous?s:a,u=e=>"NaN"!==e.qNum?e.qNum:0;return[{key:e,data:{extract:l.map(({ref:e,typeIndex:r,refIndex:o})=>({source:t,field:a,value:n.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:c},selectionDimension:{field:a},segment:{field:e,value:u,reduceLabel:"none"},end:{field:e,value:u,reduceLabel:"none"},null:{fields:l.map(e=>({field:e.ref})),value:e=>Array.isArray(e)&&e.every(e=>"NaN"===e),reduceLabel:"none"},typeIndex:r,...i.getDatumProps(o),customTooltipAttrExps:hh.getNode(n.getLayout(),n.meta),sumOfPositives:{fields:l.map(e=>({field:e.ref})),value:e=>e.reduce((e,t)=>t>0?e+t:e,0),reduceLabel:"none"},sumOfNegatives:{fields:l.map(e=>({field:e.ref})),value:e=>e.reduce((e,t)=>t<0?e+t:e,0),reduceLabel:"none"}}})),stack:{stackKey:e=>e.value,value:e=>e.end.value,offset:"diverging"}}}]}return[]}function bh({key:e,series:t,source:n,fieldModel:r,colorService:i,layoutService:o,forceCreate:a=!1,isLineSeries:s=!1}){if(t.length||a){const{major:a,majorNumeric:l}=r.main,{isContinuous:c,isLineStacked:u}=o.meta,d=e=>"NaN"!==e.qNum?e.qNum:0,f=c?l:a,h=o.getLayoutValue("separateStacking",!0),p=[{key:e,data:{extract:t.map(({ref:e,refIndex:t,typeIndex:r,options:s},l)=>({source:n,field:a,value:c?e=>e.qNum:void 0,props:{major:{field:f},selectionDimension:{field:a},end:{field:e,value:s.showAsZeros?d:void 0,reduceLabel:"none"},start:0,line:l,typeIndex:r,null:{field:e,value:e=>"NaN"===e.qNum,reduceLabel:"none"},customTooltipAttrExps:hh.getNode(o.getLayout(),o.meta),...i.getDatumProps(t)}}))}}];return s&&u&&(p[0].data.stack={stackKey:e=>e.value,value:e=>e.end.value,offset:h?"diverging":"none"},t.forEach((e,t)=>{const{props:n}=p[0].data.extract[t];n.point={field:n.end.field,label:n.end.label},n.end.value&&(n.point.value=n.end.value)})),p}return[]}function xh({key:e,layoutService:t,fieldModel:n,series:r}){const{meta:i}=t;if(i.isBarSeriesStacked){const{major:t,majorNumeric:o}=n.main,a=r.filter(e=>e.type===Gf.BAR),s=i.isContinuous?{field:o,value:e=>e.qNum,reduceLabel:"none"}:[];return[{key:e,data:{extract:{field:0,props:{major:{field:i.isContinuous?o:t},null:{fields:a.map(e=>({field:e.ref})),value:e=>Array.isArray(e)&&e.every(e=>"NaN"===e),reduceLabel:"none"},sumOfPositives:{fields:a.map(e=>({field:e.ref})),value:e=>e.reduce((e,t)=>t>0?e+t:e,0),reduceLabel:"none"},sumOfNegatives:{fields:a.map(e=>({field:e.ref})),value:e=>e.reduce((e,t)=>t<0?e+t:e,0),reduceLabel:"none"},timeStart:s,timeEnd:s},value:i.isContinuous?e=>e.qNum:void 0}}}]}return[]}const Sh={MINI_CHART:{value:"miniChart"},BAR:{value:"bar"},NONE:{value:"none"}};var Mh={OPTIONS:Sh,DEFAULT:Sh.MINI_CHART};function wh({layoutService:e,discrete:t}){return({h:n,rect:r,orientation:i,minThumbSize:o})=>{const a=t.query.getCurrentDataPage(),s=e.meta.size.y,l="horizontal"===i,c=r[l?"width":"height"];let u=a.qArea.qTop/s*c,d=a.qArea.qHeight/s*c;if(d<o){const e=(o-d)/2;u=u-e+(Math.max(0,0-(u-e))-Math.max(0,u+d+e-c)),d=o}return n("div",{style:{position:"absolute",right:0,bottom:0,background:"red",opacity:.2,...l?{top:0,left:u,width:d}:{top:u,left:0,height:d}}})}}function Eh({layoutService:e,viewState:t,viewCache:n}){return e.meta.isContinuous?function(e,t){const n=e.get("zoom"),r=t.get("continuousMin"),i=t.get("continuousMax");return[(n.min-r)/(i-r),(n.max-r)/(i-r)]}(t,n):function(e){return e.get("viewRange")}(t)}const kh=e=>({miniChart:e===Mh.OPTIONS.MINI_CHART.value,bar:e===Mh.OPTIONS.BAR.value,none:e===Mh.OPTIONS.NONE.value});function Ch({layoutService:e,override:t}){const n=(({layoutService:e})=>{const t=e.getLayoutValue("scrollbar");if(t)return kh(t);const n=e.getLayoutValue("showMiniChartForContinuousAxis");if(void 0===n)return kh(Mh.DEFAULT.value);const r=e.getLayoutValue("dimensionAxis.continuousAuto"),i=e.getLayoutValue("preferContinuousAxis");return kh(!n&&(r||!r&&i)?Mh.OPTIONS.NONE.value:Mh.OPTIONS.MINI_CHART.value)})({layoutService:e});return t&&t.predicate({layoutService:e,scrollbar:n})&&(n.miniChart=t.value===Mh.OPTIONS.MINI_CHART.value,n.bar=t.value===Mh.OPTIONS.BAR.value,n.none=t.value===Mh.OPTIONS.NONE.value),n}function Ah({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o,rtl:a}){return s=>{const{x:l,y:c}=s.center,u=t.element.getBoundingClientRect(),d=t.component(e),f="horizontal"===o.meta.major.orientation,h=f?l-u.left-d.rect.computedInner.x:c-u.top-d.rect.computedInner.y,p=f?d.rect.computedInner.width:d.rect.computedInner.height,m=f&&a?p-h:h,g=Math.max(0,Math.min(m/p,1)),[y,v]=Eh({layoutService:i,viewState:n,viewCache:r}),b=g<y,x=g>v,S=!b&&!x;return{pixel:m,relative:g,thumb:S?m-y*p:0,beforeThumb:b,afterThumb:x,onThumb:S}}}function Oh({componentKey:e,chart:t,viewState:n,viewCache:r,layoutService:i,dockService:o}){return()=>{const a=t.component(e),{orientation:s}=o.meta.major,{width:l,height:c}=a.rect.computedInner,u="horizontal"===s?l:c,[d,f]=Eh({layoutService:i,viewState:n,viewCache:r});return{size:u,thumbSize:(f-d)*u}}}function Nh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const c=Ah({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),u=Oh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Tap",options:{event:"scrollbarTap",enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e)},events:{scrollbarTap(n){n.preventDefault();const a=c(n);if(o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;r.set("zoom",{min:Math.min(s-t/2,o-t),max:Math.max(s+t/2,n+t)})}else{const e=u(),t=a.pixel-e.thumbSize/2,n=Math.max(0,t/e.size);s.command.scrollTo(n)}t.component(e).emit("render")}}}}const Dh="data-scrollbar-handle";function Th({e:e}){return(e.srcEvent||e).srcElement.getAttribute(Dh)||""}const qh="scrollbarResize";function Ih({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s}){const l=Ah({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:s});return{type:"Pan",key:`event:${qh}`,options:{event:qh,threshold:0,enable(e,t){return!(!o.meta.isContinuous||!n.scroll.enabled())&&(!t||(this[qh]=this[qh]||{},(e=>{const[t]=e.changedPointers;return t&&("pointerdown"===t.type||"mousedown"===t.type)})(t)&&Th({e:t})&&(this[qh].panningEvent=t.srcEvent),!!this[qh].panningEvent))}},events:{[`${qh}start`](n){n.preventDefault(),this[qh]=this[qh]||{},this[qh].panningEvent&&t.component(e).emit("dragStart",this[qh].panningEvent)},[`${qh}move`](n){if(n.preventDefault(),this[qh]=this[qh]||{},!this[qh].panningEvent)return;const o=r.get("zoom"),a=i.get("continuousMin"),s=i.get("continuousMax"),c=i.get("minimiumZoomSpan"),u=(s-a)*l(n).relative+a,d=Th({e:this[qh].panningEvent});let f="start"===d?Math.min(u,o.max):o.min,h="end"===d?Math.max(u,o.min):o.max;f===h&&(f-="start"===d?c:0,h+="end"===d?c:0),r.set("zoom",{min:f,max:h}),t.component(e).emit("render")},[`${qh}end`](n){n.preventDefault(),this[qh]=this[qh]||{},delete this[qh].panningEvent,t.component(e).emit("dragEnd")},[`${qh}cancel`](n){n.preventDefault(),this[qh]=this[qh]||{},delete this[qh].panningEvent,t.component(e).emit("dragEnd")}}}}const Rh="scrollbarPan";function Lh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){const c=Ah({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),u=Oh({componentKey:e,chart:t,viewState:r,viewCache:i,layoutService:o,dockService:a});return{type:"Pan",key:`event:${Rh}`,options:{event:Rh,threshold:0,enable(r,i){return this[Rh]=this[Rh]||{},!(i&&!this[Rh].isPanning)||!!n.scroll.enabled()&&((!i||i.target===t.element)&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e))}},events:{[`${Rh}start`](n){n.preventDefault();const a=c(n);if(this[Rh]=this[Rh]||{},this[Rh].isPanning=!0,t.component(e).emit("lockState"),o.meta.isContinuous){const e=r.get("zoom"),t=e.max-e.min,n=i.get("continuousMin"),o=i.get("continuousMax"),s=n+(o-n)*a.relative;s<e.min?r.set("zoom",{min:Math.min(s,o-t),max:Math.max(s+t,n+t)}):s>e.max&&r.set("zoom",{min:Math.min(s-t,o-t),max:Math.max(s,n+t)}),this[Rh].relative=a.relative,this[Rh].zoom=r.get("zoom"),this[Rh].zoom.span=this[Rh].zoom.max-this[Rh].zoom.min,this[Rh].zoom.fullSpan=o-n}else if(a.onThumb)this[Rh].offset=a.thumb;else{const e=u();this[Rh].offset=a.beforeThumb?0:e.thumbSize}},[`${Rh}move`](n){n.preventDefault();const a=c(n);if(this[Rh]=this[Rh]||{},o.meta.isContinuous){const e=a.relative-this[Rh].relative,{fullSpan:t,span:n,min:o,max:s}=this[Rh].zoom,l=i.get("continuousMin"),c=i.get("continuousMax");r.set("zoom",{min:Math.min(o+e*t,c-n),max:Math.max(s+e*t,l+n)})}else{const e=a.pixel-(this[Rh].offset||0),t=u(),n=Math.max(0,e/t.size);s.command.scrollTo(n)}t.component(e).emit("render")},[`${Rh}end`](n){n.preventDefault(),this[Rh]=this[Rh]||{},this[Rh].isPanning=!1,t.component(e).emit("unlockState")},[`${Rh}cancel`](n){n.preventDefault(),this[Rh]=this[Rh]||{},this[Rh].isPanning=!1,t.component(e).emit("unlockState")}}}}function _h({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return[Nh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}),Ih({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,rtl:l}),Lh({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})]}function Ph({componentKey:e,chart:t,actions:n,layoutService:r}){const i=(i,o)=>{if(!r.meta.isContinuous)return;const a=t.component(e);a&&a.emit&&n.scroll.enabled()&&a.emit(i,o)};return{type:"native",events:{mousemove:e=>i("hover",e),mouseleave:()=>i("leave")}}}const zh={background:"rgba(0, 0, 0, 0.1)"},Fh={top:-1,bottom:-1,width:6},jh={width:2,background:"#595959"};var $h={before:zh,after:zh,thumb:{background:"transparent",border:"1px solid rgba(68, 68, 68, 0.4)"},startHandle:Fh,endHandle:Fh,startHandleBorder:jh,endHandleBorder:jh};const Bh={background:"rgba(0, 0, 0, 0.1)"},Vh={top:-1,bottom:-1,width:6},Hh={width:2,background:"#595959"};var Uh={before:Bh,after:Bh,thumb:{background:"#B0AFAE",border:"transparent"},startHandle:Vh,endHandle:Vh,startHandleBorder:Hh,endHandleBorder:Hh};const Wh={position:"absolute",top:0,right:0,bottom:0,left:0,boxSizing:"border-box"},Yh={pointerEvents:"initial"},Kh={pointerEvents:"none"};const Gh="ew-resize",Xh="default";function Jh(){const{rect:e}=this,{settings:t}=this.settings,n="horizontal"===t.orientation,r=n?e.computedInner.width:e.computedInner.height,i=t.range(),o=n&&t.rtl;return{size:r,start:(o?1-i[1]:i[0])*r,end:(o?1-i[0]:i[1])*r}}function Zh(){const e=this.state.hover.start||this.state.hover.end||this.state.drag.start||this.state.drag.end;this.renderer.element().ownerDocument.body.style.cursor=e?Gh:Xh}function Qh(e,t,n){const{min:r}=this.settings.settings.size.thumb;if(n-t<r){const i=(r-(n-t))/2,o=Math.max(0,0-(t-i))-Math.max(0,n+i-e);return{size:e,start:t-i+o,end:n+i+o}}return{size:e,start:t,end:n}}function ep(e){const t=(e.srcEvent||e).srcElement;return this.renderer.element().contains(t)}function tp(){const{size:e,start:t,end:n}=Jh.call(this);this.renderer.render(this.elements(this.h,Qh.call(this,e,t,n)))}function np(){const{state:e,settings:t,style:n}=this,r=t.settings.style;return e.style[r]||(e.style[r]=function({id:e,style:t}){const n="slim"===e?Uh:$h;return{container:{...Wh},before:{...Wh,...n.before,...t.before},after:{...Wh,...n.after,...t.after},thumb:{...Wh,...n.thumb,...t.thumb},startHandle:{...Wh,...Yh,...n.startHandle},endHandle:{...Wh,...Yh,...n.endHandle},startHandleBorder:{...Wh,...Kh,...n.startHandleBorder},endHandleBorder:{...Wh,...Kh,...n.endHandleBorder}}}({id:t.settings.style,style:n[r]})),e.style[r]}var rp={require:["renderer"],defaultSettings:{settings:{style:"standard",size:{area:{min:30,max:40,ratio:1/8},thumb:{min:4}},orientation:"horizontal",rtl:!1,isContinuous:!1,range:()=>[0,1],injections:()=>[]},style:{standard:{before:{},thumb:{},after:{}},slim:{before:{},thumb:{},after:{}}}},renderer:"dom",on:{render(){tp.call(this)},lockState(){this.state.locked=!0},unlockState(){this.state.locked=!1},hover(e){if(this.state.locked||this.state.drag.start||this.state.drag.end||!ep.call(this,e)&&this.state.hover.isPristine())return;this.state.hover.reset();const t=Th({e:e});t&&(this.state.hover[t]=!0),Zh.call(this),tp.call(this)},leave(){this.state.locked||(this.state.hover.reset(),Zh.call(this),tp.call(this))},dragStart(e){if(this.state.locked)return;this.state.drag.reset();const t=Th({e:e});t&&(this.state.drag[t]=!0),Zh.call(this)},dragEnd(){this.state.locked||(this.state.drag.reset(),Zh.call(this),tp.call(this))}},preferredSize({outer:e}){const{min:t,max:n,ratio:r}=this.settings.settings.size.area,i="horizontal"===this.settings.settings.orientation?"height":"width";return Math.max(t,Math.min(n,e[i]*r))},created(){this.state={style:{},locked:!1,hover:{start:!1,end:!1,reset(){this.start=!1,this.end=!1},isPristine(){return!this.start&&!this.end}},drag:{start:!1,end:!1,reset(){this.start=!1,this.end=!1}}}},render(e){this.h=e;const{size:t,start:n,end:r}=Jh.call(this);return this.elements(e,Qh.call(this,t,n,r))},properties(){return"horizontal"===this.settings.settings.orientation?{start:"left",end:"right"}:{start:"top",end:"bottom"}},elements(e,{size:t,start:n,end:r}){const{settings:i}=this.settings,o=i.injections().map(t=>t({h:e,rect:this.rect,orientation:i.orientation,minThumbSize:i.size.thumb.min}));return function({h:e,size:t,start:n,end:r,properties:i,startHandleActive:o,endHandleActive:a,style:s,continuous:l,invert:c,injections:u}){const d={[i.end]:t-n},f={[i.start]:r},h={left:-3},p={left:1},m={right:-3,left:"auto"},g={left:3},y=e("div",{style:{...s.before,...c?f:d},class:"scrollbar--before"}),v=e("div",{style:{...s.after,...c?d:f},class:"scrollbar--after"}),b=[];if(l){const t=e("div",{style:{...s.startHandle,...c?m:h},class:"scrollbar--start-handle",[Dh]:"start"},o?e("div",{style:{...s.startHandleBorder,...c?g:p}}):void 0);b.push(t);const n=e("div",{style:{...s.endHandle,...c?h:m},class:"scrollbar--end-handle",[Dh]:"end"},a?e("div",{style:{...s.endHandleBorder,...c?p:g}}):void 0);b.push(n)}const x=e("div",{style:{...s.thumb,[i.start]:n,[i.end]:t-r},class:"scrollbar--thumb"},b);return e("div",{style:{...s.container}},[y,x,v,...u])}({h:e,size:t,start:n,end:r,properties:this.properties(),startHandleActive:this.state.hover.start||this.state.drag.start,endHandleActive:this.state.hover.end||this.state.drag.end,style:np.call(this),continuous:i.isContinuous,invert:"horizontal"===i.orientation&&i.rtl,injections:o})}};function ip({layoutService:e}){return e.meta.isContinuous&&Ch({layoutService:e}).miniChart}function op({models:e}){const{layoutService:t,fieldModel:n,seriesModel:r,colorService:i}=e,{primarySeries:o,secondarySeries:a}=r.meta,s=r.query.series(Gf.LINE),l=s.filter(e=>e.isPrimary),c=s.filter(e=>!e.isPrimary),u=[...bh({forceCreate:!0,key:Kf.COLLECTION.PRIMARY,series:o,fieldModel:n,colorService:i,layoutService:t}),...bh({key:Kf.COLLECTION.SECONDARY,series:a,fieldModel:n,colorService:i,layoutService:t}),...bh({key:Kf.COLLECTION.LINE,series:s,fieldModel:n,colorService:i,layoutService:t}),...bh({key:Kf.COLLECTION.PRIMARY_LINE,series:l,fieldModel:n,colorService:i,layoutService:t,isLineSeries:!0}),...bh({key:Kf.COLLECTION.SECONDARY_LINE,series:c,fieldModel:n,colorService:i,layoutService:t,isLineSeries:!0}),...vh({key:Kf.COLLECTION.STACKED_PRIMARY,layoutService:t,fieldModel:n,colorService:i,series:o}),...vh({key:Kf.COLLECTION.STACKED_SECONDARY,layoutService:t,fieldModel:n,colorService:i,series:a}),...xh({key:Kf.COLLECTION.STACKED_TOTAL_PRIMARY,layoutService:t,fieldModel:n,series:o}),...xh({key:Kf.COLLECTION.STACKED_TOTAL_SECONDARY,layoutService:t,fieldModel:n,series:a})];return ip(e)&&(u.push(...bh({key:Kf.COLLECTION.REDUCED,source:Kf.DATA.REDUCED,series:r.query.all(),fieldModel:n,colorService:i,layoutService:t})),u.push(...bh({key:Kf.COLLECTION.REDUCED_PRIMARY_LINE,source:Kf.DATA.REDUCED,series:l,fieldModel:n,colorService:i,layoutService:t,isLineSeries:!0})),u.push(...bh({key:Kf.COLLECTION.REDUCED_SECONDARY_LINE,source:Kf.DATA.REDUCED,series:c,fieldModel:n,colorService:i,layoutService:t,isLineSeries:!0})),u.push(...bh({key:Kf.COLLECTION.REDUCED_PRIMARY,source:Kf.DATA.REDUCED,series:o,fieldModel:n,colorService:i,layoutService:t})),u.push(...bh({key:Kf.COLLECTION.REDUCED_SECONDARY,source:Kf.DATA.REDUCED,series:a,fieldModel:n,colorService:i,layoutService:t})),u.push(...vh({key:Kf.COLLECTION.REDUCED_STACKED_PRIMARY,source:Kf.DATA.REDUCED,layoutService:t,fieldModel:n,series:r.meta.primarySeries.filter(e=>e.type===Gf.BAR),colorService:i})),u.push(...vh({key:Kf.COLLECTION.REDUCED_STACKED_SECONDARY,source:Kf.DATA.REDUCED,layoutService:t,fieldModel:n,series:r.meta.secondarySeries.filter(e=>e.type===Gf.BAR),colorService:i}))),u}const ap=({layoutService:e,dockService:t})=>"custom"!==e.getLayoutValue("dimensionAxis.axisDisplayMode")?Math.min(200,t.meta.chart.size["horizontal"===t.meta.major.orientation?"height":"width"]/4):void 0;function sp({models:e}){const{dockService:t,seriesModel:n,layoutService:r}=e,i=2===n.meta.measureAxes.length;if(i)return.5;const o=n.meta.measureAxes[0].isPrimary?t.meta.minor.dock:t.meta.minorSecondary.dock;if(!i){const e=n.meta.measureAxes[0].isPrimary?0:1;if("none"===r.getLayoutValue(`measureAxes.${e}.show`))return.5}return"horizontal"===t.meta.minor.orientation?"near"===o||"bottom"===o?1:0:"near"===o||"left"===o?0:1}const lp=({models:e,environment:t})=>{const{fieldModel:n,discreteModel:r,layoutService:i,dockService:o}=e,{orientation:a}=o.meta.major;return{data:{extract:{field:n.main.major,props:{selectionDimension:{field:n.main.major}}}},maxPxStep:ap({layoutService:i,dockService:o}),invert:"horizontal"===a&&"rtl"===t.options.direction,range:r.query.getScaleRange,align:sp({models:e})}},cp=({models:e,environment:t})=>{const{fieldModel:n,discreteModel:r,layoutService:i,dockService:o}=e,{orientation:a}=o.meta.major;return{type:"group-by-measure",data:{extract:{field:n.main.major}},measureCount:i.meta.groupSize,maxPxStep:ap({layoutService:i,dockService:o}),invert:"horizontal"===a&&"rtl"===t.options.direction,range:r.query.getScaleRange,align:sp({models:e})}};function up({viewState:e,models:t,environment:n}){const{fieldModel:r,dockService:i}=t,{orientation:o}=i.meta.major;return{type:"linear",invert:"horizontal"===o&&"rtl"===n.options.direction,data:{extract:{field:r.main.majorNumeric}},ticks:{forceBounds:!0,count:e.get("zoom").min===e.get("zoom").max?1:void 0},minorTicks:{count:1},min:()=>e.get("zoom").min,max:()=>e.get("zoom").max}}function dp({viewCache:e,mainMajor:t}){return l(!0,{},t,{min:()=>e.get("continuousMin"),max:()=>e.get("continuousMax")})}function fp({viewState:e,viewCache:t,layoutService:n}){return t.set("qTimeAxisCache",[]),{get:(e,n=0)=>{const r=t.get("qTimeAxisCache");return r[n]&&r[n][0]===e?r[n][1]:void 0},set:(e,n,r=0)=>{t.get("qTimeAxisCache")[r]=[e,n]},key:({distance:r})=>{const{min:i,max:o}=e.get("zoom"),a=(o-i)/(t.get("continuousMax")-t.get("continuousMin")),s=n.getHyperCubeValue("qAxisData.qAxis",[]).map(e=>e.qName);return[r,Number.parseFloat(a).toFixed(12),...s].toString()}}}function hp({picasso:e,viewState:t,viewCache:n,models:r,environment:i}){const{layoutService:o,fieldModel:a,appLayoutModel:s,themeService:c}=r,{measureText:u}=e.renderer("svg")(),{majorNumeric:d}=a.main,f=c.getStyles(),h={type:"time",data:{field:d},qAxis:()=>o.getHyperCubeValue("qAxisData.qAxis",[]),field:d,min:()=>t.get("zoom").min,max:()=>t.get("zoom").max,invert:"rtl"===i.options.direction,formatter:{fn:e.formatter("q-time"),localeInfo:s.qLocaleInfo,qNumFormat:o.getHyperCubeValue("qDimensionInfo.0",{}).qNumFormat,measureText:e=>u({text:e,fontFamily:f.axis.label.name.fontFamily,fontSize:f.axis.label.name.fontSize})},ticks:{generator:{type:"d3",initialMin:t.get("zoom").min},anchor:"start",clamp:!0},cache:fp({viewState:t,viewCache:n,layoutService:o})};return{[Kf.SCALE.MAJOR]:l(!0,{},h,{ticks:{level:"outer"}}),[Kf.SCALE.MAJOR_INNER]:l(!0,{},h,{ticks:{level:"inner"}})}}function pp({picasso:e,models:t,viewState:n,viewCache:r,environment:i}){const{meta:o}=t.layoutService,a=o.isTime?{...hp({picasso:e,viewState:n,viewCache:r,models:t,environment:i})}:o.isContinuous?{[Kf.SCALE.MAJOR]:up({models:t,viewState:n,environment:i})}:o.isBarSeriesGrouped?{[Kf.SCALE.MAJOR]:cp({models:t,environment:i})}:{[Kf.SCALE.MAJOR]:o.isBarSeriesStackedInBothAxis?cp({models:t,environment:i}):lp({models:t,environment:i})};return ip(t)?{...a,[Kf.SCALE.REDUCED]:dp({viewCache:r,mainMajor:a[Kf.SCALE.MAJOR]})}:a}function mp({fields:e,tickModel:t,dockService:n,environment:r}){const i="rtl"===r.options.direction,{orientation:o}=n.meta.minor;return{data:{source:"qHyperCube",fields:e},invert:"vertical"===o||i,ticks:{values:t.query.getValues},min:t.query.getMin,max:t.query.getMax}}function gp({layoutService:e,tickModel:t,dockService:n,environment:r}){if(!ip({layoutService:e}))return;const i="rtl"===r.options.direction,{orientation:o}=n.meta.minor;return{type:"linear",invert:"vertical"===o||i,min:t.query.getMin,max:t.query.getMax}}var yp={AXIS:{MAJOR:{HORIZONTAL:{width:"XSMALL",height:"SMALL"},VERTICAL:{width:"SMALL",height:"XSMALL"}},MINOR:"XSMALL"},AXIS_TITLE:{MAJOR:{HORIZONTAL:{width:"XSMALL",height:"MEDIUM"},VERTICAL:{width:"MEDIUM",height:"XSMALL"}},MINOR:"SMALL"},GRID_LINE:"XSMALL",VALUE_LABEL:"XSMALL",LABEL_SPACE:"XSMALL",OUT_OF_BOUNDS_MARKER:"XSMALL",REFERENCE_LINE:"SPARK"};const vp=["all","labels"];function bp({models:e}){const{layoutService:t,dockService:n,seriesModel:r,themeService:i,styleModel:o,animationsModel:a}=e,s=t.getLayoutValue("measureAxes");if(!s||!s.length)return[];const l=i.getStyles(),c=o.query.axis.label.getStyle(),{measureAxes:u}=r.meta;return u.filter(e=>{const t=e.isPrimary?0:1;return vp.some(e=>s[t].show===e)}).map(e=>({type:"axis",key:e.isPrimary?Kf.COMPONENT.AXIS.MINOR.PRIMARY:Kf.COMPONENT.AXIS.MINOR.SECONDARY,renderer:Of(),scale:e.scale,layout:{dock:e.isPrimary?n.meta.minor.dock:n.meta.minorSecondary.dock,minimumLayoutMode:yp.AXIS.MINOR},settings:{labels:{show:!0,fontFamily:c.fontFamily,fontSize:c.fontSize,fill:c.fill},line:{stroke:l.axis.line.major.color},ticks:{stroke:l.axis.line.major.color},minorTicks:{stroke:l.axis.line.minor.color}},animations:{enabled:a.enabled,trackBy:xf.axes.trackBy({isMeasure:!0}),compensateForLayoutChanges:xf.axes.compensateForLayoutChanges({isMeasure:!0,dock:e.isPrimary?n.meta.minor.dock:n.meta.minorSecondary.dock})}}))}var xp=.5,Sp=3,Mp=13;function wp({models:e,environment:t}){const{layoutService:n,dockService:r,styleModel:i,themeService:o,animationsModel:a}=e,s="rtl"===t.options.direction,l=n.getLayoutValue("dimensionAxis"),c=i.query.axis.label.getStyle(),u=(({layoutService:e})=>{const t=e.getHyperCubeValue("qDimensionInfo.0.qApprMaxGlyphCount"),[n]=e.getDataPages(),r=n?n.qMatrix:[];return A.getAdjustedMaxGlyphCount(t,r,0,"qText")})({layoutService:n}),{orientation:d}=r.meta.major,f="horizontal"===d,h=f?l.label:"auto",p=o.getStyles(),{auto:m,spacing:g}=n.getLayoutValue("gridLine",{});return{type:"axis",key:Kf.COMPONENT.AXIS.MAJOR,renderer:Of(),scale:Kf.SCALE.MAJOR,layout:{dock:r.meta.major.dock,minimumLayoutMode:yp.AXIS.MAJOR[d.toUpperCase()]},settings:{labels:{mode:l.label,tiltAngle:s?-40:40,maxEdgeBleed:50,maxLengthPx:"horizontal"===h?void 0:r.meta.minor.size/4,maxGlyphCount:u,tiltThreshold:u>Sp&&u<Mp?1:void 0,fontFamily:c.fontFamily,fontSize:c.fontSize,fill:c.fill},line:{show:!m&&0===g,stroke:p.axis.line.major.color},paddingEnd:4},brush:{consume:[{context:"selection",style:{inactive:{opacity:xp}}}]},animations:{enabled:a.enabled,trackBy:xf.axes.trackBy({isMajor:!0}),compensateForLayoutChanges:xf.axes.compensateForLayoutChanges({isHorizontal:f})}}}function Ep({models:e}){const{dockService:t,styleModel:n,themeService:r,layoutService:i,animationsModel:o}=e,{orientation:a}=t.meta.major,s=n.query.axis.label.getStyle(),l=r.getStyles(),{auto:c,spacing:u}=i.getLayoutValue("gridLine",{});return{type:"axis",key:Kf.COMPONENT.AXIS.MAJOR_CONTINUOUS,renderer:Of(),scale:Kf.SCALE.MAJOR,layout:{dock:t.meta.major.dock,minimumLayoutMode:yp.AXIS.MAJOR[a.toUpperCase()]},settings:{labels:{align:0,offset:4,fontFamily:s.fontFamily,fontSize:s.fontSize,fill:s.fill},line:{show:!c&&0===u,stroke:l.axis.line.major.color}},animations:{enabled:o.enabled,trackBy:xf.axes.trackBy({isContinuous:!0}),compensateForLayoutChanges:xf.axes.compensateForLayoutChanges({isContinuous:!0})}}}function kp({models:e,environment:t}){const{layoutService:n}=e,r=n.getLayoutValue("dimensionAxis");if(!r)return[];const{show:i}=r;return"none"===i||"title"===i?[]:n.meta.isTime?function({models:e,environment:t}){const{dockService:n,themeService:r,styleModel:i,layoutService:o,animationsModel:a}=e,s="rtl"===t.options.direction,{orientation:c}=n.meta.major,u="bottom"===n.meta.major.dock?0:1,d=r.getStyles(),f=i.query.axis.label.getStyle(),h=s?1:0,{auto:p,spacing:m}=o.getLayoutValue("gridLine",{}),g={type:"time-axis",renderer:"svg",layout:{dock:n.meta.major.dock,minimumLayoutMode:yp.AXIS.MAJOR[c]},preferredSize:()=>({size:2*parseFloat(f.fontSize),edgeBleed:{left:1,right:1}}),settings:{anchor:s?"end":"start",label:{align:u,justify:h},guideLine:{major:{justify:h},minor:{align:u}},line:{show:!1}},style:{label:{fontFamily:f.fontFamily,fontSize:f.fontSize,fill:f.fill},majorGuideLine:{stroke:d.axis.line.major.color},minorGuideLine:{stroke:d.axis.line.minor.color}},animations:{enabled:a.enabled,trackBy:xf.axes.trackBy({isTime:!0}),compensateForLayoutChanges:xf.axes.compensateForLayoutChanges({isTime:!0})}};return[l(!0,{},g,{key:Kf.COMPONENT.AXIS.TIME_INNER,scale:Kf.SCALE.MAJOR_INNER,settings:{guideLine:{minor:{show:!0}},line:{show:!p&&0===m}},style:{majorGuideLine:{stroke:d.axis.line.minor.color},minorGuideLine:{stroke:d.axis.line.major.color},line:{stroke:d.axis.line.major.color}}}),l(!0,{},g,{key:Kf.COMPONENT.AXIS.TIME_OUTER,scale:Kf.SCALE.MAJOR,settings:{guideLine:{minor:{show:!1}}}})]}({models:e,environment:t}):n.meta.isContinuous?[Ep({models:e})]:[wp({models:e,environment:t})]}const Cp=({layoutService:e,axis:t})=>e.meta.isBarSeriesGrouped?({scale:e,datum:t})=>e([t.value,t.typeIndex.value])+e.bandwidth()/2:e.meta.isBarSeriesStackedInBothAxis?({scale:e,datum:n})=>e([n.value,t])+e.bandwidth()/2:null,Ap=({layoutService:e,seriesModel:t,rtl:n,orientation:r})=>e.meta.isContinuous?null:e.meta.isBarSeriesGrouped?({scale:e,datum:i})=>e([i.value,n&&"horizontal"===r?t.meta.barSeriesCount-1:0])+e.bandwidth()*t.meta.barSeriesCount/2:e.meta.isBarSeriesStackedInBothAxis?({scale:e,datum:t})=>e([t.value,n&&"horizontal"===r?1:0])+e.bandwidth():null;function Op({layoutService:e,active:t={},inactive:n={}}){return{consume:[{context:"selection",data:["selectionDimension","end","color","major"],style:{active:{strokeWidth:e.meta.isContinuous?0:2,stroke:"#000",opacity:e=>!0===e.data?.null?.value?0:1,...t},inactive:{opacity:e=>!0===e.data?.null?.value?0:xp,...n}}}]}}function Np(e,t){return function(e,t){const{hasExplicitMax:n}=t.meta,{max:r}=t.explicit;return!!n&&e>r}(e,t)||function(e,t){const{hasExplicitMin:n}=t.meta,{min:r}=t.explicit;return!!n&&e<r}(e,t)}const Dp=(e,t)=>`${e}-${t.id}`,Tp=4,qp=12,Ip=4;function Rp({chart:e,layoutService:t,dockService:n,markerKey:r,markerType:i}){if(t.meta.isContinuous)return()=>`${Ip}px`;const o={size:void 0},a="horizontal"===n.meta.major.orientation?"width":"height";return t=>{if(!o.size){const n=e.component(r),s=t.resources.scale(Kf.SCALE.MAJOR),l=n.rect[a]*s.bandwidth()*.25,c=Math.max(Tp,Math.min(qp,l));o.size=`${"bar"===i?2*c:c}px`}return o.size}}const Lp=({series:e,isPrimary:t,seriesModel:n})=>e?"qMeasureInfo/0"===e.ref:t?n.meta.primarySeries.some(e=>"qMeasureInfo/0"===e.ref):n.meta.secondarySeries.some(e=>"qMeasureInfo/0"===e.ref),{isDark:_p}=Te;const Pp=({chart:e,models:t,series:n,environment:r})=>{const{layoutService:i,seriesModel:o,colorService:a,dockService:s,primaryExtremumModel:l,secondaryExtremumModel:c,animationsModel:u}=t,d=a.getColor(),{fill:f,marker:h}=n.options,{isContinuous:p}=i.meta,m="rtl"===r.options.direction,{orientation:g}=s.meta.major,y="horizontal"===g,v=(n.isPrimary?l:c).query.getExtrema(),b=({end:e})=>{const{value:t}=e;return Np(t,v)},x=Dp(Kf.COMPONENT.MARKER,n);return{type:"point",key:x,data:{filter:e=>n.ref===e.end.source.field,collection:n.collection},settings:{[y?"x":"y"]:{scale:Kf.SCALE.MAJOR,fn:Ap({layoutService:i,seriesModel:o,rtl:m,orientation:g}),ref:p?"major":void 0},[y?"y":"x"]:{scale:n.scale,ref:"end",fn:e=>{const t=!0===e.datum.null?.value?e.scale.min():e.datum.end.value;return function(e){return Math.min(Math.max(0,e),1)}(e.scale(t))}},fill:f||"bar"===h?d:"none",opacity:e=>!0===e.datum.null?.value||b(e.datum)?0:1,stroke:e=>{const t=d(e);return f?_p(t)?function(e){return te(e).brighter(.5).toString()}(t):function(e){return te(e).darker().toString()}(t):t},size:Rp({chart:e,layoutService:i,dockService:s,markerKey:x,markerType:h}),shape:()=>(({marker:e,horizontal:t,rtl:n})=>{let r;return"triangle"!==e||t||(r=n?"left":"right"),"bar"===e&&(r=t?"horizontal":"vertical"),r?{type:e,direction:r}:{type:e}})({marker:h,horizontal:y,rtl:m})},brush:Op({layoutService:i,active:{opacity:e=>!0===e.data.null?.value||b(e.data)?0:1},inactive:{opacity:e=>!0===e.data.null?.value||b(e.data)?0:xp}}),animations:{enabled:u.enabled,isMainComponent:Lp({series:n}),trackBy:xf.markers.trackBy,compensateForLayoutChanges:xf.markers.compensateForLayoutChanges}}};function zp({property:e="end",isHorizontal:t,isColor:n,fallback:r,rtl:i}){return function(o){const{datum:a,resources:{scale:s}}=o,l=s(Kf.SCALE.MAJOR),c=s(Kf.SCALE.COLOR),u=t&&i?[...a.points].reverse():a.points,d=u.reduce((t,n,r)=>{const i="NaN"===n[e].value||Number.isNaN(n[e].value),o=u[r+1],a=o&&"NaN"!==o[e].value&&!Number.isNaN(o[e].value);return i?t.length&&a&&t.push(n):t.push(n),t},[]),f="group-by-measure"===l.type?e=>l([e.major.value,e.typeIndex.value]):e=>l(e.major.value),h=d.map(f),p=Math.min(...h),m=Math.max(...h)-p,g=0===m?1:m,y=h.map((e,t)=>0===t?0:t===h.length-1?1:(e-p)/g),v=[];for(let t=0;t<d.length;t++){const i=d[t],o=i.color&&i.color.value,a=n?o||r:c(o)||r,s=0===t,l=t===d.length-1,u=y[t];if("NaN"===i[e].value||Number.isNaN(i[e].value))v[t-1].virtual||v.push({virtual:!0});else{const n=d[t-1];n&&"NaN"!==n[e].value&&!Number.isNaN(n[e].value)?v.push({color:a,offset:s?0:Math.max(0,parseFloat((u-(u-y[t-1])/2).toFixed(5)))}):v.push({color:a,offset:u});const r=d[t+1];r&&"NaN"!==r[e].value&&!Number.isNaN(r[e].value)?v.push({color:a,offset:l?1:Math.max(0,parseFloat((u+(y[t+1]-u)/2).toFixed(5)))}):v.push({color:a,offset:u})}}const b=v.reduce((e,t,n)=>{if(t.virtual){const t=v[n-1],r=v[n+1],i=t.offset+(r.offset-t.offset)/2;e.push({color:t.color,offset:i},{color:r.color,offset:i})}else e.push(t);return e},[]);return{type:"gradient",x1:0,x2:t?1:0,y1:0,y2:t?0:1,stops:b}}}function Fp({environment:e,models:t,measureIndex:n}){const{layoutService:r,colorService:i,dockService:o}=t,a="rtl"===e.options.direction,{hasMultipleMeasures:s}=r.meta,{mode:l,type:c,nil:u}=i.getSettingsForMeasure(n),d="horizontal"===o.meta.major.orientation;if(!l||"constant"===c)return i.getColor();if("measure"===l&&"categorical"===c)return i.getColor();const f=r.getHyperCubeValue(`qMeasureInfo.${n}.color`);if(f?.on)return"byExpression"===f.mode?zp({isHorizontal:d,isColor:!0,fallback:u,rtl:a}):i.getColor();const h=r.getLayoutValue("color",{}),p=!h.auto&&"byExpression"===h.mode,m=!!h.colorExpression;if(p&&!m)return u;const g=!h.auto&&"byMeasure"===h.mode&&h.byMeasureDef&&void 0!==h.byMeasureDef.activeMeasureIndex;return s||!g?zp({isHorizontal:d,isColor:"color"===c,fallback:u,rtl:a}):"continuous"===c?function({isHorizontal:e,rtl:t}){return function(n){const{datum:{points:r},resources:{scale:i}}=n,o=i(Kf.SCALE.COLOR),a=r.map(e=>e.end.value).filter(e=>"NaN"!==e&&!Number.isNaN(e)),s=Math.min(...a),l=Math.max(...a),c=l-s,u=0===c?1:c,d=o.domain().map(e=>({color:o(Math.min(l,Math.max(s,e))),offset:Math.min(1,Math.max(0,(e-s)/u))}));return{type:"gradient",x1:!e&&t?1:0,x2:e||t?0:1,y1:e?1:0,y2:0,stops:d}}}({isHorizontal:d,rtl:a}):function({isHorizontal:e,isArea:t,fallback:n,rtl:r}){return function(i){const{datum:{points:o},resources:{scale:a}}=i,s=a(Kf.SCALE.COLOR),l=o.map(e=>e.end.value).filter(e=>"NaN"!==e&&!Number.isNaN(e)),c=Math.min(...l),u=Math.max(...l),d=t?Math.min(0,c):c,f=(t?Math.max(0,u):u)-d,h=0===f?1:f,p=s.domain(),m=[];for(let e=0;e<p.length-1;e++){const t=p[e],r=s(t)||n;m.push({color:r,offset:Math.min(1,Math.max(0,(t-d)/h))});const i=p[e+1];m.push({color:r,offset:Math.min(1,Math.max(0,(i-d)/h))})}return{type:"gradient",x1:!e&&r?1:0,x2:e||r?0:1,y1:e?1:0,y2:0,stops:m}}}({isHorizontal:d,fallback:u,rtl:a})}const jp=({models:e,environment:t,series:n})=>{const{layoutService:r,seriesModel:i,dockService:o,styleModel:a,animationsModel:s,colorService:l}=e,c="rtl"===t.options.direction,{orientation:u}=o.meta.major,d=Ap({layoutService:r,seriesModel:i,rtl:c,orientation:u}),{isArea:f,isLineStacked:h}=r.meta,p=r.getLayoutValue("separateStacking",!0),{fieldType:m}=l.getSettings(),g={key:Dp(Kf.COMPONENT.LINE,n),type:"line",data:{filter:h?e=>n.ref===e.point.source.field:e=>n.ref===e.end.source.field,collection:n.isPrimary?Kf.COLLECTION.PRIMARY_LINE:Kf.COLLECTION.SECONDARY_LINE},settings:{coordinates:{major:{scale:Kf.SCALE.MAJOR,fn:d},minor:{scale:n.scale,ref:"end",fn:e=>{if(h&&p){const t=e.datum.point.value<0?e.datum.start.value:e.datum.end.value;return e.scale(t)}return e.scale(e.datum.end.value)}}},layers:{curve:a.query.line.getCurveFn(),line:{stroke:Fp({models:e,environment:t,measureIndex:n.refIndex}),strokeWidth:a.query.line.getStrokeWidthFn(),strokeDasharray:a.query.line.getStrokeDasharrayFn(),strokeLinejoin:"round",showMinor0:!1}},connect:n.options.showAsConnections,orientation:o.meta.major.orientation},brush:Op({layoutService:r,active:{stroke:void 0,strokeWidth:void 0,opacity:xp},inactive:{opacity:xp}}),animations:{enabled:s.enabled,isMainComponent:!!Lp({series:n})&&{filterFn:e=>e.commonPoints.length>0},trackBy:xf.lines.trackBy,compensateForLayoutChanges:xf.lines.compensateForLayoutChanges}};return h&&(g.settings.coordinates.minor0={scale:n.scale,fn:e=>{if(p){const t=e.datum.point.value<0?e.datum.end.value:e.datum.start.value;return e.scale(t)}return e.scale(e.datum.start.value)}}),f&&(g.settings.layers.area={fill:Fp({models:e,environment:t,measureIndex:n.refIndex}),opacity:"measure"===m||"expression"===m?.6:.3},g.brush.consume.push({context:"selection",data:["selectionDimension","end","color","major"],filter:e=>(e=>void 0===e.strokeLinejoin)(e),style:{active:{opacity:.15},inactive:{opacity:.15}}})),g};var $p={BAR:{STROKE:{COLOR:"#205891",WIDTH:{NONE:0,SMALL:1,MEDIUM:2,LARGE:4}}},LINE:{CURVE:{LINEAR:"linear",MONOTONE:"monotone"},WIDTH:{FULL:{DEFAULT:2},LESS:{DEFAULT:1},DEFAULT:3},TYPE:{SOLID:void 0,DASHED:"5, 5"}},POINT:{SIZE:{DEFAULT:6,ACTIVE:4,NEW_DEFAULT:8}}};function Bp({series:e,layoutService:t}){const{showAsConnections:n}=e.options,r=function({layoutService:e}){const{isDiscrete:t}=e.meta;return({item:e})=>{if(e.dummy)return t;const{value:n}=e.end;return"NaN"===n||Number.isNaN(n)}}({layoutService:t}),i=n?(e,t)=>0!==e&&t.slice(0,e).reverse().some(e=>!r({item:e})):(e,t)=>0!==e&&!r({item:t[e-1]}),o=n?(e,t)=>e!==t.length-1&&t.slice(e+1,t.length).some(e=>!r({item:e})):(e,t)=>e!==t.length-1&&!r({item:t[e+1]});return({index:e,items:t})=>({before:i(e,t),after:o(e,t)})}const Vp=3,Hp=20;function Up({models:e,series:t,environment:n}){const{layoutService:r,colorService:i,seriesModel:o,dockService:a,styleModel:s,primaryExtremumModel:l,secondaryExtremumModel:c,selectionService:u,animationsModel:d}=e,f=r.getLayoutValue("dataPoint.show",!1),{orientation:h}=a.meta.major,p="horizontal"===h,m="SPARK"===a.meta.chart.mode,g=i.getColor(),{POINT:y}=$p,v=function({layoutService:e,series:t}){const n={key:void 0,map:void 0},r=Bp({series:t,layoutService:e});return({item:e,items:t})=>{n.key!==t&&(n.key=t,n.map=function({items:e}){const t=e.reduce((e,t)=>{const{value:n}=t.line;return e[n]||(e[n]={items:[],keys:[]}),e[n].items.push(t),e[n].keys.push(`${t.major.value}-${t.line.value}`),e},{});return t}({items:t}));const{value:i}=e.line,o=n.map[i],a=`${e.major.value}-${i}`,s=o.keys.indexOf(a),{before:l,after:c}=r({index:s,items:o.items});return!l&&!c}}({series:t,layoutService:r}),b="rtl"===n.options.direction,x=(t.isPrimary?l:c).query.getExtrema(),{isContinuous:S,isLineStacked:M}=r.meta,w=r.getLayoutValue("separateStacking",!0),E=({end:e})=>{const{value:t}=e;return Np(t,x)};return{type:"point",key:Dp(Kf.COMPONENT.POINT,t),data:{filter:M?void 0:e=>t.ref===e.end.source.field,collection:t.isPrimary?Kf.COLLECTION.PRIMARY_LINE:Kf.COLLECTION.SECONDARY_LINE},preferredSize:()=>({edgeBleed:{top:p?y.SIZE.DEFAULT/2:0}}),settings:{[p?"y":"x"]:{scale:t.scale,ref:"end",fn:e=>{if(M&&w){const t=e.datum.point.value<0?e.datum.start.value:e.datum.end.value;return e.scale(t)}const t=!0===e.datum.null?.value?e.scale.min():e.datum.end.value;return function(e){return Math.min(Math.max(0,e),1)}(e.scale(t))}},[p?"x":"y"]:{scale:Kf.SCALE.MAJOR,fn:Ap({layoutService:r,seriesModel:o,rtl:b,orientation:h}),ref:"major"},sizeLimits:{minPx:Vp,maxPx:Hp},size:e=>{const{value:t}=e.datum.line;return`${s.query.point.getSize(t)}px`},fill:g,opacity:({datum:e,data:t})=>e.null?.value||E(e)?0:m?v({item:e,items:t.items})?1:0:f||v({item:e,items:t.items})?1:0},brush:Op({layoutService:r,active:{r:e=>e.r+$p.POINT.SIZE.ACTIVE/2,strokeWidth:1.5,stroke:"#FFFFFF",opacity:e=>{if(!0===e.data.null?.value||E(e.data))return 0;if(!S||f)return 1;const{event:t,components:n=[]}=u?.getSelectionInfo()||{};if("continuousRange"===t)return 0;if("tap"!==t)return 1;const r=[Kf.COMPONENT.AXIS_OVERLAY.CONTINUOUS,Kf.COMPONENT.AXIS_OVERLAY.TIME_INNER,Kf.COMPONENT.AXIS_OVERLAY.TIME_OUTER].some(e=>n.indexOf(e)>=0);return r?0:1}},inactive:{opacity:e=>1===e.opacity?.5:0}}),animations:{enabled:d.enabled,trackBy:xf.nonUpdatingNode.trackBy,compensateForLayoutChanges:xf.points.compensateForLayoutChanges}}}const Wp=(e,{dataset:t},n=!1)=>{const{value:r,label:i,source:o}=n?e.segment:e.end,a=t(o.key).field(o.field);return y.shouldUseFormat(a.raw())?a.formatter()(r):i};function Yp({chart:e,models:t,environment:n,lineSeries:r}){const{layoutService:i,dockService:o,styleModel:a,primaryExtremumModel:s,secondaryExtremumModel:l,animationsModel:c}=t,u="rtl"===n.options.direction,d=i.getLayoutValue("dataPoint");if(!d)return!1;if(!d.show||!d.showLineLabels)return!1;if(!r.length)return!1;const f=i.meta.isLineStacked?t=>((e,{dataset:t})=>{const{value:n,label:r,source:i}=e.point,o=t(i.key).field(i.field);return y.shouldUseFormat(o.raw())?o.formatter()(n):r})(t,e):t=>Wp(t,e),h=a.query.point.label.getStyle();return{type:"point-label",key:Kf.COMPONENT.POINT_LABEL,renderer:Of(),layout:{displayOrder:2,minimumLayoutMode:yp.VALUE_LABEL},settings:{orientation:o.meta.major.orientation,rtl:u,label:f,pointValue:e=>e.end.value,majorValue:e=>e.value,lineId:e=>e.data.typeIndex.value,configs:r.map(e=>({key:`${Kf.COMPONENT.POINT}-${e.id}`,labels:!0,lines:!0})),showLabel:e=>{const t=parseInt(e.key.substr(e.key.length-1),10),n=r.find(e=>e.id===t),i=(n.isPrimary?s:l).query.getExtrema();return!Np(e.data.end.value,i)},labelSpace:{use:()=>{const t=e.component(Kf.COMPONENT.LABEL_SPACE);return!!t?.preferredSize()},size:10}},style:{fontFamily:h.fontFamily,fontSize:h.fontSize,fill:h.fill},animations:{enabled:c.enabled,trackBy:xf.nonUpdatingNode.trackBy,compensateForLayoutChanges:xf.labels.compensateForLayoutChanges}}}const Kp=({chart:e,models:t,environment:n,markerSeries:r})=>{const{layoutService:i,dockService:o,styleModel:a,primaryExtremumModel:s,secondaryExtremumModel:l,animationsModel:c}=t,u="rtl"===n.options.direction,d=a.query.marker.label.getStyle(),f=i.getLayoutValue("dataPoint");return!!f?.showMarkerLabels&&(!!r.length&&{type:"point-label",key:Kf.COMPONENT.MARKER_LABEL,renderer:Of(),layout:{displayOrder:2,minimumLayoutMode:yp.VALUE_LABEL},settings:{orientation:o.meta.major.orientation,rtl:u,label:t=>Wp(t,e),pointValue:e=>e.end.value,majorValue:e=>e.value,lineId:e=>e.data.typeIndex.value,configs:r.map(e=>({key:`${Kf.COMPONENT.MARKER}-${e.id}`,labels:!0,lines:!1,fixed:!0})),showLabel:e=>{const t=parseInt(e.key.substr(e.key.length-1),10),n=r.find(e=>e.id===t),i=(n.isPrimary?s:l).query.getExtrema();return!Np(e.data.end.value,i)},labelSpace:{use:()=>{const t=e.component(Kf.COMPONENT.LABEL_SPACE);return!!t?.preferredSize()},size:10}},style:{fontFamily:d.fontFamily,fontSize:d.fontSize,fill:d.fill},animations:{enabled:c.enabled,trackBy:xf.nonUpdatingNode.trackBy,compensateForLayoutChanges:xf.labels.compensateForLayoutChanges}})};var Gp="max",Xp="min";const Jp=({chart:e,dock:t})=>{let n=t;const r=e.component(`${Kf.COMPONENT.SLICED_HAT}-${Gp}`),i=e.component(`${Kf.COMPONENT.SLICED_HAT}-${Gp}-${Xf.PRIMARY}`),o=e.component(`${Kf.COMPONENT.SLICED_HAT}-${Gp}-${Xf.SECONDARY}`);return r?n=`@${Kf.COMPONENT.SLICED_HAT}-${Gp}`:i?n=`@${Kf.COMPONENT.SLICED_HAT}-${Gp}-${Xf.PRIMARY}`:o&&(n=`@${Kf.COMPONENT.SLICED_HAT}-${Gp}-${Xf.SECONDARY}`),n},Zp=({dockPosition:e,orientation:t,rtl:n})=>{let r=1;return e!==`@${Kf.COMPONENT.SLICED_HAT}-${Gp}`&&e!==`@${Kf.COMPONENT.SLICED_HAT}-${Gp}-${Xf.PRIMARY}`&&e!==`@${Kf.COMPONENT.SLICED_HAT}-${Gp}-${Xf.SECONDARY}`||!("horizontal"===t||"vertical"===t&&n)||(r=4),e!==`@${Kf.COMPONENT.SLICED_HAT}-${Xp}`&&e!==`@${Kf.COMPONENT.SLICED_HAT}-${Xp}-${Xf.PRIMARY}`&&e!==`@${Kf.COMPONENT.SLICED_HAT}-${Xp}-${Xf.SECONDARY}`||"vertical"!==t||n||(r=4),r};function Qp({chart:e,models:t,environment:n,lineSeries:r}){const{layoutService:i,dockService:o,primaryExtremumModel:a,secondaryExtremumModel:s}=t,l=i.getLayoutValue("dataPoint",{}),c="rtl"===n.options.direction;if(!r.length)return!1;if(!l.show||!l.showLineLabels)return!1;const u="horizontal"===o.meta.major.orientation,{show:d}=i.getLayoutValue("dimensionAxis",{});if("none"!==d){const{dock:e}=o.meta.major;if(u&&"top"===e)return!1;if(!u&&e===(c?"left":"right"))return!1}const f=c?"left":"right";return{type:"label-space",key:Kf.COMPONENT.LABEL_SPACE,layout:{minimumLayoutMode:yp.LABEL_SPACE,dock:Jp({chart:e,dock:u?"top":f})},settings:{size:10},preferredSize:()=>{const t=e.component(`${Kf.COMPONENT.LINE}-${r[0].id}`);if(!t?.rect)return 0;const n=(u?17:34)/t.rect[u?"height":"width"],i=a.query.getExtrema(),o=e.scale(Kf.SCALE.MINOR.PRIMARY)(i.implicit.line.max),l=u||c?o:1-o,d=r.filter(e=>e.isPrimary).length>0,f=s.query.getExtrema(),h=e.scale(Kf.SCALE.MINOR.SECONDARY)(f.implicit.line.max),p=u||c?h:1-h,m=r.filter(e=>!e.isPrimary).length>0;return d&&l<n||m&&p<n?10:0}}}const em={min:"Min",max:"Max"};function tm(e,t,n){return function(e,t,n){const{hasExplicitMax:r}=n.meta,{max:i}=n.explicit;return!!r&&Math.max(e,t)>i&&i<=Math.min(e,t)}(e,t,n)||function(e,t,n){const{hasExplicitMin:r}=n.meta,{min:i}=n.explicit;return!!r&&Math.min(e,t)<i&&i>=Math.max(e,t)}(e,t,n)}function nm(e,t){const{hasExplicitMax:n}=t.meta,{max:r}=t.explicit;return!!n&&e>r&&r<=0}function rm(e,t){const{hasExplicitMin:n}=t.meta,{min:r}=t.explicit;return!!n&&e<r&&r>=0}function im(e,t){return nm(e,t)||rm(e,t)}function om({extrema:e,type:t}){return!(function({extrema:e,type:t}){return!e.meta[`hasExplicit${em[t]}`]}({extrema:e,type:t})||function({extrema:e,type:t}){const n=t===Gp?e.implicit.bar.max:e.implicit.bar.min,r=Number(n.toFixed(13));return t===Gp?!nm(r,e):!rm(r,e)}({extrema:e,type:t}))}var am=Object.freeze({__proto__:null,isMaxOutOfBounds:nm,isMinOutOfBounds:rm,isOutOfBounds:im,isSegmentOutOfBounds:tm,shouldShowOob:om});const sm={min:"Min",max:"Max"},lm=({chart:e,models:t,markerSeries:n,lineSeries:r,barSeries:i,environment:o,type:a})=>{const{dockService:s,primaryExtremumModel:l,secondaryExtremumModel:c,primaryTickModel:u,secondaryTickModel:d,layoutService:f,seriesModel:h,themeService:p,fieldModel:m,animationsModel:g}=t,y="rtl"===o.options.direction,{dock:v,opposite:b,orientation:x}=s.meta.major,S=l.query.getExtrema(),M=c.query.getExtrema(),w=a===Gp,{isBarSeriesGrouped:E,isLineStacked:k}=f.meta,C=f.getLayoutValue("separateStacking",!0),A=(({chart:e,type:t,opposite:n,dock:r})=>{let i=t===Gp?n:r;const o=e.component(`${Kf.COMPONENT.SLICED_HAT}-${t}`),a=e.component(`${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.PRIMARY}`),s=e.component(`${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.SECONDARY}`),l=e.component(Kf.COMPONENT.LABEL_SPACE),c=e.component(`${Kf.COMPONENT.BAR_OOB}-${t}`),u=e.component(`${Kf.COMPONENT.BAR_OOB}-${t}-${Xf.PRIMARY}`),d=e.component(`${Kf.COMPONENT.BAR_OOB}-${t}-${Xf.SECONDARY}`);return o?i=`@${Kf.COMPONENT.SLICED_HAT}-${t}`:a?i=`@${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.PRIMARY}`:s?i=`@${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.SECONDARY}`:c||u||d?l&&t===Gp?i=`@${Kf.COMPONENT.LABEL_SPACE}`:c?i=`@${Kf.COMPONENT.BAR_OOB}-${t}`:u?i=`@${Kf.COMPONENT.BAR_OOB}-${t}-${Xf.PRIMARY}`:d&&(i=`@${Kf.COMPONENT.BAR_OOB}-${t}-${Xf.SECONDARY}`):l&&t===Gp&&(i=`@${Kf.COMPONENT.LABEL_SPACE}`),i})({chart:e,type:a,opposite:b,dock:v}),O=Ap({layoutService:f,seriesModel:h,rtl:y,orientation:x}),N=r?.length>0&&k,D=r.concat(n);if(!D.length)return!1;const T=w?S.implicit.bar.max:S.implicit.bar.min,q=Number(T.toFixed(13));if(!E&&i.length&&am[`is${sm[a]}OutOfBounds`](q,S))return!1;if(!S.meta.hasExplicit&&!M.meta.hasExplicit)return!1;const I=w?"max":"min",R=Math[I](Number(S.implicit.line[I].toFixed(13)),Number(S.implicit.marker[I].toFixed(13))),L=Math[I](Number(M.implicit.line[I].toFixed(13)),Number(M.implicit.marker[I].toFixed(13))),_=D.filter(e=>e.isPrimary),P=D.filter(e=>!e.isPrimary),z=_.length>0,F=P.length>0,{major:j,majorNumeric:$}=m.main,B=e=>"NaN"!==e.qNum?e.qNum:0,V=f.meta.isContinuous?$:j;return{type:"data-out-of-bounds-marker",key:`${Kf.COMPONENT.DATA_OOB_MARKER}-${a}`,layout:{dock:A,minimumLayoutMode:yp.OUT_OF_BOUNDS_MARKER},data:{extract:[..._.map(({ref:e,typeIndex:t,options:n,type:r})=>({field:j,value:f.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:V},end:{field:e,value:n.showAsZeros?B:void 0},point:{field:e,value:void 0},typeIndex:t,isMarker:r===Gf.MARKER,null:{field:e,value:e=>"NaN"===e.qNum},key:"primary"}})),...P.map(({ref:e,typeIndex:t,options:n,type:r})=>({field:j,value:f.meta.isContinuous?e=>e.qNum:void 0,props:{major:{field:V},end:{field:e,value:n.showAsZeros?B:void 0},point:{field:e,value:void 0},typeIndex:t,isMarker:r===Gf.MARKER,null:{field:e,value:e=>"NaN"===e.qNum},key:"secondary"}}))],stack:N?{stackKey:e=>e.value,value:e=>e.end.value,offset:C?"diverging":"none",stackByKey:["primary","secondary"]}:void 0},settings:{type:a,primaryExtremum:w?()=>u.query.getMax():()=>u.query.getMin(),secondaryExtremum:w?()=>d.query.getMax():()=>d.query.getMin(),isLineStacked:k,separateStacking:k&&C,primarySeries:_,secondarySeries:P,orientation:x,rtl:y,major:{scale:Kf.SCALE.MAJOR,fn:O},markerOffset:Zp({dockPosition:A,orientation:x,rtl:y})},brush:Op({layoutService:f}),show:()=>{if(w){if(z&&R>u.query.getMax())return!0;if(F&&L>d.query.getMax())return!0}if(!w){if(z&&R<u.query.getMin())return!0;if(F&&L<d.query.getMin())return!0}return!1},style:{fill:p.getStyles().outOfRange.color},animations:{enabled:g.enabled,compensateForLayoutChanges:xf.lineOobs.compensateForLayoutChanges}}},cm={FULL:16,MEDIUM:14,SMALL:12,XSMALL:8,SPARK:4};function um({chart:e,models:t,viewState:n,viewCache:r,axis:i}){const o=gc(),{dockService:a}=t;return({data:t})=>(({items:t})=>{const{rect:n}=e.component(`${Kf.COMPONENT.BAR}-${i}`)||{};return(!t.length||!n)&&2})(t)||(()=>{const{min:e,max:t}=n.get("zoom");return o.get([e,t])||o.empty()&&!1})()||(()=>{const e=cm[a.meta.chart.mode];return 0===Math.abs(r.get("continuousMax")-r.get("continuousMin"))&&e})()||(()=>{const{min:e,max:t}=n.get("zoom"),i=Math.abs(r.get("continuousMax")-r.get("continuousMin")),s=Math.abs(t-e),l=cm[a.meta.chart.mode],c=function(e,t,n){return e*(1-n)+t*n}(2,l,1-Math.min(s/i/.2,1));return o.set([e,t],Math.max(2,Math.min(l,c)))})()}const dm=({isContinuous:e,isBarSeriesGrouped:t,styleModel:n,discreteModel:r,isBarSeriesStackedInBothAxis:i})=>e?1:n.query.bar.getHasStyling()?n.query.bar.getHasStrokeWidth()?function(){const e=n.query.bar.getStrokeWidth()/r.query.getItemSize(),t=n.query.bar.getWidthFn()(),i=t+e;return i>1?t-(i-1):t}:n.query.bar.getWidthFn():t||i?.9:.7;function fm(e){return Math.min(Math.max(0,e),1)}const hm=({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i})=>{const{layoutService:o,dockService:a,colorService:s,seriesModel:l,styleModel:c,discreteModel:u,primaryExtremumModel:d,secondaryExtremumModel:f,animationsModel:h}=t,{isContinuous:p,isBarSeriesStacked:m,isBarSeriesGrouped:g,isBarSeriesStackedInBothAxis:y}=o.meta,v=e=>e.datum.start?e.datum.start.value:e.scale.min(),b=i?Xf.PRIMARY:Xf.SECONDARY,x=i?Kf.SCALE.MINOR.PRIMARY:Kf.SCALE.MINOR.SECONDARY;if(!(i?l.meta.primaryBarSeriesCount:l.meta.secondaryBarSeriesCount))return!1;const S=m?{scale:x,start:{ref:"start",fn:e=>{const t=v(e);return fm(e.scale(t))}},end:{ref:"end",fn:e=>{const t=(e=>e.datum.end?e.datum.end.value:v(e))(e);return fm(e.scale(t))}}}:{scale:x,start:{ref:"start",fn:e=>{const t=v(e);return fm(e.scale(t))}},end:{ref:"end",fn:e=>{const t=!0===e.datum.null?.value?v(e):e.datum.end.value;return fm(e.scale(t))}}},M=(i?d:f).query.getExtrema(),w=m?({start:e,end:t})=>tm(e.value,t.value,M):({end:e})=>im(e.value,M);return{type:"box",key:`${Kf.COMPONENT.BAR}-${b}`,data:{filter:(()=>{if(m)return;const e=l.query.series(Gf.BAR).filter(e=>e.isPrimary===i).map(e=>e.ref);return t=>e.some(e=>e===t.end.source.field)})(),collection:m?i?Kf.COLLECTION.STACKED_PRIMARY:Kf.COLLECTION.STACKED_SECONDARY:i?Kf.COLLECTION.PRIMARY:Kf.COLLECTION.SECONDARY},preferredSize:p?()=>({size:0,edgeBleed:{left:1,right:1}}):void 0,settings:{orientation:a.meta.minor.orientation,major:{scale:Kf.SCALE.MAJOR,fn:Cp({layoutService:o,axis:b}),ref:p?{start:"major",end:"major"}:void 0},minor:S,box:{width:dm({isContinuous:p,isBarSeriesGrouped:g,styleModel:c,discreteModel:u,isBarSeriesStackedInBothAxis:y}),minWidthPx:p?um({chart:e,models:t,viewState:n,viewCache:r,axis:b}):void 0,fill:s.getColor(),strokeWidth:c.query.bar.getStrokeWidth(),stroke:c.query.bar.getStrokeColor(),minHeightPx:.3,opacity:e=>!0===e.datum?.null?.value||w(e.datum)?0:1},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}},brush:Op({layoutService:o,active:{opacity:e=>!0===e.data.null?.value||w(e.data)?0:1},inactive:{opacity:e=>!0===e.data.null?.value||w(e.data)?0:xp}}),animations:{enabled:h.enabled,isMainComponent:Lp({isPrimary:i,seriesModel:l}),trackBy:xf.bars.trackBy,compensateForLayoutChanges:xf.bars.compensateForLayoutChanges}}},pm=({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i})=>{const{layoutService:o,dockService:a,colorService:s,seriesModel:l,styleModel:c,discreteModel:u}=t,{isBarSeriesStacked:d,isContinuous:f,isBarSeriesGrouped:h,isBarSeriesStackedInBothAxis:p}=o.meta,m=i?Xf.PRIMARY:Xf.SECONDARY,g=i?l.meta.primaryBarSeriesCount:l.meta.secondaryBarSeriesCount;if(!d||0===g)return!1;return{key:`${Kf.COMPONENT.STACK_BAR}-${m}`,type:"box",data:{collection:i?Kf.COLLECTION.STACKED_TOTAL_PRIMARY:Kf.COLLECTION.STACKED_TOTAL_SECONDARY},settings:{major:{scale:Kf.SCALE.MAJOR,fn:Cp({layoutService:o,axis:m}),ref:f?{start:"timeStart",end:"timeEnd"}:void 0},minor:{scale:i?Kf.SCALE.MINOR.PRIMARY:Kf.SCALE.MINOR.SECONDARY,start:{ref:"sumOfNegatives"},end:{ref:"sumOfPositives"}},orientation:a.meta.minor.orientation,box:{width:dm({isContinuous:f,isBarSeriesGrouped:h,styleModel:c,discreteModel:u,isBarSeriesStackedInBothAxis:p}),minWidthPx:f?um({chart:e,models:t,viewState:n,viewCache:r,axis:m}):2,opacity:0,fill:s.getColor()},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}}};function mm(e,t){const n="horizontal"===e.dockService.meta.major.orientation,{style:r}=t,i=e.styleModel.query.bar.label.getStyle();return{placements:t.simplifiedPlacements.map(e=>{const t=i.useContrastColor&&!e.onBackground?function({style:e,simplifiedPlacement:t}){return n=>Te.isDark(t.background?t.background.fill:n.node.attrs.fill)?e.lightColor:e.darkColor}({style:r,simplifiedPlacement:e}):i.fill;return function({simplifiedPlacement:e,fill:t,isHorizontal:n}){const r=e.padding||{left:n?0:4,right:n?0:4,top:n?4:0,bottom:n?4:0};return{position:e.position,justify:e.justify,fill:t,overflow:e.overflow,background:e.background,padding:r}}({simplifiedPlacement:e,fill:t,isHorizontal:n})}),label:t.label}}function gm(e,t,n,r){const i=function(e,t){return function(e,t){if(t&&0===e){const{min:e,max:n}=t;return 0===n&&0===e?1:n<=0?-1:e>=0||n>=-e?1:-1}return e>=0?1:-1}(e,t)}(e,r);let o="up";return"vertical"===t&&i<0?o="down":"horizontal"===t&&(o=i>=0&&!n||i<0&&n?"right":"left"),o}const ym=(e,t)=>{const{showBarLabels:n,showBarSegmentLabels:r}=e;if(!n)return!1;const{isBarSeriesStacked:i,isContinuous:o}=t;return!i||!o&&!!r},vm=(e,t)=>{const{showBarLabels:n,showBarTotalLabels:r}=e;if(!n)return!1;const{isBarSeriesStacked:i,isContinuous:o}=t;return!!i&&(!!o||!1!==r)};function bm(e,t,n,r){const i=[];return void 0!==e&&(i[e]={position:"outside",onBackground:!0,justify:0,overflow:r}),void 0!==t&&(i[t]={position:"inside",onBackground:!1,justify:n}),i}const xm=({models:e,environment:t,isPrimary:n})=>{const{layoutService:r,seriesModel:i,styleModel:o,themeService:a,animationsModel:s}=e,{meta:l}=r,{isBarSeriesStacked:c}=l,u="rtl"===t.options.direction,d=a.getStyles(),f=o.query.bar.label.getStyle(),h=e.layoutService.getLayoutValue("dataPoint",{}),p=n?Xf.PRIMARY:Xf.SECONDARY;if(!(n?i.meta.primaryBarSeriesCount:i.meta.secondaryBarSeriesCount)||!ym(h,l))return!1;let m;!c&&(m=c?1:0);const g={label:e=>Wp(e.data,e,c),simplifiedPlacements:bm(m,0===m?1:0,c?.5:1,l.isContinuous),style:d.label.value},y=[mm(e,g)],v={component:`${Kf.COMPONENT.BAR}-${p}`,selector:"rect",strategy:{type:"bar",settings:{direction:t=>gm(t.data.end.value,e.dockService.meta.minor.orientation,u,0),labels:y,fontSize:parseInt(f.fontSize,10),fontFamily:f.fontFamily}}},b=[v];return{type:"labels",key:`${Kf.COMPONENT.BAR_LABEL}-${p}`,renderer:Of(),layout:{minimumLayoutMode:yp.VALUE_LABEL},settings:{sources:b},animations:{enabled:s.enabled,trackBy:xf.nonUpdatingNode.trackBy,compensateForLayoutChanges:xf.labels.compensateForLayoutChanges}}};function Sm(e,t,n,r){const i=[{position:e,onBackground:!0,justify:0,overflow:r}];if(t){const t={fill:"#cce6e6e6",padding:{left:2,right:2,top:2,bottom:2}};i.push({position:"inside",onBackground:!1,justify:"outside"===e?1:0,background:n?t:void 0})}return i}function Mm({chart:e,models:t,environment:n,isPrimary:r}){const{meta:i}=t.layoutService,o="rtl"===n.options.direction,a=t.themeService.getStyles(),s=t.styleModel.query.bar.label.getStyle(),l=t.layoutService.getLayoutValue("dataPoint",{}),c=r?Xf.PRIMARY:Xf.SECONDARY;if(0===(r?t.seriesModel.meta.primaryBarSeriesCount:t.seriesModel.meta.secondaryBarSeriesCount)||!vm(l,i))return!1;const u=!ym(l,i),d=s.useContrastColor,f=e.formatter(r?Kf.FORMATTER.PRIMARY:Kf.FORMATTER.SECONDARY)||(e=>e),h=e=>f(e),p={label:e=>0===e.data.sumOfPositives.value&&0!==e.data.sumOfNegatives.value?"":h(e.data.sumOfPositives.value),simplifiedPlacements:Sm("outside",u,d,i.isContinuous),style:a.label.value},m={label:e=>0===e.data.sumOfNegatives.value&&0!==e.data.sumOfPositives.value?"":h(e.data.sumOfNegatives.value),simplifiedPlacements:Sm("opposite",u,d,i.isContinuous),style:a.label.value},g=[mm(t,p),mm(t,m)];return{type:"labels",key:`${Kf.COMPONENT.STACK_BAR_LABEL}-${c}`,renderer:Of(),layout:{displayOrder:2,minimumLayoutMode:yp.VALUE_LABEL},settings:{sources:[{component:`${Kf.COMPONENT.STACK_BAR}-${c}`,selector:"rect",strategy:{type:"bar",settings:{direction:e=>gm(e.data.sumOfPositives.value,t.dockService.meta.minor.orientation,o),labels:g,fontSize:parseInt(s.fontSize,10),fontFamily:s.fontFamily}}}]},animations:{enabled:t.animationsModel.enabled,trackBy:xf.nonUpdatingNode.trackBy,compensateForLayoutChanges:xf.labels.compensateForLayoutChanges}}}var wm=Object.freeze({__proto__:null,hasMaxHat:function(e,t){const{hasExplicitMax:n}=t.meta,{max:r}=t.explicit;return!!n&&e>r&&r>0},hasMinHat:function(e,t){const{hasExplicitMin:n}=t.meta,{min:r}=t.explicit;return!!n&&e<r&&r<0}});const Em={min:"Min",max:"Max"};function km({chart:e,models:t,type:n,viewCache:r,viewState:i,isPrimary:o}){const{layoutService:a,dockService:s,primaryExtremumModel:c,secondaryExtremumModel:u,styleModel:d,discreteModel:f}=t,{isBarSeriesStacked:h,isContinuous:p,isBarSeriesGrouped:m,isBarSeriesStackedInBothAxis:g}=a.meta,y=h?pm({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}):hm({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}),v=o?c.query.getExtrema():u.query.getExtrema(),b=n===Gp,x=o?Xf.PRIMARY:Xf.SECONDARY;if(!y)return!1;if(function(e,t){return!e.meta[`hasExplicit${Em[t]}`]}(v,n)||function(e,t,n){const r=n?e.implicit.bar.max:e.implicit.bar.min,i=Number(r.toFixed(13));return!wm[`has${Em[t]}Hat`](i,e)}(v,n,b)||function(e,t,n){const r=n?e=>e<0:e=>e>0;return e.meta[`hasExplicit${Em[t]}`]&&r(e.explicit[t])}(v,n,b))return!1;let S="end";h&&(S=b?"sumOfPositives":"sumOfNegatives");const M=function(e){let t;return()=>(void 0===t&&(t=e()),t)}(()=>e.scale(o?Kf.SCALE.MINOR.PRIMARY:Kf.SCALE.MINOR.SECONDARY)[n]());const w=(({chart:e,type:t,isPrimary:n,dock:r})=>{let i=r;const o=e.component(`${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.PRIMARY}`),a=e.component(`${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.SECONDARY}`);return o&&a&&(i=n?r:`@${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.PRIMARY}`),i})({chart:e,type:n,isPrimary:o,dock:b?s.meta.minor.end:s.meta.minor.start}),E={type:"box-sliced-hat",key:`${Kf.COMPONENT.SLICED_HAT}-${n}-${x}`,layout:{dock:w},data:y.data,settings:{orientation:y.settings.orientation,major:y.settings.major,minor:y.settings.minor,hat:l({},y.settings.box,{fill:h?"#999":y.settings.box.fill,alignment:1,opacity:1,show:function(e){const t=M(),n=function(e){if("number"!=typeof e)return e;const t=Math.round(e);return Math.abs(e-t)<1e-12?t:e}(e.datum[S].value);return b?n>t:n<t},width:dm({isContinuous:p,isBarSeriesGrouped:m,styleModel:d,discreteModel:f,isBarSeriesStackedInBothAxis:g}),strokeWidth:d.query.bar.getStrokeWidth(),stroke:d.query.bar.getStrokeColor()})},brush:Op({layoutService:a})};return E}const Cm={min:"Min",max:"Max"},Am={sumOfPositives:"sumOfNegatives",sumOfNegatives:"sumOfPositives"};function Om({chart:e,models:t,type:n,viewCache:r,viewState:i,isPrimary:o}){const{layoutService:a,dockService:s,primaryExtremumModel:c,secondaryExtremumModel:u,themeService:d,animationsModel:f}=t,{end:h,start:p}=s.meta.minor,{isBarSeriesStacked:m}=a.meta,g=m?pm({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}):hm({chart:e,models:t,viewCache:r,viewState:i,isPrimary:o}),y=o?c.query.getExtrema():u.query.getExtrema(),v=n===Gp?y.implicit.bar.max:y.implicit.bar.min,b=Number(v.toFixed(13)),x=o?Xf.PRIMARY:Xf.SECONDARY;if(!g)return!1;if(!am[`is${Cm[n]}OutOfBounds`](b,y))return!1;const S=(({chart:e,type:t,end:n,start:r,isPrimary:i})=>{let o=t===Gp?n:r;const a=e.component(Kf.COMPONENT.LABEL_SPACE),s=e.component(`${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.PRIMARY}`),l=e.component(`${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.SECONDARY}`),c=e.component(`${Kf.COMPONENT.BAR_OOB}-${t}-${Xf.PRIMARY}`),u=e.component(`${Kf.COMPONENT.BAR_OOB}-${t}-${Xf.SECONDARY}`);return s?o=`@${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.PRIMARY}`:l?o=`@${Kf.COMPONENT.SLICED_HAT}-${t}-${Xf.SECONDARY}`:c&&u&&!i?o=`@${Kf.COMPONENT.BAR_OOB}-${t}-${Xf.PRIMARY}`:a&&t===Gp&&(o=`@${Kf.COMPONENT.LABEL_SPACE}`),o})({chart:e,type:n,end:h,start:p,isPrimary:o});let M="end";m&&(M=n===Gp?"sumOfPositives":"sumOfNegatives");const w={type:"box-out-of-bounds",key:`${Kf.COMPONENT.BAR_OOB}-${n}-${x}`,layout:{dock:S},data:g.data,settings:{orientation:g.settings.orientation,major:g.settings.major,minor:g.settings.minor,dockValue:E.getDockValue(n===Gp?h:p),oob:l({},g.settings.box,{fill:d.getStyles().outOfRange.color,alignment:1,opacity:1,show:function(e){if(!0===e.datum.null?.value)return!1;const t=m&&0===e.datum[M].value,r=am[`is${Cm[n]}OutOfBounds`](e.datum[M].value,y,n),i=(!t||function({type:e,item:t,prop:n,extrema:r}){const i=t.datum[Am[n]].value;return 0!==i&&am[`is${Cm[e]}OutOfBounds`](i,r,e)}({type:n,item:e,prop:M,extrema:y}))&&r;return i}})},brush:Op({layoutService:a}),animations:{enabled:f.enabled,compensateForLayoutChanges:xf.barOobs.compensateForLayoutChanges}};return w}function Nm(e){return Math.min(Math.max(0,e),1)}const Dm=({chart:e,models:t,type:n,isPrimary:r})=>{const{discreteModel:i,styleModel:o,seriesModel:a,layoutService:s}=t;if(!(r?a.meta.primaryBarSeriesCount:a.meta.secondaryBarSeriesCount))return!1;const{isBarSeriesStacked:l,isContinuous:c,isBarSeriesGrouped:u,isBarSeriesStackedInBothAxis:d}=s.meta,f=e.scale(r?Kf.SCALE.MINOR.PRIMARY:Kf.SCALE.MINOR.SECONDARY),h=r?Xf.PRIMARY:Xf.SECONDARY,p=r?t.primaryExtremumModel.query.getExtrema():t.secondaryExtremumModel.query.getExtrema(),m=n===Gp;if(!om({extrema:p,type:n}))return!1;const g=e=>e.datum.start?e.datum.start.value:e.scale.min(),y=(e,t="end")=>e.datum[t]?e.datum[t].value:g(e),v={type:"box",key:`${Kf.COMPONENT.GHOST_BAR_OOB}-${n}-${h}`,data:{filter:(()=>{if(l)return;const e=a.query.series(Gf.BAR).filter(e=>e.isPrimary===r).map(e=>e.ref);return t=>e.some(e=>e===t.end.source.field)})(),collection:l?r?Kf.COLLECTION.STACKED_TOTAL_PRIMARY:Kf.COLLECTION.STACKED_TOTAL_SECONDARY:r?Kf.COLLECTION.PRIMARY:Kf.COLLECTION.SECONDARY},settings:{orientation:t.dockService.meta.minor.orientation,major:{scale:Kf.SCALE.MAJOR,fn:Cp({layoutService:s,axis:h}),ref:c?{start:"major",end:"major"}:void 0},minor:{scale:r?Kf.SCALE.MINOR.PRIMARY:Kf.SCALE.MINOR.SECONDARY,start:{ref:"start",fn:e=>{const t=g(e);return Nm(e.scale(t))}},end:l?"max"===n?{ref:"sumOfPositives",fn:e=>{const t=y(e,"sumOfPositives");return Nm(e.scale(t))}}:{ref:"sumOfNegatives",fn:e=>{const t=y(e,"sumOfNegatives");return Nm(e.scale(t))}}:{ref:"end",fn:e=>{const t=y(e);return Nm(e.scale(t))}}},box:{width:dm({isContinuous:c,isBarSeriesGrouped:u,styleModel:o,discreteModel:i,isBarSeriesStackedInBothAxis:d}),stroke:"transparent",fill:"none",opacity:0,show:e=>{let t="end";l&&(t=m?"sumOfPositives":"sumOfNegatives");const n=e.datum[t]?e.datum[t].value:f.max();return m?n>f.max():n<f.min()}},oob:{show:!1},whisker:{show:!1},median:{show:!1},line:{show:!1}}};return v};function Tm(e,t,n,r,i){const o=[{position:e,justify:0,overflow:n,background:{padding:{left:1,right:1,top:1,bottom:1}}}];return o.push({position:"inside",onBackground:!1,justify:r||i?0:1,background:{padding:{left:2,right:2,top:2,bottom:2}}}),o}const qm=({chart:e,models:t,type:n,environment:r,isPrimary:i})=>{const{layoutService:o,dockService:a,primaryExtremumModel:s,secondaryExtremumModel:l,styleModel:c,seriesModel:u,themeService:d,animationsModel:f}=t,h=d.getStyles(),p=c.query.bar.label.getStyle(),{meta:m}=o,{isBarSeriesStacked:g}=m,y=e.formatter(i?Kf.FORMATTER.PRIMARY:Kf.FORMATTER.SECONDARY),v=o.getLayoutValue("dataPoint",{}),b="horizontal"===a.meta.major.orientation,x="rtl"===r.options.direction;if(!(i?u.meta.primaryBarSeriesCount:u.meta.secondaryBarSeriesCount)||!g&&!ym(v,m)||g&&!vm(v,m))return!1;const S=i?s.query.getExtrema():l.query.getExtrema();if(!S.meta.hasExplicit)return!1;const M=n===Gp?S.implicit.bar.max:S.implicit.bar.min;if(!(n===Gp?nm(M,S):rm(M,S)))return!1;let w=e=>Wp(e.data,e);m.isBarSeriesStacked&&(w=n===Gp?function(e){if(!0===e.data.null?.value)return"";if(nm(e.data.sumOfNegatives.value,S)){const t=0===e.data.sumOfNegatives.value?e.data.sumOfPositives.value:e.data.sumOfNegatives.value;return y?y(t):t}return""}:function(e){if(!0===e.data.null?.value)return"";if(rm(e.data.sumOfPositives.value,S)){const t=0===e.data.sumOfPositives.value?e.data.sumOfNegatives.value:e.data.sumOfPositives.value;return y?y(t):t}return""});const E={label:w,simplifiedPlacements:Tm("outside",0,m.isContinuous,b,x),style:h.label.value},k={label:w,simplifiedPlacements:Tm("opposite",0,m.isContinuous,b,x),style:h.label.value},C=[mm(t,E),mm(t,k)],A=i?Xf.PRIMARY:Xf.SECONDARY,O="horizontal"===a.meta.major.orientation?"down":"right",N=[{component:`${Kf.COMPONENT.GHOST_BAR_OOB}-${n}-${A}`,selector:"rect",strategy:{type:"bar",settings:{direction:O,labels:C,fontSize:parseInt(p.fontSize,10),fontFamily:p.fontFamily}}}];return{key:`${Kf.COMPONENT.BAR_OOB_LABEL}-${n}-${A}`,type:"labels",renderer:Of(),layout:{minimumLayoutMode:yp.VALUE_LABEL},settings:{sources:N},animations:{enabled:f.enabled,trackBy:xf.nonUpdatingNode.trackBy,compensateForLayoutChanges:xf.labels.compensateForLayoutChanges}}},Im=({chart:e,models:t,viewState:n,viewCache:r})=>[hm({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!0}),hm({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!1})],Rm=({chart:e,models:t,viewState:n,viewCache:r})=>[pm({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!0}),pm({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!1})],Lm=({chart:e,models:t,environment:n,flags:r})=>{const i=Mm({chart:e,models:t,environment:n,isPrimary:!0}),o=Mm({chart:e,models:t,environment:n,isPrimary:!1});return[xm({models:t,environment:n,isPrimary:!0}),xm({models:t,environment:n,isPrimary:!1}),i,o]},_m=({chart:e,models:t,viewCache:n,viewState:r})=>[km({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!0}),km({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!0}),km({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!1}),km({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!1})],Pm=({chart:e,models:t,viewCache:n,viewState:r})=>[Om({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!0}),Om({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!0}),Om({chart:e,models:t,type:"max",viewCache:n,viewState:r,isPrimary:!1}),Om({chart:e,models:t,type:"min",viewCache:n,viewState:r,isPrimary:!1})],zm=({chart:e,models:t})=>[Dm({chart:e,models:t,type:"max",isPrimary:!0}),Dm({chart:e,models:t,type:"min",isPrimary:!0}),Dm({chart:e,models:t,type:"max",isPrimary:!1}),Dm({chart:e,models:t,type:"min",isPrimary:!1})],Fm=({chart:e,models:t,environment:n,flags:r})=>[qm({chart:e,models:t,type:"max",environment:n,isPrimary:!0}),qm({chart:e,models:t,type:"min",environment:n,isPrimary:!0}),qm({chart:e,models:t,type:"max",environment:n,isPrimary:!1}),qm({chart:e,models:t,type:"min",environment:n,isPrimary:!1})],jm=({chart:e,environment:t,models:n,viewState:r,viewCache:i})=>{const{seriesModel:o}=n,a=o.query.series(Gf.BAR).slice(-1),s=o.query.series(Gf.LINE),l=o.query.series(Gf.MARKER);return[...Im({chart:e,models:n,viewState:r,viewCache:i}),...Rm({chart:e,models:n,viewState:r,viewCache:i}),...s.map(e=>jp({models:n,environment:t,series:e})),...s.map(e=>Up({models:n,series:e,environment:t})),...l.map(r=>Pp({chart:e,models:n,series:r,environment:t})),Yp({chart:e,models:n,environment:t,lineSeries:s}),Kp({chart:e,models:n,environment:t,markerSeries:l}),...Lm({chart:e,models:n,environment:t}),..._m({chart:e,models:n,viewCache:i,viewState:r}),...Pm({chart:e,models:n,viewCache:i,viewState:r}),...zm({chart:e,models:n}),...Fm({chart:e,models:n,environment:t}),lm({chart:e,models:n,markerSeries:l,lineSeries:s,barSeries:a,environment:t,type:"max"}),lm({chart:e,models:n,markerSeries:l,lineSeries:s,barSeries:a,environment:t,type:"min"}),Qp({chart:e,models:n,environment:t,lineSeries:s})]},$m=0,Bm=1,Vm=3;function Hm({models:e}){const{dockService:t,seriesModel:n,layoutService:r,themeService:i,animationsModel:o}=e,{auto:a,spacing:s,axis:l}=r.getLayoutValue("gridLine",{});if(!a&&s===$m)return!1;const c=i.getStyles(),u=n.meta.primarySeries.length>0;return{key:Kf.COMPONENT.GRID_LINE,type:"grid-line",layout:{minimumLayoutMode:yp.GRID_LINE},preferredSize:()=>({size:0,edgeBleed:{left:1,right:1,top:1,bottom:1}}),ticks:{show:!(!a&&s===Bm)||((e,t)=>t%2==0),stroke:c.grid.line.major.color},minorTicks:{show:!a&&s===Vm,stroke:c.grid.line.minor.color},["horizontal"===t.meta.major.orientation?"y":"x"]:0===(l??0)&&u?Kf.SCALE.MINOR.PRIMARY:Kf.SCALE.MINOR.SECONDARY,animations:{enabled:o.enabled,trackBy:xf.lines.trackBy,compensateForLayoutChanges:xf.lines.compensateForLayoutChanges}}}function Um({models:e}){const{primaryExtremumModel:t,primaryTickModel:n,themeService:r,dockService:i,seriesModel:o,secondaryExtremumModel:a,secondaryTickModel:s,layoutService:l,animationsModel:c}=e,u=0===(l.getLayoutValue("gridLine",{})?.axis??0),d=t.query.getExtrema(),f=a.query.getExtrema();if(!d.meta.includesZero&&!f.meta.includesZero)return!1;return{key:Kf.COMPONENT.ZERO_LINE,type:"ref-line",layout:{minimumLayoutMode:yp.GRID_LINE},show:()=>(()=>{const e=o.meta.primarySeries.length>0,t=o.meta.secondarySeries.length>0;return u&&e&&n.query.getMin()<=0&&n.query.getMax()>=0||!u&&t&&s.query.getMin()<=0&&s.query.getMax()>=0})(),lines:{["horizontal"===i.meta.minor.orientation?"x":"y"]:[{value:0,scale:u?Kf.SCALE.MINOR.PRIMARY:Kf.SCALE.MINOR.SECONDARY,line:{stroke:r.getStyles().grid.line.highContrast.color}}]},animations:{enabled:c.enabled,trackBy:xf.lines.trackBy,compensateForLayoutChanges:xf.lines.compensateForLayoutChanges}}}function Wm({models:e}){const{layoutService:t,themeService:n,animationsModel:r}=e,{isContinuous:i,isTime:o}=t.meta;if(!i)return[];const a=n.getStyles(),s={type:"grid-line",layout:{minimumLayoutMode:yp.GRID_LINE},ticks:{stroke:a.grid.line.major.color},minorTicks:{show:!1,stroke:a.grid.line.minor.color},animations:{enabled:r.enabled,trackBy:xf.lines.trackBy,compensateForLayoutChanges:xf.lines.compensateForLayoutChanges}};return o?[l(!0,{},s,{key:"time-inner-grid",x:{scale:Kf.SCALE.MAJOR_INNER},ticks:{stroke:a.grid.line.minor.color}}),l(!0,{},s,{key:"time-outer-grid",x:{scale:Kf.SCALE.MAJOR}})]:[l(!0,{},s,{key:"continuous-grid",x:{scale:Kf.SCALE.MAJOR},minorTicks:{show:!0}})]}function Ym({models:e}){return[Hm({models:e}),Um({models:e}),...Wm({models:e})]}function Km({models:e,environment:t,actions:n,viewCache:r}){const{alternativeService:i,layoutService:o,dockService:a,appModel:s,genericObjectModel:l,selectionService:c,styleModel:u}=e,d=o.getLayoutValue("dimensionAxis");if(!d)return!1;const{show:f}=d;if("all"!==f&&"title"!==f)return!1;const h=i.getAlternatives(),{orientation:p}=a.meta.major,m=u.query.axis.title.getStyle();return{type:"axis-title",key:Kf.COMPONENT.AXIS_TITLE.MAJOR,renderer:"react-qcm",layout:{dock:a.meta.major.dock,minimumLayoutMode:yp.AXIS_TITLE.MAJOR[p.toUpperCase()]},data:{infos:o.getHyperCubeValue("qDimensionInfo"),alternatives:h.dimensions},resources:{app:s,cache:r,model:l,selections:c.getSelectionsObject(),translator:t.translator},callbacks:{onChange:()=>{}},settings:{isDisabled:()=>!n.interact.enabled(),isRTL:"rtl"===t.options.direction,isSnapshot:o.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:m.color,fontFamily:m.fontFamily,fontSize:m.fontSize}}}}const Gm=(e,t,n)=>e.query.seriesByAxis(n).map(e=>({...t[e.refIndex],explicitColumn:e.refIndex}));function Xm({models:e,environment:t,actions:n,viewCache:r}){const{alternativeService:i,layoutService:o,dockService:a,seriesModel:s,appModel:l,genericObjectModel:c,selectionService:u,styleModel:d}=e,f=o.getLayoutValue("measureAxes");if(!f||!f.length)return[];const h=i.getAlternatives(),p=d.query.axis.title.getStyle(),{measureAxes:m}=s.meta;return m.filter(e=>e.isPrimary?"all"===f[0].show||"title"===f[0].show:"all"===f[1].show||"title"===f[1].show).map(e=>{const i=o.getHyperCube(),{isPrimary:d}=e;return{type:"axis-title",key:d?Kf.COMPONENT.AXIS_TITLE.MINOR.PRIMARY:Kf.COMPONENT.AXIS_TITLE.MINOR.SECONDARY,renderer:"react-qcm",layout:{dock:d?a.meta.minor.dock:a.meta.minorSecondary.dock,minimumLayoutMode:yp.AXIS_TITLE.MINOR},data:{infos:Gm(s,i.qMeasureInfo,d),alternatives:h.measures},resources:{app:l,cache:r,model:c,selections:u.getSelectionsObject(),translator:t.translator},callbacks:{onChange:({fromItem:e,toItem:t})=>{t.qDef.series=e.qDef.series;const n=e.qAttributeExpressions.findIndex(e=>"colorByExpression"===e.id);if(-1!==n){const r=e.qAttributeExpressions.splice(n,1)[0];t.qAttributeExpressions.unshift(r)}}},settings:{isDisabled:()=>!n.interact.enabled(),isRTL:"rtl"===t.options.direction,isSnapshot:o.meta.isSnapshot,noModelDependencies:!0,skipAttributeExpressions:!0,type:"measure"},style:{title:{fontFamily:p.fontFamily,fontSize:p.fontSize,color:p.color}}}})}function Jm({models:e,environment:t,actions:n,viewCache:r}){return[Km({models:e,environment:t,actions:n,viewCache:r}),...Xm({models:e,environment:t,actions:n,viewCache:r})]}function Zm({models:e,environment:t,viewState:n,viewCache:r}){const{discreteModel:i,layoutService:o,dockService:a,continuousModel:s,themeService:l}=e,{isSnapshot:c,isDiscrete:u,isContinuous:d}=o.meta,f="rtl"===t.options.direction;return!(c&&!d)&&function({layoutService:e,dockService:t,discrete:n,continuousDataModel:r,viewState:i,viewCache:o,themeService:a,rtl:s,scrollbarOverride:l,visualizeCache:c=!1,deviceType:u}){const d=Ch({layoutService:e,override:l});if(d.none)return!1;const{orientation:f}=t.meta.major,h={key:"scrollbar",type:"scrollbar",layout:{dock:"horizontal"===f?t.meta.minor.start:t.meta.minor.end,minimumLayoutMode:"XSMALL"},show:()=>e.meta.isContinuous?r.getDimensionCardinality()>1:n.query.getCanScroll(),settings:{orientation:f,rtl:s,isContinuous:e.meta.isContinuous,range:()=>Eh({layoutService:e,viewState:i,viewCache:o})}};d.bar&&(h.settings.style="slim",h.settings.size={area:"touch"===u?{max:16,min:16}:{max:8,min:8}},e.meta.isContinuous||(h.settings.size.thumb={min:4}));const p=a.getStyles();return p.color&&(h.style={standard:{thumb:{"border-color":p.color,opacity:.4},before:{background:p.color,opacity:.1},after:{background:p.color,opacity:.1}}}),e.meta.isDiscrete&&c&&(h.settings.injections=()=>[wh({layoutService:e,discrete:n})]),h}({viewState:n,viewCache:r,discrete:i,continuousDataModel:s,layoutService:o,dockService:a,themeService:l,rtl:f,scrollbarOverride:{predicate:()=>u,value:Mh.OPTIONS.BAR.value},deviceType:t.deviceType})}function Qm({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i}){const{layoutService:o}=t,a=hm({chart:e,models:t,viewState:n,viewCache:r,isPrimary:i});if(!a)return!1;const s=i?Xf.PRIMARY:Xf.SECONDARY;return a.key=`${Kf.COMPONENT.MINI_CHART.BAR}-${s}`,a.data.collection=o.meta.isBarSeriesStacked?i?Kf.COLLECTION.REDUCED_STACKED_PRIMARY:Kf.COLLECTION.REDUCED_STACKED_SECONDARY:i?Kf.COLLECTION.REDUCED_PRIMARY:Kf.COLLECTION.REDUCED_SECONDARY,a.settings.box.minWidthPx=void 0,a.settings.minor.scale=i?Kf.SCALE.MINOR.REDUCED_PRIMARY:Kf.SCALE.MINOR.REDUCED_SECONDARY,a.settings.major.scale=Kf.SCALE.REDUCED,a.layout={dock:"@scrollbar"},a}function eg({environment:e,models:t}){const n=t.styleModel.query.line.getStrokeDasharrayFn();return t.seriesModel.query.series(Gf.LINE).map(r=>{const i=jp({models:t,environment:e,series:r});return i.key=Dp(Kf.COMPONENT.MINI_CHART.LINE,r),i.data.collection=(e=>e.isPrimary?Kf.COLLECTION.REDUCED_PRIMARY_LINE:Kf.COLLECTION.REDUCED_SECONDARY_LINE)(r),i.settings.coordinates.minor.scale=r.isPrimary?Kf.SCALE.MINOR.REDUCED_PRIMARY:Kf.SCALE.MINOR.REDUCED_SECONDARY,i.settings.coordinates.major.scale=Kf.SCALE.REDUCED,i.settings.layers.line.strokeWidth=1,i.settings.layers.line.strokeDasharray=(...e)=>void 0===n(...e)?void 0:"1, 1",i.layout={dock:"@scrollbar"},i})}function tg({models:e,environment:t}){return e.seriesModel.query.series(Gf.MARKER).map(n=>{const r=Pp({models:e,environment:t,series:n});return r.key=Dp(Kf.COMPONENT.MINI_CHART.MARKER,n),r.data.collection=Kf.COLLECTION.REDUCED,r.settings.y.scale=n.isPrimary?Kf.SCALE.MINOR.REDUCED_PRIMARY:Kf.SCALE.MINOR.REDUCED_SECONDARY,r.settings.x.scale=Kf.SCALE.REDUCED,r.layout={dock:"@scrollbar"},r})}function ng({chart:e,models:t,viewState:n,viewCache:r,environment:i}){return ip(t)?[Qm({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!0}),Qm({chart:e,models:t,viewState:n,viewCache:r,isPrimary:!1}),...eg({environment:i,models:t}),...tg({models:t,environment:i})]:[]}function rg({models:e}){const{layoutService:t,dockService:n}=e,{isContinuous:r,isTime:i}=t.meta,o=t.getLayoutValue("dimensionAxis");if(!o||"none"===o.show||"title"===o.show)return[!1];if(!r)return[!1];const a=yp.AXIS.MAJOR[n.meta.major.orientation.toUpperCase()];return i?[{type:"axis-overlay",key:Kf.COMPONENT.AXIS_OVERLAY.TIME_INNER,scale:Kf.SCALE.MAJOR_INNER,layout:{dock:`@${Kf.COMPONENT.AXIS.TIME_INNER}`,minimumLayoutMode:a}},{type:"axis-overlay",key:Kf.COMPONENT.AXIS_OVERLAY.TIME_OUTER,scale:Kf.SCALE.MAJOR,layout:{dock:`@${Kf.COMPONENT.AXIS.TIME_OUTER}`,minimumLayoutMode:a}}]:[{type:"axis-overlay",key:Kf.COMPONENT.AXIS_OVERLAY.CONTINUOUS,scale:Kf.SCALE.MAJOR,layout:{dock:`@${Kf.COMPONENT.AXIS.MAJOR_CONTINUOUS}`,minimumLayoutMode:a}}]}function ig({chart:e,models:t,environment:n}){const{refLineModel:r,layoutService:i,colorService:o,dockService:a,themeService:s,appLayoutModel:l,seriesModel:c,animationsModel:u}=t,d=l.qLocaleInfo,{options:f,theme:h}=n,p="rtl"===f.direction,m=c.query.series(Gf.BAR).filter(e=>e.isPrimary),g=c.query.series(Gf.BAR).filter(e=>!e.isPrimary),y=c.query.series(Gf.LINE),v=c.query.series(Gf.MARKER),b=c.query.all(),x=b.some(e=>e.isPrimary),S=b.some(e=>!e.isPrimary),M=x&&S,w={resolveUIColor:o.getPaletteColor},E=u.enabled,k=x?Cf({refLineModel:r,layoutService:i,colorModel:w,dock:M?a.meta.minor.dock:a.meta.minor.opposite,scale:Kf.SCALE.MINOR.PRIMARY,style:s.getStyles(),formatter:Kf.FORMATTER.PRIMARY,theme:h,localeInfo:d,rtl:p,key:Kf.COMPONENT.PRIMARY_MEASURE_AXIS_REF_LINE_LABEL,animationsEnabled:E}):[],C=S?Cf({refLineModel:r,layoutService:i,colorModel:w,dock:M?a.meta.minor.opposite:a.meta.minor.dock,scale:Kf.SCALE.MINOR.SECONDARY,style:s.getStyles(),formatter:Kf.FORMATTER.SECONDARY,theme:h,localeInfo:d,rtl:p,key:Kf.COMPONENT.SECONDARY_MEASURE_AXIS_REF_LINE_LABEL,path:"refLine.refLines2",animationsEnabled:E}):[];return[!!x&&kf({refLineModel:r,layoutService:i,colorModel:w,dockService:a,chart:e,scale:Kf.SCALE.MINOR.PRIMARY,axis:"horizontal"===a.meta.major.orientation?"y":"x",key:Kf.COMPONENT.PRIMARY_MEASURE_AXIS_REF_LINE,minimumLayoutMode:yp.REFERENCE_LINE,animationsEnabled:E}),!!S&&kf({refLineModel:r,layoutService:i,colorModel:w,dockService:a,chart:e,scale:Kf.SCALE.MINOR.SECONDARY,axis:"horizontal"===a.meta.major.orientation?"y":"x",key:Kf.COMPONENT.SECONDARY_MEASURE_AXIS_REF_LINE,path:"refLine.refLines2",minimumLayoutMode:yp.REFERENCE_LINE,animationsEnabled:E}),kf({isDimension:!0,refLineModel:r,layoutService:i,colorModel:w,dockService:a,chart:e,scale:Kf.SCALE.MAJOR,axis:"horizontal"===a.meta.major.orientation?"x":"y",rtl:p,key:Kf.COMPONENT.DIMENSION_REF_LINE,mainComponentKey:m.length?`${Kf.COMPONENT.BAR}-${Xf.PRIMARY}`:g.length?`${Kf.COMPONENT.BAR}-${Xf.SECONDARY}`:y.length?`${Kf.COMPONENT.LINE}-${y[0].id}`:v.length?`${Kf.COMPONENT.MARKER}-${v[0].id}`:`${Kf.COMPONENT.BAR}-${Xf.PRIMARY}`,minimumLayoutMode:yp.REFERENCE_LINE,animationsEnabled:E}),...k,...C,...Cf({isDimension:!0,refLineModel:r,layoutService:i,colorModel:w,dock:a.meta.major.opposite,scale:Kf.SCALE.MAJOR,style:s.getStyles(),theme:h,localeInfo:d,rtl:p,key:Kf.COMPONENT.DIMENSION_REF_LINE_LABEL,animationsEnabled:E})]}function og({layoutService:e}){return!!ip({layoutService:e})&&{type:"range",key:"range-brush-highlighter",layout:{dock:"@scrollbar"},settings:{scale:Kf.SCALE.REDUCED,brush:"selection",fill:"#6CB33F",opacity:.2}}}function ag(e){return e?.type||Gf.BAR}function sg({models:e,environment:t}){const{layoutService:n,colorService:r,dockService:i,seriesModel:o,selectionService:a}=e,{hasLineSeries:s,isContinuous:l,hasMultipleMeasures:c,isGroupedByMeasure:u,isLineStacked:d}=n.meta;if(!s)return!1;const{options:f}=t,h=n.getLayoutValue("color",{}),p=e=>e.filter(e=>ag(e)===Gf.LINE).map(e=>({key:Dp(Kf.COMPONENT.LINE,e),typeIndex:e.typeIndex})),m=!h.auto&&"byMeasure"===h.mode&&h.byMeasureDef&&void 0!==h.byMeasureDef.activeMeasureIndex,g=n.getHyperCubeValue("qMeasureInfo").map(e=>e.color?.on);return{type:"brush-highlighter",key:"brush-highlighter",data:{collection:Kf.COLLECTION.LINE},settings:{getSelectionInfo:()=>a?.getSelectionInfo?.()||{},seriesInfo:{primary:p(o.meta.primarySeries),secondary:p(o.meta.secondarySeries)},selectionValues:{"qHyperCube/qDimensionInfo/0":l?e=>e.value:e=>e.major.value,"qHyperCube/qDimensionInfo/0:numeric":e=>e.major.value,"qHyperCube/qDimensionInfo/0/qAttrExprInfo/0":e=>e.end.value,"qHyperCube/qMeasureInfo/X":e=>e.end.value},colorSettings:e=>r.getSettingsForMeasure(e),colorByData:e=>!g[e]&&m,hasMultipleMeasures:c,groupedByMeasure:u,itemsPerGroup:o.meta.barSeriesCount,isLineStacked:d,orientation:i.meta.major.orientation,rtl:"rtl"===f.direction}}}function lg({models:{fieldModel:e}}){return{[Kf.FORMATTER.PRIMARY]:{data:{fields:e.main.minorsPrimary}},[Kf.FORMATTER.SECONDARY]:{data:{fields:e.main.minorsSecondary}}}}var cg={MAX_NUM_POINTS:5e4,DEFAULT_NUM_POINTS:2e3,DEFAULT_NUM_LINES:12};const{DEFAULT_NUM_POINTS:ug}=cg;function dg({layoutService:e,largeDataService:t}){const{maxNumPoints:n=ug}=t?.meta||{},{qHyperCube:r}=e.getLayout();return r.qSize.qcy*r.qMeasureInfo.length>n}const{DEFAULT_NUM_LINES:fg}=cg,hg=({layoutService:e,largeDataService:t})=>{const{maxNumLines:n=fg}=t?.meta||{},{qHyperCube:r}=e.getLayout();return r.qDimensionInfo.length>1&&!dg({layoutService:e,largeDataService:t})?e.meta.size.dimensions[1]+1:n},{DEFAULT_NUM_POINTS:pg}=cg,{MAX_NUM_POINTS:mg,DEFAULT_NUM_POINTS:gg,DEFAULT_NUM_LINES:yg}=cg,{DEFAULT_NUM_POINTS:vg}=cg,bg=({layoutService:e,largeDataService:t})=>{if(!dg({layoutService:e,largeDataService:t})){const{maxNumPoints:e=vg}=t?.meta||{};return e}const{dimensionCount:n}=e.meta;return n>1?(({layoutService:e,largeDataService:t})=>{const{dimensions:n=[]}=e?.meta?.size||{},{maxNumLines:r=yg,maxNumPoints:i=gg,hasInjectedData:o=!1}=t?.meta||{};if(hg({layoutService:e,largeDataService:t})*n[0]<=i)return n[0];const a=Math.max(1,Math.min(r,n[1])),s=i/a,l=Math.floor(n[0]<=s?s:s/4),c=2*a*(a+1);return o&&(a>yg||i>gg)?Math.min(l,Math.ceil(mg/c)):l})({layoutService:e,largeDataService:t}):(({layoutService:e,largeDataService:t})=>{const{maxNumPoints:n=pg}=t?.meta||{},{measureCount:r=1}=e?.meta||{},i=4+2*(r-1);return Math.floor(n/(r*i))})({layoutService:e,largeDataService:t})};function xg({model:e,layoutService:t,largeDataService:n,definitionPath:r="/qHyperCubeDef"}){return{shouldFetchReduced:()=>dg({layoutService:t,largeDataService:n}),computeNbrOfBins:()=>bg({layoutService:t,largeDataService:n}),computeMaxNumberLines:()=>hg({layoutService:t,largeDataService:n}),fetch:(i,o)=>(({start:e,end:t,model:n,layoutService:r,largeDataService:i,definitionPath:o})=>{const a={qStart:e,qEnd:t,qNbrPoints:bg({layoutService:r,largeDataService:i}),qMaxNbrTicks:300,qMaxNumberLines:hg({layoutService:r,largeDataService:i})};return n.getHyperCubeContinuousData(o,a,!1)})({start:i,end:o,model:e,layoutService:t,largeDataService:n,definitionPath:r})}}function Sg(e={}){const{cache:t={}}=e;return{fetch:()=>Promise.resolve(t.merged)}}function Mg({layoutService:e,viewCache:t}){return{fetch:()=>{const{qAxisData:t,qDataPages:n}=e.getHyperCube();return Promise.resolve({qAxisData:t,qDataPages:n})},getSnapshotData(){const n=e.getLayoutValue("snapshotData.content.chartData",{});return"zoom"in n&&"min"in n.zoom&&"max"in n.zoom?function({zoom:e}){return{zoom:e}}(n):function({scrollOffset:e=0,viewRange:t=0},n){let r=n+e,i=r+t;return 1===t&&0===e&&(r=n-.5,i=n+.5),{zoom:{min:r,max:i}}}(n,t.get("continuousMin"))}}}function wg(){const e=()=>{},t=[],n={};return e.set=(e,r)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1),t.push(e),n[e]=r},e.forEach=e=>{t.forEach((t,r)=>e(n[t],r))},e.has=e=>e in n,e}function Eg(e,t,n){return n[0]&&n[0][1]&&n[0][1].qElemNumber>-1?function({start:e,end:t,matrix:n}){const r=[],i=wg(),o=wg();for(let a=0;a<n.length;a++){const s=n[a],l=s[1].qElemNumber.toString();s[0].qNum<e?i.set(l,s):s[0].qNum>t&&(o.has(l)||o.set(l,s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i.forEach((e,t)=>r.splice(t,0,e)),o.forEach(e=>r.push(e)),r}({start:e,end:t,matrix:n}):function({start:e,end:t,matrix:n}){const r=[];let i,o;for(let a=0;a<n.length;a++){const s=n[a];s[0].qNum<e?i=s:s[0].qNum>t&&(o||(o=s)),s[0].qNum>=e&&s[0].qNum<=t&&r.push(s)}return i&&r.unshift(i),o&&r.push(o),r}({start:e,end:t,matrix:n})}function kg(e,t){return{...e,qWidth:t[0]?t[0].length:0,qHeight:t.length}}function Cg(e,t,n){const r={qDataPages:(n.qDataPages||[]).map(n=>{const r=Eg(e,t,n.qMatrix),i=kg(n.qArea,r);return{...n,qArea:i,qMatrix:r}})};return n.qAxisData&&n.qAxisData.qAxis&&(r.qAxisData=function(e,t,n){return{qAxis:n.qAxis.map(n=>({qName:n.qName,qTags:n.qTags,qTicks:n.qTicks.reduce((n,r)=>((r.qStart>=e&&r.qStart<=t||r.qEnd>=e&&r.qEnd<=t||r.qStart<e&&r.qEnd>t)&&n.push(r),n),[])}))}}(e,t,n.qAxisData)),r}const Ag=2**.5,Og=1/Ag,Ng=Og**44;function Dg(e){return e.qIsOtherCell}function Tg({qDataPages:e=[]}={},t={}){const n=e.length?e[0].qMatrix:[];return t.isStackedByDimension?function(e){const t={};return e.forEach(e=>{if(!e.some(Dg)){const n=e[0].qElemNumber;t[n]=void 0}}),Object.keys(t).length}(n):function(e){let t=0;return e.forEach(e=>{e.some(Dg)||t++}),t}(n)}const qg={query:{getShouldProcess:()=>!1},command:{processDataPage:()=>{}}};var Ig={created(){this.state={}},beforeUpdate(){this.state={}},beforeRender({size:e}){this.state.ticks=this.scale.ticks({distance:e.width}).filter(e=>!e.isMinor),"linear"===this.scale.type&&function(e,t){const[,n]=e.domain();for(let e=0;e<t.length;e++){const r=t[e],i=t[e+1];r.data={},i||1===r.end?i?(r.data.start=r.value,r.data.end=i.value,r.end=i.position):(r.data.start=r.value,r.data.end=r.value):(r.data.start=r.value,r.data.end=n,r.end=1)}}(this.scale,this.state.ticks)},render(){const e=this.scale.data().fields.length?this.scale.data().fields[0].id():"",{ticks:t}=this.state,n=t.map(t=>({type:"rect",fill:"none",data:{source:{field:e},value:[t.data.start,t.data.end]},x:t.start*this.rect.width,y:0,width:(t.end-t.start)*this.rect.width,height:this.rect.height}));if(t.length&&t[0].start>0){const r=t[0];n.unshift({type:"rect",fill:"none",data:{source:{field:e},value:[this.scale.domain()[0],r.data.start]},x:0,y:0,width:r.start*this.rect.width,height:this.rect.height})}return n}};function Rg(e,t=1){if(t%2==0)return e;let n=Math.round(e);return e-n>0?n+=.5:n-=.5,n}function Lg(e,t){return e.x<t.x?e.x+e.width>=t.x:t.x+t.width>=e.x}function _g(e,t){const{localProps:{size:n},props:{anchor:r}}=t,i=function({props:e,localProps:{size:t},style:n,renderer:r}){const i=e.label.padding,o=Math.max(0,Math.min(e.label.justify,1)),a=Math.max(0,Math.min(e.label.align,1)),s=e=>r.measureText({text:e,fontSize:n.label.fontSize,fontFamily:n.label.fontFamily});return{resolve:(e,r)=>{const l="string"==typeof e.label?e.label:"",c=s(l);let{x:u,width:d}=r;e.start===e.end&&(d=c.width+2*i,1===e.end&&(u-=d));const f={x:u+i,y:i,width:d-2*i,height:t.height-2*i},h=s(`${l[0]}…`).width,p=Math.max(0,f.width-c.width),m=Math.max(0,f.height-c.height),g=o*p,y=a*m;return{show:f.width>=Math.min(h,c.width),text:l,dx:g,dy:y,rect:f,style:n.label,segment:{x:u+g,width:c.width+2*i},tickValue:e.value}}}}(t),o=function({localProps:{size:e},style:t,scale:n,props:r}){const[i,o]=n.domain(),a=Math.max(0,Math.min(1,r.guideLine.major.justify));return{resolve:(n,r)=>{const s=a*r.width,l=Rg(r.x+s,t.majorGuideLine.strokeWidth);return{show:n.value>=i&&n.value<=o,x1:l,y1:0,x2:l,y2:Rg(e.height,t.majorGuideLine.strokeWidth),style:t.majorGuideLine,tickValue:n.value}}}}(t),a=e.map(e=>{const t=function(e,t,n){const r=Math.abs(Math.max(e.start,0)-Math.min(e.end,1))*t.width;return{x:Math.max(e[n],0)*t.width,y:0,width:r,height:t.height}}(e,n,r);return{rect:t,label:i.resolve(e,t),guideLine:o.resolve(e,t)}});return function(e,t){const n=e.length;if(n<2)return;const r=e[n-1],i=t[n-1].label;if(r&&r.start===r.end)for(let e=n-2;e>-1;e--){const n=t[e].label;n.show=n.show&&!Lg(n.segment,i.segment)}}(e,a),a}function Pg(e,t){const n=function({localProps:{size:e},props:t,style:n}){return{resolve:r=>{const i=Math.max(e.height-t.guideLine.minor.size,0)*Math.max(0,Math.min(t.guideLine.minor.align,1)),o=Rg(r.position*e.width,n.minorGuideLine.strokeWidth);return{guideLine:{show:!0,x1:o,y1:Rg(i,n.minorGuideLine.strokeWidth),x2:o,y2:Rg(t.guideLine.minor.size+i,n.minorGuideLine.strokeWidth),style:n.minorGuideLine}}}}}(t);return t.props.guideLine.minor.show?e.map(n.resolve):[]}function zg(e){return e.filter(e=>e.show).map(e=>l({strokeWidth:1},e.style,{type:"line",x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,tickValue:e.tickValue}))}var Fg={require:["renderer"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{anchor:"start",label:{show:!0,padding:4,align:0,justify:0},line:{show:!0},guideLine:{major:{justify:0},minor:{show:!0,size:4,align:0}}},style:{label:"$label",line:"$guide-line",majorGuideLine:"$guide-line",minorGuideLine:"$guide-line"}},preferredSize:()=>({size:30,edgeBleed:{left:1,right:1}}),init(){this.props=this.settings.settings,this.localProps={},this.state={major:[],minor:[]}},created(){this.init()},beforeUpdate(){this.init()},beforeRender({size:e}){this.localProps.size=e;const t=this.scale.ticks({distance:e.width}),n=t.filter(e=>!e.isMinor),r=t.filter(e=>e.isMinor);this.state.line=function({localProps:{size:e},style:t,props:n}){const r=Rg(1,t.line.strokeWidth);return{show:n.line.show,x1:Rg(0,t.line.strokeWidth),y1:r,x2:Rg(e.width,t.line.strokeWidth),y2:r,style:t.line}}(this),this.state.major=_g(n,this),this.state.minor=Pg(r,this)},render(){return[...zg([this.state.line]),...(e=this.state.major.map(e=>e.label),e.filter(e=>e.show).map(e=>l({},e.style,{type:"text",x:e.rect.x,y:e.rect.y,dx:e.dx,dy:e.dy,maxWidth:e.rect.width,text:e.text,title:e.text,baseline:"text-before-edge",tickValue:e.tickValue}))),...zg(this.state.major.map(e=>e.guideLine)),...zg(this.state.minor.map(e=>e.guideLine))];var e}};function jg(e,t){return e&&t&&e.qTicks.length===t.qTicks.length&&e.qTicks.every((e,n)=>e.qStart===t.qTicks[n].qStart&&e.qEnd===t.qTicks[n].qEnd)}function $g(e){return e.qTags.indexOf("$qualified")>-1}function Bg({qAxis:e}){const t=[],n=[];for(let r=0;r<e.length;r++){const i=r+1,o=e[r],a=e[i];jg(o,a)?($g(a)?(t.push(i),n.push(r)):(t.push(r),n.push(i)),r++):(t.push(r),n.push(r))}return{qualified:t,nonQualified:n}}function Vg({qualifiedMeta:e,nonQualifiedMeta:t}){return{resolve(n){let r,i=NaN,o=NaN,a=NaN,s=!1;for(let l=e.length-1;l>=0;l--){const c=e[l];if(c.queries.outer(n)){const e=t[l+1];if(i=c.index,r=l,c.attrs.isDayOrShorter()&&c.queries.canFitHalfDayTicks(n)){o="auto",s=!0;break}if(e&&e.queries.inner(n)){o=e.index;const r=t[l+2];r&&r.queries.minor(n)&&(a=r.index);break}}}if(!Number.isNaN(i)&&Number.isNaN(o)&&"auto"!==o){o=i,i=NaN;const e=t[r+1];e&&e.queries.minor(n)&&(a=e.index)}else Number.isNaN(i)&&(i="auto",o="auto");return{outer:i,inner:o,minor:a,isDayOrShorter:s}}}}function Hg({qTicks:e,measureText:t=()=>({width:0}),cache:n={},scale:r}){const i=n;return{isDayOrShorter:()=>(i.isDayOrShorter=e.length>0&&Math.abs(e[0].qStart-e[0].qEnd)<=1,i.isDayOrShorter),count:()=>e.length,maxRange:()=>(i.maxRange=e.length?Math.max(...e.map(e=>Math.abs(r(e.qStart)-r(e.qEnd)))):0,i.maxRange),rangeAndWidth(){const n=r.clamp();return r.clamp(!1),i.rangeAndWidth=e.map(e=>({range:Math.abs(r(e.qStart)-r(e.qEnd)),width:t(`${e.qText}`).width+16})),r.clamp(n),i.rangeAndWidth}}}function Ug({attrs:e,reqAutoFitWidth:t}){return{outer:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),inner:t=>!e.rangeAndWidth().some(({width:e,range:n})=>e>n*t),minor:t=>e.maxRange()*t>=6,canFitHalfDayTicks:n=>n>=t*e.count()}}function Wg({qualified:e,nonQualified:t,qAxis:n,measureText:r,reqAutoFitWidth:i,scale:o},{attributesFactory:a=Hg,queryFactory:s=Ug}={attributesFactory:Hg,queryFactory:Ug}){const l=n.map((e,t)=>function(e,t){const{qTicks:n}=e,l=a({qTicks:n,measureText:r,scale:o});return{data:e,index:t,attrs:l,queries:s({attrs:l,reqAutoFitWidth:i})}}(e,t)),c=e.map(e=>l[e]),u=t.map(e=>l[e]);return{qAxisMeta:l,qualifiedMeta:c,nonQualifiedMeta:u}}function Yg({qAxis:e=[],measureText:t=()=>({width:0}),cache:n={},reqAutoFitWidth:r=0,scale:i},{metaFactory:o=Wg,mapper:a=Bg,resolver:s=Vg}={metaFactory:Wg,mapper:Bg,resolver:Vg}){const{qualified:l,nonQualified:c}=a({qAxis:e}),{qualifiedMeta:u,nonQualifiedMeta:d}=o({qAxis:e,qualified:l,nonQualified:c,measureText:t,reqAutoFitWidth:r,scale:i}),f=s({qualifiedMeta:u,nonQualifiedMeta:d});return{resolve:t=>{const r=n.key({distance:t});if(n.get(r))return n.get(r);if(function(e){return!Array.isArray(e)||0===e.length||e.every(e=>0===e.qTicks.length)}(e))return{outer:"auto",inner:"auto",minor:NaN,isDayOrShorter:!1};const i=f.resolve(t);return n.set(r,i),i}}}function Kg(e){return new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,0,Math.round(864e5*(e-Math.floor(e)))))}const Gg=Kg(0).getTime();function Xg(e){return(e.getTime()-Gg)/86400/1e3}const Jg=new Date,Zg=new Date;function Qg(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>Qg(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(Jg.setTime(+t),Zg.setTime(+r),e(Jg),e(Zg),Math.floor(n(Jg,Zg))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const ey=1e3,ty=6e4,ny=36e5,ry=864e5,iy=6048e5,oy=Qg(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ey)},(e,t)=>(t-e)/ey,e=>e.getUTCSeconds());oy.range;const ay=Qg(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ey)},(e,t)=>{e.setTime(+e+t*ty)},(e,t)=>(t-e)/ty,e=>e.getMinutes());ay.range;const sy=Qg(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*ty)},(e,t)=>(t-e)/ty,e=>e.getUTCMinutes());sy.range;const ly=Qg(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ey-e.getMinutes()*ty)},(e,t)=>{e.setTime(+e+t*ny)},(e,t)=>(t-e)/ny,e=>e.getHours());ly.range;const cy=Qg(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ny)},(e,t)=>(t-e)/ny,e=>e.getUTCHours());cy.range;const uy=Qg(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ty)/ry,e=>e.getDate()-1);uy.range;const dy=Qg(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ry,e=>e.getUTCDate()-1);dy.range;const fy=Qg(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ry,e=>Math.floor(e/ry));function hy(e){return Qg(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ty)/iy)}fy.range;const py=hy(0),my=hy(1),gy=hy(2),yy=hy(3),vy=hy(4),by=hy(5),xy=hy(6);function Sy(e){return Qg(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/iy)}py.range,my.range,gy.range,yy.range,vy.range,by.range,xy.range;const My=Sy(0),wy=Sy(1),Ey=Sy(2),ky=Sy(3),Cy=Sy(4),Ay=Sy(5),Oy=Sy(6);My.range,wy.range,Ey.range,ky.range,Cy.range,Ay.range,Oy.range;const Ny=Qg(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth());Ny.range;const Dy=Qg(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth());Dy.range;const Ty=Qg(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ty.every=e=>isFinite(e=Math.floor(e))&&e>0?Qg(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,Ty.range;const qy=Qg(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());qy.every=e=>isFinite(e=Math.floor(e))&&e>0?Qg(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,qy.range;const Iy=1,Ry=2,Ly=3,_y=4,Py=5,zy=6;function Fy({timeScale:e,labels:t,distance:n,isDayOrShorter:r,cache:i,timeOnly:o,initialMin:a}){const[s,l]=e.domain(),c=i.key({distance:n});let u;i.get(c,1)?u=i.get(c,1):(u=function(e,t,n,r,i,o){function a(e){return qy.filter(t=>(t.getUTCFullYear()-o.getUTCFullYear())%e===0)}const s=oy.count(e,t),l=sy.count(e,t),c=cy.count(e,t),u=dy.count(e,t),d=My.count(e,t),f=Dy.count(e,t),h=qy.count(e,t),p=n/r.second.width-1,m=n/r.minute.width-1,g=n/r.date.width-1,y=n/r.year.width-1,v={type:"year",desc:"year",count:h,interval:qy.every(1),formatter:r.year.formatter,offset:e=>qy.offset(e,-1),floor:qy.floor};if(s<=p)v.type=Iy,v.desc="second",v.count=s,v.interval=oy.every(1),v.formatter=r.second.formatter,v.offset=e=>oy.offset(e,-1),v.floor=oy.floor;else if(s/2<=p)v.type=Iy,v.desc="every other second",v.count=s/2,v.interval=oy.every(2),v.formatter=r.second.formatter,v.offset=e=>oy.offset(e,-2),v.floor=oy.floor;else if(s/5<=p)v.type=Iy,v.desc="every 5 second",v.count=s/5,v.interval=oy.every(5),v.formatter=r.second.formatter,v.offset=e=>oy.offset(e,-5),v.floor=oy.floor;else if(s/15<=p)v.type=Iy,v.desc="every 15 second",v.count=s/15,v.interval=oy.every(15),v.formatter=r.second.formatter,v.offset=e=>oy.offset(e,-15),v.floor=oy.floor;else if(s/30<=p)v.type=Iy,v.desc="every 30 second",v.count=s/30,v.interval=oy.every(30),v.formatter=r.second.formatter,v.offset=e=>oy.offset(e,-30),v.floor=oy.floor;else if(l<=m)v.type=Ry,v.desc="minute",v.count=l,v.interval=sy.every(1),v.formatter=r.minute.formatter,v.offset=e=>sy.offset(e,-1),v.floor=sy.floor;else if(l/2<=m)v.type=Ry,v.desc="every 2 minute",v.count=l/2,v.interval=sy.every(2),v.formatter=r.minute.formatter,v.offset=e=>sy.offset(e,-2),v.floor=sy.floor;else if(l/5<=m)v.type=Ry,v.desc="every 5 minute",v.count=l/5,v.interval=sy.every(5),v.formatter=r.minute.formatter,v.offset=e=>sy.offset(e,-5),v.floor=sy.floor;else if(l/10<=m)v.type=Ry,v.desc="every 10 minute",v.count=l/10,v.interval=sy.every(10),v.formatter=r.minute.formatter,v.offset=e=>sy.offset(e,-10),v.floor=sy.floor;else if(l/15<=m)v.type=Ry,v.desc="every 15 minute",v.count=l/15,v.interval=sy.every(15),v.formatter=r.minute.formatter,v.offset=e=>sy.offset(e,-15),v.floor=sy.floor;else if(l/30<=m)v.type=Ry,v.desc="every 30 minute",v.count=l/30,v.interval=sy.every(30),v.formatter=r.minute.formatter,v.offset=e=>sy.offset(e,-30),v.floor=sy.floor;else if(c<=m)v.type=Ly,v.desc="hour",v.count=c,v.interval=cy.every(1),v.formatter=r.minute.formatter,v.offset=e=>cy.offset(e,-1),v.floor=cy.floor;else if(c/2<=m)v.type=Ly,v.desc="every 2 hour",v.count=c/2,v.interval=cy.every(2),v.formatter=r.minute.formatter,v.offset=e=>cy.offset(e,-2),v.floor=cy.floor;else if(c/3<=m)v.type=Ly,v.desc="every 3 hour",v.count=c/3,v.interval=cy.every(3),v.formatter=r.minute.formatter,v.offset=e=>cy.offset(e,-3),v.floor=cy.floor;else if(c/6<=m)v.type=Ly,v.desc="every 6 hour",v.count=c/6,v.interval=cy.every(6),v.formatter=r.minute.formatter,v.offset=e=>cy.offset(e,-6),v.floor=cy.floor;else if(c/12<=m||i)v.type=Ly,v.desc="every 12 hour",v.count=c/12,v.interval=cy.every(12),v.formatter=r.minute.formatter,v.offset=e=>cy.offset(e,-12),v.floor=cy.floor;else if(u<=g)v.type=_y,v.desc="day",v.count=u,v.interval=dy.every(1),v.formatter=r.date.formatter,v.offset=e=>dy.offset(e,-1),v.floor=dy.floor;else if(u/2<=g)v.type=_y,v.desc="every 2 day",v.count=u/2,v.interval=dy.every(2),v.formatter=r.date.formatter,v.offset=e=>dy.offset(e,-2),v.floor=dy.floor;else if(u/3<=g)v.type=_y,v.desc="every 3 day",v.count=u/3,v.interval=dy.every(3),v.formatter=r.date.formatter,v.offset=e=>dy.offset(e,-3),v.floor=dy.floor;else if(d<=g)v.type=_y,v.desc="week",v.count=d,v.interval=My.every(1),v.formatter=r.date.formatter,v.offset=e=>My.offset(e,-1),v.floor=dy.floor;else if(d/2<=g)v.type=_y,v.desc="every 2 week",v.count=d/2,v.interval=My.every(2),v.formatter=r.date.formatter,v.offset=e=>My.offset(e,-2),v.floor=dy.floor;else if(f<=g)v.type=Py,v.desc="month",v.count=f,v.interval=Dy.every(1),v.formatter=r.date.formatter,v.offset=e=>Dy.offset(e,-1),v.floor=dy.floor;else if(f/3<=g)v.type=Py,v.desc="quarter",v.count=f/3,v.interval=Dy.every(3),v.formatter=r.date.formatter,v.offset=e=>Dy.offset(e,-3),v.floor=dy.floor;else if(f/6<=g)v.type=Py,v.desc="half year",v.count=f/6,v.interval=Dy.every(6),v.formatter=r.date.formatter,v.offset=e=>Dy.offset(e,-6),v.floor=dy.floor;else if(h<=y)v.type=zy,v.desc="year",v.count=h,v.interval=qy.every(1),v.formatter=r.year.formatter,v.offset=e=>qy.offset(e,-1),v.floor=qy.floor;else if(h/2<=y)v.type=zy,v.desc="every 2 year",v.count=h/2,v.interval=a(2),v.formatter=r.year.formatter,v.offset=e=>qy.offset(e,-2),v.floor=qy.floor;else if(h/5<=y)v.type=zy,v.desc="every 5 year",v.count=h/5,v.interval=a(5),v.formatter=r.year.formatter,v.offset=e=>qy.offset(e,-5),v.floor=qy.floor;else if(h/10<=y)v.type=zy,v.desc="every 10 year",v.count=h/10,v.interval=a(10),v.formatter=r.year.formatter,v.offset=e=>qy.offset(e,-10),v.floor=qy.floor;else{const e=Math.max(1,Math.floor(h/y));v.type=zy,v.desc="every nth year",v.count=e,v.interval=a(e),v.formatter=r.year.formatter,v.offset=t=>qy.offset(t,-e),v.floor=qy.floor}return v}(s,l,n,t.all(),r,a),i.set(c,u,1));const d=e.ticks(u.interval);d.length?s.getTime()!==d[0].getTime()&&d.unshift(u.offset(d[0])):d.push(u.floor(s));const f=d.map((e,t,n)=>{const r=n[t+1]?n[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+r),formatter:u.formatter}});let h=[];if(!o&&u.type<=Ly){const n=t.getFormat("date"),r=e.ticks(dy.every(1));r.length&&s.getUTCDate()!==r[0].getUTCDate()&&r.unshift(dy.offset(r[0],-1)),h=(r.length?r:[dy.floor(s)]).map((e,t,r)=>{const i=r[t+1]?r[t+1]-e:l-e;return{start:e,end:new Date(e.getTime()+i),formatter:n.formatter}})}return{inner:f,outer:h}}const jy=86400,$y=1440,By={};function Vy(e,t,n,r){return{type:e,start:new Date(Date.UTC(...t)),end:new Date(Date.UTC(...n)),formatter:r}}function Hy(e,t,n){const{generator:r,anchor:i,clamp:o,level:a}=t.ticks,{qNumFormat:s}=t.formatter;e.clamp(o);const[l,c]=e.domain(),u=wi().domain([Kg(l),Kg(c)]);u.clamp(o),u.range(t.invert?[1,0]:[0,1]);const d="object"==typeof r?r:{type:r};let f;f="d3"===d.type?(e,i)=>Fy({timeScale:u,labels:n,distance:e,isDayOrShorter:i,cache:t.cache,timeOnly:"T"===s.qType,initialMin:void 0===d.initialMin?u.domain()[0]:Kg(r.initialMin)}):e=>function(e,t,n,r,i,o=!1){if(By[[t,n,r,r,o]])return By[[t,n,r,r,o]];const a={year:e.getFormat("year"),date:e.getFormat("date"),minute:e.getFormat("minute"),second:e.getFormat("second")},s=Kg(n),l=s.getFullYear(),c=s.getMonth(),u=s.getDate(),d=r-n,f=t/(i-r),h=f/1440,p=f/jy,m=366*f,g=3*f*30,y=a.second.width/p,v=a.minute.width/h,b=a.date.width/g,x=a.year.width/m;let S,M,w,E=0,k=0,C=null,A=null,O=null,N=null,D=null,T=null;const q={outer:[],inner:[]};for(y<1?(C=1,k=1/jy):y<2?(C=2,k=1/jy*2):y<5?(C=5,k=1/jy*5):y<10?(C=10,k=.00011574074074074073):y<30?(C=30,k=.0003472222222222222):v<1?(A=1,k=1/$y):v<2?(A=2,k=1/$y*2):v<5?(A=5,k=1/$y*5):v<10?(A=10,k=.006944444444444445):v<30?(A=30,k=.020833333333333336):v<60?(O=1,k=1/24):v<120?(O=2,k=2/24):v<360?(O=6,k=.25):v<720?(O=12,k=.5):b<1/90?(k=1,N=1):b<2/90?(k=2,N=2):b<7/90?(k=7,N=7):b<31/90?(D=1,k=31):b<1?(D=3,k=90):x<1?(T=1,k=366):x<2?(T=2,k=732):x<5?(T=5,k=1826.25):(T=10,k=3652.5),M=Math.floor((d+n%1)/k);E<i;){w=M+1,S=T?Vy("year",[l+M*T,0,1],[l+w*T,0,1],a.year.formatter):D?Vy("month",[l,c+M*D,1],[l,c+w*D,1],a.date.formatter):N?Vy("day",[l,c,u+M*N],[l,c,u+w*N],a.date.formatter):O?Vy("hour",[l,c,u,0+M*O],[l,c,u,0+w*O],a.minute.formatter):A?Vy("minute",[l,c,u,0,0+M*A],[l,c,u,0,0+w*A],a.minute.formatter):Vy("second",[l,c,u,0,0,0+M*C],[l,c,u,0,0,0+w*C],a.second.formatter),E=Xg(S.start),q.inner.push(S);const e=Math.floor(E);if(!(o||T||D||N)){const t={type:"day",start:Kg(e),end:Kg(e+1),formatter:a.date.formatter,qStart:e};q.outer[q.outer.length-1]&&q.outer[q.outer.length-1].qStart===t.qStart||q.outer.push(t)}M++}return q.min=r,q.max=i,By[[t,n,r,r,o]]=q,q}(n,e,d.min,l,c,"T"===s.qType);const h={transform:(t=[],{isMinor:n=!1}={})=>t.map(t=>{let r;r="start"===i?t.qStart:"end"===i?t.qEnd:(t.qStart+t.qEnd)/2;const o=e.clamp();n&&e.clamp(!1);const a=e(r),s=e(t.qStart),l=e(t.qEnd);return e.clamp(o),{value:r,position:a,start:s,end:l,label:t.qText,isMinor:n,data:n?void 0:{start:t.qStart,end:t.qEnd,scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1),generate:(t=100,n)=>f(t,n)[a].map(t=>{let n;return n="start"===i?Xg(t.start):"end"===i?Xg(t.end):(Xg(t.start)+Xg(t.end))/2,{position:u(t.start),start:u(t.start),end:u(t.end),value:n,label:t.formatter(n),isMinor:!1,data:{start:Xg(t.start),end:Xg(t.end),scaleStart:e.domain()[0]}}}).filter(e=>e.position>=0&&e.position<=1)};return h}const Uy=/t+/i;const Wy={min:NaN,max:NaN,invert:!1,qAxis:[],field:void 0,formatter:{fn:()=>e=>e,measureText:()=>({width:0,height:0}),localeInfo:{},qNumFormat:{}},ticks:{generator:"d3",level:"outer",anchor:void 0,clamp:!1},cache:{get:()=>!1,set:()=>{},key:()=>""}};function Yy(e,t){e.instance||(e.instance=t.copy(),e.instance.domain(t.domain()),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}const Ky="continuousPan";var Gy={model:function({model:e,layoutService:t,largeDataService:n,dataProcessorModel:r=qg,viewCache:i,viewState:o,definitionPath:a},s={}){const{engineFetcherFactory:c=xg,snapshotFetcherFactory:u=Mg,cacheFetcherFactory:d=Sg,cache:f={initial:{},merged:{}}}=s,h=c({model:e,layoutService:t,largeDataService:n,definitionPath:a}),p=u({layoutService:t,viewCache:i}),m=d({cache:f}),g=e=>{throw e.isHandled=!0,e};let y,v,b;return{update(e){({initialMin:v,initialMax:b}=function(e={}){let{qMin:t,qMax:n}=e;return t=Number.isNaN(+t)?0:t,n=Number.isNaN(+n)?0:n,{initialMin:t,initialMax:n}}(e.qHyperCube.qDimensionInfo[0])),i.set("continuousMin",v),i.set("continuousMax",b),i.set("minimiumZoomSpan",function(e,t){return Math.max(1e-6,(t-e)*Ng)}(v,b)),y=t.meta.isSnapshot?p:h,t.meta.isSnapshot&&({zoom:{min:v,max:b}}=p.getSnapshotData()),o.preventSet("zoom",{min:v,max:b})},updateLayout(e){const{qDataPages:n,qAxisData:r}=e;return t.setHyperCubeValue("qDataPages",n),t.setHyperCubeValue("qAxisData",r),t.setHyperCubeValue("qMode","S"),t.setHyperCubeValue("qColumnOrder",[]),e},initialFetch(){return y.fetch(v,b).then(e=>{const t=function(e){return{qDataPages:e.qDataPages.map(e=>{const t=kg(e.qArea,e.qMatrix);return{...e,qArea:t}}),qAxisData:e.qAxisData}}(e);return r.command.processDataPage({dataPage:t.qDataPages.length?t.qDataPages[0]:[]}),f.initial=t,f.merged=t,e}).then(e=>Cg(v,b,e)).then(e=>this.updateLayout(e)).catch(g)},fetch:(e,t)=>y.fetch(e,t).then(e=>function(e,t){const n={};return n.qDataPages=(e.qDataPages||[]).map((e,n)=>{const r=function(e,t){if(!t||!t.length||!t[0].length)return e;const n=t[0][0].qNum,r=t[t.length-1][0].qNum,i=[],o=[];for(let t=0,a=e.length;t<a;t++){const a=e[t][0];a.qNum<n?i.push(e[t]):a.qNum>r&&o.push(e[t])}return[...i,...t,...o]}(e.qMatrix,t.qDataPages[n].qMatrix),i=kg(e.qArea,r);return{...e,qArea:i,qMatrix:r}}),e.qAxisData&&e.qAxisData.qAxis&&(n.qAxisData=function(e,t){if(!t||!t.qAxis.length||t.qAxis.every(e=>!e.qTicks.length))return e;const n=t.qAxis.map(e=>e.qName),r=t.qAxis.map(e=>({start:e.qTicks[0].qStart,end:e.qTicks[e.qTicks.length-1].qStart})),i=t.qAxis.map(e=>({qName:e.qName,qTags:[...e.qTags],qTicks:[...e.qTicks]}));for(let t=0,o=e.qAxis.length;t<o;t++){const o=e.qAxis[t],a=n.indexOf(o.qName),s=[],l=[];if(a>-1){const{start:e,end:t}=r[a];for(let n=0,r=o.qTicks.length;n<r;n++){const r=o.qTicks[n];r.qStart<e?s.push(r):r.qStart>t&&l.push(r)}i[a].qTicks=[...s,...i[a].qTicks,...l]}}return{qAxis:i}}(e.qAxisData,t.qAxisData)),n}(f.initial,e)).then(e=>(r.command.processDataPage({dataPage:e.qDataPages.length?e.qDataPages[0]:[]}),f.merged=e,e)).then(n=>Cg(e,t,n)).catch(g),fetchFromCache:(e,t)=>m.fetch(e,t).then(n=>Cg(e,t,n)),fetchMinMaxData:()=>Promise.resolve(f.initial.qDataPages||[]),getInitialCube(){const e=t.getHyperCube();return l({},e,{...f.initial})},getInitialLayout(){const e=this.getInitialCube();return l({},t.getLayout(),{qHyperCube:e})},getDimensionCardinality:()=>Tg(f.initial,t.meta),setSnapshotData(e){const{qHyperCube:t}=e,n=r.query.getShouldProcess()?[r.query.getFilteredDataPage({dataPage:f.merged.qDataPages[0]})]:f.merged.qDataPages;t.qDataPages=n,t.qAxisData=f.merged.qAxisData}}},event:{onZoomChange:function(e,t){const{layoutService:n,continuousDataModel:r}=e;function i(e,n,i){return r[e](n,i).then(e=>(r.updateLayout(e),t(),e))}const o=yc((e,t)=>i("fetch",e,t),50);return({min:e,max:t},{min:r,max:a})=>!n.meta.isContinuous||e===r&&t===a?Promise.resolve(null):i("fetchFromCache",e,t).then(n=>(o(e,t),n))},onZoomIntercept:function({viewCache:e}){let t=NaN,n=NaN,r=NaN;return(i,o)=>(t=e.get("continuousMin"),n=e.get("continuousMax"),r=e.get("minimiumZoomSpan"),Math.abs(i.max-i.min)<r?o:{min:Math.min(i.max,Math.max(t,i.min)),max:Math.max(i.min,Math.min(n,i.max))})},onZoom:function({viewCache:e,viewState:t,chart:n},{threshold:r=50,rtl:i=!1,targetKey:o}){const a=e.get("continuousMin"),s=e.get("continuousMax");return vc((e,r)=>{const l=(e=>n.componentsFromPoint(e).filter(e=>e.key===o)[0])(e);if(l){const o=function(e,t,n){let{x:r}=e;return r-=t.element.getBoundingClientRect().left,r-=n.rect.x,Math.max(0,Math.min(1,r/n.rect.width))}(e,n,l),c=i?1-o:o,{min:u,max:d}=t.get("zoom"),f=Math.abs(d-u),h=f-(r>0?Og:Ag)*f,p=u+h*c,m=d-h*(1-c),g=p<a?a-p:0,y=m>s?m-s:0;t.set("zoom",{min:Math.max(p-y,a),max:Math.min(m+g,s)})}},r)}},interactions:{areaPan:function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i}){return{type:"Pan",key:"continuous:pan",options:{event:Ky,pointers:1,threshold:10,enable(r,i){return this.started===Ky||!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e)}},events:{[`${Ky}start`](n){n.preventDefault(),this.started=Ky;const{min:i,max:o}=r.get("zoom");this[Ky]={min:i,max:o,size:t.component(e).rect.computedInner.width,span:o-i}},[`${Ky}move`](e){e.preventDefault();const{span:t,min:n,max:o,size:a}=this[Ky],s=-e.deltaX/a;r.set("zoom",{min:Math.min(n+s*t,i.get("continuousMax")-t),max:Math.max(o+s*t,i.get("continuousMin")+t)})},[`${Ky}end`](e){e.preventDefault(),this.started=!1},[`${Ky}cancel`](e){e.preventDefault(),this.started=!1}}}}},picassoComponents:{axisOverlay:Ig,timeAxis:Fg},picassoScales:{time:function e(t,n={}){const r=function(e,t,n){const r={};return Object.keys(t).forEach(i=>{const o=e[i],a=typeof o;"function"===a?r[i]=o(n):"object"!==a||Array.isArray(o)?r[i]="undefined"===a?t[i]:o:r[i]=l(!0,{},t[i],o)}),r}(t,Wy,n),{qAxis:i}=r,o=hn(),a={instance:null,invert:!1},{min:s,max:c}=function(e,t){let n=+e.min,r=+e.max;return Number.isNaN(n)&&Number.isNaN(r)&&Array.isArray(t)&&t.length&&(n=Math.min(...t[t.length-1].qTicks.map(e=>e.qStart)),r=Math.max(...t[t.length-1].qTicks.map(e=>e.qEnd))),n===r&&(n-=.5,r+=.5),{min:Number.isNaN(+n)?0:n,max:Number.isNaN(+r)?1:r}}(r,i);let u,d,f=[];const h=function(e){return Number.isNaN(+e)?NaN:o(e)};h.ticks=({distance:e,resolve:t=u.resolve}={})=>{const n=t(e),o=n[r.ticks.level];if(Number.isNaN(+o)||(f=d.transform(i[o].qTicks,{isMinor:!1})),!Number.isNaN(+n.minor)){const e=d.transform(i[n.minor].qTicks,{isMinor:!0});f=f.concat(e)}return"auto"===o&&(f=d.generate(e,n.isDayOrShorter)),f},h.invert=e=>o.invert(e),h.domain=e=>Array.isArray(e)?o.domain(e):o.domain(),h.range=e=>Array.isArray(e)?o.range(e):o.range(),h.norm=e=>(Yy(a,h),a.instance(e)),h.normInvert=e=>(Yy(a,h),a.instance.invert(e)),h.copy=()=>e(t,n),h.clamp=(e=!0)=>(o.clamp(e),o.clamp()),h.min=()=>Math.min(s,c),h.max=()=>Math.max(s,c),o.range(r.invert?[1,0]:[0,1]),o.domain([s,c]),a.invert=r.invert;const p=function(e){const t={},{measureText:n,fn:r,localeInfo:i}=e.formatter,o={second:{type:"second",pattern:"hh:mm:ss",width:60,formatter:void 0},minute:{type:"minute",pattern:"hh:mm",width:60,formatter:void 0},date:{type:"date",pattern:"YYYY-MM-DD",width:60,formatter:void 0},year:{type:"year",pattern:"YYYY",width:60,formatter:void 0}};return i&&Uy.test(i.qTimestampFmt)&&(o.minute.pattern+=" tt",o.second.pattern+=" tt"),o.date.pattern=i&&i.qDateFmt?i.qDateFmt:o.date.pattern,Object.keys(o).forEach(e=>{o[e].formatter=r(o[e].pattern),o[e].width=Math.max(o[e].width,n(o[e].formatter(41000.2343433)).width+16)}),t.getFormat=e=>o[e],t.all=()=>o,t.getFormatFromTicks=e=>{const t=e.filter(e=>!e.isMinor),{length:n}=t;if(!n)return o.date;const r=Kg(t[0].data.start),i=Kg(t[n-1].data.start);return dy.count(r,i)/n>=1?o.date:cy.count(r,i)/n>0?o.minute:sy.count(r,i)/n>0?o.second:o.date},t}(r);return d=Hy(o.copy(),r,p),u=Yg({qAxis:i,measureText:r.formatter.measureText,reqAutoFitWidth:2*p.getFormat("minute").width,cache:r.cache,scale:h}),h.data=()=>({fields:[{formatter:h.formatter,id:()=>`qHyperCube/${r.field}`,key:()=>r.field,raw:hc(n,"fields.0.raw",()=>({}))}]}),h.formatter=()=>p.getFormatFromTicks(f).formatter,h}}};const Xy=e=>e.meta.seriesComponentKeys[0];function Jy({chart:e,models:t,actions:n,viewState:r,viewCache:i,environment:o}){const{event:{onZoom:a}}=Gy,{layoutService:s,seriesModel:l}=t,c=Xy(l),u=s.meta.isContinuous?a({chart:e,viewState:r,viewCache:i},{rtl:"rtl"===o.options.direction,threshold:50,targetKey:c}):()=>{};return{type:"native",events:{wheel(t){const r={x:t.clientX,y:t.clientY},i=e.componentsFromPoint(r);if(n.interact.enabled()){const[e]=i.filter(e=>e.key===Kf.COMPONENT.LEGEND_CATEGORICAL);((e,t)=>{if(t){const n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;t.emit(n>=0?"next":"prev"),e.preventDefault()}})(t,e)}if(n.scroll.enabled()){const[e]=i.filter(e=>e.key===c);e&&(u(r,Math.sign(-t.deltaY)),t.preventDefault())}}}}}const Zy="continuousPinchZoom";function Qy({chart:e,models:t,environment:n,viewState:r,viewCache:i,actions:o,selectables:a}){const s=Gy.interactions.areaPan,{layoutService:l,dockService:c,discreteModel:u,colorService:d,tooltipService:f}=t,h="rtl"===n.options.direction,p=f.getInteractions(),m=function({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l}){return{gestures:[..._h({componentKey:e,chart:t,actions:n,viewState:r,viewCache:i,layoutService:o,dockService:a,discrete:s,rtl:l})],native:Ph({componentKey:e,chart:t,actions:n,layoutService:o})}}({componentKey:"scrollbar",chart:e,actions:o,viewState:r,viewCache:i,discrete:u,layoutService:l,dockService:c,rtl:h}),g={type:"hammer",enable:!0,gestures:[...d.custom.legendInteractions(),...a.gestures.sort((e,t)=>(t.prio||0)-(e.prio||0)),...m.gestures,...p.gestures]},y=[Jy({chart:e,models:t,actions:o,viewState:r,viewCache:i,environment:n}),m.native,p.native];return l.meta.isDiscrete&&(g.gestures.push(...u.interactions.gestures),y.push(u.interactions.native)),l.meta.isContinuous&&g.gestures.push(s({targetKey:Xy(t.seriesModel),chart:e,actions:o,viewState:r,viewCache:i}),function({targetKey:e,chart:t,actions:n,viewState:r,viewCache:i,rtl:o}){const a={last:0},s=Gy.event.onZoom({viewCache:i,viewState:r,chart:t},{threshold:100,rtl:o,targetKey:e});return{type:"Pinch",key:"continuous:pinch-zoom",options:{event:Zy,pointers:2,threshold:0,enable:(r,i)=>!i||!!n.scroll.enabled()&&t.componentsFromPoint({x:i.center.x,y:i.center.y}).some(t=>t.key===e)},events:{[`${Zy}start`](e){a.last=e.scale,e.preventDefault()},[`${Zy}move`](e){const t=e.scale-a.last;Math.abs(t)>.01&&s(e.center,t>0?1:-1),a.last=e.scale,e.preventDefault()}}}}({targetKey:Xy(t.seriesModel),chart:e,actions:o,viewState:r,viewCache:i,rtl:h})),[g,...y]}const ev="lasso",tv=({key:e,componentTargetKey:t,requireFailure:n,recognizeWith:r},i)=>({key:`event:${e}`,type:"Pan",requireFailure:n,recognizeWith:r,options:{event:ev,enable(e,n){if(this.started===ev||!n)return!0;if(!i.actions.select.enabled()||!i.actions.lasso.enabled()||!i.actions.lasso.active())return!1;return this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(e=>e.key===t).length>0}},events:{lassostart(t){t.preventDefault(),this.started!==ev&&(i.actions.select.emit("start",ev),this.chart.component(e).emit("lassoStart",t),this.started=ev)},lassomove(t){t.preventDefault(),this.chart.component(e).emit("lassoMove",t),"function"==typeof i.updateOnMove&&i.updateOnMove(this.chart)},lassoend(t){t.preventDefault(),this.started=!1,this.chart.component(e).emit("lassoEnd",t),i.actions.select.emit("end",ev),"function"==typeof i.updateOnEnd&&i.updateOnEnd()}}});const nv=({targets:e,requireFailure:t,recognizeWith:n,components:r,eventName:i="tap"},o)=>{let a;const s=o.customTooltipModel?o.customTooltipModel.utils:void 0,l=s?o.debouncer(s.displayTooltip,s.DEBOUNCE_THRESHOLD):void 0;return{key:"event:tap",type:"Tap",requireFailure:t,recognizeWith:n,options:{event:i,interval:10,pointers:1,enable(t,n){return!n||!(!o.actions.select.enabled()&&!o.actions.tooltip.enabled())&&(a=this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).filter(t=>-1!==e.indexOf(t.key)),a.length>0)}},events:{[i](t){t.preventDefault();const n=function(e,t){const n=t.element.getBoundingClientRect();let r,i;return e.center?(({x:r}=e.center),({y:i}=e.center)):(r=e.clientX,i=e.clientY),{x:r-n.left,y:i-n.top}}(t,this.chart),c=o.hitRadius?o.hitRadius(a):0,u=c>0?{cx:n.x,cy:n.y,r:c}:n,d=o.shapesAt?o.shapesAt(u):this.chart.shapesAt(u,{components:e.map(e=>({key:e,propagation:"stop"})),propagation:"stop"}),f=this.chart.component("tooltip"),h="mouse"!==t.pointerType&&f&&f.show;if(!o.isLocked(a)&&!o.tooltipOnly&&o.actions.select.enabled()){const e=this.chart.componentsFromPoint({x:t.center.x,y:t.center.y}),n=e.some(e=>"legend-cat"===e.type);if(!d.length&&n||(this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1,o.actions.select.emit("start",i,e)),d.length&&r){this.chart.brushSelectionIncludeMax=!1,o.actions.select.brushSelectionIncludeMax=!1;const e="function"==typeof r?r(t,d):r;this.chart.brushFromShapes(d,{components:e}),o.actions.select.emit("end",i),(({largeDataService:e,chart:t})=>{(e?.meta||{}).isLargeNumPoints&&t.brush("lazySelection")._state(t.brush("selection")._state())})({largeDataService:o.largeDataService,chart:this.chart})}}if(f&&o.actions.tooltip.enabled())if(d.length){const{customTooltipModel:e}=o;if(e?.useCustomTooltip&&s.checkIfPromisesExist({customTooltipModel:e})){const n=s.getNodes(t,this.chart);l(t,f,{nodes:n,opts:o,customTooltipModel:e})}else f.emit("show",t,{nodes:d})}else h&&f.emit("hide")}}}};const rv=({key:e,requireFailure:t,recognizeWith:n,eventName:r="tap"},i)=>({prio:1,key:`event:${e}-tap`,type:"Tap",requireFailure:t,recognizeWith:n,options:{event:`${r}-${e}-tap`,interval:10,pointers:1,enable:(t,n)=>!!n&&(!!i.actions.select.enabled()&&(!(!n.target||"INPUT"!==n.target.nodeName)||!(!n.target||!n.target.hasAttribute("data-other-value"))&&(n.target.getAttribute("data-key")||"").split("-bubble")[0]===e))},events:{[`${r}-${e}-tap`](t){(t.target.getAttribute("data-key")||"").split("-bubble")[0]&&(t.preventDefault(),this.chart.component(e).emit("bubbleStart",t))}}});const iv=({eventName:e,key:t,fillTargets:n=[],requireFailure:r,recognizeWith:i},o,a)=>({key:`event:${t}`,type:"Pan",requireFailure:r,recognizeWith:i,options:{event:e,enable(r,i){if(this.started===e||!i)return!0;if(!o.actions.select.enabled())return!1;const a=this.chart.componentsFromPoint({x:i.center.x,y:i.center.y}).filter(e=>-1!==n.indexOf(e.key)),s=0===a.length&&function(e,t){const{target:n}=e.srcEvent;return!(!n||0!==(n.getAttribute("data-key")||"").indexOf(`${t}-`))}(i,t);return s?(this.started=e,!0):a.length>0}},events:{[`${e}start`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),o.actions.select.emit("start",e),this.chart.component(t).emit(`${a}Start`,n),this.started=e},[`${e}move`](e){e.preventDefault(),this.chart.component(t).emit(`${a}Move`,e),"function"==typeof o.updateOnMove&&o.updateOnMove(this.chart)},[`${e}end`](n){void 0===this.chart.brushSelectionIncludeMax&&(this.chart.brushSelectionIncludeMax=!0,o.actions.select.brushSelectionIncludeMax=!0),n.preventDefault(),this.chart.component(t).emit(`${a}End`,n),o.actions.select.emit("end",e),this.started=!1,"function"==typeof o.updateOnEnd&&o.updateOnEnd()}}});function ov(e,t){const n=function(e){const{key:t,targets:n,fillTargets:r,targetSelector:i,targetFillSelector:o,dock:a,scale:s,bubblesPlacement:l="inside",observeBrush:c=!1,multiple:u=!1,toLabel:d,onEdited:f}=e;return{key:t,type:"brush-range",layout:{dock:n.map(e=>`@${e}`).join(",")},on:f?{bubbleEnd(){f()}}:{},settings:{brush:c?{context:"selection",observe:!0}:"selection",scale:s,multiple:u,direction:"left"===a||"right"===a?"vertical":"horizontal",bubbles:{align:"left"===a||"top"===a?"end":"start",placement:l,label:d},target:{components:r,selector:i,fillSelector:o,fill:"rgba(82,204,82,0.2)"}}}}(e),r=iv(e,t,"range");return{interactions:[e.onEdited?rv(e,t):null,r].filter(Boolean),components:[n]}}const av=/axis|legend/,sv=e=>e.some(e=>av.test(e.type));function lv({actions:e,models:t}){const{seriesModel:n,layoutService:r,colorService:i,flags:o}=t,a=r.getHyperCubeValue("qDimensionInfo.0.qIsOneAndOnlyOne",!1),s=[`${Kf.COMPONENT.BAR}-${Xf.PRIMARY}`,`${Kf.COMPONENT.BAR}-${Xf.SECONDARY}`,...n.query.series(Gf.MARKER).map(e=>Dp(Kf.COMPONENT.MARKER,e)),...n.query.series(Gf.LINE).map(e=>Dp(Kf.COMPONENT.POINT,e)),Kf.COMPONENT.AXIS.MAJOR,Kf.COMPONENT.AXIS_OVERLAY.TIME_INNER,Kf.COMPONENT.AXIS_OVERLAY.TIME_OUTER,Kf.COMPONENT.AXIS_OVERLAY.CONTINUOUS,Kf.COMPONENT.LEGEND_CATEGORICAL],l=(e,t)=>{const[n]=t,{key:r}=n,i={key:r,action:e.srcEvent.ctrlKey||a?"set":"toggle",contexts:["selection"]};return-1===[Kf.COMPONENT.AXIS.MAJOR,Kf.COMPONENT.AXIS_OVERLAY.TIME_INNER,Kf.COMPONENT.AXIS_OVERLAY.TIME_OUTER,Kf.COMPONENT.AXIS_OVERLAY.CONTINUOUS,Kf.COMPONENT.LEGEND_CATEGORICAL].indexOf(r)&&(i.data=["selectionDimension"]),[i]},c={targets:s,components:l},u=e=>e.some(e=>"legend-cat"===e.type)?i.isSelectionLocked({isMeasureSelectionLocked:r.meta.isDimensionLocked}):r.meta.isDimensionLocked,d={actions:e,isLocked:u,hitRadius:e=>sv(e)?0:3,debouncer:yc,flags:o};return o.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){const t=function(e={}){return{actions:e.actions??Za.ACTIONS,components:e.components??Za.COMPONENTS,events:{onSelectStart:e.events?.onSelectStart??Za.EVENTS,onSelectEnd:e.events?.onSelectEnd??Za.EVENTS},hitRadius:e.hitRadius??Za.HIT_RADIUS,isLocked:e.isLocked??Za.IS_LOCKED,shapesAt:e.shapesAt,targets:e.targets??Za.TARGETS}}(e);return{interactions:[es(t)],components:[]}}({actions:e,components:l,hitRadius:e=>sv(e)?0:3,isLocked:u,targets:s}):function(e,t){if(!e.targets)throw new Error("Missing 'targets' property");return{interactions:[nv(e,t)],components:[]}}(c,d)}function cv({actions:e,models:t}){const{flags:n,layoutService:r,dockService:i,seriesModel:o}=t,{isDiscrete:a,isDimensionLocked:s}=r.meta;if(!a||s)return!1;const l=[...o.meta.seriesComponentKeys,Kf.COMPONENT.AXIS.MAJOR],c=[{key:l[0],contexts:["selection"],action:"set",data:["selectionDimension"]}];return n.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){const t=function(e={}){return{actions:e.actions??Va.ACTIONS,componentKey:e.componentKey??Va.COMPONENT_KEY,components:e.components??Va.COMPONENTS,dock:e.dock??Va.DOCK,enable:e.enable??Va.ENABLE,eventKey:e.eventKey??Va.EVENT_KEY,events:{onRangeStart:e.events?.onRangeStart??Va.EVENTS,onRangeMove:e.events?.onRangeMove??Va.EVENTS,onRangeEnd:e.events?.onRangeEnd??Va.EVENTS},fillTargets:e.fillTargets??Va.FILL_TARGETS,targets:e.targets??Va.TARGETS}}(e),n=function(e){return Ua({config:e,type:"area"})}(t),r=function(e){const{componentKey:t,components:n,dock:r,fillTargets:i,targets:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:o.map(e=>`@${e}`).join(",")},settings:{multiple:!0,brush:{components:n},direction:"left"===r||"right"===r?"vertical":"horizontal",bubbles:{align:"left"===r||"top"===r?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(t);return{interactions:[n],components:[r]}}({actions:e,componentKey:"discrete-range-brush",components:c,dock:i.meta.major.dock,eventKey:"discreteRange",fillTargets:[Kf.COMPONENT.AXIS.MAJOR],targets:l}):function(e,t){const n=function(e){const{key:t,targets:n,components:r,fillTargets:i,dock:o}=e;return{key:t,type:"brush-area-dir",layout:{dock:n.map(e=>`@${e}`).join(",")},settings:{multiple:!0,brush:{components:r},direction:"left"===o||"right"===o?"vertical":"horizontal",bubbles:{align:"left"===o||"top"===o?"end":"start",placement:"inside"},target:{components:i,fill:"rgba(82,204,82,0.2)"}}}}(e);return{interactions:[iv(e,t,"area")],components:[n]}}({eventName:"discreteRange",key:"discrete-range-brush",components:c,targets:l,fillTargets:[Kf.COMPONENT.AXIS.MAJOR],dock:i.meta.major.dock},{actions:e})}const uv={components:[],interactions:[]};function dv({actions:e,chart:t,models:n,isUnsupportedFeature:r}){const i=function({actions:e,models:t,isUnsupportedFeature:n}){const{flags:r,dockService:i,seriesModel:o,layoutService:a}=t,{isDimensionLocked:s,isBarSeriesStacked:l,isLineStacked:c}=a.meta;if(s||l||c||n?.("rangeSelections"))return!1;const u=[Kf.COMPONENT.AXIS.MINOR.PRIMARY,`${Kf.COMPONENT.BAR}-${Xf.PRIMARY}`,...o.query.series(Gf.MARKER).filter(e=>e.isPrimary).map(e=>Dp(Kf.COMPONENT.MARKER,e)),...o.query.series(Gf.LINE).filter(e=>e.isPrimary).map(e=>Dp(Kf.COMPONENT.POINT,e))];return r.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Ga({actions:e,componentKey:"minor-range-brush",dock:i.meta.minor.dock,eventKey:"minorRange",fillTargets:[Kf.COMPONENT.AXIS.MINOR.PRIMARY],onEdited:()=>{e.select.emit("end","minorRange")},scale:Kf.SCALE.MINOR.PRIMARY,targets:u}):ov({eventName:"minorRange",key:"minor-range-brush",targets:u,fillTargets:[Kf.COMPONENT.AXIS.MINOR.PRIMARY],dock:i.meta.minor.dock,scale:Kf.SCALE.MINOR.PRIMARY,onEdited(){e.select.emit("end","minorRange")}},{actions:e})}({actions:e,models:n,isUnsupportedFeature:r})||uv,o=function({actions:e,models:t,isUnsupportedFeature:n}){const{flags:r,dockService:i,seriesModel:o,layoutService:a}=t;if(a.meta.isDimensionLocked||a.meta.isBarSeriesStacked||n?.("rangeSelections"))return!1;const s=[Kf.COMPONENT.AXIS.MINOR.SECONDARY,`${Kf.COMPONENT.BAR}-${Xf.SECONDARY}`,...o.query.series(Gf.MARKER).filter(e=>!e.isPrimary).map(e=>Dp(Kf.COMPONENT.MARKER,e)),...o.query.series(Gf.LINE).filter(e=>!e.isPrimary).map(e=>Dp(Kf.COMPONENT.POINT,e))];return r.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Ga({actions:e,componentKey:"minor-secondary-range-brush",dock:i.meta.minorSecondary.dock,eventKey:"minorRange-secondary",fillTargets:[Kf.COMPONENT.AXIS.MINOR.SECONDARY],onEdited:()=>{e.select.emit("end","minorRange-secondary")},scale:Kf.SCALE.MINOR.SECONDARY,targets:s}):ov({eventName:"minorRange-secondary",key:"minor-secondary-range-brush",targets:s,fillTargets:[Kf.COMPONENT.AXIS.MINOR.SECONDARY],dock:i.meta.minorSecondary.dock,scale:Kf.SCALE.MINOR.SECONDARY,onEdited(){e.select.emit("end","minorRange-secondary")}},{actions:e})}({actions:e,models:n,isUnsupportedFeature:r})||uv,a=cv({actions:e,models:n})||uv,s=function({actions:e,chart:t,models:n}){const{flags:r,layoutService:i,dockService:o,seriesModel:a}=n,{isContinuous:s,isTime:l}=i.meta;if(!s)return!1;const c=l?[Kf.COMPONENT.AXIS_OVERLAY.TIME_INNER,Kf.COMPONENT.AXIS_OVERLAY.TIME_OUTER]:[Kf.COMPONENT.AXIS_OVERLAY.CONTINUOUS],u=[`${Kf.COMPONENT.BAR}-${Xf.PRIMARY}`,`${Kf.COMPONENT.BAR}-${Xf.SECONDARY}`,...a.query.series(Gf.MARKER).map(e=>Dp(Kf.COMPONENT.MARKER,e)),...a.query.series(Gf.LINE).map(e=>Dp(Kf.COMPONENT.POINT,e)),...c],d=({datum:e,data:n,scale:r})=>{const i=l?r.formatter():r.data().fields[0].formatter(),o=t.scale(Kf.SCALE.MAJOR).max(),a=t.brushSelectionIncludeMax&&e===o;return`${e!==Math.max(...n)||a?"":"<"}${i(e)}`};return r.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Ga({actions:e,componentKey:"continuous-range-brush",dock:o.meta.major.dock,eventKey:"continuousRange",fillTargets:c,multiple:!0,observeBrush:!0,scale:l?Kf.SCALE.MAJOR_INNER:Kf.SCALE.MAJOR,targets:u,toLabel:d}):ov({eventName:"continuousRange",key:"continuous-range-brush",targets:u,fillTargets:c,dock:o.meta.major.dock,scale:l?Kf.SCALE.MAJOR_INNER:Kf.SCALE.MAJOR,observeBrush:!0,multiple:!0,toLabel:d},{actions:e})}({actions:e,chart:t,models:n})||uv,l=function({actions:e,models:t}){const{flags:n,colorService:r,layoutService:i}=t,[o]=r.custom.legendComponents(),a=r.custom.wrappedScales(),{isDimensionLocked:s}=i.meta;if(s||!o)return!1;const l=`${Kf.SCALE.COLOR}Range`,{type:c,key:u}=o,d=a[l];return!("legend-seq"!==c||!d||d.min>=d.max)&&(n.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?Ga({actions:e,bubblesPlacement:"outside",componentKey:"legend-range-brush",dock:o.layout.dock,eventKey:"legendRange",fillTargets:[u],onEdited:()=>{e.select.emit("end","legendRange")},scale:l,targetFillSelector:'[id="legend-seq-ticks"]',targets:[u],targetSelector:'[id="legend-seq-target"]'}):ov({eventName:"legendRange",key:"legend-range-brush",targets:[u],fillTargets:[u],targetSelector:'[id="legend-seq-target"]',targetFillSelector:'[id="legend-seq-ticks"]',dock:o.layout.dock,scale:l,bubblesPlacement:"outside",onEdited:()=>{e.select.emit("end","legendRange")}},{actions:e}))}({actions:e,models:n})||uv;return{components:[...i.components,...o.components,...a.components,...s.components,...l.components],interactions:[...i.interactions,...o.interactions,...a.interactions,...s.interactions,...l.interactions]}}function fv({actions:e,models:t}){const{flags:n,layoutService:r,seriesModel:i}=t,{seriesComponentKeys:o}=i.meta;if(r.meta.isDimensionLocked)return{components:[],interactions:[]};const a={key:"lasso",componentTargetKey:o[0],components:o.map(e=>({key:e,action:"add",contexts:["selection"],data:["selectionDimension"]}))},s={actions:e};return n.isEnabled("VIZ_398_CHART_INTERACTION_REFACTOR")?function(e){const t=function(e={}){return{actions:e.actions??Xa.ACTIONS,componentKey:e.componentKey??Xa.COMPONENT_KEY,components:e.components??Xa.COMPONENTS,events:{onLassoStart:e.events?.onLassoStart??Xa.EVENTS,onLassoMove:e.events?.onLassoMove??Xa.EVENTS,onLassoEnd:e.events?.onLassoEnd??Xa.EVENTS},targetKeys:e.targetKeys??Xa.TARGET_KEYS}}(e),n=function(e){const{actions:t,componentKey:n,events:r,targetKeys:i}=e;return{key:"event:lasso",type:"Pan",requireFailure:void 0,recognizeWith:void 0,options:{event:Ja,enable(e,n){return this.started===Ja||!n||!!(t.select.enabled()&&t.lasso.enabled()&&t.lasso.active())&&this.chart.componentsFromPoint({x:n.center.x,y:n.center.y}).some(e=>-1!==i.indexOf(e.key))}},events:{[`${Ja}start`](e){e.preventDefault(),this.started!==Ja&&(t.select.emit("start",Ja),this.chart.component(n).emit("lassoStart",e),this.started=Ja,r.onLassoStart({chart:this.chart}))},[`${Ja}move`](e){e.preventDefault(),this.chart.component(n).emit("lassoMove",e),r.onLassoMove({chart:this.chart})},[`${Ja}end`](e){e.preventDefault(),this.started=!1,this.chart.component(n).emit("lassoEnd",e),t.select.emit("end",Ja),r.onLassoEnd({chart:this.chart})}}}}(t),r=function(e){const{components:t}=e;return{key:"lasso",type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}}(t);return{interactions:[n],components:[r]}}({actions:e,componentKey:"lasso",components:o.map(e=>({key:e,action:"add",contexts:["selection"],data:["selectionDimension"]})),targetKeys:[o[0]]}):function(e,t){if(!e.componentTargetKey)throw new Error("Missing 'componentTargetKey' property");const n={key:"lasso",...e},r=(({key:e,components:t})=>({key:e,type:"brush-lasso",layout:{displayOrder:99},settings:{brush:{components:t},lasso:{fill:"rgba(0, 0, 0, 0)",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.7},startPoint:{r:10,stroke:"rgba(77, 192, 78, 1)",strokeWidth:0,opacity:1}}}))(n);return{interactions:[tv(n,t)],components:[r]}}(a,s)}function hv({chart:e,chartModel:t,colorService:n,context:r,resources:i,viewCache:o,scales:a,models:s}){const{layoutService:l,dockService:c,themeService:u,discreteModel:d,seriesModel:f}=s,h={...n,getMain:()=>({getPaletteColor:n.getPaletteColor.bind(n)})},p=[],m=l.getLayoutValue("plugins");if(!Array.isArray(m)||0===m.length)return p;const{allSeries:g,seriesComponentKeys:v}=f.meta,[b]=v;let x;const S=m.map(e=>{if("point"===e.type){const t=g.find(t=>e.measureIndex===t.id);if(t)return{...e,component:t.type,scale:t.scale}}if("line"===e.type){const t=e.points.map(e=>{const t=g.find(t=>e.measureIndex===t.id);return t?{...e,component:t.type,scale:t.scale}:{...e,scale:g[0].scale}});return{...e,points:t}}return e});!function(e){e.forEach(e=>{e&&!e.cId&&(e.cId=y.generateId)})}(m);const M=[{key:Kf.COMPONENT.POINT,lines:!0,labels:!1,labelKeys:[Kf.COMPONENT.POINT_LABEL]},{key:Kf.COMPONENT.FORECAST_POINT,lines:!0,labels:!1,labelKeys:[Kf.COMPONENT.FORECAST_POINT_LABEL]}],w=function(e){const t=[];return e.forEach(e=>{const n=t[t.length-1],r=n?.[0],i=e?.type===r?.type,o=e?.scale===r?.scale;let a=!1;"point"===e?.type?a=o&&i:"line"===e?.type&&(a=i&&o&&!e?.showPoints&&!r?.showPoints),a?n.push(e):t.push([e])}),t}(S);return w.forEach((n,i)=>{const o=`points-addon-combo-chart-${i}`,s=`lines-addon-combo-chart-${i}`;switch(x="point"===n[0].type?n[0]?.scale||g[0]?.scale:n[0]?.points?.[0]?.scale??g[0]?.scale,n[0]?.type){case"point":p.push(qf({chart:e,chartModel:t,discreteModel:d,colorService:h,themeService:u,layoutService:l,dockService:c,rtl:r.rtl,majorScale:Kf.SCALE.MAJOR,minorScale:x,mainComponentKey:b,data:n,key:o})),M.push({key:o,lines:!1,labels:!0,fixed:!0,duplicates:!0});break;case"line":p.push(function({chart:e,chartModel:t,discreteModel:n,colorService:r,layoutService:i,dockService:o,rtl:a,majorScale:s,minorScale:l,mainComponentKey:c,data:u,key:d,scales:f={}}){if(!Array.isArray(u)||0===u.length)return!1;const h={resolveUIColor:r.getMain().getPaletteColor},p="horizontal"===o.meta.major.orientation,m=!(!p||!a),{canBeContinuous:g,isContinuous:y}=i.meta,v=i.getLayout(),b=lo.getDimensionValuesInfo({layout:v,canBeContinuous:g,discreteModel:n,layoutService:i}),x=[];u.forEach((e,t)=>{const n=(e?.points??[]).map((n,r)=>({...n,lineId:t,style:0===r?e.style:void 0}));x.push(...n)});const S={},M=[];u.forEach(e=>M.push(...(e?.points??[]).map(e=>e.dimensionValue))),M.forEach(e=>{b[e]&&(S[e]?(S[e].innerValues=b[e].innerValues,S[e].minOrder=Math.min(S[e].minOrder,b[e].minOrder),S[e].maxOrder=Math.max(S[e].maxOrder,b[e].maxOrder),S[e].isMinOrderOk=S[e].isMinOrderOk||b[e].isMinOrderOk,S[e].isMaxOrderOk=S[e].isMaxOrderOk||b[e].isMaxOrderOk):S[e]={id:b[e].id,dataNode:b[e].dataNode,qText:b[e].qText,innerValues:b[e].innerValues,minOrder:b[e].minOrder,maxOrder:b[e].maxOrder,isMinOrderOk:b[e].isMinOrderOk,isMaxOrderOk:b[e].isMaxOrderOk},S[e].numInnerValues=(S[e].maxOrder||0)-(S[e].minOrder||0)+1)});const w=x[0];x.forEach(t=>{const n=Df({point:t,dimensionValueInfo:S,layoutService:i}),r=t?.scale,o=w?.scale,a=i?.meta?.isButterfly,s=i?.meta?.isStacked,l=S[t.dimensionValue]?.dataNode;let c=n;const u=o&&r&&o!==r,d=a&&1===t.measureIndex,h=s&&Array.isArray(l);if(u)c=function(e,t,n){const r=t.min(),i=t.max(),o=n.min(),a=n.max();return i===r?o:o+(e-r)/(i-r)*(a-o)}(n,f[r]||e.scale(r),f[o]||e.scale(o));else if(d)c=-n;else if(h&&void 0!==t.measureIndex&&Array.isArray(l)){const e=l.slice(0,t.measureIndex+2),n=l[t.measureIndex+1]?.qNum;if("number"==typeof n&&0!==n){const t=Math.sign(n);c=e.reduce((e,n)=>{const r=n.qNum;return"number"==typeof r&&Math.sign(r)===t?e+r:e},0)}}t.validMeasureValue=c});const E={scale:s,fn:({datum:t})=>{const n=e.scale(s),r=t.value.dimensionValue;return y?n("string"==typeof r?""===r?void 0:+r:r):void 0!==S[r]?lo.getScaledPosition({scale:n,value:S[r].id,valueInfo:S[r],size:e.component(c)?.rect[p?"width":"height"],align:"center",invert:m,layoutService:i,isContinuous:y}):void 0}},k={scale:l,fn:({datum:e,scale:t})=>t(e.value.validMeasureValue)};return{key:d,type:"line",data:x,settings:{connect:!0,coordinates:{major:p?E:k,minor:p?k:E,layerId:({datum:e})=>e.value.lineId},layers:{curve:({datum:e})=>e.value.style?.lineCurve??"monotone",line:{strokeWidth:({datum:e})=>e.value.style?.lineThickness??3,stroke:({datum:e})=>Nf({colorModel:h,color:e.value.style?.lineColor?.color?e.value.style?.lineColor:{index:-1,color:"#000"}}),strokeDasharray:({datum:e})=>e.value.style?.lineType}}},animations:{enabled:t.query.animationsEnabled,trackBy:xf.nonUpdatingNode.trackBy,compensateForLayoutChanges:xf.lines.compensateForLayoutChanges}}}({chart:e,chartModel:t,discreteModel:d,colorService:h,layoutService:l,dockService:c,rtl:r.rtl,majorScale:Kf.SCALE.MAJOR,minorScale:x,mainComponentKey:b,data:n,key:s,scales:a})),n.forEach(n=>{n?.showPoints&&n?.points?n.points.forEach((n,i)=>{const o=`points-${i}-for-${s}`;p.push(qf({chart:e,chartModel:t,discreteModel:d,colorService:h,themeService:u,layoutService:l,dockService:c,rtl:r.rtl,majorScale:Kf.SCALE.MAJOR,minorScale:n.scale,mainComponentKey:b,data:[n],key:o})),M.push({key:o,lines:!0,labels:!0,duplicates:!0})}):n?.points&&M.push({key:s,lines:!0,labels:!1,duplicates:!0,points:n.points})})}}),p.push(function({layoutService:e,dockService:t,chartModel:n,themeService:r,configs:i,cache:o}){const a=e.getLayoutValue("plugins"),{rtl:s}=t.config,{orientation:l}=t.meta.major,{isOneDimensional:c,isStacked:u}=e.meta,d=r.getStyles();return{type:"point-label",key:"plugins-point-labels",renderer:Of(),settings:{all:!0,cache:o,configs:i,label:e=>e.value?.label?.value?e.value?.label?.value:u?e.point?.label:e.end?.label,lineId:({data:e})=>{for(let t=0;t<a.length;t++){const n=a[t];switch(n.type){case"point":if(n.cId===e.value?.cId)return n.cId;break;case"line":if(n.points.some(t=>t.cId===e.value?.cId))return n.cId}}return e.value?.cId||e.line?.value},majorValue:e=>e.value?.dimensionValue?e.value.dimensionValue:c?e.value:e.major?.value,orientation:l,pointValue:e=>e.value?.validMeasureValue,rtl:s},style:d.plugins.label,animations:{enabled:n.query.animationsEnabled,trackBy:xf.nonUpdatingNode.trackBy,compensateForLayoutChanges:xf.labels.compensateForLayoutChanges}}}({layoutService:l,dockService:c,chartModel:t,themeService:u,configs:M,cache:o})),p}function pv({picasso:e,chart:t,models:n,environment:r,flags:i,viewState:o,viewCache:a,actions:s,isUnsupportedFeature:l}){const{colorService:c,pluginService:u}=n,f=n.layoutService.getLayout(),{options:h}=r,p=function({layout:e,options:t={}}){return!(!e?.snapshotData||t.freeResize)&&{width:e.snapshotData.content.size.w,height:e.snapshotData.content.size.h}}({layout:f,options:h}),m=(g={logicalSize:p,minCenterRatio:0},{layoutModes:d.getLayoutModes(),center:void 0!==g.minCenterRatio?{minWidthRatio:g.minCenterRatio,minHeightRatio:g.minCenterRatio}:void 0,logicalSize:g.logicalSize?{align:.5,preserveAspectRatio:!0,...g.logicalSize}:void 0});var g;const y=function({chart:e,models:t,environment:n,viewState:r,viewCache:i,actions:o}){const{colorService:a,layoutService:s,dockService:l,tooltipService:c,disclaimerService:u}=t,d=function({environment:e,models:t}){const{translator:n,options:r}=e,{themeService:i,disclaimerService:o}=t,a=o.getDisclaimer();if(!a)return!1;const{fontFamily:s}=i.getStyles();return{key:"disclaimer",type:"disclaimer",renderer:"react-qcm",layout:{dock:a.alignment},settings:{isRTL:"rtl"===r.direction,label:n.get(`Object.Disclaimer.${a.key}`)},style:{fontFamily:s}}}({environment:n,models:t});return u.getHasSuppressingDisclaimer()?[d]:[...Ym({models:t}),...bp({models:t}),...jm({chart:e,models:t,environment:n,viewState:r,viewCache:i}),sg({models:t,environment:n}),...kp({models:t,environment:n}),...Jm({models:t,environment:n,actions:o,viewCache:i}),Ai({viewState:r,viewCache:i,layoutService:s,dockService:l}),...rg({models:t}),...ig({chart:e,models:t,environment:n}),Zm({models:t,environment:n,viewState:r,viewCache:i}),...a.custom.legendComponents(),og(t),...ng({chart:e,models:t,viewState:r,viewCache:i,environment:n}),...c.getComponents(),d].filter(Boolean)}({chart:t,models:n,environment:r,viewState:o,viewCache:a,actions:s}),v=function({actions:e,chart:t,models:n,isUnsupportedFeature:r}){const{layoutService:i}=n,o=i.getHyperCubeValue("qDimensionInfo.0.qIsOneAndOnlyOne",!1),a=lv({actions:e,models:n});if(o)return{components:[...a.components],gestures:[...a.interactions]};const s=dv({actions:e,chart:t,models:n,isUnsupportedFeature:r}),l=fv({actions:e,models:n});return{components:[...a.components,...s.components,...l.components],gestures:[...a.interactions,...s.interactions,...l.interactions]}}({actions:s,chart:t,models:n,isUnsupportedFeature:l}),b=function({picasso:e,models:t,viewState:n,viewCache:r,environment:i}){const{layoutService:o,fieldModel:a,primaryTickModel:s,secondaryTickModel:l,colorService:c,dockService:u}=t;return{...pp({picasso:e,models:t,viewState:n,viewCache:r,environment:i}),[Kf.SCALE.MINOR.PRIMARY]:mp({fields:a.main.minorsPrimary,tickModel:s,dockService:u,environment:i}),[Kf.SCALE.MINOR.SECONDARY]:mp({fields:a.main.minorsSecondary,tickModel:l,dockService:u,environment:i}),[Kf.SCALE.MINOR.REDUCED_PRIMARY]:gp({layoutService:o,tickModel:s,dockService:u,environment:i}),[Kf.SCALE.MINOR.REDUCED_SECONDARY]:gp({layoutService:o,tickModel:l,dockService:u,environment:i}),...c.custom.wrappedScales()}}({picasso:e,models:n,viewState:o,viewCache:a,environment:r}),x=hv({chart:t,chartModel:{query:{animationsEnabled:n.animationsModel.enabled}},colorService:c,context:{},resources:{},viewCache:a,scales:b,models:n}),S=u.extendComponents([...y,...v.components,...x]);return{collections:op({models:n}),scales:b,components:S,formatters:lg({models:n}),interactions:Qy({chart:t,models:n,environment:r,viewState:o,viewCache:a,actions:s,selectables:v}),strategy:m,palettes:c.getPalettes()}}const mv=[Kf.COMPONENT.AXIS_TITLE.MAJOR,Kf.COMPONENT.AXIS_TITLE.MINOR.PRIMARY,Kf.COMPONENT.AXIS_TITLE.MINOR.SECONDARY,Kf.COMPONENT.GRID_LINE,Kf.COMPONENT.ZERO_LINE],gv=({models:{layoutService:e,fieldModel:t,appLayoutModel:n}})=>({type:"q",key:Kf.DATA.MAIN,data:e.getHyperCube(),config:{virtualFields:t.virtuals,localeInfo:n.qLocaleInfo}}),yv=({models:{layoutService:e,fieldModel:t,continuousModel:n,appLayoutModel:r}})=>e.meta.isContinuous?[{type:"q",key:Kf.DATA.REDUCED,data:n.getInitialCube(),config:{virtualFields:t.virtuals,localeInfo:r.qLocaleInfo}}]:[];var vv,bv={exports:{}};
/*! Hammer.JS - v2.0.7 - 2016-04-22
   * http://hammerjs.github.io/
   *
   * Copyright (c) 2016 Jorik Tangelder;
   * Licensed under the MIT license */var xv=(vv||(vv=1,function(e){!function(t,n,r,i){var o,a=["","webkit","Moz","MS","ms","o"],s=n.createElement("div"),l=Math.round,c=Math.abs,u=Date.now;function d(e,t,n){return setTimeout(v(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(h(e,n[t],n),!0)}function h(e,t,n){var r;if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==i)for(r=0;r<e.length;)t.call(n,e[r],r,e),r++;else for(r in e)e.hasOwnProperty(r)&&t.call(n,e[r],r,e)}function p(e,n,r){var i="DEPRECATED METHOD: "+n+"\n"+r+" AT \n";return function(){var n=new Error("get-stack-trace"),r=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=t.console&&(t.console.warn||t.console.log);return o&&o.call(t.console,i,r),e.apply(this,arguments)}}o="function"!=typeof Object.assign?function(e){if(e===i||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==i&&null!==r)for(var o in r)r.hasOwnProperty(o)&&(t[o]=r[o])}return t}:Object.assign;var m=p(function(e,t,n){for(var r=Object.keys(t),o=0;o<r.length;)(!n||n&&e[r[o]]===i)&&(e[r[o]]=t[r[o]]),o++;return e},"extend","Use `assign`."),g=p(function(e,t){return m(e,t,!0)},"merge","Use `assign`.");function y(e,t,n){var r,i=t.prototype;(r=e.prototype=Object.create(i)).constructor=e,r._super=i,n&&o(r,n)}function v(e,t){return function(){return e.apply(t,arguments)}}function b(e,t){return"function"==typeof e?e.apply(t&&t[0]||i,t):e}function x(e,t){return e===i?t:e}function S(e,t,n){h(k(t),function(t){e.addEventListener(t,n,!1)})}function M(e,t,n){h(k(t),function(t){e.removeEventListener(t,n,!1)})}function w(e,t){for(;e;){if(e==t)return!0;e=e.parentNode}return!1}function E(e,t){return e.indexOf(t)>-1}function k(e){return e.trim().split(/\s+/g)}function C(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var r=0;r<e.length;){if(n&&e[r][n]==t||!n&&e[r]===t)return r;r++}return-1}function A(e){return Array.prototype.slice.call(e,0)}function O(e,t,n){for(var r=[],i=[],o=0;o<e.length;){var a=e[o][t];C(i,a)<0&&r.push(e[o]),i[o]=a,o++}return r=r.sort(function(e,n){return e[t]>n[t]}),r}function N(e,t){for(var n,r,o=t[0].toUpperCase()+t.slice(1),s=0;s<a.length;){if((r=(n=a[s])?n+o:t)in e)return r;s++}return i}var D=1;function T(e){var n=e.ownerDocument||e;return n.defaultView||n.parentWindow||t}var q="ontouchstart"in t,I=N(t,"PointerEvent")!==i,R=q&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),L="touch",_="mouse",P=24,z=["x","y"],F=["clientX","clientY"];function j(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){b(e.options.enable,[e])&&n.handler(t)},this.init()}function $(e,t,n){var r=n.pointers.length,o=n.changedPointers.length,a=1&t&&r-o===0,s=12&t&&r-o===0;n.isFirst=!!a,n.isFinal=!!s,a&&(e.session={}),n.eventType=t,function(e,t){var n=e.session,r=t.pointers,o=r.length;n.firstInput||(n.firstInput=B(t)),o>1&&!n.firstMultiple?n.firstMultiple=B(t):1===o&&(n.firstMultiple=!1);var a=n.firstInput,s=n.firstMultiple,l=s?s.center:a.center,d=t.center=V(r);t.timeStamp=u(),t.deltaTime=t.timeStamp-a.timeStamp,t.angle=Y(l,d),t.distance=W(l,d),function(e,t){var n=t.center,r=e.offsetDelta||{},i=e.prevDelta||{},o=e.prevInput||{};1!==t.eventType&&4!==o.eventType||(i=e.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=e.offsetDelta={x:n.x,y:n.y}),t.deltaX=i.x+(n.x-r.x),t.deltaY=i.y+(n.y-r.y)}(n,t),t.offsetDirection=U(t.deltaX,t.deltaY);var f=H(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=f.x,t.overallVelocityY=f.y,t.overallVelocity=c(f.x)>c(f.y)?f.x:f.y,t.scale=s?function(e,t){return W(t[0],t[1],F)/W(e[0],e[1],F)}(s.pointers,r):1,t.rotation=s?function(e,t){return Y(t[1],t[0],F)+Y(e[1],e[0],F)}(s.pointers,r):0,t.maxPointers=n.prevInput?t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers:t.pointers.length,function(e,t){var n,r,o,a,s=e.lastInterval||t,l=t.timeStamp-s.timeStamp;if(8!=t.eventType&&(l>25||s.velocity===i)){var u=t.deltaX-s.deltaX,d=t.deltaY-s.deltaY,f=H(l,u,d);r=f.x,o=f.y,n=c(f.x)>c(f.y)?f.x:f.y,a=U(u,d),e.lastInterval=t}else n=s.velocity,r=s.velocityX,o=s.velocityY,a=s.direction;t.velocity=n,t.velocityX=r,t.velocityY=o,t.direction=a}(n,t);var h=e.element;w(t.srcEvent.target,h)&&(h=t.srcEvent.target),t.target=h}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function B(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:l(e.pointers[n].clientX),clientY:l(e.pointers[n].clientY)},n++;return{timeStamp:u(),pointers:t,center:V(t),deltaX:e.deltaX,deltaY:e.deltaY}}function V(e){var t=e.length;if(1===t)return{x:l(e[0].clientX),y:l(e[0].clientY)};for(var n=0,r=0,i=0;i<t;)n+=e[i].clientX,r+=e[i].clientY,i++;return{x:l(n/t),y:l(r/t)}}function H(e,t,n){return{x:t/e||0,y:n/e||0}}function U(e,t){return e===t?1:c(e)>=c(t)?e<0?2:4:t<0?8:16}function W(e,t,n){n||(n=z);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return Math.sqrt(r*r+i*i)}function Y(e,t,n){n||(n=z);var r=t[n[0]]-e[n[0]],i=t[n[1]]-e[n[1]];return 180*Math.atan2(i,r)/Math.PI}j.prototype={handler:function(){},init:function(){this.evEl&&S(this.element,this.evEl,this.domHandler),this.evTarget&&S(this.target,this.evTarget,this.domHandler),this.evWin&&S(T(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&M(this.element,this.evEl,this.domHandler),this.evTarget&&M(this.target,this.evTarget,this.domHandler),this.evWin&&M(T(this.element),this.evWin,this.domHandler)}};var K={mousedown:1,mousemove:2,mouseup:4},G="mousedown",X="mousemove mouseup";function J(){this.evEl=G,this.evWin=X,this.pressed=!1,j.apply(this,arguments)}y(J,j,{handler:function(e){var t=K[e.type];1&t&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:_,srcEvent:e}))}});var Z={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Q={2:L,3:"pen",4:_,5:"kinect"},ee="pointerdown",te="pointermove pointerup pointercancel";function ne(){this.evEl=ee,this.evWin=te,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}t.MSPointerEvent&&!t.PointerEvent&&(ee="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel"),y(ne,j,{handler:function(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),i=Z[r],o=Q[e.pointerType]||e.pointerType,a=o==L,s=C(t,e.pointerId,"pointerId");1&i&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):12&i&&(n=!0),s<0||(t[s]=e,this.callback(this.manager,i,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(s,1))}});var re={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function ie(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,j.apply(this,arguments)}function oe(e,t){var n=A(e.touches),r=A(e.changedTouches);return 12&t&&(n=O(n.concat(r),"identifier")),[n,r]}y(ie,j,{handler:function(e){var t=re[e.type];if(1===t&&(this.started=!0),this.started){var n=oe.call(this,e,t);12&t&&n[0].length-n[1].length===0&&(this.started=!1),this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:L,srcEvent:e})}}});var ae={touchstart:1,touchmove:2,touchend:4,touchcancel:8},se="touchstart touchmove touchend touchcancel";function le(){this.evTarget=se,this.targetIds={},j.apply(this,arguments)}function ce(e,t){var n=A(e.touches),r=this.targetIds;if(3&t&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=A(e.changedTouches),s=[],l=this.target;if(o=n.filter(function(e){return w(e.target,l)}),1===t)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),12&t&&delete r[a[i].identifier],i++;return s.length?[O(o.concat(s),"identifier"),s]:void 0}function ue(){j.apply(this,arguments);var e=v(this.handler,this);this.touch=new le(this.manager,e),this.mouse=new J(this.manager,e),this.primaryTouch=null,this.lastTouches=[]}function de(e,t){1&e?(this.primaryTouch=t.changedPointers[0].identifier,fe.call(this,t)):12&e&&fe.call(this,t)}function fe(e){var t=e.changedPointers[0];if(t.identifier===this.primaryTouch){var n={x:t.clientX,y:t.clientY};this.lastTouches.push(n);var r=this.lastTouches;setTimeout(function(){var e=r.indexOf(n);e>-1&&r.splice(e,1)},2500)}}function he(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(t-i.x),a=Math.abs(n-i.y);if(o<=25&&a<=25)return!0}return!1}y(le,j,{handler:function(e){var t=ae[e.type],n=ce.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:L,srcEvent:e})}}),y(ue,j,{handler:function(e,t,n){var r=n.pointerType==L,i=n.pointerType==_;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)de.call(this,t,n);else if(i&&he.call(this,n))return;this.callback(e,t,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var pe=N(s.style,"touchAction"),me=pe!==i,ge="compute",ye="auto",ve="manipulation",be="none",xe="pan-x",Se="pan-y",Me=function(){if(!me)return!1;var e={},n=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(r){e[r]=!n||t.CSS.supports("touch-action",r)}),e}();function we(e,t){this.manager=e,this.set(t)}we.prototype={set:function(e){e==ge&&(e=this.compute()),me&&this.manager.element.style&&Me[e]&&(this.manager.element.style[pe]=e),this.actions=e.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var e=[];return h(this.manager.recognizers,function(t){b(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(e){if(E(e,be))return be;var t=E(e,xe),n=E(e,Se);return t&&n?be:t||n?t?xe:Se:E(e,ve)?ve:ye}(e.join(" "))},preventDefaults:function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var r=this.actions,i=E(r,be)&&!Me[be],o=E(r,Se)&&!Me[Se],a=E(r,xe)&&!Me[xe];if(i){var s=1===e.pointers.length,l=e.distance<2,c=e.deltaTime<250;if(s&&l&&c)return}if(!a||!o)return i||o&&6&n||a&&n&P?this.preventSrc(t):void 0}},preventSrc:function(e){this.manager.session.prevented=!0,e.preventDefault()}};var Ee=32;function ke(e){this.options=o({},this.defaults,e||{}),this.id=D++,this.manager=null,this.options.enable=x(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Ce(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}function Ae(e){return 16==e?"down":8==e?"up":2==e?"left":4==e?"right":""}function Oe(e,t){var n=t.manager;return n?n.get(e):e}function Ne(){ke.apply(this,arguments)}function De(){Ne.apply(this,arguments),this.pX=null,this.pY=null}function Te(){Ne.apply(this,arguments)}function qe(){ke.apply(this,arguments),this._timer=null,this._input=null}function Ie(){Ne.apply(this,arguments)}function Re(){Ne.apply(this,arguments)}function Le(){ke.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function _e(e,t){return(t=t||{}).recognizers=x(t.recognizers,_e.defaults.preset),new Pe(e,t)}function Pe(e,t){var n;this.options=o({},_e.defaults,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((n=this).options.inputClass||(I?ne:R?le:q?ue:J))(n,$),this.touchAction=new we(this,this.options.touchAction),ze(this,!0),h(this.options.recognizers,function(e){var t=this.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}function ze(e,t){var n,r=e.element;r.style&&(h(e.options.cssProps,function(i,o){n=N(r.style,o),t?(e.oldCssProps[n]=r.style[n],r.style[n]=i):r.style[n]=e.oldCssProps[n]||""}),t||(e.oldCssProps={}))}ke.prototype={defaults:{},set:function(e){return o(this.options,e),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(e){if(f(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=Oe(e,this)).id]||(t[e.id]=e,e.recognizeWith(this)),this},dropRecognizeWith:function(e){return f(e,"dropRecognizeWith",this)||(e=Oe(e,this),delete this.simultaneous[e.id]),this},requireFailure:function(e){if(f(e,"requireFailure",this))return this;var t=this.requireFail;return-1===C(t,e=Oe(e,this))&&(t.push(e),e.requireFailure(this)),this},dropRequireFailure:function(e){if(f(e,"dropRequireFailure",this))return this;e=Oe(e,this);var t=C(this.requireFail,e);return t>-1&&this.requireFail.splice(t,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(e){return!!this.simultaneous[e.id]},emit:function(e){var t=this,n=this.state;function r(n){t.manager.emit(n,e)}n<8&&r(t.options.event+Ce(n)),r(t.options.event),e.additionalEvent&&r(e.additionalEvent),n>=8&&r(t.options.event+Ce(n))},tryEmit:function(e){if(this.canEmit())return this.emit(e);this.state=Ee},canEmit:function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},recognize:function(e){var t=o({},e);if(!b(this.options.enable,[this,t]))return this.reset(),void(this.state=Ee);56&this.state&&(this.state=1),this.state=this.process(t),30&this.state&&this.tryEmit(t)},process:function(e){},getTouchAction:function(){},reset:function(){}},y(Ne,ke,{defaults:{pointers:1},attrTest:function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},process:function(e){var t=this.state,n=e.eventType,r=6&t,i=this.attrTest(e);return r&&(8&n||!i)?16|t:r||i?4&n?8|t:2&t?4|t:2:Ee}}),y(De,Ne,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var e=this.options.direction,t=[];return 6&e&&t.push(Se),e&P&&t.push(xe),t},directionTest:function(e){var t=this.options,n=!0,r=e.distance,i=e.direction,o=e.deltaX,a=e.deltaY;return i&t.direction||(6&t.direction?(i=0===o?1:o<0?2:4,n=o!=this.pX,r=Math.abs(e.deltaX)):(i=0===a?1:a<0?8:16,n=a!=this.pY,r=Math.abs(e.deltaY))),e.direction=i,n&&r>t.threshold&&i&t.direction},attrTest:function(e){return Ne.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=Ae(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),y(Te,Ne,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),y(qe,ke,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ye]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime>t.time;if(this._input=e,!r||!n||12&e.eventType&&!i)this.reset();else if(1&e.eventType)this.reset(),this._timer=d(function(){this.state=8,this.tryEmit()},t.time,this);else if(4&e.eventType)return 8;return Ee},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&4&e.eventType?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=u(),this.manager.emit(this.options.event,this._input)))}}),y(Ie,Ne,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[be]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),y(Re,Ne,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return De.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:n&P&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&4&e.eventType},emit:function(e){var t=Ae(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),y(Le,ke,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ve]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance<t.threshold,i=e.deltaTime<t.time;if(this.reset(),1&e.eventType&&0===this.count)return this.failTimeout();if(r&&i&&n){if(4!=e.eventType)return this.failTimeout();var o=!this.pTime||e.timeStamp-this.pTime<t.interval,a=!this.pCenter||W(this.pCenter,e.center)<t.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,a&&o?this.count+=1:this.count=1,this._input=e,0===this.count%t.taps)return this.hasRequireFailures()?(this._timer=d(function(){this.state=8,this.tryEmit()},t.interval,this),2):8}return Ee},failTimeout:function(){return this._timer=d(function(){this.state=Ee},this.options.interval,this),Ee},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),_e.VERSION="2.0.7",_e.defaults={domEvents:!1,touchAction:ge,enable:!0,inputTarget:null,inputClass:null,preset:[[Ie,{enable:!1}],[Te,{enable:!1},["rotate"]],[Re,{direction:6}],[De,{direction:6},["swipe"]],[Le],[Le,{event:"doubletap",taps:2},["tap"]],[qe]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Pe.prototype={set:function(e){return o(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},stop:function(e){this.session.stopped=e?2:1},recognize:function(e){var t=this.session;if(!t.stopped){var n;this.touchAction.preventDefaults(e);var r=this.recognizers,i=t.curRecognizer;(!i||i&&8&i.state)&&(i=t.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===t.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(e),!i&&14&n.state&&(i=t.curRecognizer=n),o++}},get:function(e){if(e instanceof ke)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event==e)return t[n];return null},add:function(e){if(f(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),e.manager=this,this.touchAction.update(),e},remove:function(e){if(f(e,"remove",this))return this;if(e=this.get(e)){var t=this.recognizers,n=C(t,e);-1!==n&&(t.splice(n,1),this.touchAction.update())}return this},on:function(e,t){if(e!==i&&t!==i){var n=this.handlers;return h(k(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this}},off:function(e,t){if(e!==i){var n=this.handlers;return h(k(e),function(e){t?n[e]&&n[e].splice(C(n[e],t),1):delete n[e]}),this}},emit:function(e,t){this.options.domEvents&&function(e,t){var r=n.createEvent("Event");r.initEvent(e,!0,!0),r.gesture=t,t.target.dispatchEvent(r)}(e,t);var r=this.handlers[e]&&this.handlers[e].slice();if(r&&r.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var i=0;i<r.length;)r[i](t),i++}},destroy:function(){this.element&&ze(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},o(_e,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Ee,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:P,DIRECTION_ALL:30,Manager:Pe,Input:j,TouchAction:we,TouchInput:le,MouseInput:J,PointerEventInput:ne,TouchMouseInput:ue,SingleTouchInput:ie,Recognizer:ke,AttrRecognizer:Ne,Tap:Le,Pan:De,Swipe:Re,Pinch:Te,Rotate:Ie,Press:qe,on:S,off:M,each:h,merge:g,extend:m,assign:o,inherit:y,bindFn:v,prefixed:N}),(void 0!==t?t:"undefined"!=typeof self?self:{}).Hammer=_e,e.exports?e.exports=_e:t.Hammer=_e}(window,document)}(bv)),bv.exports),Sv=o(xv),Mv=Object.prototype.hasOwnProperty,wv=Object.prototype.toString,Ev=Object.defineProperty,kv=Object.getOwnPropertyDescriptor,Cv=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===wv.call(e)},Av=function(e){if(!e||"[object Object]"!==wv.call(e))return!1;var t,n=Mv.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Mv.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Mv.call(e,t)},Ov=function(e,t){Ev&&"__proto__"===t.name?Ev(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},Nv=function(e,t){if("__proto__"===t){if(!Mv.call(e,t))return;if(kv)return kv(e,t).value}return e[t]},Dv=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=Nv(s,n),s!==(i=Nv(t,n))&&(u&&i&&(Av(i)||(o=Cv(i)))?(o?(o=!1,a=r&&Cv(r)?r:[]):a=r&&Av(r)?r:{},Ov(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&Ov(s,{name:n,newValue:i}));return s},Tv="2.11.7";function qv(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 Iv(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 Rv(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 Lv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rv(Object(n),!0).forEach(function(t){Iv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return qv(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)?qv(e,t):void 0}}(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 Pv(e){return!!e.changedTouches}function zv(e){return"number"==typeof e&&!isNaN(e)}function Fv(e){return"number"!=typeof e||isNaN(e)}function jv(e){const t=e.length;let n=NaN,r=NaN,i=NaN,o=NaN;for(let a=0;a<t;a++)n=isNaN(n)?e[a].x:Math.min(n,e[a].x),r=isNaN(r)?e[a].x:Math.max(r,e[a].x),i=isNaN(i)?e[a].y:Math.min(i,e[a].y),o=isNaN(o)?e[a].y:Math.max(o,e[a].y);return[n,i,r,o]}function $v(e){return[{x:e.x1||0,y:e.y1||0},{x:e.x2||0,y:e.y2||0}]}function Bv(e){return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}]}function Vv(e){const t=_v(jv(e),4),n=t[0],r=t[1];return{x:n,y:r,width:t[2]-n,height:t[3]-r}}function Hv(e){return{x1:e[0].x,y1:e[0].y,x2:e[1].x,y2:e[1].y}}function Uv(e){const t=e||{},n=t.x,r=t.y,i=t.width,o=t.height,a=t.x1,s=t.x2,l=t.y1,c=t.y2,u=t.cx,d=t.cy,f=t.r,h=t.vertices;return zv(u)&&zv(d)&&zv(f)?"circle":zv(a)&&zv(s)&&zv(l)&&zv(c)?"line":zv(n)&&zv(r)&&zv(i)&&zv(o)?"rect":zv(n)&&zv(r)?"point":Array.isArray(h)?h.every(e=>Array.isArray(e))?"geopolygon":"polygon":null}function Wv(e,t){return{x:t.x-e,y:t.y-e,width:t.width+e,height:t.height+e}}function Yv(e){return function(){return e}}const Kv=Math.abs,Gv=Math.atan2,Xv=Math.cos,Jv=Math.max,Zv=Math.min,Qv=Math.sin,eb=Math.sqrt,tb=1e-12,nb=Math.PI,rb=nb/2,ib=2*nb;function ob(e){return e>=1?rb:e<=-1?-rb:Math.asin(e)}const ab=Math.PI,sb=2*ab,lb=1e-6,cb=sb-lb;function ub(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class db{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?ub:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ub;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,o){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-e,l=r-t,c=o-e,u=a-t,d=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>lb)if(Math.abs(u*s-l*c)>lb&&i){let f=n-o,h=r-a,p=s*s+l*l,m=f*f+h*h,g=Math.sqrt(p),y=Math.sqrt(d),v=i*Math.tan((ab-Math.acos((p+d-m)/(2*g*y)))/2),b=v/y,x=v/g;Math.abs(b-1)>lb&&this._append`L${e+b*c},${t+b*u}`,this._append`A${i},${i},0,0,${+(u*f>c*h)},${this._x1=e+x*s},${this._y1=t+x*l}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,n,r,i,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),l=e+a,c=t+s,u=1^o,d=o?r-i:i-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>lb||Math.abs(this._y1-c)>lb)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%sb+sb),d>cb?this._append`A${n},${n},0,1,${u},${e-a},${t-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:d>lb&&this._append`A${n},${n},0,${+(d>=ab)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function fb(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new db(t)}function hb(e){return e.innerRadius}function pb(e){return e.outerRadius}function mb(e){return e.startAngle}function gb(e){return e.endAngle}function yb(e){return e&&e.padAngle}function vb(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/eb(s*s+l*l),u=c*l,d=-c*s,f=e+u,h=t+d,p=n+u,m=r+d,g=(f+p)/2,y=(h+m)/2,v=p-f,b=m-h,x=v*v+b*b,S=i-o,M=f*m-p*h,w=(b<0?-1:1)*eb(Jv(0,S*S*x-M*M)),E=(M*b-v*w)/x,k=(-M*v-b*w)/x,C=(M*b+v*w)/x,A=(-M*v+b*w)/x,O=E-g,N=k-y,D=C-g,T=A-y;return O*O+N*N>D*D+T*T&&(E=C,k=A),{cx:E,cy:k,x01:-u,y01:-d,x11:E*(i/S-1),y11:k*(i/S-1)}}function bb(){var e=hb,t=pb,n=Yv(0),r=null,i=mb,o=gb,a=yb,s=null,l=fb(c);function c(){var c,u,d=+e.apply(this,arguments),f=+t.apply(this,arguments),h=i.apply(this,arguments)-rb,p=o.apply(this,arguments)-rb,m=Kv(p-h),g=p>h;if(s||(s=c=l()),f<d&&(u=f,f=d,d=u),f>tb)if(m>ib-tb)s.moveTo(f*Xv(h),f*Qv(h)),s.arc(0,0,f,h,p,!g),d>tb&&(s.moveTo(d*Xv(p),d*Qv(p)),s.arc(0,0,d,p,h,g));else{var y,v,b=h,x=p,S=h,M=p,w=m,E=m,k=a.apply(this,arguments)/2,C=k>tb&&(r?+r.apply(this,arguments):eb(d*d+f*f)),A=Zv(Kv(f-d)/2,+n.apply(this,arguments)),O=A,N=A;if(C>tb){var D=ob(C/d*Qv(k)),T=ob(C/f*Qv(k));(w-=2*D)>tb?(S+=D*=g?1:-1,M-=D):(w=0,S=M=(h+p)/2),(E-=2*T)>tb?(b+=T*=g?1:-1,x-=T):(E=0,b=x=(h+p)/2)}var q=f*Xv(b),I=f*Qv(b),R=d*Xv(M),L=d*Qv(M);if(A>tb){var _,P=f*Xv(x),z=f*Qv(x),F=d*Xv(S),j=d*Qv(S);if(m<nb)if(_=function(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,d=s-o,f=d*l-u*c;if(!(f*f<tb))return[e+(f=(u*(t-o)-d*(e-i))/f)*l,t+f*c]}(q,I,F,j,P,z,R,L)){var $=q-_[0],B=I-_[1],V=P-_[0],H=z-_[1],U=1/Qv(function(e){return e>1?0:e<-1?nb:Math.acos(e)}(($*V+B*H)/(eb($*$+B*B)*eb(V*V+H*H)))/2),W=eb(_[0]*_[0]+_[1]*_[1]);O=Zv(A,(d-W)/(U-1)),N=Zv(A,(f-W)/(U+1))}else O=N=0}E>tb?N>tb?(y=vb(F,j,q,I,f,N,g),v=vb(P,z,R,L,f,N,g),s.moveTo(y.cx+y.x01,y.cy+y.y01),N<A?s.arc(y.cx,y.cy,N,Gv(y.y01,y.x01),Gv(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,N,Gv(y.y01,y.x01),Gv(y.y11,y.x11),!g),s.arc(0,0,f,Gv(y.cy+y.y11,y.cx+y.x11),Gv(v.cy+v.y11,v.cx+v.x11),!g),s.arc(v.cx,v.cy,N,Gv(v.y11,v.x11),Gv(v.y01,v.x01),!g))):(s.moveTo(q,I),s.arc(0,0,f,b,x,!g)):s.moveTo(q,I),d>tb&&w>tb?O>tb?(y=vb(R,L,P,z,d,-O,g),v=vb(q,I,F,j,d,-O,g),s.lineTo(y.cx+y.x01,y.cy+y.y01),O<A?s.arc(y.cx,y.cy,O,Gv(y.y01,y.x01),Gv(v.y01,v.x01),!g):(s.arc(y.cx,y.cy,O,Gv(y.y01,y.x01),Gv(y.y11,y.x11),!g),s.arc(0,0,d,Gv(y.cy+y.y11,y.cx+y.x11),Gv(v.cy+v.y11,v.cx+v.x11),g),s.arc(v.cx,v.cy,O,Gv(v.y11,v.x11),Gv(v.y01,v.x01),!g))):s.arc(0,0,d,M,S,g):s.lineTo(R,L)}else s.moveTo(0,0);if(s.closePath(),c)return s=null,c+""||null}return c.centroid=function(){var n=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-nb/2;return[Xv(r)*n,Qv(r)*n]},c.innerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Yv(+t),c):e},c.outerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Yv(+e),c):t},c.cornerRadius=function(e){return arguments.length?(n="function"==typeof e?e:Yv(+e),c):n},c.padRadius=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:Yv(+e),c):r},c.startAngle=function(e){return arguments.length?(i="function"==typeof e?e:Yv(+e),c):i},c.endAngle=function(e){return arguments.length?(o="function"==typeof e?e:Yv(+e),c):o},c.padAngle=function(e){return arguments.length?(a="function"==typeof e?e:Yv(+e),c):a},c.context=function(e){return arguments.length?(s=null==e?null:e,c):s},c}function xb(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function Sb(e){this._context=e}function Mb(e){return new Sb(e)}function wb(e){return e[0]}function Eb(e){return e[1]}function kb(e,t,n){var r=null,i=Yv(!0),o=null,a=Mb,s=null,l=fb(c);function c(c){var u,d,f,h,p,m=(c=xb(c)).length,g=!1,y=new Array(m),v=new Array(m);for(null==o&&(s=a(p=l())),u=0;u<=m;++u){if(!(u<m&&i(h=c[u],u,c))===g)if(g=!g)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(y[f],v[f]);s.lineEnd(),s.areaEnd()}g&&(y[u]=+e(h,u,c),v[u]=+t(h,u,c),s.point(r?+r(h,u,c):y[u],n?+n(h,u,c):v[u]))}if(p)return s=null,p+""||null}function u(){return function(e,t){var n=Yv(!0),r=null,i=Mb,o=null,a=fb(s);function s(s){var l,c,u,d=(s=xb(s)).length,f=!1;for(null==r&&(o=i(u=a())),l=0;l<=d;++l)!(l<d&&n(c=s[l],l,s))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(c,l,s),+t(c,l,s));if(u)return o=null,u+""||null}return e="function"==typeof e?e:void 0===e?wb:Yv(e),t="function"==typeof t?t:void 0===t?Eb:Yv(t),s.x=function(t){return arguments.length?(e="function"==typeof t?t:Yv(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:Yv(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:Yv(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,null!=r&&(o=i(r)),s):i},s.context=function(e){return arguments.length?(null==e?r=o=null:o=i(r=e),s):r},s}().defined(i).curve(a).context(o)}return e="function"==typeof e?e:void 0===e?wb:Yv(+e),t="function"==typeof t?t:Yv(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?Eb:Yv(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:Yv(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:Yv(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:Yv(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:Yv(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:Yv(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:Yv(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(i="function"==typeof e?e:Yv(!!e),c):i},c.curve=function(e){return arguments.length?(a=e,null!=o&&(s=a(o)),c):a},c.context=function(e){return arguments.length?(null==e?o=s=null:s=a(o=e),c):o},c}function Cb(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function Ab(e){return e}function Ob(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function Nb(e){this._context=e}function Db(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function Tb(e,t){this._context=e,this._k=(1-t)/6}Sb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},Nb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Ob(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Ob(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},Tb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Db(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:Db(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var qb=function e(t){function n(e){return new Tb(e,t)}return n.tension=function(t){return e(+t)},n}(0);function Ib(e,t){this._context=e,this._alpha=t}Ib.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:!function(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>tb){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>tb){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Rb=function e(t){function n(e){return t?new Ib(e,t):new Tb(e,0)}return n.alpha=function(t){return e(+t)},n}(.5);function Lb(e){return e<0?-1:1}function _b(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Lb(o)+Lb(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Pb(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function zb(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function Fb(e){this._context=e}function jb(e){this._context=new $b(e)}function $b(e){this._context=e}function Bb(e){this._context=e}function Vb(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=e[0]+2*e[1],t=1;t<r-1;++t)i[t]=1,o[t]=4,a[t]=4*e[t]+2*e[t+1];for(i[r-1]=2,o[r-1]=7,a[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=i[t]/o[t-1],o[t]-=n,a[t]-=n*a[t-1];for(i[r-1]=a[r-1]/o[r-1],t=r-2;t>=0;--t)i[t]=(a[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-i[t+1];return[i,o]}function Hb(e,t){this._context=e,this._t=t}function Ub(e,t){if((i=e.length)>1)for(var n,r,i,o=1,a=e[t[0]],s=a.length;o<i;++o)for(r=a,a=e[t[o]],n=0;n<s;++n)a[n][1]+=a[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function Wb(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function Yb(e,t){return e[t]}function Kb(e){const t=[];return t.key=e,t}function Gb(e){for(var t,n=-1,r=0,i=e.length,o=-1/0;++n<i;)(t=+e[n][1])>o&&(o=t,r=n);return r}function Xb(e){for(var t,n=0,r=-1,i=e.length;++r<i;)(t=+e[r][1])&&(n+=t);return n}function Jb(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unspecified",r=arguments.length>2?arguments[2]:void 0;const i={},o=e||{get:()=>{},has:()=>!1,default:()=>{}};function a(e,t){if(!e||"string"!=typeof e)throw new TypeError("Invalid argument: key must be a non-empty string");return!(e in i)&&(i[e]=t,!0)}function s(e){return i[e]||o.get(e)}function l(e,i){if(void 0!==i)return a(e,i);const o=s(e);return r&&void 0===o&&r.warn("".concat(e," does not exist in ").concat(n," registry")),o||s(t)}return t=o.default(),l.add=a,l.get=s,l.has=function(e){return!!i[e]||o.has(e)},l.remove=function(e){const t=i[e];return delete i[e],t},l.getKeys=function(){return Object.keys(i)},l.getValues=function(){return Object.keys(i).map(e=>i[e])},l.default=function(e){return void 0!==e&&(t=e),t},l.register=a,l}function Zb(e,t){if(!isFinite(e)||0===e)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Qb(e){return(e=Zb(Math.abs(e)))?e[1]:NaN}Fb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:zb(this,this._t0,Pb(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,zb(this,Pb(this,n=_b(this,e,t)),n);break;default:zb(this,this._t0,n=_b(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(jb.prototype=Object.create(Fb.prototype)).point=function(e,t){Fb.prototype.point.call(this,t,e)},$b.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}},Bb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=Vb(e),i=Vb(t),o=0,a=1;a<n;++o,++a)this._context.bezierCurveTo(r[0][o],i[0][o],r[1][o],i[1][o],e[a],t[a]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},Hb.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var ex,tx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nx(e){if(!(t=tx.exec(e)))throw new Error("invalid format: "+e);var t;return new rx({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function rx(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ix(e,t){var n=Zb(e,t);if(!n)return e+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}nx.prototype=rx.prototype,rx.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var ox={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ix(100*e,t),r:ix,s:function(e,t){var n=Zb(e,t);if(!n)return ex=void 0,e.toPrecision(t);var r=n[0],i=n[1],o=i-(ex=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Zb(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function ax(e){return e}var sx,lx,cx,ux=Array.prototype.map,dx=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fx(e){var t=void 0===e.grouping||void 0===e.thousands?ax:function(e,t){return function(n,r){for(var i=n.length,o=[],a=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(n.substring(i-=s,i+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(t)}}(ux.call(e.grouping,Number),e.thousands+""),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",o=void 0===e.numerals?ax:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}(ux.call(e.numerals,String)),a=void 0===e.percent?"%":e.percent+"",s=void 0===e.minus?"−":e.minus+"",l=void 0===e.nan?"NaN":e.nan+"";function c(e,c){var u=(e=nx(e)).fill,d=e.align,f=e.sign,h=e.symbol,p=e.zero,m=e.width,g=e.comma,y=e.precision,v=e.trim,b=e.type;"n"===b?(g=!0,b="g"):ox[b]||(void 0===y&&(y=12),v=!0,b="g"),(p||"0"===u&&"="===d)&&(p=!0,u="0",d="=");var x=(c&&void 0!==c.prefix?c.prefix:"")+("$"===h?n:"#"===h&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),S=("$"===h?r:/[%p]/.test(b)?a:"")+(c&&void 0!==c.suffix?c.suffix:""),M=ox[b],w=/[defgprs%]/.test(b);function E(e){var n,r,a,c=x,h=S;if("c"===b)h=M(e)+h,e="";else{var E=(e=+e)<0||1/e<0;if(e=isNaN(e)?l:M(Math.abs(e),y),v&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r<n;++r)switch(e[r]){case".":i=t=r;break;case"0":0===i&&(i=r),t=r;break;default:if(!+e[r])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),E&&0===+e&&"+"!==f&&(E=!1),c=(E?"("===f?f:s:"-"===f||"("===f?"":f)+c,h=("s"!==b||isNaN(e)||void 0===ex?"":dx[8+ex/3])+h+(E&&"("===f?")":""),w)for(n=-1,r=e.length;++n<r;)if(48>(a=e.charCodeAt(n))||a>57){h=(46===a?i+e.slice(n+1):e.slice(n))+h,e=e.slice(0,n);break}}g&&!p&&(e=t(e,1/0));var k=c.length+e.length+h.length,C=k<m?new Array(m-k+1).join(u):"";switch(g&&p&&(e=t(C+e,C.length?m-h.length:1/0),C=""),d){case"<":e=c+e+h+C;break;case"=":e=c+C+e+h;break;case"^":e=C.slice(0,k=C.length>>1)+c+e+h+C.slice(k);break;default:e=C+c+e+h}return o(e)}return y=void 0===y?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),E.toString=function(){return e+""},E}return{format:c,formatPrefix:function(e,t){var n=3*Math.max(-8,Math.min(8,Math.floor(Qb(t)/3))),r=Math.pow(10,-n),i=c(((e=nx(e)).type="f",e),{suffix:dx[8+n/3]});return function(e){return i(r*e)}}}}!function(e){sx=fx(e),lx=sx.format,cx=sx.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]});const hx=new Date,px=new Date;function mx(e,t,n,r){function i(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{const t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),i.range=(n,r,o)=>{const a=[];if(n=i.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return a;let s;do{a.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return a},i.filter=n=>mx(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(hx.setTime(+t),px.setTime(+r),e(hx),e(px),Math.floor(n(hx,px))),i.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i:null)),i}const gx=6e4,yx=864e5,vx=6048e5,bx=mx(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*gx)/yx,e=>e.getDate()-1);bx.range;const xx=mx(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yx,e=>e.getUTCDate()-1);xx.range;const Sx=mx(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/yx,e=>Math.floor(e/yx));function Mx(e){return mx(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*gx)/vx)}Sx.range;const wx=Mx(0),Ex=Mx(1),kx=Mx(2),Cx=Mx(3),Ax=Mx(4),Ox=Mx(5),Nx=Mx(6);function Dx(e){return mx(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/vx)}wx.range,Ex.range,kx.range,Cx.range,Ax.range,Ox.range,Nx.range;const Tx=Dx(0),qx=Dx(1),Ix=Dx(2),Rx=Dx(3),Lx=Dx(4),_x=Dx(5),Px=Dx(6);Tx.range,qx.range,Ix.range,Rx.range,Lx.range,_x.range,Px.range;const zx=mx(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());zx.every=e=>isFinite(e=Math.floor(e))&&e>0?mx(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,zx.range;const Fx=mx(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function jx(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function $x(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Bx(e){let t,n,r;function i(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<0?i=t+1:o=t}while(i<o)}return i}return 2!==e.length?(t=jx,n=(t,n)=>jx(e(t),n),r=(t,n)=>e(t)-n):(t=e===jx||e===$x?e:Vx,n=e,r=e),{left:i,center:function(e,t,n=0,o=e.length){const a=i(e,t,n,o-1);return a>n&&r(e[a-1],t)>-r(e[a],t)?a-1:a},right:function(e,r,i=0,o=e.length){if(i<o){if(0!==t(r,r))return o;do{const t=i+o>>>1;n(e[t],r)<=0?i=t+1:o=t}while(i<o)}return i}}}function Vx(){return 0}Fx.every=e=>isFinite(e=Math.floor(e))&&e>0?mx(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,Fx.range;const Hx=Bx(jx).right;Bx(function(e){return null===e?NaN:+e}).center;var Ux=Hx;class Wx extends Map{constructor(e,t=Kx){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(Yx(this,e))}has(e){return super.has(Yx(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);e.has(r)&&(n=e.get(r),e.delete(r));return n}(this,e))}}function Yx({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function Kx(e){return null!==e&&"object"==typeof e?e.valueOf():e}const Gx=Math.sqrt(50),Xx=Math.sqrt(10),Jx=Math.sqrt(2);function Zx(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=Gx?10:o>=Xx?5:o>=Jx?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?Zx(e,t,2*n):[s,l,c]}function Qx(e,t,n){return Zx(e=+e,t=+t,n=+n)[2]}function eS(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function tS(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function nS(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function rS(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,o=e.days,a=e.shortDays,s=e.months,l=e.shortMonths,c=uS(i),u=dS(i),d=uS(o),f=dS(o),h=uS(a),p=dS(a),m=uS(s),g=dS(s),y=uS(l),v=dS(l),b={a:function(e){return a[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:qS,e:qS,f:PS,g:KS,G:XS,H:IS,I:RS,j:LS,L:_S,m:zS,M:FS,p:function(e){return i[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:bM,s:xM,S:jS,u:$S,U:BS,V:HS,w:US,W:WS,x:null,X:null,y:YS,Y:GS,Z:JS,"%":vM},x={a:function(e){return a[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:ZS,e:ZS,f:rM,g:pM,G:gM,H:QS,I:eM,j:tM,L:nM,m:iM,M:oM,p:function(e){return i[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:bM,s:xM,S:aM,u:sM,U:lM,V:uM,w:dM,W:fM,x:null,X:null,y:hM,Y:mM,Z:yM,"%":vM},S={a:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=y.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return E(e,t,n,r)},d:MS,e:MS,f:OS,g:vS,G:yS,H:ES,I:ES,j:wS,L:AS,m:SS,M:kS,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:xS,Q:DS,s:TS,S:CS,u:hS,U:pS,V:mS,w:fS,W:gS,x:function(e,t,r){return E(e,n,t,r)},X:function(e,t,n){return E(e,r,t,n)},y:vS,Y:yS,Z:bS,"%":NS};function M(e,t){return function(n){var r,i,o,a=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(a.push(e.slice(l,s)),null!=(i=iS[r=e.charAt(++s)])?r=e.charAt(++s):i="e"===r?" ":"0",(o=t[r])&&(r=o(n,i)),a.push(r),l=s+1);return a.push(e.slice(l,s)),a.join("")}}function w(e,t){return function(n){var r,i,o=nS(1900,void 0,1);if(E(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=tS(nS(o.y,0,1))).getUTCDay(),r=i>4||0===i?qx.ceil(r):qx(r),r=xx.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=eS(nS(o.y,0,1))).getDay(),r=i>4||0===i?Ex.ceil(r):Ex(r),r=bx.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?tS(nS(o.y,0,1)).getUTCDay():eS(nS(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,tS(o)):eS(o)}}function E(e,t,n,r){for(var i,o,a=0,s=t.length,l=n.length;a<s;){if(r>=l)return-1;if(37===(i=t.charCodeAt(a++))){if(i=t.charAt(a++),!(o=S[i in iS?t.charAt(a++):i])||(r=o(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return b.x=M(n,b),b.X=M(r,b),b.c=M(t,b),x.x=M(n,x),x.X=M(r,x),x.c=M(t,x),{format:function(e){var t=M(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=w(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=M(e+="",x);return t.toString=function(){return e},t},utcParse:function(e){var t=w(e+="",!0);return t.toString=function(){return e},t}}}var iS={"-":"",_:" ",0:"0"},oS=/^\s*\d+/,aS=/^%/,sS=/[\\^$*+?|[\]().{}]/g;function lS(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",o=i.length;return r+(o<n?new Array(n-o+1).join(t)+i:i)}function cS(e){return e.replace(sS,"\\$&")}function uS(e){return new RegExp("^(?:"+e.map(cS).join("|")+")","i")}function dS(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function fS(e,t,n){var r=oS.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function hS(e,t,n){var r=oS.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function pS(e,t,n){var r=oS.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function mS(e,t,n){var r=oS.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function gS(e,t,n){var r=oS.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function yS(e,t,n){var r=oS.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function vS(e,t,n){var r=oS.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function bS(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function xS(e,t,n){var r=oS.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function SS(e,t,n){var r=oS.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function MS(e,t,n){var r=oS.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function wS(e,t,n){var r=oS.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ES(e,t,n){var r=oS.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function kS(e,t,n){var r=oS.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function CS(e,t,n){var r=oS.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function AS(e,t,n){var r=oS.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function OS(e,t,n){var r=oS.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function NS(e,t,n){var r=aS.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function DS(e,t,n){var r=oS.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function TS(e,t,n){var r=oS.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function qS(e,t){return lS(e.getDate(),t,2)}function IS(e,t){return lS(e.getHours(),t,2)}function RS(e,t){return lS(e.getHours()%12||12,t,2)}function LS(e,t){return lS(1+bx.count(zx(e),e),t,3)}function _S(e,t){return lS(e.getMilliseconds(),t,3)}function PS(e,t){return _S(e,t)+"000"}function zS(e,t){return lS(e.getMonth()+1,t,2)}function FS(e,t){return lS(e.getMinutes(),t,2)}function jS(e,t){return lS(e.getSeconds(),t,2)}function $S(e){var t=e.getDay();return 0===t?7:t}function BS(e,t){return lS(wx.count(zx(e)-1,e),t,2)}function VS(e){var t=e.getDay();return t>=4||0===t?Ax(e):Ax.ceil(e)}function HS(e,t){return e=VS(e),lS(Ax.count(zx(e),e)+(4===zx(e).getDay()),t,2)}function US(e){return e.getDay()}function WS(e,t){return lS(Ex.count(zx(e)-1,e),t,2)}function YS(e,t){return lS(e.getFullYear()%100,t,2)}function KS(e,t){return lS((e=VS(e)).getFullYear()%100,t,2)}function GS(e,t){return lS(e.getFullYear()%1e4,t,4)}function XS(e,t){var n=e.getDay();return lS((e=n>=4||0===n?Ax(e):Ax.ceil(e)).getFullYear()%1e4,t,4)}function JS(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+lS(t/60|0,"0",2)+lS(t%60,"0",2)}function ZS(e,t){return lS(e.getUTCDate(),t,2)}function QS(e,t){return lS(e.getUTCHours(),t,2)}function eM(e,t){return lS(e.getUTCHours()%12||12,t,2)}function tM(e,t){return lS(1+xx.count(Fx(e),e),t,3)}function nM(e,t){return lS(e.getUTCMilliseconds(),t,3)}function rM(e,t){return nM(e,t)+"000"}function iM(e,t){return lS(e.getUTCMonth()+1,t,2)}function oM(e,t){return lS(e.getUTCMinutes(),t,2)}function aM(e,t){return lS(e.getUTCSeconds(),t,2)}function sM(e){var t=e.getUTCDay();return 0===t?7:t}function lM(e,t){return lS(Tx.count(Fx(e)-1,e),t,2)}function cM(e){var t=e.getUTCDay();return t>=4||0===t?Lx(e):Lx.ceil(e)}function uM(e,t){return e=cM(e),lS(Lx.count(Fx(e),e)+(4===Fx(e).getUTCDay()),t,2)}function dM(e){return e.getUTCDay()}function fM(e,t){return lS(qx.count(Fx(e)-1,e),t,2)}function hM(e,t){return lS(e.getUTCFullYear()%100,t,2)}function pM(e,t){return lS((e=cM(e)).getUTCFullYear()%100,t,2)}function mM(e,t){return lS(e.getUTCFullYear()%1e4,t,4)}function gM(e,t){var n=e.getUTCDay();return lS((e=n>=4||0===n?Lx(e):Lx.ceil(e)).getUTCFullYear()%1e4,t,4)}function yM(){return"+0000"}function vM(){return"%"}function bM(e){return+e}function xM(e){return Math.floor(+e/1e3)}const SM=Jb();SM("d3-number",function(e,t,n){let r,i;function o(e){return i(e)}function a(){o.locale({decimal:n||".",thousands:t||",",grouping:[3],currency:["$",""]})}return o.locale=function(t){return r=fx(t),i=r.format(e),this},a(),o.format=function(e,i,o,s){return(o||s)&&(t=o,n=s,a()),r.format(e)(i)},o.pattern=function(t){return t&&(e=t,i=r.format(t)),e},o}),SM("d3-time",function(e){let t=rS({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),n=t.format(e);function r(e){return n(e)}return r.format=function(e,n){return t.format(e)(n)},r.locale=function(){return t=rS(...arguments),n=t.format(e),this},r.parse=function(e,n){return t.parse(e)(n)},r.parsePattern=function(e){return t.parse(e)},r});const MM={id:e=>"".concat(e.source,"/").concat(e.key||e.title),key:e=>String(e.key||e.title),tags:e=>e.tags,min:e=>e.min,max:e=>e.max,type:e=>e.type,title:e=>String(e.title),values:e=>e.values,value:e=>e,label:e=>e,formatter:e=>(e=>{if("function"==typeof e.formatter)return e.formatter();const t=e.formatter||{};return SM(t.type||"d3-number")(t.format||"")})(e)};function wM(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.id,r=void 0===n?MM.id:n,i=t.key,o=void 0===i?MM.key:i,a=t.min,s=void 0===a?MM.min:a,l=t.max,c=void 0===l?MM.max:l,u=t.type,d=void 0===u?MM.type:u,f=t.tags,h=void 0===f?MM.tags:f,p=t.title,m=void 0===p?MM.title:p,g=t.values,y=void 0===g?MM.values:g,v=t.value,b=void 0===v?MM.value:v,x=t.label,S=void 0===x?MM.label:x,M=t.formatter,w=void 0===M?MM.formatter:M;return{id:()=>r(e),key:()=>o(e),raw:()=>e,tags:()=>h(e),type:()=>d(e),min:()=>s(e),max:()=>c(e),title:()=>m(e),items:()=>y(e),formatter:()=>w(e),value:b,label:S}}const EM=e=>e.filter(e=>"number"==typeof e&&!isNaN(e)),kM=e=>e.reduce((e,t)=>e+t,0),CM={first:e=>e[0],last:e=>e[e.length-1],min:e=>{const t=EM(e);return t.length?Math.min.apply(null,t):NaN},max:e=>{const t=EM(e);return t.length?Math.max.apply(null,t):NaN},sum:e=>{const t=EM(e);return t.length?t.reduce((e,t)=>e+t,0):NaN},avg:e=>{const t=EM(e),n=t.length;return n?kM(t)/n:NaN}};function AM(e,t,n,r){const i={},o=r.field||(void 0!==e.field?t.field(e.field):null);return Object.keys(n).forEach(a=>{const s=n[a],l=i[a]={};-1!==["number","string","boolean"].indexOf(typeof s)?(l.type="primitive",l.value=s):"function"==typeof s?(l.type="function",l.value=s,l.label=s,l.field=o):"object"==typeof s&&(s.fields?l.fields=s.fields.map(n=>AM(e,t,{main:n},r).main):void 0!==s.field?(l.type="field",l.field=t.field(s.field),l.value=l.field.value,l.label=l.field.label):o&&(l.value=o.value,l.label=o.label,l.field=o),"function"==typeof s.filter&&(l.filter=s.filter),void 0!==s.value&&(l.value=s.value),void 0!==s.label&&(l.label=s.label),"function"==typeof s.reduce?l.reduce=s.reduce:s.reduce?l.reduce=CM[s.reduce]:l.field&&l.field.reduce&&(l.reduce="string"==typeof l.field.reduce?CM[l.field.reduce]:l.field.reduce),"function"==typeof s.reduceLabel?l.reduceLabel=s.reduceLabel:s.reduceLabel?l.reduceLabel=CM[s.reduceLabel]:l.field&&l.field.reduceLabel&&(l.reduceLabel="string"==typeof l.field.reduceLabel?CM[l.field.reduceLabel]:l.field.reduceLabel))}),i}function OM(e,t){const n=AM(e,t,{main:{value:e.value,label:e.label,reduce:e.reduce,filter:e.filter}},{}).main;return{props:AM(e,t,e.props||{},n),main:n}}function NM(e,t,n,r){const i=Array(e.length),o=Array(e.length);let a;for(let t=0;t<e.length;t++)a=r?e[t][r]:e[t],i[t]=a.value,o[t]=a.label;const s=t.reduce,l=t.reduceLabel,c=s?s(i):i,u={value:c,label:l?l(o,c):n?n(c):String(c)};return r&&e[0][r].source?(u.source=e[0][r].source,u):!r&&e[0].source?(u.source=e[0].source,u):u}function DM(e,t){let n=t.main,r=t.propsArr,i=t.props,o=[];const a=n.field.formatter(),s={};return r.forEach(e=>{s[e]=i[e].field?i[e].field.formatter():e=>e}),o.push(...e.map(e=>{const t=NM(e.items,n,a);return r.forEach(n=>{t[n]=NM(e.items,i[n],s[n],n)}),t})),o}function TM(e){let t=e.cfg,n=e.itemData,r=e.obj,i=e.target,o=e.tracker;const a="function"===e.trackType?t.trackBy(n):n[t.trackBy];let s=o[a];s||(s=o[a]={items:[],id:a},i.push(s)),s.items.push(r)}function qM(e){if(e.length<1e4)return Math.max(...e);let t=-1/0;const n=e.length;for(let r=0;r<n;r++)t<e[r]&&(t=e[r]);return t}function IM(e){if(e.length<1e4)return Math.min(...e);let t=1/0;const n=e.length;for(let r=0;r<n;r++)t>e[r]&&(t=e[r]);return t}const RM={diverging:function(e,t){const n=e.length;if(n<=0)return;const r=e[t[0]].length;for(let i=0;i<r;++i){let r=0,o=0;for(let a=0;a<n;++a){const n=e[t[a]][i],s=n[1]-n[0];s>=0?(n[0]=r,r+=s,n[1]=r):s<0?(n[1]=o,o+=s,n[0]=o):n[0]=r}}},none:Ub,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,i=e[t[0]],o=i.length;r<o;++r){for(var a=0,s=0;a<n;++a)s+=e[a][r][1]||0;i[r][1]+=i[r][0]=-s/2}Ub(e,t)}},expand:function(e,t){if((r=e.length)>0){for(var n,r,i,o=0,a=e[0].length;o<a;++o){for(i=n=0;n<r;++n)i+=e[n][o][1]||0;if(i)for(n=0;n<r;++n)e[n][o][1]/=i}Ub(e,t)}},wiggle:function(e,t){if((i=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,i,o=0,a=1;a<r;++a){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],d=u[a][1]||0,f=(d-(u[a-1][1]||0))/2,h=0;h<s;++h){var p=e[t[h]];f+=(p[a][1]||0)-(p[a-1][1]||0)}l+=d,c+=f*d}n[a-1][1]+=n[a-1][0]=o,l&&(o-=c/l)}n[a-1][1]+=n[a-1][0]=o,Ub(e,t)}}},LM={ascending:function(e){var t=e.map(Xb);return Wb(e).sort(function(e,n){return t[e]-t[n]})},insideout:function(e){var t,n,r=e.length,i=e.map(Xb),o=function(e){var t=e.map(Gb);return Wb(e).sort(function(e,n){return t[e]-t[n]})}(e),a=0,s=0,l=[],c=[];for(t=0;t<r;++t)n=o[t],a<s?(a+=i[n],l.push(n)):(s+=i[n],c.push(n));return c.reverse().concat(l)},none:Wb,reverse:function(e){return Wb(e).reverse()}};function _M(e,t,n,r){const i=r||e.items,o={},a=t.stackKey,s=t.value,l=t.startProp||"start",c=t.endProp||"end",u=t.offset||"none",d=t.order||"none",f=t.valueRef||"";let h=0,p={};for(let e=0;e<i.length;e++){let t=i[e],n=f?t[f]:null;if(n&&n.source){let e="".concat(n.source.key||"","/").concat(n.source.field);p[e]||(p[e]=n.source)}let r=a(t);o[r]=o[r]||{items:[]},o[r].items.push(t),h=Math.max(h,o[r].items.length)}const m=Array.apply(null,{length:h}).map(Number.call,Number),g=Object.keys(o).map(e=>o[e].items),y=function(){var e=Yv([]),t=Wb,n=Ub,r=Yb;function i(i){var o,a,s=Array.from(e.apply(this,arguments),Kb),l=s.length,c=-1;for(const e of i)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(e,s[o].key,c,i)]).data=e;for(o=0,a=xb(t(s));o<l;++o)s[a[o]].index=o;return n(s,a),s}return i.keys=function(t){return arguments.length?(e="function"==typeof t?t:Yv(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r="function"==typeof e?e:Yv(+e),i):r},i.order=function(e){return arguments.length?(t=null==e?Wb:"function"==typeof e?e:Yv(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=null==e?Ub:e,i):n},i}().keys(m).value((e,t)=>e[t]?s(e[t]):0).order(LM[d]).offset(RM[u]);let v=y(g),b=[];for(let e=0;e<v.length;e++){let t=v[e];for(let e=0;e<t.length;e++){let n=t[e],r=t[e].data[t.key];r&&(r[l]={value:n[0]},r[c]={value:n[1]},b.push(n[0],n[1]))}}let x=Object.keys(p).map(e=>{let t=n(p[e].key);return t?t.field(p[e].field):null}).filter(e=>!!e);const S=wM({title:x.map(e=>e.title()).join(", "),min:IM(b),max:qM(b),type:"measure",formatter:x[0]?x[0].formatter:void 0});e.fields.push(S)}function PM(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={};const r=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).logger;if(Array.isArray(e))n.items=e.map(e=>({value:e,label:String(e)}));else if(e){if("collection"in e)n=Lv({},t.collection(e.collection));else{const i=t.dataset?t.dataset(e.source):null;let o=e.value||(e=>e),a=e.label||(e=>e);if(e.groupBy||e.mapTo)r.warn('Deprecated "data" configuration',e),n.items=[];else if(e.hierarchy)n.root=i.hierarchy?i.hierarchy(e.hierarchy):null,n.fields=i.fields();else if(e.items)n.items=e.skipNormalize?e.items:e.items.map(e=>({value:o(e),label:String(a(e))}));else if(e.extract){const r=Array.isArray(e.extract)?e.extract:[e.extract];n.items=[];const o=[];r.forEach(e=>{const r=e.source?t.dataset(e.source):i;r&&(n.items=[...n.items,...r.extract(e)],void 0!==e.field&&o.push(r.field(e.field)))}),o.length&&(n.fields=o),e.amend&&Array.isArray(e.amend)&&(n.items=[...n.items,...e.amend])}else if(void 0!==e.field&&i){const t=i.field(e.field);t&&(n.fields||(n.fields=[]),n.fields.push(t),"value"in e||(o=t.value||(e=>e),a=t.label||(e=>e),n.value=o),n.items=t.items().map(t=>({value:o(t),label:String(a(t)),source:{field:e.field}})))}else e.fields&&e.fields.forEach(e=>{const r="object"==typeof e&&e.source?t.dataset(e.source):i;if(!r)return;let o;o="object"==typeof e&&void 0!==e.field?r.field(e.field):r.field(e),o&&(n.fields||(n.fields=[]),n.fields.push(o))});n.items&&e.map&&(n.items=n.items.map(e.map))}e&&e.stack&&(Array.isArray(e.stack.stackByKey)?e.stack.stackByKey.forEach(r=>{const i=n.items.filter(e=>{var t;return(null===(t=e.key)||void 0===t?void 0:t.value)&&e.key.value===r});_M(n,e.stack,t.dataset,i)}):_M(n,e.stack,t.dataset,n.items))}return e&&!Array.isArray(e)&&"function"==typeof e.filter&&n.items&&(n.items=n.items.filter(e.filter)),e&&!Array.isArray(e)&&"function"==typeof e.sort&&n.items&&(n.items=n.items.sort(e.sort)),n}function zM(e,t,n){let r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:PM;if(e.data){const r=i(e.data,t,n);if(r&&r.fields&&r.fields[0])return r.fields[0].formatter()}if(r=e.formatter?"".concat(e.formatter,"-").concat(e.type||"number"):e.type||"d3-number",n.formatter.has(r)){return n.formatter.get(r)(e.format||"")}throw new Error("Formatter of type '".concat(r,"' was not found"))}function FM(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}const jM=Symbol("implicit");function $M(){var e=new Wx,t=[],n=[],r=jM;function i(i){let o=e.get(i);if(void 0===o){if(r!==jM)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Wx;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return $M(t,n).unknown(r)},FM.apply(i,arguments),i}function BM(){var e,t,n=$M().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=a<o,f=d?a:o,h=d?o:a;e=(h-f)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),f+=(h-f-e*(n-l))*u,t=e*(1-l),s&&(f=Math.round(f),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r<i;)o[r]=e+r*n;return o}(n).map(function(t){return f+e*t});return i(d?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,a]=e,o=+o,a=+a,d()):[o,a]},n.rangeRound=function(e){return[o,a]=e,o=+o,a=+a,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return BM(r(),[o,a]).round(s).paddingInner(l).paddingOuter(c).align(u)},FM.apply(d(),arguments)}function VM(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function HM(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function UM(){}var WM=.7,YM=1/WM,KM="\\s*([+-]?\\d+)\\s*",GM="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",XM="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",JM=/^#([0-9a-f]{3,8})$/,ZM=new RegExp(`^rgb\\(${KM},${KM},${KM}\\)$`),QM=new RegExp(`^rgb\\(${XM},${XM},${XM}\\)$`),ew=new RegExp(`^rgba\\(${KM},${KM},${KM},${GM}\\)$`),tw=new RegExp(`^rgba\\(${XM},${XM},${XM},${GM}\\)$`),nw=new RegExp(`^hsl\\(${GM},${XM},${XM}\\)$`),rw=new RegExp(`^hsla\\(${GM},${XM},${XM},${GM}\\)$`),iw={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 ow(){return this.rgb().formatHex()}function aw(){return this.rgb().formatRgb()}function sw(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=JM.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?lw(t):3===n?new dw(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?cw(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?cw(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=ZM.exec(e))?new dw(t[1],t[2],t[3],1):(t=QM.exec(e))?new dw(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ew.exec(e))?cw(t[1],t[2],t[3],t[4]):(t=tw.exec(e))?cw(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=nw.exec(e))?yw(t[1],t[2]/100,t[3]/100,1):(t=rw.exec(e))?yw(t[1],t[2]/100,t[3]/100,t[4]):iw.hasOwnProperty(e)?lw(iw[e]):"transparent"===e?new dw(NaN,NaN,NaN,0):null}function lw(e){return new dw(e>>16&255,e>>8&255,255&e,1)}function cw(e,t,n,r){return r<=0&&(e=t=n=NaN),new dw(e,t,n,r)}function uw(e,t,n,r){return 1===arguments.length?function(e){return e instanceof UM||(e=sw(e)),e?new dw((e=e.rgb()).r,e.g,e.b,e.opacity):new dw}(e):new dw(e,t,n,null==r?1:r)}function dw(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function fw(){return`#${gw(this.r)}${gw(this.g)}${gw(this.b)}`}function hw(){const e=pw(this.opacity);return`${1===e?"rgb(":"rgba("}${mw(this.r)}, ${mw(this.g)}, ${mw(this.b)}${1===e?")":`, ${e})`}`}function pw(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function mw(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function gw(e){return((e=mw(e))<16?"0":"")+e.toString(16)}function yw(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new bw(e,t,n,r)}function vw(e){if(e instanceof bw)return new bw(e.h,e.s,e.l,e.opacity);if(e instanceof UM||(e=sw(e)),!e)return new bw;if(e instanceof bw)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 bw(a,s,l,e.opacity)}function bw(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function xw(e){return(e=(e||0)%360)<0?e+360:e}function Sw(e){return Math.max(0,Math.min(1,e||0))}function Mw(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}VM(UM,sw,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ow,formatHex:ow,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return vw(this).formatHsl()},formatRgb:aw,toString:aw}),VM(dw,uw,HM(UM,{brighter(e){return e=null==e?YM:Math.pow(YM,e),new dw(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?WM:Math.pow(WM,e),new dw(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dw(mw(this.r),mw(this.g),mw(this.b),pw(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:fw,formatHex:fw,formatHex8:function(){return`#${gw(this.r)}${gw(this.g)}${gw(this.b)}${gw(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:hw,toString:hw})),VM(bw,function(e,t,n,r){return 1===arguments.length?vw(e):new bw(e,t,n,null==r?1:r)},HM(UM,{brighter(e){return e=null==e?YM:Math.pow(YM,e),new bw(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?WM:Math.pow(WM,e),new bw(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 dw(Mw(e>=240?e-240:e+120,i,r),Mw(e,i,r),Mw(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new bw(xw(this.h),Sw(this.s),Sw(this.l),pw(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=pw(this.opacity);return`${1===e?"hsl(":"hsla("}${xw(this.h)}, ${100*Sw(this.s)}%, ${100*Sw(this.l)}%${1===e?")":`, ${e})`}`}}));var ww=e=>()=>e;function Ew(e){return 1===(e=+e)?kw: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):ww(isNaN(t)?n:t)}}function kw(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):ww(isNaN(e)?t:e)}var Cw=function e(t){var n=Ew(t);function r(e,t){var r=n((e=uw(e)).r,(t=uw(t)).r),i=n(e.g,t.g),o=n(e.b,t.b),a=kw(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 Aw(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,i=t.slice();return function(o){for(n=0;n<r;++n)i[n]=e[n]*(1-o)+t[n]*o;return i}}function Ow(e,t){var n,r=t?t.length:0,i=e?Math.min(r,e.length):0,o=new Array(i),a=new Array(r);for(n=0;n<i;++n)o[n]=Lw(e[n],t[n]);for(;n<r;++n)a[n]=t[n];return function(e){for(n=0;n<i;++n)a[n]=o[n](e);return a}}function Nw(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Dw(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Tw(e,t){var n,r={},i={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=Lw(e[n],t[n]):i[n]=t[n];return function(e){for(n in r)i[n]=r[n](e);return i}}var qw=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Iw=new RegExp(qw.source,"g");function Rw(e,t){var n,r,i,o=qw.lastIndex=Iw.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=qw.exec(e))&&(r=Iw.exec(t));)(i=r.index)>o&&(i=t.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:Dw(n,r)})),o=Iw.lastIndex;return o<t.length&&(i=t.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function Lw(e,t){var n,r=typeof t;return null==t||"boolean"===r?ww(t):("number"===r?Dw:"string"===r?(n=sw(t))?(t=n,Cw):Rw:t instanceof sw?Cw:t instanceof Date?Nw:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Aw:Array.isArray(t)?Ow:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?Tw:Dw)(e,t)}function _w(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Pw(e){return+e}var zw=[0,1];function Fw(e){return e}function jw(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function $w(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return i<r?(r=jw(i,r),o=n(a,o)):(r=jw(r,i),o=n(o,a)),function(e){return o(r(e))}}function Bw(e,t,n){var r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<r;)i[a]=jw(e[a],e[a+1]),o[a]=n(t[a],t[a+1]);return function(t){var n=Ux(e,t,1,r)-1;return o[n](i[n](t))}}function Vw(){var e,t,n,r,i,o,a=zw,s=zw,l=Lw,c=Fw;function u(){var e=Math.min(a.length,s.length);return c!==Fw&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(a[0],a[e-1])),r=e>2?Bw:$w,i=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(i||(i=r(a.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,a.map(e),Dw)))(n)))},d.domain=function(e){return arguments.length?(a=Array.from(e,Pw),u()):a.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=_w,u()},d.clamp=function(e){return arguments.length?(c=!!e||Fw,u()):c!==Fw},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function Hw(e,t,n,r){var i,o=function(e,t,n){n=+n;const r=(t=+t)<(e=+e),i=r?Qx(t,e,n):Qx(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}(e,t,n);switch((r=nx(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(i=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Qb(t)/3)))-Qb(Math.abs(e)))}(o,a))||(r.precision=i),cx(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Qb(t)-Qb(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(e){return Math.max(0,-Qb(Math.abs(e)))}(o))||(r.precision=i-2*("%"===r.type))}return lx(r)}function Uw(e){var t=e.domain;return e.ticks=function(e){var n=t();return function(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const r=t<e,[i,o,a]=r?Zx(t,e,n):Zx(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let e=0;e<s;++e)l[e]=(o-e)/-a;else for(let e=0;e<s;++e)l[e]=(o-e)*a;else if(a<0)for(let e=0;e<s;++e)l[e]=(i+e)/-a;else for(let e=0;e<s;++e)l[e]=(i+e)*a;return l}(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return Hw(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,i,o=t(),a=0,s=o.length-1,l=o[a],c=o[s],u=10;for(c<l&&(i=l,l=c,c=i,i=a,a=s,s=i);u-- >0;){if((i=Qx(l,c,n))===r)return o[a]=l,o[s]=c,t(o);if(i>0)l=Math.floor(l/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;l=Math.ceil(l*i)/i,c=Math.floor(c*i)/i}r=i}return e},e}function Ww(){var e=Vw()(Fw,Fw);return e.copy=function(){return t=e,Ww().domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown());var t},FM.apply(e,arguments),Uw(e)}function Yw(){var e,t=[.5],n=[0,1],r=1;function i(i){return null!=i&&i<=i?n[Ux(t,i,0,r)]:e}return i.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),i):t.slice()},i.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),i):n.slice()},i.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},i.unknown=function(t){return arguments.length?(e=t,i):e},i.copy=function(){return Yw().domain(t).range(n).unknown(e)},FM.apply(i,arguments)}function Kw(e){return void 0===e?e=>e:t=>e(t)}function Gw(e){return Math.max(0,Math.min(1,e))}function Xw(e){return"object"==typeof e}function Jw(e,t,n){const r=Math.abs(t-n)/(e+1),i=[];for(let o=1;o<=e;o++){const e=o*r;i.push(t<n?t+e:t-e)}return i}function Zw(e,t,n){if(1===e.length)return e;const r=e.concat([]);for(let i=0;i<e.length;i++){let o=e[i],a=e[i+1];0===i&&o!==n.start()?(r.push(...Jw(t,o,a)),o-=a-o,a=e[i],r.push(...Jw(t,o,a))):i===e.length-1&&a!==n.end()?(a=o+(o-e[i-1]),r.push(...Jw(t,o,a))):r.push(...Jw(t,o,a))}return r.filter(e=>e>=n.min()&&e<=n.max())}function Qw(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s;const c=Fv(a)||Fv(t)?2:Math.max(t/a,2),u=Math.min(1e3,Math.round(c));let d=n.ticks(u);d.length<=1&&(d=n.ticks(u+1));const f=i>0?Zw(d,i,n):d;f.sort((e,t)=>e-t);const h=f.map(Kw(l));return f.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:h[t],value:e,isMinor:-1===d.indexOf(e)}})}function eE(e){let t=e.distance,n=e.scale,r=e.minorCount,i=void 0===r?0:r,o=e.unitDivider,a=void 0===o?100:o,s=e.formatter,l=void 0===s?void 0:s;const c=Fv(a)||Fv(t)?2:Math.max(t/a,2),u=Math.min(1e3,Math.round(c)),d=u>10?10:u;n.nice(d);const f=n.ticks(u),h=i>0?Zw(f,i,n):f;h.sort((e,t)=>e-t);const p=h.map(Kw(l));return h.map((e,t)=>{const r=n(e);return{position:r,start:r,end:r,label:p[t],value:e,isMinor:-1===f.indexOf(e)}})}function tE(e){let t,n=e.settings,r=e.scale,i=e.distance,o=e.formatter,a=void 0===o?e=>e:o;const s=n.minorTicks&&!Fv(n.minorTicks.count)?Math.min(100,n.minorTicks.count):0;if(Array.isArray(n.ticks.values)){const e=n.ticks.values.filter(e=>"object"==typeof e?!Fv(e.value):!Fv(e));t=function(e){let t=e.values,n=e.scale,r=e.formatter,i=void 0===r?e=>e:r;return t.sort((e,t)=>(Xw(e)?e.value:e)-(Xw(t)?t.value:t)).filter((e,t,r)=>{const i=Xw(e)?e.value:e;return i<=n.max()&&i>=n.min()&&r.indexOf(e)===t}).map(e=>{const t=Xw(e),r=t?e.value:e,o=n(r);return{position:o,value:r,label:t&&void 0!==e.label?e.label:i(r),isMinor:!!t&&!!e.isMinor,start:t&&!isNaN(e.start)?Gw(n(e.start)):o,end:t&&!isNaN(e.end)?Gw(n(e.end)):o}})}({values:e,scale:r.copy(),formatter:a})}else if(Fv(n.ticks.count)){t=(n.ticks.tight?eE:Qw)({distance:i,minorCount:s,unitDivider:n.ticks.distance,scale:r,formatter:a}),n.ticks.forceBounds&&function(e,t,n){const r=e.map(e=>e.position),i=t.range();-1===r.indexOf(i[0])?e.splice(0,0,{position:i[0],start:i[0],end:i[0],label:n(t.start()),isMinor:!1,value:t.start()}):e[0]&&e[0].isMinor&&(e[0].isMinor=!1);const o=e[e.length-1];-1===r.indexOf(i[1])?e.push({position:i[1],start:i[1],end:i[1],label:n(t.end()),isMinor:!1,value:t.end()}):o&&o.isMinor&&(o.isMinor=!1)}(t,r,a)}else{t=function(e){let t=e.count,n=e.minorCount,r=e.scale,i=e.formatter;return r.ticks((t-1)*n+t).map((e,t)=>{const o=r(e);return{position:o,start:o,end:o,label:i(e),isMinor:t%(n+1)!==0,value:e}})}({count:Math.min(1e3,n.ticks.count),minorCount:s,scale:r.copy(),formatter:a})}return t}function nE(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r={};return Object.keys(t).forEach(i=>{const o=typeof e[i];r[i]="function"===o?e[i](n):"undefined"===o?t[i]:e[i]}),r}const rE={min:NaN,max:NaN,expand:NaN,include:[],invert:!1},iE={tight:!1,forceBounds:!1,values:void 0,count:NaN,distance:100},oE={count:NaN};function aE(e,t){e.instance||(e.instance=t.copy(),e.instance.domain([t.start(),t.end()]),e.instance.clamp(!0),e.instance.range(e.invert?[1,0]:[0,1]))}function sE(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Ww(),i={instance:null,invert:!1},o={data:t,resources:n},a=nE(e,rE,o);let s;function l(e){return Fv(e)?NaN:r(e)}a.ticks=nE(e.ticks,iE,o),a.minorTicks=nE(e.minorTicks,oE,o),l.data=()=>t,l.invert=function(e){return r.invert(e)},l.rangeRound=function(e){return r.rangeRound(e),l},l.clamp=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return r.clamp(e),l},l.cachedTicks=function(){return s},l.clearTicksCache=function(){return s=void 0,this},l.ticks=function(e){return null!==e&&"object"==typeof e?(e.settings=e.settings||{},e.settings=Dv(!0,{},a,e.settings),e.scale=l,s=tE(e),s):(s=r.ticks(e),s)},l.nice=function(e){return r.nice(e),l},l.tickFormat=function(e,t){return r.tickFormat(e,t)},l.interpolate=function(e){return r.interpolate(e),l},l.domain=function(e){return arguments.length?(r.domain(e),i.instance&&i.instance.domain([l.start(),l.end()]),l):r.domain()},l.range=function(e){return arguments.length?(r.range(e),l):r.range()},l.start=function(){return l.domain()[0]},l.end=function(){return l.domain()[this.domain().length-1]},l.min=function(){return Math.min(this.start(),this.end())},l.max=function(){return Math.max(this.start(),this.end())},l.classify=function(e){let t=(l.start()-l.end())/e,n=[l.end()],r=[],i=t/2;for(let o=0;o<e;o++){let e=n[n.length-1]||0,o=e+t,a=l(e+i);n.push(o,o),r.push(a,a)}return n.pop(),l.domain(n),l.range(r),l},l.copy=function(){const i=sE(e,t,n);return i.domain(l.domain()),i.range(l.range()),i.clamp(r.clamp()),i},l.norm=function(e){return aE(i,l),i.instance(e)},l.normInvert=function(e){return aE(i,l),i.instance.invert(e)};const c=function(e,t){const n=+e.min,r=+e.max;let i=0,o=1;if(t&&t[0]){const n=t.map(e=>e.min()).filter(e=>!isNaN(e)),r=t.map(e=>e.max()).filter(e=>!isNaN(e));if(i=n.length?Math.min(...n):Number.NaN,o=r.length?Math.max(...r):Number.NaN,isNaN(i)||isNaN(o))i=-1,o=1;else if(i===o&&0===i)i=-1,o=1;else if(i===o&&i)i-=Math.abs(.1*i),o+=Math.abs(.1*o);else if(!isNaN(e.expand)){const t=o-i;i-=t*e.expand,o+=t*e.expand}if(Array.isArray(e.include)){const t=e.include.filter(e=>!isNaN(e));i=Math.min(...t,i),o=Math.max(...t,o)}}return{mini:isNaN(n)?i:n,maxi:isNaN(r)?o:r}}(a,t?t.fields:[]),u=c.mini,d=c.maxi;return l.domain([u,d]),l.range(a.invert?[1,0]:[0,1]),i.invert=a.invert,l}const lE={padding:0,paddingInner:NaN,paddingOuter:NaN,align:.5,invert:!1,maxPxStep:NaN,range:[0,1]};function cE(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={data:t,resources:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}},r=nE(e,lE,n),i=t.items||[],o={},a=[],s=[];function l(e,n){e.data=()=>t,e.datum=e=>i[o[e]],e.start=function(){return e.domain()[0]},e.end=function(){return e.domain()[e.domain().length-1]},e.labels=()=>s,e.ticks=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.scale=e,function(e){let t=e.scale;const n=t.domain(),r=t.data().items,i=t.labels?t.labels():n,o=t.bandwidth();return n.map((e,n)=>{const a=t(e);return{position:a+o/2,label:"".concat(i[n]),data:r?r[n]:void 0,start:a,end:a+o}})}(t,n.trackBy)}}const c=BM();l(c,e),c.pxScale=function(t){const n=r.maxPxStep;if(isNaN(n))return c;const i=c.domain().length,o=Math.max(1,i-c.paddingInner()+2*c.paddingOuter());if(o*n>=t)return c;const a=c.copy();a.type=c.type,l(a,e);const s=o*n/t,u=(1-s)*c.align();return a.range(r.invert?[s+u,u]:[u,s+u]),a};const u="function"==typeof e.value?e.value:e=>e.datum.value,d="function"==typeof e.label?e.label:e=>e.datum.label;for(let e=0;e<i.length;e++){const t=Dv({datum:i[e]},n),r=u(t,e);-1===a.indexOf(r)&&(a.push(r),s.push(d(t,e)),o[r]=e)}return c.domain(a),c.range(r.invert?r.range.slice().reverse():r.range),c.padding(isNaN(r.padding)?0:r.padding),isNaN(r.paddingInner)||c.paddingInner(r.paddingInner),isNaN(r.paddingOuter)||c.paddingOuter(r.paddingOuter),c.align(isNaN(r.align)?.5:r.align),c}const uE={depth:0};function dE(e,t,n){return e.ancestors().map(e=>t(Dv({datum:e.data},n))).reverse().slice(1).toString()}const fE=e=>e.min(),hE=e=>e.max();function pE(e,t){const n=e&&!isNaN(e.min),r=e&&!isNaN(e.max);let i=n?+e.min:0,o=r?+e.max:1;if(t&&t.length){if(!n){const e=t.map(fE).filter(zv);i=e.length?Math.min(...e):i}if(!r){const e=t.map(hE).filter(zv);o=e.length?Math.max(...e):o}}return[i,o]}const mE={domain:[],range:[],invert:!1,min:NaN,max:NaN};function gE(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=sE(e,t,n).clamp(!0).interpolate(Cw),i=nE(e,mE,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length,s=r;Dv(!0,s,r);const l=_v(pE(i,t?t.fields:[]),2),c=l[0],u=l[1],d=o?i.domain.length:-1,f=n.theme?n.theme.palette("sequential",d>0?d:2):[],h=a?i.range:f;return s.range(i.invert?h.slice().reverse():h.slice()),s.domain(o?i.domain:function(e,t,n){const r=e.length;if(2===r)return[t,n];const i=[],o=(n-t)/(r-1);i.push(t);for(let e=1;e<r-1;e++)i.push(t+o*e);return i.push(n),i}(s.range(),c,u)),s}const yE={domain:[],range:[],invert:!1,min:NaN,max:NaN,nice:!1};function vE(e){const t=[];for(let n=0;n<e.length-1;n++)t.push((e[n]+e[n+1])/2);return t}const bE={domain:[],range:[]};const xE={domain:[],range:[],unknown:void 0},SE={domain:[],range:[],override:!1};const ME=Jb();function wE(e,t,n){let r=e.data;e.source&&(n.logger.warn("Deprecated: Scale data source configuration"),r={extract:[]},(Array.isArray(e.source)?e.source:[e.source]).forEach(e=>{r.extract.push({field:e})}));const i=PM(r,t,n);let o,a=e.type||function(e){return e.root?"h-band":e.fields&&e.fields[0]?function(e){const t=e.map(e=>"dimension"===e.type()?"band":"linear");return-1!==t.indexOf("linear")?"linear":"band"}(e.fields):"linear"}(i);return"color"===a&&(a=i.fields&&i.fields[0]&&"dimension"===i.fields[0].type()?"categorical-color":"sequential-color"),n.scale.has(a)&&(o=n.scale.get(a),o=o(e,i,{theme:n.theme,logger:n.logger}),o.type=a),o}ME("linear",sE),ME("band",cE),ME("h-band",function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i={data:n,resources:r},o=nE(t,lE,i);o.ticks=nE(t.ticks,uE,i),o.value="function"==typeof t.value?t.value:e=>e.datum.value,o.label="function"==typeof t.label?t.label:e=>e.datum.value;let a=cE(o);const s=function(e,t,n){const r=t.ticks.depth,i=t.value,o=t.label,a=[],s=[],l={},c=[];let u=0;if(!e)return{values:a,labels:s,items:l,ticks:c};e.eachAfter(e=>{if(e.depth>0){const t=dE(e,i,n),d=e.leaves()||[e],f=i(Dv({datum:e.data},n)),h=o(Dv({datum:e.data},n)),p=Array.isArray(e.children),m={key:t,count:d.length,value:f,label:h,leftEdge:dE(d[0],i,n),rightEdge:dE(d[Math.max(d.length-1,0)],i,n),node:e};p?(a.push("SPACER_".concat(u,"_SPACER")),u++):(a.push(t),s.push(h)),(r<=0&&!p||e.depth===r)&&c.push(m),l[t]=m}});const d=e.height-1;return d>0&&a.splice(-d),{values:a,labels:s,items:l,ticks:c}}(n.root,o,i),l=s.values,c=s.labels,u=s.items,d=s.ticks,f=function(e){const t=String(e),n=u[t];return a(n?o.invert?n.rightEdge:n.leftEdge:t)};Dv(!0,f,a),f.bandwidth=function(e){const t=u[String(e)],n=a.bandwidth();if(t&&!t.isLeaf){const e=f(t.leftEdge),r=f(t.rightEdge);return Math.abs(e-r)+n}return n},f.step=function(e){const t=u[String(e)],n=t?t.count:1;let r=a.step();return r*=n,r},f.data=()=>n,f.datum=e=>{const t=u[String(e)];return t?t.node.data:null},f.copy=()=>e(t,n,r),f.labels=()=>c,f.ticks=()=>d.map(e=>{const t=f(e.key),n=f.bandwidth(e.key);return{position:t+n/2,label:e.label,data:e.node.data,start:t,end:t+n}});const h=a.pxScale;return f.pxScale=function(e){return a=h(e),f},f.domain(l),f}),ME("sequential-color",gE),ME("threshold-color",function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=Yw(),i=nE(e,yE,{data:t,resources:n}),o=Array.isArray(i.domain)&&i.domain.length,a=Array.isArray(i.range)&&i.range.length;function s(e){return Fv(e)?NaN:r(e)}Object.keys(r).forEach(e=>s[e]=r[e]);const l=_v(pE(i,t.fields),2),c=l[0],u=l[1],d=o?i.domain.length:-1,f=n.theme?n.theme.palette("sequential",d>0?d:2):[];let h=a?i.range:f,p=[];return p=o?i.domain:i.nice?function(e,t,n){const r=2===e.length?10:Math.max(1,e.length),i=Ww().domain([t,n]).nice(r).ticks(r);if(!e||!e.length)return i;const o=Math.max(0,e.length-1);for(;i.length>o;)i[0]-t<=n-i[i.length-1]?i.shift():i.pop();return i}(h,c,u):[c+(u-c)/2],h.length>p.length+1?p=function(e,t,n){const r=e.length;if(2===r)return[t+(n-t)/2];const i=[],o=(n-t)/r;for(let e=1;e<r;e++)i.push(t+o*e);return i}(h,c,u):h.length<p.length+1&&(h=function(e,t,n,r){n=e[0],r=e&&e.length>=2?e[e.length-1]:r;const i=gE().domain([n,r]).range(t);return[n,...vE(e),r].map(e=>i(e))}(p,h,c,u)),s.data=()=>t,s.range(i.invert?h.slice().reverse():h),s.domain(p),s}),ME("categorical-color",function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=$M(),i={data:t,resources:n},o=nE(e,bE,i),a="function"==typeof e.value?e.value:e=>e.datum.value,s="function"==typeof e.label?e.label:e=>e.datum.label,l=t.items||[],c={},u=[],d=[];for(let e=0;e<l.length;e++){const t=Dv({datum:l[e]},i),n=a(t,e);-1===u.indexOf(n)&&(u.push(n),d.push(s(t,e)),c[n]=e)}return r.data=()=>t,r.labels=()=>d,r.label=e=>d[u.indexOf(e)],r.datum=e=>l[c[e]],r.range(o.range),Array.isArray(o.domain)&&o.domain.length?r.domain(o.domain):r.domain(u),r}(e,t,n),i=n.theme,o=nE(e,xE,{data:t,resources:n});let a;if(o.explicit=nE(e.explicit,SE,{data:t,resources:n}),a=Array.isArray(o.range)&&0!==o.range.length?o.range.slice():i?i.palette("categorical",r.domain().length).slice():[],o.unknown)r.unknown(o.unknown);else if(i&&i.palette("unknown")){let e=i.palette("unknown");r.unknown(e[0])}if(Array.isArray(o.explicit.domain)&&o.explicit.domain.length){const e=r.domain().slice(),t=o.explicit.domain,n=Array.isArray(o.explicit.range)?o.explicit.range:[],i=Math.floor(e.length/a.length);for(let e=1;e<i+1;e*=2)a=a.concat(a);if(o.explicit.override)for(let r=0;r<t.length;r++){const i=e.indexOf(t[r]);i>-1&&(a[i]=n[r])}else{const r=t.map((t,r)=>[e.indexOf(t),t,n[r]]).sort((e,t)=>e[0]-t[0]);r.forEach(t=>{const n=e.indexOf(t[1]);-1!==n&&a.splice(n,0,t[2])})}a.length=e.length}return r.range(a),r});var EE={};function kE(){kE.init.call(this)}EE.isObject=function(e){return"object"==typeof e&&null!==e},EE.isNumber=function(e){return"number"==typeof e},EE.isUndefined=function(e){return void 0===e},EE.isFunction=function(e){return"function"==typeof e};var CE=kE;kE.EventEmitter=kE,kE.prototype._events=void 0,kE.prototype._maxListeners=void 0,kE.defaultMaxListeners=10,kE.init=function(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0},kE.prototype.setMaxListeners=function(e){if(!EE.isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},kE.prototype.emit=function(e){var t,n,r,i,o,a;if(this._events||(this._events={}),"error"===e&&!this._events.error)throw(t=arguments[1])instanceof Error?t:Error('Uncaught, unspecified "error" event.');if(n=this._events[e],EE.isUndefined(n))return!1;if(EE.isFunction(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];n.apply(this,i)}else if(EE.isObject(n)){for(r=arguments.length,i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];for(r=(a=n.slice()).length,o=0;o<r;o++)a[o].apply(this,i)}return!0},kE.prototype.addListener=function(e,t){var n;if(!EE.isFunction(t))throw TypeError("listener must be a function");(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,EE.isFunction(t.listener)?t.listener:t),this._events[e]?EE.isObject(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,EE.isObject(this._events[e])&&!this._events[e].warned)&&((n=EE.isUndefined(this._maxListeners)?kE.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,EE.isFunction(console.error)&&console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),EE.isFunction(console.trace)&&console.trace()));return this},kE.prototype.on=kE.prototype.addListener,kE.prototype.once=function(e,t){if(!EE.isFunction(t))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}return r.listener=t,this.on(e,r),this},kE.prototype.removeListener=function(e,t){var n,r,i,o;if(!EE.isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(i=(n=this._events[e]).length,r=-1,n===t||EE.isFunction(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(EE.isObject(n)){for(o=i;o-- >0;)if(n[o]===t||n[o].listener&&n[o].listener===t){r=o;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},kE.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],EE.isFunction(n))this.removeListener(e,n);else if(Array.isArray(n))for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},kE.prototype.listeners=function(e){return this._events&&this._events[e]?EE.isFunction(this._events[e])?[this._events[e]]:this._events[e].slice():[]},kE.listenerCount=function(e,t){return e._events&&e._events[t]?EE.isFunction(e._events[t])?1:e._events[t].length:0};var AE={mixin:e=>(Object.keys(CE.prototype).forEach(t=>{e[t]=CE.prototype[t]}),CE.init(e),e)};function OE(){let e=0,t=0,n=0,r=0;n=n||e;const i={move(e){this.moveTo(n+e)},moveTo(o){const a=Math.max(e,Math.min(t-r,o));n!==a&&(n=a,i.emit("update"))},update(o){let a=!1;var s=o.min;e=void 0===s?e:s;var l=o.max;t=void 0===l?t:l,void 0!==o.viewSize&&o.viewSize!==r&&(r=o.viewSize,a=!0);const c=Math.max(e,Math.min(t-r,n));n!==c&&(n=c,a=!0),a&&i.emit("update")},getState:()=>({min:e,max:t,start:n,viewSize:r})};return AE.mixin(i),i}function NE(e,t){const n=e.min||0,r=e.max||0,i=e.viewSize||0,o=t||OE();return o.update({min:n,max:r,viewSize:i}),o}function DE(e,t){return e<=t}function TE(e,t){return e<t}function qE(e,t,n){let r=0;for(;r<e.length&&t>e[r];)++r;return e[r]===t&&n&&++r,r}function IE(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];function i(){}return i.configure=function(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=n.includeMax,i=void 0===r||r,o=n.includeMin;e=i?DE:TE,t=void 0===o||o?DE:TE},i.add=e=>{let t=e.min,n=e.max;const i=qE(r,t),o=qE(r,n,!0),a=[i,o-i];i%2==0&&a.push(t),o%2==0&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.remove=e=>{let t=e.min,n=e.max;const i=qE(r,t),o=qE(r,n,!0),a=[i,o-i];i%2==1&&a.push(t),o%2==1&&a.push(n);const s=r.join(",");r.splice(...a);return s!==r.join(",")},i.set=e=>{const t=r.join(",");r=[],Array.isArray(e)?e.forEach(i.add):i.add(e);return t!==r.join(",")},i.clear=()=>{const e=r.length>0;return r=[],e},i.containsValue=n=>function(e,t,n,r){const i=e.length;for(let o=1;o<i;o+=2)if(n(e[o-1],t)&&r(t,e[o]))return!0;return!1}(r,n,t,e),i.containsRange=e=>{let t=e.min,n=e.max;const i=qE(r,t,!0),o=qE(r,n);return i===o&&o%2==1},i.toggle=e=>i.containsRange(e)?i.remove(e):i.add(e),i.ranges=()=>{const e=[];for(let t=1;t<r.length;t+=2)e.push({min:r[t-1],max:r[t]});return e},i.configure(n),i}function RE(){let e=[];function t(){}return t.add=t=>-1===e.indexOf(t)&&(e.push(t),!0),t.remove=t=>{const n=e.indexOf(t);return-1!==n&&(e.splice(n,1),!0)},t.contains=t=>-1!==e.indexOf(t),t.values=()=>e.slice(),t.clear=()=>e=[],t.toString=()=>e.join(";"),t}const LE={key:void 0,includeMin:!0,includeMax:!0};function _E(e){let t=e.items,n=e.collection,r=e.vc;const i={},o=[];let a,s;for(let e=0,o=t.length;e<o;e++){a=t[e].key,n[a]||(n[a]=r()),s=t[e].values||[t[e].value];for(let e=0;e<s.length;e++)n[a].add(s[e])&&(i[a]=i[a]||[],i[a].push(s[e]))}const l=Object.keys(i);for(let e=0,t=l.length;e<t;e++)a=l[e],o.push({id:a,values:i[a]});return o}function PE(e){let t=e.items,n=e.collection;const r={},i=[];let o,a;for(let e=0,i=t.length;e<i;e++)if(o=t[e].key,n[o]){a=t[e].values||[t[e].value];for(let e=0;e<a.length;e++)n[o].remove(a[e])&&(r[o]=r[o]||[],r[o].push(a[e]))}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++)o=s[e],i.push({id:o,values:r[o]});return i}function zE(e){const t={};let n,r;for(let i=0,o=e.length;i<o;i++){n=e[i].key,r=e[i].values||[e[i].value],t[n]||(t[n]=[]);for(let e=0;e<r.length;e++){-1===t[n].indexOf(r[e])&&t[n].push(r[e])}}return t}function FE(e){let t=e.key,n=e.collection,r=e.obj,i=e.fn,o=e.value;n[t]||(n[t]=i()),r[t]=r[t]||[],r[t].push(o),n[t].add(o)}function jE(e,t){const n=[],r=Object.keys(e);let i,o;const a=e=>-1===t[i].indexOf(e);for(let s=0,l=r.length;s<l;s++)i=r[s],t[i]?(o=e[i].filter(a),o.length&&n.push({id:i,values:o})):n.push({id:i,values:e[i]});return n}function $E(e,t,n){const r=function(e,t){if(!Object.keys(t).length)return e;const n=e.length,r=Array(n);for(let i=0;i<n;i++)r[i]=e[i].key in t?Dv({},e[i],{key:t[e[i].key]}):e[i];return r}(t,n);return e&&e.length?e.reduce((e,t)=>t(e),r):r}function BE(e){return e.replace(/(-[a-z])/g,e=>e.toUpperCase().replace("-",""))}function VE(e){return e.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase()))}function HE(e,t,n){let r=n.ranges,i=n.interceptors,o=n.rc,a=n.aliases,s=n.rangeConfig;const l=$E(i["".concat(t,"Ranges")],e,a);let c=!1;return l.forEach(e=>{const n=e.key;if(r[n]||(r[n]=o(s.sources[n]||s.default)),"set"===t)c=r[n][t](e.ranges||e.range)||c;else{const i=e.ranges||[e.range];for(let e=0;e<i.length;e++)c=r[n][t](i[e])||c}}),c}function UE(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.vc,n=void 0===t?RE:t,r=e.rc,i=void 0===r?IE:r,o=!1,a={},s={},l={},c={sources:{},default:Dv({},LE)};const u={addValues:[],removeValues:[],toggleValues:[],setValues:[],addRanges:[],setRanges:[],removeRanges:[],toggleRanges:[]},d=()=>{const e={values:{},ranges:{}};return Object.keys(s).forEach(t=>{e.values[t]=s[t].values()}),Object.keys(a).forEach(t=>{e.ranges[t]=a[t].ranges()}),e},f={ls:[],clear(){this.ls.forEach(e=>e.clear())},start(){this.ls.forEach(e=>e.start())},end(){this.ls.forEach(e=>e.end())},update(){const e=d();this.ls.forEach(t=>t._state(e))},updateValues(){const e=d();this.ls.forEach(t=>t._state({values:e.values}))},updateRanges(){const e=d();this.ls.forEach(t=>t._state({ranges:e.ranges}))}},h={configure:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Array.isArray(e.ranges)&&e.ranges.length&&(c={sources:{},default:Dv({},LE)},e.ranges.forEach(e=>{const t={};Object.keys(LE).filter(e=>"key"!==e).forEach(n=>{t[n]=void 0!==e[n]?e[n]:LE[n]}),void 0!==e.key?c.sources[e.key]=t:c.default=t}),Object.keys(a).forEach(e=>a[e].configure(c.sources[e]||c.default)),h.emit("update",[],[]))},link:e=>{if(h===e)throw new Error("Can't link to self");f.ls.push(e),e._state(d())},_state:e=>{if(!e)return d();if(e.values){const t=[];Object.keys(e.values).forEach(n=>{s[n]&&e.values[n].join(";")===s[n].toString()||t.push({key:n,values:e.values[n]})}),Object.keys(s).forEach(n=>{e.values[n]||t.push({key:n,values:[]})}),t.length&&h.setValues(t)}if(e.ranges){const t=[];Object.keys(e.ranges).forEach(n=>{a[n]&&e.ranges[n].join(";")===a[n].toString()||t.push({key:n,ranges:e.ranges[n]})}),Object.keys(a).forEach(n=>{e.ranges[n]||t.push({key:n,ranges:[]})}),t.length&&h.setRanges(t)}},start:function(){if(!o){o=!0;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];h.emit("start",...t),f.start()}},end:function(){if(o){o=!1,a={},s={};for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];h.emit("end",...t),f.end()}},isActive:()=>o,clear:()=>{const e=h.brushes().filter(e=>"value"===e.type&&e.brush.values().length).map(e=>({id:e.id,values:e.brush.values()})),t=Object.keys(a).length>0||e.length;a={},s={},t&&(h.emit("update",[],e),f.clear())},brushes:()=>{let e=[];return e=e.concat(Object.keys(a).map(e=>({type:"range",id:e,brush:a[e]}))),e=e.concat(Object.keys(s).map(e=>({type:"value",id:e,brush:s[e]}))),e},addValue:(e,t)=>{h.addValues([{key:e,value:t}])},addValues:e=>{const t=$E(u.addValues,e,l),r=_E({vc:n,collection:s,items:t});h.emit("add-values",t),r.length&&(o||(o=!0,h.emit("start")),h.emit("update",r,[]),f.updateValues())}};return h.setValues=e=>{const t=$E(u.setValues,e,l),r=function(e){let t=e.items,n=e.vCollection,r=e.vc;const i={},o=zE(t);let a,s=[],l=[];const c={},u=Object.keys(n);for(let e=0,t=u.length;e<t;e++)a=u[e],c[a]=n[a].values().slice(),delete n[a];const d=e=>{n[a]&&n[a].contains(e)||FE({key:a,value:e,collection:n,obj:i,fn:r})},f=Object.keys(o);for(let e=0,t=f.length;e<t;e++)a=f[e],o[a].forEach(d);return l=jE(c,i),s=jE(i,c),[s,l]}({items:t,vCollection:s,vc:n});h.emit("set-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,h.emit("start")),h.emit("update",r[0],r[1]),f.updateValues())},h.removeValue=(e,t)=>{h.removeValues([{key:e,value:t}])},h.removeValues=e=>{const t=$E(u.removeValues,e,l),n=PE({collection:s,items:t});h.emit("remove-values",t),n.length&&(h.emit("update",[],n),f.updateValues())},h.addAndRemoveValues=(e,t)=>{const r=$E(u.addValues,e,l),i=$E(u.removeValues,t,l),a=_E({vc:n,collection:s,items:r}),c=PE({collection:s,items:i});h.emit("add-values",r),h.emit("remove-values",i),(a.length||c.length)&&(o||(o=!0,h.emit("start")),h.emit("update",a,c),f.updateValues())},h.toggleValue=(e,t)=>{h.toggleValues([{key:e,value:t}])},h.toggleValues=e=>{const t=$E(u.toggleValues,e,l),r=function(e){let t=e.items,n=e.values,r=e.vc;const i={},o={},a=[],s=[],l=zE(t);let c,u,d;const f=Object.keys(l);for(let e=0,t=f.length;e<t;e++){c=f[e],d=l[c];for(let e=0,t=d.length;e<t;e++)u=d[e],n[c]&&n[c].contains(u)?n[c]&&n[c].contains(u)&&(o[c]=o[c]||[],o[c].push(u),n[c].remove(u)):FE({key:c,value:u,collection:n,obj:i,fn:r})}const h=Object.keys(i);for(let e=0,t=h.length;e<t;e++)c=h[e],a.push({id:c,values:i[c]});const p=Object.keys(o);for(let e=0,t=p.length;e<t;e++)c=p[e],s.push({id:c,values:o[c]});return[a,s]}({items:t,values:s,vc:n});h.emit("toggle-values",t),(r[0].length>0||r[1].length>0)&&(o||(o=!0,h.emit("start")),h.emit("update",r[0],r[1]),f.updateValues())},h.containsValue=(e,t)=>{let n=l[e]||e;return!!s[n]&&s[n].contains(t)},h.addRange=(e,t)=>{h.addRanges([{key:e,range:t}])},h.addRanges=e=>{HE(e,"add",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,h.emit("start")),h.emit("update",[],[]),f.updateRanges())},h.removeRange=(e,t)=>{h.removeRanges([{key:e,range:t}])},h.removeRanges=e=>{HE(e,"remove",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,h.emit("start")),h.emit("update",[],[]),f.updateRanges())},h.setRange=(e,t)=>{h.setRanges([{key:e,range:t}])},h.setRanges=e=>{HE(e,"set",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,h.emit("start")),h.emit("update",[],[]),f.updateRanges())},h.toggleRange=(e,t)=>{h.toggleRanges([{key:e,range:t}])},h.toggleRanges=e=>{HE(e,"toggle",{ranges:a,rc:i,interceptors:u,aliases:l,rangeConfig:c})&&(o||(o=!0,h.emit("start")),h.emit("update",[],[]),f.updateRanges())},h.containsRangeValue=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].containsValue(t)},h.containsRange=(e,t)=>{let n=l[e]||e;return!!a[n]&&a[n].containsRange(t)},h.containsMappedData=(e,t,n)=>{let r=[];const i=Object.keys(e);let o,c,u,d;for(let t=0,n=i.length;t<n;t++){if(o=i[t],"value"===o)c=e,r[t]={key:"",i:t,bool:!1};else{if("source"===o)continue;c=e[o],r[t]={key:o,i:t,bool:!1}}u=c.source&&c.source.field,void 0!==u&&(void 0!==c.source.key&&(u="".concat(c.source.key,"/").concat(u)),u in l&&(u=l[u]),d=c.value,a[u]?r[t].bool=Array.isArray(d)?a[u].containsRange({min:d[0],max:d[1]}):a[u].containsValue(d):s[u]&&s[u].contains(d)&&(r[t].bool=!0))}return t?(r=r.filter(e=>-1!==t.indexOf(e.key)),"and"===n?!!r.length&&!r.some(e=>!1===e.bool):"xor"===n?!!r.length&&r.some(e=>e.bool)&&r.some(e=>!1===e.bool):r.some(e=>e.bool)):r.some(e=>e.bool)},h.intercept=(e,t)=>{const n=BE(e);u[n]&&u[n].push(t)},h.removeInterceptor=(e,t)=>{const n=BE(e);if(!u[n])return;const r=u[n].indexOf(t);-1!==r&&u[n].splice(r,1)},h.removeAllInterceptors=e=>{const t=[];if(e){const n=BE(e);u[n]&&u[n].length&&t.push({name:e,handlers:u[n]})}else Object.keys(u).forEach(e=>{u[e].length&&t.push({name:VE(e),handlers:u[e]})});t.forEach(e=>{e.handlers.slice().forEach(t=>h.removeInterceptor(e.name,t))})},h.addKeyAlias=(e,t)=>{l[e]=t},h.removeKeyAlias=e=>{delete l[e]},AE.mixin(h),h}function WE(e){return e*e*e}function YE(e){return--e*e*e+1}function KE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}Jb();const GE=["stroke","fill","color","backgroundColor","thumbColor"];function XE(e,t){const n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),o=new Array(n);let a;for(a=0;a<r;++a)i[a]=JE(e[a],t[a]);for(;a<n;++a)o[a]=t[a];return function(e){for(a=0;a<r;++a)o[a]=i[a](e);return o}}function JE(e,t,n){const r=typeof t;let i;return null==t||"boolean"===r?function(e){return()=>e}(t):("number"===r?Dw:"string"===r?(i=sw(t))&&GE.includes(n)?(t=i,Cw):Rw:t instanceof sw?Cw:t instanceof Date?Nw:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?Aw:Array.isArray(t)?XE:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?ZE:Dw)(e,t)}function ZE(e,t){const n={},r={};let i;for(i in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)i in e?n[i]=JE(e[i],t[i],i):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}function QE(e,t){return e.data?e.data.value:"text"===e.type?e.text:t}const ek={fontFamily:"Arial",fontSize:"13px",color:"#595959",backgroundColor:"#ffffff",stroke:"#000000",strokeWidth:0,$fill:"#333333"},tk=/^\$/;function nk(e){const t=typeof e;return"object"!==t&&"function"!==t&&"undefined"!==t}function rk(e,t,n){const r=e[t];r&&r.scale&&r.scale.pxScale?r.scale=r.scale.pxScale(n):r&&r.pxScale&&(e[t]=r.pxScale(n))}function ik(e,t){return e.pxScale?e.pxScale(t):e}const ok={normalizeSettings:function(e,t,n){const r=Dv({},e),i=Dv({},t);return Object.keys(r).forEach(e=>{i[e]={};const o=r[e],a=typeof o;if("function"==typeof o)i[e].fn=o;else if(nk(o)){let n=t[e];"string"==typeof n&&tk.test(n)&&(n=ek[n]);const r=typeof n;i[e]="undefined"===r||r===a?o:n}else o&&"object"==typeof o&&("function"==typeof o.fn&&(i[e].fn=o.fn),void 0!==o.scale&&(i[e].scale=n.scale(o.scale)),"string"==typeof o.ref&&(i[e].ref=o.ref))}),Object.keys(t).forEach(e=>{if(e in r)return;const n=t[e];"string"===typeof n&&tk.test(n)?i[e]=ek[n]:i[e]=n}),i},resolveForItem:function(e,t,n){const r={},i=Object.keys(t),o=i.length,a=e.datum,s=e.datum;for(let l=0;l<o;l++){const o=i[l],c=t[o],u="object"==typeof s&&void 0!==c,d=u&&"string"==typeof c.ref,f=u&&o in s,h=d?s[c.ref]:f?s[o]:a;nk(c)?r[o]=c:u&&c.fn?(c.scale&&(e.scale=c.scale),r[o]=c.fn.call(null,e,n)):u&&c.scale&&h?(r[o]=c.scale(h.value),c.scale.bandwidth&&(r[o]+=c.scale.bandwidth()/2)):d&&h?r[o]=h.value:c.fn?r[o]=c.fn.call(null,e,n):r[o]=c}return r},updateScaleSize:rk};function ak(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((e,t)=>Array.isArray(t.children)?(e.push(...ak(t.children)),e):(e.push(t),e),[])}function sk(e,t){let n=t.context,r=t.data,i=t.style,o=t.filter,a=t.mode;const s=e.chart.brush(n),l=r,c=i.active||{},u=i.inactive||{},d=[];Object.keys(c).forEach(e=>{d.push(e)}),Object.keys(u).forEach(e=>{-1===d.indexOf(e)&&d.push(e)});const f=[];let h=!1;const p=()=>{let t=ak(e.nodes);return"function"==typeof o&&(t=t.filter(o)),t},m=()=>{const e=p(),t=e.length;let n,r=!1;const i="function"==typeof l?l({brush:s}):l;for(let r=0;r<t;r++){if(n=e[r].data,!n)continue;e[r].__style||(e[r].__style={},d.forEach(t=>{e[r].__style[t]=e[r][t]}));const t=s.containsMappedData(n,i,a),o=f.indexOf(e[r]);let l=!1;t&&-1===o?(f.push(e[r]),l=!0):t||-1===o||(f.splice(o,1),l=!0),e[r].needToUpdate=l||h,e[r].isActive=t}for(let i=0;i<t;i++)if(n=e[i].data,n){if(e[i].needToUpdate){const t=Dv({},e[i],e[i].__style),n=e[i].isActive;d.forEach(r=>{e[i][r]=n&&r in c?"function"==typeof c[r]?c[r].call(null,t,f):c[r]:!n&&r in u?"function"==typeof u[r]?u[r].call(null,t,f):u[r]:e[i].__style[r]}),r=!0}delete e[i].needToUpdate}return h=!1,r},g=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=p(),r=n.length;for(let e=0;e<r;e++)n[e].data&&(n[e].__style=n[e].__style||{},d.forEach(t=>{n[e].__style[t]=n[e][t],t in u&&(n[e][t]="function"==typeof u[t]?u[t].call(null,n[e]):u[t])}));h=!0,f.length=0,t||e.renderer.render(e.nodes)},y=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{suppressRender:!1}).suppressRender,n=p(),r=n.length;for(let e=0;e<r;e++)n[e].__style&&(Object.keys(n[e].__style).forEach(t=>{n[e][t]=n[e].__style[t]}),n[e].__style=void 0);f.length=0,t||e.renderer.render(e.nodes)},v=()=>{if(m()){const t="function"==typeof e.config.sortNodes?e.config.sortNodes(e):e.nodes;"function"==typeof e.config.customRender?e.config.customRender({render:e.renderer.render,nodes:t}):e.renderer.render(t)}};return s.on("start",g),s.on("end",y),s.on("update",v),{isActive:()=>s.isActive(),update:()=>{f.length=0,h=!0,m()},cleanUp:function(){s.removeListener("start",g),s.removeListener("end",y),s.removeListener("update",v)}}}function lk(e){let t=e.nodes,n=e.action,r=e.chart,i=e.trigger;const o=[];for(let e=0;e<t.length;e++){let n=t[e].data;null!==n&&o.push(n)}!function(e){let t=e.dataPoints,n=e.action,r=e.chart,i=e.trigger;if(!i)return;const o=i.data||[""];let a={items:[],actionFn:"toggleRanges"},s={items:[],actionFn:"toggleValues"};-1!==["add","remove","set","toggle"].indexOf(n)&&(a.actionFn="".concat(n,"Ranges"),s.actionFn="".concat(n,"Values"));for(let e=0;e<t.length;e++){const n=t[e];n&&o.forEach(e=>{let t=n&&!e?n:n[e];if(t){let e={key:t.source.field};void 0!==t.source.key&&(e.key="".concat(t.source.key,"/").concat(t.source.field)),Array.isArray(t.value)?(e.range={min:t.value[0],max:t.value[1]},a.items.push(e)):(e.value=t.value,s.items.push(e))}})}i.contexts.forEach(e=>{a.items.length?r.brush(e)[a.actionFn](a.items):r.brush(e)[s.actionFn](s.items)})}({dataPoints:o,action:n,chart:r,trigger:i})}function ck(e){let t=e.collisions,n=e.t,r=e.config,i=e.action,o=[],a=!1;t.length>0&&(o=t,a=!0,"stop"===n.propagation&&(o=[t[t.length-1]]));const s=o.map(e=>e.node);return lk({nodes:s,action:i,chart:r.chart,data:r.data,trigger:n}),a}function uk(e,t,n){const r=n.element().getBoundingClientRect();let i=Pv(e)?function(e,t){return 1!==e.changedTouches.length?null:{x:e.changedTouches[0].clientX-t.left,y:e.changedTouches[0].clientY-t.top}}(e,r):function(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}(e,r);return null===i||i.x<0||i.y<0||i.x>r.width||i.y>r.height?[]:(t.touchRadius>0&&Pv(e)?i={cx:i.x,cy:i.y,r:t.touchRadius}:t.mouseRadius>0&&!Pv(e)&&(i={cx:i.x,cy:i.y,r:t.mouseRadius}),n.itemsAt(i))}function dk(e,t,n){return e?"function"==typeof e?e(t):e:n}const fk={fill:"fill",stroke:"stroke",opacity:"opacity",strokeWidth:"stroke-width",strokeLinejoin:"stroke-linejoin",fontFamily:"font-family",fontSize:"font-size",fontStyle:"font-style",textDecoration:"text-decoration",fontWeight:"font-weight",baseline:"dominant-baseline",dominantBaseline:"dominant-baseline",anchor:"text-anchor",textAnchor:"text-anchor",maxWidth:"maxWidth",transform:"transform",strokeDasharray:"stroke-dasharray",id:"id"};function hk(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?"M".concat(r.x," ").concat(r.y):"L".concat(r.x," ").concat(r.y),n+=" "}return t&&(n+="Z"),n}function pk(e,t,n,r){const i=n/2,o=e-r/2,a=t-r/2,s=e-i,l=t-i;return[{x:o,y:a},{x:o,y:l},{x:o+r,y:l},{x:o+r,y:a},{x:s+n,y:a},{x:s+n,y:a+r},{x:o+r,y:a+r},{x:o+r,y:l+n},{x:o,y:l+n},{x:o,y:a+r},{x:s,y:a+r},{x:s,y:a}]}function mk(e){return-e/180*Math.PI}function gk(e){return function(e){let t=(.5*(Math.floor(e/Math.PI*2)+2)+.25)*Math.PI,n=Math.cos(Math.abs(t-e))*Math.sqrt(2),r=n*Math.cos(e),i=n*Math.sin(e);return{x1:r<0?1:0,y1:i<0?1:0,x2:r>=0?r:r+1,y2:i>=0?i:i+1}}(mk(e))}function yk(e,t){return{x:e.x+t.x,y:e.y+t.y}}function vk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function bk(e,t){return{x:e.x*t,y:e.y*t}}function xk(e,t){return e.x-t.x}function Sk(e,t){return e.y-t.y}function Mk(e,t){return xk(e,t)**2+Sk(e,t)**2}function wk(e,t){return Math.sqrt(Mk(e,t))}function Ek(e,t){return e.x*t.x+e.y*t.y}function kk(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{x:0,y:0};const r=Math.cos(t),i=Math.sin(t),o=vk(e,n);return yk({x:r*o.x-i*o.y,y:i*o.x+r*o.y},n)}const Ck={up:0,down:180,left:90,right:-90};function Ak(e){let t=e.x,n=e.y,r=e.size;const i=r/2;return{type:"rect",x:t-i,y:n-i,width:r,height:r}}const Ok=Jb();Ok.add("circle",function(e){return{type:"circle",fill:"black",cx:e.x,cy:e.y,r:e.size/2}}),Ok.add("diamond",function(e){const t=e.size,n=e.x-t/2,r=e.y-t/2;return{type:"path",fill:"black",d:hk([{x:n,y:r+t/2},{x:n+t/2,y:r},{x:n+t,y:r+t/2},{x:n+t/2,y:r+t},{x:n,y:r+t/2}])}}),Ok.add("saltire",function(e){const t=mk(45),n=e.size/2,r=isNaN(e.width)?n/2:e.width,i=Math.min(r,n);let o=e.size;const a=Math.sin(Math.asin(-t))*(i/2);o+=2*(n/Math.sin(-t)-n),o-=2*a;const s={x:e.x,y:e.y},l=pk(e.x,e.y,o,i).map(e=>kk(e,t,s));return{type:"path",fill:"black",d:hk(l)}}),Ok.add("square",function(e){const t=e.size;return{type:"rect",fill:"black",x:e.x-t/2,y:e.y-t/2,width:t,height:t}}),Ok.add("triangle",function(e){const t=e.size,n={x:e.x,y:e.y},r=Ck[e.direction]||0,i=t/2,o=e.x-i,a=e.y-i;let s=[{x:o,y:a+t},{x:o+i,y:a},{x:o+t,y:a+t},{x:o,y:a+t}];const l=mk(r);return s=s.map(e=>kk(e,l,n)),{type:"path",fill:"black",d:hk(s)}}),Ok.add("line",function(e){const t="vertical"===e.direction,n=e.size/2,r=e.x,i=e.y;return{type:"line",stroke:"black",strokeWidth:1,x1:r-(t?0:n),y1:i-(t?n:0),x2:r+(t?0:n),y2:i+(t?n:0),collider:Ak(e)}}),Ok.add("star",function(e){const t=e.size,n=[],r=t/2,i=e.points||5,o=Math.min(e.innerRadius||t/2,t)/2,a=isNaN(e.startAngle)?90:e.startAngle,s=360/i;for(let t=1;t<=i;t++){const i=s*t+a,l=mk(i),c=mk(i+s/2),u=Math.sin(l),d=Math.cos(l),f=Math.sin(c),h=Math.cos(c);n.push({x:e.x+d*r,y:e.y+u*r}),n.push({x:e.x+h*o,y:e.y+f*o})}return{type:"path",fill:"black",d:hk(n)}}),Ok.add("n-polygon",function(e){const t=[],n=e.size/2,r=Math.max(isNaN(e.sides)?6:e.sides,3),i=360/r,o=isNaN(e.startAngle)?0:e.startAngle;for(let a=1;a<=r;a++){const r=mk(i*a+o),s=Math.sin(r),l=Math.cos(r);t.push({x:e.x+l*n,y:e.y+s*n})}return{type:"path",fill:"black",d:hk(t)}}),Ok.add("cross",function(e){const t=e.x,n=e.y,r=e.size/2,i=isNaN(e.width)?r/2:e.width,o=Math.min(i,r);return{type:"path",fill:"black",d:hk(pk(t,n,e.size,o))}}),Ok.add("bar",function(e){const t={x:e.x,y:e.y},n="vertical"===e.direction,r=e.size/2,i=r/2/2;let o=[{x:t.x-r,y:t.y+i},{x:t.x-r,y:t.y-i},{x:t.x+r,y:t.y-i},{x:t.x+r,y:t.y+i}];if(n){const e=mk(90);o=o.map(n=>kk(n,e,t))}const a=Vv(o);return a.type="rect",a.fill="black",a}),Ok.add("rect",function(e){const t=e.x,n=e.y,r=e.size,i=void 0===e.width?r:e.width,o=void 0===e.height?r:e.height;return{type:"rect",fill:"black",x:t-i/2,y:n-o/2,width:i,height:o}}),Ok.add("image",function(e){const t=e.x,n=e.y,r=e.imageSettings||{},i=r.width,o=r.height,a=r.imageSrc,s=r.position;return{type:"image",x:t,y:n,width:i,height:o,src:a,symbol:r.symbol,r:10,cx:0,cy:0,imageScalingFactor:r.imageScalingFactor,imagePosition:s}});const Nk=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ok;return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=e.get(t.type);if(n){const e=n(t);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach(n=>{void 0!==fk[n]&&"transform"!==n&&(e[n]=t[n])})}(e,t),void 0!==t.data&&(e.data=t.data),e}return n}};function Dk(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.dock,r=void 0===n?"center":n,i=e.displayOrder,o=void 0===i?0:i,a=e.prioOrder,s=void 0===a?0:a,l=e.preferredSize,c=void 0===l?0:l,u=e.minimumLayoutMode,d=e.show,f=void 0===d||d;r=r||"center";return{computePreferredSize(e){let n=e.inner,r=e.outer,i=e.children;return"function"==typeof c?c({inner:n,outer:r,children:i,dock:this.dock()},t):c},dock(e){return void 0!==e?(r=e,this):"function"==typeof r?r(t):r},displayOrder(e){return void 0!==e?(o=e,this):"function"==typeof o?o(t):o},prioOrder(e){return void 0!==e?(s=e,this):"function"==typeof s?s(t):s},minimumLayoutMode(e){return void 0!==e?(u=e,this):"function"==typeof u?u(t):u},show(e){return void 0!==e?(f=e,this):"function"==typeof f?f(t):f}}}function Tk(e,t,n){const r=t.require,i=void 0===r?[]:r,o=t.mediator||{},a=n.settings,s=n.formatter,l=n.scale,c=n.data,u=n.renderer,d=n.chart,f=n.dockConfig,h=n.mediator,p=n.instance,m=n.rect,g=n.style,y=n.registries,v=n.resolver,b=n.update,x=n._DO_NOT_USE_getInfo,S=n.symbol,M=n.isVisible;e.emit=()=>{},M&&(e.isVisible=M),Object.defineProperty(e,"settings",{get:a}),Object.defineProperty(e,"data",{get:c}),Object.defineProperty(e,"formatter",{get:s}),Object.defineProperty(e,"scale",{get:l}),Object.defineProperty(e,"mediator",{get:h}),Object.defineProperty(e,"style",{get:g}),Object.defineProperty(e,"registries",{get:y}),m&&Object.defineProperty(e,"rect",{get:m}),x&&(e._DO_NOT_USE_getInfo=x),Object.keys(t).forEach(n=>{var r;r=n,["on","preferredSize","created","beforeMount","mounted","resize","beforeUpdate","updated","beforeRender","render","beforeUnmount","beforeDestroy","destroyed","defaultSettings","data","settings","formatter","scale","chart","dockConfig","mediator","style","resolver","registries","_DO_NOT_USE_getInfo","symbol","isVisible"].some(e=>e===r)||("function"==typeof t[n]?e[n]=t[n].bind(e):e[n]=t[n])}),i.forEach(t=>{"renderer"===t?Object.defineProperty(e,"renderer",{get:u}):"chart"===t?Object.defineProperty(e,"chart",{get:d}):"dockConfig"===t?Object.defineProperty(e,"dockConfig",{get:f}):"instance"===t?Object.defineProperty(e,"instance",{get:p}):"update"===t&&b?Object.defineProperty(e,"update",{get:b}):"resolver"===t?Object.defineProperty(e,"resolver",{get:v}):"symbol"===t&&Object.defineProperty(e,"symbol",{get:S})}),Object.keys(o).forEach(t=>{e.mediator.on(t,o[t].bind(e))})}function qk(e,t,n){const r=t=>e[t]?(n.warn("Deprecation Warning the ".concat(t," property should be moved into layout: {} property")),e[t]):e.layout?e.layout[t]:void 0,i={};return i.displayOrder=r("displayOrder"),i.dock=r("dock"),i.prioOrder=r("prioOrder"),i.minimumLayoutMode=r("minimumLayoutMode"),e.layout=e.layout||{},e.layout.displayOrder=void 0!==i.displayOrder?i.displayOrder:e.layout.displayOrder,e.layout.prioOrder=void 0!==i.prioOrder?i.prioOrder:e.layout.prioOrder,e.layout.dock=i.dock||e.layout.dock,e.layout.minimumLayoutMode=i.minimumLayoutMode||e.layout.minimumLayoutMode,i.show=e.show,i.preferredSize=t,i}function Ik(e,t,n){Object.keys(n.on||{}).forEach(r=>{e.eventListeners=e.eventListeners||[];const i=n.on[r].bind(e);e.eventListeners.push({event:r,listener:i}),t.on(r,i)}),e.emit=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return t.emit(e,...r)}}function Rk(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=e.defaultSettings,r=void 0===n?{}:n,i=e._DO_NOT_USE_getInfo,o=void 0===i?()=>({}):i,a=t.chart,s=t.container,l=t.mediator,c=t.registries,u=t.theme,d=t.renderer,f=AE.mixin({});let h,p,m,g,y,v=t.settings||{},b=Dv(!0,{},r,v),x=[],S=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ok,n={};return{resolve:function(r){let i=r.data,o=r.settings,a=r.defaults,s=void 0===a?{}:a,l=r.scaled;const c=n.norm=t.normalizeSettings(o,s,e.chart),u={scale:e.chart.scale,formatter:e.chart.formatter};l&&Object.keys(l).forEach(e=>{c[e]&&t.updateScaleSize(c,e,l[e])});const d=[];if(!i||!Array.isArray(i.items)){const e={data:i,resources:u};let r=t.resolveForItem(e,n.norm,-1);return{settings:n.norm,item:r}}{let e;for(let r=0,o=i.items.length;r<o;r++){e={datum:i.items[r],data:i,resources:u};let o=t.resolveForItem(e,n.norm,r);o.data=i.items[r],d.push(o)}}return{settings:n.norm,items:d}}}}({chart:a}),M=!1;const w={nodes:[],chart:a,config:b.brush||{},renderer:null},E={tap:[],over:[]},k=[],C={},A=Dv({},v);function O(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){const i=void 0!==e[t],o=void 0!==v[t];let a;for(var s=arguments.length,l=new Array(s),c=0;c<s;c++)l[c]=arguments[c];return i&&("function"==typeof e[t]?a=e[t].call(C,...l):r&&(a=e[t])),o&&("function"==typeof v[t]?a=v[t].call(A,...l):r&&(a=v[t])),i||o||(a=n.call(C,...l)),a}}const N=O("preferredSize",()=>0,!0),D=O("resize",e=>e.inner),T=O("created"),q=O("beforeMount"),I=O("mounted"),R=O("beforeUnmount"),L=O("beforeUpdate"),_=O("updated"),P=O("beforeRender"),z=O("beforeDestroy"),F=O("destroyed"),j=e.render,$=()=>{b.brush&&(b.brush.consume||[]).forEach(e=>{e.context&&e.style&&k.push(sk(w,e))})},B=()=>{b.brush&&(b.brush.trigger||[]).forEach(e=>{"over"===e.on?E.over.push(e):E.tap.push(e)})};Object.defineProperty(w,"data",{get:()=>x});const V=b.renderer||e.renderer,H=V?d||c.renderer(V)():d||c.renderer()();"function"==typeof H.settings&&H.settings(b.rendererSettings),w.renderer=H;const U={resources:a.logger?{logger:a.logger()}:{}};let W=Dk(qk(b,N,a.logger()),U);const Y=e=>{e.key=b.key,e.element=H.element()},K=()=>{};K.dockConfig=()=>W,K.set=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e.settings&&(v=e.settings,b=Dv(!0,{},r,e.settings),W=Dk(qk(b,N,a.logger()),U),w.config=b.brush||{}),b.scale&&(h=a.scale(b.scale)),b.data){const e=b.rendererSettings,t="function"==typeof(null==e?void 0:e.progressive)&&e.progressive(),n=PM(b.data,{dataset:a.dataset,collection:a.dataCollection},{logger:a.logger()},a.dataCollection);t?t.isFirst?(x=n,x.items&&(x.items=[...n.items])):x.items&&(x.items=[...x.items,...n.items||[]]):x=n}else x=h?h.data():[];"string"==typeof b.formatter||"object"==typeof b.formatter?p=a.formatter(b.formatter):h&&h.data().fields&&(p=h.data().fields[0].formatter()),y=u.style(b.style||{})},K.resize=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=D({inner:e,outer:t});g=n?H.size(n):H.size(e),A.rect=Dv(!0,{computedPhysical:g.computedPhysical,computedOuter:t.computed||t,computedInner:e.computed||e},e),g=Dv(!0,{computedOuter:t.computed||t,computedInner:e.computed||e},g)},K.getRect=()=>A.rect;const G=()=>{const e=H.renderArgs?H.renderArgs.slice(0):[],t=b.rendererSettings;let n=x;const r="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();return x.items&&r&&(n=Lv(Lv({},x),{},{items:x.items.slice(r.start,r.end)})),e.push({data:n}),e};let X,J,Z;function Q(e){const t=b.rendererSettings,n="function"==typeof(null==t?void 0:t.progressive)&&t.progressive();n?n.isFirst?w.nodes=[...e||[]]:w.nodes&&(w.nodes=[...w.nodes,...e||[]]):w.nodes=e}K.beforeMount=q,K.beforeRender=()=>{P({size:g})},K.render=()=>{const e=j.call(C,...G());Q(e),H.render(e),X=e,J=A.rect.computed},K.hide=()=>{K.unmount(),H.size({x:0,y:0,width:0,height:0}),H.clear()},K.beforeUpdate=()=>{L({settings:b,data:x})},K.update=()=>{Z&&Z.stop();const e=b,t=e.rendererSettings,n=e.brush,r=e.animations;if("function"==typeof(null==t?void 0:t.transform)&&t.transform())return H.render(),void(X=null);const i=j.call(C,...G());Q(i),k.forEach(e=>e.cleanUp()),k.length=0,E.tap=[],E.over=[],n&&($(),B()),k.forEach(e=>{e.isActive()&&e.update()}),X&&r&&("function"==typeof r.enabled?r.enabled():r.enabled)?(r.compensateForLayoutChanges&&r.compensateForLayoutChanges({currentNodes:X,currentRect:A.rect.computed,previousRect:J}),Z=function(e,t,n,r){let i,o=e.old,a=e.current,s=t.renderer,l=[],c={nodes:[],ips:[]},u={nodes:[],ips:[]},d={nodes:[],ips:[]},f=[],h=null;const p=n.trackBy||QE,m={start(){let e={};if(o.forEach((t,n)=>{let r=p(t,n);e[r]=t}),a.forEach((t,n)=>{let r=p(t,n);if(e[r]){if("path"===t.type&&t.points&&t.points.length>0&&"trend"!==t.data.source.key){const n=function(e,t){const n=e.points.filter(e=>!e.dummy),r=t.points.filter(e=>!e.dummy),i=r.map(e=>e.data.major.value),o=n.filter(e=>i.includes(e.data.major.value)).map(e=>e.data.major.value),a=n.filter(e=>o.includes(e.data.major.value)),s=r.filter(e=>o.includes(e.data.major.value));return{old:a,current:s}}(e[r],t);d.ips.push(ZE(Dv({},e[r],{points:n.old}),Dv({},t,{points:n.current}))),l.push(Dv({},e[r],{commonPoints:n.old}))}else d.ips.push(ZE(e[r],t)),l.push(e[r]);d.nodes.push(t),e[r]=!1}else c.nodes.push(t),c.ips.push(ZE(Dv({},t,{r:.001,opacity:0}),t))}),Object.keys(e).forEach(t=>{e[t]&&(u.nodes.push(e[t]),u.ips.push(ZE(e[t],Dv({},e[t],{r:1e-4,opacity:0}))))}),f.push({name:"exiting",easing:WE,duration:200,tweens:u.ips,nodes:[...l]}),f.push({name:"updating",easing:KE,duration:400,tweens:d.ips,nodes:[]}),f.push({name:"entering",easing:YE,duration:200,tweens:c.ips,nodes:[...d.nodes]}),n.isMainComponent){var t;const e=null===(t=n.isMainComponent)||void 0===t?void 0:t.filterFn,i=e?l.filter(e).length:l.length,o=r.getValue("animations.updatingStageMeta"),a=o.isInit,s=o.shouldBeRemoved;!1===a?(r.setValue("animations.updatingStageMeta.shouldBeRemoved",0===i),r.setValue("animations.updatingStageMeta.isInit",!0)):r.setValue("animations.updatingStageMeta.shouldBeRemoved",s&&0===i)}f.length&&(h=s.getScene(a),f[0].started=Date.now(),"undefined"!=typeof window&&(i=window.requestAnimationFrame(m.tick)))},tick(){let e=f[0];e||m.stop(),e.started||(e.started=Date.now());let t=(Date.now()-e.started)/e.duration,o=[],a=e.tweens.map(n=>n(e.easing(Math.min(1,t))));const l=n.adjustTweenedNodes;if(l&&l(a),o.push(...a),o.push(...e.nodes),s.render(o),t>=1){f.shift();const e=r.getValue("animations.updatingStageMeta"),t=e.isInit,n=e.shouldBeRemoved;f.length?"updating"===f[0].name&&n&&f.shift():(!0===t&&r.setValue("animations.updatingStageMeta.isInit",!1),m.stop())}i&&(i=window.requestAnimationFrame(m.tick))},stop(){i&&(window.cancelAnimationFrame(i),i=!1)},inProgress:()=>!!i,get targetScene(){return h}};return m}({old:X,current:i},{renderer:H},r,a.storage),Z.start()):H.render(i),X=i,J=A.rect.computed,H.setKey&&"string"==typeof v.key&&H.setKey(v.key)},K.updated=_,K.destroy=()=>{K.unmount(),z(m),H.destroy(),F(),m=null};const ee=e=>{w.nodes=e,k.forEach(e=>{e.isActive()&&e.update()}),H.render(e)};return Tk(C,e,{settings:()=>b,data:()=>x,scale:()=>h,formatter:()=>p,renderer:()=>H,chart:()=>a,dockConfig:()=>W,mediator:()=>l,instance:()=>A,rect:()=>A.rect,style:()=>y,update:()=>ee,registries:()=>c,resolver:()=>S,symbol:()=>Nk(c.symbol)}),Tk(A,v,{settings:()=>b,data:()=>x,scale:()=>h,formatter:()=>p,renderer:()=>H,chart:()=>a,dockConfig:()=>W,mediator:()=>l,style:()=>y,_DO_NOT_USE_getInfo:o.bind(C),isVisible:()=>M}),K.getBrushedShapes=function(e,t,n){const r=[];if(b.brush&&b.brush.consume){const i=a.brush(e),o=H.findShapes("*");b.brush.consume.filter(t=>t.context===e).forEach(e=>{for(let a=0;a<o.length;a++){const s=o[a];s.data&&i.containsMappedData(s.data,n||e.data,t)&&(Y(s),r.push(s),o.splice(a,1),a--)}})}return r},K.findShapes=e=>{var t;const n=(null!==(t=Z)&&void 0!==t&&t.inProgress()?Z.targetScene:H).findShapes(e);for(let e=0,t=n.length;e<t;e++)Y(n[e]);return n},K.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=H.itemsAt(e);let r;r=t&&"stop"===t.propagation&&n.length>0?[n.pop().node]:n.map(e=>e.node);for(let e=0,t=r.length;e<t;e++)Y(r[e]);return r},K.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.contexts=Array.isArray(t.contexts)?t.contexts:[];lk({nodes:e,action:t.action||"toggle",trigger:t,chart:a,data:w.data})},K.mount=()=>{m=H.element&&H.element()?m:H.appendTo(s),H.setKey&&"string"==typeof v.key&&H.setKey(v.key),b.brush&&($(),B()),Ik(A,f,v),Ik(C,f,e),M=!0},K.mounted=()=>I(m),K.unmount=()=>{[A,C].forEach(e=>{!function(e,t){e.eventListeners&&(e.eventListeners.forEach(e=>{let n=e.event,r=e.listener;t.removeListener(n,r)}),e.eventListeners.length=0),e.emit=()=>{}}(e,f)}),E.tap=[],E.over=[],k.forEach(e=>{e.cleanUp()}),k.length=0,R(),M=!1},K.onBrushTap=e=>{E.tap.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return ck({collisions:uk(t,n,r.renderer),t:n,config:r,action:dk(n.action,t,"toggle")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&a.toggleBrushing(!0)})},K.onBrushOver=e=>{E.over.forEach(t=>{(function(e){let t=e.e,n=e.t,r=e.config;return ck({collisions:uk(t,n,r.renderer),t:n,config:r,action:dk(n.action,t,"set")})})({e:e,t:t,config:w})&&"stop"===t.globalPropagation&&a.toggleBrushing(!0)})},K.def=C,K.ctx=A,K.renderer=()=>H,K.set({settings:v}),T(),K}const Lk=["__proto__","constructor","prototype"];function _k(e){const t=Dv(!0,{},e),n={getAll:()=>t,getValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return n;const r=t.split(".");let i=e;for(let e=0;e<r.length;++e){const t=r[e];if(void 0===i[t])return n;i=i[t]}return i}(t,e,n),setValue:(e,n)=>function(e,t,n){if(void 0===e||void 0===t)return;const r=t.split("."),i=r[r.length-1];let o=e;for(let e=0;e<r.length-1;++e){const t=r[e];if(Lk.includes(t))throw new Error("Unsafe key in path: ".concat(t));void 0===o[t]&&(o[t]=Number.isNaN(+r[e+1])?{}:[]),o=o[t]}void 0!==n?o[i]=n:delete o[i]}(t,e,n)};return n}function Pk(e,t,n){const r=yk(function(e,t){const n=Ek(e,t)/Ek(t,t)||1;return{x:t.x*n,y:t.y*n}}(vk(n,e),vk(t,e)),e);return r}function zk(e,t,n){return wk(e,n)+wk(t,n)-wk(e,t)<1e-12}function Fk(e,t){return e.x>=t.x&&e.x+e.width<=t.x+t.width&&e.y>=t.y&&e.y+e.height<=t.y+t.height}function jk(e){return e.x1===e.x2&&e.y1===e.y2}function $k(e){return e.width<=0||e.height<=0}function Bk(e){return e.r<=0}function Vk(e){return e.edges.length<=2}function Hk(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=Jk(e,Hv(t.edges[r])),!0===n)return!0;return!1}function Uk(e,t){let n=!1;const r=t.numPolygons,i=t.polygons;for(let t=0;t<r;t++){if(n=aC(e,i[t]),!0===n)return!0}return!1}function Wk(e,t){if(Bk(e))return!1;return Mk({x:e.cx,y:e.cy},t)<=e.r**2}function Yk(e,t){if($k(t)||Bk(e))return!1;const n=t.width/2,r=t.height/2,i=t.x+n,o=t.y+r,a=e.r,s=e.cx,l=e.cy,c=Math.abs(s-i),u=Math.abs(l-o);if(c>n+a||u>r+a)return!1;if(c<=n||u<=r)return!0;return(c-n)**2+(u-r)**2<=a**2}function Kk(e,t){if(Bk(e)||jk(t))return!1;const n=_v($v(t),2),r=n[0],i=n[1];if(Wk(e,r)||Wk(e,i))return!0;const o={x:e.cx,y:e.cy},a=Pk(r,i,o);return Mk(a,o)<=e.r**2&&zk(r,i,a)}function Gk(e,t){if(Vk(t)||Bk(e))return!1;if(Xk(t,{x:e.cx,y:e.cy}))return!0;const n=t.edges.length;for(let r=0;r<n;r++){if(Kk(e,Hv(t.edges[r])))return!0}return!1}function Xk(e,t){if(Vk(e)||!tC(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.vertices;let o,a,s,l,c;for(o=!1,l=-1,a=i.length,s=a-1;++l<a;s=l){if(i[l].x===n&&i[l].y===r)return!0;if(i[l].y===i[s].y&&i[l].y===r&&(n-i[l].x)*(n-i[s].x)<=0)return!0;if(i[l].y<r&&r<=i[s].y||i[s].y<r&&r<=i[l].y){if(c=(i[s].x-i[l].x)*(r-i[l].y)/(i[s].y-i[l].y)+i[l].x,n===c)return!0;n<c&&(o=!o)}}return o}function Jk(e,t){if(Vk(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(rC(t,Hv(e.edges[n])))return!0}const n=_v($v(t),2),r=n[0],i=n[1];return Xk(e,r)||Xk(e,i)}function Zk(e,t){if(Vk(e))return!1;for(let n=0,r=e.edges.length;n<r;n++){if(nC(t,Hv(e.edges[n])))return!0}const n=_v(Bv(t),4),r=n[0],i=n[1],o=n[2],a=n[3];return Xk(e,r)||Xk(e,i)||Xk(e,o)||Xk(e,a)}function Qk(e,t){return!$k(e)&&!$k(t)&&(e.x<=t.x+t.width&&t.x<=e.x+e.width&&e.y<=t.y+t.height&&t.y<=e.y+e.height)}function eC(e,t){if($k(e)||$k(t))return!1;return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}].every(t=>tC(e,t))}function tC(e,t){return!$k(e)&&(t.x>=e.x&&t.x<=e.x+e.width&&t.y>=e.y&&t.y<=e.y+e.height)}function nC(e,t){if(jk(t)||$k(e))return!1;const n=_v($v(t),2),r=n[0],i=n[1];if(tC(e,r)||tC(e,i))return!0;const o=Bv(e);let a=o.length;for(let e=0;e<a;e++){if(rC(Hv([o[e],o[3!==e?e+1:0]]),t))return!0}return!1}function rC(e,t){const n=_v($v(e),2),r=n[0],i=n[1],o=_v($v(t),2),a=o[0],s=o[1],l=xk(i,r),c=Sk(i,r),u=xk(s,a),d=Sk(s,a),f=xk(r,a),h=Sk(r,a);let p=d*l-u*c;const m=u*h-d*f,g=l*h-c*f;let y,v;if(0===l&&0===c)return!1;if(0===u&&0===d)return!1;if(0===p){if(0===m&&0===g){if(0===l){if(0===c)return r.x===i.x&&r.y===i.y;y=Sk(a,r)/c,v=Sk(s,r)/c}else y=(a.x-r.x)/l,v=(s.x-r.x)/l;return!(y<0&&v<0||y>1&&v>1)}return!1}const b=m/p;return p=g/p,b>=0&&b<=1&&p>=0&&p<=1}function iC(e,t){if(jk(e))return!1;const n=_v($v(e),2);return zk(n[0],n[1],t)}function oC(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Qk(n,r)&&(eC(n,r)?Hk(e,t):Hk(t,e))}function aC(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Qk(n,r)&&(eC(r,n)?function(e,t){let n=!1;const r=e.numPolygons,i=e.polygons;for(let e=0;e<r;e++)if(n=oC(t,i[e]),!0===n)return!0;return!1}(e,t):function(e,t){let n=!1;for(let r=0,i=t.edges.length;r<i;r++)if(n=cC(e,Hv(t.edges[r])),!0===n)return!0;return!1}(e,t))}function sC(e,t){if(Bk(e))return!1;if(lC(t,{x:e.cx,y:e.cy}))return!0;const n=t.numPolygons,r=t.polygons;for(let t=0;t<n;t++){const n=r[t],i=n.edges.length;for(let t=0;t<i;t++){if(Kk(e,Hv(n.edges[t])))return!0}}return!1}function lC(e,t){if(!tC(e.boundingRect(),t))return!1;const n=t.x,r=t.y,i=e.numPolygons;let o,a,s,l,c,u,d=!1;for(a=0;a<i;a++)for(o=e.vertices[a],c=-1,s=o.length,l=s-1;++c<s;l=c){if(o[c].x===n&&o[c].y===r)return!0;if(o[c].y===o[l].y&&o[c].y===r&&(n-o[c].x)*(n-o[l].x)<=0)return!0;if(o[c].y<r&&r<=o[l].y||o[l].y<r&&r<=o[c].y){if(u=(o[l].x-o[c].x)*(r-o[c].y)/(o[l].y-o[c].y)+o[c].x,n===u)return!0;n<u&&(d=!d)}}return d}function cC(e,t){const n=_v($v(t),2),r=n[0],i=n[1];if(lC(e,r)||lC(e,i))return!0;const o=e.numPolygons,a=e.polygons;for(let e=0;e<o;e++){const n=a[e];for(let e=0,r=n.edges.length;e<r;e++){if(rC(t,Hv(n.edges[e])))return!0}}return!1}function uC(e,t){const n=_v(Bv(t),4),r=n[0],i=n[1],o=n[2],a=n[3];if(lC(e,r)||lC(e,i)||lC(e,o)||lC(e,a))return!0;const s=e.numPolygons,l=e.polygons;for(let e=0;e<s;e++){const n=l[e];for(let e=0,r=n.edges.length;e<r;e++){if(nC(t,Hv(n.edges[e])))return!0}}return!1}const dC=/^\$/,fC="@extend";function hC(e){throw new Error('Cyclical reference for "'.concat(e,'"'))}function pC(e,t,n){if("string"==typeof e){let r=t[e];return-1!==n.indexOf(e)&&hC(e),dC.test(r)?(n.push(e),pC(r,t,n)):r}let r=e;const i=Dv(!0,{},t,e),o={};if(e[fC]){const o=e[fC];-1!==n.indexOf(o)&&hC(o);let a=n.slice();a.push(o),r=Dv(!0,{},pC(i[o],t,a),e)}return Object.keys(r).forEach(e=>{let t=n.slice();if(e===fC||dC.test(e))return;o[e]=r[e];let a=o[e];dC.test(a)&&a in i?(-1!==n.indexOf(a)&&hC(a),t.push(a),a=i[a],"object"==typeof a||dC.test(a)&&a in i?o[e]=pC(a,i,t):o[e]=a):"object"==typeof a&&(o[e]=pC(a,i,t))}),o}function mC(e,t){return pC(e,t,[])}function gC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={},n=e;const r=e=>{e.forEach(e=>{const n=Array.isArray(e.colors[0])?e.colors:[e.colors];t[e.key]={colors:n,sizes:n.map(e=>e?e.length:0)}})},i={palette:(e,n)=>((e,n)=>{const r=t[e];if(!r)return[];const i=r.sizes;for(let e=0;e<i.length;e++)if(n<=i[e])return r.colors[e];return r.colors[i.length-1]})(e,n),setPalettes:r,style:e=>mC(e,n),setStyle:t=>{n=Dv({},e,t)}};return r(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]),i}function yC(e){e.x=Math.floor(e.x),e.y=Math.floor(e.y),e.width=Math.floor(e.width),e.height=Math.floor(e.height)}function vC(e){const t={center:{minWidthRatio:.5,minHeightRatio:.5,minWidth:0,minHeight:0}};return Dv(!0,t,e),t.center.minWidthRatio=Math.min(Math.max(t.center.minWidthRatio,0),1),t.center.minHeightRatio=Math.min(Math.max(t.center.minHeightRatio,0),1),t.center.minWidth=Math.max(t.center.minWidth,0),t.center.minHeight=Math.max(t.center.minHeight,0),t}function bC(e,t,n,r,i){return{x:isNaN(e)?0:e,y:isNaN(e)?0:t,width:isNaN(e)?0:n,height:isNaN(e)?0:r,margin:isNaN(i)?0:i}}function xC(e,t,n){if(void 0===e.cachedSize){const r=e.config.dock();let i,o=e.comp.preferredSize({inner:t,outer:n,dock:r});isNaN(o)?o&&!isNaN(o.size)&&(o.width=o.size,o.height=o.size):o={width:o,height:o},i="top"===r||"bottom"===r?o.height:"right"===r||"left"===r?o.width:Math.max(o.width,o.height),e.cachedSize=Math.ceil(i),e.edgeBleed=o.edgeBleed||0}return e.cachedSize}function SC(e,t){switch(t.config.dock()){case"top":e.y+=t.cachedSize,e.height-=t.cachedSize;break;case"bottom":e.height-=t.cachedSize;break;case"left":e.x+=t.cachedSize,e.width-=t.cachedSize;break;case"right":e.width-=t.cachedSize}}function MC(e,t){const n=t.edgeBleed;n&&(e.left=Math.max(e.left,n.left||0),e.right=Math.max(e.right,n.right||0),e.top=Math.max(e.top,n.top||0),e.bottom=Math.max(e.bottom,n.bottom||0))}function wC(e,t,n){t.x<n.left&&(t.width-=n.left-t.x,t.x=n.left);const r=e.width-(t.x+t.width);r<n.right&&(t.width-=n.right-r),t.y<n.top&&(t.height-=n.top-t.y,t.y=n.top);const i=e.height-(t.y+t.height);i<n.bottom&&(t.height-=n.bottom-i)}function EC(e,t,n,r,i){const o=Dv({},t),a=Dv({},n);SC(o,r),MC(a,r),wC(e,o,a);const s=function(e,t,n){const r=Math.min(n.center.minWidth,e.width)||Math.max(e.width*n.center.minWidthRatio,1),i=Math.min(n.center.minHeight,e.height)||Math.max(e.height*n.center.minHeightRatio,1);return t.width>=r&&t.height>=i}(e,o,i);return!!s&&(SC(t,r),MC(n,r),!0)}function kC(e){return{x:e.margin.left+e.x*e.scaleRatio.x,y:e.margin.top+e.y*e.scaleRatio.y,width:e.width*e.scaleRatio.x,height:e.height*e.scaleRatio.y}}function CC(e){return Vv([].concat(...e.map(Bv)))}function AC(e){let t=e.visible,n=e.layoutRect,r=e.reducedRect,i=e.containerRect,o=e.translation;const a=bC(r.x,r.y,r.width,r.height),s=bC(r.x,r.y,r.width,r.height),l={},c=t.slice(),u=c.slice().sort((e,t)=>e.config.displayOrder()-t.config.displayOrder());return t.sort((e,t)=>{if(e.referencedDocks.length>0&&t.referencedDocks.length>0)return 0;if(t.referencedDocks.length>0)return-1;if(e.referencedDocks.length>0)return 1;const n=e.config.displayOrder()-t.config.displayOrder();return 0===n?c.indexOf(e)-c.indexOf(t):n}).forEach(e=>{let t={},c={};switch(e.config.dock()){case"top":t.height=c.height=e.cachedSize,t.width=n.width,c.width=a.width,t.x=n.x,c.x=a.x,t.y=c.y=a.y-e.cachedSize,a.y-=e.cachedSize,a.height+=e.cachedSize;break;case"bottom":t.x=n.x,c.x=a.x,t.y=c.y=a.y+a.height,t.width=n.width,c.width=a.width,t.height=c.height=e.cachedSize,a.height+=e.cachedSize;break;case"left":t.x=c.x=s.x-e.cachedSize,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.x-=e.cachedSize,s.width+=e.cachedSize;break;case"right":t.x=c.x=s.x+s.width,t.y=n.y,c.y=s.y,t.width=c.width=e.cachedSize,t.height=n.height,c.height=s.height,s.width+=e.cachedSize;break;case"center":t.x=c.x=r.x,t.y=c.y=r.y,t.width=c.width=r.width,t.height=c.height=r.height;break;default:if(e.referencedDocks.length>0){const n=e.referencedDocks.map(e=>l[e]).filter(e=>!!e);n.length>0&&(t=CC(n.map(e=>e.outerRect)),c=CC(n.map(e=>e.r)))}}e.key&&(l[e.key]={r:c,outerRect:t}),function(e,t,n,r){const i={x:r.width/n.width,y:r.height/n.height},o={left:0,top:0};if(n.preserveAspectRatio){const e=i.x<i.y,t=Math.min(i.x,i.y);i.x=t,i.y=t;const a=e?"height":"width",s=(r[a]-n[a]*i.x)*n.align;o.left=e?0:s,o.top=e?s:0}e.scaleRatio=i,e.margin=o,t.scaleRatio=i,t.margin=o,n.scaleRatio=i,n.margin=o}(c,t,n,i),c.edgeBleed=e.edgeBleed,c.computed=kC(c),t.edgeBleed=e.edgeBleed,t.computed=kC(t),c.x+=o.x,c.y+=o.y,t.x+=o.x,t.y+=o.y,e.comp.resize(c,t),e.cachedSize=void 0,e.edgeBleed=void 0}),u}function OC(e,t,n){const r=e.layoutModes||{},i=t.minimumLayoutMode();let o=t.show();return o&&"object"==typeof i?o=r[i.width]&&r[i.height]&&n.width>=r[i.width].width&&n.height>=r[i.height].height:o&&void 0!==i&&(o=r[i]&&n.width>=r[i].width&&n.height>=r[i].height),o}function NC(e){if(!e.resize||"function"!=typeof e.resize)throw new Error("Component is missing resize function");if(!e.dockConfig&&!e.preferredSize)throw new Error("Component is missing preferredSize function")}function DC(e){let t=vC(e);const n={};return n.layout=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!e||isNaN(e.x)||isNaN(e.y)||isNaN(e.width)||isNaN(e.height))throw new Error("Invalid rect");if(!n.length)return{visible:[],hidden:[],ordered:[]};const r=function(e,t){const n={x:0,y:0,width:0,height:0},r={x:0,y:0,width:0,height:0};return n.width=e.width||0,n.height=e.height||0,void 0!==t.size&&(n.width=isNaN(t.size.width)?n.width:t.size.width,n.height=isNaN(t.size.height)?n.height:t.size.height),void 0!==t.logicalSize?(r.width=isNaN(t.logicalSize.width)?n.width:t.logicalSize.width,r.height=isNaN(t.logicalSize.height)?n.height:t.logicalSize.height,r.align=isNaN(t.logicalSize.align)?.5:Math.min(Math.max(t.logicalSize.align,0),1),r.preserveAspectRatio=t.logicalSize.preserveAspectRatio):(r.width=n.width,r.height=n.height,r.preserveAspectRatio=!1),yC(r),yC(n),{logicalContainerRect:r,containerRect:n}}(e,t),i=r.logicalContainerRect,o=r.containerRect,a=function(e,t,n){const r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o];NC(a);let s=a.dockConfig;const l=a.key,c=s.dock(),u=/@/.test(c)?c.split(",").map(e=>e.replace(/^\s*@/,"")):[];OC(t,s,n)?r.push({comp:a,key:l,config:s,referencedDocks:u}):i.push({comp:a,key:l,config:s,referencedDocks:u})}return[r,i]}(n,t,i),s=_v(a,2),l=s[0],c=s[1],u=function(e){let t=e.layoutRect,n=e.visible,r=e.hidden,i=e.settings;const o=bC(t.x,t.y,t.width,t.height),a={left:0,right:0,top:0,bottom:0},s=n.slice();s.sort((e,t)=>e.config.prioOrder()-t.config.prioOrder());for(let e=0;e<s.length;++e){const n=s[e];xC(n,o,t),EC(t,o,a,n,i)||(r.push(s.splice(e,1)[0]),--e)}!function(e,t){if(0!==t.length)for(let n=0;n<e.length;++n){let r=e[n];if(r.referencedDocks.length){const i=r.referencedDocks.every(e=>t.some(t=>t.key===e));i&&t.push(e.splice(n,1)[0])}}}(n,r);const l=n.filter(e=>-1!==s.indexOf(e));return n.length=0,n.push(...l),wC(t,o,a),o}({layoutRect:i,visible:l,hidden:c,settings:t}),d=AC({visible:l,layoutRect:i,reducedRect:u,containerRect:o,translation:{x:e.x,y:e.y}});return c.forEach(e=>{e.comp.visible=!1;const t=bC();e.comp.resize(t,t)}),{visible:l.map(e=>e.comp),hidden:c.map(e=>e.comp),ordered:d.map(e=>e.comp)}},n.settings=function(e){t=vC(e)},n}const TC=(e,t)=>{for(let n=0;n<e.length;n++){const r=e[n];if(r.hasKey&&r.key===t)return e[n]}return null},qC=e=>null==e?void 0:e.map(e=>{const t=e.instance.dockConfig();return{preferredSize:n=>t.computePreferredSize(Lv(Lv({},n),{},{children:qC(e.children)}))}}),IC=(e,t)=>({visible:[],hidden:t,ordered:[]}),RC=e=>(t,n)=>{var r;const i=n.map((e,t)=>{const n=e.instance.dockConfig();return{index:t,key:e.key,dockConfig:n,resize:e.instance.resize,preferredSize:t=>n.computePreferredSize(Lv(Lv({},t),{},{children:qC(e.children)}))}}),o=e=>n[e.index],a=null!==(r=e(t,i))&&void 0!==r?r:{},s=a.visible,l=void 0===s?i:s,c=a.hidden,u=void 0===c?[]:c,d=a.ordered,f=void 0===d?l:d;return{visible:l.map(o),hidden:u.map(o),ordered:f.map(o)}},LC=e=>"function"==typeof e?RC(e):(e=>{const t=DC(e);return RC((e,n)=>t.layout(e,n))})(e);function _C(e,t,n){const r=t.left-n.left,i=t.top-n.top,o=Uv(e),a=Dv(!0,{},e);switch(o){case"circle":a.cx+=r,a.cy+=i;break;case"polygon":for(let e=0,t=a.vertices.length;e<t;e++){const t=a.vertices[e];t.x+=r,t.y+=i}break;case"geopolygon":for(let e=0;e<a.vertices.length;e++){const t=a.vertices[e];for(let e=0,n=t.length;e<n;e++){const n=t[e];n.x+=r,n.y+=i}}break;case"line":a.x1+=r,a.y1+=i,a.x2+=r,a.y2+=i;break;case"point":case"rect":a.x+=r,a.y+=i}return a}function PC(e,t){const n=[];let r=0;t.forEach(e=>{n.push(r),r++;const t=e.instance.def.additionalElements&&e.instance.def.additionalElements();t&&(r+=t.length)}),t.forEach((t,r)=>((e,t,n)=>{const r=t.instance.renderer().element();if(isNaN(n)||!r||!e||!e.children)return;const i=e.children[Math.max(0,n)];if(r===i)return;const o=t.instance.def.additionalElements&&t.instance.def.additionalElements().filter(Boolean);e.insertBefore&&void 0!==i?(e.insertBefore(r,i),o&&o.forEach(t=>{e.insertBefore(t,r)})):(o&&o.forEach(t=>{e.appendChild(t,r)}),e.appendChild(r))})(e,t,n[r]))}function zC(e,t){let n=e.element,r=e.data,i=void 0===r?[]:r,o=e.settings,a=void 0===o?{}:o,s=e.on,l=void 0===s?{}:s;const c=t.registries,u=t.logger,d=gC(t.style,t.palettes),f=[],h=Dv({},e),p=function(){const e={};return AE.mixin(e),e}();let m=[],g=null,y=null,v=null,b=[],x=()=>{},S=()=>{};const M={};let w=!1;const E=function(e){let t=e.createComponent;const n={};let r=[],i=[];const o=e=>{const n=t(e);return n&&(r.push(n),e.components&&(n.children=e.components.map(e=>o(e)).filter(e=>!!e))),n},a=e=>{const t=r.indexOf(e);-1!==t&&r.splice(t,1)},s=(e,t)=>{for(let n=e.length-1;n>=0;n--){const r=e[n],i=t.find(e=>r.hasKey&&r.key===e.key);i?r.children&&i.components&&s(r.children,i.components):(e.splice(n,1),a(r),r.children&&s(r.children,[]),r.instance.destroy())}},l=e=>{let t=e.compList,n=e.data,r=e.excludeFromUpdate,i=e.formatters,a=e.scales;return e.settingsList.map(e=>{const s=TC(t,e.key);return r.indexOf(e.key)>-1?(delete s.updateWith,s):s?(e.rendererSettings&&"function"==typeof s.instance.renderer().settings&&s.instance.renderer().settings(e.rendererSettings),e.rendererSettings&&"function"==typeof e.rendererSettings.transform&&e.rendererSettings.transform()?(s.applyTransform=!0,s):(s.updateWith={formatters:i,scales:a,data:n,settings:e},e.components&&(s.children=l({compList:s.children||[],data:n,excludeFromUpdate:r,formatters:i,scales:a,settingsList:e.components})),s)):o(e)}).filter(e=>!!e)},c=e=>{let t=e.components,n=e.hidden,r=e.layoutFn,i=e.ordered,o=e.rect,a=e.visible;const s=r(o,t),l=s.visible,u=s.hidden,d=s.ordered;a.push(...l),n.push(...u),i.push(...d),l.forEach(e=>{if(e.children){var t,r;const o=LC(null!==(t=null===(r=e.settings)||void 0===r?void 0:r.strategy)&&void 0!==t?t:{});c({components:e.children,hidden:n,layoutFn:o,ordered:i,rect:e.instance.getRect(),visible:a})}}),u.forEach(e=>{e.children&&c({components:e.children,hidden:n,layoutFn:IC,ordered:i,rect:null,visible:a})})};return n.destroy=()=>{r.forEach(e=>e.instance.destroy()),r=[],i=[]},n.findComponentByKey=e=>TC(r,e),n.forEach=e=>{r.forEach(e)},n.layout=e=>{let t=e.layoutSettings,n=e.rect;const r=[],o=[],a=[],s=LC(t);return c({components:i,hidden:o,layoutFn:s,ordered:a,rect:n,visible:r}),{visible:r,hidden:o,ordered:a}},n.set=e=>{let t=e.components;i=t.map(e=>o(e)).filter(e=>!!e)},n.update=e=>{let t=e.components,n=e.data,r=e.excludeFromUpdate,o=e.formatters,a=e.scales;s(i,t),i=l({compList:i,data:n,excludeFromUpdate:r,formatters:o,scales:a,settingsList:t})},n}({createComponent:e=>{if(!c.component.has(e.type))return u.warn("Unknown component: ".concat(e.type)),!1;return{instance:Rk(c.component(e.type),{settings:e,chart:h,mediator:p,registries:c,theme:d,container:n}),settings:Dv(!0,{},e),key:e.key,hasKey:void 0!==e.key}}});function k(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};return function(){const r="function"==typeof e[t];let i;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return i=r?e[t].call(h,...a):n.call(h,...a),i}}const C=()=>{let e;a.dockLayout?(u.warn('Deprecation Warning: "dockLayout" property should be renamed to "strategy"'),e=a.dockLayout):e=a.strategy;const t=function(e){if("function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect();return{x:0,y:0,width:t.width,height:t.height}}return{x:0,y:0,width:0,height:0}}(n);return E.layout({layoutSettings:e,rect:t})},A=k("created"),O=k("beforeMount"),N=k("mounted"),D=k("beforeUpdate"),T=k("updated"),q=k("beforeRender"),I=k("beforeDestroy"),R=k("destroyed"),L=function(e,t){let n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).partialData;const r=t.formatters,i=void 0===r?{}:r,o=t.scales,a=void 0===o?{}:o,s=t.scroll,l=void 0===s?{}:s;x=function(e,t){let n=t.types,r=t.logger;const i={},o=[];return Array.isArray(e)?o.push(...e):(r.warn('Deprecated: "data-source" configuration"'),o.push(e)),o.forEach((e,t)=>{let o=n(e.type);if(o){let n=e.key;void 0===e.key&&(r.warn("Missing key for dataset. Using index '".concat(t,"' as key.")),n=t);let a=o({key:n,data:e.data,config:e.config});i[n]=a}}),e=>e?i[e]:i[Object.keys(i)[0]]}(e,{logger:u,types:c.data}),n||Object.keys(M).forEach(e=>M[e].clear()),t.palettes&&d.setPalettes(t.palettes),t.style&&d.setStyle(t.style),S=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:PM;const i={};return(e||[]).forEach(e=>{if(!e.key)throw new Error('Data collection is missing "key" property');if("object"==typeof e.data&&"collection"in e.data)throw new Error("Data config for collections may not reference other collections");i[e.key]=()=>r(e.data,t,n)}),e=>{let t,n;if("string"==typeof e?t=e:"object"==typeof e&&(t=e.key,n=e),!(t in i))throw new Error("Unknown data collection: ".concat(t));"function"==typeof i[t]&&(i[t]=i[t]());let r=i[t];if(n&&n.fields&&n.fields.filter){let e=r.fields.filter(n.fields.filter);r.fields.length!==e.length&&(r=Dv(r,{fields:e}))}return r}}(t.collections,{dataset:x},{logger:u});const f={theme:d,logger:u};g=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:wE;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"scale"in o&&e[o.scale]&&(a=o.scale),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o,t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(a,{dataset:x,collection:S},Lv(Lv({},f),{},{scale:c.scale})),y=function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zM;const i={};return{get(o){let a;return"string"==typeof o&&e[o]?a=o:"object"==typeof o&&"formatter"in o&&e[o.formatter]?a=o.formatter:"object"==typeof o&&"type"in o&&e[o.type]&&(a=o.type),a?(i[a]=i[a]||r(e[a],t,n),i[a]):r(o||{},t,n)},all(){return Object.keys(e).forEach(this.get),i}}}(i,{dataset:x,collection:S},Lv(Lv({},f),{},{formatter:c.formatter})),v=function(e,t){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=NE(e[r],t?t[r]:null));return n}(l,v)};function _(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},r=e.filter(e=>!!e.key).map(e=>e.key);b.forEach(e=>{e.key&&-1!==r.indexOf(e.key)?t[e.key]=e:e.destroy()}),b=e.map(e=>{const r=e.key&&t[e.key]?t[e.key]:c.interaction(e.type)(h,p,n);return r.set(e),r})}const P=e=>{const t=n.getBoundingClientRect(),r="clientX"in e?e.clientX:e.x,i="clientY"in e?e.clientY:e.y,o={x:r-t.left,y:i-t.top},a=[];return m.forEach(e=>{const t=e.instance.getRect();tC(t.computedPhysical?t.computedPhysical:{x:t.margin.left+t.x*t.scaleRatio.x,y:t.margin.top+t.y*t.scaleRatio.y,width:t.width*t.scaleRatio.x,height:t.height*t.scaleRatio.y},o)&&a.push(e)}),a},z=()=>{if(f.length||!n)return;Object.keys(l).forEach(e=>{const t=l[e].bind(h);n.addEventListener(e,t),f.push({key:e,listener:t})});const e={},t=t=>{t.touches?(e.x=t.touches[0].clientX,e.y=t.touches[0].clientY,e.multiTouch=t.touches.length>1):(e.x=t.clientX,e.y=t.clientY,e.multiTouch=!1),e.time=Date.now(),e.comps=P(e)},r=t=>{const n=e.comps||P(t);if(!n.every(e=>e.instance.def.disableTriggers)&&("touchend"===t.type&&t.preventDefault(),function(e,t){const n=Pv(e),r=n?e.changedTouches[0]:e,i=Date.now()-t.time,o=isNaN(t.x)?0:Math.abs(r.clientX-t.x),a=isNaN(t.y)?0:Math.abs(r.clientY-t.y);return(0===e.button||n)&&!t.multiTouch&&o<=12&&a<=12&&i<=300}(t,e)))for(let e=n.length-1;e>=0;e--){if(n[e].instance.onBrushTap(t),w){w=!1;break}}},i=[];i.push({key:"mousedown",listener:t}),i.push({key:"mouseup",listener:r}),function(e){return"ontouchstart"in e&&"ontouchend"in e||navigator.maxTouchPoints>1}(n)&&(i.push({key:"touchstart",listener:t}),i.push({key:"touchend",listener:r})),i.push({key:"mousemove",listener:e=>{const t=P(e);for(let n=t.length-1;n>=0;n--){if(t[n].instance.onBrushOver(e),w){w=!1;break}}}}),i.forEach(e=>{n.addEventListener(e.key,e.listener),f.push(e)})},F=()=>{f.forEach(e=>{let t=e.key,r=e.listener;return n.removeEventListener(t,r)}),f.length=0},j=()=>{n.innerHTML="",(()=>{const e=a.components,t=void 0===e?[]:e;q(),L(i,a),E.set({components:t});const r=C(),o=r.visible,s=r.hidden,l=r.ordered;m=o,s.forEach(e=>{e.instance.hide(),e.visible=!1}),o.forEach(e=>e.instance.beforeMount()),o.forEach(e=>e.instance.mount()),o.forEach(e=>e.instance.beforeRender()),o.forEach(e=>e.instance.render()),o.forEach(e=>e.instance.mounted()),o.forEach(e=>{e.visible=!0}),PC(n,l)})(),z(),_(a.interactions)};return h.layoutComponents=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.excludeFromUpdate,n=void 0===t?[]:t;e.data&&(i=e.data),e.settings&&(a=e.settings,_(e.settings.interactions)),D(),L(i,a);const r=a,o=r.formatters,s=r.scales,l=r.components,c=void 0===l?[]:l;E.update({components:c,data:i,excludeFromUpdate:n,formatters:o,scales:s}),E.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),E.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()}),C()},h.update=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.partialData,r=e.excludeFromUpdate,o=void 0===r?[]:r;let s;e.data&&(i=e.data),e.settings&&(a=e.settings,_(e.settings.interactions)),D(),L(i,a,{partialData:t});const l=a,c=l.formatters,u=l.scales,d=l.components,f=void 0===d?[]:d;E.update({components:f,data:i,excludeFromUpdate:o,formatters:c,scales:u}),E.forEach(e=>{e.updateWith&&e.instance.set(e.updateWith)}),E.forEach(e=>{e.updateWith&&e.instance.beforeUpdate()});const h=[],p=[];let g;if(t)E.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible&&h.push(e)}),g=h;else{const e=C(),t=e.visible,n=e.hidden,r=e.ordered;m=t,g=t,s=r,t.forEach(e=>{e.updateWith&&e.visible?h.push(e):p.push(e)}),n.forEach(e=>{e.instance.hide(),e.visible=!1,delete e.updateWith,e.applyTransform=!1})}p.forEach(e=>e.instance.beforeMount()),p.forEach(e=>e.instance.mount()),g.forEach(e=>e.instance.beforeRender()),g.forEach(e=>{(e.updateWith||e.applyTransform)&&e.visible?e.instance.update():e.instance.render()}),t||PC(n,s),p.forEach(e=>e.instance.mounted()),h.forEach(e=>e.instance.updated()),m.forEach(e=>{delete e.updateWith,e.visible=!0,e.applyTransform=!1}),T()},h.destroy=()=>{I(),E.destroy(),F(),_(),delete h.update,delete h.destroy,R()},h.getAffectedShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"and",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=[];return m.filter(e=>null==r||e.key===r).forEach(r=>{const o=r.instance.getBrushedShapes(e,t,n);i=[...i,...o]}),i},h.findShapes=e=>{let t=[];return m.forEach(n=>{const r=n.instance.findShapes(e);t=[...t,...r]}),t},h.componentsFromPoint=e=>P(e).map(e=>e.instance.ctx),h.shapesAt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[];const i=n.getBoundingClientRect();let o=m;if(Array.isArray(t.components)&&t.components.length>0){const e=t.components.map(e=>e.key);o=m.filter(t=>-1!==e.indexOf(t.key)).map(n=>({instance:n.instance,opts:t.components[e.indexOf(n.key)]}))}for(let n=o.length-1;n>=0;n--){const a=o[n],s=_C(e,i,a.instance.renderer().element().getBoundingClientRect()),l=a.instance.shapesAt(s,a.opts),c=l.length>0&&"stop"===t.propagation;if(r=[...r,...l],r.length>0&&c)return r}return r},h.brushFromShapes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{components:[]};for(let n=0;n<t.components.length;n++){const r=t.components[n].key;m.filter(e=>r===e.key).forEach(r=>{let i=e.filter(e=>e.key===r.key);r.instance.brushFromShapes(i,t.components[n])})}},h.scroll=function(){return function(e,t){return t[e]||(t[e]=OE()),t[e]}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",v)},h.dataset=e=>x(e),h.dataCollection=e=>S(e),h.scales=function(){return g.all()},h.formatters=function(){return y.all()},h.brush=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return M[e]||(M[e]=UE()),M[e]},h.scale=function(e){return g.get(e)},h.formatter=function(e){return y.get(e)},h.toggleBrushing=function(e){w=void 0!==e?e:!w},h.component=e=>{const t=E.findComponentByKey(e);return null==t?void 0:t.instance.ctx},h.logger=()=>u,h.theme=()=>d,h.storage=_k({animations:{updatingStageMeta:{isInit:!1,shouldBeRemoved:!1}}}),Object.defineProperty(h,"interactions",{get:()=>({instances:b,on(){z(),b.forEach(e=>e.on())},off(){F(),b.forEach(e=>e.off())}})}),A(),n&&(O(),j(),N(n),h.element=n),h}const FC=e=>{let t=Jb(e);return t.prio=e=>e?t.default(e[0]):[t.default()],t.types=()=>t.getKeys(),t};var jC=Jb();function $C(e,t,n){let r=n.key;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}const BC=e=>e.filter(e=>"number"==typeof e&&!isNaN(e));const VC=e=>{let t=e.key,n=e.data,r=e.cache,i=e.config;if(!n)return;let o=n;"string"==typeof o&&(o=(e=>{let t=e.data,n=e.config;const r=t.split("\n"),i=r[0],o=r[1];let a=",";if(n&&n.parse&&n.parse.delimiter)a=n.parse.delimiter;else if(i){const e=[/,/,/\t/,/;/];for(let t=0;t<e.length;t++){const n=e[t];if(i&&o){if(n.test(i)&&n.test(o)&&i.split(n).length===o.split(n).length){a=n;break}}else n.test(i)&&(a=n)}}return r.map(e=>e.split(a))})({data:n,config:i})),Array.isArray(o)&&function(e){let t,n=e.source,r=e.data,i=e.cache,o=e.config,a=r;const s=o&&o.parse;Array.isArray(r[0])?s&&!1===s.headers?t=r[0].map((e,t)=>t):(t=r[0],a=r.slice(1)):t=Object.keys(r[0]);const l=!!s&&"function"==typeof s.row&&s.row;let c,u=t;u=s&&"function"==typeof s.fields?s.fields(u.slice()):t.map(e=>({key:e,title:e})),Array.isArray(r[0])?c=u.map(()=>[]):(c={},u.forEach(e=>{c[e.key]=[]}));for(let e=0;e<a.length;e++){const t=l?l(a[e],e,u):a[e];if(t)if(Array.isArray(t))for(let e=0;e<u.length;e++)c[e].push(t[e]);else for(let e=0;e<u.length;e++)c[u[e].key].push(t[u[e].key])}const d=Array.isArray(c)?e=>c[e]:e=>c[u[e].key];for(let e=0;e<u.length;e++){const t=d(e),r=BC(t),o=r.length>0,a=o?"measure":"dimension",s=o?Math.min(...r):NaN,l=o?Math.max(...r):NaN;i.fields.push(wM(Dv({source:n,key:e,title:u[e].title,values:t,min:s,max:l,type:a},u[e]),{value:u[e].value,label:u[e].label}))}}({data:o,cache:r,source:t,config:i})};function HC(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config;const i={fields:[]},o={key:()=>t,raw:()=>n,field:e=>function(e,t){let n=t.cache;if("number"==typeof e)return n.fields[e];for(let t=0;t<n.fields.length;t++)if(n.fields[t].key()===e)return n.fields[t];for(let t=0;t<n.fields.length;t++)if(n.fields[t].title()===e)return n.fields[t];return null}(e,{cache:i}),fields:()=>i.fields.slice(),extract:e=>function(e,t){const n=Array.isArray(e)?e:[e];let r=[];return n.forEach(e=>{if(void 0!==e.field){const n=t.field(e.field),i=t.key();if(!n)throw Error("Field '".concat(e.field,"' not found"));const o=OM(e,t),a=o.props,s=o.main,l=Object.keys(a),c=!!e.trackBy,u=typeof e.trackBy,d={},f=[],h=n.items(),p=[];for(let t=0;t<h.length;t++){const n=h[t];if(s.filter&&!s.filter(n))continue;const r=$C(s,n,{key:i});l.forEach(e=>{const o=a[e];let s=o.field?o.field.items()[t]:n;r[e]=$C(o,s,{key:i})}),c&&TM({cfg:e,itemData:n,obj:r,target:f,tracker:d,trackType:u}),p.push(r)}r=c?[...r,...DM(f,{main:s,propsArr:l,props:a})]:[...r,...p]}}),r}(e,o),hierarchy:()=>null};return VC({key:t,data:n,config:r,cache:i}),o}HC.util={normalizeConfig:OM,collect:DM,track:TM};const UC=Jb();UC.default("matrix"),UC("matrix",HC),UC("default",HC);const WC=Jb();function YC(e,t,n){return Math.max(e,Math.min(t,n))}function KC(e){let t=e.item,n=e.value,r=e.boxCenter,i=e.rendWidth,o=e.rendHeight,a="x",s="y",l=i,c=o,u=n<.5?90:-90;return e.flipXY&&(a="y",s="x",l=o,c=i,u=n<.5?180:0),(0,e.symbol)(Dv({},t.oob,{[a]:r*l,[s]:Math.max(t.oob.size/2,Math.min(n*c,c-t.oob.size/2)),startAngle:u}))}function GC(e){let t=e.item,n=e.boxWidth,r=e.boxPadding,i=e.rendWidth,o=e.rendHeight,a="x",s="y",l="width",c="height",u=i,d=o;e.flipXY&&(a="y",s="x",l="height",c="width",u=o,d=i);const f=function(e){let t=e.start,n=e.end,r=e.minPx,i=void 0===r?.1:r,o=e.maxPx,a=void 0===o?1:o;const s=Math.max(t,n),l=Math.min(t,n),c=YC(-.1,1.2,s),u=YC(-.1,1.2,l),d=c*a-u*a,f=Math.max(i,d),h=(f-d)/2;return{actualDiff:f,startModifier:h,actualLow:u*a-h}}({start:t.start,end:t.end,minPx:t.box.minHeightPx,maxPx:d}),h=f.actualDiff,p=f.actualLow;return Dv({},t.box,{type:"rect",[a]:(r+t.major)*u,[s]:p,[c]:h,[l]:n*u,data:t.data||{},collider:{type:null}})}function XC(e){let t=e.item,n=e.from,r=e.to,i=e.boxCenter,o=e.rendWidth,a=e.rendHeight,s="x1",l="y1",c="x2",u="y2",d=o,f=a;return e.flipXY&&(s="y1",l="x1",c="y2",u="x2",d=a,f=o),Dv({},t.line,{type:"line",[u]:Math.floor(n*f),[s]:i*d,[l]:Math.floor(r*f),[c]:i*d,data:t.data||{},collider:{type:null}})}function JC(e){let t=e.item,n=e.key,r=e.position,i=e.width,o=e.boxCenter,a=e.rendWidth,s=e.rendHeight,l="x1",c="y1",u="x2",d="y2",f=a,h=s;e.flipXY&&(l="y1",c="x1",u="y2",d="x2",f=s,h=a);const p=i/2;return Dv({type:"line"},t[n],{[c]:Math.floor(r*h),[l]:(o-p)*f,[d]:Math.floor(r*h),[u]:(o+p)*f,r:p*f,cx:o*f,cy:r*h,width:i*f,data:t.data||{},collider:{type:null}})}function ZC(e,t,n){const r=t.box,i=r.width,o=r.maxWidthPx,a=r.minWidthPx,s=e>=0?1:-1;let l=Math.min(s*e*i,isNaN(o)?n:o/n);return l=isNaN(a)?l:Math.max(a/n,l),l*s}WC("native",function(e,t,n){let r,i,o={chart:e,mediator:t,element:n},a=[],s=!0;function l(){"function"==typeof r.enable&&(r.enable=r.enable.bind(o)()),r.enable&&Object.keys(r.events).forEach(e=>{const t=r.events[e].bind(o);n.addEventListener(e,t),a.push({key:e,listener:t})})}function c(){a.forEach(e=>{let t=e.key,r=e.listener;n.removeEventListener(t,r)}),a=[]}return{get key(){return i},set(e){!function(e){i=e.key,r=e,r.events=r.events||[],void 0===r.enable&&(r.enable=!0)}(e),c(),s&&l()},off(){s=!1,c()},on(){s=!0,0===a.length&&l()},destroy(){c(),o=null,r=null}}});const QC={oob:{show:!0,type:"n-polygon",fill:"#999",stroke:"#000",strokeWidth:0,size:10,sides:3,startAngle:-90},box:{show:!0,fill:"#fff",stroke:"#000",strokeWidth:1,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1},line:{show:!0,stroke:"#000",strokeWidth:1},median:{show:!0,stroke:"#000",strokeWidth:1},whisker:{show:!0,stroke:"#000",strokeWidth:1,fill:"",type:"line",width:1}},eA=Object.keys(QC),tA={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},style:{box:"$shape",line:"$shape-guide",whisker:"$shape-guide",median:"$shape-guide--inverted"}},created(){this.state={}},render(e){let t=e.data;const n=this.rect,r=n.width,i=n.height,o="horizontal"===this.settings.settings.orientation,a=this.style,s=this.resolver,l=this.symbol,c=eA.filter(e=>!this.settings.settings[e]||!1!==this.settings.settings[e].show),u={};c.forEach(e=>u[e]=QC[e]);const d=function(e){let t=e.keys,n=e.data,r=e.defaultSettings,i=e.style,o=e.settings,a=e.width,s=e.height,l=e.resolver;const c=Dv(!0,{},r||{},i||{}),u={major:"horizontal"===o.orientation?s:a,minor:"horizontal"===o.orientation?a:s},d=o.major;let f;f="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Dv(!0,{},{binStart:{scale:o.major.scale,ref:o.major.ref.start},binEnd:{scale:o.major.scale,ref:o.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Dv(!0,{},{binStart:{scale:o.major.scale,ref:"binStart"},binEnd:{scale:o.major.scale,ref:"binEnd"}},o.major)}):l.resolve({data:n,scaled:u,defaults:{major:.5},settings:{major:o.major}});const h=o.minor||{},p={};["start","end","min","max","med"].forEach(e=>{(h[e]||n.items&&n.items.length&&n.items[0][e])&&(p[e]={scale:h.scale,ref:e})});let m,g={major:f,minor:l.resolve({data:n,defaults:{start:0,end:1},scaled:u,settings:Dv(!0,{},p,h)})};for(let e=0,r=t.length;e<r;e++)o[m]&&!1===o[m].show||(m=t[e],g[m]=l.resolve({data:n,defaults:c[m],settings:o[m],scaled:u}));return g}({keys:c,data:t,defaultSettings:u,style:a,settings:this.settings.settings,width:r,height:i,resolver:s});d.settings,d.items;const f=function(e){let t=e.width,n=e.height,r=e.flipXY,i=e.resolved,o=e.keys,a=e.symbol;const s=[],l=i.major.items;if(!l.length)return s;const c=t,u=n,d=r?n:t,f=i.major.settings,h=["start","end","min","max","med"].filter(e=>void 0!==i.minor.settings[e]),p=h.length,m=o.filter(e=>"oob"!==e);let g,y,v,b,x,S,M,w,E;const k=o?o.length:0,C=m?m.length:0;function A(){M?g.push(KC({item:v,value:0,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r,symbol:a})):w&&g.push(KC({item:v,value:1,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r,symbol:a}))}const O={box:function(){v.box&&zv(v.start)&&zv(v.end)&&g.push(GC({item:v,boxWidth:b,boxPadding:x,rendWidth:c,rendHeight:u,flipXY:r}))},line:function(){zv(v.min)&&zv(v.start)&&g.push(XC({item:v,from:v.min,to:v.start,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r})),zv(v.max)&&zv(v.end)&&g.push(XC({item:v,from:v.max,to:v.end,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r}))},median:function(){v.median&&zv(v.med)&&g.push(JC({item:v,key:"median",position:v.med,width:b,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r}))},whisker:function(){if(v.whisker){const e=b*v.whisker.width;zv(v.min)&&g.push(JC({item:v,key:"whisker",position:v.min,width:e,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r})),zv(v.max)&&g.push(JC({item:v,key:"whisker",position:v.max,width:e,boxCenter:S,rendWidth:c,rendHeight:u,flipXY:r}))}}};function N(){let e,t=-Number.MAX_VALUE,n=Number.MAX_VALUE;for(let r=0;r<p;r++)e=v[h[r]],zv(e)&&(t<e&&(t=e),n>e&&(n=e));M=t<0&&t!==-Number.MAX_VALUE,w=n>1&&n!==Number.MAX_VALUE,E=M||w}for(let e=0,t=l.length;e<t;e++){g=[],y=null;const t=l[e],n=t.data;let r=null,a=null;void 0!==f.binStart?(r=t.binStart,a=t.binEnd,y=f.binStart.scale):(y=f.major.scale,r=y?t.major:0);let c=0;y?y.bandwidth?(c=y.bandwidth(),r-=c/2):c=a-r:c=1,v=Dv({},{major:r,majorEnd:a},i.minor.items[e]);for(let t=0;t<k;t++)v[o[t]]=i[o[t]].items[e];if(b=ZC(c,v,d),x=(c-b)/2,S=x+v.major+b/2,N(),E)v.oob&&A();else for(let e=0;e<C;e++)v[m[e]]&&!1===v[m[e]].show||O[m[e]]();const u={type:"container",data:n,collider:{type:"bounds"},children:g};s.push(u)}return s}({width:r,height:i,flipXY:o,resolved:d,keys:c,symbol:l});return f}};const nA={shape:"saltire",width:2,size:.5,fill:"#333",stroke:"#333",strokeWidth:0},rA=/px$/,iA={shape:"circle",label:"",fill:"#333",stroke:"#ccc",strokeDasharray:"",strokeWidth:0,strokeLinejoin:"miter",opacity:1,x:.5,y:.5,size:1,show:!0},oA={imageSrc:void 0,imageScalingFactor:void 0,position:"center-center",symbol:"rectangle",width:void 0,height:void 0},aA={maxPx:1e4,minPx:1,maxRelExtent:.1,minRelExtent:.01,maxRelDiscrete:1,minRelDiscrete:.1};function sA(e,t){return e&&"function"==typeof e.bandwidth?{isBandwidth:!0,value:Math.max(1,e.bandwidth()*t)}:{isBandwidth:!1,value:Math.max(1,t)}}function lA(e,t,n,r){let i=t.width,o=t.height;return e.filter(e=>!1!==e.show&&!isNaN(e.x+e.y)).map(e=>{let t=e,a=rA.test(e.size)?parseInt(e.size,10):n.min+t.size*(n.max-n.min);Fv(a)&&(t=nA,a=n.min+t.size*(n.max-n.min));const s=function(e){let t=iA.shape,n={};return"object"==typeof e.shape&&"string"==typeof e.shape.type?(t=e.shape.type,n=e.shape):"string"==typeof e.shape&&(t=e.shape),[t,n]}(t),l=_v(s,2),c=l[0],u=Lv(Lv({},l[1]),{},{type:c,label:e.label,x:e.x*i,y:e.y*o,fill:t.fill,size:Math.min(n.maxGlobal,Math.max(n.minGlobal,a)),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeDasharray:t.strokeDasharray,opacity:t.opacity,imageSettings:t.imageSettings});t===e.errorShape&&(u.width=t.width);const d=r(u);return d.data=e.data,d})}const cA={require:["chart","resolver","symbol"],defaultSettings:{settings:{},data:{},animations:{enabled:!1,trackBy:e=>e.data.value},style:{item:"$shape"}},render(e){let t=e.data;const n=this.resolver.resolve({data:t,defaults:Dv({},iA,this.style.item),settings:this.settings.settings,scaled:{x:this.rect.width,y:this.rect.height}}),r=this.rect,i=r.width,o=r.height,a=Dv({},aA,this.settings.settings.sizeLimits),s=n.items;s.length>0&&"image"===s[0].shape&&t.items.forEach((e,t)=>{s[t].imageSettings=Dv({},oA,this.settings.settings.imageSettings)});const l=function(e,t,n,r,i){const o=sA(e?e.scale:void 0,n),a=sA(t?t.scale:void 0,r);let s=Math.min(o.value*i[o.isBandwidth?"maxRelDiscrete":"maxRelExtent"],a.value*i[a.isBandwidth?"maxRelDiscrete":"maxRelExtent"]),l=Math.min(o.value*i[o.isBandwidth?"minRelDiscrete":"minRelExtent"],a.value*i[a.isBandwidth?"minRelDiscrete":"minRelExtent"]);return{min:Math.max(1,Math.floor(l)),max:Math.max(1,Math.floor(s)),maxGlobal:i.maxPx,minGlobal:i.minPx}}(n.settings.x,n.settings.y,i,o,a);return lA(s,this.rect,l,this.settings.shapeFn||this.symbol)}};const uA={label:"",arc:1,show:!0,fill:"#333",stroke:"#ccc",strokeWidth:1,strokeLinejoin:"round",opacity:1,innerRadius:0,outerRadius:.8,cornerRadius:0,offset:0};function dA(e,t,n,r){let i=t.x,o=t.y,a=t.width,s=t.height;const l=bb(),c={x:i+a/2,y:o+s/2},u=Math.min(a,s)/2,d=Math.min(a,s)/2,f=d/100;return e.map((e,t)=>{const i=n[t];i.type="path";const o=d*i.outerRadius,a=u*i.innerRadius,s=f*i.cornerRadius;l.innerRadius(a),l.outerRadius(o),l.cornerRadius(s),i.arcDatum=e;const h=l.centroid(e),p=i.offset?function(e,t,n,r){let i=_v(e,2),o=i[0],a=i[1];const s=Math.sqrt(o*o+a*a);o/=s,a/=s;const l=n-r;return{x:o*t*l,y:a*t*l}}(h,i.offset,o,a):{x:0,y:0};return i.transform="translate(".concat(p.x,", ").concat(p.y,") translate(").concat(c.x,", ").concat(c.y,")"),i.desc={share:e.value/r,slice:{start:e.startAngle,end:e.endAngle,innerRadius:a,outerRadius:o,cornerRadius:s,offset:{x:c.x+p.x,y:c.y+p.y}}},i})}function fA(e,t){return e.slice&&"arc"in e.slice?t.arc:t.data.value}const hA={require:["chart","resolver"],defaultSettings:{settings:{startAngle:0,endAngle:2*Math.PI,padAngle:0,slice:{}},style:{slice:"$shape"},data:{}},render(e){let t=e.data;const n=[],r=[],i=this.settings.settings,o=this.resolver.resolve({data:t,defaults:Dv({},uA,this.style.slice),settings:i.slice}).items;let a=0;for(let e=0,t=o.length;e<t;e++){const t=fA(i,o[e]);t>0&&o[e].outerRadius>=o[e].innerRadius&&(n.push(t),r.push(o[e]),a+=t)}const s=function(){var e=Ab,t=Cb,n=null,r=Yv(0),i=Yv(ib),o=Yv(0);function a(a){var s,l,c,u,d,f=(a=xb(a)).length,h=0,p=new Array(f),m=new Array(f),g=+r.apply(this,arguments),y=Math.min(ib,Math.max(-ib,i.apply(this,arguments)-g)),v=Math.min(Math.abs(y)/f,o.apply(this,arguments)),b=v*(y<0?-1:1);for(s=0;s<f;++s)(d=m[p[s]=s]=+e(a[s],s,a))>0&&(h+=d);for(null!=t?p.sort(function(e,n){return t(m[e],m[n])}):null!=n&&p.sort(function(e,t){return n(a[e],a[t])}),s=0,c=h?(y-f*b)/h:0;s<f;++s,g=u)l=p[s],u=g+((d=m[l])>0?d*c:0)+b,m[l]={data:a[l],index:s,value:d,startAngle:g,endAngle:u,padAngle:v};return m}return a.value=function(t){return arguments.length?(e="function"==typeof t?t:Yv(+t),a):e},a.sortValues=function(e){return arguments.length?(t=e,n=null,a):t},a.sort=function(e){return arguments.length?(n=e,t=null,a):n},a.startAngle=function(e){return arguments.length?(r="function"==typeof e?e:Yv(+e),a):r},a.endAngle=function(e){return arguments.length?(i="function"==typeof e?e:Yv(+e),a):i},a.padAngle=function(e){return arguments.length?(o="function"==typeof e?e:Yv(+e),a):o},a}().sortValues(null);s.startAngle(i.startAngle),s.endAngle(i.endAngle),s.padAngle(i.padAngle);return dA(s(n),Dv({},this.rect,{x:0,y:0}),r,a)}};const pA=function(e){function t(t){if(e[t.type]&&e[t.type].condition(t)){const n=e[t.type],r=void 0===n.conditionAppend||n.conditionAppend(t);n.items.forEach(e=>{const n=Math.round(t[e.key]),i=t[e.key]-n;t[e.key]=n,r&&"append"===e.type&&(i>0?t[e.key]+=.5:t[e.key]-=.5)})}}return void 0===e&&((e={}).line={append:["x1","x2","y1","y2"],round:[],condition:e=>e.x1===e.x2||e.y1===e.y2,conditionAppend:e=>e.strokeWidth%2!=0},e.rect={append:["x","y"],round:["width","height"],condition:()=>!0,conditionAppend:e=>e.strokeWidth%2!=0}),Object.keys(e).forEach(t=>{const n=e[t];n.items=[],n.append.forEach(e=>{n.items.push({key:e,type:"append"})}),n.round.forEach(e=>{n.items.push({key:e,type:"round"})})}),t.multiple=e=>e.forEach(e=>t(e)),t}();class mA{constructor(){this.reset(),this.push(...arguments)}static evaluateKey(e,t){if(t){const t=e.substring(0,1),n=e.substring(1);if("x"===t)return"y".concat(n);if("y"===t)return"x".concat(n);if("cx"===e)return"cy";if("cy"===e)return"cx";if("width"===e)return"height";if("height"===e)return"width"}return e}transposeCoordinate(e,t,n){if("number"==typeof t&&isFinite(t)){const r=e.substring(0,1);if("x"===r||"cx"===e)return t*this.width;if("width"===e)return t*this.width;if("r"===e)return t*(n?this.height:this.width);if("y"===r||"cy"===e)return t*this.height;if("height"===e)return t*this.height}return t}push(){return this.storage.push(...arguments),this}processItem(e){let t={};const n=void 0!==e.flipXY?e.flipXY:this.flipXY,r=void 0!==e.crisp?e.crisp:this.crisp;if(e.fn&&"function"==typeof e.fn){let r=n?this.height:this.width,i=n?this.width:this.height;e=e.fn({width:r,height:i,flipXY:n});const o=Object.keys(e);for(let r=0,i=o.length;r<i;r++){let i=o[r];t[mA.evaluateKey(i,n)]=e[i]}}else{const r=Object.keys(e);for(let i=0,o=r.length;i<o;i++){let o=r[i];const a=mA.evaluateKey(o,n),s=this.transposeCoordinate(a,e[o],n);t[a]=s}}return r&&pA(t),t}output(){let e=[];for(let t=0,n=this.storage.length;t<n;t++){let n=this.processItem(this.storage[t]);e.push(n)}return e}reset(){this.storage=[],this.flipXY=!1,this.crisp=!1,this.width=0,this.height=0}}function gA(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new mA(...t)}function yA(e,t){return e&&t?e.cachedTicks&&e.cachedTicks()||e.ticks({distance:t}):[]}const vA={created(){},require:["chart","renderer","resolver"],defaultSettings:{layout:{displayOrder:0},style:{ticks:"$guide-line",minorTicks:"$guide-line--minor"}},beforeRender(){this.blueprint=gA(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){if(this.x=this.settings.x?this.chart.scale(this.settings.x):null,this.y=this.settings.y?this.chart.scale(this.settings.y):null,rk(this,"x",this.rect.width),rk(this,"y",this.rect.height),!this.x&&!this.y)return[];this.settings.ticks=Dv({show:!0},this.style.ticks,this.settings.ticks||{}),this.settings.minorTicks=Dv({show:!1},this.style.minorTicks,this.settings.minorTicks||{}),this.lines={x:[],y:[]},this.lines.x=yA(this.x,this.rect.width),this.lines.y=yA(this.y,this.rect.height),this.lines.y=this.lines.y.map(e=>Dv(e,{flipXY:!0}));let e=e=>{let t=e.dir,n=e.isMinor,r=this.lines[t].filter(e=>!!e.isMinor===n),i=n?this.settings.minorTicks:this.settings.ticks;this.resolver.resolve({settings:i,data:{items:r,dir:t}}).items.forEach(e=>{let n=e.data;var r,i;e.show&&this.blueprint.push({type:"line",x1:n.position,y1:0,x2:n.position,y2:1,stroke:e.stroke||"black",strokeWidth:void 0!==e.strokeWidth?e.strokeWidth:1,strokeDasharray:void 0!==e.strokeDasharray?e.strokeDasharray:void 0,flipXY:n.flipXY||!1,value:null!==(r=n.value)&&void 0!==r?r:null===(i=n.data)||void 0===i?void 0:i.value,dir:t})})};return e({dir:"x",isMinor:!1}),e({dir:"x",isMinor:!0}),e({dir:"y",isMinor:!1}),e({dir:"y",isMinor:!0}),this.blueprint.output()}};function bA(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.8,"left"===r||"right"===r){let i="right"===r;return"\n      M ".concat(e," ").concat(t-n,"\n      A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?0:1,", ").concat(e," ").concat(t+n,"\n      L ").concat(i?e+n:e-n," ").concat(t," Z\n    ")}let i="bottom"===r;return"\n    M ".concat(e-n," ").concat(t,"\n    A ").concat(1.25*n," ").concat(1.25*n,", 0, 1, ").concat(i?1:0,", ").concat(e+n," ").concat(t,"\n    L ").concat(e," ").concat(i?t+n:t-n," Z\n  ")}function xA(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"bottom";if(n*=.75,"left"===r||"right"===r){let i="right"===r;return"\n      M ".concat(e+=i?1.5*n:-1.5*n," ").concat(t-n,"\n      L ").concat(e," ").concat(t+n,"\n      L ").concat(i?e+n:e-n," ").concat(t," Z\n    ")}let i="bottom"===r;return t+=i?1.5*n:-1.5*n,"\n    M ".concat(e-n," ").concat(t,"\n    L ").concat(e+n," ").concat(t,"\n    L ").concat(e," ").concat(i?t+n:t-n," Z\n  ")}function SA(e,t,n){return e<t||e>n}function MA(e,t){if("string"==typeof e.formatter)return t.formatter(e.formatter);if("object"==typeof e.formatter)return t.formatter(e.formatter);if(void 0!==e.scale&&e.scale.data){const t=e.scale.data()&&e.scale.data().fields;return t&&t[0]?t[0].formatter():null}return null}function wA(e){if(void 0===e)return 0;if("number"==typeof e&&isFinite(e))return e;if("string"==typeof e)switch(e){case"center":case"middle":return.5;case"bottom":case"right":return 1;default:return 0}return 0}function EA(e){var t,n;let r=e.chart,i=e.blueprint,o=e.renderer,a=e.p,s=e.settings,l=e.items,c=e.slopeLine,u=!0,d=!1,f=!1,h=!1,p=!1,m=Dv(!0,{},s.style.line,a.line||{}),g=Dv(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke});if(d=c?i.processItem({type:"line",x1:c.x1,y1:c.y1,x2:c.x2,y2:c.y2,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:!1,value:a.valueInfo?a.valueInfo.id:a.value}):i.processItem({type:"line",x1:a.position,y1:0,x2:a.position,y2:1,stroke:m.stroke||"black",strokeWidth:m.strokeWidth||1,strokeDasharray:m.strokeDasharray,flipXY:a.flipXY||!1,value:a.valueInfo?a.valueInfo.id:a.value}),a.label&&!1!==a.label.show&&(null==c||!c.slope||0===c.slope)){const e=Dv(!0,{fill:"#000",fontFamily:"Arial",fontSize:"12px",opacity:1,maxWidth:1,maxWidthPx:9999,padding:5,background:{fill:"#fff",stroke:"transparent",strokeWidth:0,opacity:.5}},s.style.label||{},{fill:m.stroke},a.label);let t,n={width:0,height:0},c="";t=MA(a,r),!1!==a.label.showValue&&(t?c=" (".concat(t(a.value),")"):a.scale&&(c=" (".concat(a.value,")"))),c&&(n=o.measureText({text:c,fontFamily:e.fontFamily,fontSize:e.fontSize}));let d=o.measureText({text:e.text||"",fontFamily:e.fontFamily,fontSize:e.fontSize}),g={width:d.width+n.width,height:Math.max(d.height,n.height)},y=e.padding,v=wA(a.flipXY?e.vAlign:e.align),b=wA(a.flipXY?e.align:e.vAlign),x=Math.min(1+g.width+2*y,e.maxWidth*i.width,e.maxWidthPx),S=g.height+2*y,M=a.flipXY?S:x,w=a.flipXY?x:S;if(f=i.processItem({fn:t=>{let n=t.width,r=t.height,o=a.position*n-(a.flipXY?S:x)*(1-v);o=a.flipXY?o:Math.max(o,0);return{type:"rect",x:o,y:Math.max(Math.abs(b*r-w*b),0),width:a.flipXY?M:Math.min(M,i.width-o),height:w,stroke:e.background.stroke,strokeWidth:e.background.strokeWidth,fill:e.background.fill,opacity:e.background.opacity}},flipXY:a.flipXY||!1}),f.x<-1||f.x+f.width>i.width+1||f.y<-1||f.y+f.height>i.height+1)f=void 0;else{h={type:"text",text:e.text||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:f.x+y,y:f.y+f.height/2+g.height/3,maxWidth:f.width-2*y-n.width,anchor:"start"},c&&(p={type:"text",text:c||"",fill:e.fill,opacity:e.opacity,fontFamily:e.fontFamily,fontSize:e.fontSize,x:h.x+3+(f.width-(n.width+2*y)),y:h.y});for(let e=0,t=l.length;e<t;e++){let t=l[e];"rect"===t.type?Qk(f,t)&&(u=!1):"line"===t.type&&a.flipXY===t.flipXY&&nC(f,t)&&(u=!1)}}}if(d&&l.push(d),c&&0!==c.slope&&(!1!==(null===(t=c.label)||void 0===t?void 0:t.show)||!1!==(null===(n=c.label)||void 0===n?void 0:n.showValue))){var y,v,b;let e,t;const n=120;let s=!1!==(null===(y=c.label)||void 0===y?void 0:y.show)?null===(v=c.label)||void 0===v?void 0:v.text:"";if(!1!==(null===(b=c.label)||void 0===b?void 0:b.showValue)){var x;const t=MA(a,r),n=t?t(c.value):c.value;e="(".concat(c.slope,"x + ").concat(n,")"),s+=null!==(x=c.label)&&void 0!==x&&x.text?" ".concat(e):e}if(s.length>1){var S,M,w;const e=o.measureText({text:s,fontFamily:g.fontFamily,fontSize:g.fontSize});e.width=e.width>n?n:e.width;const a=function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});if(t>0){if(r.max()*t+n>=i.max())return!0}else if(t<0&&r.min()*t+n>=i.max())return!0;return!1}(r,c.slope,c.value)?function(e,t,n){const r=e.scale({scale:"x"}),i=e.scale({scale:"y"});return r((i.max()-n)/t)}(r,c.slope,c.value):void 0,u=void 0===a||c.isRtl?g.padding:3*g.padding,f=void 0!==a||c.slope>0?3*g.padding:g.padding,h=function(e,t,n,r,i,o){let a=0;if(void 0!==n){if(n<.8)return a=e.slope<0||e.isRtl?3*o.padding:2*o.padding,e.isRtl,n*i.width+a;if(1===n)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding);if(n>.8)return e.isRtl?n*i.width-(r.width+3*o.padding):n*i.width-(r.width+6*o.padding)}else if(e.slope>0)return t.x2-(r.width+2*o.padding);return e.isRtl?t.x1-(r.width+2*o.padding):t.x1}(c,d,a,e,i,g),p=Math.min(d.y1,d.y2);null!==(S=c.label)&&void 0!==S&&S.stroke&&(t={type:"rect",x:c.isRtl?Math.max(h,u)-2:Math.max(h,u)+2,y:Math.abs(Math.max(p,f)-e.height),rx:3,ry:3,width:e.width+g.padding,height:e.height-2,stroke:m.stroke,fill:m.stroke});const y={type:"text",text:s,fill:null!==(M=null===(w=c.label)||void 0===w?void 0:w.stroke)&&void 0!==M?M:m.stroke,opacity:g.opacity,fontFamily:g.fontFamily,fontSize:g.fontSize,x:t?t.x+2:Math.max(h,u)+2,y:t?t.y+e.height-g.padding:Math.abs(Math.max(p,f)-g.padding/2),anchor:"start",title:s,maxWidth:n,width:e.width};(function(e,t,n,r,i){for(let o=0,a=e.length;o<a;o++){const a=e[o];if("text"===(null==a?void 0:a.type)&&Math.abs(a.x-t.x)<Math.max(a.width+r,t.width+r)&&Math.abs(a.y-t.y)<n.height+i)return!0}return!1})(l,y,e,u,f)||(t&&l.push(t),l.push(y))}}u&&f&&h&&(l.push(f,h),p&&l.push(p))}function kA(e){const t={value:e.value};return e.label&&(t.label=e.label.text),t}function CA(e){return void 0!==("function"==typeof e.value?e.value():e.value)}function AA(e,t){const n=e.min();if(n===e.max()){const r=function(e){const t=e.range();return 2===(null==t?void 0:t.length)&&t[0]>t[1]}(e);if(t<n)return r?2:-1;if(t>n)return r?-1:2}return e(t)}function OA(e,t){return e&&t&&Math.abs(e.x-t.x)<1e-15&&Math.abs(e.y-t.y)<1e-15}const NA={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:0},style:{oob:{show:!0,width:10,fill:"#1A1A1A",stroke:"transparent",strokeWidth:0,opacity:1,text:{fontFamily:"Arial",stroke:"transparent",fill:"#fff",strokeWidth:0,opacity:1},triangle:{fill:"#4D4D4D",stroke:"transparent",strokeWidth:0,opacity:1},padding:{x:28,y:5}},line:{stroke:"#000"},label:{strokeWidth:0}}},preferredSize:()=>30,beforeRender(){this.blueprint=gA(),this.blueprint.width=this.rect.width,this.blueprint.height=this.rect.height,this.blueprint.x=this.rect.x,this.blueprint.y=this.rect.y,this.blueprint.crisp=!0},render(){let e=this.settings;if(this.lines={x:[],y:[]},this.lines.x=e.lines&&e.lines.x||[],this.lines.y=e.lines&&e.lines.y||[],0===this.lines.x.length&&0===this.lines.y.length)return[];const t={x0:[],x1:[],y0:[],y1:[]};this.lines.x=this.lines.x.filter(CA).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=AA(t,e.value);return Dv(e,{scale:t,position:n})}return Dv(e,{position:e.value})}),this.lines.y=this.lines.y.filter(CA).map(e=>{if("function"==typeof e.value&&(e.value=e.value()),e.scale){let t=this.chart.scale(e.scale);const n=AA(t,e.value);return Dv(e,{scale:t,position:n,flipXY:!0})}return Dv(e,{position:e.value,flipXY:!0})}),this.lines.x=this.lines.x.filter(e=>!(e.position<0||e.position>1)||(t["x".concat(e.position>1?1:0)].push(kA(e)),!1)),this.lines.y=this.lines.y.filter(e=>!(!e.slope||0===e.slope)||(!(e.position<0||e.position>1)||(t["y".concat(e.position>1?1:0)].push(kA(e)),!1)));let n=[];return[...this.lines.x,...this.lines.y].forEach(r=>{if(!0===r.show||void 0===r.show){let i;if(r.slope&&0!==r.slope){const e=this.chart.scale({scale:"x"}),n=this.chart.scale({scale:"y"}),o=e.min(),a=e.max(),s=n.min(),l=n.max();i=Lv(Lv({},r),{},{x1:void 0,y1:void 0,x2:void 0,y2:void 0});const c=o*r.slope+r.value,u=a*r.slope+r.value,d=(s-r.value)/r.slope,f=(l-r.value)/r.slope;let h=[];SA(c,s,l)||(h[0]={x:AA(e,o),y:AA(n,c)}),SA(d,o,a)||(h[1]={x:AA(e,d),y:1}),SA(u,s,l)||(h[2]={x:AA(e,a),y:AA(n,u)}),SA(f,o,a)||(h[3]={x:AA(e,f),y:0});const p=h.filter(e=>!!e).length;if(p>2&&function(e){OA(e[0],e[1])&&(e[1]=void 0),OA(e[1],e[2])&&(e[2]=void 0),OA(e[2],e[3])&&(e[3]=void 0),OA(e[3],e[0])&&(e[3]=void 0)}(h),h=h.filter(e=>!!e),h.length<2)return void t["y".concat(c>l?0:1)].push(kA(r));i.x1=h[0].x,i.y1=h[0].y,i.x2=h[1].x,i.y2=h[1].y}else i=void 0;EA({chart:this.chart,blueprint:this.blueprint,renderer:this.renderer,p:r,settings:e,items:n,slopeLine:i})}}),e.style.oob.show&&function(e){let t=e.blueprint,n=e.oob,r=e.settings,i=e.items;const o=Object.keys(n);let a=r.style.oob||{};for(let e=0,r=o.length;e<r;e++){const r=o[e],s=n[r];if(s.length>0){let e=r.charAt(1),n="y"===r.charAt(0),o=a.padding.x+a.width,l=a.padding.y+a.width,c="bottom";c=n?"1"===e?"bottom":"top":"1"===e?"right":"left";let u=t.processItem({fn:t=>{let r=t.width,i=t.height,u=e*r+("1"===e?-o:o),d=n?l:i-l;return"arc"===a.type?{type:"path",d:bA(n?d:u,n?u:d,a.width,c),x:u,y:d,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0}:{type:"circle",cx:u,cy:d,r:a.width,stroke:a.stroke,fill:a.fill,strokeWidth:a.strokeWidth||0,opacity:a.opacity,data:s}},flipXY:n}),d=u.cx||u.x,f=u.cy||u.y;const h=s.map(e=>e.label?"".concat(e.label," (").concat(e.value,")"):"(".concat(e.value,")")),p=h.reduce((e,t,n)=>0===n?t:"".concat(e,"\n\n").concat(t),"");let m={type:"text",text:s.length||"",title:p,x:d-.4*a.width,y:f+.4*a.width,fontFamily:a.text.fontFamily,fontSize:"".concat(1.3*a.width,"px"),stroke:a.text.stroke,fill:a.text.fill,strokeWidth:a.text.strokeWidth||0,opacity:a.text.opacity},g={type:"path",d:xA(d,f,a.width,c),x:d,y:f,stroke:a.triangle.stroke,fill:a.triangle.fill,strokeWidth:a.triangle.strokeWidth||0,opacity:a.triangle.opacity};i.push(u,m,g)}}}({blueprint:this.blueprint,oob:t,settings:e,items:n}),n}};function DA(e){const t={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null}};return"top"===e.align||"bottom"===e.align?(t.x1=e.innerRect.x-e.outerRect.x,t.x2=t.x1+e.innerRect.width,t.y1=t.y2="top"===e.align?e.innerRect.height-e.padding:e.padding):(t.x1=t.x2="left"===e.align?e.innerRect.width-e.padding:e.padding,t.y1=e.innerRect.y-e.outerRect.y,t.y2=t.y1+e.innerRect.height),function(e,t){Dv(e,t.style)}(t,e),t}function TA(e){return"string"==typeof e||"number"==typeof e?e:"-"}function qA(e,t,n){n.layered||!n.stepSize?function(e,t){t.collider={type:"polygon",vertices:[{x:t.boundingRect.x,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y},{x:t.boundingRect.x+t.boundingRect.width,y:t.boundingRect.y+t.boundingRect.height},{x:t.boundingRect.x,y:t.boundingRect.y+t.boundingRect.height}]}}(0,t):n.tilted?function(e,t,n){const r=n.angle*(Math.PI/180),i=Math.max(n.stepSize/2,t.boundingRect.height/2),o="start"===t.anchor,a="end"===t.anchor&&r<0,s="start"===t.anchor&&r>=0,l=t.boundingRect.y+(s||a?t.boundingRect.height:0),c=[{x:t.x-i,y:l},{x:t.x+i,y:l}].map(e=>kk(e,r,{x:t.x,y:t.y})),u={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y+t.boundingRect.height},d={x:o?t.boundingRect.x+t.boundingRect.width+10:t.boundingRect.x-10,y:t.boundingRect.y},f=r>=0?[u,d]:[d,u];c.push(...f),t.collider={type:"polygon",vertices:c}}(0,t,n):function(e,t,n){if("bottom"===n.align||"top"===n.align){const r=e.position*n.innerRect.width+(n.innerRect.x-n.outerRect.x-n.stepSize/2);t.collider={type:"rect",x:r,y:0,width:r<0?n.stepSize+r:n.stepSize,height:n.innerRect.height}}else{const r=e.position*n.innerRect.height+(n.innerRect.y-n.outerRect.y-n.stepSize/2);t.collider={type:"rect",x:0,y:r,width:n.innerRect.width,height:r<0?n.stepSize+r:n.stepSize}}const r=t.collider;r.x=Math.max(r.x,0),r.y=Math.max(r.y,0);const i=r.x+r.width-(n.outerRect.x+n.outerRect.width);r.width=i>0?r.width-i:r.width;const o=r.y+r.height-(n.outerRect.y+n.outerRect.height);r.height=o>0?r.height-o:r.height}(e,t,n)}function IA(e,t){const n=isNaN(e.style.align)?.5:Math.min(Math.max(e.style.align,0),1);let r=0;if(e.tilted)r=e.stepSize*n;else{const i=t?e.textRect.height:e.textRect.width;r=Math.max(0,e.stepSize-i)*n}return r}function RA(e,t){var n,r;const i={type:"text",text:TA(e.label),x:0,y:0,maxWidth:t.maxWidth,maxHeight:t.maxHeight,tickValue:null!==(n=e.value)&&void 0!==n?n:null===(r=e.data)||void 0===r?void 0:r.value};return"top"===t.align||"bottom"===t.align?(i.x=e.start*t.innerRect.width+(t.innerRect.x-t.outerRect.x)+IA(t,!1),i.y="top"===t.align?t.innerRect.height:0,i.anchor=t.stepSize?"start":"middle",i.x+=isNaN(t.style.offset)?0:+t.style.offset):(i.y=e.start*t.innerRect.height+(t.innerRect.y-t.outerRect.y)+IA(t,!0),i.x="left"===t.align?t.innerRect.width:0,i.anchor="left"===t.align?"end":"start",i.baseline=t.stepSize?"text-before-edge":"central",i.y+=isNaN(t.style.offset)?0:+t.style.offset),function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(i,t),function(e,t){if(!t.tilted&&!t.stepSize)if("top"===t.align||"bottom"===t.align){const n=0,r=t.outerRect.width,i=Math.min(t.maxWidth/2,t.textRect.width/2),o=e.x-i,a=e.x+i;o<n?(e.anchor="start",e.x=t.innerRect.x-t.outerRect.x):a>r&&(e.anchor="end",e.x=t.innerRect.width+t.innerRect.x)}else{const n=0,r=t.outerRect.height,i=t.maxHeight/2,o=e.y-i,a=e.y+i;o<n?(e.y=t.innerRect.y-t.outerRect.y,e.baseline="text-before-edge"):a>r&&(e.y=t.innerRect.height+(t.innerRect.y-t.outerRect.y),e.baseline="text-after-edge")}}(i,t),function(e,t){"top"===t.align?e.y-=t.padding:"bottom"===t.align?e.y+=t.padding+t.maxHeight:"left"===t.align?e.x-=t.padding:"right"===t.align&&(e.x+=t.padding)}(i,t),function(e,t){if(t.tilted){const n=-t.angle,r=n*(Math.PI/180);"bottom"===t.align?(e.x-=t.maxHeight*Math.sin(r)/2,e.y-=t.maxHeight,e.y+=t.maxHeight*Math.cos(r)/2):e.x-=t.maxHeight*Math.sin(r)/3,e.transform="rotate(".concat(n,", ").concat(e.x,", ").concat(e.y,")"),e.anchor="bottom"===t.align==t.angle<0?"start":"end";const i=Math.cos(r)*t.maxWidth;if("bottom"===t.align==t.angle<0){const n=t.outerRect.width-t.paddingEnd;e.x+i>n&&(e.maxWidth=(n-e.x-10)/Math.cos(r))}else{const n=t.paddingEnd;e.x-i<n&&(e.maxWidth=(e.x-n-10)/Math.cos(r))}}}(i,t),function(e,t){e.boundingRect=t.textBounds(e)}(i,t),qA(e,i,t),i}function LA(e,t){const n={type:"line",x1:0,x2:0,y1:0,y2:0,collider:{type:null},tickValue:e.value};return"top"===t.align||"bottom"===t.align?(n.x1=n.x2=e.position*t.innerRect.width+(t.innerRect.x-t.outerRect.x),n.y1="top"===t.align?t.innerRect.height:0,n.y2="top"===t.align?n.y1-t.tickSize:n.y1+t.tickSize):(n.y1=n.y2=e.position*t.innerRect.height+(t.innerRect.y-t.outerRect.y),n.x1="left"===t.align?t.innerRect.width:0,n.x2="left"===t.align?n.x1-t.tickSize:n.x1+t.tickSize),function(e,t){Dv(e,t.style)}(n,t),function(e,t){"top"===t.align?(e.y1-=t.padding,e.y2-=t.padding):"bottom"===t.align?(e.y1+=t.padding,e.y2+=t.padding):"left"===t.align?(e.x1-=t.padding,e.x2-=t.padding):"right"===t.align&&(e.x1+=t.padding,e.x2+=t.padding)}(n,t),function(e,t){const n=e.strokeWidth/2;e.x1===t.innerRect.width?(e.x1-=n,e.x2-=n):0===e.x1?(e.x1+=n,e.x2+=n):e.y1===t.innerRect.height?(e.y1-=n,e.y2-=n):0===e.y1&&(e.y1+=n,e.y2+=n)}(n,t),n}function _A(e){return!e.isMinor&&e.position>=0&&e.position<=1}function PA(e){let t=e.rect,n=e.state,r=e.majorTicks,i=e.measure;return e.horizontal?function(e){let t=e.majorTicks,n=e.measureText,r=e.rect;const i="layered"===e.state.labels.activeMode?2:1,o=r.width,a=t.map(e=>e.label).map(e=>"".concat(e.slice(0,1)).concat(e.length>1?"…":"")).map(n).map(e=>e.width);for(let e=0;e<t.length;++e){const n=t[e];if(i*o*Math.abs(n.start-n.end)<a[e])return!0}return!1}({majorTicks:r,measureText:i,rect:t,state:n}):function(e){let t=e.majorTicks,n=e.measureText;const r=e.rect.height,i=n("M").height;return!(t.length<2)&&r*Math.abs(t[0].position-t[1].position)<i}({majorTicks:r,measureText:i,rect:t})}function zA(e){let t=e.value,n=e.maxValue,r=e.minValue,i=e.range,o=e.modifier;return isNaN(i)||isNaN(o)||(t=i*o),t>n&&(t=n),t<r&&(t=r),t}function FA(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=e.state,l=0;const c={left:0,top:0,right:0,bottom:0},u=a.labels,d=u.maxLengthPx,f=u.minLengthPx;if(a.labels.show){const e=a.align,u="top"===e||"bottom"===e,h=u?n.inner.width:n.inner.height,p=o.ticks({settings:a,distance:h,formatter:r}).filter(_A),m=e=>{const t=i({text:e,fontSize:a.labels.fontSize,fontFamily:a.labels.fontFamily});return t.width=zA({value:t.width,maxValue:d,minValue:f}),t};if(t&&u&&"auto"===a.labels.mode&&(!function(e){let t=e.majorTicks,n=e.measure,r=e.rect,i=e.state,o=e.settings;const a=o.labels.maxGlyphCount,s="layered"===i.labels.activeMode?2:1,l=o.labels.tiltThreshold?o.labels.tiltThreshold:.7,c=n("…").width,u=r.width;let d=0,f=0;if(isNaN(a))for(let e=0;e<t.length;e++){const r=t[e],i=r.label,o=n(i).width*(i.length>1?l:1);if(f=s*u*Math.abs(r.start-r.end),o+c>f)return!0}else{const e=t.reduce((e,t)=>Math.min(Math.abs(t.start-t.end),e),1/0);if(f=s*u*e,d=n("M").width*l*a,d+c>f)return!0}return!1}({majorTicks:p,measure:m,rect:n.inner,state:s,settings:a})?s.labels.activeMode="horizontal":s.labels.activeMode="tilted"),!a.labels.filterOverlapping&&"tilted"!==s.labels.activeMode&&PA({rect:n.inner,state:s,majorTicks:p,measure:m,horizontal:u})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}let g,y;if("tilted"===s.labels.activeMode){const e=Math.abs(a.labels.tiltAngle)*(Math.PI/180);g=t=>zA({value:t.width,maxValue:d,minValue:f})*Math.sin(e)+t.height*Math.cos(e)}else g=u?e=>e.height:e=>zA({value:e.width,maxValue:d,minValue:f});if(u&&"tilted"!==s.labels.activeMode)y=["M"];else if(isNaN(a.labels.maxGlyphCount))y=p.map(e=>e.label);else{let e="";for(let t=0;t<a.labels.maxGlyphCount;t++)e+="M";y=[e]}const v=y.map(m),b=v.map(g),x=Math.max(...b,0);if(l+=x,l+=a.labels.margin,"layered"===s.labels.activeMode&&(l*=2),"tilted"===s.labels.activeMode){const e="bottom"===a.align==a.labels.tiltAngle>=0,t=Math.abs(a.labels.tiltAngle)*(Math.PI/180),r=(x-m("M").height*Math.cos(t))/Math.sin(t),i=e=>Math.min(r,e.width)*Math.cos(t)+e.height,o=(t,r)=>{const i=p[r]?p[r].position:0;return e?t-i*n.inner.width:t-(1-i)*n.inner.width},s=Math.min(a.labels.maxEdgeBleed,Math.max(...v.map(i).map(o),0))+a.paddingEnd;if(c[e?"left":"right"]=s,!a.labels.filterOverlapping&&function(e){let t=e.majorTicks,n=e.measureText,r=e.rect,i=e.bleedSize,o=e.angle;if(t.length<2)return!1;if(0===o)return!0;const a=Math.abs(o),s=1/(Math.min(r.outer.width-i,r.inner.width)*Math.abs(t[0].position-t[1].position));return n("M").height>Math.sin(a*(Math.PI/180))/s}({majorTicks:p,measureText:m,rect:n,bleedSize:s,angle:a.labels.tiltAngle})){return{size:Math.max(n.outer.width,n.outer.height),isToLarge:!0}}}}return{size:l,edgeBleed:c}}const jA=(e,t,n)=>e.width*Math.abs(t.position-n.position);function $A(e){let t=e.layered,n=e.major,r=e.innerRect,i=e.outerRect,o=e.tick,a=e.index;const s=t?2:1,l=n[a-s],c=n[a+s],u=l?jA(r,o,l)/2-2:1/0,d=c?jA(r,o,c)/2-2:1/0;return n.length<2?r.width:l?c?2*Math.min(u,d):(e=>{let t=e.innerRect,n=e.outerRect,r=e.tick,i=e.prevWidth;const o=t.x-n.x,a=n.width-t.width-o,s=t.width-t.width*r.position+a,l=2*Math.min(i,s),c=1===r.position?t.width/2-2:0;return Math.max(i,l,c)})({innerRect:r,outerRect:i,tick:o,prevWidth:u}):(e=>{let t=e.innerRect,n=e.outerRect,r=e.tick,i=e.nextWidth;const o=t.x-n.x,a=t.width*r.position+o,s=2*Math.min(i,a),l=0===r.position?t.width/2-2:0;return Math.max(i,s,l)})({innerRect:r,outerRect:i,tick:o,nextWidth:d})}function BA(e){const t=e.innerRect,n={cx:t.width/2,cy:t.height/2},r=Math.min(t.height,t.width)/2*e.radius,i=r+e.style.strokeWidth,o={visible:!0,type:"path",arcDatum:{startAngle:e.startAngle,endAngle:e.endAngle},transform:"translate(0, 0) translate(".concat(n.cx,", ").concat(n.cy,")"),desc:{share:1,slice:{cornerRadius:0,innerRadius:r,outerRadius:i}},ticks:[]};return function(e,t){Dv(e,t.style)}(o,e),o}function VA(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}function HA(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o;let c=a-e.position*l;c-=Math.PI/2;const u=VA(r.cx,r.cy,i+s,c),d=VA(r.cx,r.cy,i,c),f={type:"line",x1:u.x,y1:u.y,x2:d.x,y2:d.y,value:e.value};return function(e,t){const n=Lv({},t.style);Dv(e,n)}(f,t),f}function UA(e){return"string"==typeof e||"number"==typeof e?e:"-"}function WA(e,t,n){let r;return r="left"===t?n.x:"right"===t?e.outerRect.width-n.x:Math.max(n.x,e.outerRect.width-n.x),r}function YA(e,t){const n=t.innerRect,r={cx:n.width/2,cy:n.height/2},i=Math.min(n.height,n.width)/2*t.radius+t.padding,o=t.startAngle,a=t.endAngle,s=t.tickSize,l=a-o,c=.2;let u,d;u="top"===t.align||"bottom"===t.align?a-e.position*l:o+e.position*l,d=u<-.2&&u>-Math.PI+c?"left":u>.2&&u<Math.PI-c?"right":"center",u-=Math.PI/2;const f=function(e,t,n,r){return{x:e+n*Math.cos(r),y:t+n*Math.sin(r)}}(r.cx,r.cy,i+s+6,u);let h;h="left"===d?"end":"right"===d?"start":"middle";const p={type:"text",text:UA(e.label),align:d,x:f.x,y:f.y,maxHeight:t.maxHeight,maxWidth:WA(t,d,f),anchor:h,baseline:"middle"};return function(e,t){["fill","fontSize","fontFamily"].forEach(n=>{e[n]=t.style[n]})}(p,t),function(e,t){e.boundingRect=t.textBounds(e)}(p,t),function(e,t,n){let r,i;const o=parseFloat(n.fontSize)||0;r=t.y-o/2,i=e.innerRect.height-(t.y+o/2),(r<0||i<0)&&(n.text="")}(t,f,p),p}function KA(e){let t=0;return t+=e.paddingStart,t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function GA(e){let t=0;return t+=e.line.show?e.line.strokeWidth/2:0,t+=e.ticks.show?e.ticks.margin:0,t}function XA(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=KA(e)+e.labels.margin,t}function JA(e,t){return e.map(e=>LA(e,t))}function ZA(e,t){return t?Math.abs(t.end-t.start):e.bandwidth()}function QA(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.scale,o=e.tilted,a=e.layered,s=e.tick;const l=t.height,c=ZA(i,s),u={width:0,height:l};if("left"===n.align||"right"===n.align)u.width=r.width-XA(n)-n.paddingEnd;else if(a)u.width=c*r.width*2;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);u.width=(r.height-XA(n)-n.paddingEnd-l*Math.cos(e))/Math.sin(e)}else u.width=c*r.width;return u.width=zA({value:u.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),u}function eO(e){let t=e.textMetrics,n=e.settings,r=e.innerRect,i=e.outerRect,o=e.tilted,a=e.layered,s=e.tick,l=e.index,c=e.major;const u=t.height,d={width:0,height:u};if("left"===n.align||"right"===n.align)d.width=r.width-XA(n)-n.paddingEnd;else if(o){const e=Math.abs(n.labels.tiltAngle)*(Math.PI/180);d.width=(r.height-XA(n)-n.paddingEnd-u*Math.cos(e))/Math.sin(e)}else d.width=$A({layered:a,major:c,innerRect:r,outerRect:i,tick:s,index:l});return d.width=zA({value:d.width,maxValue:n.labels.maxLengthPx,minValue:n.labels.minLengthPx}),d}function tO(e){let t;function n(){return t=eO,n}function r(){return t=QA,r}function i(e){let n=e.settings,r=e.scale,i=e.innerRect,o=e.outerRect,a=e.measureText,s=e.ticks,l=e.state,c=e.textBounds;const u=[],d=function(e){return e.filter(e=>!e.isMinor)}(s),f=function(e){return e.filter(e=>e.isMinor)}(s),h={innerRect:i,align:n.align,outerRect:o},p="tilted"===l.labels.activeMode,m="layered"===l.labels.activeMode;let g;if(n.arc&&(h.startAngle=n.arc.startAngle,h.endAngle=n.arc.endAngle,h.radius=n.arc.radius),n.line.show&&(h.style=n.line,h.padding=n.paddingStart,n.arc?u.push(BA(h)):u.push(DA(h))),n.ticks.show&&(h.style=n.ticks,h.tickSize=n.ticks.tickSize,h.padding=KA(n),n.arc?(h.padding=GA(n),g=function(e,t){return e.map(e=>HA(e,t))}(d,h)):g=JA(d,h)),n.labels.show){const e=XA(n);h.style=n.labels,h.padding=e,h.tilted=p,h.layered=m,h.angle=n.labels.tiltAngle,h.paddingEnd=n.paddingEnd,h.textBounds=c;const s=(e,s)=>{h.textRect=function(e){let t=e.style;return(0,e.measureText)({text:e.tick.label,fontSize:t.fontSize,fontFamily:t.fontFamily})}({tick:e,measureText:a,style:h.style});const l=t({textMetrics:h.textRect,settings:n,innerRect:i,outerRect:o,scale:r,tilted:p,layered:m,tick:e,major:d,index:s});h.maxWidth=l.width,h.maxHeight=l.height,h.stepSize=function(e){let t=e.innerRect,n=e.scale,r=e.settings,i=e.tick;return("top"===r.align||"bottom"===r.align?t.width:t.height)*ZA(n,i)}({innerRect:i,scale:r,settings:n,tick:e})};let l=[];n.arc?(h.padding=function(e){let t=0;return t+=e.ticks.show?e.ticks.tickSize:0,t+=GA(e)+e.labels.margin,t}(n),l=function(e,t,n){return e.map((e,r)=>{n(e,r);const i=YA(e,t);return i.data=e.data,i})}(d,h,s)):l=!m||"top"!==n.align&&"bottom"!==n.align?function(e,t,n){return e.map((e,r)=>{n(e,r);const i=RA(e,t);return i.data=e.data,i})}(d,h,s):function(e,t,n,r){const i=t.padding,o=XA(n);return e.map((e,a)=>{r(e,a);const s=o+t.maxHeight+n.labels.margin;t.layer=a%2,t.padding=a%2==0?i:s;const l=RA(e,t);return l.data=e.data,l})}(d,h,n,s),n.labels.filterOverlapping&&function(e,t,n){let r=(t,n)=>Qk(Wv(1,e[t].boundingRect),Wv(1,e[n].boundingRect));if(n&&n.tilted){const t=Math.abs(n.angle);r=(n,r)=>{const i=1/Math.abs(e[n].x-e[r].x),o=Math.sin(t*(Math.PI/180))/i;return e[n].boundingRect.height>o}}for(let n=0;n<=e.length-1;n++)for(let i=n+1;i<=Math.min(n+5,n+(e.length-1));i++)e[n]&&e[i]&&r(n,i)&&(i===e.length-1?(e.splice(n,1),t&&t.splice(n,1)):(e.splice(i,1),t&&t.splice(i,1)),i--,n--)}(l,g,h),u.push(...l)}return n.minorTicks&&n.minorTicks.show&&f.length>0&&(h.style=n.minorTicks,h.tickSize=n.minorTicks.tickSize,h.padding=function(e){return e.line.strokeWidth+e.minorTicks.margin}(n),u.push(...JA(f,h))),g&&u.push(...g),u}return n.build=i,r.build=i,e?r():n()}const nO={labels:{show:!0,tiltAngle:40,tiltThreshold:.7,maxEdgeBleed:1/0,margin:4,maxLengthPx:150,minLengthPx:0,mode:"auto",maxGlyphCount:NaN,align:.5,offset:0,filterOverlapping:!1},ticks:{show:!1,margin:0,tickSize:4},line:{show:!1},paddingStart:0,paddingEnd:10,align:"auto"},rO={labels:{show:!0,margin:4,maxLengthPx:150,minLengthPx:0,align:.5,offset:0,filterOverlapping:!0,centerEndLabels:!1},ticks:{show:!0,margin:0,tickSize:8},minorTicks:{show:!1,tickSize:3,margin:0},line:{show:!0},paddingStart:0,paddingEnd:10,align:"auto"};const iO={require:["chart","renderer","dockConfig"],defaultSettings:{layout:{displayOrder:0,prioOrder:0},settings:{},style:{labels:"$label",ticks:"$guide-line",minorTicks:"$guide-line--minor",line:"$guide-line"}},created(){this.state={isDiscrete:!!this.scale.bandwidth,isHorizontal:!1,labels:{activeMode:"horizontal"},ticks:[],innerRect:{width:0,height:0,x:0,y:0},outerRect:{width:0,height:0,x:0,y:0},defaultDock:void 0,concreteNodeBuilder:void 0,settings:void 0},this.state.isDiscrete?this.state.defaultDock="bottom":this.state.defaultDock="left",this.setState(this.settings)},setState(){this.state.isDiscrete=!!this.scale.bandwidth,this.state.settings=function(e){let t=e.state,n=e.style,r=e.settings;const i=Dv(!0,{},t.isDiscrete?nO:rO,n),o=Dv(!0,{},i,r.settings),a=r.layout.dock||t.defaultDock;o.dock=a,o.align=function(e,t){const n=["top","bottom"],r=["left","right"];return-1!==n.indexOf(e)&&-1===r.indexOf(t)||-1!==r.indexOf(e)&&-1===n.indexOf(t)?e:t}(r.settings.align,a),o.labels.tiltAngle=Math.max(-90,Math.min(o.labels.tiltAngle,90));const s=o.paddingStart,l=o.paddingEnd;return o.paddingStart="function"==typeof s?s.call(null):s,o.paddingEnd="function"==typeof l?l.call(null):l,o}(this),this.state.concreteNodeBuilder=tO(this.state.isDiscrete),this.dockConfig.dock(this.state.settings.dock),this.state.isHorizontal="top"===this.state.settings.align||"bottom"===this.state.settings.align,this.state.labels.activeMode=function(e,t,n){const r=t.labels.mode;return n&&e.isHorizontal?"auto"===r?e.labels.activeMode:-1!==["layered","tilted"].indexOf(t.labels.mode)&&-1!==["top","bottom"].indexOf(t.dock)?r:"horizontal":"horizontal"}(this.state,this.state.settings,this.state.isDiscrete)},preferredSize(e){const t=this.formatter,n=this.state,r=this.scale,i=this.state.isHorizontal?e.inner.width:e.inner.height;this.state.pxScale=ik(r,i);const o=function(e){let t=e.isDiscrete,n=e.rect,r=e.formatter,i=e.measureText,o=e.scale,a=e.settings,s=0;const l=FA({isDiscrete:t,rect:n,formatter:r,measureText:i,scale:o,settings:a,state:e.state}),c=l.size,u=l.edgeBleed;if(s+=c,l.isToLarge)return{size:s};if(a.ticks.show&&(s+=a.ticks.margin,s+=a.ticks.tickSize),a.minorTicks&&a.minorTicks.show){const e=a.minorTicks.margin+a.minorTicks.tickSize;e>s&&(s=e)}if(a.line.show){const e=a.line.strokeWidth/2;s+=e,u[function(e){switch(e){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left";default:return e}}(a.align)]=Math.ceil(e)}return s+=a.paddingStart,s+=a.paddingEnd,{size:s,edgeBleed:u}}({isDiscrete:this.state.isDiscrete,rect:{inner:e.inner,outer:e.outer},formatter:t,measureText:this.renderer.measureText,scale:this.state.pxScale,settings:this.state.settings,state:n});return o},beforeUpdate(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).settings;this.setState(e)},resize(e){const t=e.inner,n=e.outer,r=Dv({},t,function(e){let t=e.align,n=e.inner;return"left"===t?{x:n.width+n.x}:"right"===t||"bottom"===t?n:{y:n.y+n.height}}({align:this.state.settings.align,inner:t})),i=n||r;return Dv(this.state.innerRect,r),Dv(this.state.outerRect,i),n},beforeRender(){const e=this.scale,t=this.formatter,n=this.state.isHorizontal?this.state.innerRect.width:this.state.innerRect.height;this.state.pxScale=ik(e,n),this.state.ticks=this.state.pxScale.ticks({distance:n,formatter:t}).filter(e=>e.position>=0&&e.position<=1)},render(){const e=this.state,t=[];return t.push(...this.state.concreteNodeBuilder.build({settings:this.state.settings,scale:this.state.pxScale,innerRect:this.state.innerRect,outerRect:this.state.outerRect,measureText:this.renderer.measureText,textBounds:this.renderer.textBounds,ticks:this.state.ticks,state:e})),pA.multiple(t),t}};const oO={render:()=>[]};function aO(e,t,n){let r="";if("function"==typeof e)r=e();else if("string"==typeof e)r=e;else if(n){const e=(n.data().fields||[]).map(e=>e.title());r=e.join(t)}return r}function sO(e,t){let n="middle";return"left"===e?"top"===t?n="end":"bottom"===t&&(n="start"):"right"===e?"top"===t?n="start":"bottom"===t&&(n="end"):"left"===t?n="start":"right"===t&&(n="end"),n}const lO={require:["renderer","chart"],defaultSettings:{layout:{dock:"bottom",displayOrder:0,prioOrder:0},settings:{paddingStart:5,paddingEnd:5,paddingLeft:0,paddingRight:0,anchor:"center",join:", ",maxLengthPx:NaN},style:{text:"$title"}},created(){this.definitionSettings=this.settings.settings;const e=this.settings.text,t=this.definitionSettings.join;this.title=aO(e,t,this.scale)},preferredSize(){return this.renderer.measureText({text:this.title,fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily}).height+this.definitionSettings.paddingStart+this.definitionSettings.paddingEnd},render(){const e=this.title,t=this.definitionSettings,n=this.rect,r=[];return r.push(function(e){let t=e.title,n=e.definitionSettings,r=e.dock,i=e.rect,o=e.measureText,a=e.style;const s={type:"text",text:t,x:0,y:0,dx:0,dy:0,anchor:sO(r,n.anchor),baseline:"alphabetical",stroke:"transparent",strokeWidth:0,fontWeight:"normal"};Dv(s,a.text);const l=o(s);if("top"===r||"bottom"===r){let e=i.width/2;"left"===n.anchor?e=n.paddingLeft||0:"right"===n.anchor&&(e=i.width-(n.paddingRight||0)),s.x=e,s.y="top"===r?i.height-n.paddingStart:n.paddingStart+l.height,s.dy="top"===r?-l.height/6:-l.height/3,s.maxWidth=.8*i.width}else{let e=i.height/2;"top"===n.anchor?e=n.paddingStart:"bottom"===n.anchor&&(e=i.height-n.paddingStart),s.y=e,s.x="left"===r?i.width-n.paddingStart:n.paddingStart,s.dx="left"===r?-l.height/3:l.height/3;const t="left"===r?270:90;s.transform="rotate(".concat(t,", ").concat(s.x+s.dx,", ").concat(s.y+s.dy,")"),s.maxWidth=.8*i.height}return isNaN(n.maxLengthPx)||(s.maxWidth=Math.min(s.maxWidth,n.maxLengthPx)),s}({title:e,dock:this.settings.layout.dock,definitionSettings:t,rect:n,measureText:this.renderer.measureText,style:this.style})),r},beforeUpdate(e){e.settings&&(Dv(this.settings,e.settings),this.definitionSettings=e.settings.settings);const t=this.settings.text,n=this.definitionSettings.join;this.title=aO(t,n,this.scale)}};function cO(e,t){const n=e.settings.layout.dock,r=e.settings.settings.invert,i="top"===n||"bottom"===n,o=i?"width":"height",a=e.rect[o],s=e.chart.scroll(e.settings.scroll);let l;{let e=t[i?"x":"y"];r&&(e=a-e);const n=s.getState();l={startOffset:e,startScroll:n.start,swipe:!1};const o=e/a*(n.max-n.min)+n.min;o<n.start?l.startScroll=o:o>n.start+n.viewSize&&(l.startScroll=o-n.viewSize)}return{update:e=>{let t=e[i?"x":"y"];if(r&&(t=a-t),!l.swipe){if(Math.abs(l.startOffset-t)<=1)return;l.swipe=!0}const n=s.getState(),o=(t-l.startOffset)/a*(n.max-n.min),c=l.startScroll+o;s.moveTo(c)},end:e=>{let t=e[i?"x":"y"];r&&(t=a-t);const n=s.getState();if(l.swipe){const e=(t-l.startOffset)/a*(n.max-n.min),r=l.startScroll+e;s.moveTo(r)}else{const e=t/a*(n.max-n.min)+n.min-n.viewSize/2;s.moveTo(e)}}}}function uO(e,t){const n=t.element().getBoundingClientRect();return{x:e.center.x-n.left,y:e.center.y-n.top}}const dO={require:["chart","renderer"],on:{panStart(e){const t=uO(e,this.renderer),n={x:t.x-e.deltaX,y:t.y-e.deltaY};this.currentMove=cO(this,n),this.currentMove.update(t)},panMove(e){if(!this.currentMove)return;const t=uO(e,this.renderer);this.currentMove.update(t)},panEnd(e){if(!this.currentMove)return;const t=uO(e,this.renderer);this.currentMove.end(t),this.currentMove=null},panCancel(){this.currentMove=null},tap(e){const t=uO(e,this.renderer);cO(this,t).end(t)}},defaultSettings:{settings:{backgroundColor:"#eee",thumbColor:"#ccc",width:16}},preferredSize:function(e){const t=this.chart.scroll(this.settings.scroll).getState();if(t.viewSize>=t.max-t.min){return Math.max(e.width,e.height)}return this.settings.settings.width},render:function(e){const t=this.settings.layout.dock,n=this.settings.settings.invert,r="top"===t||"bottom"===t,i=r?"width":"height",o=this.rect[i],a=this.chart.scroll(this.settings.scroll).getState();let s=o*(a.start-a.min)/(a.max-a.min);const l=o*a.viewSize/(a.max-a.min);return n&&(s=o-s-l),e("div",{style:{position:"relative",width:"100%",height:"100%",background:this.settings.settings.backgroundColor,pointerEvents:"auto"}},[].concat(e("div",{class:"scroller",style:{position:"absolute",[r?"left":"top"]:"".concat(s,"px"),[r?"top":"left"]:"25%",[r?"height":"width"]:"50%",[i]:"".concat(Math.max(1,l),"px"),background:this.settings.settings.thumbColor}})))},renderer:"dom"};function fO(e){let t=e.h,n=e.isVertical,r=e.value,i=e.pos,o=e.align,a=e.borderHit,s=e.state,l=e.idx;const c="end"!==o,u=c?{left:"0",top:"0"}:{right:"0",bottom:"0"};let d=0,f="100%",h="100%";return s.targetRect&&"start"===s.settings.bubbles.align?(f="".concat(s.targetRect.x+s.targetRect.width,"px"),h="".concat(s.targetRect.y+s.targetRect.height,"px")):s.targetRect&&"end"===s.settings.bubbles.align&&(d=n?s.targetRect.x:s.targetRect.y,f="".concat(s.rect.width-d,"px"),h="".concat(s.rect.height-d,"px")),c||(i-=a),t("div",{onmouseover(e){e.srcElement.children[0].style.backgroundColor="#000",e.srcElement.children[0].style[n?"height":"width"]="2px"},onmouseout(e){e.srcElement.children[0].style.backgroundColor=s.style.line.stroke,e.srcElement.children[0].style[n?"height":"width"]="1px"},"data-value":r,"data-key":[s.key,"edge",l].join("-"),style:{cursor:n?"ns-resize":"ew-resize",position:"absolute",left:"".concat(n?d:i,"px"),top:"".concat(n?i:d,"px"),height:n?"".concat(a,"px"):h,width:n?f:"".concat(a,"px"),pointerEvents:"auto"}},[t("div",{style:Dv({backgroundColor:s.style.line.stroke,position:"absolute",height:n?"".concat(1,"px"):"100%",width:n?"100%":"".concat(1,"px"),pointerEvents:"none"},u)})])}function hO(e){let t=e.h,n=e.isVertical,r=e.label,i=e.otherValue,o=e.rangeIdx,a=e.idx,s=e.pos,l=e.align,c=e.state,u=e.value;const d="end"!==l,f="outside"===c.settings.bubbles.placement;let h,p="none";n?(h=d?"left":"right",f&&(p=d?"translate(-100%,  0px)":"translate(100%,  0px)")):(h=d?"top":"bottom",f&&(p=d?"translate(0px, -100%)":"translate(0px,  100%)"));let m=c.edit&&c.edit.rangeIdx===o&&c.edit.bubbleIdx===a;const g={position:"relative",borderRadius:"".concat(c.style.bubble.borderRadius,"px"),border:"".concat(c.style.bubble.strokeWidth,"px solid ").concat(c.style.bubble.stroke),backgroundColor:c.style.bubble.fill,color:c.style.bubble.color,fontFamily:c.style.bubble.fontFamily,fontSize:c.style.bubble.fontSize,padding:"4px 8px",textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"150px",minWidth:"50px",minHeight:"1em",pointerEvents:"auto",transform:n?"translate(0,-50%)":"translate(-50%,0)",cursor:n?"ns-resize":"ew-resize"};let y=c.style.bubble.stroke;const v=m?t("input",{type:"text",value:u,style:Lv(Lv({},g),{},{textAlign:"start",textOverflow:"",fontSize:"13px"}),onkeyup(e){if("Enter"===e.key){e.preventDefault(),e.stopPropagation();const t=parseFloat(e.target.value);isNaN(t)?(y="rgba(230, 78, 78, 0.6)",e.target.style.border="".concat(c.style.bubble.strokeWidth,"px solid ").concat(y)):c.onEditConfirmed(o,t,i)}else"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c.onEditCanceled())}}):t("div",{"data-key":[c.key,"bubble",o,a].join("-"),"data-other-value":i,"data-idx":o,"data-bidx":a,style:g},[r]);return t("div",{style:{position:"absolute",[h]:"0",[n?"top":"left"]:"".concat(s,"px"),transform:p}},[v])}function pO(e){let t=e.h,n=e.isVertical,r=e.top,i=e.height,o=e.color,a=e.on,s=e.opacity;return t("div",Dv({style:{backgroundColor:o,opacity:s,position:"absolute",left:n?0:"".concat(r,"px"),top:n?"".concat(r,"px"):0,height:n?"".concat(i,"px"):"100%",width:n?"100%":"".concat(i,"px"),pointerEvents:"auto"}},a),[])}function mO(e){let t=e.borderHit,n=e.els,r=e.isVertical,i=e.state,o=e.vStart,a=e.vEnd,s=e.idx,l=0;i.targetRect&&(l=r?i.targetRect.y:i.targetRect.x);const c=!!i.scale,u=c?i.scale.norm(o)*i.size:o,d=c?i.scale.norm(a)*i.size:a,f=Math.abs(u-d),h=Math.min(u,d)+l,p=h+f;if(i.targetRect){const e=i.targetFillRect||i.targetRect,t=r?e.height:e.width,s=c?i.scale.norm(o)*t:o,l=c?i.scale.norm(a)*t:a,u=Math.abs(s-l),d=Math.min(s,l),f={h:i.h,isVertical:r,top:d,height:u,color:i.style.target.fill,opacity:i.style.target.opacity};i.style.target.opacity<.8&&(f.on={onmouseover(e){e.srcElement.style.opacity=i.style.target.opacity+.1},onmouseout(e){e.srcElement.style.opacity=i.style.target.opacity}}),n.push(i.h("div",{style:{position:"absolute",left:"".concat(e.x,"px"),top:"".concat(e.y,"px"),height:"".concat(e.height,"px"),width:"".concat(e.width,"px")}},[pO(f)]))}const m=u<d?o:a,g=u<d?a:o,y=_v(c?i.scale.domain():[Math.min(o,a),Math.max(o,a)],2),v=y[0],b=y[1],x=m+1e-5>=v&&m-1e-5<=b,S=g-1e-5<=b&&g+1e-5>=v;x&&n.push(fO({h:i.h,isVertical:r,borderHit:t,value:m,pos:h,align:"start",state:i,idx:s})),S&&n.push(fO({h:i.h,isVertical:r,borderHit:t,value:g,pos:p,align:"end",state:i,idx:s}));const M=i.settings.bubbles;if(M&&M.show){M.fontSize,M.fontFamily,M.fill;const e=[o,a];x&&n.push(hO({h:i.h,isVertical:r,align:M.align,rangeIdx:s,idx:0,otherValue:g,value:m,label:"".concat(i.format(m,e)),pos:h,state:i})),S&&n.push(hO({h:i.h,isVertical:r,align:M.align,rangeIdx:s,idx:1,otherValue:m,value:g,label:"".concat(i.format(g,e)),pos:p,state:i}))}}function gO(e){const t=e.active.limitHigh-e.active.end,n=e.active.limitLow-e.active.start;let r=e.current-e.start;return r=r<0?Math.max(r,n):Math.min(r,t),r}function yO(e){let t=[];const n=0===e.direction;if(Array.isArray(e.ranges)&&e.ranges.forEach((r,i)=>{e.active&&i===e.active.idx||mO({borderHit:5,els:t,isVertical:n,state:e,vStart:Math.min(r.min,r.max),vEnd:Math.max(r.min,r.max),idx:i})}),e.active){let r=e.start,i=e.current;if(-1!==e.active.idx)if("foo"===e.active.mode)r=Math.min(e.active.start,e.active.end),i=Math.max(e.active.start,e.active.end);else if("modify"===e.active.mode)r=Math.min(e.start,e.current),i=Math.max(e.start,e.current);else{const t=gO(e);r=e.active.start+t,i=e.active.end+t}mO({borderHit:5,els:t,isVertical:n,state:e,vStart:r,vEnd:i,idx:e.active.idx})}return t}function vO(e){return{min:e.scale.min(),max:e.scale.max()}}function bO(e){return{min:0,max:e.direction?e.rect.width:e.rect.height}}function xO(e,t,n){let r,i,o=e.ranges,a=-1;for(r=0;r<o.length;r++){if(o[r].min<=t&&t<=o[r].max){a=r,n.min=r?o[r-1].max:n.min,n.max=r+1<o.length?o[r+1].min:n.max;break}if(t<o[r].min){n.max=o[r].min,n.min=r?o[r-1].max:n.min;break}}-1===a&&o.length&&r>=o.length&&(n.min=o[o.length-1].max),-1!==a&&(i={idx:a,start:o[a].min,end:o[a].max,limitLow:n.min,limitHigh:n.max,mode:"foo"}),e.active=i}function SO(e){e.renderer.render(yO(e))}function MO(e,t){if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map(e=>e.id()),i=t.brushes().filter(e=>"range"===e.type&&-1!==r.indexOf(e.id))[0];return i?i.brush.ranges():[]}function wO(e,t){let n,r=1/0;const i=t.domain(),o=t.bandwidth()/2;for(let a=0;a<i.length;++a){const s=Math.abs(e-o-t(i[a]));s<r&&(r=s,n=i[a])}return n}function EO(e,t){return Math.min(...e)<=Math.max(...t)&&Math.max(...e)>=Math.min(...t)}function kO(e){const t=e.reduce((e,t)=>(e.push(...Bv(t.bounds)),e),[]);return Vv(t)}const CO={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{rangeStart(e){this.start(e)},rangeMove(e){this.move(e)},rangeEnd(e){this.end(e)},rangeClear(e){this.clear(e)},bubbleStart(e){this.bubbleStart(e)}},created(){this.state={key:this.settings.key||"brush-range"}},beforeRender(e){this.state.rect=e.size.computedInner},renderRanges(){this.state.started||(this.state.ranges=MO(this.state,this.state.brushInstance),this.state.active=null,SO(this.state))},render(e){const t=this.settings.settings;this.state.direction="vertical"===t.direction?0:1;const n=this.renderer.element().getBoundingClientRect(),r=this.state.rect[0===this.state.direction?"height":"width"];let i=ik(this.chart.scale(t.scale),r);const o=function(e){const t={targetRect:null,targetFillRect:null,scale:null,size:null},n=e.settings.settings,r=n.target&&(n.target.components||(n.target.component?[n.target.component]:[])).map(t=>e.chart.component(t)).filter(e=>!!e&&!!e.rect),i=n.target&&n.target.selector?e.chart.findShapes(n.target.selector):[],o=n.target&&n.target.fillSelector?e.chart.findShapes(n.target.fillSelector):[];if(i.length>0){const r=kO(i);if(t.size=r[0===e.state.direction?"height":"width"],t.scale=ik(e.chart.scale(n.scale),t.size),t.targetRect=r,o.length>0){const e=kO(o);t.targetFillRect=e}}else if(r&&r.length>0){const n=r.slice(1).reduce((e,t)=>({x0:Math.min(e.x0,t.rect.computedInner.x),y0:Math.min(e.y0,t.rect.computedInner.y),x1:Math.max(e.x1,t.rect.computedInner.x+t.rect.computedInner.width),y1:Math.max(e.y1,t.rect.computedInner.y+t.rect.computedInner.height)}),{x0:r[0].rect.computedInner.x,y0:r[0].rect.computedInner.y,x1:r[0].rect.computedInner.x+r[0].rect.computedInner.width,y1:r[0].rect.computedInner.y+r[0].rect.computedInner.height});t.targetRect={x:n.x0-e.state.rect.x,y:n.y0-e.state.rect.y,width:n.x1-n.x0,height:n.y1-n.y0}}return t}(this);if(i=o.scale?o.scale:i,this.state.targetRect=o.targetRect,this.state.targetFillRect=o.targetFillRect,this.state.size=null===o.size?r:o.size,this.state.settings=t,this.state.style=this.style,this.state.offset=n,this.state.brush="object"==typeof t.brush?t.brush.context:t.brush,this.state.brushInstance=this.chart.brush(this.state.brush),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.onEditConfirmed=(e,t,n)=>{this.state.edit=null,function(e,t,n,r){let i=e.ranges.map(e=>({min:e.min,max:e.max}));const o=e.scale.min(),a=e.scale.max();i[t]={min:Math.max(o,Math.min(n,r)),max:Math.min(a,Math.max(n,r))},e.ranges[t]=Lv({},i[t]);const s=e.scale.data();s&&s.fields&&s.fields.forEach(t=>{e.fauxBrushInstance||e.brushInstance.setRange(t.id(),i)})}(this.state,e,t,n),this.emit("bubbleEnd"),SO(this.state)},this.state.onEditCanceled=()=>{this.state.edit=null,SO(this.state)},this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX"},this.state.format="function"==typeof t.bubbles.label&&((e,n)=>t.bubbles.label.call(void 0,{datum:e,data:n,scale:i,resources:{scale:this.chart.scale,formatter:this.chart.formatter}})),{}.hasOwnProperty.call(i,"norm")){this.state.editable=!0,this.state.observeBrush="object"==typeof t.brush&&t.brush.observe,this.state.fauxBrushInstance=null,this.state.findValues=null,this.state.scale=i;const e=this.state.scale.data();!this.state.format&&e&&e.fields&&e.fields[0]&&(this.state.format=e.fields[0].formatter())}else this.state.editable=!1,this.state.scale=sE(),this.state.scale.data=i.data,this.state.format||(this.state.format=(e,t)=>EO(i.range(),t)?function(e,t){const n=t.ticks(),r=t.domain().indexOf(wO(e,t));return-1!==r?n[r].label:"-"}(e,i):"-"),this.state.fauxBrushInstance=UE(),this.state.findValues=e=>function(e,t){const n=t.domain(),r=t.range(),i=[];return e.forEach(e=>{if(!EO(r,[e.min,e.max]))return;const o=n.indexOf(wO(e.min,t)),a=n.indexOf(wO(e.max,t));i.push.apply(i,n.slice(Math.min(o,a),Math.max(o,a)+1))}),i}(e,i);return this.state.ranges=MO(this.state,this.state.brushInstance),this.state.observeBrush||this.state.sourcedFromThisComponent?[yO(this.state)]:[]},mounted(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.on("update",this.renderRanges)},beforeDestroy(){this.state.observeBrush&&this.state.brushInstance&&this.state.brushInstance.removeListener("update",this.renderRanges)},start(e){!function(e){let t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(t.started)return;t.edit=null;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=Dv({},r.element().getBoundingClientRect());const u=a-t.offset.left,d=s-t.offset.top;t.offset.left+=t.targetRect?t.targetRect.x:0,t.offset.top+=t.targetRect?t.targetRect.y:0,t.ranges=i(t,t.fauxBrushInstance||t.brushInstance);const f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];c.current=t.scale.normInvert(h/t.size),c.start=t.scale.normInvert(f/t.size);let p=t.ranges;const m=vO(t);let g,y,v=-1;if(l&&l.hasAttribute("data-idx"))v=parseInt(l.getAttribute("data-idx"),10),m.min=v>0?p[v-1].max:m.min,m.max=v+1<p.length?p[v+1].min:m.max;else{for(g=0;g<p.length;g++){if(p[g].min<=c.start&&c.start<=p[g].max){v=g,m.min=g?p[g-1].max:m.min,m.max=g+1<p.length?p[g+1].min:m.max;break}if(c.start<p[g].min){m.max=p[g].min,m.min=g?p[g-1].max:m.min;break}}-1===v&&p.length&&g>=p.length&&(m.min=p[p.length-1].max)}if(-1!==v||t.multi||(c.ranges=[],m.min=t.scale.min(),m.max=t.scale.max()),-1!==v)if(y={idx:v,start:p[v].min,end:p[v].max,limitLow:m.min,limitHigh:m.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),y.mode="modify";else{let e=t.scale.norm(y.start)*t.size,n=t.scale.norm(y.end)*t.size;Math.abs(f-e)<=o?(c.start=y.end,y.mode="modify"):Math.abs(f-n)<=o&&(c.start=y.start,y.mode="modify")}else y={idx:-1,start:c.start,end:c.current,limitLow:m.min,limitHigh:m.max,mode:"current"};c.active=y,"modify"!==y.mode&&t.targetRect&&!tC(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:MO,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e,e.fauxBrushInstance||e.brushInstance);const n=vO(e);xO(e,e.current,n)}(this.state,MO),SO(this.state),this.state.sourcedFromThisComponent=!0,this.state.active=null)},move(e){this.state.started&&(!function(e,t){const n=(t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset])/e.size,r=e.scale.normInvert(n);e.current=Math.max(Math.min(r,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){let t=e.ranges.map(e=>({min:e.min,max:e.max}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=gO(e);t[e.active.idx].min+=n,t[e.active.idx].max+=n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});const n=e.scale.data();n&&n.fields&&n.fields.forEach(n=>{if(e.fauxBrushInstance){let r=MO(e,e.fauxBrushInstance),i=e.findValues(r),o=e.findValues(t),a=o.filter(e=>-1===i.indexOf(e)),s=i.filter(e=>-1===o.indexOf(e)),l=a.map(e=>({key:n.id(),value:e})),c=s.map(e=>({key:n.id(),value:e}));e.brushInstance.addAndRemoveValues(l,c),e.fauxBrushInstance.setRange(n.id(),t)}else e.brushInstance.setRange(n.id(),t)})}(this.state),SO(this.state))},clear(){this.state.fauxBrushInstance&&this.state.fauxBrushInstance.clear(),this.state.renderer.render([]),this.state.started=!1,this.state.active=null,this.state.sourcedFromThisComponent=!1},bubbleStart(e){if(!this.state.editable)return;const t=e.srcEvent||e,n=t.target,r={rangeIdx:parseInt(n.getAttribute("data-idx"),10),bubbleIdx:parseInt(n.getAttribute("data-bidx"),10)};if(isNaN(r.rangeIdx)||JSON.stringify(r)===JSON.stringify(this.state.edit))return;this.state.edit=r,t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();const i=n.parentNode;SO(this.state);const o=i.querySelector("input");o.focus(),o.select()}};function AO(e){e.renderer.render(yO(e))}function OO(e){return e.rc.ranges()}function NO(e,t){const n={x:e.direction?t.min+e.rect.x:e.rect.x,y:e.direction?e.rect.y:t.min+e.rect.y,width:e.direction?t.max-t.min:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:t.max-t.min};return e.chart.shapesAt(n,e.settings.brush)}const DO={require:["chart","settings","renderer"],defaultSettings:{settings:{bubbles:{show:!0,align:"start"}},style:{bubble:"$label-overlay",line:"$shape-guide--inverted",target:"$selection-area-target"}},renderer:"dom",on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaClear(e){this.clear(e)}},created(){this.state={key:this.settings.key||"brush-area-dir"}},render(e){this.state.rect=this.rect;const t=this.settings.settings,n="vertical"===t.direction?0:1,r=this.state.rect[0===n?"height":"width"],i=this.renderer.element().getBoundingClientRect(),o=(t.target?t.target.components||[t.target.component]:[]).map(e=>this.chart.component(e)).filter(e=>!!e&&!!e.rect),a=o[0]?o.slice(1).reduce((e,t)=>({x0:Math.min(e.x0,t.rect.x),y0:Math.min(e.y0,t.rect.y),x1:Math.max(e.x1,t.rect.x+t.rect.width),y1:Math.max(e.y1,t.rect.y+t.rect.height)}),{x0:o[0].rect.x,y0:o[0].rect.y,x1:o[0].rect.x+o[0].rect.width,y1:o[0].rect.y+o[0].rect.height}):null;return this.state.targetRect=a?{x:a.x0-this.rect.x,y:a.y0-this.rect.y,width:a.x1-a.x0,height:a.y1-a.y0}:null,this.state.style=this.style,this.state.chart=this.chart,this.state.direction=n,this.state.settings=t,this.state.offset=i,this.state.rc=IE(),this.state.renderer=this.renderer,this.state.multi=!!t.multiple,this.state.h=e,this.state.size=r,this.state.cssCoord={offset:0===this.state.direction?"top":"left",coord:0===this.state.direction?"y":"x",pos:0===this.state.direction?"deltaY":"deltaX",area:0===this.state.direction?"height":"width"},this.state.format=function(e,t){return function(e,t,n){const r=Math.min(...n),i=Math.max(...n),o={x:e.direction?r+e.rect.x:e.rect.x,y:e.direction?e.rect.y:r+e.rect.y,width:e.direction?i-r:e.rect.width+e.rect.x,height:e.direction?e.rect.height+e.rect.y:i-r},a=e.chart.shapesAt(o,e.settings.brush);if(0===a.length)return"-";const s=a.reduce((n,i)=>{const o=n.bounds,a=i.bounds;return t===r?o[e.cssCoord.coord]<=a[e.cssCoord.coord]?n:i:o[e.cssCoord.coord]+o[e.cssCoord.area]>=a[e.cssCoord.coord]+a[e.cssCoord.area]?n:i}),l=e.settings.brush.components.reduce((e,t)=>e.key===s.key?e:t);return"function"==typeof e.settings.bubbles.label?e.settings.bubbles.label(s.data):Array.isArray(l.data)&&l.data.length?s.data[l.data[0]].label:s.data&&s.data.label?s.data.label:"-"}(this,e,t)},[]},start(e){!function(e){let t=e.state,n=e.e,r=e.renderer,i=e.ranges,o=e.targetSize;if(t.started)return;const a=n.center.x-n.deltaX,s=n.center.y-n.deltaY;let l=document.elementFromPoint(a,s);r.element().contains(l)||(l=null);const c={started:!0};t.offset=r.element().getBoundingClientRect(),t.ranges=i(t);const u=a-t.offset.left,d=s-t.offset.top,f=n.center[t.cssCoord.coord]-n[t.cssCoord.pos]-t.offset[t.cssCoord.offset],h=n.center[t.cssCoord.coord]-t.offset[t.cssCoord.offset];let p=h,m=f;c.start=f,c.current=h;let g=t.ranges;const y=bO(t);let v,b,x=-1;if(l&&l.hasAttribute("data-idx"))x=parseInt(l.getAttribute("data-idx"),10),y.min=x>0?g[x-1].max:y.min,y.max=x+1<g.length?g[x+1].min:y.max;else{for(v=0;v<g.length;v++){if(g[v].min<=m&&m<=g[v].max){x=v,y.min=v?g[v-1].max:y.min,y.max=v+1<g.length?g[v+1].min:y.max;break}if(m<g[v].min){y.max=g[v].min,y.min=v?g[v-1].max:y.min;break}}-1===x&&g.length&&v>=g.length&&(y.min=g[g.length-1].max)}if(-1!==x||t.multi||(c.ranges=[],y.min=0,y.max=t.direction?t.rect.width:t.rect.height),-1!==x)if(b={idx:x,start:g[x].min,end:g[x].max,limitLow:y.min,limitHigh:y.max,mode:"move"},l&&l.hasAttribute("data-other-value"))c.start=parseFloat(l.getAttribute("data-other-value")),b.mode="modify";else{let e=b.start,t=b.end;Math.abs(f-e)<=o?(c.start=b.end,b.mode="modify"):Math.abs(f-t)<=o&&(c.start=b.start,b.mode="modify")}else b={idx:-1,start:m,end:p,limitLow:y.min,limitHigh:y.max,mode:"current"};c.active=b,"modify"!==b.mode&&t.targetRect&&!tC(t.targetRect,{x:u,y:d})||Object.keys(c).forEach(e=>t[e]=c[e])}({e:e,state:this.state,renderer:this.renderer,ranges:OO,targetSize:5})},end(){this.state.started&&(!function(e,t){e.started=!1,e.ranges=t(e);const n=bO(e);xO(e,e.current,n)}(this.state,OO),AO(this.state))},move(e){this.state.started&&(!function(e,t){const n=t.center[e.cssCoord.coord]-e.offset[e.cssCoord.offset];e.current=Math.max(Math.min(n,e.active.limitHigh),e.active.limitLow)}(this.state,e),function(e){const t=e.ranges.map(e=>({min:e.min,max:e.max}));if(-1!==e.active.idx)if("modify"===e.active.mode)t[e.active.idx].min=Math.min(e.start,e.current),t[e.active.idx].max=Math.max(e.start,e.current);else{const n=gO(e);t[e.active.idx].min=e.active.start+n,t[e.active.idx].max=e.active.end+n}else t.push({min:Math.min(e.start,e.current),max:Math.max(e.start,e.current)});e.rc.set(t);let n=[];t.forEach(t=>{n=[...n,...NO(e,t)]}),function(e,t){e.chart.brushFromShapes(t,e.settings.brush)}(e,n)}(this.state),AO(this.state))},clear(){this.state.rc&&this.state.rc.clear(),this.state.renderer.render([])}};function TO(e){const t="vertical"===e.direction,n=e.rect[t?"height":"width"],r=e.rect[t?"width":"height"];return function(e){const t=e.brush;if(!t||!t.isActive())return[];const n=e.scale.data(),r=(n&&n.fields||[]).map(e=>e.id()),i=t.brushes().filter(e=>"range"===e.type&&-1!==r.indexOf(e.id))[0];return i?i.brush.ranges():[]}(e).map(i=>{const o=e.scale(i.min)*n,a=e.scale(i.max)*n,s=Math.min(o,a),l=Math.abs(o-a);return{type:"rect",fill:e.fill,opacity:e.opacity,x:t?0:s,width:t?r:l,y:t?s:0,height:t?l:r}})}function qO(e,t,n,r){function i(){!function(e){e.renderer.render(TO(e))}(e)}function o(){!function(e){e.renderer.render(TO(e))}(e)}function a(){!function(e){e.renderer.render(TO(e))}(e)}e.brush=t,t&&(t.on("start",i),t.on("update",o),t.on("end",a),e.start=i,e.update=o,e.end=a,e.brush=t,e.scale=n,e.renderer=r)}function IO(e){e.brush&&(e.brush.removeListener("start",e.start),e.brush.removeListener("update",e.update),e.brush.removeListener("end",e.end)),e.start=void 0,e.update=void 0,e.end=void 0,e.brush=void 0,e.scale=void 0,e.renderer=void 0}const RO={require:["chart","settings","renderer"],defaultSettings:{settings:{}},preferredSize:()=>50,created(){this.state={}},render(){const e=this.settings.settings,t=this.chart.brush(e.brush),n=e.direction||"horizontal",r="horizontal"===n?this.rect.width:this.rect.height,i=ik(this.chart.scale(e.scale),r);return IO(this.state),qO(this.state,t,i,this.renderer),this.state.rect=this.rect,this.state.fill=e.fill||"#ccc",this.state.opacity=void 0!==e.opacity?e.opacity:1,this.state.direction=n,TO(this.state)},beforeDestroy(){IO(this.state)}};function LO(e,t){const n=t.center.x,r=t.center.y;return{x:n-e.left,y:r-e.top}}function _O(e,t,n){return Mk(e,t.points[0])<n.settings.snapIndicator.threshold**2}function PO(e,t){null==e.path.d?e.path.d="M".concat(t.x," ").concat(t.y," "):e.path.d+="L".concat(t.x," ").concat(t.y," "),e.points.push(t)}function zO(e){let t=e.state,n=e.start,r=void 0===n?null:n,i=e.end,o=void 0===i?null:i;null!==r&&(t.snapIndicator.x1=r.x,t.snapIndicator.y1=r.y),null!==o&&(t.snapIndicator.x2=o.x,t.snapIndicator.y2=o.y)}function FO(e,t){e.snapIndicator.visible=t}const jO={require:["chart","renderer","settings"],defaultSettings:{layout:{displayOrder:0},settings:{brush:{components:[]},snapIndicator:{threshold:75,strokeDasharray:"5, 5",stroke:"black",strokeWidth:2,opacity:.5},lasso:{fill:"transparent",stroke:"black",strokeWidth:2,opacity:.7,strokeDasharray:"20, 10"},startPoint:{r:10,fill:"green",stroke:"black",strokeWidth:1,opacity:1}}},on:{lassoStart(e){this.start(e)},lassoEnd(e){this.end(e)},lassoMove(e){this.move(e)},lassoCancel(){this.cancel()}},created(){this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}}},start(e){var t;this.state.active=!0,this.state.path={visible:!0,type:"path",d:null,fill:(t=this.settings.settings.lasso).fill,stroke:t.stroke,strokeWidth:t.strokeWidth,opacity:t.opacity,strokeDasharray:t.strokeDasharray,collider:{type:null}},this.state.snapIndicator=function(e){return{visible:!1,type:"line",x1:0,y1:0,x2:0,y2:0,strokeDasharray:e.strokeDasharray,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,collider:{type:null}}}(this.settings.settings.snapIndicator),this.state.startPoint=function(e){return{visible:!0,type:"circle",cx:0,cy:0,r:e.r,fill:e.fill,opacity:e.opacity,stroke:e.stroke,strokeWidth:e.strokeWidth,collider:{type:null}}}(this.settings.settings.startPoint),this.state.rendererBounds=this.renderer.element().getBoundingClientRect(),this.state.componentDelta=function(e,t){const n=e.element.getBoundingClientRect();return{x:t.left-n.left,y:t.top-n.top}}(this.chart,this.state.rendererBounds),this.state.brushConfig=this.settings.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts||["lassoBrush"],data:e.data||[""],action:e.action||"add"}));const n=LO(this.state.rendererBounds,e);PO(this.state,n),zO({state:this.state,start:n}),function(e,t){e.startPoint.cx=t.x,e.startPoint.cy=t.y}(this.state,n)},move(e){if(!this.state.active)return;const t=LO(this.state.rendererBounds,e);_O(t,this.state,this.settings)?FO(this.state,!0):FO(this.state,!1),PO(this.state,t),zO({state:this.state,end:t}),function(e,t){const n=[e.startPoint,e.path,e.snapIndicator].filter(e=>e.visible);t.render(n)}(this.state,this.renderer),function(e,t){if(e.active){const n=e.points[e.points.length-2],r=e.points[e.points.length-1];e.lineBrushShape.x1=n.x+e.componentDelta.x,e.lineBrushShape.y1=n.y+e.componentDelta.y,e.lineBrushShape.x2=r.x+e.componentDelta.x,e.lineBrushShape.y2=r.y+e.componentDelta.y;const i=t.shapesAt(e.lineBrushShape,{components:e.brushConfig});t.brushFromShapes(i,{components:e.brushConfig})}}(this.state,this.chart)},end(e){if(!this.state.active)return;FO(this.state,!1);_O(LO(this.state.rendererBounds,e),this.state,this.settings)&&function(e,t){if(e.active){const n=e.componentDelta.x,r=e.componentDelta.y,i=e.points.map(e=>({x:e.x+n,y:e.y+r})),o=t.shapesAt({vertices:i},{components:e.brushConfig});t.brushFromShapes(o,{components:e.brushConfig})}}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([])},cancel(){this.state.active&&(!function(e,t){e.brushConfig.forEach(e=>{e.contexts.forEach(e=>{t.brush(e).end()})})}(this.state,this.chart),this.state={points:[],active:!1,path:null,snapIndicator:null,startPoint:null,rendererBounds:null,componentDelta:null,brushConfig:null,lineBrushShape:{x1:0,y1:0,x2:0,y2:0}},this.renderer.render([]))},render(){}};function $O(e,t,n,r,i){let o,a=0,s=t.length-1;for(;a<s;){let l=Math.floor((a+s)/2);o=i(t[l]),o[n]+o[r]<e[n]?a=l+1:s=l}return a}function BO(e){let t=e.orientation,n=e.targetNodes,r=e.labels,i=e.container,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$O;const a=[],s="v"===t?"x":"y",l="v"===t?"width":"height",c=e=>e.textBounds,u=e=>e.node.localBounds;return(e,t)=>{const d=r[t],f=d.textBounds,h=d.node;if(f[s]<i[s]||f[s]+f[l]>i[s]+i[l])return!1;for(let e=o(f,a,s,l,c);e<a.length;e++)if(Qk(f,a[e].textBounds))return!1;const p=o(f,n,s,l,u),m=f[s]+f[l];for(let e=p;e<n.length;e++){const t=n[e].node;if(m<t.localBounds[s])break;if(Qk(f,t.localBounds)&&h!==t)return!1}return a.push(r[t]),!0}}function VO(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function HO(e){const t=typeof e;return("string"===t||"number"===t)&&""!==e}function UO(e){return Lv(Lv({type:"rect",rx:2,ry:2,fill:e.backgroundColor},e.backgroundBounds),{},{data:"".concat(e.data," ").concat(e.text),rotation:e.transform&&e.transform.match(/rotate/gi)?"rotated":"horizontal"})}function WO(e,t,n){return n?e.width>=t.height:e.width>=t.width}function YO(e,t,n){return n?e.height>=t.width:e.height>=t.height}function KO(e,t,n,r,i){let o,a;return"v"===e?(o=r||i||WO(t,n,!0),a=YO(t,n,!r)):(o=WO(t,n),a=i||YO(t,n,!1)),o&&a}function GO(e,t,n,r){return e+.5*t+(r-.5)*(t-n)-.5*n}function XO(e,t,n){const r={type:"text",text:t,maxWidth:n.rotate?e.height:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:n.rotate?"end":"start",baseline:"central",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(!n.overflow&&!function(e,t,n){return WO(e,t,n.rotate)&&YO(e,t,n.rotate)}(e,i,n))return!1;const o=.5*i.height;return n.rotate?(r.x=GO(e.x,e.width,i.height,n.align)+o,r.y=GO(e.y,e.height,i.width,n.justify),"right"===n.dock?r.transform="rotate(90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,") translate(").concat(i.width,", 0)"):r.transform="rotate(-90, ".concat(r.x+r.dx,", ").concat(r.y+r.dy,")")):(r.x=GO(e.x,e.width,i.width,n.align),r.y=GO(e.y,e.height,i.height,n.justify)+o),r}function JO(e){let t=e.bar,n=e.view,r=e.direction,i=e.position,o=e.padding,a=void 0===o?4:o,s=e.measured;const l={};if(Dv(l,t),i&&"inside"!==i)if("up"===r||"down"===r){const e=Math.max(0,Math.min(t.y,n.height)),o=Math.max(0,Math.min(t.y+t.height,n.height));"outside"===i&&"up"===r||"opposite"===i&&"down"===r?(l.y=0,l.height=e):("outside"===i&&"down"===r||"opposite"===i&&"up"===r)&&(l.y=o,l.height=n.height-o)}else{const e=Math.max(0,Math.min(t.x,n.width)),o=Math.max(0,Math.min(t.x+t.width,n.width));"outside"===i&&"left"===r||"opposite"===i&&"right"===r?(l.x=0,l.width=e):("outside"===i&&"right"===r||"opposite"===i&&"left"===r)&&(l.x=o,l.width=n.width-o)}else;return function(e,t){const n=Math.max(0,Math.min(e.y,t.height)),r=Math.max(0,Math.min(e.y+e.height,t.height)),i=Math.max(0,Math.min(e.x,t.width)),o=Math.max(0,Math.min(e.x+e.width,t.width));e.x=i,e.width=o-i,e.y=n,e.height=r-n}(l,n),function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=n.top,i=void 0===r?4:r,o=n.bottom,a=void 0===o?4:o,s=n.left,l=void 0===s?4:s,c=n.right,u=void 0===c?4:c,d="function"==typeof l?l(t):l,f="function"==typeof u?u(t):u,h="function"==typeof i?i(t):i,p="function"==typeof a?a(t):a;e.x+=d,e.width-=d+f,e.y+=h,e.height-=h+p}(l,s,a),l}function ZO(e){let t,n,r,i,o,a=e.direction,s=e.fitsHorizontally,l=e.measured,c=e.node,u=e.orientation,d=e.placementSettings,f=e.rect,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JO;const p=[],m="h"===u?"width":"height";for(o=0;o<d.length;o++)if(r=d[o],i=h({bar:c.localBounds,view:f,direction:a,position:r.position,padding:r.padding,measured:l}),p.push(i),t=!o||i[m]>t[m]?i:t,KO(u,i,l,s,r.overflow)){n=i;break}return n||(n=t,o=p.indexOf(n)),r=d[o],{bounds:n,placement:r}}function QO(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=i.top,a=void 0===o?4:o,s=i.bottom,l=void 0===s?4:s,c=i.left,u=void 0===c?4:c,d=i.right,f=void 0===d?4:d,h="function"==typeof u?u(t):u,p="function"==typeof f?f(t):f,m="function"==typeof a?a(t):a,g="function"==typeof l?l(t):l,y=e.x+e.dx,v=e.y+e.dy,b=n?Math.min(t.width,r.height):Math.min(t.height,r.width),x=n?Math.min(t.height,r.height):Math.min(t.width,r.width),S=.5*t.height,M=1e-9;return{x:(n?y-S:y)-h-M,y:(n?v:v-S)-m-M,width:x+(h+p)-M,height:b+(m+g)-M}}function eN(e){let t=e.chart,n=e.targetNodes,r=e.rect,i=e.fitsHorizontally,o=e.collectiveOrientation,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ZO,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:XO,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:BO;const c=[],u={container:r,targetNodes:n,labels:[],orientation:o};let d,f,h,p,m,g,y,v,b,x,S,M,w,E;for(let e=0,l=n.length;e<l;e++){g=null,f=n[e],h=f.node,w=VO(h,t),b=f.direction,E="left"===b||"right"===b?"h":"v";for(let t=0;t<f.texts.length;t++){if(p=f.texts[t],!HO(p))continue;x=f.labelSettings[t],v=f.measurements[t],M=x.placements;const n=a({direction:b,fitsHorizontally:i,lblStngs:x,measured:v,node:h,orientation:E,placements:M,placementSettings:f.placementSettings[t],rect:r});if(g=n.bounds,S=n.placement,g&&S){var k;m=S.justify;const t="function"==typeof x.linkData?x.linkData(w,e):void 0,n="function"==typeof S.overflow?S.overflow(w,e):S.overflow;"up"===b&&(m=1-m),"opposite"===S.position&&(m=1-m),"left"===b&&(m=1-m);const r=!("h"===o||i);if(d=s(g,p,{justify:"h"===E?S.align:m,align:"h"===E?m:S.align,fontSize:x.fontSize,fontFamily:x.fontFamily,textMetrics:v,rotate:r,overflow:!!n,dock:null!==(k=x.dock)&&void 0!==k?k:"left"}),d){const n=QO(d,v,r,g,S.padding);y="function"==typeof S.fill?S.fill(Lv(Lv({},w),{},{textBounds:n}),e):S.fill,d.fill=y,void 0!==t&&(d.data=t),"object"==typeof S.background&&(d.backgroundColor="function"==typeof S.background.fill?S.background.fill(Lv(Lv({},w),{},{textBounds:n}),e):S.background.fill,void 0!==d.backgroundColor&&(d.backgroundBounds=QO(d,v,r,g,S.background.padding))),c.push(d),u.labels.push({node:h,textBounds:n})}}}}const C=c.filter(l(u));return[...C.filter(e=>void 0!==e.backgroundBounds).map(UO),...C]}function tN(e){const t=2*Math.PI;return(e%t+t)%t}function nN(e,t){e.x+=t,e.width-=2*t,e.y+=t,e.height-=2*t}function rN(e){return{x:e.x,y:e.y-e.height/2,width:e.width,height:e.height}}function iN(e,t,n){let r=t.x,i=t.y;if(r*r+i*i>e*e)return null;let o=Math.sin(n),a=Math.cos(n),s=r*a-i*o,l=e*e-s*s;if(l<0)return null;let c=Math.sqrt(l);return{x:s*a+o*c,y:-s*o+a*c}}function oN(e){let t,n,r=e.radius,i=e.size,o=e.angle,a=i.width,s=i.height,l={x:a/2,y:s/2};switch(Math.floor(o/(Math.PI/2))){case 0:if(t=iN(r,l,o),!t)return null;t.y*=-1,n={x:-a,y:0};break;case 1:if(t=iN(r,l,Math.PI-o),!t)return null;n={x:-a,y:-s};break;case 2:if(t=iN(r,l,o-Math.PI),!t)return null;t.x*=-1,n={x:0,y:-s};break;case 3:if(t=iN(r,l,2*Math.PI-o),!t)return null;t.x*=-1,t.y*=-1,n={x:0,y:0};break;default:throw new Error("invalid angle")}return{x:t.x+n.x,y:t.y+n.y,width:a,height:s}}function aN(e){let t=e.slice,n=e.measured,r=e.padding,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius,l=s-a-2*r,c=o-i;if(c<Math.PI){let e=(n.height/2+r)/Math.tan(c/2);e>a&&(l=s-e-2*r)}if(l<0||l<n.minReqWidth)return null;const u=tN((i+o)/2);let d=s-r,f={x:Math.sin(u)*d,y:-Math.cos(u)*d,width:l,height:n.height};return u<Math.PI?(f.angle=u-Math.PI/2,f.anchor="end"):(f.angle=u+Math.PI/2,f.anchor="start"),f}function sN(e){let t=e.context,n=e.node,r=e.bounds;let i=n.desc.slice;const o=tN((i.start+i.end)/2);switch(Math.floor(o/(Math.PI/2))){case 0:t.q1maxY=r.y-2,void 0===t.q2minY&&(t.q2minY=r.y+r.height+2);break;case 1:t.q2minY=r.y+r.height+2;break;case 2:t.q3minY=r.y+r.height+2;break;case 3:t.q4maxY=r.y-2,void 0===t.q3minY&&(t.q3minY=r.y+r.height+2)}}function lN(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function cN(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:e.x,y:e.y+("top"===e.baseline?e.height/2:0),fill:n.fill,anchor:e.anchor||"start",baseline:"middle",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily};if(!isNaN(e.angle)){let t=e.angle*(360/(2*Math.PI));r.transform="rotate(".concat(t,", ").concat(r.x,", ").concat(r.y,")")}return r}function uN(e){let t,n,r=e.slice,i=e.direction,o=e.position,a=e.padding,s=e.measured,l=e.view,c=e.context,u=e.store,d=r.start,f=r.end,h=r.innerRadius,p=r.offset;switch(o){case"into":t="rotate"===i?aN({slice:r,measured:s,padding:a}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=t.start,o=t.end,a=t.innerRadius,s=t.outerRadius;const l=tN((i+o)/2);let c=oN({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",nC(c,{x1:0,y1:0,x2:Math.sin(i)*s,y2:-Math.cos(i)*s})||nC(c,{x1:0,y1:0,x2:Math.sin(o)*s,y2:-Math.cos(o)*s})||Yk({cx:0,cy:0,r:a},c)?null:(nN(c,n),c)):null}({slice:r,measured:s,padding:a});break;case"inside":n={start:d,end:f,innerRadius:0,outerRadius:h},t="rotate"===i?aN({slice:n,measured:s,padding:a}):function(e){let t=e.slice,n=e.padding,r=e.measured,i=e.store;const o=t.start,a=t.end,s=t.outerRadius,l=tN((o+a)/2);let c=oN({radius:s,size:{width:r.width+2*n+1,height:r.height+2*n},angle:l});return c?(c.baseline="top",nN(c,n),i.insideLabelBounds.some(e=>Qk(e,c))?null:(i.insideLabelBounds.push({x:c.x-4,y:c.y,width:c.width+8,height:c.height}),c)):null}({slice:n,measured:s,padding:a,store:u});break;case"outside":t="rotate"===i?function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=t.start,a=t.end,s=t.outerRadius,l=t.offset,c=s+r,u=a-o;if(u<Math.PI&&(n.height/2+r)/Math.tan(u/2)>c)return null;const d=tN((o+a)/2);let f=Math.sin(d)*c,h=-Math.cos(d)*c,p=n.width+1,m=d%Math.PI;if(m>Math.PI/2&&(m=Math.PI-m),Math.cos(m)>.001){let e=h<0?i.y:i.y+i.height,t=Math.abs(e-l.y)/Math.cos(m)-Math.tan(m)*(n.height/2)-2*r-s;t<p&&(p=t)}if(Math.sin(m)>.001){let e=f<0?i.x:i.x+i.width,t=Math.abs(e-l.x)/Math.sin(m)-n.height/2/Math.tan(m)-2*r-s;t<p&&(p=t)}if(p<=0||p<n.minReqWidth)return null;let g={x:f,y:h,width:p,height:n.height};return d<Math.PI?(g.angle=d-Math.PI/2,g.anchor="start"):(g.angle=d+Math.PI/2,g.anchor="end"),g}({slice:r,measured:s,padding:a,view:l}):function(e){let t=e.slice,n=e.measured,r=e.padding,i=e.view,o=e.context,a=t.start,s=t.end,l=t.outerRadius,c=t.offset;const u=tN((a+s)/2);if(function(e,t,n){switch(t){case 0:return e.q1maxY<0;case 1:return e.q2minY>n.height;case 2:return e.q3minY>n.height;case 3:return e.q4maxY<0;default:return!0}}(o,Math.floor(u/(Math.PI/2)),i))return null;let d=l+r+n.height/2,f=Math.sin(u)*d,h=-Math.cos(u)*d,p=n.width+1;if(u<Math.PI){let e=Math.abs(i.x+i.width-(f+c.x));e<p&&(p=e)}else{let e=Math.abs(i.x-(f+c.x));e<p&&(p=e)}if(p<n.minReqWidth)return null;let m={x:f,y:h,width:p,height:n.height};return u<Math.PI?m.anchor="start":m.anchor="end",m}({slice:r,measured:s,padding:a,view:l,context:c});break;default:throw new Error("not implemented")}return t&&(t.x+=p.x,t.y+=p.y,"outside"===o&&"rotate"!==i&&function(e,t,n){const r=n.start,i=n.end,o=n.offset,a=n.outerRadius,s=tN((r+i)/2);switch(Math.floor(s/(Math.PI/2))){case 0:if(void 0!==t.q1maxY){let n=Math.min(e.y,t.q1maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 1:if(void 0!==t.q2minY){let n=Math.max(e.y,t.q2minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x-2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 2:if(void 0!==t.q3minY){let n=Math.max(e.y,t.q3minY),r=n-e.y;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y-2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}break;case 3:if(void 0!==t.q4maxY){let n=Math.min(e.y,t.q4maxY-e.height),r=e.y-n;if(e.y=n,r>1){let t=a+2;e.line={type:"line",x1:e.x+2,y1:e.y+2,x2:o.x+Math.sin(s)*t,y2:o.y-Math.cos(s)*t,strokeWidth:1}}}}}(t,c,r)),t}function dN(e){let t=e.context,n=e.direction,r=e.measured,i=e.node,o=e.placementSettings,a=e.rect,s=e.store,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:uN;for(let e=0;e<o.length;e++){let c=o[e],u=l({context:t,slice:i.desc.slice,view:a,direction:n,position:c.position,measured:r,padding:c.padding,store:s});if(u)return{bounds:u,placement:c}}return{bounds:null,placement:null}}function fN(e,t,n){const r=t.fontFamily,i="".concat(t.fontSize,"px"),o=n.measureText({text:e,fontFamily:r,fontSize:i});return o.minReqWidth=Math.min(o.width,n.measureText({text:"".concat(e[0],"…"),fontFamily:r,fontSize:i}).width),o}const hN=/\n+|\r+|\r\n/,pN=/\s/,mN=/[a-zA-Z\u00C0-\u00F6\u00F8-\u00FF\u00AD]/;function gN(e){return"string"==typeof e?-1!==e.search(hN):-1!==String(e).search(hN)}function yN(e){return-1!==e.search(pN)}function vN(e){return-1!==e.search(mN)}function bN(e,t,n){return Math.max(t,Math.min(n,e))}function xN(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.string,n=e.separator,r=void 0===n?"":n,i=e.reverse,o=void 0!==i&&i,a=e.measureText,s=void 0===a?e=>({width:e.length,height:1}):a,l=e.mandatoryBreakIdentifiers,c=void 0===l?[gN]:l,u=e.noBreakAllowedIdentifiers,d=void 0===u?[]:u,f=e.suppressIdentifier,h=void 0===f?[yN,gN,e=>""===e]:f,p=e.hyphenationIdentifiers,m=void 0===p?[vN]:p;const g=String(t).split(r);!function(e){""===e[0]&&e.shift(),""===e[e.length-1]&&e.pop()}(g);const y=g.length,v=o?e=>e>=0:e=>e<y;let b=o?y:-1;function x(e){const t=bN(e,0,y-1),n=g[t],r=s(n),i=function(e,t,n,r,i){return r.some(r=>r(e,t,n))?1:i.some(r=>r(e,t,n))?0:2}(n,t,g,c,d);return{index:t,value:n,breakOpportunity:i,suppress:h.some(e=>e(n,t,g)),hyphenation:m.some(e=>e(n,t,g)),width:r.width,height:r.height,done:!1}}return{next:function(e){return isNaN(e)?o?b--:b++:b=bN(e,0,y-1),v(b)?x(b):{done:!0}},peek:x,length:y}}const SN="…",MN=/^\s*\d+(\.\d+)?px\s*$/i;function wN(e){return"string"===typeof e&&MN.test(e)}function EN(e){const t=e["font-size"]||e.fontSize;return wN(t)?parseFloat(t)*Math.max(isNaN(e.lineHeight)?1.2:e.lineHeight,0):19.2}function kN(e){const t=e.maxHeight,n=Math.max(e.maxLines,1)||1/0;if(isNaN(t))return n;const r=EN(e);return Math.max(1,Math.min(Math.floor(t/r),n))}function CN(e,t){return{lines:[],line:"",width:0,maxLines:kN(e),maxWidth:e.maxWidth,hyphens:{enabled:"auto"===e.hyphens,char:"‐",metrics:t("‐")}}}function AN(e){e.lines.push(e.line),e.line="",e.width=0}function ON(e,t){e.line+=t.value,e.width+=t.width}function NN(e,t,n){if(t.width>e.maxWidth)return t;const r=t.index;for(let i=1;i<5;i++){const o=n.peek(t.index-1);if(!t.hyphenation||!o.hyphenation||0===t.index)return t;if(e.width+e.hyphens.metrics.width<=e.maxWidth)return e.line+=e.hyphens.char,t;if(1===e.line.length)return t;t=n.next(r-i),e.line=e.line.slice(0,-1),e.width-=t.width}return t}function DN(e,t,n){const r=xN({string:t.value,measureText:n});for(;e.lines.length<e.maxLines;){let t=r.next();if(t.done)break;e.width+t.width>e.maxWidth&&2===t.breakOpportunity&&e.line.length>0?(t=e.hyphens.enabled?NN(e,t,r):t,AN(e),ON(e,t)):ON(e,t)}}function TN(e,t){const n=xN({string:e.text,separator:"",measureText:t,noBreakAllowedIdentifiers:[(e,t)=>0===t]}),r=CN(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){AN(r),i=!1;break}1===e.breakOpportunity?AN(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?r.width+=e.width:(e=r.hyphens.enabled?NN(r,e,n):e,AN(r),ON(r,e)):ON(r,e)}return{lines:r.lines,reduced:i}}function qN(e,t){const n=xN({string:e.text,separator:/(\s|-|\u2010)/,measureText:t}),r=CN(e,t);let i=!0;for(;r.lines.length<r.maxLines;){let e=n.next();if(e.done){AN(r),i=!1;break}1===e.breakOpportunity?AN(r):r.width+e.width>r.maxWidth&&2===e.breakOpportunity?e.suppress?AN(r):e.width>r.maxWidth?DN(r,e,t):(AN(r),ON(r,e)):ON(r,e)}return{lines:r.lines,reduced:i}}function IN(e){return{"break-all":TN,"break-word":qN}[e.wordBreak]}function RN(e){return t=>{const n=t.node;if(function(e){return"text"===e.type&&!e._lineBreak}(n)){const r=IN(n);if(!r)return;const i=e(n);if(i.width>n.maxWidth||gN(n.text)){const o=(EN(n)-i.height)/2,a=r(n,function(e,t){return n=>t({text:n,fontSize:e.fontSize,fontFamily:e.fontFamily})}(n,e));t.node=function(e,t,n,r){const i={type:"container",children:[]};void 0!==t.id&&(i.id=t.id);let o=0;return e.lines.forEach((a,s)=>{const l=Dv({},t);l.text=a,l._lineBreak=!0,o+=n,e.reduced&&s===e.lines.length-1?l.text+=SN:delete l.maxWidth,l.dy=isNaN(l.dy)?o:l.dy+o,o+=r,o+=n,i.children.push(l)}),i}(a,n,o,i.height)}}}}function LN(e,t){const n=e["font-family"]||e.fontFamily,r=e["font-size"]||e.fontSize,i="string"==typeof e.text?e.text:"".concat(e.text),o=e.maxWidth;if(void 0===o)return i;let a=t({text:i,fontSize:r,fontFamily:n}).width;if(a<=o)return i;let s=0,l=i.length-1;for(;s<=l;){let e=Math.floor((s+l)/2);a=t({text:i.substr(0,e)+SN,fontSize:r,fontFamily:n}).width,a<=o?s=e+1:l=e-1}return i.substr(0,l)+SN}function _N(e){const t=e.baseline||e["dominant-baseline"];let n=0;const r=parseInt(e.fontSize||e["font-size"],10)||0;switch(t){case"hanging":n=.75*r;break;case"text-before-edge":n=.85*r;break;case"middle":n=.25*r;break;case"central":n=.35*r;break;case"mathemetical":n=r/2;break;case"text-after-edge":case"ideographic":n=.2*-r;break;default:n=0}return n}const PN={},zN={},FN={fontSize:void 0,fontFamily:void 0};let jN;function $N(e,t){return!e&&!t||e===t}function BN(e){let t=e.text,n=e.fontWeight,r=e.fontSize,i=e.fontFamily;const o="".concat(t," ").concat(n," ").concat(r," ").concat(i);return"number"!=typeof zN[o]&&(jN=jN||document.createElement("canvas").getContext("2d"),function(e){let t=e.fontWeight,n=e.fontSize,r=e.fontFamily;$N(FN.fontWeight,t)&&$N(FN.fontSize,n)&&$N(FN.fontFamily,r)||(jN.font=[t,n,r].filter(e=>!!e).join(" "),FN.fontWeight=t,FN.fontSize=n,FN.fontFamily=r)}({fontWeight:n,fontSize:r,fontFamily:i}),zN[o]=jN.measureText(t).width),zN[o]}function VN(e){return"number"!=typeof PN[e]&&(PN[e]=function(e){if(wN(e)){const t=parseFloat(e);return t+4*Math.ceil((t+1e-12)/24)}return 16}(e)),PN[e]}function HN(e){let t=e.text,n=e.fontWeight,r=e.fontSize;return{width:BN({text:t,fontWeight:n,fontSize:r,fontFamily:e.fontFamily}),height:VN(r)}}function UN(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:HN;const n=e["font-size"]||e.fontSize,r=e["font-family"]||e.fontFamily,i=t({text:e.text,fontFamily:r,fontSize:n}),o=Math.min(e.maxWidth||i.width,i.width),a=e.x||0,s=e.y||0,l=e.dx||0,c={x:0,y:s+((e.dy||0)+_N(e))-.75*i.height,width:o,height:i.height},u=e["text-anchor"]||e.anchor;return c.x="middle"===u?a+l-o/2:"end"===u?a+l-o:a+l,c}function WN(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:HN;const n=IN(e),r=e["font-size"]||e.fontSize,i=e["font-family"]||e.fontFamily,o=t({text:e.text,fontFamily:i,fontSize:r});if(n&&(o.width>e.maxWidth||gN(e.text))){const o=n(e,e=>t({text:e,fontFamily:i,fontSize:r})),a=Dv({},e);let s=0,l="";for(let e=0,n=o.lines.length;e<n;e++){let a=o.lines[e];a+=e===n-1&&o.reduced?SN:"";const c=t({text:a,fontSize:r,fontFamily:i}).width;c>=s&&(s=c,l=a)}a.text=l;const c=UN(a,t);return c.height=EN(e)*o.lines.length,c}return UN(e,t)}function YN(e,t){return{node:e,data:e.data,scale:t.scale,formatter:t.formatter,dataset:t.dataset}}function KN(e,t,n){const r={type:"text",text:t,maxWidth:e.width,x:0,y:e.y,dx:0,dy:0,fill:n.fill,anchor:"start",baseline:"alphabetical",fontSize:"".concat(n.fontSize,"px"),fontFamily:n.fontFamily},i=n.textMetrics;if(e.width<n.fontSize)return!1;const o=Math.max(0,e.width-i.width);return r.x=e.x+n.align*o,r.y=e.y+i.height/1.2,r}function GN(e){return{type:"circle",bounds:{cx:e.cx,cy:e.cy,r:e.r}}}function XN(e){return e.desc&&e.desc.slice?function(e){let t=e.start,n=e.end,r=e.innerRadius,i=e.outerRadius,o=e.offset;if(Math.abs(t+2*Math.PI-n)>1e-12)return{type:null,bounds:null};let a=0!==r?r:i;return GN({cx:o.x,cy:o.y,r:a})}(e.desc.slice):"circle"===e.type?GN(e.attrs):"rect"===e.type?{type:"rect",bounds:e.bounds}:{type:null,bounds:null}}var JN={bar:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eN;const l=Dv({fontSize:12,fontFamily:"Arial",align:.5,justify:0,fill:"#333"},a.label);l.fontSize=parseInt(l.fontSize,10);const c=t.labels.map(e=>Dv({},l,t,e)),u=t.labels.map(e=>e.placements.map(n=>Dv({},l,t,e,n))),d=function(e){let t=e.nodes,n=e.rect,r=e.chart,i=e.labelSettings,o=e.placementSettings,a=e.settings,s=e.renderer;const l={},c=[];let u,d,f,h,p,m,g,y=!0,v=!1;for(let e=0;e<t.length;e++){if(d=t[e],h=d.localBounds,!Qk(h,n))continue;let b=VO(d,r);u={node:d,texts:[],measurements:[],labelSettings:[],placementSettings:[]};for(let t=0;t<i.length;t++)m=i[t],f="function"==typeof m.label?m.label(b,e):void 0,HO(f)&&(g="function"==typeof a.direction?a.direction(b,e):a.direction||"up",v=v||"left"===g||"right"===g,l.fontFamily=m.fontFamily,l.fontSize="".concat(m.fontSize,"px"),l.text=f,p=s.measureText(l),u.measurements.push(p),u.texts.push(f),u.labelSettings.push(m),u.placementSettings.push(o[t]),u.direction=g,y=y&&p.width<=h.width-8);c.push(u)}return{targetNodes:c,fitsHorizontally:y,hasHorizontalDirection:v}}({nodes:r,chart:n,renderer:o,settings:t,rect:i,labelSettings:c,placementSettings:u}),f=d.fitsHorizontally,h=d.hasHorizontalDirection,p=d.targetNodes,m=function(e){let t=e.orientation,n=void 0===t?"auto":t,r=e.defaultOrientation,i=void 0===r?"h":r;switch(n.toLocaleLowerCase()){case"vertical":return"v";case"horizontal":return"h";default:return i}}({orientation:t.orientation,defaultOrientation:h?"h":"v"}),g="h"===m?"y":"x",y="h"===m?"height":"width";return p.sort((e,t)=>e.node.localBounds[g]+e.node.localBounds[y]-(t.node.localBounds[g]+t.node.localBounds[y])),s({chart:n,targetNodes:p,stngs:t,rect:i,fitsHorizontally:f,collectiveOrientation:m})},slice:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.rect,o=e.renderer,a=e.style,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dN,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:cN;const c=Dv({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,position:"into"},a.label);c.fontSize=parseInt(c.fontSize,10);const u=t.labels.map(e=>Dv({},c,t,e)),d=t.labels.map(e=>e.placements.map(n=>Dv({},c,t,e,n))),f=[],h={insideLabelBounds:[]};r=function(e){const t=[],n=[],r=[],i=[];for(let o=0;o<e.length;++o){const a=e[o].desc.slice,s=tN((a.start+a.end)/2);switch(Math.floor(s/(Math.PI/2))){case 0:t.push(e[o]);break;case 1:n.push(e[o]);break;case 2:r.push(e[o]);break;case 3:i.push(e[o])}}const o=(e,t)=>tN((e.desc.slice.start+e.desc.slice.end)/2)-tN((t.desc.slice.start+t.desc.slice.end)/2),a=(e,t)=>o(t,e);return t.sort(a),n.sort(o),r.sort(a),i.sort(o),t.concat(n,i,r)}(r);const p={};for(let e=0,t=r.length;e<t;e++){const t=r[e],a=lN(t,n);for(let n=0;n<u.length;n++){const r=u[n],c="function"==typeof r.label?r.label(a,e):"";if(!c)continue;const m="function"==typeof r.direction?r.direction(a,e):r.direction||"horizontal",g="function"==typeof r.linkData?r.linkData(a,e):void 0,y=fN(c,r,o),v=s({context:p,direction:m,lblStngs:r,measured:y,node:t,placementSettings:d[n],rect:i,store:h}),b=v.bounds,x=v.placement;if(b&&x){if("outside"===x.position&&"rotate"!==m){sN({context:p,node:t,bounds:b});if(!Fk(rN(b),i))continue}const n="function"==typeof x.fill?x.fill(a,e):x.fill,o=l(b,c,{fill:n,fontSize:r.fontSize,fontFamily:r.fontFamily,textMetrics:y});o&&(void 0!==g&&(o.data=g),f.push(o),b.line&&(b.line.stroke=n,f.push(b.line)))}}}return f},rows:function(e){let t=e.settings,n=e.chart,r=e.nodes,i=e.renderer,o=e.style,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:KN;const s=Dv({fontSize:12,fontFamily:"Arial",fill:"#333",padding:4,align:.5,justify:.5},o.label);s.fontSize=parseInt(s.fontSize,10);const l=Dv({},s,t),c=t.labels.map(e=>Dv({},l,e)),u={},d=[];for(let e=0,t=r.length;e<t;e++){let t=r[e],o=YN(t,n),s=XN(t),f=s.type,h=s.bounds;if(!h)continue;let p,m=0,g=[],y=[],v="circle"===f?2*h.r*.9:h.height;for(m+=l.padding,p=0;p<c.length;p++){let t=c[p],n="function"==typeof t.label?t.label(o,e):"";u.fontFamily=t.fontFamily,u.fontSize="".concat(t.fontSize,"px"),u.text=n;let r=i.measureText(u);if(m+=r.height+t.padding,m>v)break;y.push(n),g.push(r)}const b=p,x=Math.max(0,v-m);let S;for(S="circle"===f?h.cy-.9*h.r:h.y,S+=l.justify*x+l.padding,p=0;p<b;p++){let t,n=c[p];if("circle"===f){let e=Math.max(Math.abs(S-h.cy),Math.abs(S+g[p].height-h.cy)),n=Math.sqrt(h.r*h.r-e*e);t={x:h.cx-n+l.padding,y:S,width:2*n-2*l.padding,height:g[p].height}}else t={x:h.x+l.padding,y:S,width:h.width-2*l.padding,height:g[p].height};S+=g[p].height+l.padding;let r="function"==typeof n.fill?n.fill(o,e):n.fill;const s="function"==typeof n.linkData?n.linkData(o,e):void 0;let u=a(t,y[p],{fill:r,align:n.align,fontSize:n.fontSize,fontFamily:n.fontFamily,textMetrics:g[p]});if(u){if(u.text&&u.text!==SN){const e=LN(u,i.measureText);if(SN===e)continue;u.ellipsed=e}void 0!==s&&(u.data=s),d.push(u)}}}return d}};const ZN={require:["chart","renderer","settings"],defaultSettings:{settings:{},style:{label:"$label"}},render(){const e=this.settings.settings,t=[];return(e.sources||[]).forEach(e=>{e.strategy&&JN[e.strategy.type]&&e.component&&t.push(...function(e,t){let n=e.chart,r=e.source,i=e.rect,o=e.renderer,a=e.style;if(!n.component(r.component))return[];const s=n.findShapes(r.selector).filter(e=>e.key===r.component);return t({chart:n,settings:r.strategy.settings,nodes:s,rect:{x:0,y:0,width:i.width,height:i.height},renderer:o,style:a})}({chart:this.chart,rect:this.rect,renderer:this.renderer,source:e,style:this.style},JN[e.strategy.type]))}),t}};const QN={layout:{size:1,direction:"ltr",scrollOffset:0},item:{show:!0,label:{fontSize:"12px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:136,lineHeight:1.2},shape:{type:"square",size:12}},title:{show:!0,text:void 0,anchor:"start",fontSize:"16px",fontFamily:"Arial",fill:"#595959",wordBreak:"none",maxLines:2,maxWidth:156,lineHeight:1.25}};function eD(e){let t=e.x,n=void 0===t?0:t,r=e.y,i=e.item,o=e.globalMetrics,a=e.createSymbol,s=e.direction,l=void 0===s?"ltr":s,c=i.label.displayObject,u=i.label.bounds,d=i.symbol.meta;const f="rtl"===l;let h={x:f?n+o.maxLabelBounds.width:n+o.maxSymbolSize+o.spacing,y:r,width:o.maxLabelBounds.width,height:Math.max(o.maxSymbolSize,o.maxLabelBounds.height)},p=function(e,t,n){const r=Math.max(0,e.width-t),i=Math.max(0,e.height-t);return{x:e.x+t/2+n.align*r,y:e.y+t/2+n.justify*i}}({x:f?n+o.maxLabelBounds.width+o.spacing:n,y:r,width:o.maxSymbolSize,height:h.height},d.size,{align:void 0===d.align?.5:d.align,justify:void 0===d.justify?.5:d.justify});const m=a(Dv({},d,p));return delete m.collider,c.anchor=f?"end":"start",function(e,t,n){const r=n.textMetrics;if(e.height<r.height)return!1;const i=Math.max(0,e.width-r.width);t.baseline="text-before-edge";const o=Math.max(0,e.height-r.height);t.x=e.x+n.align*i,t.y=e.y+n.justify*o+.175*parseInt(t.fontSize,10)}(h,c,{textMetrics:u,fontSize:parseInt(c.fontSize,10),align:0,justify:.5}),{item:{type:"container",data:i.label.displayObject.data,children:[m,c],collider:{type:"rect",x:n,y:r,width:o.maxItemBounds.width,height:o.maxItemBounds.height}},metrics:h}}function tD(e,t){const n=e.items.length,r=Math.ceil(n/t),i="horizontal"===e.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[i]*r+(r-1)*e.layout.margin[o]}function nD(e,t){let n,r,i,o,a=t.onScroll,s=void 0===a?()=>{}:a,l=null,c=0;const u={itemize:t=>{n=function(e,t){let n,r,i=e.resolved,o=e.dock,a=[],s=i.items.items,l=i.symbols.items,c=i.labels.items,u=0,d=0,f=0;for(let e=0;e<s.length;e++){if(!1===s[e].show)continue;const i=void 0!==c[e].text?c[e].text:c[e].data.label||"";n=Dv({},c[e],{type:"text",fontSize:"".concat(parseInt(c[e].fontSize,10),"px"),text:i,title:i}),r={symbol:{meta:l[e]},label:{displayObject:n,bounds:t.textBounds(n)}},a.push(r),u=Math.max(l[e].size,u),d=Math.max(r.label.bounds.width,d),f=Math.max(r.label.bounds.height,f)}return{items:a,globalMetrics:{spacing:8,maxSymbolSize:u,maxItemBounds:{height:Math.max(u,f),width:u+8+d},maxLabelBounds:{width:d,height:f}},layout:{margin:{vertical:void 0!==i.layout.item.vertical?i.layout.item.vertical:4,horizontal:void 0!==i.layout.item.horizontal?i.layout.item.horizontal:4},mode:i.layout.item.mode,size:i.layout.item.size,orientation:"top"===o||"bottom"===o?"horizontal":"vertical",direction:i.layout.item.direction,scrollOffset:i.layout.item.scrollOffset}}}(t,e.renderer),l=isNaN(n.layout.scrollOffset)?l:n.layout.scrollOffset},getItemsToRender:t=>{i=t.viewRect,c=u.getContentOverflow(i);const a=u.extent();l=Math.max(0,Math.min(l,c)),o=Dv({},i);const s="horizontal"===u.orientation()?"x":"y";return o[s]-=l,o["x"===s?"width":"height"]=a,function(e,t,n){let r=e.viewRect,i=n.itemized,o=n.create,a=void 0===o?eD:o,s=n.parallels,l=n.createSymbol;const c=i.layout.direction,u=i.globalMetrics,d=i.items,f="horizontal"===i.layout.orientation;let h=0;const p=[],m=u.maxItemBounds.height,g=u.maxItemBounds.width,y=i.layout.margin.vertical+m,v=i.layout.margin.horizontal+g;let b=t.x,x=t.y,S=r.x-t.x;for(let e=0;e<d.length;e++){let n=a({y:x,x:"rtl"===c?r.x+S+r.width-g-(b-t.x):b,item:d[e],globalMetrics:u,direction:c,createSymbol:l});if((f&&b>=r.x-g||!f&&x>=r.y-m)&&p.push(n.item),h++,h>=s?(h=0,f?(b+=v,x=t.y):(x+=y,b=t.x)):f?x+=y:b+=v,!f&&x>r.y+r.height)break;if(f&&b>r.x+r.width)break}return p}(t,o,{itemized:n,parallels:r,createSymbol:e.symbol})},parallelize:(e,t)=>(r=function(e,t,n){const r=n.items.length,i="horizontal"===n.layout.orientation?"width":"height",o="width"===i?"horizontal":"vertical",a=n.globalMetrics.maxItemBounds[i]*r+(r-1)*n.layout.margin[o];let s=Math.ceil(a/e);if(null!=t){const e="horizontal"===n.layout.orientation?"height":"width",r="width"===e?"horizontal":"vertical",i=n.layout.margin[r]||4,o=Math.floor((t+i)/(i+n.globalMetrics.maxItemBounds[e]));s=Math.min(s,o)}const l=isNaN(n.layout.size)?1:n.layout.size;return Math.max(1,Math.min(s,l))}(e,t,n),r),hasContentOverflow:()=>{const e="horizontal"===n.layout.orientation?"width":"height";return tD(n,r)>i[e]},getContentOverflow:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i;const t="horizontal"===n.layout.orientation?"width":"height";return Math.max(0,tD(n,r)-e[t])},getNextSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},getPrevSize:()=>{const e="horizontal"===n.layout.orientation?"width":"height",t="width"===e?"horizontal":"vertical";return n.globalMetrics.maxItemBounds[e]+n.layout.margin[t]},hasNext:()=>"horizontal"===u.orientation()?i.x+i.width<o.x+o.width:i.y+i.height<o.y+o.height,hasPrev:()=>"horizontal"===u.orientation()?o.x<i.x:o.y<i.y,next:()=>{u.scroll(-u.getNextSize())},prev:()=>{u.scroll(u.getPrevSize())},scroll:e=>{const t=Math.max(0,Math.min(c,l-e));t!==l&&(l=t,s())},offset:()=>l,orientation:()=>n.layout.orientation,direction:()=>n.layout.direction,extent:()=>tD(n,r),spread:()=>function(e,t){const n=t,r="horizontal"===e.layout.orientation?"height":"width",i="width"===r?"horizontal":"vertical";return e.globalMetrics.maxItemBounds[r]*n+(n-1)*e.layout.margin[i]}(n,r)};return u}function rD(e){return Object.keys(e).filter(t=>e[t]).join(" ")}const iD={up:"▲",right:"▶",down:"▼",left:"◀"};function oD(e,t){let n=t.size,r=t.isActive,i=t.direction,o=t.nav,a={},s="";const l=t.attrs;o&&o.button&&("function"==typeof o.button.class?a=o.button.class({direction:i}):o.button.class&&(a=o.button.class),"function"==typeof o.button.content&&(s=o.button.content(e,{direction:i})),void 0!==o.button.tabIndex&&(l.tabindex=o.button.tabIndex));const c={width:"".concat(n,"px"),minWidth:"".concat(n,"px"),height:"".concat(n,"px")};return Object.keys(a).length||(c.border="0",c.background="none"),(!r||o&&o.disabled)&&(l.disabled="disabled"),e("button",Dv({class:rD(a),style:c},l),[s||e("span",{style:{pointerEvents:"none"}},[iD[i]])])}function aD(e){let t;const n={itemize:e=>{t=function(e){let t=e.dock;return{layout:{orientation:"top"===t||"bottom"===t?"vertical":"horizontal"},navigation:e.navigation}}(e)},render:r=>function(e,t,n,r){let i=t.rect,o=t.itemRenderer;if(!e||!e.renderArgs)return;e.size(i);const a=e.renderArgs[0],s="vertical"===n.layout.orientation,l="rtl"===o.direction(),c=o.hasNext(),u=o.hasPrev();if(!u&&!c)return void e.render([]);const d=s?["right","left"]:["down","up"];l&&s&&d.reverse();const f=[a("div",{style:{position:"relative",display:"flex","flex-direction":s?"column":"row","justify-content":"center",height:"100%",pointerEvents:"auto"},dir:l&&!s?"rtl":"ltr"},[oD(a,{size:32,isActive:c,direction:d[0],attrs:{"data-action":"next","data-component-key":r.settings.key},nav:n.navigation}),oD(a,{size:32,isActive:u,direction:d[1],attrs:{"data-action":"prev","data-component-key":r.settings.key},nav:n.navigation})])];e.render(f)}(n.renderer,r,t,e),extent:()=>32,spread:()=>64};return n}function sD(e){let t;const n={itemize:n=>{t=function(e,t){let n=e.resolved;if(!1===n.title.item.show)return null;const r=Dv({},n.title.item,{type:"text"});if("rtl"===n.layout.item.direction&&(r.anchor&&"start"!==r.anchor?"end"===r.anchor&&(r.anchor="start"):r.anchor="end"),void 0===n.title.settings.text){const e=t.scale.data().fields;r.text=e&&e[0]?e[0].title():""}return{displayObject:r,bounds:t.renderer.textBounds(r)}}(n,e)},render:e=>{!function(e,t,n){let r=e.rect;if(!t)return;const i=[];if(t.size(r),n){const e={start:0,end:r.width,middle:r.width/2};i.push(Dv({},n.displayObject,{x:e[n.displayObject.anchor]||0,y:0,baseline:"text-before-edge",title:n.displayObject.text}))}t.render(i)}(e,n.renderer,t)},spread:()=>t?t.bounds.height:0,extent:()=>t?t.bounds.width:0};return n}function lD(e,t,n,r){let i,o,a,s=r.itemRenderer,l=r.navigationRenderer,c=r.titleRenderer,u=r.isPreliminary,d=void 0!==u&&u,f=0;const h={x:t.spacing,y:t.spacing,width:e.width-2*t.spacing,height:e.height-2*t.spacing};if(i={x:h.x,y:h.y,width:h.width,height:c.spread()},"horizontal"===n){i={x:h.x,y:h.y,width:c.extent(),height:c.spread()};const e=h.width-i.width-(i.width?t.spacing:0),n=h.height;s.parallelize(e,d?void 0:n);const r=s.extent()>e?l.extent():0,u=s.spread(),p=r?l.spread():0;o={x:i.x+i.width+(i.width?t.spacing:0),y:h.y+Math.max(0,(p-u)/2),width:h.width-r-i.width-(r?t.spacing:0)-(i.width?t.spacing:0),height:n},a={x:o.x+o.width+(r?t.spacing:0),y:h.y,width:r,height:h.height},i.y=o.y;"rtl"===s.direction()&&(a.x=h.x,o.x=a.x+a.width+(a.width?t.spacing:0),i.x=o.x+o.width+(i.width?t.spacing:0)),f=Math.max(i.height,p,s.spread())}else{const e=h.height-i.height-(i.height?t.spacing:0),n=h.width;s.parallelize(e,d?void 0:n);const r=s.extent()>e?l.extent():0;a={x:h.x,y:h.y+h.height-r,width:h.width,height:r},o={x:h.x,y:i.y+i.height+(i.height?t.spacing:0),width:h.width,height:h.height-i.height-(i.height?t.spacing:0)-a.height-(a.height?t.spacing:0)},f=Math.max(c.extent(),r?l.spread():0,s.spread())}return o=Dv({},e,{x:e.x+o.x,y:e.y+o.y,width:o.width,height:o.height}),a.x+=e.x,a.y+=e.y,i.x+=e.x,i.y+=e.y,{title:Dv({},e,i),content:Dv({},e,o),navigation:Dv({},e,a),orientation:n,preferredSize:f}}function cD(e){e.state.resolved=function(e){const t=e.scale.domain();let n={items:[]};const r=e.settings.layout.dock;if("threshold-color"===e.scale.type){const i=e.scale.data().fields[0];let o=e=>String(e);e.settings.formatter?o=e.chart.formatter(e.settings.formatter):i&&(o=i.formatter());for(let e=0;e<t.length-1;e++){const r={value:t[e],label:"".concat(o(t[e])," - < ").concat(o(t[e+1]))};i&&(r.source={field:i.id()}),n.items.push(r)}"vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")&&n.items.reverse()}else{const r=e.scale.labels?e.scale.labels():null;n.items=t.map((t,n)=>{const i=e.scale.datum?Dv({},e.scale.datum(t)):{value:t};return i.value=t,e.scale.label?i.label=e.scale.label(t):r&&(i.label=r[n]),i})}const i=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:Dv(!0,{},QN.title,e.style.title),settings:e.settings.settings.title}),o=e.resolver.resolve({data:{fields:e.scale.data().fields},defaults:QN.layout,settings:e.settings.settings.layout}),a=e.resolver.resolve({data:n,defaults:Dv(!0,{},QN.item.label,e.style.item.label),settings:(e.settings.settings.item||{}).label}),s=Dv(!0,{},(e.settings.settings.item||{}).shape);void 0===s.fill&&e.settings.scale&&(s.fill={scale:e.settings.scale});const l=e.resolver.resolve({data:n,defaults:Dv(!0,{},QN.item.shape,e.style.item.shape),settings:s}),c=e.resolver.resolve({data:n,defaults:Dv(!0,{},{show:QN.item.show}),settings:{show:(e.settings.settings.item||{}).show}});function u(e,n){let r=e.data.value,i=t[n+1];e.data.value=[r,i]}"threshold-color"===e.scale.type&&("vertical"==("top"===r||"bottom"===r?"horizontal":"vertical")?(c.items.reverse().forEach(u),c.items.reverse()):c.items.forEach(u));return{title:i,labels:a,symbols:l,items:c,layout:o}}(e),e.titleRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.itemRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center"}),e.navigationRenderer.itemize({resolved:e.state.resolved,dock:e.settings.layout.dock||"center",navigation:e.settings.settings.navigation}),e.state.display={spacing:8}}function uD(e){const t=e.rect,n=e.settings,r=e.state,i=e.itemRenderer,o=e.navigationRenderer,a=e.titleRenderer,s=n.layout.dock,l="top"===s||"bottom"===s?"horizontal":"vertical",c=lD(t,r.display,l,{itemRenderer:i,navigationRenderer:o,titleRenderer:a});e.renderer.size(c.content);let u=i.getItemsToRender({viewRect:Dv({},c.content,{x:0,y:0})});return o.render({rect:c.navigation,itemRenderer:i}),a.render({rect:c.title}),e.state.views={layout:c},u}const dD={require:["chart","settings","renderer","update","resolver","registries","symbol"],defaultSettings:{settings:{},style:{item:{label:"$label",shape:"$shape"},title:"$title"}},mounted(e){e&&e.parentNode&&(this.navigationRenderer.renderer.appendTo(e.parentNode),this.titleRenderer.renderer.appendTo(e.parentNode),e.parentNode.insertBefore(this.navigationRenderer.renderer.element(),e),e.parentNode.insertBefore(this.titleRenderer.renderer.element(),e)),this.navigationRenderer.render({rect:this.state.views.layout.navigation,itemRenderer:this.itemRenderer}),this.titleRenderer.render({rect:this.state.views.layout.title})},beforeUnmount(){this.navigationRenderer.renderer.clear(),this.titleRenderer.renderer.clear()},on:{panstart(){if(this.state.interaction.started)return;this.itemRenderer.getContentOverflow()&&(this.state.interaction.started=!0,this.state.interaction.delta=0)},panmove(e){if(!this.state.interaction.started)return;const t="horizontal"===this.itemRenderer.orientation()?("rtl"===this.itemRenderer.direction()?-1:1)*e.deltaX:e.deltaY;this.itemRenderer.scroll(t-this.state.interaction.delta),this.state.interaction.delta=t},panend(){this.state.interaction.started=!1},scroll(e){this.itemRenderer.scroll(-e)},next(){this.itemRenderer.next()},prev(){this.itemRenderer.prev()}},created(){this.state={interaction:{}},this.onScroll=()=>{const e=uD(this);this.update(e)},this.itemRenderer=nD(this,{onScroll:this.onScroll}),this.navigationRenderer=aD(this),this.titleRenderer=sD(this),this.navigationRenderer.renderer=this.registries.renderer("dom")(),this.titleRenderer.renderer=this.registries.renderer(this.settings.renderer)(),cD(this)},preferredSize(e){return function(e,t){let n=0;const r=e.settings.layout.dock||"center",i="top"===r||"bottom"===r?"horizontal":"vertical",o=e.state.display,a=lD(t.inner,o,i,{itemRenderer:e.itemRenderer,navigationRenderer:e.navigationRenderer,titleRenderer:e.titleRenderer,isPreliminary:!0});return n+=o.spacing,n+=a.preferredSize,n+=o.spacing,n}(this,e)},beforeUpdate(){cD(this)},render(){return uD(this)},beforeDestroy(){this.navigationRenderer.renderer.destroy(),this.titleRenderer.renderer.destroy()},additionalElements(){return[this.titleRenderer.renderer.element(),this.navigationRenderer.renderer.element()]},_DO_NOT_USE_getInfo(){return{offset:this.itemRenderer.offset()}}};function fD(e,t){let n=0;const r=e.state.isVertical?"justify":"align",i=e.state.isVertical?"y":"x",o=e.state.isVertical?"height":"width",a=e.state.isVertical?"requiredHeight":"requiredWidth";n=e.state.rect[o]-e.state.legend.length()-e.state.title[a](),n*=Math.min(1,Math.max(e.stgns[r],0)),t[i]+=n}function hD(e,t,n){const r=n[e];return"object"==typeof r?-1!==r.valid.indexOf(t)?t:r.default:n.default}function pD(e){return hD(e.layout.dock,e.settings.title.anchor,{left:{valid:["top"],default:"top"},right:{valid:["top"],default:"top"},top:{valid:["left","right"],default:"left"},bottom:{valid:["left","right"],default:"left"},default:"top"})}function mD(e,t){const n={x:0,y:0,width:0,height:0},r=e.stgns.padding;return n.x=r.left,n.y=r.top,n.width=t.width-r.left-r.right,n.height=t.height-r.top-r.bottom,n}function gD(e){const t="top"!==e.settings.layout.dock&&"bottom"!==e.settings.layout.dock,n=e.stgns.title,r=e.chart.scale(e.stgns.fill),i=e.chart.scale(e.stgns.major),o=function(e,t){const n=t.domain();let r=n,i=e.stgns.tick.label;!i&&e.formatter?i=e.formatter:!i&&t.data().fields&&(i=t.data().fields[0].formatter()),"function"==typeof i&&(r=n.map(i).map(String));const o=n.map((n,i)=>{const o=r[i];return{value:n,label:o,pos:t.norm(parseFloat(n,10)),textMetrics:e.renderer.measureText({text:o,fontSize:e.stgns.tick.fontSize,fontFamily:e.stgns.tick.fontFamily})}});return o}(e,i),a=hD((s=e.settings).layout.dock,s.settings.tick.anchor,{left:{valid:["left","right"],default:"left"},right:{valid:["left","right"],default:"right"},top:{valid:["top","bottom"],default:"top"},bottom:{valid:["top","bottom"],default:"bottom"},default:"right"});var s;if(void 0===n.text){const e=i.data().fields;n.text=e&&e[0]?e[0].title():""}const l=e.renderer.measureText({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily}),c=e.renderer.textBounds({text:n.text,fontSize:n.fontSize,fontFamily:n.fontFamily,maxLines:n.maxLines,maxWidth:n.maxLengthPx,wordBreak:n.wordBreak,hyphens:n.hyphens,lineHeight:n.lineHeight}),u={isVertical:t,nodes:[],title:{anchor:pD(e.settings),textMetrics:l,textBounds:c,requiredWidth:()=>{if(!n.show)return 0;let e=c.width,r=n.maxLengthPx;return t||(e+=n.padding,r+=n.padding),Math.min(e,r,u.rect.width)},requiredHeight:()=>{if(!n.show)return 0;let e=c.height;return t&&(e+=n.padding),Math.min(e,u.rect.height)}},ticks:{values:o,anchor:a,length:Math.min(Math.max(...o.map(e=>e.textMetrics.width)),e.stgns.tick.maxLengthPx),requiredHeight:()=>"top"===a?Math.max(...u.ticks.values.map(e=>e.textMetrics.height))+e.stgns.tick.padding:0,height:Math.max(...o.map(e=>e.textMetrics.height))},legend:{fillScale:r,majorScale:i,length:()=>{const n=t?"height":"width",r=t?"requiredHeight":"requiredWidth",i=Math.min(u.rect[n],u.rect[n]*e.stgns.length)-u.title[r]();return Math.max(0,Math.min(i,e.stgns.maxLengthPx))}}};return u}const yD={require:["chart","settings","renderer"],defaultSettings:{layout:{displayOrder:0,dock:"right"},settings:{size:15,length:.5,maxLengthPx:250,align:.5,justify:0,padding:{left:5,right:5,top:5,bottom:5},tick:{label:null,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,anchor:null,padding:5},title:{show:!0,text:void 0,fill:"#595959",fontSize:"12px",fontFamily:"Arial",maxLengthPx:100,padding:5,maxLines:2,wordBreak:"none",lineHeight:1.2,hyphens:"auto",anchor:null}}},preferredSize(e){const t=this.state;t.rect=mD(this,e.inner);let n=this.stgns.size;const r=t.isVertical?this.stgns.padding.left+this.stgns.padding.right:this.stgns.padding.top+this.stgns.padding.bottom;n+=r;const i=Math.max(e.inner.width,e.inner.height);if("left"===t.ticks.anchor||"right"===t.ticks.anchor){const e=t.ticks.values.reduce((e,t)=>e+t.textMetrics.height,0);if(e>this.state.legend.length())return i;n+=t.ticks.length}else{if(t.ticks.length>this.state.legend.length())return i;n+=Math.max(...t.ticks.values.map(e=>e.textMetrics.height))}return n+=this.stgns.tick.padding,this.stgns.title.show&&(n="left"===t.title.anchor||"right"===t.title.anchor?Math.max(t.title.textBounds.height+r,n):Math.max(n,t.title.requiredWidth()+r)),this.state.preferredSize=n,n},created(){this.stgns=this.settings.settings,this.state=gD(this)},beforeUpdate(e){this.stgns=e.settings.settings,this.state=gD(this)},beforeRender(e){if(this.state.nodes=[],this.state.rect=mD(this,e.size),this.stgns.title.show){const e=function(e){const t=e.state,n=e.stgns,r="left"===t.ticks.anchor,i="top"===t.ticks.anchor;let o=t.rect.x,a=t.rect.y,s="start";"left"===t.title.anchor?(o+=t.title.requiredWidth()-n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0,s="end"):"right"===t.title.anchor?(o+=t.legend.length(),o+=n.title.padding,a+=t.title.textMetrics.height,a+=i?t.rect.height-t.title.textBounds.height:0):"top"===t.title.anchor&&(o+=r?t.rect.width:0,a+=t.title.textMetrics.height,s=r?"end":"start");const l={tag:"legend-title",type:"text",x:o,y:Math.min(a,t.rect.y+t.rect.height),text:n.title.text,fill:n.title.fill,fontSize:n.title.fontSize,fontFamily:n.title.fontFamily,maxWidth:n.title.maxLengthPx,maxLines:n.title.maxLines,wordBreak:n.title.wordBreak,hyphens:n.title.hyphens,lineHeight:n.title.lineHeight,anchor:s,title:n.title.text};return fD(e,l),l}(this);this.state.nodes.push(e)}const t=function(e){const t=e.state.legend.fillScale,n=e.state.legend.majorScale,r=t.domain().map(e=>({type:"stop",color:t(e),offset:Math.min(1,Math.max(0,n.norm(e)))}));return r.sort((e,t)=>e.offset-t.offset)}(this),n=function(e,t){const n=e.state,r=e.stgns,i=n.rect;let o=i.x,a=i.y,s=n.isVertical?r.size:n.legend.length(),l=n.isVertical?n.legend.length():r.size;"left"===n.ticks.anchor?o+=n.rect.width-r.size:"top"===n.ticks.anchor&&(a+=n.rect.height-r.size),"top"===n.title.anchor?a+=n.title.requiredHeight():"left"===n.title.anchor&&(o+=n.title.requiredWidth());const c={type:"rect",x:o,y:a,width:s,height:l,fill:{type:"gradient",stops:t,degree:n.isVertical?90:180}};return fD(e,c),c}(this,t),r=function(e,t){const n=e.state,r=e.stgns;let i="start";const o={type:"rect",x:t.x,y:t.y,width:n.isVertical?0:t.width,height:n.isVertical?t.height:0,fill:"transparent"},a=n.ticks.values.map(a=>{let s=0,l=0,c=0,u="alphabetical";return n.isVertical?(l=t.y+t.height*a.pos,u=0===a.pos?"text-before-edge":"text-after-edge"):s=t.x+t.width*a.pos,"right"===n.ticks.anchor?(s=t.x+r.size+r.tick.padding,o.x=t.x+t.width):"left"===n.ticks.anchor?(s=t.x-r.tick.padding,i="end"):"top"===n.ticks.anchor?(l=t.y-r.tick.padding,c-=.25*a.textMetrics.height,i=0===a.pos?"start":"end"):"bottom"===n.ticks.anchor&&(l=t.y+t.height+r.tick.padding,c=.8*a.textMetrics.height,i=0===a.pos?"start":"end",o.y=t.y+t.height),{type:"text",x:s,y:l,dx:0,dy:c,text:a.label,fontSize:r.tick.fontSize,fontFamily:r.tick.fontFamily,fill:r.tick.fill,maxWidth:n.isVertical?r.tick.maxLengthPx:Math.min(r.tick.maxLengthPx,n.legend.length()/2),anchor:i,textBoundsFn:e.renderer.textBounds,title:a.label,baseline:u}});return{type:"container",id:"legend-seq-ticks",children:[...a,o]}}(this,n),i={id:"legend-seq-target",type:"container",children:[n,r]};this.state.nodes.push(i)},render(){return this.state.nodes}};const vD={coordinates:{minor:.5,major:.5,layerId:0,defined:!0},layers:{curve:"linear",show:!0,line:{stroke:"#ccc",strokeWidth:1,strokeLinejoin:"miter",strokeDasharray:void 0,opacity:1,show:!0,showMinor0:!0},area:{fill:"#ccc",opacity:.8,show:!0}}};function bD(e,t){let n=t.generatorType,r=t.item,i=t.data,o=t.major,a=t.minor,s=t.layerObj,l=t.stngs,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const u={type:"path",points:e,generatorType:n,major:o,minor:a,layerObj:s,stngs:l,opacity:r.opacity,stroke:r.stroke,strokeWidth:r.strokeWidth,strokeLinejoin:r.strokeLinejoin,fill:c||r.fill,data:i};return r.strokeDasharray&&(u.strokeDasharray=r.strokeDasharray),u}function xD(e){const t=function(e){let t=e.data,n=e.stngs,r=e.rect,i=e.resolver,o=e.style,a=e.domain;const s=r.width,l=r.height,c=i.resolve({data:t,defaults:vD.coordinates,settings:n.coordinates||{},scaled:{major:"vertical"===n.orientation?l:s,minor:"vertical"===n.orientation?s:l}}),u=!n.connect&&a.length>2&&("function"==typeof n.coordinates.layerId||"object"==typeof n.coordinates.layerId),d={};let f=0;for(let e=0;e<c.items.length;e++){let t=c.items[e],n=t.layerId;if(u){const e=d[n]?d[n].items[d[n].items.length-1]:null,r=e?a.indexOf(e.data.major?e.data.major.value:e.data.value):null;e&&a.indexOf(t.data.major?t.data.major.value:t.data.value)-1!==r&&d[n].items.push({dummy:!0})}d[n]=d[n]||{order:f++,id:n,items:[],dataItems:[],consumableData:{}},d[n].dataItems.push(t.data),d[n].items.push(t)}const h=Object.keys(d).map(e=>(d[e].consumableData=Lv({points:d[e].dataItems},d[e].dataItems[0]),d[e])),p={items:h.map(e=>e.consumableData)},m=n.layers||{};return{coordinates:c,metaLayers:h,layers:i.resolve({data:p,defaults:{curve:vD.layers.curve,show:vD.layers.show},settings:{curve:m.curve,show:m.show}}),lines:i.resolve({data:p,defaults:Dv({},vD.layers.line,o.line),settings:m.line}),areas:i.resolve({data:p,defaults:Dv({},vD.layers.area,o.area),settings:m.area})}}(e),n=t.metaLayers,r=t.coordinates,i=t.layers,o=t.lines,a=t.areas,s=[];return n.forEach((t,n)=>{const l=i.items[n];if(!1===l.show)return;l.datum=l.data,l.data=[],l.id=t.id;const c=[],u=[];let d,f;for(let n=0;n<t.items.length;n++){if(d=t.items[n],f=d.data,!d.dummy){if(isNaN(d.major))continue;e.missingMinor0&&(d.minor0=r.settings.minor.scale?r.settings.minor.scale(f.minor0?f.minor0.value:0):0),isNaN(d.minor)||c.push(d.minor),l.data.push(d.data)}u.push(d)}const h=c.sort((e,t)=>e-t)[Math.floor((c.length-1)/2)];s.push({layerObj:l,lineObj:o.items[n],areaObj:a.items[n],median:h,points:u,consumableData:t.consumableData})}),s}const SD={require:["chart","resolver"],defaultSettings:{style:{area:"$shape",line:"$shape-outline"}},created(){},render(e){let t=e.data;const n=this.rect,r=n.width,i=n.height;this.stngs=this.settings.settings||{};const o=!this.stngs.coordinates||void 0===this.stngs.coordinates.minor0,a=xD({data:t,stngs:this.stngs,rect:this.rect,resolver:this.resolver,style:this.style,missingMinor0:o,domain:this.stngs.coordinates&&this.stngs.coordinates.major&&this.stngs.coordinates.major.scale?this.chart.scale(this.stngs.coordinates.major.scale).domain():[]});if(this.stngs.layers&&this.stngs.layers.sort){const e=a.map(e=>({id:e.layerObj.id,data:e.layerObj.data})).sort(this.stngs.layers.sort).map(e=>e.id);a.sort((t,n)=>e.indexOf(t.layerObj.id)-e.indexOf(n.layerObj.id))}else a.sort((e,t)=>e.median-t.median);return function(e,t){let n=t.width,r=t.height,i=t.missingMinor0,o=t.stngs;const a=[],s=o.layers||{};return e.forEach(e=>{const t=e.lineObj,l=e.layerObj,c=e.areaObj,u=e.points;let d={size:r,p:"y"},f={size:n,p:"x"};if("vertical"===o.orientation){const e=Dv(!0,{},f);f=Dv(!0,{},d),d=Dv(!0,{},e)}s.area&&!1!==c.show&&a.push(bD(u,{data:e.consumableData,item:c,generatorType:"area",major:f,minor:d,layerObj:l,stngs:o})),t&&!1!==t.show&&(a.push(bD(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"1"),major:f,minor:d,layerObj:l,stngs:o},"none")),!i&&s.area&&!1!==c.show&&!1!==t.showMinor0&&a.push(bD(u,{data:e.consumableData,item:t,generatorType:"line".concat(d.p.toUpperCase(),"0"),major:f,minor:d,layerObj:l,stngs:o},"none")))}),a}(a,{width:r,height:i,missingMinor0:o,stngs:this.stngs})}};function MD(e,t){let n,r,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];"object"==typeof t.center?(n=t.center.x,r=t.center.y):(n=t.clientX,r=t.clientY);const o=n-e.state.boundingRect.left,a=r-e.state.boundingRect.top;return{x:i?Math.max(0,Math.min(o,e.rect.width)):o,y:i?Math.max(0,Math.min(a,e.rect.height)):a}}function wD(e,t){return{x:t.x+e.rect.x,y:t.y+e.rect.y}}function ED(e,t){const n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return{x:n,y:r,width:Math.max(e.x,t.x)-n,height:Math.max(e.y,t.y)-r}}const kD={require:["chart","renderer"],defaultSettings:{layout:{displayOrder:99},settings:{brush:{components:[]}},style:{area:"$selection-area-target"}},on:{areaStart(e){this.start(e)},areaMove(e){this.move(e)},areaEnd(e){this.end(e)},areaCancel(){this.cancel()}},created(){this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1}},preferredSize:()=>0,render(){},start(e){this.state.boundingRect=this.renderer.element().getBoundingClientRect();const t=MD(this,e,!1);tC({x:0,y:0,width:this.rect.width,height:this.rect.height},t)&&(this.state.brushConfig=this.settings.settings.brush.components.map(e=>({key:e.key,contexts:e.contexts,data:e.data,action:e.action||"set"})),this.state.start=MD(this,e),this.state.active=!0)},move(e){var t;this.state.active&&(this.state.end=MD(this,e),function(e){if(e.state.active){const t=wD(e,e.state.start),n=wD(e,e.state.end),r=e.chart.shapesAt(ED(t,n),{components:e.state.brushConfig});e.chart.brushFromShapes(r,{components:e.state.brushConfig})}}(this),(t=this).renderer.render([Dv({type:"rect"},ED(t.state.start,t.state.end),t.style.area)]))},end(){this.state.active&&(this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))},cancel(){this.state.active&&(!function(e,t){e.brushConfig.forEach(e=>{Array.isArray(e.contexts)&&e.contexts.forEach(e=>{t.brush(e).end()})})}(this.state,this.chart),this.state={start:{x:0,y:0},end:{x:0,y:0},active:!1},this.renderer.render([]))}};function CD(e,t,n){let r=n.renderer,i=n.style,o=n.props,a=n.h;const s=function(e,t){return{tooltip:"function"==typeof e.tooltipClass?e.tooltipClass({dock:t.dock}):e.tooltipClass,content:"function"==typeof e.contentClass?e.contentClass({dock:t.dock}):e.contentClass,arrow:"function"==typeof e.arrowClass?e.arrowClass({dock:t.dock}):e.arrowClass}}(o,t),l=function(e,t,n,r){return r.content({h:e,style:n,data:t})}(a,e,i,o),c=a("div",{dir:o.direction,class:rD(Dv({"pic-tooltip":!0},s.tooltip)),style:Dv({position:"relative",display:"inline-block"},t.computedTooltipStyle)},a("div",{style:i.content,class:rD(Dv({"pic-tooltip-content":!0},s.content))},l),a("div",{class:rD(Dv({"pic-tooltip-arrow":!0},s.arrow)),style:Dv({},i.arrow,i["arrow-".concat(t.dock)],t.computedArrowStyle)}));return r.render(c),r.element().children[0]}function AD(e){let t=e.defaultDuration,n=e.defaultDelay,r=null,i=null,o=!1;const a=function(){const e=function(){},t={pending:[],debounced:[],active:[],cancelled:[],rejected:[],fulfilled:[]};let n;return e.set=e=>{n=e,t[n].forEach(t=>t(e))},e.on=(e,n)=>{Array.isArray(e)?e.forEach(e=>t[e].push(n)):t[e].push(n)},e.destroy=()=>{Object.keys(t).forEach(e=>{t[e].length=0})},e}(),s=function(){},l=()=>{r=null,i=null,o=!1,a.set("fulfilled")};return s.invoke=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n;r&&(clearTimeout(r),a.set("debounced")),a.set("pending"),r=setTimeout(()=>{e(),o=!0,r=null,a.set("active")},c),s>0&&(i&&clearTimeout(i),i=setTimeout(l,s+Math.max(c,0)))},s.clear=()=>{o?a.set("cancelled"):r&&(clearTimeout(r),a.set("rejected")),i&&clearTimeout(i),r=null,i=null,o=!1},s.on=(e,t)=>{a.on(e,t)},s.destroy=()=>{s.clear(),a.destroy()},s}function OD(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return{left:"translate(-100%,-50%) translateX(".concat(-e,"px)"),right:"translate(".concat(e,"px, -50%)"),top:"translate(-50%, -100%) translateY(".concat(-e,"px)"),bottom:"translate(-50%, ".concat(e,"px)"),inside:"translate(-50%, -50%)"}}function ND(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{left:{x:-e-n,y:-t/2},right:{x:n,y:-t/2},top:{x:-e/2,y:-t-n},bottom:{x:-e/2,y:n},inside:{x:-e/2,y:-t/2}}}function DD(e,t){const n=e>0?"-":"+";return e=Math.abs(e),void 0===t&&(t=e),{left:{left:"100%",top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},right:{left:"".concat(2*-e,"px"),top:"calc(50% ".concat(n," ").concat(e,"px)"),borderWidth:"".concat(t,"px")},top:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"100%",borderWidth:"".concat(t,"px")},bottom:{left:"calc(50% ".concat(n," ").concat(e,"px)"),top:"".concat(2*-e,"px"),borderWidth:"".concat(t,"px")},inside:{left:"0px",top:"0px",borderWidth:"0px"}}}function TD(e,t,n,r,i,o){const a=t+o.x,s=n+o.y,l=i;return!(a<0||s<0)&&!(a+r>e.width||s+l>e.height)}function qD(e){let t=e.area,n=e.vx,r=e.vy,i=e.width,o=e.height,a=e.offset;const s=n+a.x,l=r+a.y,c=i,u=o;let d=s<0?-s:0,f=l<0?-l:0;return d+=s+c>t.width?-(s+c-t.width):0,f+=l+u>t.height?-(l+u-t.height):0,{x:d,y:f}}function ID(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.dockOrder,a=e.x,s=e.y;const l=n.targetBounds,c=OD(t.offset),u=c[t.dock];if(u)return{computedTooltipStyle:{left:"".concat(a,"px"),top:"".concat(s,"px"),transform:u},computedArrowStyle:DD(t.offset)[t.dock],dock:t.dock};const d={width:"target"===t.area?l.width:window.innerWidth,height:"target"===t.area?l.height:window.innerHeight},f=ND(r,i,t.offset),h=[],p="target"===t.area?a:l.left+a,m="target"===t.area?s:l.top+s;for(let e=0;e<o.length;e+=1){const n=o[e],l=qD({area:d,vx:p,vy:m,width:r,height:i,offset:f[n]}),u={left:"".concat(a,"px"),top:"".concat(s,"px"),transform:c[n]},g=DD(t.offset)[n];0!==l.x&&(u.width="".concat(r-20-Math.abs(l.x),"px"),"top"!==n&&"bottom"!==n||(u.left="".concat(a+l.x,"px"),g.left="calc(50% ".concat(l.x>0?"-":"+"," ").concat(Math.abs(l.x),"px)")));const y={computedTooltipStyle:u,computedArrowStyle:g,dock:n,rect:{width:r,height:i}};if(0===l.x&&0===l.y)return y;y.offset=l,h.push(y)}return h.sort((e,t)=>Math.abs(e.offset.x)-Math.abs(t.offset.x)),h[0]}function RD(e,t,n){const r=e.key?n.component(e.key):n.componentsFromPoint({x:t.clientX,y:t.clientY})[0];if(!r)return{x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1}};const i=r.rect;return Dv({scaleRatio:i.scaleRatio},i.computedInner)}const LD={bounds:function(e){let t=e.resources,n=e.nodes,r=e.pointer,i=e.width,o=e.height,a=e.options;const s=r.targetBounds,l=t.getNodeBoundsRelativeToTarget(n[0]),c=l.x,u=l.y,d=l.width,f=l.height,h={left:{x:c,y:u+f/2},right:{x:c+d,y:u+f/2},top:{x:c+d/2,y:u},bottom:{x:c+d/2,y:u+f},inside:{x:c+d/2,y:u+f/2}},p=OD(a.offset),m=p[a.dock];if(m)return{computedTooltipStyle:{left:"".concat(h[a.dock].x,"px"),top:"".concat(h[a.dock].y,"px"),transform:m},computedArrowStyle:DD(a.offset)[a.dock],dock:a.dock};const g={width:"target"===a.area?s.width:window.innerWidth,height:"target"===a.area?s.height:window.innerHeight},y=ND(i,o,a.offset),v=["top","left","right","bottom","inside"];for(let e=0;e<v.length;e+=1){const t=v[e];if(TD(g,"target"===a.area?h[t].x:s.left+h[t].x,"target"===a.area?h[t].y:s.top+h[t].y,i,o,y[t]))return{computedTooltipStyle:{left:"".concat(h[t].x,"px"),top:"".concat(h[t].y,"px"),transform:p[t]},computedArrowStyle:DD(a.offset)[t],dock:t}}const b=function(e){let t=e.options,n=e.docks,r=e.dockOffsets,i=e.targetBounds,o=e.area,a=e.width;const s="top",l="target"===t.area?n[s].x:i.left+n[s].x,c=("target"===t.area?n[s].y:(i.top,n[s].y),r[s]),u=l+c.x,d=(c.y,a);let f=n.top.x;return u<0&&u+d>o.width||(u<0?f-=u:u+d>o.width&&(f-=u+d-o.width)),f}({options:a,docks:h,dockOffsets:y,targetBounds:s,area:g,width:i});return{computedTooltipStyle:{left:"".concat(b,"px"),top:"".concat(h.top.y,"px"),transform:p.top},computedArrowStyle:DD(a.offset+b-h.top.x,a.offset).top,dock:"top"}},pointer:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height;return ID({x:n.x,y:n.y,pointer:n,width:r,height:i,options:t,dockOrder:["top","left","right","bottom"]})},slice:function(e){let t=e.options,n=e.pointer,r=e.width,i=e.height,o=e.nodes,a=e.resources;const s=o[0],l=n.dx,c=n.dy,u=a.getComponentBoundsFromNode(s),d=l+u.x+u.width/2,f=c+u.y+u.height/2,h=s.desc.slice,p=h.start,m=h.end,g=h.outerRadius,y=(p+m)/2-Math.PI/2,v=2*Math.PI,b=(y%v+v)%v;let x=["top","left","right","bottom"];return"auto"===t.dock&&(x=b<=Math.PI/4||b>=7*Math.PI/4?["right","top","bottom","left"]:b<=3*Math.PI/4?["bottom","left","right","top"]:b<=5*Math.PI/4?["left","top","bottom","right"]:["top","left","right","bottom"]),ID({x:d+g*u.scaleRatio.x*Math.cos(b),y:f+g*u.scaleRatio.y*Math.sin(b),pointer:n,width:r,height:i,options:t,dockOrder:x})}};function _D(e,t){let n=e.width,r=e.height,i=t.chart,o=t.state,a=t.props;const s={resources:{formatter:i.formatter,scale:i.scale,component:i.component,getComponentBoundsFromNode:e=>RD(e,o.pointer,i),getNodeBoundsRelativeToTarget:e=>function(e,t,n){const r=RD(e,t,n),i=e.bounds;return{x:r.x+t.dx+i.x,y:r.y+t.dy+i.y,width:i.width,height:i.height}}(e,o.pointer,i)},nodes:o.activeNodes,pointer:o.pointer,width:n,height:r},l=typeof a.placement;if("object"===l&&"function"==typeof a.placement.fn)return a.placement.fn(s);let c={type:"pointer",offset:8,dock:"auto",area:"viewport"};"function"===l&&(c=Dv(c,a.placement(s))),"object"===l&&LD[a.placement.type]?c=Dv(c,a.placement):"string"===l&&LD[a.placement]&&(c=Dv(c,{type:a.placement})),s.options=c;const u=LD[c.type](s);let d=s.resources.getComponentBoundsFromNode(s.nodes[0]),f=d.x,h=d.y,p=d.width,m=d.height;return f+=s.pointer.dx,p+=f,h+=s.pointer.dy,m+=h,u.computedTooltipStyle.left="".concat(Math.min(Math.max(0,f,parseFloat(u.computedTooltipStyle.left)),p),"px"),u.computedTooltipStyle.top="".concat(Math.min(Math.max(0,h,parseFloat(u.computedTooltipStyle.top)),m),"px"),u}let PD;function zD(){PD=null}const FD={duration:8e3,delay:500,filter:e=>e.filter(e=>e.data&&void 0!==e.data.value),extract:e=>e.node.data.value,content:e=>{let t=e.h;return e.data.map(e=>t("div",{},e))},isEqual:(e,t)=>e.length&&e.length===t.length&&e.every((e,n)=>t[n]&&JSON.stringify(e.data)===JSON.stringify(t[n].data)),placement:{type:"pointer",dock:"auto",offset:8,area:"viewport"},tooltipClass:{},contentClass:{},arrowClass:{},direction:"ltr",appendTo:void 0,beforeShow:void 0,afterShow:void 0,beforeHide:void 0,onHide:void 0,afterHide:void 0};const jD={require:["chart","renderer"],defaultSettings:{settings:FD,style:{tooltip:{},content:{backgroundColor:"$gray-25",color:"$font-color--inverted",fontFamily:"$font-family",fontSize:"$font-size",lineHeight:"$line-height",borderRadius:"4px",padding:"8px",opacity:.9},arrow:{position:"absolute",width:"0px",height:"0px",borderStyle:"solid",color:"$gray-25",opacity:.9},"arrow-bottom":{borderTopColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-top":{borderBottomColor:"transparent",borderLeftColor:"transparent",borderRightColor:"transparent"},"arrow-right":{borderTopColor:"transparent",borderLeftColor:"transparent",borderBottomColor:"transparent"},"arrow-left":{borderTopColor:"transparent",borderBottomColor:"transparent",borderRightColor:"transparent"}}},renderer:"dom",on:{hide(){this.hide()},show(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.show(e,t)},prevent(e){this.prevent(e)}},hide(){this.dispatcher.clear(),this.state.activeNodes=[],this.state.pointer={}},show(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.nodes,i=n.duration,o=n.delay;!this.state.prevent&&this.state.targetElement&&(this.state.pointer=function(e,t){let n=t.chart,r=t.state,i=0,o=0;e.center?(i+=e.center.x,o+=e.center.y):(i+=e.clientX,o+=e.clientY);const a=n.element.getBoundingClientRect(),s=r.targetElement.getBoundingClientRect(),l=i,c=o,u=a.left-s.left,d=a.top-s.top,f=i-a.left,h=o-a.top;return i-=s.left,o-=s.top,{x:i,y:o,dx:u,dy:d,cx:f,cy:h,clientX:l,clientY:c,targetBounds:s,chartBounds:a}}(e,this),t=Array.isArray(r)?this.props.filter(r):this.props.filter(this.chart.shapesAt({x:this.state.pointer.cx,y:this.state.pointer.cy})),this.props.isEqual(this.state.activeNodes,t)||(this.dispatcher.clear(),this.state.activeNodes=t,this.state.activeNodes.length&&this.dispatcher.invoke(()=>this.invokeRenderer(this.state.activeNodes),i,o)))},prevent(e){this.state.prevent=!!e},init(e){this.state={activeNodes:[],pointer:{},targetElement:null,prevent:!1},this.props=e.settings,this.dispatcher=AD({defaultDuration:this.props.duration,defaultDelay:this.props.delay});const t=this.dispatcher.clear;this.dispatcher.on("pending",()=>{!function(e){PD&&PD!==e&&PD()}(t),PD=t,"function"==typeof this.props.beforeShow&&this.props.beforeShow.call(void 0,{resources:{formatter:this.chart.formatter,scale:this.chart.scale}})}),this.dispatcher.on(["cancelled","fulfilled"],()=>{const e={resources:{formatter:this.chart.formatter,scale:this.chart.scale}};"function"==typeof this.props.beforeHide&&this.props.beforeHide.call(void 0,Dv({element:this.state.tooltipElm},e)),"function"==typeof this.props.onHide?this.props.onHide.call(void 0,Dv({element:this.state.tooltipElm},e)):this.renderer.clear([]),"function"==typeof this.props.afterHide&&this.props.afterHide.call(void 0,e),PD===t&&(PD=null),this.state.tooltipElm=void 0}),this.dispatcher.on("active",()=>{"function"==typeof this.props.afterShow&&this.props.afterShow.call(void 0,{element:this.state.tooltipElm,resources:{formatter:this.chart.formatter,scale:this.chart.scale}})})},created(){this.init(this.settings)},beforeUpdate(e){let t=e.settings;this.dispatcher&&(this.dispatcher.destroy(),zD()),this.init(t)},render(e){return this.h=e,[]},beforeDestroy(){this.dispatcher.destroy(),zD()},appendTo(){if(this.props.appendTo){this.state.targetElement="function"==typeof this.props.appendTo?this.props.appendTo({resources:{formatter:this.chart.formatter,scale:this.chart.scale}}):this.props.appendTo;const e=this.state.targetElement.getBoundingClientRect(),t=e.width,n=e.height;this.renderer.destroy(),this.renderer.size({width:t,height:n}),this.renderer.appendTo(this.state.targetElement)}else this.state.targetElement=this.renderer.element()},mounted(){this.appendTo()},updated(){this.appendTo()},invokeRenderer(e){const t=function(e,t){let n=t.chart,r=t.scale,i=t.props,o=t.h;const a={resources:{dataset:n.dataset,scale:n.scale,formatter:n.formatter},scale:r,h:o},s=[];return e.forEach(e=>{if("function"==typeof i.extract){const t=Dv({node:e},a);s.push(i.extract(t))}}),s}(e,this),n=_D(CD(t,{},this).getBoundingClientRect(),this);this.state.tooltipElm=CD(t,n,this)}};const $D={require:["renderer","chart"],defaultSettings:{settings:{target:"",selector:"*",fill:"rgba(0, 255, 0, 0.1)",stroke:"lime",opacity:1,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes(this.props.selector).filter(e=>e.key===this.props.target),t=e.filter(e=>e.collider).map(e=>e.collider);t.forEach(e=>{e.fill=this.props.fill,e.stroke=this.props.stroke,e.opacity=this.props.opacity,e.collider={type:null}}),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}},BD={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},VD=/([astvzqmhlc])([^astvzqmhlc]*)/gi,HD=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi;function UD(e){const t=[],n=String(e).trim();return"M"!==n[0]&&"m"!==n[0]||n.replace(VD,(e,n,r)=>{const i=function(e){const t=e.match(HD);return t?t.map(Number):[]}(r);let o=n.toLowerCase(),a=n;if("m"===o&&i.length>2&&(t.push([a,...i.splice(0,2)]),o="l",a="m"===a?"l":"L"),i.length<BD[o])return"";for(t.push([a,...i.splice(0,BD[o])]);i.length>=BD[o]&&i.length&&BD[o];)t.push([a,...i.splice(0,BD[o])]);return""}),t}const WD=2*Math.PI;function YD(e,t){return{x:.5*(e.x+t.x),y:.5*(e.y+t.y)}}function KD(e,t,n,r,i){const o=1-e;return o**3*t+3*o**2*e*n+3*o*e**2*r+e**3*i}function GD(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:8;if(o<1||function(e,t,n,r){return Math.abs(e.x+n.x-(t.x+t.x))+Math.abs(e.y+n.y-(t.y+t.y))+Math.abs(t.x+r.x-(n.x+n.x))+Math.abs(t.y+r.y-(n.y+n.y))}(e,t,n,r)<=10)return i[i.length-1]!==e&&i.push(e),i.push(r),i;const a=YD(e,t),s=YD(t,n),l=YD(n,r),c={x:KD(.5,e.x,t.x,n.x,r.x),y:KD(.5,e.y,t.y,n.y,r.y)},u=YD(a,s),d=YD(s,l);return GD(e,a,u,c,i,o-1),GD(c,d,l,r,i,o-1),i}function XD(e,t,n){const r=function(e,t,n){return{cp1:{x:e.x+2/3*(t.x-e.x),y:e.y+2/3*(t.y-e.y)},cp2:{x:n.x+2/3*(t.x-n.x),y:n.y+2/3*(t.y-n.y)}}}(e,t,n);return GD(e,r.cp1,r.cp2,n)}function JD(e,t,n){const r=[],i=!!e[4],o=!!e[5],a=e[3];let s,l,c,u,d=e[6],f=e[7],h=e[1],p=e[2];if("a"===e[0]&&(d+=t,f+=n),t===f&&n===f)return r;if(!h||!p)return r.push({x:d,y:f}),r;var m=function(e,t,n,r,i,o,a,s,l){let c,u,d,f,h,p;const m=mk(n%360),g=Math.cos(m),y=Math.sin(m),v=(s-o)/2,b=(l-a)/2,x=g*v+y*b,S=g*b-y*v;p=x**2/(e=Math.abs(e))**2+S**2/(t=Math.abs(t))**2,p>1&&(p=Math.sqrt(p),e*=p,t*=p);const M=e*S,w=t*x,E=M**2+w**2,k=(e*t)**2-E;let C=Math.sqrt(Math.max(k/E,0));r===i&&(C=-C);const A=C*(M/t),O=C*(-w/e);f=g*A-y*O+(s+o)/2,h=y*A+g*O+(l+a)/2;const N=(x-A)/e,D=(S-O)/t,T=(-x-A)/e,q=(-S-O)/t;return c=Math.atan2(D,N),c+=c<0?WD:0,u=Math.atan2(q,T),u+=u<0?WD:0,d=u-c,!i&&c<u?d-=WD:i&&u<c&&(d+=WD),d%=WD,{startAngle:c,sweepAngle:d,cx:f,cy:h,rx:e,ry:t}}(h,p,a,i,o,d,f,t,n);s=m.cx,l=m.cy,h=m.rx,p=m.ry,c=m.sweepAngle,u=m.startAngle;const g=Math.abs(c*Math.sqrt((h**2+p**2)/2)),y=Math.ceil(g/10),v=c/y;for(let e=1;e<=y;e++){const t=(u+v*e)%WD,n=Math.cos(t),i=Math.sin(t);r.push({x:s+n*h+-i*n,y:l+i*p+n*i})}return r}function ZD(e){const t=UD(e),n=[],r=[];let i=0,o=0,a=null,s=null,l=null,c=null;for(let e=0;e<t.length;++e){const u=t[e],d=u[0];switch("S"!==d&&"s"!==d&&"C"!==d&&"c"!==d&&(a=null,s=null),"T"!==d&&"t"!==d&&"Q"!==d&&"q"!==d&&(l=null,c=null),d){case"m":r.length&&n.push(r.splice(0));case"l":i+=u[1],o+=u[2],r.push({x:i,y:o});break;case"M":r.length&&n.push(r.splice(0));case"L":i=u[1],o=u[2],r.push({x:i,y:o});break;case"H":i=u[1],r.push({x:i,y:o});break;case"h":i+=u[1],r.push({x:i,y:o});break;case"V":o=u[1],r.push({x:i,y:o});break;case"v":o+=u[1],r.push({x:i,y:o});break;case"a":r.push(...JD(u,i,o)),i+=u[6],o+=u[7];break;case"A":r.push(...JD(u,i,o)),i=u[6],o=u[7];break;case"c":r.push(...GD({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o},{x:u[5]+i,y:u[6]+o})),a=u[3]+i,s=u[4]+o,i+=u[5],o+=u[6];break;case"C":r.push(...GD({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]},{x:u[5],y:u[6]})),a=u[3],s=u[4],i=u[5],o=u[6];break;case"s":null!==a&&null!==a||(a=i,s=o),r.push(...GD({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),a=u[1]+i,s=u[2]+o,i+=u[3],o+=u[4];break;case"S":null!==a&&null!==a||(a=i,s=o),r.push(...GD({x:i,y:o},{x:2*i-a,y:2*o-s},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),a=u[1],s=u[2],i=u[3],o=u[4];break;case"Q":r.push(...XD({x:i,y:o},{x:u[1],y:u[2]},{x:u[3],y:u[4]})),l=u[1],c=u[2],i=u[3],o=u[4];break;case"q":r.push(...XD({x:i,y:o},{x:u[1]+i,y:u[2]+o},{x:u[3]+i,y:u[4]+o})),l=u[1]+i,c=u[2]+o,i+=u[3],o+=u[4];break;case"T":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...XD({x:i,y:o},{x:l,y:c},{x:u[1],y:u[2]})),i=u[1],o=u[2];break;case"t":null!==l&&null!==l||(l=i,c=o),l=2*i-l,c=2*o-c,r.push(...XD({x:i,y:o},{x:l,y:c},{x:u[1]+i,y:u[2]+o})),i+=u[1],o+=u[2];break;case"z":case"Z":r.length&&r.push({x:r[0].x,y:r[0].y})}}return function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];Math.abs(n.x-r.x)<1e-12&&Math.abs(n.y-r.y)<1e-12&&(e.splice(t,1),t--)}}(r),n.push(r.splice(0)),n}const QD={require:["renderer","chart"],defaultSettings:{settings:{target:"",fill:"transparent",stroke:"lime",opacity:1,radius:2,useOuterRect:!1}},on:{update(){this.draw()}},draw(){const e=this.chart.findShapes("path").filter(e=>e.key===this.props.target),t=[];e.forEach(e=>{ZD(e.attrs.d).forEach(e=>{e.forEach(e=>{t.push({type:"circle",cx:e.x,cy:e.y,r:this.props.radius,fill:this.props.fill,stroke:this.props.stroke,opacity:this.props.opacity,collider:{type:null}})})})}),this.renderer.render(t)},created(){this.props=this.settings.settings},resize(e){let t=e.outer,n=e.inner;return this.props.useOuterRect?t:n},render(){},mounted(){this.draw()},updated(){this.props=this.settings.settings,this.draw()}};var eT=[function(e){e.component("box",tA),e.component("box-marker",tA)},function(e){e.component("point",cA),e.component("point-marker",cA)},function(e){e.component("pie",hA)},function(e){e.component("grid-line",vA)},function(e){e.component("ref-line",NA)},function(e){e.component("axis",iO)},function(e){e.component("container",oO)},function(e){e.component("text",lO)},function(e){e.component("scrollbar",dO)},function(e){e.component("brush-range",CO),e.component("brush-area-dir",DO)},function(e){e.component("range",RO)},function(e){e.component("brush-lasso",jO)},function(e){e.component("labels",ZN)},function(e){e.component("legend-cat",dD)},function(e){e.component("legend-seq",yD)},function(e){e.component("line",SD)},function(e){e.component("brush-area",kD)},function(e){e.component("tooltip",jD)},function(e){e.component("debug-collider",$D)},function(e){e.component("debug-path-to-points",QD)}];let tT=class{constructor(e){this._parent=null,this._children=[],this._ancestors=null,this.type=e,this.data=null}detach(){return this._parent&&this._parent.removeChild(this),this}get parent(){return this._parent}get isBranch(){return this._children&&this._children.length}get children(){return this._children}get ancestors(){return this._ancestors||(this._ancestors=[],this.parent&&this._ancestors.push(this.parent,...this.parent.ancestors)),this._ancestors}get descendants(){let e=[];const t=this.children.length;let n,r;for(n=0;n<t;n++)r=this.children[n],e.push(r),r.children.length&&(e=[...e,...r.descendants]);return e}equals(e){const t=this.children,n=e.children;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(!t[e].equals(n[e]))return!1;return!0}toJSON(){return{type:this.type,children:this.children.map(e=>e.toJSON())}}};class nT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,f=void 0===d?0:d;this.set({x:n,y:i,width:a,height:l,minWidth:u,minHeight:f})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.minWidth,u=void 0===c?0:c,d=e.minHeight,f=void 0===d?0:d;this.type="rect",a>=0?(this.x=n,this.width=Math.max(a,u)):(this.x=n+Math.min(a,-u),this.width=-Math.min(a,-u)),l>=0?(this.y=i,this.height=Math.max(l,f)):(this.y=i+Math.min(l,-f),this.height=-Math.min(l,-f))}containsPoint(e){return tC(this,e)}intersectsLine(e){return nC(this,Hv(e))}intersectsRect(e){return Qk(this,Vv(e))}intersectsCircle(e){return Yk(e,this)}intersectsPolygon(e){return Zk(e,this)}intersectsGeoPolygon(e){return uC(e,this)}points(){return[{x:this.x,y:this.y},{x:this.x+this.width,y:this.y},{x:this.x+this.width,y:this.y+this.height},{x:this.x,y:this.y+this.height}]}}class rT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.set({cx:n,cy:i,r:a,minRadius:l})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.minRadius,l=void 0===s?0:s;this.type="circle",this.cx=n,this.cy=i,this.r=Math.max(a,l),this.vector={x:this.cx,y:this.cy}}containsPoint(e){return Wk(this,e)}intersectsLine(e){return Kk(this,Hv(e))}intersectsRect(e){return Yk(this,Vv(e))}intersectsCircle(e){return n=e,!Bk(t=this)&&!Bk(n)&&(t.cx-n.cx)**2+(t.cy-n.cy)**2<=(t.r+n.r)**2;var t,n}intersectsPolygon(e){return Gk(this,e)}intersectsGeoPolygon(e){return sC(this,e)}points(){return[{x:this.cx,y:this.cy}]}}class iT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.tolerance,u=void 0===c?0:c;this.set({x1:n,y1:i,x2:a,y2:l,tolerance:u})}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.tolerance,u=void 0===c?0:c;this.type="line",this.x1=n,this.y1=i,this.x2=a,this.y2=l,this.tolerance=Math.max(0,Math.round(u)),this.vectors=this.points(),this.zeroSize=n===a&&i===l}containsPoint(e){if(this.tolerance>0){return Kk({cx:e.x,cy:e.y,r:this.tolerance},this)}return iC(this,e)}intersectsLine(e){return rC(this,Hv(e))}intersectsRect(e){return nC(Vv(e),this)}intersectsCircle(e){return Kk(e,this)}intersectsPolygon(e){return Jk(e,this)}intersectsGeoPolygon(e){return cC(e,this)}points(){return[{x:this.x1,y:this.y1},{x:this.x2,y:this.y2}]}}class oT{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;if(this.type="polygon",this.vertices=t.slice(),this.edges=[],function(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}(this.vertices),!(this.vertices.length<=2)){!function(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}(this.vertices),this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.vertices.length;e++)e<this.vertices.length-1&&this.edges.push([this.vertices[e],this.vertices[e+1]]),this.xMin=isNaN(this.xMin)?this.vertices[e].x:Math.min(this.xMin,this.vertices[e].x),this.xMax=isNaN(this.xMax)?this.vertices[e].x:Math.max(this.xMax,this.vertices[e].x),this.yMin=isNaN(this.yMin)?this.vertices[e].y:Math.min(this.yMin,this.vertices[e].y),this.yMax=isNaN(this.yMax)?this.vertices[e].y:Math.max(this.yMax,this.vertices[e].y);this._bounds=null,this._boundingRect=null}}containsPoint(e){return Xk(this,e)}intersectsCircle(e){return Gk(e,this)}intersectsLine(e){return Jk(this,Hv(e))}intersectsRect(e){return Zk(this,Vv(e))}intersectsPolygon(e){return oC(this,e)}intersectsGeoPolygon(e){return aC(e,this)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function aT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new oT(...t)}function sT(e){const t=e[0],n=e[e.length-1];t.x===n.x&&t.y===n.y||e.push(t)}function lT(e){for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1];n.x===r.x&&n.y===r.y&&(e.splice(t,1),t--)}}class cT{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[[]]:e;this.set({vertices:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).vertices,t=void 0===e?[]:e;this.type="geopolygon",this.vertices=t.slice(),this.numPolygons=this.vertices.length,this.polygons=[],this.xMin=NaN,this.yMin=NaN,this.xMax=NaN,this.yMax=NaN;for(let e=0;e<this.numPolygons;e++)lT(this.vertices[e]),this.vertices[e].length>2&&sT(this.vertices[e]),this.polygons[e]=aT({vertices:this.vertices[e]}),this.xMin=isNaN(this.xMin)?this.polygons[e].xMin:Math.min(this.xMin,this.polygons[e].xMin),this.xMax=isNaN(this.xMax)?this.polygons[e].xMax:Math.max(this.xMax,this.polygons[e].xMax),this.yMin=isNaN(this.yMin)?this.polygons[e].yMin:Math.min(this.yMin,this.polygons[e].yMin),this.yMax=isNaN(this.yMax)?this.polygons[e].yMax:Math.max(this.yMax,this.polygons[e].yMax);this._bounds=null,this._boundingRect=null}containsPoint(e){return lC(this,e)}intersectsCircle(e){return sC(e,this)}intersectsLine(e){return cC(this,Hv(e))}intersectsRect(e){return uC(this,Vv(e))}intersectsPolygon(e){return aC(this,e)}intersectsGeoPolygon(e){return function(e,t){const n=e.boundingRect(),r=t.boundingRect();return!!Qk(n,r)&&(eC(r,n)?Uk(t,e):Uk(e,t))}(this,e)}points(){return this.vertices}bounds(){return this._bounds||(this._bounds=[{x:this.xMin,y:this.yMin},{x:this.xMax,y:this.yMin},{x:this.xMax,y:this.yMax},{x:this.xMin,y:this.yMax}]),this._bounds}boundingRect(){return this._boundingRect||(this._boundingRect={x:this.xMin,y:this.yMin,width:this.xMax-this.xMin,height:this.yMax-this.yMin}),this._boundingRect}}function uT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cT(...t)}function dT(e,t){return e.x!==t.x||e.y!==t.y}class fT{constructor(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;this.set({points:t})}set(){let e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).points,t=void 0===e?[]:e;if(this.type="polyline",this.segments=[],this._points=t.slice(),this._points.length>1)for(let e=0,t=this._points.length-1;e<t;e++)dT(this._points[e],this._points[e+1])&&this.segments.push({x1:this._points[e].x,y1:this._points[e].y,x2:this._points[e+1].x,y2:this._points[e+1].y})}containsPoint(e){return this.segments.some(t=>iC(t,e))}intersectsCircle(e){return this.segments.some(t=>Kk(e,t))}intersectsLine(e){const t=Hv(e);return this.segments.some(e=>rC(e,t))}intersectsRect(e){const t=Vv(e);return this.segments.some(e=>nC(t,e))}intersectsPolygon(e){return this.segments.some(t=>Jk(e,t))}intersectsGeoPolygon(e){return this.segments.some(t=>cC(e,t))}points(){return this._points}}const hT=Jb();function pT(e,t){return hT.get(e)(t)}hT.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new nT(...t)}),hT.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new rT(...t)}),hT.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new iT(...t)}),hT.add("polygon",aT),hT.add("geopolygon",uT),hT.add("polyline",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new fT(...t)});class mT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.geometries=[],e.forEach(e=>{const t=pT(e.type,e);t&&this.geometries.push(t)})}containsPoint(e){return this.geometries.some(t=>t.containsPoint(e))}intersectsLine(e){return this.geometries.some(t=>t.intersectsLine(e))}intersectsRect(e){return this.geometries.some(t=>t.intersectsRect(e))}intersectsCircle(e){return this.geometries.some(t=>t.intersectsCircle(e))}intersectsPolygon(e){return this.geometries.some(t=>t.intersectsPolygon(e))}intersectsGeoPolygon(e){return this.geometries.some(t=>t.intersectsGeoPolygon(e))}}class gT{constructor(){this._elements=[[1,0,0],[0,1,0],[0,0,1]],this._stack=[]}clone(){return(new gT).multiply(this)}set(e){return this._elements=e,this}save(){return this._stack.push(this.elements),this}restore(){return this._stack.length&&(this._elements=this._stack.pop()),this}add(e){let t,n;for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]+=e;return this}translate(e,t){return this.multiply([[1,0,e],[0,1,t],[0,0,1]]),this}rotate(e){let t=Math.cos(-e),n=Math.sin(-e);return this.multiply([[t,n,0],[-n,t,0],[0,0,1]]),this}multiply(e){let t,n,r,i;if(e instanceof gT&&(e=e._elements),Array.isArray(e)){for(r=[[0,0,0],[0,0,0],[0,0,0]],t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)for(i=0;i<3;i++)r[t][n]+=this._elements[t][i]*e[i][n];this._elements=r}else for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)this._elements[t][n]*=e;return this}scale(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return this.multiply([[e,0,0],[0,t,0],[0,0,1]]),this}transform(e,t,n,r,i,o){return this.multiply([[e,n,i],[t,r,o],[0,0,1]]),this}determinant(){let e=this._elements[0][0],t=this._elements[0][1],n=this._elements[0][2],r=this._elements[1][0],i=this._elements[1][1],o=this._elements[1][2],a=this._elements[2][0],s=this._elements[2][1],l=this._elements[2][2],c=0;return c=e*i*l+t*o*a+n*r*s-n*i*a-t*r*l-e*o*s,c}invert(){let e=this.determinant(),t=this._elements[0][0],n=this._elements[0][1],r=this._elements[0][2],i=this._elements[1][0],o=this._elements[1][1],a=this._elements[1][2],s=this._elements[2][0],l=this._elements[2][1],c=this._elements[2][2];return this._elements=[[o*c-a*l,r*l-n*c,n*a-r*o],[a*s-i*c,t*c-r*s,r*i-t*a],[i*l-o*s,s*n-t*l,t*o-n*i]],this.multiply(1/e),this}transpose(){const e=Object.create(this._elements);return this._elements=[[e[0][0],e[1][0],e[2][0]],[e[0][1],e[1][1],e[2][1]],[e[0][2],e[1][2],e[2][2]]],this}identity(){return this._elements=[[1,0,0],[0,1,0],[0,0,1]],this}toString(){return"".concat(this._elements.map(e=>e.join("\t")).join("\n"))}isIdentity(){const e=this._elements;return 1===e[0][0]&&0===e[0][1]&&0===e[0][2]&&0===e[1][0]&&1===e[1][1]&&0===e[1][2]&&0===e[2][0]&&0===e[2][1]&&1===e[2][2]}transformPoint(e){let t,n,r=[e.x,e.y,1],i=this._elements,o=[0,0,0];for(t=0;t<this._elements.length;t++)for(n=0;n<this._elements[t].length;n++)o[t]+=r[n]*i[t][n];return{x:o[0],y:o[1]}}transformPoints(e){let t,n,r,i,o,a=this._elements,s=[];for(i=0;i<e.length;i++){for(t=[e[i].x,e[i].y,1],o=[0,0,0],n=0;n<this._elements.length;n++)for(r=0;r<this._elements[n].length;r++)o[n]+=t[r]*a[n][r];s.push({x:o[0],y:o[1]})}return s}get elements(){const e=this._elements;return[[e[0][0],e[0][1],e[0][2]],[e[1][0],e[1][1],e[1][2]],[e[2][0],e[2][1],e[2][2]]]}}const yT=/(translate|scale|rotate|matrix)\(([0-9,.eE+-\s]+)(?:,|\s?)+\)/g;function vT(e,t){const n=t.args[0]*(Math.PI/180);if(t.args.length>2){const r=t.args[1],i=t.args[2];e.translate(r,i),e.rotate(n),e.translate(-r,-i)}else 1===t.args.length&&e.rotate(n)}function bT(e,t){const n=t.args[0],r=isNaN(t.args[1])?t.args[0]:t.args[1];e.scale(n,r)}function xT(e,t){const n=t.args[0],r=isNaN(t.args[1])?0:t.args[1];e.translate(n,r)}function ST(e,t){t.args.length>=6&&e.transform(...t.args)}function MT(e,t){const n=function(e){let t,n=[];for(;null!==(t=yT.exec(e));){const e=t[2].trim(),r=-1===e.indexOf(",")?e.split(" "):e.split(",");n.push({cmd:t[1],args:r.filter(e=>e.trim().length>0).map(e=>Number(e))})}return n}(e);let r;for(let e=0,i=n.length;e<i;e++)r=n[e],"rotate"===r.cmd?vT(t,r):"scale"===r.cmd?bT(t,r):"matrix"===r.cmd?ST(t,r):"translate"===r.cmd&&xT(t,r)}const wT={type:/^\w[\w-]+/,attr:/^\[\w(?:[\w\._-]+)?(?:[!]?=['\"][\w\s*#_-]*['\"])?\]/,universal:/^(\*)/,tag:/^\.(\w+)/},ET={type:(e,t)=>t.filter(t=>{const n=t.type;return!!n&&n.toLowerCase()===e.toLowerCase()}),attr:(e,t,n,r)=>r.filter(r=>{const i=r.attrs[e];if(!t)return void 0!==i;if(void 0===i)return!1;switch(t){case"=":return n===String(i);case"!=":return n!==String(i);default:return!1}}),universal:e=>e,tag:(e,t)=>t.filter(t=>{const n=t.tag;return!!n&&-1!==n.trim().split(/\s+/).indexOf(e.replace(".",""))})};function kT(e,t){if(!t||!t.length||!e||"function"!=typeof ET[e.type])return[];switch(e.type){case"type":case"tag":return ET[e.type](e.value,t);case"attr":return ET[e.type](e.attribute,e.operator,e.attributeValue,t);case"universal":return ET[e.type](t);default:return[]}}var CT={find:function(e,t){const n=[],r=[];let i,o;if(t.isBranch){let a;i=function(e){const t=[];let n,r,i,o;return e.split(/\s*,\s*/).forEach(e=>{e=e.trim(),n=[];const a=t=>{i=e.match(wT[t]),i&&(o=!0,e=e.slice(i[0].length),r={type:t,value:i[0]},"attr"===t&&(i=i[0].match(/\[(\w[\w\._-]+)?(?:([!]?=)['\"]([\w\s#_-]*)['\"])?\]/),r.attribute=i[1],r.operator=i[2],r.attributeValue=i[3]),n.push(r))};for(;e&&(o=!1,i=e.match(/^\s*([>+~]|\s)\s*/),i&&(o=!0,n.push({type:" ",value:i[0]}),e=e.slice(i[0].length)),Object.keys(wT).forEach(a),n&&n.length&&t.indexOf(n)<0&&t.push(n),o););}),t}(e),o=t.descendants;for(let e=0,t=i.length;e<t;e++){a=i[e];const t=[];let n=o.slice(),s=!1;a.reverse().forEach(e=>{if(" "===e.type)return t.push(n),n=o.slice(),void(s=!1);n=kT(e,n),s=!0}),s&&t.push(n);const l=t[0].filter(e=>{let n,r=e.parent;for(let e=1;e<t.length;e++){for(n=t[e].indexOf(r);r&&n<0;)r=r.parent,n=t[e].indexOf(r);if(n<0)return!1}return!0});r.push(l)}for(let e=0,t=r.length;e<t;e++)for(let t=0,i=r[e].length;t<i;t++)n.indexOf(r[e][t])<0&&n.push(r[e][t])}return n||[]}};function AT(e,t,n){const r=e.type;let i=e.points();n&&(i=i.every(e=>Array.isArray(e))?i.map(e=>n.transformPoints(e)):n.transformPoints(i)),function(e,t){for(let n=0,r=e.length;n<r;n++)e[n].x/=t,e[n].y/=t}(i,t);let o=null;if("rect"===r||"bounds"===r)o=Vv(i),o.type=r;else if("circle"===r)o=function(e,t){return{cx:e[0].x,cy:e[0].y,r:t}}(i,e.r),o.type=r;else if("line"===r)o=Hv(i),o.type=r;else if("polygon"===r||"polyline"===r){o={type:"path",d:hk(i,"polygon"===r)}}else if("geopolygon"===r){let e="";for(let t=0;t<i.length;t++)e+=hk(i[t],!0);o={type:"path",d:e}}return o}class OT{constructor(e){this._bounds=function(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const n=e.boundingRect?e.boundingRect(t):{x:0,y:0,width:0,height:0};return{x:n.x,y:n.y,width:n.width,height:n.height}},this._attrs=e.attrs,this._type=e.type,this._data=e.data,this._dpi=e.stage?e.stage.dpi:1,this._collider=()=>function(e,t){if(e.collider){const n=e.modelViewMatrix;return"collection"===e.colliderType?{type:"container",children:e.collider.geometries.map(e=>AT(e,t,n))}:AT(e.collider,t,n)}return null}(e,this._dpi),this._desc=e.desc,this._tag=e.tag,this._children=()=>e.children.map(e=>new OT(e)),this._parent=()=>e.parent?new OT(e.parent):null,this._cache={elementBoundingRect:null},this._getElementBoundingRect=()=>(!this._cache.elementBoundingRect&&this.element&&(this._cache.elementBoundingRect=this.element.getBoundingClientRect()),this._cache.elementBoundingRect||{left:0,top:0})}get children(){return this._children()}get parent(){return this._parent()}get type(){return this._type}get data(){return this._data}get attrs(){return this._attrs}set element(e){this._cache.elementBoundingRect=null,this._element=e}get element(){return this._element}set key(e){this._key=e}get key(){return this._key}get bounds(){const e=this._bounds();return e.x/=this._dpi,e.y/=this._dpi,e.width/=this._dpi,e.height/=this._dpi,e}get localBounds(){return this._bounds(!1)}boundsRelativeTo(e){const t=typeof e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.bounds:this.localBounds,r=this._getElementBoundingRect();let i=r.left,o=r.top;if("object"===t&&null!==e&&"function"==typeof e.getBoundingClientRect){const t=e.getBoundingClientRect(),n=t.left,r=void 0===n?0:n,a=t.top;i-=r,o-=void 0===a?0:a}return n.x+=i,n.y+=o,n}get collider(){return this._collider()}get desc(){return this._desc}get tag(){return this._tag}}function NT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new OT(...t)}class DT{constructor(e){this._node=NT(e),this._parent=null,this._input=null}get node(){return this._node}set parent(e){this._parent=e}get parent(){return this._parent}set input(e){this._input=e}get input(){return this._input}}function TT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new DT(...t)}function qT(e,t){const n=e.parent;if(n&&"stage"!==n.type){t.parent=TT(n);const e=n.parent;e&&"stage"!==e.type&&qT(e,t.parent)}}function IT(e,t,n){if(null===e.colliderType)return null;const r=function(e,t){let n={};if(e.modelViewMatrix)if(Array.isArray(t))n=e.inverseModelViewMatrix.transformPoints(t);else if(isNaN(t.r))Array.isArray(t.vertices)?n.vertices=e.inverseModelViewMatrix.transformPoints(t.vertices):n=e.inverseModelViewMatrix.transformPoint(t);else{const i={x:t.cx,y:t.cy};var r=e.inverseModelViewMatrix.transformPoint(i);n.cx=r.x,n.cy=r.y,n.r=t.r}else n=t;return Array.isArray(n.vertices)&&(n=n.vertices.every(e=>Array.isArray(e))?uT(n):aT(n)),n}(e,n);return"frontChild"===e.colliderType?function(e,t,n){for(let r=e.descendants.length-1;r>=0;r--){const i=e.descendants[r];if(null!==i.collider&&i.collider[t](n)){const e=TT(i);return qT(i,e),e}}return null}(e,t,r):function(e,t,n){if(e.collider[t](n)){const t=TT(e);return qT(e,t),t}return null}(e,t,r)}function RT(e,t,n,r){const i=e.length;for(let o=0;o<i;o++){const i=e[o],a=IT(i,t,r);a&&n.push(a),!i.children||a||i.collider||RT(i.children,t,n,r)}}function LT(e,t,n){const r=e.length;for(let i=0;i<r;i++){const r=e[i];if(null!==IT(r,t,n))return!0;if(r.children&&!r.collider)return LT(r.children,t,n)}return!1}function _T(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;let n={};switch(Uv(e)){case"circle":return n.cx=e.cx*t,n.cy=e.cy*t,n.r=e.r,["intersectsCircle",n];case"rect":return n=Bv(e).map(e=>bk(e,t)),["intersectsRect",n];case"line":return n=$v(e).map(e=>bk(e,t)),["intersectsLine",n];case"point":return n=bk(e,t),["containsPoint",n];case"polygon":return n.vertices=e.vertices.map(e=>bk(e,t)),["intersectsPolygon",n];case"geopolygon":return n.vertices=e.vertices.map(e=>e.map(e=>bk(e,t))),["intersectsGeoPolygon",n];default:return[]}}function PT(e,t){const n=_v(_T(t,e.dpi),2),r=n[0],i=n[1],o=[];return r&&(RT([e],r,o,i),function(e,t){for(let n=0,r=t.length;n<r;n++)t[n].input=e}(t,o)),o}function zT(e,t){const n=_v(_T(t,e.dpi),2);return LT([e],n[0],n[1])}class FT extends tT{constructor(e){super(e),this._stage=null,this._collider={type:null,definition:null,fn:null},this._attrs={},this._node=null}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.node=e;const t=e.data,n=e.desc,r=e.tag,i=e.strokeReference,o=e.fillReference;var a,s;a=this.attrs,s=e,Object.keys(fk).forEach(e=>{const t=s[e];void 0!==t&&(a[fk[e]]=t)}),void 0!==t&&(this.data=t),"object"==typeof n&&(this.desc=Dv(!0,{},n)),"string"==typeof r&&(this.tag=r),"string"==typeof i&&(this.strokeReference=i),"string"==typeof o&&(this.fillReference=o)}findShapes(e){return CT.find(e,this).map(e=>NT(e))}getItemsFrom(e){return PT(this,e)}containsPoint(e){return zT(this,e)}intersectsLine(e){return zT(this,e)}intersectsRect(e){return zT(this,e)}intersectsCircle(e){return zT(this,e)}intersectsPolygon(e){return zT(this,e)}intersectsGeoPolygon(e){return zT(this,e)}resolveLocalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new gT;void 0!==this.attrs.transform&&MT(this.attrs.transform,e),this.modelViewMatrix=e.clone()}resolveGlobalTransform(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new gT;const t=this.ancestors;if(t.length>0)for(let n=t.length-1;n>=0;n--)t[n].resolveLocalTransform(e),e=t[n].modelViewMatrix;this.resolveLocalTransform(e)}attr(e){return this.attrs[e]}equals(e){const t=this.attrs,n=Object.keys(t),r=e.attrs,i=Object.keys(r);if(n.length!==i.length)return!1;for(let e=0;e<n.length;e++){const i=n[e];if(!Object.hasOwnProperty.call(r,i))return!1;if(t[i]!==r[i])return!1}return super.equals(e)}toJSON(){const e=super.toJSON();return e.attrs=this.attrs,e}get attrs(){return this._attrs}get stage(){return this._parent&&!this._stage?this._stage=this._parent.stage:this._parent||this._stage===this||(this._stage=null),this._stage}set modelViewMatrix(e){this._mvm=e,this._imvm=null}get modelViewMatrix(){return this._mvm}get inverseModelViewMatrix(){return this._imvm=this._imvm?this._imvm:this._mvm.clone().invert(),this._imvm}set node(e){this._node=e}get node(){return this._node}set collider(e){const t=Array.isArray(e)?"collection":e&&e.type;return"string"!=typeof t?(this._collider.type=null,this._collider.definition=null,void(this._collider.fn=null)):null!==this._collider&&this._collider.type===t&&null!==this._collider.fn?(this._collider.fn.set(e),void(this._collider.definition=e)):(this._collider.type=t,void(this._collider.definition=e))}get collider(){if(null!==this._collider.fn)return this._collider.fn;switch(this._collider.type){case"collection":this._collider.fn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new mT(...t)}(this._collider.definition);break;case"frontChild":return!0;case"bounds":this._collider.fn=pT("rect",this.boundingRect());break;case"line":case"rect":case"circle":case"polygon":case"geopolygon":case"polyline":this._collider.fn=pT(this._collider.type,this._collider.definition);break;default:return null}return this._collider.fn}get colliderType(){return this._collider.type}}class jT extends tT{addChild(e){if(!(e&&e instanceof tT))throw new TypeError("Expecting a Node as argument, but got ".concat(e));if(e===this)throw new Error("Can not add itself as child!");if(e._children&&e._children.length&&this.ancestors.indexOf(e)>=0)throw new Error("Can not add an ancestor as child!");return e._parent&&e._parent!==this&&e._parent.removeChild(e),this._children.push(e),e._parent=this,e._ancestors=null,this}addChildren(e){let t,n=e?e.length:0;for(t=0;t<n;t++)this.addChild(e[t]);return this}removeChild(e){const t=this._children.indexOf(e);return t>=0&&(this._children.splice(t,1),e._parent=null,e._ancestors=null),this}removeChildren(e){let t,n;if(!this._children)return this;if(e)for(n=e.length,t=0;t<n;t++)this.removeChild(e[t]);else for(;this._children.length;)this.removeChild(this._children[0]);return this}}const $T=jT.prototype;class BT extends FT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=e.collider,n=Dv({type:null},t);this.collider=n,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}appendChildRect(e,t){if(void 0!==e.bounds){const n=this.__boundingRect[t]||{},r=_v(e.bounds(t),3),i=r[0],o=r[2],a=i.x,s=i.y,l=o.x,c=o.y,u=isNaN(n.width)?l:Math.max(l,n.width+n.x),d=isNaN(n.height)?c:Math.max(c,n.height+n.y);n.x=isNaN(n.x)?a:Math.min(a,n.x),n.y=isNaN(n.y)?s:Math.min(s,n.y),n.width=u-n.x,n.height=d-n.y,this.__boundingRect[t]=n}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.children.length;for(let n=0;n<t;n++)this.appendChildRect(this.children[n],e);return this.__boundingRect[e]=Dv({x:0,y:0,width:0,height:0},this.__boundingRect[e]),this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}addChild(e){const t=$T.addChild.call(this,e);if(this._collider&&"bounds"===this._collider.type){this.appendChildRect(e,!0);const t=Dv({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}addChildren(e){const t=$T.addChildren.call(this,e),n=e.length;if(this._collider&&"bounds"===this._collider.type&&n>0){for(let t=0;t<n;t++)this.appendChildRect(e[t],!0);const t=Dv({type:"bounds",x:0,y:0,width:0,height:0},this.__boundingRect.true);this.collider=t}return t}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;if($T.removeChild.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=Dv(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}removeChildren(e){if($T.removeChildren.call(this,e),this._collider&&"bounds"===this._collider.type){this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null};const e=Dv(this.boundingRect(!0),{type:"bounds"});this.collider=e}return this}}function VT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new BT(...t)}class HT extends BT{constructor(e){super("stage"),this._stage=this,this._dpiRatio=e||1}get dpi(){return this._dpiRatio}}const UT=jT.prototype,WT=["x1","x2","y1","y2","id","offset","style"];class YT extends FT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=WT.length;r!==i;r++)n=WT[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return UT.addChild.call(this,e)}addChildren(e){return UT.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return UT.removeChild.call(this,e),this}removeChildren(e){return UT.removeChildren.call(this,e),this}}function KT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new YT(...t)}const GT=jT.prototype,XT=["patternUnits","x","y","width","height","id"];class JT extends FT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.type;super(void 0===t?"container":t),this.set(e),this._boundingRect={}}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super.set(e);const t=this.attrs;let n="";for(let r=0,i=XT.length;r!==i;r++)n=XT[r],void 0!==e[n]&&(t[n]=e[n])}addChild(e){return GT.addChild.call(this,e)}addChildren(e){return GT.addChildren.call(this,e)}removeChild(e){e._stage=null;let t,n=e.descendants,r=n?n.length:0;for(t=0;t<r;t++)n[t]._stage=null;return GT.removeChild.call(this,e),this}removeChildren(e){return GT.removeChildren.call(this,e),this}}class ZT extends FT{constructor(){super("rect"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.rx,u=void 0===c?0:c,d=e.ry,f=void 0===d?0:d,h=e.collider,p=Dv({type:"rect",x:n,y:i,width:a,height:l},h);super.set(e),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=i,this.attrs.height=l):(this.attrs.y=i+l,this.attrs.height=-l),u>0&&(this.attrs.rx=u),f>0&&(this.attrs.ry=f),this.collider=p,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=Bv(this.attrs),n=_v(jv(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],a=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class QT extends FT{constructor(){super("circle"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.cx,n=void 0===t?0:t,r=e.cy,i=void 0===r?0:r,o=e.r,a=void 0===o?0:o,s=e.collider,l=Dv({type:"circle",cx:n,cy:i,r:a},s);super.set(e),this.attrs.cx=n,this.attrs.cy=i,this.attrs.r=a,this.collider=l,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=this.bounds(e);return this.__boundingRect[e]={x:t[0].x,y:t[0].y,width:t[2].x-t[0].x,height:t[2].y-t[0].y},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.attrs,n=t.cx,r=t.cy,i=t.r,o=t.r,a=n-i,s=r-o;let l=2*i,c=2*o,u=[{x:a,y:s},{x:a+l,y:s},{x:a+l,y:s+c},{x:a,y:s+c}];if(e&&this.modelViewMatrix){u=this.modelViewMatrix.transformPoints(u);const t=_v(jv(u),4),n=t[0],r=t[1];l=t[2]-n,c=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+l,y:r},{x:n+l,y:r+c},{x:n,y:r+c}]}else this.__bounds[e]=u;return this.__bounds[e]}}class eq extends FT{constructor(){super("line"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x1,n=void 0===t?0:t,r=e.y1,i=void 0===r?0:r,o=e.x2,a=void 0===o?0:o,s=e.y2,l=void 0===s?0:s,c=e.collider;super.set(e),this.attrs.x1=n,this.attrs.y1=i,this.attrs.x2=a,this.attrs.y2=l;const u={type:"line",x1:n,y1:i,x2:a,y2:l};this.collider=Dv(u,c),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];let t=$v(this.attrs);e&&this.modelViewMatrix&&(t=this.modelViewMatrix.transformPoints(t));const n=_v(jv(t),4),r=n[0],i=n[1],o=n[2],a=n[3],s=r!==o||i!==a;return this.__boundingRect[e]={x:r,y:i,width:s?Math.max(1,o-r):0,height:s?Math.max(1,a-i):0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const tq=Math.PI/2;function nq(e,t){const n=Math.atan2(t.y-e.y,t.x-e.x);return n<0?n+2*Math.PI:n}function rq(e,t,n){return{x:e.x+Math.cos(t)*n,y:e.y+Math.sin(t)*n}}const iq={step:function(e){return new Hb(e,.5)},stepAfter:function(e){return new Hb(e,1)},stepBefore:function(e){return new Hb(e,0)},linear:Mb,basis:function(e){return new Nb(e)},cardinal:qb.tension(0),catmullRom:Rb,monotonex:function(e){return new Fb(e)},monotoney:function(e){return new jb(e)},natural:function(e){return new Bb(e)}};function oq(e){if(e.length<2)return!1;const t=e[0],n=e[e.length-1];return Math.abs(t.x-n.x)<1e-12&&Math.abs(t.y-n.y)<1e-12}class aq extends FT{constructor(){super("path"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(super.set(e),this.segments=[],this.points=[],e.arcDatum){const t=bb();t.innerRadius(e.desc.slice.innerRadius),t.outerRadius(e.desc.slice.outerRadius),t.cornerRadius(e.desc.slice.cornerRadius);const n=t(e.arcDatum);this.attrs.d=n}else if(e.points){const t=e.major,n=e.minor,r=e.layerObj,i=e.points,o=e.stngs,a=e.generatorType,s=kb(),l=o.coordinates?o.coordinates.defined:null;s[t.p](e=>e.major*t.size)["".concat(n.p,"1")](e=>e.minor*n.size)["".concat(n.p,"0")](e=>e.minor0*n.size).curve(iq["monotone"===r.curve?"monotone".concat(t.p):r.curve]),l?s.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor)&&e.defined):s.defined(e=>!e.dummy&&"number"==typeof e.minor&&!isNaN(e.minor));const c=o.connect?i.filter(s.defined()):i,u=("area"===a?s:s[a]())(c);this.attrs.d=u}else e.d&&(this.attrs.d=e.d);if(this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},Array.isArray(e.collider)||"object"==typeof e.collider&&void 0!==e.collider.type)this.collider=e.collider;else if(this.attrs.d){if(this.segments=ZD(this.attrs.d),this.segments.length>1&&this.segments.every(e=>oq(e)))return void(this.collider=Dv({type:"geopolygon",vertices:this.segments},e.collider));this.segments.forEach(t=>{if(t.length<=1);else if(oq(t))this.collider=Dv({type:"polygon",vertices:t},e.collider);else if("object"==typeof e.collider&&e.collider.visual){const n=this.attrs["stroke-width"]/2;this.collider=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=[],i=[];if("h"===n.forceOrientation){const t=e[0].x<e[1].x?-1:1,n=e[e.length-1].x>e[e.length-2].x?1:-1;e.unshift({x:e[0].x+t,y:e[0].y}),e.push({x:e[e.length-1].x+n,y:e[e.length-1].y})}else if("v"===n.forceOrientation){const t=e[0].y<e[1].y?-1:1,n=e[e.length-1].y>e[e.length-2].y?1:-1;e.unshift({x:e[0].x,y:e[0].y+t}),e.push({x:e[e.length-1].x,y:e[e.length-1].y+n})}const o=e.length-1;for(let n=1;n<o;n++){const a=e[n-1],s=e[n],l=e[n+1],c=nq(s,a),u=nq(s,l),d=(c+u)/2,f=d+Math.PI,h=Math.max(d,f),p=Math.min(d,f),m=c>u;if(1===n){const e=nq(a,s);r.push(rq(a,e-tq,t)),i.unshift(rq(a,e+tq,t))}const g=m?h:p,y=m?p:h;if(r.push(rq(s,g,t)),i.unshift(rq(s,y,t)),n===o-1){const e=nq(l,s);r.push(rq(l,e+tq,t)),i.unshift(rq(l,e-tq,t))}}return{type:"polygon",vertices:[...r,...i]}}(t,n,e.collider)}else this.collider=Dv({type:"polyline",points:t},e.collider)})}}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];this.points.length||(this.segments=this.segments.length?this.segments:ZD(this.attrs.d),this.points=function(e){const t=[];let n,r=e.length;for(let i=0;i<r;i++){n=e[i];for(let e=0;e<n.length;e++)t.push(n[e])}return t}(this.segments));const t=_v(jv(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(this.points):this.points),4),n=t[0],r=t[1],i=t[2],o=t[3];return this.__boundingRect[e]={x:n||0,y:r||0,width:i-n||0,height:o-r||0},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}function sq(e){let t=e.data,n=e._boundingRect,r=e._textBoundsFn;return null!=t&&(n||r)}class lq extends FT{constructor(){super("text"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.dx,a=void 0===o?0:o,s=e.dy,l=void 0===s?0:s,c=e.textBoundsFn,u=e.text,d=e.title,f=e.collider,h=e.boundingRect,p=e.ellipsed;super.set(e),this.attrs.x=n,this.attrs.y=i,this.attrs.dx=a,this.attrs.dy=l,this.attrs.text=u,void 0!==d&&(this.attrs.title=String(d)),"object"==typeof h?this._textBoundsFn=()=>h:"function"==typeof c&&(this._textBoundsFn=c),"string"==typeof p&&(this.ellipsed=p),this.collider=Dv({type:sq(this)?"bounds":null},f),this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null}}boundingRect(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[t])return this.__boundingRect[t];if("function"!=typeof this._textBoundsFn)return{x:0,y:0,width:0,height:0};e=this._textBoundsFn(this.attrs);const n=Bv(e),r=_v(jv(t&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(n):n),4),i=r[0],o=r[1],a=r[2],s=r[3];return this.__boundingRect[t]={x:i,y:o,width:a-i,height:s-o},this.__boundingRect[t]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}class cq extends FT{constructor(){super("image"),this.set(...arguments)}set(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.x,n=void 0===t?0:t,r=e.y,i=void 0===r?0:r,o=e.width,a=void 0===o?0:o,s=e.height,l=void 0===s?0:s,c=e.rx,u=void 0===c?0:c,d=e.ry,f=void 0===d?0:d,h=e.src,p=e.collider,m=e.cx,g=void 0===m?0:m,y=e.cy,v=void 0===y?0:y,b=e.r,x=void 0===b?0:b,S=e.opacity,M=e.imageScalingFactor,w=e.imagePosition,E=e.symbol;let k;k="circle"===e.symbol?Dv({type:"circle",cx:g,cy:v,r:x},p):Dv({type:"bounds",x:n,y:i,width:a,height:l},p),super.set(e),a>=0?(this.attrs.x=n,this.attrs.width=a):(this.attrs.x=n+a,this.attrs.width=-a),l>=0?(this.attrs.y=i,this.attrs.height=l):(this.attrs.y=i+l,this.attrs.height=-l),u>0&&(this.attrs.rx=u),f>0&&(this.attrs.ry=f),h&&(this.attrs.src=h),this.attrs.r=x,this.attrs.cx=g,this.attrs.cy=v,this.attrs.opacity=void 0!==S?S:1,this.attrs.imageScalingFactor=void 0!==M?M:1,this.attrs.imagePosition=w||"center-center",this.attrs.symbol=E||"rectangle",this.collider=k,this.__boundingRect={true:null,false:null},this.__bounds={true:null,false:null},e.collider||(this.attrs.updateCollider=this.updateCollider.bind(this))}updateCollider(e){let t;t="circle"===e.symbol?Dv(this.collider,{type:"circle",cx:e.cx,cy:e.cy,r:e.r}):Dv(this.collider,{type:"bounds",x:e.x,y:e.y,width:e.width,height:e.height}),this.collider=t}boundingRect(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__boundingRect[e])return this.__boundingRect[e];const t=Bv(this.attrs),n=_v(jv(e&&this.modelViewMatrix?this.modelViewMatrix.transformPoints(t):t),4),r=n[0],i=n[1],o=n[2],a=n[3];return this.__boundingRect[e]={x:r,y:i,width:o-r,height:a-i},this.__boundingRect[e]}bounds(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(null!==this.__bounds[e])return this.__bounds[e];if("circle"===this._node.symbol){const t=this.boundingRect(e),n=Math.min(t.width,t.height)/2,r=t.x-n,i=t.y-n;let o=2*n,a=2*n,s=[{x:r,y:i},{x:r+o,y:i},{x:r+o,y:i+a},{x:r,y:i+a}];if(e&&this.modelViewMatrix){s=this.modelViewMatrix.transformPoints(s);const t=_v(jv(s),4),n=t[0],r=t[1];o=t[2]-n,a=t[3]-r,this.__bounds[e]=[{x:n,y:r},{x:n+o,y:r},{x:n+o,y:r+a},{x:n,y:r+a}]}else this.__bounds[e]=s;return this.__bounds[e]}const t=this.boundingRect(e);return this.__bounds[e]=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],this.__bounds[e]}}const uq=Jb();function dq(e,t){return uq.get(e)(t)}uq.add("rect",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new ZT(...t)}),uq.add("circle",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new QT(...t)}),uq.add("text",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new lq(...t)}),uq.add("line",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new eq(...t)}),uq.add("path",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new aq(...t)}),uq.add("stage",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new HT(...t)}),uq.add("container",VT),uq.add("defs",VT),uq.add("linearGradient",KT),uq.add("radialGradient",KT),uq.add("conicGradient",KT),uq.add("stop",KT),uq.add("pattern",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new JT(...t)}),uq.add("image",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new cq(...t)});const fq=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=[{}];function n(){return t[t.length-1]}return n.save=function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const i=n(),o={};let a="";for(let t=0;t<e.length;t++)a=e[t],void 0!==i[a]&&(o[a]=i[a]);return Dv(o,r),t.push(o),n()},n.restore=function(){t.splice(t.length-1,1)},n}(["stroke","fill","strokeWidth","opacity","fontFamily","fontSize","baseline"]);function hq(e,t){if(Array.isArray(t))for(let n=0,r=t.length;n<r;n++)t[n](e)}function pq(e,t,n){e.node=n[t],e.index=t}function mq(e,t,n,r){let i=!1;const o={siblings:e,node:null,index:0};for(let a=0,s=e.length;a<s;a++){if(pq(o,a,e),hq(o,r.create),i="function"==typeof o.node.disabled?o.node.disabled():o.node.disabled,i)continue;o.node=fq.save(o.node);const s=dq(o.node.type,o.node);s&&(o.node.transform&&(n.save(),MT(o.node.transform,n)),n.isIdentity()||(s.modelViewMatrix=n.clone()),t.addChild(s),o.node.children&&mq(o.node.children,s,n,r),o.node.transform&&n.restore()),fq.restore()}}function gq(e){let t=e.items,n=e.stage,r=e.dpi,i=e.on,o=void 0===i?{}:i;return n||(n=dq("stage",r)),mq(t,n,new gT,o),n}function yq(e,t,n){const r=n.orientation,i=n.degree,o=n.stops,a=void 0===o?[]:o;let s=null;if("radial"===r){const n=t.boundingRect();s=e.createRadialGradient(n.x+n.width/2,n.y+n.height/2,1e-5,n.x+n.width/2,n.y+n.height/2,Math.max(n.width,n.height)/2)}else if("conic"===r){const t=n.startAngle||0,r=n.x||0,i=n.y||0;s=e.createConicGradient(t,r,i)}else{const r=gk(i);["x1","x2","y1","y2"].forEach(e=>{e in n&&(r[e]=n[e])});const o=t.boundingRect();s=e.createLinearGradient(o.x+r.x1*o.width,o.y+r.y1*o.height,o.x+r.x2*o.width,o.y+r.y2*o.height)}for(let e=0,t=a.length;e<t;e++){let t=a[e];s.addColorStop(t.offset,t.color)}return s}function vq(e,t,n){return t.width=e.width,t.height=e.height,n.save(),n.fillStyle=e.fill,e.shapes.forEach(e=>{if("rect"===e.type)n.rect(e.x,e.y,e.width,e.height)}),n.fill(),n.restore(),n.createPattern(t,"repeat")}function bq(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.x,n=e.y,r=e.width,i=e.height,o=e.scaleRatio,a=e.margin,s=e.edgeBleed;const l={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0},edgeBleed:{left:0,right:0,top:0,bottom:0,bool:!1}};return l.x=isNaN(t)?l.x:t,l.y=isNaN(n)?l.y:n,l.width=isNaN(r)?l.width:r,l.height=isNaN(i)?l.height:i,void 0!==o&&(l.scaleRatio.x=isNaN(o.x)?l.scaleRatio.x:o.x,l.scaleRatio.y=isNaN(o.y)?l.scaleRatio.y:o.y),void 0!==a&&(l.margin.left=isNaN(a.left)?0:a.left,l.margin.top=isNaN(a.top)?0:a.top),"object"==typeof s&&["left","right","top","bottom"].forEach(e=>{!isNaN(s[e])&&s[e]>0&&(l.edgeBleed[e]=s[e],l.edgeBleed.bool=!0)}),l.computedPhysical={x:Math.round(l.margin.left+(l.x-l.edgeBleed.left)*l.scaleRatio.x),y:Math.round(l.margin.top+(l.y-l.edgeBleed.top)*l.scaleRatio.y),width:Math.round((l.width+l.edgeBleed.left+l.edgeBleed.right)*l.scaleRatio.x),height:Math.round((l.height+l.edgeBleed.top+l.edgeBleed.bottom)*l.scaleRatio.y)},l}function xq(){const e={element:()=>{},root:()=>{},settings:()=>{},appendTo:()=>{},getScene:()=>[],render:()=>!1,itemsAt:()=>[],findShapes:()=>[],clear:()=>{},destory:()=>{},size:()=>{},measureText:HN,textBounds:WN,setKey:t=>{e.element().setAttribute("data-key",t)}};return e}function Sq(e){return t=>{let n=t.node;"text"!==n.type||null==n.data||n.textBoundsFn||(n.textBoundsFn=e.textBounds)}}const Mq=200,wq=200;class Eq{constructor(e){this.targetCanvas=e,this.bufferCanvas=e.cloneNode()}updateSize(e){let t,n=e.rect,r=e.dpiRatio,i=e.canvasBufferSize;t=i?"function"==typeof i?i(n):i:{width:n.computedPhysical.width+2*Mq,height:n.computedPhysical.height+2*wq},this.bufferCanvas.style.width="".concat(t.width,"px"),this.bufferCanvas.style.height="".concat(t.height,"px"),this.bufferCanvas.width=Math.round(t.width*r),this.bufferCanvas.height=Math.round(t.height*r)}apply(){this.targetCanvas.getContext("2d").drawImage(this.bufferCanvas,0,0)}clear(){this.bufferCanvas.width=this.bufferCanvas.width}getContext(){return this.bufferCanvas.getContext("2d")}}const kq=Jb();function Cq(e){return Array.isArray(e)?e:"string"==typeof e?-1!==e.indexOf(",")?e.split(","):e.split(" "):[]}function Aq(e){return("undefined"==typeof window?1:window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}function Oq(e,t){t.setTransform(e[0][0],e[1][0],e[0][1],e[1][1],e[0][2],e[1][2])}function Nq(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=Object.keys(r);for(let i=0,o=n.length;i<o;i++){let o=n[i];const a=o[0],s=o[1],l=o[2];if(a in t.attrs&&!(s in r)&&e[s]!==t.attrs[a]){const n=l?l(t.attrs[a]):t.attrs[a];"function"==typeof e[s]?e[s](n):e[s]=n}}for(let t=0,n=i.length;t<n;t++){const n=i[t];e[n]=r[n]}}function Dq(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let o=e[i],a={};t.save(),o.attrs&&(o.attrs.fill||o.attrs.stroke)&&(o.attrs.fill&&"object"==typeof o.attrs.fill&&"gradient"===o.attrs.fill.type?a.fillStyle=yq(t,o,o.attrs.fill):o.attrs.fill&&"object"==typeof o.attrs.fill&&"pattern"===o.attrs.fill.type&&(a.fillStyle=r.patterns.create(o.attrs.fill)),o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"gradient"===o.attrs.stroke.type?a.strokeStyle=yq(t,o,o.attrs.stroke):o.attrs.stroke&&"object"==typeof o.attrs.stroke&&"pattern"===o.attrs.stroke.type&&(a.strokeStyle=r.patterns.create(o.attrs.stroke))),Nq(t,o,n,a),o.modelViewMatrix&&Oq(o.modelViewMatrix.elements,t),kq.has(o.type)&&kq.get(o.type)(o.attrs,{g:t,doFill:"fill"in o.attrs&&"none"!==o.attrs.fill,doStroke:"stroke"in o.attrs&&0!==o.attrs["stroke-width"],ellipsed:o.ellipsed}),o.children&&Dq(o.children,t,n,r),t.restore()}}function Tq(){let e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gq;const r={transform:void 0,canvasBufferSize:void 0,progressive:void 0};let i,o=!1,a=bq();const s=[["fill","fillStyle"],["stroke","strokeStyle"],["opacity","globalAlpha"],["globalAlpha","globalAlpha"],["stroke-width","lineWidth"],["stroke-linejoin","lineJoin"],["stroke-dasharray","setLineDash",Cq]];let l;const c=xq();return c.element=()=>e,c.root=()=>e,c.settings=e=>(e&&Object.keys(r).forEach(t=>{void 0!==e[t]&&(r[t]=e[t])}),r),c.appendTo=n=>(e||(e=n.ownerDocument.createElement("canvas"),e.style.position="absolute",e.style["-webkit-font-smoothing"]="antialiased",e.style["-moz-osx-font-smoothing"]="antialiased",e.style.pointerEvents="none"),"function"!=typeof r.transform||t||(t=new Eq(e)),n.appendChild(e),e),c.getScene=r=>{const i=Aq(t&&t.getContext()||e.getContext("2d")),o=a.scaleRatio.x,s=a.scaleRatio.y,l={type:"container",children:r,transform:a.edgeBleed.bool?"translate(".concat(a.edgeBleed.left*i*o,", ").concat(a.edgeBleed.top*i*s,")"):""};return 1===i&&1===o&&1===s||(l.transform+="scale(".concat(i*o,", ").concat(i*s,")")),n({items:[l],dpi:i,on:{create:[RN(c.measureText),Sq(c)]}})},c.render=n=>{if(!e)return!1;l||(l=function(e){const t=e.createElement("canvas"),n=t.getContext("2d");let r={};return{create(e){const i=e.key;return i?(r[i]=r[i]||vq(e,t,n),r[i]):vq(e,t,n)},clear(){r={}}}}(e.ownerDocument));const u=t&&t.getContext()||e.getContext("2d"),d=Aq(u),f=t&&r.transform();if(f)return e.width=e.width,function(e){let t=e.el,n=e.dpiRatio,r=e.transform;if("object"==typeof r){const e=[r.horizontalScaling,r.horizontalSkewing,r.verticalSkewing,r.verticalScaling,r.horizontalMoving*n,r.verticalMoving*n];t.getContext("2d").setTransform(...e)}}({el:e,dpiRatio:d,transform:f}),t.apply(),!0;o&&(e.style.left="".concat(a.computedPhysical.x,"px"),e.style.top="".concat(a.computedPhysical.y,"px"),e.style.width="".concat(a.computedPhysical.width,"px"),e.style.height="".concat(a.computedPhysical.height,"px"),e.width=Math.round(a.computedPhysical.width*d),e.height=Math.round(a.computedPhysical.height*d),t&&t.updateSize({rect:a,dpiRatio:d,canvasBufferSize:r.canvasBufferSize}));const h=c.getScene(n),p=!i||!h.equals(i);l.clear();const m=o||p,g="function"==typeof r.progressive&&r.progressive();return m&&(g&&!g.isFirst||c.clear(),Dq(h.children,u,s,{patterns:l})),t&&(e.width=e.width,t.apply()),o=!1,g&&!g.isFirst&&h.children.unshift(...i.children),i=h,m},c.itemsAt=e=>i?i.getItemsFrom(e):[],c.findShapes=e=>i?i.findShapes(e):[],c.clear=()=>(e&&(e.width=e.width),t&&t.clear(),i=null,c),c.size=e=>{if(e){const t=bq(e);JSON.stringify(a)!==JSON.stringify(t)&&(o=!0,a=t)}return a},c.destroy=()=>{e&&(e.parentElement&&e.parentElement.removeChild(e),e=null),t&&(t=null),i=null},c}function qq(e,t){kq.add(e,t)}function Iq(e,t){return Math.max(0,Math.min(e,t))}const Rq=new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗＡ-Ｚａ-ｚｦ-ￜ]"),Lq=new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),_q=new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]");function Pq(e){return Rq.test(e)}function zq(e){return Lq.test(e)||_q.test(e)}function Fq(e){let t,n,r=e?e.length:0;for(t=0;t<r;t++){if(n=e[t],Pq(n))return"ltr";if(zq(n))return"rtl"}return"ltr"}const jq={start:"end",end:"start",center:"center",middle:"middle"};function $q(e,t){return"rtl"===t?jq[e]:e}function Bq(e,t){if(Bq.cache[e])return void t(Bq.cache[e]);const n=new Image;n.src=e,n.onload=()=>{Bq.cache[e]=n,t(n)},n.onerror=e=>{console.error("Image load error",e)}}function Vq(e,t){const n=[];let r;const i=[],o=[],a=[];let s,l;const c=e=>e.id,u=(e,t)=>{let n;return n="object"==typeof e?"id"in e?e.id:t:e,{content:e,id:"".concat(n,"__").concat(e.type||"")}};e.isTree||(e=e.map(u)),t=t.map(u),s=e.map(c),l=t.map(c);for(let e=0,r=t.length;e<r;e++){-1===s.indexOf(t[e].id)?n.push(t[e]):o.push(t[e])}for(let t=0,n=e.length;t<n;t++){-1===l.indexOf(e[t].id)?i.push(e[t]):a.push(e[t])}for(let e=0,t=n.length;e<t;e++)n[e].content.children&&(n[e].diff=Vq([],n[e].content.children),n[e].children=n[e].diff.updatedNew.concat(n[e].diff.added),n[e].children.isTree=!0);for(let e=0,t=o.length;e<t;e++)o[e].diff=Vq(a[e].children||[],o[e].content.children||[]),o[e].object=a[e].object,o[e].children=o[e].diff.items;return r=o.concat(n),n.isTree=!0,i.isTree=!0,o.isTree=!0,a.isTree=!0,r.isTree=!0,{added:n,updatedNew:o,updatedOld:a,removed:i,items:r}}function Hq(e,t,n){for(let r=0,i=e.length;r<i;r++)e[r].object=n(e[r].content.type,t)}function Uq(e,t){for(let n=0,r=e.length;n<r;n++)null!==e[n].object&&void 0!==e[n].object&&(t(e[n].object),e[n].object=null)}function Wq(e,t,n,r){let i;for(let o=0,a=e.length;o<a;o++)i=e[o],null!==i.object&&void 0!==i.object&&(n(i.object,i.content),i.diff&&(Hq(i.diff.added,i.object,t),Uq(i.diff.removed,r),Wq(i.diff.items,t,n,r)))}function Yq(e,t,n,r,i,o){const a=Vq(e,t);return Hq(a.added,n,r),Uq(a.removed,o),Wq(a.items,r,i,o),a.items}Bq.cache={},qq("rect",function(e,t){let n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),e.rx>0||e.ry>0?function(e,t,n,r,i,o,a){o=Iq(r/2,o>0?o:a),a=Iq(i/2,a>0?a:o),e.moveTo(t,n+a),e.lineTo(t,n+i-a),e.quadraticCurveTo(t,n+i,t+o,n+i),e.lineTo(t+r-o,n+i),e.quadraticCurveTo(t+r,n+i,t+r,n+i-a),e.lineTo(t+r,n+a),e.quadraticCurveTo(t+r,n,t+r-o,n),e.lineTo(t+o,n),e.quadraticCurveTo(t,n,t,n+a)}(n,e.x,e.y,e.width,e.height,e.rx,e.ry):n.rect(e.x,e.y,e.width,e.height),r&&n.fill(),i&&n.stroke()}),qq("circle",function(e,t){let n=t.g,r=t.doFill,i=t.doStroke;n.beginPath(),n.moveTo(e.cx+e.r,e.cy),n.arc(e.cx,e.cy,e.r,0,2*Math.PI,!1),r&&n.fill(),i&&n.stroke()}),qq("line",function(e,t){let n=t.g,r=t.doStroke;n.beginPath(),n.moveTo(e.x1,e.y1),n.lineTo(e.x2,e.y2),r&&n.stroke()}),qq("path",function(e,t){let n=t.g,r=t.doStroke,i=t.doFill;const o=new Path2D(e.d);i&&n.fill(o),r&&n.stroke(o)}),qq("text",function(e,t){let n=t.g,r=t.ellipsed,i=t.doStroke;const o=r||LN(e,HN);n.font=[e["font-style"],e["font-weight"],e["font-size"],e["font-family"]].filter(e=>!!e).join(" ");const a=Fq(e.text);n.canvas.dir!==a&&(n.canvas.dir=a);const s=$q("middle"===e["text-anchor"]?"center":e["text-anchor"],n.canvas.dir);s&&n.textAlign!==s&&(n.textAlign=s);const l=_N(e);n.fillText(o,e.x+e.dx,e.y+e.dy+l),i&&n.strokeText(o,e.x+e.dx,e.y+e.dy+l)}),qq("image",function(e,t){let n=t.g;const r=n.canvas,i=n.getTransform(),o=window.devicePixelRatio||1,a=r.clientWidth*o,s=r.clientHeight*o;r.width===a&&r.height===s||(r.width=a,r.height=s),Bq(e.src,t=>{if(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.width,r.height),n.setTransform(i),n.globalAlpha=e.opacity,e.width||e.height||(e.width=t.naturalWidth*e.imageScalingFactor,e.height=t.naturalHeight*e.imageScalingFactor),function(e){const t=e.imagePosition||"center-center";let n=e.width,r=e.height;if("circle"===e.symbol){const t=Math.min(e.width,e.height)/2;n=2*t,r=2*t}switch(t){case"top-center":e.y-=r/2;break;case"center-left":e.x-=n/2;break;case"center-right":e.x+=n/2;break;case"top-left":e.x-=n/2,e.y-=r/2;break;case"top-right":e.x+=n/2,e.y-=r/2;break;case"bottom-left":e.x-=n/2,e.y+=r/2;break;case"bottom-right":e.x+=n/2,e.y+=r/2;break;case"bottom-center":e.y+=r/2}}(e),"circle"===e.symbol){const r=e.x,i=e.y;e.r=Math.min(e.width,e.height)/2;const o=r-e.width/2,a=i-e.height/2;n.save(),n.beginPath(),n.arc(r,i,e.r,0,2*Math.PI),n.clip(),n.drawImage(t,o,a,e.width,e.height),n.restore()}else e.x-=e.width/2,e.y-=e.height/2,n.drawImage(t,e.x,e.y,e.width,e.height);n.globalAlpha=1,e.updateCollider&&e.updateCollider(e)})});const Kq="http://www.w3.org/2000/svg",Gq=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("Invalid type: ".concat(e));const n=t.ownerDocument.createElementNS(Kq,"container"===e?"g":e);return t.appendChild(n),n},Xq=e=>{e.parentNode&&e.parentNode.removeChild(e)};function Jq(e){let t=e.element,n=e.attrs;return function(){const e=n.width,r=n.height,i=n.imagePosition,o=n.imageScalingFactor,a=n.symbol;let s=n.x,l=void 0===s?0:s,c=n.y,u=void 0===c?0:c,d=e>0?e:this.naturalWidth,f=r>0?r:this.naturalHeight;switch(o&&(d*=o,f*=o),i){case"top-center":u-=f/2;break;case"center-left":l-=d/2;break;case"center-right":l+=d/2;break;case"top-left":l-=d/2,u-=f/2;break;case"top-right":l+=d/2,u-=f/2;break;case"bottom-left":l-=d/2,u+=f/2;break;case"bottom-right":l+=d/2,u+=f/2;break;case"bottom-center":u+=f/2}if(t.setAttribute("width",d),t.setAttribute("height",f),t.setAttribute("x",l-d/2),t.setAttribute("y",u-f/2),t.setAttribute("preserveAspectRatio","none"),"circle"===a){const e=t.ownerSVGElement;if(!e)return;const n="clip-".concat(Math.random().toString(36).substr(2,9));if(!e.querySelector("#".concat(n))){const t=e.querySelector("defs")||e.insertBefore(document.createElementNS(Kq,"defs"),e.firstChild),r=document.createElementNS(Kq,"clipPath");r.setAttribute("id",n);const i=document.createElementNS(Kq,"circle");i.setAttribute("cx",l),i.setAttribute("cy",u),i.setAttribute("r",Math.min(d,f)/2),r.appendChild(i),t.appendChild(r)}t.setAttribute("clip-path","url(#".concat(n,")"))}}}const Zq=(e,t)=>{if((e=>{switch(e.type){case"circle":return!isNaN(e.attrs.cx)&&!isNaN(e.attrs.cy)&&!isNaN(e.attrs.r);case"line":return!(isNaN(e.attrs.x1)||isNaN(e.attrs.y1)||isNaN(e.attrs.x2)||isNaN(e.attrs.y2));case"rect":return!(isNaN(e.attrs.x)||isNaN(e.attrs.y)||isNaN(e.attrs.width)||isNaN(e.attrs.height));case"text":case"image":return!isNaN(e.attrs.x)&&!isNaN(e.attrs.y);default:return!0}})(t)){for(const n in t.attrs)if("stroke"===n&&t.strokeReference)e.setAttribute("stroke",t.strokeReference);else if("fill"===n&&t.fillReference)e.setAttribute("fill",t.fillReference);else if("text"===n){e.setAttribute("style","white-space: pre"),e.textContent=t.ellipsed||LN(t.attrs,HN);const n=Fq(t.attrs.text);"rtl"===n&&(e.setAttribute("direction","rtl"),e.setAttribute("dir","rtl"),e.setAttribute("text-anchor",$q(e.getAttribute("text-anchor"),n)))}else if("text"!==t.type||"dy"!==n&&"dominant-baseline"!==n)if("text"===t.type&&"title"===n&&t.attrs.title){const n=e.ownerDocument.createElementNS(Kq,"title");n.textContent=t.attrs.title,e.appendChild(n)}else if("image"===t.type&&"src"===n){e.setAttributeNS("http://www.w3.org/1999/xlink","href",t.attrs.src);let n=new Image;n.src=t.attrs.src,n.onload=Jq({element:e,attrs:t.attrs})}else e.setAttribute(n,t.attrs[n]);else{const r=+e.getAttribute(n)||0;let i=0;i="dominant-baseline"===n?_N(t.attrs):t.attrs[n],e.setAttribute("dy",i+r)}if("string"==typeof t.data||"number"==typeof t.data||"boolean"==typeof t.data)e.setAttribute("data",t.data);else if("object"==typeof t.data&&null!==t.data)for(const n in t.data)"string"!=typeof t.data[n]&&"number"!=typeof t.data[n]&&"boolean"!=typeof t.data[n]||e.setAttribute("data-".concat(n),t.data[n])}};class Qq{constructor(e,t,n,r){this.create=e,this.nodeCreator=t,this.nodeMaintainer=n,this.nodeDestroyer=r}render(e,t){return this.create([],e,t,this.nodeCreator,this.nodeMaintainer,this.nodeDestroyer)}}function eI(){return new Qq(Yq,Gq,Zq,Xq)}function tI(e){let t,n,r,i=0;if(0===(e=JSON.stringify(e)).length)return i;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),i=(i<<5)-i+n,i&=i;return i}function nI(){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Kq,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gq;const n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:eI)();let r,i,o,a=!1,s=bq();const l={transform:void 0,disableScreenReader:!1},c=xq(),u={type:"defs",children:[]},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tI,n={},r=Date.now();const i={onCreate(i){let o={};i.node&&"object"==typeof i.node.fill&&"pattern"===i.node.fill.type&&i.node.fill.shapes&&(o.fill=i.node.fill),i.node&&"object"==typeof i.node.stroke&&"pattern"===i.node.stroke.type&&i.node.stroke.shapes&&(o.stroke=i.node.stroke),Object.keys(o).forEach(a=>{let s="";const l=o[a],c=t(l),u="picasso-pattern-".concat(r,"-").concat(c);if("undefined"!=typeof window&&(s=window.location.href.split("#")[0]),!n[c]){const t={patternUnits:"userSpaceOnUse",x:0,y:0,width:l.width,height:l.height,type:"pattern",id:u,children:[],fill:l.fill};l.shapes.forEach(e=>{t.children.push(e)}),e.push(t),n[c]=!0}i.node["".concat(a,"Reference")]="url('".concat(s,"#").concat(u,"')")})},clear(){n={}}};return i}(u.children),f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tI,n={},r=Date.now();const i={getOrCreateGradient(){let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fill",a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=t(i[o]),l="picasso-gradient-".concat(r,"-").concat(s);if(!n[s]){let t=i[o],r=t.orientation,a=t.degree,c=t.stops,u=void 0===c?[]:c,d={};void 0===a&&(a=90),"radial"===r?d.type="radialGradient":(d=gk(a),["x1","x2","y1","y2"].forEach(e=>{e in i[o]&&(d[e]=i[o][e])}),d.type="linearGradient"),d.id=l,d.children=u.map(e=>{let t=e.offset,n=e.color,r=e.opacity;return{type:"stop",offset:"".concat(100*t,"%"),style:"stop-color:".concat(n,";stop-opacity:").concat(void 0!==r?r:1)}}),e.push(d),n[s]=l}return"url('".concat(a,"#").concat(l,"')")},onCreate(e){let t="";"undefined"!=typeof window&&(t=window.location.href.split("#")[0]);const n=e.node;n.fill&&"object"==typeof n.fill&&"gradient"===n.fill.type&&(n.fillReference=i.getOrCreateGradient(n,"fill",t)),n.stroke&&"object"==typeof n.stroke&&"gradient"===n.stroke.type&&(n.strokeReference=i.getOrCreateGradient(n,"stroke",t))},clear(){n={}}};return i}(u.children);return c.element=()=>r,c.root=()=>i,c.settings=e=>(e&&Object.keys(l).forEach(t=>{void 0!==e[t]&&(l[t]=e[t])}),l),c.appendTo=t=>(r||(r=t.ownerDocument.createElementNS(e,"svg"),r.style.position="absolute",r.style["-webkit-font-smoothing"]="antialiased",r.style["-moz-osx-font-smoothing"]="antialiased",r.style.pointerEvents="none",r.setAttribute("xmlns",e),i=t.ownerDocument.createElementNS(e,"g"),i.style.pointerEvents="auto",r.appendChild(i)),t.appendChild(r),r),c.getScene=e=>{const n=s.scaleRatio.x,r=s.scaleRatio.y,i={type:"container",children:Array.isArray(e)?[...e,u]:e,transform:s.edgeBleed.bool?"translate(".concat(s.edgeBleed.left*n,", ").concat(s.edgeBleed.top*r,")"):""};return 1===n&&1===r||(i.transform+="scale(".concat(n,", ").concat(r,")")),t({items:[i],on:{create:[e=>{e.node.fillReference=void 0,e.node.strokeReference=void 0},f.onCreate,d.onCreate,RN(c.measureText),Sq(c)]}})},c.render=e=>{if(!r)return!1;const t="function"==typeof l.transform&&l.transform();if(t){const e=t.horizontalScaling,n=t.horizontalSkewing,r=t.verticalSkewing,o=t.verticalScaling,a=t.horizontalMoving,s=t.verticalMoving;return i.style.transform="matrix(".concat(e,", ").concat(n,", ").concat(r,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}i.style.transform="";l.disableScreenReader&&r.setAttribute("aria-hidden",!0),a&&(r.style.left="".concat(s.computedPhysical.x,"px"),r.style.top="".concat(s.computedPhysical.y,"px"),r.setAttribute("width",s.computedPhysical.width),r.setAttribute("height",s.computedPhysical.height)),f.clear(),d.clear(),u.children.length=0;const h=c.getScene(e),p=!o||!h.equals(o),m=a||p;return m&&(c.clear(),n.render(h.children,i)),a=!1,o=h,m},c.itemsAt=e=>o?o.getItemsFrom(e):[],c.findShapes=e=>o?o.findShapes(e):[],c.clear=()=>{if(!i)return c;o=null;const e=i.cloneNode(!1);return r.replaceChild(e,i),i=e,c},c.destroy=()=>{r&&r.parentNode&&r.parentNode.removeChild(r),r=null,i=null},c.size=e=>{if(e){const t=bq(e);JSON.stringify(s)!==JSON.stringify(t)&&(a=!0,s=t)}return s},c}var rI,iI,oI,aI,sI,lI,cI,uI={},dI=[],fI=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function hI(e,t){for(var n in t)e[n]=t[n];return e}function pI(e){var t=e.parentNode;t&&t.removeChild(e)}function mI(e,t,n){var r,i,o,a={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?rI.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return gI(e,a,r,i,null)}function gI(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==i?++oI:i};return null==i&&null!=iI.vnode&&iI.vnode(o),o}function yI(e){return e.children}function vI(e,t){this.props=e,this.context=t}function bI(e,t){if(null==t)return e.__?bI(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?bI(e):null}function xI(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return xI(e)}}function SI(e){(!e.__d&&(e.__d=!0)&&aI.push(e)&&!MI.__r++||sI!==iI.debounceRendering)&&((sI=iI.debounceRendering)||lI)(MI)}function MI(){var e,t,n,r,i,o,a,s;for(aI.sort(cI);e=aI.shift();)e.__d&&(t=aI.length,r=void 0,i=void 0,a=(o=(n=e).__v).__e,(s=n.__P)&&(r=[],(i=hI({},o)).__v=o.__v+1,TI(s,o,i,n.__n,void 0!==s.ownerSVGElement,null!=o.__h?[a]:null,r,null==a?bI(o):a,o.__h),qI(r,o),o.__e!=a&&xI(o)),aI.length>t&&aI.sort(cI));MI.__r=0}function wI(e,t,n,r,i,o,a,s,l,c){var u,d,f,h,p,m,g,y=r&&r.__k||dI,v=y.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(h=n.__k[u]=null==(h=t[u])||"boolean"==typeof h||"function"==typeof h?null:"string"==typeof h||"number"==typeof h||"bigint"==typeof h?gI(null,h,null,null,h):Array.isArray(h)?gI(yI,{children:h},null,null,null):h.__b>0?gI(h.type,h.props,h.key,h.ref?h.ref:null,h.__v):h)){if(h.__=n,h.__b=n.__b+1,null===(f=y[u])||f&&h.key==f.key&&h.type===f.type)y[u]=void 0;else for(d=0;d<v;d++){if((f=y[d])&&h.key==f.key&&h.type===f.type){y[d]=void 0;break}f=null}TI(e,h,f=f||uI,i,o,a,s,l,c),p=h.__e,(d=h.ref)&&f.ref!=d&&(g||(g=[]),f.ref&&g.push(f.ref,null,h),g.push(d,h.__c||p,h)),null!=p?(null==m&&(m=p),"function"==typeof h.type&&h.__k===f.__k?h.__d=l=EI(h,l,e):l=kI(e,h,f,y,p,l),"function"==typeof n.type&&(n.__d=l)):l&&f.__e==l&&l.parentNode!=e&&(l=bI(f))}for(n.__e=m,u=v;u--;)null!=y[u]&&("function"==typeof n.type&&null!=y[u].__e&&y[u].__e==n.__d&&(n.__d=CI(r).nextSibling),LI(y[u],y[u]));if(g)for(u=0;u<g.length;u++)RI(g[u],g[++u],g[++u])}function EI(e,t,n){for(var r,i=e.__k,o=0;i&&o<i.length;o++)(r=i[o])&&(r.__=e,t="function"==typeof r.type?EI(r,t,n):kI(n,r,r,i,r.__e,t));return t}function kI(e,t,n,r,i,o){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||i!=o||null==i.parentNode)e:if(null==o||o.parentNode!==e)e.appendChild(i),a=null;else{for(s=o,l=0;(s=s.nextSibling)&&l<r.length;l+=1)if(s==i)break e;e.insertBefore(i,o),a=o}return void 0!==a?a:i.nextSibling}function CI(e){var t,n,r;if(null==e.type||"string"==typeof e.type)return e.__e;if(e.__k)for(t=e.__k.length-1;t>=0;t--)if((n=e.__k[t])&&(r=CI(n)))return r;return null}function AI(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||fI.test(t)?n:n+"px"}function OI(e,t,n,r,i){var o;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||AI(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||AI(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r||e.addEventListener(t,o?DI:NI,o):e.removeEventListener(t,o?DI:NI,o);else if("dangerouslySetInnerHTML"!==t){if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function NI(e){return this.l[e.type+!1](iI.event?iI.event(e):e)}function DI(e){return this.l[e.type+!0](iI.event?iI.event(e):e)}function TI(e,t,n,r,i,o,a,s,l){var c,u,d,f,h,p,m,g,y,v,b,x,S,M,w,E=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,o=[s]),(c=iI.__b)&&c(t);try{e:if("function"==typeof E){if(g=t.props,y=(c=E.contextType)&&r[c.__c],v=c?y?y.props.value:c.__:r,n.__c?m=(u=t.__c=n.__c).__=u.__E:("prototype"in E&&E.prototype.render?t.__c=u=new E(g,v):(t.__c=u=new vI(g,v),u.constructor=E,u.render=_I),y&&y.sub(u),u.props=g,u.state||(u.state={}),u.context=v,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=E.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=hI({},u.__s)),hI(u.__s,E.getDerivedStateFromProps(g,u.__s))),f=u.props,h=u.state,u.__v=t,d)null==E.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==E.getDerivedStateFromProps&&g!==f&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,v)||t.__v===n.__v){for(t.__v!==n.__v&&(u.props=g,u.state=u.__s,u.__d=!1),u.__e=!1,t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,v),null!=u.componentDidUpdate&&u.__h.push(function(){u.componentDidUpdate(f,h,p)})}if(u.context=v,u.props=g,u.__P=e,x=iI.__r,S=0,"prototype"in E&&E.prototype.render){for(u.state=u.__s,u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),M=0;M<u._sb.length;M++)u.__h.push(u._sb[M]);u._sb=[]}else do{u.__d=!1,x&&x(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++S<25);u.state=u.__s,null!=u.getChildContext&&(r=hI(hI({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(p=u.getSnapshotBeforeUpdate(f,h)),w=null!=c&&c.type===yI&&null==c.key?c.props.children:c,wI(e,Array.isArray(w)?w:[w],t,n,r,i,o,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),m&&(u.__E=u.__=null),u.__e=!1}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=II(n.__e,t,n,r,i,o,a,l);(c=iI.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=o)&&(t.__e=s,t.__h=!!l,o[o.indexOf(s)]=null),iI.__e(e,t,n)}}function qI(e,t){iI.__c&&iI.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){iI.__e(e,t.__v)}})}function II(e,t,n,r,i,o,a,s){var l,c,u,d=n.props,f=t.props,h=t.type,p=0;if("svg"===h&&(i=!0),null!=o)for(;p<o.length;p++)if((l=o[p])&&"setAttribute"in l==!!h&&(h?l.localName===h:3===l.nodeType)){e=l,o[p]=null;break}if(null==e){if(null===h)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",h):document.createElement(h,f.is&&f),o=null,s=!1}if(null===h)d===f||s&&e.data===f||(e.data=f);else{if(o=o&&rI.call(e.childNodes),c=(d=n.props||uI).dangerouslySetInnerHTML,u=f.dangerouslySetInnerHTML,!s){if(null!=o)for(d={},p=0;p<e.attributes.length;p++)d[e.attributes[p].name]=e.attributes[p].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,i){var o;for(o in n)"children"===o||"key"===o||o in t||OI(e,o,null,n[o],r);for(o in t)i&&"function"!=typeof t[o]||"children"===o||"key"===o||"value"===o||"checked"===o||n[o]===t[o]||OI(e,o,t[o],n[o],r)}(e,f,d,i,s),u)t.__k=[];else if(p=t.props.children,wI(e,Array.isArray(p)?p:[p],t,n,r,i&&"foreignObject"!==h,o,a,o?o[0]:n.__k&&bI(n,0),s),null!=o)for(p=o.length;p--;)null!=o[p]&&pI(o[p]);s||("value"in f&&void 0!==(p=f.value)&&(p!==e.value||"progress"===h&&!p||"option"===h&&p!==d.value)&&OI(e,"value",p,d.value,!1),"checked"in f&&void 0!==(p=f.checked)&&p!==e.checked&&OI(e,"checked",p,d.checked,!1))}return e}function RI(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){iI.__e(e,n)}}function LI(e,t,n){var r,i;if(iI.unmount&&iI.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||RI(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){iI.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&LI(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||pI(e.__e),e.__=e.__e=e.__d=void 0}function _I(e,t,n){return this.constructor(e,n)}function PI(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).createElement,t=void 0===e?document.createElement.bind(document):e;let n,r,i=bq();const o={transform:void 0,disableScreenReader:!1},a=xq();return a.element=()=>n,a.root=()=>n,a.settings=e=>(e&&Object.keys(o).forEach(t=>{void 0!==e[t]&&(o[t]=e[t])}),o),a.appendTo=e=>(n||(n=t("div"),n.style.position="absolute",n.style["-webkit-font-smoothing"]="antialiased",n.style["-moz-osx-font-smoothing"]="antialiased",n.style.pointerEvents="none"),e.appendChild(n),n),a.render=e=>{if(!n)return!1;const t="function"==typeof o.transform&&o.transform();if(t){const e=t.horizontalScaling,r=t.horizontalSkewing,i=t.verticalSkewing,o=t.verticalScaling,a=t.horizontalMoving,s=t.verticalMoving;return n.style.transform="matrix(".concat(e,", ").concat(r,", ").concat(i,", ").concat(o,", ").concat(a,", ").concat(s,")"),!0}n.style.transform="";let a;return o.disableScreenReader&&n.setAttribute("aria-hidden",!0),n.style.left="".concat(i.computedPhysical.x,"px"),n.style.top="".concat(i.computedPhysical.y,"px"),n.style.width="".concat(i.computedPhysical.width,"px"),n.style.height="".concat(i.computedPhysical.height,"px"),a=Array.isArray(e)?mI("div",null,e):e,r=function(e,t,n){var r,i,o;iI.__&&iI.__(e,t),i=(r="function"==typeof n)?null:n&&n.__k||t.__k,o=[],TI(t,e=(!r&&n||t).__k=mI(yI,null,[e]),i||uI,uI,void 0!==t.ownerSVGElement,!r&&n?[n]:i?null:t.firstChild?rI.call(t.childNodes):null,o,!r&&n?n:i?i.__e:t.firstChild,r),qI(o,e)}(a,n,r),!0},a.renderArgs=[mI],a.clear=()=>{if(n){let e=n.firstChild;for(;e;)n.removeChild(e),e=n.firstChild;r=null}return a},a.destroy=()=>{n&&n.parentElement&&n.parentElement.removeChild(n),n=null,r=null},a.size=e=>(e&&(i=bq(e)),i),a}rI=dI.slice,iI={__e:function(e,t,n,r){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),a=i.__d),a)return i.__E=i}catch(t){e=t}throw e}},oI=0,vI.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=hI({},this.state),"function"==typeof e&&(e=e(hI({},n),this.props)),e&&hI(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),SI(this))},vI.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),SI(this))},vI.prototype.render=yI,aI=[],lI="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,cI=function(e,t){return e.__v.__b-t.__v.__b},MI.__r=0;var zI=[function(e){e.renderer("svg",nI)},function(e){e.renderer("canvas",Tq)},function(e){e.renderer("dom",PI)}];const FI={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4};const jI=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.level,n=void 0===t?FI.OFF:t,r=e.pipe,i=void 0===r?console:r,o=n;const a={[FI.OFF]:()=>{},[FI.ERROR]:function(){return i.error(...arguments)},[FI.WARN]:function(){return i.warn(...arguments)},[FI.INFO]:function(){return i.info(...arguments)},[FI.DEBUG]:function(){return i.log(...arguments)}},s=function(e){if(e&&!(o<e)){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];(a[e]||a[FI.DEBUG])(...n)}};return{log:s,error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(FI.ERROR,...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(FI.WARN,...t)},info:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(FI.INFO,...t)},debug:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return s(FI.DEBUG,...t)},level:e=>("number"==typeof e&&(o=e),o),LOG_LEVEL:FI}}(t.logger),i={component:Jb(n.component,"component",r),data:Jb(n.data,"data",r),formatter:Jb(n.formatter,"formatter",r),interaction:Jb(n.interaction,"interaction",r),renderer:FC(n.renderer),scale:Jb(n.scale,"scale",r),symbol:Jb(n.symbol,"symbol",r),logger:r};function o(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e({palettes:t.palettes.concat(n.palettes||[]),style:Dv({},t.style,n.style),logger:n.logger||t.logger,renderer:n.renderer||t.renderer},i)}return t.renderer&&t.renderer.prio&&i.renderer.default(t.renderer.prio[0]),o.use=function(e){return function(e){e(arguments.length>2?arguments[2]:void 0,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i)},o.chart=e=>zC(e,{registries:i,logger:r,style:t.style,palettes:t.palettes}),o.config=()=>t,Object.keys(i).forEach(e=>{o[e]=i[e]}),o.version=Tv,o}({renderer:{prio:["svg","canvas"]},logger:{level:0},style:{"$font-family":"'Source Sans Pro', Arial, sans-serif","$font-size":"12px","$line-height":"16px","$font-size--l":"16px","$font-weight":"normal","$gray-100":"#ffffff","$gray-98":"#f9f9f9","$gray-95":"#f2f2f2","$gray-90":"#e6e6e6","$gray-35":"#595959","$gray-30":"#4d4d4d","$gray-25":"#404040","$gray-20":"#333333","$border-95":"rgba(255, 255, 255, 0.05)","$border-90":"rgba(255, 255, 255, 0.1)","$border-80":"rgba(255, 255, 255, 0.2)","$border-20":"rgba(0, 0, 0, 0.2)","$border-10":"rgba(0, 0, 0, 0.1)","$border-5":"rgba(0, 0, 0, 0.05)","$primary-blue":"#3F8AB3","$primary-green":"#6CB33F","$primary-red":"#DC423F","$primary-orange":"#EF960F","$spacing--s":4,$spacing:8,"$spacing--l":12,"$font-color":"$gray-35","$font-color--inverted":"$gray-90","$guide-color":"$gray-90","$guide-color--inverted":"$gray-35",$border:"$border-80","$border--inverted":"$border-10",$shape:{fill:"$primary-blue",strokeWidth:1,stroke:"$border"},"$shape-outline":{stroke:"$primary-blue",strokeWidth:2},"$shape-guide":{stroke:"$guide-color",strokeWidth:1},"$shape-guide--inverted":{"@extend":"$shape-guide",stroke:"$guide-color--inverted"},$label:{fontSize:"$font-size",fontFamily:"$font-family",fill:"$font-color"},"$label--inverted":{$extend:"$label",fill:"$font-color--inverted"},"$label-overlay":{fontSize:"$font-size--l",fontFamily:"$font-family",fill:"$gray-100",color:"$font-color",stroke:"$guide-color--inverted",strokeWidth:1,borderRadius:4},$title:{"@extend":"$label",fontSize:"$font-size--l",fontWeight:"$font-weight",stroke:"$guide-color--inverted",strokeWidth:0},"$guide-line":{strokeWidth:1,stroke:"$guide-color"},"$guide-line--minor":{strokeWidth:1,stroke:"$gray-95"},"$padding--s":{left:"$spacing--s",right:"$spacing--s",top:"$spacing--s",bottom:"$spacing--s"},$padding:{left:"$spacing",right:"$spacing",top:"$spacing",bottom:"$spacing"},"$selection-area-target":{fill:"$primary-green",strokeWidth:0,opacity:.2}},palettes:[{key:"categorical",colors:[["#a54343","#d76c6c","#ec983d","#ecc43d","#f9ec86","#cbe989","#70ba6e","#578b60","#79d69f","#26a0a7","#138185","#65d3da"]]},{key:"diverging",colors:[["#3d52a1","#3a89c9","#77b7e5","#b4ddf7","#e6f5fe","#ffe3aa","#f9bd7e","#ed875e","#d24d3e","#ae1c3e"]]},{key:"sequential",colors:[["rgb(180,221,212)","rgb(34, 83, 90)"]]}]},{component:jC,data:UC,formatter:SM,interaction:WC,renderer:FC(),scale:ME,symbol:Ok});function $I(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 BI(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 VI(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 HI(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VI(Object(n),!0).forEach(function(t){BI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function UI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $I(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)?$I(e,t):void 0}}(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.")}()}eT.forEach(jI.use),zI.forEach(jI.use),[].forEach(jI.use);var WI=Object.prototype.hasOwnProperty,YI=Object.prototype.toString,KI=Object.defineProperty,GI=Object.getOwnPropertyDescriptor,XI=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===YI.call(e)},JI=function(e){if(!e||"[object Object]"!==YI.call(e))return!1;var t,n=WI.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&WI.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||WI.call(e,t)},ZI=function(e,t){KI&&"__proto__"===t.name?KI(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},QI=function(e,t){if("__proto__"===t){if(!WI.call(e,t))return;if(GI)return GI(e,t).value}return e[t]},eR=function e(){var t,n,r,i,o,a,s=arguments[0],l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),(null==s||"object"!=typeof s&&"function"!=typeof s)&&(s={});l<c;++l)if(null!=(t=arguments[l]))for(n in t)r=QI(s,n),s!==(i=QI(t,n))&&(u&&i&&(JI(i)||(o=XI(i)))?(o?(o=!1,a=r&&XI(r)?r:[]):a=r&&JI(r)?r:{},ZI(s,{name:n,newValue:e(u,a,i)})):void 0!==i&&ZI(s,{name:n,newValue:i}));return s};function tR(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 nR(e,t,n){let r=n.key;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 rR(e){let t=e.cache,n=e.f,r=e.mainCell,i=e.p,o=e.page,a=e.rowIdx,s=e.row,l=e.sourceKey,c=e.target,u=e.targetProp,d=e.columnOrder,f=r;if(i.field&&i.field!==n){const e=tR(i.field,o,{cache:t},d);if(-1===e)return;f=eR({qRow:a},e(s))}c[u]=nR(i,f,{key:l})}function iR(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),c=r.normalizeConfig(i[e],t),u=c.props,d=c.main,f=Object.keys(u),h=!!i[e].trackBy,p=typeof i[e].trackBy,m={},g=[],y=[];for(let t=0;t<a.qDataPages.length;t++){const o=tR(l,a.qDataPages[t],{cache:n},a.qColumnOrder);if(-1!==o)for(let c=0;c<a.qDataPages[t].qMatrix.length;c++){const v=a.qDataPages[t].qArea.qTop+c,b=eR({qRow:v},o(a.qDataPages[t].qMatrix[c])),x=nR(d,b,{key:s});if(!(d.filter&&!d.filter(b))){for(let e=0;e<f.length;e++){const r=u[f[e]];let i=r.fields||[r];r.fields&&(x[f[e]]=[]);for(let o=0;o<i.length;o++)rR({cache:n,f:l,mainCell:b,p:i[o],prop:f[e],page:a.qDataPages[t],rowIdx:v,row:a.qDataPages[t].qMatrix[c],sourceKey:s,target:r.fields?x[f[e]]:x,targetProp:r.fields?o:f[e],columnOrder:a.qColumnOrder});if(r.fields){const t=x[f[e]].map(e=>e.value),n=x[f[e]].map(e=>e.label);x[f[e]]={value:"function"==typeof r.value?r.value(t):void 0!==r.value?r.value:t,label:"function"==typeof r.label?r.label(n):void 0!==r.label?String(r.label):String(x[f[e]].value)}}}h&&r.track({cfg:i[e],itemData:b,obj:x,target:g,tracker:m,trackType:p}),y.push(x)}}}const v=h?r.collect(g,{main:d,propsArr:f,props:u}):y;o=[...o,...v]}return o}function oR(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 aR(e,t){e instanceof Map?(e=[void 0,e],void 0===t&&(t=lR)):void 0===t&&(t=sR);for(var n,r,i,o,a,s=new dR(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 dR(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(uR)}function sR(e){return e.children}function lR(e){return Array.isArray(e)?e[1]:null}function cR(e){void 0!==e.data.value&&(e.value=e.data.value),e.data=e.data.data}function uR(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function dR(e){this.data=e,this.depth=this.height=0,this.parent=null}function fR(e){return null==e?null:function(e){if("function"!=typeof e)throw new Error;return e}(e)}dR.prototype=aR.prototype={constructor:dR,count:function(){return this.eachAfter(oR)},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;e=n.pop(),t=r.pop();for(;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 aR(this).eachBefore(cR)},[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 hR={depth:-1},pR={},mR={};function gR(e){return e.id}function yR(e){return e.parentId}function vR(){var e,t=gR,n=yR;function r(r){var i,o,a,s,l,c,u,d,f=Array.from(r),h=t,p=n,m=new Map;if(null!=e){const t=f.map((t,n)=>function(e){e=`${e}`;let t=e.length;xR(e,t-1)&&!xR(e,t-2)&&(e=e.slice(0,-1));return"/"===e[0]?e:`/${e}`}(e(t,n,r))),n=t.map(bR),i=new Set(t).add("");for(const e of n)i.has(e)||(i.add(e),t.push(e),n.push(bR(e)),f.push(mR));h=(e,n)=>t[n],p=(e,t)=>n[t]}for(a=0,i=f.length;a<i;++a)o=f[a],c=f[a]=new dR(o),null!=(u=h(o,a,r))&&(u+="")&&(d=c.id=u,m.set(d,m.has(d)?pR:c)),null!=(u=p(o,a,r))&&(u+="")&&(c.parent=u);for(a=0;a<i;++a)if(u=(c=f[a]).parent){if(!(l=m.get(u)))throw new Error("missing: "+u);if(l===pR)throw new Error("ambiguous: "+u);l.children?l.children.push(c):l.children=[c],c.parent=l}else{if(s)throw new Error("multiple roots");s=c}if(!s)throw new Error("no root");if(null!=e){for(;s.data===mR&&1===s.children.length;)s=s.children[0],--i;for(let e=f.length-1;e>=0&&(c=f[e]).data===mR;--e)c.data=null}if(s.parent=hR,s.eachBefore(function(e){e.depth=e.parent.depth+1,--i}).eachBefore(uR),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(e){return arguments.length?(t=fR(e),r):t},r.parentId=function(e){return arguments.length?(n=fR(e),r):n},r.path=function(t){return arguments.length?(e=fR(t),r):e},r}function bR(e){let t=e.length;if(t<2)return"";for(;--t>1&&!xR(e,t););return e.slice(0,t)}function xR(e,t){if("/"===e[t]){let n=0;for(;t>0&&"\\"===e[--t];)++n;if(!(1&n))return!0}return!1}function SR(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=SR(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]=SR(r,i[e]);return t}n[e]in i&&(i=i[n[e]])}return i}function MR(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,...MR(e[i].children,t-1,n)]);return r}function wR(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=>MR(e.children,r-1,n)}return!1}const ER=/^qDimensionInfo(?:\/(\d+))?/,kR=/^\/?qMeasureInfo\/(\d+)/,CR=/\/qAttrExprInfo\/(\d+)/,AR=/\/qAttrDimInfo\/(\d+)/;function OR(e){const t=e.qColumnOrder&&e.qColumnOrder.length?e.qColumnOrder:e.qDimensionInfo.map((e,t)=>t);return t.filter(t=>t<e.qDimensionInfo.length)}function NR(e,t){let n=t.cube;if(!e)return-1;let r=e.origin&&e.origin()?e.origin().key():e.key(),i=!1,o=-1,a=-1,s=-1,l=-1,c=-1,u=-1,d=r;const f=n.qEffectiveInterColumnSortOrder,h=OR(n);return ER.test(d)&&(i=!0,o=+ER.exec(d)[1],d=r.replace(ER,"")),kR.test(d)&&("K"===n.qMode?c=+kR.exec(d)[1]:f&&-1!==f.indexOf(-1)?(c=+kR.exec(d)[1],u=0):u=+kR.exec(d)[1],d=d.replace(kR,"")),d&&(AR.exec(d)?s=+AR.exec(d)[1]:CR.exec(d)&&(a=+CR.exec(d)[1])),l=i?"S"===n.qMode?h[o]:f?f.indexOf(o):o:f&&-1!==f.indexOf(-1)?f.indexOf(-1):n.qDimensionInfo.length-("K"===n.qMode?0:1),{fieldDepth:l+1,pseudoMeasureIndex:c,measureIdx:u,attrDimIdx:s,attrIdx:a}}function DR(e,t){let n,r,i=wR(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 TR(e,t,n){let r=n.key;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 qR(e){let t=e.propsArr,n=e.props,r=e.item,i=e.itemData,o=e.ret,a=e.sourceKey;for(let e=0;e<t.length;e++){const s=n[t[e]],l=s.fields||[s];let c,u;s.fields&&(c=[],u=[]);for(let n=0;n<l.length;n++){const d=l[n];let f,h,p,m,g,y;if("primitive"===d.type?(p=d.value,y=String(d.value)):("function"==typeof d.value&&(f=e=>d.value(e,r)),"function"==typeof d.label&&(h=e=>d.label(e,r)),d.accessor?(m=d.accessor(r),Array.isArray(m)?(g=m.map(d.valueAccessor),d.attrAccessor&&(g=g.map(d.attrAccessor)),f&&(p=g.map(f),f=null),h&&(y=g.map(h),h=null),p=d.reduce?d.reduce(p):p,y=d.reduceLabel?d.reduceLabel(y,p):String(p)):(p=d.attrAccessor?d.attrAccessor(d.valueAccessor(m)):d.valueAccessor(m),y=p)):(p=i,y=i)),s.fields){const e=f?f(p):p;c.push(e),u.push(h&&null!=y?h(y):null!=y?y:String(e))}else{const n=f?f(p):p;o[t[e]]={value:n,label:h?h(y):null!=y?y:String(n)},d.field&&(o[t[e]].source={field:d.field.key(),key:a})}}c&&(o[t[e]]={value:"function"==typeof s.value?s.value(c,r):c,label:"function"==typeof s.label?s.label(u,r):u})}}const IR=(e,t,n)=>{const r="K"===e.qMode?"/qStackedDataPages/*/qData":"/qTreeDataPages/*",i="K"===e.qMode?"qSubNodes":"qNodes",o=SR(r,e);return o&&o[0]?(t.tree=aR(o[0],n.children||(e=>e[i])),t.tree):null};const RR=e=>{let t=e.propsArr,n=e.props,r=e.cube;e.cache;let i=e.itemDepthObject,o=e.f;for(let e=0;e<t.length;e++){const a=n[t[e]],s=a.fields?a.fields:[a];for(let e=0;e<s.length;e++){const t=s[e];if(t.field!==o){const e=DR(i,NR(t.field,{cube:r}));t.accessor=e.nodeFn,t.valueAccessor=e.valueFn,t.attrAccessor=e.attrFn}}}};function LR(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;const i=t.raw(),o=t.key(),a="S"===i.qMode?function(e){const t=e.raw().qDataPages.length?e.raw().qDataPages[0].qMatrix:[],n=function(e){const t=e.raw().qColumnOrder,n=e.fields();return t&&t.length===n.length?t:n.map((e,t)=>t)}(e),r=e.fields(),i=e.fields().filter(e=>"dimension"===e.type()).map(e=>n.indexOf(r.indexOf(e))),o=e.fields().filter(e=>"measure"===e.type()).map(e=>n.indexOf(r.indexOf(e))),a={__root:{__id:"__root",qValues:[]}};for(let e=0;e<t.length;e++){const n=t[e];let r="__root",l=!1;for(let e=0;e<i.length;e++){var s;const t=n[i[e]],o="".concat(r,"__").concat(null!==(s=t.qElemNumber)&&void 0!==s?s:t.qElemNo);a[o]||(a[o]=HI({__id:o,__parent:r,qValues:[]},t),l=!0),r=o}if(l)for(let e=0;e<o.length;e++){const t=n[o[e]];a[r].qValues.push(t)}}const l=Object.keys(a).map(e=>a[e]),c=vR().id(e=>e.__id).parentId(e=>e.__parent)(l);return c}(t):IR(i,n,e);if(!a)return null;const s=a.height,l=[];for(let o=0;o<=s;o++){let a=null;if(o>0)if("S"===i.qMode){let e=OR(i)[o-1];a=n.fields[e]}else{let e=i.qEffectiveInterColumnSortOrder[o-1];o>i.qEffectiveInterColumnSortOrder.length&&(e=i.qDimensionInfo.length),a=n.fields[e]}const s=r.normalizeConfig(HI(HI({},e),{},{field:a?a.key():void 0}),t),c=s.props,u=s.main,d=Object.keys(c);l[o]={propsArr:d,props:c,main:u};const f=a?NR(a,{cube:i}):{fieldDepth:0};RR({propsArr:d,props:c,cube:i,cache:n,itemDepthObject:f,f:a})}const c=a.copy().descendants(),u=a.descendants();for(let e=0;e<u.length;e++){const t=l[u[e].depth].propsArr,n=l[u[e].depth].props,r=l[u[e].depth].main,i=c[e],a=i.data,s=TR(r,a,{key:o});qR({propsArr:t,props:n,item:i,itemData:a,ret:s,sourceKey:o}),u[e].data=s}return a}function _R(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(!IR(s,n,e))continue;const c="object"==typeof i[a].field?i[a].field:t.field(i[a].field),u=r.normalizeConfig(i[a],t),d=u.props,f=u.main,h=Object.keys(d),p=NR(c,{cube:s}),m=DR({fieldDepth:0},p),g=m.nodeFn,y=m.attrFn,v=m.valueFn;RR({propsArr:h,props:d,cube:s,cache:n,itemDepthObject:p,f:c});const b=!!i[a].trackBy,x=typeof i[a].trackBy,S={},M=[],w=g(n.tree),E=[];for(let e=0;e<w.length;e++){const t=w[e],n=y?y(v(t)):v(t);if(f.filter&&!f.filter(n))continue;const o=TR(f,n,{key:l});qR({propsArr:h,props:d,item:t,itemData:n,ret:o,sourceKey:l}),b&&r.track({cfg:i[a],itemData:n,obj:o,target:M,tracker:S,trackType:x}),E.push(o)}const k=b?r.collect(M,{main:f,propsArr:h,props:d}):E;o=[...o,...k]}return o}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var PR=function(e,t){return e(t={exports:{}},t.exports),t.exports}(function(e){
/*! javascript-number-formatter - v1.1.11 - http://mottie.github.com/javascript-number-formatter/ * © ecava */
e.exports=function(e,t){if(!e||isNaN(+t))return t;var n,r,i,o,a,s,l,c,u,d,f=e.length,h=e.search(/[0-9\-\+#]/),p=h>0?e.substring(0,h):"",m=e.split("").reverse().join(""),g=m.search(/[0-9\-\+#]/),y=f-g,v=e.substring(y,y+1),b=y+("."===v||","===v?1:0),x=g>0?e.substring(b,f):"";if(n=(t="-"===(e=e.substring(h,b)).charAt(0)?-t:+t)<0?t=-t:0,i=(r=e.match(/[^\d\-\+#]/g))&&r[r.length-1]||".",o=r&&r[1]&&r[0]||",",e=e.split(i),t=+(t=t.toFixed(e[1]&&e[1].length))+"",s=e[1]&&e[1].lastIndexOf("0"),(!(c=t.split("."))[1]||c[1]&&c[1].length<=s)&&(t=(+t).toFixed(s+1)),u=e[0].split(o),e[0]=u.join(""),(a=e[0]&&e[0].indexOf("0"))>-1)for(;c[0].length<e[0].length-a;)c[0]="0"+c[0];else 0===+c[0]&&(c[0]="");if((t=t.split("."))[0]=c[0],l=u[1]&&u[u.length-1].length){for(m="",y=(d=t[0]).length%l,f=d.length,b=0;b<f;b++)m+=d.charAt(b),!((b-y+1)%l)&&b<f-l&&(m+=o);t[0]=m}return t[1]=e[1]&&t[1]?i+t[1]:"","0"!==(r=t.join(""))&&""!==r||(n=!1),p+(n?"-":"")+r+x}});function zR(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}const FR={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"},jR=/%\)?$/,$R=/^\(r(0[2-9]|[12]\d|3[0-6])\)/i,BR=/^\(oct\)/i,VR=/^\(dec\)/i,HR=/^\(hex\)/i,UR=/^\(bin\)/i,WR=/^\(rom\)/i,YR=/^(\(rom\)|\(bin\)|\(hex\)|\(dec\)|\(oct\)|\(r(0[2-9]|[12]\d|3[0-6])\))/i,KR=/#|0/g;function GR(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 XR(e,t,n){let r;return $R.test(t)?e=GR(e,Number(/\d{2}/.exec(t)[0]),t,n):BR.test(t)?e=GR(e,8,t,n):VR.test(t)?e=GR(e,10,t,n):HR.test(t)?e=GR(e,16,t,n):UR.test(t)?e=GR(e,2,t,n):WR.test(t)&&(r="",e<0&&(r="-",e=-e),0===(e=Math.floor(e))?e="0":e<=5e5?(e=function(e,t){let n,r="",i=Number(String(e).slice(-3)),o=(e-i)/1e3,a=[0,1,4,5,9,10,40,50,90,100,400,500,900].reverse(),s=["0","I","IV","V","IX","X","XL","L","XC","C","CD","D","CM"].reverse();for(;i>0;)for(n=0;n<a.length;n++)if(a[n]<=i){r+=s[n],i-=a[n];break}for(n=0;n<o;n++)r="M".concat(r);return t[1]!==t[1].toUpperCase()&&(r=r.toLowerCase()),r}(e,t),e=r+e):e=t+r+e.toExponential(0)),e}function JR(e,t,n){const r=zR(e);return n?r:new RegExp(r||"",t)}function ZR(e,t,n,r){let i,o,a,s,l,c,u,d,f,h=e.pattern;var p,m;r&&(e.abbreviate=!0),p=t,(m=n)&&(m=zR(m)),p&&(p=zR(p)),f=new RegExp("(?:[#0]+".concat(p,")?[#0]+(?:").concat(m,"[#0]+)?")),a=h.match(f),a=a?a[0]:"",s=a?h.substr(0,h.indexOf(a)):h,l=a?h.substring(h.indexOf(a)+a.length):"",a||(a=h?"#":"##########"),t&&t===n&&(i=a.split(n),o=i.pop(),a=i.join("")+n+o,t=""),c=t,t=/,/.test(n)?"¤":",",c&&(a=a.replace(JR(c,"g"),t)),u=n,n=".",u&&(a=a.replace(JR(u,"g"),n)),d=a.match(/#/g),d=d?d.length:0;const g=h.split(u);let y;g[1]&&(y=g[1].match(KR)),e.prefix=s||"",e.postfix=l||"",e.pattern=h,e.maxPrecision=y?y.length:2,e.percentage=jR.test(h),e.numericPattern=a||"",e.numericRegex=new RegExp("".concat(JR(t,null,!0),"|").concat(JR(n,null,!0)),"g"),e.groupTemp=c,e.decTemp=u,e.t=t,e.d=n,e.temp=d}class QR{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 FR;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 QR(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],YR.test(e[0])&&(r.positive.isFunctional=!0),e[1]?YR.test(e[1])&&(r.negative.isFunctional=!0):r.negative=!1,e[2]?YR.test(e[2])&&(r.zero.isFunctional=!0):r.zero=!1;const i="U"===this.type;r.positive.isFunctional||ZR(r.positive,t,n,i),r.negative&&!r.negative.isFunctional&&ZR(r.negative,t,n,i),r.zero&&!r.zero.isFunctional&&ZR(r.zero,t,n,i)}formatValue(e){let t,n,r,i,o,a,s,l,c,u=this._prepared,d="",f="",h=e;if(isNaN(e))return"".concat(h);if(e=+e,!1===u.pattern)return e.toString();if(0===e&&u.zero)return u=u.zero,u.pattern;if(e<0&&u.negative?(u=u.negative,e=-e):u=u.positive,o=u.d,a=u.t,u.isFunctional)e=XR(e,u.pattern,o);else{if(u.percentage&&(e*=100),u.abbreviate){const t=Object.keys(this.abbreviations).map(e=>parseInt(e,10)).sort((e,t)=>e-t);let r,i,o=t[0];for(s=0,n=Number(Number(e).toExponential().split("e")[1]);o<=n&&s<t.length;)s++,o=t[s];s>0&&(r=t[s-1]),r&&n>0&&r>0?i=r:(n<0&&r<0||!r)&&(o<0&&o-n<=u.maxPrecision?i=o:r<=n&&!(o>0&&-n<=u.maxPrecision)&&(i=r)),i&&(d=this.abbreviations[i],e/=10**i)}if(r=Math.abs(e),t=u.temp,l=u.numericPattern,c=l.split(o)[1],"I"===this.type&&(e=Math.round(e)),i=e,c||"#"!==l.slice(-1)[0])if(r>=1e15||r>0&&r<=1e-14)e=r?r.toExponential(15).replace(/\.?0+(?=e)/,""):"0";else{const t=Number((e+1e-15*(e<0?-1:1)).toFixed(Math.min(20,c?c.length:0)).split(".")[0]);let n=l.split(o)[0];if(n+=o,e=PR(n,t)||"0",c){const t=Math.max(0,Math.min(14,c.length)),n=c.replace(/#+$/,"").length;let i=("I"===this.type?0:r%1+1e-15).toFixed(t).slice(2).replace(/0+$/,"");for(s=i.length;s<n;s++)i+="0";i&&(e+=o+i)}else 0===t&&(i=0)}else if(r>=10**t||r<1||r<1e-4)0===e?e="0":r<1e-4||r>=1e20?(e=(e=i.toExponential(Math.max(1,Math.min(14,t))-1)).replace(/\.?0+(?=e)/,""),f=""):(e=e.toPrecision(Math.max(1,Math.min(14,t)))).indexOf(".")>=0&&(e=(e=e.replace(e.indexOf("e")<0?/0+$/:/\.?0+(?=e)/,"")).replace(".",o));else{for(l+=o,t=Math.max(0,Math.min(20,t-Math.ceil(Math.log(r)/Math.log(10)))),s=0;s<t;s++)l+="#";e=PR(l,e)}e=e.replace(u.numericRegex,e=>e===a?u.groupTemp:e===o?u.decTemp:""),i<0&&!/^-/.test(e)&&(e="-".concat(e))}return u.prefix+e+f+d+u.postfix}static getStaticFormatter(){return{prepare(){},formatValue:e=>"".concat(e)}}}function eL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=t.size,r=void 0===n?5e3:n,i=t.multipleArguments,o=void 0!==i&&i,a=t.toKey,s=void 0===a?e=>e:a;let l,c,u=Object.create(null),d=Object.create(null),f=0,h=0;return l=o?function(){return c=s(...arguments),l.has(c)?l.get(c):l.set(c,e(...arguments))}:t=>(c=s(t),l.has(c)?l.get(c):l.set(c,e(t))),l.set=(e,t)=>(f>=r&&(delete u[d[h]],delete d[h],f--,h++),u[e]=t,d[f]=e,f++,t),l.get=e=>u[e],l.has=e=>e in u,l.clear=()=>{u=Object.create(null),d=Object.create(null),f=0,h=0},l.size=()=>f,l}function tL(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 QR(...t)}(i,e,t,n,r),a=eL(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 nL="D",rL="T",iL="TS",oL="IV",aL=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],sL=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],lL=["January","February","March","April","May","June","July","August","September","October","November","December"],cL=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function uL(e,t){for(let n=e.length;n<t;n++)e="0".concat(e);return e}function dL(e){let t=e.toString().split(".");return t[1]?(t=Number("0.".concat(t[1])),t):0}function fL(e,t){let n,r=function(e){const t=e,n=24*dL(t),r=60*dL(n),i=60*dL(r),o=1e3*dL(i);return{d:Math.floor(t),h:Math.floor(n),m:Math.floor(r),s:Math.floor(i),f:Math.round(o)}}(e),i=r.d,o=r.h,a=r.m,s=r.s,l=r.f,c=0;/w+|t+/gi.test(t)&&(n=new Date(Date.UTC(1899,11,30+Math.floor(e),0,0,Math.round(86400*(e-Math.floor(e))))),isNaN(n.getTime())&&(n=null)),/D+/gi.test(t)||(o+=24*i),/h+/gi.test(t)||(a+=60*o),/m+/gi.test(t)||(s+=60*a),/w+/gi.test(t)&&(c=n?n.getDay()-1:0,c<0&&(c=6));let u="";return n&&(u=n.getUTCHours()>=12?"pm":"am"),{year:0,month:0,day:c,date:i,h:o,m:a,s:s,f:l,t:u}}class hL{constructor(e,t,n){const r=e||{};if(r.qCalendarStrings||(r.qCalendarStrings={qLongDayNames:aL,qDayNames:sL,qLongMonthNames:lL,qMonthNames:cL}),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={[rL]:r.qTimeFmt||"hh:mm:ss",[nL]:r.qDateFmt||"YYYY-MM-DD",[iL]:r.qTimestampFmt||"YYYY-MM-DD hh:mm:ss"}[n]}this.pattern=t}clone(){const e=new hL(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=fL(e,t));const i=function(e,t){return{"Y+|y+":{Y:"".concat(Number("".concat(t.year).slice(-2))),YY:uL("".concat(t.year).slice(-2),2),YYY:uL("".concat(t.year).slice(-3),3),def:e=>uL("".concat(t.year),e.length)},"M+":{M:t.month+1,MM:uL("".concat(t.month+1),2),MMM:e.locale_months_abbr[t.month],def:e.locale_months[t.month]},"W+|w+":{W:t.day,WW:uL("".concat(t.day),2),WWW:e.locale_days_abbr[t.day],def:e.locale_days[t.day]},"D+|d+":{D:t.date,def:e=>uL("".concat(t.date),e.length)},"h+|H+":{h:t.h,def:e=>uL("".concat(t.h),e.length)},"m+":{m:t.m,def:e=>uL("".concat(t.m),e.length)},"s+|S+":{s:t.s,def:e=>uL("".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"),s=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});return s}}function pL(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return new hL(...t)}function mL(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TS",n=pL(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,e,t),r=eL(n.format.bind(n),{toKey:e=>"object"==typeof e&&"function"==typeof e.getTime?e.getTime():e});function i(e){return t!==oL?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=pL(i,e,t),r=eL(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 gL(e,t){if(e&&e.qNumFormat&&-1!==["D","T","TS","IV"].indexOf(e.qNumFormat.qType))return mL(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"),tL(n,r,i,o,t)}function yL(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.meta,r=t.id,i=t.key,o=t.localeInfo,a=t.fieldExtractor,s=t.value,l=t.type,c=t.sourceField;const u=s||("dimension"===l?e=>null==e?void 0:e.qElemNo:e=>null==e?void 0:e.qValue),d="dimension"===l?"first":"avg",f=gL(n,o),h="dimension"===l?"first":(e,t)=>f(t),p={id:()=>r,key:()=>i,raw:()=>n,title:()=>n.qFallbackTitle||n.label,type:()=>l,origin:()=>c,items:()=>(e||(e=a(p)),e),min:()=>n.qMin,max:()=>n.qMax,value:u,label:e=>(null==e?void 0:e.qText)||"",reduce:d,reduceLabel:h,formatter:()=>f,tags:()=>n.qTags};return p}function vL(e,t,n,r,i){return(t[e]||[]).map((t,o)=>{const a="".concat(r?"".concat(r,"/"):"").concat(e,"/").concat(o),s={instance:yL(eR({id:"".concat(n?"".concat(n,"/"):"").concat(a),key:a,meta:t},i))};return s.attrDims=vL("qAttrDimInfo",t,n,a,eR({},i,{value:e=>null==e?void 0:e.qElemNo,type:"dimension"})),s.attrExps=vL("qAttrExprInfo",t,n,a,eR({},i,{value:e=>null==e?void 0:e.qNum,type:"measure"})),s.measures=vL("qMeasureInfo",t,n,a,eR({},i,{value:e=>null==e?void 0:e.qValue,type:"measure"})),s})}function bL(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.key,n=e.data,r=e.config,i=void 0===r?{}:r;const o={fields:[],wrappedFields:[],allFields:[],virtualFields:[]},a=n;if(!a)throw new Error('Missing "data" input');if(!a.qDimensionInfo)throw new Error('The "data" input is not recognized as a hypercube');const s=bL.util,l={cache:o,cube:a,localeInfo:i.localeInfo,fieldExtractor:null,pages:null,hierarchy:()=>null,virtualFields:i.virtualFields},c={key:()=>t,raw:()=>a,field:e=>function(e,t){let n=t.cache;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,l),fields:()=>o.fields.slice(),extract:e=>l.extractor(e,c,o,s),hierarchy:e=>l.hierarchy(e,c,o,s),_cache:()=>o};"K"===a.qMode||"T"===a.qMode||!a.qMode&&a.qNodesOnDim?(l.extractor=_R,l.hierarchy=LR,l.pages="K"===a.qMode?a.qStackedDataPages:a.qTreeDataPages):"S"===a.qMode?(l.extractor=iR,l.pages=a.qDataPages,l.hierarchy=LR):l.extractor=()=>[],l.fieldExtractor=e=>l.extractor({field:e},c,o,s);const u="S"===a.qMode?e=>e.qElemNumber:void 0,d="S"===a.qMode?e=>e.qNum:void 0;o.wrappedFields.push(...vL("qDimensionInfo",a,t,"",eR({},l,{value:u,type:"dimension"}))),o.wrappedFields.push(...vL("qMeasureInfo",a,t,"",eR({},l,{value:d,type:"measure"}))),o.fields=o.wrappedFields.map(e=>e.instance);const f=e=>{e.forEach(e=>{o.allFields.push(e.instance),f(e.measures),f(e.attrDims),f(e.attrExps)})};return f(o.wrappedFields),(i.virtualFields||[]).forEach(e=>{const n=c.field(e.from),r=yL(HI({meta:n.raw(),id:"".concat(t,"/").concat(e.key),sourceField:n,fieldExtractor:e=>l.extractor({field:e},c,o,s),key:e.key,type:n.type(),localeInfo:l.localeInfo,value:n.value},e.override||{}));o.virtualFields.push(r)}),o.allFields.push(...o.virtualFields),c}const xL=[["qHyperCube","qHyperCubeDef"],["qTreeData","qTreeDataDef"],["qDimensionInfo","qDimensions"],["qMeasureInfo","qMeasures"],["qAttrDimInfo","qAttributeDimensions"],["qAttrExprInfo","qAttributeExpressions"]],SL=/\/qDimensionInfo(?:\/(\d+))?/,ML=/\/qMeasureInfo\/(\d+)/,wL=/\/qAttrDimInfo\/(\d+)(?:\/(\d+))?/,EL=/\/qAttrExprInfo\/(\d+)/,kL=/\/?qHyperCube/,CL=/\/?qTreeData/,AL=e=>"".concat(e.substr(0,e.indexOf("/qHyperCubeDef")+14)),OL=e=>"".concat(e.substr(0,e.indexOf("/qTreeDataDef")+13));function NL(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;if(e.brushes().forEach(e=>{const t=function(e,t){let n=e,r=-1,i=-1,o="",a=e=>e;kL.test(e)?(o="".concat(n.substr(0,n.indexOf("qHyperCube")+10)),a=AL):CL.test(e)&&(o="".concat(n.substr(0,n.indexOf("qTreeData")+9)),a=OL);let s=!0;if(SL.test(e)&&(r=+SL.exec(e)[1]),ML.test(e)&&(i=+ML.exec(e)[1]),wL.test(e)){i=-1,r=0;const e=+wL.exec(n)[2];isNaN(e)||(r=e,n=n.replace(/\/\d+$/,"")),s=!1}if(EL.test(e)){const e=i;if(t){i=0;const a=SR(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+=+EL.exec(n)[1]}else r>-1?(r=-1,i=+EL.exec(n)[1]):i+=+EL.exec(n)[1]+1}return xL.forEach(e=>{let t=UI(e,2),r=t[0],i=t[1];n=n.replace(r,i)}),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)return[{method:"resetMadeSelections",params:[]}];var c;a.rangeSelectHyperCubeValues&&o.push({method:"rangeSelectHyperCubeValues",params:[a.rangeSelectHyperCubeValues.path,a.rangeSelectHyperCubeValues.ranges,[],null===(c=t.orMode)||void 0===c||c]});return 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}function DL(e){bL.util=e.data("matrix").util,e.data("q",bL),e.formatter("q-number",tL),e.formatter("q-time",mL)}DL.qBrushHelper=NL,DL.selections=NL;const TL={click:"Tap",Click:"Tap",tap:"Tap",pan:"Pan",swipe:"Swipe",rotate:"Rotate",press:"Press",pinch:"Pinch"};function qL(e){return TL[e]||e}function IL(e){return function(t,n,r){let i,o,a,s,l=[],c=!0;function u(){"function"==typeof i.enable&&(i.enable=i.enable.bind(o)()),i.enable&&(i.gestures.forEach(t=>{t.options=t.options||{},void 0===t.options.enable&&(t.options.enable=!0),"function"==typeof t.options.enable&&(t.options.enable=t.options.enable.bind(o));const n=qL(t.type);e&&e[n]&&(t.options.event=t.options.event||t.type.toLowerCase(),a=a||new e.Manager(r),a.add(new e[n](t.options)),Object.keys(t.events).forEach(e=>{t.events[e]=t.events[e].bind(o),a.on(e,t.events[e])}),l.push(t))}),i.gestures.forEach(t=>{const n=qL(t.type);e&&e[n]&&(t.recognizeWith&&a.get(t.options.event).recognizeWith(t.recognizeWith.split(" ").filter(e=>""!==e)),t.requireFailure&&a.get(t.options.event).requireFailure(t.requireFailure.split(" ").filter(e=>""!==e)))}))}function d(){l.forEach(e=>{Object.keys(e.events).forEach(t=>{a.off(t,e.events[t])}),a.remove(e.options.event)}),l=[]}return{get key(){return s},set(e){!function(e){s=e.key,i=e,o={chart:t,mediator:n,settings:i},i.gestures=i.gestures||[],void 0===i.enable&&(i.enable=!0)}(e),d(),c&&u()},off(){c=!1,d()},on(){c=!0,0===l.length&&u()},destroy(){d(),a&&a.destroy(),a=null,o=null,i=null}}}}function RL(e,t,n,r){const i=function(t){const n=String(t);return e(n)};return i.ticks=()=>t.map(t=>{const o=i([t.data.value,r?n-1:0]),a=i([t.data.value,r?0:n-1])+e.bandwidth();return{position:(o+a)/2,label:t.label,data:t.data,start:o,end:a}}),i.bandwidth=()=>e.bandwidth(),i.data=()=>e.data(),i.domain=()=>e.domain(),i.pxScale=function(r){const i=e.pxScale(r);return i===e?this:RL(i,t,n)},i}function LL(e){const t=e.scale("band");e.scale("group-by-measure",function(e={},n={},r={}){const i=t(e,n,r),o=i.domain(),a=i.ticks(),s=[],l=e.measureCount;return o.forEach((e,t)=>{for(let t=0;t<l;++t)s.push(String([e,t]));s.push(`SPACER_${t}_SPACER`)}),s.splice(-1),i.domain(s),RL(i,a,l,e.invert)})}const _L={getDefaultSettings:({size:e=10,fill:t="#999",alignment:n}={})=>({show:!0,type:"n-polygon",fill:t,stroke:"#000",strokeWidth:0,size:e,sides:3,startAngle:-90,alignment:n}),createOob({oob:e,dockValue:t,boxCenter:n,rendWidth:r,rendHeight:i,flipXY:o,symbol:a}){let s="x",c="y",u=r,d=i,f=t<.5?90:-90;return o&&(s="y",c="x",u=i,d=r,f=t<.5?180:0),a(l({},e,{[s]:n*u,[c]:d-Math.max(e.size/2,Math.min(t*d,d-e.size/2)),startAngle:f}))}};function PL({i:e,width:t,height:n,resolved:r,keys:i,flipXY:o,calcKey:a="box"}){let s,c=null,u=null;void 0!==r.major.settings.binStart?(c=r.major.items[e].binStart,u=r.major.items[e].binEnd,s=r.major.settings.binStart.scale):(s=r.major.settings.major.scale,c=s?r.major.items[e].major:0);let d=0;s?s.bandwidth?(d=s.bandwidth(),c-=d/2):d=u-c:d=1;const f=l({},{major:c,majorEnd:u},r.minor.items[e]);i.forEach(t=>{f[t]=r[t].items[e]});const h=o?n:t,p=function({bandwidth:e,width:t,minWidthPx:n,maxWidthPx:r,maxMajorWidth:i}){const o=e>=0?1:-1;let a=Math.min(o*e*t,Number.isNaN(Number(r))?i:r/i);return a=Number.isNaN(Number(n))?a:Math.max(n/i,a),a*o}({bandwidth:d,width:f[a].width,minWidthPx:f[a].minWidthPx,maxWidthPx:f[a].maxWidthPx,maxMajorWidth:h}),m=(d-p)/2,g=m+f.major+p/2;return{item:f,boxCenter:g,boxWidth:p,boxPadding:m,rendWidth:t,rendHeight:n}}function zL({keys:e,data:t,defaultSettings:n,style:r,settings:i,width:o,height:a,resolver:s}){const c=l(!0,{},n||{},r||{}),u={major:"horizontal"===i.orientation?a:o,minor:"horizontal"===i.orientation?o:a},d=i.major;let f;f="object"==typeof d&&"object"==typeof d.ref&&void 0!==d.ref.start&&void 0!==d.ref.end?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:l(!0,{},{binStart:{scale:i.major.scale,ref:i.major.ref.start},binEnd:{scale:i.major.scale,ref:i.major.ref.end}})}):"object"==typeof d&&void 0!==d.binStart&&void 0!==d.binEnd?s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:l(!0,{},{binStart:{scale:i.major.scale,ref:"binStart"},binEnd:{scale:i.major.scale,ref:"binEnd"}},i.major)}):s.resolve({data:t,scaled:u,defaults:{major:.5},settings:{major:i.major}});const h=i.minor||{};let p;const m={major:f,minor:s.resolve({data:t,defaults:{start:0,end:1},scaled:u,settings:l(!0,{},{start:{scale:h.scale,ref:"start"},end:{scale:h.scale,ref:"end"},min:{scale:h.scale,ref:"min"},max:{scale:h.scale,ref:"max"},med:{scale:h.scale,ref:"med"}},h)})};for(let n=0,r=e.length;n<r;n++)p=e[n],m[p]=s.resolve({data:t,defaults:c[p],settings:i[p],scaled:u});return m}const FL=["oob"];const jL={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:10},data:{},style:{}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,{dockValue:n}=this.settings.settings,r="horizontal"===this.settings.settings.orientation,{data:i,style:o,resolver:a,symbol:s}=this,l=zL({keys:FL,data:i,defaultSettings:{oob:_L.getDefaultSettings()},style:o,settings:this.settings.settings,width:e,height:t,resolver:a}),{settings:c,items:u}=l,d=function({width:e,height:t,flipXY:n,resolved:r,keys:i,symbol:o,dockValue:a,_calcItemRenderingOpts:s=PL}){const l=[],{items:c}=r.major;for(let u=0,d=c.length;u<d;u++){const{item:d,boxCenter:f,rendWidth:h,rendHeight:p}=s({i:u,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"oob"}),m=c[u].data,g=[];if(d.oob.show){g.push(_L.createOob({oob:d.oob,dockValue:a,boxCenter:f,rendWidth:h,rendHeight:p,flipXY:n,symbol:o}));const e={type:"container",data:m,collider:{type:"bounds"},children:g};l.push(e)}}return l}({width:e,height:t,flipXY:r,resolved:l,keys:FL,symbol:s,dockValue:n});return d}},$L={size:25,hat:{show:!0,fill:"#999",stroke:"#000",strokeWidth:0,strokeLinejoin:"miter",width:1,maxWidthPx:void 0,minWidthPx:1,minHeightPx:1,alignment:0}},BL=["hat"];function VL(e,t=!0){let n="";for(let t=0;t<e.length;t++){const r=e[t];n+=0===t?`M${r.x} ${r.y}`:`L${r.x} ${r.y}`,n+=" "}return t&&(n+="Z"),n}function HL({item:e,boxWidth:t,boxPadding:n,rendWidth:r,rendHeight:i,flipXY:o}){let a="x",s="y",c=r,u=i,d=e.hat.alignment||0;o&&(a="y",s="x",c=i,u=r,d=1-d);const f=(n+e.major)*c;let h=[{[a]:f,[s]:0+u},{[a]:f+t*d*c,[s]:8},{[a]:f+t*c,[s]:0+u},{[a]:f+t*c,[s]:0+u+10},{[a]:f,[s]:0+u+10}];const p=l({},e.hat,{type:"path",d:VL(h)});h=[{[a]:f,[s]:0},{[a]:f+t*(1-d)*c,[s]:0+u-8},{[a]:f+t*c,[s]:0},{[a]:f+t*c,[s]:-10},{[a]:f,[s]:-10}];return[p,l({},e.hat,{type:"path",d:VL(h)})]}const UL={require:["chart","resolver","symbol"],defaultSettings:{settings:{size:25},data:{},style:{hat:"$shape"}},created(){this.state={}},preferredSize(){return this.settings.settings.size},render(){const{width:e,height:t}=this.rect,n="horizontal"===this.settings.settings.orientation,{data:r,style:i,resolver:o}=this,a=zL({keys:BL,data:r,defaultSettings:$L,style:i,settings:this.settings.settings,width:e,height:t,resolver:o}),{settings:s,items:l}=a,c=function({width:e,height:t,flipXY:n,resolved:r,keys:i,_calcItemRenderingOpts:o=PL}){const a=[],{items:s}=r.major;for(let l=0,c=s.length;l<c;l++){const{item:c,boxWidth:u,boxPadding:d,rendWidth:f,rendHeight:h}=o({i:l,width:e,height:t,resolved:r,keys:i,flipXY:n,calcKey:"hat"}),p=s[l].data,m=[];c.hat.show&&m.push(...HL({item:c,boxWidth:u,boxPadding:d,rendWidth:f,rendHeight:h,flipXY:n}));const g={type:"container",data:p,collider:{type:"bounds"},children:m};a.push(g)}return a}({width:e,height:t,flipXY:n,resolved:a,keys:BL});return c}};var WL,YL,KL={defaultSettings:{settings:{size:10}},preferredSize(){return this.settings.settings.size},render:()=>[]},GL={exports:{}},XL={};function JL(){if(WL)return XL;WL=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),d=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,p={};function m(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||f}function g(){}function y(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||f}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},g.prototype=m.prototype;var v=y.prototype=new g;v.constructor=y,h(v,m.prototype),v.isPureReactComponent=!0;var b=Array.isArray,x=Object.prototype.hasOwnProperty,S={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function w(t,n,r){var i,o={},a=null,s=null;if(null!=n)for(i in void 0!==n.ref&&(s=n.ref),void 0!==n.key&&(a=""+n.key),n)x.call(n,i)&&!M.hasOwnProperty(i)&&(o[i]=n[i]);var l=arguments.length-2;if(1===l)o.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(t&&t.defaultProps)for(i in l=t.defaultProps)void 0===o[i]&&(o[i]=l[i]);return{$$typeof:e,type:t,key:a,ref:s,props:o,_owner:S.current}}function E(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var k=/\/+/g;function C(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function A(n,r,i,o,a){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l=!1;if(null===n)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(n.$$typeof){case e:case t:l=!0}}if(l)return a=a(l=n),n=""===o?"."+C(l,0):o,b(a)?(i="",null!=n&&(i=n.replace(k,"$&/")+"/"),A(a,r,i,"",function(e){return e})):null!=a&&(E(a)&&(a=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(a,i+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(k,"$&/")+"/")+n)),r.push(a)),1;if(l=0,o=""===o?".":o+":",b(n))for(var c=0;c<n.length;c++){var u=o+C(s=n[c],c);l+=A(s,r,i,u,a)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(n),"function"==typeof u)for(n=u.call(n),c=0;!(s=n.next()).done;)l+=A(s=s.value,r,i,u=o+C(s,c++),a);else if("object"===s)throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return l}function O(e,t,n){if(null==e)return e;var r=[],i=0;return A(e,r,"","",function(e){return t.call(n,e,i++)}),r}function N(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var D={current:null},T={transition:null},q={ReactCurrentDispatcher:D,ReactCurrentBatchConfig:T,ReactCurrentOwner:S};function I(){throw Error("act(...) is not supported in production builds of React.")}return XL.Children={map:O,forEach:function(e,t,n){O(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return O(e,function(){t++}),t},toArray:function(e){return O(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},XL.Component=m,XL.Fragment=n,XL.Profiler=i,XL.PureComponent=y,XL.StrictMode=r,XL.Suspense=l,XL.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q,XL.act=I,XL.cloneElement=function(t,n,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var i=h({},t.props),o=t.key,a=t.ref,s=t._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,s=S.current),void 0!==n.key&&(o=""+n.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(c in n)x.call(n,c)&&!M.hasOwnProperty(c)&&(i[c]=void 0===n[c]&&void 0!==l?l[c]:n[c])}var c=arguments.length-2;if(1===c)i.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];i.children=l}return{$$typeof:e,type:t.type,key:o,ref:a,props:i,_owner:s}},XL.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:o,_context:e},e.Consumer=e},XL.createElement=w,XL.createFactory=function(e){var t=w.bind(null,e);return t.type=e,t},XL.createRef=function(){return{current:null}},XL.forwardRef=function(e){return{$$typeof:s,render:e}},XL.isValidElement=E,XL.lazy=function(e){return{$$typeof:u,_payload:{_status:-1,_result:e},_init:N}},XL.memo=function(e,t){return{$$typeof:c,type:e,compare:void 0===t?null:t}},XL.startTransition=function(e){var t=T.transition;T.transition={};try{e()}finally{T.transition=t}},XL.unstable_act=I,XL.useCallback=function(e,t){return D.current.useCallback(e,t)},XL.useContext=function(e){return D.current.useContext(e)},XL.useDebugValue=function(){},XL.useDeferredValue=function(e){return D.current.useDeferredValue(e)},XL.useEffect=function(e,t){return D.current.useEffect(e,t)},XL.useId=function(){return D.current.useId()},XL.useImperativeHandle=function(e,t,n){return D.current.useImperativeHandle(e,t,n)},XL.useInsertionEffect=function(e,t){return D.current.useInsertionEffect(e,t)},XL.useLayoutEffect=function(e,t){return D.current.useLayoutEffect(e,t)},XL.useMemo=function(e,t){return D.current.useMemo(e,t)},XL.useReducer=function(e,t,n){return D.current.useReducer(e,t,n)},XL.useRef=function(e){return D.current.useRef(e)},XL.useState=function(e){return D.current.useState(e)},XL.useSyncExternalStore=function(e,t,n){return D.current.useSyncExternalStore(e,t,n)},XL.useTransition=function(){return D.current.useTransition()},XL.version="18.3.1",XL}function ZL(){return YL||(YL=1,GL.exports=JL()),GL.exports}var QL=ZL(),e_=o(QL),t_=t({__proto__:null,default:e_},[QL]);const n_={black:"#000",white:"#fff"},r_="#e57373",i_="#ef5350",o_="#f44336",a_="#d32f2f",s_="#c62828",l_="#f3e5f5",c_="#ce93d8",u_="#ba68c8",d_="#ab47bc",f_="#9c27b0",h_="#7b1fa2",p_="#e3f2fd",m_="#90caf9",g_="#42a5f5",y_="#1976d2",v_="#1565c0",b_="#4fc3f7",x_="#29b6f6",S_="#03a9f4",M_="#0288d1",w_="#01579b",E_="#81c784",k_="#66bb6a",C_="#4caf50",A_="#388e3c",O_="#2e7d32",N_="#1b5e20",D_="#ffb74d",T_="#ffa726",q_="#ff9800",I_="#f57c00",R_="#e65100",L_={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function __(e){let t="https://mui.com/production-error/?code="+e;for(let e=1;e<arguments.length;e+=1)t+="&args[]="+encodeURIComponent(arguments[e]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var P_=Object.freeze({__proto__:null,default:__}),z_="$$material";function F_(){return F_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},F_.apply(null,arguments)}function j_(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}var $_=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),B_="-ms-",V_="-moz-",H_="-webkit-",U_="comm",W_="rule",Y_="decl",K_="@keyframes",G_=Math.abs,X_=String.fromCharCode,J_=Object.assign;function Z_(e){return e.trim()}function Q_(e,t,n){return e.replace(t,n)}function eP(e,t){return e.indexOf(t)}function tP(e,t){return 0|e.charCodeAt(t)}function nP(e,t,n){return e.slice(t,n)}function rP(e){return e.length}function iP(e){return e.length}function oP(e,t){return t.push(e),e}var aP=1,sP=1,lP=0,cP=0,uP=0,dP="";function fP(e,t,n,r,i,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:aP,column:sP,length:a,return:""}}function hP(e,t){return J_(fP("",null,null,"",null,null,0),e,{length:-e.length},t)}function pP(){return uP=cP>0?tP(dP,--cP):0,sP--,10===uP&&(sP=1,aP--),uP}function mP(){return uP=cP<lP?tP(dP,cP++):0,sP++,10===uP&&(sP=1,aP++),uP}function gP(){return tP(dP,cP)}function yP(){return cP}function vP(e,t){return nP(dP,e,t)}function bP(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function xP(e){return aP=sP=1,lP=rP(dP=e),cP=0,[]}function SP(e){return dP="",e}function MP(e){return Z_(vP(cP-1,kP(91===e?e+2:40===e?e+1:e)))}function wP(e){for(;(uP=gP())&&uP<33;)mP();return bP(e)>2||bP(uP)>3?"":" "}function EP(e,t){for(;--t&&mP()&&!(uP<48||uP>102||uP>57&&uP<65||uP>70&&uP<97););return vP(e,yP()+(t<6&&32==gP()&&32==mP()))}function kP(e){for(;mP();)switch(uP){case e:return cP;case 34:case 39:34!==e&&39!==e&&kP(uP);break;case 40:41===e&&kP(e);break;case 92:mP()}return cP}function CP(e,t){for(;mP()&&e+uP!==57&&(e+uP!==84||47!==gP()););return"/*"+vP(t,cP-1)+"*"+X_(47===e?e:mP())}function AP(e){for(;!bP(gP());)mP();return vP(e,cP)}function OP(e){return SP(NP("",null,null,null,[""],e=xP(e),0,[0],e))}function NP(e,t,n,r,i,o,a,s,l){for(var c=0,u=0,d=a,f=0,h=0,p=0,m=1,g=1,y=1,v=0,b="",x=i,S=o,M=r,w=b;g;)switch(p=v,v=mP()){case 40:if(108!=p&&58==tP(w,d-1)){-1!=eP(w+=Q_(MP(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:w+=MP(v);break;case 9:case 10:case 13:case 32:w+=wP(p);break;case 92:w+=EP(yP()-1,7);continue;case 47:switch(gP()){case 42:case 47:oP(TP(CP(mP(),yP()),t,n),l);break;default:w+="/"}break;case 123*m:s[c++]=rP(w)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(w=Q_(w,/\f/g,"")),h>0&&rP(w)-d&&oP(h>32?qP(w+";",r,n,d-1):qP(Q_(w," ","")+";",r,n,d-2),l);break;case 59:w+=";";default:if(oP(M=DP(w,t,n,c,u,i,s,b,x=[],S=[],d),o),123===v)if(0===u)NP(w,t,M,M,x,o,d,s,S);else switch(99===f&&110===tP(w,3)?100:f){case 100:case 108:case 109:case 115:NP(e,M,M,r&&oP(DP(e,M,M,0,0,i,s,b,i,x=[],d),S),i,S,d,s,r?x:S);break;default:NP(w,M,M,M,[""],S,0,s,S)}}c=u=h=0,m=y=1,b=w="",d=a;break;case 58:d=1+rP(w),h=p;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==pP())continue;switch(w+=X_(v),v*m){case 38:y=u>0?1:(w+="\f",-1);break;case 44:s[c++]=(rP(w)-1)*y,y=1;break;case 64:45===gP()&&(w+=MP(mP())),f=gP(),u=d=rP(b=w+=AP(yP())),v++;break;case 45:45===p&&2==rP(w)&&(m=0)}}return o}function DP(e,t,n,r,i,o,a,s,l,c,u){for(var d=i-1,f=0===i?o:[""],h=iP(f),p=0,m=0,g=0;p<r;++p)for(var y=0,v=nP(e,d+1,d=G_(m=a[p])),b=e;y<h;++y)(b=Z_(m>0?f[y]+" "+v:Q_(v,/&\f/g,f[y])))&&(l[g++]=b);return fP(e,t,n,0===i?W_:s,l,c,u)}function TP(e,t,n){return fP(e,t,n,U_,X_(uP),nP(e,2,-2),0)}function qP(e,t,n,r){return fP(e,t,n,Y_,nP(e,0,r),nP(e,r+1,-1),r)}function IP(e,t){for(var n="",r=iP(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function RP(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Y_:return e.return=e.return||e.value;case U_:return"";case K_:return e.return=e.value+"{"+IP(e.children,r)+"}";case W_:e.value=e.props.join(",")}return rP(n=IP(e.children,r))?e.return=e.value+"{"+n+"}":""}function LP(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var _P=function(e,t,n){for(var r=0,i=0;r=i,i=gP(),38===r&&12===i&&(t[n]=1),!bP(i);)mP();return vP(e,cP)},PP=function(e,t){return SP(function(e,t){var n=-1,r=44;do{switch(bP(r)){case 0:38===r&&12===gP()&&(t[n]=1),e[n]+=_P(cP-1,t,n);break;case 2:e[n]+=MP(r);break;case 4:if(44===r){e[++n]=58===gP()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=X_(r)}}while(r=mP());return e}(xP(e),t))},zP=new WeakMap,FP=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||zP.get(n))&&!r){zP.set(e,!0);for(var i=[],o=PP(t,i),a=n.props,s=0,l=0;s<o.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=i[s]?o[s].replace(/&\f/g,a[c]):a[c]+" "+o[s]}}},jP=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function $P(e,t){switch(function(e,t){return 45^tP(e,0)?(((t<<2^tP(e,0))<<2^tP(e,1))<<2^tP(e,2))<<2^tP(e,3):0}(e,t)){case 5103:return H_+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return H_+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return H_+e+V_+e+B_+e+e;case 6828:case 4268:return H_+e+B_+e+e;case 6165:return H_+e+B_+"flex-"+e+e;case 5187:return H_+e+Q_(e,/(\w+).+(:[^]+)/,H_+"box-$1$2"+B_+"flex-$1$2")+e;case 5443:return H_+e+B_+"flex-item-"+Q_(e,/flex-|-self/,"")+e;case 4675:return H_+e+B_+"flex-line-pack"+Q_(e,/align-content|flex-|-self/,"")+e;case 5548:return H_+e+B_+Q_(e,"shrink","negative")+e;case 5292:return H_+e+B_+Q_(e,"basis","preferred-size")+e;case 6060:return H_+"box-"+Q_(e,"-grow","")+H_+e+B_+Q_(e,"grow","positive")+e;case 4554:return H_+Q_(e,/([^-])(transform)/g,"$1"+H_+"$2")+e;case 6187:return Q_(Q_(Q_(e,/(zoom-|grab)/,H_+"$1"),/(image-set)/,H_+"$1"),e,"")+e;case 5495:case 3959:return Q_(e,/(image-set\([^]*)/,H_+"$1$`$1");case 4968:return Q_(Q_(e,/(.+:)(flex-)?(.*)/,H_+"box-pack:$3"+B_+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+H_+e+e;case 4095:case 3583:case 4068:case 2532:return Q_(e,/(.+)-inline(.+)/,H_+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(rP(e)-1-t>6)switch(tP(e,t+1)){case 109:if(45!==tP(e,t+4))break;case 102:return Q_(e,/(.+:)(.+)-([^]+)/,"$1"+H_+"$2-$3$1"+V_+(108==tP(e,t+3)?"$3":"$2-$3"))+e;case 115:return~eP(e,"stretch")?$P(Q_(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==tP(e,t+1))break;case 6444:switch(tP(e,rP(e)-3-(~eP(e,"!important")&&10))){case 107:return Q_(e,":",":"+H_)+e;case 101:return Q_(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+H_+(45===tP(e,14)?"inline-":"")+"box$3$1"+H_+"$2$3$1"+B_+"$2box$3")+e}break;case 5936:switch(tP(e,t+11)){case 114:return H_+e+B_+Q_(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return H_+e+B_+Q_(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return H_+e+B_+Q_(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return H_+e+B_+e+e}return e}var BP,VP,HP,UP,WP=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Y_:e.return=$P(e.value,e.length);break;case K_:return IP([hP(e,{value:Q_(e.value,"@","@"+H_)})],r);case W_:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return IP([hP(e,{props:[Q_(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return IP([hP(e,{props:[Q_(t,/:(plac\w+)/,":"+H_+"input-$1")]}),hP(e,{props:[Q_(t,/:(plac\w+)/,":-moz-$1")]}),hP(e,{props:[Q_(t,/:(plac\w+)/,B_+"input-$1")]})],r)}return""})}}],YP=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,i,o=e.stylisPlugins||WP,a={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;s.push(e)});var l,c,u=[RP,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=iP(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}([FP,jP].concat(o,u));i=function(e,t,n,r){l=n,function(e){IP(OP(e),d)}(e?e+"{"+t.styles+"}":t.styles),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new $_({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:i};return f.sheet.hydrate(s),f},KP={exports:{}},GP={};function XP(){return VP||(VP=1,KP.exports=function(){if(BP)return GP;BP=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case l:case c:case r:case o:case i:case d:return e;default:switch(e=e&&e.$$typeof){case s:case u:case p:case h:case a:return e;default:return f}}case n:return f}}}function x(e){return b(e)===c}return GP.AsyncMode=l,GP.ConcurrentMode=c,GP.ContextConsumer=s,GP.ContextProvider=a,GP.Element=t,GP.ForwardRef=u,GP.Fragment=r,GP.Lazy=p,GP.Memo=h,GP.Portal=n,GP.Profiler=o,GP.StrictMode=i,GP.Suspense=d,GP.isAsyncMode=function(e){return x(e)||b(e)===l},GP.isConcurrentMode=x,GP.isContextConsumer=function(e){return b(e)===s},GP.isContextProvider=function(e){return b(e)===a},GP.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},GP.isForwardRef=function(e){return b(e)===u},GP.isFragment=function(e){return b(e)===r},GP.isLazy=function(e){return b(e)===p},GP.isMemo=function(e){return b(e)===h},GP.isPortal=function(e){return b(e)===n},GP.isProfiler=function(e){return b(e)===o},GP.isStrictMode=function(e){return b(e)===i},GP.isSuspense=function(e){return b(e)===d},GP.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===o||e===i||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===a||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===m)},GP.typeOf=b,GP}()),KP.exports}!function(){if(UP)return HP;UP=1;var e=XP(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function o(n){return e.isMemo(n)?r:i[n.$$typeof]||t}i[e.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[e.Memo]=r;var a=Object.defineProperty,s=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,c=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,d=Object.prototype;HP=function e(t,r,i){if("string"!=typeof r){if(d){var f=u(r);f&&f!==d&&e(t,f,i)}var h=s(r);l&&(h=h.concat(l(r)));for(var p=o(t),m=o(r),g=0;g<h.length;++g){var y=h[g];if(!(n[y]||i&&i[y]||m&&m[y]||p&&p[y])){var v=c(r,y);try{a(t,y,v)}catch(e){}}}}return t}}();function JP(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}var ZP=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},QP=function(e,t,n){ZP(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+r:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}};var ez={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},tz=/[A-Z]|^ms/g,nz=/_EMO_([^_]+?)_([^]*?)_EMO_/g,rz=function(e){return 45===e.charCodeAt(1)},iz=function(e){return null!=e&&"boolean"!=typeof e},oz=LP(function(e){return rz(e)?e:e.replace(tz,"-$&").toLowerCase()}),az=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(nz,function(e,t,n){return lz={name:t,styles:n,next:lz},t})}return 1===ez[e]||rz(e)||"number"!=typeof t||0===t?t:t+"px"};function sz(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var i=n;if(1===i.anim)return lz={name:i.name,styles:i.styles,next:lz},i.name;var o=n;if(void 0!==o.styles){var a=o.next;if(void 0!==a)for(;void 0!==a;)lz={name:a.name,styles:a.styles,next:lz},a=a.next;return o.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=sz(e,t,n[i])+";";else for(var o in n){var a=n[o];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?r+=o+"{"+t[s]+"}":iz(s)&&(r+=oz(o)+":"+az(o,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=sz(e,t,a);switch(o){case"animation":case"animationName":r+=oz(o)+":"+l+";";break;default:r+=o+"{"+l+"}"}}else for(var c=0;c<a.length;c++)iz(a[c])&&(r+=oz(o)+":"+az(o,a[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=lz,l=n(e);return lz=s,sz(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var lz,cz=/label:\s*([^\s;{]+)\s*(;|$)/g;function uz(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,i="";lz=void 0;var o=e[0];null==o||void 0===o.raw?(r=!1,i+=sz(n,t,o)):i+=o[0];for(var a=1;a<e.length;a++){if(i+=sz(n,t,e[a]),r)i+=o[a]}cz.lastIndex=0;for(var s,l="";null!==(s=cz.exec(i));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,i=e.length;i>=4;++r,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(i){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(i)+l;return{name:c,styles:i,next:lz}}var dz,fz,hz=!!t_.useInsertionEffect&&t_.useInsertionEffect,pz=hz||function(e){return e()},mz=hz||QL.useLayoutEffect,gz=QL.createContext("undefined"!=typeof HTMLElement?YP({key:"css"}):null),yz=gz.Provider,vz=function(e){return QL.forwardRef(function(t,n){var r=QL.useContext(gz);return e(t,r,n)})},bz=QL.createContext({}),xz={}.hasOwnProperty,Sz="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Mz=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return ZP(t,n,r),pz(function(){return QP(t,n,r)}),null},wz=vz(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var i=e[Sz],o=[r],a="";"string"==typeof e.className?a=JP(t.registered,o,e.className):null!=e.className&&(a=e.className+" ");var s=uz(o,void 0,QL.useContext(bz));a+=t.key+"-"+s.name;var l={};for(var c in e)xz.call(e,c)&&"css"!==c&&c!==Sz&&(l[c]=e[c]);return l.className=a,n&&(l.ref=n),QL.createElement(QL.Fragment,null,QL.createElement(Mz,{cache:t,serialized:s,isStringTag:"string"==typeof i}),QL.createElement(i,l))}),Ez=function(e,t){var n=arguments;if(null==t||!xz.call(t,"css"))return QL.createElement.apply(void 0,n);var r=n.length,i=new Array(r);i[0]=wz,i[1]=function(e,t){var n={};for(var r in t)xz.call(t,r)&&(n[r]=t[r]);return n[Sz]=e,n}(e,t);for(var o=2;o<r;o++)i[o]=n[o];return QL.createElement.apply(null,i)};dz=Ez||(Ez={}),fz||(fz=dz.JSX||(dz.JSX={}));var kz=vz(function(e,t){var n=uz([e.styles],void 0,QL.useContext(bz)),r=QL.useRef();return mz(function(){var e=t.key+"-global",i=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),o=!1,a=document.querySelector('style[data-emotion="'+e+" "+n.name+'"]');return t.sheet.tags.length&&(i.before=t.sheet.tags[0]),null!==a&&(o=!0,a.setAttribute("data-emotion",e),i.hydrate([a])),r.current=[i,o],function(){i.flush()}},[t]),mz(function(){var e=r.current,i=e[0];if(e[1])e[1]=!1;else{if(void 0!==n.next&&QP(t,n.next,!0),i.tags.length){var o=i.tags[i.tags.length-1].nextElementSibling;i.before=o,i.flush()}t.insert("",n,i,!1)}},[t,n.name]),null});function Cz(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return uz(t)}function Az(){var e=Cz.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var Oz=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Nz=LP(function(e){return Oz.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Dz=function(e){return"theme"!==e},Tz=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Nz:Dz},qz=function(e,t,n){var r;if(t){var i=t.shouldForwardProp;r=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Iz=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return ZP(t,n,r),pz(function(){return QP(t,n,r)}),null},Rz=function e(t,n){var r,i,o=t.__emotion_real===t,a=o&&t.__emotion_base||t;void 0!==n&&(r=n.label,i=n.target);var s=qz(t,n,o),l=s||Tz(a),c=!l("as");return function(){var u=arguments,d=o&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&d.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{var f=u[0];d.push(f[0]);for(var h=u.length,p=1;p<h;p++)d.push(u[p],f[p])}var m=vz(function(e,t,n){var r=c&&e.as||a,o="",u=[],f=e;if(null==e.theme){for(var h in f={},e)f[h]=e[h];f.theme=QL.useContext(bz)}"string"==typeof e.className?o=JP(t.registered,u,e.className):null!=e.className&&(o=e.className+" ");var p=uz(d.concat(u),t.registered,f);o+=t.key+"-"+p.name,void 0!==i&&(o+=" "+i);var m=c&&void 0===s?Tz(r):l,g={};for(var y in e)c&&"as"===y||m(y)&&(g[y]=e[y]);return g.className=o,n&&(g.ref=n),QL.createElement(QL.Fragment,null,QL.createElement(Iz,{cache:t,serialized:p,isStringTag:"string"==typeof r}),QL.createElement(r,g))});return m.displayName=void 0!==r?r:"Styled("+("string"==typeof a?a:a.displayName||a.name||"Component")+")",m.defaultProps=t.defaultProps,m.__emotion_real=m,m.__emotion_base=a,m.__emotion_styles=d,m.__emotion_forwardProp=s,Object.defineProperty(m,"toString",{value:function(){return"."+i}}),m.withComponent=function(t,r){return e(t,F_({},n,r,{shouldForwardProp:qz(m,r,!0)})).apply(void 0,d)},m}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){Rz[e]=Rz(e)});var Lz,_z,Pz={exports:{}},zz={};var Fz=(_z||(_z=1,Pz.exports=function(){if(Lz)return zz;Lz=1;var e=ZL(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},c=null,u=null;for(s in void 0!==a&&(c=""+a),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!o.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:u,props:l,_owner:i.current}}return zz.Fragment=n,zz.jsx=a,zz.jsxs=a,zz}()),Pz.exports);const jz=new Map;function $z(e){const{styles:t,defaultTheme:n={}}=e,r="function"==typeof t?e=>{return t(null==(r=e)||0===Object.keys(r).length?n:e);var r}:t;return Fz.jsx(kz,{styles:r})}
/**
   * @mui/styled-engine v5.18.0
   *
   * @license MIT
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */const Bz=[];function Vz(e){return Bz[0]=e,uz(Bz)}var Hz=Object.freeze({__proto__:null,GlobalStyles:$z,StyledEngineProvider:function(e){const{injectFirst:t,enableCssLayer:n,children:r}=e,i=QL.useMemo(()=>{const e=`${t}-${n}`;if("object"==typeof document&&jz.has(e))return jz.get(e);const r=function(e,t){const n=YP({key:"css",prepend:e});if(t){const e=n.insert;n.insert=(...t)=>(t[1].styles.match(/^@layer\s+[^{]*$/)||(t[1].styles=`@layer mui {${t[1].styles}}`),e(...t))}return n}(t,n);return jz.set(e,r),r},[t,n]);return t||n?Fz.jsx(yz,{value:i,children:r}):r},ThemeContext:bz,css:Cz,default:function(e,t){return Rz(e,t)},internal_processStyles:(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},internal_serializeStyles:Vz,keyframes:Az});function Uz(e){if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)}function Wz(e){if(QL.isValidElement(e)||!Uz(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Wz(e[n])}),t}function Yz(e,t,n={clone:!0}){const r=n.clone?F_({},e):e;return Uz(e)&&Uz(t)&&Object.keys(t).forEach(i=>{QL.isValidElement(t[i])?r[i]=t[i]:Uz(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Uz(e[i])?r[i]=Yz(e[i],t[i],n):n.clone?r[i]=Uz(t[i])?Wz(t[i]):t[i]:r[i]=t[i]}),r}var Kz=Object.freeze({__proto__:null,default:Yz,isPlainObject:Uz});const Gz=["values","unit","step"];function Xz(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,i=j_(e,Gz),o=(e=>{const t=Object.keys(e).map(t=>({key:t,val:e[t]}))||[];return t.sort((e,t)=>e.val-t.val),t.reduce((e,t)=>F_({},e,{[t.key]:t.val}),{})})(t),a=Object.keys(o);function s(e){return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n})`}function l(e){return`@media (max-width:${("number"==typeof t[e]?t[e]:e)-r/100}${n})`}function c(e,i){const o=a.indexOf(i);return`@media (min-width:${"number"==typeof t[e]?t[e]:e}${n}) and (max-width:${(-1!==o&&"number"==typeof t[a[o]]?t[a[o]]:i)-r/100}${n})`}return F_({keys:a,values:o,up:s,down:l,between:c,only:function(e){return a.indexOf(e)+1<a.length?c(e,a[a.indexOf(e)+1]):s(e)},not:function(e){const t=a.indexOf(e);return 0===t?s(a[1]):t===a.length-1?l(a[t]):c(e,a[a.indexOf(e)+1]).replace("@media","@media not all and")},unit:n},i)}const Jz={borderRadius:4};function Zz(e,t){return t?Yz(e,t,{clone:!1}):e}const Qz={xs:0,sm:600,md:900,lg:1200,xl:1536},eF={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Qz[e]}px)`};function tF(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const e=r.breakpoints||eF;return t.reduce((r,i,o)=>(r[e.up(e.keys[o])]=n(t[o]),r),{})}if("object"==typeof t){const e=r.breakpoints||eF;return Object.keys(t).reduce((r,i)=>{if(-1!==Object.keys(e.values||Qz).indexOf(i)){r[e.up(i)]=n(t[i],i)}else{const e=i;r[e]=t[e]}return r},{})}return n(t)}function nF(e,t){return e.reduce((e,t)=>{const n=e[t];return(!n||0===Object.keys(n).length)&&delete e[t],e},t)}function rF(e){if("string"!=typeof e)throw new Error(__(7));return e.charAt(0).toUpperCase()+e.slice(1)}var iF=Object.freeze({__proto__:null,default:rF});function oF(e,t,n=!0){if(!t||"string"!=typeof t)return null;if(e&&e.vars&&n){const n=`vars.${t}`.split(".").reduce((e,t)=>e&&e[t]?e[t]:null,e);if(null!=n)return n}return t.split(".").reduce((e,t)=>e&&null!=e[t]?e[t]:null,e)}function aF(e,t,n,r=n){let i;return i="function"==typeof e?e(n):Array.isArray(e)?e[n]||r:oF(e,n)||r,t&&(i=t(i,r,e)),i}function sF(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=e=>{if(null==e[t])return null;const o=e[t],a=oF(e.theme,r)||{};return tF(e,o,e=>{let r=aF(a,i,e);return e===r&&"string"==typeof e&&(r=aF(a,i,`${t}${"default"===e?"":rF(e)}`,e)),!1===n?r:{[n]:r}})};return o.propTypes={},o.filterProps=[t],o}const lF={m:"margin",p:"padding"},cF={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},uF={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},dF=function(e){const t={};return n=>(void 0===t[n]&&(t[n]=e(n)),t[n])}(e=>{if(e.length>2){if(!uF[e])return[e];e=uF[e]}const[t,n]=e.split(""),r=lF[t],i=cF[n]||"";return Array.isArray(i)?i.map(e=>r+e):[r+i]}),fF=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],hF=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];function pF(e,t,n,r){var i;const o=null!=(i=oF(e,t,!1))?i:n;return"number"==typeof o?e=>"string"==typeof e?e:o*e:Array.isArray(o)?e=>"string"==typeof e?e:o[e]:"function"==typeof o?o:()=>{}}function mF(e){return pF(e,"spacing",8)}function gF(e,t){if("string"==typeof t||null==t)return t;const n=e(Math.abs(t));return t>=0?n:"number"==typeof n?-n:`-${n}`}function yF(e,t,n,r){if(-1===t.indexOf(n))return null;const i=function(e,t){return n=>e.reduce((e,r)=>(e[r]=gF(t,n),e),{})}(dF(n),r);return tF(e,e[n],i)}function vF(e,t){const n=mF(e.theme);return Object.keys(e).map(r=>yF(e,t,r,n)).reduce(Zz,{})}function bF(e){return vF(e,fF)}function xF(e){return vF(e,hF)}function SF(...e){const t=e.reduce((e,t)=>(t.filterProps.forEach(n=>{e[n]=t}),e),{}),n=e=>Object.keys(e).reduce((n,r)=>t[r]?Zz(n,t[r](e)):n,{});return n.propTypes={},n.filterProps=e.reduce((e,t)=>e.concat(t.filterProps),[]),n}function MF(e){return"number"!=typeof e?e:`${e}px solid`}function wF(e,t){return sF({prop:e,themeKey:"borders",transform:t})}bF.propTypes={},bF.filterProps=fF,xF.propTypes={},xF.filterProps=hF;const EF=wF("border",MF),kF=wF("borderTop",MF),CF=wF("borderRight",MF),AF=wF("borderBottom",MF),OF=wF("borderLeft",MF),NF=wF("borderColor"),DF=wF("borderTopColor"),TF=wF("borderRightColor"),qF=wF("borderBottomColor"),IF=wF("borderLeftColor"),RF=wF("outline",MF),LF=wF("outlineColor"),_F=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=pF(e.theme,"shape.borderRadius",4),n=e=>({borderRadius:gF(t,e)});return tF(e,e.borderRadius,n)}return null};_F.propTypes={},_F.filterProps=["borderRadius"],SF(EF,kF,CF,AF,OF,NF,DF,TF,qF,IF,_F,RF,LF);const PF=e=>{if(void 0!==e.gap&&null!==e.gap){const t=pF(e.theme,"spacing",8),n=e=>({gap:gF(t,e)});return tF(e,e.gap,n)}return null};PF.propTypes={},PF.filterProps=["gap"];const zF=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=pF(e.theme,"spacing",8),n=e=>({columnGap:gF(t,e)});return tF(e,e.columnGap,n)}return null};zF.propTypes={},zF.filterProps=["columnGap"];const FF=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=pF(e.theme,"spacing",8),n=e=>({rowGap:gF(t,e)});return tF(e,e.rowGap,n)}return null};FF.propTypes={},FF.filterProps=["rowGap"];function jF(e,t){return"grey"===t?t:e}SF(PF,zF,FF,sF({prop:"gridColumn"}),sF({prop:"gridRow"}),sF({prop:"gridAutoFlow"}),sF({prop:"gridAutoColumns"}),sF({prop:"gridAutoRows"}),sF({prop:"gridTemplateColumns"}),sF({prop:"gridTemplateRows"}),sF({prop:"gridTemplateAreas"}),sF({prop:"gridArea"}));function $F(e){return e<=1&&0!==e?100*e+"%":e}SF(sF({prop:"color",themeKey:"palette",transform:jF}),sF({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:jF}),sF({prop:"backgroundColor",themeKey:"palette",transform:jF}));const BF=sF({prop:"width",transform:$F}),VF=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{var n,r;const i=(null==(n=e.theme)||null==(n=n.breakpoints)||null==(n=n.values)?void 0:n[t])||Qz[t];return i?"px"!==(null==(r=e.theme)||null==(r=r.breakpoints)?void 0:r.unit)?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:$F(t)}};return tF(e,e.maxWidth,t)}return null};VF.filterProps=["maxWidth"];const HF=sF({prop:"minWidth",transform:$F}),UF=sF({prop:"height",transform:$F}),WF=sF({prop:"maxHeight",transform:$F}),YF=sF({prop:"minHeight",transform:$F});sF({prop:"size",cssProperty:"width",transform:$F}),sF({prop:"size",cssProperty:"height",transform:$F});SF(BF,VF,HF,UF,WF,YF,sF({prop:"boxSizing"}));const KF={border:{themeKey:"borders",transform:MF},borderTop:{themeKey:"borders",transform:MF},borderRight:{themeKey:"borders",transform:MF},borderBottom:{themeKey:"borders",transform:MF},borderLeft:{themeKey:"borders",transform:MF},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:MF},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:_F},color:{themeKey:"palette",transform:jF},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:jF},backgroundColor:{themeKey:"palette",transform:jF},p:{style:xF},pt:{style:xF},pr:{style:xF},pb:{style:xF},pl:{style:xF},px:{style:xF},py:{style:xF},padding:{style:xF},paddingTop:{style:xF},paddingRight:{style:xF},paddingBottom:{style:xF},paddingLeft:{style:xF},paddingX:{style:xF},paddingY:{style:xF},paddingInline:{style:xF},paddingInlineStart:{style:xF},paddingInlineEnd:{style:xF},paddingBlock:{style:xF},paddingBlockStart:{style:xF},paddingBlockEnd:{style:xF},m:{style:bF},mt:{style:bF},mr:{style:bF},mb:{style:bF},ml:{style:bF},mx:{style:bF},my:{style:bF},margin:{style:bF},marginTop:{style:bF},marginRight:{style:bF},marginBottom:{style:bF},marginLeft:{style:bF},marginX:{style:bF},marginY:{style:bF},marginInline:{style:bF},marginInlineStart:{style:bF},marginInlineEnd:{style:bF},marginBlock:{style:bF},marginBlockStart:{style:bF},marginBlockEnd:{style:bF},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:PF},rowGap:{style:FF},columnGap:{style:zF},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:$F},maxWidth:{style:VF},minWidth:{transform:$F},height:{transform:$F},maxHeight:{transform:$F},minHeight:{transform:$F},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function GF(){function e(e,t,n,r){const i={[e]:t,theme:n},o=r[e];if(!o)return{[e]:t};const{cssProperty:a=e,themeKey:s,transform:l,style:c}=o;if(null==t)return null;if("typography"===s&&"inherit"===t)return{[e]:t};const u=oF(n,s)||{};if(c)return c(i);return tF(i,t,t=>{let n=aF(u,l,t);return t===n&&"string"==typeof t&&(n=aF(u,l,`${e}${"default"===t?"":rF(t)}`,t)),!1===a?n:{[a]:n}})}return function t(n){var r;const{sx:i,theme:o={},nested:a}=n||{};if(!i)return null;const s=null!=(r=o.unstable_sxConfig)?r:KF;function l(n){let r=n;if("function"==typeof n)r=n(o);else if("object"!=typeof n)return n;if(!r)return null;const i=function(e={}){var t;return(null==(t=e.keys)?void 0:t.reduce((t,n)=>(t[e.up(n)]={},t),{}))||{}}(o.breakpoints),l=Object.keys(i);let c=i;return Object.keys(r).forEach(n=>{const i=(a=r[n],l=o,"function"==typeof a?a(l):a);var a,l;if(null!=i)if("object"==typeof i)if(s[n])c=Zz(c,e(n,i,o,s));else{const e=tF({theme:o},i,e=>({[n]:e}));!function(...e){const t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]),n=new Set(t);return e.every(e=>n.size===Object.keys(e).length)}(e,i)?c=Zz(c,e):c[n]=t({sx:i,theme:o,nested:!0})}else c=Zz(c,e(n,i,o,s))}),!a&&o.modularCssLayers?{"@layer sx":nF(l,c)}:nF(l,c)}return Array.isArray(i)?i.map(l):l(i)}}const XF=GF();function JF(e,t){const n=this;if(n.vars&&"function"==typeof n.getColorSchemeSelector){const r=n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)");return{[r]:t}}return n.palette.mode===e?t:{}}XF.filterProps=["sx"];const ZF=["breakpoints","palette","spacing","shape"];function QF(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=e,a=j_(e,ZF),s=Xz(n),l=function(e=8){if(e.mui)return e;const t=mF({spacing:e}),n=(...e)=>(0===e.length?[1]:e).map(e=>{const n=t(e);return"number"==typeof n?`${n}px`:n}).join(" ");return n.mui=!0,n}(i);let c=Yz({breakpoints:s,direction:"ltr",components:{},palette:F_({mode:"light"},r),spacing:l,shape:F_({},Jz,o)},a);return c.applyStyles=JF,c=t.reduce((e,t)=>Yz(e,t),c),c.unstable_sxConfig=F_({},KF,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return XF({sx:e,theme:this})},c}var ej=Object.freeze({__proto__:null,default:QF,private_createBreakpoints:Xz,unstable_applyStyles:JF});function tj(e=null){const t=QL.useContext(bz);return t&&(n=t,0!==Object.keys(n).length)?t:e;var n}const nj=QF();function rj(e=nj){return tj(e)}function ij(e){const t=Vz(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function oj({styles:e,themeId:t,defaultTheme:n={}}){const r=rj(n),i=t&&r[t]||r;let o="function"==typeof e?e(i):e;return i.modularCssLayers&&(o=Array.isArray(o)?o.map(e=>ij("function"==typeof e?e(i):e)):ij(o)),Fz.jsx($z,{styles:o})}const aj=["sx"];function sj(e){const{sx:t}=e,n=j_(e,aj),{systemProps:r,otherProps:i}=(e=>{var t,n;const r={systemProps:{},otherProps:{}},i=null!=(t=null==e||null==(n=e.theme)?void 0:n.unstable_sxConfig)?t:KF;return Object.keys(e).forEach(t=>{i[t]?r.systemProps[t]=e[t]:r.otherProps[t]=e[t]}),r})(n);let o;return o=Array.isArray(t)?[r,...t]:"function"==typeof t?(...e)=>{const n=t(...e);return Uz(n)?F_({},r,n):r}:F_({},r,t),F_({},i,{sx:o})}var lj=Object.freeze({__proto__:null,default:XF,extendSxProp:sj,unstable_createStyleFunctionSx:GF,unstable_defaultSxConfig:KF});const cj=e=>e,uj=(()=>{let e=cj;return{configure(t){e=t},generate:t=>e(t),reset(){e=cj}}})();function dj(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=dj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function fj(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=dj(e))&&(r&&(r+=" "),r+=t);return r}const hj={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function pj(e,t,n="Mui"){const r=hj[t];return r?`${n}-${r}`:`${uj.generate(e)}-${t}`}function mj(e,t,n="Mui"){const r={};return t.forEach(t=>{r[t]=pj(e,t,n)}),r}var gj,yj,vj={exports:{}},bj={};function xj(){if(gj)return bj;gj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),h=Symbol.for("react.client.reference");function p(h){if("object"==typeof h&&null!==h){var p=h.$$typeof;switch(p){case e:switch(h=h.type){case n:case i:case r:case l:case c:case f:return h;default:switch(h=h&&h.$$typeof){case a:case s:case d:case u:case o:return h;default:return p}}case t:return p}}}return bj.ContextConsumer=o,bj.ContextProvider=a,bj.Element=e,bj.ForwardRef=s,bj.Fragment=n,bj.Lazy=d,bj.Memo=u,bj.Portal=t,bj.Profiler=i,bj.StrictMode=r,bj.Suspense=l,bj.SuspenseList=c,bj.isContextConsumer=function(e){return p(e)===o},bj.isContextProvider=function(e){return p(e)===a},bj.isElement=function(t){return"object"==typeof t&&null!==t&&t.$$typeof===e},bj.isForwardRef=function(e){return p(e)===s},bj.isFragment=function(e){return p(e)===n},bj.isLazy=function(e){return p(e)===d},bj.isMemo=function(e){return p(e)===u},bj.isPortal=function(e){return p(e)===t},bj.isProfiler=function(e){return p(e)===i},bj.isStrictMode=function(e){return p(e)===r},bj.isSuspense=function(e){return p(e)===l},bj.isSuspenseList=function(e){return p(e)===c},bj.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===n||e===i||e===r||e===l||e===c||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===u||e.$$typeof===a||e.$$typeof===o||e.$$typeof===s||e.$$typeof===h||void 0!==e.getModuleId)},bj.typeOf=p,bj}function Sj(){return yj||(yj=1,vj.exports=xj()),vj.exports}var Mj=Sj();const wj=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function Ej(e){const t=`${e}`.match(wj);return t&&t[1]||""}function kj(e,t=""){return e.displayName||e.name||Ej(e)||t}function Cj(e,t,n){const r=kj(t);return e.displayName||(""!==r?`${n}(${r})`:n)}var Aj=Object.freeze({__proto__:null,default:function(e){if(null!=e){if("string"==typeof e)return e;if("function"==typeof e)return kj(e,"Component");if("object"==typeof e)switch(e.$$typeof){case Mj.ForwardRef:return Cj(e,e.render,"ForwardRef");case Mj.Memo:return Cj(e,e.type,"memo");default:return}}},getFunctionName:Ej});function Oj(e,t){const n=F_({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=F_({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=e[r]||{},o=t[r];n[r]={},o&&Object.keys(o)?i&&Object.keys(i)?(n[r]=F_({},o),Object.keys(i).forEach(e=>{n[r][e]=Oj(i[e],o[e])})):n[r]=o:n[r]=i}else void 0===n[r]&&(n[r]=e[r])}),n}const Nj="undefined"!=typeof window?QL.useLayoutEffect:QL.useEffect;var Dj=Object.freeze({__proto__:null,default:function(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}});function Tj(...e){return e.reduce((e,t)=>null==t?e:function(...n){e.apply(this,n),t.apply(this,n)},()=>{})}function qj(e){return e&&e.ownerDocument||document}function Ij(e){return qj(e).defaultView||window}function Rj(e,t){"function"==typeof e?e(t):e&&(e.current=t)}let Lj=0;const _j=t_["useId".toString()];function Pj(e){if(void 0!==_j){return _j()}return function(e){const[t,n]=QL.useState(e),r=e||t;return QL.useEffect(()=>{null==t&&(Lj+=1,n(`mui-${Lj}`))},[t]),r}(e)}function zj(e){const t=QL.useRef(e);return Nj(()=>{t.current=e}),QL.useRef((...e)=>(0,t.current)(...e)).current}function Fj(...e){return QL.useMemo(()=>e.every(e=>null==e)?null:t=>{e.forEach(e=>{Rj(e,t)})},e)}const jj={};const $j=[];class Bj{constructor(){this.currentId=null,this.clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Bj}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,t()},e)}}function Vj(){const e=function(e,t){const n=QL.useRef(jj);return n.current===jj&&(n.current=e(t)),n}(Bj.create).current;return function(e){QL.useEffect(e,$j)}(e.disposeEffect),e}let Hj=!0,Uj=!1;const Wj=new Bj,Yj={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Kj(e){e.metaKey||e.altKey||e.ctrlKey||(Hj=!0)}function Gj(){Hj=!1}function Xj(){"hidden"===this.visibilityState&&Uj&&(Hj=!0)}function Jj(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(e){}return Hj||function(e){const{type:t,tagName:n}=e;return!("INPUT"!==n||!Yj[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}(t)}function Zj(){const e=QL.useCallback(e=>{var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",Kj,!0),t.addEventListener("mousedown",Gj,!0),t.addEventListener("pointerdown",Gj,!0),t.addEventListener("touchstart",Gj,!0),t.addEventListener("visibilitychange",Xj,!0))},[]),t=QL.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!Jj(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(Uj=!0,Wj.start(100,()=>{Uj=!1}),t.current=!1,!0)},ref:e}}function Qj(e,t,n=void 0){const r={};return Object.keys(e).forEach(i=>{r[i]=e[i].reduce((e,r)=>{if(r){const i=t(r);""!==i&&e.push(i),n&&n[r]&&e.push(n[r])}return e},[]).join(" ")}),r}function e$(e){return"string"==typeof e}function t$(e,t=[]){if(void 0===e)return{};const n={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&"function"==typeof e[n]&&!t.includes(n)).forEach(t=>{n[t]=e[t]}),n}function n$(e){if(void 0===e)return{};const t={};return Object.keys(e).filter(t=>!(t.match(/^on[A-Z]/)&&"function"==typeof e[t])).forEach(n=>{t[n]=e[n]}),t}const r$=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function i$(e){var t;const{elementType:n,externalSlotProps:r,ownerState:i,skipResolvingSlotProps:o=!1}=e,a=j_(e,r$),s=o?{}:function(e,t,n){return"function"==typeof e?e(t,n):e}(r,i),{props:l,internalRef:c}=function(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const e=fj(null==n?void 0:n.className,o,null==i?void 0:i.className,null==r?void 0:r.className),t=F_({},null==n?void 0:n.style,null==i?void 0:i.style,null==r?void 0:r.style),a=F_({},n,i,r);return e.length>0&&(a.className=e),Object.keys(t).length>0&&(a.style=t),{props:a,internalRef:void 0}}const a=t$(F_({},i,r)),s=n$(r),l=n$(i),c=t(a),u=fj(null==c?void 0:c.className,null==n?void 0:n.className,o,null==i?void 0:i.className,null==r?void 0:r.className),d=F_({},null==c?void 0:c.style,null==n?void 0:n.style,null==i?void 0:i.style,null==r?void 0:r.style),f=F_({},c,n,l,s);return u.length>0&&(f.className=u),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:c.ref}}(F_({},a,{externalSlotProps:s})),u=function(e,t,n){return void 0===e||e$(e)?t:F_({},t,{ownerState:F_({},t.ownerState,n)})}(n,F_({},l,{ref:Fj(c,null==s?void 0:s.ref,null==(t=e.additionalProps)?void 0:t.ref)}),i);return u}function o$(e){var t;return parseInt(QL.version,10)>=19?(null==e||null==(t=e.props)?void 0:t.ref)||null:(null==e?void 0:e.ref)||null}const a$=QL.createContext(null);function s$(){return QL.useContext(a$)}var l$="function"==typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";function c$(e){const{children:t,theme:n}=e,r=s$(),i=QL.useMemo(()=>{const e=null===r?n:function(e,t){if("function"==typeof t)return t(e);return F_({},e,t)}(r,n);return null!=e&&(e[l$]=null!==r),e},[n,r]);return Fz.jsx(a$.Provider,{value:i,children:t})}const u$=["value"],d$=QL.createContext();function f$(e){let{value:t}=e,n=j_(e,u$);return Fz.jsx(d$.Provider,F_({value:null==t||t},n))}const h$=QL.createContext(void 0);function p$({value:e,children:t}){return Fz.jsx(h$.Provider,{value:e,children:t})}function m$({props:e,name:t}){return function(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?Oj(i.defaultProps,r):i.styleOverrides||i.variants?r:Oj(i,r)}({props:e,name:t,theme:{components:QL.useContext(h$)}})}const g$={};function y$(e,t,n,r=!1){return QL.useMemo(()=>{const i=e&&t[e]||t;if("function"==typeof n){const o=n(i),a=e?F_({},t,{[e]:o}):o;return r?()=>a:a}return F_({},t,e?{[e]:n}:n)},[e,t,n,r])}function v$(e){const{children:t,theme:n,themeId:r}=e,i=tj(g$),o=s$()||g$,a=y$(r,i,n),s=y$(r,o,n,!0),l="rtl"===a.direction,c=function(e){const t=tj(),n=Pj()||"",{modularCssLayers:r}=e;let i="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return i=r&&null===t?"string"==typeof r?r.replace(/mui(?!\.)/g,i):`@layer ${i};`:"",Nj(()=>{const e=document.querySelector("head");if(!e)return;const t=e.firstChild;if(i){var r;if(t&&null!=(r=t.hasAttribute)&&r.call(t,"data-mui-layer-order")&&t.getAttribute("data-mui-layer-order")===n)return;const o=document.createElement("style");o.setAttribute("data-mui-layer-order",n),o.textContent=i,e.prepend(o)}else{var o;null==(o=e.querySelector(`style[data-mui-layer-order="${n}"]`))||o.remove()}},[i,n]),i?Fz.jsx(oj,{styles:i}):null}(a);return Fz.jsx(c$,{theme:s,children:Fz.jsx(bz.Provider,{value:a,children:Fz.jsx(f$,{value:l,children:Fz.jsxs(p$,{value:null==a?void 0:a.components,children:[c,t]})})})})}var b$,x$={},S$={exports:{}};function M$(){return b$||(b$=1,function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}(S$)),S$.exports}var w$,E$=a(P_),k$=a(Dj);function C$(){if(w$)return x$;w$=1;var e=M$();Object.defineProperty(x$,"__esModule",{value:!0}),x$.alpha=u,x$.blend=function(e,t,n,r=1){const i=(e,t)=>Math.round((e**(1/r)*(1-n)+t**(1/r)*n)**r),a=o(e),l=o(t),c=[i(a.values[0],l.values[0]),i(a.values[1],l.values[1]),i(a.values[2],l.values[2])];return s({type:"rgb",values:c})},x$.colorChannel=void 0,x$.darken=d,x$.decomposeColor=o,x$.emphasize=h,x$.getContrastRatio=function(e,t){const n=c(e),r=c(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)},x$.getLuminance=c,x$.hexToRgb=i,x$.hslToRgb=l,x$.lighten=f,x$.private_safeAlpha=function(e,t,n){try{return u(e,t)}catch(t){return e}},x$.private_safeColorChannel=void 0,x$.private_safeDarken=function(e,t,n){try{return d(e,t)}catch(t){return e}},x$.private_safeEmphasize=function(e,t,n){try{return h(e,t)}catch(t){return e}},x$.private_safeLighten=function(e,t,n){try{return f(e,t)}catch(t){return e}},x$.recomposeColor=s,x$.rgbToHex=function(e){if(0===e.indexOf("#"))return e;const{values:t}=o(e);return`#${t.map((e,t)=>function(e){const t=e.toString(16);return 1===t.length?`0${t}`:t}(3===t?Math.round(255*e):e)).join("")}`};var t=e(E$),n=e(k$);function r(e,t=0,r=1){return(0,n.default)(e,t,r)}function i(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&1===n[0].length&&(n=n.map(e=>e+e)),n?`rgb${4===n.length?"a":""}(${n.map((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3).join(", ")})`:""}function o(e){if(e.type)return e;if("#"===e.charAt(0))return o(i(e));const n=e.indexOf("("),r=e.substring(0,n);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw new Error((0,t.default)(9,e));let a,s=e.substring(n+1,e.length-1);if("color"===r){if(s=s.split(" "),a=s.shift(),4===s.length&&"/"===s[3].charAt(0)&&(s[3]=s[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(a))throw new Error((0,t.default)(10,a))}else s=s.split(",");return s=s.map(e=>parseFloat(e)),{type:r,values:s,colorSpace:a}}const a=e=>{const t=o(e);return t.values.slice(0,3).map((e,n)=>-1!==t.type.indexOf("hsl")&&0!==n?`${e}%`:e).join(" ")};x$.colorChannel=a;function s(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return-1!==t.indexOf("rgb")?r=r.map((e,t)=>t<3?parseInt(e,10):e):-1!==t.indexOf("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),r=-1!==t.indexOf("color")?`${n} ${r.join(" ")}`:`${r.join(", ")}`,`${t}(${r})`}function l(e){e=o(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,a=r*Math.min(i,1-i),l=(e,t=(e+n/30)%12)=>i-a*Math.max(Math.min(t-3,9-t,1),-1);let c="rgb";const u=[Math.round(255*l(0)),Math.round(255*l(8)),Math.round(255*l(4))];return"hsla"===e.type&&(c+="a",u.push(t[3])),s({type:c,values:u})}function c(e){let t="hsl"===(e=o(e)).type||"hsla"===e.type?o(l(e)).values:e.values;return t=t.map(t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function u(e,t){return e=o(e),t=r(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,s(e)}function d(e,t){if(e=o(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return s(e)}function f(e,t){if(e=o(e),t=r(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(-1!==e.type.indexOf("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return s(e)}function h(e,t=.15){return c(e)>.5?d(e,t):f(e,t)}return x$.private_safeColorChannel=(e,t)=>{try{return a(e)}catch(t){return e}},x$}var A$=C$();const O$=["mode","contrastThreshold","tonalOffset"],N$={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:n_.white,default:n_.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},D$={text:{primary:n_.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:n_.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function T$(e,t,n,r){const i=r.light||r,o=r.dark||1.5*r;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:"light"===t?e.light=A$.lighten(e.main,i):"dark"===t&&(e.dark=A$.darken(e.main,o)))}function q$(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=e,i=j_(e,O$),o=e.primary||function(e="light"){return"dark"===e?{main:m_,light:p_,dark:g_}:{main:y_,light:g_,dark:v_}}(t),a=e.secondary||function(e="light"){return"dark"===e?{main:c_,light:l_,dark:d_}:{main:f_,light:u_,dark:h_}}(t),s=e.error||function(e="light"){return"dark"===e?{main:o_,light:r_,dark:a_}:{main:a_,light:i_,dark:s_}}(t),l=e.info||function(e="light"){return"dark"===e?{main:x_,light:b_,dark:M_}:{main:M_,light:S_,dark:w_}}(t),c=e.success||function(e="light"){return"dark"===e?{main:k_,light:E_,dark:A_}:{main:O_,light:C_,dark:N_}}(t),u=e.warning||function(e="light"){return"dark"===e?{main:T_,light:D_,dark:I_}:{main:"#ed6c02",light:q_,dark:R_}}(t);function d(e){return A$.getContrastRatio(e,D$.text.primary)>=n?D$.text.primary:N$.text.primary}const f=({color:e,name:t,mainShade:n=500,lightShade:i=300,darkShade:o=700})=>{if(!(e=F_({},e)).main&&e[n]&&(e.main=e[n]),!e.hasOwnProperty("main"))throw new Error(__(11,t?` (${t})`:"",n));if("string"!=typeof e.main)throw new Error(__(12,t?` (${t})`:"",JSON.stringify(e.main)));return T$(e,"light",i,r),T$(e,"dark",o,r),e.contrastText||(e.contrastText=d(e.main)),e},h={dark:D$,light:N$};return Yz(F_({common:F_({},n_),mode:t,primary:f({color:o,name:"primary"}),secondary:f({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:f({color:s,name:"error"}),warning:f({color:u,name:"warning"}),info:f({color:l,name:"info"}),success:f({color:c,name:"success"}),grey:L_,contrastThreshold:n,getContrastText:d,augmentColor:f,tonalOffset:r},h[t]),i)}const I$=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function R$(e){return Math.round(1e5*e)/1e5}const L$={textTransform:"uppercase"},_$='"Roboto", "Helvetica", "Arial", sans-serif';function P$(e,t){const n="function"==typeof t?t(e):t,{fontFamily:r=_$,fontSize:i=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d}=n,f=j_(n,I$),h=i/14,p=d||(e=>e/c*h+"rem"),m=(e,t,n,i,o)=>F_({fontFamily:r,fontWeight:e,fontSize:p(t),lineHeight:n},r===_$?{letterSpacing:`${R$(i/t)}em`}:{},o,u),g={h1:m(o,96,1.167,-1.5),h2:m(o,60,1.2,-.5),h3:m(a,48,1.167,0),h4:m(a,34,1.235,.25),h5:m(a,24,1.334,0),h6:m(s,20,1.6,.15),subtitle1:m(a,16,1.75,.15),subtitle2:m(s,14,1.57,.1),body1:m(a,16,1.5,.15),body2:m(a,14,1.43,.15),button:m(s,14,1.75,.4,L$),caption:m(a,12,1.66,.4),overline:m(a,12,2.66,1,L$),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Yz(F_({htmlFontSize:c,pxToRem:p,fontFamily:r,fontSize:i,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:l},g),f,{clone:!1})}function z$(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,0.2)`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,0.14)`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,0.12)`].join(",")}const F$=["none",z$(0,2,1,-1,0,1,1,0,0,1,3,0),z$(0,3,1,-2,0,2,2,0,0,1,5,0),z$(0,3,3,-2,0,3,4,0,0,1,8,0),z$(0,2,4,-1,0,4,5,0,0,1,10,0),z$(0,3,5,-1,0,5,8,0,0,1,14,0),z$(0,3,5,-1,0,6,10,0,0,1,18,0),z$(0,4,5,-2,0,7,10,1,0,2,16,1),z$(0,5,5,-3,0,8,10,1,0,3,14,2),z$(0,5,6,-3,0,9,12,1,0,3,16,2),z$(0,6,6,-3,0,10,14,1,0,4,18,3),z$(0,6,7,-4,0,11,15,1,0,4,20,3),z$(0,7,8,-4,0,12,17,2,0,5,22,4),z$(0,7,8,-4,0,13,19,2,0,5,24,4),z$(0,7,9,-4,0,14,21,2,0,5,26,4),z$(0,8,9,-5,0,15,22,2,0,6,28,5),z$(0,8,10,-5,0,16,24,2,0,6,30,5),z$(0,8,11,-5,0,17,26,2,0,6,32,5),z$(0,9,11,-5,0,18,28,2,0,7,34,6),z$(0,9,12,-6,0,19,29,2,0,7,36,6),z$(0,10,13,-6,0,20,31,3,0,8,38,7),z$(0,10,13,-6,0,21,33,3,0,8,40,7),z$(0,10,14,-6,0,22,35,3,0,8,42,7),z$(0,11,14,-7,0,23,36,3,0,9,44,8),z$(0,11,15,-7,0,24,38,3,0,9,46,8)],j$=["duration","easing","delay"],$$={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},B$={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function V$(e){return`${Math.round(e)}ms`}function H$(e){if(!e)return 0;const t=e/36;return Math.round(10*(4+15*t**.25+t/5))}function U$(e){const t=F_({},$$,e.easing),n=F_({},B$,e.duration);return F_({getAutoHeightDuration:H$,create:(e=["all"],r={})=>{const{duration:i=n.standard,easing:o=t.easeInOut,delay:a=0}=r;return j_(r,j$),(Array.isArray(e)?e:[e]).map(e=>`${e} ${"string"==typeof i?i:V$(i)} ${o} ${"string"==typeof a?a:V$(a)}`).join(",")}},e,{easing:t,duration:n})}const W$={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},Y$=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function K$(e={},...t){const{mixins:n={},palette:r={},transitions:i={},typography:o={}}=e,a=j_(e,Y$);if(e.vars&&void 0===e.generateCssVars)throw new Error(__(18));const s=q$(r),l=QF(e);let c=Yz(l,{mixins:(u=l.breakpoints,d=n,F_({toolbar:{minHeight:56,[u.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[u.up("sm")]:{minHeight:64}}},d)),palette:s,shadows:F$.slice(),typography:P$(s,o),transitions:U$(i),zIndex:F_({},W$)});var u,d;return c=Yz(c,a),c=t.reduce((e,t)=>Yz(e,t),c),c.unstable_sxConfig=F_({},KF,null==a?void 0:a.unstable_sxConfig),c.unstable_sx=function(e){return XF({sx:e,theme:this})},c}const G$=K$();function X$(){const e=rj(G$);return e[z_]||e}var J$,Z$={},Q$={exports:{}};var eB,tB={exports:{}};var nB,rB=a(Hz),iB=a(Kz),oB=a(iF),aB=a(Aj),sB=a(ej),lB=a(lj);function cB(){if(nB)return Z$;nB=1;var e=M$();Object.defineProperty(Z$,"__esModule",{value:!0}),Z$.default=function(e={}){const{themeId:o,defaultTheme:s=h,rootShouldForwardProp:l=d,slotShouldForwardProp:u=d}=e,f=e=>(0,a.default)((0,t.default)({},e,{theme:m((0,t.default)({},e,{defaultTheme:s,themeId:o}))}));return f.__mui_systemSx=!0,(e,a={})=>{(0,r.internal_processStyles)(e,e=>e.filter(e=>!(null!=e&&e.__mui_systemSx)));const{name:h,slot:v,skipVariantsResolver:b,skipSx:x,overridesResolver:S=g(p(v))}=a,M=(0,n.default)(a,c),w=h&&h.startsWith("Mui")||v?"components":"custom",E=void 0!==b?b:v&&"Root"!==v&&"root"!==v||!1,k=x||!1;let C=d;"Root"===v||"root"===v?C=l:v?C=u:function(e){return"string"==typeof e&&e.charCodeAt(0)>96}(e)&&(C=void 0);const A=(0,r.default)(e,(0,t.default)({shouldForwardProp:C,label:void 0},M)),O=e=>"function"==typeof e&&e.__emotion_real!==e||(0,i.isPlainObject)(e)?n=>{const r=m({theme:n.theme,defaultTheme:s,themeId:o});return y(e,(0,t.default)({},n,{theme:r}),r.modularCssLayers?w:void 0)}:e,N=(n,...r)=>{let i=O(n);const a=r?r.map(O):[];h&&S&&a.push(e=>{const n=m((0,t.default)({},e,{defaultTheme:s,themeId:o}));if(!n.components||!n.components[h]||!n.components[h].styleOverrides)return null;const r=n.components[h].styleOverrides,i={};return Object.entries(r).forEach(([r,o])=>{i[r]=y(o,(0,t.default)({},e,{theme:n}),n.modularCssLayers?"theme":void 0)}),S(e,i)}),h&&!E&&a.push(e=>{var n;const r=m((0,t.default)({},e,{defaultTheme:s,themeId:o}));return y({variants:null==r||null==(n=r.components)||null==(n=n[h])?void 0:n.variants},(0,t.default)({},e,{theme:r}),r.modularCssLayers?"theme":void 0)}),k||a.push(f);const l=a.length-r.length;if(Array.isArray(n)&&l>0){const e=new Array(l).fill("");i=[...n,...e],i.raw=[...n.raw,...e]}const c=A(i,...a);return e.muiName&&(c.muiName=e.muiName),c};return A.withConfig&&(N.withConfig=A.withConfig),N}},Z$.shouldForwardProp=d,Z$.systemDefaultTheme=void 0;var t=e((J$||(J$=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(Q$)),Q$.exports)),n=e((eB||(eB=1,function(e){e.exports=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n},e.exports.__esModule=!0,e.exports.default=e.exports}(tB)),tB.exports)),r=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(r,o,a):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r}(rB),i=iB;e(oB),e(aB);var o=e(sB),a=e(lB);const s=["ownerState"],l=["variants"],c=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}function d(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function f(e,t){return t&&e&&"object"==typeof e&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}const h=Z$.systemDefaultTheme=(0,o.default)(),p=e=>e?e.charAt(0).toLowerCase()+e.slice(1):e;function m({defaultTheme:e,theme:t,themeId:n}){return r=t,0===Object.keys(r).length?e:t[n]||t;var r}function g(e){return e?(t,n)=>n[e]:null}function y(e,i,o){let{ownerState:a}=i,c=(0,n.default)(i,s);const u="function"==typeof e?e((0,t.default)({ownerState:a},c)):e;if(Array.isArray(u))return u.flatMap(e=>y(e,(0,t.default)({ownerState:a},c),o));if(u&&"object"==typeof u&&Array.isArray(u.variants)){const{variants:e=[]}=u;let i=(0,n.default)(u,l);return e.forEach(e=>{let n=!0;if("function"==typeof e.props?n=e.props((0,t.default)({ownerState:a},c,a)):Object.keys(e.props).forEach(t=>{(null==a?void 0:a[t])!==e.props[t]&&c[t]!==e.props[t]&&(n=!1)}),n){Array.isArray(i)||(i=[i]);const n="function"==typeof e.style?e.style((0,t.default)({ownerState:a},c,a)):e.style;i.push(o?f((0,r.internal_serializeStyles)(n),o):n)}}),i}return o?f((0,r.internal_serializeStyles)(u),o):u}return Z$}const uB=e=>function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}(e)&&"classes"!==e,dB=o(cB())({themeId:z_,defaultTheme:G$,rootShouldForwardProp:uB}),fB=["theme"];function hB(e){let{theme:t}=e,n=j_(e,fB);const r=t[z_];let i=r||t;return"function"!=typeof t&&(r&&!r.vars?i=F_({},r,{vars:null}):t&&!t.vars&&(i=F_({},t,{vars:null}))),Fz.jsx(v$,F_({},n,{themeId:r?z_:void 0,theme:i}))}const pB=e=>{let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,(t/100).toFixed(2)};function mB(e){return m$(e)}function gB(e){return pj("MuiSvgIcon",e)}mj("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const yB=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],vB=dB("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"inherit"!==n.color&&t[`color${rF(n.color)}`],t[`fontSize${rF(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,i,o,a,s,l,c,u,d,f,h,p;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:null==(n=e.transitions)||null==(r=n.create)?void 0:r.call(n,"fill",{duration:null==(i=e.transitions)||null==(i=i.duration)?void 0:i.shorter}),fontSize:{inherit:"inherit",small:(null==(o=e.typography)||null==(a=o.pxToRem)?void 0:a.call(o,20))||"1.25rem",medium:(null==(s=e.typography)||null==(l=s.pxToRem)?void 0:l.call(s,24))||"1.5rem",large:(null==(c=e.typography)||null==(u=c.pxToRem)?void 0:u.call(c,35))||"2.1875rem"}[t.fontSize],color:null!=(d=null==(f=(e.vars||e).palette)||null==(f=f[t.color])?void 0:f.main)?d:{action:null==(h=(e.vars||e).palette)||null==(h=h.action)?void 0:h.active,disabled:null==(p=(e.vars||e).palette)||null==(p=p.action)?void 0:p.disabled,inherit:void 0}[t.color]}}),bB=QL.forwardRef(function(e,t){const n=mB({props:e,name:"MuiSvgIcon"}),{children:r,className:i,color:o="inherit",component:a="svg",fontSize:s="medium",htmlColor:l,inheritViewBox:c=!1,titleAccess:u,viewBox:d="0 0 24 24"}=n,f=j_(n,yB),h=QL.isValidElement(r)&&"svg"===r.type,p=F_({},n,{color:o,component:a,fontSize:s,instanceFontSize:e.fontSize,inheritViewBox:c,viewBox:d,hasSvgAsChild:h}),m={};c||(m.viewBox=d);const g=(e=>{const{color:t,fontSize:n,classes:r}=e;return Qj({root:["root","inherit"!==t&&`color${rF(t)}`,`fontSize${rF(n)}`]},gB,r)})(p);return Fz.jsxs(vB,F_({as:a,className:fj(g.root,i),focusable:"false",color:l,"aria-hidden":!u||void 0,role:u?"img":void 0,ref:t},m,f,h&&r.props,{ownerState:p,children:[h?r.props.children:r,u?Fz.jsx("title",{children:u}):null]}))});function xB(e,t){return xB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xB(e,t)}function SB(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,xB(e,t)}bB.muiName="SvgIcon";var MB,wB,EB,kB,CB={exports:{}},AB={},OB={exports:{}},NB={};function DB(){return wB||(wB=1,OB.exports=(MB||(MB=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<i(o,t)))break e;e[r]=t,e[n]=o,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,a=o>>>1;r<a;){var s=2*(r+1)-1,l=e[s],c=s+1,u=e[c];if(0>i(l,n))c<o&&0>i(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[s]=n,r=s);else{if(!(c<o&&0>i(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],c=[],u=1,d=null,f=3,h=!1,p=!1,m=!1,g="function"==typeof setTimeout?setTimeout:null,y="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var i=n(c);null!==i;){if(null===i.callback)r(c);else{if(!(i.startTime<=e))break;r(c),i.sortIndex=i.expirationTime,t(l,i)}i=n(c)}}function x(e){if(m=!1,b(e),!p)if(null!==n(l))p=!0,q(S);else{var t=n(c);null!==t&&I(x,t.startTime-e)}}function S(t,i){p=!1,m&&(m=!1,y(k),k=-1),h=!0;var o=f;try{for(b(i),d=n(l);null!==d&&(!(d.expirationTime>i)||t&&!O());){var a=d.callback;if("function"==typeof a){d.callback=null,f=d.priorityLevel;var s=a(d.expirationTime<=i);i=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),b(i)}else r(l);d=n(l)}if(null!==d)var u=!0;else{var g=n(c);null!==g&&I(x,g.startTime-i),u=!1}return u}finally{d=null,f=o,h=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var M,w=!1,E=null,k=-1,C=5,A=-1;function O(){return!(e.unstable_now()-A<C)}function N(){if(null!==E){var t=e.unstable_now();A=t;var n=!0;try{n=E(!0,t)}finally{n?M():(w=!1,E=null)}}else w=!1}if("function"==typeof v)M=function(){v(N)};else if("undefined"!=typeof MessageChannel){var D=new MessageChannel,T=D.port2;D.port1.onmessage=N,M=function(){T.postMessage(null)}}else M=function(){g(N,0)};function q(e){E=e,w||(w=!0,M())}function I(t,n){k=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,q(S))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,o){var a=e.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:u++,callback:i,priorityLevel:r,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>a?(r.sortIndex=o,t(c,r),null===n(l)&&r===n(c)&&(m?(y(k),k=-1):m=!0,I(x,o-a))):(r.sortIndex=s,t(l,r),p||h||(p=!0,q(S))),r},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}}(NB)),NB)),OB.exports}
/**
   * @license React
   * react-dom.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */function TB(){if(EB)return AB;EB=1;var e=ZL(),t=DB();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function o(e,t){a(e,t),a(e+"Capture",t)}function a(e,t){for(i[e]=t,e=0;e<t.length;e++)r.add(t[e])}var s=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),l=Object.prototype.hasOwnProperty,c=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,u={},d={};function f(e,t,n,r,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var h={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){h[e]=new f(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];h[t]=new f(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){h[e]=new f(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){h[e]=new f(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){h[e]=new f(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){h[e]=new f(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){h[e]=new f(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){h[e]=new f(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){h[e]=new f(e,5,!1,e.toLowerCase(),null,!1,!1)});var p=/[\-:]([a-z])/g;function m(e){return e[1].toUpperCase()}function g(e,t,n,r){var i=h.hasOwnProperty(t)?h[t]:null;(null!==i?0!==i.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,i,r)&&(n=null),r||null===i?function(e){return!!l.call(d,e)||!l.call(u,e)&&(c.test(e)?d[e]=!0:(u[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=null===n?3!==i.type&&"":n:(t=i.attributeName,r=i.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(i=i.type)||4===i&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(p,m);h[t]=new f(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(p,m);h[t]=new f(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(p,m);h[t]=new f(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){h[e]=new f(e,1,!1,e.toLowerCase(),null,!1,!1)}),h.xlinkHref=new f("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){h[e]=new f(e,1,!1,e.toLowerCase(),null,!0,!0)});var y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,v=Symbol.for("react.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),w=Symbol.for("react.provider"),E=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),C=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),T=Symbol.iterator;function q(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=T&&e[T]||e["@@iterator"])?e:null}var I,R=Object.assign;function L(e){if(void 0===I)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);I=t&&t[1]||""}return"\n"+I+e}var _=!1;function P(e,t){if(!e||_)return"";_=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var i=t.stack.split("\n"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s]){var l="\n"+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{_=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?L(e):""}function z(e){switch(e.tag){case 5:return L(e.type);case 16:return L("Lazy");case 13:return L("Suspense");case 19:return L("SuspenseList");case 0:case 2:case 15:return e=P(e.type,!1);case 11:return e=P(e.type.render,!1);case 1:return e=P(e.type,!0);default:return""}}function F(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case x:return"Fragment";case b:return"Portal";case M:return"Profiler";case S:return"StrictMode";case C:return"Suspense";case A:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case E:return(e.displayName||"Context")+".Consumer";case w:return(e._context.displayName||"Context")+".Provider";case k:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case O:return null!==(t=e.displayName||null)?t:F(e.type)||"Memo";case N:t=e._payload,e=e._init;try{return F(e(t))}catch(e){}}return null}function j(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return F(t);case 8:return t===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function $(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function B(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function V(e){e._valueTracker||(e._valueTracker=function(e){var t=B(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function H(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=B(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function U(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function W(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Y(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=$(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function K(e,t){null!=(t=t.checked)&&g(e,"checked",t,!1)}function G(e,t){K(e,t);var n=$(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?J(e,t.type,n):t.hasOwnProperty("defaultValue")&&J(e,t.type,$(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function X(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function J(e,t,n){"number"===t&&U(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Z=Array.isArray;function Q(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$(n),t=null,i=0;i<e.length;i++){if(e[i].value===n)return e[i].selected=!0,void(r&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ee(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(n(91));return R({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function te(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(n(92));if(Z(r)){if(1<r.length)throw Error(n(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:$(r)}}function ne(e,t){var n=$(t.value),r=$(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function re(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function ie(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function oe(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?ie(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ae,se=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n)})}:e}(function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ae=ae||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ae.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function le(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ce={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ue=["Webkit","ms","Moz","O"];function de(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ce.hasOwnProperty(e)&&ce[e]?(""+t).trim():t+"px"}function fe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),i=de(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}Object.keys(ce).forEach(function(e){ue.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ce[t]=ce[e]})});var he=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function pe(e,t){if(t){if(he[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function me(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ge=null;function ye(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var ve=null,be=null,xe=null;function Se(e){if(e=mi(e)){if("function"!=typeof ve)throw Error(n(280));var t=e.stateNode;t&&(t=yi(t),ve(e.stateNode,e.type,t))}}function Me(e){be?xe?xe.push(e):xe=[e]:be=e}function we(){if(be){var e=be,t=xe;if(xe=be=null,Se(e),t)for(e=0;e<t.length;e++)Se(t[e])}}function Ee(e,t){return e(t)}function ke(){}var Ce=!1;function Ae(e,t,n){if(Ce)return e(t,n);Ce=!0;try{return Ee(e,t,n)}finally{Ce=!1,(null!==be||null!==xe)&&(ke(),we())}}function Oe(e,t){var r=e.stateNode;if(null===r)return null;var i=yi(r);if(null===i)return null;r=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(n(231,t,typeof r));return r}var Ne=!1;if(s)try{var De={};Object.defineProperty(De,"passive",{get:function(){Ne=!0}}),window.addEventListener("test",De,De),window.removeEventListener("test",De,De)}catch(e){Ne=!1}function Te(e,t,n,r,i,o,a,s,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(e){this.onError(e)}}var qe=!1,Ie=null,Re=!1,Le=null,_e={onError:function(e){qe=!0,Ie=e}};function Pe(e,t,n,r,i,o,a,s,l){qe=!1,Ie=null,Te.apply(_e,arguments)}function ze(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Fe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function je(e){if(ze(e)!==e)throw Error(n(188))}function $e(e){return e=function(e){var t=e.alternate;if(!t){if(null===(t=ze(e)))throw Error(n(188));return t!==e?null:e}for(var r=e,i=t;;){var o=r.return;if(null===o)break;var a=o.alternate;if(null===a){if(null!==(i=o.return)){r=i;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===r)return je(o),e;if(a===i)return je(o),t;a=a.sibling}throw Error(n(188))}if(r.return!==i.return)r=o,i=a;else{for(var s=!1,l=o.child;l;){if(l===r){s=!0,r=o,i=a;break}if(l===i){s=!0,i=o,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,i=o;break}if(l===i){s=!0,i=a,r=o;break}l=l.sibling}if(!s)throw Error(n(189))}}if(r.alternate!==i)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?e:t}(e),null!==e?Be(e):null}function Be(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=Be(e);if(null!==t)return t;e=e.sibling}return null}var Ve=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Ue=t.unstable_shouldYield,We=t.unstable_requestPaint,Ye=t.unstable_now,Ke=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Je=t.unstable_NormalPriority,Ze=t.unstable_LowPriority,Qe=t.unstable_IdlePriority,et=null,tt=null;var nt=Math.clz32?Math.clz32:function(e){return e>>>=0,0===e?32:31-(rt(e)/it|0)|0},rt=Math.log,it=Math.LN2;var ot=64,at=4194304;function st(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function lt(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~i;0!==s?r=st(s):0!==(o&=a)&&(r=st(o))}else 0!==(a=n&~i)?r=st(a):0!==o&&(r=st(o));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&i)&&((i=r&-r)>=(o=t&-t)||16===i&&4194240&o))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-nt(t)),r|=e[n],t&=~i;return r}function ct(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function ut(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function dt(){var e=ot;return!(4194240&(ot<<=1))&&(ot=64),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-nt(t)]=n}function pt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-nt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var mt=0;function gt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var yt,vt,bt,xt,St,Mt=!1,wt=[],Et=null,kt=null,Ct=null,At=new Map,Ot=new Map,Nt=[],Dt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Tt(e,t){switch(e){case"focusin":case"focusout":Et=null;break;case"dragenter":case"dragleave":kt=null;break;case"mouseover":case"mouseout":Ct=null;break;case"pointerover":case"pointerout":At.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ot.delete(t.pointerId)}}function qt(e,t,n,r,i,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},null!==t&&(null!==(t=mi(t))&&vt(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function It(e){var t=pi(e.target);if(null!==t){var n=ze(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Fe(n)))return e.blockedOn=t,void St(e.priority,function(){bt(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Rt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ut(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=mi(n))&&vt(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);ge=r,n.target.dispatchEvent(r),ge=null,t.shift()}return!0}function Lt(e,t,n){Rt(e)&&n.delete(t)}function _t(){Mt=!1,null!==Et&&Rt(Et)&&(Et=null),null!==kt&&Rt(kt)&&(kt=null),null!==Ct&&Rt(Ct)&&(Ct=null),At.forEach(Lt),Ot.forEach(Lt)}function Pt(e,n){e.blockedOn===n&&(e.blockedOn=null,Mt||(Mt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,_t)))}function zt(e){function t(t){return Pt(t,e)}if(0<wt.length){Pt(wt[0],e);for(var n=1;n<wt.length;n++){var r=wt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Et&&Pt(Et,e),null!==kt&&Pt(kt,e),null!==Ct&&Pt(Ct,e),At.forEach(t),Ot.forEach(t),n=0;n<Nt.length;n++)(r=Nt[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Nt.length&&null===(n=Nt[0]).blockedOn;)It(n),null===n.blockedOn&&Nt.shift()}var Ft=y.ReactCurrentBatchConfig,jt=!0;function $t(e,t,n,r){var i=mt,o=Ft.transition;Ft.transition=null;try{mt=1,Vt(e,t,n,r)}finally{mt=i,Ft.transition=o}}function Bt(e,t,n,r){var i=mt,o=Ft.transition;Ft.transition=null;try{mt=4,Vt(e,t,n,r)}finally{mt=i,Ft.transition=o}}function Vt(e,t,n,r){if(jt){var i=Ut(e,t,n,r);if(null===i)jr(e,t,r,Ht,n),Tt(e,r);else if(function(e,t,n,r,i){switch(t){case"focusin":return Et=qt(Et,e,t,n,r,i),!0;case"dragenter":return kt=qt(kt,e,t,n,r,i),!0;case"mouseover":return Ct=qt(Ct,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return At.set(o,qt(At.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Ot.set(o,qt(Ot.get(o)||null,e,t,n,r,i)),!0}return!1}(i,e,t,n,r))r.stopPropagation();else if(Tt(e,r),4&t&&-1<Dt.indexOf(e)){for(;null!==i;){var o=mi(i);if(null!==o&&yt(o),null===(o=Ut(e,t,n,r))&&jr(e,t,r,Ht,n),o===i)break;i=o}null!==i&&r.stopPropagation()}else jr(e,t,r,null,n)}}var Ht=null;function Ut(e,t,n,r){if(Ht=null,null!==(e=pi(e=ye(r))))if(null===(t=ze(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=Fe(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ht=e,null}function Wt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ke()){case Ge:return 1;case Xe:return 4;case Je:case Ze:return 16;case Qe:return 536870912;default:return 16}default:return 16}}var Yt=null,Kt=null,Gt=null;function Xt(){if(Gt)return Gt;var e,t,n=Kt,r=n.length,i="value"in Yt?Yt.value:Yt.textContent,o=i.length;for(e=0;e<r&&n[e]===i[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===i[o-t];t++);return Gt=i.slice(e,1<t?1-t:void 0)}function Jt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Zt(){return!0}function Qt(){return!1}function en(e){function t(t,n,r,i,o){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?Zt:Qt,this.isPropagationStopped=Qt,this}return R(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Zt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Zt)},persist:function(){},isPersistent:Zt}),t}var tn,nn,rn,on={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},an=en(on),sn=R({},on,{view:0,detail:0}),ln=en(sn),cn=R({},sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==rn&&(rn&&"mousemove"===e.type?(tn=e.screenX-rn.screenX,nn=e.screenY-rn.screenY):nn=tn=0,rn=e),tn)},movementY:function(e){return"movementY"in e?e.movementY:nn}}),un=en(cn),dn=en(R({},cn,{dataTransfer:0})),fn=en(R({},sn,{relatedTarget:0})),hn=en(R({},on,{animationName:0,elapsedTime:0,pseudoElement:0})),pn=R({},on,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mn=en(pn),gn=en(R({},on,{data:0})),yn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},bn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=bn[e])&&!!t[e]}function Sn(){return xn}var Mn=R({},sn,{key:function(e){if(e.key){var t=yn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Jt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?vn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sn,charCode:function(e){return"keypress"===e.type?Jt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Jt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),wn=en(Mn),En=en(R({},cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),kn=en(R({},sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sn})),Cn=en(R({},on,{propertyName:0,elapsedTime:0,pseudoElement:0})),An=R({},cn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),On=en(An),Nn=[9,13,27,32],Dn=s&&"CompositionEvent"in window,Tn=null;s&&"documentMode"in document&&(Tn=document.documentMode);var qn=s&&"TextEvent"in window&&!Tn,In=s&&(!Dn||Tn&&8<Tn&&11>=Tn),Rn=String.fromCharCode(32),Ln=!1;function _n(e,t){switch(e){case"keyup":return-1!==Nn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Pn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var zn=!1;var Fn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Fn[e.type]:"textarea"===t}function $n(e,t,n,r){Me(r),0<(t=Br(t,"onChange")).length&&(n=new an("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Bn=null,Vn=null;function Hn(e){Rr(e,0)}function Un(e){if(H(gi(e)))return e}function Wn(e,t){if("change"===e)return t}var Yn=!1;if(s){var Kn;if(s){var Gn="oninput"in document;if(!Gn){var Xn=document.createElement("div");Xn.setAttribute("oninput","return;"),Gn="function"==typeof Xn.oninput}Kn=Gn}else Kn=!1;Yn=Kn&&(!document.documentMode||9<document.documentMode)}function Jn(){Bn&&(Bn.detachEvent("onpropertychange",Zn),Vn=Bn=null)}function Zn(e){if("value"===e.propertyName&&Un(Vn)){var t=[];$n(t,Vn,e,ye(e)),Ae(Hn,t)}}function Qn(e,t,n){"focusin"===e?(Jn(),Vn=n,(Bn=t).attachEvent("onpropertychange",Zn)):"focusout"===e&&Jn()}function er(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Un(Vn)}function tr(e,t){if("click"===e)return Un(t)}function nr(e,t){if("input"===e||"change"===e)return Un(t)}var rr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function ir(e,t){if(rr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!l.call(t,i)||!rr(e[i],t[i]))return!1}return!0}function or(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ar(e,t){var n,r=or(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=or(r)}}function sr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?sr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function lr(){for(var e=window,t=U();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=U((e=t.contentWindow).document)}return t}function cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function ur(e){var t=lr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&sr(n.ownerDocument.documentElement,n)){if(null!==r&&cr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=void 0===r.end?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=ar(n,o);var a=ar(n,r);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var dr=s&&"documentMode"in document&&11>=document.documentMode,fr=null,hr=null,pr=null,mr=!1;function gr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;mr||null==fr||fr!==U(r)||("selectionStart"in(r=fr)&&cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},pr&&ir(pr,r)||(pr=r,0<(r=Br(hr,"onSelect")).length&&(t=new an("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=fr)))}function yr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var vr={animationend:yr("Animation","AnimationEnd"),animationiteration:yr("Animation","AnimationIteration"),animationstart:yr("Animation","AnimationStart"),transitionend:yr("Transition","TransitionEnd")},br={},xr={};function Sr(e){if(br[e])return br[e];if(!vr[e])return e;var t,n=vr[e];for(t in n)if(n.hasOwnProperty(t)&&t in xr)return br[e]=n[t];return e}s&&(xr=document.createElement("div").style,"AnimationEvent"in window||(delete vr.animationend.animation,delete vr.animationiteration.animation,delete vr.animationstart.animation),"TransitionEvent"in window||delete vr.transitionend.transition);var Mr=Sr("animationend"),wr=Sr("animationiteration"),Er=Sr("animationstart"),kr=Sr("transitionend"),Cr=new Map,Ar="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Or(e,t){Cr.set(e,t),o(t,[e])}for(var Nr=0;Nr<Ar.length;Nr++){var Dr=Ar[Nr];Or(Dr.toLowerCase(),"on"+(Dr[0].toUpperCase()+Dr.slice(1)))}Or(Mr,"onAnimationEnd"),Or(wr,"onAnimationIteration"),Or(Er,"onAnimationStart"),Or("dblclick","onDoubleClick"),Or("focusin","onFocus"),Or("focusout","onBlur"),Or(kr,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),qr=new Set("cancel close invalid load scroll toggle".split(" ").concat(Tr));function Ir(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,i,o,a,s,l,c){if(Pe.apply(this,arguments),qe){if(!qe)throw Error(n(198));var u=Ie;qe=!1,Ie=null,Re||(Re=!0,Le=u)}}(i,t,void 0,e),e.currentTarget=null}function Rr(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;Ir(i,s,c),o=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,c=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;Ir(i,s,c),o=l}}}if(Re)throw e=Le,Re=!1,Le=null,e}function Lr(e,t){var n=t[di];void 0===n&&(n=t[di]=new Set);var r=e+"__bubble";n.has(r)||(Fr(t,e,2,!1),n.add(r))}function _r(e,t,n){var r=0;t&&(r|=4),Fr(n,e,r,t)}var Pr="_reactListening"+Math.random().toString(36).slice(2);function zr(e){if(!e[Pr]){e[Pr]=!0,r.forEach(function(t){"selectionchange"!==t&&(qr.has(t)||_r(t,!1,e),_r(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Pr]||(t[Pr]=!0,_r("selectionchange",!1,t))}}function Fr(e,t,n,r){switch(Wt(t)){case 1:var i=$t;break;case 4:i=Bt;break;default:i=Vt}n=i.bind(null,t,n,e),i=void 0,!Ne||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),r?void 0!==i?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):void 0!==i?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function jr(e,t,n,r,i){var o=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;a=a.return}for(;null!==s;){if(null===(a=pi(s)))return;if(5===(l=a.tag)||6===l){r=o=a;continue e}s=s.parentNode}}r=r.return}Ae(function(){var r=o,i=ye(n),a=[];e:{var s=Cr.get(e);if(void 0!==s){var l=an,c=e;switch(e){case"keypress":if(0===Jt(n))break e;case"keydown":case"keyup":l=wn;break;case"focusin":c="focus",l=fn;break;case"focusout":c="blur",l=fn;break;case"beforeblur":case"afterblur":l=fn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=un;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=dn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=kn;break;case Mr:case wr:case Er:l=hn;break;case kr:l=Cn;break;case"scroll":l=ln;break;case"wheel":l=On;break;case"copy":case"cut":case"paste":l=mn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=En}var u=!!(4&t),d=!u&&"scroll"===e,f=u?null!==s?s+"Capture":null:s;u=[];for(var h,p=r;null!==p;){var m=(h=p).stateNode;if(5===h.tag&&null!==m&&(h=m,null!==f&&(null!=(m=Oe(p,f))&&u.push($r(p,m,h)))),d)break;p=p.return}0<u.length&&(s=new l(s,c,null,n,i),a.push({event:s,listeners:u}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===ge||!(c=n.relatedTarget||n.fromElement)||!pi(c)&&!c[ui])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(c=(c=n.relatedTarget||n.toElement)?pi(c):null)&&(c!==(d=ze(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(l=null,c=r),l!==c)){if(u=un,m="onMouseLeave",f="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(u=En,m="onPointerLeave",f="onPointerEnter",p="pointer"),d=null==l?s:gi(l),h=null==c?s:gi(c),(s=new u(m,p+"leave",l,n,i)).target=d,s.relatedTarget=h,m=null,pi(i)===r&&((u=new u(f,p+"enter",c,n,i)).target=h,u.relatedTarget=d,m=u),d=m,l&&c)e:{for(f=c,p=0,h=u=l;h;h=Vr(h))p++;for(h=0,m=f;m;m=Vr(m))h++;for(;0<p-h;)u=Vr(u),p--;for(;0<h-p;)f=Vr(f),h--;for(;p--;){if(u===f||null!==f&&u===f.alternate)break e;u=Vr(u),f=Vr(f)}u=null}else u=null;null!==l&&Hr(a,s,l,u,!1),null!==c&&null!==d&&Hr(a,d,c,u,!0)}if("select"===(l=(s=r?gi(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Wn;else if(jn(s))if(Yn)g=nr;else{g=er;var y=Qn}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=tr);switch(g&&(g=g(e,r))?$n(a,g,n,i):(y&&y(e,s,r),"focusout"===e&&(y=s._wrapperState)&&y.controlled&&"number"===s.type&&J(s,"number",s.value)),y=r?gi(r):window,e){case"focusin":(jn(y)||"true"===y.contentEditable)&&(fr=y,hr=r,pr=null);break;case"focusout":pr=hr=fr=null;break;case"mousedown":mr=!0;break;case"contextmenu":case"mouseup":case"dragend":mr=!1,gr(a,n,i);break;case"selectionchange":if(dr)break;case"keydown":case"keyup":gr(a,n,i)}var v;if(Dn)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else zn?_n(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(In&&"ko"!==n.locale&&(zn||"onCompositionStart"!==b?"onCompositionEnd"===b&&zn&&(v=Xt()):(Kt="value"in(Yt=i)?Yt.value:Yt.textContent,zn=!0)),0<(y=Br(r,b)).length&&(b=new gn(b,e,null,n,i),a.push({event:b,listeners:y}),v?b.data=v:null!==(v=Pn(n))&&(b.data=v))),(v=qn?function(e,t){switch(e){case"compositionend":return Pn(t);case"keypress":return 32!==t.which?null:(Ln=!0,Rn);case"textInput":return(e=t.data)===Rn&&Ln?null:e;default:return null}}(e,n):function(e,t){if(zn)return"compositionend"===e||!Dn&&_n(e,t)?(e=Xt(),Gt=Kt=Yt=null,zn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return In&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(r=Br(r,"onBeforeInput")).length&&(i=new gn("onBeforeInput","beforeinput",null,n,i),a.push({event:i,listeners:r}),i.data=v))}Rr(a,t)})}function $r(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Br(e,t){for(var n=t+"Capture",r=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Oe(e,n))&&r.unshift($r(e,o,i)),null!=(o=Oe(e,t))&&r.push($r(e,o,i))),e=e.return}return r}function Vr(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Hr(e,t,n,r,i){for(var o=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,c=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==c&&(s=c,i?null!=(l=Oe(n,o))&&a.unshift($r(n,l,s)):i||null!=(l=Oe(n,o))&&a.push($r(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Ur=/\r\n?/g,Wr=/\u0000|\uFFFD/g;function Yr(e){return("string"==typeof e?e:""+e).replace(Ur,"\n").replace(Wr,"")}function Kr(e,t,r){if(t=Yr(t),Yr(e)!==t&&r)throw Error(n(425))}function Gr(){}var Xr=null,Jr=null;function Zr(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Qr="function"==typeof setTimeout?setTimeout:void 0,ei="function"==typeof clearTimeout?clearTimeout:void 0,ti="function"==typeof Promise?Promise:void 0,ni="function"==typeof queueMicrotask?queueMicrotask:void 0!==ti?function(e){return ti.resolve(null).then(e).catch(ri)}:Qr;function ri(e){setTimeout(function(){throw e})}function ii(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&8===i.nodeType)if("/$"===(n=i.data)){if(0===r)return e.removeChild(i),void zt(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=i}while(n);zt(t)}function oi(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function ai(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var si=Math.random().toString(36).slice(2),li="__reactFiber$"+si,ci="__reactProps$"+si,ui="__reactContainer$"+si,di="__reactEvents$"+si,fi="__reactListeners$"+si,hi="__reactHandles$"+si;function pi(e){var t=e[li];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ui]||n[li]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=ai(e);null!==e;){if(n=e[li])return n;e=ai(e)}return t}n=(e=n).parentNode}return null}function mi(e){return!(e=e[li]||e[ui])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function gi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(n(33))}function yi(e){return e[ci]||null}var vi=[],bi=-1;function xi(e){return{current:e}}function Si(e){0>bi||(e.current=vi[bi],vi[bi]=null,bi--)}function Mi(e,t){bi++,vi[bi]=e.current,e.current=t}var wi={},Ei=xi(wi),ki=xi(!1),Ci=wi;function Ai(e,t){var n=e.type.contextTypes;if(!n)return wi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Oi(e){return null!=(e=e.childContextTypes)}function Ni(){Si(ki),Si(Ei)}function Di(e,t,r){if(Ei.current!==wi)throw Error(n(168));Mi(Ei,t),Mi(ki,r)}function Ti(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,"function"!=typeof i.getChildContext)return r;for(var o in i=i.getChildContext())if(!(o in t))throw Error(n(108,j(e)||"Unknown",o));return R({},r,i)}function qi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||wi,Ci=Ei.current,Mi(Ei,e),Mi(ki,ki.current),!0}function Ii(e,t,r){var i=e.stateNode;if(!i)throw Error(n(169));r?(e=Ti(e,t,Ci),i.__reactInternalMemoizedMergedChildContext=e,Si(ki),Si(Ei),Mi(Ei,e)):Si(ki),Mi(ki,r)}var Ri=null,Li=!1,_i=!1;function Pi(e){null===Ri?Ri=[e]:Ri.push(e)}function zi(){if(!_i&&null!==Ri){_i=!0;var e=0,t=mt;try{var n=Ri;for(mt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}Ri=null,Li=!1}catch(t){throw null!==Ri&&(Ri=Ri.slice(e+1)),Ve(Ge,zi),t}finally{mt=t,_i=!1}}return null}var Fi=[],ji=0,$i=null,Bi=0,Vi=[],Hi=0,Ui=null,Wi=1,Yi="";function Ki(e,t){Fi[ji++]=Bi,Fi[ji++]=$i,$i=e,Bi=t}function Gi(e,t,n){Vi[Hi++]=Wi,Vi[Hi++]=Yi,Vi[Hi++]=Ui,Ui=e;var r=Wi;e=Yi;var i=32-nt(r)-1;r&=~(1<<i),n+=1;var o=32-nt(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Wi=1<<32-nt(t)+i|n<<i|r,Yi=o+e}else Wi=1<<o|n<<i|r,Yi=e}function Xi(e){null!==e.return&&(Ki(e,1),Gi(e,1,0))}function Ji(e){for(;e===$i;)$i=Fi[--ji],Fi[ji]=null,Bi=Fi[--ji],Fi[ji]=null;for(;e===Ui;)Ui=Vi[--Hi],Vi[Hi]=null,Yi=Vi[--Hi],Vi[Hi]=null,Wi=Vi[--Hi],Vi[Hi]=null}var Zi=null,Qi=null,eo=!1,to=null;function no(e,t){var n=Ac(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function ro(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,Zi=e,Qi=oi(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,Zi=e,Qi=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Ui?{id:Wi,overflow:Yi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Ac(18,null,null,0)).stateNode=t,n.return=e,e.child=n,Zi=e,Qi=null,!0);default:return!1}}function io(e){return!(!(1&e.mode)||128&e.flags)}function oo(e){if(eo){var t=Qi;if(t){var r=t;if(!ro(e,t)){if(io(e))throw Error(n(418));t=oi(r.nextSibling);var i=Zi;t&&ro(e,t)?no(i,r):(e.flags=-4097&e.flags|2,eo=!1,Zi=e)}}else{if(io(e))throw Error(n(418));e.flags=-4097&e.flags|2,eo=!1,Zi=e}}}function ao(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Zi=e}function so(e){if(e!==Zi)return!1;if(!eo)return ao(e),eo=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!Zr(e.type,e.memoizedProps)),t&&(t=Qi)){if(io(e))throw lo(),Error(n(418));for(;t;)no(e,t),t=oi(t.nextSibling)}if(ao(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){Qi=oi(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}Qi=null}}else Qi=Zi?oi(e.stateNode.nextSibling):null;return!0}function lo(){for(var e=Qi;e;)e=oi(e.nextSibling)}function co(){Qi=Zi=null,eo=!1}function uo(e){null===to?to=[e]:to.push(e)}var fo=y.ReactCurrentBatchConfig;function ho(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(n(309));var i=r.stateNode}if(!i)throw Error(n(147,e));var o=i,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=o.refs;null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(n(284));if(!r._owner)throw Error(n(290,e))}return e}function po(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function mo(e){return(0,e._init)(e._payload)}function go(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function r(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function o(e,t){return(e=Nc(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Ic(n,e.mode,r)).return=e,t):((t=o(t,n)).return=e,t)}function c(e,t,n,r){var i=n.type;return i===x?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===i||"object"==typeof i&&null!==i&&i.$$typeof===N&&mo(i)===t.type)?((r=o(t,n.props)).ref=ho(e,t,n),r.return=e,r):((r=Dc(n.type,n.key,n.props,null,e.mode,r)).ref=ho(e,t,n),r.return=e,r)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Rc(n,e.mode,r)).return=e,t):((t=o(t,n.children||[])).return=e,t)}function d(e,t,n,r,i){return null===t||7!==t.tag?((t=Tc(n,e.mode,r,i)).return=e,t):((t=o(t,n)).return=e,t)}function f(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Ic(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case v:return(n=Dc(t.type,t.key,t.props,null,e.mode,n)).ref=ho(e,null,t),n.return=e,n;case b:return(t=Rc(t,e.mode,n)).return=e,t;case N:return f(e,(0,t._init)(t._payload),n)}if(Z(t)||q(t))return(t=Tc(t,e.mode,n,null)).return=e,t;po(e,t)}return null}function h(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case v:return n.key===i?c(e,t,n,r):null;case b:return n.key===i?u(e,t,n,r):null;case N:return h(e,t,(i=n._init)(n._payload),r)}if(Z(n)||q(n))return null!==i?null:d(e,t,n,r,null);po(e,n)}return null}function p(e,t,n,r,i){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case v:return c(t,e=e.get(null===r.key?n:r.key)||null,r,i);case b:return u(t,e=e.get(null===r.key?n:r.key)||null,r,i);case N:return p(e,t,n,(0,r._init)(r._payload),i)}if(Z(r)||q(r))return d(t,e=e.get(n)||null,r,i,null);po(t,r)}return null}function m(n,o,s,l){for(var c=null,u=null,d=o,m=o=0,g=null;null!==d&&m<s.length;m++){d.index>m?(g=d,d=null):g=d.sibling;var y=h(n,d,s[m],l);if(null===y){null===d&&(d=g);break}e&&d&&null===y.alternate&&t(n,d),o=a(y,o,m),null===u?c=y:u.sibling=y,u=y,d=g}if(m===s.length)return r(n,d),eo&&Ki(n,m),c;if(null===d){for(;m<s.length;m++)null!==(d=f(n,s[m],l))&&(o=a(d,o,m),null===u?c=d:u.sibling=d,u=d);return eo&&Ki(n,m),c}for(d=i(n,d);m<s.length;m++)null!==(g=p(d,n,m,s[m],l))&&(e&&null!==g.alternate&&d.delete(null===g.key?m:g.key),o=a(g,o,m),null===u?c=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(n,e)}),eo&&Ki(n,m),c}function g(o,s,l,c){var u=q(l);if("function"!=typeof u)throw Error(n(150));if(null==(l=u.call(l)))throw Error(n(151));for(var d=u=null,m=s,g=s=0,y=null,v=l.next();null!==m&&!v.done;g++,v=l.next()){m.index>g?(y=m,m=null):y=m.sibling;var b=h(o,m,v.value,c);if(null===b){null===m&&(m=y);break}e&&m&&null===b.alternate&&t(o,m),s=a(b,s,g),null===d?u=b:d.sibling=b,d=b,m=y}if(v.done)return r(o,m),eo&&Ki(o,g),u;if(null===m){for(;!v.done;g++,v=l.next())null!==(v=f(o,v.value,c))&&(s=a(v,s,g),null===d?u=v:d.sibling=v,d=v);return eo&&Ki(o,g),u}for(m=i(o,m);!v.done;g++,v=l.next())null!==(v=p(m,o,g,v.value,c))&&(e&&null!==v.alternate&&m.delete(null===v.key?g:v.key),s=a(v,s,g),null===d?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(o,e)}),eo&&Ki(o,g),u}return function e(n,i,a,l){if("object"==typeof a&&null!==a&&a.type===x&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case v:e:{for(var c=a.key,u=i;null!==u;){if(u.key===c){if((c=a.type)===x){if(7===u.tag){r(n,u.sibling),(i=o(u,a.props.children)).return=n,n=i;break e}}else if(u.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===N&&mo(c)===u.type){r(n,u.sibling),(i=o(u,a.props)).ref=ho(n,u,a),i.return=n,n=i;break e}r(n,u);break}t(n,u),u=u.sibling}a.type===x?((i=Tc(a.props.children,n.mode,l,a.key)).return=n,n=i):((l=Dc(a.type,a.key,a.props,null,n.mode,l)).ref=ho(n,i,a),l.return=n,n=l)}return s(n);case b:e:{for(u=a.key;null!==i;){if(i.key===u){if(4===i.tag&&i.stateNode.containerInfo===a.containerInfo&&i.stateNode.implementation===a.implementation){r(n,i.sibling),(i=o(i,a.children||[])).return=n,n=i;break e}r(n,i);break}t(n,i),i=i.sibling}(i=Rc(a,n.mode,l)).return=n,n=i}return s(n);case N:return e(n,i,(u=a._init)(a._payload),l)}if(Z(a))return m(n,i,a,l);if(q(a))return g(n,i,a,l);po(n,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==i&&6===i.tag?(r(n,i.sibling),(i=o(i,a)).return=n,n=i):(r(n,i),(i=Ic(a,n.mode,l)).return=n,n=i),s(n)):r(n,i)}}var yo=go(!0),vo=go(!1),bo=xi(null),xo=null,So=null,Mo=null;function wo(){Mo=So=xo=null}function Eo(e){var t=bo.current;Si(bo),e._currentValue=t}function ko(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Co(e,t){xo=e,Mo=So=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ms=!0),e.firstContext=null)}function Ao(e){var t=e._currentValue;if(Mo!==e)if(e={context:e,memoizedValue:t,next:null},null===So){if(null===xo)throw Error(n(308));So=e,xo.dependencies={lanes:0,firstContext:e}}else So=So.next=e;return t}var Oo=null;function No(e){null===Oo?Oo=[e]:Oo.push(e)}function Do(e,t,n,r){var i=t.interleaved;return null===i?(n.next=n,No(t)):(n.next=i.next,i.next=n),t.interleaved=n,To(e,r)}function To(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var qo=!1;function Io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ro(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Lo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function _o(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&El){var i=r.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),r.pending=t,To(e,n)}return null===(i=r.interleaved)?(t.next=t,No(r)):(t.next=i.next,i.next=t),r.interleaved=t,To(e,n)}function Po(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,pt(e,n)}}function zo(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Fo(e,t,n,r){var i=e.updateQueue;qo=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,c=l.next;l.next=null,null===a?o=c:a.next=c,a=l;var u=e.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==a&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==o){var d=i.baseState;for(a=0,u=c=l=null,s=o;;){var f=s.lane,h=s.eventTime;if((r&f)===f){null!==u&&(u=u.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,m=s;switch(f=t,h=n,m.tag){case 1:if("function"==typeof(p=m.payload)){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null==(f="function"==typeof(p=m.payload)?p.call(h,d,f):p))break e;d=R({},d,f);break e;case 2:qo=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(f=i.effects)?i.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=h,l=d):u=u.next=h,a|=f;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(f=s).next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}if(null===u&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null!==(t=i.shared.interleaved)){i=t;do{a|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);ql|=a,e.lanes=a,e.memoizedState=d}}function jo(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var i=e[t],o=i.callback;if(null!==o){if(i.callback=null,i=r,"function"!=typeof o)throw Error(n(191,o));o.call(i)}}}var $o={},Bo=xi($o),Vo=xi($o),Ho=xi($o);function Uo(e){if(e===$o)throw Error(n(174));return e}function Wo(e,t){switch(Mi(Ho,t),Mi(Vo,e),Mi(Bo,$o),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:oe(null,"");break;default:t=oe(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Si(Bo),Mi(Bo,t)}function Yo(){Si(Bo),Si(Vo),Si(Ho)}function Ko(e){Uo(Ho.current);var t=Uo(Bo.current),n=oe(t,e.type);t!==n&&(Mi(Vo,e),Mi(Bo,n))}function Go(e){Vo.current===e&&(Si(Bo),Si(Vo))}var Xo=xi(0);function Jo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Zo=[];function Qo(){for(var e=0;e<Zo.length;e++)Zo[e]._workInProgressVersionPrimary=null;Zo.length=0}var ea=y.ReactCurrentDispatcher,ta=y.ReactCurrentBatchConfig,na=0,ra=null,ia=null,oa=null,aa=!1,sa=!1,la=0,ca=0;function ua(){throw Error(n(321))}function da(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!rr(e[n],t[n]))return!1;return!0}function fa(e,t,r,i,o,a){if(na=a,ra=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ea.current=null===e||null===e.memoizedState?Ga:Xa,e=r(i,o),sa){a=0;do{if(sa=!1,la=0,25<=a)throw Error(n(301));a+=1,oa=ia=null,t.updateQueue=null,ea.current=Ja,e=r(i,o)}while(sa)}if(ea.current=Ka,t=null!==ia&&null!==ia.next,na=0,oa=ia=ra=null,aa=!1,t)throw Error(n(300));return e}function ha(){var e=0!==la;return la=0,e}function pa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===oa?ra.memoizedState=oa=e:oa=oa.next=e,oa}function ma(){if(null===ia){var e=ra.alternate;e=null!==e?e.memoizedState:null}else e=ia.next;var t=null===oa?ra.memoizedState:oa.next;if(null!==t)oa=t,ia=e;else{if(null===e)throw Error(n(310));e={memoizedState:(ia=e).memoizedState,baseState:ia.baseState,baseQueue:ia.baseQueue,queue:ia.queue,next:null},null===oa?ra.memoizedState=oa=e:oa=oa.next=e}return oa}function ga(e,t){return"function"==typeof t?t(e):t}function ya(e){var t=ma(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var i=ia,o=i.baseQueue,a=r.pending;if(null!==a){if(null!==o){var s=o.next;o.next=a.next,a.next=s}i.baseQueue=o=a,r.pending=null}if(null!==o){a=o.next,i=i.baseState;var l=s=null,c=null,u=a;do{var d=u.lane;if((na&d)===d)null!==c&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),i=u.hasEagerState?u.eagerState:e(i,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};null===c?(l=c=f,s=i):c=c.next=f,ra.lanes|=d,ql|=d}u=u.next}while(null!==u&&u!==a);null===c?s=i:c.next=l,rr(i,t.memoizedState)||(ms=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=c,r.lastRenderedState=i}if(null!==(e=r.interleaved)){o=e;do{a=o.lane,ra.lanes|=a,ql|=a,o=o.next}while(o!==e)}else null===o&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function va(e){var t=ma(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var i=r.dispatch,o=r.pending,a=t.memoizedState;if(null!==o){r.pending=null;var s=o=o.next;do{a=e(a,s.action),s=s.next}while(s!==o);rr(a,t.memoizedState)||(ms=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,i]}function ba(){}function xa(e,t){var r=ra,i=ma(),o=t(),a=!rr(i.memoizedState,o);if(a&&(i.memoizedState=o,ms=!0),i=i.queue,qa(wa.bind(null,r,i,e),[e]),i.getSnapshot!==t||a||null!==oa&&1&oa.memoizedState.tag){if(r.flags|=2048,Aa(9,Ma.bind(null,r,i,o,t),void 0,null),null===kl)throw Error(n(349));30&na||Sa(r,t,o)}return o}function Sa(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ra.updateQueue)?(t={lastEffect:null,stores:null},ra.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ma(e,t,n,r){t.value=n,t.getSnapshot=r,Ea(t)&&ka(e)}function wa(e,t,n){return n(function(){Ea(t)&&ka(e)})}function Ea(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rr(e,n)}catch(e){return!0}}function ka(e){var t=To(e,1);null!==t&&Zl(t,e,1,-1)}function Ca(e){var t=pa();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:e},t.queue=e,e=e.dispatch=Ha.bind(null,ra,e),[t.memoizedState,e]}function Aa(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ra.updateQueue)?(t={lastEffect:null,stores:null},ra.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Oa(){return ma().memoizedState}function Na(e,t,n,r){var i=pa();ra.flags|=e,i.memoizedState=Aa(1|t,n,void 0,void 0===r?null:r)}function Da(e,t,n,r){var i=ma();r=void 0===r?null:r;var o=void 0;if(null!==ia){var a=ia.memoizedState;if(o=a.destroy,null!==r&&da(r,a.deps))return void(i.memoizedState=Aa(t,n,o,r))}ra.flags|=e,i.memoizedState=Aa(1|t,n,o,r)}function Ta(e,t){return Na(8390656,8,e,t)}function qa(e,t){return Da(2048,8,e,t)}function Ia(e,t){return Da(4,2,e,t)}function Ra(e,t){return Da(4,4,e,t)}function La(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function _a(e,t,n){return n=null!=n?n.concat([e]):null,Da(4,4,La.bind(null,t,e),n)}function Pa(){}function za(e,t){var n=ma();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&da(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Fa(e,t){var n=ma();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&da(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ja(e,t,n){return 21&na?(rr(n,t)||(n=dt(),ra.lanes|=n,ql|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ms=!0),e.memoizedState=n)}function $a(e,t){var n=mt;mt=0!==n&&4>n?n:4,e(!0);var r=ta.transition;ta.transition={};try{e(!1),t()}finally{mt=n,ta.transition=r}}function Ba(){return ma().memoizedState}function Va(e,t,n){var r=Jl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ua(e))Wa(t,n);else if(null!==(n=Do(e,t,n,r))){Zl(n,e,r,Xl()),Ya(n,t,r)}}function Ha(e,t,n){var r=Jl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ua(e))Wa(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,rr(s,a)){var l=t.interleaved;return null===l?(i.next=i,No(t)):(i.next=l.next,l.next=i),void(t.interleaved=i)}}catch(e){}null!==(n=Do(e,t,i,r))&&(Zl(n,e,r,i=Xl()),Ya(n,t,r))}}function Ua(e){var t=e.alternate;return e===ra||null!==t&&t===ra}function Wa(e,t){sa=aa=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ya(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,pt(e,n)}}var Ka={readContext:Ao,useCallback:ua,useContext:ua,useEffect:ua,useImperativeHandle:ua,useInsertionEffect:ua,useLayoutEffect:ua,useMemo:ua,useReducer:ua,useRef:ua,useState:ua,useDebugValue:ua,useDeferredValue:ua,useTransition:ua,useMutableSource:ua,useSyncExternalStore:ua,useId:ua,unstable_isNewReconciler:!1},Ga={readContext:Ao,useCallback:function(e,t){return pa().memoizedState=[e,void 0===t?null:t],e},useContext:Ao,useEffect:Ta,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Na(4194308,4,La.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Na(4194308,4,e,t)},useInsertionEffect:function(e,t){return Na(4,2,e,t)},useMemo:function(e,t){var n=pa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=pa();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Va.bind(null,ra,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},pa().memoizedState=e},useState:Ca,useDebugValue:Pa,useDeferredValue:function(e){return pa().memoizedState=e},useTransition:function(){var e=Ca(!1),t=e[0];return e=$a.bind(null,e[1]),pa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=ra,o=pa();if(eo){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===kl)throw Error(n(349));30&na||Sa(i,t,r)}o.memoizedState=r;var a={value:r,getSnapshot:t};return o.queue=a,Ta(wa.bind(null,i,a,e),[e]),i.flags|=2048,Aa(9,Ma.bind(null,i,a,r,t),void 0,null),r},useId:function(){var e=pa(),t=kl.identifierPrefix;if(eo){var n=Yi;t=":"+t+"R"+(n=(Wi&~(1<<32-nt(Wi)-1)).toString(32)+n),0<(n=la++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ca++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Xa={readContext:Ao,useCallback:za,useContext:Ao,useEffect:qa,useImperativeHandle:_a,useInsertionEffect:Ia,useLayoutEffect:Ra,useMemo:Fa,useReducer:ya,useRef:Oa,useState:function(){return ya(ga)},useDebugValue:Pa,useDeferredValue:function(e){return ja(ma(),ia.memoizedState,e)},useTransition:function(){return[ya(ga)[0],ma().memoizedState]},useMutableSource:ba,useSyncExternalStore:xa,useId:Ba,unstable_isNewReconciler:!1},Ja={readContext:Ao,useCallback:za,useContext:Ao,useEffect:qa,useImperativeHandle:_a,useInsertionEffect:Ia,useLayoutEffect:Ra,useMemo:Fa,useReducer:va,useRef:Oa,useState:function(){return va(ga)},useDebugValue:Pa,useDeferredValue:function(e){var t=ma();return null===ia?t.memoizedState=e:ja(t,ia.memoizedState,e)},useTransition:function(){return[va(ga)[0],ma().memoizedState]},useMutableSource:ba,useSyncExternalStore:xa,useId:Ba,unstable_isNewReconciler:!1};function Za(e,t){if(e&&e.defaultProps){for(var n in t=R({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}function Qa(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:R({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var es={isMounted:function(e){return!!(e=e._reactInternals)&&ze(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xl(),i=Jl(e),o=Lo(r,i);o.payload=t,null!=n&&(o.callback=n),null!==(t=_o(e,o,i))&&(Zl(t,e,i,r),Po(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xl(),i=Jl(e),o=Lo(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),null!==(t=_o(e,o,i))&&(Zl(t,e,i,r),Po(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xl(),r=Jl(e),i=Lo(n,r);i.tag=2,null!=t&&(i.callback=t),null!==(t=_o(e,i,r))&&(Zl(t,e,r,n),Po(t,e,r))}};function ts(e,t,n,r,i,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!ir(n,r)||!ir(i,o))}function ns(e,t,n){var r=!1,i=wi,o=t.contextType;return"object"==typeof o&&null!==o?o=Ao(o):(i=Oi(t)?Ci:Ei.current,o=(r=null!=(r=t.contextTypes))?Ai(e,i):wi),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=es,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function rs(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&es.enqueueReplaceState(t,t.state,null)}function is(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Io(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=Ao(o):(o=Oi(t)?Ci:Ei.current,i.context=Ai(e,o)),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(Qa(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&es.enqueueReplaceState(i,i.state,null),Fo(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4194308)}function os(e,t){try{var n="",r=t;do{n+=z(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i,digest:null}}function as(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ss(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var ls="function"==typeof WeakMap?WeakMap:Map;function cs(e,t,n){(n=Lo(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){jl||(jl=!0,$l=r),ss(0,t)},n}function us(e,t,n){(n=Lo(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ss(0,t)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){ss(0,t),"function"!=typeof r&&(null===Bl?Bl=new Set([this]):Bl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ds(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ls;var i=new Set;r.set(t,i)}else void 0===(i=r.get(t))&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Sc.bind(null,e,t,n),t.then(e,e))}function fs(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function hs(e,t,n,r,i){return 1&e.mode?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Lo(-1,1)).tag=2,_o(n,t,1))),n.lanes|=1),e)}var ps=y.ReactCurrentOwner,ms=!1;function gs(e,t,n,r){t.child=null===e?vo(t,null,n,r):yo(t,e.child,n,r)}function ys(e,t,n,r,i){n=n.render;var o=t.ref;return Co(t,i),r=fa(e,t,n,r,o,i),n=ha(),null===e||ms?(eo&&n&&Xi(t),t.flags|=1,gs(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,js(e,t,i))}function vs(e,t,n,r,i){if(null===e){var o=n.type;return"function"!=typeof o||Oc(o)||void 0!==o.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Dc(n.type,null,r,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,bs(e,t,o,r,i))}if(o=e.child,0===(e.lanes&i)){var a=o.memoizedProps;if((n=null!==(n=n.compare)?n:ir)(a,r)&&e.ref===t.ref)return js(e,t,i)}return t.flags|=1,(e=Nc(o,r)).ref=t.ref,e.return=t,t.child=e}function bs(e,t,n,r,i){if(null!==e){var o=e.memoizedProps;if(ir(o,r)&&e.ref===t.ref){if(ms=!1,t.pendingProps=r=o,0===(e.lanes&i))return t.lanes=e.lanes,js(e,t,i);131072&e.flags&&(ms=!0)}}return Ms(e,t,n,r,i)}function xs(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Mi(Nl,Ol),Ol|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==o?o.baseLanes:n,Mi(Nl,Ol),Ol|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Mi(Nl,Ol),Ol|=n;else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Mi(Nl,Ol),Ol|=r;return gs(e,t,i,n),t.child}function Ss(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ms(e,t,n,r,i){var o=Oi(n)?Ci:Ei.current;return o=Ai(t,o),Co(t,i),n=fa(e,t,n,r,o,i),r=ha(),null===e||ms?(eo&&r&&Xi(t),t.flags|=1,gs(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,js(e,t,i))}function ws(e,t,n,r,i){if(Oi(n)){var o=!0;qi(t)}else o=!1;if(Co(t,i),null===t.stateNode)Fs(e,t),ns(t,n,r),is(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Ao(c):c=Ai(t,c=Oi(n)?Ci:Ei.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&rs(t,a,r,c),qo=!1;var f=t.memoizedState;a.state=f,Fo(t,r,a,i),l=t.memoizedState,s!==r||f!==l||ki.current||qo?("function"==typeof u&&(Qa(t,n,u,r),l=t.memoizedState),(s=qo||ts(t,n,s,r,f,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ro(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:Za(t.type,s),a.props=c,d=t.pendingProps,f=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=Ao(l):l=Ai(t,l=Oi(n)?Ci:Ei.current);var h=n.getDerivedStateFromProps;(u="function"==typeof h||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||f!==l)&&rs(t,a,r,l),qo=!1,f=t.memoizedState,a.state=f,Fo(t,r,a,i);var p=t.memoizedState;s!==d||f!==p||ki.current||qo?("function"==typeof h&&(Qa(t,n,h,r),p=t.memoizedState),(c=qo||ts(t,n,c,r,f,p,l)||!1)?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Es(e,t,n,r,o,i)}function Es(e,t,n,r,i,o){Ss(e,t);var a=!!(128&t.flags);if(!r&&!a)return i&&Ii(t,n,!1),js(e,t,o);r=t.stateNode,ps.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=yo(t,e.child,null,o),t.child=yo(t,null,s,o)):gs(e,t,s,o),t.memoizedState=r.state,i&&Ii(t,n,!0),t.child}function ks(e){var t=e.stateNode;t.pendingContext?Di(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Di(0,t.context,!1),Wo(e,t.containerInfo)}function Cs(e,t,n,r,i){return co(),uo(i),t.flags|=256,gs(e,t,n,r),t.child}var As,Os,Ns,Ds,Ts={dehydrated:null,treeContext:null,retryLane:0};function qs(e){return{baseLanes:e,cachePool:null,transitions:null}}function Is(e,t,r){var i,o=t.pendingProps,a=Xo.current,s=!1,l=!!(128&t.flags);if((i=l)||(i=(null===e||null!==e.memoizedState)&&!!(2&a)),i?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Mi(Xo,1&a),null===e)return oo(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=o.children,e=o.fallback,s?(o=t.mode,s=t.child,l={mode:"hidden",children:l},1&o||null===s?s=qc(l,o,0,null):(s.childLanes=0,s.pendingProps=l),e=Tc(e,o,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=qs(r),t.memoizedState=Ts,e):Rs(t,l));if(null!==(a=e.memoizedState)&&null!==(i=a.dehydrated))return function(e,t,r,i,o,a,s){if(r)return 256&t.flags?(t.flags&=-257,Ls(e,t,s,i=as(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=i.fallback,o=t.mode,i=qc({mode:"visible",children:i.children},o,0,null),(a=Tc(a,o,s,null)).flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,1&t.mode&&yo(t,e.child,null,s),t.child.memoizedState=qs(s),t.memoizedState=Ts,a);if(!(1&t.mode))return Ls(e,t,s,null);if("$!"===o.data){if(i=o.nextSibling&&o.nextSibling.dataset)var l=i.dgst;return i=l,Ls(e,t,s,i=as(a=Error(n(419)),i,void 0))}if(l=0!==(s&e.childLanes),ms||l){if(null!==(i=kl)){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}0!==(o=0!==(o&(i.suspendedLanes|s))?0:o)&&o!==a.retryLane&&(a.retryLane=o,To(e,o),Zl(i,e,o,-1))}return dc(),Ls(e,t,s,i=as(Error(n(421))))}return"$?"===o.data?(t.flags|=128,t.child=e.child,t=wc.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,Qi=oi(o.nextSibling),Zi=t,eo=!0,to=null,null!==e&&(Vi[Hi++]=Wi,Vi[Hi++]=Yi,Vi[Hi++]=Ui,Wi=e.id,Yi=e.overflow,Ui=t),t=Rs(t,i.children),t.flags|=4096,t)}(e,t,l,o,i,a,r);if(s){s=o.fallback,l=t.mode,i=(a=e.child).sibling;var c={mode:"hidden",children:o.children};return 1&l||t.child===a?(o=Nc(a,c)).subtreeFlags=14680064&a.subtreeFlags:((o=t.child).childLanes=0,o.pendingProps=c,t.deletions=null),null!==i?s=Nc(i,s):(s=Tc(s,l,r,null)).flags|=2,s.return=t,o.return=t,o.sibling=s,t.child=o,o=s,s=t.child,l=null===(l=e.child.memoizedState)?qs(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~r,t.memoizedState=Ts,o}return e=(s=e.child).sibling,o=Nc(s,{mode:"visible",children:o.children}),!(1&t.mode)&&(o.lanes=r),o.return=t,o.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=o,t.memoizedState=null,o}function Rs(e,t){return(t=qc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Ls(e,t,n,r){return null!==r&&uo(r),yo(t,e.child,null,n),(e=Rs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function _s(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),ko(e.return,t,n)}function Ps(e,t,n,r,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function zs(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(gs(e,t,r.children,n),2&(r=Xo.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&_s(e,n,t);else if(19===e.tag)_s(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Mi(Xo,r),1&t.mode)switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Jo(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ps(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Jo(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ps(t,!0,n,null,o);break;case"together":Ps(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Fs(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function js(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),ql|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Nc(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Nc(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function $s(e,t){if(!eo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Bs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=14680064&i.subtreeFlags,r|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Vs(e,t,r){var o=t.pendingProps;switch(Ji(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Bs(t),null;case 1:case 17:return Oi(t.type)&&Ni(),Bs(t),null;case 3:return o=t.stateNode,Yo(),Si(ki),Si(Ei),Qo(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),null!==e&&null!==e.child||(so(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==to&&(nc(to),to=null))),Os(e,t),Bs(t),null;case 5:Go(t);var a=Uo(Ho.current);if(r=t.type,null!==e&&null!=t.stateNode)Ns(e,t,r,o,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(null===t.stateNode)throw Error(n(166));return Bs(t),null}if(e=Uo(Bo.current),so(t)){o=t.stateNode,r=t.type;var s=t.memoizedProps;switch(o[li]=t,o[ci]=s,e=!!(1&t.mode),r){case"dialog":Lr("cancel",o),Lr("close",o);break;case"iframe":case"object":case"embed":Lr("load",o);break;case"video":case"audio":for(a=0;a<Tr.length;a++)Lr(Tr[a],o);break;case"source":Lr("error",o);break;case"img":case"image":case"link":Lr("error",o),Lr("load",o);break;case"details":Lr("toggle",o);break;case"input":Y(o,s),Lr("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!s.multiple},Lr("invalid",o);break;case"textarea":te(o,s),Lr("invalid",o)}for(var l in pe(r,s),a=null,s)if(s.hasOwnProperty(l)){var c=s[l];"children"===l?"string"==typeof c?o.textContent!==c&&(!0!==s.suppressHydrationWarning&&Kr(o.textContent,c,e),a=["children",c]):"number"==typeof c&&o.textContent!==""+c&&(!0!==s.suppressHydrationWarning&&Kr(o.textContent,c,e),a=["children",""+c]):i.hasOwnProperty(l)&&null!=c&&"onScroll"===l&&Lr("scroll",o)}switch(r){case"input":V(o),X(o,s,!0);break;case"textarea":V(o),re(o);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(o.onclick=Gr)}o=a,t.updateQueue=o,null!==o&&(t.flags|=4)}else{l=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=ie(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof o.is?e=l.createElement(r,{is:o.is}):(e=l.createElement(r),"select"===r&&(l=e,o.multiple?l.multiple=!0:o.size&&(l.size=o.size))):e=l.createElementNS(e,r),e[li]=t,e[ci]=o,As(e,t,!1,!1),t.stateNode=e;e:{switch(l=me(r,o),r){case"dialog":Lr("cancel",e),Lr("close",e),a=o;break;case"iframe":case"object":case"embed":Lr("load",e),a=o;break;case"video":case"audio":for(a=0;a<Tr.length;a++)Lr(Tr[a],e);a=o;break;case"source":Lr("error",e),a=o;break;case"img":case"image":case"link":Lr("error",e),Lr("load",e),a=o;break;case"details":Lr("toggle",e),a=o;break;case"input":Y(e,o),a=W(e,o),Lr("invalid",e);break;case"option":default:a=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},a=R({},o,{value:void 0}),Lr("invalid",e);break;case"textarea":te(e,o),a=ee(e,o),Lr("invalid",e)}for(s in pe(r,a),c=a)if(c.hasOwnProperty(s)){var u=c[s];"style"===s?fe(e,u):"dangerouslySetInnerHTML"===s?null!=(u=u?u.__html:void 0)&&se(e,u):"children"===s?"string"==typeof u?("textarea"!==r||""!==u)&&le(e,u):"number"==typeof u&&le(e,""+u):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(i.hasOwnProperty(s)?null!=u&&"onScroll"===s&&Lr("scroll",e):null!=u&&g(e,s,u,l))}switch(r){case"input":V(e),X(e,o,!1);break;case"textarea":V(e),re(e);break;case"option":null!=o.value&&e.setAttribute("value",""+$(o.value));break;case"select":e.multiple=!!o.multiple,null!=(s=o.value)?Q(e,!!o.multiple,s,!1):null!=o.defaultValue&&Q(e,!!o.multiple,o.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Gr)}switch(r){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Bs(t),null;case 6:if(e&&null!=t.stateNode)Ds(e,t,e.memoizedProps,o);else{if("string"!=typeof o&&null===t.stateNode)throw Error(n(166));if(r=Uo(Ho.current),Uo(Bo.current),so(t)){if(o=t.stateNode,r=t.memoizedProps,o[li]=t,(s=o.nodeValue!==r)&&null!==(e=Zi))switch(e.tag){case 3:Kr(o.nodeValue,r,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Kr(o.nodeValue,r,!!(1&e.mode))}s&&(t.flags|=4)}else(o=(9===r.nodeType?r:r.ownerDocument).createTextNode(o))[li]=t,t.stateNode=o}return Bs(t),null;case 13:if(Si(Xo),o=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(eo&&null!==Qi&&1&t.mode&&!(128&t.flags))lo(),co(),t.flags|=98560,s=!1;else if(s=so(t),null!==o&&null!==o.dehydrated){if(null===e){if(!s)throw Error(n(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(n(317));s[li]=t}else co(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Bs(t),s=!1}else null!==to&&(nc(to),to=null),s=!0;if(!s)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=r,t):((o=null!==o)!==(null!==e&&null!==e.memoizedState)&&o&&(t.child.flags|=8192,1&t.mode&&(null===e||1&Xo.current?0===Dl&&(Dl=3):dc())),null!==t.updateQueue&&(t.flags|=4),Bs(t),null);case 4:return Yo(),Os(e,t),null===e&&zr(t.stateNode.containerInfo),Bs(t),null;case 10:return Eo(t.type._context),Bs(t),null;case 19:if(Si(Xo),null===(s=t.memoizedState))return Bs(t),null;if(o=!!(128&t.flags),null===(l=s.rendering))if(o)$s(s,!1);else{if(0!==Dl||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(l=Jo(e))){for(t.flags|=128,$s(s,!1),null!==(o=l.updateQueue)&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=r,r=t.child;null!==r;)e=o,(s=r).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Mi(Xo,1&Xo.current|2),t.child}e=e.sibling}null!==s.tail&&Ye()>zl&&(t.flags|=128,o=!0,$s(s,!1),t.lanes=4194304)}else{if(!o)if(null!==(e=Jo(l))){if(t.flags|=128,o=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),$s(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!eo)return Bs(t),null}else 2*Ye()-s.renderingStartTime>zl&&1073741824!==r&&(t.flags|=128,o=!0,$s(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(r=s.last)?r.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ye(),t.sibling=null,r=Xo.current,Mi(Xo,o?1&r|2:1&r),t):(Bs(t),null);case 22:case 23:return sc(),o=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==o&&(t.flags|=8192),o&&1&t.mode?!!(1073741824&Ol)&&(Bs(t),6&t.subtreeFlags&&(t.flags|=8192)):Bs(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function Hs(e,t){switch(Ji(t),t.tag){case 1:return Oi(t.type)&&Ni(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Yo(),Si(ki),Si(Ei),Qo(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return Go(t),null;case 13:if(Si(Xo),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));co()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Si(Xo),null;case 4:return Yo(),null;case 10:return Eo(t.type._context),null;case 22:case 23:return sc(),null;default:return null}}As=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Os=function(){},Ns=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Uo(Bo.current);var a,s=null;switch(n){case"input":o=W(e,o),r=W(e,r),s=[];break;case"select":o=R({},o,{value:void 0}),r=R({},r,{value:void 0}),s=[];break;case"textarea":o=ee(e,o),r=ee(e,r),s=[];break;default:"function"!=typeof o.onClick&&"function"==typeof r.onClick&&(e.onclick=Gr)}for(u in pe(n,r),n=null,o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&null!=o[u])if("style"===u){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==u&&"children"!==u&&"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(i.hasOwnProperty(u)?s||(s=[]):(s=s||[]).push(u,null));for(u in r){var c=r[u];if(l=null!=o?o[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(null!=c||null!=l))if("style"===u)if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(s||(s=[]),s.push(u,n)),n=c;else"dangerouslySetInnerHTML"===u?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(s=s||[]).push(u,c)):"children"===u?"string"!=typeof c&&"number"!=typeof c||(s=s||[]).push(u,""+c):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&(i.hasOwnProperty(u)?(null!=c&&"onScroll"===u&&Lr("scroll",e),s||l===c||(s=[])):(s=s||[]).push(u,c))}n&&(s=s||[]).push("style",n);var u=s;(t.updateQueue=u)&&(t.flags|=4)}},Ds=function(e,t,n,r){n!==r&&(t.flags|=4)};var Us=!1,Ws=!1,Ys="function"==typeof WeakSet?WeakSet:Set,Ks=null;function Gs(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){xc(e,t,n)}else n.current=null}function Xs(e,t,n){try{n()}catch(n){xc(e,t,n)}}var Js=!1;function Zs(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&Xs(t,n,o)}i=i.next}while(i!==r)}}function Qs(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function el(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function tl(e){var t=e.alternate;null!==t&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[li],delete t[ci],delete t[di],delete t[fi],delete t[hi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nl(e){return 5===e.tag||3===e.tag||4===e.tag}function rl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function il(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Gr));else if(4!==r&&null!==(e=e.child))for(il(e,t,n),e=e.sibling;null!==e;)il(e,t,n),e=e.sibling}function ol(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(ol(e,t,n),e=e.sibling;null!==e;)ol(e,t,n),e=e.sibling}var al=null,sl=!1;function ll(e,t,n){for(n=n.child;null!==n;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(tt&&"function"==typeof tt.onCommitFiberUnmount)try{tt.onCommitFiberUnmount(et,n)}catch(e){}switch(n.tag){case 5:Ws||Gs(n,t);case 6:var r=al,i=sl;al=null,ll(e,t,n),sl=i,null!==(al=r)&&(sl?(e=al,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):al.removeChild(n.stateNode));break;case 18:null!==al&&(sl?(e=al,n=n.stateNode,8===e.nodeType?ii(e.parentNode,n):1===e.nodeType&&ii(e,n),zt(e)):ii(al,n.stateNode));break;case 4:r=al,i=sl,al=n.stateNode.containerInfo,sl=!0,ll(e,t,n),al=r,sl=i;break;case 0:case 11:case 14:case 15:if(!Ws&&(null!==(r=n.updateQueue)&&null!==(r=r.lastEffect))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,void 0!==a&&(2&o||4&o)&&Xs(n,t,a),i=i.next}while(i!==r)}ll(e,t,n);break;case 1:if(!Ws&&(Gs(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){xc(n,t,e)}ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:1&n.mode?(Ws=(r=Ws)||null!==n.memoizedState,ll(e,t,n),Ws=r):ll(e,t,n);break;default:ll(e,t,n)}}function ul(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Ys),t.forEach(function(t){var r=Ec.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function dl(e,t){var r=t.deletions;if(null!==r)for(var i=0;i<r.length;i++){var o=r[i];try{var a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:al=l.stateNode,sl=!1;break e;case 3:case 4:al=l.stateNode.containerInfo,sl=!0;break e}l=l.return}if(null===al)throw Error(n(160));cl(a,s,o),al=null,sl=!1;var c=o.alternate;null!==c&&(c.return=null),o.return=null}catch(e){xc(o,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)fl(t,e),t=t.sibling}function fl(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dl(t,e),hl(e),4&i){try{Zs(3,e,e.return),Qs(3,e)}catch(t){xc(e,e.return,t)}try{Zs(5,e,e.return)}catch(t){xc(e,e.return,t)}}break;case 1:dl(t,e),hl(e),512&i&&null!==r&&Gs(r,r.return);break;case 5:if(dl(t,e),hl(e),512&i&&null!==r&&Gs(r,r.return),32&e.flags){var o=e.stateNode;try{le(o,"")}catch(t){xc(e,e.return,t)}}if(4&i&&null!=(o=e.stateNode)){var a=e.memoizedProps,s=null!==r?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===l&&"radio"===a.type&&null!=a.name&&K(o,a),me(l,s);var u=me(l,a);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];"style"===d?fe(o,f):"dangerouslySetInnerHTML"===d?se(o,f):"children"===d?le(o,f):g(o,d,f,u)}switch(l){case"input":G(o,a);break;case"textarea":ne(o,a);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var p=a.value;null!=p?Q(o,!!a.multiple,p,!1):h!==!!a.multiple&&(null!=a.defaultValue?Q(o,!!a.multiple,a.defaultValue,!0):Q(o,!!a.multiple,a.multiple?[]:"",!1))}o[ci]=a}catch(t){xc(e,e.return,t)}}break;case 6:if(dl(t,e),hl(e),4&i){if(null===e.stateNode)throw Error(n(162));o=e.stateNode,a=e.memoizedProps;try{o.nodeValue=a}catch(t){xc(e,e.return,t)}}break;case 3:if(dl(t,e),hl(e),4&i&&null!==r&&r.memoizedState.isDehydrated)try{zt(t.containerInfo)}catch(t){xc(e,e.return,t)}break;case 4:default:dl(t,e),hl(e);break;case 13:dl(t,e),hl(e),8192&(o=e.child).flags&&(a=null!==o.memoizedState,o.stateNode.isHidden=a,!a||null!==o.alternate&&null!==o.alternate.memoizedState||(Pl=Ye())),4&i&&ul(e);break;case 22:if(d=null!==r&&null!==r.memoizedState,1&e.mode?(Ws=(u=Ws)||d,dl(t,e),Ws=u):dl(t,e),hl(e),8192&i){if(u=null!==e.memoizedState,(e.stateNode.isHidden=u)&&!d&&1&e.mode)for(Ks=e,d=e.child;null!==d;){for(f=Ks=d;null!==Ks;){switch(p=(h=Ks).child,h.tag){case 0:case 11:case 14:case 15:Zs(4,h,h.return);break;case 1:Gs(h,h.return);var m=h.stateNode;if("function"==typeof m.componentWillUnmount){i=h,r=h.return;try{t=i,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(e){xc(i,r,e)}}break;case 5:Gs(h,h.return);break;case 22:if(null!==h.memoizedState){yl(f);continue}}null!==p?(p.return=h,Ks=p):yl(f)}d=d.sibling}e:for(d=null,f=e;;){if(5===f.tag){if(null===d){d=f;try{o=f.stateNode,u?"function"==typeof(a=o.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=f.stateNode,s=null!=(c=f.memoizedProps.style)&&c.hasOwnProperty("display")?c.display:null,l.style.display=de("display",s))}catch(t){xc(e,e.return,t)}}}else if(6===f.tag){if(null===d)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(t){xc(e,e.return,t)}}else if((22!==f.tag&&23!==f.tag||null===f.memoizedState||f===e)&&null!==f.child){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;null===f.sibling;){if(null===f.return||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:dl(t,e),hl(e),4&i&&ul(e);case 21:}}function hl(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(nl(r)){var i=r;break e}r=r.return}throw Error(n(160))}switch(i.tag){case 5:var o=i.stateNode;32&i.flags&&(le(o,""),i.flags&=-33),ol(e,rl(e),o);break;case 3:case 4:var a=i.stateNode.containerInfo;il(e,rl(e),a);break;default:throw Error(n(161))}}catch(t){xc(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function pl(e,t,n){Ks=e,ml(e)}function ml(e,t,n){for(var r=!!(1&e.mode);null!==Ks;){var i=Ks,o=i.child;if(22===i.tag&&r){var a=null!==i.memoizedState||Us;if(!a){var s=i.alternate,l=null!==s&&null!==s.memoizedState||Ws;s=Us;var c=Ws;if(Us=a,(Ws=l)&&!c)for(Ks=i;null!==Ks;)l=(a=Ks).child,22===a.tag&&null!==a.memoizedState?vl(i):null!==l?(l.return=a,Ks=l):vl(i);for(;null!==o;)Ks=o,ml(o),o=o.sibling;Ks=i,Us=s,Ws=c}gl(e)}else 8772&i.subtreeFlags&&null!==o?(o.return=i,Ks=o):gl(e)}}function gl(e){for(;null!==Ks;){var t=Ks;if(8772&t.flags){var r=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:Ws||Qs(5,t);break;case 1:var i=t.stateNode;if(4&t.flags&&!Ws)if(null===r)i.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:Za(t.type,r.memoizedProps);i.componentDidUpdate(o,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&jo(t,a,i);break;case 3:var s=t.updateQueue;if(null!==s){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}jo(t,s,r)}break;case 5:var l=t.stateNode;if(null===r&&4&t.flags){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var u=t.alternate;if(null!==u){var d=u.memoizedState;if(null!==d){var f=d.dehydrated;null!==f&&zt(f)}}}break;default:throw Error(n(163))}Ws||512&t.flags&&el(t)}catch(e){xc(t,t.return,e)}}if(t===e){Ks=null;break}if(null!==(r=t.sibling)){r.return=t.return,Ks=r;break}Ks=t.return}}function yl(e){for(;null!==Ks;){var t=Ks;if(t===e){Ks=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Ks=n;break}Ks=t.return}}function vl(e){for(;null!==Ks;){var t=Ks;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Qs(4,t)}catch(e){xc(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var i=t.return;try{r.componentDidMount()}catch(e){xc(t,i,e)}}var o=t.return;try{el(t)}catch(e){xc(t,o,e)}break;case 5:var a=t.return;try{el(t)}catch(e){xc(t,a,e)}}}catch(e){xc(t,t.return,e)}if(t===e){Ks=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Ks=s;break}Ks=t.return}}var bl,xl=Math.ceil,Sl=y.ReactCurrentDispatcher,Ml=y.ReactCurrentOwner,wl=y.ReactCurrentBatchConfig,El=0,kl=null,Cl=null,Al=0,Ol=0,Nl=xi(0),Dl=0,Tl=null,ql=0,Il=0,Rl=0,Ll=null,_l=null,Pl=0,zl=1/0,Fl=null,jl=!1,$l=null,Bl=null,Vl=!1,Hl=null,Ul=0,Wl=0,Yl=null,Kl=-1,Gl=0;function Xl(){return 6&El?Ye():-1!==Kl?Kl:Kl=Ye()}function Jl(e){return 1&e.mode?2&El&&0!==Al?Al&-Al:null!==fo.transition?(0===Gl&&(Gl=dt()),Gl):0!==(e=mt)?e:e=void 0===(e=window.event)?16:Wt(e.type):1}function Zl(e,t,r,i){if(50<Wl)throw Wl=0,Yl=null,Error(n(185));ht(e,r,i),2&El&&e===kl||(e===kl&&(!(2&El)&&(Il|=r),4===Dl&&rc(e,Al)),Ql(e,i),1===r&&0===El&&!(1&t.mode)&&(zl=Ye()+500,Li&&zi()))}function Ql(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-nt(o),s=1<<a,l=i[a];-1===l?0!==(s&n)&&0===(s&r)||(i[a]=ct(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}(e,t);var r=lt(e,e===kl?Al:0);if(0===r)null!==n&&He(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&He(n),1===t)0===e.tag?function(e){Li=!0,Pi(e)}(ic.bind(null,e)):Pi(ic.bind(null,e)),ni(function(){!(6&El)&&zi()}),n=null;else{switch(gt(r)){case 1:n=Ge;break;case 4:n=Xe;break;case 16:default:n=Je;break;case 536870912:n=Qe}n=kc(n,ec.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ec(e,t){if(Kl=-1,Gl=0,6&El)throw Error(n(327));var r=e.callbackNode;if(vc()&&e.callbackNode!==r)return null;var i=lt(e,e===kl?Al:0);if(0===i)return null;if(30&i||0!==(i&e.expiredLanes)||t)t=fc(e,i);else{t=i;var o=El;El|=2;var a=uc();for(kl===e&&Al===t||(Fl=null,zl=Ye()+500,lc(e,t));;)try{pc();break}catch(t){cc(e,t)}wo(),Sl.current=a,El=o,null!==Cl?t=0:(kl=null,Al=0,t=Dl)}if(0!==t){if(2===t&&(0!==(o=ut(e))&&(i=o,t=tc(e,o))),1===t)throw r=Tl,lc(e,0),rc(e,i),Ql(e,Ye()),r;if(6===t)rc(e,i);else{if(o=e.current.alternate,!(30&i||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!rr(o(),i))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(o)||(t=fc(e,i),2===t&&(a=ut(e),0!==a&&(i=a,t=tc(e,a))),1!==t)))throw r=Tl,lc(e,0),rc(e,i),Ql(e,Ye()),r;switch(e.finishedWork=o,e.finishedLanes=i,t){case 0:case 1:throw Error(n(345));case 2:case 5:yc(e,_l,Fl);break;case 3:if(rc(e,i),(130023424&i)===i&&10<(t=Pl+500-Ye())){if(0!==lt(e,0))break;if(((o=e.suspendedLanes)&i)!==i){Xl(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Qr(yc.bind(null,e,_l,Fl),t);break}yc(e,_l,Fl);break;case 4:if(rc(e,i),(4194240&i)===i)break;for(t=e.eventTimes,o=-1;0<i;){var s=31-nt(i);a=1<<s,(s=t[s])>o&&(o=s),i&=~a}if(i=o,10<(i=(120>(i=Ye()-i)?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*xl(i/1960))-i)){e.timeoutHandle=Qr(yc.bind(null,e,_l,Fl),i);break}yc(e,_l,Fl);break;default:throw Error(n(329))}}}return Ql(e,Ye()),e.callbackNode===r?ec.bind(null,e):null}function tc(e,t){var n=Ll;return e.current.memoizedState.isDehydrated&&(lc(e,t).flags|=256),2!==(e=fc(e,t))&&(t=_l,_l=n,null!==t&&nc(t)),e}function nc(e){null===_l?_l=e:_l.push.apply(_l,e)}function rc(e,t){for(t&=~Rl,t&=~Il,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-nt(t),r=1<<n;e[n]=-1,t&=~r}}function ic(e){if(6&El)throw Error(n(327));vc();var t=lt(e,0);if(!(1&t))return Ql(e,Ye()),null;var r=fc(e,t);if(0!==e.tag&&2===r){var i=ut(e);0!==i&&(t=i,r=tc(e,i))}if(1===r)throw r=Tl,lc(e,0),rc(e,t),Ql(e,Ye()),r;if(6===r)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,yc(e,_l,Fl),Ql(e,Ye()),null}function oc(e,t){var n=El;El|=1;try{return e(t)}finally{0===(El=n)&&(zl=Ye()+500,Li&&zi())}}function ac(e){null!==Hl&&0===Hl.tag&&!(6&El)&&vc();var t=El;El|=1;var n=wl.transition,r=mt;try{if(wl.transition=null,mt=1,e)return e()}finally{mt=r,wl.transition=n,!(6&(El=t))&&zi()}}function sc(){Ol=Nl.current,Si(Nl)}function lc(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ei(n)),null!==Cl)for(n=Cl.return;null!==n;){var r=n;switch(Ji(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Ni();break;case 3:Yo(),Si(ki),Si(Ei),Qo();break;case 5:Go(r);break;case 4:Yo();break;case 13:case 19:Si(Xo);break;case 10:Eo(r.type._context);break;case 22:case 23:sc()}n=n.return}if(kl=e,Cl=e=Nc(e.current,null),Al=Ol=t,Dl=0,Tl=null,Rl=Il=ql=0,_l=Ll=null,null!==Oo){for(t=0;t<Oo.length;t++)if(null!==(r=(n=Oo[t]).interleaved)){n.interleaved=null;var i=r.next,o=n.pending;if(null!==o){var a=o.next;o.next=i,r.next=a}n.pending=r}Oo=null}return e}function cc(e,t){for(;;){var r=Cl;try{if(wo(),ea.current=Ka,aa){for(var i=ra.memoizedState;null!==i;){var o=i.queue;null!==o&&(o.pending=null),i=i.next}aa=!1}if(na=0,oa=ia=ra=null,sa=!1,la=0,Ml.current=null,null===r||null===r.return){Dl=1,Tl=t,Cl=null;break}e:{var a=e,s=r.return,l=r,c=t;if(t=Al,l.flags|=32768,null!==c&&"object"==typeof c&&"function"==typeof c.then){var u=c,d=l,f=d.tag;if(!(1&d.mode||0!==f&&11!==f&&15!==f)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=fs(s);if(null!==p){p.flags&=-257,hs(p,s,l,0,t),1&p.mode&&ds(a,u,t),c=u;var m=(t=p).updateQueue;if(null===m){var g=new Set;g.add(c),t.updateQueue=g}else m.add(c);break e}if(!(1&t)){ds(a,u,t),dc();break e}c=Error(n(426))}else if(eo&&1&l.mode){var y=fs(s);if(null!==y){!(65536&y.flags)&&(y.flags|=256),hs(y,s,l,0,t),uo(os(c,l));break e}}a=c=os(c,l),4!==Dl&&(Dl=2),null===Ll?Ll=[a]:Ll.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,zo(a,cs(0,c,t));break e;case 1:l=c;var v=a.type,b=a.stateNode;if(!(128&a.flags||"function"!=typeof v.getDerivedStateFromError&&(null===b||"function"!=typeof b.componentDidCatch||null!==Bl&&Bl.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t,zo(a,us(a,l,t));break e}}a=a.return}while(null!==a)}gc(r)}catch(e){t=e,Cl===r&&null!==r&&(Cl=r=r.return);continue}break}}function uc(){var e=Sl.current;return Sl.current=Ka,null===e?Ka:e}function dc(){0!==Dl&&3!==Dl&&2!==Dl||(Dl=4),null===kl||!(268435455&ql)&&!(268435455&Il)||rc(kl,Al)}function fc(e,t){var r=El;El|=2;var i=uc();for(kl===e&&Al===t||(Fl=null,lc(e,t));;)try{hc();break}catch(t){cc(e,t)}if(wo(),El=r,Sl.current=i,null!==Cl)throw Error(n(261));return kl=null,Al=0,Dl}function hc(){for(;null!==Cl;)mc(Cl)}function pc(){for(;null!==Cl&&!Ue();)mc(Cl)}function mc(e){var t=bl(e.alternate,e,Ol);e.memoizedProps=e.pendingProps,null===t?gc(e):Cl=t,Ml.current=null}function gc(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Hs(n,t)))return n.flags&=32767,void(Cl=n);if(null===e)return Dl=6,void(Cl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Vs(n,t,Ol)))return void(Cl=n);if(null!==(t=t.sibling))return void(Cl=t);Cl=t=e}while(null!==t);0===Dl&&(Dl=5)}function yc(e,t,r){var i=mt,o=wl.transition;try{wl.transition=null,mt=1,function(e,t,r,i){do{vc()}while(null!==Hl);if(6&El)throw Error(n(327));r=e.finishedWork;var o=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-nt(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}(e,a),e===kl&&(Cl=kl=null,Al=0),!(2064&r.subtreeFlags)&&!(2064&r.flags)||Vl||(Vl=!0,kc(Je,function(){return vc(),null})),a=!!(15990&r.flags),!!(15990&r.subtreeFlags)||a){a=wl.transition,wl.transition=null;var s=mt;mt=1;var l=El;El|=4,Ml.current=null,function(e,t){if(Xr=jt,cr(e=lr())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var i=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(i&&0!==i.rangeCount){r=i.anchorNode;var o=i.anchorOffset,a=i.focusNode;i=i.focusOffset;try{r.nodeType,a.nodeType}catch(e){r=null;break e}var s=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==r||0!==o&&3!==f.nodeType||(l=s+o),f!==a||0!==i&&3!==f.nodeType||(c=s+i),3===f.nodeType&&(s+=f.nodeValue.length),null!==(p=f.firstChild);)h=f,f=p;for(;;){if(f===e)break t;if(h===r&&++u===o&&(l=s),h===a&&++d===i&&(c=s),null!==(p=f.nextSibling))break;h=(f=h).parentNode}f=p}r=-1===l||-1===c?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Jr={focusedElem:e,selectionRange:r},jt=!1,Ks=t;null!==Ks;)if(e=(t=Ks).child,1028&t.subtreeFlags&&null!==e)e.return=t,Ks=e;else for(;null!==Ks;){t=Ks;try{var m=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==m){var g=m.memoizedProps,y=m.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Za(t.type,g),y);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;1===x.nodeType?x.textContent="":9===x.nodeType&&x.documentElement&&x.removeChild(x.documentElement);break;default:throw Error(n(163))}}catch(e){xc(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Ks=e;break}Ks=t.return}m=Js,Js=!1}(e,r),fl(r,e),ur(Jr),jt=!!Xr,Jr=Xr=null,e.current=r,pl(r),We(),El=l,mt=s,wl.transition=a}else e.current=r;if(Vl&&(Vl=!1,Hl=e,Ul=o),a=e.pendingLanes,0===a&&(Bl=null),function(e){if(tt&&"function"==typeof tt.onCommitFiberRoot)try{tt.onCommitFiberRoot(et,e,void 0,!(128&~e.current.flags))}catch(e){}}(r.stateNode),Ql(e,Ye()),null!==t)for(i=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],i(o.value,{componentStack:o.stack,digest:o.digest});if(jl)throw jl=!1,e=$l,$l=null,e;!!(1&Ul)&&0!==e.tag&&vc(),a=e.pendingLanes,1&a?e===Yl?Wl++:(Wl=0,Yl=e):Wl=0,zi()}(e,t,r,i)}finally{wl.transition=o,mt=i}return null}function vc(){if(null!==Hl){var e=gt(Ul),t=wl.transition,r=mt;try{if(wl.transition=null,mt=16>e?16:e,null===Hl)var i=!1;else{if(e=Hl,Hl=null,Ul=0,6&El)throw Error(n(331));var o=El;for(El|=4,Ks=e.current;null!==Ks;){var a=Ks,s=a.child;if(16&Ks.flags){var l=a.deletions;if(null!==l){for(var c=0;c<l.length;c++){var u=l[c];for(Ks=u;null!==Ks;){var d=Ks;switch(d.tag){case 0:case 11:case 15:Zs(8,d,a)}var f=d.child;if(null!==f)f.return=d,Ks=f;else for(;null!==Ks;){var h=(d=Ks).sibling,p=d.return;if(tl(d),d===u){Ks=null;break}if(null!==h){h.return=p,Ks=h;break}Ks=p}}}var m=a.alternate;if(null!==m){var g=m.child;if(null!==g){m.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(null!==g)}}Ks=a}}if(2064&a.subtreeFlags&&null!==s)s.return=a,Ks=s;else e:for(;null!==Ks;){if(2048&(a=Ks).flags)switch(a.tag){case 0:case 11:case 15:Zs(9,a,a.return)}var v=a.sibling;if(null!==v){v.return=a.return,Ks=v;break e}Ks=a.return}}var b=e.current;for(Ks=b;null!==Ks;){var x=(s=Ks).child;if(2064&s.subtreeFlags&&null!==x)x.return=s,Ks=x;else e:for(s=b;null!==Ks;){if(2048&(l=Ks).flags)try{switch(l.tag){case 0:case 11:case 15:Qs(9,l)}}catch(e){xc(l,l.return,e)}if(l===s){Ks=null;break e}var S=l.sibling;if(null!==S){S.return=l.return,Ks=S;break e}Ks=l.return}}if(El=o,zi(),tt&&"function"==typeof tt.onPostCommitFiberRoot)try{tt.onPostCommitFiberRoot(et,e)}catch(e){}i=!0}return i}finally{mt=r,wl.transition=t}}return!1}function bc(e,t,n){e=_o(e,t=cs(0,t=os(n,t),1),1),t=Xl(),null!==e&&(ht(e,1,t),Ql(e,t))}function xc(e,t,n){if(3===e.tag)bc(e,e,n);else for(;null!==t;){if(3===t.tag){bc(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Bl||!Bl.has(r))){t=_o(t,e=us(t,e=os(n,e),1),1),e=Xl(),null!==t&&(ht(t,1,e),Ql(t,e));break}}t=t.return}}function Sc(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Xl(),e.pingedLanes|=e.suspendedLanes&n,kl===e&&(Al&n)===n&&(4===Dl||3===Dl&&(130023424&Al)===Al&&500>Ye()-Pl?lc(e,0):Rl|=n),Ql(e,t)}function Mc(e,t){0===t&&(1&e.mode?(t=at,!(130023424&(at<<=1))&&(at=4194304)):t=1);var n=Xl();null!==(e=To(e,t))&&(ht(e,t,n),Ql(e,n))}function wc(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Mc(e,n)}function Ec(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,o=e.memoizedState;null!==o&&(r=o.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(n(314))}null!==i&&i.delete(t),Mc(e,r)}function kc(e,t){return Ve(e,t)}function Cc(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ac(e,t,n,r){return new Cc(e,t,n,r)}function Oc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Nc(e,t){var n=e.alternate;return null===n?((n=Ac(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Dc(e,t,r,i,o,a){var s=2;if(i=e,"function"==typeof e)Oc(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case x:return Tc(r.children,o,a,t);case S:s=8,o|=8;break;case M:return(e=Ac(12,r,t,2|o)).elementType=M,e.lanes=a,e;case C:return(e=Ac(13,r,t,o)).elementType=C,e.lanes=a,e;case A:return(e=Ac(19,r,t,o)).elementType=A,e.lanes=a,e;case D:return qc(r,o,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case w:s=10;break e;case E:s=9;break e;case k:s=11;break e;case O:s=14;break e;case N:s=16,i=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=Ac(s,r,t,o)).elementType=e,t.type=i,t.lanes=a,t}function Tc(e,t,n,r){return(e=Ac(7,e,r,t)).lanes=n,e}function qc(e,t,n,r){return(e=Ac(22,e,r,t)).elementType=D,e.lanes=n,e.stateNode={isHidden:!1},e}function Ic(e,t,n){return(e=Ac(6,e,null,t)).lanes=n,e}function Rc(e,t,n){return(t=Ac(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Lc(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ft(0),this.expirationTimes=ft(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function _c(e,t,n,r,i,o,a,s,l){return e=new Lc(e,t,n,s,l),1===t?(t=1,!0===o&&(t|=8)):t=0,o=Ac(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Io(o),e}function Pc(e){if(!e)return wi;e:{if(ze(e=e._reactInternals)!==e||1!==e.tag)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Oi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(n(171))}if(1===e.tag){var r=e.type;if(Oi(r))return Ti(e,r,t)}return t}function zc(e,t,n,r,i,o,a,s,l){return(e=_c(n,r,!0,e,0,o,0,s,l)).context=Pc(null),n=e.current,(o=Lo(r=Xl(),i=Jl(n))).callback=null!=t?t:null,_o(n,o,i),e.current.lanes=i,ht(e,i,r),Ql(e,r),e}function Fc(e,t,n,r){var i=t.current,o=Xl(),a=Jl(i);return n=Pc(n),null===t.context?t.context=n:t.pendingContext=n,(t=Lo(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=_o(i,t,a))&&(Zl(e,i,a,o),Po(e,i,a)),a}function jc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function $c(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Bc(e,t){$c(e,t),(e=e.alternate)&&$c(e,t)}bl=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||ki.current)ms=!0;else{if(0===(e.lanes&r)&&!(128&t.flags))return ms=!1,function(e,t,n){switch(t.tag){case 3:ks(t),co();break;case 5:Ko(t);break;case 1:Oi(t.type)&&qi(t);break;case 4:Wo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Mi(bo,r._currentValue),r._currentValue=i;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Mi(Xo,1&Xo.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Is(e,t,n):(Mi(Xo,1&Xo.current),null!==(e=js(e,t,n))?e.sibling:null);Mi(Xo,1&Xo.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return zs(e,t,n);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Mi(Xo,Xo.current),r)break;return null;case 22:case 23:return t.lanes=0,xs(e,t,n)}return js(e,t,n)}(e,t,r);ms=!!(131072&e.flags)}else ms=!1,eo&&1048576&t.flags&&Gi(t,Bi,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Fs(e,t),e=t.pendingProps;var o=Ai(t,Ei.current);Co(t,r),o=fa(null,t,i,e,o,r);var a=ha();return t.flags|=1,"object"==typeof o&&null!==o&&"function"==typeof o.render&&void 0===o.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Oi(i)?(a=!0,qi(t)):a=!1,t.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,Io(t),o.updater=es,t.stateNode=o,o._reactInternals=t,is(t,i,e,r),t=Es(null,t,i,!0,a,r)):(t.tag=0,eo&&a&&Xi(t),gs(null,t,o,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Fs(e,t),e=t.pendingProps,i=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"==typeof e)return Oc(e)?1:0;if(null!=e){if((e=e.$$typeof)===k)return 11;if(e===O)return 14}return 2}(i),e=Za(i,e),o){case 0:t=Ms(null,t,i,e,r);break e;case 1:t=ws(null,t,i,e,r);break e;case 11:t=ys(null,t,i,e,r);break e;case 14:t=vs(null,t,i,Za(i.type,e),r);break e}throw Error(n(306,i,""))}return t;case 0:return i=t.type,o=t.pendingProps,Ms(e,t,i,o=t.elementType===i?o:Za(i,o),r);case 1:return i=t.type,o=t.pendingProps,ws(e,t,i,o=t.elementType===i?o:Za(i,o),r);case 3:e:{if(ks(t),null===e)throw Error(n(387));i=t.pendingProps,o=(a=t.memoizedState).element,Ro(e,t),Fo(t,i,null,r);var s=t.memoizedState;if(i=s.element,a.isDehydrated){if(a={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Cs(e,t,i,r,o=os(Error(n(423)),t));break e}if(i!==o){t=Cs(e,t,i,r,o=os(Error(n(424)),t));break e}for(Qi=oi(t.stateNode.containerInfo.firstChild),Zi=t,eo=!0,to=null,r=vo(t,null,i,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(co(),i===o){t=js(e,t,r);break e}gs(e,t,i,r)}t=t.child}return t;case 5:return Ko(t),null===e&&oo(t),i=t.type,o=t.pendingProps,a=null!==e?e.memoizedProps:null,s=o.children,Zr(i,o)?s=null:null!==a&&Zr(i,a)&&(t.flags|=32),Ss(e,t),gs(e,t,s,r),t.child;case 6:return null===e&&oo(t),null;case 13:return Is(e,t,r);case 4:return Wo(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=yo(t,null,i,r):gs(e,t,i,r),t.child;case 11:return i=t.type,o=t.pendingProps,ys(e,t,i,o=t.elementType===i?o:Za(i,o),r);case 7:return gs(e,t,t.pendingProps,r),t.child;case 8:case 12:return gs(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,o=t.pendingProps,a=t.memoizedProps,s=o.value,Mi(bo,i._currentValue),i._currentValue=s,null!==a)if(rr(a.value,s)){if(a.children===o.children&&!ki.current){t=js(e,t,r);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var c=l.firstContext;null!==c;){if(c.context===i){if(1===a.tag){(c=Lo(-1,r&-r)).tag=2;var u=a.updateQueue;if(null!==u){var d=(u=u.shared).pending;null===d?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=r,null!==(c=a.alternate)&&(c.lanes|=r),ko(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(n(341));s.lanes|=r,null!==(l=s.alternate)&&(l.lanes|=r),ko(s,r,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}gs(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps.children,Co(t,r),i=i(o=Ao(o)),t.flags|=1,gs(e,t,i,r),t.child;case 14:return o=Za(i=t.type,t.pendingProps),vs(e,t,i,o=Za(i.type,o),r);case 15:return bs(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,o=t.pendingProps,o=t.elementType===i?o:Za(i,o),Fs(e,t),t.tag=1,Oi(i)?(e=!0,qi(t)):e=!1,Co(t,r),ns(t,i,o),is(t,i,o,r),Es(null,t,i,!0,e,r);case 19:return zs(e,t,r);case 22:return xs(e,t,r)}throw Error(n(156,t.tag))};var Vc="function"==typeof reportError?reportError:function(e){console.error(e)};function Hc(e){this._internalRoot=e}function Uc(e){this._internalRoot=e}function Wc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Yc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Kc(){}function Gc(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if("function"==typeof i){var s=i;i=function(){var e=jc(a);s.call(e)}}Fc(t,a,e,i)}else a=function(e,t,n,r,i){if(i){if("function"==typeof r){var o=r;r=function(){var e=jc(a);o.call(e)}}var a=zc(t,r,e,0,null,!1,0,"",Kc);return e._reactRootContainer=a,e[ui]=a.current,zr(8===e.nodeType?e.parentNode:e),ac(),a}for(;i=e.lastChild;)e.removeChild(i);if("function"==typeof r){var s=r;r=function(){var e=jc(l);s.call(e)}}var l=_c(e,0,!1,null,0,!1,0,"",Kc);return e._reactRootContainer=l,e[ui]=l.current,zr(8===e.nodeType?e.parentNode:e),ac(function(){Fc(t,l,n,r)}),l}(n,t,e,i,r);return jc(a)}Uc.prototype.render=Hc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(n(409));Fc(e,t,null,null)},Uc.prototype.unmount=Hc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;ac(function(){Fc(null,e,null,null)}),t[ui]=null}},Uc.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nt.length&&0!==t&&t<Nt[n].priority;n++);Nt.splice(n,0,e),0===n&&It(e)}},yt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=st(t.pendingLanes);0!==n&&(pt(t,1|n),Ql(t,Ye()),!(6&El)&&(zl=Ye()+500,zi()))}break;case 13:ac(function(){var t=To(e,1);if(null!==t){var n=Xl();Zl(t,e,1,n)}}),Bc(e,1)}},vt=function(e){if(13===e.tag){var t=To(e,134217728);if(null!==t)Zl(t,e,134217728,Xl());Bc(e,134217728)}},bt=function(e){if(13===e.tag){var t=Jl(e),n=To(e,t);if(null!==n)Zl(n,e,t,Xl());Bc(e,t)}},xt=function(){return mt},St=function(e,t){var n=mt;try{return mt=e,t()}finally{mt=n}},ve=function(e,t,r){switch(t){case"input":if(G(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var o=yi(i);if(!o)throw Error(n(90));H(i),G(i,o)}}}break;case"textarea":ne(e,r);break;case"select":null!=(t=r.value)&&Q(e,!!r.multiple,t,!1)}},Ee=oc,ke=ac;var Xc={usingClientEntryPoint:!1,Events:[mi,gi,yi,Me,we,oc]},Jc={findFiberByHostInstance:pi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Zc={bundleType:Jc.bundleType,version:Jc.version,rendererPackageName:Jc.rendererPackageName,rendererConfig:Jc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:y.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=$e(e))?null:e.stateNode},findFiberByHostInstance:Jc.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Qc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Qc.isDisabled&&Qc.supportsFiber)try{et=Qc.inject(Zc),tt=Qc}catch(e){}}return AB.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xc,AB.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Wc(t))throw Error(n(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:b,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,r)},AB.createRoot=function(e,t){if(!Wc(e))throw Error(n(299));var r=!1,i="",o=Vc;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(i=t.identifierPrefix),void 0!==t.onRecoverableError&&(o=t.onRecoverableError)),t=_c(e,1,!1,null,0,r,0,i,o),e[ui]=t.current,zr(8===e.nodeType?e.parentNode:e),new Hc(t)},AB.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(n(188));throw e=Object.keys(e).join(","),Error(n(268,e))}return e=null===(e=$e(t))?null:e.stateNode},AB.flushSync=function(e){return ac(e)},AB.hydrate=function(e,t,r){if(!Yc(t))throw Error(n(200));return Gc(null,e,t,!0,r)},AB.hydrateRoot=function(e,t,r){if(!Wc(e))throw Error(n(405));var i=null!=r&&r.hydratedSources||null,o=!1,a="",s=Vc;if(null!=r&&(!0===r.unstable_strictMode&&(o=!0),void 0!==r.identifierPrefix&&(a=r.identifierPrefix),void 0!==r.onRecoverableError&&(s=r.onRecoverableError)),t=zc(t,null,e,1,null!=r?r:null,o,0,a,s),e[ui]=t.current,zr(e),i)for(e=0;e<i.length;e++)o=(o=(r=i[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new Uc(t)},AB.render=function(e,t,r){if(!Yc(t))throw Error(n(200));return Gc(null,e,t,!1,r)},AB.unmountComponentAtNode=function(e){if(!Yc(e))throw Error(n(40));return!!e._reactRootContainer&&(ac(function(){Gc(null,null,e,!1,function(){e._reactRootContainer=null,e[ui]=null})}),!0)},AB.unstable_batchedUpdates=oc,AB.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Yc(r))throw Error(n(200));if(null==e||void 0===e._reactInternals)throw Error(n(38));return Gc(e,t,r,!1,i)},AB.version="18.3.1-next-f1338f8080-20240426",AB}var qB=(kB||(kB=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),CB.exports=TB()),CB.exports),IB=o(qB),RB=!1,LB=e_.createContext(null),_B="unmounted",PB="exited",zB="entering",FB="entered",jB="exiting",$B=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=PB,r.appearStatus=zB):i=FB:i=t.unmountOnExit||t.mountOnEnter?_B:PB,r.state={status:i},r.nextCallback=null,r}SB(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===_B?{status:PB}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==zB&&n!==FB&&(t=zB):n!==zB&&n!==FB||(t=jB)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===zB){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:IB.findDOMNode(this);n&&function(e){e.scrollTop}(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===PB&&this.setState({status:_B})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[IB.findDOMNode(this),r],o=i[0],a=i[1],s=this.getTimeouts(),l=r?s.appear:s.enter;!e&&!n||RB?this.safeSetState({status:FB},function(){t.props.onEntered(o)}):(this.props.onEnter(o,a),this.safeSetState({status:zB},function(){t.props.onEntering(o,a),t.onTransitionEnd(l,function(){t.safeSetState({status:FB},function(){t.props.onEntered(o,a)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:IB.findDOMNode(this);t&&!RB?(this.props.onExit(r),this.safeSetState({status:jB},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:PB},function(){e.props.onExited(r)})})})):this.safeSetState({status:PB},function(){e.props.onExited(r)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:IB.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],a=i[1];this.props.addEndListener(o,a)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===_B)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=j_(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return e_.createElement(LB.Provider,{value:null},"function"==typeof n?n(e,r):e_.cloneElement(e_.Children.only(n),r))},t}(e_.Component);function BB(){}function VB(e,t){var n=Object.create(null);return e&&QL.Children.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&QL.isValidElement(e)?t(e):e}(e)}),n}function HB(e,t,n){return null!=n[t]?n[t]:e.props[t]}function UB(e,t,n){var r=VB(e.children),i=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var l in t){if(i[l])for(r=0;r<i[l].length;r++){var c=i[l][r];s[i[l][r]]=n(c)}s[l]=n(l)}for(r=0;r<o.length;r++)s[o[r]]=n(o[r]);return s}(t,r);return Object.keys(i).forEach(function(o){var a=i[o];if(QL.isValidElement(a)){var s=o in t,l=o in r,c=t[o],u=QL.isValidElement(c)&&!c.props.in;!l||s&&!u?l||!s||u?l&&s&&QL.isValidElement(c)&&(i[o]=QL.cloneElement(a,{onExited:n.bind(null,a),in:c.props.in,exit:HB(a,"exit",e),enter:HB(a,"enter",e)})):i[o]=QL.cloneElement(a,{in:!1}):i[o]=QL.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:HB(a,"exit",e),enter:HB(a,"enter",e)})}}),i}$B.contextType=LB,$B.propTypes={},$B.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:BB,onEntering:BB,onEntered:BB,onExit:BB,onExiting:BB,onExited:BB},$B.UNMOUNTED=_B,$B.EXITED=PB,$B.ENTERING=zB,$B.ENTERED=FB,$B.EXITING=jB;var WB=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},YB=function(e){function t(t,n){var r,i=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}SB(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,i=t.children,o=t.handleExited;return{children:t.firstRender?(n=e,r=o,VB(n.children,function(e){return QL.cloneElement(e,{onExited:r.bind(null,e),in:!0,appear:HB(e,"appear",n),enter:HB(e,"enter",n),exit:HB(e,"exit",n)})})):UB(e,i,o),firstRender:!1}},n.handleExited=function(e,t){var n=VB(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=F_({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=j_(e,["component","childFactory"]),i=this.state.contextValue,o=WB(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?e_.createElement(LB.Provider,{value:i},o):e_.createElement(LB.Provider,{value:i},e_.createElement(t,r,o))},t}(e_.Component);YB.propTypes={},YB.defaultProps={component:"div",childFactory:function(e){return e}};const KB=e=>e.scrollTop;function GB(e,t){var n,r;const{timeout:i,easing:o,style:a={}}=e;return{duration:null!=(n=a.transitionDuration)?n:"number"==typeof i?i:i[t.mode]||0,easing:null!=(r=a.transitionTimingFunction)?r:"object"==typeof o?o[t.mode]:o,delay:a.transitionDelay}}function XB(e){return pj("MuiPaper",e)}mj("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const JB=["className","component","elevation","square","variant"],ZB=dB("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,"elevation"===n.variant&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return F_({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.divider}`},"elevation"===t.variant&&F_({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&"dark"===e.palette.mode&&{backgroundImage:`linear-gradient(${A$.alpha("#fff",pB(t.elevation))}, ${A$.alpha("#fff",pB(t.elevation))})`},e.vars&&{backgroundImage:null==(n=e.vars.overlays)?void 0:n[t.elevation]}))}),QB=QL.forwardRef(function(e,t){const n=mB({props:e,name:"MuiPaper"}),{className:r,component:i="div",elevation:o=1,square:a=!1,variant:s="elevation"}=n,l=j_(n,JB),c=F_({},n,{component:i,elevation:o,square:a,variant:s}),u=(e=>{const{square:t,elevation:n,variant:r,classes:i}=e;return Qj({root:["root",r,!t&&"rounded","elevation"===r&&`elevation${n}`]},XB,i)})(c);return Fz.jsx(ZB,F_({as:i,ownerState:c,className:fj(u.root,r),ref:t},l))});const eV=mj("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),tV=["center","classes","className"];let nV,rV,iV,oV,aV=e=>e;const sV=Az(nV||(nV=aV`
  0% {
    transform: scale(0);
    opacity: 0.1;
  }

  100% {
    transform: scale(1);
    opacity: 0.3;
  }
`)),lV=Az(rV||(rV=aV`
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
`)),cV=Az(iV||(iV=aV`
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(0.92);
  }

  100% {
    transform: scale(1);
  }
`)),uV=dB("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),dV=dB(function(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:c}=e,[u,d]=QL.useState(!1),f=fj(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),h={width:a,height:a,top:-a/2+o,left:-a/2+i},p=fj(n.child,u&&n.childLeaving,r&&n.childPulsate);return s||u||d(!0),QL.useEffect(()=>{if(!s&&null!=l){const e=setTimeout(l,c);return()=>{clearTimeout(e)}}},[l,s,c]),Fz.jsx("span",{className:f,style:h,children:Fz.jsx("span",{className:p})})},{name:"MuiTouchRipple",slot:"Ripple"})(oV||(oV=aV`
  opacity: 0;
  position: absolute;

  &.${0} {
    opacity: 0.3;
    transform: scale(1);
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }

  &.${0} {
    animation-duration: ${0}ms;
  }

  & .${0} {
    opacity: 1;
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: currentColor;
  }

  & .${0} {
    opacity: 0;
    animation-name: ${0};
    animation-duration: ${0}ms;
    animation-timing-function: ${0};
  }

  & .${0} {
    position: absolute;
    /* @noflip */
    left: 0px;
    top: 0;
    animation-name: ${0};
    animation-duration: 2500ms;
    animation-timing-function: ${0};
    animation-iteration-count: infinite;
    animation-delay: 200ms;
  }
`),eV.rippleVisible,sV,550,({theme:e})=>e.transitions.easing.easeInOut,eV.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,eV.child,eV.childLeaving,lV,550,({theme:e})=>e.transitions.easing.easeInOut,eV.childPulsate,cV,({theme:e})=>e.transitions.easing.easeInOut),fV=QL.forwardRef(function(e,t){const n=mB({props:e,name:"MuiTouchRipple"}),{center:r=!1,classes:i={},className:o}=n,a=j_(n,tV),[s,l]=QL.useState([]),c=QL.useRef(0),u=QL.useRef(null);QL.useEffect(()=>{u.current&&(u.current(),u.current=null)},[s]);const d=QL.useRef(!1),f=Vj(),h=QL.useRef(null),p=QL.useRef(null),m=QL.useCallback(e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:a}=e;l(e=>[...e,Fz.jsx(dV,{classes:{ripple:fj(i.ripple,eV.ripple),rippleVisible:fj(i.rippleVisible,eV.rippleVisible),ripplePulsate:fj(i.ripplePulsate,eV.ripplePulsate),child:fj(i.child,eV.child),childLeaving:fj(i.childLeaving,eV.childLeaving),childPulsate:fj(i.childPulsate,eV.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},c.current)]),c.current+=1,u.current=a},[i]),g=QL.useCallback((e={},t={},n=()=>{})=>{const{pulsate:i=!1,center:o=r||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&d.current)return void(d.current=!1);"touchstart"===(null==e?void 0:e.type)&&(d.current=!0);const s=a?null:p.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,g;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(n-l.top)}if(o)g=Math.sqrt((2*l.width**2+l.height**2)/3),g%2==0&&(g+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;g=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===h.current&&(h.current=()=>{m({pulsate:i,rippleX:c,rippleY:u,rippleSize:g,cb:n})},f.start(80,()=>{h.current&&(h.current(),h.current=null)})):m({pulsate:i,rippleX:c,rippleY:u,rippleSize:g,cb:n})},[r,m,f]),y=QL.useCallback(()=>{g({},{pulsate:!0})},[g]),v=QL.useCallback((e,t)=>{if(f.clear(),"touchend"===(null==e?void 0:e.type)&&h.current)return h.current(),h.current=null,void f.start(0,()=>{v(e,t)});h.current=null,l(e=>e.length>0?e.slice(1):e),u.current=t},[f]);return QL.useImperativeHandle(t,()=>({pulsate:y,start:g,stop:v}),[y,g,v]),Fz.jsx(uV,F_({className:fj(eV.root,i.root,o),ref:p},a,{children:Fz.jsx(YB,{component:null,exit:!0,children:s})}))});function hV(e){return pj("MuiButtonBase",e)}const pV=mj("MuiButtonBase",["root","disabled","focusVisible"]),mV=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],gV=dB("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${pV.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),yV=QL.forwardRef(function(e,t){const n=mB({props:e,name:"MuiButtonBase"}),{action:r,centerRipple:i=!1,children:o,className:a,component:s="button",disabled:l=!1,disableRipple:c=!1,disableTouchRipple:u=!1,focusRipple:d=!1,LinkComponent:f="a",onBlur:h,onClick:p,onContextMenu:m,onDragLeave:g,onFocus:y,onFocusVisible:v,onKeyDown:b,onKeyUp:x,onMouseDown:S,onMouseLeave:M,onMouseUp:w,onTouchEnd:E,onTouchMove:k,onTouchStart:C,tabIndex:A=0,TouchRippleProps:O,touchRippleRef:N,type:D}=n,T=j_(n,mV),q=QL.useRef(null),I=QL.useRef(null),R=Fj(I,N),{isFocusVisibleRef:L,onFocus:_,onBlur:P,ref:z}=Zj(),[F,j]=QL.useState(!1);l&&F&&j(!1),QL.useImperativeHandle(r,()=>({focusVisible:()=>{j(!0),q.current.focus()}}),[]);const[$,B]=QL.useState(!1);QL.useEffect(()=>{B(!0)},[]);const V=$&&!c&&!l;function H(e,t,n=u){return zj(r=>{t&&t(r);return!n&&I.current&&I.current[e](r),!0})}QL.useEffect(()=>{F&&d&&!c&&$&&I.current.pulsate()},[c,d,F,$]);const U=H("start",S),W=H("stop",m),Y=H("stop",g),K=H("stop",w),G=H("stop",e=>{F&&e.preventDefault(),M&&M(e)}),X=H("start",C),J=H("stop",E),Z=H("stop",k),Q=H("stop",e=>{P(e),!1===L.current&&j(!1),h&&h(e)},!1),ee=zj(e=>{q.current||(q.current=e.currentTarget),_(e),!0===L.current&&(j(!0),v&&v(e)),y&&y(e)}),te=()=>{const e=q.current;return s&&"button"!==s&&!("A"===e.tagName&&e.href)},ne=QL.useRef(!1),re=zj(e=>{d&&!ne.current&&F&&I.current&&" "===e.key&&(ne.current=!0,I.current.stop(e,()=>{I.current.start(e)})),e.target===e.currentTarget&&te()&&" "===e.key&&e.preventDefault(),b&&b(e),e.target===e.currentTarget&&te()&&"Enter"===e.key&&!l&&(e.preventDefault(),p&&p(e))}),ie=zj(e=>{d&&" "===e.key&&I.current&&F&&!e.defaultPrevented&&(ne.current=!1,I.current.stop(e,()=>{I.current.pulsate(e)})),x&&x(e),p&&e.target===e.currentTarget&&te()&&" "===e.key&&!e.defaultPrevented&&p(e)});let oe=s;"button"===oe&&(T.href||T.to)&&(oe=f);const ae={};"button"===oe?(ae.type=void 0===D?"button":D,ae.disabled=l):(T.href||T.to||(ae.role="button"),l&&(ae["aria-disabled"]=l));const se=Fj(t,z,q),le=F_({},n,{centerRipple:i,component:s,disabled:l,disableRipple:c,disableTouchRipple:u,focusRipple:d,tabIndex:A,focusVisible:F}),ce=(e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:i}=e,o=Qj({root:["root",t&&"disabled",n&&"focusVisible"]},hV,i);return n&&r&&(o.root+=` ${r}`),o})(le);return Fz.jsxs(gV,F_({as:oe,className:fj(ce.root,a),ownerState:le,onBlur:Q,onClick:p,onContextMenu:W,onFocus:ee,onKeyDown:re,onKeyUp:ie,onMouseDown:U,onMouseLeave:G,onMouseUp:K,onDragLeave:Y,onTouchEnd:J,onTouchMove:Z,onTouchStart:X,ref:se,tabIndex:l?-1:A,type:D},ae,T,{children:[o,V?Fz.jsx(fV,F_({ref:R,center:i},O)):null]}))});function vV(e){return pj("MuiTypography",e)}mj("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const bV=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],xV=dB("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],"inherit"!==n.align&&t[`align${rF(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>F_({margin:0},"inherit"===t.variant&&{font:"inherit"},"inherit"!==t.variant&&e.typography[t.variant],"inherit"!==t.align&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),SV={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},MV={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},wV=QL.forwardRef(function(e,t){const n=mB({props:e,name:"MuiTypography"}),r=(e=>MV[e]||e)(n.color),i=sj(F_({},n,{color:r})),{align:o="inherit",className:a,component:s,gutterBottom:l=!1,noWrap:c=!1,paragraph:u=!1,variant:d="body1",variantMapping:f=SV}=i,h=j_(i,bV),p=F_({},i,{align:o,color:r,className:a,component:s,gutterBottom:l,noWrap:c,paragraph:u,variant:d,variantMapping:f}),m=s||(u?"p":f[d]||SV[d])||"span",g=(e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:a}=e;return Qj({root:["root",o,"inherit"!==e.align&&`align${rF(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]},vV,a)})(p);return Fz.jsx(xV,F_({as:m,ref:t,ownerState:p,className:fj(g.root,a)},h))});const EV=QL.forwardRef(function(e,t){const{children:n,container:r,disablePortal:i=!1}=e,[o,a]=QL.useState(null),s=Fj(QL.isValidElement(n)?o$(n):null,t);if(Nj(()=>{i||a(function(e){return"function"==typeof e?e():e}(r)||document.body)},[r,i]),Nj(()=>{if(o&&!i)return Rj(t,o),()=>{Rj(t,null)}},[t,o,i]),i){if(QL.isValidElement(n)){const e={ref:s};return QL.cloneElement(n,e)}return Fz.jsx(QL.Fragment,{children:n})}return Fz.jsx(QL.Fragment,{children:o?qB.createPortal(n,o):o})}),kV=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],CV={entering:{opacity:1},entered:{opacity:1}},AV=QL.forwardRef(function(e,t){const n=X$(),r={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:o=!0,children:a,easing:s,in:l,onEnter:c,onEntered:u,onEntering:d,onExit:f,onExited:h,onExiting:p,style:m,timeout:g=r,TransitionComponent:y=$B}=e,v=j_(e,kV),b=QL.useRef(null),x=Fj(b,o$(a),t),S=e=>t=>{if(e){const n=b.current;void 0===t?e(n):e(n,t)}},M=S(d),w=S((e,t)=>{KB(e);const r=GB({style:m,timeout:g,easing:s},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",r),e.style.transition=n.transitions.create("opacity",r),c&&c(e,t)}),E=S(u),k=S(p),C=S(e=>{const t=GB({style:m,timeout:g,easing:s},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),f&&f(e)}),A=S(h);return Fz.jsx(y,F_({appear:o,in:l,nodeRef:b,onEnter:w,onEntered:E,onEntering:M,onExit:C,onExited:A,onExiting:k,addEndListener:e=>{i&&i(b.current,e)},timeout:g},v,{children:(e,t)=>QL.cloneElement(a,F_({style:F_({opacity:0,visibility:"exited"!==e||l?void 0:"hidden"},CV[e],m,a.props.style),ref:x},t))}))});function OV(e){return pj("MuiBackdrop",e)}mj("MuiBackdrop",["root","invisible"]);const NV=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],DV=dB("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>F_({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),TV=QL.forwardRef(function(e,t){var n,r,i;const o=mB({props:e,name:"MuiBackdrop"}),{children:a,className:s,component:l="div",components:c={},componentsProps:u={},invisible:d=!1,open:f,slotProps:h={},slots:p={},TransitionComponent:m=AV,transitionDuration:g}=o,y=j_(o,NV),v=F_({},o,{component:l,invisible:d}),b=(e=>{const{classes:t,invisible:n}=e;return Qj({root:["root",n&&"invisible"]},OV,t)})(v),x=null!=(n=h.root)?n:u.root;return Fz.jsx(m,F_({in:f,timeout:g},y,{children:Fz.jsx(DV,F_({"aria-hidden":!0},x,{as:null!=(r=null!=(i=p.root)?i:c.Root)?r:l,className:fj(b.root,s,null==x?void 0:x.className),ownerState:F_({},v,null==x?void 0:x.ownerState),classes:b,ref:t,children:a}))}))});function qV(e){return pj("MuiButton",e)}const IV=mj("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),RV=QL.createContext({}),LV=QL.createContext(void 0),_V=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],PV=e=>F_({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}}),zV=dB(yV,{shouldForwardProp:e=>uB(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${rF(n.color)}`],t[`size${rF(n.size)}`],t[`${n.variant}Size${rF(n.size)}`],"inherit"===n.color&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const i="light"===e.palette.mode?e.palette.grey[300]:e.palette.grey[800],o="light"===e.palette.mode?e.palette.grey.A100:e.palette.grey[700];return F_({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":F_({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:A$.alpha(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===t.variant&&"inherit"!==t.color&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:A$.alpha(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===t.variant&&"inherit"!==t.color&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:A$.alpha(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===t.variant&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:o,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},"contained"===t.variant&&"inherit"!==t.color&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":F_({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${IV.focusVisible}`]:F_({},"contained"===t.variant&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${IV.disabled}`]:F_({color:(e.vars||e).palette.action.disabled},"outlined"===t.variant&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"contained"===t.variant&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},"text"===t.variant&&{padding:"6px 8px"},"text"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main},"outlined"===t.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${A$.alpha(e.palette[t.color].main,.5)}`},"contained"===t.variant&&{color:e.vars?e.vars.palette.text.primary:null==(n=(r=e.palette).getContrastText)?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:i,boxShadow:(e.vars||e).shadows[2]},"contained"===t.variant&&"inherit"!==t.color&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},"inherit"===t.color&&{color:"inherit",borderColor:"currentColor"},"small"===t.size&&"text"===t.variant&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"text"===t.variant&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"outlined"===t.variant&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"outlined"===t.variant&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},"small"===t.size&&"contained"===t.variant&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},"large"===t.size&&"contained"===t.variant&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${IV.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${IV.disabled}`]:{boxShadow:"none"}}),FV=dB("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${rF(n.size)}`]]}})(({ownerState:e})=>F_({display:"inherit",marginRight:8,marginLeft:-4},"small"===e.size&&{marginLeft:-2},PV(e))),jV=dB("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${rF(n.size)}`]]}})(({ownerState:e})=>F_({display:"inherit",marginRight:-4,marginLeft:8},"small"===e.size&&{marginRight:-2},PV(e))),$V=QL.forwardRef(function(e,t){const n=QL.useContext(RV),r=QL.useContext(LV),i=mB({props:Oj(n,e),name:"MuiButton"}),{children:o,color:a="primary",component:s="button",className:l,disabled:c=!1,disableElevation:u=!1,disableFocusRipple:d=!1,endIcon:f,focusVisibleClassName:h,fullWidth:p=!1,size:m="medium",startIcon:g,type:y,variant:v="text"}=i,b=j_(i,_V),x=F_({},i,{color:a,component:s,disabled:c,disableElevation:u,disableFocusRipple:d,fullWidth:p,size:m,type:y,variant:v}),S=(e=>{const{color:t,disableElevation:n,fullWidth:r,size:i,variant:o,classes:a}=e;return F_({},a,Qj({root:["root",o,`${o}${rF(t)}`,`size${rF(i)}`,`${o}Size${rF(i)}`,`color${rF(t)}`,n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${rF(i)}`],endIcon:["icon","endIcon",`iconSize${rF(i)}`]},qV,a))})(x),M=g&&Fz.jsx(FV,{className:S.startIcon,ownerState:x,children:g}),w=f&&Fz.jsx(jV,{className:S.endIcon,ownerState:x,children:f}),E=r||"";return Fz.jsxs(zV,F_({ownerState:x,className:fj(n.className,S.root,l,E),component:s,disabled:c,focusRipple:!d,focusVisibleClassName:fj(S.focusVisible,h),ref:t,type:y},b,{classes:S,children:[M,o,w]}))});function BV(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function VV(e){return parseInt(Ij(e).getComputedStyle(e).paddingRight,10)||0}function HV(e,t,n,r,i){const o=[t,n,...r];[].forEach.call(e.children,e=>{const t=-1===o.indexOf(e),n=!function(e){const t=-1!==["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName),n="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||n}(e);t&&n&&BV(e,i)})}function UV(e,t){let n=-1;return e.some((e,r)=>!!t(e)&&(n=r,!0)),n}function WV(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(function(e){const t=qj(e);return t.body===e?Ij(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(r)){const e=function(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}(qj(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${VV(r)+e}px`;const t=qj(r).querySelectorAll(".mui-fixed");[].forEach.call(t,t=>{n.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${VV(t)+e}px`})}let e;if(r.parentNode instanceof DocumentFragment)e=qj(r).body;else{const t=r.parentElement,n=Ij(r);e="HTML"===(null==t?void 0:t.nodeName)&&"scroll"===n.getComputedStyle(t).overflowY?t:r}n.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{n.forEach(({value:e,el:t,property:n})=>{e?t.style.setProperty(n,e):t.style.removeProperty(n)})}}const YV=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function KV(e){const t=[],n=[];return Array.from(e.querySelectorAll(YV)).forEach((e,r)=>{const i=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1!==i&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}(e))}(e)&&(0===i?t.push(e):n.push({documentOrder:r,tabIndex:i,node:e}))}),n.sort((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex).map(e=>e.node).concat(t)}function GV(){return!0}function XV(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:i=!1,getTabbable:o=KV,isEnabled:a=GV,open:s}=e,l=QL.useRef(!1),c=QL.useRef(null),u=QL.useRef(null),d=QL.useRef(null),f=QL.useRef(null),h=QL.useRef(!1),p=QL.useRef(null),m=Fj(o$(t),p),g=QL.useRef(null);QL.useEffect(()=>{s&&p.current&&(h.current=!n)},[n,s]),QL.useEffect(()=>{if(!s||!p.current)return;const e=qj(p.current);return p.current.contains(e.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),h.current&&p.current.focus()),()=>{i||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[s]),QL.useEffect(()=>{if(!s||!p.current)return;const e=qj(p.current),t=t=>{g.current=t,!r&&a()&&"Tab"===t.key&&e.activeElement===p.current&&t.shiftKey&&(l.current=!0,u.current&&u.current.focus())},n=()=>{const t=p.current;if(null===t)return;if(!e.hasFocus()||!a()||l.current)return void(l.current=!1);if(t.contains(e.activeElement))return;if(r&&e.activeElement!==c.current&&e.activeElement!==u.current)return;if(e.activeElement!==f.current)f.current=null;else if(null!==f.current)return;if(!h.current)return;let n=[];if(e.activeElement!==c.current&&e.activeElement!==u.current||(n=o(p.current)),n.length>0){var i,s;const e=Boolean((null==(i=g.current)?void 0:i.shiftKey)&&"Tab"===(null==(s=g.current)?void 0:s.key)),t=n[0],r=n[n.length-1];"string"!=typeof t&&"string"!=typeof r&&(e?r.focus():t.focus())}else t.focus()};e.addEventListener("focusin",n),e.addEventListener("keydown",t,!0);const i=setInterval(()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&n()},50);return()=>{clearInterval(i),e.removeEventListener("focusin",n),e.removeEventListener("keydown",t,!0)}},[n,r,i,a,s,o]);const y=e=>{null===d.current&&(d.current=e.relatedTarget),h.current=!0};return Fz.jsxs(QL.Fragment,{children:[Fz.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:c,"data-testid":"sentinelStart"}),QL.cloneElement(t,{ref:m,onFocus:e=>{null===d.current&&(d.current=e.relatedTarget),h.current=!0,f.current=e.target;const n=t.props.onFocus;n&&n(e)}}),Fz.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":"sentinelEnd"})]})}const JV=new class{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(e,t){let n=this.modals.indexOf(e);if(-1!==n)return n;n=this.modals.length,this.modals.push(e),e.modalRef&&BV(e.modalRef,!1);const r=function(e){const t=[];return[].forEach.call(e.children,e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)}),t}(t);HV(t,e.mount,e.modalRef,r,!0);const i=UV(this.containers,e=>e.container===t);return-1!==i?(this.containers[i].modals.push(e),n):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:r}),n)}mount(e,t){const n=UV(this.containers,t=>-1!==t.modals.indexOf(e)),r=this.containers[n];r.restore||(r.restore=WV(r,t))}remove(e,t=!0){const n=this.modals.indexOf(e);if(-1===n)return n;const r=UV(this.containers,t=>-1!==t.modals.indexOf(e)),i=this.containers[r];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(n,1),0===i.modals.length)i.restore&&i.restore(),e.modalRef&&BV(e.modalRef,t),HV(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(r,1);else{const e=i.modals[i.modals.length-1];e.modalRef&&BV(e.modalRef,!1)}return n}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};function ZV(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:i=JV,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:d}=e,f=QL.useRef({}),h=QL.useRef(null),p=QL.useRef(null),m=Fj(p,d),[g,y]=QL.useState(!u),v=function(e){return!!e&&e.props.hasOwnProperty("in")}(l);let b=!0;"false"!==e["aria-hidden"]&&!1!==e["aria-hidden"]||(b=!1);const x=()=>(f.current.modalRef=p.current,f.current.mount=h.current,f.current),S=()=>{i.mount(x(),{disableScrollLock:r}),p.current&&(p.current.scrollTop=0)},M=zj(()=>{const e=function(e){return"function"==typeof e?e():e}(t)||qj(h.current).body;i.add(x(),e),p.current&&S()}),w=QL.useCallback(()=>i.isTopModal(x()),[i]),E=zj(e=>{h.current=e,e&&(u&&w()?S():p.current&&BV(p.current,b))}),k=QL.useCallback(()=>{i.remove(x(),b)},[b,i]);QL.useEffect(()=>()=>{k()},[k]),QL.useEffect(()=>{u?M():v&&o||k()},[u,k,v,o,M]);const C=e=>t=>{var r;null==(r=e.onKeyDown)||r.call(e,t),"Escape"===t.key&&229!==t.which&&w()&&(n||(t.stopPropagation(),c&&c(t,"escapeKeyDown")))},A=e=>t=>{var n;null==(n=e.onClick)||n.call(e,t),t.target===t.currentTarget&&c&&c(t,"backdropClick")};return{getRootProps:(t={})=>{const n=t$(e);delete n.onTransitionEnter,delete n.onTransitionExited;const r=F_({},n,t);return F_({role:"presentation"},r,{onKeyDown:C(r),ref:m})},getBackdropProps:(e={})=>F_({"aria-hidden":!0},e,{onClick:A(e),open:u}),getTransitionProps:()=>({onEnter:Tj(()=>{y(!1),a&&a()},null==l?void 0:l.props.onEnter),onExited:Tj(()=>{y(!0),s&&s(),o&&k()},null==l?void 0:l.props.onExited)}),rootRef:m,portalRef:E,isTopModal:w,exited:g,hasTransition:v}}function QV(e){return pj("MuiModal",e)}mj("MuiModal",["root","hidden","backdrop"]);const eH=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],tH=dB("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>F_({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),nH=dB(TV,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),rH=QL.forwardRef(function(e,t){var n,r,i,o,a,s;const l=mB({name:"MuiModal",props:e}),{BackdropComponent:c=nH,BackdropProps:u,className:d,closeAfterTransition:f=!1,children:h,container:p,component:m,components:g={},componentsProps:y={},disableAutoFocus:v=!1,disableEnforceFocus:b=!1,disableEscapeKeyDown:x=!1,disablePortal:S=!1,disableRestoreFocus:M=!1,disableScrollLock:w=!1,hideBackdrop:E=!1,keepMounted:k=!1,onBackdropClick:C,open:A,slotProps:O,slots:N}=l,D=j_(l,eH),T=F_({},l,{closeAfterTransition:f,disableAutoFocus:v,disableEnforceFocus:b,disableEscapeKeyDown:x,disablePortal:S,disableRestoreFocus:M,disableScrollLock:w,hideBackdrop:E,keepMounted:k}),{getRootProps:q,getBackdropProps:I,getTransitionProps:R,portalRef:L,isTopModal:_,exited:P,hasTransition:z}=ZV(F_({},T,{rootRef:t})),F=F_({},T,{exited:P}),j=(e=>{const{open:t,exited:n,classes:r}=e;return Qj({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},QV,r)})(F),$={};if(void 0===h.props.tabIndex&&($.tabIndex="-1"),z){const{onEnter:e,onExited:t}=R();$.onEnter=e,$.onExited=t}const B=null!=(n=null!=(r=null==N?void 0:N.root)?r:g.Root)?n:tH,V=null!=(i=null!=(o=null==N?void 0:N.backdrop)?o:g.Backdrop)?i:c,H=null!=(a=null==O?void 0:O.root)?a:y.root,U=null!=(s=null==O?void 0:O.backdrop)?s:y.backdrop,W=i$({elementType:B,externalSlotProps:H,externalForwardedProps:D,getSlotProps:q,additionalProps:{ref:t,as:m},ownerState:F,className:fj(d,null==H?void 0:H.className,null==j?void 0:j.root,!F.open&&F.exited&&(null==j?void 0:j.hidden))}),Y=i$({elementType:V,externalSlotProps:U,additionalProps:u,getSlotProps:e=>I(F_({},e,{onClick:t=>{C&&C(t),null!=e&&e.onClick&&e.onClick(t)}})),className:fj(null==U?void 0:U.className,null==u?void 0:u.className,null==j?void 0:j.backdrop),ownerState:F});return k||A||z&&!P?Fz.jsx(EV,{ref:L,container:p,disablePortal:S,children:Fz.jsxs(B,F_({},W,{children:[!E&&c?Fz.jsx(V,F_({},Y)):null,Fz.jsx(XV,{disableEnforceFocus:b,disableAutoFocus:v,disableRestoreFocus:M,isEnabled:_,open:A,children:QL.cloneElement(h,$)})]}))}):null});function iH(e){return pj("MuiDivider",e)}mj("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);const oH=["absolute","children","className","component","flexItem","light","orientation","role","textAlign","variant"],aH=dB("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,"vertical"===n.orientation&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&"vertical"===n.orientation&&t.withChildrenVertical,"right"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignRight,"left"===n.textAlign&&"vertical"!==n.orientation&&t.textAlignLeft]}})(({theme:e,ownerState:t})=>F_({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin"},t.absolute&&{position:"absolute",bottom:0,left:0,width:"100%"},t.light&&{borderColor:e.vars?`rgba(${e.vars.palette.dividerChannel} / 0.08)`:A$.alpha(e.palette.divider,.08)},"inset"===t.variant&&{marginLeft:72},"middle"===t.variant&&"horizontal"===t.orientation&&{marginLeft:e.spacing(2),marginRight:e.spacing(2)},"middle"===t.variant&&"vertical"===t.orientation&&{marginTop:e.spacing(1),marginBottom:e.spacing(1)},"vertical"===t.orientation&&{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"},t.flexItem&&{alignSelf:"stretch",height:"auto"}),({ownerState:e})=>F_({},e.children&&{display:"flex",whiteSpace:"nowrap",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}),({theme:e,ownerState:t})=>F_({},t.children&&"vertical"!==t.orientation&&{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}),({theme:e,ownerState:t})=>F_({},t.children&&"vertical"===t.orientation&&{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}),({ownerState:e})=>F_({},"right"===e.textAlign&&"vertical"!==e.orientation&&{"&::before":{width:"90%"},"&::after":{width:"10%"}},"left"===e.textAlign&&"vertical"!==e.orientation&&{"&::before":{width:"10%"},"&::after":{width:"90%"}})),sH=dB("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,"vertical"===n.orientation&&t.wrapperVertical]}})(({theme:e,ownerState:t})=>F_({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`},"vertical"===t.orientation&&{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`})),lH=QL.forwardRef(function(e,t){const n=mB({props:e,name:"MuiDivider"}),{absolute:r=!1,children:i,className:o,component:a=(i?"div":"hr"),flexItem:s=!1,light:l=!1,orientation:c="horizontal",role:u=("hr"!==a?"separator":void 0),textAlign:d="center",variant:f="fullWidth"}=n,h=j_(n,oH),p=F_({},n,{absolute:r,component:a,flexItem:s,light:l,orientation:c,role:u,textAlign:d,variant:f}),m=(e=>{const{absolute:t,children:n,classes:r,flexItem:i,light:o,orientation:a,textAlign:s,variant:l}=e;return Qj({root:["root",t&&"absolute",l,o&&"light","vertical"===a&&"vertical",i&&"flexItem",n&&"withChildren",n&&"vertical"===a&&"withChildrenVertical","right"===s&&"vertical"!==a&&"textAlignRight","left"===s&&"vertical"!==a&&"textAlignLeft"],wrapper:["wrapper","vertical"===a&&"wrapperVertical"]},iH,r)})(p);return Fz.jsx(aH,F_({as:a,className:fj(m.root,o),role:u,ref:t,ownerState:p},h,{children:i?Fz.jsx(sH,{className:m.wrapper,ownerState:p,children:i}):null}))});lH.muiSkipListHighlight=!0;const cH=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function uH(e){return`scale(${e}, ${e**2})`}const dH={entering:{opacity:1,transform:uH(1)},entered:{opacity:1,transform:"none"}},fH="undefined"!=typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),hH=QL.forwardRef(function(e,t){const{addEndListener:n,appear:r=!0,children:i,easing:o,in:a,onEnter:s,onEntered:l,onEntering:c,onExit:u,onExited:d,onExiting:f,style:h,timeout:p="auto",TransitionComponent:m=$B}=e,g=j_(e,cH),y=Vj(),v=QL.useRef(),b=X$(),x=QL.useRef(null),S=Fj(x,o$(i),t),M=e=>t=>{if(e){const n=x.current;void 0===t?e(n):e(n,t)}},w=M(c),E=M((e,t)=>{KB(e);const{duration:n,delay:r,easing:i}=GB({style:h,timeout:p,easing:o},{mode:"enter"});let a;"auto"===p?(a=b.transitions.getAutoHeightDuration(e.clientHeight),v.current=a):a=n,e.style.transition=[b.transitions.create("opacity",{duration:a,delay:r}),b.transitions.create("transform",{duration:fH?a:.666*a,delay:r,easing:i})].join(","),s&&s(e,t)}),k=M(l),C=M(f),A=M(e=>{const{duration:t,delay:n,easing:r}=GB({style:h,timeout:p,easing:o},{mode:"exit"});let i;"auto"===p?(i=b.transitions.getAutoHeightDuration(e.clientHeight),v.current=i):i=t,e.style.transition=[b.transitions.create("opacity",{duration:i,delay:n}),b.transitions.create("transform",{duration:fH?i:.666*i,delay:fH?n:n||.333*i,easing:r})].join(","),e.style.opacity=0,e.style.transform=uH(.75),u&&u(e)}),O=M(d);return Fz.jsx(m,F_({appear:r,in:a,nodeRef:x,onEnter:E,onEntered:k,onEntering:w,onExit:A,onExited:O,onExiting:C,addEndListener:e=>{"auto"===p&&y.start(v.current||0,e),n&&n(x.current,e)},timeout:"auto"===p?null:p},g,{children:(e,t)=>QL.cloneElement(i,F_({style:F_({opacity:0,transform:uH(.75),visibility:"exited"!==e||a?void 0:"hidden"},dH[e],h,i.props.style),ref:S},t))}))});hH.muiSupportAuto=!0;const pH=QL.createContext({});function mH(e){return pj("MuiList",e)}mj("MuiList",["root","padding","dense","subheader"]);const gH=["children","className","component","dense","disablePadding","subheader"],yH=dB("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})(({ownerState:e})=>F_({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),vH=QL.forwardRef(function(e,t){const n=mB({props:e,name:"MuiList"}),{children:r,className:i,component:o="ul",dense:a=!1,disablePadding:s=!1,subheader:l}=n,c=j_(n,gH),u=QL.useMemo(()=>({dense:a}),[a]),d=F_({},n,{component:o,dense:a,disablePadding:s}),f=(e=>{const{classes:t,disablePadding:n,dense:r,subheader:i}=e;return Qj({root:["root",!n&&"padding",r&&"dense",i&&"subheader"]},mH,t)})(d);return Fz.jsx(pH.Provider,{value:u,children:Fz.jsxs(yH,F_({as:o,className:fj(f.root,i),ref:t,ownerState:d},c,{children:[l,r]}))})});function bH(e){return pj("MuiListItemButton",e)}const xH=mj("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),SH=["alignItems","autoFocus","component","children","dense","disableGutters","divider","focusVisibleClassName","selected","className"],MH=dB(yV,{shouldForwardProp:e=>uB(e)||"classes"===e,name:"MuiListItemButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,"flex-start"===n.alignItems&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters]}})(({theme:e,ownerState:t})=>F_({display:"flex",flexGrow:1,justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minWidth:0,boxSizing:"border-box",textAlign:"left",paddingTop:8,paddingBottom:8,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${xH.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:A$.alpha(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${xH.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:A$.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${xH.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:A$.alpha(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:A$.alpha(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${xH.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${xH.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},"flex-start"===t.alignItems&&{alignItems:"flex-start"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.dense&&{paddingTop:4,paddingBottom:4})),wH=QL.forwardRef(function(e,t){const n=mB({props:e,name:"MuiListItemButton"}),{alignItems:r="center",autoFocus:i=!1,component:o="div",children:a,dense:s=!1,disableGutters:l=!1,divider:c=!1,focusVisibleClassName:u,selected:d=!1,className:f}=n,h=j_(n,SH),p=QL.useContext(pH),m=QL.useMemo(()=>({dense:s||p.dense||!1,alignItems:r,disableGutters:l}),[r,p.dense,s,l]),g=QL.useRef(null);Nj(()=>{i&&g.current&&g.current.focus()},[i]);const y=F_({},n,{alignItems:r,dense:m.dense,disableGutters:l,divider:c,selected:d}),v=(e=>{const{alignItems:t,classes:n,dense:r,disabled:i,disableGutters:o,divider:a,selected:s}=e;return F_({},n,Qj({root:["root",r&&"dense",!o&&"gutters",a&&"divider",i&&"disabled","flex-start"===t&&"alignItemsFlexStart",s&&"selected"]},bH,n))})(y),b=Fj(g,t);return Fz.jsx(pH.Provider,{value:m,children:Fz.jsx(MH,F_({ref:b,href:h.href||h.to,component:(h.href||h.to)&&"div"===o?"button":o,focusVisibleClassName:fj(v.focusVisible,u),ownerState:y,className:fj(v.root,f)},h,{classes:v,children:a}))})});function EH(e){return pj("MuiListItemIcon",e)}mj("MuiListItemIcon",["root","alignItemsFlexStart"]);const kH=["className"],CH=dB("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,"flex-start"===n.alignItems&&t.alignItemsFlexStart]}})(({theme:e,ownerState:t})=>F_({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex"},"flex-start"===t.alignItems&&{marginTop:8})),AH=QL.forwardRef(function(e,t){const n=mB({props:e,name:"MuiListItemIcon"}),{className:r}=n,i=j_(n,kH),o=F_({},n,{alignItems:QL.useContext(pH).alignItems}),a=(e=>{const{alignItems:t,classes:n}=e;return Qj({root:["root","flex-start"===t&&"alignItemsFlexStart"]},EH,n)})(o);return Fz.jsx(CH,F_({className:fj(a.root,r),ownerState:o,ref:t},i))});function OH(e){return pj("MuiListItemText",e)}const NH=mj("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),DH=["children","className","disableTypography","inset","primary","primaryTypographyProps","secondary","secondaryTypographyProps"],TH=dB("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${NH.primary}`]:t.primary},{[`& .${NH.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})(({ownerState:e})=>F_({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4},e.primary&&e.secondary&&{marginTop:6,marginBottom:6},e.inset&&{paddingLeft:56})),qH=QL.forwardRef(function(e,t){const n=mB({props:e,name:"MuiListItemText"}),{children:r,className:i,disableTypography:o=!1,inset:a=!1,primary:s,primaryTypographyProps:l,secondary:c,secondaryTypographyProps:u}=n,d=j_(n,DH),{dense:f}=QL.useContext(pH);let h=null!=s?s:r,p=c;const m=F_({},n,{disableTypography:o,inset:a,primary:!!h,secondary:!!p,dense:f}),g=(e=>{const{classes:t,inset:n,primary:r,secondary:i,dense:o}=e;return Qj({root:["root",n&&"inset",o&&"dense",r&&i&&"multiline"],primary:["primary"],secondary:["secondary"]},OH,t)})(m);return null==h||h.type===wV||o||(h=Fz.jsx(wV,F_({variant:f?"body2":"body1",className:g.primary,component:null!=l&&l.variant?void 0:"span",display:"block"},l,{children:h}))),null==p||p.type===wV||o||(p=Fz.jsx(wV,F_({variant:"body2",className:g.secondary,color:"text.secondary",display:"block"},u,{children:p}))),Fz.jsxs(TH,F_({className:fj(g.root,i),ownerState:m,ref:t},d,{children:[h,p]}))});function IH(e){return pj("MuiPopover",e)}mj("MuiPopover",["root","paper"]);const RH=["onEntering"],LH=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],_H=["slotProps"];function PH(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.height/2:"bottom"===t&&(n=e.height),n}function zH(e,t){let n=0;return"number"==typeof t?n=t:"center"===t?n=e.width/2:"right"===t&&(n=e.width),n}function FH(e){return[e.horizontal,e.vertical].map(e=>"number"==typeof e?`${e}px`:e).join(" ")}function jH(e){return"function"==typeof e?e():e}const $H=dB(rH,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),BH=dB(QB,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),VH=QL.forwardRef(function(e,t){var n,r,i;const o=mB({props:e,name:"MuiPopover"}),{action:a,anchorEl:s,anchorOrigin:l={vertical:"top",horizontal:"left"},anchorPosition:c,anchorReference:u="anchorEl",children:d,className:f,container:h,elevation:p=8,marginThreshold:m=16,open:g,PaperProps:y={},slots:v,slotProps:b,transformOrigin:x={vertical:"top",horizontal:"left"},TransitionComponent:S=hH,transitionDuration:M="auto",TransitionProps:{onEntering:w}={},disableScrollLock:E=!1}=o,k=j_(o.TransitionProps,RH),C=j_(o,LH),A=null!=(n=null==b?void 0:b.paper)?n:y,O=QL.useRef(),N=Fj(O,A.ref),D=F_({},o,{anchorOrigin:l,anchorReference:u,elevation:p,marginThreshold:m,externalPaperSlotProps:A,transformOrigin:x,TransitionComponent:S,transitionDuration:M,TransitionProps:k}),T=(e=>{const{classes:t}=e;return Qj({root:["root"],paper:["paper"]},IH,t)})(D),q=QL.useCallback(()=>{if("anchorPosition"===u)return c;const e=jH(s),t=(e&&1===e.nodeType?e:qj(O.current).body).getBoundingClientRect();return{top:t.top+PH(t,l.vertical),left:t.left+zH(t,l.horizontal)}},[s,l.horizontal,l.vertical,c,u]),I=QL.useCallback(e=>({vertical:PH(e,x.vertical),horizontal:zH(e,x.horizontal)}),[x.horizontal,x.vertical]),R=QL.useCallback(e=>{const t={width:e.offsetWidth,height:e.offsetHeight},n=I(t);if("none"===u)return{top:null,left:null,transformOrigin:FH(n)};const r=q();let i=r.top-n.vertical,o=r.left-n.horizontal;const a=i+t.height,l=o+t.width,c=Ij(jH(s)),d=c.innerHeight-m,f=c.innerWidth-m;if(null!==m&&i<m){const e=i-m;i-=e,n.vertical+=e}else if(null!==m&&a>d){const e=a-d;i-=e,n.vertical+=e}if(null!==m&&o<m){const e=o-m;o-=e,n.horizontal+=e}else if(l>f){const e=l-f;o-=e,n.horizontal+=e}return{top:`${Math.round(i)}px`,left:`${Math.round(o)}px`,transformOrigin:FH(n)}},[s,u,q,I,m]),[L,_]=QL.useState(g),P=QL.useCallback(()=>{const e=O.current;if(!e)return;const t=R(e);null!==t.top&&(e.style.top=t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,_(!0)},[R]);QL.useEffect(()=>(E&&window.addEventListener("scroll",P),()=>window.removeEventListener("scroll",P)),[s,E,P]);QL.useEffect(()=>{g&&P()}),QL.useImperativeHandle(a,()=>g?{updatePosition:()=>{P()}}:null,[g,P]),QL.useEffect(()=>{if(!g)return;const e=function(e,t=166){let n;function r(...r){clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}return r.clear=()=>{clearTimeout(n)},r}(()=>{P()}),t=Ij(s);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}},[s,g,P]);let z=M;"auto"!==M||S.muiSupportAuto||(z=void 0);const F=h||(s?qj(jH(s)).body:void 0),j=null!=(r=null==v?void 0:v.root)?r:$H,$=null!=(i=null==v?void 0:v.paper)?i:BH,B=i$({elementType:$,externalSlotProps:F_({},A,{style:L?A.style:F_({},A.style,{opacity:0})}),additionalProps:{elevation:p,ref:N},ownerState:D,className:fj(T.paper,null==A?void 0:A.className)}),V=i$({elementType:j,externalSlotProps:(null==b?void 0:b.root)||{},externalForwardedProps:C,additionalProps:{ref:t,slotProps:{backdrop:{invisible:!0}},container:F,open:g},ownerState:D,className:fj(T.root,f)}),{slotProps:H}=V,U=j_(V,_H);return Fz.jsx(j,F_({},U,!e$(j)&&{slotProps:H,disableScrollLock:E},{children:Fz.jsx(S,F_({appear:!0,in:g,onEntering:(e,t)=>{w&&w(e,t),P()},onExited:()=>{_(!1)},timeout:z},k,{children:Fz.jsx($,F_({},B,{children:d}))}))}))});function HH(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var UH,WH,YH={exports:{}},KH={},GH=(WH||(WH=1,YH.exports=function(){if(UH)return KH;UH=1;var e=e_,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},c=null,u=null;for(s in void 0!==a&&(c=""+a),void 0!==n.key&&(c=""+n.key),void 0!==n.ref&&(u=n.ref),n)r.call(n,s)&&!o.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:c,ref:u,props:l,_owner:i.current}}return KH.Fragment=n,KH.jsx=a,KH.jsxs=a,KH}()),YH.exports),XH=({className:e,title:t,path:n,fillRule:r})=>GH.jsxs(bB,{className:e,viewBox:"0 0 16 16",fontSize:"small",role:"img",style:{height:12,width:12},children:[GH.jsx("path",{d:n}),t?GH.jsx("title",{children:t}):void 0,r?GH.jsx("use",{fillRule:r}):void 0]}),JH={STYLE:{ELLIPSIS:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},FOCUS:{boxShadow:"inset 0 0 0 2px #177FE6"},ICONS:{COLOR:{PRIMARY:"rgba(89, 89, 89)",SECONDARY:"rgba(89, 89, 89, 0.8)",DISABLED:"rgba(89, 89, 89, 0.4)"}}}};const ZH={L:new RegExp("[A-Za-zªµºÀ-ÖØ-öø-ʸʻ-ˁː-ˑˠ-ˤˮͰ-ͳͶ-ͽΆΈ-ϵϷ-҂Ҋ-։ः-हऻऽ-ीॉ-ौॎ-ॐक़-ॡ।-ॿং-হঽ-ীে-ৌৎ-ৡ০-ৱ৴-৺ਃ-ਹਾ-ੀਖ਼-੯ੲ-ੴઃ-હઽ-ીૉ-ૌૐ-ૡ૦-૯ଂ-ହଽ-ାୀେ-ୌୗ-ୡ୦-୷ஃ-ிு-ௌௐ-௲ఁ-ఽు-ౄౘ-ౡ౦-౯౿-ಹಽ-ೋೕ-ೡ೦-ീെ-ൌൎ-ൡ൦-ෆා-ෑෘ-ะา-ำเ-ๆ๏-ະາ-ຳຽ-ໆ໐-༗༚-༴༶༸༾-ཬཿ྅ྈ-ྌ྾-࿅࿇-ာေးျ-ြဿ-ၗၚ-ၝၡ-ၰၵ-ႁႃ-ႄႇ-ႌႎ-ႜ႞-ፚ፠-ᎏᎠ-Ᏼᐁ-ᙿᚁ-ᚚᚠ-ᜑᜠ-ᜱ᜵-ᝑᝠ-ᝰក-ាើ-ៅះ-ៈ។-៚ៜ០-៩᠐-ᢨᢪ-ᤜᤣ-ᤦᤩ-ᤱᤳ-ᤸ᥆-᧚ᨀ-ᨖᨙ-ᩕᩗᩡᩣ-ᩤᩭ-ᩲ᪀-᪭ᬄ-ᬳᬵᬻᬽ-ᭁᭃ-᭪᭴-᭼ᮂ-ᮡᮦ-ᮧ᮪-ᯥᯧᯪ-ᯬᯮ᯲-ᰫᰴ-ᰵ᰻-᱿᳓᳡ᳩ-ᳬᳮ-ᶿḀ-ᾼιῂ-ῌῐ-Ίῠ-Ῥῲ-ῼ‎ⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎ-⅏Ⅰ-ↈ⌶-⍺⎕⒜-ⓩ⚬⠀-⣿Ⰰ-ⳤⳫ-ⳮⴀ-⵰ⶀ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ㆺㇰ-㈜㈠-㉏㉠-㉻㉿-㊰㋀-㋋㋐-㍶㍻-㏝㏠-㏾㐀-䶵一-ꒌꓐ-ꘌꘐ-ꙮꚀ-ꛯ꛲-꛷Ꜣ-ꞇ꞉-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠤꠧ꠰-꠷ꡀ-ꡳꢀ-ꣃ꣎-꣙ꣲ-ꤥ꤮-ꥆꥒ-ꥼꦃ-ꦲꦴ-ꦵꦺ-ꦻꦽ-ꨨꨯ-ꨰꨳ-ꨴꩀ-ꩂꩄ-ꩋꩍ-ꪯꪱꪵ-ꪶꪹ-ꪽꫀꫂ-ꯤꯦ-ꯧꯩ-꯬꯰-ﬗＡ-Ｚａ-ｚｦ-ￜ]"),R:new RegExp("[־׀׃׆א-״߀-ߪߴ-ߵߺ-ࠕࠚࠤࠨ࠰-ࡘ࡞‏יִײַ-ﬨשׁ-ﭏ]"),AL:new RegExp("[؈؋؍؛-ي٭-ٯٱ-ەۥ-ۦۮ-ۯۺ-܍ܐܒ-ܯݍ-ޥޱﭐ-ﴽﵐ-﷼ﹰ-ﻼ]")},QH=e=>ZH.L.test(e),eU=e=>ZH.R.test(e)||ZH.AL.test(e);function tU(e){const t=e?e.length:0;let n;for(let r=0;r<t;r++){if(n=e[r],QH(n))return"ltr";if(eU(n))return"rtl"}return"ltr"}const nU=dB($V,{shouldForwardProp:e=>"direction"!==e&&"padding"!==e&&"styling"!==e})(({direction:e,padding:t,styling:n})=>{const{fontSize:r,fontFamily:i,color:o}=n;return{fontWeight:"normal",lineHeight:"normal",fontSize:`${r} !important`,fontFamily:`${i} !important`,color:`${o} !important`,height:"100%",minWidth:"0px",maxWidth:"640px",padding:t,"&:disabled":{color:o,opacity:1},"& .MuiButton-startIcon":{margin:"ltr"===e?"0 2px":void 0},"& .MuiButton-endIcon":{margin:"rtl"===e?"0 2px":void 0}}}),rU=dB(({className:e})=>GH.jsx(XH,{className:e,path:"M13,7 L8,7 L13,7 L13,4.98151367 C13,2.23029964 10.7614237,0 8,0 C5.23857625,0 3,2.23029964 3,4.98151367 L3,7 L3.75,7 L3,7 L4.5,7 L4.5,5.33193359 C4.5,3.21561511 5.54860291,1.5 8,1.5 C10.4513971,1.5 11.5,3.21561511 11.5,5.33193359 L11.5,7 L12.25,7 L3,7 C2.44771525,7 2,7.44771525 2,8 L2,15 C2,15.5522847 2.44771525,16 3,16 L13,16 C13.5522847,16 14,15.5522847 14,15 L14,8 C14,7.44771525 13.5522847,7 13,7 L3,7 L13,7 Z",fillRule:"evenodd"}))(()=>({color:JH.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px"})),iU=dB(({className:e})=>GH.jsx(XH,{className:e,path:"m8 9 4.5-4.5L14 6l-4.5 4.5L8 12 2 6l1.5-1.5L8 9Z"}))(()=>({color:JH.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px","&.disabled":{color:JH.STYLE.ICONS.COLOR.DISABLED,opacity:.6}}));var oU=({isOpen:e,onClick:t,popoverId:n,source:r})=>{const{styling:i}=r,{text:o}=r.info,{direction:a}=r.layout,{allowed:s,hasAlternatives:l,hasCyclic:c,hasMultiple:u,index:d,isCyclic:f,isLocked:h}=r.meta,{translator:p}=r.resources,{focus:m}=r.services,{isDisabled:g}=r.settings,{inSelections:y}=r.state,v=!(!s.change||!l),b=!(!s.reload||!f),x=(v||b)&&!y&&!g(),S={pointerEvents:x?"auto":"none"},M=function({allowed:e,canChange:t,canReload:n,direction:r,hasCyclic:i,hasMultiple:o,isLocked:a}){const s={top:"8px",right:"6px",bottom:"8px",left:"6px"};if(!o)return`${s.top} ${s.right} ${s.bottom} ${s.left}`;const l=i&&e.reload;return"ltr"===r&&(a?s.left="0px":n||!t&&l?s.left="4px":t||(s.left="2px"),t||n||(s.right="0px")),"rtl"===r&&(a?s.right="0px":n||!t&&l?s.right="4px":t||(s.right="2px"),t||n||(s.left="0px")),`${s.top} ${s.right} ${s.bottom} ${s.left}`}({allowed:s,canChange:v,canReload:b,direction:a,hasCyclic:c,hasMultiple:u,isLocked:h}),w={["rtl"===a?"endIcon":"startIcon"]:h&&GH.jsx(rU,{height:12}),["rtl"===a?"startIcon":"endIcon"]:(v||b)&&GH.jsx(iU,{className:y||g()?"disabled":""})},E=QL.useRef(),k=QL.useRef();QL.useEffect(()=>{e||m.shouldFor(d)&&(E.current.focus(),k.current.focusVisible())});const C=tU(o),A=`Accessibility.${x?"Alternative":"Normal"}.Instructions`;return GH.jsx(nU,{action:k,"aria-describedby":n,"aria-label":p.get(A),color:"inherit",direction:a,disabled:!x||g()||y,onClick:e=>{x&&t(e)},padding:M,ref:E,style:S,styling:i.title,title:o,...w,children:GH.jsx("span",{dir:C,style:JH.STYLE.ELLIPSIS,children:o})})},aU=({className:e,title:t})=>GH.jsx(XH,{className:e,title:t,path:"M 6 2 h 10 V 1 H 6 Z m 5 5 h 5 V 6 h -5 Z m 5 5 h -5 v -1 h 5 Z M 5 10 h 1 v 2.663 a 3.5 3.5 0 1 0 -2.922 0.036 l -0.406 0.914 A 4.501 4.501 0 1 1 7.329 13 H 9 v 1 H 5 Z"});const sU=dB($V,{shouldForwardProp:e=>"direction"!==e&&"isFirst"!==e&&"isLast"!==e&&"styling"!==e})(({direction:e,isFirst:t,isLast:n,styling:r})=>{const{color:i}=r;return{fontWeight:"normal",lineHeight:"normal",color:i,height:"24px",width:"24px",padding:0,marginLeft:"ltr"!==e||t?void 0:"4px",marginRight:"rtl"!==e||n?void 0:"4px","&:disabled":{color:i,opacity:1}}}),lU=dB(aU,{shouldForwardProp:e=>"direction"!==e&&"isFirst"!==e&&"isLast"!==e})(({direction:e,isFirst:t,isLast:n})=>({color:JH.STYLE.ICONS.COLOR.PRIMARY,marginTop:"1px",marginLeft:"ltr"!==e||t?void 0:"4px",marginRight:"rtl"!==e||n?void 0:"4px"})),cU=dB(({className:e,title:t})=>GH.jsx(XH,{className:e,title:t,path:"M1 8a7 7 0 1 1 10 6.326V11h-1v5h5v-1h-3.124A8 8 0 1 0 8 16v-1a7 7 0 0 1-7-7Z"}),{})(()=>({color:JH.STYLE.ICONS.COLOR.SECONDARY,"&.disabled":{color:JH.STYLE.ICONS.COLOR.DISABLED}}));var uU=({source:e})=>{if(!e.meta.isCyclic)return null;const[t,n]=QL.useState(!1),{styling:r}=e,{stepCycle:i}=e.action,{position:o,tooltip:a}=e.info,{direction:s}=e.layout,{allowed:l,isFirst:c,isLast:u}=e.meta,{isDisabled:d}=e.settings,{inSelections:f}=e.state;return QL.useEffect(()=>{t&&n(!1)},[o]),l.reload?GH.jsx(sU,{direction:s,disabled:t||f||d(),isFirst:c,isLast:u,onClick:()=>(n(!0),void i()),styling:r.title,title:a,variant:"outlined",children:GH.jsx(cU,{className:t||f||d()?"disabled":""})}):GH.jsx(lU,{direction:s,isFirst:c,isLast:u,style:{flexShrink:0},title:a})},dU=({className:e,title:t})=>GH.jsx(XH,{className:e,title:t,path:"M7 4h9v1H7V4ZM9 8h7v1H9V8ZM11 12h5v1h-5v-1ZM1 4v3.526a3.5 3.5 0 0 0 3.5 3.5h2.31L5.22 9.402l.715-.7L8.7 11.527 5.935 14.35l-.714-.7 1.59-1.624H4.5a4.5 4.5 0 0 1-4.5-4.5V4h1Z"});const fU=dB($V,{shouldForwardProp:e=>"styling"!==e})(({styling:e})=>{const{fontSize:t,fontFamily:n,color:r}=e;return{fontWeight:"normal",lineHeight:"normal",fontSize:`${t} !important`,fontFamily:`${n} !important`,color:`${r} !important`,padding:"0px 5px",height:"100%",minWidth:"45px","&:disabled":{color:r}}}),hU={color:JH.STYLE.ICONS.COLOR.SECONDARY,marginTop:"1px","&.disabled":{color:JH.STYLE.ICONS.COLOR.DISABLED}},pU=dB(({className:e})=>GH.jsx(XH,{className:e,path:"M8.5 8 4 3.5 5.5 2l6 6-6 6L4 12.5 8.5 8z"}))(()=>hU),mU=dB(({className:e})=>GH.jsx(XH,{className:e,path:"m7 8 4.5 4.5L10 14 4 8l6-6 1.5 1.5z"}))(()=>hU),gU=dB(dU,{shouldForwardProp:e=>"direction"!==e&&"isFirst"!==e&&"isLast"!==e})(({direction:e,isFirst:t,isLast:n})=>({color:JH.STYLE.ICONS.COLOR.PRIMARY,marginTop:"1px",marginLeft:"ltr"!==e||t?void 0:"4px",marginRight:"rtl"!==e||n?void 0:"4px"}));var yU=({source:e})=>{if(!e.meta.isDrillDown)return null;const{styling:t}=e,{drillUp:n}=e.action,{breadcrumbs:r,tooltip:i}=e.info,{direction:o}=e.layout,{isFirst:a,isLast:s}=e.meta,{isDisabled:l}=e.settings,{inSelections:c}=e.state,u=l()||c?"disabled":null,d={["rtl"===o?"startIcon":"endIcon"]:"rtl"===o?GH.jsx(mU,{className:u}):GH.jsx(pU,{className:u})},f=r.map((e,i)=>{const o=tU(e);return GH.jsx(fU,{disabled:l()||c,onClick:()=>(e=>{n({steps:r.length-e})})(i),styling:t.title,title:e,...d,children:GH.jsx("span",{dir:o,style:JH.STYLE.ELLIPSIS,children:e})},`breadcrumb-${e}`)});return GH.jsxs(GH.Fragment,{children:["rtl"===o?f.reverse():void 0,GH.jsx(gU,{direction:o,isFirst:a,isLast:s,style:{flexShrink:0},title:i}),"rtl"===o?void 0:f]})};const vU=dB(wH,{shouldForwardProp:e=>"nested"!==e&&"rtl"!==e})(({nested:e,rtl:t})=>({padding:`4px ${e&&t?"32px":"16px"} 4px ${e&&!t?"32px":"16px"}`,"&:focus":{...JH.STYLE.FOCUS}})),bU=dB(AH)(()=>({marginRight:0,justifyContent:"center"})),xU=dB(({className:e})=>GH.jsx(XH,{className:e,path:"m6 10 7-7 2 2-7 7-2 2-5-5 2-2 3 3Z"}))(()=>({color:JH.STYLE.ICONS.COLOR.SECONDARY})),SU=dB(aU)(()=>({color:JH.STYLE.ICONS.COLOR.SECONDARY})),MU=dB(dU)(()=>({color:JH.STYLE.ICONS.COLOR.SECONDARY,fontWeight:600})),wU=({meta:e,selected:t})=>t?GH.jsx(xU,{height:12}):e?.isCyclic?GH.jsx(SU,{height:12}):e?.isDrillDown?GH.jsx(MU,{height:12}):void 0;var EU=({id:e,meta:t,nested:n,onClick:r,selected:i,source:o,text:a})=>{const{styling:s}=o,{isRTL:l}=o.settings,c={fontWeight:!t||t.isNormal?"normal":600,lineHeight:"normal",fontSize:s.popover.fontSize,fontFamily:s.popover.fontFamily,color:s.popover.color,textAlign:l?"end":"start",...JH.STYLE.ELLIPSIS},u=tU(a),d=GH.jsx(bU,{sx:l?{paddingRight:"12px"}:{paddingLeft:"12px"},children:wU({meta:t,selected:i})});return GH.jsx(e_.Fragment,{children:GH.jsxs(vU,{autoFocus:i,nested:n,onClick:e=>r?.(e),rtl:l,title:a,children:[l&&d,GH.jsx(qH,{dir:u,primaryTypographyProps:{style:c},children:a}),!l&&d]})},e)};const kU=dB(lH)(()=>({marginTop:"-1px"}));var CU,AU,OU,NU,DU=({anchor:e,id:t,onClose:n,open:r,source:i})=>{const{changeTo:o,drillUp:a,setActiveField:s}=i.action,{breadcrumbs:l,group:c,id:u,text:d}=i.info,{alternatives:f}=i.data,{index:h,isCyclic:p,isDrillDown:m}=i.meta,{translator:g}=i.resources,{focus:y}=i.services,v={isChanging:!1},b=QL.useRef(),x=()=>{const e=document.activeElement;b?.current?.contains(e)&&e.blur(),n()},S=p||m,M=GH.jsx(EU,{id:u,meta:i.meta,onClick:x,selected:!S,source:i,text:S?c.name:d},u),w=S&&c.items.map(e=>GH.jsx(EU,{id:e.id,nested:!0,onClick:t=>((e,t)=>{v.isChanging||(v.isChanging=!0,"keydown"!==e.type&&"keyup"!==e.type||y.queueFor(h),p&&s({fieldIndex:t.index}),m&&a({steps:l.length-t.index}))})(t,e),selected:e.current,source:i,text:e.text})),E=f.map((e,t)=>GH.jsxs(e_.Fragment,{children:[GH.jsx(EU,{id:e.id,meta:e.meta,onClick:t=>{return n=t,r=e.id,void(v.isChanging||(v.isChanging=!0,"keydown"!==n.type&&"keyup"!==n.type||y.queueFor(h),o({id:r})));var n,r},source:i,text:e.text},e.id),t<f.length-1&&GH.jsx(kU,{},`divider-${e.id}`)]},e.id));return GH.jsx(VH,{anchorEl:e,anchorOrigin:{vertical:"top",horizontal:"center"},disableRestoreFocus:!0,id:t,onClose:x,open:r,ref:b,slotProps:{paper:{style:{minWidth:"250px",maxWidth:"640px",maxHeight:"300px"}}},transformOrigin:{vertical:"bottom",horizontal:"center"},children:GH.jsxs(vH,{"aria-label":g.get("Accessibility.Popover.Instructions"),dense:!0,children:[M,w,GH.jsx(kU,{},`divider-${u}`),E]})})},TU=({source:e})=>{const[t,n]=QL.useState(null),r={id:t?"alternatives-popover":void 0,isOpen:Boolean(t)},{direction:i}=e.layout,{index:o}=e.meta,{focus:a}=e.services,s=()=>{n(null)};QL.useEffect(()=>{r.isOpen&&s()},[e.info.key]);const l=GH.jsx(uU,{source:e}),c=GH.jsx(yU,{source:e});return GH.jsxs(GH.Fragment,{children:["rtl"===i?void 0:c,"rtl"===i?void 0:l,GH.jsx(oU,{onClick:e=>{const{currentTarget:t}=e;t.classList.contains("qcm-focus-visible")&&a.queueFor(o),n(t)},isOpen:r.isOpen,popoverId:r.id,source:e}),GH.jsx(DU,{anchor:t,id:r.id,onClose:s,open:r.isOpen,source:e}),"rtl"===i?c:void 0,"rtl"===i?l:void 0]})},qU=function(){if(AU)return CU;AU=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 CU=function e(){var t,n,r,l,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=s(d,n),d!==(l=s(t,n))&&(p&&l&&(o(l)||(c=i(l)))?(c?(c=!1,u=r&&i(r)?r:[]):u=r&&o(r)?r:{},a(d,{name:n,newValue:e(p,u,l)})):void 0!==l&&a(d,{name:n,newValue:l}));return d},CU}(),IU=HH(qU),RU={},LU=HH((OU||(OU=1,NU=RU,(()=>{var e={370:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},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),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{default:()=>Oe});var i=n(370),o=n.n(i);const a=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},s=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},l={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 c="".concat(" ","(").concat("　"),u="".concat("　",")").concat(" ");function d(e){return c+e+u}function f(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 h(e){return!(!e.fullAccumulation&&!e.fullRange)}function p(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function m(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 g(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function y(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function v(e){return void 0===e?")":", 0, ".concat(e,")")}function b(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function x(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 S(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=x(f(r[0],i),g(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var u=f(r[0],i),d=f(r[1],i),h=g(0),p=g(1),m=x(u,h),y=x(d,p);return"".concat(a,"({1<").concat(m,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function M(e){return"".concat(e,"(")}function w(e){var t=e.properties,n=e.layout;return s(t,"qHyperCubeDef.qDimensions",s(n,"qHyperCube.qDimensionInfo",[])).length}const E={isFullRange:h,getNumDimensions:w,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=d(m(t));if(!n.showExcludedValues)return a;var s=S({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var c=g(0);return"If(Count(".concat(c,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var u=g(0),f=g(1);return"If(Count(".concat(u,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:p,getNumStepComp:function(e,t){if(!h(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return p(e,t)},getAboveCompPrefix:y,getAboveCompSuffix:v,getAboveComp:function(e,t,n,r){return y(e,t)+n+v(r)},getFunctionPrefix:M,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return M(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:S,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout;return 0===function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t)&&2===w({properties:n,layout:r})},getDimComp:function(e,t){var n=function(e){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0].qDef.qSortCriterias[0]}(e,t),r=g(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:m,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(c);if(-1!==n){var r=t.indexOf(u);if(-1!==r)return t.substring(n+c.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:f,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=w({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:d,canExtract:function(e){var t=e.indexOf(c),n=e.indexOf(u);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:g,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=l.OPTIONS.find(function(t){return t.value===e.decomposition});return t?l.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(l.EXPRESSIONS).find(function(n){var r=e.qDef.base.qDef.toLowerCase()||e.qDef.qDef.toLowerCase();return l.EXPRESSIONS[n]&&r.includes(l.EXPRESSIONS[n].toLowerCase())&&(t=n),n}),t}};function k(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 C(e){return C="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},C(e)}var A=o().bind(null,!0),O={},N=Array.isArray;function D(e){return null!=e&&!Array.isArray(e)&&"object"===C(e)}function T(e){return void 0===e}function q(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function I(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]=T(e[n||t])?o:e[t],e=e[n||t]}}),e}function R(e,t){var n=!0;if(D(e)&&D(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){R(e[r],t[r])||(n=!1)}),n);if(N(e)&&N(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!R(e[r],t[r]))return!1;return!0}return e===t}O.generate=function(e,t,n){n=n||"";var r=[];return Object.keys(t).forEach(function(i){var o=function(e){return e?A({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);R(o,a)||q(t,i)||(T(a)?r.push({op:"add",path:s,value:o}):D(o)&&D(a)?r=r.concat(O.generate(a,o,s)):N(o)&&N(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&T(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(R(t,i))return r;if(!T(t[0])&&T(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(O.generate(i[s],t[o],"".concat(n,"/").concat(s)));for(var l=0,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){T(t[i])&&!q(e,i)&&r.push({op:"remove",path:"".concat(n,"/").concat(i)})}),r},O.apply=function(e,t){t.forEach(function(t){var n,r,i=I(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(N(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(N(a)&&N(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return k(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}else if(D(a)&&D(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!q(n,e)&&delete n[e]}),A(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=I(e,t.from);N(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(N(i)?i.splice(+o,1):delete i[o])})},O.clone=function(e){return A({},e)},O.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},O.updateObject=function(e,t){Object.keys(e).length?O.apply(e,O.generate(e,t)):A(e,t)};const L=O;var _="accumulation";function P(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===_)return n[r]}function z(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===_)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var F={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const j={translationKey:"properties.modifier.accumulation",needDimension:E.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return E.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,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=E.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=E.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=E.getNumStepComp(n,l),f=E.getAboveComp(n,l,u,d),h=E.getRangeComp("RangeSum",f);if(E.needDimension({modifier:n,properties:r,layout:i})){var p=E.getDimComp(c,1),m=E.getDimComp(c,0),g=E.getAggrComp(h,p,m);h=n.showExcludedValues?E.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,valueComp:g}):g}return h},extractInputExpression:E.extractInputExpression,initModifier:function(e){E.initModifier(e,F)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!E.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(z(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(z(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(z(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(z(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=P(t,e);if(n){var r=n.steps;n.steps="number"!=typeof r||Number.isNaN(r)?6:Math.abs(r)}},show:function(t){var n=P(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return E.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(_))return!1;var o=P(t,e);return o&&!o.disabled}}}};var $="movingAverage";function B(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===$)return n[r]}function V(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===$)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var H={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const U={translationKey:"properties.modifier.movingAverage",needDimension:E.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return E.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,o=e.layout,a=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=a;void 0===c&&(c=E.getNumDimensions({properties:i,layout:o}));var u=s(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=E.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),h=E.getNumStepComp(r,c),p=E.getAboveComp(r,c,f,h);if(r.nullSuppression)t=E.getRangeComp("RangeAvg",p);else{var m=E.getRangeComp("RangeSum",p),g=function(e,t){var n=E.getRowNoComp(e,t);if(!E.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(E.needDimension({modifier:r,properties:i,layout:o})){var v=E.getDimComp(u,1),b=E.getDimComp(u,0),x=E.getAggrComp(y,v,b);y=r.showExcludedValues?E.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:E.extractInputExpression,initModifier:function(e){E.initModifier(e,H)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.movingAverage.disclaimer",show:function(e,t){return!E.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(V(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(V(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(V(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(V(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=B(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=B(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(V(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(V(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return E.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf($))return!1;var o=B(t,e);return o&&!o.disabled}}}};var W="timeSeriesDecomposition";function Y(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===W)return n[r]}function K(e,t){var n=function(e,t){var n=s(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===W)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var G={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const X={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:E.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return E.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?E.generateTSDExpression(n,t,r):t},extractInputExpression:E.extractInputExpression,initModifier:function(e,t){E.initModifier(e,G),""===e.decomposition&&t&&(e.decomposition=E.getDecomposition(t))},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.timeSeriesDecomposition||"properties.modifier.timeSeriesDecomposition",show:function(e,t){return!E.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(K(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:l.OPTIONS},steps:{refFn:function(t){return"".concat(K(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=Y(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=Y(t,e);return n&&!n.fullRange}}},show:function(e,t){return E.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(W))return!1;var o=Y(t,e);return o&&!o.disabled}}}};var J="difference";function Z(e,t){var n=function(e,t){var n=s(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 Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:E.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return E.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:E.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=E.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=E.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=E.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(E.needDimension({modifier:n,properties:r,layout:i})){var h=E.getDimComp(c,1),p=E.getDimComp(c,0),m=E.getAggrComp(f,h,p);f=n.showExcludedValues?E.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:a,funcComp:"Only",valueComp:m}):m}return f},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[t])})},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.difference.disclaimer",show:function(e,t){return!E.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.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(Z(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(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return E.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=function(e,t){var n=s(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===J)return n[r]}(t,e);return o&&!o.disabled}}}};var te="normalization";function ne(e,t){var n=s(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=s(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(E.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(E.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return E.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:E.extractInputExpression,generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties,i=e.layout,o=e.numDimensions,a=e.dimensionAndFieldList;if(!n)return t;var l=o;void 0===l&&(l=E.getNumDimensions({properties:r,layout:i}));var c=s(r,"qHyperCubeDef.qDimensions",[]),u=E.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:a}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a,s){var l=ae(t),c=se(t,n,r),u=""===l&&""===c?"":l||c,d=le(i,o),f=ce(i,o,a),h=function(e){for(var t=[],n=0;n<e;n++)t[n]=E.getDimDefWithWrapper(n);return t.join(", ")}(o);return s?"(If(".concat(e," < 0, null(), ").concat(e,"))/ Sum(").concat(u," ").concat(d).concat(f," Aggr(").concat(u," RangeMax( 0, ").concat(e,"), ").concat(h,"))"):"".concat(e,"/ Sum(").concat(u," ").concat(d).concat(f," Aggr(").concat(u," ").concat(e,", ").concat(h,"))")}(u,d,n.field,n.value,f,l,n.primaryDimension,n.ignoreNegative)},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]:{};return{type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!E.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 E.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}}},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="library id deleted",fe="qDef.qDef",he="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId",ge="qDef.qLabel",ye="qDef.qLabelExpression",ve="qDef.base.qLabel",be="qDef.base.qLabelExpression",xe="qDef.qAggrFunc",Se="qDef.base.qAggrFunc",Me="qDef.base";const we={getExpression:function(e){var t=s(e,he);return void 0!==t?t:s(e,fe)},getExpressionRef:function(e){return void 0!==s(e,he)?he:fe},getLibraryIdRef:function(e){return s(e,me)?me:pe},getLibraryId:function(e){return s(e,me)||s(e,pe)},getLabelRef:function(e){return s(e,Me)?ve:ge},getLabelExpressionRef:function(e){return s(e,Me)?be:ye}};var Ee={initBase:function(e,t){(t||Ee.isValid(e))&&(a(e,he,s(e,fe)),a(e,me,s(e,pe)),a(e,ve,s(e,ge)),a(e,be,s(e,ye)))},restoreBase:function(e){Ee.isValid(e)&&(a(e,fe,s(e,he)),a(e,pe,s(e,me)),a(e,ge,s(e,ve)),a(e,ye,s(e,be)),s(e,xe)&&s(e,Se)&&a(e,xe,s(e,Se)),delete e.qDef.base)},isValid:function(e){var t=s(e,he),n=s(e,me);return void 0!==t||void 0!==n}};const ke=Ee;function Ce(e){return Ce="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},Ce(e)}var Ae={accumulation:j,movingAverage:U,difference:ee,normalization:ue,timeSeriesDecomposition:X};const Oe={modifiers:Ae,apply:De,applyModifiers:Te,cleanUpMeasure:qe,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:Ie,getActiveModifier:Re,initBase:ke.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return Ae[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return Ae[e]&&Ae[e].isApplicable({properties:n,layout:r})})},measureBase:we,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=Pe(e);He({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ge({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:Le};var Ne={};function De(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.model,n=e.properties,r=e.isSnapshot,i=void 0!==r&&r,a=e.masterItem,l=!1;Ne[t.id]=Ne[t.id]||{isFirstTime:!0};var c=Ne[t.id].isFirstTime;if(Ne[t.id].isFirstTime=!1,n&&"object"===Ce(n))return Te({model:t,properties:n});var u=t?t.layout:void 0,d=s(u,"qSelectionInfo.qInSelections");if(i||d)return Promise.resolve(l);var f=s(u,"qHyperCube.qMeasureInfo"),h=Ne[t.id].lastReloadTime;if(Ne[t.id].lastReloadTime=s(t,"app.layout.qLastReloadTime"),Ie({measures:f,layout:u})){var p=function(e){var t=e.measures,n=e.layout,r=e.lastReloadTime;return s(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 Ve({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:f,layout:u,model:t,lastReloadTime:h});return p||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 He({modifiers:Pe(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:f,layout:u,masterItem:a,isFirstTime:c})?t.getEffectiveProperties().then(function(e){var n=o()(!0,{},e);Fe(n);var r=Xe(n);return Ue({model:t}).then(function(i){return We({libraryIds:r,model:t}).then(function(r){return p&&function(e){var t=e.properties;_e(t).forEach(function(e){return function(e){var t=e.measure;if(Ve({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Ce(e)&&!e.disabled){if(n++,"object"!==Ce(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(n>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");var r=Ae[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&$e(t)&&E.simplifyExpression(t.qDef.base.qDef)!==E.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:n}),Te({model:t,oldProperties:e,properties:n,runUpdateIfChange:!0,masterItem:a,libraryItemsProps:r,dimensionAndFieldList:i})})}).catch(function(){return Promise.resolve(l)})}):Promise.resolve(l)}return function(e){return!!Array.isArray(e)&&e.some(function(e){return"object"===Ce(e.base)})}(f)?t.getEffectiveProperties().then(function(e){return function(e){var t=e.model,n=e.properties,r=Xe(n);return Je({model:t,libraryIds:r}).then(function(){var e=o()(!0,{},n);return _e(n).forEach(function(e){return qe(e)}),Ke({oldProperties:e,newProperties:n,model:t})})}({model:t,properties:e})}):Promise.resolve(l)}function Te(e){var t=e.model,n=e.oldProperties,r=e.properties,i=e.measures,a=e.runUpdateIfChange,l=void 0!==a&&a,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===n&&(n=l?o()(!0,{},r):r),Fe(r);var f=Xe(r);return Je({model:t,libraryIds:f,masterItem:c}).then(function(){return function(e){var t=e.measures,n=e.properties,r=e.model,i=e.libraryItemsProps,a=e.dimensionAndFieldList;if(t||(t=_e(n)),!t.length)return Promise.resolve();if(!i&&!Ie({measures:t,properties:n}))return t.forEach(function(e){return qe(e)}),Promise.resolve();var l=i?void 0:Xe(n);return Ue({model:r,dimensionAndFieldList:a}).then(function(e){return We({libraryIds:l,model:r,libraryItemsProps:i}).then(function(r){t.forEach(function(t){var i=t.qDef.modifiers;r&&He({modifiers:i,properties:n})?(function(e){var t=e.measure,n=e.properties,r=e.libraryItemsProps,i=e.dimensionAndFieldList,a=0;ke.isValid(t)||ke.initBase(t,!0);var l=t.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Ce(e)&&!e.disabled){if(a++,"object"!==Ce(Ae[e.type]))throw new Error('Modifier "'.concat(e.type,'" is not available'));if(a>1)throw new Error("More than 1 modifier on a measure! (not yet supported)");Ae[e.type].initModifier(e,t);var l=t.qLibraryId||u&&u.qLibraryId;l?function(e){var t=e.measure,n=e.modifier,r=e.properties,i=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:Ae[n.type].generateExpression({expression:s,modifier:n,properties:r,dimensionAndFieldList:i});n.outputExpression=l,t.qDef.qDef=n.outputExpression,(t.qDef.qLabel||a.qMeasure.qLabel)&&(t.qDef.qLabel=t.qDef.base.qLabel||a.qMeasure.qLabel),(t.qDef.qLabelExpression||a.qMeasure.qLabelExpression)&&(t.qDef.qLabelExpression=a.qMeasure.qLabelExpression),t.qDef.quarantine&&t.qDef.quarantine.qNumFormat&&a.qMeasure.qNumFormat&&(t.qDef.qNumFormat=t.qDef.base.qNumFormat||a.qMeasure.qNumFormat,t.qDef.isCustomFormatted=a.qMeasure.isCustomFormatted),delete t.qLibraryId,t.qDef.coloring=a.qMeasure.coloring,n.base=o()(!0,{},t.qDef.base)}({measure:t,modifier:e,libraryId:l,properties:n,libraryItemsProps:r,dimensionAndFieldList:i}):function(e){var t=e.measure,n=e.modifier,r=e.properties,i=e.dimensionAndFieldList;"function"==typeof Ae[n.type].updateModifier&&Ae[n.type].updateModifier(n,r.qHyperCubeDef);var a=we.getExpression(t),s=""===a?a:Ae[n.type].generateExpression({expression:a,modifier:n,properties:r,dimensionAndFieldList:i});n.outputExpression=s,t.qDef.qDef=n.outputExpression,t.qDef.base.qLabelExpression?t.qDef.qLabelExpression=t.qDef.base.qLabelExpression:t.qDef.qLabel=t.qDef.base.qLabel||a,n.base=o()(!0,{},t.qDef.base)}({measure:t,modifier:e,properties:n,dimensionAndFieldList:i}),function(e){var t=s(e,"qDef.qAggrFunc");"Expr"!==t||Le(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&Le(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(t)}})}({measure:t,properties:n,libraryItemsProps:r,dimensionAndFieldList:e}),je(t)):qe(t)})})})}({measures:i,properties:r,model:t,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Ke({oldProperties:n,newProperties:r,model:t}):Promise.resolve(!1)})}).catch(function(){return Promise.resolve(!1)})}function qe(e){!function(e){var t=Pe(e);return Array.isArray(t)&&t.some(function(e){return"object"===Ce(e)&&!e.disabled&&!Ae[e.type]})}(e)?ke.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,je(e)}function Ie(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return He({modifiers:Pe(e),properties:n,layout:r})})}function Re(e){var t=Pe(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(Ae[r.type]&&!r.disabled)return r}}function Le(e){var t=Re(e);return!t||Ae[t.type].enableTotalsFunction(e)}function _e(e){return s(e,"qHyperCubeDef.qMeasures",[]).concat(s(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function Pe(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function ze(e){return s(e,"outputExpression.qValueExpression.qExpr")||s(e,"outputExpression")}function Fe(e){_e(e).forEach(function(e){return function(e){var t=Re(e);t&&(void 0!==t.outputExpression&&ze(t)!==e.qDef.qDef?delete e.qDef.base:!ke.isValid(e)&&t.base&&(e.qDef.base=o()(!0,{},t.base)))}(e)})}function je(e){var t=Pe(e);Array.isArray(t)&&t.forEach(function(t){"object"===Ce(t)&&(t.disabled||!Ae[t.type]&&ze(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function $e(e){return e.base||e.qDef&&e.qDef.base}function Be(e){var t=$e(e);return e.qLibraryId||t&&t.qLibraryId}function Ve(e){var t=e.measure,n=e.properties,r=e.layout;return!Be(t)&&He({modifiers:Pe(t),properties:n,layout:r})}function He(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Ce(e)||e.disabled||!Ae[e.type])&&(void 0===i[e.type]&&(i[e.type]=Ae[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ue(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 We(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}).catch(function(){return null})}function Ye(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Ke(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(s(t,"qHyperCubeDef.qMeasures"),Ye)!==JSON.stringify(s(n,"qHyperCubeDef.qMeasures"),Ye)||JSON.stringify(s(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ye)!==JSON.stringify(s(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Ye);return i?function(e){var t=e.model,n=e.oldProperties,r=e.newProperties,i=t.layout;return i&&!i.qHasSoftPatches&&!i.qExtendsId&&s(i,"qMeta.privileges",[]).indexOf("update")>-1?t.setProperties(r):function(e,t,n){if(!e)return Promise.resolve();var r=L.generate(t,n);return o()(!0,t,n),r&&r.length?(r=r.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(r,!0)):Promise.resolve()}(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ge(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Ce(e)&&!e.disabled&&Ae[e.type]&&Ae[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=Pe(t);if(He({modifiers:r,properties:e})){var o=Be(t);o&&n.push(o),i=i||Ge({modifiers:r,properties:e})}}),s(e,"qHyperCubeDef.qDimensions",[]).forEach(function(e){var t=e.qLibraryId;t&&r.push(t)}),{measureLibraryIds:n,dimensionLibraryIds:r}}function Je(e){var t=e.model,n=e.libraryIds,r=e.masterItem;return!r&&r!==de&&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={},o={},a={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=s(e,"qInfo.qType");return n&&a[n]&&a[n].forEach(function(n){t[n]=s(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(){Object.keys(r).forEach(function(e){i[e]||o[e]||(r[e].listener.dispose(),r[e].unbindCloseListnener(),delete r[e])})}var d=function(e,t){return e.once("closed",t),function(){return e.removeListener("closed",t)}};function f(e,i){return t.app[i](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),unbindCloseListnener:d(t,function(){return e=t.id,n(de),delete r[e],void u();var e}),enabled:!1,properties:l(t.layout)}}).catch(function(){})}return{subscribe:function(e){var n=e.measureLibraryIds,a=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),o={},t.forEach(function(e){o[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:a}),u(),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(f(e,"getMeasure"))}),Object.keys(o).forEach(function(e){o[e]&&!r[e]&&s.push(f(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose(),r[e].unbindCloseListnener()}),r={}}}}({model:t,callback:function(e){return De({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),Ne[t.id].masterItemSubscriber.subscribe(n)):Promise.resolve()}for(var Ze in NU.default=r.default,r)-1===["default"].indexOf(Ze)&&(NU[Ze]=r[Ze]);Object.defineProperty(NU,"__esModule",{value:!0})})()),RU));function _U(e){return Array.isArray(e)}function PU(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function zU(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function FU(e){return void 0===e}function jU(e,t){if(PU(e)&&PU(t)){if(Object.keys(e).length!==Object.keys(t).length)return!1;const n=Object.keys(e);for(let r=0,i=n.length;r<i;r+=1)if(!jU(e[n[r]],t[n[r]]))return!1;return!0}if(_U(e)&&_U(t)){if(e.length!==t.length)return!1;for(let n=0,r=e.length;n<r;n+=1)if(!jU(e[n],t[n]))return!1;return!0}return e===t}function $U({oldData:e={},newData:t={},basePath:n=""}){const r=[];return Object.keys(t).forEach(i=>{const o=function(e){return e?IU(!0,{},{value:e}).value:e}(t[i]),a=e[i],s=`${n}/${i}`;jU(o,a)||zU(t,i)||(FU(a)?r.push({op:"add",path:s,value:o}):PU(o)&&PU(a)?r.push(...$U({oldData:a,newData:o,basePath:s})):_U(o)&&_U(a)?r.push(...(({oldArray:e,newArray:t,basePath:n})=>{const r=[];return jU(t,e.slice())||(!FU(t[0])&&FU(t[0].qInfo)||0===t.length)&&r.push({op:"replace",path:n,value:t}),r})({oldArray:a,newArray:o,basePath:s})):r.push({op:"replace",path:s,value:o}))}),Object.keys(e).forEach(i=>{FU(t[i])&&!zU(e,i)&&r.push({op:"remove",path:`${n}/${i}`})}),r}async function BU({from:e,to:t,model:n,container:r,filtered:i,noModelDependencies:o,skipAttributeExpressions:a,onChange:s}){if(!n)return;const l=await n.getEffectiveProperties(),c=l.qHyperCubeDef[r].findIndex(t=>t.qDef.cId===e),u=l.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r].findIndex(e=>e.qDef.cId===t),d=IU(!0,{},l),f=d.qHyperCubeDef[r][c],h=d.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][u];h.qAttributeDimensions=f.qAttributeDimensions,f.qAttributeDimensions=[],a||(h.qAttributeExpressions=f.qAttributeExpressions,f.qAttributeExpressions=[]),d.qHyperCubeDef[r][c]=h,d.qHyperCubeDef.qLayoutExclude.qHyperCubeDef[r][u]=f,s({fromItem:f,toItem:h,oldProperties:l,newProperties:d,model:n}),await function({model:e,properties:t,noModelDependencies:n}){return n?LU.apply({model:e,properties:t}):e.modifiers?e.modifiers.apply({model:e,properties:t}):Promise.resolve()}({model:n,properties:d,noModelDependencies:o}),o?function({properties:e,container:t,filtered:n}){const{color:r}=e;if(!r)return;const{auto:i,mode:o}=r;if(i)return;const a=n.map(n=>e.qHyperCubeDef[t][n]?.qDef.cId).filter(e=>void 0!==e),s=e.qHyperCubeDef[t].filter(e=>!a.includes(e.qDef.cId));if("byDimension"===o&&"qDimensions"===t){const{byDimDef:e}=r;if(!e)return;const t=void 0===e.activeDimensionIndex?-1:e.activeDimensionIndex;if(t<0)return;const n=s[t];if(!n)return;if(n.qLibraryId)r.byDimDef={type:"libraryItem",key:n.qLibraryId,label:n.qLibraryId,activeDimensionIndex:t};else{const{qDef:e}=n,i=e.qLabelExpression||e.qFieldLabels&&e.qFieldLabels[0]||e.qFieldDefs[0],o=(l=n.qDef.qFieldDefs[0]).split(" ").length>1&&"="!==l[0]&&"["!==l[0]?`[${l}]`:l;r.byDimDef={type:"expression",key:o,label:i||o,activeDimensionIndex:t}}}var l;if("byMeasure"===o&&"qMeasures"===t){const{byMeasureDef:e}=r;if(!e)return;const t=void 0===e.activeMeasureIndex?-1:e.activeMeasureIndex;if(t<0)return;const n=s[t];if(!n)return;const i=LU.measureBase.getLibraryId(n);if(i){r.byMeasureDef={type:"libraryItem",key:i,label:i,activeMeasureIndex:t};const e=LU.hasActiveModifiers({measures:[n]})?n.qDef.qDef:void 0;e&&(r.byMeasureDef.expression=e)}else{const{qDef:e}=n;r.byMeasureDef={type:"expression",key:e.qDef,label:e.qLabelExpression||e.qLabel||e.qDef,activeMeasureIndex:t}}}}({properties:d,container:r,filtered:i}):n.colorSupport&&n.colorSupport.colorByUpdater(d,"qHyperCubeDef."),function({model:e,oldProperties:t,newProperties:n}){const r=$U({oldData:t,newData:n});e?.applyPatches&&r?.length&&e.applyPatches(r.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),!0)}({model:n,oldProperties:l,newProperties:d})}function VU({callbacks:e,data:t,resources:n,settings:r}){const{onChange:i}=e,{infos:o,filtered:a}=t,{app:s,model:l,translator:c}=n,{noModelDependencies:u,skipAttributeExpressions:d}=r;return o.map((e,t)=>{const{cId:n,qGrouping:r,qGroupFallbackTitles:o,qGroupPos:f,qFallbackTitle:h,qLocked:p,title:m}=e,g="C"===r,y="H"===r,v="N"===r,b="number"==typeof e.explicitColumn?e.explicitColumn:t,x=(t,n)=>{g&&s&&s.getDimension&&s.getDimension(e.qLibraryId).then(e=>{e?.[t](n)}).catch(()=>{})};return{meta:{isCyclic:g,isDrillDown:y,isLocked:!!p,isNormal:v},info:{id:n,key:`${n}-${f}`,text:v?h:o[f],position:f,breadcrumbs:o.slice(0,e.qGroupPos),group:{name:m,items:o.slice(0,y?e.qGroupPos+1:o.length).map((e,t)=>({id:`${n}-item-${t}`,text:e,current:f===t,index:t}))},tooltip:v?void 0:c.get(g?"Tooltip.dimensions.cyclic":"Tooltip.dimensions.drilldown")},action:{changeTo:({id:e})=>BU({from:n,to:e,container:"qDimensions",model:l,filtered:a,noModelDependencies:u,skipAttributeExpressions:d,onChange:i}),drillUp:({steps:e})=>{y&&l&&l?.drillUp("/qHyperCubeDef",b,e)},stepCycle:()=>x("stepCycle",1),setActiveField:({fieldIndex:e})=>x("setActiveField",e)}}})}function HU({callbacks:e,data:t,resources:n,settings:r}){const{onChange:i}=e,{infos:o,filtered:a}=t,{model:s}=n,{noModelDependencies:l,skipAttributeExpressions:c}=r;return o.map(e=>{const{cId:t,qFallbackTitle:n}=e;return{meta:{isNormal:!0},info:{id:t,key:t,text:n},action:{changeTo:({id:e})=>BU({from:t,to:e,container:"qMeasures",model:s,filtered:a,noModelDependencies:l,skipAttributeExpressions:c,onChange:i})}}})}function UU({callbacks:e,data:t,dock:n,key:r,rect:i,resources:o,settings:a,state:s,styling:l}){const c=function({dock:e,rect:t}){const n={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",height:"100%"};return"left"!==e&&"right"!==e||(n.width=`${t.height}px`,n.height=`${t.width}px`,n.transformOrigin="top left"),"left"===e&&(n.transform=`rotate(-90deg) translate(-${t.height}px, 0)`),"right"===e&&(n.transform=`rotate(90deg) translate(0, -${t.width}px)`),n}({dock:n,rect:i}),u=function({callbacks:e,data:t,dock:n,key:r,resources:i,settings:o,state:a,styling:s}){const{alternatives:l,infos:c}=t,{app:u,cache:d,model:f}=i,{isRTL:h,isSnapshot:p,noModelDependencies:m,type:g}=o,y=function({dock:e,isRTL:t}){return"top"!==e&&"bottom"!==e||!t?"ltr":"rtl"}({dock:n,isRTL:h}),v=function({cache:e,key:t}){const n="axis-title-auto-focus_"+t;return{queueFor:t=>e?.set?.(n,{focus:!0,index:t}),shouldFor:t=>{const r=e?.get?.(n),i=!(!r?.focus||r?.index!==t);return i&&e?.set?.(n,{focus:!1}),i}}}({cache:d,key:r}),b=("dimension"===g?VU:HU)({callbacks:e,data:t,resources:i,settings:o});"rtl"===y&&b.reverse();const x={allowed:{change:m?!p:!(!f?.modifiers||!f?.colorSupport||p),reload:!!u&&!p},hasAlternatives:!!l.length,hasCyclic:b.some(e=>e.meta.isCyclic),hasMultiple:c.length>1};return b.map((e,n)=>({data:t,layout:{direction:y},resources:{translator:i.translator},services:{focus:v},settings:o,state:a,styling:s,...e,meta:{...x,...e.meta,index:n,isFirst:0===n,isLast:n===b.length-1}}))}({callbacks:e,data:t,dock:n,key:r,resources:o,settings:a,state:s,styling:l});return GH.jsx("div",{style:c,children:u.map(e=>GH.jsxs(e_.Fragment,{children:[GH.jsx(TU,{source:e}),!e.meta.isLast&&GH.jsx("span",{dir:e.layout.direction,style:{...l.title,lineHeight:"normal"},children:", "})]},e.info.id))})}const WU='"Source Sans Pro", "Arial", "sans-serif"',YU="12px",KU=e=>{const{rect:t,state:n}=e,{callbacks:r,data:i,key:o,layout:a,resources:s,settings:l,style:c}=e.settings;return UU({callbacks:r,data:i,dock:a.dock,key:o,rect:t,resources:s,settings:l,state:n,styling:c})};var GU,XU={renderer:"react",require:["renderer"],disableTriggers:!0,key:"axis-title",defaultSettings:{callbacks:{onChange:()=>{}},data:{alternatives:[],infos:[],filtered:[]},resources:{app:void 0,cache:void 0,model:void 0,selections:void 0,translator:void 0},settings:{isDisabled:()=>!1,isRTL:!1,isSnapshot:!1,noModelDependencies:!1,skipAttributeExpressions:!1,type:"dimension"},style:{title:{color:"#333",fontFamily:WU,fontSize:YU},popover:{color:"#595959CC",fontFamily:WU,fontSize:YU}}},preferredSize(){const{data:e,settings:t,style:n}=this.settings,{alternatives:r}=e,{type:i}=t,{fontSize:o,fontFamily:a}=n.title,s=r.length||"measure"!==i?28:20,l=this.registries.renderer("svg")(),{height:c}=l.measureText({text:"M",fontSize:o,fontFamily:a});return Math.max(s,c)},created(){this.state={inSelections:!1},this.listeners={onSelectionsActivated:()=>{this.state.inSelections=!0,this.renderer.render(KU(this))},onSelectionsDeactivated:()=>{this.state.inSelections=!1}}},beforeMount(){const{selections:e}=this.settings.resources;e&&(e.addListener("activated",this.listeners.onSelectionsActivated),e.addListener("deactivated",this.listeners.onSelectionsDeactivated),e.addListener("canceled",this.listeners.onSelectionsDeactivated))},render(){return KU(this)},beforeUnmount(){const{selections:e}=this.settings.resources;e&&(e.removeListener("activated",this.listeners.onSelectionsActivated),e.removeListener("deactivated",this.listeners.onSelectionsDeactivated),e.removeListener("canceled",this.listeners.onSelectionsDeactivated))}},JU=({dock:e,settings:t})=>{const{label:n}=t,r="center"===e,i=r?{}:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"};return GH.jsx("span",{style:i,title:n,children:r?n:`* ${n}`})},ZU={renderer:"react",disableTriggers:!0,key:"disclaimer",defaultSettings:{settings:{isRTL:!1,label:void 0},style:{fontFamily:'"Source Sans Pro", "Arial", "sans-serif"'}},preferredSize:()=>22,render(){const{rect:e}=this,{layout:t,settings:n,style:r}=this.settings;return function({dock:e,rect:t,settings:n,styling:r}){const{isRTL:i}=n,o=function({dock:e,isRTL:t}){return"top"!==e&&"bottom"!==e||!t?"ltr":"rtl"}({dock:e,isRTL:i}),a=function({dock:e,rect:t,styling:n}){const r={pointerEvents:"auto",display:"flex",justifyContent:"center",alignItems:"center",color:"#404040",fontStyle:"italic",fontSize:"13px",fontFamily:n.fontFamily};return"left"===e&&(r.width=`${t.height}px`,r.transform=`rotate(-90deg) translate(-${t.height}px, 0)`,r.transformOrigin="top left"),"right"===e&&(r.width=`${t.height}px`,r.transform=`rotate(90deg) translate(0, -${t.width}px)`,r.transformOrigin="top left"),"center"===e&&(r.width=`${t.width}px`,r.height=`${t.height}px`,r.color="#404040",r.fontStyle="normal",r.fontSize="1.2em",r.textAlign="center"),"bottom"!==e&&"top"!==e||(r.justifyContent="flex-start",r.alignItems="flex-start"),r}({dock:e,rect:t,styling:r});return GH.jsx("div",{dir:o,style:a,children:GH.jsx(JU,{dock:e,settings:n})})}({dock:t.dock,rect:e,settings:n,styling:r})}},QU={},eW=function(){if(GU)return QU;GU=1;var e=IB;return QU.createRoot=e.createRoot,QU.hydrateRoot=e.hydrateRoot,QU}();const tW=K$({spacing:8,shadows:["none","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 1px 2px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 2px 4px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 4px 10px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)","0px 6px 20px 0px rgba(0,0,0,0.15)"],transitions:{easing:{easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration:{standard:300,short:250,enteringScreen:225,shorter:200,leavingScreen:195,shortest:150,complex:375}},typography:{fontSize:14,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:600,fontWeightBold:700,htmlFontSize:14,fontFamily:"'Source Sans Pro', 'HelveticaNeue', 'Helvetica Neue', Helvetica, Arial, sans-serif",button:{fontWeight:600,fontSize:14,textTransform:"none"}},shape:{borderRadius:3},components:{MuiButtonBase:{defaultProps:{disableRipple:!0,disableTouchRipple:!0,focusVisibleClassName:"qcm-focus-visible"}},MuiButton:{defaultProps:{color:"inherit",disableRipple:!0,focusVisibleClassName:"qcm-focus-visible"},styleOverrides:{root:{height:"32px",lineHeight:"16px",minWidth:"24px",fontSize:141,borderRadius:3,"& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},text:{padding:"8px 16px","&:active":{backgroundColor:"rgba(0, 0, 0, 0.1)"},"&.Mui-focusVisible":{boxShadow:"inset 0 0 0 2px #177FE6"}},outlined:{border:"1px solid rgba(0, 0, 0, 0.15)"},sizeSmall:{fontSize:12,height:"24px","& > svg:only-child, & > i:only-child":{marginLeft:"-7px",marginRight:"-7px"}},sizeLarge:{fontSize:16,height:"40px",lineHeight:"20px","& > i:only-child, & > svg:only-child":{marginLeft:"-9px",marginRight:"-9px"}},textSizeSmall:{padding:"4px 11px"},textSizeLarge:{padding:"10px 19px"}},variants:[]},MuiList:{styleOverrides:{padding:{paddingTop:"0px",paddingBottom:"0px"}}},MuiListItemButton:{styleOverrides:{root:{fontSize:14,height:"32px"}}},MuiListItemIcon:{styleOverrides:{root:{color:"#404040",minWidth:"16px",marginRight:"16px"}}},MuiListItemText:{styleOverrides:{root:{fontSize:"12px"},primary:{fontSize:14,color:"#404040",lineHeight:"16px",fontWeight:600},secondary:{fontSize:12,color:"#737373",fontWeight:400,lineHeight:"16px"}}}}});function nW(e){const t={x:0,y:0,width:0,height:0,scaleRatio:{x:1,y:1},margin:{left:0,top:0}},{x:n,y:r,width:i,height:o,scaleRatio:a,margin:s}=e||{};return t.x=Number.isNaN(n)||void 0===n?t.x:n,t.y=Number.isNaN(r)||void 0===r?t.y:r,t.width=Number.isNaN(i)||void 0===i?t.width:i,t.height=Number.isNaN(o)||void 0===o?t.height:o,void 0!==a&&(t.scaleRatio.x=Number.isNaN(a.x)?t.scaleRatio.x:a.x,t.scaleRatio.y=Number.isNaN(a.y)?t.scaleRatio.y:a.y),void 0!==s&&(t.margin.left=Number.isNaN(s.left)?0:s.left,t.margin.top=Number.isNaN(s.top)?0:s.top),t}function rW(){const e={rendererBox:nW(),container:void 0,root:void 0},t=()=>{e.root?.unmount(),e.container?.parentElement?.removeChild(e.container),e.container=void 0};return{size:t=>(t&&(e.rendererBox=nW(t)),e.rendererBox),element:()=>e.container,appendTo:t=>(e.container||(e.container=document.createElement("div"),e.container.style.position="absolute",e.container.style["-webkit-font-smoothing"]="antialiased",e.container.style["-moz-osx-font-smoothing"]="antialiased",e.container.style.pointerEvents="none",e.root=eW.createRoot(e.container)),t.appendChild(e.container),e.container),setKey:t=>{e.container&&e.container.setAttribute("data-key",t)},render(t){if(!e.container)return!1;const n=e.rendererBox,r=n.scaleRatio.x,i=n.scaleRatio.y;return e.container.style.left=`${Math.round(n.margin.left+n.x*r)}px`,e.container.style.top=`${Math.round(n.margin.top+n.y*i)}px`,e.container.style.width=`${Math.round(n.width)}px`,e.container.style.height=`${Math.round(n.height)}px`,e.container.style.transform=`scale(${r}, ${i})`,e.container.style.transformOrigin="top left",e.root.render(function({nodes:e}){return GH.jsx(e_.StrictMode,{children:GH.jsx(hB,{theme:tW,children:e})})}({nodes:t})),!0},findShapes:()=>[],itemsAt:()=>[],clear(){t()},destroy(){t()}}}var iW={require:["resolver","symbol"],defaultSettings:{settings:{type:"max",primaryExtremum:()=>{},secondaryExtremum:()=>{},primarySeries:[],secondarySeries:[],separateStacking:!1,orientation:"horizontal",rtl:!1,major:{scale:"major-scale"},markerOffset:1,size:10,isLineStacked:!1},style:{fill:"#999"}},preferredSize(){return this.settings.settings.size},render(){const{items:e=[]}=this.data;if(!e.length)return[];const{type:t,orientation:n,rtl:r,markerOffset:i,size:o,major:a,primarySeries:s,secondarySeries:l,separateStacking:c,isLineStacked:u}=this.settings.settings,d=this.settings.settings.primaryExtremum(),f=this.settings.settings.secondaryExtremum(),h=s.length&&void 0!==d,p=l.length&&void 0!==f;if(!h&&!p)return[];const m=s.map(e=>e.ref),g=l.map(e=>e.ref),y=e.filter(e=>m.includes(e.end?.source?.field||e.point?.source?.field)),v=e.filter(e=>g.includes(e.end?.source?.field||e.point?.source?.field)),b=function({type:e,primaryExtremum:t,secondaryExtremum:n,primaryItems:r=[],secondaryItems:i=[],primarySeries:o=[],secondarySeries:a=[],isLineStacked:s,separateStacking:l}){const c=[],u=[];o.length&&u.push({isPrimary:!0}),a.length&&u.push({isPrimary:!1}),u.forEach(o=>{const a=o.isPrimary?t:n,u=o.isPrimary?r:i;c.push((({type:e,extremum:t,separateStacking:n,items:r,isLineStacked:i})=>{const o="max"===e?e=>e>t:e=>e<t,a=r.filter(e=>o(((e,t,n)=>{const r=n.isMarker?.value;return t?r?n.point.value:n.point.value<0?n.start.value:n.end.value:e&&r?n.point.value:n.end.value})(i,n,e)));return a})({type:e,extremum:a,items:u,isLineStacked:s,separateStacking:l}))});const d=(({items:e})=>{const t=[],n=[];return e.forEach(e=>{const{value:r}=e.major;t[r]||(t[r]=!0,n.push(e))}),n})({items:c.reduce((e,t)=>e.concat(t),[])});return d}({type:t,primaryExtremum:d,secondaryExtremum:f,primaryItems:y,secondaryItems:v,primarySeries:s,secondarySeries:l,separateStacking:c,isLineStacked:u});if(!b.length)return[];const x="horizontal"===n,S=this.rect[x?"width":"height"],M=this.resolver.resolve({data:{items:b},settings:{major:a},scaled:{major:S}}),w=("max"===t?90:-90)-(x?0:90)-(!x&&r?180:0),E=o/2*i,{fill:k}=this.settings.style,C=M.items.map(e=>function({symbol:e,size:t,fill:n,startAngle:r,x:i,y:o,data:a}){return e({type:"n-polygon",show:!0,size:t,fill:n,stroke:"#205891",strokeWidth:0,sides:3,startAngle:r,width:.7,x:i,y:o,data:a})}({symbol:this.symbol,size:o,fill:k,startAngle:w,x:x?S*e.major:E,y:x?E:S*e.major,data:e.data}));return C}};function oW({x:e,y:t,size:n,stroke:r,strokeWidth:i,fill:o}){return{type:"container",children:[{type:"line",stroke:r||o,strokeWidth:i,x1:e-n/2,y1:t,x2:e+n/2,y2:t},{type:"circle",strokeWidth:0,fill:o,cx:e,cy:t,r:.25*n}]}}function aW({chart:e,seriesInfo:t}){const n={primary:{paths:[],linePaths:[],areaPaths:[],lineMap:{},areaMap:{}},secondary:{paths:[],linePaths:[],areaPaths:[],lineMap:{},areaMap:{}}},r=[...t.primary.map(e=>e.key),...t.secondary.map(e=>e.key)],i=e.findShapes("path").filter(e=>r.some(t=>t===e.key));return i.reduce((e,n)=>{let r=t.primary.some(e=>e.key===n.key)?e.primary:e.secondary;return r=Object.hasOwnProperty.call(n.attrs,"stroke-linejoin")?r.linePaths:r.areaPaths,r.push(n),e},n),{getLine:(e,t)=>{const r=t?n.primary:n.secondary;if(!r.lineMap[e]){const[t]=r.linePaths.filter(t=>t.data&&t.data.typeIndex.value===e);r.lineMap[e]=t}return r.lineMap[e]},getArea:(e,t)=>{const r=t?n.primary:n.secondary;if(!r.areaMap[e]){const[t]=r.areaPaths.filter(t=>t.data&&t.data.typeIndex.value===e);r.areaMap[e]=t}return r.areaMap[e]}}}function sW({brush:e}){const t=e.brush.values();return function({value:e}){return-1!==t.indexOf(e)}}function lW({brush:e,chart:t}){const n=e.brush.ranges();if(!n.length)return!1;const r=t&&t.scale(Kf.SCALE.MAJOR),i=r&&r.max&&r.max(),o="qHyperCube/qDimensionInfo/0:numeric"===e.id?(e,t)=>t===i?e<=t:e<t:(e,t)=>e<=t;return function({value:e}){return n.some(t=>t.min<=e&&o(e,t.max))}}function cW({brush:e,selectionInfo:t,items:n,selectionValues:r,colorByData:i,chart:o}){const a=e.brushes();if(!a.length)return[];const s=a[0],{minorRange:l,legendRange:c,legendTap:u}=t,d=0===s.id.indexOf("qHyperCube/qMeasureInfo/")?"qHyperCube/qMeasureInfo/X":s.id;let f=[c?e=>e.color.value:r[d]].filter(Boolean);if(i&&l&&f.push(e=>e.color.value),!i&&u&&(f=[e=>e.color.value]),!f.length)return[];const h=function({brush:e,chart:t}){return("value"===e.type?sW:lW)({brush:e,chart:t})}({brush:s,chart:o});return h?n.reduce((e,t,n)=>(f.some(e=>h({value:e(t)}))&&e.push({item:t,index:n}),e),[]):[]}function uW({d:e}){return e.replace("Z","").split(/(?=[LMC])/).map(e=>{const t=e.substring(0,1),n={letter:t,x:0,y:0,raw:e},r=e.substring(1).split(",");return"M"===t||"L"===t?([n.x]=r,[,n.y]=r):"C"===t&&([,,,,n.x]=r,[,,,,,n.y]=r),n})}function dW({chart:e,selected:t,connection:n,gradient:r,fallback:i}){const o=e.scale(Kf.SCALE.COLOR),a=t.filter(e=>-1!==n.indexOf(e.index)).map(e=>e.item.end.value),s=Math.min(...a),l=Math.max(...a),c=l-s,u=0===c?1:c,d=o.domain().map(e=>({color:o(Math.min(l,Math.max(s,e)))||i,offset:Math.min(1,Math.max(0,(e-s)/u))})),f=d.map(e=>e.offset),h=f.lastIndexOf(0),p=f.indexOf(1),m=d.slice(-1===h?0:h,-1===p?d.length:p+1);return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:m}}function fW({chart:e,selected:t,connection:n,gradient:r,fallback:i}){const o=e.scale(Kf.SCALE.COLOR),a=t.filter(e=>-1!==n.indexOf(e.index)).map(e=>e.item.end.value),s=Math.min(...a),l=Math.max(...a)-s,c=0===l?1:l,u=o.domain(),d=[];for(let e=0;e<u.length-1;e++){const t=u[e],n=o(t)||i;d.push({color:n,offset:Math.min(1,Math.max(0,(t-s)/c))});const r=u[e+1];d.push({color:n,offset:Math.min(1,Math.max(0,(r-s)/c))})}const f=d.map(e=>e.offset),h=f.lastIndexOf(0),p=f.indexOf(1),m=d.slice(-1===h?0:h,-1===p?d.length:p+1);return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:m}}function hW({property:e,chart:t,connection:n,attrs:r,colorSettings:i,colorByData:o,selected:a,hasMultipleMeasures:s,groupedByMeasure:l,itemsPerGroup:c,orientation:u,rtl:d}){const f=r[e];if("gradient"!==f.type)return f;const{type:h,nil:p}=i;if(s||!o)return function({chart:e,selected:t,connection:n,gradient:r,fallback:i,orientation:o,isColorCode:a,groupedByMeasure:s,itemsPerGroup:l,rtl:c}){const u=e.scale(Kf.SCALE.MAJOR),d=e.scale(Kf.SCALE.COLOR),f=s?e=>u([e,0])+u.bandwidth()*l/2:e=>u(e),h=t.filter(e=>-1!==n.indexOf(e.index)),p=("vertical"===o&&c?h.reverse():h).map(e=>e.item),m=p.map(e=>f(e.major.value)),g=Math.min(...m),y=Math.max(...m)-g,v=0===y?1:y,b=m.map((e,t)=>0===t?0:t===m.length-1?1:(e-g)/v),x=[];for(let e=0;e<p.length;e++){const t=p[e],n=a?t.color.value:d(t.color.value)||i,r=b[e];x.push({color:n,offset:0===e?0:Math.max(0,x[x.length-1].offset)}),x.push({color:n,offset:e===p.length-1?1:Math.max(0,parseFloat((r+(b[e+1]-r)/2).toFixed(5)))})}return{type:"gradient",x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,stops:x}}({chart:t,selected:a,connection:n,gradient:f,fallback:p,orientation:u,isColorCode:"color"===h,groupedByMeasure:l,itemsPerGroup:c,rtl:d});return("continuous"===h?dW:fW)({chart:t,selected:a,connection:n,gradient:f,fallback:p})}function pW({chart:e,pathModel:t,colorSettings:n,colorByData:r,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,lineKey:l,primary:c,selected:u,connections:d,rtl:f,count:h}){const p=t.getLine(l,c),{attrs:m}=p,g=uW({d:m.d}),y=d.map(t=>function({chart:e,colorSettings:t,colorByData:n,hasMultipleMeasures:r,groupedByMeasure:i,itemsPerGroup:o,orientation:a,selected:s,connection:l,commands:c,attrs:u,rtl:d,count:f}){const h=l.map((e,t)=>{const n=c[e];return 0!==t||"M"===n.letter?n.raw:`M${n.x},${n.y}`}).join("");return{path:h,attrs:u,stroke:hW({property:"stroke",chart:e,connection:l,attrs:u,selected:s,colorSettings:t,colorByData:n,hasMultipleMeasures:r,groupedByMeasure:i,itemsPerGroup:o,orientation:a,rtl:d})}}({chart:e,colorSettings:n,colorByData:r,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,selected:u,connection:t,commands:g,attrs:m,rtl:f,count:h}));return{lines:y,commands:g}}function mW({chart:e,pathModel:t,seriesInfo:n,brush:r,selectionInfo:i,items:o,selectionValues:a,colorSettings:s,colorByData:l,hasMultipleMeasures:c,groupedByMeasure:u,itemsPerGroup:d,orientation:f,rtl:h,highlightArea:p,isLineStacked:m}){const g=function({items:e,selectionInfo:t,seriesInfo:n}){return e.filter(e=>{if("NaN"===e.end.value||Number.isNaN(e.end.value))return!1;const{minorRange:r,minorRangePrimary:i}=t;return!r||(i?n.primary:n.secondary).some(t=>t.typeIndex===e.typeIndex.value)})}({items:o,selectionInfo:i,seriesInfo:n}),y=function({items:e,seriesInfo:t}){const n=e.reduce((e,n,r)=>{const i=n.typeIndex.value;return e[i]||(e[i]={key:i,items:[],index:r,measureIx:n.colorMeasureIdx?.value,primary:t.primary.some(e=>e.typeIndex===i)}),e[i].items.push(n),e},{});return Object.keys(n).map(e=>n[e]).sort((e,t)=>e.index-t.index).map(e=>({lineKey:e.key,items:e.items,primary:e.primary,measureIx:e.measureIx}))}({items:g,seriesInfo:n}),{lines:v,areas:b}=y.reduce((n,o)=>{const g=cW({brush:r,selectionInfo:i,items:o.items,selectionValues:a,colorByData:l(o.measureIx),chart:e});if(g.length<2)return n;const y=function({selected:e}){return e.reduce((e,t)=>{const{index:n}=t;if(e.length){const t=e[e.length-1];n===t[t.length-1]+1?t.push(n):e.push([n])}else e.push([n]);return e},[]).filter(e=>e.length>1)}({selected:g});if(!y.length)return n;const{lines:v,commands:b}=pW({chart:e,pathModel:t,colorSettings:s(o.measureIx),colorByData:l(o.measureIx),hasMultipleMeasures:c,groupedByMeasure:u,itemsPerGroup:d,orientation:f,lineKey:o.lineKey,primary:o.primary,selected:g,connections:y,rtl:h,count:o.items.length});n.lines.push(...v);const x=function({chart:e,pathModel:t,colorSettings:n,colorByData:r,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,lineKey:l,primary:c,selected:u,connections:d,rtl:f,count:h,commands:p,isLineStacked:m}){const g=t.getArea(l,c);if(!g)return[];const{attrs:y,key:v}=g,b="horizontal"===s,x=e.component(v).rect.computedInner[b?"height":"width"]*e.scale(c?Kf.SCALE.MINOR.PRIMARY:Kf.SCALE.MINOR.SECONDARY)(0),S=[];let M;return d.forEach(e=>{e.forEach((t,n)=>{const r=p[t],i={x:r.x,y:r.y,raw:r.raw};if(0===n||"M"===r.letter||e[n-1]!==e[n]-1)S.push({lines:[i],first:{x:i.x,y:i.y},connection:[e[n]]});else{const t=S[S.length-1];t.lines.push(i),t.connection.push(e[n])}})}),m&&(M=uW({d:y.d}).reduce((e,t,n)=>(0===n||"M"===t.letter?e.push([t]):e[e.length-1].push(t),e),[])),S.map(t=>{const{lines:l}=t,c=l.map((e,t)=>0===t?`M${e.x},${e.y}`:e.raw);if(m){const e=t.connection[0],n=M.reduce((t,n)=>(t.found||(t.counted+=n.length/2,e<t.counted&&(t.areaCommand=n,t.found=!0)),t),{counted:0,found:!1}),r=M.indexOf(n.areaCommand),i=M.reduce((e,t,n)=>(n<r&&(e+=t.length/2),e),0),o=n.areaCommand,a=o.slice(o.length/2,o.length).reverse();t.connection.map(e=>a[e-i].raw).reverse().forEach((e,t)=>{if(0===t&&"C"===e.charAt(0)){const t=e.substring(1).split(","),n={x:0,y:0};[,,,,n.x,n.y]=t,c.push(`L${n.x},${n.y}`)}else c.push(e)})}else{const e=l[l.length-1],n=b?e.x:x,r=b?x:e.y;c.push(`L${n},${r}`);const i=b?t.first.x:x,o=b?x:t.first.y;c.push(`L${i},${o}`)}return c.push("Z"),{path:`M${c.join("").substring(1)}`,attrs:y,fill:hW({property:"fill",chart:e,connection:t.connection,attrs:y,selected:u,colorSettings:n,colorByData:r,hasMultipleMeasures:i,groupedByMeasure:o,itemsPerGroup:a,orientation:s,rtl:f}),key:v}})}({chart:e,pathModel:t,colorSettings:s(o.measureIx),colorByData:l(o.measureIx),hasMultipleMeasures:c,groupedByMeasure:u,itemsPerGroup:d,orientation:f,lineKey:o.lineKey,primary:o.primary,selected:g,connections:y,rtl:h,count:o.items.length,commands:b,isLineStacked:m});return p&&n.areas.push(...x),n},{lines:[],areas:[]}),x=[];return v.forEach(e=>x.push({type:"path",d:e.path,stroke:e.stroke,strokeLinejoin:e.attrs["stroke-linejoin"],strokeWidth:e.attrs["stroke-width"],strokeDasharray:e.attrs["stroke-dasharray"],fill:"none"})),p&&b.forEach(e=>x.push({type:"path",d:e.path,fill:e.fill,opacity:e.attrs.opacity})),x}var gW={require:["chart","renderer"],defaultSettings:{settings:{highlightArea:()=>!0,seriesInfo:{primary:[],secondary:[]},selectionValues:{},colorSettings:void 0,colorByData:!1,isColorCode:!1,hasMultipleMeasures:!1,groupedByMeasure:!1,itemsPerGroup:1,orientation:"vertical",rtl:!1,isLineStacked:!1}},addListener(e,t){this.state.brush.addListener(e,t),this.state.listeners.push({type:e,fn:t})},removeListeners(){this.state.listeners.forEach(e=>this.state.brush.removeListener(e.type,e.fn)),this.state.listeners.length=0},created(){this.state={pathModel:aW({chart:this.chart,seriesInfo:this.settings.settings.seriesInfo}),brush:this.chart.brush("selection"),listeners:[],selectionInfo:{minorRange:!1,minorRangePrimary:!1,legendRange:!1,legendTap:!1}}},mounted(){this.addListener("update",()=>{this.state.selectionInfo=this.settings.settings.getSelectionInfo();const e=mW({chart:this.chart,pathModel:this.state.pathModel,seriesInfo:this.settings.settings.seriesInfo,brush:this.state.brush,selectionInfo:this.state.selectionInfo,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,groupedByMeasure:this.settings.settings.groupedByMeasure,itemsPerGroup:this.settings.settings.itemsPerGroup,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl,highlightArea:this.settings.settings.highlightArea(),isLineStacked:this.settings.settings.isLineStacked});this.renderer.render(e)}),this.addListener("end",()=>{this.renderer.render([])})},render(){this.state.pathModel=aW({chart:this.chart,seriesInfo:this.settings.settings.seriesInfo}),this.state.selectionInfo=this.settings.settings.getSelectionInfo();return mW({chart:this.chart,pathModel:this.state.pathModel,seriesInfo:this.settings.settings.seriesInfo,brush:this.state.brush,selectionInfo:this.state.selectionInfo,items:this.data.items,selectionValues:this.settings.settings.selectionValues,colorSettings:this.settings.settings.colorSettings,colorByData:this.settings.settings.colorByData,isColorCode:this.settings.settings.isColorCode,hasMultipleMeasures:this.settings.settings.hasMultipleMeasures,groupedByMeasure:this.settings.settings.groupedByMeasure,itemsPerGroup:this.settings.settings.itemsPerGroup,orientation:this.settings.settings.orientation,rtl:this.settings.settings.rtl,highlightArea:this.settings.settings.highlightArea(),isLineStacked:this.settings.settings.isLineStacked})},destroyed(){this.removeListeners()}};const yW=()=>{const e=jI();return e.use(DL),e.use(function(e){if("function"!=typeof e.interaction)return t=>{t.interaction("hammer",IL(e))};e.interaction("hammer",IL(Hammer))}(Sv)),e.use(LL),e.renderer("react-qcm",rW),e.component("axis-title",XU),e.component("disclaimer",ZU),e.component("scrollbar",rp),e.component("point-label",Ba),e.component("label-space",KL),e.component("time-axis",Gy.picassoComponents.timeAxis),e.component("axis-overlay",Gy.picassoComponents.axisOverlay),e.component("reference-line-labels",Do),e.component("box-sliced-hat",UL),e.component("box-out-of-bounds",jL),e.component("data-out-of-bounds-marker",iW),e.component("scroll-hint",Ci),e.component("brush-highlighter",gW),e.scale("time",Gy.picassoScales.time),e.symbol("line-point",oW),e},vW=e=>"[object Object]"===Object.prototype.toString.call(e),bW=e=>Array.isArray(e);function xW(e,t){if(e===t)return!0;if(bW(e)){if(!bW(t))return!1;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!xW(e[n],t[n]))return!1;return!0}if(vW(e)){if(!vW(t))return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++){if(!Object.hasOwn(t,n[r]))return!1;if(!xW(e[n[r]],t[n[r]]))return!1}return!0}return e===t}function SW({enable:t=!0}={}){const n=e.useModel(),r=()=>Date.now().toString()+Math.random(),[i,o]=e.useState(r()),a={properties:void 0};return e.useEffect(()=>{if(!n||!n.getEffectiveProperties||!t)return()=>{};const e=()=>{n.getEffectiveProperties().then(e=>{const t=l(!0,{},e);if(!a.properties)return void(a.properties=t);const n=function(e,t){const n={properties:!1,exclude:!1};if(e===t)return n;const r=l(!0,{},e),i=l(!0,{},t);return n.exclude=!xW(r.qHyperCubeDef?.qLayoutExclude,i.qHyperCubeDef?.qLayoutExclude),delete r.qHyperCubeDef?.qLayoutExclude,delete i.qHyperCubeDef?.qLayoutExclude,n.properties=!xW(r,i),n}(a.properties,t);a.properties=t,n.exclude&&!n.properties&&o(r())})};return n.on("changed",e),e(),()=>{n.removeListener("changed",e)}},[t]),i}const MW={line:"bar",circle:"circle",diamond:"diamond",triangle:"triangle",rect:"square"},wW=e=>void 0===e.marker?MW.circle:MW[e.marker],EW=e=>void 0===e.markerFill||e.markerFill;function kW({series:e,layoutService:t}){switch(ag(e)){case Gf.MARKER:return(e=>({marker:wW(e),fill:EW(e)}))(e);case Gf.LINE:return(e=>{const t=e.getLayoutValue("nullMode","gap");return{showAsGaps:"gap"===t,showAsConnections:"connect"===t,showAsZeros:"zero"===t}})(t);case Gf.BAR:return{showAsZeros:!0};default:return{}}}function CW(e=Jf,t=!0){return t?e.axis===Xf.PRIMARY:e.axis===Xf.PRIMARY||ag(e)===Gf.BAR}var AW,OW,NW,DW,TW,qW,IW,RW,LW,_W,PW,zW,FW,jW,$W,BW,VW,HW,UW,WW,YW,KW,GW,XW,JW,ZW,QW,eY,tY,nY,rY,iY,oY,aY,sY,lY,cY,uY,dY,fY,hY,pY,mY,gY,yY,vY,bY,xY,SY,MY,wY,EY,kY,CY,AY,OY,NY,DY,TY,qY,IY,RY,LY,_Y,PY,zY,FY,jY,$Y,BY,VY,HY,UY,WY,YY,KY,GY,XY,JY,ZY,QY,eK,tK,nK,rK,iK,oK,aK,sK,lK,cK,uK={exports:{}};function dK(){if(OW)return AW;OW=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return AW={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}function fK(){if(DW)return NW;DW=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return NW=e}function hK(){return TW||(TW=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=dK(),o=fK(),a=(t=e.exports={}).re=[],s=t.safeRe=[],l=t.src=[],c=t.safeSrc=[],u=t.t={};let d=0;const f="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[f,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=d++;o(e,i,t),u[e]=i,l[i]=t,c[i]=r,a[i]=new RegExp(t,n?"g":void 0),s[i]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),p("MAINVERSION",`(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})\\.(${l[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})\\.(${l[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[u.NONNUMERICIDENTIFIER]}|${l[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASE",`(?:-(${l[u.PRERELEASEIDENTIFIER]}(?:\\.${l[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${f}+`),p("BUILD",`(?:\\+(${l[u.BUILDIDENTIFIER]}(?:\\.${l[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[u.MAINVERSION]}${l[u.PRERELEASE]}?${l[u.BUILD]}?`),p("FULL",`^${l[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[u.MAINVERSIONLOOSE]}${l[u.PRERELEASELOOSE]}?${l[u.BUILD]}?`),p("LOOSE",`^${l[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:\\.(${l[u.XRANGEIDENTIFIER]})(?:${l[u.PRERELEASE]})?${l[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[u.XRANGEIDENTIFIERLOOSE]})(?:${l[u.PRERELEASELOOSE]})?${l[u.BUILD]}?)?)?`),p("XRANGE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[u.GTLT]}\\s*${l[u.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${l[u.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[u.COERCEPLAIN]+`(?:${l[u.PRERELEASE]})?`+`(?:${l[u.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[u.COERCE],!0),p("COERCERTLFULL",l[u.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[u.LONETILDE]}${l[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[u.LONECARET]}${l[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[u.LONECARET]}${l[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[u.GTLT]}\\s*(${l[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[u.GTLT]}\\s*(${l[u.LOOSEPLAIN]}|${l[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[u.XRANGEPLAIN]})\\s+-\\s+(${l[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(uK,uK.exports)),uK.exports}function pK(){if(IW)return qW;IW=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return qW=n=>n?"object"!=typeof n?e:n:t}function mK(){if(LW)return RW;LW=1;const e=/^[0-9]+$/,t=(t,n)=>{if("number"==typeof t&&"number"==typeof n)return t===n?0:t<n?-1:1;const r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:t<n?-1:1};return RW={compareIdentifiers:t,rcompareIdentifiers:(e,n)=>t(n,e)},RW}function gK(){if(PW)return _W;PW=1;const e=fK(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=dK(),{safeRe:r,t:i}=hK(),o=pK(),{compareIdentifiers:a}=mK();class s{constructor(a,l){if(l=o(l),a instanceof s){if(a.loose===!!l.loose&&a.includePrerelease===!!l.includePrerelease)return a;a=a.version}else if("string"!=typeof a)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof a}".`);if(a.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",a,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const c=a.trim().match(l.loose?r[i.LOOSE]:r[i.FULL]);if(!c)throw new TypeError(`Invalid Version: ${a}`);if(this.raw=a,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<n)return t}return e}):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof s)){if("string"==typeof t&&t===this.version)return 0;t=new s(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof s||(e=new s(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(t){if(t instanceof s||(t=new s(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=t.prerelease[n];if(e("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return a(r,i)}while(++n)}compareBuild(t){t instanceof s||(t=new s(t,this.options));let n=0;do{const r=this.build[n],i=t.build[n];if(e("build compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return a(r,i)}while(++n)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];if(!1===n&&(r=[t]),((e,t)=>{const n=t.split(".");if(n.length>e.length)return!1;for(let t=0;t<n.length;t++)if(0!==a(e[t],n[t]))return!1;return!0})(this.prerelease,t)){const e=this.prerelease[t.split(".").length];isNaN(e)&&(this.prerelease=r)}else this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return _W=s}function yK(){if(FW)return zW;FW=1;const e=gK();return zW=(t,n,r=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(e){if(!r)return null;throw e}},zW}function vK(){if(rY)return nY;rY=1;const e=gK();return nY=(t,n,r)=>new e(t,r).compare(new e(n,r)),nY}function bK(){if(cY)return lY;cY=1;const e=gK();return lY=(t,n,r)=>{const i=new e(t,r),o=new e(n,r);return i.compare(o)||i.compareBuild(o)},lY}function xK(){if(mY)return pY;mY=1;const e=vK();return pY=(t,n,r)=>e(t,n,r)>0,pY}function SK(){if(yY)return gY;yY=1;const e=vK();return gY=(t,n,r)=>e(t,n,r)<0,gY}function MK(){if(bY)return vY;bY=1;const e=vK();return vY=(t,n,r)=>0===e(t,n,r),vY}function wK(){if(SY)return xY;SY=1;const e=vK();return xY=(t,n,r)=>0!==e(t,n,r),xY}function EK(){if(wY)return MY;wY=1;const e=vK();return MY=(t,n,r)=>e(t,n,r)>=0,MY}function kK(){if(kY)return EY;kY=1;const e=vK();return EY=(t,n,r)=>e(t,n,r)<=0,EY}function CK(){if(AY)return CY;AY=1;const e=MK(),t=wK(),n=xK(),r=EK(),i=SK(),o=kK();return CY=(a,s,l,c)=>{switch(s){case"===":return"object"==typeof a&&(a=a.version),"object"==typeof l&&(l=l.version),a===l;case"!==":return"object"==typeof a&&(a=a.version),"object"==typeof l&&(l=l.version),a!==l;case"":case"=":case"==":return e(a,l,c);case"!=":return t(a,l,c);case">":return n(a,l,c);case">=":return r(a,l,c);case"<":return i(a,l,c);case"<=":return o(a,l,c);default:throw new TypeError(`Invalid operator: ${s}`)}},CY}function AK(){if(LY)return RY;LY=1;const e=/\s+/g;class t{constructor(n,r){if(r=i(r),n instanceof t)return n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease?n:new t(n.raw,r);if(n instanceof o)return this.raw=n.value,this.set=[[n]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=n.trim().replace(e," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!y(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&v(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(g,"");const t=((this.options.includePrerelease&&p)|(this.options.loose&&m))+":"+e,n=r.get(t);if(n)return n;const i=this.options.loose,s=i?l[u.HYPHENRANGELOOSE]:l[u.HYPHENRANGE];e=e.replace(s,D(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(l[u.COMPARATORTRIM],d),a("comparator trim",e),e=e.replace(l[u.TILDETRIM],f),a("tilde trim",e),e=e.replace(l[u.CARETTRIM],h),a("caret trim",e);let c=e.split(" ").map(e=>x(e,this.options)).join(" ").split(/\s+/).map(e=>N(e,this.options));i&&(c=c.filter(e=>(a("loose invalid filter",e,this.options),!!e.match(l[u.COMPARATORLOOSE])))),a("range list",c);const v=new Map,b=c.map(e=>new o(e,this.options));for(const e of b){if(y(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const S=[...v.values()];return r.set(t,S),S}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(t=>b(t,n)&&e.set.some(e=>b(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(T(this.set[t],e,this.options))return!0;return!1}}RY=t;const n=(IY||(IY=1,qY=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}),qY),r=new n,i=pK(),o=OK(),a=fK(),s=gK(),{safeRe:l,src:c,t:u,comparatorTrimReplace:d,tildeTrimReplace:f,caretTrimReplace:h}=hK(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:m}=dK(),g=new RegExp(c[u.BUILD],"g"),y=e=>"<0.0.0-0"===e.value,v=e=>""===e.value,b=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},x=(e,t)=>(e=e.replace(l[u.BUILD],""),a("comp",e,t),e=E(e,t),a("caret",e),e=M(e,t),a("tildes",e),e=C(e,t),a("xrange",e),e=O(e,t),a("stars",e),e),S=e=>!e||"x"===e.toLowerCase()||"*"===e,M=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{const n=t.loose?l[u.TILDELOOSE]:l[u.TILDE],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,i,o,s)=>{let l;return a("tilde",e,t,n,i,o,s),S(n)?l="":S(i)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:S(o)?l=`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:s?(a("replaceTilde pr",s),l=`>=${n}.${i}.${o}-${s} <${n}.${+i+1}.0-0`):l=`>=${n}.${i}.${o} <${n}.${+i+1}.0-0`,a("tilde return",l),l})},E=(e,t)=>e.trim().split(/\s+/).map(e=>k(e,t)).join(" "),k=(e,t)=>{a("caret",e,t);const n=t.loose?l[u.CARETLOOSE]:l[u.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(t,n,i,o,s)=>{let l;return a("caret",e,t,n,i,o,s),S(n)?l="":S(i)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:S(o)?l="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:s?(a("replaceCaret pr",s),l="0"===n?"0"===i?`>=${n}.${i}.${o}-${s} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o}-${s} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o}-${s} <${+n+1}.0.0-0`):(a("no pr"),l="0"===n?"0"===i?`>=${n}.${i}.${o} <${n}.${i}.${+o+1}-0`:`>=${n}.${i}.${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${o} <${+n+1}.0.0-0`),a("caret return",l),l})},C=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map(e=>A(e,t)).join(" ")),A=(e,t)=>{e=e.trim();const n=t.loose?l[u.XRANGELOOSE]:l[u.XRANGE];return e.replace(n,(n,r,i,o,s,l)=>{if(a("xRange",e,n,r,i,o,s,l),((e,t,n)=>S(e)&&!S(t)||S(t)&&n&&!S(n))(i,o,s))return e;const c=S(i),u=c||S(o),d=u||S(s),f=d;return"="===r&&f&&(r=""),l=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(o=0),s=0,">"===r?(r=">=",u?(i=+i+1,o=0,s=0):(o=+o+1,s=0)):"<="===r&&(r="<",u?i=+i+1:o=+o+1),"<"===r&&(l="-0"),n=`${r+i}.${o}.${s}${l}`):u?n=`>=${i}.0.0${l} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),a("xRange return",n),n})},O=(e,t)=>(a("replaceStars",e,t),e.trim().replace(l[u.STAR],"")),N=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(l[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),D=e=>(t,n,r,i,o,a,s,l,c,u,d,f)=>`${n=S(r)?"":S(i)?`>=${r}.0.0${e?"-0":""}`:S(o)?`>=${r}.${i}.0${e?"-0":""}`:a?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=S(c)?"":S(u)?`<${+c+1}.0.0-0`:S(d)?`<${c}.${+u+1}.0-0`:f?`<=${c}.${u}.${d}-${f}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`}`.trim(),T=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(a(e[n].semver),e[n].semver!==o.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return RY}function OK(){if(PY)return _Y;PY=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),a("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new s(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(a("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,r).test(this.value):""===e.operator?""===e.value||new l(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}_Y=t;const n=pK(),{safeRe:r,t:i}=hK(),o=CK(),a=fK(),s=gK(),l=AK();return _Y}function NK(){if(FY)return zY;FY=1;const e=AK();return zY=(t,n,r)=>{try{n=new e(n,r)}catch(e){return!1}return n.test(t)},zY}function DK(){if(GY)return KY;GY=1;const e=AK();return KY=(t,n)=>{try{return new e(t,n).range||"*"}catch(e){return null}},KY}function TK(){if(JY)return XY;JY=1;const e=gK(),t=OK(),{ANY:n}=t,r=AK(),i=NK(),o=xK(),a=SK(),s=kK(),l=EK();return XY=(c,u,d,f)=>{let h,p,m,g,y;switch(c=new e(c,f),u=new r(u,f),d){case">":h=o,p=s,m=a,g=">",y=">=";break;case"<":h=a,p=l,m=o,g="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(c,u,f))return!1;for(let e=0;e<u.set.length;++e){const r=u.set[e];let i=null,o=null;if(r.forEach(e=>{e.semver===n&&(e=new t(">=0.0.0")),i=i||e,o=o||e,h(e.semver,i.semver,f)?i=e:m(e.semver,o.semver,f)&&(o=e)}),i.operator===g||i.operator===y)return!1;if((!o.operator||o.operator===g)&&p(c,o.semver))return!1;if(o.operator===y&&m(c,o.semver))return!1}return!0},XY}var qK=function(){if(cK)return lK;cK=1;const e=hK(),t=dK(),n=gK(),r=mK(),i=yK(),o=function(){if($W)return jW;$W=1;const e=yK();return jW=(t,n)=>{const r=e(t,n);return r?r.version:null},jW}(),a=function(){if(VW)return BW;VW=1;const e=yK();return BW=(t,n)=>{const r=e(t.trim().replace(/^[=v]+/,""),n);return r?r.version:null},BW}(),s=function(){if(UW)return HW;UW=1;const e=gK();return HW=(t,n,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new e(t instanceof e?t.version:t,r).inc(n,i,o).version}catch(e){return null}},HW}(),l=function(){if(YW)return WW;YW=1;const e=yK();return WW=(t,n)=>{const r=e(t,null,!0),i=e(n,null,!0),o=r.compare(i);if(0===o)return null;const a=o>0,s=a?r:i,l=a?i:r,c=!!s.prerelease.length;if(l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(s))return l.minor&&!l.patch?"minor":"patch"}const u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"},WW}(),c=function(){if(GW)return KW;GW=1;const e=gK();return KW=(t,n)=>new e(t,n).major,KW}(),u=function(){if(JW)return XW;JW=1;const e=gK();return XW=(t,n)=>new e(t,n).minor,XW}(),d=function(){if(QW)return ZW;QW=1;const e=gK();return ZW=(t,n)=>new e(t,n).patch,ZW}(),f=function(){if(tY)return eY;tY=1;const e=yK();return eY=(t,n)=>{const r=e(t,n);return r&&r.prerelease.length?r.prerelease:null}}(),h=vK(),p=function(){if(oY)return iY;oY=1;const e=vK();return iY=(t,n,r)=>e(n,t,r),iY}(),m=function(){if(sY)return aY;sY=1;const e=vK();return aY=(t,n)=>e(t,n,!0),aY}(),g=bK(),y=function(){if(dY)return uY;dY=1;const e=bK();return uY=(t,n)=>t.sort((t,r)=>e(t,r,n)),uY}(),v=function(){if(hY)return fY;hY=1;const e=bK();return fY=(t,n)=>t.sort((t,r)=>e(r,t,n)),fY}(),b=xK(),x=SK(),S=MK(),M=wK(),w=EK(),E=kK(),k=CK(),C=function(){if(NY)return OY;NY=1;const e=gK(),t=yK(),{safeRe:n,t:r}=hK();return OY=(i,o)=>{if(i instanceof e)return i;if("number"==typeof i&&(i=String(i)),"string"!=typeof i)return null;let a=null;if((o=o||{}).rtl){const e=o.includePrerelease?n[r.COERCERTLFULL]:n[r.COERCERTL];let t;for(;(t=e.exec(i))&&(!a||a.index+a[0].length!==i.length);)a&&t.index+t[0].length===a.index+a[0].length||(a=t),e.lastIndex=t.index+t[1].length+t[2].length;e.lastIndex=-1}else a=i.match(o.includePrerelease?n[r.COERCEFULL]:n[r.COERCE]);if(null===a)return null;const s=a[2],l=a[3]||"0",c=a[4]||"0",u=o.includePrerelease&&a[5]?`-${a[5]}`:"",d=o.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${s}.${l}.${c}${u}${d}`,o)},OY}(),A=function(){if(TY)return DY;TY=1;const e=yK(),t=dK(),n=gK(),r=(t,r)=>{const i=t instanceof n?t.version:t;return e(i,r)},i=(e,t)=>{if(o(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0}return e.format()},o=e=>e.startsWith("pre");return DY=(e,n,o)=>{if(!t.RELEASE_TYPES.includes(n))return null;const a=r(e,o);return a&&i(a,n)}}(),O=OK(),N=AK(),D=NK(),T=function(){if($Y)return jY;$Y=1;const e=AK();return jY=(t,n)=>new e(t,n).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" ")),jY}(),q=function(){if(VY)return BY;VY=1;const e=gK(),t=AK();return BY=(n,r,i)=>{let o=null,a=null,s=null;try{s=new t(r,i)}catch(e){return null}return n.forEach(t=>{s.test(t)&&(o&&-1!==a.compare(t)||(o=t,a=new e(o,i)))}),o},BY}(),I=function(){if(UY)return HY;UY=1;const e=gK(),t=AK();return HY=(n,r,i)=>{let o=null,a=null,s=null;try{s=new t(r,i)}catch(e){return null}return n.forEach(t=>{s.test(t)&&(o&&1!==a.compare(t)||(o=t,a=new e(o,i)))}),o},HY}(),R=function(){if(YY)return WY;YY=1;const e=gK(),t=AK(),n=xK();return WY=(r,i)=>{r=new t(r,i);let o=new e("0.0.0");if(r.test(o))return o;if(o=new e("0.0.0-0"),r.test(o))return o;o=null;for(let t=0;t<r.set.length;++t){const i=r.set[t];let a=null;i.forEach(t=>{const r=new e(t.semver.version);switch(t.operator){case">":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":a&&!n(r,a)||(a=r);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}),!a||o&&!n(o,a)||(o=a)}return o&&r.test(o)?o:null},WY}(),L=DK(),_=TK(),P=function(){if(QY)return ZY;QY=1;const e=TK();return ZY=(t,n,r)=>e(t,n,">",r),ZY}(),z=function(){if(tK)return eK;tK=1;const e=TK();return eK=(t,n,r)=>e(t,n,"<",r),eK}(),F=function(){if(rK)return nK;rK=1;const e=AK();return nK=(t,n,r)=>(t=new e(t,r),n=new e(n,r),t.intersects(n,r))}(),j=function(){if(oK)return iK;oK=1;const e=NK(),t=vK();return iK=(n,r,i)=>{const o=[];let a=null,s=null;const l=n.sort((e,n)=>t(e,n,i));for(const t of l)e(t,r,i)?(s=t,a||(a=t)):(s&&o.push([a,s]),s=null,a=null);a&&o.push([a,null]);const c=[];for(const[e,t]of o)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const u=c.join(" || "),d="string"==typeof r.raw?r.raw:String(r);return u.length<d.length?u:r},iK}(),$=function(){if(sK)return aK;sK=1;const e=AK(),t=OK(),{ANY:n}=t,r=NK(),i=vK(),o=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],s=(e,t,s)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=s.includePrerelease?o:a}if(1===t.length&&t[0].semver===n){if(s.includePrerelease)return!0;t=a}const u=new Set;let d,f,h,p,m,g,y;for(const t of e)">"===t.operator||">="===t.operator?d=l(d,t,s):"<"===t.operator||"<="===t.operator?f=c(f,t,s):u.add(t.semver);if(u.size>1)return null;if(d&&f){if(h=i(d.semver,f.semver,s),h>0)return null;if(0===h&&(">="!==d.operator||"<="!==f.operator))return null}for(const e of u){if(d&&!r(e,String(d),s))return null;if(f&&!r(e,String(f),s))return null;for(const n of t)if(!r(e,String(n),s))return!1;return!0}let v=!(!f||s.includePrerelease||!f.semver.prerelease.length)&&f.semver,b=!(!d||s.includePrerelease||!d.semver.prerelease.length)&&d.semver;v&&1===v.prerelease.length&&"<"===f.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(y=y||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,d)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if(p=l(d,e,s),p===e&&p!==d)return!1}else if(">="===d.operator&&!e.test(d.semver))return!1;if(f)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(m=c(f,e,s),m===e&&m!==f)return!1}else if("<="===f.operator&&!e.test(f.semver))return!1;if(!e.operator&&(f||d)&&0!==h)return!1}return!(d&&g&&!f&&0!==h||f&&y&&!d&&0!==h||b||v)},l=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},c=(e,t,n)=>{if(!e)return t;const r=i(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};return aK=(t,n,r={})=>{if(t===n)return!0;t=new e(t,r),n=new e(n,r);let i=!1;e:for(const e of t.set){for(const t of n.set){const n=s(e,t,r);if(i=i||null!==n,n)continue e}if(i)return!1}return!0},aK}();return lK={parse:i,valid:o,clean:a,inc:s,diff:l,major:c,minor:u,patch:d,prerelease:f,compare:h,rcompare:p,compareLoose:m,compareBuild:g,sort:y,rsort:v,gt:b,lt:x,eq:S,neq:M,gte:w,lte:E,cmp:k,coerce:C,truncate:A,Comparator:O,Range:N,satisfies:D,toComparators:T,maxSatisfying:q,minSatisfying:I,minVersion:R,validRange:L,outside:_,gtr:P,ltr:z,intersects:F,simplifyRange:j,subset:$,SemVer:n,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:r.compareIdentifiers,rcompareIdentifiers:r.rcompareIdentifiers}}(),IK=o(qK),RK="0.23.1";const LK=e=>!e||IK.lt(IK.coerce(e),IK.coerce(RK)),_K=({layoutService:e})=>{const t=!LK(e.getLayoutValue("version")),n=e.getHyperCubeValue("qMeasureInfo").map(((e,t)=>{const n={[Gf.BAR]:0,[Gf.LINE]:0,[Gf.MARKER]:0};return({series:r=Jf},i)=>{const o=CW(r,t),a=ag(r);return{id:i,type:a,typeIndex:n[a]++,ref:`qMeasureInfo/${i}`,refIndex:i,isPrimary:o,scale:o?Kf.SCALE.MINOR.PRIMARY:Kf.SCALE.MINOR.SECONDARY,collection:o?Kf.COLLECTION.PRIMARY:Kf.COLLECTION.SECONDARY,options:kW({series:r,layoutService:e})}}})(e,t)),r=(e,t)=>e.filter(e=>ag(e)===t).length,i=n.filter(e=>e.isPrimary),o=n.filter(e=>!e.isPrimary),a=[!!i.length&&i[0],!!o.length&&o[0]].filter(e=>!!e),s=r(n,Gf.BAR),l=r(i,Gf.BAR),c=r(o,Gf.BAR),u=e=>n.filter(t=>ag(t)===e),d=u(Gf.LINE).map(e=>Dp(Kf.COMPONENT.POINT,e)),f=u(Gf.MARKER).map(e=>({key:Dp(Kf.COMPONENT.MARKER,e),type:e.options.marker})),h=f.map(e=>e.key),p=[];l>0&&p.push(`${Kf.COMPONENT.BAR}-${Xf.PRIMARY}`),c>0&&p.push(`${Kf.COMPONENT.BAR}-${Xf.SECONDARY}`);const m=[...p,...d,...h],{MINI_CHART:g}=Kf.COMPONENT,y=u(Gf.LINE).map(e=>Dp(g.LINE,e)),v=u(Gf.MARKER).map(e=>Dp(g.MARKER,e)),b=e.meta.isContinuous?[`${g.BAR}-${Xf.PRIMARY}`,`${g.BAR}-${Xf.SECONDARY}`,...y,...v]:[];return{meta:{allSeries:n,primarySeries:i,secondarySeries:o,barSeriesCount:s,primaryBarSeriesCount:l,secondaryBarSeriesCount:c,measureAxes:a,pointComponentKeys:d,markerComponentKeys:h,barComponentKeys:p,seriesComponentKeys:m,miniComponentKeys:b,markers:f},query:{all:()=>n,seriesByAxis:e=>e?i:o,series:u,isPrimary:CW}}},PK=(e,t)=>e.filter(({series:e=Jf})=>ag(e)===t),zK=({series:e=Jf})=>e.axis!==Xf.SECONDARY,FK=({series:e=Jf})=>e.axis===Xf.SECONDARY;function jK({layoutService:e}){const{dimensionCount:t,measureCount:n}=e.meta;return{qTop:0,qLeft:0,qWidth:t+n,qHeight:Math.min(2e3,1e4/(n+1))}}function $K({genericObjectModel:e,layoutService:t}){return function(){return function(e,t,n){return e.getHyperCubeReducedData(n.path,[n.rect],n.zoomLevel,n.filter).catch(w).then(e=>{const n=t.getHyperCubeValue("qMode"),r=t.getHyperCubeValue("qDimensionInfo"),i="K"===n&&r.length>1&&e[0]?.qIsReduced,o=e.slice(),a=t.getHyperCubeValue("qMeasureInfo"),s=i?[]:t.getHyperCubeValue("qColumnOrder");return{reducedCube:{qDataPages:o,qDimensionInfo:r.slice(),qEffectiveInterColumnSortOrder:[1,0],qMeasureInfo:i?[a[0],a[0]]:a.slice(),qStackedDataPages:[],qMode:"S",qHasOtherValues:t.getHyperCubeValue("qHasOtherValues"),qSize:t.getHyperCubeValue("qSize"),qColumnOrder:s}}})}(e,t,{path:"/qHyperCubeDef",rect:jK({layoutService:t}),zoomLevel:-1,filter:"D1"})}}function BK({genericObjectModel:e,layoutService:t}){const{isSnapshot:n,isContinuous:r}=t.meta;return n?function({layoutService:e}){return function(){return Promise.resolve({reducedCube:e.getLayoutValue("reducedHyperCube")||e.getHyperCube()})}}({layoutService:t}):r?function({layoutService:e}){return function(){const t=e.getHyperCube();return Promise.resolve({reducedCube:{...t,qDataPages:[...t.qDataPages]}})}}({layoutService:t}):$K({genericObjectModel:e,layoutService:t})}const VK=e=>"number"==typeof e&&!Number.isNaN(e);function HK({isPrimary:e,layoutService:t,seriesModel:n}){return function(){const r=t.getHyperCubeValue("qMeasureInfo"),i=n.query.seriesByAxis(e).map(e=>r[e.refIndex]),o=i.filter(e=>ag(e.series)===Gf.BAR),a=i.filter(e=>ag(e.series)===Gf.LINE),s=i.filter(e=>ag(e.series)===Gf.MARKER);return{min:Math.min(...i.filter(e=>VK(e.qMin)).map(e=>e.qMin)),max:Math.max(...i.filter(e=>VK(e.qMax)).map(e=>e.qMax)),bar:{min:Math.min(...o.filter(e=>VK(e.qMin)).map(e=>e.qMin)),max:Math.max(...o.filter(e=>VK(e.qMax)).map(e=>e.qMax))},line:{min:Math.min(...a.filter(e=>VK(e.qMin)).map(e=>e.qMin)),max:Math.max(...a.filter(e=>VK(e.qMax)).map(e=>e.qMax))},marker:{min:Math.min(...s.filter(e=>VK(e.qMin)).map(e=>e.qMin)),max:Math.max(...s.filter(e=>VK(e.qMax)).map(e=>e.qMax))}}}}function UK({seriesModel:e,isPrimary:t,type:n}){return function({dataPage:r}){const i=e.query.series(n).filter(e=>e.isPrimary===t).map(e=>e.refIndex),{qMatrix:o}=r,a={min:NaN,max:NaN};return o.forEach(e=>{let t=0,n=0;e.slice(1).filter((e,t)=>i.some(e=>e===t)&&"NaN"!==e.qNum).forEach(e=>{e.qNum>=0?n+=e.qNum:t+=e.qNum}),a.min=Number.isNaN(a.min)?t:Math.min(t,a.min),a.max=Number.isNaN(a.max)?n:Math.max(n,a.max)}),a}}function WK({isPrimary:e,layoutService:t,seriesModel:n}){const{isBarSeriesStacked:r,isLineStacked:i}=t.meta,o=n.query.series(Gf.BAR).filter(t=>t.isPrimary===e).length,a=n.query.series(Gf.LINE).filter(t=>t.isPrimary===e).length,s=r&&o>=2,l=i&&a>=2;return s||l?function({isPrimary:e,layoutService:t,seriesModel:n,hasBarStacked:r,hasLineStacked:i}){const o=HK({isPrimary:e,layoutService:t,seriesModel:n}),a=r?UK({seriesModel:n,isPrimary:e,type:Gf.BAR}):()=>({min:1/0,max:-1/0}),s=i?UK({seriesModel:n,isPrimary:e,type:Gf.LINE}):()=>({min:1/0,max:-1/0});return function({dataPage:e}){const t=o({dataPage:e});r&&(t.bar=a({dataPage:e})),i&&(t.line=s({dataPage:e}));const n=[t.bar.min,t.line.min,t.marker.min].filter(e=>void 0!==e),l=[t.bar.max,t.line.max,t.marker.max].filter(e=>void 0!==e);return t.min=n.length?Math.min(...n):NaN,t.max=l.length?Math.max(...l):NaN,t}}({isPrimary:e,layoutService:t,seriesModel:n,hasBarStacked:s,hasLineStacked:l}):HK({isPrimary:e,layoutService:t,seriesModel:n})}function YK({isPrimary:e,continuousModel:t,layoutService:n,reducedModel:r,seriesModel:i}){const o={min:NaN,max:NaN,implicit:{min:NaN,max:NaN,bar:{min:NaN,max:NaN},line:{min:NaN,max:NaN},marker:{min:NaN,max:NaN}},explicit:{min:NaN,max:NaN},meta:{hasExplicit:!1,hasExplicitMin:!1,hasExplicitMax:!1,includesZero:!1}},a=WK({isPrimary:e,layoutService:n,seriesModel:i}),{isArea:s}=n.meta;return{query:{getExtrema:()=>o},command:{initialize:()=>{const{min:l,max:c}=function({isPrimary:e,layoutService:t}){const n={min:NaN,max:NaN},{getLayoutValue:r}=t,i=r("measureAxes."+(e?0:1),{});if(i.autoMinMax)return n;const{minMax:o,min:a,max:s}=i;return"min"!==o&&"minMax"!==o||(n.min=a),"max"!==o&&"minMax"!==o||(n.max=s),Number.isNaN(n.min)||Number.isNaN(n.max)||(n.min=Math.min(a,s),n.max=Math.max(a,s)),n}({isPrimary:e,layoutService:n});return o.explicit.min=l,o.explicit.max=c,o.meta.hasExplicitMin=!Number.isNaN(l),o.meta.hasExplicitMax=!Number.isNaN(c),o.meta.hasExplicit=o.meta.hasExplicitMin||o.meta.hasExplicitMax,function({continuousModel:e,layoutService:t,reducedModel:n}){const{isDiscrete:r}=t.meta;if(r){const e=n.query.getCube();return Promise.resolve({dataPage:e.qDataPages[0]})}return e.fetchMinMaxData().then(e=>({dataPage:e[0]}))}({continuousModel:t,layoutService:n,reducedModel:r}).then(({dataPage:t})=>{const{min:n,max:r,bar:l,line:c,marker:u}=a({dataPage:t}),d=i.query.seriesByAxis(e).some(e=>ag(e)===Gf.BAR),f=i.query.seriesByAxis(e).some(e=>ag(e)===Gf.LINE),h=d||s&&f,p=Number((h?Math.min(n,0):n).toFixed(13)),m=Number((h?Math.max(r,0):r).toFixed(13)),g=Number((h?Math.min(l.min,0):l.min).toFixed(13)),y=Number((h?Math.max(l.max,0):l.max).toFixed(13)),v=Number((h?Math.min(c.min,0):c.min).toFixed(13)),b=Number((h?Math.max(c.max,0):c.max).toFixed(13)),x=Number((h?Math.min(u.min,0):u.min).toFixed(13)),S=Number((h?Math.max(u.max,0):u.max).toFixed(13));o.implicit.min=Number.isFinite(p)?p:0,o.implicit.max=Number.isFinite(m)?m:0,o.implicit.bar.min=Number.isFinite(g)?g:0,o.implicit.bar.max=Number.isFinite(y)?y:0,o.implicit.line.min=Number.isFinite(v)?v:0,o.implicit.line.max=Number.isFinite(b)?b:0,o.implicit.marker.min=Number.isFinite(x)?x:0,o.implicit.marker.max=Number.isFinite(S)?S:0,o.min=Number.isNaN(o.explicit.min)?o.implicit.min:o.explicit.min,o.max=Number.isNaN(o.explicit.max)?o.implicit.max:o.explicit.max,o.meta.hasExplicitMin&&!o.meta.hasExplicitMax&&(o.max=Math.max(o.min,o.max)),o.meta.hasExplicitMax&&!o.meta.hasExplicitMin&&(o.min=Math.min(o.min,o.max)),o.meta.includesZero=!!((0-o.min)*(0-o.max)<=0)})}}}}function KK({extrema:e,ticks:t}){const n=e.meta.hasExplicit?2:3;return t.filter(t=>(t=>!e.meta.hasExplicitMin||t>=e.explicit.min)(t)&&(t=>!e.meta.hasExplicitMax||t<=e.explicit.max)(t)).length>=n}function GK({min:e,max:t,count:n,threshold:r,disable:i}){const o=function(e,t,n){const r=hn().domain([e,t]);return r.nice(n),r}(e,t,n),a={start:!0,stop:!0};if(!a.start||!a.stop){const[e,t]=o.domain(),r=o.ticks(n),i=r.length>=4?r[1]-r[0]:.1*e,s=r.length>=4?r[r.length-1]-r[r.length-2]:.1*t;o.domain([a.start?e:e-i,a.stop?t:t+s]),o.nice(n)}return o}const XK=50,JK=100,ZK=200,QK=125;function eG({config:{measureAxesRef:e},layoutService:t,size:n}){const r=(e=>{switch(e){case.5:return XK;case 1:return JK;case 2:return ZK;default:return e*QK}})(t.getLayoutValue(`${e}.spacing`,1));return Math.max(1,Math.round(n/r))}function tG({config:e,chart:t,layoutService:n,dockService:r,measureText:i,size:o,min:a,max:s}){const l=eG({config:e,layoutService:n,size:o}),c=GK({min:a,max:s,count:l,threshold:.05,disable:!0}),u=c.domain(),d={roundedMin:u[0],roundedMax:u[1],ticks:c.ticks(l)},f="horizontal"===r.meta.major.orientation?"height":"width",h=e=>i(e)[f],p=t.formatter(e.formatter),m=()=>{const e=d.ticks.map(p),t=e.some((t,n)=>e.indexOf(t)!==n);return!t&&(e=>{const t=o/d.ticks.length;return Math.max(...e.map(h))<=t})(e)};for(let e=l-1;e>0&&!m();e--)c.domain([a,s]),c.nice(e),[d.roundedMin,d.roundedMax]=c.domain(),d.ticks=c.ticks(e);return d}function nG({tick:e,index:t,ticks:n}){return 0===t||t===n.length-1||0===e}function rG({index:e,ticks:t}){return 0===e||e===t.length-1||e===Math.floor((t.length-1)/2)}function iG({config:e,chart:t,extrema:n,min:r,max:i}){const o={roundedMin:0,roundedMax:0,ticks:[]},a=GK({min:r,max:i,count:10,threshold:.15,disable:!0});[o.roundedMin,o.roundedMax]=a.domain();const s=a.ticks(10),l=function({ticks:e}){const t=Math.round(.3*e.length),n=t,r=e.length-t;return e.slice(n,r).some(e=>0===e)}({ticks:s}),c=l?nG:rG;o.ticks=s.filter((e,t,n)=>c({tick:e,index:t,ticks:n}));o.ticks.length%2==0&&!l&&!n.meta.hasExplicit&&s.length>1&&(o.ticks=[s[0],(s[0]+s[s.length-1])/2,s[s.length-1]]);const u=t.formatter(e.formatter),d=o.ticks.map(u),f=d.some((e,t)=>d.indexOf(e)!==t);return f&&(o.ticks=[o.ticks[0],o.ticks[o.ticks.length-1]]),o}function oG({ticks:e,extrema:t}){let n=[...e];return t.meta.hasExplicit&&e.length?(t.meta.hasExplicitMin&&!e.some(e=>e===t.explicit.min)&&(n.unshift(t.explicit.min),n=n.filter(e=>e>=t.explicit.min)),t.meta.hasExplicitMax&&!e.some(e=>e===t.explicit.max)&&(n.push(t.explicit.max),n=n.filter(e=>e<=t.explicit.max)),n):n}function aG({config:e,chart:t,layoutService:n,dockService:r,extrema:i,measureText:o,size:a,min:s,max:l}){const{ticks:c,roundedMin:u,roundedMax:d}=function({config:e,chart:t,layoutService:n,dockService:r,extrema:i,measureText:o,size:a,min:s,max:l}){if("SPARK"===r.meta.chart.mode)return function({min:e,max:t}){return{roundedMin:e,roundedMax:t,ticks:[]}}({min:s,max:l});const c=tG({config:e,chart:t,layoutService:n,dockService:r,measureText:o,size:a,min:s,max:l});return KK({extrema:i,ticks:c.ticks})?c:iG({config:e,chart:t,extrema:i,min:s,max:l})}({config:e,chart:t,layoutService:n,dockService:r,extrema:i,measureText:o,size:a,min:s,max:l}),f=function({ticks:e,count:t}){const n=[];for(let r=0;r<e.length-1;r++){const i=e[r],o=(e[r+1]-i)/(t+1);for(let e=1;e<=t;e++)n.push(i+o*e)}return n}({ticks:c,count:1}),h=[...oG({ticks:c,extrema:i}).map(e=>({value:e,isMinor:!1})),...f.map(e=>({value:e,isMinor:!0}))].sort((e,t)=>e.value-t.value);return{min:u,max:d,values:h}}function sG({config:e,chart:t,layoutService:n,dockService:r,measureText:i,extrema:o,size:a}){const{min:s,max:l}=function({extrema:e}){const{min:t,max:n}=e;return t!==n?{min:t,max:n}:0===t||1===t?{min:t-1,max:n+1}:{min:t-.2*t*Math.sign(t),max:n+.2*n*Math.sign(n)}}({extrema:o});return aG({config:e,chart:t,layoutService:n,dockService:r,extrema:o,measureText:i,size:a,min:s,max:l})}function lG({config:e,chart:t,layoutService:n,extremumModel:r,dockService:i,seriesModel:o,themeService:a}){const s={locked:!1,resolved:void 0},{getExtrema:l}=r.query,c=function({chart:e,config:t,dockService:n,extremumModel:r,layoutService:i,seriesModel:o,themeService:a}){const{measureText:s}=jI.renderer("svg")();return()=>{const l=a.getStyles(),c=function({dockService:e,seriesModel:t,chart:n}){const r=n.component(t.meta.seriesComponentKeys[0]),i=r?.rect??e.meta.chart.size;return"horizontal"===e.meta.major.orientation?i.height:i.width}({chart:e,dockService:n,seriesModel:o}),u=r.query.getExtrema(),d=sG({config:t,chart:e,layoutService:i,dockService:n,measureText:e=>s({text:e,fontFamily:l.axis.label.name.fontFamily,fontSize:l.axis.label.name.fontSize}),extrema:u,size:c});return d}}({config:e,chart:t,layoutService:n,extremumModel:r,dockService:i,seriesModel:o,themeService:a}),u=()=>(s.locked&&s.resolved||(s.resolved=c()),s.resolved);return{query:{getValues:()=>u().values,getMin:()=>l().meta.hasExplicitMin?l().explicit.min:u().min,getMax:()=>l().meta.hasExplicitMax?l().explicit.max:u().max},command:{lock:()=>{s.locked=!0},unlock:()=>{s.locked=!1}}}}function cG({genericObjectModel:e,layoutService:t}){const n={properties:void 0};return{query:{getProperties:()=>n.properties},command:{initialize:()=>function({layout:e,model:t}){return S.snapshot(e)?Promise.resolve(null):t.getEffectiveProperties().then(e=>({properties:e}))}({layout:t.getLayout(),model:e}).then(e=>{const{properties:t}=e??{};n.properties=t})}}}function uG({layoutService:e,seriesModel:t,colorService:n}){const{type:r,mode:i,fieldType:o}=n.getSettings();if("categorical"!==r)return;const a=e.getLayoutValue("dataPoint.show",!1)?"line-point":"line";let s;s="field"===i?"measure"===o?()=>({type:Gf.BAR}):()=>t.query.all()[0]:e=>t.query.all()[e.value];return{item:{shape:{type:({datum:e})=>{const{type:t,options:n}=s(e);switch(t){case"line":return a;case"marker":return n.marker;default:return"square"}},stroke:{},strokeWidth:({datum:e})=>{const{type:t,options:n}=s(e);return t===Gf.LINE?2:t!==Gf.MARKER||n.fill?0:1},size:10,fill:{fn:({datum:e,scale:t})=>{const{type:n,options:r}=s(e);return n!==Gf.MARKER||"bar"===r.marker||r.fill?t(e.value):"none"}}}}}}function dG({layout:e,defaultAuto:t}){const n=t(e),r=e.qHyperCube.qMeasureInfo.length>1;return{...n,useBaseColors:r?"measure":n.useBaseColors}}function fG({actions:e,appLayoutModel:t,appModel:n,chart:r,environment:i,genericObjectModel:o,layoutService:a,picasso:s,seriesModel:l,viewState:c}){let u;const{theme:d,translator:f}=i,h={wrappedScales:void 0,legendComponents:void 0,legendInteractions:void 0};return u=function({picasso:e,model:t,app:n,translator:r,layoutService:i,createConfig:o=Zl,config:a={},custom:s={}}){const{localeInfo:l,key:c,theme:u,auto:d,definitionPath:f}=a,h=i?.getLayout?.(),p={theme:u,key:c,localeInfo:l,layout:h,hc:i?.getHyperCube?.(),legendProps:i?.getLayoutValue?.("legend"),colorProps:{...i?.getLayoutValue?.("color"),useBaseColors:h?Gl(h):void 0}},m=Yl({picasso:e,model:t,app:n,translator:r,auto:d});!1!==d&&m.auto(e=>d?d({layout:e,defaultAuto:Jl}):Jl(e));let g=!1;const y={getColor:()=>m.color(),getPaletteColor:({index:e,color:t})=>m.resolveUIColor({index:e,color:t}),getData:()=>m.data(),getDatumProps:e=>m.datumProps(e),getSnapshotData:()=>m.getSnapshotData(f),getSettingsForMeasure:e=>m.settingsForMeasure(e),getSettings:()=>m.settings(),getLegend:(e,t)=>m.legend(e,t),getScales:()=>m.scales(),getPalettes:()=>m.palettes(),isSelectionLocked:({isMeasureSelectionLocked:e})=>m.isSelectionLocked({isMeasureSelectionLocked:e}),isInitialized:()=>g,custom:{...s},initialize:({createConfig:e=o}={})=>{const t=e({getUseBaseColors:Gl}),n=function(e,t={}){return{...e,...t,colorProps:{...e.colorProps,...t.colorProps||{}}}}(p,t);return m.config(n),m.getAuxiliarySettings(f).then(()=>{g=!0})}};return y}({picasso:s,model:o,app:n,translator:f,layoutService:a,createConfig:()=>{const e=a.getHyperCubeValue("qMeasureInfo").map(e=>e.color);return{theme:d,colorProps:{measureOverrides:e},legendProps:a.getLayoutValue("legend"),hc:a.getHyperCube(),key:Kf.SCALE.COLOR}},config:{auto:dG,localeInfo:t.qLocaleInfo},custom:{wrappedScales:()=>h.wrappedScales,legendComponents:()=>h.legendComponents,legendInteractions:()=>h.legendInteractions,updateLegend:t=>{const{components:n,interactions:o,scales:s}=function({viewState:e,chart:t,layoutService:n,seriesModel:r,environment:i,colorService:o,actions:a,styleModel:s}){const{options:l}=i,c={eventName:"legend-c",key:Kf.COMPONENT.LEGEND,viewState:e,chart:t,styleReference:"object.comboChart",styleOverrides:{title:s.query.legend.title.getStyle(),label:s.query.legend.label.getStyle()},rtl:"rtl"===l.direction,settings:uG({layoutService:n,seriesModel:r,colorService:o})},{components:u,interactions:d}=o.getLegend(c,{actions:a,navigationDisabled:!a.interact.enabled()}),f=o.getScales();return{components:u.filter(Boolean).map(e=>{const{layout:t}=e,{dock:n}=t,r=f[`${Kf.SCALE.COLOR}Range`];return!r||"right"!==n&&"left"!==n||(r.invert=!0),"legend-cat"===e.type&&(e.settings.item.shape.fill.scale=e.scale,e.settings.item.shape.stroke.scale=e.scale),e}),interactions:d,scales:f}}({viewState:c,chart:r,environment:i,colorService:u,seriesModel:l,layoutService:a,actions:e,styleModel:t});h.wrappedScales=s,h.legendComponents=n,h.legendInteractions=o}}}),u}const hG="REJECTED",pG=()=>{},mG=2,gG=20,yG=200,vG=10;var bG={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qLeft<=t.qLeft&&n.qLeft+n.qWidth>=t.qLeft+t.qWidth&&n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qMatrix.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qMatrix.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(0,t.qWidth)-Math.abs(Math.min(0,t.qLeft-e.qArea.qLeft)),i=Math.max(t.qTop,e.qArea.qTop),o=Math.max(t.qLeft,e.qArea.qLeft),a=Math.max(0,i-e.qArea.qTop),s=Math.min(i+n-e.qArea.qTop,e.qArea.qHeight),l=Math.max(0,o-e.qArea.qLeft),c=Math.min(o+r-e.qArea.qLeft,e.qArea.qWidth),u={qArea:{qHeight:s-a,qWidth:c-l,qTop:i,qLeft:o},qMatrix:[]};for(let t=a;t<s;t++)u.qMatrix.push(e.qMatrix[t].slice(l,c));return u},cacheWarden:function({bounds:e={width:0,height:0}}){return{release(t,n){const r=n.qTop-vG<=t.qTop,i=n.qLeft+n.qWidth+vG>=t.qLeft+t.qWidth,o=n.qTop+n.qHeight+vG>=t.qTop+t.qHeight,a=n.qLeft-vG<=t.qLeft;return r&&t.qTop>0||i&&t.qLeft+t.qWidth<e.width||o&&t.qTop+t.qHeight<e.height||a&&t.qLeft>0}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeData",args:[e,[t]]})}};var xG={contains:function(e,t){if(!e)return!1;const{qArea:n}=e;return!!n&&(n.qTop<=t.qTop&&n.qTop+n.qHeight>=t.qTop+t.qHeight)},patcher:function({layoutService:e}){const t=t=>{t.qArea.qHeight=t.qData[0].qSubNodes.length,t.qArea.qWidth=e.meta.size.x};return t.should=e=>0===e.qArea.qHeight&&0===e.qArea.qWidth&&!!e.qData.length,t},slicer:function(e,t){const n=Math.max(0,t.qHeight)-Math.abs(Math.min(0,t.qTop-e.qArea.qTop)),r=Math.max(t.qTop,e.qArea.qTop),i=Math.max(t.qLeft,e.qArea.qLeft),o=Math.max(0,r-e.qArea.qTop),a=Math.min(r+n-e.qArea.qTop,e.qArea.qHeight),s=e.qData[0].qUp+e.qArea.qHeight+e.qData[0].qDown-r-(a-o),l={qArea:{qHeight:a-o,qWidth:e.qArea.qWidth,qTop:r,qLeft:i},qData:[{...e.qData[0],qUp:r,qDown:s,qSubNodes:[]}]};for(let t=o;t<a;t++)l.qData[0].qSubNodes.push(e.qData[0].qSubNodes[t]);return l},cacheWarden:function({bounds:e={height:0}}){return{release(t,n){const r=n.qTop-vG<=t.qTop,i=n.qTop+n.qHeight+vG>=t.qTop+t.qHeight;return r&&t.qTop>0||i&&t.qTop+t.qHeight<e.height}}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeStackData",args:[e,[t]]})}};var SG={contains:function(){return!1},patcher:function(){const e=e=>e;return e.should=()=>!1,e},slicer:function(e){return e},cacheWarden:function(){return{release:()=>!0}},request:function({definitionPath:e}){return t=>({method:"getHyperCubeTreeData",args:[e,[t]]})}};const MG="pages";const wG="discretePan";function EG({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{type:"Pan",key:"discrete:pan",options:{event:wG,pointers:1,threshold:10,enable(r,i){return this.started===wG||!i||!(!t.scroll.enabled()||!o.enabled())&&e.componentsFromPoint({x:i.center.x,y:i.center.y}).some(e=>e.key===n)}},events:{[`${wG}start`](e){e.preventDefault(),this.started=wG;const t="horizontal"===r.meta.major.orientation?e.deltaX:e.deltaY;this.previousTotalDelta=t<0?-10:10},[`${wG}move`](e){e.preventDefault();const t="horizontal"===r.meta.major.orientation,n=t?e.deltaX:e.deltaY,a=t&&i?-1:1,s=(n-this.previousTotalDelta)*a;this.previousTotalDelta=n,o.scroll(s)},[`${wG}end`](e){e.preventDefault(),this.started=!1},[`${wG}cancel`](e){e.preventDefault(),this.started=!1}}}}function kG({chart:e,componentKey:t,actions:n,scroller:r}){return function(i){if(!n.scroll.enabled()||!r.enabled())return;const[o]=e.componentsFromPoint({x:i.clientX,y:i.clientY}).filter(e=>e.key===t);if(!o)return;i.preventDefault();const a=Math.abs(i.deltaY)>Math.abs(i.deltaX)?i.deltaY:i.deltaX,s=100*Math.sign(-a);r.scroll(s)}}function CG({layoutService:e}){const t=function({layoutService:e}){const t=Math.floor(1e4/(e.meta.dimensionCount+e.meta.measureCount));return function({width:e,height:n}){const r=Math.min(t,Math.max(yG,n));return{width:e,height:Math.max(gG,Math.min(n*mG,r))}}}({layoutService:e}),n={width:e.meta.size.x,height:e.meta.size.y};return function(e){const{width:r,height:i}=t({width:e.qWidth,height:e.qHeight}),o=i?Math.ceil((i-e.qHeight)/2):0,a=r?Math.ceil((r-e.qWidth)/2):0;return{qHeight:i?Math.min(i,n.height):e.qHeight,qWidth:r?Math.min(r,n.width):e.qWidth,qTop:i?Math.max(0,Math.min(e.qTop-o,n.height-i)):e.qTop,qLeft:r?Math.max(0,Math.min(e.qLeft-a,n.width-r)):e.qLeft}}}function AG(e){let t,n;const r=i=>{t=i;const{method:o,args:a}=t.request;e[o](...a).then(e=>{if(t.canceled||n)return t.reject(hG),t=null,void(n&&(r(n),n=null));t.resolve(e[0]),t=null})},i=e=>new Promise((i,o)=>{const a={request:e,resolve:i,reject:o,canceled:!1,cancel:()=>{a.canceled=!0}};t?(e=>{n&&n.reject(hG),n=e})(a):r(a)});return i.isProcessing=()=>!!t,i.hasQueued=()=>!!n,i.cancel=()=>{i.isProcessing()&&t.cancel(),i.hasQueued()&&(n.reject(hG),n=null)},i}const OG={command:{update:()=>{}}};function NG({dataStore:e,composition:t,enigmaModel:n,layoutService:r,trendLineModel:i=OG,definitionPath:o,processDataPage:a}){const{slicer:s,cacheWarden:l,request:c}=t,u=function({dataStore:e,slice:t,warden:n,expand:r,request:i,process:o,connectionless:a,processDataPage:s}){return(l,{onProcessing:c}={})=>{if(e.contains(l)){const r=e.getCurrent();if(a)return Promise.resolve(t(r,l));const i=n.release(r.qArea,l),s=o.isProcessing();if(!i&&s&&o.cancel(),!i||s)return Promise.resolve(t(r,l))}if(a)return Promise.resolve(e.getCurrent());o.isProcessing()&&c&&c();const u=r(l);return o(i(u)).then(n=>(s(n),e.add(n),t(n,l)))}}({dataStore:e,slice:s,warden:l({bounds:{width:r.meta.size.x,height:r.meta.size.y}}),expand:CG({layoutService:r}),request:c({definitionPath:o}),process:AG(n),connectionless:r.meta.isSnapshot,processDataPage:a}),d=vc((e,{onProcessing:t,onData:n})=>{u(e,{onProcessing:t}).then(e=>n(e)).catch(e=>{if(e!==hG)throw e})},50);return function(e,{onProcessing:t=pG,onDataPage:n=pG}={}){d(e,{onProcessing:t,onData:e=>{r.setDataPages(e?[e]:[]),i.command.update(),n(e)}})}}var DG={inTotal:function({layoutService:e}){return e.meta.size.x},area:function({layoutService:e}){return{qTop:0,qHeight:1,qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=i/r;return[a,n.inView>=n.inTotal?a+1:a+o.qArea.qWidth/n.inView]}};var TG={inTotal:function({layoutService:e,getReducedCube:t}){if(e.meta.isSnapshot&&!e.getLayoutValue("reducedHyperCube")){const n=t();if(n){const[t]=hc({qHyperCube:n},e.refs.dataPages);if(t)return t.qArea.qHeight}const[r]=e.getDataPages();if(r)return r.qArea.qHeight}return e.meta.size.y},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=void 0===r?4:r,o=Math.max(0,Math.floor(t)-i/2);return{qTop:o,qHeight:Math.min(e.meta.size.y-o,Math.max(0,Math.ceil(n+i))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const{pixel:i}=t,o=e.getDataPages()[0],a=r/n.inView,s=(i+o.qArea.qTop*a)/r;return[s,n.inView>=n.inTotal?s+1:s+o.qArea.qHeight/n.inView]}};function qG(e){const{groupSize:t,measureCount:n}=e.meta;return t??n}function IG(e,t){const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);-1===n.indexOf(i)&&n.push(i)}return n.length}function RG(e){return IG(e.qMatrix,e=>e[0].qElemNumber)-1}var LG={inTotal:function({layoutService:e}){const t=qG(e);return e.meta.size.y*t*(1+1/t)-1},area:function({layoutService:e,itemOffset:t,inView:n,areaBuffer:r}){const i=qG(e),o=void 0===r?i:r,a=t/(i+1),s=Math.max(0,Math.floor((t-a-o/2)/i));return{qTop:s,qHeight:Math.min(e.meta.size.y-s,Math.max(0,Math.ceil((n+o)/i+1))),qLeft:0,qWidth:e.meta.size.x}},scaleRange:function({layoutService:e,offsets:t,items:n,viewSize:r}){const i=qG(e),o=e.getDataPages()[0],a=r/n.inView,{pixel:s}=t,l=RG(o),c=o.qArea.qHeight*i+l,u=(s+(o.qArea.qTop*i+o.qArea.qTop)*a)/r;return[u,n.inView>=n.inTotal?u+1:u+c/n.inView]}};const _G=(e,t)=>t/(e.meta.size.y/e.meta.size.dimensions[0]+1);function PG(e){return{itemOffset(t,n){if(0!==t.qArea.qTop)return _G(e,n);const r=((e,t)=>{const n={successful:!0,count:0};let r=Math.abs(Math.floor(t));const i=[];for(let t=0;t<=r;t++){if(!e[t])return n.successful=!1,n;const o=e[t][0].qElemNumber;-1===i.indexOf(o)&&(i.push(o),r--)}return n.count=i.length-1,n})(t.qMatrix,n);return r.successful?r.count:_G(e,n)},area(t,n,r){if(0!==t.qArea.qTop)return _G(e,n);return IG(t.qMatrix.slice(0,r.qTop+1),e=>e[0].qElemNumber)-1}}}var zG={inTotal:function({layoutService:e}){return e.meta.size.y+e.meta.size.dimensions[0]-1},area:function({getDataPages:e,layoutService:t,itemOffset:n,inView:r}){const i=PG(t).itemOffset(e(),n),o=Math.max(0,Math.floor(n-i));return{qTop:o,qHeight:Math.min(t.meta.size.y-o,Math.max(0,Math.ceil(r+1))),qLeft:0,qWidth:t.meta.size.x}},scaleRange:function({getDataPages:e,layoutService:t,offsets:n,items:r,viewSize:i,upperBound:o}){const a=t.getDataPages()[0],s=i/r.inView,{item:l,pixel:c}=n,u=PG(t).area(e(),l,a.qArea),d=RG(a),f=a.qArea.qHeight+d,h=c===o?(r.inView-f)*s/i:(c+(a.qArea.qTop+u)*s)/i;return[h,r.inView>=r.inTotal?h+1:h+f/r.inView]}};function FG({chart:e,rect:t,dockService:n,itemWidths:r,axisKey:i,renderer:o,isGrouped:a,dimensionAxis:s,inTotal:l,isMajorLabelless:c,maxDataRows:u}){const{DEFAULT:d,SQUEEZE:f,LABELLESS:h}=r[n.meta.chart.mode],p="horizontal"===n.meta.major.orientation,{axisDisplayMode:m="auto",maxVisibleItems:g=10,label:y}=s,v=p?t.width:t.height;if(!v||!Number.isFinite(v))return 0;const b=v/l>=f;switch(m){case"max":return Math.min(l,u);case"custom":return Math.min(g,u);default:return c?v/h:b?function({chart:e,isHorizontal:t,axisKey:n,renderer:r={},isGrouped:i,itemSize:o,label:a}){if(i||"auto"!==a&&"tilted"!==a)return!1;const s=e.component(n),{measureText:l}=r;if(!s||!l)return!0;const{fontFamily:c,fontSize:u,tiltAngle:d}=s.settings.settings.labels,{height:f}=l({fontFamily:c,fontSize:u,text:"M"});if(!t)return f>o;const h=(90-d)*(Math.PI/180);return f>Math.cos(h)*o}({chart:e,isHorizontal:p,axisKey:i,renderer:o,isGrouped:a,itemSize:f,label:y})?v/d:l:v/d}}function jG({chart:e,getRect:t,getDataPages:n,layoutService:r,dockService:i,getItemWidths:o,axisKey:a,renderer:s,areaBuffer:l,rtl:c,getReducedCube:u}){const{inTotal:d,area:f,scaleRange:h}=function({layoutService:e}){const{isDimensionless:t,isGrouped:n,isGroupedByMeasure:r}=e.meta;return t?DG:n?r?LG:zG:TG}({layoutService:r}),p=()=>"horizontal"===i.meta.major.orientation?t().width:t().height,m=e=>e?p()/e:0,g=(e,t)=>-(e-t)*m(t);return{getItems(){const n=r.getLayoutValue("dimensionAxis"),l=d({layoutService:r,getReducedCube:u});return{inTotal:l,inView:FG({chart:e,rect:t(),dockService:i,itemWidths:o(),axisKey:a,renderer:s,isGrouped:r.meta.isGrouped,dimensionAxis:n,inTotal:l,isMajorLabelless:"none"===n.show||"title"===n.show,maxDataRows:Math.floor(1e4/(r.meta.dimensionCount+r.meta.measureCount))})}},getItemSize({items:e}){const{inView:t}=e;return m(t)},getOffsets({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t,i=Math.min(0,Math.max(e,g(n,r))),o=r?Math.abs(r*i/p()):0;return{start:{pixel:i,item:o},end:{item:Math.min(o+(r||0),n)}}},getUpperBound({items:e}){const{inTotal:t,inView:n}=e;return g(t,n)},getViewRange({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return function({viewSize:e,inTotal:t,inView:n,pixelOffset:r}){const i=e/n*t,o=Math.abs(r)/i;return[o,Math.min(1,o+e/i)]}({viewSize:p(),inTotal:n,inView:r,pixelOffset:e})},getArea:({itemOffset:e,items:t})=>f({getDataPages:n,layoutService:r,itemOffset:e,inView:t.inView,areaBuffer:l}),getScaleRange({offsets:e,items:t}){const o=h({getDataPages:n,layoutService:r,offsets:e,items:t,viewSize:p(),upperBound:g(t.inTotal,t.inView)});return"horizontal"===i.meta.major.orientation&&c?function(e){return[1-e[1],1-e[0]]}(o):o},validate:{offset({pixelOffset:e,items:t}){const{inTotal:n,inView:r}=t;return e<=0&&e>=g(n,r)}},convert:{itemToPixelOffset({itemOffset:e,items:t}){const{inView:n}=t,r=e*m(n);return Number.isFinite(r)?-r:0},relativeToPixelOffset({relativeOffset:e,items:t}){const{inTotal:n,inView:r}=t;return-e*(m(r)*n)}}}}function $G({chart:e,componentKey:t,state:n,dataStore:r,pageData:i,layoutService:o,dockService:a,itemWidths:s,getRect:l,axisKey:c,renderer:u,areaBuffer:d,viewState:f,rtl:h,getReducedCube:p}){n.set("rect",{width:0,height:0}),n.set("itemWidths",{}),n.set("itemSize",0),n.set("items",{}),n.set("offsets",{}),n.set("finished",0),n.set("scaleRange",[0,1]);const m=jG({chart:e,getRect:()=>n.get("rect"),getDataPages:r.getCurrent,layoutService:o,dockService:a,getItemWidths:()=>n.get("itemWidths"),axisKey:c,renderer:u,areaBuffer:d,rtl:h,getReducedCube:p}),g=()=>{const e=m.getItems();return n.set("items",e),e},y=({pixelOffset:e,items:t})=>{const r=m.getOffsets({pixelOffset:e,items:t});return n.set("offsets",r),r},v=e=>{const t=Date.now(),r=g(),a=y({pixelOffset:e,items:r}),s=m.getArea({itemOffset:a.start.item,items:r});if((e=>{const[{qArea:t}]=o.getDataPages();return!!t&&Object.keys(e).every(n=>e[n]===t[n])})(s))return void((m.validate.offset({pixelOffset:e,items:r})||f.get("scrollOffset").start!==a.start.item)&&(n.set("finished",t),n.set("scaleRange",m.getScaleRange({offsets:a.start,items:r})),f.preventSet("viewRange",m.getViewRange({pixelOffset:a.start.pixel,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item})));f.preventSet("viewRange",m.getViewRange({pixelOffset:a.start.pixel,items:r}));const l=()=>{n.get("finished")>t||(n.set("finished",t),n.set("scaleRange",m.getScaleRange({offsets:a.start,items:r})),f.set("scrollOffset",{start:a.start.item,end:a.end.item}))};i(s,{onProcessing:l,onDataPage:l})};return{enabled(){const{inTotal:e,inView:t}=n.get("items");return e>t},itemSize:()=>n.get("itemSize"),scaleRange:()=>n.get("scaleRange"),initialize(){const r=e.component(t);if(!r)return Promise.resolve();n.set("rect","function"==typeof l?l():r.rect),n.set("itemWidths","function"==typeof s?s():s);const a=g();n.set("itemSize",m.getItemSize({items:a}));const c=(({items:e})=>{const t=o.getLayoutValue("scrollStartPos"),n=f.get("scrollOffset");if(void 0===n)return 1===t?m.getUpperBound({items:e}):0;if("number"==typeof n)return m.convert.itemToPixelOffset({itemOffset:n,items:e});const{start:r,end:i}=n,a=1===t&&i?i-e.inView:r;return m.convert.itemToPixelOffset({itemOffset:a,items:e})})({items:a}),u=y({pixelOffset:c,items:a});f.preventSet("viewRange",m.getViewRange({pixelOffset:u.start.pixel,items:a}));const d=m.getArea({itemOffset:u.start.item,items:a});return new Promise(e=>{i(d,{onDataPage:()=>{n.set("scaleRange",m.getScaleRange({offsets:u.start,items:a})),f.preventSet("scrollOffset",{start:u.start.item,end:u.end.item}),e()}})})},scroll(e){const t=n.get("offsets").start.pixel+e;v(t)},scrollToRelative(e){const t=n.get("items"),r=m.convert.relativeToPixelOffset({relativeOffset:e,items:t});v(r)}}}function BG({chart:e,actions:t,componentKey:n,enigmaModel:r,layoutService:i,dockService:o,trendLineModel:a,itemWidths:s,viewState:l,rtl:c,options:{definitionPath:u="/qHyperCubeDef",getRect:d,axisKey:f,renderer:h,areaBuffer:p,processDataPage:m=()=>{},getReducedCube:g=()=>{}}={}}){const y=gc(),v=function({qMode:e}){switch(e){case"K":return xG;case"T":return SG;default:return bG}}({qMode:i.getHyperCubeValue("qMode")}),b=function({state:e,contains:t}){return e.set(MG,[]),{add:t=>{const n=e.get(MG);n.length=0,n.push(t)},getCurrent:()=>e.get(MG)[0],getAll:()=>e.get(MG),contains:n=>t(e.get(MG)[0],n)}}({state:y,contains:v.contains});!function({layoutService:e,dataStore:t,composition:n}){const r=e.getDataPages()[0];if(!r)return;const i=n.patcher({layoutService:e});i.should(r)&&i(r),t.add(r)}({layoutService:i,dataStore:b,composition:v});const x=function({buffer:e}){return void 0===e?void 0:2*Math.round(e/2)}({buffer:p}),S=NG({dataStore:b,composition:v,enigmaModel:r,layoutService:i,trendLineModel:a,definitionPath:u,processDataPage:m}),M=$G({chart:e,componentKey:n,state:y,dataStore:b,pageData:S,layoutService:i,dockService:o,itemWidths:s,getRect:d,axisKey:f,renderer:h,areaBuffer:x,viewState:l,rtl:c,getReducedCube:g}),w=function({layoutService:e,dataStore:t}){return function(n){const r=hc(n,`${e.refs.dataPages}`);r.length=0,r.push(t.getCurrent())}}({layoutService:i,dataStore:b}),E=function({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o}){return{gestures:[EG({chart:e,actions:t,componentKey:n,dockService:r,rtl:i,scroller:o})],native:{type:"native",events:{wheel:kG({chart:e,actions:t,componentKey:n,scroller:o})}}}}({chart:e,actions:t,componentKey:n,dockService:o,rtl:c,scroller:M});return{interactions:E,query:{getCanScroll:()=>M.enabled(),getItemSize:()=>M.itemSize(),getScaleRange:()=>M.scaleRange(),getCurrentDataPage:()=>b.getCurrent()},command:{initialize:()=>M.initialize(),scrollTo:e=>M.scrollToRelative(e),setSnapshotData:e=>w(e)}}}var VG={SPARK:{DEFAULT:7,SQUEEZE:7,LABELLESS:7},XSMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},SMALL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},MEDIUM:{DEFAULT:28,SQUEEZE:24,LABELLESS:20},FULL:{DEFAULT:28,SQUEEZE:24,LABELLESS:20}};function HG({layoutService:e,key:t}){const{style:n}=e.getLayoutValue("components",[]).filter(e=>e.key===t)[0]||{};return({property:e,defaultValue:t})=>n&&Object.hasOwnProperty.call(n,e)?n[e]:t}function UG({layoutService:e,dockService:t,themeService:n,colorService:r,flags:i}){const{BAR:o,LINE:a,POINT:s}=$p,l=n.getStyles(),c=(e=>!!e&&IK.gt(IK.coerce(e),IK.coerce("1.45.0")))(e.getLayoutValue("version"))&&i.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS"),u=HG({layoutService:e,key:"bar"}),d=HG({layoutService:e,key:"line"}),f=()=>{const e=u({property:"strokeWidth",defaultValue:"none"});return e?o.STROKE.WIDTH[e.toUpperCase()]:0},h=t=>i.isEnabled("CLIENT_IM_3050")?e.getLayoutValue("components",[]).find(e=>e.key===t):void 0,p=(e,t)=>{const n=r.getPaletteColor;if(e?.color&&n){const r=n(e);return"none"===r&&e.index>0?e?.color??t:r??t}return t};return{query:{bar:{getHasStyling:()=>!!e.getLayoutValue("components",[]).filter(e=>"bar"===e.key).length,getWidthFn:()=>()=>u({property:"width",defaultValue:.7}),getHasStrokeWidth:()=>!!f(),getStrokeWidth:()=>f(),getStrokeColor:()=>p(u({property:"strokeColor"}),o.STROKE.COLOR),label:{getStyle:()=>{const e=h("bar")?.bar?.label?.value;return{fill:p(e?.color,l.label.value.color),useContrastColor:e?.useContrastColor??!0,fontSize:e?.fontSize??12,fontFamily:e?.fontFamily??l.label.value.fontFamily}}}},line:{getCurveFn:()=>()=>d({property:"lineCurve",defaultValue:c?a.CURVE.MONOTONE:a.CURVE.LINEAR}),getStrokeWidthFn:()=>()=>d({property:"lineThickness",defaultValue:c?a.WIDTH.DEFAULT:"FULL"===t.meta.chart.mode?a.WIDTH.FULL.DEFAULT:a.WIDTH.LESS.DEFAULT}),getStrokeDasharrayFn:()=>()=>{const e=d({property:"lineType",defaultValue:a.TYPE.SOLID});return e&&a.TYPE[e.toUpperCase()]}},point:{getSize:()=>d({property:"dataPointSize",defaultValue:c?s.SIZE.NEW_DEFAULT:s.SIZE.DEFAULT}),label:{getStyle:()=>{const e=h("line")?.line?.label?.value;return{fill:p(e?.color,l.label.value.color),fontSize:e?.fontSize??l.label.value.fontSize,fontFamily:e?.fontFamily??l.label.value.fontFamily}}}},marker:{label:{getStyle:()=>{const e=h("marker")?.marker?.label?.value;return{fill:p(e?.color,l.label.value.color),fontSize:e?.fontSize??l.label.value.fontSize,fontFamily:e?.fontFamily??l.label.value.fontFamily}}}},axis:{title:{getStyle:()=>{const e=h("axis")?.axis?.title;return{fontFamily:e?.fontFamily??l.axis.title.fontFamily,fontSize:e?.fontSize??l.axis.title.fontSize,color:p(e?.color,l.axis.title.color)}}},label:{getStyle:()=>{const e=h("axis")?.axis?.label?.name;return{fill:p(e?.color,l.axis.label.name.color),fontSize:e?.fontSize??l.axis.label.name.fontSize,fontFamily:e?.fontFamily??l.axis.label.name.fontFamily}}}},legend:{title:{getStyle:()=>{const e=h("legend")?.legend?.title;return{fontFamily:e?.fontFamily??l.legend.title.fontFamily,fontSize:e?.fontSize??l.legend.title.fontSize,color:p(e?.color,l.legend.title.color)}}},label:{getStyle:()=>{const e=h("legend")?.legend?.label;return{fontFamily:e?.fontFamily??l.legend.label.fontFamily,fontSize:e?.fontSize??l.legend.label.fontSize,color:p(e?.color,l.legend.label.color)}}}}}}}function WG({layoutService:e}){return function({layout:e,config:t={}}){const n={disclaimer:void 0,isSuppressing:!1,showDisclaimer:t.args?.layoutService?t.args.layoutService.getLayoutValue("showDisclaimer"):e?.showDisclaimer};return{initialize:({args:r}={})=>{n.disclaimer=function({args:e,disclaimers:t}){const n=[];return Object.keys(t).forEach(r=>{const i=tc[r],o=t[r];o&&(o.condition||i?.condition||nc)(e)&&n.push({key:i?.translationKey||i?.key||r,alignment:o.alignment||i?.alignment||ec})}),n.find(e=>e.alignment===Ql)||n[0]}({args:{layout:e,...t.args,...r},disclaimers:t.disclaimers||{}}),n.isSuppressing=!(!n.disclaimer||n.disclaimer.alignment!==Ql)},getDisclaimer:()=>n.isSuppressing?n.disclaimer:!1===n.showDisclaimer?void 0:n.disclaimer,getHasSuppressingDisclaimer:()=>n.isSuppressing}}({config:{args:{layoutService:e},disclaimers:{NoDataExist:!0,OnlyNanDataMeasure:!0,OnlyNanDataDimensionContinuous:!0}}})}function YG({dataset:e,data:t,valueData:n}){const{source:r,label:i,value:o}=n,a=e(r.key).field(r.field);return y.shouldUseFormat(a.raw())?"-"===i||""===o||Number.isNaN(o)||"NaN"===o||t.null?.value?"-":a.formatter()(o):i}function KG({chart:e,actions:t,translator:n,rtl:r,dockService:i,seriesModel:o,colorService:a,themeService:s,layoutService:l,propertiesModel:c,custom:u}){const d=s.getStyles(),{isLineStacked:f}=l.meta,h=({data:e})=>e.major.value,p=({data:e})=>!e.null.value||0===e.end.value,{SLICED_HAT:m}=Kf.COMPONENT,{PRIMARY:g,SECONDARY:y}=Xf,v=function({dockService:e,seriesModel:t}){const{AXIS:n,BAR_OOB:r,DATA_OOB_MARKER:i,SLICED_HAT:o}=Kf.COMPONENT,{PRIMARY:a,SECONDARY:s}=Xf,{orientation:l}=e.meta.chart,c="vertical"===l,u=[...t.meta.barComponentKeys,...t.meta.markerComponentKeys,...t.meta.pointComponentKeys];return[({chart:e,hovered:t,meta:l})=>{const[d]=t,{triggerer:f}=l,h=f===n.MAJOR?d.data.value:d.data.major.value;if(c){const t=e.findShapes("container").find(e=>(e.key===`${o}-max-${a}`||e.key===`${o}-max-${s}`)&&e.data&&e.data.value===h&&e.children.length);if(t)return{key:t.key,bounds:t.bounds}}const p=e.findShapes("path").find(e=>(e.key===`${r}-max-${a}`||e.key===`${r}-max-${s}`||e.key===`${i}-max`)&&e.data.major.value===h);if(c&&p)return{key:p.key,bounds:p.bounds};const m=e.findShapes("path").find(e=>(e.key===`${r}-min-${a}`||e.key===`${r}-min-${s}`||e.key===`${i}-min`)&&e.data.major.value===h),g=e.findShapes("*").filter(e=>u.indexOf(e.key)>-1&&e.data&&e.data.major.value===h);if(c&&m&&!g.find(e=>e.data.end?.source?.field!==m.data.end?.source?.field)&&!g.find(e=>e.data.segment?.source?.field!==m.data.source?.field))return{key:m.key,bounds:m.bounds};const y=p||m;return!(c||!y||g.find(e=>e.data.end?.source?.field!==y.data.end?.source?.field)||g.find(e=>e.data.segment?.source?.field!==y.data.source?.field))&&{key:y.key,bounds:y.bounds}},"collectible"]}({dockService:i,seriesModel:o});return yf({chart:e,translator:n,config:{rtl:r,enable:()=>t.tooltip.enabled(),getColorSettings:()=>a.getSettings(),style:{fontFamily:d.fontFamily},main:{key:Kf.COMPONENT.TOOLTIP,getGroupByValue:h,collectibles:[...o.meta.barComponentKeys.map(e=>({key:e,type:"bar",major:h})),...o.meta.pointComponentKeys.map(e=>({key:e,type:"point",major:h})),...o.meta.markers.map(e=>({key:e.key,type:e.type,major:h}))],triggers:[{keys:[Kf.COMPONENT.AXIS.MAJOR],collect:{from:"dimension",by:({data:e})=>e.value,filter:p},placement:v},{keys:[...o.meta.barComponentKeys,...o.meta.markerComponentKeys,`${m}-max-${g}`,`${m}-max-${y}`,`${m}-min-${g}`,`${m}-min-${y}`,`${Kf.COMPONENT.BAR_OOB}-max-${g}`,`${Kf.COMPONENT.BAR_OOB}-max-${y}`,`${Kf.COMPONENT.BAR_OOB}-min-${g}`,`${Kf.COMPONENT.BAR_OOB}-min-${y}`,`${Kf.COMPONENT.DATA_OOB_MARKER}-max`,`${Kf.COMPONENT.DATA_OOB_MARKER}-min`],collect:{from:"dimension",by:h,filter:p},placement:v},{keys:[...o.meta.pointComponentKeys],distance:3,collect:{from:"dimension",by:h,filter:p},placement:v}],section:({h:e,nodes:t,dataset:n,create:r,util:i})=>{const[o]=t,{title:a,description:s,measures:l}=u.isEnabled()?u.getAttributes({dataset:n,nodes:[o]}):{},c=[];a&&c.push(r.text({value:a,style:{bold:!0}})),s&&c.push(r.text({value:s}));const d=u.hideBasic();d&&!l.length&&(a||s)||c.push(r.text({value:o.data.label,style:{bold:!0}})),d||(c.push(r.color({nodes:t,property:Kf.SCALE.COLOR})),c.push(...t.map(e=>{const{segment:t,end:o,point:a}=e.data,s=e.key.includes("point-component")&&f?a:t||o,{key:l,field:c}=s.source;return r.measure({label:i.dataset.title(l,c),value:YG({dataset:n,data:e.data,valueData:s})})}))),l&&c.push(...l.map(e=>r.measure({label:e.label,value:e.value,survive:{color:!0,duplicate:!0}}))),u.chart.isEnabled()&&(u.chart.hasLimitation()?(u.chart.destroy(),c.push(r.raw({value:u.chart.createLimitationRow()}))):c.push(r.raw({value:u.chart.createContainer({h:e})})));const{customTooltipImages:h}=o.data;return u.isEnabled()&&h&&c.push(...h.map(t=>r.raw({value:u.createImageRow({value:t,h:e})}))),c},layout:{grouping:!0,single:()=>!(!u.isEnabled()||!u.hasImages())||u.chart.isEnabled()},events:{tooltip:{beforeShow:({collectNodes:e})=>u.isEnabled()&&u.hasImages()?u.addImages({nodes:e()}):Promise.resolve(),afterShow:({nodes:e})=>{u.chart.isEnabled()&&!u.chart.hasLimitation()&&u.chart.show({nodes:e,properties:c.query.getProperties()})}},interaction:{mouseleave:()=>{u.chart.isEnabled()&&u.chart.hasAlternateState()&&u.chart.hide()}}}},legend:{keys:{tooltip:Kf.COMPONENT.LEGEND_TOOLTIP,component:Kf.COMPONENT.LEGEND_CATEGORICAL}}}})}const{model:GG}=Gy,XG=({picasso:t,chart:n,environment:r,flags:i,viewState:o,viewCache:a,actions:s,selectionService:c})=>{const u=e.useStaleLayout(),{width:d,height:f}=e.useRect(),[h,m]=e.useState(),[g,y]=e.useState(),v=e.useModel(),b=e.useApp(),x=e.useAppLayout(),M=e.usePlugins(),w=e.useEmbed(),E=SW({enable:!1===h?.layoutService?.meta?.isSnapshot}),k=e.useRenderState();e.useEffect(()=>{if(!(u&&n?.update&&r&&o&&c))return;const e=function({source:e,metaAdditionsFn:t,experimental:n={filter:!1}}){const r=ys(!0,{},e),i=n.filter?function(e){const{qHyperCube:t}=e,{reduced:n,filtered:r}=xc(t,bc.DIMENSION);t[bc.DIMENSION]=n;const{reduced:i,filtered:o}=xc(t,bc.MEASURE);return t[bc.MEASURE]=i,{dimensions:r,measures:o}}(r):{dimensions:[],measures:[]};let o=Mc(r);const a=()=>{const e=function({layout:e,additionsFn:t=()=>({}),additionsProps:n={}}){const{qDimensionInfo:r,qMeasureInfo:i,qMode:o}=e.qHyperCube,a=r.length,s=i.length,l={mode:{S:"S"===o,P:"P"===o,K:"K"===o,T:"T"===o},dimensionCount:a,measureCount:s,hasMultipleDimensions:a>1,hasMultipleMeasures:s>1,isOneDimensional:1===a,isTwoDimensional:2===a,...n};return{...l,...t({layout:e,meta:l})}}({layout:r,additionsFn:t,additionsProps:{size:o.size}});return e.filteredFields=i,e},s={refs:{...o.refs},meta:a(),getLayout:()=>r,getLayoutValue:(e,t)=>hc(r,e,t),setLayoutValue:(e,t)=>{mc(r,e,t),o=Mc(r),s.meta=a()},getHyperCube:()=>r.qHyperCube,getHyperCubeValue:(e,t)=>hc(r.qHyperCube,e,t),setHyperCubeValue:(e,t)=>{mc(r.qHyperCube,e,t),o=Mc(r),s.meta=a()},getDataPages:()=>hc(r,o.refs.dataPages),setDataPages:e=>{mc(r,o.refs.dataPages,e),s.meta=a()}};return s}({source:u,metaAdditionsFn:function({layout:e}){const t=hc(e,"qHyperCube.qMeasureInfo",[]),n=PK(t,Gf.LINE),r=n.length>0,i=S.continuous({layout:e,auto:()=>r&&p.isTime(!0,e)}),o=!LK(hc(e,"version","")),a=PK(t,Gf.BAR),s=a.length,l=a.filter(zK).length,c=a.filter(FK).length,u=o?l>1||c>1:s>1,d=("grouped"!==hc(e,"barGrouping.grouping")||i)&&u,f=!d&&s>1,h=o&&d&&(l>0&&c>1||l>1&&c>0),m=!!e?.qHyperCube?.qDimensionInfo?.[0]?.qLocked,g=!("area"!==e?.lineType),y=n.filter(zK).length>1||n.filter(FK).length>1,v=g&&e.stackedArea&&y;return{canBeContinuous:p.canBeContinuous(e),isDiscrete:!i,isContinuous:i,isTime:p.isTime(i,e),isSnapshot:S.snapshot(e),isBarSeriesStacked:d,isBarSeriesGrouped:f,isBarSeriesStackedInBothAxis:h,isGrouped:f||h,isGroupedByMeasure:f||h,isDimensionLocked:m,groupSize:h?2:s,hasLineSeries:r,isArea:g,isLineStacked:v}},experimental:{filter:!0}}),{options:l,translator:h}=r,{direction:g}=l,y="rtl"===g,E=function({genericObjectModel:e,layoutService:t}){const n={cube:void 0,on:!1},r=BK({genericObjectModel:e,layoutService:t});return{query:{getCube:()=>n.cube,getIsReduced:()=>n.on},command:{initialize:()=>r().then(({reducedCube:e})=>{n.cube=e,n.on=!!(n.cube&&n.cube.qDataPages[0]&&n.cube.qDataPages[0].qIsReduced)}),setSnapshotData:e=>{e.reducedHyperCube=n.cube}}}}({genericObjectModel:v,layoutService:e}),k=function({app:e,translator:t}){const n={initialized:!1,dimensions:[],measures:[]};return{initialize:async({properties:r})=>{if(n.initialized)return;const i={app:e,translator:t,properties:r},o=[fs(i),hs(i)],a=await Promise.all(o),[s,l]=a;n.dimensions=s,n.measures=l,n.initialized=!0},getAlternatives:()=>({dimensions:[...n.dimensions],measures:[...n.measures]})}}({app:b,translator:h}),C=fc({chart:n,layoutService:e,config:{logicalSize:{width:d,height:f},rtl:y},typeConfig:{type:"major-minor",fallback:"vertical",invert:!0,measureAxes:[{ref:"measureAxes.0",name:"minor"},{ref:"measureAxes.1",name:"minorSecondary"}]}}),A=_K({layoutService:e}),O=e.meta.isDiscrete?function({chart:e,genericObjectModel:t,layoutService:n,dockService:r,seriesModel:i,viewState:o,rtl:a,actions:s,picasso:l}){return BG({chart:e,actions:s,componentKey:Xy(i),enigmaModel:t,layoutService:n,dockService:r,viewState:o,rtl:a,itemWidths:VG,options:{axisKey:Kf.COMPONENT.AXIS.MAJOR,renderer:l.renderer("svg")()}})}({chart:n,genericObjectModel:v,layoutService:e,dockService:C,seriesModel:A,viewState:o,rtl:"rtl"===r.options.direction,actions:s,picasso:t}):void 0,N=e.meta.isContinuous?GG({model:v,layoutService:e,viewState:o,viewCache:a}):void 0,D=function({theme:e,config:t={}}){const{id:n,resolve:r=[],transform:i=[],extend:o=[]}=t,a={theme:e,matrix:Rd(r),styles:void 0};return a.styles=Pd({theme:e,id:n,transform:i,extend:o,matrix:a.matrix}),{getStyles:()=>a.styles,getTheme:()=>a.theme,setTheme:e=>{a.theme=e,a.styles=Pd({theme:e,id:n,transform:i,extend:o,matrix:a.matrix})}}}({theme:r.theme,config:{id:"comboChart",resolve:[["object","plugins.label","fontFamily",'"Source Sans Pro", "Arial", "sans-serif"'],["object","plugins.label","fontSize","12px"]]}}),T=fG({actions:s,appLayoutModel:x,appModel:b,chart:n,environment:r,genericObjectModel:v,layoutService:e,picasso:t,seriesModel:A,viewState:o}),q=UG({layoutService:e,dockService:C,themeService:D,colorService:T,flags:i}),I=function({layoutService:e,seriesModel:t}){const{isContinuous:n}=e.meta,r="qDimensionInfo/0",i=`${r}:numeric`,o=t.meta.primarySeries.map(e=>e.ref),a=t.meta.secondarySeries.map(e=>e.ref),s=n?[{key:i,from:r,override:{value:e=>e.qNum}}]:void 0;return{main:{major:r,majorNumeric:i,minorsPrimary:o,minorsSecondary:a},virtuals:s}}({layoutService:e,seriesModel:A}),R=YK({isPrimary:!0,layoutService:e,reducedModel:E,seriesModel:A,continuousModel:N}),L=YK({isPrimary:!1,layoutService:e,reducedModel:E,seriesModel:A,continuousModel:N}),_=WG({layoutService:e}),P=lG({config:{measureAxesRef:"measureAxes.0",formatter:Kf.FORMATTER.PRIMARY},chart:n,layoutService:e,extremumModel:R,dockService:C,seriesModel:A,themeService:D}),z=lG({config:{measureAxesRef:"measureAxes.1",formatter:Kf.FORMATTER.SECONDARY},chart:n,layoutService:e,extremumModel:L,dockService:C,seriesModel:A,themeService:D}),F=cG({genericObjectModel:v,layoutService:e}),j=yh({flags:i,layout:u,app:b,model:v,picasso:t,chart:n,translator:h,localeInfo:x.qLocaleInfo,embed:w,options:l}),$=KG({chart:n,actions:s,translator:h,rtl:y,dockService:C,seriesModel:A,colorService:T,themeService:D,layoutService:e,propertiesModel:F,custom:j}),B=Af({layoutService:e,discreteModel:O}),V=function(e){return{layout:e.getLayout(),keys:{SCALE:{MAJOR:Kf.SCALE.MAJOR,MAJOR_INNER:Kf.SCALE.MAJOR_INNER,MINOR:{PRIMARY:Kf.SCALE.MINOR.PRIMARY,SECONDARY:Kf.SCALE.MINOR.SECONDARY}},COMPONENT:{BAR_PRIMARY:`${Kf.COMPONENT.BAR}-${Xf.PRIMARY}`,BAR_SECONDARY:`${Kf.COMPONENT.BAR}-${Xf.SECONDARY}`,AXIS:{MAJOR:Kf.COMPONENT.AXIS.MAJOR,MAJOR_CONTINUOUS:Kf.COMPONENT.AXIS.MAJOR_CONTINUOUS,TIME_INNER:Kf.COMPONENT.AXIS.TIME_INNER,MINOR:{PRIMARY:Kf.COMPONENT.AXIS.MINOR.PRIMARY,SECONDARY:Kf.COMPONENT.AXIS.MINOR.SECONDARY}},AXIS_TITLE:{MAJOR:Kf.COMPONENT.AXIS_TITLE.MAJOR,MINOR:{PRIMARY:Kf.COMPONENT.AXIS_TITLE.MINOR.PRIMARY,SECONDARY:Kf.COMPONENT.AXIS_TITLE.MINOR.SECONDARY}}},COLLECTION:{MAIN:Kf.COLLECTION.MAIN}}}}(e),H=function({picassoInstance:e,plugins:t,pluginArgs:n={}}){const r={initialized:!1,definitions:[]};return{async initialize(){if(r.initialized)return;const i=Promise.all(t.filter(e=>"custom-component"===e.info.type).map(async t=>{if(!t.info.componentName)throw new Error("plugin-service: Custom component is missing componentName");const r=await t.fn({...n});if("object"!=typeof r)throw new Error("plugin-service: Custom component needs to be an object");e.component(t.info.componentName,r)})),o=Promise.all(t.filter(e=>"component-definition"===e.info.type).map(e=>e.fn({...n}))),a=await Promise.all([i,o]);r.initialized=!0,r.definitions.push(...a[1])},extendComponents:e=>r.initialized?(r.definitions.filter(Boolean).forEach(t=>{const[n]=e.filter(e=>e.key&&e.key===t.key);if(n){const e=ys(!0,{},n.brush);ys(!0,n,t),t.brush&&(n.brush=function(e,t){return"object"==typeof e&&Object.keys(e).length?(Array.isArray(t.consume)&&(e.consume=wc({originalArray:e.consume,newArray:t.consume,matchKey:"context"})),Array.isArray(t.trigger)&&(e.trigger=wc({originalArray:e.trigger,newArray:t.trigger,matchKey:"on"})),e):t}(e,t.brush))}else e.push(t)}),e):e}}({picassoInstance:t,plugins:M,pluginArgs:V}),U=function({options:e,viewCache:t,layoutService:n}){const r={hasSlicedHats:!1,isPartialUpdating:!1,isSizeChanging:!1};return{enabled:()=>!(!1===e.chartAnimations||r.hasSlicedHats||r.isPartialUpdating||r.isSizeChanging||xf.propertiesHaveChanged({viewCache:t,layout:n.getLayout()})),meta:r}}({options:l,viewCache:a,layoutService:e});m({alternativeService:k,selectionService:c,genericObjectModel:v,appModel:b,dockService:C,styleModel:q,layoutService:e,fieldModel:I,seriesModel:A,reducedModel:E,primaryExtremumModel:R,secondaryExtremumModel:L,primaryTickModel:P,secondaryTickModel:z,propertiesModel:F,colorService:T,themeService:D,appLayoutModel:x,tooltipService:$,disclaimerService:_,flags:i,...O&&{discreteModel:O},...N&&{continuousModel:N},refLineModel:B,pluginService:H,animationsModel:U})},[u,v,b,x,r,n?.update,o,c]);const[,C]=e.usePromise(()=>{if(!h)return Promise.resolve();const{alternativeService:e,layoutService:t,colorService:n,reducedModel:i,primaryExtremumModel:a,secondaryExtremumModel:d,propertiesModel:f,continuousModel:p,discreteModel:m,pluginService:g,disclaimerService:x,styleModel:S}=h,M=p?()=>{p.update(t.getLayout());const e=p.initialFetch(),n=!t.meta.isSnapshot&&r?.options?.viewState?.zoom;return n&&o.preventSet("zoom",n),e}:()=>Promise.resolve(),w=n.initialize().then(()=>{const e=n.getSettings().field;c&&c.setBrushAliases({colorField:e}),n.custom.updateLegend(S)});return Promise.all([g.initialize(),i.command.initialize(),v?f.command.initialize():Promise.resolve(),w,M(),s.scroll.attachDiscreteModel(m)]).then(async()=>{let n;if(t.meta.isSnapshot||(n=f.query.getProperties()),n?.qHyperCubeDef){const e=l(!0,{},n),r=(({properties:e,layout:t,model:n,layoutService:r})=>{const i=t.qHyperCube.qMeasureInfo,o=l(!0,{},e);return((e,t)=>{const{color:{mode:n}}=t;"byExpression"===n&&0===e.length?t.color.mode="primary":"byDimension"===n&&e.length>1&&(t.color.mode="byMultiple")})(i,e),n.colorSupport?.colorByUpdater?.(e,"qHyperCubeDef.",t),function({properties:e,layoutService:t}){const{filteredFields:n}=t.meta;if(!(n.measures.length>0))return;const{mode:r}=e.color||{};if("byExpression"===r){const r=t.getLayout();if("colorByExpression"===r.qHyperCube.qMeasureInfo?.[0]?.qAttrExprInfo?.[0]?.id)return;const{current:i,target:o}=function({properties:e,filtered:t}){const{qMeasures:n}=e.qHyperCubeDef||[],{current:r,target:i}=n.reduce((e,n,r)=>("colorByExpression"===n.qAttributeExpressions[0]?.id&&(e.current=r),void 0!==e.target||t.includes(r)||(e.target=r),e),{current:void 0,target:void 0});return{current:r,target:i}}({properties:e,filtered:n.measures});if(void 0===i)return;const a=e.qHyperCubeDef.qMeasures[i].qAttributeExpressions[0];e.qHyperCubeDef.qMeasures[i].qAttributeExpressions.splice(0,1),e.qHyperCubeDef.qMeasures[o].qAttributeExpressions.splice(0,0,a)}}({properties:e,layoutService:r}),!Ii.compare(o,e,!0)&&JSON.stringify(o)!==JSON.stringify(e)&&(e.hash=Math.random(),!0)})({properties:n,layout:t.getLayout(),model:v,layoutService:t});if(r)return(e=>!(!e||e.qHasSoftPatches||e.qExtendsId||!((e.qMeta?.privileges||[]).indexOf("update")>-1)))(u)?(await v.setProperties(n),b.clearUndoBuffer()):await((e,t,n)=>{if(!e)return Promise.resolve();let r=Ii.generate(t,n);return l(!0,t,n),r&&r.length?(r=r.map(e=>({qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path})),e.applyPatches(r,!0)):Promise.resolve()})(v,e,n),void k.pending();k.restore()}return Promise.all([a.command.initialize(),d.command.initialize()]).then(async()=>{await e.initialize({properties:f.query.getProperties()||{}}),x.initialize(),y({...h})})})},[h,E]);if(C)throw C;return g};const JG={shapes:[{type:"path",attrs:{d:"M15.9488039,5.20769129 C16.0487326,6.70662306 15.3492311,8.30548361 14.050157,9.30477145 C12.651154,10.5039169 10.8524359,10.8037032 8.85386017,10.4039881 L7.3549284,10.0042729 L5.75606786,9.70448659 C5.75606786,9.90434416 5.65613907,10.0042729 5.4562815,10.2041305 C5.05656637,10.6038456 4.55692244,10.8037032 4.05727852,10.8037032 C3.75749217,10.8037032 3.45770582,10.7037744 3.15791946,10.6038456 C3.05799068,10.903632 3.15791946,11.2034184 3.45770582,11.7030623 C5.05656637,14.0014243 3.85742095,15.9000712 3.75749217,16 L2.2585604,15.3004985 C2.2585604,15.2005697 2.95806189,14.0014243 1.95877405,12.6024213 C1.6589877,12.0028486 1.15934378,11.0035608 1.55905891,10.0042729 C1.6589877,9.80441537 1.75891648,9.6045578 1.95877405,9.40470024 C1.6589877,8.90505631 1.55905891,8.30548361 1.85884527,7.7059109 C1.55905891,7.40612455 1.25927256,7.1063382 1.15934378,6.70662306 C0.859557424,5.90719279 0.959486209,4.5081898 1.6589877,3.30904439 C1.95877405,2.6095429 2.55834676,2.0099702 3.15791946,1.51032628 C3.95734974,0.91075357 4.95663758,0.610967217 6.15578299,0.311180864 C9.05371774,-0.388320626 11.9516525,0.111323295 13.9502282,1.61025506 C15.1493736,2.50961412 15.8488751,3.80868831 15.9488039,5.20769129 Z M13.0508691,8.10562604 C13.8502994,7.40612455 14.3499433,6.40683671 14.3499433,5.30762008 C14.2500145,4.20840345 13.550513,3.40897318 12.9509403,2.90932926 C12.1515101,2.40968533 11.252151,2.0099702 10.1529344,1.81011263 C8.95378895,1.61025506 7.75464354,1.71018384 6.45556935,1.91004141 C4.75678001,2.30975655 3.65756338,3.00925804 3.05799068,4.10847467 C2.55834676,5.00783373 2.65827554,5.90719279 2.75820433,6.20697914 C2.75820433,6.30690792 2.85813311,6.40683671 3.05799068,6.40683671 C3.15791946,6.40683671 3.25784825,6.40683671 3.35777703,6.40683671 C3.45770582,6.40683671 3.45770582,6.40683671 3.45770582,6.40683671 L3.5576346,6.40683671 L3.65756338,6.40683671 C4.65685123,6.40683671 5.4562815,6.90648063 5.85599664,7.80583969 L5.85599664,8.00569726 C6.35564056,8.10562604 7.05514205,8.30548361 7.75464354,8.50534118 L9.25357531,8.90505631 C10.0530056,9.0049851 10.7525071,9.0049851 11.4520086,8.80512753 C12.0515813,8.70519875 12.5512252,8.40541239 13.0508691,8.10562604 Z"}}]};const ZG={query:{getCanScroll:()=>!0}};function QG(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),[a,s]=e.useState(!1),l=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState({}),[a,s]=e.useState();return e.useEffect(()=>()=>{o({})},[]),e.useEffect(()=>{t&&r(!t.select&&!t.active)},[t]),{enabled:()=>n,emit:(e,...t)=>i[e].forEach(e=>e(...t)),removeListener:(e,t)=>{const n=i[e]?.indexOf(t);n>-1&&i[e].splice(n,1)},on:(e,t)=>{Array.isArray(i[e])?i[e].push(t):i[e]=[t]},get brushSelectionIncludeMax(){return a},set brushSelectionIncludeMax(e){s(e)},getBrushOptions:void 0}}(),c=function(){const t=e.useConstraints(),[n,r]=e.useState(!1),[i,o]=e.useState(!1),a=e.useLayout(),s=e.useTranslator(),l=!!a.qSelectionInfo.qInSelections,c=!!a.qHyperCube?.qDimensionInfo?.[0]?.qIsOneAndOnlyOne;e.useEffect(()=>{t&&r(!t.select&&!t.active)},[t]);const u=e=>{o("boolean"==typeof e?e:!i)};return e.useAction(()=>({key:"lasso",label:s.get(i?"Tooltip.ToggleOffLassoSelection":"Tooltip.ToggleOnLassoSelection"),icon:JG,hidden:!n||!l||c,active:i,action:u}),[l,c,i,n,s.language()]),{action:u,enabled:()=>n,active:()=>i}}();let u=ZG;e.useEffect(()=>{t&&(r(!t.active),o(!t.active),s(!t.passive))},[t]);const[d]=e.useState({});return d.scroll={enabled:()=>n&&u.query.getCanScroll(),attachDiscreteModel:e=>{u=e||ZG}},d.interact={enabled:()=>i},d.tooltip={enabled:()=>a},d.lasso=c,d.select=l,d}function eX({clearMinor:e,clearDiscrete:t,clearLegend:n}){e(),e({componentName:"minor-secondary-range-brush",eventName:"minorRange-secondary"}),t({brushName:!1}),n()}function tX({setSelectionInfo:e,event:t,components:n,clear:r}){const i=n?.length?n.map(e=>e.key).filter(Boolean):[];e({event:t,components:i,minorRangePrimary:"minorRange"===t,minorRange:["minorRange","minorRange-secondary"].includes(t),legendRange:"legendRange"===t,legendTap:"tap"===t&&i[0]===Kf.COMPONENT.LEGEND_CATEGORICAL}),r()}var nX,rX={exports:{}};var iX=(nX||(nX=1,function(e){self,e.exports=(()=>{var e={909:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}},8:(e,t)=>{(()=>{var e={229:e=>{var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},a=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,i=t.call(e,"constructor"),o=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!i&&!o)return!1;for(r in e);return void 0===r||t.call(e,r)},s=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(i)return i(e,n).value}return e[n]};e.exports=function e(){var t,n,r,i,c,u,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(t=arguments[f]))for(n in t)r=l(d,n),d!==(i=l(t,n))&&(p&&i&&(a(i)||(c=o(i)))?(c?(c=!1,u=r&&o(r)?r:[]):u=r&&a(r)?r:{},s(d,{name:n,newValue:e(p,u,i)})):void 0!==i&&s(d,{name:n,newValue:i}));return d}}},n={};function r(t){var i=n[t];if(void 0!==i)return i.exports;var o=n[t]={exports:{}};return e[t](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{r.r(i),r.d(i,{default:()=>Te});var e=r(229),t=r.n(e);const n=function(e,t,n){if(!t)return!1;var r,i=t.split("."),o=i[i.length-1],a=e;for(r=0;r<i.length-1;++r)void 0===a[i[r]]&&(a[i[r]]=Number.isNaN(+i[r+1])?{}:[]),a=a[i[r]];if(void 0!==n){var s=a[o];return a[o]=n,{updated:n,previous:s}}return delete a[o],!1},o=function(e,t,n){var r,i=t.split("."),o=e;if(void 0===o)return n;for(r=0;r<i.length;++r){if(void 0===o[i[r]])return n;o=o[i[r]]}return o},a={EXPRESSIONS:{observed:"",trend:"STL_Trend",seasonal:"STL_Seasonal",residual:"STL_Residual"},OPTIONS:[{value:"observed",translation:"cao.trendDecomposition.parameters.decomposition.observed"},{value:"trend",translation:"cao.trendDecomposition.parameters.decomposition.trend"},{value:"seasonal",translation:"cao.trendDecomposition.parameters.decomposition.seasonal"},{value:"residual",translation:"cao.trendDecomposition.parameters.decomposition.residual"}]};var s="".concat(" ","(").concat("　"),l="".concat("　",")").concat(" ");function c(e){return s+e+l}function u(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e.qLibraryId){var n=function(e,t){if(!t)return null;var n,r;for(n=0;n<t.length;n++)if((r=t[n]).qInfo.qId===e)return r;return null}(e.qLibraryId,t.dimensionList);return n&&n.qData.info[0].qTags.indexOf("$numeric")>-1}var r=function(e,t){if(!t)return null;var n,r,i=function(e){var t=e.trim();"="===t.charAt(0)&&(t=(t=t.substring(1)).trim());var n=t.length-1;return"["===t.charAt(0)&&"]"===t.charAt(n)&&(t=(t=t.substring(1,n)).trim()),t}(e);for(n=0;n<t.length;n++){if((r=t[n]).qName===i)return r;if(r.qDerivedFieldData)for(var o=0;o<r.qDerivedFieldData.qDerivedFieldLists.length;++o)for(var a=r.qDerivedFieldData.qDerivedFieldLists[o],s=0;s<a.qFieldDefs.length;++s){var l=a.qFieldDefs[s];if(l.qName===i)return l}}return null}(e.qDef.qFieldDefs[0],t.fieldList);return r&&r.qTags.indexOf("$numeric")>-1}function d(e){return!(!e.fullAccumulation&&!e.fullRange)}function f(e,t){var n=e.crossAllDimensions;return 2===t&&n?"RowNo(Total)":"RowNo()"}function h(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 p(){return"[$(=Replace(GetObjectField(".concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,"),']',']]'))]")}function m(e,t){var n=e.crossAllDimensions;return 2===t&&n?"Above(Total ":"Above("}function g(e){return void 0===e?")":", 0, ".concat(e,")")}function y(e){return"Replace(Replace(".concat(e,",'''',''''''),'$','$''&''')")}function v(e,t){return e?"".concat(t,'={">=$(=Min(').concat(t,"))<=$(=Max(").concat(t,'))"}'):"".concat(t,'={"=Only({1}').concat(t,")>='$(=").concat(y("MinString(".concat(t,")")),")' and Only({1}").concat(t,")<='$(=").concat(y("MaxString(".concat(t,")")),")'\"}")}function b(e){var t=e.modifier,n=void 0===t?{}:t,r=e.dimensions,i=e.dimensionAndFieldList,o=e.funcComp,a=void 0===o?"Sum":o,s=e.valueComp,l=void 0===s?"0":s;if(!n.showExcludedValues)return"";if(r&&1===r.length){var c=v(u(r[0],i),p(0));return"".concat(a,"({1<").concat(c,">}").concat(l,")")}if(r&&2===r.length){var d=u(r[0],i),f=u(r[1],i),h=p(0),m=p(1),g=v(d,h),y=v(f,m);return"".concat(a,"({1<").concat(g,",").concat(y,">}").concat(l,")")}return"".concat(a,"({1}").concat(l,")")}function x(e){return"".concat(e,"(")}function S(e){var t=e.properties,n=e.layout;return o(t,"qHyperCubeDef.qDimensions",o(n,"qHyperCube.qDimensionInfo",[])).length}const M={isFullRange:d,getNumDimensions:S,getExpressionWithExcludedComp:function(e){var t=e.expression,n=e.modifier,r=e.dimensions,i=e.dimensionAndFieldList,o=e.treatMissingAsNull,a=c(h(t));if(!n.showExcludedValues)return a;var s=b({modifier:n,dimensions:r,dimensionAndFieldList:i}),l=o?"":", 0";if(r&&1===r.length){var u=p(0);return"If(Count(".concat(u,") > 0, ").concat(a," + ").concat(s).concat(l,")")}if(r&&2===r.length){var d=p(0),f=p(1);return"If(Count(".concat(d,") * Count(").concat(f,") > 0, ").concat(a," + ").concat(s).concat(l,")")}return a},getRowNoComp:f,getNumStepComp:function(e,t){if(!d(e)){var n=e.steps;return"number"!=typeof n||Number.isNaN(n)?6:n}return f(e,t)},getAboveCompPrefix:m,getAboveCompSuffix:g,getAboveComp:function(e,t,n,r){return m(e,t)+n+g(r)},getFunctionPrefix:x,getFunctionSuffix:function(){return")"},getRangeComp:function(e,t){return x(e)+t+")"},getAggrComp:function(e,t,n){return"Aggr(".concat(e,", ").concat(t,", ").concat(n,")")},getExcludedComp:b,needDimension:function(e){var t=e.modifier,n=e.properties,r=e.layout,i=function(e){return void 0===e.primaryDimension?e.accumulationDimension:e.primaryDimension}(t);return 0===i&&2===S({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=p(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:h,extractInputExpression:function(e){var t=e.outputExpression;if(e.modifier){var n=t.indexOf(s);if(-1!==n){var r=t.indexOf(l);if(-1!==r)return t.substring(n+s.length,r)}}},initModifier:function(e,t){Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])})},isNumeric:u,isApplicable:function(e){var t=e.properties,n=e.layout,r=e.minDimensions,i=void 0===r?1:r,o=e.maxDimensions,a=void 0===o?2:o;if(!t&&!n)return!0;var s=S({properties:t,layout:n});return s>=i&&s<=a},getExpressionWithMarkers:c,canExtract:function(e){var t=e.indexOf(s),n=e.indexOf(l);return t>-1&&n>-1&&t<n},getDimDefWithWrapper:p,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 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 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 k=t().bind(null,!0),C={},A=Array.isArray;function O(e){return null!=e&&!Array.isArray(e)&&"object"===E(e)}function N(e){return void 0===e}function D(e,t){return"function"==typeof e[t]||"$$"===t.substring(0,2)||"_"===t.substring(0,1)}function T(e,t){var n,r=t.substring(1).split("/").slice(0,-1);return r.forEach(function(t,i){if(i!==r.length){n=+t;var o=Number.isNaN(n)?{}:[];e[n||t]=N(e[n||t])?o:e[t],e=e[n||t]}}),e}function q(e,t){var n=!0;if(O(e)&&O(t))return Object.keys(e).length===Object.keys(t).length&&(Object.keys(e).forEach(function(r){q(e[r],t[r])||(n=!1)}),n);if(A(e)&&A(t)){if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r+=1)if(!q(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?k({},{val:e}).val:e}(t[i]),a=e[i],s="".concat(n,"/").concat(i);q(o,a)||D(t,i)||(N(a)?r.push({op:"add",path:s,value:o}):O(o)&&O(a)?r=r.concat(C.generate(a,o,s)):A(o)&&A(a)?r=r.concat(function(e,t,n){var r=[],i=e.slice(),o=-1;function a(e,t,n){if(e[n]&&N(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(q(t,i))return r;if(!N(t[0])&&N(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,c=t.length;l<c;l+=1)-1===(o=a(i,t[l].qInfo&&t[l].qInfo.qId))?(r.push({op:"add",path:"".concat(n,"/").concat(l),value:t[l]}),i.splice(l,0,t[l])):o!==l&&(r.push({op:"move",path:"".concat(n,"/").concat(l),from:"".concat(n,"/").concat(o)}),i.splice(l,0,i.splice(o,1)[0]));return r}(a,o,s)):r.push({op:"replace",path:"".concat(n,"/").concat(i),value:o}))}),Object.keys(e).forEach(function(i){N(t[i])&&!D(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=T(e,t.path),o=t.path.split("/").splice(-1)[0],a=o&&Number.isNaN(+o)?i[o]:i[+o]||i,s=t.from?t.from.split("/").splice(-1)[0]:null;if("/"===t.path&&(i=null,a=e),"add"===t.op||"replace"===t.op)if(A(i))"-"===o&&(o=i.length),i.splice(+o,"add"===t.op?0:1,t.value);else if(A(a)&&A(t.value)){var l,c=t.value.slice();a.length=0,(l=a).push.apply(l,function(e){if(Array.isArray(e))return w(e)}(r=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return 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}}(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(O(a)&&O(t.value))n=a,Object.keys(n).forEach(function(e){Object.getOwnPropertyDescriptor(n,e).configurable&&!D(n,e)&&delete n[e]}),k(a,t.value);else{if(!i)throw new Error("Patchee is not an object we can patch");i[o]=t.value}else if("move"===t.op){var u=T(e,t.from);A(i)?i.splice(+o,0,u.splice(+s,1)[0]):(i[o]=u[s],delete u[s])}else"remove"===t.op&&(A(i)?i.splice(+o,1):delete i[o])})},C.clone=function(e){return k({},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)):k(e,t)};const I=C,R=function(e,n,r){if(!e)return Promise.resolve();var i=I.generate(n,r);return t()(!0,n,r),i&&i.length?(i=i.map(function(e){return{qOp:e.op,qValue:JSON.stringify(e.value),qPath:e.path}}),e.applyPatches(i,!0)):Promise.resolve()};var L="accumulation";function _(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===L)return n[r]}function P(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===L)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var z={type:"accumulation",disabled:!1,accumulationDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullAccumulation:!1,steps:6,outputExpression:""};const F={translationKey:"properties.modifier.accumulation",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.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=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=M.getNumStepComp(n,l),f=M.getAboveComp(n,l,u,d),h=M.getRangeComp("RangeSum",f);if(M.needDimension({modifier:n,properties:r,layout:i})){var p=M.getDimComp(c,1),m=M.getDimComp(c,0),g=M.getAggrComp(h,p,m);h=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,valueComp:g}):g}return h},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,z)},enableTotalsFunction:function(){return!1},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.accumulation.disclaimer",show:function(e,t){return!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(P(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(P(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(P(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(P(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=_(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=_(t,e);return n&&!n.fullAccumulation}},showExcludedValues:{refFn:function(t){return"".concat(P(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(L))return!1;var o=_(t,e);return o&&!o.disabled}};return n}};var j="movingAverage";function $(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 B(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 V={type:"movingAverage",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,fullRange:!1,steps:6,outputExpression:"",nullSuppression:!1};const H={translationKey:"properties.modifier.movingAverage",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t,n=e.expression,r=e.modifier,i=e.properties,a=e.layout,s=e.numDimensions,l=e.dimensionAndFieldList;if(!r)return n;var c=s;void 0===c&&(c=M.getNumDimensions({properties:i,layout:a}));var u=o(i,"qHyperCubeDef.qDimensions",[]),d=r.showExcludedValues&&r.nullSuppression,f=M.getExpressionWithExcludedComp({expression:n,modifier:r,dimensions:u,dimensionAndFieldList:l,treatMissingAsNull:d}),h=M.getNumStepComp(r,c),p=M.getAboveComp(r,c,f,h);if(r.nullSuppression)t=M.getRangeComp("RangeAvg",p);else{var m=M.getRangeComp("RangeSum",p),g=function(e,t){var n=M.getRowNoComp(e,t);if(!M.isFullRange(e)){var r=e.steps,i="number"!=typeof r||Number.isNaN(r)?6:r;return"RangeMin(".concat(i,", ").concat(n,")")}return n}(r,c);t="".concat(m," / ").concat(g)}var y=t;if(M.needDimension({modifier:r,properties:i,layout:a})){var v=M.getDimComp(u,1),b=M.getDimComp(u,0),x=M.getAggrComp(y,v,b);y=r.showExcludedValues?M.getExcludedComp({modifier:r,dimensions:u,dimensionAndFieldList:l,funcComp:"Only",valueComp:x}):x}return y},extractInputExpression:M.extractInputExpression,initModifier:function(e){M.initModifier(e,V)},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!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{primaryDimension:{refFn:function(t){return"".concat(B(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(B(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(B(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(B(t,e),".steps")},type:"integer",translation:t.rangeSteps||"properties.modifier.range.steps",schemaIgnore:!0,defaultValue:6,change:function(t){var n=$(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=$(t,e);return n&&!n.fullRange}},showExcludedValues:{refFn:function(t){return"".concat(B(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0},nullSuppression:{refFn:function(t){return"".concat(B(t,e),".nullSuppression")},type:"boolean",translation:t.showNull||"properties.dimensions.showNull",schemaIgnore:!0,defaultValue:!1,inverted:!0}},show:function(e,t){return M.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=$(t,e);return o&&!o.disabled}};return n}};var U="timeSeriesDecomposition";function W(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 Y(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===U)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var K={type:"timeSeriesDecomposition",disabled:!1,decomposition:"",steps:2,outputExpression:""};const G={translationKey:"properties.modifier.timeSeriesDecomposition",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},generateExpression:function(e){var t=e.expression,n=e.modifier,r=e.properties;return n?M.generateTSDExpression(n,t,r):t},extractInputExpression:M.extractInputExpression,initModifier:function(e,t){M.initModifier(e,K),""===e.decomposition&&t&&(e.decomposition=M.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!M.isApplicable({properties:t.properties})}},settings:{type:"items",items:{decomposition:{refFn:function(t){return"".concat(Y(t,e),".decomposition")},type:"string",translation:t.modifierTrendDecompositionDecomposition||"properties.modifier.trendDecomposition.decomposition",component:"dropdown",schemaIgnore:!0,defaultValue:t.trendDecompositionParametersDecompositionObserved||"cao.trendDecomposition.parameters.decomposition.observed",options:a.OPTIONS},steps:{refFn:function(t){return"".concat(Y(t,e),".steps")},type:"integer",translation:t.modifierTimeSeriesDecompositionPeriods||"properties.modifier.timeSeriesDecomposition.periods",schemaIgnore:!0,defaultValue:2,change:function(t,n){var r=W(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=W(t,e);return n&&!n.fullRange}}},show:function(e,t){return M.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=W(t,e);return o&&!o.disabled}};return n}};var X="difference";function J(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===X)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===X)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}var Q={type:"difference",disabled:!1,primaryDimension:0,crossAllDimensions:!1,showExcludedValues:!0,outputExpression:""};const ee={translationKey:"properties.modifier.difference",needDimension:M.needDimension,isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.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=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=M.getAboveComp(n,l,u),f="".concat(u," - ").concat(d);if(M.needDimension({modifier:n,properties:r,layout:i})){var h=M.getDimComp(c,1),p=M.getDimComp(c,0),m=M.getAggrComp(f,h,p);f=n.showExcludedValues?M.getExcludedComp({modifier:n,dimensions:c,dimensionAndFieldList:s,funcComp:"Only",valueComp:m}):m}return f},initModifier:function(e){Object.keys(Q).forEach(function(t){void 0===e[t]&&(e[t]=Q[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!M.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.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(Z(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(Z(t,e),".showExcludedValues")},type:"boolean",translation:t.showExcludedValues||"properties.modifier.showExcludedValues",schemaIgnore:!0,defaultValue:!0}},show:function(e,t){return M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(X))return!1;var o=J(t,e);return o&&!o.disabled}};return n}};var te="normalization";function ne(e,t){var n=o(e,t);if(n)for(var r=0;r<n.length;r++)if(n[r].type===te)return n[r]}function re(e,t){var n=function(e,t){var n=o(e,t);if(!n)return-1;for(var r=0;r<n.length;r++)if(n[r].type===te)return r;return-1}(e,t);return n>-1?"".concat(t,".").concat(n):t}function ie(e,t){for(var n=0;n<e.length;n++)if(e[n].value===t)return n;return-1}var oe={type:"normalization",disabled:!1,primaryDimension:0,outputExpression:"",dimensionalScope:2,selectionScope:2};function ae(e){return 2===e?"{1}":""}function se(e,t,n){return 1===e?"{$<".concat(M.getFieldWithWrapper(t),"={'").concat(n,"'}>}"):""}function le(e,t){return 0===e&&t>1||2===e?"Total":""}function ce(e,t,n){return 0===e&&t>1?"<".concat(M.getDimDefWithWrapper(n),">"):""}const ue={translationKey:"properties.modifier.normalization",needDimension:function(){return!0},isApplicable:function(e){var t=e.properties,n=e.layout;return M.isApplicable({properties:t,layout:n,minDimensions:1,maxDimensions:2})},extractInputExpression:M.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=M.getNumDimensions({properties:r,layout:i}));var c=o(r,"qHyperCubeDef.qDimensions",[]),u=M.getExpressionWithExcludedComp({expression:t,modifier:n,dimensions:c,dimensionAndFieldList:s}),d=n.selectionScope,f=n.dimensionalScope;return function(e,t,n,r,i,o,a){var s=ae(t),l=se(t,n,r),c=""===s&&""===l?"":s||l,u=le(i,o),d=ce(i,o,a),f=function(e){for(var t=[],n=0;n<e;n++)t[n]=M.getDimDefWithWrapper(n);return t.join(", ")}(o);return"".concat(e,"/ Sum(").concat(c," ").concat(u).concat(d," Aggr(").concat(c," ").concat(e,", ").concat(f,"))")}(u,d,n.field,n.value,f,l,n.primaryDimension)},initModifier:function(e){Object.keys(oe).forEach(function(t){void 0===e[t]&&(e[t]=oe[t])})},updateModifier:function(e,t){1===(t.qDimensions?t.qDimensions.length:0)&&0===e.dimensionalScope&&(e.dimensionalScope=2)},enableTotalsFunction:function(){return!0},propertyPanelDef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n={type:"items",items:{disclaimer:{component:"text",translation:t.disclaimer||"properties.modifier.normalization.disclaimer",show:function(e,t){return!M.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 M.isApplicable({properties:t.properties})}}},show:function(t,n,r){var i=r.ext.support.modifiers;if(!Array.isArray(i)||-1===i.indexOf(te))return!1;var o=ne(t,e);return o&&!o.disabled}};return n},getDisregardSelectionComp:ae,getFieldSelectionComp:se,getTotalComp:le,getSelectedDimComp:ce};var de="qDef.base",fe="qDef.qDef",he="qDef.base.qDef",pe="qLibraryId",me="qDef.base.qLibraryId";const ge={getExpression:function(e){var t=o(e,he);return void 0!==t?t:o(e,fe)},getExpressionRef:function(e){return void 0!==o(e,he)?he:fe},getLibraryIdRef:function(e){return o(e,me)?me:pe},getLibraryId:function(e){return o(e,me)||o(e,pe)},getLabelRef:function(e){return o(e,de)?"qDef.base.qLabel":"qDef.qLabel"},getLabelExpressionRef:function(e){return o(e,de)?"qDef.base.qLabelExpression":"qDef.qLabelExpression"}};var ye="qDef.qDef",ve="qDef.base.qDef",be="qLibraryId",xe="qDef.base.qLibraryId",Se="qDef.qLabel",Me="qDef.qLabelExpression",we="qDef.base.qLabel",Ee="qDef.base.qLabelExpression",ke="qDef.qAggrFunc",Ce="qDef.base.qAggrFunc",Ae={initBase:function(e,t){(t||Ae.isValid(e))&&(n(e,ve,o(e,ye)),n(e,xe,o(e,be)),n(e,we,o(e,Se)),n(e,Ee,o(e,Me)))},restoreBase:function(e){Ae.isValid(e)&&(n(e,ye,o(e,ve)),n(e,be,o(e,xe)),n(e,Se,o(e,we)),n(e,Me,o(e,Ee)),o(e,ke)&&o(e,Ce)&&n(e,ke,o(e,Ce)),delete e.qDef.base)},isValid:function(e){var t=o(e,ve),n=o(e,xe);return void 0!==t||void 0!==n}};const Oe=Ae;function Ne(e){return Ne="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},Ne(e)}var De={accumulation:F,movingAverage:H,difference:ee,normalization:ue,timeSeriesDecomposition:G};const Te={modifiers:De,apply:Ie,applyModifiers:Re,cleanUpMeasure:Le,destroy:function(e){e&&qe[e.id]&&qe[e.id].masterItemSubscriber&&(qe[e.id].masterItemSubscriber&&qe[e.id].masterItemSubscriber.unsubscribe(),delete qe[e.id])},hasActiveModifiers:_e,getActiveModifier:Pe,initBase:Oe.initBase,isSupportedModifiers:function(e){return Array.isArray(e)&&e.some(function(e){return De[e]})},isApplicableSupportedModifiers:function(e){var t=e.modifierTypes,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return De[e]&&De[e].isApplicable({properties:n,layout:r})})},measureBase:ge,limitedSorting:function(e){var t=e.measures,n=e.properties,r=e.layout,i=!1,o=!1;return t.forEach(function(e){var t=je(e);Ye({modifiers:t,properties:n,layout:r})&&(i=!0,o=o||Ze({modifiers:t,properties:n,layout:r}))}),i&&!o},ifEnableTotalsFunction:ze};var qe={};function Ie(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.model,r=e.properties,i=e.isSnapshot,a=void 0!==i&&i,s=e.masterItem,l=!1;qe[n.id]=qe[n.id]||{isFirstTime:!0};var c=qe[n.id].isFirstTime;if(qe[n.id].isFirstTime=!1,r&&"object"===Ne(r))return Re({model:n,properties:r});var u=n?n.layout:void 0,d=o(u,"qSelectionInfo.qInSelections");if(a||d)return Promise.resolve(l);var f=o(u,"qHyperCube.qMeasureInfo"),h=qe[n.id].lastReloadTime;if(qe[n.id].lastReloadTime=o(n,"app.layout.qLastReloadTime"),_e({measures:f,layout:u})){var p=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 We({measure:e,properties:n,layout:r})})}({measures:t,layout:n})}({measures:f,layout:u,model:n,lastReloadTime:h});return p||function(e){var t=e.measures,n=e.layout,r=e.masterItem,i=e.isFirstTime;return!!Array.isArray(t)&&(i||r||t.some(function(e){return function(e){var t=e.measure,n=e.layout;return Ye({modifiers:je(t),layout:n})?!t.base:!!t.base}({measure:e,layout:n})}))}({measures:f,layout:u,masterItem:s,isFirstTime:c})?n.getEffectiveProperties().then(function(e){var r=t()(!0,{},e);Be(r);var i=Qe(r);return Ke({model:n}).then(function(t){return Ge({libraryIds:i,model:n}).then(function(i){return p&&function(e){var t=e.properties;Fe(t).forEach(function(e){return function(e){var t=e.measure;if(We({measure:t,properties:e.properties})){var n=0,r=t.qDef.modifiers;Array.isArray(r)&&r.forEach(function(e){if("object"===Ne(e)&&!e.disabled){if(n++,"object"!==Ne(De[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=De[e.type].extractInputExpression({outputExpression:t.qDef.qDef,modifier:e});void 0!==r&&He(t)&&M.simplifyExpression(t.qDef.base.qDef)!==M.simplifyExpression(r)&&(t.qDef.base.qDef=r)}})}}({measure:e,properties:t})})}({properties:r}),Re({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"===Ne(e.base)})}(f)?n.getEffectiveProperties().then(function(e){return function(e){var n=e.model,r=e.properties,i=Qe(r);return et({model:n,libraryIds:i}).then(function(){var e=t()(!0,{},r);return Fe(r).forEach(function(e){return Le(e)}),Je({oldProperties:e,newProperties:r,model:n})})}({model:n,properties:e})}):Promise.resolve(l)}function Re(e){var n=e.model,r=e.oldProperties,i=e.properties,a=e.measures,s=e.runUpdateIfChange,l=void 0!==s&&s,c=e.masterItem,u=e.libraryItemsProps,d=e.dimensionAndFieldList;void 0===r&&(r=l?t()(!0,{},i):i),Be(i);var f=Qe(i);return et({model:n,libraryIds:f,masterItem:c}).then(function(){return function(e){var n=e.measures,r=e.properties,i=e.model,a=e.libraryItemsProps,s=e.dimensionAndFieldList;if(n||(n=Fe(r)),!n.length)return Promise.resolve();if(!_e({measures:n,properties:r}))return n.forEach(function(e){return Le(e)}),Promise.resolve();var l=a?void 0:Qe(r);return Ke({model:i,dimensionAndFieldList:s}).then(function(e){return Ge({libraryIds:l,model:i,libraryItemsProps:a}).then(function(i){n.forEach(function(n){Ye({modifiers:n.qDef.modifiers,properties:r})?(function(e){var n=e.measure,r=e.properties,i=e.libraryItemsProps,a=e.dimensionAndFieldList,s=0;Oe.isValid(n)||Oe.initBase(n,!0);var l=n.qDef,c=l.modifiers,u=l.base;Array.isArray(c)&&c.forEach(function(e){if("object"===Ne(e)&&!e.disabled){if(s++,"object"!==Ne(De[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)");De[e.type].initModifier(e,n);var l=n.qLibraryId||u&&u.qLibraryId;l?function(e){var n=e.measure,r=e.modifier,i=e.properties,o=e.dimensionAndFieldList,a=e.libraryItemsProps[e.libraryId],s=a.qMeasure.qDef,l=""===s?s:De[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 De[r.type].updateModifier&&De[r.type].updateModifier(r,i.qHyperCubeDef);var a=ge.getExpression(n),s=""===a?a:De[r.type].generateExpression({expression:a,modifier:r,properties:i,dimensionAndFieldList:o});r.outputExpression=s,n.qDef.qDef=r.outputExpression,n.qDef.base.qLabelExpression?n.qDef.qLabelExpression=n.qDef.base.qLabelExpression:n.qDef.qLabel=n.qDef.base.qLabel||a,r.base=t()(!0,{},n.qDef.base)}({measure:n,modifier:e,properties:r,dimensionAndFieldList:a}),function(e){var t=o(e,"qDef.qAggrFunc");"Expr"!==t||ze(e)?"None"!==t?delete e.qDef.base.qAggrFunc:"None"===t&&ze(e)&&"Expr"===e.qDef.base.qAggrFunc&&(e.qDef.qAggrFunc="Expr",delete e.qDef.base.qAggrFunc):(e.qDef.qAggrFunc="None",e.qDef.base.qAggrFunc="Expr")}(n)}})}({measure:n,properties:r,libraryItemsProps:i,dimensionAndFieldList:e}),Ve(n)):Le(n)})})})}({measures:a,properties:i,model:n,libraryItemsProps:u,dimensionAndFieldList:d}).then(function(){return l?Je({oldProperties:r,newProperties:i,model:n}):Promise.resolve(!1)})})}function Le(e){!function(e){var t=je(e);return Array.isArray(t)&&t.some(function(e){return"object"===Ne(e)&&!e.disabled&&!De[e.type]})}(e)?Oe.restoreBase(e):delete e.qDef.base,e.qDef.coloring&&delete e.qDef.coloring,Ve(e)}function _e(e){var t=e.measures,n=e.properties,r=e.layout;return!!Array.isArray(t)&&t.some(function(e){return Ye({modifiers:je(e),properties:n,layout:r})})}function Pe(e){var t=je(e);if(Array.isArray(t))for(var n=0;n<t.length;n++){var r=t[n];if(De[r.type]&&!r.disabled)return r}}function ze(e){var t=Pe(e);return!t||De[t.type].enableTotalsFunction(e)}function Fe(e){return o(e,"qHyperCubeDef.qMeasures",[]).concat(o(e,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",[]))}function je(e){return e.modifiers||e.qDef&&e.qDef.modifiers}function $e(e){return o(e,"outputExpression.qValueExpression.qExpr")||o(e,"outputExpression")}function Be(e){Fe(e).forEach(function(e){return function(e){var n=Pe(e);n&&(void 0!==n.outputExpression&&$e(n)!==e.qDef.qDef?delete e.qDef.base:!Oe.isValid(e)&&n.base&&(e.qDef.base=t()(!0,{},n.base)))}(e)})}function Ve(e){var t=je(e);Array.isArray(t)&&t.forEach(function(t){"object"===Ne(t)&&(t.disabled||!De[t.type]&&$e(t)!==e.qDef.qDef)&&(t.disabled=!0,delete t.base)})}function He(e){return e.base||e.qDef&&e.qDef.base}function Ue(e){var t=He(e);return e.qLibraryId||t&&t.qLibraryId}function We(e){var t=e.measure,n=e.properties,r=e.layout;return!Ue(t)&&Ye({modifiers:je(t),properties:n,layout:r})}function Ye(e){var t=e.modifiers,n=e.properties,r=e.layout,i={};return Array.isArray(t)&&t.some(function(e){return!("object"!==Ne(e)||e.disabled||!De[e.type])&&(void 0===i[e.type]&&(i[e.type]=De[e.type].isApplicable({properties:n,layout:r})),i[e.type])})}function Ke(e){var t=e.model,n=e.dimensionAndFieldList;if(n)return Promise.resolve(n);var r=[],i={},o=t.app.getDimensionList().then(function(e){i.dimensionList=e});r.push(o);var a=t.app.getFieldList().then(function(e){i.fieldList=e});return r.push(a),Promise.all(r).then(function(){return i})}function 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 Xe(e,t){if(""!==t||-1===["qFmt","qDec","qThou"].indexOf(e))return t}function Je(e){var t=e.oldProperties,n=e.newProperties,r=e.model,i=JSON.stringify(o(t,"qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qMeasures"),Xe)||JSON.stringify(o(t,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe)!==JSON.stringify(o(n,"qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures"),Xe);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):R(t,n,r)}({model:r,oldProperties:t,newProperties:n}).then(function(){return i}):Promise.resolve(i)}function Ze(e){var t=e.modifiers,n=e.properties,r=e.layout;return Array.isArray(t)&&t.some(function(e){return"object"===Ne(e)&&!e.disabled&&De[e.type]&&De[e.type].needDimension({modifier:e,properties:n,layout:r})})}function Qe(e){var t=Fe(e),n=[],r=[],i=!1;return t.forEach(function(t){var r=je(t);if(Ye({modifiers:r,properties:e})){var o=Ue(t);o&&n.push(o),i=i||Ze({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)?(qe[t.id].masterItemSubscriber=qe[t.id].masterItemSubscriber||function(e){var t=e.model,n=e.callback,r={},i={},a={},s={dimension:["qDim.qFieldDefs"],measure:["qMeasure.qDef","qMeasure.qLabel","qMeasure.qLabelExpression","qMeasure.coloring","qMeasure.qNumFormat","qMeasure.isCustomFormatted"]};function l(e){var t={},n=o(e,"qInfo.qType");return n&&s[n]&&s[n].forEach(function(n){t[n]=o(e,n)}),JSON.stringify(t)}function c(e){var t=e.qInfo.qId;if(r[t]){var i=l(e);r[t].properties!==i&&(r[t].properties=i,"function"==typeof n&&r[t].enabled&&n(e)),r[t].enabled=!0}}function u(e,n){return t.app[n](e).then(function(t){r[e]={listener:t.layoutSubscribe(c),enabled:!1,properties:l(t.layout)}})}return{subscribe:function(e){var n=e.measureLibraryIds,o=e.dimensionLibraryIds,s=[];return function(e){var t=e.dimensionLibraryIds;i={},e.measureLibraryIds.forEach(function(e){i[e]=!0}),a={},t.forEach(function(e){a[e]=!0})}({measureLibraryIds:n,dimensionLibraryIds:o}),Object.keys(r).forEach(function(e){i[e]||a[e]||(r[e].listener.dispose(),delete r[e])}),t.app&&(Object.keys(i).forEach(function(e){i[e]&&!r[e]&&s.push(u(e,"getMeasure"))}),Object.keys(a).forEach(function(e){a[e]&&!r[e]&&s.push(u(e,"getDimension"))})),Promise.all(s)},unsubscribe:function(){Object.keys(r).forEach(function(e){r[e].listener.dispose()}),r={}}}}({model:t,callback:function(e){return Ie({model:t,masterItem:e}).then(function(){return t.app.clearUndoBuffer()})}}),qe[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:()=>Be});const o={getValue:function(e,t,n){if(null==e||null==t)return n;for(var r=t.split("."),i=e,o=0;o<r.length;++o){var a=r[o];if(""!==a){if(void 0===i[a]||null===i[a])return n;i=i[a]}}return i},setValue:function(e,t,n){if(null!=e&&null!=t){for(var r=t.split("."),i=r[r.length-1],o=e,a=0;a<r.length-1;++a){var s=r[a];void 0!==o[s]&&null!==o[s]||(o[s]=Number.isNaN(+r[a+1])?{}:[]),o=o[s]}void 0!==n?o[i]=n:delete o[i]}},isEmpty:function(e){return 0===Object.keys(e).length&&e.constructor===Object},isAtomicValue:function(e){return/boolean|number|string/.test(i(e))},generateId:function(){return t(Math.round(99e11*Math.random()+1e11)).replace(/\W/g,"")}};function a(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function l(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return r;return-1}return-1}const d={isOrderedSubset:function(e,t){if(!(e&&t&&e.length&&t.length))return!1;var n=e.indexOf(t[0]);if(-1!==n){for(var r=0;r<t.length;r++){var i=e.indexOf(t[r]);if(n>i)return!1;n=i}return!0}return!1},indexAdded:function(e,t){var n;for(n=0;n<e.length;++n)e[n]>=0&&e[n]>=t&&++e[n];e.push(t)},indexRemoved:function(e,t){var n,r=0;for(n=0;n<e.length;++n)e[n]>t?--e[n]:e[n]===t&&(r=n);return e.splice(r,1),r},findItemByPropertyValue:function(e,t,n){if(e){for(var r=0;r<e.length;r++)if(e[r][t]===n)return e[r];return null}return null},findIndexByPropertyValue:u};var f=n(8),h=n.n(f);const p=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.dimensions).push.apply(t,a(r.qDimensions));var s,l=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qDimensions");l&&(s=i.excludedDimensions).push.apply(s,a(l))},m=function(e){var t,n=e.exportFormat,r=e.qHyperCubeDef,i=n.data[0];(t=i.measures).push.apply(t,l(r.qMeasures));var a,s=o.getValue(r,"qLayoutExclude.qHyperCubeDef.qMeasures");s&&(a=i.excludedMeasures).push.apply(a,l(s))},g=function(e){var t=e.exportFormat,n=e.qHyperCubeDef,r=t.data[0];n.qInterColumnSortOrder||(n.qInterColumnSortOrder=[]),r.interColumnSortOrder=n.qInterColumnSortOrder.concat();var i=o.getValue(n,"qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder");i&&d.isOrderedSubset(i,r.interColumnSortOrder)&&(r.interColumnSortOrder=i.concat())},y=function(e){var t=e.exportFormat,n=e.properties;Object.keys(n).forEach(function(e){t.properties[e]=n[e]})},v=function(e){var t=e.exportFormat,n=e.properties;n.qLayoutExclude||(n.qLayoutExclude={}),n.qLayoutExclude.disabled&&(Object.keys(n.qLayoutExclude.disabled).forEach(function(e){t.properties.hasOwnProperty(e)||(t.properties[e]=n.qLayoutExclude.disabled[e])}),delete n.qLayoutExclude.disabled),n.qLayoutExclude.changed&&(function(e){Object.keys(e.qLayoutExclude.changed).forEach(function(t){e.qLayoutExclude.changed[t].to===o.getValue(e,t)&&o.setValue(e,t,e.qLayoutExclude.changed[t].from)})}(n),delete n.qLayoutExclude.changed),n.qLayoutExclude.quarantine&&!o.isEmpty(n.qLayoutExclude.quarantine)||delete n.qLayoutExclude},b=function(e){e.forEach(function(e){h().cleanUpMeasure(e),e.qDef.modifiers&&(e.store={modifiers:e.qDef.modifiers},delete e.qDef.modifiers)})};function x(e,t,n){var r,i,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=o.getValue(e,t);if(!o.isAtomicValue(s))try{if((i=(i=(r=JSON.stringify(s)).match(/:\{/g))?i.length:0)>2&&!a)return;s=JSON.parse(r)}catch(e){return}o.getValue(e,"qLayoutExclude.quarantine")||o.setValue(e,"qLayoutExclude.quarantine",{});var l=o.getValue(e,"qLayoutExclude.quarantine");l[n]||(l[n]={}),l[n][t]=s}var S=n(909),M=n.n(S);function w(e,t){var n=M()(!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 M()(!0,{},t,e)}function k(e,t,n){return"function"==typeof e?e(t):Number.isNaN(+e)?n:e}var C=Math.pow(2,53)-1;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}function O(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 N=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},D=function(e,t,n){t.hasOwnProperty(e)&&(n[e]=t[e])},T=function(e,t,n,r){t.hasOwnProperty(e)?n[e]=t[e]:n[e]=r},q=function(){return{qDef:{autoSort:!0,cId:"",othersLabel:"Others"},qLibraryId:"",qNullSuppression:!1,qOtherLabel:"Others",qOtherTotalSpec:{qOtherLimitMode:"OTHER_GE_LIMIT",qOtherMode:"OTHER_OFF",qOtherSortMode:"OTHER_SORT_DESCENDING",qSuppressOther:!1}}},I=function(){return{qDef:{autoSort:!0,cId:"",numFormatFromTemplate:!0},qLibraryId:"",qTrendLines:[]}},R=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=w(s.dimensions[t],a);o.qDimensions.length<r?o.qDimensions.push(l):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(l)}for(t=0;t<s.excludedDimensions.length;++t){var c=w(s.excludedDimensions[t],a);o.qDimensions.length<i?o.qDimensions.push(c):o.qLayoutExclude.qHyperCubeDef.qDimensions.push(c)}},L=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 c=E(s.excludedMeasures[t],a);o.qMeasures.length<i?o.qMeasures.push(c):o.qLayoutExclude.qHyperCubeDef.qMeasures.push(c)}},_=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=k(a.max,i.dimensions.length,C),l=k(a.min,i.dimensions.length,0);return{maxDimensions:k(o.max,s,C),minDimensions:k(o.min,l,0),maxMeasures:s,minMeasures:l}},P=function(e){var t=e.exportFormat,n=e.newHyperCubeDef,r=t.data[0],i=n.qDimensions.length+n.qMeasures.length;n.qInterColumnSortOrder=r.interColumnSortOrder.concat();var o=n.qInterColumnSortOrder.length;if(o!==i)for(n.qLayoutExclude&&(n.qLayoutExclude.qHyperCubeDef.qInterColumnSortOrder=r.interColumnSortOrder.concat());o!==i;)o<i?(d.indexAdded(n.qInterColumnSortOrder,o),++o):(--o,d.indexRemoved(n.qInterColumnSortOrder,o))},z=function(e){var t=e.exportFormat,n=e.initialProperties,r=e.hypercubePath,i={qLayoutExclude:{disabled:{},quarantine:{}}};return Object.keys(t.properties).forEach(function(e){"qLayoutExclude"===e?t.properties[e].quarantine&&(i.qLayoutExclude.quarantine=M()(!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=M()(!0,{},n,i)).components&&(i.components=[]),i},F=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=t.data[0];return a.dimensions.length>n&&n>0||a.measures.length>i&&i>0||a.excludedDimensions.length>0&&a.dimensions.length+a.excludedDimensions.length>r||a.excludedMeasures.length>0&&a.measures.length+a.excludedMeasures.length>o||!i&&a.measures.length>0||!n&&a.dimensions.length>0},j=function(e){var t=e.exportFormat,n=e.maxDimensions,r=e.minDimensions,i=e.maxMeasures,o=e.minMeasures,a=e.newHyperCubeDef,s=t.data[0];a.qLayoutExclude||(a.qLayoutExclude={}),a.qLayoutExclude.qHyperCubeDef||(a.qLayoutExclude.qHyperCubeDef={}),(s.dimensions.length>n&&n>0||s.excludedDimensions&&s.excludedDimensions.length&&s.dimensions.length+s.excludedDimensions.length>r)&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[])),(s.measures.length>i&&i>0||s.excludedMeasures&&s.excludedMeasures.length&&s.measures.length+s.excludedMeasures.length>o)&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!i&&s.measures.length&&(a.qLayoutExclude.qHyperCubeDef.qMeasures||(a.qLayoutExclude.qHyperCubeDef.qMeasures=[])),!n&&s.dimensions.length&&(a.qLayoutExclude.qHyperCubeDef.qDimensions||(a.qLayoutExclude.qHyperCubeDef.qDimensions=[]))},$=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 A(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 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.qDimensions=[],s.forEach(function(e){a.qDimensions.push(e),r.dimensions.added(e,n)})}},B=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 O(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 O(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)?O(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)})}},V=function(e){var t=e.measures,n=e.modifierTypes;t&&n&&h().isSupportedModifiers(n)&&t.forEach(function(e){e.store&&e.store.modifiers&&(e.qDef.modifiers=e.store.modifiers),delete e.store})};function H(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=[]),p({exportFormat:i,qHyperCubeDef:l}),m({exportFormat:i,qHyperCubeDef:l}),g({exportFormat:i,qHyperCubeDef:l}),delete l.qLayoutExclude,y({exportFormat:i,properties:a}),n&&(i.properties.qHyperCubeDef=l,delete s.qHyperCubeDef),v({exportFormat:i,properties:a}),r||b(i.properties.qHyperCubeDef.qMeasures),Array.isArray(i.properties.filters)&&(x(i.properties,"filters","storedFilters",!0),delete i.properties.filters),i.properties.qHyperCubeDef.qContextSetExpression&&(x(i.properties,"qHyperCubeDef.qContextSetExpression","storedFilters"),i.properties.qHyperCubeDef.qContextSetExpression=""),i.properties.qHyperCubeDef.qDynamicScript&&i.properties.qHyperCubeDef.qDynamicScript.length&&(x(i.properties,"qHyperCubeDef.qDynamicScript","dynamicScript"),i.properties.qHyperCubeDef.qDynamicScript=[]),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=void 0===n?{}:n,i=e.dataDefinition,a=void 0===i?{}:i,s=e.defaultPropertyValues,l=void 0===s?{}:s,c=e.hypercubePath,u=e.extension,d=e.supportedFilters,f=void 0===d||d,h=e.isHCModifierSupported,p=void 0===h||h,m={qChildren:[]},g=z({exportFormat:t,initialProperties:r,hypercubePath:c}),y=o.getValue(r,c||"").qHyperCubeDef,v=o.getValue(g,c||"").qHyperCubeDef,b=_({exportFormat:t,dataDefinition:a}),x=b.maxDimensions,S=b.minDimensions,M=b.maxMeasures,w=b.minMeasures,E=l.defaultDimension,k=void 0===E?q():E,C=l.defaultMeasure,A=void 0===C?I():C;v.qDimensions.length=0,v.qMeasures.length=0,F({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:M,minMeasures:w})&&j({exportFormat:t,maxDimensions:x,minDimensions:S,maxMeasures:M,minMeasures:w,newHyperCubeDef:v}),R({exportFormat:t,maxDimensions:x,minDimensions:S,newHyperCubeDef:v,defaultDimension:k}),L({exportFormat:t,maxMeasures:M,minMeasures:w,newHyperCubeDef:v,defaultMeasure:A}),$({newProperties:g,dataDefinition:a,hypercubePath:c}),B({newProperties:g,dataDefinition:a,hypercubePath:c}),P({exportFormat:t,newHyperCubeDef:v}),D("qMaxStackedCells",y,v),D("qNoOfLeftDims",y,v),T("qInitialDataFetch",y,v,[{qTop:0,qLeft:0,qWidth:0,qHeight:0}]),T("qMode",y,v,"S"),T("qReductionMode",y,v,"N"),T("qSortbyYValue",y,v),T("qIndentMode",y,v),T("qShowTotalsAbove",y,v),N(g,t,r),m.qProperty=g;var O=o.getValue(u||{},"support.modifiers");return V({measures:v.qMeasures,modifierTypes:O}),f&&H(m.qProperty,"storedFilters"),"S"===v.qMode&&p&&H(m.qProperty,"dynamicScript"),m}};var W={cellBackgroundColor:!0,cellForegroundColor:!0,colorByAlternative:!0,colorByExpression:!0,tooltip:!0,urlLabel:!0,url:!0};function Y(e,t,n,r){t=t||[];var i=u(e,r,n),o=u(t,r,n);if(-1!==i&&-1===o){var a=e.splice(i,1);t.push(a[0])}return t}function K(e,t){return e.length!==t}const G={create:function(e,t){if(!e||!W[e])throw new Error("Attribute Expressions Util: ID required");var n={};return t&&Object.keys(t).forEach(function(e){n[e]=t[e]}),n.id=e,n.qAttribute=!0,n},moveByIdFromGroup:function(e,t,n,r,i){n=n||"qAttributeExpressions",i=i||"id";for(var o=0;o<e.length;o++){var a=e[o][n],s=t.length;if(Y(a,t,r,i),K(t,s))return t}return t},IDMAP:{CELL_BACKGROUND_COLOR:"cellBackgroundColor",CELL_FOREGROUND_COLOR:"cellForegroundColor",COLOR_BY_ALTERNATIVE:"colorByAlternative",COLOR_BY_EXPRESSION:"colorByExpression",TOOLTIP:"tooltip",CELL_LINK_LABEL:"urlLabel",CELL_LINK_URL:"url"}},X={getNumDimensions:function(e){return o.getValue(e,"qHyperCubeDef.qDimensions.length",0)},getNumMeasures:function(e){return o.getValue(e,"qHyperCubeDef.qMeasures.length",0)},wrapFieldName:function(e){return e.split(" ").length>1&&"="!==e[0]&&"["!==e[0]?"[".concat(e,"]"):e},getItemLabel:function(e){return e.label||e.name}},J={colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>0&&X.getNumMeasures(e)<=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>0},expression:function(e){return X.getNumMeasures(e)>=1}}},Z={colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}};var Q={scatterplot:Z,"sn-scatter-plot":Z,piechart:{colorModeOptions:{primary:function(){return!0},dimension:function(){return!0},multiColor:function(){return!1},measure:function(){return!0},expression:function(e){return X.getNumMeasures(e)>=1}}},linechart:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)<=1},expression:function(e){return X.getNumMeasures(e)>=1}}},map:{colorModeOptions:{primary:function(){return!0},dimension:function(e){return X.getNumDimensions(e)>=1},multiColor:function(e){return X.getNumMeasures(e)>1},measure:function(e){return X.getNumDimensions(e)>=1},expression:function(e){return X.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 X.getNumDimensions(e)>=1}}}};function ee(e,t,n){if(Array.isArray(e[t])){var r=d.findIndexByPropertyValue(e[t],"id",n);r>=0&&e[t].splice(r,1)}else e[t]=[]}function te(e,t){var n=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 c=n?o.getValue(t,"color.byDimDef"):o.getValue(t,"color.byMeasureDef"),u=o.getValue(t,"color.formatting.qNumFormat"),f=o.getValue(t,"color.formatting.isCustomFormatted");if(c){var h=G.create(G.IDMAP.COLOR_BY_ALTERNATIVE);switch(c.type){case"expression":!function(e){var t=e.attributeExpression,n=e.label,r=e.item,i=e.isDimension,o=e.qNumFormat,a=e.isCustomFormatted;t.label=n||r.label,i?t.qDef=r.key:(t.qExpression=r.key,o&&(t.qNumFormat=o,t.isCustomFormatted=a)),t.matchMeasure=r.activeMeasureIndex,t.label&&"="===t.label.charAt(0)&&(t.labelExpRef="color.altLabel")}({attributeExpression:h,label:s,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f});break;case"libraryItem":!function(e){var t=e.attributeExpression,n=e.measures,r=e.item,i=e.qNumFormat,o=e.isCustomFormatted;e.isDimension||(t.matchMeasure=d.findIndexByPropertyValue(n,"qLibraryId",r.key),i&&(t.qNumFormat=i,t.isCustomFormatted=o)),void 0!==r.expression?t.qExpression=r.expression:t.qLibraryId=r.key,t.colorMapRef=r.key}({attributeExpression:h,measures:a,item:c,isDimension:n,qNumFormat:u,isCustomFormatted:f})}n?(h.qSortBy={qSortByAscii:1},l.qAttributeDimensions.push(h)):l.qAttributeExpressions.push(h)}}}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:h().measureBase.getLibraryId(e)}(n,t),i?(s.type="measure",s.name=i,s.id=i,o=function(e,t){return h().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=X.getItemLabel(t);switch(ne(e,s||""),i){case"field":a="byDimension",o.byDimDef={label:t.label||X.wrapFieldName(t.name),key:X.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=d.findItemByPropertyValue(r.qAttributeDimensions,"id",i);return ae(e,ie("dimension",!!a,a||r)),!!a}(e,t))return;re({properties:e,isDimension:!0,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byDimDef.label")})}const le=function(e,t,n){o.setValue(e,t,n),o.isAtomicValue(n)&&function(e,t,n){var r=e.qLayoutExclude;r&&(r.changed||(r.changed={}),r.changed[t]={from:o.getValue(e,t),to:n})}(e,t,n)},ce=function(e,t){var n={primary:!0};if(e){var r=(Q[t]||J).colorModeOptions||J.colorModeOptions;n.byDimension=r.dimension(e),n.byMeasure=r.measure(e),n.byMultiple=r.multiColor(e),n.byExpression=r.expression(e)}return n},ue=function(e){var t=e.canColorBy,n=e.autoColor,r=e.colorMode,i=e.dimensions;return!(t[r]&&!n&&("byDimension"!==r&&"byMeasure"!==r||!i.length))},de=function(e,t){var n,r=o.getValue(e,"color.mode"),i=o.getValue(e,"color.auto"),a=o.getValue(e,"".concat(t,"qDimensions"),[]),s=o.getValue(e,"".concat(t,"qMeasures"),[]),l=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);i?te(a,l):!(n={auto:i,colorMode:r,dimensions:a}).auto&&"byDimension"===n.colorMode&&n.dimensions.length>0?se(e,t):function(e){var t=e.auto,n=e.colorMode,r=e.dimensions,i=e.measures,a=e.properties,s=o.getValue(a,"visualization");return!(t||"byMeasure"!==n||!r.length||"map"!==s&&!i.length)}({auto:i,colorMode:r,dimensions:a,measures:s,properties:e})?function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]),a=o.getValue(e,"color.byMeasureDef");if(a&&ne(e,a.label),function(e){return!!(e&&e.activeMeasureIndex>-1)}(a))!function(e,t){var n=o.getValue(e,"".concat(t,"qMeasures"),[]),r=o.getValue(e,"color.byMeasureDef");if(r.activeMeasureIndex=Math.min(r.activeMeasureIndex,n.length-1),r.activeMeasureIndex>-1){var i=ie("measure",!1,n[r.activeMeasureIndex],!0);i.activeMeasureIndex=r.activeMeasureIndex,ae(e,i)}}(e,t);else if(function(e,t){return(!e||!e.key)&&t.length>0}(a,r)&&function(e,t){var n=o.getValue(e,"".concat(t,"qDimensions"),[]),r=o.getValue(e,"".concat(t,"qMeasures"),[]),i=n[n.length-1],a=G.IDMAP.COLOR_BY_ALTERNATIVE,s=d.findItemByPropertyValue(i.qAttributeExpressions,"id",a);return ae(e,ie("measure",!!s,s||r[0])),!!s}(e,t))return;re({properties:e,isDimension:!1,dimensions:n,excludedDimensions:i,measures:r,label:o.getValue(e,"color.byMeasureDef.label")})}(e,t):function(e,t){var n=o.getValue(e,"color.mode"),r=o.getValue(e,"".concat(t,"qDimensions"),[]),i=o.getValue(e,"".concat(t,"qMeasures"),[]),a=o.getValue(e,"".concat(t,"qLayoutExclude.qHyperCubeDef.qDimensions"),[]);"byMultiple"===n&&i.length<2&&o.setValue(e,"color.mode","primary"),te(r,a)}(e,t)},fe=function(e){e.forEach(function(e){e.qOtherTotalSpec&&"qTotalMode"in e.qOtherTotalSpec&&delete e.qOtherTotalSpec.qTotalMode})},he=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},pe=function(e){var t=o.getValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",[]),n=o.getValue(e,"color.colorExpression","");t.splice(0,0,{qExpression:n,id:"colorByExpression"}),o.setValue(e,"qHyperCubeDef.qMeasures.0.qAttributeExpressions",t)},me=function(e){o.setValue(e,"color.mode","primary"),o.setValue(e,"color.auto",!0)},ge=function(e){var t=o.getValue(e,"qHyperCubeDef.qDimensions",[]),n=o.getValue(e,"color.persistent",!1);return t.length>1&&!n},ye={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=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,c=l.COLOR_BY_ALTERNATIVE,u=l.COLOR_BY_EXPRESSION;return G.moveByIdFromGroup(a,[],"qAttributeDimensions",c),G.moveByIdFromGroup(a,[],"qAttributeExpressions",c),G.moveByIdFromGroup(s,[],"qAttributeExpressions",u),i},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,a=e.hypercubePath,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=U.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:a,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty,f=o.getValue(d,"visualization"),h=o.getValue(d,"qHyperCubeDef.qDimensions",[]),p=o.getValue(d,"color.mode",""),m=o.getValue(d,"color.auto",""),g=ce(d,f),y=ue({canColorBy:g,autoColor:m,colorMode:p,dimensions:h});return g[p]?he({shouldUpdateColorBy:y,properties:d})&&pe(d):me(d),y&&de(d,"qHyperCubeDef."),ge(d)&&le(d,"color.persistent",!0),fe(h),u}};var ve=["bar","marker","line"];const be=function(e){var t=e.initialProperties,n=e.properties;t.measureAxis&&void 0===t.measureAxis.autoMinMax?H(n,"unsupportedAutoMinMax")||M()(n.measureAxis,t.measureAxis):H(n,"supportedAutoMinMax")||M()(n.measureAxis,t.measureAxis)},xe=function(e){var t,n=e.exportFormat,r=e.initialProperties,i=e.properties,o=e.measureType,a=i.qHyperCubeDef,s=i.measureAxis;if(function(e){var t=e.initialProperties;return!(!e.exportFormat.properties.measureAxes||t.measureAxes||!t.measureAxis||void 0===t.measureAxis.autoMinMax)}({exportFormat:n,initialProperties:r})){var l=function(e){var t=[];return e.qMeasures.length>0&&e.qMeasures.forEach(function(e){if(e.qDef.series){var n=e.qDef.series,r=n.type,i=n.axis;t[i]||(t[i]={axis:i,type:{line:0,marker:0,bar:0,total:0}}),ve.includes(r)&&t[i].type[r]++,t[i].type.total++}}),t}(a);l.length?(o&&(t=l.filter(function(e){return e.type[o]>0}).sort(function(e,t){return t.type[o]-e.type[o]})),t&&t.length||(t=l.sort(function(e,t){return t.type.total-e.type.total})),t&&t[0]&&M()(s,n.properties.measureAxes[t[0].axis])):M()(s,n.properties.measureAxes[0])}},Se=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}}},Me={exportProperties:function(e){var t=e.propertyTree,n=e.hypercubePath,r=e.viewDataMode,i=e.supportedAutoMinMax,o=void 0===i||i,a=ye.exportProperties({propertyTree:t,hypercubePath:n,viewDataMode:r}),s=a.properties;return o?(x(s,"measureAxis.min","supportedAutoMinMax"),x(s,"measureAxis.max","supportedAutoMinMax")):(x(s,"measureAxis.min","unsupportedAutoMinMax"),x(s,"measureAxis.max","unsupportedAutoMinMax")),a},importProperties:function(e){var t=e.exportFormat,n=e.initialProperties,r=e.dataDefinition,i=e.defaultPropertyValues,o=e.hypercubePath,a=e.measureType,s=e.extension,l=e.supportedFilters,c=e.isHCModifierSupported,u=ye.importProperties({exportFormat:t,initialProperties:n,dataDefinition:r,defaultPropertyValues:i,hypercubePath:o,extension:s,supportedFilters:l,isHCModifierSupported:c}),d=u.qProperty;return be({initialProperties:n,properties:d}),xe({exportFormat:t,initialProperties:n,properties:d,measureType:a}),Se(d.qHyperCubeDef),d.qHyperCubeDef.qColumnOrder=[],d.qHyperCubeDef.columnOrder=[],u}};function we(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 c=we(n,r,l);o.setValue(t,c,s),o.setValue(i,a,void 0)}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}function ke(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=we(n,r,s),c=o.getValue(t,l);void 0!==c&&(o.setValue(i,a,c),o.setValue(t,l,void 0))}}({properties:t,quarantineName:r,arrayName:i,item:e,itemPath:a})})}var Ce="qHyperCubeDef.qMeasures",Ae="conditionalColoring",Oe="measures",Ne="qDef.conditionalColoring";const De={quarantine:function(e){Ee({properties:e,arrayPath:Ce,quarantineName:Ae,arrayName:Oe,itemPath:Ne})},unquarantine:function(e){ke({properties:e,arrayPath:Ce,itemPath:Ne,arrayName:Oe,quarantineName:Ae})}};var Te="qHyperCubeDef.qMeasures",qe="measures",Ie="qHyperCubeDef.qDimensions",Re="dimensions",Le="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qMeasures",_e="alternativeMeasures",Pe="qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions",ze="alternativeDimensions",Fe="qCalcCondition",je="conditionalShowHide";const $e={quarantine:function(e){Ee({properties:e,arrayPath:Te,quarantineName:je,arrayName:qe,itemPath:Fe}),Ee({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Re,itemPath:Fe})},unquarantine:function(e){ke({properties:e,arrayPath:Te,quarantineName:je,arrayName:qe,itemPath:Fe}),ke({properties:e,arrayPath:Ie,quarantineName:je,arrayName:Re,itemPath:Fe})},quarantineAlternative:function(e){Ee({properties:e,arrayPath:Le,quarantineName:je,arrayName:_e,itemPath:Fe}),Ee({properties:e,arrayPath:Pe,quarantineName:je,arrayName:ze,itemPath:Fe})},unquarantineAlternative:function(e){ke({properties:e,arrayPath:Le,quarantineName:je,arrayName:_e,itemPath:Fe}),ke({properties:e,arrayPath:Pe,quarantineName:je,arrayName:ze,itemPath:Fe})}},Be={hypercube:U,colorChart:ye,axisChart:Me,quarantineProperty:x,unquarantineProperty:H,quarantineArrayProp:Ee,unquarantineArrayProp:ke,conditionalColoring:De,conditionalShow:$e}})(),r.default})()}(rX)),rX.exports),oX=o(iX);const aX={version:"1.47.0",qHyperCubeDef:{qAlwaysFullyExpanded:!0,qDimensions:[],qMeasures:[],qInitialDataFetch:[{qWidth:17,qHeight:500}],qSuppressMissing:!0,qSuppressZero:!1},showTitles:!0,subtitle:"",title:"",footnote:"",barGrouping:{grouping:"grouped"},lineType:"line",stackedArea:!1,separateStacking:!0,orientation:"vertical",scrollStartPos:0,nullMode:"gap",dataPoint:{show:!1,showLineLabels:!1,showBarLabels:!1},color:{auto:!0,mode:"primary",useBaseColors:"off",paletteColor:{index:6},useDimColVal:!0,useMeasureGradient:!0,persistent:!1,expressionIsColor:!0,expressionLabel:"",measureScheme:"sg",reverseScheme:!1,dimensionScheme:"12",autoMinMax:!0,measureMin:0,measureMax:10},legend:{dock:"auto",show:!0,showTitle:!0},components:[],dimensionAxis:{axisDisplayMode:"auto",continuousAuto:!0,dock:"near",label:"auto",maxVisibleItems:10,show:"all"},measureAxes:[{show:"all",dock:"near",spacing:1,autoMinMax:!0,minMax:"min",min:0,max:10},{show:"all",dock:"far",spacing:1,autoMinMax:!0,minMax:"min",min:0,max:10}],refLine:{refLines:[],refLines2:[],dimRefLines:[]},preferContinuousAxis:!0,showMiniChartForContinuousAxis:!0,tooltip:{auto:!0,hideBasic:!1,title:"",description:"",chart:void 0,imageComponents:void 0}};var sX=e=>t=>{const n=t.qHyperCubeDef.qMeasures,{lineType:r}=t,i=[0,0,0];let o;const a="area"===r?["Visualizations.Descriptions.Marker","Visualizations.Descriptions.Area","Visualizations.Descriptions.ComboChart.Dimension.AreaMarker","Visualizations.Descriptions.Bars","Visualizations.Descriptions.ComboChart.Dimension.BarMarker","Visualizations.Descriptions.ComboChart.Dimension.BarArea","Visualizations.Descriptions.ComboChart.Dimension.BarAreaMarker"]:["Visualizations.Descriptions.Marker","Visualizations.Descriptions.Line","Visualizations.Descriptions.ComboChart.Dimension.LineMarker","Visualizations.Descriptions.Bars","Visualizations.Descriptions.ComboChart.Dimension.BarMarker","Visualizations.Descriptions.ComboChart.Dimension.BarLine","Visualizations.Descriptions.ComboChart.Dimension.BarLineMarker"];if(!n.length)return e.get("Visualizations.Descriptions.Bars");for(let e=0;e<n.length;++e)o=ag(n[e].qDef.series),o===Gf.BAR?i[0]=1:o===Gf.LINE?i[1]=1:i[2]=1;const s=a[parseInt(i.join(""),2)-1];return e.get(s)},lX=e=>(t,n)=>{let r;const i=t.qHyperCubeDef.qMeasures[n];if(i){const{type:e}=i.qDef.series;r=e===Gf.LINE?"Visualizations.Descriptions.HeightLine":e===Gf.BAR?"Visualizations.Descriptions.LengthBars":"Visualizations.Descriptions.ComboChart.Measure.HeightMarker"}else r=n?"Visualizations.Descriptions.HeightLine":"Visualizations.Descriptions.LengthBars";return e.get(r)};function cX(e){const t=e.qHyperCubeDef.qMeasures,n=e.color?.mode;"byDimension"===n&&1===t.length&&ag(t[0].qDef?.series)===Gf.LINE?e.color.mode="primary":"byDimension"===n&&t.length>1&&(e.color.mode="byMultiple")}function uX(e){const{translator:t}=e;return{dimensions:{min:1,max:1,description:sX(t),added(e,t){dh.addCallbackCustomTooltip(t)},moved(e,t){dh.moveCallbackCustomTooltip(t,e)},removed(e,t){dh.removeCallbackCustomTooltip(t,e)},replaced(e,t,n,r){dh.replaceCallbackCustomTooltip(r,t)}},measures:{min:1,max:15,description:lX(t),added({qDef:e},t){cX(t),e.series?.type||(t.qHyperCubeDef.qMeasures.length>1?e.series={type:Gf.LINE,axis:Xf.SECONDARY}:e.series={type:Gf.BAR,axis:Xf.PRIMARY})},moved(e,t){cX(t)}}}}function dX(e){const t=uX(e);return{properties:aX,data:{targets:[{path:"/qHyperCubeDef",...t}]},importProperties:({exportFormat:e,initialProperties:n,hypercubePath:r})=>{const i=oX.axisChart.importProperties({exportFormat:e,initialProperties:n,dataDefinition:t,hypercubePath:r}),o="linechart"===e.properties.visualization,a=[];i.qProperty.qHyperCubeDef.qMeasures.forEach(e=>{e.qDef.series||(e.qDef.series={type:o?"line":"bar",axis:0,marker:"circle",markerFill:!0}),a.indexOf(e.qDef.series.axis)<0&&a.push(e.qDef.series.axis)});const s=a.sort().shift();return i.qProperty.measureAxes[s]&&e.properties.measureAxis&&void 0!==e.properties.measureAxis.autoMinMax&&l(!0,i.qProperty.measureAxes[s],e.properties.measureAxis,{logarithmic:!1}),i},exportProperties:({propertyTree:e,hyperCubePath:t,viewDataMode:n})=>oX.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})}}const fX=e=>7005!==e.qError?.qErrorCode,hX=e=>void 0===e?.qHyperCube?.qMeasureInfo?[]:e?.qHyperCube?.qMeasureInfo.filter(e=>fX(e)),pX=e=>(e=>e.qHyperCube.qDimensionInfo.filter(e=>fX(e)))(e).length&&hX(e).length,mX=e=>{const t=hX(e).some(({series:e=Jf})=>ag(e)===Gf.LINE);return S.continuous({layout:e,auto:()=>t&&p.isTime(!0,e)})},gX=(e,t,n)=>{const r=n||0;return hX(e?e.layout:t.layout).filter(e=>{const{series:t}=e||{};return 0===r?CW(t,!0):!CW(t,!0)})},yX=(e,t)=>{const n=gX(e,t,0).filter(e=>e.series.type===Gf.BAR),r=gX(e,t,1).filter(e=>e.series.type===Gf.BAR),i="stacked"===hc(t.layout,"barGrouping.grouping");return!S.continuous({layout:t.layout})&&i&&(n.length>1||r.length>1)},vX=(e,t,n,r,i=void 0)=>{const o=`${t}.fontFamily`,a=`${t}.fontSize`;return{fontFamilyItem:{component:"dropdown",ref:`${e}.fontFamily`,options:()=>n.getOptions(o),defaultValue:()=>n.getDefaultValue(o)},fontWrapperItem:{component:"inline-wrapper",items:{fontSizeItem:{component:"dropdown",ref:`${e}.fontSize`,options:()=>n.getOptions(a),defaultValue:()=>i??n.getDefaultValue(a)},fontColorItem:{component:"color-picker",width:!1,ref:`${e}.color`,defaultValue:()=>({color:r.getStyle("object.comboChart",t,"color")})}}}}};function bX(e,t,n){const r=function({theme:e,translator:t,config:n={}}){const{id:r,paths:i}=function({config:e={}}){const{id:t,paths:n}=e;return{id:void 0===t?ts:`${ts}.${t}`,paths:Array.isArray(n)?n:[]}}({config:n}),o={};i.forEach(n=>{const i=n.split(".");us(i);let a=o;for(let o=0;o<i.length;o++){const s=i[o];o===i.length-1?a[s]=ls({theme:e,translator:t,id:r,path:n}):void 0===a[s]&&(a[s]={}),a=a[s]}});const a=e=>{const t=e.split(".");us(t);let n=o;for(let r=0;r<t.length;r++){const i=t[r];if(void 0===n[i])throw new Error(`font-resolver: Path '${e}' could not be resolved.`);n=n[i]}return n};return o.getDefaultValue=e=>a(e).getDefaultValue(),o.getOptions=e=>a(e).getOptions(),o}({theme:t,translator:n,config:{id:"comboChart",paths:["axis.title","axis.label.name","label.value","legend.title","legend.label"]}});return{component:"styling-panel",show:!0,chartType:"combochart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.ComboChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,useBackground:e?.isEnabled("SENSECLIENT_IM_2431_COMBOCHART_BG"),items:{barSection:{translation:"Visualizations.Descriptions.Bars",component:"accordion",items:{outlineSection:{translation:"properties.Outline",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",options:[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",defaultValue:{color:"#205891"},schemaIgnore:!0,width:"auto",component:"color-picker"}}}}}}},widthSection:{translation:"LayerStyleEditor.style.barWidth",component:"panel-section",show:(e,t)=>!mX(t.layout),items:{barWidth:{component:"items",ref:"components",key:"bar",items:{width:{ref:"style.width",component:"slider",min:.01,max:1,step:.01,defaultValue:.7,schemaIgnore:!0}}}}},labelValueSection:e?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.barlabelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"bar",items:{...vX("bar.label.value","label.value",r,t,"12px"),contrastColor:{component:"checkbox",type:"boolean",ref:"bar.label.value.useContrastColor",translation:"properties.dataPoints.valuelabel.contrast",defaultValue:!0}}}}}:void 0}},lineSection:{translation:"Visualizations.Descriptions.Lines",component:"accordion",items:{dataPointSection:{translation:"LayerStyleEditor.style.dataPointSize",component:"panel-section",items:{dataPointSize:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.dataPointSize",component:"slider",min:3,max:20,step:1,defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?8:6,schemaIgnore:!0}}}}},lineSection:{translation:"Line options",component:"panel-section",items:{wrapperItem:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.lineThickness",translation:"Thickness",component:"slider",defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?3:1,min:1,max:5,step:1,schemaIgnore:!0},type:{ref:"style.lineType",translation:"Type",component:"dropdown",width:"auto",grouped:!0,options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}],defaultValue:"solid",schemaIgnore:!0},curve:{ref:"style.lineCurve",translation:"Curve",component:"dropdown",width:"auto",grouped:!0,options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}],defaultValue:e?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")?"monotone":"linear",schemaIgnore:!0}}}}},labelValueSection:e?.isEnabled("CLIENT_IM_3050")?{translation:"properties.dataPoints.linelabelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"line",items:vX("line.label.value","label.value",r,t)}}}:void 0}},markerSection:{translation:"Visualizations.Descriptions.Markers",component:"accordion",items:{labelValueSection:{translation:"properties.dataPoints.markerlabelmode",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"marker",items:vX("marker.label.value","label.value",r,t)}}}}},axisTitleSection:e?.isEnabled("CLIENT_IM_3050")?{translation:"properties.axis.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"axis",items:vX("axis.title","axis.title",r,t)}}}:void 0,axisLabelSection:e?.isEnabled("CLIENT_IM_3050")?{translation:"properties.axis.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"axis",items:vX("axis.label.name","axis.label.name",r,t)}}}:void 0,legendTitleSection:e?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.title",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:vX("legend.title","legend.title",r,t)}}}:void 0,legendLabelSection:e?.isEnabled("CLIENT_IM_3051")?{translation:"properties.legend.label",component:"panel-section",items:{labelItems:{component:"items",ref:"components",key:"legend",items:vX("legend.label","legend.label",r,t)}}}:void 0}}}const xX={classification:{section:"styling",tags:["simple"],exclusive:!0},component:"items",show:!0,chartType:"combochart",translation:"LayerStyleEditor.component.styling",chartTitle:"Object.ComboChart",subtitle:"LayerStyleEditor.component.styling",useGeneral:!0,items:{barsSection:{component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"bar",items:{barsHeader:{component:"header",translation:"Visualizations.Descriptions.Bars"},outlineSection:{component:"items",items:{barStroke:{component:"inline-wrapper",items:{strokeWidth:{ref:"style.strokeWidth",width:!0,component:"dropdown",translation:"LayerStyleEditor.style.strokeWidth",options:[{translation:"Common.None",value:"none"},{translation:"Common.Small",value:"small"},{translation:"Common.Medium",value:"medium"},{translation:"Common.Large",value:"large"}],defaultValue:"none",schemaIgnore:!0},strokeColor:{ref:"style.strokeColor",schemaIgnore:!0,defaultValue:{color:"#205891"},width:"auto",component:"color-picker"}}}}},widthSection:{component:"items",show:(e,t)=>!mX(t.layout),items:{barWidth:{component:"items",items:{width:{ref:"style.width",translation:"LayerStyleEditor.style.barWidth",component:"slider",min:.01,max:1,step:.01,schemaIgnore:!0,defaultValue:.7}}}}}}}}},linesSection:{component:"items",items:{wrapperItem:{component:"items",items:{linesHeader:{component:"header",translation:"Visualizations.Descriptions.Lines"},dataPointSection:{component:"items",items:{dataPointSize:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.dataPointSize",translation:"LayerStyleEditor.style.dataPointSize",component:"slider",min:3,max:20,step:1,defaultValue:6,schemaIgnore:!0}}}}},lineSection:{component:"items",items:{wrapperItem:{component:"items",ref:"components",key:"line",items:{size:{ref:"style.lineThickness",translation:"LayerStyleEditor.style.lineThickness",component:"slider",defaultValue:1,min:1,max:5,step:1,schemaIgnore:!0},type:{ref:"style.lineType",translation:"LayerStyleEditor.style.lineType",component:"dropdown",width:"auto",grouped:!0,options:[{value:"solid",translation:"LayerStyleEditor.style.solid"},{value:"dashed",translation:"LayerStyleEditor.style.dashed"}],defaultValue:"solid",schemaIgnore:!0},curve:{ref:"style.lineCurve",translation:"LayerStyleEditor.style.lineCurve",component:"dropdown",width:"auto",grouped:!0,options:[{value:"linear",translation:"LayerStyleEditor.style.linear"},{value:"monotone",translation:"LayerStyleEditor.style.monotone"}],defaultValue:"linear",schemaIgnore:!0}}}}}}}}},optionsSection:{component:"items",items:{wrapperItem:{component:"items",items:{optionsHeader:{component:"header",translation:"LayerStyleEditor.label.Options"},scrollStartPos:{ref:"scrollStartPos",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}]},dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1}}}}}}};function SX(e){return!!e.qDef?.color?.on}function MX(e){return SX(e)&&"primary"===(e.qDef?.color?.mode??"primary")}function wX(e){return SX(e)&&"byExpression"===e.qDef?.color?.mode}function EX(e){if(e?.color?.auto||"byExpression"!==e?.color?.mode)return[];const t=e?.color?.colorExpression;return t?[{qExpression:t,label:e?.color?.expressionLabel??"",id:"colorByExpression"}]:[]}function kX(e){return wX(e)?[{qExpression:e.qDef.color.colorExpression,id:"colorByMeasureExpression"}]:[]}function CX(e){(e?.qHyperCubeDef?.qMeasures??[]).forEach((t,n)=>function(e,t,n){e.qAttributeExpressions=0===t?[...EX(n),...kX(e)]:kX(e)}(t,n,e))}function AX(e){const t={type:"string",component:"expression",ref:"qCalcCondition.qCond",expression:"optional",expressionType:"ValueExpr",translation:"Object.Chart.Measures.VisibilityCondition",defaultValue:{qv:""},tid:"visibilityCondition",isExpression:e=>"string"==typeof e&&e.trim().length>0},n={ref:"qDef.series.type",type:"string",component:"item-selection-list",defaultValue:"bar",schemaIgnore:!0,horizontal:!0,items:[{icon:e=>"stacked"===e.barGrouping.grouping||mX(e)?"stacked":"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.bar",value:"bar"},{icon:"line_chart_line",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.line",value:"line"},{icon:"shapes",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.marker",value:"marker"}]},r={ref:"qDef.series.marker",type:"string",component:"dropdown",defaultValue:"circle",options:[{translation:"properties.marker.circle",value:"circle"},{translation:"properties.marker.rect",value:"rect"},{translation:"properties.marker.diamond",value:"diamond"},{translation:"properties.marker.triangle",value:"triangle"},{translation:"properties.marker.line",value:"line"}],show:e=>ag(e.qDef?.series)===Gf.MARKER},i={ref:"qDef.series.markerFill",translation:"properties.series.fill",type:"boolean",defaultValue:!0,show:e=>ag(e.qDef?.series)===Gf.MARKER&&!["line"].includes(e.qDef.series.marker)},o={ref:"qDef.color.mode",type:"string",component:"dropdown",options:[{value:"primary",translation:"properties.colorMode.primary"},{value:"byExpression",translation:"properties.colorMode.byExpression"}],defaultValue:"primary",show:(...e)=>SX(...e)},a=e.anything?.sense?.theme,s={ref:"qDef.color.paletteColor",translation:"properties.color",type:"object",component:"color-picker",dualOutput:!0,defaultValue:()=>{const{primary:e}=a.getDataColorSpecials(),t=a.getDataColorPickerPalettes()[0]?.colors,n=t.indexOf(e);return{index:-1===n?Math.min(6,t.length-1):n}},show:MX},l={translation:"properties.measure.moreProperties",title:"properties.measure.moreProperties",subTitle:(e,t,n)=>n.measureTitle?.(),component:"sub-panel",type:"items",items:{groups:{type:"items",component:"expandable-items",items:{presentation:{type:"items",translation:"properties.presentation",items:{seriesType:n,seriesAxis:{ref:"qDef.series.axis",type:"integer",component:"dropdown",defaultValue:0,options:[{translation:"properties.axis.primary",value:0},{translation:"properties.axis.secondary",value:1}]},seriesMarker:r,seriesMarkerFill:i}},color:{type:"items",translation:"properties.color",items:{customColor:{ref:"qDef.color.on",translation:"properties.colors",type:"boolean",component:"switch",defaultValue:!1,trueOption:{value:!1,translation:"Common.Auto"},falseOption:{value:!0,translation:"Common.Custom"}},colorMode:o,paletteColor:s,attributeExpression:{type:"string",component:"expression",expressionType:"measure",schemaIgnore:!0,ref:"qDef.color.colorExpression",translation:"Common.Expression",show:wX}}}}}}};return{type:"items",items:{series:{type:"items",items:{visibilityCondition:t,supPanel:l}}}}}const OX=!0,NX=({series:e=Jf})=>e.axis!==Xf.SECONDARY,DX=({series:e=Jf})=>e.axis===Xf.SECONDARY;function TX(e,t){return t?t.getDimensionLayouts():e.qHyperCubeDef.qDimensions.map(e=>e.qDef)}function qX(e){const t=hX(e).filter(e=>ag(e.series)===Gf.LINE);return t.length>0}const IX=(e,t,n)=>{const r=hX(n.layout).filter(e=>ag(e.series)===Gf.LINE),i=r.filter(NX).length>1||r.filter(DX).length>1;return"area"===e.lineType&&TX(e,t).length>0&&i};function RX(e,t){const n=hX(e).filter(e=>ag(e.series)===Gf.BAR);return n.filter(e=>e.series.axis!==Xf.SECONDARY).length>t||n.filter(e=>e.series.axis===Xf.SECONDARY).length>t}function LX(e){return hX(e).filter(e=>ag(e.series)===Gf.MARKER).length>0}const _X=(e,t,n,r)=>{const i="vertical"===e.layout.orientation||mX(e.layout)?"y":"x",o=gX(e,t,r).map(e=>e.qFallbackTitle);let a;return a=o.length?n.get(`properties.${i}AxisWithInfo`,[o.join(",")]):n.get(`properties.${i}Axis`),a};function PX(e){const{translator:t,flags:n,anything:r}=e,i=e?.anything?.sense?.theme,o=e?.anything?.sense?.isUnsupportedFeature?.("continuousData"),a={items:{attributeExpression:{ref:"color.colorExpression",change:null,globalChange:e=>CX(e)},expressionLabel:{change:null},disclaimer:{component:"text",translation:"properties.color.colorOnMeasureDisclaimer",style:"hint",show:e=>e.qHyperCubeDef.qMeasures.some(e=>SX(e))}}},s=e=>e.qHyperCubeDef.qMeasures.some(e=>SX(e)),l=(e,t)=>0!==e.filter(e=>e.series.axis===t).length,c={items:{disclaimer:{show:(e,t)=>s(e),reset:e=>{e.qHyperCubeDef.qMeasures.forEach(e=>{var t;hc(t=e,"qDef.color.on",void 0)&&mc(t,"qDef.color.on",!1)})}},simpleItems:{show:(e,t)=>!s(e)}}},u={items:{labels:{items:{header:{show:(e,t)=>pX(t.layout)},barLabels:{component:"checkbox",ref:"dataPoint.showBarLabels",type:"boolean",translation:"Simple.Label.Bar",show:(e,t,n)=>pX(n.layout)&&RX(n.layout,0)},lineLabels:{component:"checkbox",ref:"dataPoint.showLineLabels",type:"boolean",translation:"Simple.Label.Line",show:(e,t,n)=>pX(n.layout)&&qX(n.layout),convertFunctions:{get:(e,t,n,r)=>r.dataPoint.show&&r.dataPoint.showLineLabels,set(e,t,n,r,i){i.dataPoint.showLineLabels=e,i.dataPoint.show=e}},reset(e){mc(e,"dataPoint.show",!1),mc(e,"dataPoint.showLineLabels",!1)}},dimensionTitle:{component:"checkbox",ref:"dimensionAxis.show",type:"string",translation:"Simple.Label.Dimension.Hide",defaultValue:"all",show:(e,t)=>pX(t.layout),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"}}},primaryMeasureTitle:{component:"checkbox",ref:"measureAxes.0.show",type:"string",label:(e,n,r)=>t.get(gX(n,r,1).length>0?"Simple.Label.PrimaryMeasure.Hide":"Simple.Label.Measure.Hide"),defaultValue:"all",show:(e,t,n)=>pX(n.layout)&&gX(e,t,0).length>0,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxes[0].show||"none"===r.measureAxes[0].show,set(e,t,n,r,i){i.measureAxes[0].show=e?"labels":"all"}}},secondaryMeasureTitle:{component:"checkbox",ref:"measureAxes.1.show",type:"string",translation:"Simple.Label.SecondaryMeasure.Hide",defaultValue:"all",show:(e,t)=>e.qHyperCubeDef.qDimensions.length&&e.qHyperCubeDef.qMeasures.length&&gX(e,t,1).length>0,convertFunctions:{get:(e,t,n,r)=>"labels"===r.measureAxes[1].show||"none"===r.measureAxes[1].show,set(e,t,n,r,i){i.measureAxes[1].show=e?"labels":"all"}}}}}}},d={uses:"settings",items:{simpleStyling:xX,simpleLabels:u,presentation:{type:"items",translation:"properties.presentation",grouped:!0,items:{stylingPanel:bX(n,i,t),grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",defaultValue:"grouped",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show:(e,t,n)=>RX(n.layout,1)&&!mX(n.layout)},lineType:{ref:"lineType",type:"string",component:"item-selection-list",defaultValue:"line",horizontal:!0,items:[{icon:"line_chart_line",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.line",value:"line"},{icon:"line_chart_area",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.area",value:"area"}],show:(e,t,n)=>qX(n.layout)},stackedProps:{type:"items",grouped:!1,items:{stackedArea:{ref:"stackedArea",translation:"properties.style.stackedArea",type:"boolean",defaultValue:!1,show:(e,t,n)=>IX(e,t,n)},separateStacking:{ref:"separateStacking",translation:"properties.separateStacking",type:"boolean",defaultValue:!0,readOnly:e=>!e.stackedArea,show:(e,t,n)=>IX(e,t,n)}}},orientation:{ref:"orientation",type:"string",component:"item-selection-list",defaultValue:"vertical",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],readOnly:(e,t,n)=>mX(n.layout),convertFunctions:(f="vertical",{get:(e,t,n)=>mX(n.layout)?f:e(t.type),set(e,t,n,r){t(n.type,mX(r.layout)?f:e,f)}})},scrollStartPos:{ref:"scrollStartPos",type:"number",translation:"properties.ScrollAlignment",component:"dropdown",defaultValue:0,options:[{value:0,translation:"properties.ScrollAlignStart"},{value:1,translation:"properties.ScrollAlignEnd"}],show:(e,t,n)=>!mX(n.layout)},nullMode:{type:"string",component:"dropdown",ref:"nullMode",translation:"properties.nullMode",options:[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],defaultValue:"gap",show:(e,t,n)=>qX(n.layout)},dataPointSettings:{type:"items",grouped:!1,snapshot:{tid:"property-dataPoint",show:e=>qX(e)},show:(e,t,n)=>qX(n.layout),items:{dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",defaultValue:!1},showLineDataPointLabels:{ref:"dataPoint.showLineLabels",translation:"properties.dataPoints.linelabelmode",type:"boolean",component:"switch",defaultValue:!1,show:e=>e.dataPoint&&e.dataPoint.show,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]}}},barLabels:{type:"items",snapshot:{tid:"property-barLabels",show:e=>RX(e,0)},show:(e,t,n)=>RX(n.layout,0),items:{showBarLabels:{ref:"dataPoint.showBarLabels",type:"boolean",translation:"properties.dataPoints.barlabelmode",component:"switch",show:(e,t,n)=>RX(n.layout,0),defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},showSegmentLabels:{ref:"dataPoint.showBarSegmentLabels",type:"boolean",translation:"properties.dataPoints.segmentLabelMode",component:"switch",defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showBarLabels&&yX(t,n)},showTotalLabels:{ref:"dataPoint.showBarTotalLabels",type:"boolean",translation:"properties.dataPoints.totalLabelMode",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}],show:(e,t,n)=>e.dataPoint.showBarLabels&&yX(t,n)}}},showMarkerLabels:{ref:"dataPoint.showMarkerLabels",type:"boolean",translation:"properties.dataPoints.markerlabelmode",component:"switch",snapshot:{tid:"property-markerLabels",show:e=>LX(e)},show:(e,t,n)=>LX(n.layout),defaultValue:!1,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"properties.off"}]},gridLines:{type:"items",snapshot:{tid:"property-gridLines"},items:{showGridLines:{ref:"gridLine.auto",type:"boolean",translation:"properties.gridLine.spacing",component:"switch",defaultValue:!0,options:[{value:!0,translation:"Common.Auto"},{value:!1,translation:"Common.Custom"}]},gridLineAxis:{ref:"gridLine.axis",type:"integer",component:"dropdown",defaultValue:0,options(e,t,n){const r=[],i=n.layout.qHyperCube.qMeasureInfo,o=l(i,0),a=l(i,1);return o&&r.push({translation:"properties.axis.primary",value:0}),a&&r.push({translation:"properties.axis.secondary",value:1}),r},show:(e,t,n)=>e.gridLine&&!e.gridLine.auto&&0!==n.layout.qHyperCube.qMeasureInfo.length,convertFunctions:{get(e,t,n,r){const i=r.gridLine.axis??0,o=n.layout.qHyperCube.qMeasureInfo,a=l(o,0),s=l(o,1);return 0===i&&!a&&s?(mc(r,"gridLine.axis",1),1):1===i&&a&&!s?(mc(r,"gridLine.axis",0),0):i}}},gridSpacing:{ref:"gridLine.spacing",type:"number",component:"dropdown",defaultValue:2,options:[{value:0,translation:"properties.gridLine.noLines"},{value:1,translation:"properties.gridLine.wide"},{value:2,translation:"properties.gridLine.medium"},{value:3,translation:"properties.gridLine.narrow"}],show:e=>e.gridLine&&!e.gridLine.auto}}}}},colorsAndLegend:{uses:"colorsAndLegend",items:{colors:a,simpleColors:c,legend:{items:{show:{snapshot:{tid:"property-legend"}}}}}},dimensionAxis:{uses:"axis.dimensionAxis",label(e,n){const r="vertical"===n.layout.orientation||mX(n.layout)?"x":"y",i=TX(e,n).map(e=>e.qFallbackTitle||"").join(", ");let o;return o=i?t.get(`properties.${r}AxisWithInfo`,[i]):t.get(`properties.${r}Axis`),o},items:{othersGroup:{items:{dock:{options(e,t){let n="Common.Bottom",r="Common.Top";return"vertical"===t.layout.orientation||mX(t.layout)||(n=e.yMirrorMode?"properties.dock.right":"properties.dock.left",r=e.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:r}]}},label:{options:[{value:"auto",translation:"Common.Auto"},{value:"horizontal",translation:"Common.Horizontal"},{value:"tilted",translation:"properties.labels.tilted"},{value:"layered",translation:"properties.labels.layered"}]}}},axisDisplaySettings:{type:"items",components:"items",show:(e,t,n)=>!mX(n.layout),items:{axisDisplayMode:{type:"string",translation:"properties.axis.displaymode",ref:"dimensionAxis.axisDisplayMode",component:"dropdown",defaultValue:"auto",options:[{value:"auto",translation:"properties.axis.displaymode.auto"},{value:"max",translation:"properties.axis.displaymode.max"},{value:"custom",translation:"properties.axis.displaymode.custom"}]},maxVisibleItems:{type:"integer",translation:"properties.axis.maxvisiblevalues",ref:"dimensionAxis.maxVisibleItems",expression:"optional",defaultValue:10,show:e=>"custom"===e.dimensionAxis.axisDisplayMode,invalid(e){const{qDimensions:t,qMeasures:n}=e.qHyperCubeDef,{maxVisibleItems:r}=e.dimensionAxis;return r<0||r>1e4/(t.length+n.length)},globalChange(e){if("custom"===e.dimensionAxis.axisDisplayMode){const{qDimensions:t,qMeasures:n}=e.qHyperCubeDef,{maxVisibleItems:r}=e.dimensionAxis;r<1?e.dimensionAxis.maxVisibleItems=10:r>1e4/(t.length+n.length)&&(e.dimensionAxis.maxVisibleItems=Math.min(r,Math.floor(1e4/(t.length+n.length))))}}},hint:{component:"text",translation:"properties.axis.maxvisiblevalues.hint.combochart",style:"hint",show:e=>["custom","max"].indexOf(e.dimensionAxis.axisDisplayMode)>-1}}}},continuousGroup:{show:!o}},measureAxis:{uses:"axis.measureAxis",label:(e,n,r)=>_X(n,r,t,0),show:(e,t,n)=>gX(t,n,0).length>0,items:{axis:{items:{measureAxisTitle:{component:"header",type:"string",label:(e,n,r)=>_X(n,r,t,0),show:(e,t,n)=>gX(t,n,0).length>0,classification:{section:"axis",tags:["simple"],exclusive:!0}},show:{ref:"measureAxes.0.show",snapshot:{title:"properties.axis.primary",tid:"property-primary-axis",show:e=>(e?.qHyperCube?.qMeasureInfo||[]).some(e=>e?.series&&CW(e?.series,OX))}},dock:{ref:"measureAxes.0.dock",show:(e,t,n)=>"none"!==e.measureAxes[0].show&&gX(t,n,0).length>0,options(e,t){let n="Common.Bottom",r="Common.Top";return("vertical"===t.layout.orientation||mX(t.layout))&&(n=e.yMirrorMode?"properties.dock.right":"properties.dock.left",r=e.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:r}]}},spacing:{ref:"measureAxes.0.spacing",show:(e,t,n)=>e.measureAxes[0]&&"none"!==e.measureAxes[0].show&&gX(t,n,0).length>0}}},minMax:{items:{autoMinMax:{ref:"measureAxes.0.autoMinMax"},minMax:{ref:"measureAxes.0.minMax",defaultValue:"min",show:e=>!e.measureAxes[0].autoMinMax},min:{ref:"measureAxes.0.min",show:e=>["min","minMax"].includes(e.measureAxes[0].minMax)&&!e.measureAxes[0].autoMinMax,invalid:e=>"minMax"===e.measureAxes[0].minMax&&e.measureAxes[0].min>=e.measureAxes[0].max},max:{ref:"measureAxes.0.max",show:e=>["max","minMax"].includes(e.measureAxes[0].minMax)&&!e.measureAxes[0].autoMinMax,invalid:e=>"minMax"===e.measureAxes[0].minMax&&e.measureAxes[0].min>=e.measureAxes[0].max}}},startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",show:(e,t,n)=>gX(t,n,0).length>0,readOnly:e=>!(e.measureAxes[0].autoMinMax||"min"===e.measureAxes[0].minMax&&0===e.measureAxes[0].min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:a}=r?.measureAxes[0]||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(mc(i,"measureAxes.0.autoMinMax",!1),mc(i,"measureAxes.0.minMax","min"),mc(i,"measureAxes.0.min",0)):mc(i,"measureAxes.0.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},secondaryMeasureAxis:{uses:"axis.measureAxis",label:(e,n,r)=>_X(n,r,t,1),show:(e,t,n)=>gX(t,n,1).length>0,items:{axis:{items:{measureAxisTitle:{component:"header",type:"string",label:(e,n,r)=>_X(n,r,t,1),show:(e,t,n)=>gX(t,n,1).length>0,classification:{section:"axis",tags:["simple"],exclusive:!0}},show:{ref:"measureAxes.1.show",snapshot:{title:"properties.axis.secondary",tid:"property-secondary-Axis",show:e=>(e?.qHyperCube?.qMeasureInfo||[]).some(e=>e?.series&&!CW(e?.series,OX))}},dock:{ref:"measureAxes.1.dock",defaultValue:"far",show:(e,t,n)=>"none"!==e.measureAxes[1].show&&gX(t,n,1).length>0,options(e,t){let n="Common.Bottom",r="Common.Top";return("vertical"===t.layout.orientation||mX(t.layout))&&(n=e.yMirrorMode?"properties.dock.right":"properties.dock.left",r=e.yMirrorMode?"properties.dock.left":"properties.dock.right"),[{value:"near",translation:n},{value:"far",translation:r}]}},spacing:{ref:"measureAxes.1.spacing",show:(e,t,n)=>e.measureAxes[1]&&"none"!==e.measureAxes[1].show&&gX(t,n,1).length>0}}},minMax:{type:"items",items:{autoMinMax:{ref:"measureAxes.1.autoMinMax"},minMax:{ref:"measureAxes.1.minMax",defaultValue:"min",show:e=>!e.measureAxes[1].autoMinMax},min:{ref:"measureAxes.1.min",show:e=>["min","minMax"].includes(e.measureAxes[1].minMax)&&!e.measureAxes[1].autoMinMax,invalid:e=>"minMax"===e.measureAxes[1].minMax&&e.measureAxes[1].min>=e.measureAxes[1].max},max:{ref:"measureAxes.1.max",show:e=>["max","minMax"].includes(e.measureAxes[1].minMax)&&!e.measureAxes[1].autoMinMax,invalid:e=>"minMax"===e.measureAxes[1].minMax&&e.measureAxes[1].min>=e.measureAxes[1].max}}},startAt:{type:"string",component:"dropdown",translation:"properties.axis.startAt",show:(e,t,n)=>gX(t,n,1).length>0,readOnly:e=>!(e.measureAxes[1].autoMinMax||"min"===e.measureAxes[1].minMax&&0===e.measureAxes[1].min),options:[{value:"zero",translation:"properties.axis.startAt.zero"},{value:"lowest",translation:"properties.axis.startAt.lowest"}],defaultValue:"lowest",convertFunctions:{get(e,t,n,r){const{autoMinMax:i,minMax:o,min:a}=r?.measureAxes[1]||{};return!0===i?"lowest":i||"min"!==o||0!==a?e(t.type):"zero"},set(e,t,n,r,i){"zero"===e?(mc(i,"measureAxes.1.autoMinMax",!1),mc(i,"measureAxes.1.minMax","min"),mc(i,"measureAxes.1.min",0)):mc(i,"measureAxes.1.autoMinMax",!0)}},classification:{section:"axis",tags:["simple"],exclusive:!0}}}},tooltips:{uses:"tooltip"}}};var f;const h={uses:"data",items:{dimensions:{items:{nullSuppression:{show(e,t,n){if(r?.sense?.isUnsupportedFeature?.("includeZeroValues"))return!1;return!mX(n.layout)}}}},measures:{items:{measureDefinition:AX(e)}}}};return{type:"items",component:"accordion",items:{data:h,sorting:{uses:"sortingWithDisclaimer"},addons:(()=>{const e={type:"items",component:"expandable-items",translation:"properties.addons",items:{dataHandling:{uses:"dataHandling",items:{calcCond:{uses:"calcCond"}}},primaryMeasureAxisRefLines:{uses:"reflines",ref:"refLine.refLines",translation:"properties.primaryMeasureAxisReferenceLines",title:{translation:"properties.primaryMeasureAxisReferenceLines.tooltip"},show:e=>function(e,t){return e.some(e=>CW(e.qDef.series,t))}(e.qHyperCubeDef.qMeasures,OX)},secondaryMeasureAxisRefLines:{uses:"reflines",ref:"refLine.refLines2",translation:"properties.secondaryMeasureAxisReferenceLines",title:{translation:"properties.secondaryMeasureAxisReferenceLines.tooltip"},show:e=>function(e,t){return e.some(e=>!CW(e.qDef.series,t))}(e.qHyperCubeDef.qMeasures,OX)},dimRefLines:{uses:"dimReflines"},plugins:Hf({translator:t,pluginOptions:[{value:"point",translation:t.get("Visualizations.Descriptions.Point")},{value:"line",translation:t.get("Visualizations.Descriptions.Line")}],supportNewStyles:n?.isEnabled("TLV_1804_DEFAULT_CHART_SETTINGS")})}};return e})(),settings:d}}}function zX(e,t){return hX(t).filter(e=>ag(e.series)===Gf.LINE).length>0}function FX(){return{type:"items",component:"accordion",items:{data:{uses:"data"},sort:{uses:"sortWithDisclaimer"},presentation:{uses:"presentation",type:"items",translation:"properties.presentation",grouped:!0,show:(e,t)=>zX(0,t)||!mX(t),items:{grouping:{ref:"barGrouping.grouping",type:"string",component:"item-selection-list",horizontal:!0,items:[{icon:"grouped",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.grouped",value:"grouped"},{icon:"stacked",component:"icon-item",labelPlacement:"bottom",translation:"properties.grouping.stacked",value:"stacked"}],show:(e,t)=>function(e,t,n){const r=hX(t).filter(e=>ag(e.series)===Gf.BAR);return n?r.filter(e=>e.series.axis===Xf.PRIMARY).length>1||r.filter(e=>e.series.axis===Xf.SECONDARY).length>1:r.length>1}(0,t,!LK(e?.version??""))&&!mX(t)},lineType:{ref:"lineType",type:"string",component:"item-selection-list",horizontal:!0,items:[{icon:"line_chart_line",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.line",value:"line"},{icon:"line_chart_area",component:"icon-item",labelPlacement:"bottom",translation:"properties.style.area",value:"area"}],show:(e,t)=>zX(0,t)},orientation:{ref:"orientation",type:"string",component:"item-selection-list",horizontal:!0,items:[{component:"icon-item",icon:"bars_vertical",labelPlacement:"bottom",translation:"properties.orientation.vertical",value:"vertical"},{icon:"bars_horizontal",component:"icon-item",labelPlacement:"bottom",translation:"Common.Horizontal",value:"horizontal"}],show:(e,t)=>!mX(t)},nullMode:{type:"string",component:"radio-list",ref:"nullMode",translation:"properties.nullMode",options:()=>[{value:"gap",translation:"properties.nullMode.gap"},{value:"connect",translation:"properties.nullMode.connect"},{value:"zero",translation:"properties.nullMode.zero"}],show:(e,t)=>zX(0,t)&&hX(t).length>1},dataPoints:{ref:"dataPoint.show",translation:"properties.dataPoints.showDataPoints",type:"boolean",show:(e,t)=>zX(0,t)}}},color:{uses:"color",items:{disclaimer:{component:"text",translation:"properties.color.colorOnMeasureDisclaimer",style:"hint",show:e=>e.qHyperCubeDef.qMeasures.some(e=>SX(e))}}}}}}const jX={bar:{axis:0,icon:"bar-chart",tid:"as-bar",translation:"contextMenu.asBar"},line:{axis:1,icon:"line-chart",tid:"as-line",translation:"contextMenu.asLine"},marker:{axis:1,icon:"shapes",tid:"as-marker",translation:"contextMenu.asMarker"}};function $X(e,t,n,r,i){const{axis:o,icon:a,tid:s,translation:l}=jX[i];t.addItem({icon:a,tid:s,translation:l,async select(){let t;t="measure"===e.type?await r.addLibraryMeasure(e.id):await r.addExpressionMeasure(e.name,""),t.qDef.series.type=i,t.qDef.series.axis=o,r.updateGlobalChangeListeners(),n.setProperties(r.properties),window.qvangularGlobal.$rootScope.$broadcast("pp-open-path",`data.${t.qDef.cId}`)}})}function BX(e,t,n,r,i){!function(e,t,n){const{item:r}=e,i=["contextMenu.add",r.name];if(n.canAddMeasure()){const o=e.menu.addItem({translation:i,tid:"add-as"});$X(r,o,t,n,"bar"),$X(r,o,t,n,"line"),$X(r,o,t,n,"marker")}}(e,n,t),t.getMeasures().length>=t.minMeasures()&&e.ReplaceMeasures(n,t,i),e.ColorBy(n,t,i),r()}function VX(e){const t={},{tooltip:n}=e;if(n){t.chart_tooltip_custom=!n.auto;const e=n.chart?.object?.refId;!n.auto&&e&&(t.chart_tooltip_custom_mini_chart=e)}return t}const HX=e=>!!(e&&e.qHyperCube.qSize.qcy>0);function UX(e){return{definition:PX(e),softDefinition:FX(),support:{snapshot:HX,export:!0,exportData:!0,sharing:!1,viewData:!0,modifiers:["accumulation","movingAverage","difference","normalization"]},getDropMeasureOptions:BX,extendMetrics:VX,importProperties:(t,n,r,i)=>{const o={layout:{templateId:n.templateId}};r.mapProperties(o);const a={defaultDimension:r.getDefaultDimensionProperties(),defaultMeasure:r.getDefaultMeasureProperties()},s=oX.axisChart.importProperties({exportFormat:t,initialProperties:n,dataDefinition:uX(e),defaultPropertyValues:a,hypercubePath:i,extension:r});!function(e,t,n){const r="linechart"===n.properties.visualization,i=[];e.qProperty.qHyperCubeDef.qMeasures.forEach(e=>{e.qDef.series||(e.qDef.series={type:r?"line":"bar",axis:0,marker:"circle",markerFill:!0}),i.indexOf(e.qDef.series.axis)<0&&i.push(e.qDef.series.axis)});const o=i.sort().shift();e.qProperty.measureAxes[o]&&n.properties.measureAxis&&void 0!==n.properties.measureAxis.autoMinMax&&l(!0,e.qProperty.measureAxes[o],n.properties.measureAxis,{logarithmic:!1}),CX(e.qProperty)}(s,0,t);const c=s.qProperty;return oX.conditionalShow.unquarantine(c),oX.conditionalShow.unquarantineAlternative(c),s},exportProperties:(e,t,n)=>{oX.conditionalShow.quarantine(e.qProperty),oX.conditionalShow.quarantineAlternative(e.qProperty),function(e){e.qProperty.qHyperCubeDef.qMeasures.forEach(e=>{e.qAttributeExpressions=[]})}(e);return oX.axisChart.exportProperties({propertyTree:e,hyperCubePath:t,viewDataMode:n})},migrate:{properties:e=>e.qExtendsId?e:(function(e){e.qHyperCubeDef.qDimensions.forEach(qe),e.qHyperCubeDef.qLayoutExclude?.qHyperCubeDef?.qDimensions&&e.qHyperCubeDef.qLayoutExclude.qHyperCubeDef.qDimensions.forEach(qe)}(e),function(e){return LK(e.version)&&(e.qHyperCubeDef.qMeasures.forEach(e=>{const{qDef:t}=e;void 0===t.series&&(t.series=Jf),void 0===t.series.type&&(t.series.type=Jf.type),void 0===t.series.axis&&(t.series.axis=t.series.type===Gf.BAR?Xf.PRIMARY:Xf.SECONDARY),t.series.type===Gf.BAR&&t.series.axis===Xf.SECONDARY&&(t.series.axis=Xf.PRIMARY)}),e.version=RK),e}(e))}}}return function(t){!function(e){if(e&&e.get&&e.add){const t="Object.Disclaimer.LimitedData";if(e.get(t)!==t)return;Object.keys(i).forEach(t=>{e.add(i[t])})}}(t.translator);const{flags:n}=t,r=t.anything?.sense?.isUnsupportedFeature,o=yW();return{qae:dX(t),ext:UX(t),component(){const t=function(){const[t,n]=e.useState();return e.useEffect(()=>n(gc()),[]),t}(),i=function(){const[t,n]=e.useState();return e.useEffect(()=>{n(function(){const e={...{viewRange:[0,1],scrollOffset:void 0}},t={},n={};let r=!1;const i={get:t=>e[t],set:(i,o)=>{const a=e[i];!r&&t[i]?e[i]=t[i](o,a):e[i]=o,!r&&n[i]&&n[i](e[i],a)},preventSet:(e,t)=>{r=!0,i.set(e,t),r=!1},intercept:(e,n)=>{t[e]=n},onChanged:(e,t)=>{n[e]=t}};return i}())},[]),t}(),a=function(){const t=e.useOptions(),n=e.useTranslator(),r=e.useEmbed(),i=e.useTheme(),[o,a]=e.useState(),s=e.useDeviceType();return e.useEffect(()=>{a({options:{direction:"ltr",...t},translator:n,theme:i,embed:r,deviceType:s})},[t.direction,t.freeResize,n.language(),i.name(),s]),o}(),s=QG(),l=function({picasso:t,environment:n}){const r=e.useElement(),[i,o]=e.useState();return e.useEffect(()=>{if(!n)return;r.style.overflow="hidden";const e=t({renderer:{prio:[n.options.renderer||"canvas"]}}).chart({element:r,data:[],settings:{}});o(e);const{destroy:i}=e;return()=>{i()}},[n]),i}({picasso:o,environment:a}),c=function({chart:t,actions:n}){const r=e.useSelections(),i=e.useStaleLayout(),[o,a]=e.useState();return e.useEffect(()=>{if(!t?.update||!t.scale)return null;const e=t.scale(Kf.SCALE.MAJOR),o=Ad({chart:t,actions:n,selections:r,config:{allowSimultaneous:!0,brushRanges:!0,majorScale:e,selectionActions:{reset(){t.brushSelectionIncludeMax=void 0,n.lasso.active()&&n.lasso.action(!1)},clear:eX},selectionEvents:{start:tX}}});o.setLayout(i);const{destroy:s}=o;return a(o),()=>{s()}},[r,t?.update,t?.scale]),e.useEffect(()=>{o?.setLayout&&i&&o.setLayout(i)},[i]),o}({chart:l,actions:s}),u=XG({picasso:o,chart:l,environment:a,flags:n,viewState:i,viewCache:t,actions:s,selectionService:c});!function({picasso:t,chart:n,models:r,environment:i,flags:o,viewState:a,viewCache:s,actions:l}){const{event:{onZoomIntercept:c,onZoomChange:u}}=Gy,[,d]=e.usePromise(async()=>{if(!(n?.update&&r&&i&&a&&s))return;const{layoutService:e,colorService:d,continuousModel:f,discreteModel:h,refLineModel:p,seriesModel:m,animationsModel:g}=r,{miniComponentKeys:y}=m.meta,{options:v}=i,{viewState:b={}}=v,{legendScrollOffset:x,scrollOffset:S}=e.meta.isSnapshot?e.getLayoutValue("snapshotData.content.chartData",{}):b;a.preventSet("scrollOffset",S),a.preventSet("legendScrollOffset",x),a.preventSet("title",e.getLayoutValue("title"));const M=()=>{p&&p.update(),g.meta.isPartialUpdating=!0,n.update({partialData:!0,excludeFromUpdate:[...mv,...y]}),g.meta.isPartialUpdating=!1};function w(e=!1){const c=pv({picasso:t,chart:n,models:r,environment:i,flags:o,viewState:a,viewCache:s,actions:l}),u=e&&[gv({models:r}),...yv({models:r}),...d.getData()];e?(n.layoutComponents({settings:c,data:u}),g.meta.hasSlicedHats=c.components.filter(e=>"box-sliced-hat"===e.type).length>0):n.update({settings:c,data:u})}a.onChanged("scrollOffset",M),e.meta.isContinuous&&(a.onChanged("zoom",u({layoutService:e,continuousDataModel:f},M)),a.intercept("zoom",c({viewCache:s})));const E=e.getDataPages();e.setDataPages([]),w(!0),e.setDataPages(E),e.meta.isContinuous||await h.command.initialize(),w(!1),xf.cacheProperties({viewCache:s,layout:e.getLayout()})},[n?.update,r,i]);if(d)throw d}({picasso:o,chart:l,models:u,environment:a,flags:n,viewState:i,viewCache:t,actions:s}),(({picasso:t,chart:n,models:r,environment:i,flags:o,viewState:a,viewCache:s,actions:l,isUnsupportedFeature:c})=>{const{width:u,height:d}=e.useRect(),[,f]=e.usePromise(async()=>{if(!(n?.update&&r&&i&&a))return;const{colorService:e,discreteModel:f,dockService:h,layoutService:p,refLineModel:m,animationsModel:g,styleModel:y}=r;function v(){n.update({settings:pv({picasso:t,chart:n,models:r,environment:i,flags:o,viewState:a,viewCache:s,actions:l,isUnsupportedFeature:c})})}h.update({width:u,height:d}),e.custom.updateLegend(y),m.update({picasso:t,chart:n,models:r,environment:i,viewState:a,viewCache:s,actions:l});const b=p.getDataPages();g.meta.isSizeChanging=!0,p.setDataPages([]),v(),p.setDataPages(b),p.meta.isContinuous||await f.command.initialize(),v()},[u,d]);if(f)throw f})({picasso:o,chart:l,models:u,environment:a,flags:n,viewState:i,viewCache:t,actions:s,isUnsupportedFeature:r}),(({models:t,chart:n,viewState:r})=>{e.onTakeSnapshot(e=>{if(!t)return;const{layoutService:i,dockService:o,colorService:a,discreteModel:s,continuousModel:l,reducedModel:c}=t,{width:u,height:d}=o.meta.chart.size;return e.snapshotData=e.snapshotData||{},e.snapshotData.content={size:{w:u,h:d}},i.meta.isSnapshot?Promise.resolve():(e.snapshotData.content.chartData={scrollOffset:r.get("scrollOffset"),zoom:r.get("zoom"),legendScrollOffset:M(n,Kf.COMPONENT.LEGEND_CATEGORICAL)},i.meta.isDiscrete?(s.command.setSnapshotData(e),c.command.setSnapshotData(e)):l.setSnapshotData(e),a.getSnapshotData().then(t=>{e.snapshotData.content.chartData={...e.snapshotData.content.chartData,...t}}).catch(()=>{}))}),e.useImperativeHandle(()=>({getViewState(){if(r&&n)return{scrollOffset:r.get("scrollOffset"),zoom:r.get("zoom"),legendScrollOffset:M(n,Kf.COMPONENT.LEGEND_CATEGORICAL)}}}),[r,n])})({models:u,chart:l,viewState:i})}}}});
