@freegridjs/core 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- "use strict";var FreeGrid=(()=>{var Pt=Object.defineProperty;var Go=Object.getOwnPropertyDescriptor;var Vo=Object.getOwnPropertyNames;var qo=Object.prototype.hasOwnProperty;var Wo=(i,e)=>{for(var t in e)Pt(i,t,{get:e[t],enumerable:!0})},Ko=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Vo(e))!qo.call(i,o)&&o!==t&&Pt(i,o,{get:()=>e[o],enumerable:!(n=Go(e,o))||n.enumerable});return i};var Uo=i=>Ko(Pt({},"__esModule",{value:!0}),i);var Ii={};Wo(Ii,{buildWorkbook:()=>mn,createGrid:()=>$o,csrfHeaders:()=>Bo,en:()=>ie,exportWorkbook:()=>Fo,loadData:()=>Ho,locales:()=>zo,parseCsv:()=>yt,readXlsx:()=>Ct,registerLocale:()=>We,renderChart:()=>kt,resolveLocale:()=>Te,restDatasource:()=>vn,saveChanges:()=>Oo,setLicenseKey:()=>ko,verifyLicense:()=>un,version:()=>Be,writeXlsx:()=>ye});var jo={code:"en",noRows:"No rows to show",filter:"Filter",apply:"Apply",reset:"Reset",selectAll:"(Select all)",search:"Search\u2026",blanks:"(Blanks)",value:"Value",valueTo:"To",sortAsc:"Sort ascending",sortDesc:"Sort descending",clearSort:"Clear sort",pinLeft:"Pin left",pinRight:"Pin right",unpin:"Unpin",columnMenu:"Column menu",selectRow:"Select row",selectAllRows:"Select all rows",chooseColumns:"Choose columns",columns:"Columns",autosizeThis:"Autosize this column",autosizeAll:"Autosize all columns",resetColumns:"Reset columns",hideColumn:"Hide column",close:"Close",copy:"Copy",cut:"Cut",copyWithHeaders:"Copy with headers",paste:"Paste",pasteHint:"Clipboard access was blocked. Press Ctrl+V to paste.",required:"This field is required",invalidValue:"Invalid value",and:"And",or:"Or",advancedFilter:"Advanced filter",addCondition:"Add condition",duplicate:"This value is already used",undo:"Undo",redo:"Redo",deleteRows:"Delete selected rows",copyRows:"Copy selected rows",statusRows:"{n} rows",statusFiltered:"{shown} of {total} rows",statusSelected:"{n} selected",count:"Count",sum:"Sum",avg:"Average",min:"Min",max:"Max",findPlaceholder:"Find in grid",noMatches:"No matches",findNext:"Next match",findPrevious:"Previous match",groupPanelHint:"Drag a column header here to group rows",groupByThis:"Group by this column",ungroup:"Remove grouping",expandAll:"Expand all",collapseAll:"Collapse all",pagerRange:"{from}\u2013{to} of {total}",pageOf:"Page {page} of {pages}",pageSize:"Rows per page",firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",loading:"Loading\u2026",loadFailed:"Could not load rows",filters:"Filters",clearFilters:"Clear all filters",exportCsv:"Export CSV",exportExcel:"Export Excel",pivot:"Pivot",pivotMode:"Pivot mode",pivotRows:"Row groups",pivotColumns:"Column labels",pivotValues:"Values",total:"Total",addColumn:"Add a column\u2026",chartBar:"Bar chart",chartStacked:"Stacked bar chart",chartLine:"Line chart",chartArea:"Area chart",chartPie:"Pie chart",chartDonut:"Donut chart",chartCombo:"Bar and line chart",chartScatter:"Scatter chart",freeBadge:"Free version",ops:{contains:"Contains",equals:"Equals",notEquals:"Does not equal",startsWith:"Starts with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",eq:"Equals",ne:"Does not equal",lt:"Less than",lte:"Less than or equal",gt:"Greater than",gte:"Greater than or equal",between:"Between",before:"Before",after:"After"}},ie=jo;var yn=new Set;function H(i){yn.has(i)||(yn.add(i),console.warn(`[FreeGrid] ${i}`))}var ge=new Map([["en",ie]]);function We(i){ge.set(i.code,i)}function bn(i){let e=i.toLowerCase();for(let n of ge.keys())if(n.toLowerCase()===e)return n;let t=e.split("-")[0];if(t==="zh"){if(/-(tw|hk|mo|hant)(-|$)/.test(e)&&ge.has("zh-TW"))return"zh-TW";if(ge.has("zh-CN"))return"zh-CN"}for(let n of ge.keys())if(n.toLowerCase().split("-")[0]===t)return n}function _o(){var i;return typeof navigator=="undefined"?[]:(i=navigator.languages)!=null&&i.length?navigator.languages:navigator.language?[navigator.language]:[]}function Xo(i){var e,t;return{...ie,...i,code:(e=i.code)!=null?e:"en",ops:{...ie.ops,...(t=i.ops)!=null?t:{}}}}function Te(i,e=_o()){if(i&&typeof i=="object")return Xo(i);if(typeof i=="string"){let t=bn(i);return t?ge.get(t):(H(`locale "${i}" is not registered \u2014 import it from "@freegridjs/core/locales/${i}" and pass the pack (or call registerLocale). Falling back to "en".`),ie)}for(let t of e){let n=bn(t);if(n)return ge.get(n)}return ie}var Yo={code:"de",noRows:"Keine Zeilen vorhanden",filter:"Filter",apply:"Anwenden",reset:"Zur\xFCcksetzen",selectAll:"(Alle ausw\xE4hlen)",search:"Suchen\u2026",blanks:"(Leer)",value:"Wert",valueTo:"Bis",sortAsc:"Aufsteigend sortieren",sortDesc:"Absteigend sortieren",clearSort:"Sortierung aufheben",pinLeft:"Links fixieren",pinRight:"Rechts fixieren",unpin:"Fixierung l\xF6sen",columnMenu:"Spaltenmen\xFC",selectRow:"Zeile ausw\xE4hlen",selectAllRows:"Alle Zeilen ausw\xE4hlen",chooseColumns:"Spalten ausw\xE4hlen",columns:"Spalten",autosizeThis:"Diese Spalte automatisch anpassen",autosizeAll:"Alle Spalten automatisch anpassen",resetColumns:"Spalten zur\xFCcksetzen",hideColumn:"Spalte ausblenden",close:"Schlie\xDFen",copy:"Kopieren",cut:"Ausschneiden",copyWithHeaders:"Mit \xDCberschriften kopieren",paste:"Einf\xFCgen",pasteHint:"Der Browser hat die Zwischenablage blockiert. Dr\xFCcken Sie Ctrl+V zum Einf\xFCgen.",required:"Dieses Feld ist erforderlich",invalidValue:"Ung\xFCltiger Wert",and:"Und",or:"Oder",advancedFilter:"Erweiterter Filter",addCondition:"Bedingung hinzuf\xFCgen",duplicate:"Dieser Wert wird bereits verwendet",undo:"R\xFCckg\xE4ngig",redo:"Wiederholen",deleteRows:"Ausgew\xE4hlte Zeilen l\xF6schen",copyRows:"Ausgew\xE4hlte Zeilen kopieren",statusRows:"{n} Zeilen",statusFiltered:"{shown} von {total} Zeilen",statusSelected:"{n} ausgew\xE4hlt",count:"Anzahl",sum:"Summe",avg:"Mittelwert",min:"Min",max:"Max",findPlaceholder:"Im Raster suchen",noMatches:"Keine Treffer",findNext:"N\xE4chster Treffer",findPrevious:"Vorheriger Treffer",groupPanelHint:"Spalten\xFCberschrift hierher ziehen, um zu gruppieren",groupByThis:"Nach dieser Spalte gruppieren",ungroup:"Gruppierung aufheben",expandAll:"Alle aufklappen",collapseAll:"Alle zuklappen",pagerRange:"{from}\u2013{to} von {total}",pageOf:"Seite {page} von {pages}",pageSize:"Zeilen pro Seite",firstPage:"Erste Seite",previousPage:"Vorherige Seite",nextPage:"N\xE4chste Seite",lastPage:"Letzte Seite",loading:"Wird geladen\u2026",loadFailed:"Zeilen konnten nicht geladen werden",filters:"Filter",clearFilters:"Alle Filter entfernen",exportCsv:"Als CSV exportieren",exportExcel:"Nach Excel exportieren",pivot:"Pivot",pivotMode:"Pivot-Modus",pivotRows:"Zeilengruppen",pivotColumns:"Spaltenbeschriftungen",pivotValues:"Werte",total:"Gesamt",addColumn:"Spalte hinzuf\xFCgen\u2026",chartBar:"Balkendiagramm",chartStacked:"Gestapelte Balken",chartLine:"Liniendiagramm",chartArea:"Fl\xE4chendiagramm",chartPie:"Kreisdiagramm",chartDonut:"Ringdiagramm",chartCombo:"Balken- und Liniendiagramm",chartScatter:"Streudiagramm",freeBadge:"Kostenlose Version",ops:{contains:"Enth\xE4lt",equals:"Gleich",notEquals:"Ungleich",startsWith:"Beginnt mit",endsWith:"Endet mit",blank:"Leer",notBlank:"Nicht leer",eq:"Gleich",ne:"Ungleich",lt:"Kleiner als",lte:"Kleiner oder gleich",gt:"Gr\xF6\xDFer als",gte:"Gr\xF6\xDFer oder gleich",between:"Zwischen",before:"Vor",after:"Nach"}},xn=Yo;var Zo={code:"es",noRows:"No hay filas para mostrar",filter:"Filtro",apply:"Aplicar",reset:"Restablecer",selectAll:"(Seleccionar todo)",search:"Buscar\u2026",blanks:"(Vac\xEDos)",value:"Valor",valueTo:"Hasta",sortAsc:"Orden ascendente",sortDesc:"Orden descendente",clearSort:"Quitar orden",pinLeft:"Fijar a la izquierda",pinRight:"Fijar a la derecha",unpin:"Desfijar",columnMenu:"Men\xFA de columna",selectRow:"Seleccionar fila",selectAllRows:"Seleccionar todas las filas",chooseColumns:"Elegir columnas",columns:"Columnas",autosizeThis:"Ajustar esta columna",autosizeAll:"Ajustar todas las columnas",resetColumns:"Restablecer columnas",hideColumn:"Ocultar columna",close:"Cerrar",copy:"Copiar",cut:"Cortar",copyWithHeaders:"Copiar con encabezados",paste:"Pegar",pasteHint:"El navegador bloque\xF3 el portapapeles. Pulsa Ctrl+V para pegar.",required:"Este campo es obligatorio",invalidValue:"Valor no v\xE1lido",and:"Y",or:"O",advancedFilter:"Filtro avanzado",addCondition:"A\xF1adir condici\xF3n",duplicate:"Este valor ya est\xE1 en uso",undo:"Deshacer",redo:"Rehacer",deleteRows:"Eliminar filas seleccionadas",copyRows:"Copiar filas seleccionadas",statusRows:"{n} filas",statusFiltered:"{shown} de {total} filas",statusSelected:"{n} seleccionadas",count:"Recuento",sum:"Suma",avg:"Promedio",min:"M\xEDn.",max:"M\xE1x.",findPlaceholder:"Buscar en la tabla",noMatches:"Sin coincidencias",findNext:"Siguiente",findPrevious:"Anterior",groupPanelHint:"Arrastre aqu\xED un encabezado de columna para agrupar",groupByThis:"Agrupar por esta columna",ungroup:"Quitar agrupaci\xF3n",expandAll:"Expandir todo",collapseAll:"Contraer todo",pagerRange:"{from}\u2013{to} de {total}",pageOf:"P\xE1gina {page} de {pages}",pageSize:"Filas por p\xE1gina",firstPage:"Primera p\xE1gina",previousPage:"P\xE1gina anterior",nextPage:"P\xE1gina siguiente",lastPage:"\xDAltima p\xE1gina",loading:"Cargando\u2026",loadFailed:"No se pudieron cargar las filas",filters:"Filtros",clearFilters:"Quitar todos los filtros",exportCsv:"Exportar CSV",exportExcel:"Exportar a Excel",pivot:"Tabla din\xE1mica",pivotMode:"Modo tabla din\xE1mica",pivotRows:"Grupos de filas",pivotColumns:"Etiquetas de columna",pivotValues:"Valores",total:"Total",addColumn:"A\xF1adir columna\u2026",chartBar:"Gr\xE1fico de barras",chartStacked:"Barras apiladas",chartLine:"Gr\xE1fico de l\xEDneas",chartArea:"Gr\xE1fico de \xE1reas",chartPie:"Gr\xE1fico circular",chartDonut:"Gr\xE1fico de anillo",chartCombo:"Gr\xE1fico de barras y l\xEDneas",chartScatter:"Gr\xE1fico de dispersi\xF3n",freeBadge:"Versi\xF3n gratuita",ops:{contains:"Contiene",equals:"Igual a",notEquals:"Distinto de",startsWith:"Empieza por",endsWith:"Termina en",blank:"Vac\xEDo",notBlank:"No vac\xEDo",eq:"Igual a",ne:"Distinto de",lt:"Menor que",lte:"Menor o igual que",gt:"Mayor que",gte:"Mayor o igual que",between:"Entre",before:"Antes de",after:"Despu\xE9s de"}},Cn=Zo;var Jo={code:"fr",noRows:"Aucune ligne \xE0 afficher",filter:"Filtre",apply:"Appliquer",reset:"R\xE9initialiser",selectAll:"(Tout s\xE9lectionner)",search:"Rechercher\u2026",blanks:"(Vides)",value:"Valeur",valueTo:"\xC0",sortAsc:"Tri croissant",sortDesc:"Tri d\xE9croissant",clearSort:"Annuler le tri",pinLeft:"\xC9pingler \xE0 gauche",pinRight:"\xC9pingler \xE0 droite",unpin:"D\xE9s\xE9pingler",columnMenu:"Menu de colonne",selectRow:"S\xE9lectionner la ligne",selectAllRows:"S\xE9lectionner toutes les lignes",chooseColumns:"Choisir les colonnes",columns:"Colonnes",autosizeThis:"Ajuster cette colonne",autosizeAll:"Ajuster toutes les colonnes",resetColumns:"R\xE9initialiser les colonnes",hideColumn:"Masquer la colonne",close:"Fermer",copy:"Copier",cut:"Couper",copyWithHeaders:"Copier avec les en-t\xEAtes",paste:"Coller",pasteHint:"Le navigateur a bloqu\xE9 le presse-papiers. Appuyez sur Ctrl+V pour coller.",required:"Ce champ est obligatoire",invalidValue:"Valeur non valide",and:"Et",or:"Ou",advancedFilter:"Filtre avanc\xE9",addCondition:"Ajouter une condition",duplicate:"Cette valeur est d\xE9j\xE0 utilis\xE9e",undo:"Annuler",redo:"R\xE9tablir",deleteRows:"Supprimer les lignes s\xE9lectionn\xE9es",copyRows:"Copier les lignes s\xE9lectionn\xE9es",statusRows:"{n} lignes",statusFiltered:"{shown} sur {total} lignes",statusSelected:"{n} s\xE9lectionn\xE9es",count:"Nombre",sum:"Somme",avg:"Moyenne",min:"Min",max:"Max",findPlaceholder:"Rechercher dans la grille",noMatches:"Aucun r\xE9sultat",findNext:"Suivant",findPrevious:"Pr\xE9c\xE9dent",groupPanelHint:"Faites glisser un en-t\xEAte de colonne ici pour regrouper",groupByThis:"Regrouper par cette colonne",ungroup:"Supprimer le regroupement",expandAll:"Tout d\xE9velopper",collapseAll:"Tout r\xE9duire",pagerRange:"{from}\u2013{to} sur {total}",pageOf:"Page {page} sur {pages}",pageSize:"Lignes par page",firstPage:"Premi\xE8re page",previousPage:"Page pr\xE9c\xE9dente",nextPage:"Page suivante",lastPage:"Derni\xE8re page",loading:"Chargement\u2026",loadFailed:"Impossible de charger les lignes",filters:"Filtres",clearFilters:"Effacer tous les filtres",exportCsv:"Exporter en CSV",exportExcel:"Exporter vers Excel",pivot:"Tableau crois\xE9",pivotMode:"Mode tableau crois\xE9",pivotRows:"Groupes de lignes",pivotColumns:"\xC9tiquettes de colonnes",pivotValues:"Valeurs",total:"Total",addColumn:"Ajouter une colonne\u2026",chartBar:"Histogramme",chartStacked:"Histogramme empil\xE9",chartLine:"Courbes",chartArea:"Aires",chartPie:"Secteurs",chartDonut:"Graphique en anneau",chartCombo:"Graphique barres et lignes",chartScatter:"Nuage de points",freeBadge:"Version gratuite",ops:{contains:"Contient",equals:"\xC9gal \xE0",notEquals:"Diff\xE9rent de",startsWith:"Commence par",endsWith:"Se termine par",blank:"Vide",notBlank:"Non vide",eq:"\xC9gal \xE0",ne:"Diff\xE9rent de",lt:"Inf\xE9rieur \xE0",lte:"Inf\xE9rieur ou \xE9gal \xE0",gt:"Sup\xE9rieur \xE0",gte:"Sup\xE9rieur ou \xE9gal \xE0",between:"Entre",before:"Avant",after:"Apr\xE8s"}},Rn=Jo;var Qo={code:"ja",noRows:"\u8868\u793A\u3059\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",filter:"\u30D5\u30A3\u30EB\u30BF\u30FC",apply:"\u9069\u7528",reset:"\u30EA\u30BB\u30C3\u30C8",selectAll:"(\u3059\u3079\u3066\u9078\u629E)",search:"\u691C\u7D22\u2026",blanks:"(\u7A7A\u767D)",value:"\u5024",valueTo:"\u7D42\u4E86\u5024",sortAsc:"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048",sortDesc:"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048",clearSort:"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664",pinLeft:"\u5DE6\u306B\u56FA\u5B9A",pinRight:"\u53F3\u306B\u56FA\u5B9A",unpin:"\u56FA\u5B9A\u3092\u89E3\u9664",columnMenu:"\u5217\u30E1\u30CB\u30E5\u30FC",selectRow:"\u884C\u3092\u9078\u629E",selectAllRows:"\u3059\u3079\u3066\u306E\u884C\u3092\u9078\u629E",chooseColumns:"\u5217\u3092\u9078\u629E",columns:"\u5217",autosizeThis:"\u3053\u306E\u5217\u306E\u5E45\u3092\u81EA\u52D5\u8ABF\u6574",autosizeAll:"\u3059\u3079\u3066\u306E\u5217\u306E\u5E45\u3092\u81EA\u52D5\u8ABF\u6574",resetColumns:"\u5217\u3092\u30EA\u30BB\u30C3\u30C8",hideColumn:"\u5217\u3092\u975E\u8868\u793A",close:"\u9589\u3058\u308B",copy:"\u30B3\u30D4\u30FC",cut:"\u5207\u308A\u53D6\u308A",copyWithHeaders:"\u30D8\u30C3\u30C0\u30FC\u4ED8\u304D\u3067\u30B3\u30D4\u30FC",paste:"\u8CBC\u308A\u4ED8\u3051",pasteHint:"\u30D6\u30E9\u30A6\u30B6\u30FC\u304C\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u3078\u306E\u30A2\u30AF\u30BB\u30B9\u3092\u30D6\u30ED\u30C3\u30AF\u3057\u307E\u3057\u305F\u3002Ctrl+V \u3067\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002",required:"\u3053\u306E\u9805\u76EE\u306F\u5FC5\u9808\u3067\u3059",invalidValue:"\u7121\u52B9\u306A\u5024\u3067\u3059",and:"\u304B\u3064",or:"\u307E\u305F\u306F",advancedFilter:"\u8A73\u7D30\u30D5\u30A3\u30EB\u30BF\u30FC",addCondition:"\u6761\u4EF6\u3092\u8FFD\u52A0",duplicate:"\u3053\u306E\u5024\u306F\u3059\u3067\u306B\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059",undo:"\u5143\u306B\u623B\u3059",redo:"\u3084\u308A\u76F4\u3057",deleteRows:"\u9078\u629E\u3057\u305F\u884C\u3092\u524A\u9664",copyRows:"\u9078\u629E\u3057\u305F\u884C\u3092\u30B3\u30D4\u30FC",statusRows:"{n} \u884C",statusFiltered:"{total} \u884C\u4E2D {shown} \u884C",statusSelected:"{n} \u4EF6\u9078\u629E",count:"\u30C7\u30FC\u30BF\u306E\u500B\u6570",sum:"\u5408\u8A08",avg:"\u5E73\u5747",min:"\u6700\u5C0F",max:"\u6700\u5927",findPlaceholder:"\u30B0\u30EA\u30C3\u30C9\u5185\u3092\u691C\u7D22",noMatches:"\u4E00\u81F4\u306A\u3057",findNext:"\u6B21\u3092\u691C\u7D22",findPrevious:"\u524D\u3092\u691C\u7D22",groupPanelHint:"\u5217\u898B\u51FA\u3057\u3092\u3053\u3053\u306B\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30B0\u30EB\u30FC\u30D7\u5316",groupByThis:"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316",ungroup:"\u30B0\u30EB\u30FC\u30D7\u5316\u3092\u89E3\u9664",expandAll:"\u3059\u3079\u3066\u5C55\u958B",collapseAll:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u3080",pagerRange:"{total} \u4EF6\u4E2D {from}\u2013{to} \u4EF6",pageOf:"{pages} \u30DA\u30FC\u30B8\u4E2D {page} \u30DA\u30FC\u30B8",pageSize:"1 \u30DA\u30FC\u30B8\u306E\u884C\u6570",firstPage:"\u6700\u521D\u306E\u30DA\u30FC\u30B8",previousPage:"\u524D\u306E\u30DA\u30FC\u30B8",nextPage:"\u6B21\u306E\u30DA\u30FC\u30B8",lastPage:"\u6700\u5F8C\u306E\u30DA\u30FC\u30B8",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",loadFailed:"\u884C\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",filters:"\u30D5\u30A3\u30EB\u30BF\u30FC",clearFilters:"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u89E3\u9664",exportCsv:"CSV \u306B\u66F8\u304D\u51FA\u3059",exportExcel:"Excel \u306B\u66F8\u304D\u51FA\u3059",pivot:"\u30D4\u30DC\u30C3\u30C8",pivotMode:"\u30D4\u30DC\u30C3\u30C8\u30E2\u30FC\u30C9",pivotRows:"\u884C\u30B0\u30EB\u30FC\u30D7",pivotColumns:"\u5217\u30E9\u30D9\u30EB",pivotValues:"\u5024",total:"\u5408\u8A08",addColumn:"\u5217\u3092\u8FFD\u52A0\u2026",chartBar:"\u68D2\u30B0\u30E9\u30D5",chartStacked:"\u7A4D\u307F\u4E0A\u3052\u68D2\u30B0\u30E9\u30D5",chartLine:"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",chartArea:"\u9762\u30B0\u30E9\u30D5",chartPie:"\u5186\u30B0\u30E9\u30D5",chartDonut:"\u30C9\u30FC\u30CA\u30C4\u30B0\u30E9\u30D5",chartCombo:"\u68D2\u30FB\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",chartScatter:"\u6563\u5E03\u56F3",freeBadge:"\u7121\u6599\u7248\u3092\u4F7F\u7528\u4E2D",ops:{contains:"\u542B\u3080",equals:"\u7B49\u3057\u3044",notEquals:"\u7B49\u3057\u304F\u306A\u3044",startsWith:"\u3067\u59CB\u307E\u308B",endsWith:"\u3067\u7D42\u308F\u308B",blank:"\u7A7A\u767D",notBlank:"\u7A7A\u767D\u4EE5\u5916",eq:"\u7B49\u3057\u3044",ne:"\u7B49\u3057\u304F\u306A\u3044",lt:"\u3088\u308A\u5C0F\u3055\u3044",lte:"\u4EE5\u4E0B",gt:"\u3088\u308A\u5927\u304D\u3044",gte:"\u4EE5\u4E0A",between:"\u7BC4\u56F2\u5185",before:"\u3088\u308A\u524D",after:"\u3088\u308A\u5F8C"}},Sn=Qo;var er={code:"ko",noRows:"\uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",filter:"\uD544\uD130",apply:"\uC801\uC6A9",reset:"\uCD08\uAE30\uD654",selectAll:"(\uC804\uCCB4 \uC120\uD0DD)",search:"\uAC80\uC0C9\u2026",blanks:"(\uBE48 \uAC12)",value:"\uAC12",valueTo:"\uB05D \uAC12",sortAsc:"\uC624\uB984\uCC28\uC21C \uC815\uB82C",sortDesc:"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C",clearSort:"\uC815\uB82C \uD574\uC81C",pinLeft:"\uC67C\uCABD \uACE0\uC815",pinRight:"\uC624\uB978\uCABD \uACE0\uC815",unpin:"\uACE0\uC815 \uD574\uC81C",columnMenu:"\uCEEC\uB7FC \uBA54\uB274",selectRow:"\uD589 \uC120\uD0DD",selectAllRows:"\uC804\uCCB4 \uD589 \uC120\uD0DD",chooseColumns:"\uCEEC\uB7FC \uC120\uD0DD",columns:"\uCEEC\uB7FC",autosizeThis:"\uC774 \uCEEC\uB7FC \uB108\uBE44 \uC790\uB3D9 \uB9DE\uCDA4",autosizeAll:"\uBAA8\uB4E0 \uCEEC\uB7FC \uB108\uBE44 \uC790\uB3D9 \uB9DE\uCDA4",resetColumns:"\uCEEC\uB7FC \uCD08\uAE30\uD654",hideColumn:"\uCEEC\uB7FC \uC228\uAE30\uAE30",close:"\uB2EB\uAE30",copy:"\uBCF5\uC0AC",cut:"\uC798\uB77C\uB0B4\uAE30",copyWithHeaders:"\uD5E4\uB354 \uD3EC\uD568 \uBCF5\uC0AC",paste:"\uBD99\uC5EC\uB123\uAE30",pasteHint:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uD074\uB9BD\uBCF4\uB4DC \uC811\uADFC\uC744 \uB9C9\uC558\uC2B5\uB2C8\uB2E4. Ctrl+V\uB85C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.",required:"\uD544\uC218 \uC785\uB825 \uD56D\uBAA9\uC785\uB2C8\uB2E4",invalidValue:"\uC62C\uBC14\uB978 \uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4",and:"\uADF8\uB9AC\uACE0",or:"\uB610\uB294",advancedFilter:"\uACE0\uAE09 \uD544\uD130",addCondition:"\uC870\uAC74 \uCD94\uAC00",duplicate:"\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uAC12\uC785\uB2C8\uB2E4",undo:"\uC2E4\uD589 \uCDE8\uC18C",redo:"\uB2E4\uC2DC \uC2E4\uD589",deleteRows:"\uC120\uD0DD\uD55C \uD589 \uC0AD\uC81C",copyRows:"\uC120\uD0DD\uD55C \uD589 \uBCF5\uC0AC",statusRows:"{n}\uD589",statusFiltered:"{total}\uD589 \uC911 {shown}\uD589",statusSelected:"{n}\uAC1C \uC120\uD0DD",count:"\uAC1C\uC218",sum:"\uD569\uACC4",avg:"\uD3C9\uADE0",min:"\uCD5C\uC18C",max:"\uCD5C\uB300",findPlaceholder:"\uADF8\uB9AC\uB4DC\uC5D0\uC11C \uCC3E\uAE30",noMatches:"\uC77C\uCE58 \uD56D\uBAA9 \uC5C6\uC74C",findNext:"\uB2E4\uC74C \uCC3E\uAE30",findPrevious:"\uC774\uC804 \uCC3E\uAE30",groupPanelHint:"\uC5F4 \uBA38\uB9AC\uAE00\uC744 \uC5EC\uAE30\uB85C \uB04C\uC5B4\uC640 \uD589\uC744 \uBB36\uC73C\uC138\uC694",groupByThis:"\uC774 \uC5F4\uB85C \uBB36\uAE30",ungroup:"\uBB36\uAE30 \uD574\uC81C",expandAll:"\uBAA8\uB450 \uD3BC\uCE58\uAE30",collapseAll:"\uBAA8\uB450 \uC811\uAE30",pagerRange:"{total}\uAC1C \uC911 {from}\u2013{to}",pageOf:"{pages}\uCABD \uC911 {page}\uCABD",pageSize:"\uCABD\uB2F9 \uD589 \uC218",firstPage:"\uCCAB \uCABD",previousPage:"\uC774\uC804 \uCABD",nextPage:"\uB2E4\uC74C \uCABD",lastPage:"\uB9C8\uC9C0\uB9C9 \uCABD",loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026",loadFailed:"\uD589\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4",filters:"\uD544\uD130",clearFilters:"\uD544\uD130 \uBAA8\uB450 \uC9C0\uC6B0\uAE30",exportCsv:"CSV\uB85C \uB0B4\uBCF4\uB0B4\uAE30",exportExcel:"\uC5D1\uC140\uB85C \uB0B4\uBCF4\uB0B4\uAE30",pivot:"\uD53C\uBC97",pivotMode:"\uD53C\uBC97 \uBAA8\uB4DC",pivotRows:"\uD589 \uADF8\uB8F9",pivotColumns:"\uC5F4 \uB808\uC774\uBE14",pivotValues:"\uAC12",total:"\uD569\uACC4",addColumn:"\uCEEC\uB7FC \uCD94\uAC00\u2026",chartBar:"\uB9C9\uB300 \uCC28\uD2B8",chartStacked:"\uB204\uC801 \uB9C9\uB300 \uCC28\uD2B8",chartLine:"\uAEBE\uC740\uC120 \uCC28\uD2B8",chartArea:"\uC601\uC5ED \uCC28\uD2B8",chartPie:"\uC6D0\uD615 \uCC28\uD2B8",chartDonut:"\uB3C4\uB11B \uCC28\uD2B8",chartCombo:"\uB9C9\uB300\xB7\uAEBE\uC740\uC120 \uCC28\uD2B8",chartScatter:"\uBD84\uC0B0\uD615 \uCC28\uD2B8",freeBadge:"\uBB34\uB8CC \uC0AC\uC6A9 \uC911",ops:{contains:"\uD3EC\uD568",equals:"\uAC19\uC74C",notEquals:"\uAC19\uC9C0 \uC54A\uC74C",startsWith:"\uC2DC\uC791 \uBB38\uC790",endsWith:"\uB05D \uBB38\uC790",blank:"\uBE48 \uAC12",notBlank:"\uBE48 \uAC12 \uC544\uB2D8",eq:"\uAC19\uC74C",ne:"\uAC19\uC9C0 \uC54A\uC74C",lt:"\uBBF8\uB9CC",lte:"\uC774\uD558",gt:"\uCD08\uACFC",gte:"\uC774\uC0C1",between:"\uBC94\uC704",before:"\uC774\uC804",after:"\uC774\uD6C4"}},kn=er;var tr={code:"zh-CN",noRows:"\u6CA1\u6709\u53EF\u663E\u793A\u7684\u6570\u636E",filter:"\u7B5B\u9009",apply:"\u5E94\u7528",reset:"\u91CD\u7F6E",selectAll:"(\u5168\u9009)",search:"\u641C\u7D22\u2026",blanks:"(\u7A7A\u767D)",value:"\u503C",valueTo:"\u81F3",sortAsc:"\u5347\u5E8F\u6392\u5E8F",sortDesc:"\u964D\u5E8F\u6392\u5E8F",clearSort:"\u6E05\u9664\u6392\u5E8F",pinLeft:"\u56FA\u5B9A\u5728\u5DE6\u4FA7",pinRight:"\u56FA\u5B9A\u5728\u53F3\u4FA7",unpin:"\u53D6\u6D88\u56FA\u5B9A",columnMenu:"\u5217\u83DC\u5355",selectRow:"\u9009\u62E9\u884C",selectAllRows:"\u9009\u62E9\u6240\u6709\u884C",chooseColumns:"\u9009\u62E9\u5217",columns:"\u5217",autosizeThis:"\u81EA\u52A8\u8C03\u6574\u6B64\u5217\u5BBD\u5EA6",autosizeAll:"\u81EA\u52A8\u8C03\u6574\u6240\u6709\u5217\u5BBD\u5EA6",resetColumns:"\u91CD\u7F6E\u5217",hideColumn:"\u9690\u85CF\u5217",close:"\u5173\u95ED",copy:"\u590D\u5236",cut:"\u526A\u5207",copyWithHeaders:"\u8FDE\u540C\u6807\u9898\u590D\u5236",paste:"\u7C98\u8D34",pasteHint:"\u6D4F\u89C8\u5668\u963B\u6B62\u4E86\u526A\u8D34\u677F\u8BBF\u95EE\u3002\u8BF7\u6309 Ctrl+V \u7C98\u8D34\u3002",required:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879",invalidValue:"\u503C\u65E0\u6548",and:"\u4E14",or:"\u6216",advancedFilter:"\u9AD8\u7EA7\u7B5B\u9009",addCondition:"\u6DFB\u52A0\u6761\u4EF6",duplicate:"\u8BE5\u503C\u5DF2\u88AB\u4F7F\u7528",undo:"\u64A4\u9500",redo:"\u91CD\u505A",deleteRows:"\u5220\u9664\u6240\u9009\u884C",copyRows:"\u590D\u5236\u6240\u9009\u884C",statusRows:"{n} \u884C",statusFiltered:"{total} \u884C\u4E2D\u7684 {shown} \u884C",statusSelected:"\u5DF2\u9009 {n} \u884C",count:"\u8BA1\u6570",sum:"\u6C42\u548C",avg:"\u5E73\u5747\u503C",min:"\u6700\u5C0F\u503C",max:"\u6700\u5927\u503C",findPlaceholder:"\u5728\u8868\u683C\u4E2D\u67E5\u627E",noMatches:"\u65E0\u5339\u914D\u9879",findNext:"\u4E0B\u4E00\u4E2A",findPrevious:"\u4E0A\u4E00\u4E2A",groupPanelHint:"\u5C06\u5217\u6807\u9898\u62D6\u5230\u6B64\u5904\u4EE5\u5206\u7EC4",groupByThis:"\u6309\u6B64\u5217\u5206\u7EC4",ungroup:"\u53D6\u6D88\u5206\u7EC4",expandAll:"\u5168\u90E8\u5C55\u5F00",collapseAll:"\u5168\u90E8\u6298\u53E0",pagerRange:"\u7B2C {from}\u2013{to} \u6761\uFF0C\u5171 {total} \u6761",pageOf:"\u7B2C {page} \u9875\uFF0C\u5171 {pages} \u9875",pageSize:"\u6BCF\u9875\u884C\u6570",firstPage:"\u9996\u9875",previousPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",lastPage:"\u672B\u9875",loading:"\u52A0\u8F7D\u4E2D\u2026",loadFailed:"\u65E0\u6CD5\u52A0\u8F7D\u6570\u636E",filters:"\u7B5B\u9009",clearFilters:"\u6E05\u9664\u6240\u6709\u7B5B\u9009",exportCsv:"\u5BFC\u51FA CSV",exportExcel:"\u5BFC\u51FA Excel",pivot:"\u6570\u636E\u900F\u89C6",pivotMode:"\u900F\u89C6\u6A21\u5F0F",pivotRows:"\u884C\u5206\u7EC4",pivotColumns:"\u5217\u6807\u7B7E",pivotValues:"\u503C",total:"\u603B\u8BA1",addColumn:"\u6DFB\u52A0\u5217\u2026",chartBar:"\u67F1\u72B6\u56FE",chartStacked:"\u5806\u79EF\u67F1\u72B6\u56FE",chartLine:"\u6298\u7EBF\u56FE",chartArea:"\u9762\u79EF\u56FE",chartPie:"\u997C\u56FE",chartDonut:"\u73AF\u5F62\u56FE",chartCombo:"\u67F1\u7EBF\u7EC4\u5408\u56FE",chartScatter:"\u6563\u70B9\u56FE",freeBadge:"\u514D\u8D39\u4F7F\u7528\u4E2D",ops:{contains:"\u5305\u542B",equals:"\u7B49\u4E8E",notEquals:"\u4E0D\u7B49\u4E8E",startsWith:"\u5F00\u5934\u662F",endsWith:"\u7ED3\u5C3E\u662F",blank:"\u4E3A\u7A7A",notBlank:"\u4E0D\u4E3A\u7A7A",eq:"\u7B49\u4E8E",ne:"\u4E0D\u7B49\u4E8E",lt:"\u5C0F\u4E8E",lte:"\u5C0F\u4E8E\u6216\u7B49\u4E8E",gt:"\u5927\u4E8E",gte:"\u5927\u4E8E\u6216\u7B49\u4E8E",between:"\u4ECB\u4E8E",before:"\u65E9\u4E8E",after:"\u665A\u4E8E"}},Mn=tr;var nr={code:"zh-TW",noRows:"\u6C92\u6709\u53EF\u986F\u793A\u7684\u8CC7\u6599",filter:"\u7BE9\u9078",apply:"\u5957\u7528",reset:"\u91CD\u8A2D",selectAll:"(\u5168\u9078)",search:"\u641C\u5C0B\u2026",blanks:"(\u7A7A\u767D)",value:"\u503C",valueTo:"\u81F3",sortAsc:"\u905E\u589E\u6392\u5E8F",sortDesc:"\u905E\u6E1B\u6392\u5E8F",clearSort:"\u6E05\u9664\u6392\u5E8F",pinLeft:"\u56FA\u5B9A\u5728\u5DE6\u5074",pinRight:"\u56FA\u5B9A\u5728\u53F3\u5074",unpin:"\u53D6\u6D88\u56FA\u5B9A",columnMenu:"\u6B04\u4F4D\u9078\u55AE",selectRow:"\u9078\u53D6\u5217",selectAllRows:"\u9078\u53D6\u6240\u6709\u5217",chooseColumns:"\u9078\u64C7\u6B04\u4F4D",columns:"\u6B04\u4F4D",autosizeThis:"\u81EA\u52D5\u8ABF\u6574\u6B64\u6B04\u5BEC",autosizeAll:"\u81EA\u52D5\u8ABF\u6574\u6240\u6709\u6B04\u5BEC",resetColumns:"\u91CD\u8A2D\u6B04\u4F4D",hideColumn:"\u96B1\u85CF\u6B04\u4F4D",close:"\u95DC\u9589",copy:"\u8907\u88FD",cut:"\u526A\u4E0B",copyWithHeaders:"\u9023\u540C\u6A19\u984C\u8907\u88FD",paste:"\u8CBC\u4E0A",pasteHint:"\u7121\u6CD5\u5B58\u53D6\u526A\u8CBC\u7C3F\u3002\u8ACB\u6309 Ctrl+V \u8CBC\u4E0A\u3002",required:"\u6B64\u6B04\u4F4D\u70BA\u5FC5\u586B",invalidValue:"\u503C\u7121\u6548",and:"\u4E14",or:"\u6216",advancedFilter:"\u9032\u968E\u7BE9\u9078",addCondition:"\u65B0\u589E\u689D\u4EF6",duplicate:"\u6B64\u503C\u5DF2\u88AB\u4F7F\u7528",undo:"\u5FA9\u539F",redo:"\u91CD\u505A",deleteRows:"\u522A\u9664\u9078\u53D6\u7684\u5217",copyRows:"\u8907\u88FD\u9078\u53D6\u7684\u5217",statusRows:"{n} \u5217",statusFiltered:"{total} \u5217\u4E2D\u7684 {shown} \u5217",statusSelected:"\u5DF2\u9078\u53D6 {n} \u5217",count:"\u7B46\u6578",sum:"\u5408\u8A08",avg:"\u5E73\u5747",min:"\u6700\u5C0F",max:"\u6700\u5927",findPlaceholder:"\u5728\u8868\u683C\u4E2D\u5C0B\u627E",noMatches:"\u6C92\u6709\u7B26\u5408\u7684\u7D50\u679C",findNext:"\u4E0B\u4E00\u500B",findPrevious:"\u4E0A\u4E00\u500B",groupPanelHint:"\u5C07\u6B04\u4F4D\u6A19\u984C\u62D6\u66F3\u5230\u9019\u88E1\u4EE5\u5206\u7D44",groupByThis:"\u4F9D\u6B64\u6B04\u4F4D\u5206\u7D44",ungroup:"\u53D6\u6D88\u5206\u7D44",expandAll:"\u5168\u90E8\u5C55\u958B",collapseAll:"\u5168\u90E8\u647A\u758A",pagerRange:"{from}\u2013{to}\uFF0C\u5171 {total} \u7B46",pageOf:"\u7B2C {page} \u9801\uFF0C\u5171 {pages} \u9801",pageSize:"\u6BCF\u9801\u5217\u6578",firstPage:"\u7B2C\u4E00\u9801",previousPage:"\u4E0A\u4E00\u9801",nextPage:"\u4E0B\u4E00\u9801",lastPage:"\u6700\u5F8C\u4E00\u9801",loading:"\u8F09\u5165\u4E2D\u2026",loadFailed:"\u7121\u6CD5\u8F09\u5165\u8CC7\u6599",filters:"\u7BE9\u9078",clearFilters:"\u6E05\u9664\u6240\u6709\u7BE9\u9078",exportCsv:"\u532F\u51FA CSV",exportExcel:"\u532F\u51FA Excel",pivot:"\u6A1E\u7D10\u5206\u6790",pivotMode:"\u6A1E\u7D10\u5206\u6790\u6A21\u5F0F",pivotRows:"\u5217\u7FA4\u7D44",pivotColumns:"\u6B04\u6A19\u7C64",pivotValues:"\u503C",total:"\u7E3D\u8A08",addColumn:"\u65B0\u589E\u6B04\u4F4D\u2026",chartBar:"\u76F4\u689D\u5716",chartStacked:"\u5806\u758A\u76F4\u689D\u5716",chartLine:"\u6298\u7DDA\u5716",chartArea:"\u5340\u57DF\u5716",chartPie:"\u5713\u5F62\u5716",chartDonut:"\u74B0\u5708\u5716",chartCombo:"\u76F4\u689D\u8207\u6298\u7DDA\u5716",chartScatter:"\u6563\u4F48\u5716",freeBadge:"\u514D\u8CBB\u7248",ops:{contains:"\u5305\u542B",equals:"\u7B49\u65BC",notEquals:"\u4E0D\u7B49\u65BC",startsWith:"\u958B\u982D\u70BA",endsWith:"\u7D50\u5C3E\u70BA",blank:"\u7A7A\u767D",notBlank:"\u975E\u7A7A\u767D",eq:"\u7B49\u65BC",ne:"\u4E0D\u7B49\u65BC",lt:"\u5C0F\u65BC",lte:"\u5C0F\u65BC\u6216\u7B49\u65BC",gt:"\u5927\u65BC",gte:"\u5927\u65BC\u6216\u7B49\u65BC",between:"\u4ECB\u65BC",before:"\u65E9\u65BC",after:"\u665A\u65BC"}},En=nr;var or={code:"vi",noRows:"Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",filter:"L\u1ECDc",apply:"\xC1p d\u1EE5ng",reset:"\u0110\u1EB7t l\u1EA1i",selectAll:"(Ch\u1ECDn t\u1EA5t c\u1EA3)",search:"T\xECm\u2026",blanks:"(Tr\u1ED1ng)",value:"Gi\xE1 tr\u1ECB",valueTo:"\u0110\u1EBFn",sortAsc:"S\u1EAFp x\u1EBFp t\u0103ng d\u1EA7n",sortDesc:"S\u1EAFp x\u1EBFp gi\u1EA3m d\u1EA7n",clearSort:"B\u1ECF s\u1EAFp x\u1EBFp",pinLeft:"Ghim tr\xE1i",pinRight:"Ghim ph\u1EA3i",unpin:"B\u1ECF ghim",columnMenu:"Menu c\u1ED9t",selectRow:"Ch\u1ECDn d\xF2ng",selectAllRows:"Ch\u1ECDn t\u1EA5t c\u1EA3 d\xF2ng",chooseColumns:"Ch\u1ECDn c\u1ED9t",columns:"C\u1ED9t",autosizeThis:"T\u1EF1 \u0111\u1ED9ng ch\u1EC9nh \u0111\u1ED9 r\u1ED9ng c\u1ED9t n\xE0y",autosizeAll:"T\u1EF1 \u0111\u1ED9ng ch\u1EC9nh \u0111\u1ED9 r\u1ED9ng t\u1EA5t c\u1EA3 c\u1ED9t",resetColumns:"\u0110\u1EB7t l\u1EA1i c\u1ED9t",hideColumn:"\u1EA8n c\u1ED9t",close:"\u0110\xF3ng",copy:"Sao ch\xE9p",cut:"C\u1EAFt",copyWithHeaders:"Sao ch\xE9p k\xE8m ti\xEAu \u0111\u1EC1",paste:"D\xE1n",pasteHint:"Kh\xF4ng truy c\u1EADp \u0111\u01B0\u1EE3c b\u1ED9 nh\u1EDB t\u1EA1m. Nh\u1EA5n Ctrl+V \u0111\u1EC3 d\xE1n.",required:"Tr\u01B0\u1EDDng n\xE0y l\xE0 b\u1EAFt bu\u1ED9c",invalidValue:"Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7",and:"V\xE0",or:"Ho\u1EB7c",advancedFilter:"L\u1ECDc n\xE2ng cao",addCondition:"Th\xEAm \u0111i\u1EC1u ki\u1EC7n",duplicate:"Gi\xE1 tr\u1ECB n\xE0y \u0111\xE3 \u0111\u01B0\u1EE3c d\xF9ng",undo:"Ho\xE0n t\xE1c",redo:"L\xE0m l\u1EA1i",deleteRows:"X\xF3a c\xE1c d\xF2ng \u0111\xE3 ch\u1ECDn",copyRows:"Sao ch\xE9p c\xE1c d\xF2ng \u0111\xE3 ch\u1ECDn",statusRows:"{n} d\xF2ng",statusFiltered:"{shown} / {total} d\xF2ng",statusSelected:"\u0110\xE3 ch\u1ECDn {n}",count:"S\u1ED1 l\u01B0\u1EE3ng",sum:"T\u1ED5ng",avg:"Trung b\xECnh",min:"Nh\u1ECF nh\u1EA5t",max:"L\u1EDBn nh\u1EA5t",findPlaceholder:"T\xECm trong b\u1EA3ng",noMatches:"Kh\xF4ng t\xECm th\u1EA5y",findNext:"K\u1EBFt qu\u1EA3 ti\u1EBFp",findPrevious:"K\u1EBFt qu\u1EA3 tr\u01B0\u1EDBc",groupPanelHint:"K\xE9o ti\xEAu \u0111\u1EC1 c\u1ED9t v\xE0o \u0111\xE2y \u0111\u1EC3 nh\xF3m d\xF2ng",groupByThis:"Nh\xF3m theo c\u1ED9t n\xE0y",ungroup:"B\u1ECF nh\xF3m",expandAll:"M\u1EDF r\u1ED9ng t\u1EA5t c\u1EA3",collapseAll:"Thu g\u1ECDn t\u1EA5t c\u1EA3",pagerRange:"{from}\u2013{to} / {total}",pageOf:"Trang {page} / {pages}",pageSize:"S\u1ED1 d\xF2ng m\u1ED7i trang",firstPage:"Trang \u0111\u1EA7u",previousPage:"Trang tr\u01B0\u1EDBc",nextPage:"Trang sau",lastPage:"Trang cu\u1ED1i",loading:"\u0110ang t\u1EA3i\u2026",loadFailed:"Kh\xF4ng t\u1EA3i \u0111\u01B0\u1EE3c d\u1EEF li\u1EC7u",filters:"B\u1ED9 l\u1ECDc",clearFilters:"X\xF3a t\u1EA5t c\u1EA3 b\u1ED9 l\u1ECDc",exportCsv:"Xu\u1EA5t CSV",exportExcel:"Xu\u1EA5t Excel",pivot:"Pivot",pivotMode:"Ch\u1EBF \u0111\u1ED9 pivot",pivotRows:"Nh\xF3m d\xF2ng",pivotColumns:"Nh\xE3n c\u1ED9t",pivotValues:"Gi\xE1 tr\u1ECB",total:"T\u1ED5ng c\u1ED9ng",addColumn:"Th\xEAm c\u1ED9t\u2026",chartBar:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t",chartStacked:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t ch\u1ED3ng",chartLine:"Bi\u1EC3u \u0111\u1ED3 \u0111\u01B0\u1EDDng",chartArea:"Bi\u1EC3u \u0111\u1ED3 v\xF9ng",chartPie:"Bi\u1EC3u \u0111\u1ED3 tr\xF2n",chartDonut:"Bi\u1EC3u \u0111\u1ED3 v\xE0nh khuy\xEAn",chartCombo:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t v\xE0 \u0111\u01B0\u1EDDng",chartScatter:"Bi\u1EC3u \u0111\u1ED3 ph\xE2n t\xE1n",freeBadge:"B\u1EA3n mi\u1EC5n ph\xED",ops:{contains:"Ch\u1EE9a",equals:"B\u1EB1ng",notEquals:"Kh\xE1c",startsWith:"B\u1EAFt \u0111\u1EA7u b\u1EB1ng",endsWith:"K\u1EBFt th\xFAc b\u1EB1ng",blank:"Tr\u1ED1ng",notBlank:"Kh\xF4ng tr\u1ED1ng",eq:"B\u1EB1ng",ne:"Kh\xE1c",lt:"Nh\u1ECF h\u01A1n",lte:"Nh\u1ECF h\u01A1n ho\u1EB7c b\u1EB1ng",gt:"L\u1EDBn h\u01A1n",gte:"L\u1EDBn h\u01A1n ho\u1EB7c b\u1EB1ng",between:"Trong kho\u1EA3ng",before:"Tr\u01B0\u1EDBc",after:"Sau"}},Ln=or;var rr={code:"th",noRows:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",filter:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",apply:"\u0E43\u0E0A\u0E49",reset:"\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15",selectAll:"(\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14)",search:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",blanks:"(\u0E27\u0E48\u0E32\u0E07)",value:"\u0E04\u0E48\u0E32",valueTo:"\u0E16\u0E36\u0E07",sortAsc:"\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01",sortDesc:"\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22",clearSort:"\u0E25\u0E49\u0E32\u0E07\u0E01\u0E32\u0E23\u0E40\u0E23\u0E35\u0E22\u0E07",pinLeft:"\u0E15\u0E23\u0E36\u0E07\u0E0B\u0E49\u0E32\u0E22",pinRight:"\u0E15\u0E23\u0E36\u0E07\u0E02\u0E27\u0E32",unpin:"\u0E40\u0E25\u0E34\u0E01\u0E15\u0E23\u0E36\u0E07",columnMenu:"\u0E40\u0E21\u0E19\u0E39\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",selectRow:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27",selectAllRows:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",chooseColumns:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",columns:"\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",autosizeThis:"\u0E1B\u0E23\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",autosizeAll:"\u0E1B\u0E23\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E17\u0E38\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",resetColumns:"\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",hideColumn:"\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",close:"\u0E1B\u0E34\u0E14",copy:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01",cut:"\u0E15\u0E31\u0E14",copyWithHeaders:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E2B\u0E31\u0E27\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",paste:"\u0E27\u0E32\u0E07",pasteHint:"\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E01\u0E14 Ctrl+V \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E27\u0E32\u0E07",required:"\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E23\u0E2D\u0E01\u0E0A\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49",invalidValue:"\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",and:"\u0E41\u0E25\u0E30",or:"\u0E2B\u0E23\u0E37\u0E2D",advancedFilter:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E02\u0E31\u0E49\u0E19\u0E2A\u0E39\u0E07",addCondition:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E07\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E02",duplicate:"\u0E04\u0E48\u0E32\u0E19\u0E35\u0E49\u0E16\u0E39\u0E01\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27",undo:"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33",redo:"\u0E17\u0E33\u0E0B\u0E49\u0E33",deleteRows:"\u0E25\u0E1A\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01",copyRows:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01",statusRows:"{n} \u0E41\u0E16\u0E27",statusFiltered:"{shown} \u0E08\u0E32\u0E01 {total} \u0E41\u0E16\u0E27",statusSelected:"\u0E40\u0E25\u0E37\u0E2D\u0E01 {n} \u0E41\u0E16\u0E27",count:"\u0E08\u0E33\u0E19\u0E27\u0E19",sum:"\u0E1C\u0E25\u0E23\u0E27\u0E21",avg:"\u0E04\u0E48\u0E32\u0E40\u0E09\u0E25\u0E35\u0E48\u0E22",min:"\u0E15\u0E48\u0E33\u0E2A\u0E38\u0E14",max:"\u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14",findPlaceholder:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E43\u0E19\u0E15\u0E32\u0E23\u0E32\u0E07",noMatches:"\u0E44\u0E21\u0E48\u0E1E\u0E1A",findNext:"\u0E16\u0E31\u0E14\u0E44\u0E1B",findPrevious:"\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",groupPanelHint:"\u0E25\u0E32\u0E01\u0E2B\u0E31\u0E27\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E21\u0E32\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21",groupByThis:"\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21\u0E15\u0E32\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49",ungroup:"\u0E40\u0E25\u0E34\u0E01\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21",expandAll:"\u0E02\u0E22\u0E32\u0E22\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",collapseAll:"\u0E22\u0E38\u0E1A\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",pagerRange:"{from}\u2013{to} \u0E08\u0E32\u0E01 {total}",pageOf:"\u0E2B\u0E19\u0E49\u0E32 {page} \u0E08\u0E32\u0E01 {pages}",pageSize:"\u0E41\u0E16\u0E27\u0E15\u0E48\u0E2D\u0E2B\u0E19\u0E49\u0E32",firstPage:"\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E23\u0E01",previousPage:"\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19",nextPage:"\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",lastPage:"\u0E2B\u0E19\u0E49\u0E32\u0E2A\u0E38\u0E14\u0E17\u0E49\u0E32\u0E22",loading:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u2026",loadFailed:"\u0E42\u0E2B\u0E25\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08",filters:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",clearFilters:"\u0E25\u0E49\u0E32\u0E07\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",exportCsv:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 CSV",exportExcel:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 Excel",pivot:"Pivot",pivotMode:"\u0E42\u0E2B\u0E21\u0E14 Pivot",pivotRows:"\u0E01\u0E25\u0E38\u0E48\u0E21\u0E41\u0E16\u0E27",pivotColumns:"\u0E1B\u0E49\u0E32\u0E22\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",pivotValues:"\u0E04\u0E48\u0E32",total:"\u0E23\u0E27\u0E21",addColumn:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u2026",chartBar:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07",chartStacked:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07\u0E0B\u0E49\u0E2D\u0E19",chartLine:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E2A\u0E49\u0E19",chartArea:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E1E\u0E37\u0E49\u0E19\u0E17\u0E35\u0E48",chartPie:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E27\u0E07\u0E01\u0E25\u0E21",chartDonut:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E42\u0E14\u0E19\u0E31\u0E17",chartCombo:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07\u0E41\u0E25\u0E30\u0E40\u0E2A\u0E49\u0E19",chartScatter:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22",freeBadge:"\u0E23\u0E38\u0E48\u0E19\u0E1F\u0E23\u0E35",ops:{contains:"\u0E21\u0E35\u0E04\u0E33\u0E27\u0E48\u0E32",equals:"\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",notEquals:"\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",startsWith:"\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22",endsWith:"\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22",blank:"\u0E27\u0E48\u0E32\u0E07",notBlank:"\u0E44\u0E21\u0E48\u0E27\u0E48\u0E32\u0E07",eq:"\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",ne:"\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",lt:"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",lte:"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",gt:"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",gte:"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",between:"\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07",before:"\u0E01\u0E48\u0E2D\u0E19",after:"\u0E2B\u0E25\u0E31\u0E07"}},Tn=rr;var ir={code:"id",noRows:"Tidak ada data",filter:"Filter",apply:"Terapkan",reset:"Atur ulang",selectAll:"(Pilih semua)",search:"Cari\u2026",blanks:"(Kosong)",value:"Nilai",valueTo:"Sampai",sortAsc:"Urutkan naik",sortDesc:"Urutkan turun",clearSort:"Hapus urutan",pinLeft:"Sematkan kiri",pinRight:"Sematkan kanan",unpin:"Lepas sematan",columnMenu:"Menu kolom",selectRow:"Pilih baris",selectAllRows:"Pilih semua baris",chooseColumns:"Pilih kolom",columns:"Kolom",autosizeThis:"Sesuaikan lebar kolom ini",autosizeAll:"Sesuaikan lebar semua kolom",resetColumns:"Atur ulang kolom",hideColumn:"Sembunyikan kolom",close:"Tutup",copy:"Salin",cut:"Potong",copyWithHeaders:"Salin dengan judul",paste:"Tempel",pasteHint:"Akses papan klip diblokir. Tekan Ctrl+V untuk menempel.",required:"Kolom ini wajib diisi",invalidValue:"Nilai tidak valid",and:"Dan",or:"Atau",advancedFilter:"Filter lanjutan",addCondition:"Tambah kondisi",duplicate:"Nilai ini sudah dipakai",undo:"Urungkan",redo:"Ulangi",deleteRows:"Hapus baris terpilih",copyRows:"Salin baris terpilih",statusRows:"{n} baris",statusFiltered:"{shown} dari {total} baris",statusSelected:"{n} dipilih",count:"Jumlah data",sum:"Total",avg:"Rata-rata",min:"Min",max:"Maks",findPlaceholder:"Cari di tabel",noMatches:"Tidak ditemukan",findNext:"Berikutnya",findPrevious:"Sebelumnya",groupPanelHint:"Seret judul kolom ke sini untuk mengelompokkan",groupByThis:"Kelompokkan menurut kolom ini",ungroup:"Hapus pengelompokan",expandAll:"Buka semua",collapseAll:"Tutup semua",pagerRange:"{from}\u2013{to} dari {total}",pageOf:"Halaman {page} dari {pages}",pageSize:"Baris per halaman",firstPage:"Halaman pertama",previousPage:"Halaman sebelumnya",nextPage:"Halaman berikutnya",lastPage:"Halaman terakhir",loading:"Memuat\u2026",loadFailed:"Gagal memuat data",filters:"Filter",clearFilters:"Hapus semua filter",exportCsv:"Ekspor CSV",exportExcel:"Ekspor Excel",pivot:"Pivot",pivotMode:"Mode pivot",pivotRows:"Grup baris",pivotColumns:"Label kolom",pivotValues:"Nilai",total:"Total",addColumn:"Tambah kolom\u2026",chartBar:"Diagram batang",chartStacked:"Diagram batang bertumpuk",chartLine:"Diagram garis",chartArea:"Diagram area",chartPie:"Diagram lingkaran",chartDonut:"Diagram donat",chartCombo:"Diagram batang dan garis",chartScatter:"Diagram sebar",freeBadge:"Versi gratis",ops:{contains:"Berisi",equals:"Sama dengan",notEquals:"Tidak sama dengan",startsWith:"Diawali",endsWith:"Diakhiri",blank:"Kosong",notBlank:"Tidak kosong",eq:"Sama dengan",ne:"Tidak sama dengan",lt:"Kurang dari",lte:"Kurang dari atau sama dengan",gt:"Lebih dari",gte:"Lebih dari atau sama dengan",between:"Di antara",before:"Sebelum",after:"Sesudah"}},In=ir;var sr={code:"ru",noRows:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445",filter:"\u0424\u0438\u043B\u044C\u0442\u0440",apply:"\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C",reset:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C",selectAll:"(\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435)",search:"\u041F\u043E\u0438\u0441\u043A\u2026",blanks:"(\u041F\u0443\u0441\u0442\u044B\u0435)",value:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435",valueTo:"\u041F\u043E",sortAsc:"\u041F\u043E \u0432\u043E\u0437\u0440\u0430\u0441\u0442\u0430\u043D\u0438\u044E",sortDesc:"\u041F\u043E \u0443\u0431\u044B\u0432\u0430\u043D\u0438\u044E",clearSort:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0443",pinLeft:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0441\u043B\u0435\u0432\u0430",pinRight:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0441\u043F\u0440\u0430\u0432\u0430",unpin:"\u041E\u0442\u043A\u0440\u0435\u043F\u0438\u0442\u044C",columnMenu:"\u041C\u0435\u043D\u044E \u0441\u0442\u043E\u043B\u0431\u0446\u0430",selectRow:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443",selectAllRows:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",chooseColumns:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0446\u044B",columns:"\u0421\u0442\u043E\u043B\u0431\u0446\u044B",autosizeThis:"\u041F\u043E\u0434\u043E\u0431\u0440\u0430\u0442\u044C \u0448\u0438\u0440\u0438\u043D\u0443 \u0441\u0442\u043E\u043B\u0431\u0446\u0430",autosizeAll:"\u041F\u043E\u0434\u043E\u0431\u0440\u0430\u0442\u044C \u0448\u0438\u0440\u0438\u043D\u0443 \u0432\u0441\u0435\u0445 \u0441\u0442\u043E\u043B\u0431\u0446\u043E\u0432",resetColumns:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0446\u044B",hideColumn:"\u0421\u043A\u0440\u044B\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446",close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",copy:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",cut:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C",copyWithHeaders:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u043C\u0438",paste:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C",pasteHint:"\u0414\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0437\u0430\u043F\u0440\u0435\u0449\u0451\u043D. \u041D\u0430\u0436\u043C\u0438\u0442\u0435 Ctrl+V, \u0447\u0442\u043E\u0431\u044B \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044C.",required:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435",invalidValue:"\u041D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435",and:"\u0418",or:"\u0418\u043B\u0438",advancedFilter:"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0439 \u0444\u0438\u043B\u044C\u0442\u0440",addCondition:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0441\u043B\u043E\u0432\u0438\u0435",duplicate:"\u042D\u0442\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0443\u0436\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F",undo:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",redo:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",deleteRows:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",copyRows:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",statusRows:"\u0421\u0442\u0440\u043E\u043A: {n}",statusFiltered:"{shown} \u0438\u0437 {total} \u0441\u0442\u0440\u043E\u043A",statusSelected:"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}",count:"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E",sum:"\u0421\u0443\u043C\u043C\u0430",avg:"\u0421\u0440\u0435\u0434\u043D\u0435\u0435",min:"\u041C\u0438\u043D.",max:"\u041C\u0430\u043A\u0441.",findPlaceholder:"\u041D\u0430\u0439\u0442\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435",noMatches:"\u041D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E",findNext:"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0435",findPrevious:"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0435",groupPanelHint:"\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0441\u044E\u0434\u0430 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0441\u0442\u043E\u043B\u0431\u0446\u0430 \u0434\u043B\u044F \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438",groupByThis:"\u0413\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E \u044D\u0442\u043E\u043C\u0443 \u0441\u0442\u043E\u043B\u0431\u0446\u0443",ungroup:"\u0423\u0431\u0440\u0430\u0442\u044C \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0443",expandAll:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0435",collapseAll:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0435",pagerRange:"{from}\u2013{to} \u0438\u0437 {total}",pageOf:"\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 {page} \u0438\u0437 {pages}",pageSize:"\u0421\u0442\u0440\u043E\u043A \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435",firstPage:"\u041F\u0435\u0440\u0432\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",previousPage:"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",nextPage:"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",lastPage:"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\u2026",loadFailed:"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",filters:"\u0424\u0438\u043B\u044C\u0442\u0440\u044B",clearFilters:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u0441\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B",exportCsv:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 CSV",exportExcel:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 Excel",pivot:"\u0421\u0432\u043E\u0434\u043D\u0430\u044F",pivotMode:"\u0420\u0435\u0436\u0438\u043C \u0441\u0432\u043E\u0434\u043D\u043E\u0439 \u0442\u0430\u0431\u043B\u0438\u0446\u044B",pivotRows:"\u0413\u0440\u0443\u043F\u043F\u044B \u0441\u0442\u0440\u043E\u043A",pivotColumns:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 \u0441\u0442\u043E\u043B\u0431\u0446\u043E\u0432",pivotValues:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u044F",total:"\u0418\u0442\u043E\u0433\u043E",addColumn:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446\u2026",chartBar:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430",chartStacked:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0441 \u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u0435\u043C",chartLine:"\u0413\u0440\u0430\u0444\u0438\u043A",chartArea:"\u0414\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430 \u0441 \u043E\u0431\u043B\u0430\u0441\u0442\u044F\u043C\u0438",chartPie:"\u041A\u0440\u0443\u0433\u043E\u0432\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",chartDonut:"\u041A\u043E\u043B\u044C\u0446\u0435\u0432\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",chartCombo:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0438 \u0433\u0440\u0430\u0444\u0438\u043A",chartScatter:"\u0422\u043E\u0447\u0435\u0447\u043D\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",freeBadge:"\u0411\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u0430\u044F \u0432\u0435\u0440\u0441\u0438\u044F",ops:{contains:"\u0421\u043E\u0434\u0435\u0440\u0436\u0438\u0442",equals:"\u0420\u0430\u0432\u043D\u043E",notEquals:"\u041D\u0435 \u0440\u0430\u0432\u043D\u043E",startsWith:"\u041D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0441",endsWith:"\u0417\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043D\u0430",blank:"\u041F\u0443\u0441\u0442\u043E",notBlank:"\u041D\u0435 \u043F\u0443\u0441\u0442\u043E",eq:"\u0420\u0430\u0432\u043D\u043E",ne:"\u041D\u0435 \u0440\u0430\u0432\u043D\u043E",lt:"\u041C\u0435\u043D\u044C\u0448\u0435",lte:"\u041C\u0435\u043D\u044C\u0448\u0435 \u0438\u043B\u0438 \u0440\u0430\u0432\u043D\u043E",gt:"\u0411\u043E\u043B\u044C\u0448\u0435",gte:"\u0411\u043E\u043B\u044C\u0448\u0435 \u0438\u043B\u0438 \u0440\u0430\u0432\u043D\u043E",between:"\u041C\u0435\u0436\u0434\u0443",before:"\u0414\u043E",after:"\u041F\u043E\u0441\u043B\u0435"}},Dn=sr;var ar={code:"pt-BR",noRows:"Nenhuma linha para mostrar",filter:"Filtro",apply:"Aplicar",reset:"Limpar",selectAll:"(Selecionar tudo)",search:"Pesquisar\u2026",blanks:"(Vazios)",value:"Valor",valueTo:"At\xE9",sortAsc:"Ordenar crescente",sortDesc:"Ordenar decrescente",clearSort:"Remover ordena\xE7\xE3o",pinLeft:"Fixar \xE0 esquerda",pinRight:"Fixar \xE0 direita",unpin:"Desafixar",columnMenu:"Menu da coluna",selectRow:"Selecionar linha",selectAllRows:"Selecionar todas as linhas",chooseColumns:"Escolher colunas",columns:"Colunas",autosizeThis:"Ajustar largura desta coluna",autosizeAll:"Ajustar largura de todas as colunas",resetColumns:"Redefinir colunas",hideColumn:"Ocultar coluna",close:"Fechar",copy:"Copiar",cut:"Recortar",copyWithHeaders:"Copiar com cabe\xE7alhos",paste:"Colar",pasteHint:"O acesso \xE0 \xE1rea de transfer\xEAncia foi bloqueado. Pressione Ctrl+V para colar.",required:"Campo obrigat\xF3rio",invalidValue:"Valor inv\xE1lido",and:"E",or:"Ou",advancedFilter:"Filtro avan\xE7ado",addCondition:"Adicionar condi\xE7\xE3o",duplicate:"Este valor j\xE1 est\xE1 em uso",undo:"Desfazer",redo:"Refazer",deleteRows:"Excluir linhas selecionadas",copyRows:"Copiar linhas selecionadas",statusRows:"{n} linhas",statusFiltered:"{shown} de {total} linhas",statusSelected:"{n} selecionadas",count:"Contagem",sum:"Soma",avg:"M\xE9dia",min:"M\xEDn.",max:"M\xE1x.",findPlaceholder:"Localizar na tabela",noMatches:"Nenhum resultado",findNext:"Pr\xF3ximo",findPrevious:"Anterior",groupPanelHint:"Arraste um cabe\xE7alho de coluna aqui para agrupar",groupByThis:"Agrupar por esta coluna",ungroup:"Remover agrupamento",expandAll:"Expandir tudo",collapseAll:"Recolher tudo",pagerRange:"{from}\u2013{to} de {total}",pageOf:"P\xE1gina {page} de {pages}",pageSize:"Linhas por p\xE1gina",firstPage:"Primeira p\xE1gina",previousPage:"P\xE1gina anterior",nextPage:"Pr\xF3xima p\xE1gina",lastPage:"\xDAltima p\xE1gina",loading:"Carregando\u2026",loadFailed:"N\xE3o foi poss\xEDvel carregar as linhas",filters:"Filtros",clearFilters:"Limpar todos os filtros",exportCsv:"Exportar CSV",exportExcel:"Exportar Excel",pivot:"Piv\xF4",pivotMode:"Modo piv\xF4",pivotRows:"Grupos de linhas",pivotColumns:"R\xF3tulos de coluna",pivotValues:"Valores",total:"Total",addColumn:"Adicionar coluna\u2026",chartBar:"Gr\xE1fico de barras",chartStacked:"Gr\xE1fico de barras empilhadas",chartLine:"Gr\xE1fico de linhas",chartArea:"Gr\xE1fico de \xE1rea",chartPie:"Gr\xE1fico de pizza",chartDonut:"Gr\xE1fico de rosca",chartCombo:"Gr\xE1fico de barras e linhas",chartScatter:"Gr\xE1fico de dispers\xE3o",freeBadge:"Vers\xE3o gratuita",ops:{contains:"Cont\xE9m",equals:"Igual a",notEquals:"Diferente de",startsWith:"Come\xE7a com",endsWith:"Termina com",blank:"Vazio",notBlank:"N\xE3o vazio",eq:"Igual a",ne:"Diferente de",lt:"Menor que",lte:"Menor ou igual a",gt:"Maior que",gte:"Maior ou igual a",between:"Entre",before:"Antes de",after:"Depois de"}},Pn=ar;var lr={code:"it",noRows:"Nessuna riga da mostrare",filter:"Filtro",apply:"Applica",reset:"Reimposta",selectAll:"(Seleziona tutto)",search:"Cerca\u2026",blanks:"(Vuoti)",value:"Valore",valueTo:"A",sortAsc:"Ordine crescente",sortDesc:"Ordine decrescente",clearSort:"Rimuovi ordinamento",pinLeft:"Blocca a sinistra",pinRight:"Blocca a destra",unpin:"Sblocca",columnMenu:"Menu colonna",selectRow:"Seleziona riga",selectAllRows:"Seleziona tutte le righe",chooseColumns:"Scegli colonne",columns:"Colonne",autosizeThis:"Adatta larghezza di questa colonna",autosizeAll:"Adatta larghezza di tutte le colonne",resetColumns:"Ripristina colonne",hideColumn:"Nascondi colonna",close:"Chiudi",copy:"Copia",cut:"Taglia",copyWithHeaders:"Copia con intestazioni",paste:"Incolla",pasteHint:"Accesso agli appunti bloccato. Premi Ctrl+V per incollare.",required:"Campo obbligatorio",invalidValue:"Valore non valido",and:"E",or:"O",advancedFilter:"Filtro avanzato",addCondition:"Aggiungi condizione",duplicate:"Questo valore \xE8 gi\xE0 in uso",undo:"Annulla",redo:"Ripeti",deleteRows:"Elimina righe selezionate",copyRows:"Copia righe selezionate",statusRows:"{n} righe",statusFiltered:"{shown} di {total} righe",statusSelected:"{n} selezionate",count:"Conteggio",sum:"Somma",avg:"Media",min:"Min",max:"Max",findPlaceholder:"Trova nella tabella",noMatches:"Nessun risultato",findNext:"Successivo",findPrevious:"Precedente",groupPanelHint:"Trascina qui un'intestazione di colonna per raggruppare",groupByThis:"Raggruppa per questa colonna",ungroup:"Rimuovi raggruppamento",expandAll:"Espandi tutto",collapseAll:"Comprimi tutto",pagerRange:"{from}\u2013{to} di {total}",pageOf:"Pagina {page} di {pages}",pageSize:"Righe per pagina",firstPage:"Prima pagina",previousPage:"Pagina precedente",nextPage:"Pagina successiva",lastPage:"Ultima pagina",loading:"Caricamento\u2026",loadFailed:"Impossibile caricare le righe",filters:"Filtri",clearFilters:"Rimuovi tutti i filtri",exportCsv:"Esporta CSV",exportExcel:"Esporta Excel",pivot:"Pivot",pivotMode:"Modalit\xE0 pivot",pivotRows:"Gruppi di righe",pivotColumns:"Etichette di colonna",pivotValues:"Valori",total:"Totale",addColumn:"Aggiungi colonna\u2026",chartBar:"Grafico a barre",chartStacked:"Grafico a barre in pila",chartLine:"Grafico a linee",chartArea:"Grafico ad area",chartPie:"Grafico a torta",chartDonut:"Grafico ad anello",chartCombo:"Grafico a barre e linee",chartScatter:"Grafico a dispersione",freeBadge:"Versione gratuita",ops:{contains:"Contiene",equals:"Uguale a",notEquals:"Diverso da",startsWith:"Inizia con",endsWith:"Finisce con",blank:"Vuoto",notBlank:"Non vuoto",eq:"Uguale a",ne:"Diverso da",lt:"Minore di",lte:"Minore o uguale a",gt:"Maggiore di",gte:"Maggiore o uguale a",between:"Tra",before:"Prima di",after:"Dopo"}},An=lr;var ne="__fg_select__",$n={id:ne,header:"",width:44,minWidth:44,maxWidth:44,pinned:"left",sortable:!1,resizable:!1,filter:!1},me="__fg_drag__",Fn={id:me,header:"",width:28,minWidth:28,maxWidth:28,pinned:"left",sortable:!1,resizable:!1,filter:!1,chooser:!1},he="__fg_rownum__",Nn=(i=52,e="#")=>({id:he,header:e,width:i,minWidth:i,maxWidth:i,pinned:"left",sortable:!1,resizable:!1,filter:!1,chooser:!1}),A=i=>i===ne||i===me||i===he,dr=120,cr=40,ur=["left","center","right"];function re(i){if(A(i.id)||i.filter===!1)return null;if(i.filter)return i.filter;switch(i.type){case"number":return"number";case"date":return"date";case"boolean":return"set";default:return"text"}}function ae(i,e,t){let n=i.editable;if(typeof n!="function")return!!n;try{return!!n({value:i.valueGetter?i.valueGetter(e):i.field?e[i.field]:void 0,row:e,rowIndex:t,column:i})}catch{return!1}}var ve=i=>i.id!==ne&&i.sortable!==!1,je=i=>i.id!==ne&&i.resizable!==!1;function Ke(i,e){var o,r;let t=(o=i.minWidth)!=null?o:cr,n=(r=i.maxWidth)!=null?r:1/0;return Math.round(Math.min(n,Math.max(t,e)))}function On(i){return i.children?1+Math.max(0,...i.children.map(On)):1}var Ue=class{constructor(e){this.depth=1;this.roots_=[];this.defs=[];this.byId=new Map;this.containerWidth=0;this.layout={left:[],center:[],right:[]};this.leafById=new Map;this.setDefs(e)}setDefs(e){this.defs=e,this.byId=new Map;let t=0,n=(r,s,a)=>{var h,f,g,x,y;let l=Array.isArray(r.children)&&r.children.length>0,d=t++,c=(h=r.id)!=null?h:l?`g${d}`:r.field;if(c||(c=`c${d}`,H(`column #${d} has neither "field" nor "id"; using "${c}"`)),this.byId.has(c)){let p=1;for(;this.byId.has(`${c}_${p}`);)p++;H(`duplicate column id "${c}"; renamed to "${c}_${p}"`),c=`${c}_${p}`}let u={id:c,def:r,parent:s,children:null,depth:a,width:Ke(r,(f=r.width)!=null?f:dr),flex:r.flex&&r.flex>0?r.flex:null,hide:(g=r.hide)!=null?g:!1,pinned:(y=(x=r.pinned)!=null?x:s==null?void 0:s.pinned)!=null?y:null,open:!!r.openByDefault};return this.byId.set(c,u),l&&(u.children=o(r.children).map(p=>n(p,u,a+1))),u},o=r=>{let s=r.filter(a=>a!==null&&typeof a=="object");return s.length!==r.length&&H("columns contain entries that are not objects; they were skipped"),s};this.roots_=o(e).map(r=>n(r,null,0)),this.depth=Math.max(1,...this.roots_.map(On)),this.relayout()}setContainerWidth(e){if(e===this.containerWidth)return!1;this.containerWidth=e;let t=this.displayed().map(n=>n.width).join();return this.relayout(),t!==this.displayed().map(n=>n.width).join()}roots(){return this.roots_}reset(){this.setDefs(this.defs)}region(e){return this.layout[e]}displayed(){return[...this.layout.left,...this.layout.center,...this.layout.right]}regionWidth(e){let t=this.layout[e],n=t[t.length-1];return n?n.left+n.width:0}getColumn(e){return this.leafById.get(e)}getNode(e){return this.byId.get(e)}siblings(e){let t=this.byId.get(e);return t?t.parent?t.parent.children:this.roots_:[]}setWidth(e,t){let n=this.byId.get(e);return!n||n.children?0:(n.flex=null,n.width=Ke(n.def,t),this.relayout(),n.width)}setPinned(e,t){let n=this.byId.get(e);!n||n.children||A(e)||(n.pinned=t,this.relayout())}setHide(e,t){let n=this.byId.get(e);!n||n.children||(n.hide=t,this.relayout())}move(e,t){let n=this.siblings(e),o=n.findIndex(s=>s.id===e);if(o<0)return;let[r]=n.splice(o,1);n.splice(Math.max(0,Math.min(n.length,t)),0,r),this.relayout()}headerCells(e){var o,r,s;let t=[],n=new Map;for(let a of this.layout[e]){let l=[];for(let d=a.node.parent;d;d=d.parent)l.unshift(d);for(let d of l){let c=n.get(d.id);if(c){c.width+=a.width;continue}let u={id:d.id,label:(o=d.def.header)!=null?o:"",isGroup:!0,column:null,node:d,row:d.depth,rowSpan:1,left:a.left,width:a.width};n.set(d.id,u),t.push(u)}t.push({id:a.id,label:(s=(r=a.def.header)!=null?r:a.def.field)!=null?s:"",isGroup:!1,column:a,node:a.node,row:a.node.depth,rowSpan:this.depth-a.node.depth,left:a.left,width:a.width})}return t}getState(){return this.leafNodes().filter(e=>!A(e.id)).map(e=>{var t,n,o;return{colId:e.id,width:(n=(t=this.leafById.get(e.id))==null?void 0:t.width)!=null?n:e.width,hide:!!e.hide,pinned:(o=e.pinned)!=null?o:null}})}applyState(e){let t=new Map;e.forEach((r,s)=>{t.set(r.colId,s);let a=this.byId.get(r.colId);!a||a.children||A(r.colId)||(typeof r.width=="number"&&Number.isFinite(r.width)&&(a.flex=null,a.width=Ke(a.def,r.width)),typeof r.hide=="boolean"&&(a.hide=r.hide),"pinned"in r&&(a.pinned=r.pinned==="left"||r.pinned==="right"?r.pinned:null))}),t.set(he,-3),t.set(me,-2),t.set(ne,-1);let n=r=>{var s;return r.children?Math.min(1/0,...r.children.map(n)):(s=t.get(r.id))!=null?s:1/0},o=r=>{let s=r.map((a,l)=>({n:a,i:l,r:n(a)}));s.sort((a,l)=>a.r===l.r?a.i-l.i:a.r-l.r),r.splice(0,r.length,...s.map(a=>a.n));for(let a of r)a.children&&o(a.children)};o(this.roots_),this.relayout()}leafNodes(){let e=[],t=n=>n.children?n.children.forEach(t):e.push(n);return this.roots_.forEach(t),e}isCollapsible(e){var t;return!!((t=e.children)!=null&&t.some(n=>n.def.columnGroupShow==="open"||n.def.columnGroupShow==="closed"))}setGroupOpen(e,t){let n=this.byId.get(e);return!(n!=null&&n.children)||n.open===t?!1:(n.open=t,this.relayout(),!0)}groupOpenState(){let e={};for(let t of this.byId.values())this.isCollapsible(t)&&(e[t.id]=t.open);return e}shownByGroups(e){for(let t=e;t!=null&&t.parent;t=t.parent){let n=t.def.columnGroupShow;if(n==="open"&&!t.parent.open||n==="closed"&&t.parent.open)return!1}return!0}relayout(){var l;let e=this.leafNodes().filter(d=>!d.hide&&this.shownByGroups(d)),t=e.reduce((d,c)=>d+(c.flex?0:c.width),0),n=e.reduce((d,c)=>{var u;return d+((u=c.flex)!=null?u:0)},0),o=Math.max(0,this.containerWidth-t),r=d=>d.flex?Ke(d.def,Math.floor(o*d.flex/n)):d.width,s={left:[],center:[],right:[]};this.leafById=new Map;let a=0;for(let d of ur){let c=0;for(let u of e){if(((l=u.pinned)!=null?l:"center")!==d)continue;let h={id:u.id,def:u.def,node:u,width:r(u),region:d,left:c,index:a++};c+=h.width,s[d].push(h),this.leafById.set(u.id,h)}}this.layout=s}};var Y=class extends Error{constructor(t){super(t);this.code=t}};function hr(i){let e=[],t=0;for(;t<i.length;){let n=i[t];if(/\s/.test(n))t++;else if(/[0-9.]/.test(n)){let o=/^(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/i.exec(i.slice(t));if(!o)throw new Y("#ERROR!");e.push({t:"num",v:Number(o[0])}),t+=o[0].length}else if(n==='"'){let o="";for(t++;;){if(t>=i.length)throw new Y("#ERROR!");if(i[t]==='"'){if(i[t+1]==='"'){o+='"',t+=2;continue}t++;break}o+=i[t++]}e.push({t:"str",v:o})}else if(n==="["){let o=i.indexOf("]",t);if(o<0)throw new Y("#ERROR!");e.push({t:"id",v:i.slice(t+1,o)}),t=o+1}else if(/[A-Za-z_À-￿]/.test(n)){let o=/^[A-Za-z_À-￿][\wÀ-￿]*/.exec(i.slice(t));e.push({t:"id",v:o[0]}),t+=o[0].length}else{let o=i.slice(t,t+2);if(o==="<>"||o==="<="||o===">=")e.push({t:"op",v:o}),t+=2;else if("+-*/%^&=<>(),".includes(n))e.push({t:"op",v:n}),t++;else throw new Y("#ERROR!")}}return e}var _e=i=>i==null||i==="";function X(i){if(typeof i=="number")return i;if(typeof i=="boolean")return i?1:0;if(_e(i))return 0;if(typeof i=="string"&&i.trim()!==""&&Number.isFinite(Number(i)))return Number(i);throw new Y("#VALUE!")}var Xe=i=>_e(i)?"":typeof i=="boolean"?i?"TRUE":"FALSE":String(i);function fr(i,e){let t=Math.trunc(e),n=+`${Math.round(+`${Math.abs(i)}e${t}`)}e${-t}`;return i<0?-n:n}var Hn={ROUND:i=>fr(X(i[0]),i.length>1?X(i[1]):0),ABS:i=>Math.abs(X(i[0])),MIN:i=>i.length?Math.min(...i.map(X)):0,MAX:i=>i.length?Math.max(...i.map(X)):0,SUM:i=>i.reduce((e,t)=>e+X(t),0),AVG:i=>{if(!i.length)throw new Y("#DIV/0!");return i.reduce((e,t)=>e+X(t),0)/i.length}};function pr(i,e){return(typeof i=="number"||_e(i))&&(typeof e=="number"||_e(e))?X(i)-X(e):Xe(i).localeCompare(Xe(e),void 0,{sensitivity:"accent"})}var At=class{constructor(e,t){this.tokens=e;this.resolve=t;this.i=0}parse(){let e=this.comparison();if(this.i<this.tokens.length)throw new Y("#ERROR!");return e}peek(e){let t=this.tokens[this.i];return!!t&&t.t==="op"&&(e===void 0||t.v===e)}take(e){return this.peek(e)?(this.i++,!0):!1}comparison(){let e=this.concat();for(let t of["=","<>","<=",">=","<",">"])if(this.take(t)){let n=pr(e,this.concat());return t==="="?n===0:t==="<>"?n!==0:t==="<"?n<0:t===">"?n>0:t==="<="?n<=0:n>=0}return e}concat(){let e=this.additive();for(;this.take("&");)e=Xe(e)+Xe(this.additive());return e}additive(){let e=this.multiplicative();for(;;)if(this.take("+"))e=X(e)+X(this.multiplicative());else if(this.take("-"))e=X(e)-X(this.multiplicative());else return e}multiplicative(){let e=this.unary();for(;;)if(this.take("*"))e=X(e)*X(this.unary());else if(this.take("/")||this.take("%")){let t=this.tokens[this.i-1].v,n=X(this.unary());if(n===0)throw new Y("#DIV/0!");e=t==="/"?X(e)/n:X(e)%n}else return e}unary(){return this.take("-")?-X(this.unary()):this.take("+")?X(this.unary()):this.power()}power(){let e=this.primary();return this.take("^")?X(e)**X(this.unary()):e}primary(){let e=this.tokens[this.i++];if(!e)throw new Y("#ERROR!");if(e.t==="num"||e.t==="str")return e.v;if(e.t==="op"){if(e.v!=="(")throw new Y("#ERROR!");let n=this.comparison();if(!this.take(")"))throw new Y("#ERROR!");return n}let t=e.v;if(this.peek("(")){this.i++;let n=[];if(!this.take(")")){do n.push(this.comparison());while(this.take(","));if(!this.take(")"))throw new Y("#ERROR!")}let o=t.toUpperCase();if(o==="IF"){if(n.length<2)throw new Y("#ERROR!");return(typeof n[0]=="boolean"?n[0]:X(n[0])!==0)?n[1]:n.length>2?n[2]:!1}let r=Object.hasOwn(Hn,o)?Hn[o]:void 0;if(!r)throw new Y("#NAME?");return r(n)}return/^(true|false)$/i.test(t)?t.toLowerCase()==="true":this.resolve(t)}},gr=32;function $t(i,e,t=new Set,n=0){try{let o=s=>{if(!e||!Object.hasOwn(e,s))throw new Y("#REF!");let a=e[s];if(typeof a=="string"&&a.startsWith("=")){if(t.has(s)||n>=gr)throw new Y("#CYCLE!");let l=$t(a,e,new Set([...t,s]),n+1);if(typeof l=="string"&&/^#[A-Z/0]+[!?]$/.test(l))throw new Y(l);return l}return a},r=new At(hr(i.slice(1)),o).parse();return typeof r=="number"&&!Number.isFinite(r)?"#NUM!":r}catch(o){return o instanceof Y?o.code:"#ERROR!"}}var Ce=i=>typeof i=="string"&&i.length>1&&i.startsWith("=");function B(i,e){var n;if(i.valueGetter)try{return i.valueGetter(e)}catch{H(`valueGetter of column "${(n=i.id)!=null?n:i.field}" threw; rendering an empty cell`);return}if(i.field==null)return;let t=e[i.field];return i.formulas&&Ce(t)?$t(t,e,new Set([i.field])):t}var Ye=["left","center","right"],Bn=[[">=","gte"],["<=","lte"],["<>","ne"],["!=","ne"],[">","gt"],["<","lt"],["=","eq"]],zn=[[">","after"],["<","before"],["=","equals"]],mr=/^(.+?)\s*(?:~|\.\.)\s*(.+)$/,Ft=i=>{let e=Number(i.replace(/[,\s₩$€¥]/g,""));return i.trim()!==""&&Number.isFinite(e)?e:null},Nt=i=>{let e=/^(\d{4})[-./]\s*(\d{1,2})[-./]\s*(\d{1,2})\.?$/.exec(i.trim());return e?`${e[1]}-${e[2].padStart(2,"0")}-${e[3].padStart(2,"0")}`:null};function vr(i,e){let t=e.trim();if(!t)return null;if(i==="text")return{type:"text",op:"contains",value:t};let n=mr.exec(t);if(i==="number"){if(n){let l=Ft(n[1]),d=Ft(n[2]);return l===null||d===null?void 0:{type:"number",op:"between",value:Math.min(l,d),valueTo:Math.max(l,d)}}let s=Bn.find(([l])=>t.startsWith(l)),a=Ft(s?t.slice(s[0].length):t);return a===null?void 0:{type:"number",op:s?s[1]:"eq",value:a}}if(n){let s=Nt(n[1]),a=Nt(n[2]);return!s||!a?void 0:{type:"date",op:"between",value:s<a?s:a,valueTo:s<a?a:s}}let o=zn.find(([s])=>t.startsWith(s)),r=Nt(o?t.slice(o[0].length):t);return r?{type:"date",op:o?o[1]:"equals",value:r}:void 0}function wr(i){var e,t,n;if(!i)return"";if(i.type==="text")return i.op==="contains"&&(e=i.value)!=null?e:"";if(i.type==="number"){if(i.op==="between")return`${i.value}~${i.valueTo}`;let o=(t=Bn.find(([,r])=>r===i.op))==null?void 0:t[0];return o&&i.value!==void 0?`${o==="="?"":o}${i.value}`:""}if(i.type==="date"){if(i.op==="between")return`${i.value}~${i.valueTo}`;let o=(n=zn.find(([,r])=>r===i.op))==null?void 0:n[0];return o&&i.value?`${o==="="?"":o}${i.value}`:""}return""}var Ze=class{constructor(e,t){this.grid=e;this.layout="";this.timers=new Map;this.data=null;this.synced=null;this.rebuilt=!1;this.inners={};for(let n of Ye)this.inners[n]=C("div","fg-filter-row",{role:"row"}),t[n].append(this.inners[n])}get height(){return Math.round(this.grid.renderer.opts.rowHeight*.95)}render(){let{columns:e,store:t}=this.grid,n=this.height,o=e.displayed();t.state.data!==this.data&&(this.data=t.state.data,this.layout="");let r=`${n}|${t.state.locale.code}|${o.map(s=>`${s.id}:${s.left}:${s.width}:${s.region}`).join(",")}`;if(r!==this.layout){this.layout=r;for(let s of Ye){let a=this.inners[s];a.style.width=`${e.regionWidth(s)}px`,a.style.height=`${n}px`,a.replaceChildren(...e.region(s).map(l=>this.cell(l,n)))}this.rebuilt=!0}this.sync()}sync(){let e=this.grid.store.state.filters;if(!(e===this.synced&&!this.rebuilt)){this.synced=e,this.rebuilt=!1;for(let t of Ye)for(let n of this.inners[t].querySelectorAll("[data-col]")){let o=n.dataset.col,r=e[o];if(n.closest(".fg-filter-cell").classList.toggle("fg-filter-active",!!r),!(n===n.ownerDocument.activeElement||n.getRootNode().activeElement===n)){if(n instanceof HTMLSelectElement){let s=(r==null?void 0:r.type)==="set"&&r.values.length===1?JSON.stringify(r.values[0]):"";[...n.options].some(a=>a.value===s)&&(n.value=s)}else n.value=wr(r);n.classList.remove("fg-filter-bad")}}}}cell(e,t){var d,c;let n=C("div","fg-filter-cell");n.style.left=`${e.left}px`,n.style.width=`${e.width}px`,n.style.height=`${t}px`;let o=A(e.id)?null:re(e.def);if(!o)return n;let r=this.grid.store.state.locale,s=`${r.filter}: ${(c=(d=e.def.header)!=null?d:e.def.field)!=null?c:e.id}`;if(o==="set"){let u=C("select","fg-filter-input",{"aria-label":s});u.dataset.col=e.id;let h=C("option","",{value:""});h.textContent=r.selectAll,u.append(h);for(let f of this.distinct(e.def)){let g=C("option","",{value:JSON.stringify(f)});g.textContent=f===!0?"\u2713":f===!1?"\u2717":String(f),u.append(g)}return u.addEventListener("change",()=>{this.grid.setFilter(e.id,u.value?{type:"set",values:[JSON.parse(u.value)]}:null)}),n.append(u),n}let a=C("input","fg-filter-input",{type:"text","aria-label":s,spellcheck:"false",autocomplete:"off"});a.dataset.col=e.id,o==="number"&&(a.placeholder=">0, 10~20"),o==="date"&&(a.placeholder=">2026-01-01");let l=()=>{let u=vr(o,a.value);a.classList.toggle("fg-filter-bad",u===void 0),u!==void 0&&this.grid.setFilter(e.id,u)};return a.addEventListener("input",()=>{clearTimeout(this.timers.get(e.id)),this.timers.set(e.id,window.setTimeout(l,200))}),a.addEventListener("keydown",u=>{u.stopPropagation(),u.key==="Enter"?(clearTimeout(this.timers.get(e.id)),l()):u.key==="Escape"&&(a.value="",clearTimeout(this.timers.get(e.id)),l())}),n.append(a),n}distinct(e){let t=new Map;for(let n of this.grid.store.state.data){let o=B(e,n);if(o==null||o==="")continue;let r=JSON.stringify(o);if(t.has(r)||t.set(r,o),t.size>=200)break}return[...t.values()].sort((n,o)=>String(n).localeCompare(String(o)))}setTransform(e){this.inners.center.style.transform=`translateX(${-e}px)`}destroy(){for(let e of this.timers.values())clearTimeout(e);for(let e of Ye)this.inners[e].remove()}};function G(i){return i==null||typeof i=="string"&&i.trim()===""||typeof i=="number"&&Number.isNaN(i)}var Gn=i=>String(i).padStart(2,"0");function ee(i){if(G(i))return null;if(typeof i=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(i))return i;let e=i instanceof Date?i:new Date(i);return Number.isNaN(e.getTime())?null:`${e.getFullYear()}-${Gn(e.getMonth()+1)}-${Gn(e.getDate())}`}function J(i){var e;return G(i)?"":i instanceof Date?(e=ee(i))!=null?e:"":String(i)}var le=()=>!0;function Je(i){var e;switch(i.type){case"combined":{let t=(Array.isArray(i.conditions)?i.conditions:[]).map(Je);return t.length?i.operator==="or"?n=>t.some(o=>o(n)):n=>t.every(o=>o(n)):le}case"text":{let t=((e=i.value)!=null?e:"").toLowerCase(),n=o=>G(o)?"":String(o).toLowerCase();switch(i.op){case"contains":return o=>n(o).includes(t);case"equals":return o=>n(o)===t;case"notEquals":return o=>n(o)!==t;case"startsWith":return o=>n(o).startsWith(t);case"endsWith":return o=>n(o).endsWith(t);case"blank":return G;case"notBlank":return o=>!G(o)}return le}case"number":{let t=o=>G(o)?NaN:Number(o);if(i.op==="blank")return o=>Number.isNaN(t(o));if(i.op==="notBlank")return o=>!Number.isNaN(t(o));let n=i.value;if(n==null||Number.isNaN(n))return le;switch(i.op){case"eq":return o=>t(o)===n;case"ne":return o=>t(o)!==n;case"lt":return o=>t(o)<n;case"lte":return o=>t(o)<=n;case"gt":return o=>t(o)>n;case"gte":return o=>t(o)>=n;case"between":{let o=i.valueTo;if(o==null||Number.isNaN(o))return le;let r=Math.min(n,o),s=Math.max(n,o);return a=>{let l=t(a);return l>=r&&l<=s}}}return le}case"date":{if(i.op==="blank")return o=>ee(o)===null;if(i.op==="notBlank")return o=>ee(o)!==null;let t=i.value;if(!t)return le;let n=o=>ee(o);switch(i.op){case"equals":return o=>n(o)===t;case"before":return o=>{let r=n(o);return r!==null&&r<t};case"after":return o=>{let r=n(o);return r!==null&&r>t};case"between":{let o=i.valueTo;if(!o)return le;let r=t<o?t:o,s=t<o?o:t;return a=>{let l=n(a);return l!==null&&l>=r&&l<=s}}}return le}case"set":{let t=new Set(i.values.map(J));return n=>t.has(J(n))}}return le}function Vn(i){let e=i.trim().toLowerCase();return e?e.split(/\s+/):[]}function qn(i,e){return i.every(t=>e.includes(t))}function Ot(i,e,t){let n=[];for(let o of Array.isArray(i==null?void 0:i.conditions)?i.conditions:[]){if(!o||typeof o!="object")continue;if("conditions"in o){let a=Ot(o,e,t);a&&n.push(a);continue}let r=e(o.colId);if(!r||!o.model)continue;let s=Je(o.model);n.push(a=>s(t(r,a)))}return n.length?i.operator==="or"?o=>n.some(r=>r(o)):o=>n.every(r=>r(o)):null}var Wn=new Map;function yr(i){var o;if(i==="integer")return{maximumFractionDigits:0};if(i==="percent")return{style:"percent"};if(i.startsWith("currency:"))return{style:"currency",currency:i.slice(9)};if(!/^[#0,]*(\.[#0]+)?%?$/.test(i)||!/[#0]/.test(i))return null;let e=i.endsWith("%"),t=e?i.slice(0,-1):i,n=t.includes(".")?t.split(".")[1]:"";return{useGrouping:t.includes(","),minimumFractionDigits:((o=n.match(/0/g))!=null?o:[]).length,maximumFractionDigits:n.length,...e?{style:"percent"}:{}}}var Qe={date:{year:"numeric",month:"2-digit",day:"2-digit"},datetime:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"},time:{hour:"2-digit",minute:"2-digit"},short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"}};function se(i){if(G(i))return null;if(i instanceof Date)return Number.isNaN(i.getTime())?null:i;if(typeof i=="string"){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(i);if(t)return new Date(Number(t[1]),Number(t[2])-1,Number(t[3]))}if(typeof i!="string"&&typeof i!="number")return null;let e=new Date(i);return Number.isNaN(e.getTime())?null:e}function br(i,e,t){var n;switch(i){case"number":{let o={};if(typeof e=="string"){let s=yr(e);s||H(`unknown number format "${e}"`),o=s!=null?s:{}}else e&&(o=e);let r=new Intl.NumberFormat(t,o);return s=>{if(G(s))return"";let a=typeof s=="number"?s:Number(s);return Number.isNaN(a)?String(s):r.format(a)}}case"date":{if(t.toLowerCase().startsWith("ko")&&(e===void 0||e==="date"||e==="datetime")){let s=l=>String(l).padStart(2,"0"),a=e==="datetime";return l=>{let d=se(l);if(!d)return G(l)?"":String(l);let c=`${d.getFullYear()}-${s(d.getMonth()+1)}-${s(d.getDate())}`;return a?`${c} ${s(d.getHours())}:${s(d.getMinutes())}`:c}}let o=Qe.date;typeof e=="string"?(Qe[e]||H(`unknown date format "${e}"`),o=(n=Qe[e])!=null?n:Qe.date):e&&(o=e);let r=new Intl.DateTimeFormat(t,o);return s=>{let a=se(s);return a?r.format(a):G(s)?"":String(s)}}case"boolean":return o=>o===!0?"\u2713":o===!1?"\u2717":"";default:return o=>G(o)?"":o instanceof Date?o.toISOString():String(o)}}function _(i,e){var r;if(i.sparkline)return s=>Array.isArray(s)?s.join(", "):s==null?"":String(s);let t=i.format,n=`${e}|${(r=i.type)!=null?r:"text"}|${typeof t=="string"?t:JSON.stringify(t!=null?t:null)}`,o=Wn.get(n);return o||(o=br(i.type,t,e),Wn.set(n,o)),o}function Ht(i){let e=[];for(let t of i){if(G(t)||t instanceof Date)continue;let n=typeof t=="number"?t:Number(t);Number.isNaN(n)||e.push(n)}return e}function Kn(i,e){let t=i.filter(o=>o instanceof Date&&!Number.isNaN(o.getTime()));if(t.length)return t.reduce((o,r)=>(e?r>o:r<o)?r:o);let n=Ht(i);return n.length?e?Math.max(...n):Math.min(...n):null}function Re(i,e,t){if(typeof i=="function")return i(e,t);switch(i){case"sum":return Ht(e).reduce((n,o)=>n+o,0);case"avg":{let n=Ht(e);return n.length?n.reduce((o,r)=>o+r,0)/n.length:null}case"min":return Kn(e,!1);case"max":return Kn(e,!0);case"count":return t.length}return null}function Bt(i){return typeof i=="object"&&i!==null&&"agg"in i?i:{agg:i}}function Un(i,e,t){let n=new Map,o=(r,s)=>{let a=n.get(r);return a||n.set(r,a=e.map(l=>B(s,l))),a};return i.map(r=>{var a;let s={};for(let[l,d]of Object.entries((a=r.columns)!=null?a:{})){let c=t(l);c&&(s[l]=Re(Bt(d).agg,o(l,c),e))}return s})}function Ie(i,e,t,n,o){if(!i)return 1;let r=1;try{r=Math.floor(Number(i({value:B(e,t),row:t,rowIndex:n})))}catch{r=1}return Number.isFinite(r)?Math.max(1,Math.min(o,r)):1}function et(i,e){let t=i.length,n=new Int32Array(t),o=new Int32Array(t);if(e.rowSpan){for(let a=0;a<t;){let l=Ie(e.rowSpan,e,i[a],a,t-a);for(let d=a;d<a+l;d++)n[d]=a,o[d]=a+l-1;a+=l}return{start:n,end:o}}let r=typeof e.merge=="function"?(a,l)=>{try{return!!e.merge(B(e,i[a]),B(e,i[l]),i[a],i[l])}catch{return!1}}:(()=>{let a=i.map(l=>{let d=B(e,l);return G(d)?null:J(d)});return(l,d)=>a[l]!==null&&a[l]===a[d]})(),s=0;for(let a=1;a<=t;a++)if(!(a<t&&r(a-1,a))){for(let l=s;l<a;l++)n[l]=s,o[l]=a-1;s=a}return{start:n,end:o}}function jn(i,e,t,n,o=4){if(n<=0||t<=0)return{first:0,last:-1};let r=Math.max(0,Math.floor(i/t)-o),s=Math.floor((i+e)/t);return{first:Math.min(r,n-1),last:Math.min(n-1,s+o)}}function tt(i,e,t,n,o=2){let r=i.length;if(!r)return{first:0,last:-1};let s=0,a=r-1;for(;s<a;){let c=s+a>>1;i[c]+e[c]<=t?s=c+1:a=c}let l=s,d=t+n;for(a=r-1;s<a;){let c=s+a+1>>1;i[c]<d?s=c:a=c-1}return{first:Math.max(0,l-o),last:Math.min(r-1,Math.max(l,s)+o)}}function _n(i,e,t,n,o=4){if(n<=0)return{first:0,last:-1};let r=0,s=n-1;for(;r<s;){let d=r+s>>1;i[d+1]<=e?r=d+1:s=d}let a=r,l=e+t;for(s=n-1;r<s;){let d=r+s+1>>1;i[d]<l?r=d:s=d-1}return{first:Math.max(0,a-o),last:Math.min(n-1,r+o)}}var te=["left","center","right"],Xn=6,xr=8,zt=2,Cr='<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M3 4h10M3 8h10M3 12h10" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>',Gt='<svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>';var Rr='<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M2.5 3h11l-4.2 5v4.5l-2.6 1.2V8z" fill="currentColor"/></svg>';function C(i,e="",t={}){let n=document.createElement(i);e&&(n.className=e);for(let[o,r]of Object.entries(t))n.setAttribute(o,r);return n}var nt=class{constructor(e,t,n){this.grid=t;this.opts=n;this.filterRow=null;this.activeCellId="";this.idBase=`fg${Math.random().toString(36).slice(2,8)}`;this.painted={left:new Map,center:new Map,right:new Map};this.pool={left:[],center:[],right:[]};this.frame=0;this.headerDirty=!0;this.version=0;this.lastRange={first:0,last:-1};this.summaryEl=null;this.summaryPanes=null;this.summaryInners=null;this.canvasSummary={left:[],center:[],right:[]};this.topOffset=0;this.pinnedTop=null;this.pinnedBottom=null;this.statusEl=null;this.statusKey="";this.pagerEl=null;this.cards=null;this.cardMode=!1;this.pagerKey="";this.offsets=null;this.details=new Map;this.firstDataId="";this.rowHeights=new Map;this.heightsVersion=0;this.groupLabelId="";this.onScroll=()=>{this.frame&&cancelAnimationFrame(this.frame),this.frame=0,this.render(),this.grid.events.emit("scroll",this.getScroll())};this.onSideWheel=e=>{e.deltaY&&(e.preventDefault(),this.scroller.scrollTop+=e.deltaY)};this.overlayKey="";this.heightFn=null;this.onCardClick=e=>{var l;let t=e.target,n=t.closest(".fg-card");if(!n)return;let o=Number(n.dataset.row),r=this.grid.rowModel.getRow(o);if(!r||r.kind)return;if(t.closest(".fg-card-check")){this.grid.selectFromClick(o,!0,!1),this.invalidate({rows:!0});return}let s=(l=t.closest(".fg-card-value"))==null?void 0:l.dataset.col,a=s?this.grid.columns.getColumn(s):void 0;a&&this.grid.events.emit("cellClick",{row:r.data,rowIndex:o,colId:a.id,value:B(a.def,r.data),event:e})};this.root=C("div","",{tabindex:"-1"}),this.root.addEventListener("focus",()=>this.gridEl.focus({preventScroll:!0})),this.gridEl=C("div","fg-grid",{role:"grid",tabindex:"0"}),this.headerEl=C("div","fg-header",{role:"rowgroup"}),this.bodyEl=C("div","fg-body",{role:"rowgroup"});let o=r=>({left:C("div",`${r} ${r}-left`),center:C("div",`${r} ${r}-center`),right:C("div",`${r} ${r}-right`)});this.headerPanes=o("fg-header-pane"),this.headerInners=o("fg-header-inner");for(let r of te)this.headerInners[r].setAttribute("role","row");this.bodyPanes=o("fg-body-pane"),this.canvases=o("fg-canvas");for(let r of te)this.headerPanes[r].dataset.region=r,this.bodyPanes[r].dataset.region=r,this.headerPanes[r].append(this.headerInners[r]),this.bodyPanes[r].append(this.canvases[r]),this.headerEl.append(this.headerPanes[r]),this.bodyEl.append(this.bodyPanes[r]);this.scroller=this.bodyPanes.center,t.options.filterRow&&(this.filterRow=new Ze(t,this.headerPanes)),this.overlay=C("div","fg-overlay",{"aria-live":"polite"}),this.main=C("div","fg-main"),this.gridEl.append(this.headerEl,this.bodyEl),this.main.append(this.gridEl,this.overlay),this.root.append(this.main),e.append(this.root),this.applyTheme(),this.scroller.addEventListener("scroll",this.onScroll,{passive:!0}),this.bodyPanes.left.addEventListener("wheel",this.onSideWheel,{passive:!1}),this.bodyPanes.right.addEventListener("wheel",this.onSideWheel,{passive:!1})}get activeScroller(){var e,t;return(t=(e=this.cards)==null?void 0:e.scroller)!=null?t:this.scroller}getScroll(){let e=this.activeScroller;return{top:e.scrollTop,left:e.scrollLeft}}setScroll(e){let t=this.activeScroller;typeof(e==null?void 0:e.top)=="number"&&Number.isFinite(e.top)&&(t.scrollTop=Math.max(0,e.top)),typeof(e==null?void 0:e.left)=="number"&&Number.isFinite(e.left)&&(t.scrollLeft=Math.max(0,e.left))}applyFont(e,t){e?this.root.style.setProperty("--fg-font-size",`${e}px`):this.root.style.removeProperty("--fg-font-size"),t?this.root.style.setProperty("--fg-font",t):this.root.style.removeProperty("--fg-font")}applyTheme(){let e=this.grid.options.direction==="rtl";this.root.className=`fg-root fg-theme-${this.grid.store.state.theme}${e?" fg-rtl":""}${this.cardMode?" fg-card-mode":""}${this.grid.density!=="normal"?` fg-density-${this.grid.density}`:""}`,this.root.setAttribute("dir",e?"rtl":"ltr")}get rtl(){return this.grid.options.direction==="rtl"}invalidate(e={}){e.header&&(this.headerDirty=!0),e.rows&&this.version++,this.schedule()}schedule(){this.frame||(this.frame=requestAnimationFrame(()=>{this.frame=0,this.render()}))}render(){var R,k,L,I,b,M,S,E,T,D;let{columns:e,rowModel:t,store:n,options:o}=this.grid,{rowHeight:r,headerHeight:s}=this.opts,a=this.scroller.offsetWidth-this.scroller.clientWidth;e.setContainerWidth(Math.max(0,this.main.clientWidth-a))&&(this.headerDirty=!0,this.version++);let l=t.getRowCount(),d=!!this.grid.options.autoRowHeight&&!t.server,c=t.layout(r,this.detailHeight(),d?this.rowHeights:void 0,this.heightsVersion,t.server?void 0:this.heightOf);if(this.offsets=c.uniform?null:c.offsets,this.firstDataId=(k=(R=e.displayed().find(P=>!A(P.id)))==null?void 0:R.id)!=null?k:"",this.groupLabelId=(I=(L=e.region("center").find(P=>!A(P.id)))==null?void 0:L.id)!=null?I:this.firstDataId,this.useCards()){this.renderCards(l),this.renderStatusBar(t.dataCount()),this.renderPager(),this.orderSections(null),this.paintOverlay(l);return}let u=this.grid.summary(),h=u?u.opts.rows.length:0,f=(b=u==null?void 0:u.opts.position)!=null?b:"bottom",g=u?u.opts.pinned!==!1:!1;this.topOffset=u&&!g&&f==="top"?h*r:0;let x=u&&!g&&f==="bottom"?h*r:0;this.syncSummaryPane(u&&g?f:null,h*r);let y=e.depth*s+((S=(M=this.filterRow)==null?void 0:M.height)!=null?S:0);this.headerEl.style.height=`${y}px`;for(let P of te){let N=e.regionWidth(P);P!=="center"&&(this.headerPanes[P].style.width=this.bodyPanes[P].style.width=`${N}px`,this.headerPanes[P].hidden=this.bodyPanes[P].hidden=N===0),this.canvases[P].style.width=`${N}px`,this.canvases[P].style.height=`${this.rowsHeight(l)+this.topOffset+x}px`}o.autoHeight&&!this.useCards()&&(this.root.classList.add("fg-auto-height"),this.bodyEl.style.height=`${this.rowsHeight(l)+this.topOffset+x+Math.max(0,this.scroller.offsetHeight-this.scroller.clientHeight)}px`);let p=this.scroller.offsetHeight-this.scroller.clientHeight;this.bodyPanes.left.style.marginBottom=this.bodyPanes.right.style.marginBottom=`${p}px`;let v=this.gridEl;v.setAttribute("role",o.treeData||this.grid.getGroupBy().length?"treegrid":"grid"),v.setAttribute("aria-rowcount",String(l+e.depth+(this.filterRow?1:0))),v.setAttribute("aria-colcount",String(e.displayed().length)),o.rowSelection==="multiple"&&v.setAttribute("aria-multiselectable","true"),this.headerDirty&&(this.headerDirty=!1,this.renderHeader()),(E=this.filterRow)==null||E.render(),this.renderRows(l),this.updateActiveCell(),d&&this.measureRows(),this.renderSummary(l,u&&u.opts.rows,(T=u==null?void 0:u.values)!=null?T:[],g,f),this.pinnedTop=this.renderPinned(this.pinnedTop,"top",this.grid.pinnedRows.top),this.pinnedBottom=this.renderPinned(this.pinnedBottom,"bottom",this.grid.pinnedRows.bottom),this.renderStatusBar(t.dataCount()),this.renderPager(),this.orderSections(u&&g?f:null),this.paintOverlay(l),this.overlay.style.top=`${y}px`;let{scrollTop:m,scrollLeft:w}=this.scroller;this.bodyPanes.left.scrollTop=this.bodyPanes.right.scrollTop=m,this.headerInners.center.style.transform=`translateX(${-w}px)`,(D=this.filterRow)==null||D.setTransform(w),this.summaryInners&&(this.summaryInners.center.style.transform=`translateX(${-w}px)`);for(let P of[this.pinnedTop,this.pinnedBottom])P&&(P.inners.center.style.transform=`translateX(${-w}px)`);this.grid.fillHandle.update()}orderSections(e){var s,a,l,d;let t=[e==="top"?this.summaryEl:null,(a=(s=this.pinnedTop)==null?void 0:s.el)!=null?a:null].filter(c=>!!c),n=[(d=(l=this.pinnedBottom)==null?void 0:l.el)!=null?d:null,e==="bottom"?this.summaryEl:null].filter(c=>!!c),o=[this.statusEl,this.pagerEl].filter(c=>!!c);for(let c of t)c.nextElementSibling!==this.bodyEl&&!t.includes(c.nextElementSibling)&&this.gridEl.insertBefore(c,this.bodyEl);let r=this.bodyEl;for(let c=t.length-1;c>=0;c--)r.previousElementSibling!==t[c]&&this.gridEl.insertBefore(t[c],r),r=t[c];r=this.bodyEl;for(let c of n)r.nextElementSibling!==c&&r.after(c),r=c;r=this.gridEl;for(let c of o)r.nextElementSibling!==c&&r.after(c),r=c}paintOverlay(e){var c;let{grid:t}=this,{store:n,rowModel:o,options:r}=t,s=(c=t.forcedOverlay)!=null?c:e>0?null:o.loading()?"loading":"noRows";if(this.overlay.hidden=!s,!s){this.overlayKey="";return}let a=!o.server&&n.state.data.length>0,l=s==="loading"?r.loadingOverlay:r.noRowsOverlay,d=`${s}|${a}|${n.state.locale.code}`;if(d!==this.overlayKey)if(this.overlayKey=d,this.overlay.classList.toggle("fg-overlay-custom",typeof l=="function"),l==null)this.overlay.textContent=s==="loading"?n.state.locale.loading:n.state.locale.noRows;else if(typeof l=="string")this.overlay.textContent=l;else try{let u=l({filtered:a});typeof u=="string"?this.overlay.textContent=u:this.overlay.replaceChildren(u)}catch{H(`${s==="loading"?"loadingOverlay":"noRowsOverlay"} threw`),this.overlay.textContent=s==="loading"?n.state.locale.loading:n.state.locale.noRows}}updateActiveCell(){var n,o,r;let e=this.activeCellId&&(r=(o=(n=this.root.getRootNode()).getElementById)==null?void 0:o.call(n,this.activeCellId))!=null?r:null,t=this.gridEl.querySelector(".fg-body .fg-cell-focused, .fg-body .fg-row-group .fg-cell-focused");if(e&&e!==t&&e.removeAttribute("id"),!t){this.gridEl.removeAttribute("aria-activedescendant"),this.activeCellId="";return}t.id||(t.id=`${this.idBase}-cell`),this.activeCellId=t.id,this.gridEl.setAttribute("aria-activedescendant",t.id)}renderPinned(e,t,n){if(!n.length)return e==null||e.el.remove(),null;let o=e!=null?e:new Vt(`fg-pinned-rows fg-pinned-${t}`),{columns:r}=this.grid,s=this.opts.rowHeight;o.size(r,n.length*s,this.scroller.offsetWidth-this.scroller.clientWidth);let a=r.region("center"),l=tt(a.map(d=>d.left),a.map(d=>d.width),this.scroller.scrollLeft,this.scroller.clientWidth,zt);for(let d of te){let c=d==="center"?a.slice(l.first,l.last+1):r.region(d);o.inners[d].replaceChildren(...n.map((u,h)=>{let f=C("div","fg-row fg-row-pinned",{role:"row"});f.style.transform=`translateY(${h*s}px)`,f.style.height=`${s}px`;let g={id:`pinned-${t}-${h}`,data:u,sourceIndex:-1};for(let x of c){let y=C("div","fg-cell",{role:"gridcell"});A(x.id)?(y.style.left=`${x.left}px`,y.style.width=`${x.width}px`):this.paintCell(y,g,-1,x,!1,!1),f.append(y)}return f}))}return o}renderStatusBar(e){var u,h;if(!this.grid.options.statusBar){(u=this.statusEl)==null||u.remove(),this.statusEl=null;return}let{grid:t}=this,n=t.store.state,o=t.rowModel.server?e:t.viewRows().length,r=`${this.version}|${e}|${o}|${n.selected.size}|${JSON.stringify(n.range)}|${n.locale.code}`;if(this.statusEl&&r===this.statusKey)return;this.statusKey=r,(h=this.statusEl)!=null||(this.statusEl=C("div","fg-statusbar",{role:"status","aria-live":"polite"}));let s=n.locale,a=new Intl.NumberFormat(s.code,{maximumFractionDigits:2}),l=C("span","fg-status-rows");l.textContent=(e===o?s.statusRows.replace("{n}",a.format(o)):s.statusFiltered.replace("{shown}",a.format(e)).replace("{total}",a.format(o)))+(n.selected.size?` \xB7 ${s.statusSelected.replace("{n}",a.format(n.selected.size))}`:"");let d=C("span","fg-status-aggs"),c=t.rangeAggregates();if(c&&c.cells>1){let f=[`${s.count} ${a.format(c.count)}`];c.numbers&&f.push(`${s.sum} ${a.format(c.sum)}`,`${s.avg} ${a.format(c.sum/c.numbers)}`,`${s.min} ${a.format(c.min)}`,`${s.max} ${a.format(c.max)}`),d.textContent=f.join(" ")}this.statusEl.replaceChildren(l,d)}renderHeader(){let{columns:e,store:t}=this.grid,{sort:n,filters:o,locale:r}=t.state;for(let s of te){let a=this.headerInners[s];a.style.width=`${e.regionWidth(s)}px`,a.style.height=`${e.depth*this.opts.headerHeight}px`,a.replaceChildren(...e.headerCells(s).map(l=>this.headerCell(l,n,o,r)))}}headerCell(e,t,n,o){var h,f;let r=this.opts.headerHeight,s=C("div",e.isGroup?"fg-header-cell fg-header-group":"fg-header-cell",{role:"columnheader"});if(s.dataset.col=e.id,s.style.left=`${e.left}px`,s.style.top=`${e.row*r}px`,s.style.width=`${e.width}px`,s.style.height=`${e.rowSpan*r}px`,A(e.id))return e.id===he&&(s.classList.add("fg-header-rownum"),s.textContent=e.label),e.id===ne&&(s.classList.add("fg-header-select"),s.append(this.selectAllBox(o))),s;let a=C("span","fg-header-label"),l=e.node.def;if(a.textContent=e.label,l.headerRenderer)try{let g=l.headerRenderer({header:e.label,column:l});typeof g=="string"?a.innerHTML=g:a.replaceChildren(g)}catch{H(`headerRenderer of column "${e.id}" threw; showing the plain header`),a.textContent=e.label}let d=null;if(e.isGroup&&this.grid.columns.isCollapsible(e.node)){let g=e.node.open,x=C("button",g?"fg-colgroup-toggle fg-expanded":"fg-colgroup-toggle",{type:"button",tabindex:"-1","aria-expanded":String(g),"aria-label":g?o.collapseAll:o.expandAll});x.textContent=g?"\u2212":"+",x.addEventListener("click",y=>{y.stopPropagation(),this.grid.setColumnGroupOpened(e.id,!g)}),s.classList.add("fg-header-collapsible"),d=x}if(l.headerClass)try{let g=typeof l.headerClass=="function"?l.headerClass(l):l.headerClass;g&&s.classList.add(...g.split(/\s+/).filter(Boolean))}catch{H(`headerClass of column "${e.id}" threw`)}if(s.append(a),d&&s.append(d),e.isGroup||!e.column)return s;let c=e.node.def;((h=c.wrapHeaderText)!=null?h:this.grid.options.wrapHeaderText)&&s.classList.add("fg-header-wrap"),s.setAttribute("aria-colindex",String(e.column.index+1)),((f=c.align)!=null?f:c.type==="number"?"right":"left")==="right"&&s.classList.add("fg-align-right");let u=t.findIndex(g=>g.colId===e.id);if(s.setAttribute("aria-sort",u<0?"none":t[u].dir==="asc"?"ascending":"descending"),ve(c)&&s.classList.add("fg-sortable"),u>=0){let g=C("span","fg-sort-icon");if(g.textContent=t[u].dir==="asc"?"\u2191":"\u2193",t.length>1){let x=C("sup");x.textContent=String(u+1),g.append(x)}s.append(g)}if(ve(c)||re(c)){let g=!!n[e.id],x=C("button",g?"fg-menu-btn fg-filter-active":"fg-menu-btn",{type:"button",tabindex:"-1","aria-label":o.columnMenu});x.innerHTML=g?Rr:Cr,s.append(x)}return je(c)&&s.append(C("div","fg-resize",{"aria-hidden":"true"})),s}selectAllBox(e){let t=this.grid.selectableRows(),n=this.grid.store.state.selected,o=0;for(let s of t)n.has(s.id)&&o++;let r=C("input","fg-checkbox fg-select-all",{type:"checkbox",tabindex:"-1","aria-label":e.selectAllRows});return r.checked=t.length>0&&o===t.length,r.indeterminate=o>0&&o<t.length,r.hidden=this.grid.options.rowSelection!=="multiple"||this.grid.options.headerCheckbox===!1,r}renderRows(e){var f,g,x;let{columns:t,rowModel:n,store:o}=this.grid,{selected:r,focus:s}=o.state,a=this.grid.allRangeBounds(),l=this.grid.mergeSpans(),d=Math.max(0,this.scroller.scrollTop-this.topOffset),c=this.grid.options.autoHeight&&!n.server?{first:0,last:e-1}:this.offsets?_n(this.offsets,d,this.scroller.clientHeight,e,Xn):jn(d,this.scroller.clientHeight,this.opts.rowHeight,e,Xn);this.lastRange=c;let u=t.region("center"),h=tt(u.map(y=>y.left),u.map(y=>y.width),this.scroller.scrollLeft,this.scroller.clientWidth,zt);u.some(y=>y.def.colSpan)&&(h.first=Math.max(0,h.first-xr));for(let y of te){let p=y==="center"?u.slice(h.first,h.last+1):t.region(y),v=this.painted[y];for(let[w,R]of v)w>=c.first&&w<=c.last&&p.length||(R.el.remove(),this.pool[y].push(R.el),v.delete(w));if(!p.length)continue;let m=y==="center"?`${h.first}-${h.last}`:"";for(let w=c.first;w<=c.last;w++){let R=n.getRow(w),k=r.has(R.id),L=s&&s.rowIndex===w?s.colId:"",I=a.filter(D=>w>=D.r1&&w<=D.r2),b=I.map(D=>`${D.c1}-${D.c2}`).join(","),M=this.mergeState(l,p,w,c.first),S=R.kind==="detail"?`${this.scroller.scrollLeft}:${this.scroller.clientWidth}`:"",E=`${R.id}|${this.version}|${m}|${k?1:0}${R.kind==="group"?`:${this.grid.selectionVersion}`:""}|${L}|${b}|${M}|${S}`,T=v.get(w);if(!T){let D=(f=this.pool[y].pop())!=null?f:C("div","fg-row",{role:"row"});this.canvases[y].append(D),T={el:D,key:""},v.set(w,T)}T.key!==E&&(T.key=E,T.el.dataset.kind!==((g=R.kind)!=null?g:"")&&(T.el.replaceChildren(),T.el.dataset.kind=(x=R.kind)!=null?x:""),R.kind==="group"?this.paintGroupRow(T.el,R,w,p,L):R.kind==="detail"?this.paintDetailRow(T.el,R,w,y):R.kind==="loading"?this.paintLoadingRow(T.el,w,p):this.paintRow(T.el,R,w,p,k,L,I,l,c.first))}}}mergeState(e,t,n,o){if(!e.size)return"";let r="";for(let s of t){let a=e.get(s.id);if(!a)continue;let l=a.start[n],d=a.end[n];r+=l===d?"n":n===Math.max(l,o)?`d${l}`:"h"}return r}paintRow(e,t,n,o,r,s,a,l=new Map,d=0){let c=this.opts.rowHeight;for(e.className=`fg-row${n%2?" fg-row-odd":""}${r?" fg-row-selected":""}${this.grid.tracker.created.has(t.data)?" fg-row-created":""}${this.grid.editor.editingRow(t.id)?" fg-row-editing":""}`,this.placeRow(e,n),this.grid.options.rowSelection&&e.setAttribute("aria-selected",String(r)),t.level!==void 0?e.setAttribute("aria-level",String(t.level+1)):e.removeAttribute("aria-level"),t.hasChildren?e.setAttribute("aria-expanded",String(!!t.expanded)):e.removeAttribute("aria-expanded");e.childElementCount>o.length;)e.lastElementChild.remove();for(;e.childElementCount<o.length;)e.append(C("div","fg-cell",{role:"gridcell"}));let u=!1,h=o.length?this.grid.columns.region(o[0].region):[],f=h.some(y=>y.def.colSpan),g=-1,x=f?new Map(h.map((y,p)=>[y.id,p])):null;o.forEach((y,p)=>{let v=e.children[p];if(this.paintCell(v,t,n,y,r,s===y.id),x){let w=x.get(y.id);if(w<=g)v.classList.add("fg-cell-span-hidden");else if(y.def.colSpan&&!A(y.id)){let R=Ie(y.def.colSpan,y.def,t.data,n,h.length-w);if(R>1){g=w+R-1;let k=0;for(let L=w;L<=g;L++)k+=h[L].width;v.style.width=`${k}px`,v.classList.add("fg-cell-colspan")}}}y.id===this.firstDataId&&this.decorate(v,t),v.style.top=v.style.height=v.style.bottom="";let m=l.get(y.id);m&&m.start[n]!==m.end[n]&&(n===Math.max(m.start[n],d)?(v.classList.add("fg-cell-merged"),v.style.top=`${-(this.rowTop(n)-this.rowTop(m.start[n]))}px`,v.style.height=`${this.rowTop(m.end[n])+this.rowH(m.end[n])-this.rowTop(m.start[n])}px`,v.style.bottom="auto",u=!0):v.classList.add("fg-cell-merge-hidden")),!A(y.id)&&a.some(w=>y.index>=w.c1&&y.index<=w.c2)&&v.classList.add("fg-cell-range")}),e.style.zIndex=u?"1":""}paintCell(e,t,n,o,r,s){var f;let a=this.grid.store.state.locale;e.style.left=`${o.left}px`,e.style.width=`${o.width}px`,e.dataset.col=o.id,e.setAttribute("aria-colindex",String(o.index+1));let l=s?"fg-cell fg-cell-focused":"fg-cell";if(o.id===he){e.className=`${l} fg-cell-rownum`;let g=n>=0&&!t.kind?this.grid.rowNumber(n):null;e.textContent=g===null?"":String(g);return}if(o.id===me){e.className=`${l} fg-cell-drag`;let g=C("span",this.grid.canMoveRows()?"fg-drag-handle":"fg-drag-handle fg-drag-disabled",{"aria-hidden":"true"});g.textContent="\u22EE\u22EE",e.replaceChildren(g);return}if(o.id===ne){e.className=`${l} fg-cell-select`;let g=C("input","fg-checkbox",{type:"checkbox",tabindex:"-1","aria-label":a.selectRow});g.checked=r,n>=0&&!t.kind&&!this.grid.rowSelectable(t.data)&&(g.disabled=!0,e.classList.add("fg-cell-select-locked")),e.replaceChildren(g);return}let d=o.def,c=B(d,t.data),u=_(d,a.code)(c);l+=` fg-align-${(f=d.align)!=null?f:d.type==="number"?"right":d.type==="boolean"?"center":"left"}`;let h={value:c,formatted:u,row:t.data,rowIndex:n,column:d};if(d.cellClass)try{let g=typeof d.cellClass=="function"?d.cellClass(h):d.cellClass;g&&(l+=` ${g}`)}catch{H(`cellClass of column "${o.id}" threw`)}if(this.grid.tracker.isDirty(t.data,d.field)&&(l+=" fg-cell-dirty"),d.wrapText&&(l+=" fg-cell-wrap"),typeof d.editable=="function"&&n>=0&&!ae(d,t.data,n)&&(l+=" fg-cell-readonly"),n>=0&&(l+=this.grid.finder.classFor(n,o.id)),this.grid.isFlashing(t.id,o.id)&&(l+=" fg-cell-flash"),e.className=l,d.sparkline&&!d.renderer){let g=Array.isArray(c)?c.map(Number).filter(Number.isFinite):[];g.length?e.replaceChildren(Sr(g,d.sparkline===!0?{}:d.sparkline,o.width,this.opts.rowHeight)):e.replaceChildren(),e.setAttribute("aria-label",Array.isArray(c)?c.join(", "):"");return}if(!d.renderer){e.textContent=u;return}try{let g=d.renderer(h);typeof g=="string"?e.innerHTML=g:e.replaceChildren(g)}catch{H(`renderer of column "${o.id}" threw; rendering an empty cell`),e.textContent=""}}cellAt(e){let t=e instanceof Element?e.closest(".fg-cell"):null,n=t==null?void 0:t.parentElement;return!t||!(n!=null&&n.dataset.row)||!t.dataset.col||t.closest(".fg-root")!==this.root?null:{rowIndex:Number(n.dataset.row),colId:t.dataset.col}}ensureVisible(e,t){let n=this.scroller,o=this.rowTop(e),r=o+Math.min(this.rowH(e),n.clientHeight||1/0);o<n.scrollTop?n.scrollTop=o:r>n.scrollTop+n.clientHeight&&(n.scrollTop=r-n.clientHeight);let s=t?this.grid.columns.getColumn(t):void 0;(s==null?void 0:s.region)==="center"&&(s.left<n.scrollLeft?n.scrollLeft=s.left:s.left+s.width>n.scrollLeft+n.clientWidth&&(n.scrollLeft=s.left+s.width-n.clientWidth))}syncSummaryPane(e,t){var o;if(!e){(o=this.summaryEl)==null||o.remove(),this.summaryEl=this.summaryPanes=this.summaryInners=null;return}if(!this.summaryEl){let r=s=>({left:C("div",`${s} ${s}-left`),center:C("div",`${s} ${s}-center`),right:C("div",`${s} ${s}-right`)});this.summaryEl=C("div","fg-summary",{role:"rowgroup"}),this.summaryPanes=r("fg-summary-pane"),this.summaryInners=r("fg-summary-inner");for(let s of te)this.summaryPanes[s].append(this.summaryInners[s]),this.summaryEl.append(this.summaryPanes[s])}this.summaryEl.className=`fg-summary fg-summary-${e}`,this.summaryEl.style.height=`${t}px`;for(let r of te){let s=this.grid.columns.regionWidth(r);r!=="center"&&(this.summaryPanes[r].style.width=`${s}px`,this.summaryPanes[r].hidden=s===0),this.summaryInners[r].style.width=`${s}px`,this.summaryInners[r].style.height=`${t}px`}let n=this.scroller.offsetWidth-this.scroller.clientWidth;this.summaryPanes.center.style.marginRight=`${n}px`}renderSummary(e,t,n,o,r){for(let u of te){for(let h of this.canvasSummary[u])h.remove();this.canvasSummary[u]=[]}if(!t)return;let{columns:s}=this.grid,a=this.opts.rowHeight,l=s.region("center"),d=tt(l.map(u=>u.left),l.map(u=>u.width),this.scroller.scrollLeft,this.scroller.clientWidth,zt),c=s.displayed().filter(u=>!A(u.id));for(let u of te){let h=u==="center"?l.slice(d.first,d.last+1):s.region(u),f=t.map((g,x)=>{var m,w,R;let y=g.label!=null&&(w=(m=c.find(k=>{var L;return!(k.id in((L=g.columns)!=null?L:{}))}))==null?void 0:m.id)!=null?w:null,p=C("div","fg-row fg-summary-row",{role:"row"}),v=o||r==="top"?x*a:this.rowsHeight(e)+x*a;p.style.transform=`translateY(${v}px)`,p.style.height=`${a}px`;for(let k of h)p.append(this.summaryCell(k,g,(R=n[x])!=null?R:{},y));return p});o?this.summaryInners[u].replaceChildren(...f):(this.canvases[u].append(...f),this.canvasSummary[u]=f)}}summaryCell(e,t,n,o){var f,g,x,y,p;let r=C("div","fg-cell",{role:"gridcell"});r.style.left=`${e.left}px`,r.style.width=`${e.width}px`,r.dataset.col=e.id;let s=e.def,a=(f=s.align)!=null?f:s.type==="number"?"right":s.type==="boolean"?"center":"left";r.className=`fg-cell fg-align-${a}`;let l=(g=t.columns)==null?void 0:g[e.id];if(l===void 0)return e.id===o&&(r.textContent=(x=t.label)!=null?x:"",r.classList.add("fg-summary-label")),r;let d=n[e.id],c=Bt(l),u=this.grid.store.state.locale.code,h;if(d==null||d==="")h="";else if(typeof d=="string")h=d;else if(c.agg==="count")h=new Intl.NumberFormat(u).format(d);else{let v=(y=s.type)!=null?y:typeof d=="number"?"number":d instanceof Date?"date":void 0;h=_({...s,type:v,format:(p=c.format)!=null?p:s.format},u)(d)}return r.textContent=c.prefix&&h?`${c.prefix} ${h}`:h,r}get heightOf(){var t;let e=this.grid.options.getRowHeight;if(e)return(t=this.heightFn)!=null?t:this.heightFn=n=>{var o;try{return(o=e(n))!=null?o:void 0}catch{return}}}invalidateHeights(){this.heightOf&&this.heightsVersion++,this.rowHeights.size&&(this.rowHeights.clear(),this.heightsVersion++)}measureRows(){var o,r;let e=this.opts.rowHeight,t=new Map;for(let s of te)for(let[a,l]of this.painted[s]){let d=this.grid.rowModel.getRow(a);if(!d||d.kind)continue;let c=(o=t.get(a))!=null?o:e;for(let u of l.el.querySelectorAll(".fg-cell-wrap"))u.classList.contains("fg-cell-merged")||u.classList.contains("fg-cell-merge-hidden")||(c=Math.max(c,Math.ceil(u.scrollHeight)));t.set(a,c)}let n=!1;for(let[s,a]of t){let l=this.grid.rowModel.getRow(s).id,d=(r=this.rowHeights.get(l))!=null?r:e;Math.abs(d-a)>1&&(a===e?this.rowHeights.delete(l):this.rowHeights.set(l,a),n=!0)}n&&(this.heightsVersion++,this.version++,this.schedule())}detailHeight(){let e=this.grid.options.detailHeight;return typeof e=="number"&&e>0?e:240}rowTop(e){return(this.offsets?this.offsets[e]:e*this.opts.rowHeight)+this.topOffset}rowH(e){return this.offsets?this.offsets[e+1]-this.offsets[e]:this.opts.rowHeight}rowsHeight(e){return this.offsets?this.offsets[e]:e*this.opts.rowHeight}placeRow(e,t){e.style.transform=`translateY(${this.rowTop(t)}px)`,e.style.height=`${this.rowH(t)}px`,e.dataset.row=String(t),e.setAttribute("aria-rowindex",String(t+1+this.grid.columns.depth+(this.filterRow?1:0)))}decorate(e,t){var d;let{grid:n}=this,o=n.store.state.locale,r=(d=t.level)!=null?d:0,s=!!n.options.treeData,a=n.canExpandDetail(t.data);if(!s&&!a&&!r)return;e.classList.add("fg-cell-lead"),e.style.setProperty("--fg-level",String(r));let l=[];if(s)if(t.hasChildren){let c=C("button",t.expanded?"fg-tree-toggle fg-expanded":t.loading?"fg-tree-toggle fg-tree-loading":"fg-tree-toggle",{type:"button",tabindex:"-1","aria-label":t.expanded?o.collapseAll:o.expandAll,"aria-expanded":String(!!t.expanded)});t.loading&&c.setAttribute("aria-busy","true"),c.innerHTML=Gt,l.push(c)}else l.push(C("span","fg-tree-spacer",{"aria-hidden":"true"}));if(a){let c=n.isDetailExpanded(t.data),u=C("button",c?"fg-detail-toggle fg-expanded":"fg-detail-toggle",{type:"button",tabindex:"-1","aria-expanded":String(c),"aria-label":c?o.collapseAll:o.expandAll});u.innerHTML=Gt,l.push(u)}e.prepend(...l)}paintGroupRow(e,t,n,o,r){var d;let s=t.group,{grid:a}=this,l=a.store.state.locale;for(e.className="fg-row fg-row-group",this.placeRow(e,n),e.setAttribute("aria-level",String(((d=t.level)!=null?d:0)+1)),e.setAttribute("aria-expanded",String(s.expanded)),e.removeAttribute("aria-selected"),e.style.zIndex="";e.childElementCount>o.length;)e.lastElementChild.remove();for(;e.childElementCount<o.length;)e.append(C("div","fg-cell",{role:"gridcell"}));o.forEach((c,u)=>{var p,v,m,w,R,k,L;let h=e.children[u];h.style.left=`${c.left}px`,h.style.width=`${c.width}px`,h.style.top=h.style.height=h.style.bottom="",h.style.removeProperty("--fg-level"),h.dataset.col=c.id,h.setAttribute("aria-colindex",String(c.index+1));let f=r===c.id?" fg-cell-focused":"";if(c.id===ne){if(h.className=`fg-cell fg-cell-select${f}`,a.options.rowSelection!=="multiple"){h.replaceChildren();return}let I=a.groupSelection(t),b=C("input","fg-checkbox",{type:"checkbox",tabindex:"-1","aria-label":l.selectAllRows});b.checked=I==="all",b.indeterminate=I==="some",h.replaceChildren(b);return}if(c.id===this.groupLabelId){h.className=`fg-cell fg-group-cell${f}`,h.style.setProperty("--fg-level",String((p=t.level)!=null?p:0));let I=C("button",s.expanded?"fg-group-toggle fg-expanded":"fg-group-toggle",{type:"button",tabindex:"-1","aria-expanded":String(s.expanded),"aria-label":s.expanded?l.collapseAll:l.expandAll});I.innerHTML=Gt;let b=(v=a.columns.getNode(s.colId))==null?void 0:v.def,M=C("span","fg-group-label"),S=G(s.value)?l.blanks:b?_(b,l.code)(s.value):String(s.value),E=new Intl.NumberFormat(l.code),T=(m=s.count)!=null?m:s.aggregates?null:s.rows.length;M.textContent=`${(R=(w=b==null?void 0:b.header)!=null?w:b==null?void 0:b.field)!=null?R:s.colId}: ${S}${T==null?"":` (${E.format(T)})`}`,h.replaceChildren(I,M);return}let g=c.def,x=(k=g.align)!=null?k:g.type==="number"?"right":g.type==="boolean"?"center":"left";h.className=`fg-cell fg-align-${x}${f}`;let y=g.aggFunc&&!A(c.id)?a.groupAggregate(t,c.id):void 0;if(y==null||y==="")h.textContent="";else if(g.aggFunc==="count")h.textContent=new Intl.NumberFormat(l.code).format(y);else{let I=(L=g.type)!=null?L:typeof y=="number"?"number":y instanceof Date?"date":void 0;h.textContent=_({...g,type:I},l.code)(y)}h.textContent&&h.classList.add("fg-cell-agg")})}paintDetailRow(e,t,n,o){var a,l;if(e.className="fg-row fg-row-detail",this.placeRow(e,n),e.style.zIndex="",o!=="center"){e.replaceChildren();return}let r=t.detailOf,s=this.details.get(r.id);if(!s){s=C("div","fg-detail");try{let d=(l=(a=this.grid.options).detailRenderer)==null?void 0:l.call(a,{row:r.data,rowIndex:n-1});typeof d=="string"?s.innerHTML=d:d&&s.append(d)}catch{H("detailRenderer threw; showing an empty panel")}this.details.set(r.id,s)}s.style.left=`${this.scroller.scrollLeft}px`,s.style.width=`${this.scroller.clientWidth||this.grid.columns.regionWidth("center")}px`,(e.firstChild!==s||e.childNodes.length!==1)&&e.replaceChildren(s)}paintLoadingRow(e,t,n){e.className="fg-row fg-row-loading",this.placeRow(e,t),e.setAttribute("aria-busy","true"),e.style.zIndex="",e.replaceChildren(...n.map(o=>{let r=C("div","fg-cell",{role:"gridcell"});return r.style.left=`${o.left}px`,r.style.width=`${o.width}px`,r.dataset.col=o.id,A(o.id)||r.append(C("span","fg-skeleton",{"aria-hidden":"true"})),r}))}renderPager(){var p;let{grid:e}=this,t=e.options.pagination;if(!t){(p=this.pagerEl)==null||p.remove(),this.pagerEl=null;return}let n=e.store.state.locale,o=e.getPage(),r=e.getPageSize(),s=e.getPageCount(),a=e.rowModel.fullCount(),l=typeof t=="object"&&Array.isArray(t.pageSizes)?t.pageSizes.filter(v=>Number.isInteger(v)&&v>0):[],d=`${o}|${r}|${s}|${a}|${n.code}|${l.join(",")}`;if(this.pagerEl&&d===this.pagerKey)return;this.pagerKey=d,this.pagerEl||(this.pagerEl=C("div","fg-pager",{role:"navigation"}),this.pagerEl.addEventListener("click",v=>{var R;let m=(R=v.target.closest("button[data-action]"))==null?void 0:R.dataset.action,w=e.getPage();m==="first"?e.setPage(0):m==="prev"?e.setPage(w-1):m==="next"?e.setPage(w+1):m==="last"&&e.setPage(e.getPageCount()-1)}),this.pagerEl.addEventListener("change",v=>{let m=v.target;m.classList.contains("fg-pager-size")&&e.setPageSize(Number(m.value))})),this.pagerEl.setAttribute("aria-label",n.pageSize);let c=new Intl.NumberFormat(n.code),u=a?o*r+1:0,h=Math.min(a,(o+1)*r),f=C("span","fg-pager-range");f.textContent=n.pagerRange.replace("{from}",c.format(u)).replace("{to}",c.format(h)).replace("{total}",c.format(a));let g=[f,C("span","fg-pager-spacer")];if(l.length){let v=C("label","fg-pager-size-label");v.textContent=n.pageSize;let m=C("select","fg-pager-size");for(let w of[...new Set([...l,r])].sort((R,k)=>R-k)){let R=C("option");R.value=String(w),R.textContent=c.format(w),R.selected=w===r,m.append(R)}v.append(m),g.push(v)}let x=(v,m,w,R)=>{let k=C("button","fg-pager-btn",{type:"button","aria-label":w,title:w});return k.dataset.action=v,k.textContent=m,k.disabled=R,k},y=C("span","fg-pager-page",{"aria-live":"polite"});y.textContent=n.pageOf.replace("{page}",c.format(o+1)).replace("{pages}",c.format(s)),g.push(x("first","\xAB",n.firstPage,o===0),x("prev","\u2039",n.previousPage,o===0),y,x("next","\u203A",n.nextPage,o>=s-1),x("last","\xBB",n.lastPage,o>=s-1)),this.pagerEl.replaceChildren(...g)}showFreeBadge(){if(this.root.querySelector(".fg-free-badge"))return;let e=C("a","fg-free-badge",{href:"https://freegrid.app/pricing/",target:"_blank",rel:"noopener"});e.innerHTML='<svg viewBox="0 0 32 32" width="14" height="14" aria-hidden="true"><rect width="32" height="32" rx="7" fill="#0E1726"/><path d="M7 11.5h18M7 16.5h18M7 21.5h18M13 7v18" stroke="#fff" stroke-width="2" stroke-linecap="round"/><rect x="14" y="12.5" width="11" height="3" rx="1" fill="#F2A900"/></svg>';let t=C("span");t.textContent=`FreeGrid \xB7 ${this.grid.store.state.locale.freeBadge}`,e.append(t),this.root.append(e)}useCards(){let e=this.grid.options.cardView,t=e===!0?640:typeof e=="number"?e:-1,n=t>0&&this.main.clientWidth<t;return n!==this.cardMode&&(this.cardMode=n,this.root.classList.toggle("fg-card-mode",n),!n&&this.cards&&(this.cards.scroller.remove(),this.cards=null),this.version++),n}renderCards(e){var x,y,p,v,m;let{grid:t}=this;if(!this.cards){let w=C("div","fg-cards",{role:"list"}),R=C("div","fg-cards-canvas");w.append(R),this.main.insertBefore(w,this.overlay),w.addEventListener("scroll",()=>{this.schedule(),this.grid.events.emit("scroll",this.getScroll())},{passive:!0}),w.addEventListener("click",this.onCardClick),this.cards={scroller:w,canvas:R}}let{scroller:n,canvas:o}=this.cards,r=t.columns.displayed().filter(w=>!A(w.id)),s=Math.round(this.opts.rowHeight*.75),a=!!t.options.rowSelection,l=20+r.length*s+(a?s:0),d=10;o.style.height=`${e*(l+d)}px`;let c=Math.max(0,Math.floor(n.scrollTop/(l+d))-2),u=Math.min(e-1,Math.ceil((n.scrollTop+(n.clientHeight||800))/(l+d))+2),{selected:h,locale:f}=t.store.state,g=[];for(let w=c;w<=u;w++){let R=t.rowModel.getRow(w);if(!R)continue;let k=C("div",R.kind?"fg-card fg-card-other":h.has(R.id)?"fg-card fg-card-selected":"fg-card",{role:"listitem"});if(k.dataset.row=String(w),k.style.transform=`translateY(${w*(l+d)}px)`,k.style.height=`${l}px`,k.style.setProperty("--fg-card-line",`${s}px`),R.kind==="group"&&R.group){let L=(x=t.columns.getNode(R.group.colId))==null?void 0:x.def;k.textContent=`${(y=L==null?void 0:L.header)!=null?y:R.group.colId}: ${String((p=R.group.value)!=null?p:f.blanks)} (${R.group.rows.length})`}else if(!R.kind){if(a){let L=C("label","fg-card-head"),I=C("input","fg-card-check fg-checkbox",{type:"checkbox","aria-label":f.selectRow});I.checked=h.has(R.id),I.disabled=!t.rowSelectable(R.data),L.append(I,document.createTextNode(`#${w+1}`)),k.append(L)}for(let L of r){let I=C("div","fg-card-line"),b=C("span","fg-card-label");b.textContent=(m=(v=L.def.header)!=null?v:L.def.field)!=null?m:L.id;let M=C("span","fg-card-value");M.dataset.col=L.id;let S=B(L.def,R.data),E=_(L.def,f.code)(S);if(L.def.renderer)try{let T=L.def.renderer({value:S,formatted:E,row:R.data,rowIndex:w,column:L.def});typeof T=="string"?M.innerHTML=T:M.replaceChildren(T)}catch{M.textContent=E}else M.textContent=E;I.append(b,M),k.append(I)}}g.push(k)}o.replaceChildren(...g)}dropDetail(e){e===void 0?this.details.clear():this.details.delete(e)}renderedRange(){return this.lastRange}measureText(e,t){let n=getComputedStyle(this.main),o=parseFloat(getComputedStyle(this.root).getPropertyValue("--fg-font-size"))||13;this.measureCtx===void 0&&(this.measureCtx=document.createElement("canvas").getContext("2d"));let r=this.measureCtx;return r?(r.font=`${t?600:400} ${o}px ${n.fontFamily||"sans-serif"}`,r.measureText(e).width):e.length*o*.6}scrollToRow(e){this.scroller.scrollTop=this.rowTop(Math.max(0,Math.min(e,this.grid.rowModel.getRowCount())))}pageRows(){return Math.max(1,Math.floor(this.scroller.clientHeight/this.opts.rowHeight))}destroy(){var e;(e=this.filterRow)==null||e.destroy(),this.frame&&cancelAnimationFrame(this.frame),this.scroller.removeEventListener("scroll",this.onScroll),this.root.remove()}},Vt=class{constructor(e){let t=n=>({left:C("div",`${n} ${n}-left`),center:C("div",`${n} ${n}-center`),right:C("div",`${n} ${n}-right`)});this.el=C("div",e,{role:"rowgroup"}),this.panes=t("fg-section-pane"),this.inners=t("fg-section-inner");for(let n of te)this.panes[n].append(this.inners[n]),this.el.append(this.panes[n])}size(e,t,n){this.el.style.height=`${t}px`;for(let o of te){let r=e.regionWidth(o);o!=="center"&&(this.panes[o].style.width=`${r}px`,this.panes[o].hidden=r===0),this.inners[o].style.width=`${r}px`,this.inners[o].style.height=`${t}px`}this.panes.center.style.marginRight=`${n}px`}},Yn="http://www.w3.org/2000/svg";function Sr(i,e,t,n){var p;let o=Math.max(20,t-16),r=Math.max(10,n-14),s=document.createElementNS(Yn,"svg");s.setAttribute("class","fg-sparkline"),s.setAttribute("width",String(o)),s.setAttribute("height",String(r)),s.setAttribute("viewBox",`0 0 ${o} ${r}`),s.setAttribute("aria-hidden","true");let a=(p=e.color)!=null?p:"var(--fg-accent)",l=e.type==="bar",d=l?Math.min(0,...i):Math.min(...i),c=l?Math.max(0,...i):Math.max(...i);d===c&&(d-=1,c+=1);let u=c-d,h=v=>r-1-(v-d)/u*(r-2),f=(v,m)=>{let w=document.createElementNS(Yn,v);for(let[R,k]of Object.entries(m))w.setAttribute(R,String(k));return s.append(w),w};if(e.type==="bar"){let v=o/i.length;return i.forEach((m,w)=>f("rect",{x:w*v+1,y:Math.min(h(m),h(0)),width:Math.max(1,v-2),height:Math.max(1,Math.abs(h(m)-h(0))),fill:m<0?"#ef4444":a})),s}let g=i.length>1?(o-2)/(i.length-1):0,x=i.map((v,m)=>`${1+m*g},${h(v)}`).join(" ");e.type==="area"&&f("polygon",{points:`1,${r} ${x} ${1+(i.length-1)*g},${r}`,fill:a,"fill-opacity":.2}),f("polyline",{points:x,fill:"none",stroke:a,"stroke-width":1.5,"stroke-linejoin":"round"});let y=i.length-1;return f("circle",{cx:1+y*g,cy:h(i[y]),r:2,fill:a}),s}var kr=4,ot=class{constructor(e){this.grid=e;this.onClick=e=>{var o;let t=e.target.closest(".fg-group-chip-remove"),n=(o=t==null?void 0:t.closest(".fg-group-chip"))==null?void 0:o.dataset.col;n&&this.grid.setGroupBy(this.grid.getGroupBy().filter(r=>r!==n))};this.onPointerDown=e=>{let t=e.target,n=t.closest(".fg-group-chip");if(e.button!==0||!n||t.closest("button"))return;let o=n.dataset.col,r=e.clientX,s=!1,a=d=>{!s&&Math.abs(d.clientX-r)<kr||(s=!0,n.classList.add("fg-dragging"))},l=d=>{if(window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",l),n.classList.remove("fg-dragging"),!s)return;let u=[...this.el.querySelectorAll(".fg-group-chip")].filter(f=>f!==n).filter(f=>{let g=f.getBoundingClientRect();return d.clientX>g.left+g.width/2}).length,h=this.grid.getGroupBy().filter(f=>f!==o);h.splice(u,0,o),this.grid.setGroupBy(h)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",l)};this.el=C("div","fg-group-panel",{role:"toolbar"}),e.renderer.main.insertBefore(this.el,e.renderer.gridEl),this.el.addEventListener("click",this.onClick),this.el.addEventListener("pointerdown",this.onPointerDown),this.refresh()}contains(e,t){let n=this.el.getBoundingClientRect();return e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}highlight(e){this.el.classList.toggle("fg-group-panel-over",e)}refresh(){let{grid:e}=this,t=e.store.state.locale;this.el.setAttribute("aria-label",t.groupByThis);let n=e.getGroupBy();if(!n.length){let o=C("span","fg-group-hint");o.textContent=t.groupPanelHint,this.el.replaceChildren(o);return}this.el.replaceChildren(...n.map((o,r)=>{var c,u,h;let s=(c=e.columns.getNode(o))==null?void 0:c.def,a=C("span","fg-group-chip");a.dataset.col=o;let l=C("span","fg-group-chip-label");l.textContent=(h=(u=s==null?void 0:s.header)!=null?u:s==null?void 0:s.field)!=null?h:o;let d=C("button","fg-group-chip-remove",{type:"button","aria-label":`${t.ungroup}: ${l.textContent}`});if(d.textContent="\xD7",a.append(l,d),r<n.length-1){let f=C("span","fg-group-sep",{"aria-hidden":"true"});return f.textContent="\u203A",[a,f]}return[a]}).flat())}destroy(){this.el.removeEventListener("click",this.onClick),this.el.removeEventListener("pointerdown",this.onPointerDown),this.el.remove()}};var Se=class{constructor(){this.listeners=new Map}on(e,t){let n=this.listeners.get(e);return n||this.listeners.set(e,n=new Set),n.add(t),()=>{n.delete(t)}}emit(e,t){let n=this.listeners.get(e);if(n)for(let o of[...n])try{o(t)}catch(r){console.error("[FreeGrid] event listener threw",r)}}clear(){this.listeners.clear()}};function oe(i){let e=i.getRootNode();return typeof ShadowRoot!="undefined"&&e instanceof ShadowRoot?e:document.body}function De(i,e,t){var o;let n=i.getRootNode();return(o=typeof n.elementFromPoint=="function"?n.elementFromPoint(e,t):null)!=null?o:document.elementFromPoint(e,t)}function Zn(i){var t;return(t=i.getRootNode().activeElement)!=null?t:document.activeElement}function fe(i,...e){let t=typeof i.composedPath=="function"?i.composedPath():[];return t.length?e.some(n=>!!n&&t.includes(n)):e.some(n=>!!n&&n.contains(i.target))}var qt=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Tab","Home","End","PageUp","PageDown"]);function Wt(i,e,t,n){let o=s=>Math.max(0,Math.min(n.rows-1,s)),r=s=>Math.max(0,Math.min(n.cols-1,s));switch(i){case"ArrowUp":return{rowIndex:o(t.rowIndex-1),colIndex:t.colIndex};case"ArrowDown":return{rowIndex:o(t.rowIndex+1),colIndex:t.colIndex};case"ArrowLeft":return{rowIndex:t.rowIndex,colIndex:r(t.colIndex-1)};case"ArrowRight":return{rowIndex:t.rowIndex,colIndex:r(t.colIndex+1)};case"PageUp":return{rowIndex:o(t.rowIndex-n.pageRows),colIndex:t.colIndex};case"PageDown":return{rowIndex:o(t.rowIndex+n.pageRows),colIndex:t.colIndex};case"Home":return{rowIndex:e.ctrl?0:t.rowIndex,colIndex:0};case"End":return{rowIndex:e.ctrl?n.rows-1:t.rowIndex,colIndex:n.cols-1};case"Tab":{let s=t.rowIndex*n.cols+t.colIndex+(e.shift?-1:1);return s<0||s>=n.rows*n.cols?null:{rowIndex:Math.floor(s/n.cols),colIndex:s%n.cols}}default:return null}}var rt=new Map,Jn=i=>i?rt.get(i):void 0;var Mr={Enter:"edit",F2:"edit",Delete:"clear",Backspace:"clear","Ctrl+Z":"undo","Ctrl+Y":"redo","Ctrl+Shift+Z":"redo","Ctrl+F":"find"};function Er(i){let e=[];return(i.ctrlKey||i.metaKey)&&e.push("Ctrl"),i.altKey&&e.push("Alt"),i.shiftKey&&i.key.length>1&&e.push("Shift"),i.shiftKey&&i.key.length===1&&(i.ctrlKey||i.metaKey)&&e.push("Shift"),e.push(i.key.length===1?i.key.toUpperCase():i.key),e.join("+")}var Lr=3;function Tr(i,e){return i.renderer.rtl?e.key==="ArrowLeft"?"ArrowRight":e.key==="ArrowRight"?"ArrowLeft":e.key:e.key}function Qn(i){var I;let{renderer:e}=i,t=e.bodyEl,n=e.root,o=b=>Tr(i,b),r="mouse",s=0,a=!1,l=b=>{let M=e.cellAt(b.target);if(!M)return null;let S=i.rowModel.getRow(M.rowIndex),E=i.columns.getColumn(M.colId);if(!S||!E)return null;let T=A(E.id)?void 0:B(E.def,S.data);return{row:S.data,rowIndex:M.rowIndex,colId:M.colId,value:T,event:b}},d=b=>{var T,D;let M=(D=(T=b.target).closest)==null?void 0:D.call(T,".fg-group-toggle, .fg-tree-toggle, .fg-detail-toggle"),S=M&&e.cellAt(b.target);if(!S)return!1;e.gridEl.focus({preventScroll:!0}),i.setFocus(S.rowIndex,S.colId),i.setRange(null);let E=i.rowModel.getRow(S.rowIndex);return M.classList.contains("fg-detail-toggle")?i.setDetailExpanded(E.data,!i.isDetailExpanded(E.data)):i.toggleRow(S.rowIndex),!0},c=b=>{var N;if(d(b))return;let M=i.store.state.focus,S=e.cellAt(b.target);if(S&&((N=i.rowModel.getRow(S.rowIndex))!=null&&N.kind)){S.colId===ne&&i.rowModel.getRow(S.rowIndex).kind==="group"&&i.toggleGroupSelection(i.rowModel.getRow(S.rowIndex)),e.gridEl.focus({preventScroll:!0}),i.setFocus(S.rowIndex,S.colId),i.setRange(null);return}let E=l(b);if(!E)return;if(e.gridEl.focus({preventScroll:!0}),E.colId===he){let $=i.columns.displayed().filter(F=>!A(F.id));$.length&&(i.setFocus(E.rowIndex,$[0].id),i.setRange({start:{rowIndex:E.rowIndex,colId:$[0].id},end:{rowIndex:E.rowIndex,colId:$[$.length-1].id}}));return}let T=a;a=!1;let D=i.store.state.focus,P=E.colId===ne;if(!T)if(b.shiftKey&&D&&!P&&!A(D.colId)&&i.options.rangeSelection!==!1)i.setRange({start:D,end:{rowIndex:E.rowIndex,colId:E.colId}},!0);else if((b.ctrlKey||b.metaKey)&&!P&&!A(E.colId)&&i.options.rangeSelection!==!1){let $={rowIndex:E.rowIndex,colId:E.colId};i.addRange({start:$,end:$}),i.setFocus(E.rowIndex,E.colId)}else i.setFocus(E.rowIndex,E.colId),i.setRange(null);i.options.rowSelection&&!T&&i.selectFromClick(E.rowIndex,P||b.ctrlKey||b.metaKey,b.shiftKey),i.events.emit("cellClick",E),r==="touch"&&!T&&M&&M.rowIndex===E.rowIndex&&M.colId===E.colId&&i.editor.canEdit(E.rowIndex,E.colId)&&(i.columns.getColumn(E.colId).def.type==="boolean"?i.applyEdit(E.rowIndex,E.colId,E.value!==!0):i.editor.start(E.rowIndex,E.colId))},u=b=>{var D,P;if((P=(D=b.target).closest)!=null&&P.call(D,"button"))return;let M=e.cellAt(b.target),S=M&&i.rowModel.getRow(M.rowIndex);if((S==null?void 0:S.kind)==="group"){i.toggleRow(M.rowIndex);return}if(S!=null&&S.kind)return;let E=l(b);if(!E||(i.events.emit("cellDoubleClick",E),!i.editor.canEdit(E.rowIndex,E.colId)))return;i.columns.getColumn(E.colId).def.type==="boolean"?i.applyEdit(E.rowIndex,E.colId,E.value!==!0):i.editor.start(E.rowIndex,E.colId)},h={...Mr};for(let[b,M]of Object.entries((I=i.options.keymap)!=null?I:{}))h[b]=M===!1?"none":M;let f=b=>{var T,D;let M=i.store.state.focus,S=h[Er(b)];if(S==="none")return!1;switch(S){case"edit":return!M||!i.editor.canEdit(M.rowIndex,M.colId)||i.columns.getColumn(M.colId).def.type==="boolean"?!1:(i.editor.start(M.rowIndex,M.colId),!0);case"clear":return i.clearCells(),!0;case"undo":return i.undo(),!0;case"redo":return i.redo(),!0;case"copy":return i.copyToClipboard(!1),!0;case"cut":return i.cutToClipboard(),!0;case"selectAll":return i.selectAllCells(),!0;case"find":return i.options.findBar===!1?!1:(i.finder.openBar(),!0);case"paste":return(D=(T=navigator.clipboard)==null?void 0:T.readText)==null||D.call(T).then(P=>i.pasteText(P),()=>{}),!0}if(!M||!i.editor.canEdit(M.rowIndex,M.colId))return!1;let E=i.columns.getColumn(M.colId).def;if(b.key===" "&&E.type==="boolean"&&!b.ctrlKey&&!b.metaKey){let P=i.rowModel.getRow(M.rowIndex).data;return i.applyEdit(M.rowIndex,M.colId,P[E.field]!==!0),!0}return b.key.length===1&&b.key!==" "&&!b.ctrlKey&&!b.metaKey&&!b.altKey&&E.type!=="boolean"?(i.editor.start(M.rowIndex,M.colId,b.key),!0):!1},g=b=>{var P,N,$;let M=i.store.state.focus;if(!M||b.ctrlKey||b.metaKey||b.altKey||b.shiftKey)return!1;let S=i.rowModel.getRow(M.rowIndex);if(!i.isExpandable(S))return!1;let E=S.kind==="group";if(!E&&M.colId!==((P=i.columns.displayed().find(F=>!A(F.id)))==null?void 0:P.id))return!1;let T=!!(($=(N=S.group)==null?void 0:N.expanded)!=null?$:S.expanded),D=i.expandKey(S);if(E&&(b.key==="Enter"||b.key===" "))i.setGroupExpanded(D,!T);else if(o(b)==="ArrowRight"&&!T)i.setGroupExpanded(D,!0);else if(o(b)==="ArrowLeft"&&T)i.setGroupExpanded(D,!1);else return!1;return!0},x=b=>{let M=e.cellAt(b.target);if(!M||M.colId!==me)return!1;b.preventDefault();let S=i.rowModel.getRow(M.rowIndex);if(!S||S.kind||!i.canMoveRows())return!0;let E=S.data,T=C("div","fg-row-drop-marker"),D=null;n.classList.add("fg-row-dragging");let P=$=>{var qe,wn;let F=De(n,$.clientX,$.clientY),O=F==null?void 0:F.closest(".fg-root"),V=O===n?i:Jn(O),z=i.dragOptions.group;if(D=null,T.remove(),!V||!O||V!==i&&(!z||V.dragOptions.group!==z||!V.options.rowDrag))return;let W=F.closest(".fg-row[data-row]"),q=W==null?void 0:W.getBoundingClientRect(),K=null,U="after",Z;if(W&&q){let ue=V.rowModel.getRow(Number(W.dataset.row));if(!ue||ue.kind==="group")return;K=(wn=(qe=ue.detailOf)==null?void 0:qe.data)!=null?wn:ue.data;let Le=($.clientY-q.top)/q.height;ue.kind==="detail"?U="after":V.options.treeData?U=Le<.25?"before":Le>.75?"after":"inside":U=Le<.5?"before":"after",Z=U==="before"?q.top:q.bottom}else{if(!F.closest(".fg-body"))return;let ue=O.querySelectorAll(".fg-body-pane-center .fg-row[data-row]");Z=ue.length?Math.max(...[...ue].map(Le=>Le.getBoundingClientRect().bottom)):O.querySelector(".fg-body").getBoundingClientRect().top}if(!V.canDropRow(E,K,U,i))return;D={into:V,target:K,position:U};let Q=O.getBoundingClientRect().top;T.classList.toggle("fg-row-drop-inside",U==="inside"),T.style.top=`${U==="inside"?q.top-Q:Z-Q-1}px`,T.style.height=U==="inside"?`${q.height}px`:"",O.append(T)},N=()=>{window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",N),window.removeEventListener("pointercancel",N),n.classList.remove("fg-row-dragging"),T.remove(),D&&D.into.dropRow(E,D.target,D.position,i)};return window.addEventListener("pointermove",P),window.addEventListener("pointerup",N),window.addEventListener("pointercancel",N),!0},y=b=>{let M=e.cellAt(b.target);if(!M)return;let S=b.clientX,E=b.clientY,T=()=>{clearTimeout(s),window.removeEventListener("pointermove",D),window.removeEventListener("pointerup",T),window.removeEventListener("pointercancel",T)},D=P=>{Math.hypot(P.clientX-S,P.clientY-E)>8&&T()};clearTimeout(s),s=window.setTimeout(()=>{T(),i.options.contextMenu!==!1&&(a=!0,A(M.colId)||(i.setFocus(M.rowIndex,M.colId),i.rangeContains(M.rowIndex,M.colId)||i.setRange({start:M,end:M})),i.contextMenu.open(S,E,M.rowIndex,M.colId))},550),window.addEventListener("pointermove",D),window.addEventListener("pointerup",T),window.addEventListener("pointercancel",T)},p=b=>{if(r=b.pointerType||"mouse",r==="touch"){y(b);return}if(b.button===0&&x(b)||i.options.rangeSelection===!1||b.button!==0||b.shiftKey||b.target.closest("input, a, button"))return;let M=e.cellAt(b.target);if(!M||A(M.colId))return;let S=b.clientX,E=b.clientY,T=b.ctrlKey||b.metaKey,D=!1,P=$=>{if(!D&&Math.hypot($.clientX-S,$.clientY-E)<Lr)return;let F=e.cellAt(De(n,$.clientX,$.clientY));!F||A(F.colId)||(D||(D=!0,n.classList.add("fg-range-dragging"),T&&i.addRange({start:M,end:M}),i.setFocus(M.rowIndex,M.colId)),i.setRange({start:M,end:F},T))},N=()=>{window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",N),n.classList.remove("fg-range-dragging"),D&&(a=!0)};window.addEventListener("pointermove",P),window.addEventListener("pointerup",N)},v=b=>{var O,V;if(b.target!==n&&b.target!==e.gridEl)return;let M=i.columns.displayed(),S=i.rowModel.getRowCount();if(!M.length||!S)return;if(g(b)){b.preventDefault();return}if(f(b)){b.preventDefault();return}let E=i.store.state.focus,T=b.ctrlKey||b.metaKey;if(b.key==="Escape"&&i.store.state.range){b.preventDefault(),i.setRange(null);return}if(T&&b.key.toLowerCase()==="a"&&i.options.rangeSelection!==!1){b.preventDefault(),i.selectAllCells();return}if(b.key==="ContextMenu"||b.key==="F10"&&b.shiftKey){b.preventDefault(),i.contextMenu.openAtFocus();return}if(b.key===" "&&E&&i.options.rowSelection){b.preventDefault(),i.selectFromClick(Math.min(E.rowIndex,S-1),!0,b.shiftKey);return}let D={rows:S,cols:M.length,pageRows:e.pageRows()},P=M.findIndex(z=>!A(z.id));if(i.options.rangeSelection!==!1&&b.shiftKey&&b.key!=="Tab"&&qt.has(b.key)){let z=E!=null?E:{rowIndex:0,colId:M[P].id},W=i.store.state.range,q=(O=W==null?void 0:W.end)!=null?O:z,K={rowIndex:Math.min(q.rowIndex,S-1),colIndex:Math.max(0,M.findIndex(Q=>Q.id===q.colId))},U=Wt(o(b),{ctrl:T,shift:!1},K,D);if(!U)return;b.preventDefault();let Z=M[Math.max(P,U.colIndex)].id;E||i.setFocus(z.rowIndex,z.colId),i.setRange({start:(V=W==null?void 0:W.start)!=null?V:z,end:{rowIndex:U.rowIndex,colId:Z}}),e.ensureVisible(U.rowIndex,Z);return}let $;if(!E)$=qt.has(b.key)&&b.key!=="Tab"?{rowIndex:0,colIndex:0}:null;else{let z=Math.max(0,M.findIndex(W=>W.id===E.colId));$=Wt(o(b),{ctrl:T,shift:b.shiftKey},{rowIndex:Math.min(E.rowIndex,S-1),colIndex:z},D)}if(!$)return;b.preventDefault();let F=M[$.colIndex].id;i.setFocus($.rowIndex,F),i.setRange(null),e.ensureVisible($.rowIndex,F)},m=b=>{var M,S;return(S=(M=b.target)==null?void 0:M.closest)==null?void 0:S.call(M,".fg-editor, input, textarea, select, [contenteditable]")},w=b=>{var M,S;return((S=(M=b.target)==null?void 0:M.closest)==null?void 0:S.call(M,".fg-root"))!==n},R=b=>{if(m(b)||w(b))return;let M=i.selectionTSV(!1);!M||!b.clipboardData||(b.clipboardData.setData("text/plain",M),b.preventDefault())},k=b=>{if(m(b)||w(b))return;let M=i.selectionTSV(!1);!M||!b.clipboardData||(b.clipboardData.setData("text/plain",M),b.preventDefault(),i.clearCells())},L=b=>{var S;if(m(b)||w(b))return;let M=(S=b.clipboardData)==null?void 0:S.getData("text/plain");M&&(b.preventDefault(),i.pasteText(M))};return t.addEventListener("click",c),t.addEventListener("dblclick",u),t.addEventListener("pointerdown",p),n.addEventListener("keydown",v),n.addEventListener("copy",R),n.addEventListener("paste",L),n.addEventListener("cut",k),()=>{t.removeEventListener("click",c),t.removeEventListener("dblclick",u),t.removeEventListener("pointerdown",p),n.removeEventListener("keydown",v),n.removeEventListener("copy",R),n.removeEventListener("paste",L),n.removeEventListener("cut",k)}}var it=class{constructor(e){this.grid=e;this.open=new Set;this.el=C("div","fg-filters-panel")}refresh(){var l,d;let{grid:e}=this,t=e.store.state.locale,n=e.store.state.filters,o=C("div","fg-filters-head"),r=C("span","fg-filters-title");r.textContent=t.filters;let s=C("button","fg-btn fg-filters-clear",{type:"button"});s.textContent=t.clearFilters,s.disabled=!Object.keys(n).length,s.addEventListener("click",()=>{for(let c of Object.keys(e.store.state.filters))e.setFilter(c,null)}),o.append(r,s);let a=C("div","fg-filters-list");for(let c of e.columns.displayed()){if(A(c.id)||!re(c.def))continue;let u=C("details",n[c.id]?"fg-filters-item fg-filter-on":"fg-filters-item");u.dataset.col=c.id,u.open=this.open.has(c.id);let h=C("summary");h.textContent=(d=(l=c.def.header)!=null?l:c.def.field)!=null?d:c.id,u.append(h);let f=()=>{if(u.querySelector(".fg-filter"))return;let g=e.menu.filterSection(c.id,()=>{});g&&u.append(g)};u.open&&f(),u.addEventListener("toggle",()=>{u.open?(this.open.add(c.id),f()):this.open.delete(c.id)}),a.append(u)}this.el.replaceChildren(o,a)}};var Ir=["sum","avg","min","max","count"],st=class{constructor(e){this.grid=e;this.draft={rows:[],columns:[],values:[]};this.el=C("div","fg-pivot-panel")}apply(){this.grid.getPivot()?this.grid.setPivot(this.draft):this.refresh()}refresh(){var d;let{grid:e}=this,t=e.store.state.locale,n=e.getPivot();n&&(this.draft={rows:[...n.rows],columns:[...(d=n.columns)!=null?d:[]],values:n.values.map(c=>({colId:c.colId,aggFunc:typeof c.aggFunc=="string"?c.aggFunc:"sum"}))});let o=e.sourceLeaves(),r=c=>{var h,f,g;let u=(h=o.find(x=>x.id===c))==null?void 0:h.def;return(g=(f=u==null?void 0:u.header)!=null?f:u==null?void 0:u.field)!=null?g:c},s=C("label","fg-pivot-mode"),a=C("input","fg-checkbox",{type:"checkbox"});a.checked=!!n,a.addEventListener("click",()=>e.setPivot(a.checked?this.draft:null)),s.append(a,document.createTextNode(t.pivotMode));let l=(c,u)=>{let h=C("div","fg-pivot-zone");h.dataset.zone=c;let f=C("div","fg-pivot-zone-title");f.textContent=u;let g=C("div","fg-pivot-chips"),x=c==="values"?this.draft.values.map(v=>v.colId):this.draft[c];x.forEach((v,m)=>{let w=C("span","fg-group-chip");w.dataset.col=v;let R=C("span","fg-group-chip-label");if(R.textContent=r(v),w.append(R),c==="values"){let L=C("select","fg-pivot-agg",{"aria-label":`${r(v)} ${t.pivotValues}`});for(let I of Ir){let b=C("option");b.value=I,b.textContent=t[I],L.append(b)}L.value=this.draft.values[m].aggFunc,L.addEventListener("change",()=>{this.draft.values[m].aggFunc=L.value,this.apply()}),w.append(L)}let k=C("button","fg-group-chip-remove",{type:"button","aria-label":`${t.ungroup}: ${r(v)}`});k.textContent="\xD7",k.addEventListener("click",()=>{c==="values"?this.draft.values.splice(m,1):this.draft[c].splice(m,1),this.apply()}),w.append(k),g.append(w)});let y=C("select","fg-pivot-add",{"aria-label":`${u}: ${t.addColumn}`}),p=C("option");p.value="",p.textContent=t.addColumn,y.append(p);for(let v of o){if(x.includes(v.id)||c==="values"&&v.def.type!=="number")continue;let m=C("option");m.value=v.id,m.textContent=r(v.id),y.append(m)}return y.addEventListener("change",()=>{y.value&&(c==="values"?this.draft.values.push({colId:y.value,aggFunc:"sum"}):this.draft[c].push(y.value),this.apply())}),h.append(f,g,y),h};this.el.replaceChildren(s,l("rows",t.pivotRows),l("columns",t.pivotColumns),l("values",t.pivotValues))}};var Dr=4,at=i=>!A(i.id)&&(i.children?i.children.some(at):i.def.chooser!==!1),Kt=i=>{var e,t;return(t=(e=i.def.header)!=null?e:i.def.field)!=null?t:i.id},lt=class{constructor(e){this.grid=e;this.collapsed=new Set;this.el=C("div","fg-chooser"),this.search=C("input","fg-input fg-chooser-search",{type:"search"});let t=C("label","fg-chooser-all");this.allBox=C("input","fg-checkbox",{type:"checkbox"}),this.allText=C("span"),t.append(this.allBox,this.allText),this.list=C("div","fg-chooser-list",{role:"tree"}),this.el.append(this.search,t,this.list),this.search.addEventListener("input",()=>this.refresh()),this.allBox.addEventListener("change",()=>this.setVisible(this.matchingLeaves(),this.allBox.checked)),this.list.addEventListener("change",n=>{let o=n.target,r=this.nodeOf(o);r&&this.setVisible(this.leavesOf(r),o.checked)}),this.list.addEventListener("click",n=>{let o=n.target.closest(".fg-chooser-caret"),r=o&&this.nodeOf(o);r&&(this.collapsed.has(r.id)?this.collapsed.delete(r.id):this.collapsed.add(r.id),this.refresh())}),this.list.addEventListener("pointerdown",n=>this.onPointerDown(n)),this.refresh()}refresh(){let e=this.grid.store.state.locale;this.search.placeholder=e.search,this.search.setAttribute("aria-label",e.search),this.allText.textContent=e.selectAll;let t=this.query(),n=[],o=(a,l)=>{for(let d of a)!at(d)||t&&!this.subtreeMatches(d,t)||(n.push(this.item(d,l)),d.children&&(t||!this.collapsed.has(d.id))&&o(d.children,l+1))};o(this.grid.columns.roots(),0),this.list.replaceChildren(...n);let r=this.matchingLeaves(),s=r.filter(a=>!a.hide).length;this.allBox.checked=r.length>0&&s===r.length,this.allBox.indeterminate=s>0&&s<r.length}query(){return this.search.value.trim().toLowerCase()}subtreeMatches(e,t){for(let n=e;n;n=n.parent)if(Kt(n).toLowerCase().includes(t))return!0;return!!e.children&&e.children.some(n=>at(n)&&this.subtreeMatches(n,t))}leavesOf(e){return at(e)?e.children?e.children.flatMap(t=>this.leavesOf(t)):[e]:[]}matchingLeaves(){let e=this.query(),t=this.grid.columns.roots().flatMap(n=>this.leavesOf(n));return e?t.filter(n=>this.subtreeMatches(n,e)):t}nodeOf(e){var n;let t=(n=e.closest(".fg-chooser-item"))==null?void 0:n.dataset.col;return t?this.grid.columns.getNode(t):void 0}setVisible(e,t){this.grid.setColumnsVisible(e.filter(n=>!n.def.lockVisible).map(n=>n.id),t)}item(e,t){let n=C("div",e.children?"fg-chooser-item fg-chooser-group":"fg-chooser-item",{role:"treeitem"});n.dataset.col=e.id,n.style.paddingLeft=`${6+t*16}px`;let o=C("span","fg-chooser-handle",{"aria-hidden":"true"});if(o.textContent="\u22EE\u22EE",n.append(o),e.children){let d=!this.collapsed.has(e.id),c=C("button","fg-chooser-caret",{type:"button",tabindex:"-1","aria-hidden":"true"});c.textContent=d?"\u25BE":"\u25B8",n.setAttribute("aria-expanded",String(d)),n.append(c)}let r=this.leavesOf(e),s=r.filter(d=>!d.hide).length,a=C("input","fg-checkbox",{type:"checkbox","aria-label":Kt(e)});a.checked=r.length>0&&s===r.length,a.indeterminate=s>0&&s<r.length,a.disabled=r.every(d=>d.def.lockVisible);let l=C("span","fg-chooser-label");if(l.textContent=Kt(e),n.append(a,l),!e.children&&e.pinned){let d=C("span","fg-chooser-pin");d.textContent=e.pinned==="left"?"\u21E4":"\u21E5",n.append(d)}return n}onPointerDown(e){let t=e.target.closest(".fg-chooser-handle"),n=t==null?void 0:t.closest(".fg-chooser-item"),o=n&&this.nodeOf(n);if(!n||!o||e.button!==0)return;e.preventDefault();let r=new Set(this.grid.columns.siblings(o.id).map(f=>f.id).filter(f=>f!==o.id)),s=[...this.list.querySelectorAll(".fg-chooser-item")].filter(f=>r.has(f.dataset.col)),a=e.clientY,l=!1,d=-1,c=C("div","fg-chooser-marker"),u=f=>{if(!l){if(Math.abs(f.clientY-a)<Dr||!s.length)return;l=!0,n.classList.add("fg-dragging"),this.list.append(c)}d=s.filter(y=>{let p=y.getBoundingClientRect();return f.clientY>p.top+p.height/2}).length;let g=this.list.getBoundingClientRect().top-this.list.scrollTop,x=d<s.length?s[d].getBoundingClientRect().top:s[s.length-1].getBoundingClientRect().bottom;c.style.top=`${x-g-1}px`},h=()=>{if(window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",h),c.remove(),n.classList.remove("fg-dragging"),!l||d<0)return;let f=this.grid.columns.siblings(o.id).map(y=>y.id).filter(y=>y!==o.id),g=d<s.length?f.indexOf(s[d].dataset.col):f.indexOf(s[s.length-1].dataset.col)+1;g=Math.max(f.filter(A).length,g);let x=this.grid.columns.siblings(o.id).findIndex(y=>y.id===o.id);g!==x&&(this.grid.columns.move(o.id,g),this.grid.layoutChanged(),this.grid.events.emit("columnMove",{colId:o.id,toIndex:g}))};window.addEventListener("pointermove",u),window.addEventListener("pointerup",h)}},dt=class{constructor(e){this.grid=e;this.popup=null;this.panel=null;this.off=[]}get isOpen(){return!!this.popup}open(){this.close();let e=this.grid.store.state.locale,t=C("div",`fg-menu fg-chooser-dialog fg-theme-${this.grid.store.state.theme}`,{role:"dialog","aria-label":e.chooseColumns});this.grid.applyFontTo(t);let n=C("div","fg-chooser-head"),o=C("span","fg-menu-title");o.textContent=e.chooseColumns;let r=C("button","fg-chooser-close",{type:"button","aria-label":e.close});r.textContent="\xD7",r.addEventListener("click",()=>this.close()),n.append(o,r),this.panel=new lt(this.grid),t.append(n,this.panel.el),oe(this.grid.renderer.root).append(t);let s=this.grid.renderer.root.getBoundingClientRect(),a=t.offsetWidth||280;t.style.left=`${Math.max(4,Math.min(s.right-a-8,window.innerWidth-a-4))}px`,t.style.top=`${Math.max(4,s.top+8)}px`,this.popup=t;let l=c=>{fe(c,t)||this.close()},d=c=>{c.key==="Escape"&&this.close()};document.addEventListener("pointerdown",l,!0),document.addEventListener("keydown",d,!0),this.off.push(()=>document.removeEventListener("pointerdown",l,!0),()=>document.removeEventListener("keydown",d,!0)),t.querySelector(".fg-chooser-search").focus()}refresh(){var e;(e=this.panel)==null||e.refresh()}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null,this.panel=null}},ct=class{constructor(e,t,n=["columns","filters"]){this.grid=e;this.tabs=new Map;this.el=C("div","fg-sidebar"),this.panelHost=C("div","fg-sidebar-panel"),this.columns=new lt(e),this.filters=new it(e),this.pivot=new st(e);let o=n.filter(s=>s==="columns"||s==="filters"||s==="pivot");o.length||o.push("columns"),this.current=o[0];let r=C("div","fg-sidebar-tabs",{role:"tablist"});for(let s of o){let a=C("button","fg-sidebar-tab",{type:"button",role:"tab"});a.dataset.panel=s,a.addEventListener("click",()=>this.toggle(!(this.isOpen&&this.current===s),s)),this.tabs.set(s,a),r.append(a)}this.el.append(this.panelHost,r),e.renderer.root.append(this.el),this.panelHost.hidden=!t,this.show(),this.refresh()}get isOpen(){return!this.panelHost.hidden}show(){this.panelHost.replaceChildren(this.current==="filters"?this.filters.el:this.current==="pivot"?this.pivot.el:this.columns.el)}toggle(e=!this.isOpen,t){t&&this.tabs.has(t)&&t!==this.current&&(this.current=t,this.show()),this.panelHost.hidden=!e,this.syncTabs(),this.grid.renderer.invalidate({header:!0,rows:!0})}syncTabs(){for(let[e,t]of this.tabs){let n=this.isOpen&&e===this.current;t.setAttribute("aria-expanded",String(n)),t.setAttribute("aria-selected",String(n))}}refresh(){let e=this.grid.store.state.locale;for(let[t,n]of this.tabs)n.textContent=t==="filters"?e.filters:t==="pivot"?e.pivot:e.columns;this.syncTabs(),this.columns.refresh(),this.filters.refresh(),this.pivot.refresh()}};var Pr=()=>typeof navigator!="undefined"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent||""),ke=i=>Pr()?`\u2318${i}`:`Ctrl+${i}`,ut=class{constructor(e){this.grid=e;this.popup=null;this.off=[];let t=e.renderer.root,n=o=>this.onContextMenu(o);t.addEventListener("contextmenu",n),this.detach=()=>t.removeEventListener("contextmenu",n)}destroy(){this.close(),this.detach()}onContextMenu(e){let{grid:t}=this;if(t.options.contextMenu===!1)return;let n=e.target,o=n.closest(".fg-header-cell");if(o){let s=o.dataset.col;if(!s||A(s)||o.classList.contains("fg-header-group"))return;e.preventDefault(),this.close(),t.menu.open(s,o);return}let r=t.renderer.cellAt(n);r&&(e.preventDefault(),t.renderer.gridEl.focus({preventScroll:!0}),!A(r.colId)&&!t.rangeContains(r.rowIndex,r.colId)&&(t.setFocus(r.rowIndex,r.colId),t.setRange({start:r,end:r})),this.open(e.clientX,e.clientY,r.rowIndex,r.colId))}openAtFocus(){var r;let e=this.grid.store.state.focus;if(!e||this.grid.options.contextMenu===!1)return;let t=this.grid.renderer.root.getBoundingClientRect(),n=this.grid.renderer.root.querySelector(`.fg-row[data-row="${e.rowIndex}"] .fg-cell[data-col="${CSS.escape(e.colId)}"]`),o=(r=n==null?void 0:n.getBoundingClientRect())!=null?r:t;this.open(o.left+8,o.bottom,e.rowIndex,e.colId)}defaultItems(e){let{grid:t}=this,n=t.store.state.locale,o=t.columns.getNode(e),r=o==null?void 0:o.def,s=!!r&&!A(e),a=[{label:n.copy,shortcut:ke("C"),action:()=>t.copyToClipboard(!1)},{label:n.copyWithHeaders,action:()=>t.copyToClipboard(!0)},{label:n.cut,shortcut:ke("X"),action:()=>t.cutToClipboard()},...t.store.state.selected.size?[{label:n.copyRows,action:()=>t.copyToClipboard(!1,!0)}]:[],{label:n.paste,shortcut:ke("V"),action:()=>this.pasteFromClipboard()}];(t.history.canUndo()||t.history.canRedo())&&a.push("separator",{label:n.undo,shortcut:ke("Z"),action:()=>t.undo(),disabled:!t.history.canUndo()},{label:n.redo,shortcut:ke("Y"),action:()=>t.redo(),disabled:!t.history.canRedo()}),t.options.rowSelection&&t.store.state.selected.size&&a.push({label:n.deleteRows,action:()=>t.api.removeSelectedRows()}),s&&(a.push("separator",{label:n.autosizeThis,action:()=>t.autoSize([e])}),r.lockVisible||a.push({label:n.hideColumn,action:()=>t.setColumnsVisible([e],!1)}),a.push({label:n.pinLeft,action:()=>t.setPinned(e,"left"),disabled:o.pinned==="left"},{label:n.pinRight,action:()=>t.setPinned(e,"right"),disabled:o.pinned==="right"},{label:n.unpin,action:()=>t.setPinned(e,null),disabled:!o.pinned})),a.push("separator"),t.options.rowSelection==="multiple"&&a.push({label:n.selectAllRows,action:()=>t.api.selectAll()}),a.push({label:n.chooseColumns,action:()=>t.chooser.open()});let l=t.rangeBounds();return l&&(l.r2>l.r1||l.c2>l.c1)&&a.push("separator",{label:n.chartBar,action:()=>t.api.createChart({type:"bar"})},{label:n.chartLine,action:()=>t.api.createChart({type:"line"})},{label:n.chartPie,action:()=>t.api.createChart({type:"pie"})}),a.push("separator",{label:n.exportCsv,action:()=>t.api.exportCsv()},{label:n.exportExcel,action:()=>t.api.exportXlsx()}),t.options.advancedFilter!==!1&&!t.options.pivot&&a.push("separator",{label:`${n.advancedFilter}\u2026`,action:()=>t.filterBuilder.open()}),a}pasteFromClipboard(){let e=typeof navigator!="undefined"?navigator.clipboard:void 0,t=()=>this.grid.toast(this.grid.store.state.locale.pasteHint.replace("Ctrl+V",ke("V")));if(!(e!=null&&e.readText))return t();e.readText().then(n=>this.grid.pasteText(n),t)}open(e,t,n,o){var w,R,k;this.close(),this.grid.menu.close();let{grid:r}=this,s=r.rowModel.getRow(n),a=r.columns.getColumn(o),l=this.defaultItems(o),d={row:(w=s==null?void 0:s.data)!=null?w:null,rowIndex:n,colId:o,value:s&&a&&!A(o)?B(a.def,s.data):void 0,defaultItems:l},c=r.options.contextMenu,u=l;if(typeof c=="function")try{u=c(d)}catch{u=l}let h=r.store.state.locale,f=C("div",`fg-menu fg-context-menu fg-theme-${r.store.state.theme}`,{role:"menu","aria-label":h.columnMenu});r.applyFontTo(f);let g=!0;for(let L of u){if(L==="separator"){g||f.append(C("div","fg-cm-sep",{role:"separator"})),g=!0;continue}let I=C("button","fg-menu-item fg-cm-item",{type:"button",role:"menuitem"}),b=C("span","fg-cm-label");if(b.textContent=L.label,I.append(b),L.shortcut){let M=C("span","fg-cm-shortcut");M.textContent=L.shortcut,I.append(M)}I.disabled=!!L.disabled,I.addEventListener("click",()=>{this.close(),L.action()}),f.append(I),g=!1}(R=f.lastElementChild)!=null&&R.classList.contains("fg-cm-sep")&&f.lastElementChild.remove(),oe(this.grid.renderer.root).append(f);let x=f.offsetWidth||220,y=f.offsetHeight||300;f.style.left=`${Math.max(4,Math.min(e,window.innerWidth-x-4))}px`,f.style.top=`${Math.max(4,Math.min(t,window.innerHeight-y-4))}px`,this.popup=f;let p=L=>{fe(L,f)||this.close()},v=L=>{if(L.key==="Escape"){this.close(),r.renderer.gridEl.focus();return}if(L.key!=="ArrowDown"&&L.key!=="ArrowUp")return;let I=[...f.querySelectorAll("button:not(:disabled)")],b=I.indexOf(Zn(f)),M=I[(b+(L.key==="ArrowDown"?1:I.length-1)+I.length)%I.length];M==null||M.focus(),L.preventDefault()},m=()=>this.close();document.addEventListener("pointerdown",p,!0),document.addEventListener("keydown",v,!0),r.renderer.scroller.addEventListener("scroll",m,{passive:!0}),this.off.push(()=>document.removeEventListener("pointerdown",p,!0),()=>document.removeEventListener("keydown",v,!0),()=>r.renderer.scroller.removeEventListener("scroll",m)),(k=f.querySelector("button:not(:disabled)"))==null||k.focus()}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null}};var ht=class{constructor(e){this.grid=e;this.onDown=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=this.source();if(!t)return;let{grid:n}=this,o=null,r=n.renderer.root,s=l=>{let d=n.renderer.cellAt(De(n.renderer.root,l.clientX,l.clientY)),c=d&&n.columns.getColumn(d.colId);if(!d||!c||A(c.id))return;let u=d.rowIndex>t.r2?d.rowIndex-t.r2:d.rowIndex<t.r1?d.rowIndex-t.r1:0,h=c.index>t.c2?c.index-t.c2:c.index<t.c1?c.index-t.c1:0;!u&&!h?o=null:Math.abs(u)>=Math.abs(h)?o={r1:Math.min(t.r1,d.rowIndex),r2:Math.max(t.r2,d.rowIndex),c1:t.c1,c2:t.c2}:o={r1:t.r1,r2:t.r2,c1:Math.min(t.c1,c.index),c2:Math.max(t.c2,c.index)},this.showPreview(o)},a=()=>{if(window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",a),this.preview.remove(),r.classList.remove("fg-range-dragging"),!o)return;let l=n.columns.displayed();n.fillRange({start:{rowIndex:o.r1,colId:l[o.c1].id},end:{rowIndex:o.r2,colId:l[o.c2].id}})};r.classList.add("fg-range-dragging"),window.addEventListener("pointermove",s),window.addEventListener("pointerup",a)};this.handle=C("div","fg-fill-handle",{"aria-hidden":"true"}),this.preview=C("div","fg-fill-preview",{"aria-hidden":"true"}),this.handle.addEventListener("pointerdown",this.onDown)}enabled(){let e=this.grid.options;return e.fillHandle!==!1&&e.rangeSelection!==!1}source(){let e=this.grid.rangeBounds();if(e)return e;let t=this.grid.store.state.focus,n=t&&this.grid.columns.getColumn(t.colId);return!t||!n||A(n.id)?null:{r1:t.rowIndex,r2:t.rowIndex,c1:n.index,c2:n.index}}cellEl(e,t){let n=this.grid.columns.displayed()[t];return n?this.grid.renderer.root.querySelector(`.fg-body .fg-row[data-row="${e}"] .fg-cell[data-col="${CSS.escape(n.id)}"]`):null}update(){let e=this.enabled()?this.source():null,t=this.grid.columns.displayed(),o=!!e&&t.slice(e.c1,e.c2+1).some(a=>a.def.editable&&a.def.field)&&e?this.cellEl(e.r2,e.c2):null;if(!o){this.handle.remove();return}let r=this.grid.renderer.root.getBoundingClientRect(),s=o.getBoundingClientRect();this.handle.style.left=`${(this.grid.renderer.rtl?s.left:s.right)-r.left-4}px`,this.handle.style.top=`${s.bottom-r.top-4}px`,this.handle.isConnected||this.grid.renderer.root.append(this.handle)}showPreview(e){let t=e&&this.cellEl(e.r1,e.c1),n=e&&this.cellEl(e.r2,e.c2);if(!t||!n){this.preview.remove();return}let o=this.grid.renderer.root.getBoundingClientRect(),r=t.getBoundingClientRect(),s=n.getBoundingClientRect();Object.assign(this.preview.style,{left:`${r.left-o.left}px`,top:`${r.top-o.top}px`,width:`${s.right-r.left}px`,height:`${s.bottom-r.top}px`}),this.preview.isConnected||this.grid.renderer.root.append(this.preview)}destroy(){this.handle.remove(),this.preview.remove()}};var Ar=1e4,ft=class{constructor(e){this.grid=e;this.matches=[];this.lookup=new Map;this.index=-1;this.query="";this.bar=null;this.countEl=null}get active(){return!!this.query}classFor(e,t){if(!this.query)return"";let n=this.lookup.get(`${e}|${t}`);return n===void 0?"":n===this.index?" fg-cell-match fg-cell-match-current":" fg-cell-match"}find(e){if(this.query=e.trim().toLowerCase(),this.matches=[],this.lookup.clear(),this.index=-1,this.query){let{grid:t}=this,n=t.store.state.locale.code,o=t.columns.displayed().filter(a=>!A(a.id)),r=o.map(a=>_(a.def,n)),s=t.rowModel.rows();e:for(let a=0;a<s.length;a++)if(!s[a].kind){for(let l=0;l<o.length;l++)if(r[l](B(o[l].def,s[a].data)).toLowerCase().includes(this.query)&&(this.lookup.set(`${a}|${o[l].id}`,this.matches.length),this.matches.push({rowIndex:a,colId:o[l].id}),this.matches.length>=Ar))break e}this.matches.length&&this.go(0)}return this.updateCount(),this.grid.renderer.invalidate({rows:!0}),this.matches.length}refresh(){this.query&&this.find(this.query)}next(){this.matches.length&&this.go((this.index+1)%this.matches.length)}previous(){this.matches.length&&this.go((this.index-1+this.matches.length)%this.matches.length)}clear(){this.query="",this.matches=[],this.lookup.clear(),this.index=-1,this.grid.renderer.invalidate({rows:!0})}go(e){this.index=e;let t=this.matches[e];this.grid.setFocus(t.rowIndex,t.colId),this.grid.renderer.ensureVisible(t.rowIndex,t.colId),this.updateCount(),this.grid.renderer.invalidate({rows:!0})}updateCount(){if(!this.countEl)return;let e=this.grid.store.state.locale;this.countEl.textContent=this.query?this.matches.length?`${this.index+1}/${this.matches.length}`:e.noMatches:""}openBar(){if(this.grid.options.findBar===!1)return;if(this.bar){this.bar.querySelector("input").focus();return}let e=this.grid.store.state.locale,t=C("div","fg-findbar",{role:"search"}),n=C("input","fg-input",{type:"search",placeholder:e.findPlaceholder,"aria-label":e.findPlaceholder});this.countEl=C("span","fg-findbar-count",{"aria-live":"polite"});let o=(r,s,a)=>{let l=C("button","fg-findbar-btn",{type:"button","aria-label":r,title:r});return l.textContent=s,l.addEventListener("click",a),l};t.append(n,this.countEl,o(e.findPrevious,"\u2191",()=>this.previous()),o(e.findNext,"\u2193",()=>this.next()),o(e.close,"\xD7",()=>this.closeBar())),n.addEventListener("input",()=>this.find(n.value)),t.addEventListener("keydown",r=>{r.stopPropagation(),r.key==="Escape"?(r.preventDefault(),this.closeBar()):r.key==="Enter"&&(r.preventDefault(),r.shiftKey?this.previous():this.next())}),this.grid.renderer.root.append(t),this.bar=t,n.focus()}closeBar(){var e;(e=this.bar)==null||e.remove(),this.bar=null,this.countEl=null,this.clear(),this.grid.renderer.gridEl.focus({preventScroll:!0})}};var $r=864e5;function Pe(i,e){if(!i.length||e<=0)return[];let t=()=>Array.from({length:e},(r,s)=>i[s%i.length]);if(i.every(r=>typeof r=="number"&&!Number.isNaN(r))){let r=i;if(r.length===1)return t();let s=r[1]-r[0];if(!r.every((l,d)=>d===0||Math.abs(l-r[d-1]-s)<1e-9))return t();let a=r[r.length-1];return Array.from({length:e},(l,d)=>Math.round((a+s*(d+1))*1e12)/1e12)}let n=i.map(r=>r instanceof Date||typeof r=="string"&&/^\d{4}-\d{2}-\d{2}/.test(r)?se(r):null);if(n.every(Boolean)&&i.length>=2){let r=n.map(a=>Math.round(a.getTime()/$r)),s=r[1]-r[0];if(r.every((a,l)=>l===0||a-r[l-1]===s)){let a=n[n.length-1],l=i[i.length-1]instanceof Date;return Array.from({length:e},(d,c)=>{let u=new Date(a.getFullYear(),a.getMonth(),a.getDate()+s*(c+1));return l?u:ee(u)})}return t()}let o=i[i.length-1];if(typeof o=="string"&&!G(o)&&i.every(r=>typeof r=="string")){let r=/^(.*?)(\d+)$/.exec(o);if(r){let s=r[2].length,a=Number(r[2]);return Array.from({length:e},(l,d)=>`${r[1]}${String(a+d+1).padStart(s,"0")}`)}}return t()}function Ut(i){let e=t=>/[\t\n\r"]/.test(t)?`"${t.replace(/"/g,'""')}"`:t;return i.map(t=>t.map(e).join(" ")).join(`\r
2
- `)}function to(i){return jt(i," ")}function jt(i,e){if(!i)return[];let t=[],n=[],o="",r=0,s=!1,a=!0;for(;r<i.length;){let l=i[r];if(s){if(l==='"'){if(i[r+1]==='"'){o+='"',r+=2;continue}s=!1,r++;continue}o+=l,r++;continue}if(l==='"'&&a){s=!0,a=!1,r++;continue}if(l===e){n.push(o),o="",a=!0,r++;continue}if(l==="\r"||l===`
1
+ "use strict";var FreeGrid=(()=>{var Pt=Object.defineProperty;var Uo=Object.getOwnPropertyDescriptor;var Ko=Object.getOwnPropertyNames;var jo=Object.prototype.hasOwnProperty;var _o=(i,e)=>{for(var t in e)Pt(i,t,{get:e[t],enumerable:!0})},Xo=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ko(e))!jo.call(i,o)&&o!==t&&Pt(i,o,{get:()=>e[o],enumerable:!(n=Uo(e,o))||n.enumerable});return i};var Yo=i=>Xo(Pt({},"__esModule",{value:!0}),i);var Bi={};_o(Bi,{buildWorkbook:()=>yn,createGrid:()=>Ho,csrfHeaders:()=>qo,en:()=>se,exportWorkbook:()=>Bo,loadData:()=>Vo,locales:()=>Wo,parseCsv:()=>bt,readXlsx:()=>Rt,registerLocale:()=>Ke,renderChart:()=>Mt,resolveLocale:()=>Ie,restDatasource:()=>xn,saveChanges:()=>zo,setLicenseKey:()=>To,verifyLicense:()=>hn,version:()=>ze,writeXlsx:()=>be});var Jo={code:"en",noRows:"No rows to show",filter:"Filter",apply:"Apply",reset:"Reset",selectAll:"(Select all)",search:"Search\u2026",blanks:"(Blanks)",value:"Value",valueTo:"To",sortAsc:"Sort ascending",sortDesc:"Sort descending",clearSort:"Clear sort",pinLeft:"Pin left",pinRight:"Pin right",unpin:"Unpin",columnMenu:"Column menu",selectRow:"Select row",selectAllRows:"Select all rows",chooseColumns:"Choose columns",columns:"Columns",autosizeThis:"Autosize this column",autosizeAll:"Autosize all columns",resetColumns:"Reset columns",hideColumn:"Hide column",close:"Close",copy:"Copy",cut:"Cut",copyWithHeaders:"Copy with headers",paste:"Paste",pasteHint:"Clipboard access was blocked. Press Ctrl+V to paste.",required:"This field is required",invalidValue:"Invalid value",and:"And",or:"Or",advancedFilter:"Advanced filter",addCondition:"Add condition",duplicate:"This value is already used",undo:"Undo",redo:"Redo",deleteRows:"Delete selected rows",copyRows:"Copy selected rows",statusRows:"{n} rows",statusFiltered:"{shown} of {total} rows",statusSelected:"{n} selected",count:"Count",sum:"Sum",avg:"Average",min:"Min",max:"Max",findPlaceholder:"Find in grid",noMatches:"No matches",findNext:"Next match",findPrevious:"Previous match",groupPanelHint:"Drag a column header here to group rows",groupByThis:"Group by this column",ungroup:"Remove grouping",expandAll:"Expand all",collapseAll:"Collapse all",pagerRange:"{from}\u2013{to} of {total}",pageOf:"Page {page} of {pages}",pageSize:"Rows per page",firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",loading:"Loading\u2026",loadFailed:"Could not load rows",filters:"Filters",clearFilters:"Clear all filters",exportCsv:"Export CSV",exportExcel:"Export Excel",pivot:"Pivot",pivotMode:"Pivot mode",pivotRows:"Row groups",pivotColumns:"Column labels",pivotValues:"Values",total:"Total",addColumn:"Add a column\u2026",chartBar:"Bar chart",chartStacked:"Stacked bar chart",chartLine:"Line chart",chartArea:"Area chart",chartPie:"Pie chart",chartDonut:"Donut chart",chartCombo:"Bar and line chart",chartScatter:"Scatter chart",freeBadge:"Free version",ops:{contains:"Contains",equals:"Equals",notEquals:"Does not equal",startsWith:"Starts with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",eq:"Equals",ne:"Does not equal",lt:"Less than",lte:"Less than or equal",gt:"Greater than",gte:"Greater than or equal",between:"Between",before:"Before",after:"After"}},se=Jo;var Cn=new Set;function O(i){Cn.has(i)||(Cn.add(i),console.warn(`[FreeGrid] ${i}`))}var me=new Map([["en",se]]);function Ke(i){me.set(i.code,i)}function Rn(i){let e=i.toLowerCase();for(let n of me.keys())if(n.toLowerCase()===e)return n;let t=e.split("-")[0];if(t==="zh"){if(/-(tw|hk|mo|hant)(-|$)/.test(e)&&me.has("zh-TW"))return"zh-TW";if(me.has("zh-CN"))return"zh-CN"}for(let n of me.keys())if(n.toLowerCase().split("-")[0]===t)return n}function Zo(){var i;return typeof navigator=="undefined"?[]:(i=navigator.languages)!=null&&i.length?navigator.languages:navigator.language?[navigator.language]:[]}function Qo(i){var e,t;return{...se,...i,code:(e=i.code)!=null?e:"en",ops:{...se.ops,...(t=i.ops)!=null?t:{}}}}function Ie(i,e=Zo()){if(i&&typeof i=="object")return Qo(i);if(typeof i=="string"){let t=Rn(i);return t?me.get(t):(O(`locale "${i}" is not registered \u2014 import it from "@freegridjs/core/locales/${i}" and pass the pack (or call registerLocale). Falling back to "en".`),se)}for(let t of e){let n=Rn(t);if(n)return me.get(n)}return se}var er={code:"de",noRows:"Keine Zeilen vorhanden",filter:"Filter",apply:"Anwenden",reset:"Zur\xFCcksetzen",selectAll:"(Alle ausw\xE4hlen)",search:"Suchen\u2026",blanks:"(Leer)",value:"Wert",valueTo:"Bis",sortAsc:"Aufsteigend sortieren",sortDesc:"Absteigend sortieren",clearSort:"Sortierung aufheben",pinLeft:"Links fixieren",pinRight:"Rechts fixieren",unpin:"Fixierung l\xF6sen",columnMenu:"Spaltenmen\xFC",selectRow:"Zeile ausw\xE4hlen",selectAllRows:"Alle Zeilen ausw\xE4hlen",chooseColumns:"Spalten ausw\xE4hlen",columns:"Spalten",autosizeThis:"Diese Spalte automatisch anpassen",autosizeAll:"Alle Spalten automatisch anpassen",resetColumns:"Spalten zur\xFCcksetzen",hideColumn:"Spalte ausblenden",close:"Schlie\xDFen",copy:"Kopieren",cut:"Ausschneiden",copyWithHeaders:"Mit \xDCberschriften kopieren",paste:"Einf\xFCgen",pasteHint:"Der Browser hat die Zwischenablage blockiert. Dr\xFCcken Sie Ctrl+V zum Einf\xFCgen.",required:"Dieses Feld ist erforderlich",invalidValue:"Ung\xFCltiger Wert",and:"Und",or:"Oder",advancedFilter:"Erweiterter Filter",addCondition:"Bedingung hinzuf\xFCgen",duplicate:"Dieser Wert wird bereits verwendet",undo:"R\xFCckg\xE4ngig",redo:"Wiederholen",deleteRows:"Ausgew\xE4hlte Zeilen l\xF6schen",copyRows:"Ausgew\xE4hlte Zeilen kopieren",statusRows:"{n} Zeilen",statusFiltered:"{shown} von {total} Zeilen",statusSelected:"{n} ausgew\xE4hlt",count:"Anzahl",sum:"Summe",avg:"Mittelwert",min:"Min",max:"Max",findPlaceholder:"Im Raster suchen",noMatches:"Keine Treffer",findNext:"N\xE4chster Treffer",findPrevious:"Vorheriger Treffer",groupPanelHint:"Spalten\xFCberschrift hierher ziehen, um zu gruppieren",groupByThis:"Nach dieser Spalte gruppieren",ungroup:"Gruppierung aufheben",expandAll:"Alle aufklappen",collapseAll:"Alle zuklappen",pagerRange:"{from}\u2013{to} von {total}",pageOf:"Seite {page} von {pages}",pageSize:"Zeilen pro Seite",firstPage:"Erste Seite",previousPage:"Vorherige Seite",nextPage:"N\xE4chste Seite",lastPage:"Letzte Seite",loading:"Wird geladen\u2026",loadFailed:"Zeilen konnten nicht geladen werden",filters:"Filter",clearFilters:"Alle Filter entfernen",exportCsv:"Als CSV exportieren",exportExcel:"Nach Excel exportieren",pivot:"Pivot",pivotMode:"Pivot-Modus",pivotRows:"Zeilengruppen",pivotColumns:"Spaltenbeschriftungen",pivotValues:"Werte",total:"Gesamt",addColumn:"Spalte hinzuf\xFCgen\u2026",chartBar:"Balkendiagramm",chartStacked:"Gestapelte Balken",chartLine:"Liniendiagramm",chartArea:"Fl\xE4chendiagramm",chartPie:"Kreisdiagramm",chartDonut:"Ringdiagramm",chartCombo:"Balken- und Liniendiagramm",chartScatter:"Streudiagramm",freeBadge:"Kostenlose Version",ops:{contains:"Enth\xE4lt",equals:"Gleich",notEquals:"Ungleich",startsWith:"Beginnt mit",endsWith:"Endet mit",blank:"Leer",notBlank:"Nicht leer",eq:"Gleich",ne:"Ungleich",lt:"Kleiner als",lte:"Kleiner oder gleich",gt:"Gr\xF6\xDFer als",gte:"Gr\xF6\xDFer oder gleich",between:"Zwischen",before:"Vor",after:"Nach"}},Sn=er;var tr={code:"es",noRows:"No hay filas para mostrar",filter:"Filtro",apply:"Aplicar",reset:"Restablecer",selectAll:"(Seleccionar todo)",search:"Buscar\u2026",blanks:"(Vac\xEDos)",value:"Valor",valueTo:"Hasta",sortAsc:"Orden ascendente",sortDesc:"Orden descendente",clearSort:"Quitar orden",pinLeft:"Fijar a la izquierda",pinRight:"Fijar a la derecha",unpin:"Desfijar",columnMenu:"Men\xFA de columna",selectRow:"Seleccionar fila",selectAllRows:"Seleccionar todas las filas",chooseColumns:"Elegir columnas",columns:"Columnas",autosizeThis:"Ajustar esta columna",autosizeAll:"Ajustar todas las columnas",resetColumns:"Restablecer columnas",hideColumn:"Ocultar columna",close:"Cerrar",copy:"Copiar",cut:"Cortar",copyWithHeaders:"Copiar con encabezados",paste:"Pegar",pasteHint:"El navegador bloque\xF3 el portapapeles. Pulsa Ctrl+V para pegar.",required:"Este campo es obligatorio",invalidValue:"Valor no v\xE1lido",and:"Y",or:"O",advancedFilter:"Filtro avanzado",addCondition:"A\xF1adir condici\xF3n",duplicate:"Este valor ya est\xE1 en uso",undo:"Deshacer",redo:"Rehacer",deleteRows:"Eliminar filas seleccionadas",copyRows:"Copiar filas seleccionadas",statusRows:"{n} filas",statusFiltered:"{shown} de {total} filas",statusSelected:"{n} seleccionadas",count:"Recuento",sum:"Suma",avg:"Promedio",min:"M\xEDn.",max:"M\xE1x.",findPlaceholder:"Buscar en la tabla",noMatches:"Sin coincidencias",findNext:"Siguiente",findPrevious:"Anterior",groupPanelHint:"Arrastre aqu\xED un encabezado de columna para agrupar",groupByThis:"Agrupar por esta columna",ungroup:"Quitar agrupaci\xF3n",expandAll:"Expandir todo",collapseAll:"Contraer todo",pagerRange:"{from}\u2013{to} de {total}",pageOf:"P\xE1gina {page} de {pages}",pageSize:"Filas por p\xE1gina",firstPage:"Primera p\xE1gina",previousPage:"P\xE1gina anterior",nextPage:"P\xE1gina siguiente",lastPage:"\xDAltima p\xE1gina",loading:"Cargando\u2026",loadFailed:"No se pudieron cargar las filas",filters:"Filtros",clearFilters:"Quitar todos los filtros",exportCsv:"Exportar CSV",exportExcel:"Exportar a Excel",pivot:"Tabla din\xE1mica",pivotMode:"Modo tabla din\xE1mica",pivotRows:"Grupos de filas",pivotColumns:"Etiquetas de columna",pivotValues:"Valores",total:"Total",addColumn:"A\xF1adir columna\u2026",chartBar:"Gr\xE1fico de barras",chartStacked:"Barras apiladas",chartLine:"Gr\xE1fico de l\xEDneas",chartArea:"Gr\xE1fico de \xE1reas",chartPie:"Gr\xE1fico circular",chartDonut:"Gr\xE1fico de anillo",chartCombo:"Gr\xE1fico de barras y l\xEDneas",chartScatter:"Gr\xE1fico de dispersi\xF3n",freeBadge:"Versi\xF3n gratuita",ops:{contains:"Contiene",equals:"Igual a",notEquals:"Distinto de",startsWith:"Empieza por",endsWith:"Termina en",blank:"Vac\xEDo",notBlank:"No vac\xEDo",eq:"Igual a",ne:"Distinto de",lt:"Menor que",lte:"Menor o igual que",gt:"Mayor que",gte:"Mayor o igual que",between:"Entre",before:"Antes de",after:"Despu\xE9s de"}},kn=tr;var nr={code:"fr",noRows:"Aucune ligne \xE0 afficher",filter:"Filtre",apply:"Appliquer",reset:"R\xE9initialiser",selectAll:"(Tout s\xE9lectionner)",search:"Rechercher\u2026",blanks:"(Vides)",value:"Valeur",valueTo:"\xC0",sortAsc:"Tri croissant",sortDesc:"Tri d\xE9croissant",clearSort:"Annuler le tri",pinLeft:"\xC9pingler \xE0 gauche",pinRight:"\xC9pingler \xE0 droite",unpin:"D\xE9s\xE9pingler",columnMenu:"Menu de colonne",selectRow:"S\xE9lectionner la ligne",selectAllRows:"S\xE9lectionner toutes les lignes",chooseColumns:"Choisir les colonnes",columns:"Colonnes",autosizeThis:"Ajuster cette colonne",autosizeAll:"Ajuster toutes les colonnes",resetColumns:"R\xE9initialiser les colonnes",hideColumn:"Masquer la colonne",close:"Fermer",copy:"Copier",cut:"Couper",copyWithHeaders:"Copier avec les en-t\xEAtes",paste:"Coller",pasteHint:"Le navigateur a bloqu\xE9 le presse-papiers. Appuyez sur Ctrl+V pour coller.",required:"Ce champ est obligatoire",invalidValue:"Valeur non valide",and:"Et",or:"Ou",advancedFilter:"Filtre avanc\xE9",addCondition:"Ajouter une condition",duplicate:"Cette valeur est d\xE9j\xE0 utilis\xE9e",undo:"Annuler",redo:"R\xE9tablir",deleteRows:"Supprimer les lignes s\xE9lectionn\xE9es",copyRows:"Copier les lignes s\xE9lectionn\xE9es",statusRows:"{n} lignes",statusFiltered:"{shown} sur {total} lignes",statusSelected:"{n} s\xE9lectionn\xE9es",count:"Nombre",sum:"Somme",avg:"Moyenne",min:"Min",max:"Max",findPlaceholder:"Rechercher dans la grille",noMatches:"Aucun r\xE9sultat",findNext:"Suivant",findPrevious:"Pr\xE9c\xE9dent",groupPanelHint:"Faites glisser un en-t\xEAte de colonne ici pour regrouper",groupByThis:"Regrouper par cette colonne",ungroup:"Supprimer le regroupement",expandAll:"Tout d\xE9velopper",collapseAll:"Tout r\xE9duire",pagerRange:"{from}\u2013{to} sur {total}",pageOf:"Page {page} sur {pages}",pageSize:"Lignes par page",firstPage:"Premi\xE8re page",previousPage:"Page pr\xE9c\xE9dente",nextPage:"Page suivante",lastPage:"Derni\xE8re page",loading:"Chargement\u2026",loadFailed:"Impossible de charger les lignes",filters:"Filtres",clearFilters:"Effacer tous les filtres",exportCsv:"Exporter en CSV",exportExcel:"Exporter vers Excel",pivot:"Tableau crois\xE9",pivotMode:"Mode tableau crois\xE9",pivotRows:"Groupes de lignes",pivotColumns:"\xC9tiquettes de colonnes",pivotValues:"Valeurs",total:"Total",addColumn:"Ajouter une colonne\u2026",chartBar:"Histogramme",chartStacked:"Histogramme empil\xE9",chartLine:"Courbes",chartArea:"Aires",chartPie:"Secteurs",chartDonut:"Graphique en anneau",chartCombo:"Graphique barres et lignes",chartScatter:"Nuage de points",freeBadge:"Version gratuite",ops:{contains:"Contient",equals:"\xC9gal \xE0",notEquals:"Diff\xE9rent de",startsWith:"Commence par",endsWith:"Se termine par",blank:"Vide",notBlank:"Non vide",eq:"\xC9gal \xE0",ne:"Diff\xE9rent de",lt:"Inf\xE9rieur \xE0",lte:"Inf\xE9rieur ou \xE9gal \xE0",gt:"Sup\xE9rieur \xE0",gte:"Sup\xE9rieur ou \xE9gal \xE0",between:"Entre",before:"Avant",after:"Apr\xE8s"}},Mn=nr;var or={code:"ja",noRows:"\u8868\u793A\u3059\u308B\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",filter:"\u30D5\u30A3\u30EB\u30BF\u30FC",apply:"\u9069\u7528",reset:"\u30EA\u30BB\u30C3\u30C8",selectAll:"(\u3059\u3079\u3066\u9078\u629E)",search:"\u691C\u7D22\u2026",blanks:"(\u7A7A\u767D)",value:"\u5024",valueTo:"\u7D42\u4E86\u5024",sortAsc:"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048",sortDesc:"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048",clearSort:"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664",pinLeft:"\u5DE6\u306B\u56FA\u5B9A",pinRight:"\u53F3\u306B\u56FA\u5B9A",unpin:"\u56FA\u5B9A\u3092\u89E3\u9664",columnMenu:"\u5217\u30E1\u30CB\u30E5\u30FC",selectRow:"\u884C\u3092\u9078\u629E",selectAllRows:"\u3059\u3079\u3066\u306E\u884C\u3092\u9078\u629E",chooseColumns:"\u5217\u3092\u9078\u629E",columns:"\u5217",autosizeThis:"\u3053\u306E\u5217\u306E\u5E45\u3092\u81EA\u52D5\u8ABF\u6574",autosizeAll:"\u3059\u3079\u3066\u306E\u5217\u306E\u5E45\u3092\u81EA\u52D5\u8ABF\u6574",resetColumns:"\u5217\u3092\u30EA\u30BB\u30C3\u30C8",hideColumn:"\u5217\u3092\u975E\u8868\u793A",close:"\u9589\u3058\u308B",copy:"\u30B3\u30D4\u30FC",cut:"\u5207\u308A\u53D6\u308A",copyWithHeaders:"\u30D8\u30C3\u30C0\u30FC\u4ED8\u304D\u3067\u30B3\u30D4\u30FC",paste:"\u8CBC\u308A\u4ED8\u3051",pasteHint:"\u30D6\u30E9\u30A6\u30B6\u30FC\u304C\u30AF\u30EA\u30C3\u30D7\u30DC\u30FC\u30C9\u3078\u306E\u30A2\u30AF\u30BB\u30B9\u3092\u30D6\u30ED\u30C3\u30AF\u3057\u307E\u3057\u305F\u3002Ctrl+V \u3067\u8CBC\u308A\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\u3002",required:"\u3053\u306E\u9805\u76EE\u306F\u5FC5\u9808\u3067\u3059",invalidValue:"\u7121\u52B9\u306A\u5024\u3067\u3059",and:"\u304B\u3064",or:"\u307E\u305F\u306F",advancedFilter:"\u8A73\u7D30\u30D5\u30A3\u30EB\u30BF\u30FC",addCondition:"\u6761\u4EF6\u3092\u8FFD\u52A0",duplicate:"\u3053\u306E\u5024\u306F\u3059\u3067\u306B\u4F7F\u308F\u308C\u3066\u3044\u307E\u3059",undo:"\u5143\u306B\u623B\u3059",redo:"\u3084\u308A\u76F4\u3057",deleteRows:"\u9078\u629E\u3057\u305F\u884C\u3092\u524A\u9664",copyRows:"\u9078\u629E\u3057\u305F\u884C\u3092\u30B3\u30D4\u30FC",statusRows:"{n} \u884C",statusFiltered:"{total} \u884C\u4E2D {shown} \u884C",statusSelected:"{n} \u4EF6\u9078\u629E",count:"\u30C7\u30FC\u30BF\u306E\u500B\u6570",sum:"\u5408\u8A08",avg:"\u5E73\u5747",min:"\u6700\u5C0F",max:"\u6700\u5927",findPlaceholder:"\u30B0\u30EA\u30C3\u30C9\u5185\u3092\u691C\u7D22",noMatches:"\u4E00\u81F4\u306A\u3057",findNext:"\u6B21\u3092\u691C\u7D22",findPrevious:"\u524D\u3092\u691C\u7D22",groupPanelHint:"\u5217\u898B\u51FA\u3057\u3092\u3053\u3053\u306B\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30B0\u30EB\u30FC\u30D7\u5316",groupByThis:"\u3053\u306E\u5217\u3067\u30B0\u30EB\u30FC\u30D7\u5316",ungroup:"\u30B0\u30EB\u30FC\u30D7\u5316\u3092\u89E3\u9664",expandAll:"\u3059\u3079\u3066\u5C55\u958B",collapseAll:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u3080",pagerRange:"{total} \u4EF6\u4E2D {from}\u2013{to} \u4EF6",pageOf:"{pages} \u30DA\u30FC\u30B8\u4E2D {page} \u30DA\u30FC\u30B8",pageSize:"1 \u30DA\u30FC\u30B8\u306E\u884C\u6570",firstPage:"\u6700\u521D\u306E\u30DA\u30FC\u30B8",previousPage:"\u524D\u306E\u30DA\u30FC\u30B8",nextPage:"\u6B21\u306E\u30DA\u30FC\u30B8",lastPage:"\u6700\u5F8C\u306E\u30DA\u30FC\u30B8",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D\u2026",loadFailed:"\u884C\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F",filters:"\u30D5\u30A3\u30EB\u30BF\u30FC",clearFilters:"\u3059\u3079\u3066\u306E\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u89E3\u9664",exportCsv:"CSV \u306B\u66F8\u304D\u51FA\u3059",exportExcel:"Excel \u306B\u66F8\u304D\u51FA\u3059",pivot:"\u30D4\u30DC\u30C3\u30C8",pivotMode:"\u30D4\u30DC\u30C3\u30C8\u30E2\u30FC\u30C9",pivotRows:"\u884C\u30B0\u30EB\u30FC\u30D7",pivotColumns:"\u5217\u30E9\u30D9\u30EB",pivotValues:"\u5024",total:"\u5408\u8A08",addColumn:"\u5217\u3092\u8FFD\u52A0\u2026",chartBar:"\u68D2\u30B0\u30E9\u30D5",chartStacked:"\u7A4D\u307F\u4E0A\u3052\u68D2\u30B0\u30E9\u30D5",chartLine:"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",chartArea:"\u9762\u30B0\u30E9\u30D5",chartPie:"\u5186\u30B0\u30E9\u30D5",chartDonut:"\u30C9\u30FC\u30CA\u30C4\u30B0\u30E9\u30D5",chartCombo:"\u68D2\u30FB\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",chartScatter:"\u6563\u5E03\u56F3",freeBadge:"\u7121\u6599\u7248\u3092\u4F7F\u7528\u4E2D",ops:{contains:"\u542B\u3080",equals:"\u7B49\u3057\u3044",notEquals:"\u7B49\u3057\u304F\u306A\u3044",startsWith:"\u3067\u59CB\u307E\u308B",endsWith:"\u3067\u7D42\u308F\u308B",blank:"\u7A7A\u767D",notBlank:"\u7A7A\u767D\u4EE5\u5916",eq:"\u7B49\u3057\u3044",ne:"\u7B49\u3057\u304F\u306A\u3044",lt:"\u3088\u308A\u5C0F\u3055\u3044",lte:"\u4EE5\u4E0B",gt:"\u3088\u308A\u5927\u304D\u3044",gte:"\u4EE5\u4E0A",between:"\u7BC4\u56F2\u5185",before:"\u3088\u308A\u524D",after:"\u3088\u308A\u5F8C"}},En=or;var rr={code:"ko",noRows:"\uD45C\uC2DC\uD560 \uB370\uC774\uD130\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4",filter:"\uD544\uD130",apply:"\uC801\uC6A9",reset:"\uCD08\uAE30\uD654",selectAll:"(\uC804\uCCB4 \uC120\uD0DD)",search:"\uAC80\uC0C9\u2026",blanks:"(\uBE48 \uAC12)",value:"\uAC12",valueTo:"\uB05D \uAC12",sortAsc:"\uC624\uB984\uCC28\uC21C \uC815\uB82C",sortDesc:"\uB0B4\uB9BC\uCC28\uC21C \uC815\uB82C",clearSort:"\uC815\uB82C \uD574\uC81C",pinLeft:"\uC67C\uCABD \uACE0\uC815",pinRight:"\uC624\uB978\uCABD \uACE0\uC815",unpin:"\uACE0\uC815 \uD574\uC81C",columnMenu:"\uCEEC\uB7FC \uBA54\uB274",selectRow:"\uD589 \uC120\uD0DD",selectAllRows:"\uC804\uCCB4 \uD589 \uC120\uD0DD",chooseColumns:"\uCEEC\uB7FC \uC120\uD0DD",columns:"\uCEEC\uB7FC",autosizeThis:"\uC774 \uCEEC\uB7FC \uB108\uBE44 \uC790\uB3D9 \uB9DE\uCDA4",autosizeAll:"\uBAA8\uB4E0 \uCEEC\uB7FC \uB108\uBE44 \uC790\uB3D9 \uB9DE\uCDA4",resetColumns:"\uCEEC\uB7FC \uCD08\uAE30\uD654",hideColumn:"\uCEEC\uB7FC \uC228\uAE30\uAE30",close:"\uB2EB\uAE30",copy:"\uBCF5\uC0AC",cut:"\uC798\uB77C\uB0B4\uAE30",copyWithHeaders:"\uD5E4\uB354 \uD3EC\uD568 \uBCF5\uC0AC",paste:"\uBD99\uC5EC\uB123\uAE30",pasteHint:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uD074\uB9BD\uBCF4\uB4DC \uC811\uADFC\uC744 \uB9C9\uC558\uC2B5\uB2C8\uB2E4. Ctrl+V\uB85C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.",required:"\uD544\uC218 \uC785\uB825 \uD56D\uBAA9\uC785\uB2C8\uB2E4",invalidValue:"\uC62C\uBC14\uB978 \uAC12\uC774 \uC544\uB2D9\uB2C8\uB2E4",and:"\uADF8\uB9AC\uACE0",or:"\uB610\uB294",advancedFilter:"\uACE0\uAE09 \uD544\uD130",addCondition:"\uC870\uAC74 \uCD94\uAC00",duplicate:"\uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC778 \uAC12\uC785\uB2C8\uB2E4",undo:"\uC2E4\uD589 \uCDE8\uC18C",redo:"\uB2E4\uC2DC \uC2E4\uD589",deleteRows:"\uC120\uD0DD\uD55C \uD589 \uC0AD\uC81C",copyRows:"\uC120\uD0DD\uD55C \uD589 \uBCF5\uC0AC",statusRows:"{n}\uD589",statusFiltered:"{total}\uD589 \uC911 {shown}\uD589",statusSelected:"{n}\uAC1C \uC120\uD0DD",count:"\uAC1C\uC218",sum:"\uD569\uACC4",avg:"\uD3C9\uADE0",min:"\uCD5C\uC18C",max:"\uCD5C\uB300",findPlaceholder:"\uADF8\uB9AC\uB4DC\uC5D0\uC11C \uCC3E\uAE30",noMatches:"\uC77C\uCE58 \uD56D\uBAA9 \uC5C6\uC74C",findNext:"\uB2E4\uC74C \uCC3E\uAE30",findPrevious:"\uC774\uC804 \uCC3E\uAE30",groupPanelHint:"\uC5F4 \uBA38\uB9AC\uAE00\uC744 \uC5EC\uAE30\uB85C \uB04C\uC5B4\uC640 \uD589\uC744 \uBB36\uC73C\uC138\uC694",groupByThis:"\uC774 \uC5F4\uB85C \uBB36\uAE30",ungroup:"\uBB36\uAE30 \uD574\uC81C",expandAll:"\uBAA8\uB450 \uD3BC\uCE58\uAE30",collapseAll:"\uBAA8\uB450 \uC811\uAE30",pagerRange:"{total}\uAC1C \uC911 {from}\u2013{to}",pageOf:"{pages}\uCABD \uC911 {page}\uCABD",pageSize:"\uCABD\uB2F9 \uD589 \uC218",firstPage:"\uCCAB \uCABD",previousPage:"\uC774\uC804 \uCABD",nextPage:"\uB2E4\uC74C \uCABD",lastPage:"\uB9C8\uC9C0\uB9C9 \uCABD",loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026",loadFailed:"\uD589\uC744 \uBD88\uB7EC\uC624\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4",filters:"\uD544\uD130",clearFilters:"\uD544\uD130 \uBAA8\uB450 \uC9C0\uC6B0\uAE30",exportCsv:"CSV\uB85C \uB0B4\uBCF4\uB0B4\uAE30",exportExcel:"\uC5D1\uC140\uB85C \uB0B4\uBCF4\uB0B4\uAE30",pivot:"\uD53C\uBC97",pivotMode:"\uD53C\uBC97 \uBAA8\uB4DC",pivotRows:"\uD589 \uADF8\uB8F9",pivotColumns:"\uC5F4 \uB808\uC774\uBE14",pivotValues:"\uAC12",total:"\uD569\uACC4",addColumn:"\uCEEC\uB7FC \uCD94\uAC00\u2026",chartBar:"\uB9C9\uB300 \uCC28\uD2B8",chartStacked:"\uB204\uC801 \uB9C9\uB300 \uCC28\uD2B8",chartLine:"\uAEBE\uC740\uC120 \uCC28\uD2B8",chartArea:"\uC601\uC5ED \uCC28\uD2B8",chartPie:"\uC6D0\uD615 \uCC28\uD2B8",chartDonut:"\uB3C4\uB11B \uCC28\uD2B8",chartCombo:"\uB9C9\uB300\xB7\uAEBE\uC740\uC120 \uCC28\uD2B8",chartScatter:"\uBD84\uC0B0\uD615 \uCC28\uD2B8",freeBadge:"\uBB34\uB8CC \uC0AC\uC6A9 \uC911",ops:{contains:"\uD3EC\uD568",equals:"\uAC19\uC74C",notEquals:"\uAC19\uC9C0 \uC54A\uC74C",startsWith:"\uC2DC\uC791 \uBB38\uC790",endsWith:"\uB05D \uBB38\uC790",blank:"\uBE48 \uAC12",notBlank:"\uBE48 \uAC12 \uC544\uB2D8",eq:"\uAC19\uC74C",ne:"\uAC19\uC9C0 \uC54A\uC74C",lt:"\uBBF8\uB9CC",lte:"\uC774\uD558",gt:"\uCD08\uACFC",gte:"\uC774\uC0C1",between:"\uBC94\uC704",before:"\uC774\uC804",after:"\uC774\uD6C4"}},Ln=rr;var ir={code:"zh-CN",noRows:"\u6CA1\u6709\u53EF\u663E\u793A\u7684\u6570\u636E",filter:"\u7B5B\u9009",apply:"\u5E94\u7528",reset:"\u91CD\u7F6E",selectAll:"(\u5168\u9009)",search:"\u641C\u7D22\u2026",blanks:"(\u7A7A\u767D)",value:"\u503C",valueTo:"\u81F3",sortAsc:"\u5347\u5E8F\u6392\u5E8F",sortDesc:"\u964D\u5E8F\u6392\u5E8F",clearSort:"\u6E05\u9664\u6392\u5E8F",pinLeft:"\u56FA\u5B9A\u5728\u5DE6\u4FA7",pinRight:"\u56FA\u5B9A\u5728\u53F3\u4FA7",unpin:"\u53D6\u6D88\u56FA\u5B9A",columnMenu:"\u5217\u83DC\u5355",selectRow:"\u9009\u62E9\u884C",selectAllRows:"\u9009\u62E9\u6240\u6709\u884C",chooseColumns:"\u9009\u62E9\u5217",columns:"\u5217",autosizeThis:"\u81EA\u52A8\u8C03\u6574\u6B64\u5217\u5BBD\u5EA6",autosizeAll:"\u81EA\u52A8\u8C03\u6574\u6240\u6709\u5217\u5BBD\u5EA6",resetColumns:"\u91CD\u7F6E\u5217",hideColumn:"\u9690\u85CF\u5217",close:"\u5173\u95ED",copy:"\u590D\u5236",cut:"\u526A\u5207",copyWithHeaders:"\u8FDE\u540C\u6807\u9898\u590D\u5236",paste:"\u7C98\u8D34",pasteHint:"\u6D4F\u89C8\u5668\u963B\u6B62\u4E86\u526A\u8D34\u677F\u8BBF\u95EE\u3002\u8BF7\u6309 Ctrl+V \u7C98\u8D34\u3002",required:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879",invalidValue:"\u503C\u65E0\u6548",and:"\u4E14",or:"\u6216",advancedFilter:"\u9AD8\u7EA7\u7B5B\u9009",addCondition:"\u6DFB\u52A0\u6761\u4EF6",duplicate:"\u8BE5\u503C\u5DF2\u88AB\u4F7F\u7528",undo:"\u64A4\u9500",redo:"\u91CD\u505A",deleteRows:"\u5220\u9664\u6240\u9009\u884C",copyRows:"\u590D\u5236\u6240\u9009\u884C",statusRows:"{n} \u884C",statusFiltered:"{total} \u884C\u4E2D\u7684 {shown} \u884C",statusSelected:"\u5DF2\u9009 {n} \u884C",count:"\u8BA1\u6570",sum:"\u6C42\u548C",avg:"\u5E73\u5747\u503C",min:"\u6700\u5C0F\u503C",max:"\u6700\u5927\u503C",findPlaceholder:"\u5728\u8868\u683C\u4E2D\u67E5\u627E",noMatches:"\u65E0\u5339\u914D\u9879",findNext:"\u4E0B\u4E00\u4E2A",findPrevious:"\u4E0A\u4E00\u4E2A",groupPanelHint:"\u5C06\u5217\u6807\u9898\u62D6\u5230\u6B64\u5904\u4EE5\u5206\u7EC4",groupByThis:"\u6309\u6B64\u5217\u5206\u7EC4",ungroup:"\u53D6\u6D88\u5206\u7EC4",expandAll:"\u5168\u90E8\u5C55\u5F00",collapseAll:"\u5168\u90E8\u6298\u53E0",pagerRange:"\u7B2C {from}\u2013{to} \u6761\uFF0C\u5171 {total} \u6761",pageOf:"\u7B2C {page} \u9875\uFF0C\u5171 {pages} \u9875",pageSize:"\u6BCF\u9875\u884C\u6570",firstPage:"\u9996\u9875",previousPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",lastPage:"\u672B\u9875",loading:"\u52A0\u8F7D\u4E2D\u2026",loadFailed:"\u65E0\u6CD5\u52A0\u8F7D\u6570\u636E",filters:"\u7B5B\u9009",clearFilters:"\u6E05\u9664\u6240\u6709\u7B5B\u9009",exportCsv:"\u5BFC\u51FA CSV",exportExcel:"\u5BFC\u51FA Excel",pivot:"\u6570\u636E\u900F\u89C6",pivotMode:"\u900F\u89C6\u6A21\u5F0F",pivotRows:"\u884C\u5206\u7EC4",pivotColumns:"\u5217\u6807\u7B7E",pivotValues:"\u503C",total:"\u603B\u8BA1",addColumn:"\u6DFB\u52A0\u5217\u2026",chartBar:"\u67F1\u72B6\u56FE",chartStacked:"\u5806\u79EF\u67F1\u72B6\u56FE",chartLine:"\u6298\u7EBF\u56FE",chartArea:"\u9762\u79EF\u56FE",chartPie:"\u997C\u56FE",chartDonut:"\u73AF\u5F62\u56FE",chartCombo:"\u67F1\u7EBF\u7EC4\u5408\u56FE",chartScatter:"\u6563\u70B9\u56FE",freeBadge:"\u514D\u8D39\u4F7F\u7528\u4E2D",ops:{contains:"\u5305\u542B",equals:"\u7B49\u4E8E",notEquals:"\u4E0D\u7B49\u4E8E",startsWith:"\u5F00\u5934\u662F",endsWith:"\u7ED3\u5C3E\u662F",blank:"\u4E3A\u7A7A",notBlank:"\u4E0D\u4E3A\u7A7A",eq:"\u7B49\u4E8E",ne:"\u4E0D\u7B49\u4E8E",lt:"\u5C0F\u4E8E",lte:"\u5C0F\u4E8E\u6216\u7B49\u4E8E",gt:"\u5927\u4E8E",gte:"\u5927\u4E8E\u6216\u7B49\u4E8E",between:"\u4ECB\u4E8E",before:"\u65E9\u4E8E",after:"\u665A\u4E8E"}},Tn=ir;var sr={code:"zh-TW",noRows:"\u6C92\u6709\u53EF\u986F\u793A\u7684\u8CC7\u6599",filter:"\u7BE9\u9078",apply:"\u5957\u7528",reset:"\u91CD\u8A2D",selectAll:"(\u5168\u9078)",search:"\u641C\u5C0B\u2026",blanks:"(\u7A7A\u767D)",value:"\u503C",valueTo:"\u81F3",sortAsc:"\u905E\u589E\u6392\u5E8F",sortDesc:"\u905E\u6E1B\u6392\u5E8F",clearSort:"\u6E05\u9664\u6392\u5E8F",pinLeft:"\u56FA\u5B9A\u5728\u5DE6\u5074",pinRight:"\u56FA\u5B9A\u5728\u53F3\u5074",unpin:"\u53D6\u6D88\u56FA\u5B9A",columnMenu:"\u6B04\u4F4D\u9078\u55AE",selectRow:"\u9078\u53D6\u5217",selectAllRows:"\u9078\u53D6\u6240\u6709\u5217",chooseColumns:"\u9078\u64C7\u6B04\u4F4D",columns:"\u6B04\u4F4D",autosizeThis:"\u81EA\u52D5\u8ABF\u6574\u6B64\u6B04\u5BEC",autosizeAll:"\u81EA\u52D5\u8ABF\u6574\u6240\u6709\u6B04\u5BEC",resetColumns:"\u91CD\u8A2D\u6B04\u4F4D",hideColumn:"\u96B1\u85CF\u6B04\u4F4D",close:"\u95DC\u9589",copy:"\u8907\u88FD",cut:"\u526A\u4E0B",copyWithHeaders:"\u9023\u540C\u6A19\u984C\u8907\u88FD",paste:"\u8CBC\u4E0A",pasteHint:"\u7121\u6CD5\u5B58\u53D6\u526A\u8CBC\u7C3F\u3002\u8ACB\u6309 Ctrl+V \u8CBC\u4E0A\u3002",required:"\u6B64\u6B04\u4F4D\u70BA\u5FC5\u586B",invalidValue:"\u503C\u7121\u6548",and:"\u4E14",or:"\u6216",advancedFilter:"\u9032\u968E\u7BE9\u9078",addCondition:"\u65B0\u589E\u689D\u4EF6",duplicate:"\u6B64\u503C\u5DF2\u88AB\u4F7F\u7528",undo:"\u5FA9\u539F",redo:"\u91CD\u505A",deleteRows:"\u522A\u9664\u9078\u53D6\u7684\u5217",copyRows:"\u8907\u88FD\u9078\u53D6\u7684\u5217",statusRows:"{n} \u5217",statusFiltered:"{total} \u5217\u4E2D\u7684 {shown} \u5217",statusSelected:"\u5DF2\u9078\u53D6 {n} \u5217",count:"\u7B46\u6578",sum:"\u5408\u8A08",avg:"\u5E73\u5747",min:"\u6700\u5C0F",max:"\u6700\u5927",findPlaceholder:"\u5728\u8868\u683C\u4E2D\u5C0B\u627E",noMatches:"\u6C92\u6709\u7B26\u5408\u7684\u7D50\u679C",findNext:"\u4E0B\u4E00\u500B",findPrevious:"\u4E0A\u4E00\u500B",groupPanelHint:"\u5C07\u6B04\u4F4D\u6A19\u984C\u62D6\u66F3\u5230\u9019\u88E1\u4EE5\u5206\u7D44",groupByThis:"\u4F9D\u6B64\u6B04\u4F4D\u5206\u7D44",ungroup:"\u53D6\u6D88\u5206\u7D44",expandAll:"\u5168\u90E8\u5C55\u958B",collapseAll:"\u5168\u90E8\u647A\u758A",pagerRange:"{from}\u2013{to}\uFF0C\u5171 {total} \u7B46",pageOf:"\u7B2C {page} \u9801\uFF0C\u5171 {pages} \u9801",pageSize:"\u6BCF\u9801\u5217\u6578",firstPage:"\u7B2C\u4E00\u9801",previousPage:"\u4E0A\u4E00\u9801",nextPage:"\u4E0B\u4E00\u9801",lastPage:"\u6700\u5F8C\u4E00\u9801",loading:"\u8F09\u5165\u4E2D\u2026",loadFailed:"\u7121\u6CD5\u8F09\u5165\u8CC7\u6599",filters:"\u7BE9\u9078",clearFilters:"\u6E05\u9664\u6240\u6709\u7BE9\u9078",exportCsv:"\u532F\u51FA CSV",exportExcel:"\u532F\u51FA Excel",pivot:"\u6A1E\u7D10\u5206\u6790",pivotMode:"\u6A1E\u7D10\u5206\u6790\u6A21\u5F0F",pivotRows:"\u5217\u7FA4\u7D44",pivotColumns:"\u6B04\u6A19\u7C64",pivotValues:"\u503C",total:"\u7E3D\u8A08",addColumn:"\u65B0\u589E\u6B04\u4F4D\u2026",chartBar:"\u76F4\u689D\u5716",chartStacked:"\u5806\u758A\u76F4\u689D\u5716",chartLine:"\u6298\u7DDA\u5716",chartArea:"\u5340\u57DF\u5716",chartPie:"\u5713\u5F62\u5716",chartDonut:"\u74B0\u5708\u5716",chartCombo:"\u76F4\u689D\u8207\u6298\u7DDA\u5716",chartScatter:"\u6563\u4F48\u5716",freeBadge:"\u514D\u8CBB\u7248",ops:{contains:"\u5305\u542B",equals:"\u7B49\u65BC",notEquals:"\u4E0D\u7B49\u65BC",startsWith:"\u958B\u982D\u70BA",endsWith:"\u7D50\u5C3E\u70BA",blank:"\u7A7A\u767D",notBlank:"\u975E\u7A7A\u767D",eq:"\u7B49\u65BC",ne:"\u4E0D\u7B49\u65BC",lt:"\u5C0F\u65BC",lte:"\u5C0F\u65BC\u6216\u7B49\u65BC",gt:"\u5927\u65BC",gte:"\u5927\u65BC\u6216\u7B49\u65BC",between:"\u4ECB\u65BC",before:"\u65E9\u65BC",after:"\u665A\u65BC"}},In=sr;var ar={code:"vi",noRows:"Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",filter:"L\u1ECDc",apply:"\xC1p d\u1EE5ng",reset:"\u0110\u1EB7t l\u1EA1i",selectAll:"(Ch\u1ECDn t\u1EA5t c\u1EA3)",search:"T\xECm\u2026",blanks:"(Tr\u1ED1ng)",value:"Gi\xE1 tr\u1ECB",valueTo:"\u0110\u1EBFn",sortAsc:"S\u1EAFp x\u1EBFp t\u0103ng d\u1EA7n",sortDesc:"S\u1EAFp x\u1EBFp gi\u1EA3m d\u1EA7n",clearSort:"B\u1ECF s\u1EAFp x\u1EBFp",pinLeft:"Ghim tr\xE1i",pinRight:"Ghim ph\u1EA3i",unpin:"B\u1ECF ghim",columnMenu:"Menu c\u1ED9t",selectRow:"Ch\u1ECDn d\xF2ng",selectAllRows:"Ch\u1ECDn t\u1EA5t c\u1EA3 d\xF2ng",chooseColumns:"Ch\u1ECDn c\u1ED9t",columns:"C\u1ED9t",autosizeThis:"T\u1EF1 \u0111\u1ED9ng ch\u1EC9nh \u0111\u1ED9 r\u1ED9ng c\u1ED9t n\xE0y",autosizeAll:"T\u1EF1 \u0111\u1ED9ng ch\u1EC9nh \u0111\u1ED9 r\u1ED9ng t\u1EA5t c\u1EA3 c\u1ED9t",resetColumns:"\u0110\u1EB7t l\u1EA1i c\u1ED9t",hideColumn:"\u1EA8n c\u1ED9t",close:"\u0110\xF3ng",copy:"Sao ch\xE9p",cut:"C\u1EAFt",copyWithHeaders:"Sao ch\xE9p k\xE8m ti\xEAu \u0111\u1EC1",paste:"D\xE1n",pasteHint:"Kh\xF4ng truy c\u1EADp \u0111\u01B0\u1EE3c b\u1ED9 nh\u1EDB t\u1EA1m. Nh\u1EA5n Ctrl+V \u0111\u1EC3 d\xE1n.",required:"Tr\u01B0\u1EDDng n\xE0y l\xE0 b\u1EAFt bu\u1ED9c",invalidValue:"Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7",and:"V\xE0",or:"Ho\u1EB7c",advancedFilter:"L\u1ECDc n\xE2ng cao",addCondition:"Th\xEAm \u0111i\u1EC1u ki\u1EC7n",duplicate:"Gi\xE1 tr\u1ECB n\xE0y \u0111\xE3 \u0111\u01B0\u1EE3c d\xF9ng",undo:"Ho\xE0n t\xE1c",redo:"L\xE0m l\u1EA1i",deleteRows:"X\xF3a c\xE1c d\xF2ng \u0111\xE3 ch\u1ECDn",copyRows:"Sao ch\xE9p c\xE1c d\xF2ng \u0111\xE3 ch\u1ECDn",statusRows:"{n} d\xF2ng",statusFiltered:"{shown} / {total} d\xF2ng",statusSelected:"\u0110\xE3 ch\u1ECDn {n}",count:"S\u1ED1 l\u01B0\u1EE3ng",sum:"T\u1ED5ng",avg:"Trung b\xECnh",min:"Nh\u1ECF nh\u1EA5t",max:"L\u1EDBn nh\u1EA5t",findPlaceholder:"T\xECm trong b\u1EA3ng",noMatches:"Kh\xF4ng t\xECm th\u1EA5y",findNext:"K\u1EBFt qu\u1EA3 ti\u1EBFp",findPrevious:"K\u1EBFt qu\u1EA3 tr\u01B0\u1EDBc",groupPanelHint:"K\xE9o ti\xEAu \u0111\u1EC1 c\u1ED9t v\xE0o \u0111\xE2y \u0111\u1EC3 nh\xF3m d\xF2ng",groupByThis:"Nh\xF3m theo c\u1ED9t n\xE0y",ungroup:"B\u1ECF nh\xF3m",expandAll:"M\u1EDF r\u1ED9ng t\u1EA5t c\u1EA3",collapseAll:"Thu g\u1ECDn t\u1EA5t c\u1EA3",pagerRange:"{from}\u2013{to} / {total}",pageOf:"Trang {page} / {pages}",pageSize:"S\u1ED1 d\xF2ng m\u1ED7i trang",firstPage:"Trang \u0111\u1EA7u",previousPage:"Trang tr\u01B0\u1EDBc",nextPage:"Trang sau",lastPage:"Trang cu\u1ED1i",loading:"\u0110ang t\u1EA3i\u2026",loadFailed:"Kh\xF4ng t\u1EA3i \u0111\u01B0\u1EE3c d\u1EEF li\u1EC7u",filters:"B\u1ED9 l\u1ECDc",clearFilters:"X\xF3a t\u1EA5t c\u1EA3 b\u1ED9 l\u1ECDc",exportCsv:"Xu\u1EA5t CSV",exportExcel:"Xu\u1EA5t Excel",pivot:"Pivot",pivotMode:"Ch\u1EBF \u0111\u1ED9 pivot",pivotRows:"Nh\xF3m d\xF2ng",pivotColumns:"Nh\xE3n c\u1ED9t",pivotValues:"Gi\xE1 tr\u1ECB",total:"T\u1ED5ng c\u1ED9ng",addColumn:"Th\xEAm c\u1ED9t\u2026",chartBar:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t",chartStacked:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t ch\u1ED3ng",chartLine:"Bi\u1EC3u \u0111\u1ED3 \u0111\u01B0\u1EDDng",chartArea:"Bi\u1EC3u \u0111\u1ED3 v\xF9ng",chartPie:"Bi\u1EC3u \u0111\u1ED3 tr\xF2n",chartDonut:"Bi\u1EC3u \u0111\u1ED3 v\xE0nh khuy\xEAn",chartCombo:"Bi\u1EC3u \u0111\u1ED3 c\u1ED9t v\xE0 \u0111\u01B0\u1EDDng",chartScatter:"Bi\u1EC3u \u0111\u1ED3 ph\xE2n t\xE1n",freeBadge:"B\u1EA3n mi\u1EC5n ph\xED",ops:{contains:"Ch\u1EE9a",equals:"B\u1EB1ng",notEquals:"Kh\xE1c",startsWith:"B\u1EAFt \u0111\u1EA7u b\u1EB1ng",endsWith:"K\u1EBFt th\xFAc b\u1EB1ng",blank:"Tr\u1ED1ng",notBlank:"Kh\xF4ng tr\u1ED1ng",eq:"B\u1EB1ng",ne:"Kh\xE1c",lt:"Nh\u1ECF h\u01A1n",lte:"Nh\u1ECF h\u01A1n ho\u1EB7c b\u1EB1ng",gt:"L\u1EDBn h\u01A1n",gte:"L\u1EDBn h\u01A1n ho\u1EB7c b\u1EB1ng",between:"Trong kho\u1EA3ng",before:"Tr\u01B0\u1EDBc",after:"Sau"}},Dn=ar;var lr={code:"th",noRows:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",filter:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",apply:"\u0E43\u0E0A\u0E49",reset:"\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15",selectAll:"(\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14)",search:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u2026",blanks:"(\u0E27\u0E48\u0E32\u0E07)",value:"\u0E04\u0E48\u0E32",valueTo:"\u0E16\u0E36\u0E07",sortAsc:"\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E19\u0E49\u0E2D\u0E22\u0E44\u0E1B\u0E21\u0E32\u0E01",sortDesc:"\u0E40\u0E23\u0E35\u0E22\u0E07\u0E08\u0E32\u0E01\u0E21\u0E32\u0E01\u0E44\u0E1B\u0E19\u0E49\u0E2D\u0E22",clearSort:"\u0E25\u0E49\u0E32\u0E07\u0E01\u0E32\u0E23\u0E40\u0E23\u0E35\u0E22\u0E07",pinLeft:"\u0E15\u0E23\u0E36\u0E07\u0E0B\u0E49\u0E32\u0E22",pinRight:"\u0E15\u0E23\u0E36\u0E07\u0E02\u0E27\u0E32",unpin:"\u0E40\u0E25\u0E34\u0E01\u0E15\u0E23\u0E36\u0E07",columnMenu:"\u0E40\u0E21\u0E19\u0E39\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",selectRow:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E41\u0E16\u0E27",selectAllRows:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E17\u0E38\u0E01\u0E41\u0E16\u0E27",chooseColumns:"\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",columns:"\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",autosizeThis:"\u0E1B\u0E23\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",autosizeAll:"\u0E1B\u0E23\u0E31\u0E1A\u0E04\u0E27\u0E32\u0E21\u0E01\u0E27\u0E49\u0E32\u0E07\u0E17\u0E38\u0E01\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E2D\u0E31\u0E15\u0E42\u0E19\u0E21\u0E31\u0E15\u0E34",resetColumns:"\u0E23\u0E35\u0E40\u0E0B\u0E47\u0E15\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",hideColumn:"\u0E0B\u0E48\u0E2D\u0E19\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",close:"\u0E1B\u0E34\u0E14",copy:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01",cut:"\u0E15\u0E31\u0E14",copyWithHeaders:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E1E\u0E23\u0E49\u0E2D\u0E21\u0E2B\u0E31\u0E27\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",paste:"\u0E27\u0E32\u0E07",pasteHint:"\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07\u0E04\u0E25\u0E34\u0E1B\u0E1A\u0E2D\u0E23\u0E4C\u0E14\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E01\u0E14 Ctrl+V \u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E27\u0E32\u0E07",required:"\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E23\u0E2D\u0E01\u0E0A\u0E48\u0E2D\u0E07\u0E19\u0E35\u0E49",invalidValue:"\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07",and:"\u0E41\u0E25\u0E30",or:"\u0E2B\u0E23\u0E37\u0E2D",advancedFilter:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E02\u0E31\u0E49\u0E19\u0E2A\u0E39\u0E07",addCondition:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E07\u0E37\u0E48\u0E2D\u0E19\u0E44\u0E02",duplicate:"\u0E04\u0E48\u0E32\u0E19\u0E35\u0E49\u0E16\u0E39\u0E01\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27",undo:"\u0E40\u0E25\u0E34\u0E01\u0E17\u0E33",redo:"\u0E17\u0E33\u0E0B\u0E49\u0E33",deleteRows:"\u0E25\u0E1A\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01",copyRows:"\u0E04\u0E31\u0E14\u0E25\u0E2D\u0E01\u0E41\u0E16\u0E27\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01",statusRows:"{n} \u0E41\u0E16\u0E27",statusFiltered:"{shown} \u0E08\u0E32\u0E01 {total} \u0E41\u0E16\u0E27",statusSelected:"\u0E40\u0E25\u0E37\u0E2D\u0E01 {n} \u0E41\u0E16\u0E27",count:"\u0E08\u0E33\u0E19\u0E27\u0E19",sum:"\u0E1C\u0E25\u0E23\u0E27\u0E21",avg:"\u0E04\u0E48\u0E32\u0E40\u0E09\u0E25\u0E35\u0E48\u0E22",min:"\u0E15\u0E48\u0E33\u0E2A\u0E38\u0E14",max:"\u0E2A\u0E39\u0E07\u0E2A\u0E38\u0E14",findPlaceholder:"\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E43\u0E19\u0E15\u0E32\u0E23\u0E32\u0E07",noMatches:"\u0E44\u0E21\u0E48\u0E1E\u0E1A",findNext:"\u0E16\u0E31\u0E14\u0E44\u0E1B",findPrevious:"\u0E01\u0E48\u0E2D\u0E19\u0E2B\u0E19\u0E49\u0E32",groupPanelHint:"\u0E25\u0E32\u0E01\u0E2B\u0E31\u0E27\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E21\u0E32\u0E17\u0E35\u0E48\u0E19\u0E35\u0E48\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21",groupByThis:"\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21\u0E15\u0E32\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u0E19\u0E35\u0E49",ungroup:"\u0E40\u0E25\u0E34\u0E01\u0E08\u0E31\u0E14\u0E01\u0E25\u0E38\u0E48\u0E21",expandAll:"\u0E02\u0E22\u0E32\u0E22\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",collapseAll:"\u0E22\u0E38\u0E1A\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",pagerRange:"{from}\u2013{to} \u0E08\u0E32\u0E01 {total}",pageOf:"\u0E2B\u0E19\u0E49\u0E32 {page} \u0E08\u0E32\u0E01 {pages}",pageSize:"\u0E41\u0E16\u0E27\u0E15\u0E48\u0E2D\u0E2B\u0E19\u0E49\u0E32",firstPage:"\u0E2B\u0E19\u0E49\u0E32\u0E41\u0E23\u0E01",previousPage:"\u0E2B\u0E19\u0E49\u0E32\u0E01\u0E48\u0E2D\u0E19",nextPage:"\u0E2B\u0E19\u0E49\u0E32\u0E16\u0E31\u0E14\u0E44\u0E1B",lastPage:"\u0E2B\u0E19\u0E49\u0E32\u0E2A\u0E38\u0E14\u0E17\u0E49\u0E32\u0E22",loading:"\u0E01\u0E33\u0E25\u0E31\u0E07\u0E42\u0E2B\u0E25\u0E14\u2026",loadFailed:"\u0E42\u0E2B\u0E25\u0E14\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08",filters:"\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07",clearFilters:"\u0E25\u0E49\u0E32\u0E07\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",exportCsv:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 CSV",exportExcel:"\u0E2A\u0E48\u0E07\u0E2D\u0E2D\u0E01 Excel",pivot:"Pivot",pivotMode:"\u0E42\u0E2B\u0E21\u0E14 Pivot",pivotRows:"\u0E01\u0E25\u0E38\u0E48\u0E21\u0E41\u0E16\u0E27",pivotColumns:"\u0E1B\u0E49\u0E32\u0E22\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C",pivotValues:"\u0E04\u0E48\u0E32",total:"\u0E23\u0E27\u0E21",addColumn:"\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E04\u0E2D\u0E25\u0E31\u0E21\u0E19\u0E4C\u2026",chartBar:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07",chartStacked:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07\u0E0B\u0E49\u0E2D\u0E19",chartLine:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E40\u0E2A\u0E49\u0E19",chartArea:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E1E\u0E37\u0E49\u0E19\u0E17\u0E35\u0E48",chartPie:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E27\u0E07\u0E01\u0E25\u0E21",chartDonut:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E42\u0E14\u0E19\u0E31\u0E17",chartCombo:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E41\u0E17\u0E48\u0E07\u0E41\u0E25\u0E30\u0E40\u0E2A\u0E49\u0E19",chartScatter:"\u0E41\u0E1C\u0E19\u0E20\u0E39\u0E21\u0E34\u0E01\u0E23\u0E30\u0E08\u0E32\u0E22",freeBadge:"\u0E23\u0E38\u0E48\u0E19\u0E1F\u0E23\u0E35",ops:{contains:"\u0E21\u0E35\u0E04\u0E33\u0E27\u0E48\u0E32",equals:"\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",notEquals:"\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",startsWith:"\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22",endsWith:"\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22",blank:"\u0E27\u0E48\u0E32\u0E07",notBlank:"\u0E44\u0E21\u0E48\u0E27\u0E48\u0E32\u0E07",eq:"\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",ne:"\u0E44\u0E21\u0E48\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",lt:"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",lte:"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",gt:"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",gte:"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32\u0E2B\u0E23\u0E37\u0E2D\u0E40\u0E17\u0E48\u0E32\u0E01\u0E31\u0E1A",between:"\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07",before:"\u0E01\u0E48\u0E2D\u0E19",after:"\u0E2B\u0E25\u0E31\u0E07"}},An=lr;var dr={code:"id",noRows:"Tidak ada data",filter:"Filter",apply:"Terapkan",reset:"Atur ulang",selectAll:"(Pilih semua)",search:"Cari\u2026",blanks:"(Kosong)",value:"Nilai",valueTo:"Sampai",sortAsc:"Urutkan naik",sortDesc:"Urutkan turun",clearSort:"Hapus urutan",pinLeft:"Sematkan kiri",pinRight:"Sematkan kanan",unpin:"Lepas sematan",columnMenu:"Menu kolom",selectRow:"Pilih baris",selectAllRows:"Pilih semua baris",chooseColumns:"Pilih kolom",columns:"Kolom",autosizeThis:"Sesuaikan lebar kolom ini",autosizeAll:"Sesuaikan lebar semua kolom",resetColumns:"Atur ulang kolom",hideColumn:"Sembunyikan kolom",close:"Tutup",copy:"Salin",cut:"Potong",copyWithHeaders:"Salin dengan judul",paste:"Tempel",pasteHint:"Akses papan klip diblokir. Tekan Ctrl+V untuk menempel.",required:"Kolom ini wajib diisi",invalidValue:"Nilai tidak valid",and:"Dan",or:"Atau",advancedFilter:"Filter lanjutan",addCondition:"Tambah kondisi",duplicate:"Nilai ini sudah dipakai",undo:"Urungkan",redo:"Ulangi",deleteRows:"Hapus baris terpilih",copyRows:"Salin baris terpilih",statusRows:"{n} baris",statusFiltered:"{shown} dari {total} baris",statusSelected:"{n} dipilih",count:"Jumlah data",sum:"Total",avg:"Rata-rata",min:"Min",max:"Maks",findPlaceholder:"Cari di tabel",noMatches:"Tidak ditemukan",findNext:"Berikutnya",findPrevious:"Sebelumnya",groupPanelHint:"Seret judul kolom ke sini untuk mengelompokkan",groupByThis:"Kelompokkan menurut kolom ini",ungroup:"Hapus pengelompokan",expandAll:"Buka semua",collapseAll:"Tutup semua",pagerRange:"{from}\u2013{to} dari {total}",pageOf:"Halaman {page} dari {pages}",pageSize:"Baris per halaman",firstPage:"Halaman pertama",previousPage:"Halaman sebelumnya",nextPage:"Halaman berikutnya",lastPage:"Halaman terakhir",loading:"Memuat\u2026",loadFailed:"Gagal memuat data",filters:"Filter",clearFilters:"Hapus semua filter",exportCsv:"Ekspor CSV",exportExcel:"Ekspor Excel",pivot:"Pivot",pivotMode:"Mode pivot",pivotRows:"Grup baris",pivotColumns:"Label kolom",pivotValues:"Nilai",total:"Total",addColumn:"Tambah kolom\u2026",chartBar:"Diagram batang",chartStacked:"Diagram batang bertumpuk",chartLine:"Diagram garis",chartArea:"Diagram area",chartPie:"Diagram lingkaran",chartDonut:"Diagram donat",chartCombo:"Diagram batang dan garis",chartScatter:"Diagram sebar",freeBadge:"Versi gratis",ops:{contains:"Berisi",equals:"Sama dengan",notEquals:"Tidak sama dengan",startsWith:"Diawali",endsWith:"Diakhiri",blank:"Kosong",notBlank:"Tidak kosong",eq:"Sama dengan",ne:"Tidak sama dengan",lt:"Kurang dari",lte:"Kurang dari atau sama dengan",gt:"Lebih dari",gte:"Lebih dari atau sama dengan",between:"Di antara",before:"Sebelum",after:"Sesudah"}},Pn=dr;var cr={code:"ru",noRows:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445",filter:"\u0424\u0438\u043B\u044C\u0442\u0440",apply:"\u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C",reset:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C",selectAll:"(\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435)",search:"\u041F\u043E\u0438\u0441\u043A\u2026",blanks:"(\u041F\u0443\u0441\u0442\u044B\u0435)",value:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435",valueTo:"\u041F\u043E",sortAsc:"\u041F\u043E \u0432\u043E\u0437\u0440\u0430\u0441\u0442\u0430\u043D\u0438\u044E",sortDesc:"\u041F\u043E \u0443\u0431\u044B\u0432\u0430\u043D\u0438\u044E",clearSort:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0443",pinLeft:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0441\u043B\u0435\u0432\u0430",pinRight:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0441\u043F\u0440\u0430\u0432\u0430",unpin:"\u041E\u0442\u043A\u0440\u0435\u043F\u0438\u0442\u044C",columnMenu:"\u041C\u0435\u043D\u044E \u0441\u0442\u043E\u043B\u0431\u0446\u0430",selectRow:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u0442\u0440\u043E\u043A\u0443",selectAllRows:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0432\u0441\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",chooseColumns:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0446\u044B",columns:"\u0421\u0442\u043E\u043B\u0431\u0446\u044B",autosizeThis:"\u041F\u043E\u0434\u043E\u0431\u0440\u0430\u0442\u044C \u0448\u0438\u0440\u0438\u043D\u0443 \u0441\u0442\u043E\u043B\u0431\u0446\u0430",autosizeAll:"\u041F\u043E\u0434\u043E\u0431\u0440\u0430\u0442\u044C \u0448\u0438\u0440\u0438\u043D\u0443 \u0432\u0441\u0435\u0445 \u0441\u0442\u043E\u043B\u0431\u0446\u043E\u0432",resetColumns:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0446\u044B",hideColumn:"\u0421\u043A\u0440\u044B\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446",close:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C",copy:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",cut:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C",copyWithHeaders:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0430\u043C\u0438",paste:"\u0412\u0441\u0442\u0430\u0432\u0438\u0442\u044C",pasteHint:"\u0414\u043E\u0441\u0442\u0443\u043F \u043A \u0431\u0443\u0444\u0435\u0440\u0443 \u043E\u0431\u043C\u0435\u043D\u0430 \u0437\u0430\u043F\u0440\u0435\u0449\u0451\u043D. \u041D\u0430\u0436\u043C\u0438\u0442\u0435 Ctrl+V, \u0447\u0442\u043E\u0431\u044B \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044C.",required:"\u041E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u043F\u043E\u043B\u0435",invalidValue:"\u041D\u0435\u0434\u043E\u043F\u0443\u0441\u0442\u0438\u043C\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435",and:"\u0418",or:"\u0418\u043B\u0438",advancedFilter:"\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0439 \u0444\u0438\u043B\u044C\u0442\u0440",addCondition:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0443\u0441\u043B\u043E\u0432\u0438\u0435",duplicate:"\u042D\u0442\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0443\u0436\u0435 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F",undo:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",redo:"\u041F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C",deleteRows:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",copyRows:"\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0441\u0442\u0440\u043E\u043A\u0438",statusRows:"\u0421\u0442\u0440\u043E\u043A: {n}",statusFiltered:"{shown} \u0438\u0437 {total} \u0441\u0442\u0440\u043E\u043A",statusSelected:"\u0412\u044B\u0431\u0440\u0430\u043D\u043E: {n}",count:"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E",sum:"\u0421\u0443\u043C\u043C\u0430",avg:"\u0421\u0440\u0435\u0434\u043D\u0435\u0435",min:"\u041C\u0438\u043D.",max:"\u041C\u0430\u043A\u0441.",findPlaceholder:"\u041D\u0430\u0439\u0442\u0438 \u0432 \u0442\u0430\u0431\u043B\u0438\u0446\u0435",noMatches:"\u041D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E",findNext:"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0435",findPrevious:"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0435",groupPanelHint:"\u041F\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0441\u044E\u0434\u0430 \u0437\u0430\u0433\u043E\u043B\u043E\u0432\u043E\u043A \u0441\u0442\u043E\u043B\u0431\u0446\u0430 \u0434\u043B\u044F \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0438",groupByThis:"\u0413\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E \u044D\u0442\u043E\u043C\u0443 \u0441\u0442\u043E\u043B\u0431\u0446\u0443",ungroup:"\u0423\u0431\u0440\u0430\u0442\u044C \u0433\u0440\u0443\u043F\u043F\u0438\u0440\u043E\u0432\u043A\u0443",expandAll:"\u0420\u0430\u0437\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0435",collapseAll:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0441\u0435",pagerRange:"{from}\u2013{to} \u0438\u0437 {total}",pageOf:"\u0421\u0442\u0440\u0430\u043D\u0438\u0446\u0430 {page} \u0438\u0437 {pages}",pageSize:"\u0421\u0442\u0440\u043E\u043A \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435",firstPage:"\u041F\u0435\u0440\u0432\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",previousPage:"\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",nextPage:"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",lastPage:"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430",loading:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430\u2026",loadFailed:"\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",filters:"\u0424\u0438\u043B\u044C\u0442\u0440\u044B",clearFilters:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0432\u0441\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B",exportCsv:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 CSV",exportExcel:"\u042D\u043A\u0441\u043F\u043E\u0440\u0442 \u0432 Excel",pivot:"\u0421\u0432\u043E\u0434\u043D\u0430\u044F",pivotMode:"\u0420\u0435\u0436\u0438\u043C \u0441\u0432\u043E\u0434\u043D\u043E\u0439 \u0442\u0430\u0431\u043B\u0438\u0446\u044B",pivotRows:"\u0413\u0440\u0443\u043F\u043F\u044B \u0441\u0442\u0440\u043E\u043A",pivotColumns:"\u0417\u0430\u0433\u043E\u043B\u043E\u0432\u043A\u0438 \u0441\u0442\u043E\u043B\u0431\u0446\u043E\u0432",pivotValues:"\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u044F",total:"\u0418\u0442\u043E\u0433\u043E",addColumn:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0441\u0442\u043E\u043B\u0431\u0435\u0446\u2026",chartBar:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430",chartStacked:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0441 \u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u0438\u0435\u043C",chartLine:"\u0413\u0440\u0430\u0444\u0438\u043A",chartArea:"\u0414\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430 \u0441 \u043E\u0431\u043B\u0430\u0441\u0442\u044F\u043C\u0438",chartPie:"\u041A\u0440\u0443\u0433\u043E\u0432\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",chartDonut:"\u041A\u043E\u043B\u044C\u0446\u0435\u0432\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",chartCombo:"\u0413\u0438\u0441\u0442\u043E\u0433\u0440\u0430\u043C\u043C\u0430 \u0438 \u0433\u0440\u0430\u0444\u0438\u043A",chartScatter:"\u0422\u043E\u0447\u0435\u0447\u043D\u0430\u044F \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0430",freeBadge:"\u0411\u0435\u0441\u043F\u043B\u0430\u0442\u043D\u0430\u044F \u0432\u0435\u0440\u0441\u0438\u044F",ops:{contains:"\u0421\u043E\u0434\u0435\u0440\u0436\u0438\u0442",equals:"\u0420\u0430\u0432\u043D\u043E",notEquals:"\u041D\u0435 \u0440\u0430\u0432\u043D\u043E",startsWith:"\u041D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0441",endsWith:"\u0417\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u043D\u0430",blank:"\u041F\u0443\u0441\u0442\u043E",notBlank:"\u041D\u0435 \u043F\u0443\u0441\u0442\u043E",eq:"\u0420\u0430\u0432\u043D\u043E",ne:"\u041D\u0435 \u0440\u0430\u0432\u043D\u043E",lt:"\u041C\u0435\u043D\u044C\u0448\u0435",lte:"\u041C\u0435\u043D\u044C\u0448\u0435 \u0438\u043B\u0438 \u0440\u0430\u0432\u043D\u043E",gt:"\u0411\u043E\u043B\u044C\u0448\u0435",gte:"\u0411\u043E\u043B\u044C\u0448\u0435 \u0438\u043B\u0438 \u0440\u0430\u0432\u043D\u043E",between:"\u041C\u0435\u0436\u0434\u0443",before:"\u0414\u043E",after:"\u041F\u043E\u0441\u043B\u0435"}},$n=cr;var ur={code:"pt-BR",noRows:"Nenhuma linha para mostrar",filter:"Filtro",apply:"Aplicar",reset:"Limpar",selectAll:"(Selecionar tudo)",search:"Pesquisar\u2026",blanks:"(Vazios)",value:"Valor",valueTo:"At\xE9",sortAsc:"Ordenar crescente",sortDesc:"Ordenar decrescente",clearSort:"Remover ordena\xE7\xE3o",pinLeft:"Fixar \xE0 esquerda",pinRight:"Fixar \xE0 direita",unpin:"Desafixar",columnMenu:"Menu da coluna",selectRow:"Selecionar linha",selectAllRows:"Selecionar todas as linhas",chooseColumns:"Escolher colunas",columns:"Colunas",autosizeThis:"Ajustar largura desta coluna",autosizeAll:"Ajustar largura de todas as colunas",resetColumns:"Redefinir colunas",hideColumn:"Ocultar coluna",close:"Fechar",copy:"Copiar",cut:"Recortar",copyWithHeaders:"Copiar com cabe\xE7alhos",paste:"Colar",pasteHint:"O acesso \xE0 \xE1rea de transfer\xEAncia foi bloqueado. Pressione Ctrl+V para colar.",required:"Campo obrigat\xF3rio",invalidValue:"Valor inv\xE1lido",and:"E",or:"Ou",advancedFilter:"Filtro avan\xE7ado",addCondition:"Adicionar condi\xE7\xE3o",duplicate:"Este valor j\xE1 est\xE1 em uso",undo:"Desfazer",redo:"Refazer",deleteRows:"Excluir linhas selecionadas",copyRows:"Copiar linhas selecionadas",statusRows:"{n} linhas",statusFiltered:"{shown} de {total} linhas",statusSelected:"{n} selecionadas",count:"Contagem",sum:"Soma",avg:"M\xE9dia",min:"M\xEDn.",max:"M\xE1x.",findPlaceholder:"Localizar na tabela",noMatches:"Nenhum resultado",findNext:"Pr\xF3ximo",findPrevious:"Anterior",groupPanelHint:"Arraste um cabe\xE7alho de coluna aqui para agrupar",groupByThis:"Agrupar por esta coluna",ungroup:"Remover agrupamento",expandAll:"Expandir tudo",collapseAll:"Recolher tudo",pagerRange:"{from}\u2013{to} de {total}",pageOf:"P\xE1gina {page} de {pages}",pageSize:"Linhas por p\xE1gina",firstPage:"Primeira p\xE1gina",previousPage:"P\xE1gina anterior",nextPage:"Pr\xF3xima p\xE1gina",lastPage:"\xDAltima p\xE1gina",loading:"Carregando\u2026",loadFailed:"N\xE3o foi poss\xEDvel carregar as linhas",filters:"Filtros",clearFilters:"Limpar todos os filtros",exportCsv:"Exportar CSV",exportExcel:"Exportar Excel",pivot:"Piv\xF4",pivotMode:"Modo piv\xF4",pivotRows:"Grupos de linhas",pivotColumns:"R\xF3tulos de coluna",pivotValues:"Valores",total:"Total",addColumn:"Adicionar coluna\u2026",chartBar:"Gr\xE1fico de barras",chartStacked:"Gr\xE1fico de barras empilhadas",chartLine:"Gr\xE1fico de linhas",chartArea:"Gr\xE1fico de \xE1rea",chartPie:"Gr\xE1fico de pizza",chartDonut:"Gr\xE1fico de rosca",chartCombo:"Gr\xE1fico de barras e linhas",chartScatter:"Gr\xE1fico de dispers\xE3o",freeBadge:"Vers\xE3o gratuita",ops:{contains:"Cont\xE9m",equals:"Igual a",notEquals:"Diferente de",startsWith:"Come\xE7a com",endsWith:"Termina com",blank:"Vazio",notBlank:"N\xE3o vazio",eq:"Igual a",ne:"Diferente de",lt:"Menor que",lte:"Menor ou igual a",gt:"Maior que",gte:"Maior ou igual a",between:"Entre",before:"Antes de",after:"Depois de"}},Fn=ur;var hr={code:"it",noRows:"Nessuna riga da mostrare",filter:"Filtro",apply:"Applica",reset:"Reimposta",selectAll:"(Seleziona tutto)",search:"Cerca\u2026",blanks:"(Vuoti)",value:"Valore",valueTo:"A",sortAsc:"Ordine crescente",sortDesc:"Ordine decrescente",clearSort:"Rimuovi ordinamento",pinLeft:"Blocca a sinistra",pinRight:"Blocca a destra",unpin:"Sblocca",columnMenu:"Menu colonna",selectRow:"Seleziona riga",selectAllRows:"Seleziona tutte le righe",chooseColumns:"Scegli colonne",columns:"Colonne",autosizeThis:"Adatta larghezza di questa colonna",autosizeAll:"Adatta larghezza di tutte le colonne",resetColumns:"Ripristina colonne",hideColumn:"Nascondi colonna",close:"Chiudi",copy:"Copia",cut:"Taglia",copyWithHeaders:"Copia con intestazioni",paste:"Incolla",pasteHint:"Accesso agli appunti bloccato. Premi Ctrl+V per incollare.",required:"Campo obbligatorio",invalidValue:"Valore non valido",and:"E",or:"O",advancedFilter:"Filtro avanzato",addCondition:"Aggiungi condizione",duplicate:"Questo valore \xE8 gi\xE0 in uso",undo:"Annulla",redo:"Ripeti",deleteRows:"Elimina righe selezionate",copyRows:"Copia righe selezionate",statusRows:"{n} righe",statusFiltered:"{shown} di {total} righe",statusSelected:"{n} selezionate",count:"Conteggio",sum:"Somma",avg:"Media",min:"Min",max:"Max",findPlaceholder:"Trova nella tabella",noMatches:"Nessun risultato",findNext:"Successivo",findPrevious:"Precedente",groupPanelHint:"Trascina qui un'intestazione di colonna per raggruppare",groupByThis:"Raggruppa per questa colonna",ungroup:"Rimuovi raggruppamento",expandAll:"Espandi tutto",collapseAll:"Comprimi tutto",pagerRange:"{from}\u2013{to} di {total}",pageOf:"Pagina {page} di {pages}",pageSize:"Righe per pagina",firstPage:"Prima pagina",previousPage:"Pagina precedente",nextPage:"Pagina successiva",lastPage:"Ultima pagina",loading:"Caricamento\u2026",loadFailed:"Impossibile caricare le righe",filters:"Filtri",clearFilters:"Rimuovi tutti i filtri",exportCsv:"Esporta CSV",exportExcel:"Esporta Excel",pivot:"Pivot",pivotMode:"Modalit\xE0 pivot",pivotRows:"Gruppi di righe",pivotColumns:"Etichette di colonna",pivotValues:"Valori",total:"Totale",addColumn:"Aggiungi colonna\u2026",chartBar:"Grafico a barre",chartStacked:"Grafico a barre in pila",chartLine:"Grafico a linee",chartArea:"Grafico ad area",chartPie:"Grafico a torta",chartDonut:"Grafico ad anello",chartCombo:"Grafico a barre e linee",chartScatter:"Grafico a dispersione",freeBadge:"Versione gratuita",ops:{contains:"Contiene",equals:"Uguale a",notEquals:"Diverso da",startsWith:"Inizia con",endsWith:"Finisce con",blank:"Vuoto",notBlank:"Non vuoto",eq:"Uguale a",ne:"Diverso da",lt:"Minore di",lte:"Minore o uguale a",gt:"Maggiore di",gte:"Maggiore o uguale a",between:"Tra",before:"Prima di",after:"Dopo"}},Nn=hr;var ne="__fg_select__",On={id:ne,header:"",width:44,minWidth:44,maxWidth:44,pinned:"left",sortable:!1,resizable:!1,filter:!1},we="__fg_drag__",Hn={id:we,header:"",width:28,minWidth:28,maxWidth:28,pinned:"left",sortable:!1,resizable:!1,filter:!1,chooser:!1},fe="__fg_rownum__",Bn=(i=52,e="#")=>({id:fe,header:e,width:i,minWidth:i,maxWidth:i,pinned:"left",sortable:!1,resizable:!1,filter:!1,chooser:!1}),$=i=>i===ne||i===we||i===fe,fr=120,pr=40,gr=["left","center","right"];function ie(i){if($(i.id)||i.filter===!1)return null;if(i.filter)return i.filter;switch(i.type){case"number":return"number";case"date":return"date";case"boolean":return"set";default:return"text"}}function le(i,e,t){let n=i.editable;if(typeof n!="function")return!!n;try{return!!n({value:i.valueGetter?i.valueGetter(e):i.field?e[i.field]:void 0,row:e,rowIndex:t,column:i})}catch{return!1}}var ve=i=>i.id!==ne&&i.sortable!==!1,Xe=i=>i.id!==ne&&i.resizable!==!1;function je(i,e){var o,r;let t=(o=i.minWidth)!=null?o:pr,n=(r=i.maxWidth)!=null?r:1/0;return Math.round(Math.min(n,Math.max(t,e)))}function Gn(i){return i.children?1+Math.max(0,...i.children.map(Gn)):1}var _e=class{constructor(e){this.depth=1;this.roots_=[];this.defs=[];this.byId=new Map;this.containerWidth=0;this.layout={left:[],center:[],right:[]};this.leafById=new Map;this.setDefs(e)}setDefs(e){this.defs=e,this.byId=new Map;let t=0,n=(r,s,a)=>{var h,p,f,x,y;let l=Array.isArray(r.children)&&r.children.length>0,c=t++,d=(h=r.id)!=null?h:l?`g${c}`:r.field;if(d||(d=`c${c}`,O(`column #${c} has neither "field" nor "id"; using "${d}"`)),this.byId.has(d)){let m=1;for(;this.byId.has(`${d}_${m}`);)m++;O(`duplicate column id "${d}"; renamed to "${d}_${m}"`),d=`${d}_${m}`}let u={id:d,def:r,parent:s,children:null,depth:a,width:je(r,(p=r.width)!=null?p:fr),flex:r.flex&&r.flex>0?r.flex:null,hide:(f=r.hide)!=null?f:!1,pinned:(y=(x=r.pinned)!=null?x:s==null?void 0:s.pinned)!=null?y:null,open:!!r.openByDefault};return this.byId.set(d,u),l&&(u.children=o(r.children).map(m=>n(m,u,a+1))),u},o=r=>{let s=r.filter(a=>a!==null&&typeof a=="object");return s.length!==r.length&&O("columns contain entries that are not objects; they were skipped"),s};this.roots_=o(e).map(r=>n(r,null,0)),this.depth=Math.max(1,...this.roots_.map(Gn)),this.relayout()}setContainerWidth(e){if(e===this.containerWidth)return!1;this.containerWidth=e;let t=this.displayed().map(n=>n.width).join();return this.relayout(),t!==this.displayed().map(n=>n.width).join()}roots(){return this.roots_}reset(){this.setDefs(this.defs)}region(e){return this.layout[e]}displayed(){return[...this.layout.left,...this.layout.center,...this.layout.right]}regionWidth(e){let t=this.layout[e],n=t[t.length-1];return n?n.left+n.width:0}getColumn(e){return this.leafById.get(e)}getNode(e){return this.byId.get(e)}siblings(e){let t=this.byId.get(e);return t?t.parent?t.parent.children:this.roots_:[]}setWidth(e,t){let n=this.byId.get(e);return!n||n.children?0:(n.flex=null,n.width=je(n.def,t),this.relayout(),n.width)}setPinned(e,t){let n=this.byId.get(e);!n||n.children||$(e)||(n.pinned=t,this.relayout())}setHide(e,t){let n=this.byId.get(e);!n||n.children||(n.hide=t,this.relayout())}move(e,t){let n=this.siblings(e),o=n.findIndex(s=>s.id===e);if(o<0)return;let[r]=n.splice(o,1);n.splice(Math.max(0,Math.min(n.length,t)),0,r),this.relayout()}headerCells(e){var o,r,s;let t=[],n=new Map;for(let a of this.layout[e]){let l=[];for(let c=a.node.parent;c;c=c.parent)l.unshift(c);for(let c of l){let d=n.get(c.id);if(d){d.width+=a.width;continue}let u={id:c.id,label:(o=c.def.header)!=null?o:"",isGroup:!0,column:null,node:c,row:c.depth,rowSpan:1,left:a.left,width:a.width};n.set(c.id,u),t.push(u)}t.push({id:a.id,label:(s=(r=a.def.header)!=null?r:a.def.field)!=null?s:"",isGroup:!1,column:a,node:a.node,row:a.node.depth,rowSpan:this.depth-a.node.depth,left:a.left,width:a.width})}return t}getState(){return this.leafNodes().filter(e=>!$(e.id)).map(e=>{var t,n,o;return{colId:e.id,width:(n=(t=this.leafById.get(e.id))==null?void 0:t.width)!=null?n:e.width,hide:!!e.hide,pinned:(o=e.pinned)!=null?o:null}})}applyState(e){let t=new Map;e.forEach((r,s)=>{t.set(r.colId,s);let a=this.byId.get(r.colId);!a||a.children||$(r.colId)||(typeof r.width=="number"&&Number.isFinite(r.width)&&(a.flex=null,a.width=je(a.def,r.width)),typeof r.hide=="boolean"&&(a.hide=r.hide),"pinned"in r&&(a.pinned=r.pinned==="left"||r.pinned==="right"?r.pinned:null))}),t.set(fe,-3),t.set(we,-2),t.set(ne,-1);let n=r=>{var s;return r.children?Math.min(1/0,...r.children.map(n)):(s=t.get(r.id))!=null?s:1/0},o=r=>{let s=r.map((a,l)=>({n:a,i:l,r:n(a)}));s.sort((a,l)=>a.r===l.r?a.i-l.i:a.r-l.r),r.splice(0,r.length,...s.map(a=>a.n));for(let a of r)a.children&&o(a.children)};o(this.roots_),this.relayout()}leafNodes(){let e=[],t=n=>n.children?n.children.forEach(t):e.push(n);return this.roots_.forEach(t),e}isCollapsible(e){var t;return!!((t=e.children)!=null&&t.some(n=>n.def.columnGroupShow==="open"||n.def.columnGroupShow==="closed"))}setGroupOpen(e,t){let n=this.byId.get(e);return!(n!=null&&n.children)||n.open===t?!1:(n.open=t,this.relayout(),!0)}groupOpenState(){let e={};for(let t of this.byId.values())this.isCollapsible(t)&&(e[t.id]=t.open);return e}shownByGroups(e){for(let t=e;t!=null&&t.parent;t=t.parent){let n=t.def.columnGroupShow;if(n==="open"&&!t.parent.open||n==="closed"&&t.parent.open)return!1}return!0}relayout(){var l;let e=this.leafNodes().filter(c=>!c.hide&&this.shownByGroups(c)),t=e.reduce((c,d)=>c+(d.flex?0:d.width),0),n=e.reduce((c,d)=>{var u;return c+((u=d.flex)!=null?u:0)},0),o=Math.max(0,this.containerWidth-t),r=c=>c.flex?je(c.def,Math.floor(o*c.flex/n)):c.width,s={left:[],center:[],right:[]};this.leafById=new Map;let a=0;for(let c of gr){let d=0;for(let u of e){if(((l=u.pinned)!=null?l:"center")!==c)continue;let h={id:u.id,def:u.def,node:u,width:r(u),region:c,left:d,index:a++};d+=h.width,s[c].push(h),this.leafById.set(u.id,h)}}this.layout=s}};var Y=class extends Error{constructor(t){super(t);this.code=t}};function mr(i){let e=[],t=0;for(;t<i.length;){let n=i[t];if(/\s/.test(n))t++;else if(/[0-9.]/.test(n)){let o=/^(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?/i.exec(i.slice(t));if(!o)throw new Y("#ERROR!");e.push({t:"num",v:Number(o[0])}),t+=o[0].length}else if(n==='"'){let o="";for(t++;;){if(t>=i.length)throw new Y("#ERROR!");if(i[t]==='"'){if(i[t+1]==='"'){o+='"',t+=2;continue}t++;break}o+=i[t++]}e.push({t:"str",v:o})}else if(n==="["){let o=i.indexOf("]",t);if(o<0)throw new Y("#ERROR!");e.push({t:"id",v:i.slice(t+1,o)}),t=o+1}else if(/[A-Za-z_À-￿]/.test(n)){let o=/^[A-Za-z_À-￿][\wÀ-￿]*/.exec(i.slice(t));e.push({t:"id",v:o[0]}),t+=o[0].length}else{let o=i.slice(t,t+2);if(o==="<>"||o==="<="||o===">=")e.push({t:"op",v:o}),t+=2;else if("+-*/%^&=<>(),".includes(n))e.push({t:"op",v:n}),t++;else throw new Y("#ERROR!")}}return e}var Ye=i=>i==null||i==="";function X(i){if(typeof i=="number")return i;if(typeof i=="boolean")return i?1:0;if(Ye(i))return 0;if(typeof i=="string"&&i.trim()!==""&&Number.isFinite(Number(i)))return Number(i);throw new Y("#VALUE!")}var Je=i=>Ye(i)?"":typeof i=="boolean"?i?"TRUE":"FALSE":String(i);function wr(i,e){let t=Math.trunc(e),n=+`${Math.round(+`${Math.abs(i)}e${t}`)}e${-t}`;return i<0?-n:n}var zn={ROUND:i=>wr(X(i[0]),i.length>1?X(i[1]):0),ABS:i=>Math.abs(X(i[0])),MIN:i=>i.length?Math.min(...i.map(X)):0,MAX:i=>i.length?Math.max(...i.map(X)):0,SUM:i=>i.reduce((e,t)=>e+X(t),0),AVG:i=>{if(!i.length)throw new Y("#DIV/0!");return i.reduce((e,t)=>e+X(t),0)/i.length}};function vr(i,e){return(typeof i=="number"||Ye(i))&&(typeof e=="number"||Ye(e))?X(i)-X(e):Je(i).localeCompare(Je(e),void 0,{sensitivity:"accent"})}var $t=class{constructor(e,t){this.tokens=e;this.resolve=t;this.i=0}parse(){let e=this.comparison();if(this.i<this.tokens.length)throw new Y("#ERROR!");return e}peek(e){let t=this.tokens[this.i];return!!t&&t.t==="op"&&(e===void 0||t.v===e)}take(e){return this.peek(e)?(this.i++,!0):!1}comparison(){let e=this.concat();for(let t of["=","<>","<=",">=","<",">"])if(this.take(t)){let n=vr(e,this.concat());return t==="="?n===0:t==="<>"?n!==0:t==="<"?n<0:t===">"?n>0:t==="<="?n<=0:n>=0}return e}concat(){let e=this.additive();for(;this.take("&");)e=Je(e)+Je(this.additive());return e}additive(){let e=this.multiplicative();for(;;)if(this.take("+"))e=X(e)+X(this.multiplicative());else if(this.take("-"))e=X(e)-X(this.multiplicative());else return e}multiplicative(){let e=this.unary();for(;;)if(this.take("*"))e=X(e)*X(this.unary());else if(this.take("/")||this.take("%")){let t=this.tokens[this.i-1].v,n=X(this.unary());if(n===0)throw new Y("#DIV/0!");e=t==="/"?X(e)/n:X(e)%n}else return e}unary(){return this.take("-")?-X(this.unary()):this.take("+")?X(this.unary()):this.power()}power(){let e=this.primary();return this.take("^")?X(e)**X(this.unary()):e}primary(){let e=this.tokens[this.i++];if(!e)throw new Y("#ERROR!");if(e.t==="num"||e.t==="str")return e.v;if(e.t==="op"){if(e.v!=="(")throw new Y("#ERROR!");let n=this.comparison();if(!this.take(")"))throw new Y("#ERROR!");return n}let t=e.v;if(this.peek("(")){this.i++;let n=[];if(!this.take(")")){do n.push(this.comparison());while(this.take(","));if(!this.take(")"))throw new Y("#ERROR!")}let o=t.toUpperCase();if(o==="IF"){if(n.length<2)throw new Y("#ERROR!");return(typeof n[0]=="boolean"?n[0]:X(n[0])!==0)?n[1]:n.length>2?n[2]:!1}let r=Object.hasOwn(zn,o)?zn[o]:void 0;if(!r)throw new Y("#NAME?");return r(n)}return/^(true|false)$/i.test(t)?t.toLowerCase()==="true":this.resolve(t)}},yr=32;function Ft(i,e,t=new Set,n=0,o=new Map){try{let r=a=>{if(!e||!Object.hasOwn(e,a))throw new Y("#REF!");let l=e[a];if(typeof l=="string"&&l.startsWith("=")){if(t.has(a)||n>=yr)throw new Y("#CYCLE!");let c;if(o.has(a)?c=o.get(a):(c=Ft(l,e,new Set([...t,a]),n+1,o),o.set(a,c)),typeof c=="string"&&/^#[A-Z/0]+[!?]$/.test(c))throw new Y(c);return c}return l},s=new $t(mr(i.slice(1)),r).parse();return typeof s=="number"&&!Number.isFinite(s)?"#NUM!":s}catch(r){return r instanceof Y?r.code:"#ERROR!"}}var Re=i=>typeof i=="string"&&i.length>1&&i.startsWith("=");function G(i,e){var n;if(i.valueGetter)try{return i.valueGetter(e)}catch{O(`valueGetter of column "${(n=i.id)!=null?n:i.field}" threw; rendering an empty cell`);return}if(i.field==null)return;let t=e[i.field];return i.formulas&&Re(t)?Ft(t,e,new Set([i.field])):t}var De=["left","center","right"],Vn=[[">=","gte"],["<=","lte"],["<>","ne"],["!=","ne"],[">","gt"],["<","lt"],["=","eq"]],qn=[[">","after"],["<","before"],["=","equals"]],br=/^(.+?)\s*(?:~|\.\.)\s*(.+)$/,Nt=i=>{let e=Number(i.replace(/[,\s₩$€¥]/g,""));return i.trim()!==""&&Number.isFinite(e)?e:null},Ot=i=>{let e=/^(\d{4})[-./]\s*(\d{1,2})[-./]\s*(\d{1,2})\.?$/.exec(i.trim());if(!e)return null;let t=Number(e[1]),n=Number(e[2]),o=Number(e[3]);return n<1||n>12||o<1||o>new Date(Date.UTC(t,n,0)).getUTCDate()?null:`${e[1]}-${e[2].padStart(2,"0")}-${e[3].padStart(2,"0")}`};function xr(i,e){let t=e.trim();if(!t)return null;if(i==="text")return{type:"text",op:"contains",value:t};let n=br.exec(t);if(i==="number"){if(n){let l=Nt(n[1]),c=Nt(n[2]);return l===null||c===null?void 0:{type:"number",op:"between",value:Math.min(l,c),valueTo:Math.max(l,c)}}let s=Vn.find(([l])=>t.startsWith(l)),a=Nt(s?t.slice(s[0].length):t);return a===null?void 0:{type:"number",op:s?s[1]:"eq",value:a}}if(n){let s=Ot(n[1]),a=Ot(n[2]);return!s||!a?void 0:{type:"date",op:"between",value:s<a?s:a,valueTo:s<a?a:s}}let o=qn.find(([s])=>t.startsWith(s)),r=Ot(o?t.slice(o[0].length):t);return r?{type:"date",op:o?o[1]:"equals",value:r}:void 0}function Cr(i){var e,t,n;if(!i)return"";if(i.type==="text")return i.op==="contains"&&(e=i.value)!=null?e:"";if(i.type==="number"){if(i.op==="between")return`${i.value}~${i.valueTo}`;let o=(t=Vn.find(([,r])=>r===i.op))==null?void 0:t[0];return o&&i.value!==void 0?`${o==="="?"":o}${i.value}`:""}if(i.type==="date"){if(i.op==="between")return`${i.value}~${i.valueTo}`;let o=(n=qn.find(([,r])=>r===i.op))==null?void 0:n[0];return o&&i.value?`${o==="="?"":o}${i.value}`:""}return""}var Ze=class{constructor(e,t){this.grid=e;this.layout="";this.timers=new Map;this.data=null;this.synced=null;this.rebuilt=!1;this.inners={};for(let n of De)this.inners[n]=S("div","fg-filter-row",{role:"row"}),t[n].append(this.inners[n])}get height(){return Math.round(this.grid.renderer.opts.rowHeight*.95)}render(){let{columns:e,store:t}=this.grid,n=this.height,o=e.displayed(),r=`${n}|${t.state.locale.code}|${o.map(s=>`${s.id}:${s.left}:${s.width}:${s.region}`).join(",")}`;if(r!==this.layout){this.layout=r;for(let s of De){let a=this.inners[s];a.style.width=`${e.regionWidth(s)}px`,a.style.height=`${n}px`,a.replaceChildren(...e.region(s).map(l=>this.cell(l,n)))}this.data=t.state.data,this.rebuilt=!0}else t.state.data!==this.data&&(this.data=t.state.data,this.refreshLists());this.sync()}sync(){let e=this.grid.store.state.filters;if(!(e===this.synced&&!this.rebuilt)){this.synced=e,this.rebuilt=!1;for(let t of De)for(let n of this.inners[t].querySelectorAll("[data-col]")){let o=n.dataset.col,r=e[o];if(n.closest(".fg-filter-cell").classList.toggle("fg-filter-active",!!r),!(n===n.ownerDocument.activeElement||n.getRootNode().activeElement===n)){if(n instanceof HTMLSelectElement){let s=(r==null?void 0:r.type)==="set"&&r.values.length===1?JSON.stringify(r.values[0]):"";[...n.options].some(a=>a.value===s)&&(n.value=s)}else n.value=Cr(r);n.classList.remove("fg-filter-bad")}}}}refreshLists(){var e;for(let t of De)for(let n of this.inners[t].querySelectorAll("select[data-col]")){let o=(e=this.grid.columns.getNode(n.dataset.col))==null?void 0:e.def;if(!o)continue;let r=n.value;if(this.fillOptions(n,o),r&&![...n.options].some(s=>s.value===r)){let s=S("option","",{value:r});s.textContent=String(JSON.parse(r)),n.append(s)}n.value=r}}fillOptions(e,t){let n=S("option","",{value:""});n.textContent=this.grid.store.state.locale.selectAll;let o=this.distinct(t).map(r=>{let s=S("option","",{value:JSON.stringify(r)});return s.textContent=r===!0?"\u2713":r===!1?"\u2717":String(r),s});e.replaceChildren(n,...o)}cell(e,t){var c,d;let n=S("div","fg-filter-cell");n.style.left=`${e.left}px`,n.style.width=`${e.width}px`,n.style.height=`${t}px`;let o=$(e.id)?null:ie(e.def);if(!o)return n;let s=`${this.grid.store.state.locale.filter}: ${(d=(c=e.def.header)!=null?c:e.def.field)!=null?d:e.id}`;if(o==="set"){let u=S("select","fg-filter-input",{"aria-label":s});return u.dataset.col=e.id,this.fillOptions(u,e.def),u.addEventListener("change",()=>{this.grid.setFilter(e.id,u.value?{type:"set",values:[JSON.parse(u.value)]}:null)}),n.append(u),n}let a=S("input","fg-filter-input",{type:"text","aria-label":s,spellcheck:"false",autocomplete:"off"});a.dataset.col=e.id,o==="number"&&(a.placeholder=">0, 10~20"),o==="date"&&(a.placeholder=">2026-01-01");let l=()=>{let u=xr(o,a.value);a.classList.toggle("fg-filter-bad",u===void 0),u!==void 0&&this.grid.setFilter(e.id,u)};return a.addEventListener("input",()=>{clearTimeout(this.timers.get(e.id)),this.timers.set(e.id,window.setTimeout(l,200))}),a.addEventListener("keydown",u=>{u.stopPropagation(),u.key==="Enter"?(clearTimeout(this.timers.get(e.id)),l()):u.key==="Escape"&&(a.value="",clearTimeout(this.timers.get(e.id)),l())}),n.append(a),n}distinct(e){let t=new Map;for(let n of this.grid.store.state.data){let o=G(e,n);if(o==null||o==="")continue;let r=JSON.stringify(o);if(t.has(r)||t.set(r,o),t.size>=200)break}return[...t.values()].sort((n,o)=>String(n).localeCompare(String(o)))}setTransform(e){this.inners.center.style.transform=`translateX(${-e}px)`}destroy(){for(let e of this.timers.values())clearTimeout(e);for(let e of De)this.inners[e].remove()}};function z(i){return i==null||typeof i=="string"&&i.trim()===""||typeof i=="number"&&Number.isNaN(i)}var Wn=i=>String(i).padStart(2,"0");function ee(i){if(z(i))return null;if(typeof i=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(i))return i;let e=i instanceof Date?i:new Date(i);return Number.isNaN(e.getTime())?null:`${e.getFullYear()}-${Wn(e.getMonth()+1)}-${Wn(e.getDate())}`}function Z(i){var e;return z(i)?"":i instanceof Date?(e=ee(i))!=null?e:"":String(i)}var de=()=>!0;function Qe(i){var e;switch(i.type){case"combined":{let t=(Array.isArray(i.conditions)?i.conditions:[]).map(Qe);return t.length?i.operator==="or"?n=>t.some(o=>o(n)):n=>t.every(o=>o(n)):de}case"text":{let t=((e=i.value)!=null?e:"").toLowerCase(),n=o=>z(o)?"":String(o).toLowerCase();switch(i.op){case"contains":return o=>n(o).includes(t);case"equals":return o=>n(o)===t;case"notEquals":return o=>n(o)!==t;case"startsWith":return o=>n(o).startsWith(t);case"endsWith":return o=>n(o).endsWith(t);case"blank":return z;case"notBlank":return o=>!z(o)}return de}case"number":{let t=o=>z(o)?NaN:Number(o);if(i.op==="blank")return o=>Number.isNaN(t(o));if(i.op==="notBlank")return o=>!Number.isNaN(t(o));let n=i.value;if(n==null||Number.isNaN(n))return de;switch(i.op){case"eq":return o=>t(o)===n;case"ne":return o=>t(o)!==n;case"lt":return o=>t(o)<n;case"lte":return o=>t(o)<=n;case"gt":return o=>t(o)>n;case"gte":return o=>t(o)>=n;case"between":{let o=i.valueTo;if(o==null||Number.isNaN(o))return de;let r=Math.min(n,o),s=Math.max(n,o);return a=>{let l=t(a);return l>=r&&l<=s}}}return de}case"date":{if(i.op==="blank")return o=>ee(o)===null;if(i.op==="notBlank")return o=>ee(o)!==null;let t=i.value;if(!t)return de;let n=o=>ee(o);switch(i.op){case"equals":return o=>n(o)===t;case"before":return o=>{let r=n(o);return r!==null&&r<t};case"after":return o=>{let r=n(o);return r!==null&&r>t};case"between":{let o=i.valueTo;if(!o)return de;let r=t<o?t:o,s=t<o?o:t;return a=>{let l=n(a);return l!==null&&l>=r&&l<=s}}}return de}case"set":{let t=new Set(i.values.map(Z));return n=>t.has(Z(n))}}return de}function Un(i){let e=i.trim().toLowerCase();return e?e.split(/\s+/):[]}function Kn(i,e){return i.every(t=>e.includes(t))}function Ht(i,e,t){let n=[];for(let o of Array.isArray(i==null?void 0:i.conditions)?i.conditions:[]){if(!o||typeof o!="object")continue;if("conditions"in o){let a=Ht(o,e,t);a&&n.push(a);continue}let r=e(o.colId);if(!r||!o.model)continue;let s=Qe(o.model);n.push(a=>s(t(r,a)))}return n.length?i.operator==="or"?o=>n.some(r=>r(o)):o=>n.every(r=>r(o)):null}var jn=new Map;function Rr(i){var o;if(i==="integer")return{maximumFractionDigits:0};if(i==="percent")return{style:"percent"};if(i.startsWith("currency:"))return{style:"currency",currency:i.slice(9)};if(!/^[#0,]*(\.[#0]+)?%?$/.test(i)||!/[#0]/.test(i))return null;let e=i.endsWith("%"),t=e?i.slice(0,-1):i,n=t.includes(".")?t.split(".")[1]:"";return{useGrouping:t.includes(","),minimumFractionDigits:((o=n.match(/0/g))!=null?o:[]).length,maximumFractionDigits:n.length,...e?{style:"percent"}:{}}}var et={date:{year:"numeric",month:"2-digit",day:"2-digit"},datetime:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"},time:{hour:"2-digit",minute:"2-digit"},short:{dateStyle:"short"},medium:{dateStyle:"medium"},long:{dateStyle:"long"}};function ae(i){if(z(i))return null;if(i instanceof Date)return Number.isNaN(i.getTime())?null:i;if(typeof i=="string"){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(i);if(t)return new Date(Number(t[1]),Number(t[2])-1,Number(t[3]))}if(typeof i!="string"&&typeof i!="number")return null;let e=new Date(i);return Number.isNaN(e.getTime())?null:e}function Sr(i,e,t){var n;switch(i){case"number":{let o={};if(typeof e=="string"){let s=Rr(e);s||O(`unknown number format "${e}"`),o=s!=null?s:{}}else e&&(o=e);let r=new Intl.NumberFormat(t,o);return s=>{if(z(s))return"";let a=typeof s=="number"?s:Number(s);return Number.isNaN(a)?String(s):r.format(a)}}case"date":{if(t.toLowerCase().startsWith("ko")&&(e===void 0||e==="date"||e==="datetime")){let s=l=>String(l).padStart(2,"0"),a=e==="datetime";return l=>{let c=ae(l);if(!c)return z(l)?"":String(l);let d=`${c.getFullYear()}-${s(c.getMonth()+1)}-${s(c.getDate())}`;return a?`${d} ${s(c.getHours())}:${s(c.getMinutes())}`:d}}let o=et.date;typeof e=="string"?(et[e]||O(`unknown date format "${e}"`),o=(n=et[e])!=null?n:et.date):e&&(o=e);let r=new Intl.DateTimeFormat(t,o);return s=>{let a=ae(s);return a?r.format(a):z(s)?"":String(s)}}case"boolean":return o=>o===!0?"\u2713":o===!1?"\u2717":"";default:return o=>z(o)?"":o instanceof Date?o.toISOString():String(o)}}function _(i,e){var r;if(i.sparkline)return s=>Array.isArray(s)?s.join(", "):s==null?"":String(s);let t=i.format,n=`${e}|${(r=i.type)!=null?r:"text"}|${typeof t=="string"?t:JSON.stringify(t!=null?t:null)}`,o=jn.get(n);return o||(o=Sr(i.type,t,e),jn.set(n,o)),o}function Bt(i){let e=[];for(let t of i){if(z(t)||t instanceof Date)continue;let n=typeof t=="number"?t:Number(t);Number.isNaN(n)||e.push(n)}return e}function _n(i,e){let t=i.filter(o=>o instanceof Date&&!Number.isNaN(o.getTime()));if(t.length)return t.reduce((o,r)=>(e?r>o:r<o)?r:o);let n=Bt(i);return n.length?e?Math.max(...n):Math.min(...n):null}function Se(i,e,t){if(typeof i=="function")return i(e,t);switch(i){case"sum":return Bt(e).reduce((n,o)=>n+o,0);case"avg":{let n=Bt(e);return n.length?n.reduce((o,r)=>o+r,0)/n.length:null}case"min":return _n(e,!1);case"max":return _n(e,!0);case"count":return t.length}return null}function Gt(i){return typeof i=="object"&&i!==null&&"agg"in i?i:{agg:i}}function Xn(i,e,t){let n=new Map,o=(r,s)=>{let a=n.get(r);return a||n.set(r,a=e.map(l=>G(s,l))),a};return i.map(r=>{var a;let s={};for(let[l,c]of Object.entries((a=r.columns)!=null?a:{})){let d=t(l);d&&(s[l]=Se(Gt(c).agg,o(l,d),e))}return s})}function Ae(i,e,t,n,o){if(!i)return 1;let r=1;try{r=Math.floor(Number(i({value:G(e,t),row:t,rowIndex:n})))}catch{r=1}return Number.isFinite(r)?Math.max(1,Math.min(o,r)):1}function tt(i,e){let t=i.length,n=new Int32Array(t),o=new Int32Array(t);if(e.rowSpan){for(let a=0;a<t;){let l=Ae(e.rowSpan,e,i[a],a,t-a);for(let c=a;c<a+l;c++)n[c]=a,o[c]=a+l-1;a+=l}return{start:n,end:o}}let r=typeof e.merge=="function"?(a,l)=>{try{return!!e.merge(G(e,i[a]),G(e,i[l]),i[a],i[l])}catch{return!1}}:(()=>{let a=i.map(l=>{let c=G(e,l);return z(c)?null:Z(c)});return(l,c)=>a[l]!==null&&a[l]===a[c]})(),s=0;for(let a=1;a<=t;a++)if(!(a<t&&r(a-1,a))){for(let l=s;l<a;l++)n[l]=s,o[l]=a-1;s=a}return{start:n,end:o}}function Yn(i,e,t,n,o=4){if(n<=0||t<=0)return{first:0,last:-1};let r=Math.max(0,Math.floor(i/t)-o),s=Math.floor((i+e)/t);return{first:Math.min(r,n-1),last:Math.min(n-1,s+o)}}function nt(i,e,t,n,o=2){let r=i.length;if(!r)return{first:0,last:-1};let s=0,a=r-1;for(;s<a;){let d=s+a>>1;i[d]+e[d]<=t?s=d+1:a=d}let l=s,c=t+n;for(a=r-1;s<a;){let d=s+a+1>>1;i[d]<c?s=d:a=d-1}return{first:Math.max(0,l-o),last:Math.min(r-1,Math.max(l,s)+o)}}function Jn(i,e,t,n,o=4){if(n<=0)return{first:0,last:-1};let r=0,s=n-1;for(;r<s;){let c=r+s>>1;i[c+1]<=e?r=c+1:s=c}let a=r,l=e+t;for(s=n-1;r<s;){let c=r+s+1>>1;i[c]<l?r=c:s=c-1}return{first:Math.max(0,a-o),last:Math.min(n-1,r+o)}}var te=["left","center","right"],Zn=6,kr=8,zt=2,Mr='<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M3 4h10M3 8h10M3 12h10" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/></svg>',Vt='<svg viewBox="0 0 16 16" width="12" height="12" aria-hidden="true"><path d="M6 3.5 10.5 8 6 12.5" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>';var Er='<svg viewBox="0 0 16 16" width="14" height="14" aria-hidden="true"><path d="M2.5 3h11l-4.2 5v4.5l-2.6 1.2V8z" fill="currentColor"/></svg>';function S(i,e="",t={}){let n=document.createElement(i);e&&(n.className=e);for(let[o,r]of Object.entries(t))n.setAttribute(o,r);return n}var ot=class{constructor(e,t,n){this.grid=t;this.opts=n;this.filterRow=null;this.activeCellId="";this.idBase=`fg${Math.random().toString(36).slice(2,8)}`;this.painted={left:new Map,center:new Map,right:new Map};this.pool={left:[],center:[],right:[]};this.frame=0;this.headerDirty=!0;this.version=0;this.lastRange={first:0,last:-1};this.summaryEl=null;this.summaryPanes=null;this.summaryInners=null;this.canvasSummary={left:[],center:[],right:[]};this.topOffset=0;this.pinnedTop=null;this.pinnedBottom=null;this.statusEl=null;this.statusKey="";this.pagerEl=null;this.cards=null;this.cardMode=!1;this.pagerKey="";this.offsets=null;this.details=new Map;this.firstDataId="";this.rowHeights=new Map;this.heightsVersion=0;this.groupLabelId="";this.onScroll=()=>{this.frame&&cancelAnimationFrame(this.frame),this.frame=0,this.render(),this.grid.events.emit("scroll",this.getScroll())};this.onSideWheel=e=>{e.deltaY&&(e.preventDefault(),this.scroller.scrollTop+=e.deltaY)};this.overlayKey="";this.heightFn=null;this.onCardClick=e=>{var l;let t=e.target,n=t.closest(".fg-card");if(!n)return;let o=Number(n.dataset.row),r=this.grid.rowModel.getRow(o);if(!r||r.kind)return;if(t.closest(".fg-card-check")){this.grid.selectFromClick(o,!0,!1),this.invalidate({rows:!0});return}let s=(l=t.closest(".fg-card-value"))==null?void 0:l.dataset.col,a=s?this.grid.columns.getColumn(s):void 0;a&&this.grid.events.emit("cellClick",{row:r.data,rowIndex:o,colId:a.id,value:G(a.def,r.data),event:e})};this.root=S("div","",{tabindex:"-1"}),this.root.addEventListener("focus",()=>this.gridEl.focus({preventScroll:!0})),this.gridEl=S("div","fg-grid",{role:"grid",tabindex:"0"}),this.headerEl=S("div","fg-header",{role:"rowgroup"}),this.bodyEl=S("div","fg-body",{role:"rowgroup"});let o=r=>({left:S("div",`${r} ${r}-left`),center:S("div",`${r} ${r}-center`),right:S("div",`${r} ${r}-right`)});this.headerPanes=o("fg-header-pane"),this.headerInners=o("fg-header-inner");for(let r of te)this.headerInners[r].setAttribute("role","row");this.bodyPanes=o("fg-body-pane"),this.canvases=o("fg-canvas");for(let r of te)this.headerPanes[r].dataset.region=r,this.bodyPanes[r].dataset.region=r,this.headerPanes[r].append(this.headerInners[r]),this.bodyPanes[r].append(this.canvases[r]),this.headerEl.append(this.headerPanes[r]),this.bodyEl.append(this.bodyPanes[r]);this.scroller=this.bodyPanes.center,t.options.filterRow&&(this.filterRow=new Ze(t,this.headerPanes)),this.overlay=S("div","fg-overlay",{"aria-live":"polite"}),this.main=S("div","fg-main"),this.gridEl.append(this.headerEl,this.bodyEl),this.main.append(this.gridEl,this.overlay),this.root.append(this.main),e.append(this.root),this.applyTheme(),this.scroller.addEventListener("scroll",this.onScroll,{passive:!0}),this.bodyPanes.left.addEventListener("wheel",this.onSideWheel,{passive:!1}),this.bodyPanes.right.addEventListener("wheel",this.onSideWheel,{passive:!1})}get activeScroller(){var e,t;return(t=(e=this.cards)==null?void 0:e.scroller)!=null?t:this.scroller}getScroll(){let e=this.activeScroller;return{top:e.scrollTop,left:e.scrollLeft}}setScroll(e){let t=this.activeScroller;typeof(e==null?void 0:e.top)=="number"&&Number.isFinite(e.top)&&(t.scrollTop=Math.max(0,e.top)),typeof(e==null?void 0:e.left)=="number"&&Number.isFinite(e.left)&&(t.scrollLeft=Math.max(0,e.left))}applyFont(e,t){e?this.root.style.setProperty("--fg-font-size",`${e}px`):this.root.style.removeProperty("--fg-font-size"),t?this.root.style.setProperty("--fg-font",t):this.root.style.removeProperty("--fg-font")}applyTheme(){let e=this.grid.options.direction==="rtl";this.root.className=`fg-root fg-theme-${this.grid.store.state.theme}${e?" fg-rtl":""}${this.cardMode?" fg-card-mode":""}${this.grid.density!=="normal"?` fg-density-${this.grid.density}`:""}`,this.root.setAttribute("dir",e?"rtl":"ltr")}get rtl(){return this.grid.options.direction==="rtl"}invalidate(e={}){e.header&&(this.headerDirty=!0),e.rows&&this.version++,this.schedule()}schedule(){this.frame||(this.frame=requestAnimationFrame(()=>{this.frame=0,this.render()}))}render(){var C,R,k,T,b,M,D,E,L,I;let{columns:e,rowModel:t,store:n,options:o}=this.grid,{rowHeight:r,headerHeight:s}=this.opts,a=this.scroller.offsetWidth-this.scroller.clientWidth;e.setContainerWidth(Math.max(0,this.main.clientWidth-a))&&(this.headerDirty=!0,this.version++);let l=t.getRowCount(),c=!!this.grid.options.autoRowHeight&&!t.server,d=t.layout(r,this.detailHeight(),c?this.rowHeights:void 0,this.heightsVersion,t.server?void 0:this.heightOf);if(this.offsets=d.uniform?null:d.offsets,this.firstDataId=(R=(C=e.displayed().find(A=>!$(A.id)))==null?void 0:C.id)!=null?R:"",this.groupLabelId=(T=(k=e.region("center").find(A=>!$(A.id)))==null?void 0:k.id)!=null?T:this.firstDataId,this.useCards()){this.renderCards(l),this.renderStatusBar(t.dataCount()),this.renderPager(),this.orderSections(null),this.paintOverlay(l);return}let u=this.grid.summary(),h=u?u.opts.rows.length:0,p=(b=u==null?void 0:u.opts.position)!=null?b:"bottom",f=u?u.opts.pinned!==!1:!1;this.topOffset=u&&!f&&p==="top"?h*r:0;let x=u&&!f&&p==="bottom"?h*r:0;this.syncSummaryPane(u&&f?p:null,h*r);let y=e.depth*s+((D=(M=this.filterRow)==null?void 0:M.height)!=null?D:0);this.headerEl.style.height=`${y}px`;for(let A of te){let F=e.regionWidth(A);A!=="center"&&(this.headerPanes[A].style.width=this.bodyPanes[A].style.width=`${F}px`,this.headerPanes[A].hidden=this.bodyPanes[A].hidden=F===0),this.canvases[A].style.width=`${F}px`,this.canvases[A].style.height=`${this.rowsHeight(l)+this.topOffset+x}px`}o.autoHeight&&!this.useCards()&&(this.root.classList.add("fg-auto-height"),this.bodyEl.style.height=`${this.rowsHeight(l)+this.topOffset+x+Math.max(0,this.scroller.offsetHeight-this.scroller.clientHeight)}px`);let m=this.scroller.offsetHeight-this.scroller.clientHeight;this.bodyPanes.left.style.marginBottom=this.bodyPanes.right.style.marginBottom=`${m}px`;let w=this.gridEl;w.setAttribute("role",o.treeData||this.grid.getGroupBy().length?"treegrid":"grid"),w.setAttribute("aria-rowcount",String(l+e.depth+(this.filterRow?1:0))),w.setAttribute("aria-colcount",String(e.displayed().length)),o.rowSelection==="multiple"&&w.setAttribute("aria-multiselectable","true"),this.headerDirty&&(this.headerDirty=!1,this.renderHeader()),(E=this.filterRow)==null||E.render(),this.renderRows(l),this.updateActiveCell(),c&&this.measureRows(),this.renderSummary(l,u&&u.opts.rows,(L=u==null?void 0:u.values)!=null?L:[],f,p),this.pinnedTop=this.renderPinned(this.pinnedTop,"top",this.grid.pinnedRows.top),this.pinnedBottom=this.renderPinned(this.pinnedBottom,"bottom",this.grid.pinnedRows.bottom),this.renderStatusBar(t.dataCount()),this.renderPager(),this.orderSections(u&&f?p:null),this.paintOverlay(l),this.overlay.style.top=`${y}px`;let{scrollTop:g,scrollLeft:v}=this.scroller;this.bodyPanes.left.scrollTop=this.bodyPanes.right.scrollTop=g,this.headerInners.center.style.transform=`translateX(${-v}px)`,(I=this.filterRow)==null||I.setTransform(v),this.summaryInners&&(this.summaryInners.center.style.transform=`translateX(${-v}px)`);for(let A of[this.pinnedTop,this.pinnedBottom])A&&(A.inners.center.style.transform=`translateX(${-v}px)`);this.grid.fillHandle.update()}orderSections(e){var s,a,l,c;let t=[e==="top"?this.summaryEl:null,(a=(s=this.pinnedTop)==null?void 0:s.el)!=null?a:null].filter(d=>!!d),n=[(c=(l=this.pinnedBottom)==null?void 0:l.el)!=null?c:null,e==="bottom"?this.summaryEl:null].filter(d=>!!d),o=[this.statusEl,this.pagerEl].filter(d=>!!d);for(let d of t)d.nextElementSibling!==this.bodyEl&&!t.includes(d.nextElementSibling)&&this.gridEl.insertBefore(d,this.bodyEl);let r=this.bodyEl;for(let d=t.length-1;d>=0;d--)r.previousElementSibling!==t[d]&&this.gridEl.insertBefore(t[d],r),r=t[d];r=this.bodyEl;for(let d of n)r.nextElementSibling!==d&&r.after(d),r=d;r=this.gridEl;for(let d of o)r.nextElementSibling!==d&&r.after(d),r=d}paintOverlay(e){var d;let{grid:t}=this,{store:n,rowModel:o,options:r}=t,s=(d=t.forcedOverlay)!=null?d:e>0?null:o.loading()?"loading":"noRows";if(this.overlay.hidden=!s,!s){this.overlayKey="";return}let a=!o.server&&n.state.data.length>0,l=s==="loading"?r.loadingOverlay:r.noRowsOverlay,c=`${s}|${a}|${n.state.locale.code}`;if(c!==this.overlayKey)if(this.overlayKey=c,this.overlay.classList.toggle("fg-overlay-custom",typeof l=="function"),l==null)this.overlay.textContent=s==="loading"?n.state.locale.loading:n.state.locale.noRows;else if(typeof l=="string")this.overlay.textContent=l;else try{let u=l({filtered:a});typeof u=="string"?this.overlay.textContent=u:this.overlay.replaceChildren(u)}catch{O(`${s==="loading"?"loadingOverlay":"noRowsOverlay"} threw`),this.overlay.textContent=s==="loading"?n.state.locale.loading:n.state.locale.noRows}}updateActiveCell(){var n,o,r;let e=this.activeCellId&&(r=(o=(n=this.root.getRootNode()).getElementById)==null?void 0:o.call(n,this.activeCellId))!=null?r:null,t=this.gridEl.querySelector(".fg-body .fg-cell-focused, .fg-body .fg-row-group .fg-cell-focused");if(e&&e!==t&&e.removeAttribute("id"),!t){this.gridEl.removeAttribute("aria-activedescendant"),this.activeCellId="";return}t.id||(t.id=`${this.idBase}-cell`),this.activeCellId=t.id,this.gridEl.setAttribute("aria-activedescendant",t.id)}renderPinned(e,t,n){if(!n.length)return e==null||e.el.remove(),null;let o=e!=null?e:new qt(`fg-pinned-rows fg-pinned-${t}`),{columns:r}=this.grid,s=this.opts.rowHeight;o.size(r,n.length*s,this.scroller.offsetWidth-this.scroller.clientWidth);let a=r.region("center"),l=nt(a.map(c=>c.left),a.map(c=>c.width),this.scroller.scrollLeft,this.scroller.clientWidth,zt);for(let c of te){let d=c==="center"?a.slice(l.first,l.last+1):r.region(c);o.inners[c].replaceChildren(...n.map((u,h)=>{let p=S("div","fg-row fg-row-pinned",{role:"row"});p.style.transform=`translateY(${h*s}px)`,p.style.height=`${s}px`;let f={id:`pinned-${t}-${h}`,data:u,sourceIndex:-1};for(let x of d){let y=S("div","fg-cell",{role:"gridcell"});$(x.id)?(y.style.left=`${x.left}px`,y.style.width=`${x.width}px`):this.paintCell(y,f,-1,x,!1,!1),p.append(y)}return p}))}return o}renderStatusBar(e){var u,h;if(!this.grid.options.statusBar){(u=this.statusEl)==null||u.remove(),this.statusEl=null;return}let{grid:t}=this,n=t.store.state,o=t.rowModel.server?e:t.viewRows().length,r=`${this.version}|${e}|${o}|${n.selected.size}|${JSON.stringify(n.range)}|${n.locale.code}`;if(this.statusEl&&r===this.statusKey)return;this.statusKey=r,(h=this.statusEl)!=null||(this.statusEl=S("div","fg-statusbar",{role:"status","aria-live":"polite"}));let s=n.locale,a=new Intl.NumberFormat(s.code,{maximumFractionDigits:2}),l=S("span","fg-status-rows");l.textContent=(e===o?s.statusRows.replace("{n}",a.format(o)):s.statusFiltered.replace("{shown}",a.format(e)).replace("{total}",a.format(o)))+(n.selected.size?` \xB7 ${s.statusSelected.replace("{n}",a.format(n.selected.size))}`:"");let c=S("span","fg-status-aggs"),d=t.rangeAggregates();if(d&&d.cells>1){let p=[`${s.count} ${a.format(d.count)}`];d.numbers&&p.push(`${s.sum} ${a.format(d.sum)}`,`${s.avg} ${a.format(d.sum/d.numbers)}`,`${s.min} ${a.format(d.min)}`,`${s.max} ${a.format(d.max)}`),c.textContent=p.join(" ")}this.statusEl.replaceChildren(l,c)}renderHeader(){let{columns:e,store:t}=this.grid,{sort:n,filters:o,locale:r}=t.state;for(let s of te){let a=this.headerInners[s];a.style.width=`${e.regionWidth(s)}px`,a.style.height=`${e.depth*this.opts.headerHeight}px`,a.replaceChildren(...e.headerCells(s).map(l=>this.headerCell(l,n,o,r)))}}headerCell(e,t,n,o){var h,p;let r=this.opts.headerHeight,s=S("div",e.isGroup?"fg-header-cell fg-header-group":"fg-header-cell",{role:"columnheader"});if(s.dataset.col=e.id,s.style.left=`${e.left}px`,s.style.top=`${e.row*r}px`,s.style.width=`${e.width}px`,s.style.height=`${e.rowSpan*r}px`,$(e.id))return e.id===fe&&(s.classList.add("fg-header-rownum"),s.textContent=e.label),e.id===ne&&(s.classList.add("fg-header-select"),s.append(this.selectAllBox(o))),s;let a=S("span","fg-header-label"),l=e.node.def;if(a.textContent=e.label,l.headerRenderer)try{let f=l.headerRenderer({header:e.label,column:l});typeof f=="string"?a.innerHTML=f:a.replaceChildren(f)}catch{O(`headerRenderer of column "${e.id}" threw; showing the plain header`),a.textContent=e.label}let c=null;if(e.isGroup&&this.grid.columns.isCollapsible(e.node)){let f=e.node.open,x=S("button",f?"fg-colgroup-toggle fg-expanded":"fg-colgroup-toggle",{type:"button",tabindex:"-1","aria-expanded":String(f),"aria-label":f?o.collapseAll:o.expandAll});x.textContent=f?"\u2212":"+",x.addEventListener("click",y=>{y.stopPropagation(),this.grid.setColumnGroupOpened(e.id,!f)}),s.classList.add("fg-header-collapsible"),c=x}if(l.headerClass)try{let f=typeof l.headerClass=="function"?l.headerClass(l):l.headerClass;f&&s.classList.add(...f.split(/\s+/).filter(Boolean))}catch{O(`headerClass of column "${e.id}" threw`)}if(s.append(a),c&&s.append(c),e.isGroup||!e.column)return s;let d=e.node.def;((h=d.wrapHeaderText)!=null?h:this.grid.options.wrapHeaderText)&&s.classList.add("fg-header-wrap"),s.setAttribute("aria-colindex",String(e.column.index+1)),((p=d.align)!=null?p:d.type==="number"?"right":"left")==="right"&&s.classList.add("fg-align-right");let u=t.findIndex(f=>f.colId===e.id);if(s.setAttribute("aria-sort",u<0?"none":t[u].dir==="asc"?"ascending":"descending"),ve(d)&&s.classList.add("fg-sortable"),u>=0){let f=S("span","fg-sort-icon");if(f.textContent=t[u].dir==="asc"?"\u2191":"\u2193",t.length>1){let x=S("sup");x.textContent=String(u+1),f.append(x)}s.append(f)}if(ve(d)||ie(d)){let f=!!n[e.id],x=S("button",f?"fg-menu-btn fg-filter-active":"fg-menu-btn",{type:"button",tabindex:"-1","aria-label":o.columnMenu});x.innerHTML=f?Er:Mr,s.append(x)}return Xe(d)&&s.append(S("div","fg-resize",{"aria-hidden":"true"})),s}selectAllBox(e){let t=this.grid.selectableRows(),n=this.grid.store.state.selected,o=0;for(let s of t)n.has(s.id)&&o++;let r=S("input","fg-checkbox fg-select-all",{type:"checkbox",tabindex:"-1","aria-label":e.selectAllRows});return r.checked=t.length>0&&o===t.length,r.indeterminate=o>0&&o<t.length,r.hidden=this.grid.options.rowSelection!=="multiple"||this.grid.options.headerCheckbox===!1,r}renderRows(e){var p,f,x;let{columns:t,rowModel:n,store:o}=this.grid,{selected:r,focus:s}=o.state,a=this.grid.allRangeBounds(),l=this.grid.mergeSpans(),c=Math.max(0,this.scroller.scrollTop-this.topOffset),d=this.grid.options.autoHeight&&!n.server?{first:0,last:e-1}:this.offsets?Jn(this.offsets,c,this.scroller.clientHeight,e,Zn):Yn(c,this.scroller.clientHeight,this.opts.rowHeight,e,Zn);this.lastRange=d;let u=t.region("center"),h=nt(u.map(y=>y.left),u.map(y=>y.width),this.scroller.scrollLeft,this.scroller.clientWidth,zt);u.some(y=>y.def.colSpan)&&(h.first=Math.max(0,h.first-kr));for(let y of te){let m=y==="center"?u.slice(h.first,h.last+1):t.region(y),w=this.painted[y];for(let[v,C]of w)v>=d.first&&v<=d.last&&m.length||(C.el.remove(),this.pool[y].push(C.el),w.delete(v));if(!m.length)continue;let g=y==="center"?`${h.first}-${h.last}`:"";for(let v=d.first;v<=d.last;v++){let C=n.getRow(v),R=r.has(C.id),k=s&&s.rowIndex===v?s.colId:"",T=a.filter(I=>v>=I.r1&&v<=I.r2),b=T.map(I=>`${I.c1}-${I.c2}`).join(","),M=this.mergeState(l,m,v,d.first),D=C.kind==="detail"?`${this.scroller.scrollLeft}:${this.scroller.clientWidth}`:"",E=`${C.id}|${this.version}|${g}|${R?1:0}${C.kind==="group"?`:${this.grid.selectionVersion}`:""}|${k}|${b}|${M}|${D}`,L=w.get(v);if(!L){let I=(p=this.pool[y].pop())!=null?p:S("div","fg-row",{role:"row"});this.canvases[y].append(I),L={el:I,key:""},w.set(v,L)}L.key!==E&&(L.key=E,L.el.dataset.kind!==((f=C.kind)!=null?f:"")&&(L.el.replaceChildren(),L.el.dataset.kind=(x=C.kind)!=null?x:""),C.kind==="group"?this.paintGroupRow(L.el,C,v,m,k):C.kind==="detail"?this.paintDetailRow(L.el,C,v,y):C.kind==="loading"?this.paintLoadingRow(L.el,v,m):this.paintRow(L.el,C,v,m,R,k,T,l,d.first))}}}mergeState(e,t,n,o){if(!e.size)return"";let r="";for(let s of t){let a=e.get(s.id);if(!a)continue;let l=a.start[n],c=a.end[n];r+=l===c?"n":n===Math.max(l,o)?`d${l}`:"h"}return r}paintRow(e,t,n,o,r,s,a,l=new Map,c=0){let d=this.opts.rowHeight;for(e.className=`fg-row${n%2?" fg-row-odd":""}${r?" fg-row-selected":""}${this.grid.tracker.created.has(t.data)?" fg-row-created":""}${this.grid.editor.editingRow(t.id)?" fg-row-editing":""}`,this.placeRow(e,n),this.grid.options.rowSelection&&e.setAttribute("aria-selected",String(r)),t.level!==void 0?e.setAttribute("aria-level",String(t.level+1)):e.removeAttribute("aria-level"),t.hasChildren?e.setAttribute("aria-expanded",String(!!t.expanded)):e.removeAttribute("aria-expanded");e.childElementCount>o.length;)e.lastElementChild.remove();for(;e.childElementCount<o.length;)e.append(S("div","fg-cell",{role:"gridcell"}));let u=!1,h=o.length?this.grid.columns.region(o[0].region):[],p=h.some(y=>y.def.colSpan),f=-1,x=p?new Map(h.map((y,m)=>[y.id,m])):null;o.forEach((y,m)=>{let w=e.children[m];if(this.paintCell(w,t,n,y,r,s===y.id),x){let v=x.get(y.id);if(v<=f)w.classList.add("fg-cell-span-hidden");else if(y.def.colSpan&&!$(y.id)){let C=Ae(y.def.colSpan,y.def,t.data,n,h.length-v);if(C>1){f=v+C-1;let R=0;for(let k=v;k<=f;k++)R+=h[k].width;w.style.width=`${R}px`,w.classList.add("fg-cell-colspan")}}}y.id===this.firstDataId&&this.decorate(w,t),w.style.top=w.style.height=w.style.bottom="";let g=l.get(y.id);g&&g.start[n]!==g.end[n]&&(n===Math.max(g.start[n],c)?(w.classList.add("fg-cell-merged"),w.style.top=`${-(this.rowTop(n)-this.rowTop(g.start[n]))}px`,w.style.height=`${this.rowTop(g.end[n])+this.rowH(g.end[n])-this.rowTop(g.start[n])}px`,w.style.bottom="auto",u=!0):w.classList.add("fg-cell-merge-hidden")),!$(y.id)&&a.some(v=>y.index>=v.c1&&y.index<=v.c2)&&w.classList.add("fg-cell-range")}),e.style.zIndex=u?"1":""}paintCell(e,t,n,o,r,s){var p;let a=this.grid.store.state.locale;e.style.left=`${o.left}px`,e.style.width=`${o.width}px`,e.dataset.col=o.id,e.setAttribute("aria-colindex",String(o.index+1));let l=s?"fg-cell fg-cell-focused":"fg-cell";if(o.id===fe){e.className=`${l} fg-cell-rownum`;let f=n>=0&&!t.kind?this.grid.rowNumber(n):null;e.textContent=f===null?"":String(f);return}if(o.id===we){e.className=`${l} fg-cell-drag`;let f=S("span",this.grid.canMoveRows()?"fg-drag-handle":"fg-drag-handle fg-drag-disabled",{"aria-hidden":"true"});f.textContent="\u22EE\u22EE",e.replaceChildren(f);return}if(o.id===ne){e.className=`${l} fg-cell-select`;let f=S("input","fg-checkbox",{type:"checkbox",tabindex:"-1","aria-label":a.selectRow});f.checked=r,n>=0&&!t.kind&&!this.grid.rowSelectable(t.data)&&(f.disabled=!0,e.classList.add("fg-cell-select-locked")),e.replaceChildren(f);return}let c=o.def,d=G(c,t.data),u=_(c,a.code)(d);l+=` fg-align-${(p=c.align)!=null?p:c.type==="number"?"right":c.type==="boolean"?"center":"left"}`;let h={value:d,formatted:u,row:t.data,rowIndex:n,column:c};if(c.cellClass)try{let f=typeof c.cellClass=="function"?c.cellClass(h):c.cellClass;f&&(l+=` ${f}`)}catch{O(`cellClass of column "${o.id}" threw`)}if(this.grid.tracker.isDirty(t.data,c.field)&&(l+=" fg-cell-dirty"),c.wrapText&&(l+=" fg-cell-wrap"),typeof c.editable=="function"&&n>=0&&!le(c,t.data,n)&&(l+=" fg-cell-readonly"),n>=0&&(l+=this.grid.finder.classFor(n,o.id)),this.grid.isFlashing(t.id,o.id)&&(l+=" fg-cell-flash"),e.className=l,c.sparkline&&!c.renderer){let f=Array.isArray(d)?d.map(Number).filter(Number.isFinite):[];f.length?e.replaceChildren(Lr(f,c.sparkline===!0?{}:c.sparkline,o.width,this.opts.rowHeight)):e.replaceChildren(),e.setAttribute("aria-label",Array.isArray(d)?d.join(", "):"");return}if(!c.renderer){e.textContent=u;return}try{let f=c.renderer(h);typeof f=="string"?e.innerHTML=f:e.replaceChildren(f)}catch{O(`renderer of column "${o.id}" threw; rendering an empty cell`),e.textContent=""}}cellAt(e){let t=e instanceof Element?e.closest(".fg-cell"):null,n=t==null?void 0:t.parentElement;return!t||!(n!=null&&n.dataset.row)||!t.dataset.col||t.closest(".fg-root")!==this.root?null:{rowIndex:Number(n.dataset.row),colId:t.dataset.col}}ensureVisible(e,t){let n=this.scroller,o=this.rowTop(e),r=o+Math.min(this.rowH(e),n.clientHeight||1/0);o<n.scrollTop?n.scrollTop=o:r>n.scrollTop+n.clientHeight&&(n.scrollTop=r-n.clientHeight);let s=t?this.grid.columns.getColumn(t):void 0;(s==null?void 0:s.region)==="center"&&(s.left<n.scrollLeft?n.scrollLeft=s.left:s.left+s.width>n.scrollLeft+n.clientWidth&&(n.scrollLeft=s.left+s.width-n.clientWidth))}syncSummaryPane(e,t){var o;if(!e){(o=this.summaryEl)==null||o.remove(),this.summaryEl=this.summaryPanes=this.summaryInners=null;return}if(!this.summaryEl){let r=s=>({left:S("div",`${s} ${s}-left`),center:S("div",`${s} ${s}-center`),right:S("div",`${s} ${s}-right`)});this.summaryEl=S("div","fg-summary",{role:"rowgroup"}),this.summaryPanes=r("fg-summary-pane"),this.summaryInners=r("fg-summary-inner");for(let s of te)this.summaryPanes[s].append(this.summaryInners[s]),this.summaryEl.append(this.summaryPanes[s])}this.summaryEl.className=`fg-summary fg-summary-${e}`,this.summaryEl.style.height=`${t}px`;for(let r of te){let s=this.grid.columns.regionWidth(r);r!=="center"&&(this.summaryPanes[r].style.width=`${s}px`,this.summaryPanes[r].hidden=s===0),this.summaryInners[r].style.width=`${s}px`,this.summaryInners[r].style.height=`${t}px`}let n=this.scroller.offsetWidth-this.scroller.clientWidth;this.summaryPanes.center.style.marginRight=`${n}px`}renderSummary(e,t,n,o,r){for(let u of te){for(let h of this.canvasSummary[u])h.remove();this.canvasSummary[u]=[]}if(!t)return;let{columns:s}=this.grid,a=this.opts.rowHeight,l=s.region("center"),c=nt(l.map(u=>u.left),l.map(u=>u.width),this.scroller.scrollLeft,this.scroller.clientWidth,zt),d=s.displayed().filter(u=>!$(u.id));for(let u of te){let h=u==="center"?l.slice(c.first,c.last+1):s.region(u),p=t.map((f,x)=>{var g,v,C;let y=f.label!=null&&(v=(g=d.find(R=>{var k;return!(R.id in((k=f.columns)!=null?k:{}))}))==null?void 0:g.id)!=null?v:null,m=S("div","fg-row fg-summary-row",{role:"row"}),w=o||r==="top"?x*a:this.rowsHeight(e)+x*a;m.style.transform=`translateY(${w}px)`,m.style.height=`${a}px`;for(let R of h)m.append(this.summaryCell(R,f,(C=n[x])!=null?C:{},y));return m});o?this.summaryInners[u].replaceChildren(...p):(this.canvases[u].append(...p),this.canvasSummary[u]=p)}}summaryCell(e,t,n,o){var p,f,x,y,m;let r=S("div","fg-cell",{role:"gridcell"});r.style.left=`${e.left}px`,r.style.width=`${e.width}px`,r.dataset.col=e.id;let s=e.def,a=(p=s.align)!=null?p:s.type==="number"?"right":s.type==="boolean"?"center":"left";r.className=`fg-cell fg-align-${a}`;let l=(f=t.columns)==null?void 0:f[e.id];if(l===void 0)return e.id===o&&(r.textContent=(x=t.label)!=null?x:"",r.classList.add("fg-summary-label")),r;let c=n[e.id],d=Gt(l),u=this.grid.store.state.locale.code,h;if(c==null||c==="")h="";else if(typeof c=="string")h=c;else if(d.agg==="count")h=new Intl.NumberFormat(u).format(c);else{let w=(y=s.type)!=null?y:typeof c=="number"?"number":c instanceof Date?"date":void 0;h=_({...s,type:w,format:(m=d.format)!=null?m:s.format},u)(c)}return r.textContent=d.prefix&&h?`${d.prefix} ${h}`:h,r}get heightOf(){var t;let e=this.grid.options.getRowHeight;if(e)return(t=this.heightFn)!=null?t:this.heightFn=n=>{var o;try{return(o=e(n))!=null?o:void 0}catch{return}}}invalidateHeights(){this.heightOf&&this.heightsVersion++,this.rowHeights.size&&(this.rowHeights.clear(),this.heightsVersion++)}measureRows(){var o,r;let e=this.opts.rowHeight,t=new Map;for(let s of te)for(let[a,l]of this.painted[s]){let c=this.grid.rowModel.getRow(a);if(!c||c.kind)continue;let d=(o=t.get(a))!=null?o:e;for(let u of l.el.querySelectorAll(".fg-cell-wrap"))u.classList.contains("fg-cell-merged")||u.classList.contains("fg-cell-merge-hidden")||(d=Math.max(d,Math.ceil(u.scrollHeight)));t.set(a,d)}let n=!1;for(let[s,a]of t){let l=this.grid.rowModel.getRow(s).id,c=(r=this.rowHeights.get(l))!=null?r:e;Math.abs(c-a)>1&&(a===e?this.rowHeights.delete(l):this.rowHeights.set(l,a),n=!0)}n&&(this.heightsVersion++,this.version++,this.schedule())}detailHeight(){let e=this.grid.options.detailHeight;return typeof e=="number"&&e>0?e:240}rowTop(e){return(this.offsets?this.offsets[e]:e*this.opts.rowHeight)+this.topOffset}rowH(e){return this.offsets?this.offsets[e+1]-this.offsets[e]:this.opts.rowHeight}rowsHeight(e){return this.offsets?this.offsets[e]:e*this.opts.rowHeight}placeRow(e,t){e.style.transform=`translateY(${this.rowTop(t)}px)`,e.style.height=`${this.rowH(t)}px`,e.dataset.row=String(t),e.setAttribute("aria-rowindex",String(t+1+this.grid.columns.depth+(this.filterRow?1:0)))}decorate(e,t){var c;let{grid:n}=this,o=n.store.state.locale,r=(c=t.level)!=null?c:0,s=!!n.options.treeData,a=n.canExpandDetail(t.data);if(!s&&!a&&!r)return;e.classList.add("fg-cell-lead"),e.style.setProperty("--fg-level",String(r));let l=[];if(s)if(t.hasChildren){let d=S("button",t.expanded?"fg-tree-toggle fg-expanded":t.loading?"fg-tree-toggle fg-tree-loading":"fg-tree-toggle",{type:"button",tabindex:"-1","aria-label":t.expanded?o.collapseAll:o.expandAll,"aria-expanded":String(!!t.expanded)});t.loading&&d.setAttribute("aria-busy","true"),d.innerHTML=Vt,l.push(d)}else l.push(S("span","fg-tree-spacer",{"aria-hidden":"true"}));if(a){let d=n.isDetailExpanded(t.data),u=S("button",d?"fg-detail-toggle fg-expanded":"fg-detail-toggle",{type:"button",tabindex:"-1","aria-expanded":String(d),"aria-label":d?o.collapseAll:o.expandAll});u.innerHTML=Vt,l.push(u)}e.prepend(...l)}paintGroupRow(e,t,n,o,r){var c;let s=t.group,{grid:a}=this,l=a.store.state.locale;for(e.className="fg-row fg-row-group",this.placeRow(e,n),e.setAttribute("aria-level",String(((c=t.level)!=null?c:0)+1)),e.setAttribute("aria-expanded",String(s.expanded)),e.removeAttribute("aria-selected"),e.style.zIndex="";e.childElementCount>o.length;)e.lastElementChild.remove();for(;e.childElementCount<o.length;)e.append(S("div","fg-cell",{role:"gridcell"}));o.forEach((d,u)=>{var m,w,g,v,C,R,k;let h=e.children[u];h.style.left=`${d.left}px`,h.style.width=`${d.width}px`,h.style.top=h.style.height=h.style.bottom="",h.style.removeProperty("--fg-level"),h.dataset.col=d.id,h.setAttribute("aria-colindex",String(d.index+1));let p=r===d.id?" fg-cell-focused":"";if(d.id===ne){if(h.className=`fg-cell fg-cell-select${p}`,a.options.rowSelection!=="multiple"){h.replaceChildren();return}let T=a.groupSelection(t),b=S("input","fg-checkbox",{type:"checkbox",tabindex:"-1","aria-label":l.selectAllRows});b.checked=T==="all",b.indeterminate=T==="some",h.replaceChildren(b);return}if(d.id===this.groupLabelId){h.className=`fg-cell fg-group-cell${p}`,h.style.setProperty("--fg-level",String((m=t.level)!=null?m:0));let T=S("button",s.expanded?"fg-group-toggle fg-expanded":"fg-group-toggle",{type:"button",tabindex:"-1","aria-expanded":String(s.expanded),"aria-label":s.expanded?l.collapseAll:l.expandAll});T.innerHTML=Vt;let b=(w=a.columns.getNode(s.colId))==null?void 0:w.def,M=S("span","fg-group-label"),D=z(s.value)?l.blanks:b?_(b,l.code)(s.value):String(s.value),E=new Intl.NumberFormat(l.code),L=(g=s.count)!=null?g:s.aggregates?null:s.rows.length;M.textContent=`${(C=(v=b==null?void 0:b.header)!=null?v:b==null?void 0:b.field)!=null?C:s.colId}: ${D}${L==null?"":` (${E.format(L)})`}`,h.replaceChildren(T,M);return}let f=d.def,x=(R=f.align)!=null?R:f.type==="number"?"right":f.type==="boolean"?"center":"left";h.className=`fg-cell fg-align-${x}${p}`;let y=f.aggFunc&&!$(d.id)?a.groupAggregate(t,d.id):void 0;if(y==null||y==="")h.textContent="";else if(f.aggFunc==="count")h.textContent=new Intl.NumberFormat(l.code).format(y);else{let T=(k=f.type)!=null?k:typeof y=="number"?"number":y instanceof Date?"date":void 0;h.textContent=_({...f,type:T},l.code)(y)}h.textContent&&h.classList.add("fg-cell-agg")})}paintDetailRow(e,t,n,o){var a,l;if(e.className="fg-row fg-row-detail",this.placeRow(e,n),e.style.zIndex="",o!=="center"){e.replaceChildren();return}let r=t.detailOf,s=this.details.get(r.id);if(!s){s=S("div","fg-detail");try{let c=(l=(a=this.grid.options).detailRenderer)==null?void 0:l.call(a,{row:r.data,rowIndex:n-1});typeof c=="string"?s.innerHTML=c:c&&s.append(c)}catch{O("detailRenderer threw; showing an empty panel")}this.details.set(r.id,s)}s.style.left=`${this.scroller.scrollLeft}px`,s.style.width=`${this.scroller.clientWidth||this.grid.columns.regionWidth("center")}px`,(e.firstChild!==s||e.childNodes.length!==1)&&e.replaceChildren(s)}paintLoadingRow(e,t,n){e.className="fg-row fg-row-loading",this.placeRow(e,t),e.setAttribute("aria-busy","true"),e.style.zIndex="",e.replaceChildren(...n.map(o=>{let r=S("div","fg-cell",{role:"gridcell"});return r.style.left=`${o.left}px`,r.style.width=`${o.width}px`,r.dataset.col=o.id,$(o.id)||r.append(S("span","fg-skeleton",{"aria-hidden":"true"})),r}))}renderPager(){var m;let{grid:e}=this,t=e.options.pagination;if(!t){(m=this.pagerEl)==null||m.remove(),this.pagerEl=null;return}let n=e.store.state.locale,o=e.getPage(),r=e.getPageSize(),s=e.getPageCount(),a=e.rowModel.fullCount(),l=typeof t=="object"&&Array.isArray(t.pageSizes)?t.pageSizes.filter(w=>Number.isInteger(w)&&w>0):[],c=`${o}|${r}|${s}|${a}|${n.code}|${l.join(",")}`;if(this.pagerEl&&c===this.pagerKey)return;this.pagerKey=c,this.pagerEl||(this.pagerEl=S("div","fg-pager",{role:"navigation"}),this.pagerEl.addEventListener("click",w=>{var C;let g=(C=w.target.closest("button[data-action]"))==null?void 0:C.dataset.action,v=e.getPage();g==="first"?e.setPage(0):g==="prev"?e.setPage(v-1):g==="next"?e.setPage(v+1):g==="last"&&e.setPage(e.getPageCount()-1)}),this.pagerEl.addEventListener("change",w=>{let g=w.target;g.classList.contains("fg-pager-size")&&e.setPageSize(Number(g.value))})),this.pagerEl.setAttribute("aria-label",n.pageSize);let d=new Intl.NumberFormat(n.code),u=a?o*r+1:0,h=Math.min(a,(o+1)*r),p=S("span","fg-pager-range");p.textContent=n.pagerRange.replace("{from}",d.format(u)).replace("{to}",d.format(h)).replace("{total}",d.format(a));let f=[p,S("span","fg-pager-spacer")];if(l.length){let w=S("label","fg-pager-size-label");w.textContent=n.pageSize;let g=S("select","fg-pager-size");for(let v of[...new Set([...l,r])].sort((C,R)=>C-R)){let C=S("option");C.value=String(v),C.textContent=d.format(v),C.selected=v===r,g.append(C)}w.append(g),f.push(w)}let x=(w,g,v,C)=>{let R=S("button","fg-pager-btn",{type:"button","aria-label":v,title:v});return R.dataset.action=w,R.textContent=g,R.disabled=C,R},y=S("span","fg-pager-page",{"aria-live":"polite"});y.textContent=n.pageOf.replace("{page}",d.format(o+1)).replace("{pages}",d.format(s)),f.push(x("first","\xAB",n.firstPage,o===0),x("prev","\u2039",n.previousPage,o===0),y,x("next","\u203A",n.nextPage,o>=s-1),x("last","\xBB",n.lastPage,o>=s-1)),this.pagerEl.replaceChildren(...f)}showFreeBadge(){if(this.root.querySelector(".fg-free-badge"))return;let e=S("a","fg-free-badge",{href:"https://freegrid.app/pricing/",target:"_blank",rel:"noopener"});e.innerHTML='<svg viewBox="0 0 32 32" width="14" height="14" aria-hidden="true"><rect width="32" height="32" rx="7" fill="#0E1726"/><path d="M7 11.5h18M7 16.5h18M7 21.5h18M13 7v18" stroke="#fff" stroke-width="2" stroke-linecap="round"/><rect x="14" y="12.5" width="11" height="3" rx="1" fill="#F2A900"/></svg>';let t=S("span");t.textContent=`FreeGrid \xB7 ${this.grid.store.state.locale.freeBadge}`,e.append(t),this.root.append(e)}useCards(){let e=this.grid.options.cardView,t=e===!0?640:typeof e=="number"?e:-1,n=t>0&&this.main.clientWidth<t;return n!==this.cardMode&&(this.cardMode=n,this.root.classList.toggle("fg-card-mode",n),!n&&this.cards&&(this.cards.scroller.remove(),this.cards=null),this.version++),n}renderCards(e){var x,y,m,w,g;let{grid:t}=this;if(!this.cards){let v=S("div","fg-cards",{role:"list"}),C=S("div","fg-cards-canvas");v.append(C),this.main.insertBefore(v,this.overlay),v.addEventListener("scroll",()=>{this.schedule(),this.grid.events.emit("scroll",this.getScroll())},{passive:!0}),v.addEventListener("click",this.onCardClick),this.cards={scroller:v,canvas:C}}let{scroller:n,canvas:o}=this.cards,r=t.columns.displayed().filter(v=>!$(v.id)),s=Math.round(this.opts.rowHeight*.75),a=!!t.options.rowSelection,l=20+r.length*s+(a?s:0),c=10;o.style.height=`${e*(l+c)}px`;let d=Math.max(0,Math.floor(n.scrollTop/(l+c))-2),u=Math.min(e-1,Math.ceil((n.scrollTop+(n.clientHeight||800))/(l+c))+2),{selected:h,locale:p}=t.store.state,f=[];for(let v=d;v<=u;v++){let C=t.rowModel.getRow(v);if(!C)continue;let R=S("div",C.kind?"fg-card fg-card-other":h.has(C.id)?"fg-card fg-card-selected":"fg-card",{role:"listitem"});if(R.dataset.row=String(v),R.style.transform=`translateY(${v*(l+c)}px)`,R.style.height=`${l}px`,R.style.setProperty("--fg-card-line",`${s}px`),C.kind==="group"&&C.group){let k=(x=t.columns.getNode(C.group.colId))==null?void 0:x.def;R.textContent=`${(y=k==null?void 0:k.header)!=null?y:C.group.colId}: ${String((m=C.group.value)!=null?m:p.blanks)} (${C.group.rows.length})`}else if(!C.kind){if(a){let k=S("label","fg-card-head"),T=S("input","fg-card-check fg-checkbox",{type:"checkbox","aria-label":p.selectRow});T.checked=h.has(C.id),T.disabled=!t.rowSelectable(C.data),k.append(T,document.createTextNode(`#${v+1}`)),R.append(k)}for(let k of r){let T=S("div","fg-card-line"),b=S("span","fg-card-label");b.textContent=(g=(w=k.def.header)!=null?w:k.def.field)!=null?g:k.id;let M=S("span","fg-card-value");M.dataset.col=k.id;let D=G(k.def,C.data),E=_(k.def,p.code)(D);if(k.def.renderer)try{let L=k.def.renderer({value:D,formatted:E,row:C.data,rowIndex:v,column:k.def});typeof L=="string"?M.innerHTML=L:M.replaceChildren(L)}catch{M.textContent=E}else M.textContent=E;T.append(b,M),R.append(T)}}f.push(R)}o.replaceChildren(...f)}dropDetail(e){e===void 0?this.details.clear():this.details.delete(e)}renderedRange(){return this.lastRange}measureText(e,t){let n=getComputedStyle(this.main),o=parseFloat(getComputedStyle(this.root).getPropertyValue("--fg-font-size"))||13;this.measureCtx===void 0&&(this.measureCtx=document.createElement("canvas").getContext("2d"));let r=this.measureCtx;return r?(r.font=`${t?600:400} ${o}px ${n.fontFamily||"sans-serif"}`,r.measureText(e).width):e.length*o*.6}scrollToRow(e){this.scroller.scrollTop=this.rowTop(Math.max(0,Math.min(e,this.grid.rowModel.getRowCount())))}pageRows(){return Math.max(1,Math.floor(this.scroller.clientHeight/this.opts.rowHeight))}destroy(){var e;(e=this.filterRow)==null||e.destroy(),this.frame&&cancelAnimationFrame(this.frame),this.scroller.removeEventListener("scroll",this.onScroll),this.root.remove()}},qt=class{constructor(e){let t=n=>({left:S("div",`${n} ${n}-left`),center:S("div",`${n} ${n}-center`),right:S("div",`${n} ${n}-right`)});this.el=S("div",e,{role:"rowgroup"}),this.panes=t("fg-section-pane"),this.inners=t("fg-section-inner");for(let n of te)this.panes[n].append(this.inners[n]),this.el.append(this.panes[n])}size(e,t,n){this.el.style.height=`${t}px`;for(let o of te){let r=e.regionWidth(o);o!=="center"&&(this.panes[o].style.width=`${r}px`,this.panes[o].hidden=r===0),this.inners[o].style.width=`${r}px`,this.inners[o].style.height=`${t}px`}this.panes.center.style.marginRight=`${n}px`}},Qn="http://www.w3.org/2000/svg";function Lr(i,e,t,n){var m;let o=Math.max(20,t-16),r=Math.max(10,n-14),s=document.createElementNS(Qn,"svg");s.setAttribute("class","fg-sparkline"),s.setAttribute("width",String(o)),s.setAttribute("height",String(r)),s.setAttribute("viewBox",`0 0 ${o} ${r}`),s.setAttribute("aria-hidden","true");let a=(m=e.color)!=null?m:"var(--fg-accent)",l=e.type==="bar",c=l?Math.min(0,...i):Math.min(...i),d=l?Math.max(0,...i):Math.max(...i);c===d&&(c-=1,d+=1);let u=d-c,h=w=>r-1-(w-c)/u*(r-2),p=(w,g)=>{let v=document.createElementNS(Qn,w);for(let[C,R]of Object.entries(g))v.setAttribute(C,String(R));return s.append(v),v};if(e.type==="bar"){let w=o/i.length;return i.forEach((g,v)=>p("rect",{x:v*w+1,y:Math.min(h(g),h(0)),width:Math.max(1,w-2),height:Math.max(1,Math.abs(h(g)-h(0))),fill:g<0?"#ef4444":a})),s}let f=i.length>1?(o-2)/(i.length-1):0,x=i.map((w,g)=>`${1+g*f},${h(w)}`).join(" ");e.type==="area"&&p("polygon",{points:`1,${r} ${x} ${1+(i.length-1)*f},${r}`,fill:a,"fill-opacity":.2}),p("polyline",{points:x,fill:"none",stroke:a,"stroke-width":1.5,"stroke-linejoin":"round"});let y=i.length-1;return p("circle",{cx:1+y*f,cy:h(i[y]),r:2,fill:a}),s}var Tr=4,rt=class{constructor(e){this.grid=e;this.onClick=e=>{var o;let t=e.target.closest(".fg-group-chip-remove"),n=(o=t==null?void 0:t.closest(".fg-group-chip"))==null?void 0:o.dataset.col;n&&this.grid.setGroupBy(this.grid.getGroupBy().filter(r=>r!==n))};this.onPointerDown=e=>{let t=e.target,n=t.closest(".fg-group-chip");if(e.button!==0||!n||t.closest("button"))return;let o=n.dataset.col,r=e.clientX,s=!1,a=c=>{!s&&Math.abs(c.clientX-r)<Tr||(s=!0,n.classList.add("fg-dragging"))},l=c=>{if(window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",l),n.classList.remove("fg-dragging"),!s)return;let u=[...this.el.querySelectorAll(".fg-group-chip")].filter(p=>p!==n).filter(p=>{let f=p.getBoundingClientRect();return c.clientX>f.left+f.width/2}).length,h=this.grid.getGroupBy().filter(p=>p!==o);h.splice(u,0,o),this.grid.setGroupBy(h)};window.addEventListener("pointermove",a),window.addEventListener("pointerup",l)};this.el=S("div","fg-group-panel",{role:"toolbar"}),e.renderer.main.insertBefore(this.el,e.renderer.gridEl),this.el.addEventListener("click",this.onClick),this.el.addEventListener("pointerdown",this.onPointerDown),this.refresh()}contains(e,t){let n=this.el.getBoundingClientRect();return e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}highlight(e){this.el.classList.toggle("fg-group-panel-over",e)}refresh(){let{grid:e}=this,t=e.store.state.locale;this.el.setAttribute("aria-label",t.groupByThis);let n=e.getGroupBy();if(!n.length){let o=S("span","fg-group-hint");o.textContent=t.groupPanelHint,this.el.replaceChildren(o);return}this.el.replaceChildren(...n.map((o,r)=>{var d,u,h;let s=(d=e.columns.getNode(o))==null?void 0:d.def,a=S("span","fg-group-chip");a.dataset.col=o;let l=S("span","fg-group-chip-label");l.textContent=(h=(u=s==null?void 0:s.header)!=null?u:s==null?void 0:s.field)!=null?h:o;let c=S("button","fg-group-chip-remove",{type:"button","aria-label":`${t.ungroup}: ${l.textContent}`});if(c.textContent="\xD7",a.append(l,c),r<n.length-1){let p=S("span","fg-group-sep",{"aria-hidden":"true"});return p.textContent="\u203A",[a,p]}return[a]}).flat())}destroy(){this.el.removeEventListener("click",this.onClick),this.el.removeEventListener("pointerdown",this.onPointerDown),this.el.remove()}};var ke=class{constructor(){this.listeners=new Map}on(e,t){let n=this.listeners.get(e);return n||this.listeners.set(e,n=new Set),n.add(t),()=>{n.delete(t)}}emit(e,t){let n=this.listeners.get(e);if(n)for(let o of[...n])try{o(t)}catch(r){console.error("[FreeGrid] event listener threw",r)}}clear(){this.listeners.clear()}};function oe(i){let e=i.getRootNode();return typeof ShadowRoot!="undefined"&&e instanceof ShadowRoot?e:document.body}function Pe(i,e,t){var o;let n=i.getRootNode();return(o=typeof n.elementFromPoint=="function"?n.elementFromPoint(e,t):null)!=null?o:document.elementFromPoint(e,t)}function eo(i){var t;return(t=i.getRootNode().activeElement)!=null?t:document.activeElement}function pe(i,...e){let t=typeof i.composedPath=="function"?i.composedPath():[];return t.length?e.some(n=>!!n&&t.includes(n)):e.some(n=>!!n&&n.contains(i.target))}var Wt=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Tab","Home","End","PageUp","PageDown"]);function Ut(i,e,t,n){let o=s=>Math.max(0,Math.min(n.rows-1,s)),r=s=>Math.max(0,Math.min(n.cols-1,s));switch(i){case"ArrowUp":return{rowIndex:o(t.rowIndex-1),colIndex:t.colIndex};case"ArrowDown":return{rowIndex:o(t.rowIndex+1),colIndex:t.colIndex};case"ArrowLeft":return{rowIndex:t.rowIndex,colIndex:r(t.colIndex-1)};case"ArrowRight":return{rowIndex:t.rowIndex,colIndex:r(t.colIndex+1)};case"PageUp":return{rowIndex:o(t.rowIndex-n.pageRows),colIndex:t.colIndex};case"PageDown":return{rowIndex:o(t.rowIndex+n.pageRows),colIndex:t.colIndex};case"Home":return{rowIndex:e.ctrl?0:t.rowIndex,colIndex:0};case"End":return{rowIndex:e.ctrl?n.rows-1:t.rowIndex,colIndex:n.cols-1};case"Tab":{let s=t.rowIndex*n.cols+t.colIndex+(e.shift?-1:1);return s<0||s>=n.rows*n.cols?null:{rowIndex:Math.floor(s/n.cols),colIndex:s%n.cols}}default:return null}}var it=new Map,to=i=>i?it.get(i):void 0;var Ir={Enter:"edit",F2:"edit",Delete:"clear",Backspace:"clear","Ctrl+Z":"undo","Ctrl+Y":"redo","Ctrl+Shift+Z":"redo","Ctrl+F":"find"};function Dr(i){let e=[];return(i.ctrlKey||i.metaKey)&&e.push("Ctrl"),i.altKey&&e.push("Alt"),i.shiftKey&&i.key.length>1&&e.push("Shift"),i.shiftKey&&i.key.length===1&&(i.ctrlKey||i.metaKey)&&e.push("Shift"),e.push(i.key.length===1?i.key.toUpperCase():i.key),e.join("+")}var Ar=3;function Pr(i,e){return i.renderer.rtl?e.key==="ArrowLeft"?"ArrowRight":e.key==="ArrowRight"?"ArrowLeft":e.key:e.key}function no(i){var T;let{renderer:e}=i,t=e.bodyEl,n=e.root,o=b=>Pr(i,b),r="mouse",s=0,a=!1,l=b=>{let M=e.cellAt(b.target);if(!M)return null;let D=i.rowModel.getRow(M.rowIndex),E=i.columns.getColumn(M.colId);if(!D||!E)return null;let L=$(E.id)?void 0:G(E.def,D.data);return{row:D.data,rowIndex:M.rowIndex,colId:M.colId,value:L,event:b}},c=b=>{var L,I;let M=(I=(L=b.target).closest)==null?void 0:I.call(L,".fg-group-toggle, .fg-tree-toggle, .fg-detail-toggle"),D=M&&e.cellAt(b.target);if(!D)return!1;e.gridEl.focus({preventScroll:!0}),i.setFocus(D.rowIndex,D.colId),i.setRange(null);let E=i.rowModel.getRow(D.rowIndex);return M.classList.contains("fg-detail-toggle")?i.setDetailExpanded(E.data,!i.isDetailExpanded(E.data)):i.toggleRow(D.rowIndex),!0},d=b=>{var F;if(c(b))return;let M=i.store.state.focus,D=e.cellAt(b.target);if(D&&((F=i.rowModel.getRow(D.rowIndex))!=null&&F.kind)){D.colId===ne&&i.rowModel.getRow(D.rowIndex).kind==="group"&&i.toggleGroupSelection(i.rowModel.getRow(D.rowIndex)),e.gridEl.focus({preventScroll:!0}),i.setFocus(D.rowIndex,D.colId),i.setRange(null);return}let E=l(b);if(!E)return;if(e.gridEl.focus({preventScroll:!0}),E.colId===fe){let P=i.columns.displayed().filter(N=>!$(N.id));P.length&&(i.setFocus(E.rowIndex,P[0].id),i.setRange({start:{rowIndex:E.rowIndex,colId:P[0].id},end:{rowIndex:E.rowIndex,colId:P[P.length-1].id}}));return}let L=a;a=!1;let I=i.store.state.focus,A=E.colId===ne;if(!L)if(b.shiftKey&&I&&!A&&!$(I.colId)&&i.options.rangeSelection!==!1)i.setRange({start:I,end:{rowIndex:E.rowIndex,colId:E.colId}},!0);else if((b.ctrlKey||b.metaKey)&&!A&&!$(E.colId)&&i.options.rangeSelection!==!1){let P={rowIndex:E.rowIndex,colId:E.colId};i.addRange({start:P,end:P}),i.setFocus(E.rowIndex,E.colId)}else i.setFocus(E.rowIndex,E.colId),i.setRange(null);i.options.rowSelection&&!L&&i.selectFromClick(E.rowIndex,A||b.ctrlKey||b.metaKey,b.shiftKey),i.events.emit("cellClick",E),r==="touch"&&!L&&M&&M.rowIndex===E.rowIndex&&M.colId===E.colId&&i.editor.canEdit(E.rowIndex,E.colId)&&(i.columns.getColumn(E.colId).def.type==="boolean"?i.applyEdit(E.rowIndex,E.colId,E.value!==!0):i.editor.start(E.rowIndex,E.colId))},u=b=>{var I,A;if((A=(I=b.target).closest)!=null&&A.call(I,"button"))return;let M=e.cellAt(b.target),D=M&&i.rowModel.getRow(M.rowIndex);if((D==null?void 0:D.kind)==="group"){i.toggleRow(M.rowIndex);return}if(D!=null&&D.kind)return;let E=l(b);if(!E||(i.events.emit("cellDoubleClick",E),!i.editor.canEdit(E.rowIndex,E.colId)))return;i.columns.getColumn(E.colId).def.type==="boolean"?i.applyEdit(E.rowIndex,E.colId,E.value!==!0):i.editor.start(E.rowIndex,E.colId)},h={...Ir};for(let[b,M]of Object.entries((T=i.options.keymap)!=null?T:{}))h[b]=M===!1?"none":M;let p=b=>{var L,I;let M=i.store.state.focus,D=h[Dr(b)];if(D==="none")return!1;switch(D){case"edit":return!M||!i.editor.canEdit(M.rowIndex,M.colId)||i.columns.getColumn(M.colId).def.type==="boolean"?!1:(i.editor.start(M.rowIndex,M.colId),!0);case"clear":return i.clearCells(),!0;case"undo":return i.undo(),!0;case"redo":return i.redo(),!0;case"copy":return i.copyToClipboard(!1),!0;case"cut":return i.cutToClipboard(),!0;case"selectAll":return i.selectAllCells(),!0;case"find":return i.options.findBar===!1?!1:(i.finder.openBar(),!0);case"paste":return(I=(L=navigator.clipboard)==null?void 0:L.readText)==null||I.call(L).then(A=>i.pasteText(A),()=>{}),!0}if(!M||!i.editor.canEdit(M.rowIndex,M.colId))return!1;let E=i.columns.getColumn(M.colId).def;if(b.key===" "&&E.type==="boolean"&&!b.ctrlKey&&!b.metaKey){let A=i.rowModel.getRow(M.rowIndex).data;return i.applyEdit(M.rowIndex,M.colId,A[E.field]!==!0),!0}return b.key.length===1&&b.key!==" "&&!b.ctrlKey&&!b.metaKey&&!b.altKey&&E.type!=="boolean"?(i.editor.start(M.rowIndex,M.colId,b.key),!0):!1},f=b=>{var A,F,P;let M=i.store.state.focus;if(!M||b.ctrlKey||b.metaKey||b.altKey||b.shiftKey)return!1;let D=i.rowModel.getRow(M.rowIndex);if(!i.isExpandable(D))return!1;let E=D.kind==="group";if(!E&&M.colId!==((A=i.columns.displayed().find(N=>!$(N.id)))==null?void 0:A.id))return!1;let L=!!((P=(F=D.group)==null?void 0:F.expanded)!=null?P:D.expanded),I=i.expandKey(D);if(E&&(b.key==="Enter"||b.key===" "))i.setGroupExpanded(I,!L);else if(o(b)==="ArrowRight"&&!L)i.setGroupExpanded(I,!0);else if(o(b)==="ArrowLeft"&&L)i.setGroupExpanded(I,!1);else return!1;return!0},x=b=>{let M=e.cellAt(b.target);if(!M||M.colId!==we)return!1;b.preventDefault();let D=i.rowModel.getRow(M.rowIndex);if(!D||D.kind||!i.canMoveRows())return!0;let E=D.data,L=S("div","fg-row-drop-marker"),I=null;n.classList.add("fg-row-dragging");let A=P=>{var re,Ue;let N=Pe(n,P.clientX,P.clientY),H=N==null?void 0:N.closest(".fg-root"),B=H===n?i:to(H),W=i.dragOptions.group;if(I=null,L.remove(),!B||!H||B!==i&&(!W||B.dragOptions.group!==W||!B.options.rowDrag))return;let q=N.closest(".fg-row[data-row]"),U=q==null?void 0:q.getBoundingClientRect(),K=null,V="after",J;if(q&&U){let he=B.rowModel.getRow(Number(q.dataset.row));if(!he||he.kind==="group")return;K=(Ue=(re=he.detailOf)==null?void 0:re.data)!=null?Ue:he.data;let Te=(P.clientY-U.top)/U.height;he.kind==="detail"?V="after":B.options.treeData?V=Te<.25?"before":Te>.75?"after":"inside":V=Te<.5?"before":"after",J=V==="before"?U.top:U.bottom}else{if(!N.closest(".fg-body"))return;let he=H.querySelectorAll(".fg-body-pane-center .fg-row[data-row]");J=he.length?Math.max(...[...he].map(Te=>Te.getBoundingClientRect().bottom)):H.querySelector(".fg-body").getBoundingClientRect().top}if(!B.canDropRow(E,K,V,i))return;I={into:B,target:K,position:V};let Q=H.getBoundingClientRect().top;L.classList.toggle("fg-row-drop-inside",V==="inside"),L.style.top=`${V==="inside"?U.top-Q:J-Q-1}px`,L.style.height=V==="inside"?`${U.height}px`:"",H.append(L)},F=()=>{window.removeEventListener("pointermove",A),window.removeEventListener("pointerup",F),window.removeEventListener("pointercancel",F),n.classList.remove("fg-row-dragging"),L.remove(),I&&I.into.dropRow(E,I.target,I.position,i)};return window.addEventListener("pointermove",A),window.addEventListener("pointerup",F),window.addEventListener("pointercancel",F),!0},y=b=>{let M=e.cellAt(b.target);if(!M)return;let D=b.clientX,E=b.clientY,L=()=>{clearTimeout(s),window.removeEventListener("pointermove",I),window.removeEventListener("pointerup",L),window.removeEventListener("pointercancel",L)},I=A=>{Math.hypot(A.clientX-D,A.clientY-E)>8&&L()};clearTimeout(s),s=window.setTimeout(()=>{L(),i.options.contextMenu!==!1&&(a=!0,$(M.colId)||(i.setFocus(M.rowIndex,M.colId),i.rangeContains(M.rowIndex,M.colId)||i.setRange({start:M,end:M})),i.contextMenu.open(D,E,M.rowIndex,M.colId))},550),window.addEventListener("pointermove",I),window.addEventListener("pointerup",L),window.addEventListener("pointercancel",L)},m=b=>{if(r=b.pointerType||"mouse",r==="touch"){y(b);return}if(b.button===0&&x(b)||i.options.rangeSelection===!1||b.button!==0||b.shiftKey||b.target.closest("input, a, button"))return;let M=e.cellAt(b.target);if(!M||$(M.colId))return;let D=b.clientX,E=b.clientY,L=b.ctrlKey||b.metaKey,I=!1,A=P=>{if(!I&&Math.hypot(P.clientX-D,P.clientY-E)<Ar)return;let N=e.cellAt(Pe(n,P.clientX,P.clientY));!N||$(N.colId)||(I||(I=!0,n.classList.add("fg-range-dragging"),L&&i.addRange({start:M,end:M}),i.setFocus(M.rowIndex,M.colId)),i.setRange({start:M,end:N},L))},F=()=>{window.removeEventListener("pointermove",A),window.removeEventListener("pointerup",F),n.classList.remove("fg-range-dragging"),I&&(a=!0)};window.addEventListener("pointermove",A),window.addEventListener("pointerup",F)},w=b=>{var H,B;if(b.target!==n&&b.target!==e.gridEl)return;let M=i.columns.displayed(),D=i.rowModel.getRowCount();if(!M.length||!D)return;if(f(b)){b.preventDefault();return}if(p(b)){b.preventDefault();return}let E=i.store.state.focus,L=b.ctrlKey||b.metaKey;if(b.key==="Escape"&&i.store.state.range){b.preventDefault(),i.setRange(null);return}if(L&&b.key.toLowerCase()==="a"&&i.options.rangeSelection!==!1){b.preventDefault(),i.selectAllCells();return}if(b.key==="ContextMenu"||b.key==="F10"&&b.shiftKey){b.preventDefault(),i.contextMenu.openAtFocus();return}if(b.key===" "&&E&&i.options.rowSelection){b.preventDefault(),i.selectFromClick(Math.min(E.rowIndex,D-1),!0,b.shiftKey);return}let I={rows:D,cols:M.length,pageRows:e.pageRows()},A=M.findIndex(W=>!$(W.id));if(i.options.rangeSelection!==!1&&b.shiftKey&&b.key!=="Tab"&&Wt.has(b.key)){let W=E!=null?E:{rowIndex:0,colId:M[A].id},q=i.store.state.range,U=(H=q==null?void 0:q.end)!=null?H:W,K={rowIndex:Math.min(U.rowIndex,D-1),colIndex:Math.max(0,M.findIndex(Q=>Q.id===U.colId))},V=Ut(o(b),{ctrl:L,shift:!1},K,I);if(!V)return;b.preventDefault();let J=M[Math.max(A,V.colIndex)].id;E||i.setFocus(W.rowIndex,W.colId),i.setRange({start:(B=q==null?void 0:q.start)!=null?B:W,end:{rowIndex:V.rowIndex,colId:J}}),e.ensureVisible(V.rowIndex,J);return}let P;if(!E)P=Wt.has(b.key)&&b.key!=="Tab"?{rowIndex:0,colIndex:0}:null;else{let W=Math.max(0,M.findIndex(q=>q.id===E.colId));P=Ut(o(b),{ctrl:L,shift:b.shiftKey},{rowIndex:Math.min(E.rowIndex,D-1),colIndex:W},I)}if(!P)return;b.preventDefault();let N=M[P.colIndex].id;i.setFocus(P.rowIndex,N),i.setRange(null),e.ensureVisible(P.rowIndex,N)},g=b=>{var M,D;return(D=(M=b.target)==null?void 0:M.closest)==null?void 0:D.call(M,".fg-editor, input, textarea, select, [contenteditable]")},v=b=>{var M,D;return((D=(M=b.target)==null?void 0:M.closest)==null?void 0:D.call(M,".fg-root"))!==n},C=b=>{if(g(b)||v(b))return;let M=i.selectionTSV(!1);!M||!b.clipboardData||(b.clipboardData.setData("text/plain",M),b.preventDefault())},R=b=>{if(g(b)||v(b))return;let M=i.selectionTSV(!1);!M||!b.clipboardData||(b.clipboardData.setData("text/plain",M),b.preventDefault(),i.clearCells(!0))},k=b=>{var D;if(g(b)||v(b))return;let M=(D=b.clipboardData)==null?void 0:D.getData("text/plain");M&&(b.preventDefault(),i.pasteText(M))};return t.addEventListener("click",d),t.addEventListener("dblclick",u),t.addEventListener("pointerdown",m),n.addEventListener("keydown",w),n.addEventListener("copy",C),n.addEventListener("paste",k),n.addEventListener("cut",R),()=>{t.removeEventListener("click",d),t.removeEventListener("dblclick",u),t.removeEventListener("pointerdown",m),n.removeEventListener("keydown",w),n.removeEventListener("copy",C),n.removeEventListener("paste",k),n.removeEventListener("cut",R)}}var st=class{constructor(e){this.grid=e;this.open=new Set;this.el=S("div","fg-filters-panel")}refresh(){var l,c;let{grid:e}=this,t=e.store.state.locale,n=e.store.state.filters,o=S("div","fg-filters-head"),r=S("span","fg-filters-title");r.textContent=t.filters;let s=S("button","fg-btn fg-filters-clear",{type:"button"});s.textContent=t.clearFilters,s.disabled=!Object.keys(n).length,s.addEventListener("click",()=>{for(let d of Object.keys(e.store.state.filters))e.setFilter(d,null)}),o.append(r,s);let a=S("div","fg-filters-list");for(let d of e.columns.displayed()){if($(d.id)||!ie(d.def))continue;let u=S("details",n[d.id]?"fg-filters-item fg-filter-on":"fg-filters-item");u.dataset.col=d.id,u.open=this.open.has(d.id);let h=S("summary");h.textContent=(c=(l=d.def.header)!=null?l:d.def.field)!=null?c:d.id,u.append(h);let p=()=>{if(u.querySelector(".fg-filter"))return;let f=e.menu.filterSection(d.id,()=>{});f&&u.append(f)};u.open&&p(),u.addEventListener("toggle",()=>{u.open?(this.open.add(d.id),p()):this.open.delete(d.id)}),a.append(u)}this.el.replaceChildren(o,a)}};var $r=["sum","avg","min","max","count"],at=class{constructor(e){this.grid=e;this.draft={rows:[],columns:[],values:[]};this.el=S("div","fg-pivot-panel")}apply(){this.grid.getPivot()?this.grid.setPivot(this.draft):this.refresh()}refresh(){var c;let{grid:e}=this,t=e.store.state.locale,n=e.getPivot();n&&(this.draft={rows:[...n.rows],columns:[...(c=n.columns)!=null?c:[]],values:n.values.map(d=>({colId:d.colId,aggFunc:typeof d.aggFunc=="string"?d.aggFunc:"sum"}))});let o=e.sourceLeaves(),r=d=>{var h,p,f;let u=(h=o.find(x=>x.id===d))==null?void 0:h.def;return(f=(p=u==null?void 0:u.header)!=null?p:u==null?void 0:u.field)!=null?f:d},s=S("label","fg-pivot-mode"),a=S("input","fg-checkbox",{type:"checkbox"});a.checked=!!n,a.addEventListener("click",()=>e.setPivot(a.checked?this.draft:null)),s.append(a,document.createTextNode(t.pivotMode));let l=(d,u)=>{let h=S("div","fg-pivot-zone");h.dataset.zone=d;let p=S("div","fg-pivot-zone-title");p.textContent=u;let f=S("div","fg-pivot-chips"),x=d==="values"?this.draft.values.map(w=>w.colId):this.draft[d];x.forEach((w,g)=>{let v=S("span","fg-group-chip");v.dataset.col=w;let C=S("span","fg-group-chip-label");if(C.textContent=r(w),v.append(C),d==="values"){let k=S("select","fg-pivot-agg",{"aria-label":`${r(w)} ${t.pivotValues}`});for(let T of $r){let b=S("option");b.value=T,b.textContent=t[T],k.append(b)}k.value=this.draft.values[g].aggFunc,k.addEventListener("change",()=>{this.draft.values[g].aggFunc=k.value,this.apply()}),v.append(k)}let R=S("button","fg-group-chip-remove",{type:"button","aria-label":`${t.ungroup}: ${r(w)}`});R.textContent="\xD7",R.addEventListener("click",()=>{d==="values"?this.draft.values.splice(g,1):this.draft[d].splice(g,1),this.apply()}),v.append(R),f.append(v)});let y=S("select","fg-pivot-add",{"aria-label":`${u}: ${t.addColumn}`}),m=S("option");m.value="",m.textContent=t.addColumn,y.append(m);for(let w of o){if(x.includes(w.id)||d==="values"&&w.def.type!=="number")continue;let g=S("option");g.value=w.id,g.textContent=r(w.id),y.append(g)}return y.addEventListener("change",()=>{y.value&&(d==="values"?this.draft.values.push({colId:y.value,aggFunc:"sum"}):this.draft[d].push(y.value),this.apply())}),h.append(p,f,y),h};this.el.replaceChildren(s,l("rows",t.pivotRows),l("columns",t.pivotColumns),l("values",t.pivotValues))}};var Fr=4,lt=i=>!$(i.id)&&(i.children?i.children.some(lt):i.def.chooser!==!1),Kt=i=>{var e,t;return(t=(e=i.def.header)!=null?e:i.def.field)!=null?t:i.id},dt=class{constructor(e){this.grid=e;this.collapsed=new Set;this.el=S("div","fg-chooser"),this.search=S("input","fg-input fg-chooser-search",{type:"search"});let t=S("label","fg-chooser-all");this.allBox=S("input","fg-checkbox",{type:"checkbox"}),this.allText=S("span"),t.append(this.allBox,this.allText),this.list=S("div","fg-chooser-list",{role:"tree"}),this.el.append(this.search,t,this.list),this.search.addEventListener("input",()=>this.refresh()),this.allBox.addEventListener("change",()=>this.setVisible(this.matchingLeaves(),this.allBox.checked)),this.list.addEventListener("change",n=>{let o=n.target,r=this.nodeOf(o);r&&this.setVisible(this.leavesOf(r),o.checked)}),this.list.addEventListener("click",n=>{let o=n.target.closest(".fg-chooser-caret"),r=o&&this.nodeOf(o);r&&(this.collapsed.has(r.id)?this.collapsed.delete(r.id):this.collapsed.add(r.id),this.refresh())}),this.list.addEventListener("pointerdown",n=>this.onPointerDown(n)),this.refresh()}refresh(){let e=this.grid.store.state.locale;this.search.placeholder=e.search,this.search.setAttribute("aria-label",e.search),this.allText.textContent=e.selectAll;let t=this.query(),n=[],o=(a,l)=>{for(let c of a)!lt(c)||t&&!this.subtreeMatches(c,t)||(n.push(this.item(c,l)),c.children&&(t||!this.collapsed.has(c.id))&&o(c.children,l+1))};o(this.grid.columns.roots(),0),this.list.replaceChildren(...n);let r=this.matchingLeaves(),s=r.filter(a=>!a.hide).length;this.allBox.checked=r.length>0&&s===r.length,this.allBox.indeterminate=s>0&&s<r.length}query(){return this.search.value.trim().toLowerCase()}subtreeMatches(e,t){for(let n=e;n;n=n.parent)if(Kt(n).toLowerCase().includes(t))return!0;return!!e.children&&e.children.some(n=>lt(n)&&this.subtreeMatches(n,t))}leavesOf(e){return lt(e)?e.children?e.children.flatMap(t=>this.leavesOf(t)):[e]:[]}matchingLeaves(){let e=this.query(),t=this.grid.columns.roots().flatMap(n=>this.leavesOf(n));return e?t.filter(n=>this.subtreeMatches(n,e)):t}nodeOf(e){var n;let t=(n=e.closest(".fg-chooser-item"))==null?void 0:n.dataset.col;return t?this.grid.columns.getNode(t):void 0}setVisible(e,t){this.grid.setColumnsVisible(e.filter(n=>!n.def.lockVisible).map(n=>n.id),t)}item(e,t){let n=S("div",e.children?"fg-chooser-item fg-chooser-group":"fg-chooser-item",{role:"treeitem"});n.dataset.col=e.id,n.style.paddingLeft=`${6+t*16}px`;let o=S("span","fg-chooser-handle",{"aria-hidden":"true"});if(o.textContent="\u22EE\u22EE",n.append(o),e.children){let c=!this.collapsed.has(e.id),d=S("button","fg-chooser-caret",{type:"button",tabindex:"-1","aria-hidden":"true"});d.textContent=c?"\u25BE":"\u25B8",n.setAttribute("aria-expanded",String(c)),n.append(d)}let r=this.leavesOf(e),s=r.filter(c=>!c.hide).length,a=S("input","fg-checkbox",{type:"checkbox","aria-label":Kt(e)});a.checked=r.length>0&&s===r.length,a.indeterminate=s>0&&s<r.length,a.disabled=r.every(c=>c.def.lockVisible);let l=S("span","fg-chooser-label");if(l.textContent=Kt(e),n.append(a,l),!e.children&&e.pinned){let c=S("span","fg-chooser-pin");c.textContent=e.pinned==="left"?"\u21E4":"\u21E5",n.append(c)}return n}onPointerDown(e){let t=e.target.closest(".fg-chooser-handle"),n=t==null?void 0:t.closest(".fg-chooser-item"),o=n&&this.nodeOf(n);if(!n||!o||e.button!==0)return;e.preventDefault();let r=new Set(this.grid.columns.siblings(o.id).map(p=>p.id).filter(p=>p!==o.id)),s=[...this.list.querySelectorAll(".fg-chooser-item")].filter(p=>r.has(p.dataset.col)),a=e.clientY,l=!1,c=-1,d=S("div","fg-chooser-marker"),u=p=>{if(!l){if(Math.abs(p.clientY-a)<Fr||!s.length)return;l=!0,n.classList.add("fg-dragging"),this.list.append(d)}c=s.filter(y=>{let m=y.getBoundingClientRect();return p.clientY>m.top+m.height/2}).length;let f=this.list.getBoundingClientRect().top-this.list.scrollTop,x=c<s.length?s[c].getBoundingClientRect().top:s[s.length-1].getBoundingClientRect().bottom;d.style.top=`${x-f-1}px`},h=()=>{if(window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",h),d.remove(),n.classList.remove("fg-dragging"),!l||c<0)return;let p=this.grid.columns.siblings(o.id).map(y=>y.id).filter(y=>y!==o.id),f=c<s.length?p.indexOf(s[c].dataset.col):p.indexOf(s[s.length-1].dataset.col)+1;f=Math.max(p.filter($).length,f);let x=this.grid.columns.siblings(o.id).findIndex(y=>y.id===o.id);f!==x&&(this.grid.columns.move(o.id,f),this.grid.layoutChanged(),this.grid.events.emit("columnMove",{colId:o.id,toIndex:f}))};window.addEventListener("pointermove",u),window.addEventListener("pointerup",h)}},ct=class{constructor(e){this.grid=e;this.popup=null;this.panel=null;this.off=[]}get isOpen(){return!!this.popup}open(){this.close();let e=this.grid.store.state.locale,t=S("div",`fg-menu fg-chooser-dialog fg-theme-${this.grid.store.state.theme}`,{role:"dialog","aria-label":e.chooseColumns});this.grid.applyFontTo(t);let n=S("div","fg-chooser-head"),o=S("span","fg-menu-title");o.textContent=e.chooseColumns;let r=S("button","fg-chooser-close",{type:"button","aria-label":e.close});r.textContent="\xD7",r.addEventListener("click",()=>this.close()),n.append(o,r),this.panel=new dt(this.grid),t.append(n,this.panel.el),oe(this.grid.renderer.root).append(t);let s=this.grid.renderer.root.getBoundingClientRect(),a=t.offsetWidth||280;t.style.left=`${Math.max(4,Math.min(s.right-a-8,window.innerWidth-a-4))}px`,t.style.top=`${Math.max(4,s.top+8)}px`,this.popup=t;let l=d=>{pe(d,t)||this.close()},c=d=>{d.key==="Escape"&&this.close()};document.addEventListener("pointerdown",l,!0),document.addEventListener("keydown",c,!0),this.off.push(()=>document.removeEventListener("pointerdown",l,!0),()=>document.removeEventListener("keydown",c,!0)),t.querySelector(".fg-chooser-search").focus()}refresh(){var e;(e=this.panel)==null||e.refresh()}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null,this.panel=null}},ut=class{constructor(e,t,n=["columns","filters"]){this.grid=e;this.tabs=new Map;this.el=S("div","fg-sidebar"),this.panelHost=S("div","fg-sidebar-panel"),this.columns=new dt(e),this.filters=new st(e),this.pivot=new at(e);let o=n.filter(s=>s==="columns"||s==="filters"||s==="pivot");o.length||o.push("columns"),this.current=o[0];let r=S("div","fg-sidebar-tabs",{role:"tablist"});for(let s of o){let a=S("button","fg-sidebar-tab",{type:"button",role:"tab"});a.dataset.panel=s,a.addEventListener("click",()=>this.toggle(!(this.isOpen&&this.current===s),s)),this.tabs.set(s,a),r.append(a)}this.el.append(this.panelHost,r),e.renderer.root.append(this.el),this.panelHost.hidden=!t,this.show(),this.refresh()}get isOpen(){return!this.panelHost.hidden}show(){this.panelHost.replaceChildren(this.current==="filters"?this.filters.el:this.current==="pivot"?this.pivot.el:this.columns.el)}toggle(e=!this.isOpen,t){t&&this.tabs.has(t)&&t!==this.current&&(this.current=t,this.show()),this.panelHost.hidden=!e,this.syncTabs(),this.grid.renderer.invalidate({header:!0,rows:!0})}syncTabs(){for(let[e,t]of this.tabs){let n=this.isOpen&&e===this.current;t.setAttribute("aria-expanded",String(n)),t.setAttribute("aria-selected",String(n))}}refresh(){let e=this.grid.store.state.locale;for(let[t,n]of this.tabs)n.textContent=t==="filters"?e.filters:t==="pivot"?e.pivot:e.columns;this.syncTabs(),this.columns.refresh(),this.filters.refresh(),this.pivot.refresh()}};var Nr=()=>typeof navigator!="undefined"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent||""),Me=i=>Nr()?`\u2318${i}`:`Ctrl+${i}`,ht=class{constructor(e){this.grid=e;this.popup=null;this.off=[];let t=e.renderer.root,n=o=>this.onContextMenu(o);t.addEventListener("contextmenu",n),this.detach=()=>t.removeEventListener("contextmenu",n)}destroy(){this.close(),this.detach()}onContextMenu(e){let{grid:t}=this;if(t.options.contextMenu===!1)return;let n=e.target,o=n.closest(".fg-header-cell");if(o){let s=o.dataset.col;if(!s||$(s)||o.classList.contains("fg-header-group"))return;e.preventDefault(),this.close(),t.menu.open(s,o);return}let r=t.renderer.cellAt(n);r&&(e.preventDefault(),t.renderer.gridEl.focus({preventScroll:!0}),!$(r.colId)&&!t.rangeContains(r.rowIndex,r.colId)&&(t.setFocus(r.rowIndex,r.colId),t.setRange({start:r,end:r})),this.open(e.clientX,e.clientY,r.rowIndex,r.colId))}openAtFocus(){var r;let e=this.grid.store.state.focus;if(!e||this.grid.options.contextMenu===!1)return;let t=this.grid.renderer.root.getBoundingClientRect(),n=this.grid.renderer.root.querySelector(`.fg-row[data-row="${e.rowIndex}"] .fg-cell[data-col="${CSS.escape(e.colId)}"]`),o=(r=n==null?void 0:n.getBoundingClientRect())!=null?r:t;this.open(o.left+8,o.bottom,e.rowIndex,e.colId)}defaultItems(e){let{grid:t}=this,n=t.store.state.locale,o=t.columns.getNode(e),r=o==null?void 0:o.def,s=!!r&&!$(e),a=[{label:n.copy,shortcut:Me("C"),action:()=>t.copyToClipboard(!1)},{label:n.copyWithHeaders,action:()=>t.copyToClipboard(!0)},{label:n.cut,shortcut:Me("X"),action:()=>t.cutToClipboard()},...t.store.state.selected.size?[{label:n.copyRows,action:()=>t.copyToClipboard(!1,!0)}]:[],{label:n.paste,shortcut:Me("V"),action:()=>this.pasteFromClipboard()}];(t.history.canUndo()||t.history.canRedo())&&a.push("separator",{label:n.undo,shortcut:Me("Z"),action:()=>t.undo(),disabled:!t.history.canUndo()},{label:n.redo,shortcut:Me("Y"),action:()=>t.redo(),disabled:!t.history.canRedo()}),t.options.rowSelection&&t.store.state.selected.size&&a.push({label:n.deleteRows,action:()=>t.api.removeSelectedRows()}),s&&(a.push("separator",{label:n.autosizeThis,action:()=>t.autoSize([e])}),r.lockVisible||a.push({label:n.hideColumn,action:()=>t.setColumnsVisible([e],!1)}),a.push({label:n.pinLeft,action:()=>t.setPinned(e,"left"),disabled:o.pinned==="left"},{label:n.pinRight,action:()=>t.setPinned(e,"right"),disabled:o.pinned==="right"},{label:n.unpin,action:()=>t.setPinned(e,null),disabled:!o.pinned})),a.push("separator"),t.options.rowSelection==="multiple"&&a.push({label:n.selectAllRows,action:()=>t.api.selectAll()}),a.push({label:n.chooseColumns,action:()=>t.chooser.open()});let l=t.rangeBounds();return l&&(l.r2>l.r1||l.c2>l.c1)&&a.push("separator",{label:n.chartBar,action:()=>t.api.createChart({type:"bar"})},{label:n.chartLine,action:()=>t.api.createChart({type:"line"})},{label:n.chartPie,action:()=>t.api.createChart({type:"pie"})}),a.push("separator",{label:n.exportCsv,action:()=>t.api.exportCsv()},{label:n.exportExcel,action:()=>t.api.exportXlsx()}),t.options.advancedFilter!==!1&&!t.options.pivot&&a.push("separator",{label:`${n.advancedFilter}\u2026`,action:()=>t.filterBuilder.open()}),a}pasteFromClipboard(){let e=typeof navigator!="undefined"?navigator.clipboard:void 0,t=()=>this.grid.toast(this.grid.store.state.locale.pasteHint.replace("Ctrl+V",Me("V")));if(!(e!=null&&e.readText))return t();e.readText().then(n=>this.grid.pasteText(n),t)}open(e,t,n,o){var v,C,R;this.close(),this.grid.menu.close();let{grid:r}=this,s=r.rowModel.getRow(n),a=r.columns.getColumn(o),l=this.defaultItems(o),c={row:(v=s==null?void 0:s.data)!=null?v:null,rowIndex:n,colId:o,value:s&&a&&!$(o)?G(a.def,s.data):void 0,defaultItems:l},d=r.options.contextMenu,u=l;if(typeof d=="function")try{u=d(c)}catch{u=l}let h=r.store.state.locale,p=S("div",`fg-menu fg-context-menu fg-theme-${r.store.state.theme}`,{role:"menu","aria-label":h.columnMenu});r.applyFontTo(p);let f=!0;for(let k of u){if(k==="separator"){f||p.append(S("div","fg-cm-sep",{role:"separator"})),f=!0;continue}let T=S("button","fg-menu-item fg-cm-item",{type:"button",role:"menuitem"}),b=S("span","fg-cm-label");if(b.textContent=k.label,T.append(b),k.shortcut){let M=S("span","fg-cm-shortcut");M.textContent=k.shortcut,T.append(M)}T.disabled=!!k.disabled,T.addEventListener("click",()=>{this.close(),k.action()}),p.append(T),f=!1}(C=p.lastElementChild)!=null&&C.classList.contains("fg-cm-sep")&&p.lastElementChild.remove(),oe(this.grid.renderer.root).append(p);let x=p.offsetWidth||220,y=p.offsetHeight||300;p.style.left=`${Math.max(4,Math.min(e,window.innerWidth-x-4))}px`,p.style.top=`${Math.max(4,Math.min(t,window.innerHeight-y-4))}px`,this.popup=p;let m=k=>{pe(k,p)||this.close()},w=k=>{if(k.key==="Escape"){this.close(),r.renderer.gridEl.focus();return}if(k.key!=="ArrowDown"&&k.key!=="ArrowUp")return;let T=[...p.querySelectorAll("button:not(:disabled)")],b=T.indexOf(eo(p)),M=T[(b+(k.key==="ArrowDown"?1:T.length-1)+T.length)%T.length];M==null||M.focus(),k.preventDefault()},g=()=>this.close();document.addEventListener("pointerdown",m,!0),document.addEventListener("keydown",w,!0),r.renderer.scroller.addEventListener("scroll",g,{passive:!0}),this.off.push(()=>document.removeEventListener("pointerdown",m,!0),()=>document.removeEventListener("keydown",w,!0),()=>r.renderer.scroller.removeEventListener("scroll",g)),(R=p.querySelector("button:not(:disabled)"))==null||R.focus()}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null}};var ft=class{constructor(e){this.grid=e;this.onDown=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=this.source();if(!t)return;let{grid:n}=this,o=null,r=n.renderer.root,s=l=>{let c=n.renderer.cellAt(Pe(n.renderer.root,l.clientX,l.clientY)),d=c&&n.columns.getColumn(c.colId);if(!c||!d||$(d.id))return;let u=c.rowIndex>t.r2?c.rowIndex-t.r2:c.rowIndex<t.r1?c.rowIndex-t.r1:0,h=d.index>t.c2?d.index-t.c2:d.index<t.c1?d.index-t.c1:0;!u&&!h?o=null:Math.abs(u)>=Math.abs(h)?o={r1:Math.min(t.r1,c.rowIndex),r2:Math.max(t.r2,c.rowIndex),c1:t.c1,c2:t.c2}:o={r1:t.r1,r2:t.r2,c1:Math.min(t.c1,d.index),c2:Math.max(t.c2,d.index)},this.showPreview(o)},a=()=>{if(window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",a),this.preview.remove(),r.classList.remove("fg-range-dragging"),!o)return;let l=n.columns.displayed();n.fillRange({start:{rowIndex:o.r1,colId:l[o.c1].id},end:{rowIndex:o.r2,colId:l[o.c2].id}})};r.classList.add("fg-range-dragging"),window.addEventListener("pointermove",s),window.addEventListener("pointerup",a)};this.handle=S("div","fg-fill-handle",{"aria-hidden":"true"}),this.preview=S("div","fg-fill-preview",{"aria-hidden":"true"}),this.handle.addEventListener("pointerdown",this.onDown)}enabled(){let e=this.grid.options;return e.fillHandle!==!1&&e.rangeSelection!==!1}source(){let e=this.grid.rangeBounds();if(e)return e;let t=this.grid.store.state.focus,n=t&&this.grid.columns.getColumn(t.colId);return!t||!n||$(n.id)?null:{r1:t.rowIndex,r2:t.rowIndex,c1:n.index,c2:n.index}}cellEl(e,t){let n=this.grid.columns.displayed()[t];return n?this.grid.renderer.root.querySelector(`.fg-body .fg-row[data-row="${e}"] .fg-cell[data-col="${CSS.escape(n.id)}"]`):null}update(){let e=this.enabled()?this.source():null,t=this.grid.columns.displayed(),o=!!e&&t.slice(e.c1,e.c2+1).some(a=>a.def.editable&&a.def.field)&&e?this.cellEl(e.r2,e.c2):null;if(!o){this.handle.remove();return}let r=this.grid.renderer.root.getBoundingClientRect(),s=o.getBoundingClientRect();this.handle.style.left=`${(this.grid.renderer.rtl?s.left:s.right)-r.left-4}px`,this.handle.style.top=`${s.bottom-r.top-4}px`,this.handle.isConnected||this.grid.renderer.root.append(this.handle)}showPreview(e){let t=e&&this.cellEl(e.r1,e.c1),n=e&&this.cellEl(e.r2,e.c2);if(!t||!n){this.preview.remove();return}let o=this.grid.renderer.root.getBoundingClientRect(),r=t.getBoundingClientRect(),s=n.getBoundingClientRect();Object.assign(this.preview.style,{left:`${r.left-o.left}px`,top:`${r.top-o.top}px`,width:`${s.right-r.left}px`,height:`${s.bottom-r.top}px`}),this.preview.isConnected||this.grid.renderer.root.append(this.preview)}destroy(){this.handle.remove(),this.preview.remove()}};var Or=1e4,pt=class{constructor(e){this.grid=e;this.matches=[];this.lookup=new Map;this.index=-1;this.query="";this.bar=null;this.countEl=null}get active(){return!!this.query}classFor(e,t){if(!this.query)return"";let n=this.lookup.get(`${e}|${t}`);return n===void 0?"":n===this.index?" fg-cell-match fg-cell-match-current":" fg-cell-match"}find(e){if(this.query=e.trim().toLowerCase(),this.matches=[],this.lookup.clear(),this.index=-1,this.query){let{grid:t}=this,n=t.store.state.locale.code,o=t.columns.displayed().filter(a=>!$(a.id)),r=o.map(a=>_(a.def,n)),s=t.rowModel.rows();e:for(let a=0;a<s.length;a++)if(!s[a].kind){for(let l=0;l<o.length;l++)if(r[l](G(o[l].def,s[a].data)).toLowerCase().includes(this.query)&&(this.lookup.set(`${a}|${o[l].id}`,this.matches.length),this.matches.push({rowIndex:a,colId:o[l].id}),this.matches.length>=Or))break e}this.matches.length&&this.go(0)}return this.updateCount(),this.grid.renderer.invalidate({rows:!0}),this.matches.length}refresh(){this.query&&this.find(this.query)}next(){this.matches.length&&this.go((this.index+1)%this.matches.length)}previous(){this.matches.length&&this.go((this.index-1+this.matches.length)%this.matches.length)}clear(){this.query="",this.matches=[],this.lookup.clear(),this.index=-1,this.grid.renderer.invalidate({rows:!0})}go(e){this.index=e;let t=this.matches[e];this.grid.setFocus(t.rowIndex,t.colId),this.grid.renderer.ensureVisible(t.rowIndex,t.colId),this.updateCount(),this.grid.renderer.invalidate({rows:!0})}updateCount(){if(!this.countEl)return;let e=this.grid.store.state.locale;this.countEl.textContent=this.query?this.matches.length?`${this.index+1}/${this.matches.length}`:e.noMatches:""}openBar(){if(this.grid.options.findBar===!1)return;if(this.bar){this.bar.querySelector("input").focus();return}let e=this.grid.store.state.locale,t=S("div","fg-findbar",{role:"search"}),n=S("input","fg-input",{type:"search",placeholder:e.findPlaceholder,"aria-label":e.findPlaceholder});this.countEl=S("span","fg-findbar-count",{"aria-live":"polite"});let o=(r,s,a)=>{let l=S("button","fg-findbar-btn",{type:"button","aria-label":r,title:r});return l.textContent=s,l.addEventListener("click",a),l};t.append(n,this.countEl,o(e.findPrevious,"\u2191",()=>this.previous()),o(e.findNext,"\u2193",()=>this.next()),o(e.close,"\xD7",()=>this.closeBar())),n.addEventListener("input",()=>this.find(n.value)),t.addEventListener("keydown",r=>{r.stopPropagation(),r.key==="Escape"?(r.preventDefault(),this.closeBar()):r.key==="Enter"&&(r.preventDefault(),r.shiftKey?this.previous():this.next())}),this.grid.renderer.root.append(t),this.bar=t,n.focus()}closeBar(){var e;(e=this.bar)==null||e.remove(),this.bar=null,this.countEl=null,this.clear(),this.grid.renderer.gridEl.focus({preventScroll:!0})}};var Hr=864e5;function $e(i,e){if(!i.length||e<=0)return[];let t=()=>Array.from({length:e},(r,s)=>i[s%i.length]);if(i.every(r=>typeof r=="number"&&!Number.isNaN(r))){let r=i;if(r.length===1)return t();let s=r[1]-r[0];if(!r.every((l,c)=>c===0||Math.abs(l-r[c-1]-s)<1e-9))return t();let a=r[r.length-1];return Array.from({length:e},(l,c)=>Math.round((a+s*(c+1))*1e12)/1e12)}let n=i.map(r=>r instanceof Date||typeof r=="string"&&/^\d{4}-\d{2}-\d{2}/.test(r)?ae(r):null);if(n.every(Boolean)&&i.length>=2){let r=n.map(a=>Math.round(a.getTime()/Hr)),s=r[1]-r[0];if(r.every((a,l)=>l===0||a-r[l-1]===s)){let a=n[n.length-1],l=i[i.length-1]instanceof Date;return Array.from({length:e},(c,d)=>{let u=new Date(a.getFullYear(),a.getMonth(),a.getDate()+s*(d+1));return l?u:ee(u)})}return t()}let o=i[i.length-1];if(typeof o=="string"&&!z(o)&&i.every(r=>typeof r=="string")){let r=/^(.*?)(\d+)$/.exec(o);if(r){let s=r[2].length,a=Number(r[2]);return Array.from({length:e},(l,c)=>`${r[1]}${String(a+c+1).padStart(s,"0")}`)}}return t()}function jt(i){let e=t=>/[\t\n\r"]/.test(t)?`"${t.replace(/"/g,'""')}"`:t;return i.map(t=>t.map(e).join(" ")).join(`\r
2
+ `)}function ro(i){return _t(i," ")}function _t(i,e){if(!i)return[];let t=[],n=[],o="",r=0,s=!1,a=!0;for(;r<i.length;){let l=i[r];if(s){if(l==='"'){if(i[r+1]==='"'){o+='"',r+=2;continue}s=!1,r++;continue}o+=l,r++;continue}if(l==='"'&&a){s=!0,a=!1,r++;continue}if(l===e){n.push(o),o="",a=!0,r++;continue}if(l==="\r"||l===`
3
3
  `){n.push(o),t.push(n),n=[],o="",a=!0,r+=l==="\r"&&i[r+1]===`
4
- `?2:1;continue}o+=l,a=!1,r++}return(o!==""||n.length||!a)&&(n.push(o),t.push(n)),t}function pt(i,e,t){var n;if(G(e))return"";if(Array.isArray(e))return e.join(", ");switch(i.type){case"number":{let o=typeof e=="number"?e:Number(e);return Number.isNaN(o)?String(e):String(o)}case"date":return(n=ee(e))!=null?n:String(e);case"boolean":return e===!0?"TRUE":e===!1?"FALSE":String(e);default:return _(i,t)(e)}}var Fr=new Set(["true","1","y","yes","\uC608","o","on"]),Nr=new Set(["false","0","n","no","\uC544\uB2C8\uC624","x","off"]);function Or(i){let e=i.trim();if(!e)return{ok:!0,value:null};let t=!1;/^\(.*\)$/.test(e)&&(t=!0,e=e.slice(1,-1));let n=e.endsWith("%");if(n&&(e=e.slice(0,-1)),e=e.replace(/[\s,₩$€£¥원]/g,""),!/^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i.test(e))return{ok:!1};let o=Number(e);return n&&(o/=100),t&&(o=-o),{ok:!0,value:Math.round(o*1e12)/1e12}}function eo(i,e,t){let n=new Date(i,e-1,t);return n.getFullYear()===i&&n.getMonth()===e-1&&n.getDate()===t?n:null}function Hr(i,e){let t=i.trim();if(!t)return{ok:!0,value:null};let n=null,o=/^(\d{4})\s*[-./년]\s*(\d{1,2})\s*[-./월]\s*(\d{1,2})\s*[.일]?$/.exec(t);return o?n=eo(+o[1],+o[2],+o[3]):(o=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(t))?n=eo(+o[3],+o[1],+o[2]):/^\d{4}-\d{2}-\d{2}T/.test(t)&&(n=se(t)),n?{ok:!0,value:e instanceof Date?n:ee(n)}:{ok:!1}}function gt(i,e,t){switch(i.type){case"number":return Or(e);case"date":return Hr(e,t);case"boolean":{let n=e.trim().toLowerCase();return n?Fr.has(n)?{ok:!0,value:!0}:Nr.has(n)?{ok:!0,value:!1}:{ok:!1}:{ok:!0,value:null}}default:return{ok:!0,value:e}}}var Br=i=>i.map(e=>e!==null&&typeof e=="object"&&"value"in e?e:{value:e,label:String(e),disabled:!1}),we=i=>String(i).padStart(2,"0");function zr(i){let e=i instanceof Date?i:typeof i=="string"&&i?new Date(i):null;return!e||Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${we(e.getMonth()+1)}-${we(e.getDate())}T${we(e.getHours())}:${we(e.getMinutes())}`}function Gr(i){if(i instanceof Date)return`${we(i.getHours())}:${we(i.getMinutes())}`;let e=typeof i=="string"?/(\d{1,2}):(\d{2})/.exec(i):null;return e?`${we(Number(e[1]))}:${e[2]}`:""}var mt=class{constructor(e){this.grid=e;this.cur=null;this.session=null;e.events.on("focusChange",({rowIndex:t})=>{var n;this.session&&!this.cur&&((n=this.grid.rowModel.getRow(t))==null?void 0:n.data)!==this.session.row&&this.endRow(!0)})}get rowMode(){return this.grid.options.editType==="row"}editingRow(e){var t;return((t=this.session)==null?void 0:t.id)===e}beginRow(e,t){var n;((n=this.session)==null?void 0:n.row)!==e&&(this.session&&this.endRow(!0),this.session={row:e,id:this.grid.rowModel.idOf(e),before:{...e}},this.grid.renderer.invalidate({rows:!0}),this.grid.events.emit("rowEditStart",{row:e,rowIndex:t}))}endRow(e){let t=this.session;if(!t)return;this.cur&&(e?this.commit(null):this.close(!1)),this.session=null;let{grid:n}=this,o=n.rowModel.indexOfId(t.id),r=n.columns.displayed().filter(a=>a.def.field&&!A(a.id));if(!e){let a=[];for(let l of r){let d=l.def.field;Object.is(t.row[d],t.before[d])||n.writeCell(a,t.row,d,l.id,o,t.before[d])}n.endCellTx(a)}let s=r.filter(a=>!Object.is(t.row[a.def.field],t.before[a.def.field])).map(a=>({colId:a.id,oldValue:t.before[a.def.field],newValue:t.row[a.def.field]}));n.renderer.invalidate({rows:!0}),n.events.emit("rowEditStop",{row:t.row,rowIndex:o,committed:e,changes:s})}get active(){return this.cur&&{rowIndex:this.cur.rowIndex,colId:this.cur.colId}}canEdit(e,t){if(A(t))return!1;let n=this.grid.columns.getColumn(t);if(!(n!=null&&n.def.field)||e<0||e>=this.grid.rowModel.getRowCount())return!1;let o=this.grid.rowModel.getRow(e);return!o.kind&&ae(n.def,o.data,e)}start(e,t,n){var k,L,I,b,M;if(this.cur&&this.commit(null),!this.canEdit(e,t))return!1;let{grid:o}=this;if(o.veto("beforeEdit",{row:o.rowModel.getRow(e).data,rowIndex:e,colId:t}))return!1;let{renderer:r}=o,s=o.columns.getColumn(t),a=s.def,l=o.rowModel.getRow(e).data,d=l[a.field];this.rowMode&&this.beginRow(l,e),o.setFocus(e,t),r.ensureVisible(e,t),r.render();let c=r.root.querySelector(`.fg-row[data-row="${e}"] .fg-cell[data-col="${CSS.escape(t)}"]`),u=r.root.getBoundingClientRect(),h=c==null?void 0:c.getBoundingClientRect(),f=C("div","fg-editor");f.style.left=`${((k=h==null?void 0:h.left)!=null?k:u.left)-u.left}px`,f.style.top=`${((L=h==null?void 0:h.top)!=null?L:u.top)-u.top}px`,f.style.width=`${(h==null?void 0:h.width)||s.width}px`,f.style.height=`${(h==null?void 0:h.height)||r.opts.rowHeight}px`;let g,x,y=()=>{},p=a.editor;if(typeof p=="function"){let S=p({value:d,row:l,column:a,initialText:n});g=S.el,x=()=>({value:S.getValue()}),y=()=>{var E;return(E=S.destroy)==null?void 0:E.call(S)},f.append(g),queueMicrotask(()=>{var E;return(E=S.focus)==null?void 0:E.call(S)})}else if((p==null?void 0:p.type)==="select"){let S=Br(typeof p.options=="function"?p.options(l):p.options),E=C("select","fg-editor-control");S.forEach((T,D)=>{var N;let P=C("option");P.value=String(D),P.textContent=(N=T.label)!=null?N:String(T.value),P.disabled=!!T.disabled,E.append(P)}),E.selectedIndex=Math.max(0,S.findIndex(T=>Object.is(T.value,d))),g=E,x=()=>{var T,D;return{value:(D=(T=S[E.selectedIndex])==null?void 0:T.value)!=null?D:null}},f.append(E)}else if((p==null?void 0:p.type)==="time"||(p==null?void 0:p.type)==="datetime"||!p&&a.type==="date"&&a.format==="datetime"){let S=(p==null?void 0:p.type)==="time",E=C("input","fg-editor-control",{type:S?"time":"datetime-local"});E.value=S?Gr(d):zr(d),g=E,x=()=>E.value?S?{value:E.value}:{value:d instanceof Date?new Date(E.value):E.value}:{value:null},f.append(E)}else{let E=(p==null?void 0:p.type)==="textarea"?C("textarea","fg-editor-control"):C("input","fg-editor-control");E instanceof HTMLInputElement&&(E.type=a.type==="date"&&n===void 0?"date":"text",a.type==="number"&&(E.inputMode="decimal"));let T=a.type==="date"?(I=ee(d))!=null?I:"":G(d)?"":String(d);E.value=n!=null?n:T,g=E,x=()=>({text:E.value}),f.append(E)}g.setAttribute("aria-label",(M=(b=a.header)!=null?b:a.field)!=null?M:t);let v=C("div","fg-editor-msg",{role:"alert"});f.append(v);let m=S=>{if(S.stopPropagation(),S.key==="Escape")S.preventDefault(),this.cancel();else if(S.key==="Enter"){if(g instanceof HTMLTextAreaElement&&!(S.ctrlKey||S.metaKey))return;S.preventDefault(),this.commit(S.shiftKey?"up":"down")}else S.key==="Tab"&&(S.preventDefault(),this.commit(S.shiftKey?"left":"right"))},w=S=>{var E;((E=this.cur)==null?void 0:E.wrap)===f&&!f.contains(S.relatedTarget)&&this.commit(null)},R=()=>this.commit(null);return f.addEventListener("keydown",m),f.addEventListener("focusout",w),r.scroller.addEventListener("scroll",R,{passive:!0}),r.root.append(f),this.cur={rowIndex:e,colId:t,row:l,def:a,wrap:f,read:x,dispose:()=>{f.removeEventListener("keydown",m),f.removeEventListener("focusout",w),r.scroller.removeEventListener("scroll",R),y(),f.remove()}},typeof p!="function"&&(g.focus(),n===void 0&&g instanceof HTMLInputElement&&g.type==="text"&&g.select()),o.events.emit("editStart",{rowIndex:e,colId:t}),!0}commit(e){let t=this.cur;if(!t)return!1;let{grid:n}=this,o=n.store.state.locale,r=t.def.field,s=t.row[r],a=t.read(),l;if("text"in a&&t.def.formulas&&Ce(a.text.trim()))l=a.text.trim();else if("text"in a){let c=gt(t.def,a.text,s);if(!c.ok)return this.fail(a.text,o.invalidValue);l=c.value}else l=a.value;let d=n.cellError(t.def,t.row,l);return d!==null?this.fail(l,d):(this.close(!0),n.applyEdit(t.rowIndex,t.colId,l),this.session&&(e==="down"||e==="up")&&this.endRow(!0),this.move(t.rowIndex,t.colId,e),!0)}cancel(){this.close(!1),this.session&&this.endRow(!1)}fail(e,t){let n=this.cur;return n.wrap.classList.add("fg-editor-invalid"),n.wrap.querySelector(".fg-editor-msg").textContent=t,this.grid.events.emit("validationFailed",{rowIndex:n.rowIndex,colId:n.colId,value:e,message:t}),!1}close(e){let t=this.cur;t&&(this.cur=null,t.dispose(),this.grid.renderer.gridEl.focus({preventScroll:!0}),this.grid.events.emit("editStop",{rowIndex:t.rowIndex,colId:t.colId,committed:e}))}move(e,t,n){if(!n)return;let{grid:o}=this,r=o.rowModel.getRowCount();if(n==="down"||n==="up"){let c=Math.max(0,Math.min(r-1,e+(n==="down"?1:-1)));o.setFocus(c,t),o.renderer.ensureVisible(c,t);return}let s=o.columns.displayed().filter(c=>this.canEdit(e,c.id)||c.def.editable);if(!s.length)return;let a=n==="right"?1:-1,l=e,d=s.findIndex(c=>c.id===t)+a;d>=s.length&&(d=0,this.session||l++),d<0&&(d=s.length-1,this.session||l--),!(l<0||l>=r)&&this.start(l,s[d].id)}};var vt=class{constructor(e=200){this.limit=e;this.entries=[];this.index=0}push(e){this.entries.splice(this.index),this.entries.push(e),this.entries.length>this.limit&&this.entries.shift(),this.index=this.entries.length}canUndo(){return this.index>0}canRedo(){return this.index<this.entries.length}undo(){return this.canUndo()?(this.entries[--this.index].undo(),!0):!1}redo(){return this.canRedo()?(this.entries[this.index++].redo(),!0):!1}clear(){this.entries=[],this.index=0}};var no=(i,e)=>i instanceof Date&&e instanceof Date?i.getTime()===e.getTime():Object.is(i,e),wt=class{constructor(){this.originals=new Map;this.created=new Set;this.deleted=new Map}beforeChange(e){!this.created.has(e)&&!this.originals.has(e)&&this.originals.set(e,{...e})}isDirty(e,t){if(!t||this.created.has(e))return!1;let n=this.originals.get(e);return!!n&&!no(n[t],e[t])}diff(e,t){let n=this.originals.get(e);return n?t.filter(o=>!no(n[o],e[o])):[]}get size(){return this.originals.size+this.created.size+this.deleted.size}reset(){this.originals.clear(),this.created.clear(),this.deleted.clear()}};function Ae(i){return{r1:Math.min(i.start.rowIndex,i.end.rowIndex),r2:Math.max(i.start.rowIndex,i.end.rowIndex),c1:Math.min(i.start.colIndex,i.end.colIndex),c2:Math.max(i.start.colIndex,i.end.colIndex)}}function oo(i,e,t){return e>=i.r1&&e<=i.r2&&t>=i.c1&&t<=i.c2}var Vr=5;function ro(i,e){let t=o=>i(o),n=o=>{window.removeEventListener("pointermove",t),window.removeEventListener("pointerup",n),window.removeEventListener("pointercancel",n),e(o)};window.addEventListener("pointermove",t),window.addEventListener("pointerup",n),window.addEventListener("pointercancel",n)}function qr(i,e,t){let n=i.columns.getColumn(t);if(!n)return;let o=e.clientX,r=n.width;i.renderer.root.classList.add("fg-resizing"),ro(s=>{i.columns.setWidth(t,r+(s.clientX-o)*(i.renderer.rtl?-1:1)),i.layoutChanged()},()=>{var a,l;i.renderer.root.classList.remove("fg-resizing");let s=(l=(a=i.columns.getColumn(t))==null?void 0:a.width)!=null?l:r;s!==r&&i.events.emit("columnResize",{colId:t,width:s})})}function Wr(i,e){let t=i.columns.getNode(e);return!!i.groupPanel&&!!t&&!t.children&&!i.options.treeData&&!i.getGroupBy().includes(e)}function Kr(i,e,t,n){var l,d;let o=new Set(i.columns.siblings(e).map(c=>c.id).filter(c=>c!==e&&!A(c))),r=[...n.querySelectorAll(".fg-header-cell")].filter(c=>o.has(c.dataset.col)).map(c=>({id:c.dataset.col,el:c})),s=C("div",`fg-drag-ghost fg-theme-${i.store.state.theme}`);s.textContent=(d=(l=t.querySelector(".fg-header-label"))==null?void 0:l.textContent)!=null?d:"",i.applyFontTo(s),oe(i.renderer.root).append(s);let a=C("div","fg-drop-marker");return a.style.height=`${i.renderer.headerEl.offsetHeight}px`,i.renderer.root.append(a),t.classList.add("fg-dragging"),{ghost:s,marker:a,cell:t,sibs:r,target:-1,overPanel:!1}}function Ur(i,e,t,n,o){var c,u;t.ghost.style.transform=`translate(${n+12}px, ${o+8}px)`,t.overPanel=Wr(i,e)&&!!((c=i.groupPanel)!=null&&c.contains(n,o)),(u=i.groupPanel)==null||u.highlight(t.overPanel),t.marker.hidden=t.overPanel;let r=0;for(let h of t.sibs){let f=h.el.getBoundingClientRect();(i.renderer.rtl?n<f.left+f.width/2:n>f.left+f.width/2)&&r++}t.target=r;let s=i.renderer.root.getBoundingClientRect().left,a=h=>i.renderer.rtl?h.getBoundingClientRect().right:h.getBoundingClientRect().left,l=h=>i.renderer.rtl?h.getBoundingClientRect().left:h.getBoundingClientRect().right,d=r<t.sibs.length?a(t.sibs[r].el):t.sibs.length?l(t.sibs[t.sibs.length-1].el):a(t.cell);t.marker.style.left=`${d-s-1}px`}function jr(i,e,t){var a;if(t.ghost.remove(),t.marker.remove(),t.cell.classList.remove("fg-dragging"),t.overPanel){(a=i.groupPanel)==null||a.highlight(!1),i.setGroupBy([...i.getGroupBy(),e]);return}if(t.target<0||!t.sibs.length)return;let n=i.columns.siblings(e),o=n.findIndex(l=>l.id===e),r=n.map(l=>l.id).filter(l=>l!==e),s=t.target<t.sibs.length?r.indexOf(t.sibs[t.target].id):r.indexOf(t.sibs[t.sibs.length-1].id)+1;s=Math.max(r.filter(A).length,s),s!==o&&(i.columns.move(e,s),i.layoutChanged(),i.events.emit("columnMove",{colId:e,toIndex:s}))}function _r(i,e,t,n){let o=i.columns.getNode(t),r=n.closest(".fg-header-pane");if(!o||!r)return;let s=e.clientX,a=null;ro(l=>{if(!a){if(Math.abs(l.clientX-s)<Vr)return;a=Kr(i,t,n,r)}Ur(i,t,a,l.clientX,l.clientY)},l=>{a?jr(i,t,a):!o.children&&ve(o.def)&&i.toggleSort(t,l.shiftKey||l.ctrlKey||l.metaKey)})}function io(i){let e=i.renderer.headerEl,t=o=>{if(o.button!==0)return;let r=o.target,s=r.closest(".fg-header-cell"),a=s==null?void 0:s.dataset.col;!s||!a||A(a)||r.closest(".fg-menu-btn")||r.closest("button, a, input, select, textarea, [data-fg-no-sort]")&&r.closest(".fg-header-label")||(o.preventDefault(),r.closest(".fg-resize")?qr(i,o,a):_r(i,o,a,s))},n=o=>{var a;let r=o.target,s=r.closest(".fg-menu-btn");if(s){let l=(a=s.closest(".fg-header-cell"))==null?void 0:a.dataset.col;l&&i.menu.toggle(l,s);return}r.closest(".fg-select-all")&&i.toggleSelectAll()};return e.addEventListener("pointerdown",t),e.addEventListener("click",n),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("click",n)}}var Xr=/^[=+\-@\t\r]/;function so(i,e=","){let t=n=>{let o=n.value;return n.text&&Xr.test(o)&&(o=`'${o}`),o.includes(e)||/["\r\n]/.test(o)||/^\s|\s$/.test(o)?`"${o.replace(/"/g,'""')}"`:o};return i.map(n=>n.map(t).join(e)).join(`\r
5
- `)}function _t(i){let e=i.slice(0,i.search(/\r?\n|$/)),t=s=>e.split(s).length-1,n=t(" "),o=t(";"),r=t(",");return n&&n>=r&&n>=o?" ":o>r?";":","}function yt(i,e=_t(i)){return jt(i.replace(/^\uFEFF/,""),e)}var Yr=(()=>{let i=new Uint32Array(256);for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;i[e]=t>>>0}return i})();function Zr(i){let e=4294967295;for(let t=0;t<i.length;t++)e=Yr[(e^i[t])&255]^e>>>8;return(e^4294967295)>>>0}var ao=new TextEncoder;function lo(i){let e=i.map(c=>{let u=ao.encode(c.name),h=typeof c.data=="string"?ao.encode(c.data):c.data;return{name:u,data:h,crc:Zr(h),offset:0}}),t=e.reduce((c,u)=>c+30+u.name.length+u.data.length,0),n=e.reduce((c,u)=>c+46+u.name.length,0),o=new Uint8Array(t+n+22),r=new DataView(o.buffer),s=0,a=0,l=33;for(let c of e)c.offset=s,r.setUint32(s,67324752,!0),r.setUint16(s+4,20,!0),r.setUint16(s+6,2048,!0),r.setUint16(s+8,0,!0),r.setUint16(s+10,a,!0),r.setUint16(s+12,l,!0),r.setUint32(s+14,c.crc,!0),r.setUint32(s+18,c.data.length,!0),r.setUint32(s+22,c.data.length,!0),r.setUint16(s+26,c.name.length,!0),r.setUint16(s+28,0,!0),o.set(c.name,s+30),o.set(c.data,s+30+c.name.length),s+=30+c.name.length+c.data.length;let d=s;for(let c of e)r.setUint32(s,33639248,!0),r.setUint16(s+4,20,!0),r.setUint16(s+6,20,!0),r.setUint16(s+8,2048,!0),r.setUint16(s+10,0,!0),r.setUint16(s+12,a,!0),r.setUint16(s+14,l,!0),r.setUint32(s+16,c.crc,!0),r.setUint32(s+20,c.data.length,!0),r.setUint32(s+24,c.data.length,!0),r.setUint16(s+28,c.name.length,!0),r.setUint16(s+30,0,!0),r.setUint16(s+32,0,!0),r.setUint16(s+34,0,!0),r.setUint16(s+36,0,!0),r.setUint32(s+38,0,!0),r.setUint32(s+42,c.offset,!0),o.set(c.name,s+46),s+=46+c.name.length;return r.setUint32(s,101010256,!0),r.setUint16(s+8,e.length,!0),r.setUint16(s+10,e.length,!0),r.setUint32(s+12,s-d,!0),r.setUint32(s+16,d,!0),o}var bt=i=>i.length>4&&i[0]===80&&i[1]===75&&i[2]===3&&i[3]===4;async function Jr(i){if(typeof DecompressionStream=="undefined")throw new Error("This browser cannot read compressed xlsx files (no DecompressionStream)");let e=new Response(i).body.pipeThrough(new DecompressionStream("deflate-raw"));return new Uint8Array(await new Response(e).arrayBuffer())}async function co(i){let e=new DataView(i.buffer,i.byteOffset,i.byteLength),t=-1;for(let a=i.length-22;a>=Math.max(0,i.length-65557);a--)if(e.getUint32(a,!0)===101010256){t=a;break}if(t<0)throw new Error("Not a zip file");let n=e.getUint16(t+10,!0),o=e.getUint32(t+16,!0),r=new TextDecoder,s=new Map;for(let a=0;a<n;a++){if(e.getUint32(o,!0)!==33639248)throw new Error("Broken zip directory");let l=e.getUint16(o+10,!0),d=e.getUint32(o+20,!0),c=e.getUint16(o+28,!0),u=e.getUint16(o+30,!0),h=e.getUint16(o+32,!0),f=e.getUint32(o+42,!0),g=r.decode(i.subarray(o+46,o+46+c)),x=e.getUint16(f+26,!0),y=e.getUint16(f+28,!0),p=f+30+x+y,v=i.subarray(p,p+d);if(l===0)s.set(g,v);else if(l===8)s.set(g,await Jr(v));else throw new Error(`Unsupported zip compression ${l}`);o+=46+c+u+h}return s}function Xt(i){let e="";for(let t=i+1;t>0;t=Math.floor((t-1)/26))e=String.fromCharCode(65+(t-1)%26)+e;return e}var uo=Date.UTC(1899,11,30),ho=864e5;function Qr(i){return(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds())-uo)/ho}function ei(i){let e=new Date(Math.round(i*ho)+uo);return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}var ti=/[\u0000-\u0008\u000b\u000c\u000e-\u001f￾￿]/g,xt=i=>i.replace(ti,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Me=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
6
- `,Yt="http://schemas.openxmlformats.org/spreadsheetml/2006/main",Ee="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function ni(i){let e=new Set;return i.map((t,n)=>{var s;let o=((s=t.name)!=null?s:`Sheet${n+1}`).replace(/[[\]:*?/\\]/g," ").slice(0,31).trim()||`Sheet${n+1}`,r=o;for(let a=2;e.has(r.toLowerCase());a++)r=`${o.slice(0,28)} (${a})`;return e.add(r.toLowerCase()),r})}function ye(i){let e=new Map([["General",0]]),t=[],n=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'],o=new Map([["General||||",0]]),r=['<font><sz val="11"/><name val="Calibri"/></font>','<font><b/><sz val="11"/><name val="Calibri"/></font>'],s=new Map([["0|",0],["1|",1]]),a=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>','<fill><patternFill patternType="solid"><fgColor rgb="FFF2F4F7"/><bgColor indexed="64"/></patternFill></fill>'],l=new Map([["FFF2F4F7",2]]),d=p=>p&&/^[0-9a-f]{8}$/i.test(p)?p.toUpperCase():p&&/^[0-9a-f]{6}$/i.test(p)?`FF${p.toUpperCase()}`:"",c=(p,v)=>{let m=`${p?1:0}|${v}`,w=s.get(m);return w===void 0&&(w=r.length,r.push(`<font>${p?"<b/>":""}<sz val="11"/>${v?`<color rgb="${v}"/>`:""}<name val="Calibri"/></font>`),s.set(m,w)),w},u=p=>{if(!p)return 0;let v=l.get(p);return v===void 0&&(v=a.length,a.push(`<fill><patternFill patternType="solid"><fgColor rgb="${p}"/><bgColor indexed="64"/></patternFill></fill>`),l.set(p,v)),v},h=(p,v)=>{let m=d(v.color),w=v.header?"FFF2F4F7":d(v.fill),R=!!(v.bold||v.header),k=v.align==="left"||v.align==="center"||v.align==="right"?v.align:"",L=`${p}|${R?1:""}|${m}|${w}|${k}`,I=o.get(L);if(I!==void 0)return I;let b=e.get(p);b===void 0&&(b=164+t.length,t.push(p),e.set(p,b));let M=c(R,m),S=u(w),E=`numFmtId="${b}" fontId="${M}" fillId="${S}" borderId="0" xfId="0"`+(b?' applyNumberFormat="1"':"")+(M?' applyFont="1"':"")+(S?' applyFill="1"':"")+(k?' applyAlignment="1"':"");return I=n.length,n.push(k?`<xf ${E}><alignment horizontal="${k}"/></xf>`:`<xf ${E}/>`),o.set(L,I),I},f=ni(i),g=i.map(p=>{var b,M,S;let v=p.rows.map((E,T)=>{let D=E.map((P,N)=>{var q;let $=P!==null&&typeof P=="object"&&!(P instanceof Date)?P:{v:P},F=`${Xt(N)}${T+1}`,O=$.v,V=(q=$.fmt)!=null?q:"General";O instanceof Date&&(Number.isNaN(O.getTime())?O=null:(V==="General"&&(V="yyyy-mm-dd"),O=Qr(O)));let z=h(V,$),W=z?` s="${z}"`:"";return O==null||O===""?W?`<c r="${F}"${W}/>`:"":typeof O=="number"?Number.isFinite(O)?`<c r="${F}"${W}><v>${O}</v></c>`:"":typeof O=="boolean"?`<c r="${F}"${W} t="b"><v>${O?1:0}</v></c>`:`<c r="${F}"${W} t="inlineStr"><is><t xml:space="preserve">${xt(String(O))}</t></is></c>`}).join("");return`<row r="${T+1}">${D}</row>`}).join(""),m=Math.max(0,...p.rows.map(E=>E.length)),w=(b=p.freezeRows)!=null?b:0,R=w?`<sheetViews><sheetView workbookViewId="0"><pane ySplit="${w}" topLeftCell="A${w+1}" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>`:'<sheetViews><sheetView workbookViewId="0"/></sheetViews>',k=(M=p.widths)!=null&&M.length?`<cols>${p.widths.map((E,T)=>`<col min="${T+1}" max="${T+1}" width="${Math.max(4,Math.min(120,E)).toFixed(1)}" customWidth="1"/>`).join("")}</cols>`:"",L=p.autoFilter&&m&&w&&p.rows.length>=w?`<autoFilter ref="A${w}:${Xt(m-1)}${p.rows.length}"/>`:"",I=(S=p.merges)!=null&&S.length?`<mergeCells count="${p.merges.length}">${p.merges.map(E=>`<mergeCell ref="${E}"/>`).join("")}</mergeCells>`:"";return`${Me}<worksheet xmlns="${Yt}" xmlns:r="${Ee}">${R}<sheetFormatPr defaultRowHeight="15"/>${k}<sheetData>${v}</sheetData>${L}${I}</worksheet>`}),x=`${Me}<styleSheet xmlns="${Yt}">`+(t.length?`<numFmts count="${t.length}">${t.map((p,v)=>`<numFmt numFmtId="${164+v}" formatCode="${xt(p)}"/>`).join("")}</numFmts>`:"")+`<fonts count="${r.length}">${r.join("")}</fonts><fills count="${a.length}">${a.join("")}</fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${n.length}">${n.join("")}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`,y=[{name:"[Content_Types].xml",data:`${Me}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>`+i.map((p,v)=>`<Override PartName="/xl/worksheets/sheet${v+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")+"</Types>"},{name:"_rels/.rels",data:`${Me}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${Ee}/officeDocument" Target="xl/workbook.xml"/></Relationships>`},{name:"xl/workbook.xml",data:`${Me}<workbook xmlns="${Yt}" xmlns:r="${Ee}"><sheets>`+f.map((p,v)=>`<sheet name="${xt(p)}" sheetId="${v+1}" r:id="rId${v+1}"/>`).join("")+"</sheets>"+(i.some(p=>p.autoFilter&&p.freezeRows)?`<definedNames>${i.map((p,v)=>{let m=Math.max(0,...p.rows.map(w=>w.length));return p.autoFilter&&p.freezeRows&&m?`<definedName name="_xlnm._FilterDatabase" localSheetId="${v}" hidden="1">'${xt(f[v].replace(/'/g,"''"))}'!$A$${p.freezeRows}:$${Xt(m-1)}$${p.rows.length}</definedName>`:""}).join("")}</definedNames>`:"")+"</workbook>"},{name:"xl/_rels/workbook.xml.rels",data:`${Me}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`+i.map((p,v)=>`<Relationship Id="rId${v+1}" Type="${Ee}/worksheet" Target="worksheets/sheet${v+1}.xml"/>`).join("")+`<Relationship Id="rId${i.length+1}" Type="${Ee}/styles" Target="styles.xml"/></Relationships>`},{name:"xl/styles.xml",data:x},...g.map((p,v)=>({name:`xl/worksheets/sheet${v+1}.xml`,data:p}))];return lo(y)}var oi=new Set([14,15,16,17,18,19,20,21,22,27,30,36,45,46,47,50,57]);function ri(i){let e=i.replace(/"[^"]*"/g,"").replace(/\[[^\]]*\]/g,"").replace(/\\./g,"");return/[dmyhs]/i.test(e)&&!/^[#0.,%\s]*$/.test(e)}function $e(i){return i?new DOMParser().parseFromString(new TextDecoder().decode(i),"application/xml"):null}var de=(i,e)=>[...i.getElementsByTagNameNS("*",e)];function ii(i){let e=0;for(let t of i){let n=t.charCodeAt(0);if(n<65||n>90)break;e=e*26+(n-64)}return e-1}async function Ct(i){var f,g,x,y,p,v,m,w,R;let e=i instanceof Uint8Array?i:new Uint8Array(i);if(!bt(e))throw new Error("Not an xlsx file");let t=await co(e),n=$e(t.get("xl/workbook.xml"));if(!n)throw new Error("xlsx has no workbook");let o=$e(t.get("xl/_rels/workbook.xml.rels")),r=new Map(o?de(o,"Relationship").map(k=>{var L,I;return[(L=k.getAttribute("Id"))!=null?L:"",(I=k.getAttribute("Target"))!=null?I:""]}):[]),s=$e(t.get("xl/sharedStrings.xml")),a=s?de(s,"si").map(k=>de(k,"t").map(L=>{var I;return(I=L.textContent)!=null?I:""}).join("")):[],l=$e(t.get("xl/styles.xml")),d=new Map(l?de(l,"numFmt").map(k=>{var L;return[Number(k.getAttribute("numFmtId")),(L=k.getAttribute("formatCode"))!=null?L:""]}):[]),c=l?de(l,"cellXfs")[0]:void 0,u=(c?[...c.children].filter(k=>k.localName==="xf"):[]).map(k=>{var I;let L=Number((I=k.getAttribute("numFmtId"))!=null?I:0);return oi.has(L)||d.has(L)&&ri(d.get(L))}),h=[];for(let k of de(n,"sheet")){let L=(g=(f=k.getAttribute("r:id"))!=null?f:k.getAttributeNS(Ee,"id"))!=null?g:"",I=(x=r.get(L))!=null?x:"";I=I.startsWith("/")?I.slice(1):`xl/${I}`;let b=$e(t.get(I)),M=[];if(b){for(let S of de(b,"row")){let E=Number((y=S.getAttribute("r"))!=null?y:M.length+1)-1,T=[],D=0;for(let P of[...S.children].filter(N=>N.localName==="c")){let N=P.getAttribute("r"),$=N?ii(N):D;D=$+1;let F=P.getAttribute("t"),O=(v=(p=de(P,"v")[0])==null?void 0:p.textContent)!=null?v:null,V=null;if(F==="s")V=O===null?null:(m=a[Number(O)])!=null?m:"";else if(F==="inlineStr")V=de(P,"t").map(z=>{var W;return(W=z.textContent)!=null?W:""}).join("");else if(F==="b")V=O==="1";else if(F==="str"||F==="e")V=O;else if(O!==null&&O!==""){let z=Number(O);V=u[Number((w=P.getAttribute("s"))!=null?w:0)]?ei(z):z}T[$]=V}for(let P=0;P<T.length;P++)T[P]===void 0&&(T[P]=null);M[E]=T}for(let S=0;S<M.length;S++)M[S]||(M[S]=[])}h.push({name:(R=k.getAttribute("name"))!=null?R:`Sheet${h.length+1}`,rows:M})}return h}function Zt(i,e){return Array.isArray(e)?e.flatMap(t=>{var o,r;let n=i.columns.getNode(t);return!n||n.children||A(t)?(H(`export: unknown column "${t}"`),[]):[{id:t,def:n.def,node:n,width:(r=(o=i.columns.getColumn(t))==null?void 0:o.width)!=null?r:n.width}]}):i.columns.displayed().filter(t=>!A(t.id)).map(t=>({id:t.id,def:t.def,node:t.node,width:t.width}))}function Jt(i,e){return e==="selected"?i.selectedRows():e==="all"?i.rowModel.server?i.rowModel.dataRows().map(t=>t.data):i.viewRows():i.rowModel.dataRows().map(t=>t.data)}var Ne=(i,e)=>{var t,n;return(n=(t=i.header)!=null?t:i.field)!=null?n:e},Fe=i=>String(i!=null?i:"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e]);function Qt(i,e={}){var u,h;let t=Zt(i,e.columns),n=i.store.state.locale.code,o=t.map(f=>_(f.def,n)),r=t.map(f=>{let g=[];for(let x=f.node;x;x=x.parent)g.unshift(x);return g}),s=Math.max(1,...r.map(f=>f.length)),a=[];for(let f=0;f<s;f++){let g="";for(let x=0;x<t.length;x++){let y=r[x],p=y.length-1;if(f<p){let v=y[f];if(x>0&&r[x-1][f]===v)continue;let m=1;for(;x+m<t.length&&r[x+m][f]===v;)m++;g+=`<th colspan="${m}">${Fe(Ne(v.def,v.id))}</th>`}else f===p&&(g+=`<th colspan="1" rowspan="${s-f}">${Fe(Ne(t[x].def,t[x].id))}</th>`)}a.push(`<tr>${g}</tr>`)}let l=f=>{var g;return(g=f.align)!=null?g:f.type==="number"?"right":f.type==="boolean"?"center":"left"},d=Jt(i,e.rows).map(f=>`<tr>${t.map((g,x)=>{let y=B(g.def,f);return`<td style="text-align:${l(g.def)}">${Fe(G(y)?"":o[x](y))}</td>`}).join("")}</tr>`).join(""),c=Fe((h=(u=e.title)!=null?u:document.title)!=null?h:"");return`<!doctype html><html lang="${Fe(n)}"><head><meta charset="utf-8"><title>${c}</title><style>
4
+ `?2:1;continue}o+=l,a=!1,r++}return(o!==""||n.length||!a)&&(n.push(o),t.push(n)),t}function gt(i,e,t){var n;if(z(e))return"";if(Array.isArray(e))return e.join(", ");switch(i.type){case"number":{let o=typeof e=="number"?e:Number(e);return Number.isNaN(o)?String(e):String(o)}case"date":return(n=ee(e))!=null?n:String(e);case"boolean":return e===!0?"TRUE":e===!1?"FALSE":String(e);default:return _(i,t)(e)}}var Br=new Set(["true","1","y","yes","\uC608","o","on"]),Gr=new Set(["false","0","n","no","\uC544\uB2C8\uC624","x","off"]);function zr(i){let e=i.trim();if(!e)return{ok:!0,value:null};let t=!1;/^\(.*\)$/.test(e)&&(t=!0,e=e.slice(1,-1));let n=e.endsWith("%");if(n&&(e=e.slice(0,-1)),e=e.replace(/[\s,₩$€£¥원]/g,""),!/^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i.test(e))return{ok:!1};let o=Number(e);return n&&(o/=100),t&&(o=-o),{ok:!0,value:Math.round(o*1e12)/1e12}}function oo(i,e,t){let n=new Date(i,e-1,t);return n.getFullYear()===i&&n.getMonth()===e-1&&n.getDate()===t?n:null}function Vr(i,e){let t=i.trim();if(!t)return{ok:!0,value:null};let n=null,o=/^(\d{4})\s*[-./년]\s*(\d{1,2})\s*[-./월]\s*(\d{1,2})\s*[.일]?$/.exec(t);return o?n=oo(+o[1],+o[2],+o[3]):(o=/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/.exec(t))?n=oo(+o[3],+o[1],+o[2]):/^\d{4}-\d{2}-\d{2}T/.test(t)&&(n=ae(t)),n?{ok:!0,value:e instanceof Date?n:ee(n)}:{ok:!1}}function mt(i,e,t){switch(i.type){case"number":return zr(e);case"date":return Vr(e,t);case"boolean":{let n=e.trim().toLowerCase();return n?Br.has(n)?{ok:!0,value:!0}:Gr.has(n)?{ok:!0,value:!1}:{ok:!1}:{ok:!0,value:null}}default:return{ok:!0,value:e}}}var qr=i=>i.map(e=>e!==null&&typeof e=="object"&&"value"in e?e:{value:e,label:String(e),disabled:!1}),ye=i=>String(i).padStart(2,"0");function Wr(i){let e=i instanceof Date?i:typeof i=="string"&&i?new Date(i):null;return!e||Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${ye(e.getMonth()+1)}-${ye(e.getDate())}T${ye(e.getHours())}:${ye(e.getMinutes())}`}function Ur(i){if(i instanceof Date)return`${ye(i.getHours())}:${ye(i.getMinutes())}`;let e=typeof i=="string"?/(\d{1,2}):(\d{2})/.exec(i):null;return e?`${ye(Number(e[1]))}:${e[2]}`:""}var wt=class{constructor(e){this.grid=e;this.cur=null;this.session=null;e.events.on("focusChange",({rowIndex:t})=>{var n;this.session&&!this.cur&&((n=this.grid.rowModel.getRow(t))==null?void 0:n.data)!==this.session.row&&this.endRow(!0)})}get rowMode(){return this.grid.options.editType==="row"}editingRow(e){var t;return((t=this.session)==null?void 0:t.id)===e}beginRow(e,t){var n;((n=this.session)==null?void 0:n.row)!==e&&(this.session&&this.endRow(!0),this.session={row:e,id:this.grid.rowModel.idOf(e),before:{...e},undoMark:this.grid.history.mark()},this.grid.renderer.invalidate({rows:!0}),this.grid.events.emit("rowEditStart",{row:e,rowIndex:t}))}endRow(e){let t=this.session;if(!t)return;if(this.cur){if(e&&!this.commit(null))return;e||this.close(!1)}this.session=null;let{grid:n}=this,o=n.rowModel.indexOfId(t.id),r=n.columns.displayed().filter(a=>a.def.field&&!$(a.id));if(!e){let a=[];for(let l of r){let c=l.def.field;Object.is(t.row[c],t.before[c])||n.writeCell(a,t.row,c,l.id,o,t.before[c])}n.endCellTx(a),n.history.rollback(t.undoMark)}let s=r.filter(a=>!Object.is(t.row[a.def.field],t.before[a.def.field])).map(a=>({colId:a.id,oldValue:t.before[a.def.field],newValue:t.row[a.def.field]}));n.renderer.invalidate({rows:!0}),n.events.emit("rowEditStop",{row:t.row,rowIndex:o,committed:e,changes:s})}get active(){return this.cur&&{rowIndex:this.cur.rowIndex,colId:this.cur.colId}}canEdit(e,t){if($(t))return!1;let n=this.grid.columns.getColumn(t);if(!(n!=null&&n.def.field)||e<0||e>=this.grid.rowModel.getRowCount())return!1;let o=this.grid.rowModel.getRow(e);return!o.kind&&le(n.def,o.data,e)}start(e,t,n){var g,v,C;if(this.cur&&!this.commit(null)||!this.canEdit(e,t))return!1;let{grid:o}=this;if(o.veto("beforeEdit",{row:o.rowModel.getRow(e).data,rowIndex:e,colId:t}))return!1;let{renderer:r}=o,a=o.columns.getColumn(t).def,l=o.rowModel.getRow(e).data,c=l[a.field];this.rowMode&&this.beginRow(l,e),o.setFocus(e,t),r.ensureVisible(e,t),r.render();let d=S("div","fg-editor");this.place(d,e,t);let u,h,p=()=>{},f=a.editor;if(typeof f=="function"){let R=f({value:c,row:l,column:a,initialText:n});u=R.el,h=()=>({value:R.getValue()}),p=()=>{var k;return(k=R.destroy)==null?void 0:k.call(R)},d.append(u),queueMicrotask(()=>{var k;return(k=R.focus)==null?void 0:k.call(R)})}else if((f==null?void 0:f.type)==="select"){let R=qr(typeof f.options=="function"?f.options(l):f.options),k=S("select","fg-editor-control");R.forEach((T,b)=>{var D;let M=S("option");M.value=String(b),M.textContent=(D=T.label)!=null?D:String(T.value),M.disabled=!!T.disabled,k.append(M)}),k.selectedIndex=Math.max(0,R.findIndex(T=>Object.is(T.value,c))),u=k,h=()=>{var T,b;return{value:(b=(T=R[k.selectedIndex])==null?void 0:T.value)!=null?b:null}},d.append(k)}else if((f==null?void 0:f.type)==="time"||(f==null?void 0:f.type)==="datetime"||!f&&a.type==="date"&&a.format==="datetime"){let R=(f==null?void 0:f.type)==="time",k=S("input","fg-editor-control",{type:R?"time":"datetime-local"});k.value=R?Ur(c):Wr(c),u=k,h=()=>k.value?R?{value:k.value}:{value:c instanceof Date?new Date(k.value):k.value}:{value:null},d.append(k)}else{let k=(f==null?void 0:f.type)==="textarea"?S("textarea","fg-editor-control"):S("input","fg-editor-control");k instanceof HTMLInputElement&&(k.type=a.type==="date"&&n===void 0?"date":"text",a.type==="number"&&(k.inputMode="decimal"));let T=a.type==="date"?(g=ee(c))!=null?g:"":z(c)?"":String(c);k.value=n!=null?n:T,u=k,h=()=>({text:k.value}),d.append(k)}u.setAttribute("aria-label",(C=(v=a.header)!=null?v:a.field)!=null?C:t);let x=S("div","fg-editor-msg",{role:"alert"});d.append(x);let y=R=>{if(R.stopPropagation(),R.key==="Escape")R.preventDefault(),this.cancel();else if(R.key==="Enter"){if(u instanceof HTMLTextAreaElement&&!(R.ctrlKey||R.metaKey))return;R.preventDefault(),this.commit(R.shiftKey?"up":"down")}else R.key==="Tab"&&(R.preventDefault(),this.commit(R.shiftKey?"left":"right"))},m=R=>{var k;((k=this.cur)==null?void 0:k.wrap)===d&&!d.contains(R.relatedTarget)&&this.commit(null)},w=()=>this.commit(null);return d.addEventListener("keydown",y),d.addEventListener("focusout",m),r.scroller.addEventListener("scroll",w,{passive:!0}),r.root.append(d),this.cur={rowIndex:e,colId:t,row:l,def:a,wrap:d,read:h,dispose:()=>{d.removeEventListener("keydown",y),d.removeEventListener("focusout",m),r.scroller.removeEventListener("scroll",w),p(),d.remove()}},typeof f!="function"&&(u.focus(),n===void 0&&u instanceof HTMLInputElement&&u.type==="text"&&u.select()),o.events.emit("editStart",{rowIndex:e,colId:t}),!0}place(e,t,n){var l,c,d;let{renderer:o}=this.grid,r=o.root.querySelector(`.fg-row[data-row="${t}"] .fg-cell[data-col="${CSS.escape(n)}"]`),s=o.root.getBoundingClientRect(),a=r==null?void 0:r.getBoundingClientRect();return e.style.left=`${((l=a==null?void 0:a.left)!=null?l:s.left)-s.left}px`,e.style.top=`${((c=a==null?void 0:a.top)!=null?c:s.top)-s.top}px`,e.style.width=`${(a==null?void 0:a.width)||((d=this.grid.columns.getColumn(n))==null?void 0:d.width)}px`,e.style.height=`${(a==null?void 0:a.height)||o.opts.rowHeight}px`,!!r}indexOf(e){var o;let t=this.grid.rowModel,n=t.indexOfId(t.idOf(e));return n>=0&&((o=t.getRow(n))==null?void 0:o.data)===e?n:-1}sync(){let e=this.cur;if(!e)return;let t=this.indexOf(e.row);if(t<0)return this.cancel();t!==e.rowIndex&&(e.rowIndex=t,this.grid.setFocus(t,e.colId),this.grid.renderer.render(),this.place(e.wrap,t,e.colId)||this.commit(null))}commit(e){let t=this.cur;if(!t)return!1;let{grid:n}=this,o=n.store.state.locale,r=t.def.field,s=t.row[r],a=t.read(),l;if("text"in a&&t.def.formulas&&Re(a.text.trim()))l=a.text.trim();else if("text"in a){let u=mt(t.def,a.text,s);if(!u.ok)return this.fail(a.text,o.invalidValue);l=u.value}else l=a.value;let c=n.cellError(t.def,t.row,l);if(c!==null)return this.fail(l,c);let d=this.indexOf(t.row);return d<0?(this.cancel(),!1):(t.rowIndex=d,this.close(!0),n.applyEdit(d,t.colId,l),this.session&&(e==="down"||e==="up")&&this.endRow(!0),this.move(d,t.colId,e),!0)}cancel(){this.close(!1),this.session&&this.endRow(!1)}destroy(){var e;(e=this.cur)==null||e.dispose(),this.cur=null,this.session=null}fail(e,t){let n=this.cur;return n.wrap.classList.add("fg-editor-invalid"),n.wrap.querySelector(".fg-editor-msg").textContent=t,this.grid.events.emit("validationFailed",{rowIndex:n.rowIndex,colId:n.colId,value:e,message:t}),!1}close(e){let t=this.cur;t&&(this.cur=null,t.dispose(),this.grid.renderer.gridEl.focus({preventScroll:!0}),this.grid.events.emit("editStop",{rowIndex:t.rowIndex,colId:t.colId,committed:e}))}move(e,t,n){if(!n)return;let{grid:o}=this,r=o.rowModel.getRowCount();if(n==="down"||n==="up"){let d=Math.max(0,Math.min(r-1,e+(n==="down"?1:-1)));o.setFocus(d,t),o.renderer.ensureVisible(d,t);return}let s=o.columns.displayed().filter(d=>this.canEdit(e,d.id)||d.def.editable);if(!s.length)return;let a=n==="right"?1:-1,l=e,c=s.findIndex(d=>d.id===t)+a;c>=s.length&&(c=0,this.session||l++),c<0&&(c=s.length-1,this.session||l--),!(l<0||l>=r)&&this.start(l,s[c].id)}};var vt=class{constructor(e=200){this.limit=e;this.entries=[];this.index=0}push(e){this.entries.splice(this.index),this.entries.push(e),this.entries.length>this.limit&&this.entries.shift(),this.index=this.entries.length}canUndo(){return this.index>0}canRedo(){return this.index<this.entries.length}undo(){return this.canUndo()?(this.entries[--this.index].undo(),!0):!1}redo(){return this.canRedo()?(this.entries[this.index++].redo(),!0):!1}mark(){var e;return(e=this.entries[this.index-1])!=null?e:null}rollback(e){let t=e?this.entries.indexOf(e)+1:0;this.entries.splice(t),this.index=Math.min(this.index,t)}clear(){this.entries=[],this.index=0}};var io=(i,e)=>i instanceof Date&&e instanceof Date?i.getTime()===e.getTime():Object.is(i,e),yt=class{constructor(){this.originals=new Map;this.created=new Set;this.deleted=new Map}beforeChange(e){!this.created.has(e)&&!this.originals.has(e)&&this.originals.set(e,{...e})}isDirty(e,t){if(!t||this.created.has(e))return!1;let n=this.originals.get(e);return!!n&&!io(n[t],e[t])}diff(e,t){let n=this.originals.get(e);return n?t.filter(o=>!io(n[o],e[o])):[]}commit(e,t){for(let n of t)this.deleted.delete(n);for(let[n,o]of e)this.created.delete(n),this.originals.set(n,{...o})}get size(){return this.originals.size+this.created.size+this.deleted.size}reset(){this.originals.clear(),this.created.clear(),this.deleted.clear()}};function Fe(i){return{r1:Math.min(i.start.rowIndex,i.end.rowIndex),r2:Math.max(i.start.rowIndex,i.end.rowIndex),c1:Math.min(i.start.colIndex,i.end.colIndex),c2:Math.max(i.start.colIndex,i.end.colIndex)}}function so(i,e,t){return e>=i.r1&&e<=i.r2&&t>=i.c1&&t<=i.c2}var Kr=5;function ao(i,e){let t=o=>i(o),n=o=>{window.removeEventListener("pointermove",t),window.removeEventListener("pointerup",n),window.removeEventListener("pointercancel",n),e(o)};window.addEventListener("pointermove",t),window.addEventListener("pointerup",n),window.addEventListener("pointercancel",n)}function jr(i,e,t){let n=i.columns.getColumn(t);if(!n)return;let o=e.clientX,r=n.width;i.renderer.root.classList.add("fg-resizing"),ao(s=>{i.columns.setWidth(t,r+(s.clientX-o)*(i.renderer.rtl?-1:1)),i.layoutChanged()},()=>{var a,l;i.renderer.root.classList.remove("fg-resizing");let s=(l=(a=i.columns.getColumn(t))==null?void 0:a.width)!=null?l:r;s!==r&&i.events.emit("columnResize",{colId:t,width:s})})}function _r(i,e){let t=i.columns.getNode(e);return!!i.groupPanel&&!!t&&!t.children&&!i.options.treeData&&!i.getGroupBy().includes(e)}function Xr(i,e,t,n){var l,c;let o=new Set(i.columns.siblings(e).map(d=>d.id).filter(d=>d!==e&&!$(d))),r=[...n.querySelectorAll(".fg-header-cell")].filter(d=>o.has(d.dataset.col)).map(d=>({id:d.dataset.col,el:d})),s=S("div",`fg-drag-ghost fg-theme-${i.store.state.theme}`);s.textContent=(c=(l=t.querySelector(".fg-header-label"))==null?void 0:l.textContent)!=null?c:"",i.applyFontTo(s),oe(i.renderer.root).append(s);let a=S("div","fg-drop-marker");return a.style.height=`${i.renderer.headerEl.offsetHeight}px`,i.renderer.root.append(a),t.classList.add("fg-dragging"),{ghost:s,marker:a,cell:t,sibs:r,target:-1,overPanel:!1}}function Yr(i,e,t,n,o){var d,u;t.ghost.style.transform=`translate(${n+12}px, ${o+8}px)`,t.overPanel=_r(i,e)&&!!((d=i.groupPanel)!=null&&d.contains(n,o)),(u=i.groupPanel)==null||u.highlight(t.overPanel),t.marker.hidden=t.overPanel;let r=0;for(let h of t.sibs){let p=h.el.getBoundingClientRect();(i.renderer.rtl?n<p.left+p.width/2:n>p.left+p.width/2)&&r++}t.target=r;let s=i.renderer.root.getBoundingClientRect().left,a=h=>i.renderer.rtl?h.getBoundingClientRect().right:h.getBoundingClientRect().left,l=h=>i.renderer.rtl?h.getBoundingClientRect().left:h.getBoundingClientRect().right,c=r<t.sibs.length?a(t.sibs[r].el):t.sibs.length?l(t.sibs[t.sibs.length-1].el):a(t.cell);t.marker.style.left=`${c-s-1}px`}function Jr(i,e,t){var a;if(t.ghost.remove(),t.marker.remove(),t.cell.classList.remove("fg-dragging"),t.overPanel){(a=i.groupPanel)==null||a.highlight(!1),i.setGroupBy([...i.getGroupBy(),e]);return}if(t.target<0||!t.sibs.length)return;let n=i.columns.siblings(e),o=n.findIndex(l=>l.id===e),r=n.map(l=>l.id).filter(l=>l!==e),s=t.target<t.sibs.length?r.indexOf(t.sibs[t.target].id):r.indexOf(t.sibs[t.sibs.length-1].id)+1;s=Math.max(r.filter($).length,s),s!==o&&(i.columns.move(e,s),i.layoutChanged(),i.events.emit("columnMove",{colId:e,toIndex:s}))}function Zr(i,e,t,n){let o=i.columns.getNode(t),r=n.closest(".fg-header-pane");if(!o||!r)return;let s=e.clientX,a=null;ao(l=>{if(!a){if(Math.abs(l.clientX-s)<Kr)return;a=Xr(i,t,n,r)}Yr(i,t,a,l.clientX,l.clientY)},l=>{a?Jr(i,t,a):!o.children&&ve(o.def)&&i.toggleSort(t,l.shiftKey||l.ctrlKey||l.metaKey)})}function lo(i){let e=i.renderer.headerEl,t=o=>{if(o.button!==0)return;let r=o.target,s=r.closest(".fg-header-cell"),a=s==null?void 0:s.dataset.col;!s||!a||$(a)||r.closest(".fg-menu-btn")||r.closest("button, a, input, select, textarea, [data-fg-no-sort]")&&r.closest(".fg-header-label")||(o.preventDefault(),r.closest(".fg-resize")?jr(i,o,a):Zr(i,o,a,s))},n=o=>{var a;let r=o.target,s=r.closest(".fg-menu-btn");if(s){let l=(a=s.closest(".fg-header-cell"))==null?void 0:a.dataset.col;l&&i.menu.toggle(l,s);return}r.closest(".fg-select-all")&&i.toggleSelectAll()};return e.addEventListener("pointerdown",t),e.addEventListener("click",n),()=>{e.removeEventListener("pointerdown",t),e.removeEventListener("click",n)}}var Qr=/^[=+\-@\t\r]/;function co(i,e=","){let t=n=>{let o=n.value;return n.text&&Qr.test(o)&&(o=`'${o}`),o.includes(e)||/["\r\n]/.test(o)||/^\s|\s$/.test(o)?`"${o.replace(/"/g,'""')}"`:o};return i.map(n=>n.map(t).join(e)).join(`\r
5
+ `)}function Xt(i){let e=i.slice(0,i.search(/\r?\n|$/)),t=s=>e.split(s).length-1,n=t(" "),o=t(";"),r=t(",");return n&&n>=r&&n>=o?" ":o>r?";":","}function bt(i,e=Xt(i)){return _t(i.replace(/^\uFEFF/,""),e)}var ei=(()=>{let i=new Uint32Array(256);for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;i[e]=t>>>0}return i})();function ti(i){let e=4294967295;for(let t=0;t<i.length;t++)e=ei[(e^i[t])&255]^e>>>8;return(e^4294967295)>>>0}var uo=new TextEncoder;function ho(i){let e=i.map(d=>{let u=uo.encode(d.name),h=typeof d.data=="string"?uo.encode(d.data):d.data;return{name:u,data:h,crc:ti(h),offset:0}}),t=e.reduce((d,u)=>d+30+u.name.length+u.data.length,0),n=e.reduce((d,u)=>d+46+u.name.length,0),o=new Uint8Array(t+n+22),r=new DataView(o.buffer),s=0,a=0,l=33;for(let d of e)d.offset=s,r.setUint32(s,67324752,!0),r.setUint16(s+4,20,!0),r.setUint16(s+6,2048,!0),r.setUint16(s+8,0,!0),r.setUint16(s+10,a,!0),r.setUint16(s+12,l,!0),r.setUint32(s+14,d.crc,!0),r.setUint32(s+18,d.data.length,!0),r.setUint32(s+22,d.data.length,!0),r.setUint16(s+26,d.name.length,!0),r.setUint16(s+28,0,!0),o.set(d.name,s+30),o.set(d.data,s+30+d.name.length),s+=30+d.name.length+d.data.length;let c=s;for(let d of e)r.setUint32(s,33639248,!0),r.setUint16(s+4,20,!0),r.setUint16(s+6,20,!0),r.setUint16(s+8,2048,!0),r.setUint16(s+10,0,!0),r.setUint16(s+12,a,!0),r.setUint16(s+14,l,!0),r.setUint32(s+16,d.crc,!0),r.setUint32(s+20,d.data.length,!0),r.setUint32(s+24,d.data.length,!0),r.setUint16(s+28,d.name.length,!0),r.setUint16(s+30,0,!0),r.setUint16(s+32,0,!0),r.setUint16(s+34,0,!0),r.setUint16(s+36,0,!0),r.setUint32(s+38,0,!0),r.setUint32(s+42,d.offset,!0),o.set(d.name,s+46),s+=46+d.name.length;return r.setUint32(s,101010256,!0),r.setUint16(s+8,e.length,!0),r.setUint16(s+10,e.length,!0),r.setUint32(s+12,s-c,!0),r.setUint32(s+16,c,!0),o}var xt=i=>i.length>4&&i[0]===80&&i[1]===75&&i[2]===3&&i[3]===4,fo=i=>new Error(`Zip file is too large: it unpacks to more than ${i>=1048576?`${Math.round(i/1048576)} MB`:`${i} bytes`}`);async function ni(i,e){if(typeof DecompressionStream=="undefined")throw new Error("This browser cannot read compressed xlsx files (no DecompressionStream)");let n=new Response(i).body.pipeThrough(new DecompressionStream("deflate-raw")).getReader(),o=[],r=0;for(;;){let{done:l,value:c}=await n.read();if(l)break;if(r+=c.length,r>e)throw await n.cancel().catch(()=>{}),fo(e);o.push(c)}let s=new Uint8Array(r),a=0;for(let l of o)s.set(l,a),a+=l.length;return s}async function po(i,e={}){var u,h;let t=(u=e.maxBytes)!=null?u:209715200,n=(h=e.maxEntries)!=null?h:1e4,o=new DataView(i.buffer,i.byteOffset,i.byteLength),r=-1;for(let p=i.length-22;p>=Math.max(0,i.length-65557);p--)if(o.getUint32(p,!0)===101010256){r=p;break}if(r<0)throw new Error("Not a zip file");let s=o.getUint16(r+10,!0);if(s>n)throw new Error(`Zip file has too many entries (${s}, at most ${n})`);let a=o.getUint32(r+16,!0),l=new TextDecoder,c=new Map,d=0;for(let p=0;p<s;p++){if(o.getUint32(a,!0)!==33639248)throw new Error("Broken zip directory");let f=o.getUint16(a+10,!0),x=o.getUint32(a+20,!0),y=o.getUint16(a+28,!0),m=o.getUint16(a+30,!0),w=o.getUint16(a+32,!0),g=o.getUint32(a+42,!0),v=l.decode(i.subarray(a+46,a+46+y)),C=o.getUint16(g+26,!0),R=o.getUint16(g+28,!0),k=g+30+C+R,T=i.subarray(k,k+x),b;if(f===0)b=T;else if(f===8)b=await ni(T,t-d);else throw new Error(`Unsupported zip compression ${f}`);if(d+=b.length,d>t)throw fo(t);c.set(v,b),a+=46+y+m+w}return c}function Yt(i){let e="";for(let t=i+1;t>0;t=Math.floor((t-1)/26))e=String.fromCharCode(65+(t-1)%26)+e;return e}var go=Date.UTC(1899,11,30),mo=864e5;function oi(i){return(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds())-go)/mo}function ri(i){let e=new Date(Math.round(i*mo)+go);return new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds())}var ii=/[\u0000-\u0008\u000b\u000c\u000e-\u001f￾￿]/g,Ct=i=>i.replace(ii,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),Ee=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
6
+ `,Jt="http://schemas.openxmlformats.org/spreadsheetml/2006/main",Le="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function si(i){let e=new Set;return i.map((t,n)=>{var s;let o=((s=t.name)!=null?s:`Sheet${n+1}`).replace(/[[\]:*?/\\]/g," ").slice(0,31).trim()||`Sheet${n+1}`,r=o;for(let a=2;e.has(r.toLowerCase());a++)r=`${o.slice(0,28)} (${a})`;return e.add(r.toLowerCase()),r})}function be(i){let e=new Map([["General",0]]),t=[],n=['<xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/>'],o=new Map([["General||||",0]]),r=['<font><sz val="11"/><name val="Calibri"/></font>','<font><b/><sz val="11"/><name val="Calibri"/></font>'],s=new Map([["0|",0],["1|",1]]),a=['<fill><patternFill patternType="none"/></fill>','<fill><patternFill patternType="gray125"/></fill>','<fill><patternFill patternType="solid"><fgColor rgb="FFF2F4F7"/><bgColor indexed="64"/></patternFill></fill>'],l=new Map([["FFF2F4F7",2]]),c=m=>m&&/^[0-9a-f]{8}$/i.test(m)?m.toUpperCase():m&&/^[0-9a-f]{6}$/i.test(m)?`FF${m.toUpperCase()}`:"",d=(m,w)=>{let g=`${m?1:0}|${w}`,v=s.get(g);return v===void 0&&(v=r.length,r.push(`<font>${m?"<b/>":""}<sz val="11"/>${w?`<color rgb="${w}"/>`:""}<name val="Calibri"/></font>`),s.set(g,v)),v},u=m=>{if(!m)return 0;let w=l.get(m);return w===void 0&&(w=a.length,a.push(`<fill><patternFill patternType="solid"><fgColor rgb="${m}"/><bgColor indexed="64"/></patternFill></fill>`),l.set(m,w)),w},h=(m,w)=>{let g=c(w.color),v=w.header?"FFF2F4F7":c(w.fill),C=!!(w.bold||w.header),R=w.align==="left"||w.align==="center"||w.align==="right"?w.align:"",k=`${m}|${C?1:""}|${g}|${v}|${R}`,T=o.get(k);if(T!==void 0)return T;let b=e.get(m);b===void 0&&(b=164+t.length,t.push(m),e.set(m,b));let M=d(C,g),D=u(v),E=`numFmtId="${b}" fontId="${M}" fillId="${D}" borderId="0" xfId="0"`+(b?' applyNumberFormat="1"':"")+(M?' applyFont="1"':"")+(D?' applyFill="1"':"")+(R?' applyAlignment="1"':"");return T=n.length,n.push(R?`<xf ${E}><alignment horizontal="${R}"/></xf>`:`<xf ${E}/>`),o.set(k,T),T},p=si(i),f=i.map(m=>{var M,D,E;let w=m.rows.map((L,I)=>{let A=L.map((F,P)=>{var K;let N=F!==null&&typeof F=="object"&&!(F instanceof Date)?F:{v:F},H=`${Yt(P)}${I+1}`,B=N.v,W=(K=N.fmt)!=null?K:"General";B instanceof Date&&(Number.isNaN(B.getTime())?B=null:(W==="General"&&(W="yyyy-mm-dd"),B=oi(B)));let q=h(W,N),U=q?` s="${q}"`:"";return B==null||B===""?U?`<c r="${H}"${U}/>`:"":typeof B=="number"?Number.isFinite(B)?`<c r="${H}"${U}><v>${B}</v></c>`:"":typeof B=="boolean"?`<c r="${H}"${U} t="b"><v>${B?1:0}</v></c>`:`<c r="${H}"${U} t="inlineStr"><is><t xml:space="preserve">${Ct(String(B))}</t></is></c>`}).join("");return`<row r="${I+1}">${A}</row>`}).join(""),g=Math.max(0,...m.rows.map(L=>L.length)),v=(M=m.freezeRows)!=null?M:0,C=v?`<sheetViews><sheetView workbookViewId="0"><pane ySplit="${v}" topLeftCell="A${v+1}" activePane="bottomLeft" state="frozen"/></sheetView></sheetViews>`:'<sheetViews><sheetView workbookViewId="0"/></sheetViews>',R=(D=m.widths)!=null&&D.length?`<cols>${m.widths.map((L,I)=>`<col min="${I+1}" max="${I+1}" width="${Math.max(4,Math.min(120,L)).toFixed(1)}" customWidth="1"/>`).join("")}</cols>`:"",k=m.autoFilter&&g&&v&&m.rows.length>=v?`<autoFilter ref="A${v}:${Yt(g-1)}${m.rows.length}"/>`:"",T=((E=m.merges)!=null?E:[]).filter(L=>typeof L=="string"&&/^[A-Z]{1,3}\d{1,7}:[A-Z]{1,3}\d{1,7}$/.test(L)),b=T.length?`<mergeCells count="${T.length}">${T.map(L=>`<mergeCell ref="${L}"/>`).join("")}</mergeCells>`:"";return`${Ee}<worksheet xmlns="${Jt}" xmlns:r="${Le}">${C}<sheetFormatPr defaultRowHeight="15"/>${R}<sheetData>${w}</sheetData>${k}${b}</worksheet>`}),x=`${Ee}<styleSheet xmlns="${Jt}">`+(t.length?`<numFmts count="${t.length}">${t.map((m,w)=>`<numFmt numFmtId="${164+w}" formatCode="${Ct(m)}"/>`).join("")}</numFmts>`:"")+`<fonts count="${r.length}">${r.join("")}</fonts><fills count="${a.length}">${a.join("")}</fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${n.length}">${n.join("")}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles></styleSheet>`,y=[{name:"[Content_Types].xml",data:`${Ee}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/>`+i.map((m,w)=>`<Override PartName="/xl/worksheets/sheet${w+1}.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>`).join("")+"</Types>"},{name:"_rels/.rels",data:`${Ee}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${Le}/officeDocument" Target="xl/workbook.xml"/></Relationships>`},{name:"xl/workbook.xml",data:`${Ee}<workbook xmlns="${Jt}" xmlns:r="${Le}"><sheets>`+p.map((m,w)=>`<sheet name="${Ct(m)}" sheetId="${w+1}" r:id="rId${w+1}"/>`).join("")+"</sheets>"+(i.some(m=>m.autoFilter&&m.freezeRows)?`<definedNames>${i.map((m,w)=>{let g=Math.max(0,...m.rows.map(v=>v.length));return m.autoFilter&&m.freezeRows&&g?`<definedName name="_xlnm._FilterDatabase" localSheetId="${w}" hidden="1">'${Ct(p[w].replace(/'/g,"''"))}'!$A$${m.freezeRows}:$${Yt(g-1)}$${m.rows.length}</definedName>`:""}).join("")}</definedNames>`:"")+"</workbook>"},{name:"xl/_rels/workbook.xml.rels",data:`${Ee}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">`+i.map((m,w)=>`<Relationship Id="rId${w+1}" Type="${Le}/worksheet" Target="worksheets/sheet${w+1}.xml"/>`).join("")+`<Relationship Id="rId${i.length+1}" Type="${Le}/styles" Target="styles.xml"/></Relationships>`},{name:"xl/styles.xml",data:x},...f.map((m,w)=>({name:`xl/worksheets/sheet${w+1}.xml`,data:m}))];return ho(y)}var ai=new Set([14,15,16,17,18,19,20,21,22,27,30,36,45,46,47,50,57]);function li(i){let e=i.replace(/"[^"]*"/g,"").replace(/\[[^\]]*\]/g,"").replace(/\\./g,"");return/[dmyhs]/i.test(e)&&!/^[#0.,%\s]*$/.test(e)}function Ne(i){return i?new DOMParser().parseFromString(new TextDecoder().decode(i),"application/xml"):null}var ce=(i,e)=>[...i.getElementsByTagNameNS("*",e)];function di(i){let e=0;for(let t of i){let n=t.charCodeAt(0);if(n<65||n>90)break;e=e*26+(n-64)}return e-1}var ci=1048576,ui=16384;async function Rt(i){var p,f,x,y,m,w,g,v,C;let e=i instanceof Uint8Array?i:new Uint8Array(i);if(!xt(e))throw new Error("Not an xlsx file");let t=await po(e),n=Ne(t.get("xl/workbook.xml"));if(!n)throw new Error("xlsx has no workbook");let o=Ne(t.get("xl/_rels/workbook.xml.rels")),r=new Map(o?ce(o,"Relationship").map(R=>{var k,T;return[(k=R.getAttribute("Id"))!=null?k:"",(T=R.getAttribute("Target"))!=null?T:""]}):[]),s=Ne(t.get("xl/sharedStrings.xml")),a=s?ce(s,"si").map(R=>ce(R,"t").map(k=>{var T;return(T=k.textContent)!=null?T:""}).join("")):[],l=Ne(t.get("xl/styles.xml")),c=new Map(l?ce(l,"numFmt").map(R=>{var k;return[Number(R.getAttribute("numFmtId")),(k=R.getAttribute("formatCode"))!=null?k:""]}):[]),d=l?ce(l,"cellXfs")[0]:void 0,u=(d?[...d.children].filter(R=>R.localName==="xf"):[]).map(R=>{var T;let k=Number((T=R.getAttribute("numFmtId"))!=null?T:0);return ai.has(k)||c.has(k)&&li(c.get(k))}),h=[];for(let R of ce(n,"sheet")){let k=(f=(p=R.getAttribute("r:id"))!=null?p:R.getAttributeNS(Le,"id"))!=null?f:"",T=(x=r.get(k))!=null?x:"";T=T.startsWith("/")?T.slice(1):`xl/${T}`;let b=Ne(t.get(T)),M=[];if(b){for(let D of ce(b,"row")){let E=Number((y=D.getAttribute("r"))!=null?y:M.length+1)-1;if(!Number.isInteger(E)||E<0||E>=ci)continue;let L=[],I=0;for(let A of[...D.children].filter(F=>F.localName==="c")){let F=A.getAttribute("r"),P=F?di(F):I;if(P<0||P>=ui)continue;I=P+1;let N=A.getAttribute("t"),H=(w=(m=ce(A,"v")[0])==null?void 0:m.textContent)!=null?w:null,B=null;if(N==="s")B=H===null?null:(g=a[Number(H)])!=null?g:"";else if(N==="inlineStr")B=ce(A,"t").map(W=>{var q;return(q=W.textContent)!=null?q:""}).join("");else if(N==="b")B=H==="1";else if(N==="str"||N==="e")B=H;else if(H!==null&&H!==""){let W=Number(H);B=u[Number((v=A.getAttribute("s"))!=null?v:0)]?ri(W):W}L[P]=B}for(let A=0;A<L.length;A++)L[A]===void 0&&(L[A]=null);M[E]=L}for(let D=0;D<M.length;D++)M[D]||(M[D]=[])}h.push({name:(C=R.getAttribute("name"))!=null?C:`Sheet${h.length+1}`,rows:M})}return h}function Zt(i,e){return Array.isArray(e)?e.flatMap(t=>{var o,r;let n=i.columns.getNode(t);return!n||n.children||$(t)?(O(`export: unknown column "${t}"`),[]):[{id:t,def:n.def,node:n,width:(r=(o=i.columns.getColumn(t))==null?void 0:o.width)!=null?r:n.width}]}):i.columns.displayed().filter(t=>!$(t.id)).map(t=>({id:t.id,def:t.def,node:t.node,width:t.width}))}function Qt(i,e){return e==="selected"?i.selectedRows():e==="all"?i.rowModel.server?i.rowModel.dataRows().map(t=>t.data):i.viewRows():i.rowModel.dataRows().map(t=>t.data)}var He=(i,e)=>{var t,n;return(n=(t=i.header)!=null?t:i.field)!=null?n:e},hi=["left","center","right"],fi=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?$/i,Oe=i=>String(i!=null?i:"").replace(/[&<>"]/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"})[e]);function en(i,e={}){var u,h;let t=Zt(i,e.columns),n=i.store.state.locale.code,o=t.map(p=>_(p.def,n)),r=t.map(p=>{let f=[];for(let x=p.node;x;x=x.parent)f.unshift(x);return f}),s=Math.max(1,...r.map(p=>p.length)),a=[];for(let p=0;p<s;p++){let f="";for(let x=0;x<t.length;x++){let y=r[x],m=y.length-1;if(p<m){let w=y[p];if(x>0&&r[x-1][p]===w)continue;let g=1;for(;x+g<t.length&&r[x+g][p]===w;)g++;f+=`<th colspan="${g}">${Oe(He(w.def,w.id))}</th>`}else p===m&&(f+=`<th colspan="1" rowspan="${s-p}">${Oe(He(t[x].def,t[x].id))}</th>`)}a.push(`<tr>${f}</tr>`)}let l=p=>hi.includes(p.align)?p.align:p.type==="number"?"right":p.type==="boolean"?"center":"left",c=Qt(i,e.rows).map(p=>`<tr>${t.map((f,x)=>{let y=G(f.def,p);return`<td style="text-align:${l(f.def)}">${Oe(z(y)?"":o[x](y))}</td>`}).join("")}</tr>`).join(""),d=Oe((h=(u=e.title)!=null?u:document.title)!=null?h:"");return`<!doctype html><html lang="${Oe(n)}"><head><meta charset="utf-8"><title>${d}</title><style>
7
7
  @page { size: auto; margin: 12mm; }
8
8
  body { font: 11px/1.4 system-ui, 'Pretendard', 'Malgun Gothic', sans-serif; color: #111; margin: 0; }
9
9
  h1 { font-size: 15px; margin: 0 0 8px; }
@@ -12,6 +12,6 @@ th, td { border: 1px solid #999; padding: 3px 6px; }
12
12
  th { background: #eee; font-weight: 600; }
13
13
  thead { display: table-header-group; }
14
14
  tr { page-break-inside: avoid; }
15
- </style></head><body>${e.title?`<h1>${c}</h1>`:""}<table><thead>${e.headers===!1?"":a.join("")}</thead><tbody>${d}</tbody></table></body></html>`}function fo(i){if(typeof document=="undefined")return;let e=document.createElement("iframe");e.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0",document.body.append(e);let t=e.contentDocument;if(!t||!e.contentWindow){e.remove(),H("printing is not supported in this environment");return}t.open(),t.write(i),t.close();let n=e.contentWindow,o=()=>setTimeout(()=>e.remove(),1e3);n.addEventListener("afterprint",o),setTimeout(()=>{try{n.focus(),n.print()}catch{H("printing is not supported in this environment")}o()},50)}function en(i,e={}){let t=Zt(i,e.columns),n=i.store.state.locale.code,o=typeof e.separator=="string"&&e.separator.length===1?e.separator:",",r=Jt(i,e.rows).map(s=>t.map(a=>{let l=B(a.def,s),d=a.def.type;return{value:pt(a.def,l,n),text:!(d==="number"||d==="date"||d==="boolean")||typeof l=="string"}}));return e.headers!==!1&&r.unshift(t.map(s=>({value:Ne(s.def,s.id),text:!0}))),so(r,o)}function si(i){var r;let e=i.format;if(i.type==="date")return e==="datetime"?"yyyy-mm-dd hh:mm":e==="time"?"hh:mm":"yyyy-mm-dd";if(i.type!=="number"||e==null)return null;if(typeof e=="string")return e==="integer"?"#,##0":e==="percent"?"0%":e.startsWith("currency:")?"#,##0.##":/^[#0,.%]+$/.test(e)?e:null;let t=e,n=(r=t.maximumFractionDigits)!=null?r:t.minimumFractionDigits,o=n?`.${"0".repeat(Math.min(10,n))}`:"";return t.style==="percent"?`0${o}%`:`${t.useGrouping===!1?"0":"#,##0"}${o}`}function Rt(i){let e=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(i.trim());if(e)return`FF${(e[1].length===3?[...e[1]].map(r=>r+r).join(""):e[1]).toUpperCase()}`;let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)(?:[\s,/]+([\d.]+%?))?\s*\)$/i.exec(i.trim());return!t||!((t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))>0)?"":`FF${[t[1],t[2],t[3]].map(o=>Math.min(255,Number(o)).toString(16).padStart(2,"0")).join("").toUpperCase()}`}function ai(i){let e=i.renderer.root;if(typeof getComputedStyle!="function"||!e.isConnected)return{of:()=>({}),dispose:()=>{}};let t=document.createElement("div");t.className="fg-row",t.style.cssText="position:absolute;left:-9999px;top:0;visibility:hidden;pointer-events:none";let n=document.createElement("div");t.append(n),e.append(t);let o=a=>{n.className=a?`fg-cell ${a}`:"fg-cell";let l=getComputedStyle(n),d=l.fontWeight;return{color:l.color,fill:l.backgroundColor,bold:d==="bold"||Number(d)>=600}},r=o(""),s=new Map;return{of(a){let l=s.get(a);if(!l){let d=o(a);l={},d.color!==r.color&&Rt(d.color)&&(l.color=Rt(d.color)),d.fill!==r.fill&&Rt(d.fill)&&(l.fill=Rt(d.fill)),d.bold&&!r.bold&&(l.bold=!0),s.set(a,l)}return l},dispose:()=>t.remove()}}function tn(i,e={}){return ye([nn(i,e)])}function nn(i,e={}){var y;let t=Zt(i,e.columns),n=i.store.state.locale.code,o=[],r=[],s=0;if(e.headers!==!1){let p=t.map(m=>{let w=[];for(let R=m.node;R;R=R.parent)w.unshift(R);return w});s=Math.max(1,...p.map(m=>m.length));let v=m=>{let w="";for(let R=m+1;R>0;R=Math.floor((R-1)/26))w=String.fromCharCode(65+(R-1)%26)+w;return w};for(let m=0;m<s;m++){let w=[];for(let R=0;R<t.length;R++){let k=p[R],L=k.length-1;if(m<L){let I=k[m],b=R>0?p[R-1][m]:null;if(w.push({v:b===I?null:Ne(I.def,I.id),header:!0}),b!==I){let M=R;for(;M+1<t.length&&p[M+1][m]===I;)M++;M>R&&r.push(`${v(R)}${m+1}:${v(M)}${m+1}`)}}else m===L?(w.push({v:Ne(t[R].def,t[R].id),header:!0}),s-1>m&&r.push(`${v(R)}${m+1}:${v(R)}${s}`)):w.push({v:null,header:!0})}o.push(w)}}let a=t.map(p=>si(p.def)),l=t.map(p=>_(p.def,n)),d=Jt(i,e.rows),c=e.styles!==!1,u=c&&t.some(p=>p.def.cellClass)?ai(i):null,h=(p,v,m)=>{var R;if(G(m))return null;let w=(R=a[v])!=null?R:void 0;switch(p.def.type){case"number":{let k=typeof m=="number"?m:Number(m);return Number.isFinite(k)?{v:k,fmt:w}:String(m)}case"date":{let k=se(m);return k?{v:k,fmt:w}:String(m)}case"boolean":return typeof m=="boolean"?m:String(m);default:return l[v](m)}};try{d.forEach((p,v)=>{o.push(t.map((m,w)=>{let R=B(m.def,p),k=h(m,w,R);if(!c)return k;let L=m.def.align?{align:m.def.align}:{};if(u&&m.def.cellClass){let I;try{I=typeof m.def.cellClass=="function"?m.def.cellClass({value:R,formatted:l[w](R),row:p,rowIndex:v,column:m.def}):m.def.cellClass}catch{I=void 0}I&&(L={...L,...u.of(I)})}return Object.keys(L).length?k!==null&&typeof k=="object"&&!(k instanceof Date)?{...k,...L}:{v:k,...L}:k}))})}finally{u==null||u.dispose()}let f=new Set,g=p=>{let v="";for(let m=p+1;m>0;m=Math.floor((m-1)/26))v=String.fromCharCode(65+(m-1)%26)+v;return v},x=(p,v,m,w)=>{for(let R=p;R<=m;R++)for(let k=v;k<=w;k++)if(f.has(`${R},${k}`))return;for(let R=p;R<=m;R++)for(let k=v;k<=w;k++)f.add(`${R},${k}`);r.push(`${g(v)}${s+p+1}:${g(w)}${s+m+1}`)};return d.forEach((p,v)=>t.forEach((m,w)=>{let R=m.def.colSpan?Ie(m.def.colSpan,m.def,p,v,t.length-w):1;R>1&&x(v,w,v,w+R-1)})),t.forEach((p,v)=>{if(!p.def.merge&&!p.def.rowSpan)return;let m=et(d,p.def);for(let w=0;w<d.length;w++)m.start[w]===w&&m.end[w]>w&&x(w,v,m.end[w],v)}),{name:(y=e.sheetName)!=null?y:"Sheet1",rows:o,widths:t.map(p=>Math.round(p.width/7)),merges:r,freezeRows:s,autoFilter:s>0}}function Oe(i,e,t){if(typeof URL=="undefined"||typeof URL.createObjectURL!="function"||typeof document=="undefined"){H("downloads are not supported in this environment");return}let n=URL.createObjectURL(new Blob(e,{type:t})),o=document.createElement("a");o.href=n,o.download=i,o.style.display="none",document.body.append(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}var St=i=>String(i!=null?i:"").trim().toLowerCase();function li(i){var e;return i==null?"":i instanceof Date?i.getHours()||i.getMinutes()||i.getSeconds()?i.toISOString():(e=ee(i))!=null?e:"":String(i)}async function po(i,e,t={}){var x;let n=e instanceof Uint8Array?e:new Uint8Array(e instanceof ArrayBuffer?e:await e.arrayBuffer()),o;if(bt(n)){let y=await Ct(n),p=typeof t.sheet=="string"?y.find(v=>v.name===t.sheet):y[typeof t.sheet=="number"?t.sheet:0];if(!p)throw new Error(`Sheet ${String(t.sheet)} not found`);o=p.rows}else{let y=new TextDecoder().decode(n);o=yt(y,_t(y))}if(!o.length)return{rows:[],skipped:0};let r=[],s=y=>y.forEach(p=>p.children?s(p.children):!A(p.id)&&p.def.field&&r.push(p));s(i.columns.roots());let a=y=>{var v,m;let p=St(y);return p&&(m=(v=r.find(w=>St(w.def.header)===p))!=null?v:r.find(w=>St(w.def.field)===p||St(w.id)===p))!=null?m:null},l=1,d=new Set(o[0].map(a).filter(Boolean));for(;l<Math.min(o.length,5);){let p=((x=o[l])!=null?x:[]).filter(m=>m!=null&&String(m).trim()!==""),v=p.map(a).filter(m=>m&&!d.has(m));if(!p.length||!p.every(m=>typeof m=="string")||!v.length)break;v.forEach(m=>d.add(m)),l++}let c=Math.max(...o.slice(0,l).map(y=>{var p;return(p=y==null?void 0:y.length)!=null?p:0})),u=Array.from({length:c},(y,p)=>{var v;for(let m=l-1;m>=0;m--){let w=(v=o[m])==null?void 0:v[p];if(w!=null&&String(w).trim()!=="")return a(w)}return null}),h=i.store.state.data[0],f=0,g=[];for(let y of o.slice(l)){if(!y||y.every(v=>v==null||String(v).trim()===""))continue;let p={};u.forEach((v,m)=>{if(!v)return;let w=v.def,R=li(y[m]),k=i.acceptText(w,p,R,h==null?void 0:h[w.field]);k.ok?R===""&&(k.value===null||k.value==="")||(p[w.field]=k.value):f++}),g.push(p)}return t.mode==="replace"?i.setData(g):i.addRows(g),{rows:g,skipped:f}}var di="http://www.w3.org/2000/svg";var on=["var(--fg-accent, #2563eb)","#f59e0b","#10b981","#ef4444","#8b5cf6","#06b6d4","#ec4899","#84cc16","#f97316","#64748b","#14b8a6","#a855f7"],pe=i=>on[i%on.length];function j(i,e={},t=""){let n=document.createElementNS(di,i);t&&n.setAttribute("class",t);for(let[o,r]of Object.entries(e))n.setAttribute(o,String(r));return n}function He(i,e){let t=j("title");t.textContent=e,i.append(t)}function rn(i,e,t=5){let n=Math.min(0,i),o=Math.max(0,e);n===o&&(o=n+1);let r=(o-n)/t,s=10**Math.floor(Math.log10(r)),a=[1,2,5,10].map(d=>d*s).find(d=>d>=r);n=Math.floor(n/a)*a,o=Math.ceil(o/a)*a;let l=[];for(let d=n;d<=o+a/2;d+=a)l.push(Math.round(d/a)*a);return l}function kt(i,e){var S,E;let t=new Intl.NumberFormat(e.locale,{maximumFractionDigits:2}),n=new Intl.NumberFormat(e.locale,{notation:"compact",maximumFractionDigits:1}),o=j("svg",{viewBox:"0 0 640 360",role:"img",preserveAspectRatio:"xMidYMid meet"},`fg-chart fg-chart-is-${e.type}`);e.title&&o.setAttribute("aria-label",e.title);let r=e.series.slice(0,on.length),s=e.categories,a=16;if(e.title){let T=j("text",{x:320,y:22,"text-anchor":"middle"},"fg-chart-title");T.textContent=e.title,o.append(T),a=36}let l=j("g",{},"fg-chart-legend"),d=e.type==="pie"||e.type==="donut",c=d?s:e.type==="scatter"?r.slice(1).map(T=>T.name):r.map(T=>T.name),u=16;c.forEach((T,D)=>{let P=j("g",{transform:`translate(${u},350)`},"fg-chart-legend-item");P.append(j("rect",{x:0,y:-9,width:10,height:10,rx:2,fill:pe(D)}));let N=j("text",{x:14,y:0});N.textContent=T,P.append(N),l.append(P),u+=24+Math.min(140,T.length*7)});let h=308;if(e.type==="scatter"){ci(o,e,r,a,h,t,n),o.append(l),i.replaceChildren(o);return}if(d){let T=((E=(S=r[0])==null?void 0:S.values)!=null?E:[]).map(O=>O!==null&&O>0?O:0),D=T.reduce((O,V)=>O+V,0),P=640/2,N=(a+h)/2,$=Math.max(10,(h-a)/2-6),F=-Math.PI/2;T.forEach((O,V)=>{if(!O||!D)return;let z=F+O/D*Math.PI*2,W=z-F>Math.PI?1:0,q=Z=>`${P+$*Math.cos(Z)},${N+$*Math.sin(Z)}`,K=O===D?`M${P-$},${N}a${$},${$} 0 1,0 ${2*$},0a${$},${$} 0 1,0 ${-2*$},0`:`M${P},${N}L${q(F)}A${$},${$} 0 ${W} 1 ${q(z)}Z`,U=j("path",{d:K,fill:pe(V)},"fg-chart-slice");He(U,`${s[V]}: ${t.format(O)} (${Math.round(O/D*1e3)/10}%)`),o.append(U),F=z}),e.type==="donut"&&o.append(j("circle",{cx:P,cy:N,r:$*.58,fill:"var(--fg-bg, #fff)"},"fg-chart-donut-hole")),o.append(l),i.replaceChildren(o);return}let f=e.type==="stackedBar",g=0,x=0;s.forEach((T,D)=>{let P=0,N=0;for(let $ of r){let F=$.values[D];F==null||!Number.isFinite(F)||(f?F>=0?P+=F:N+=F:(x=Math.max(x,F),g=Math.min(g,F)))}f&&(x=Math.max(x,P),g=Math.min(g,N))});let y=rn(g,x),p=y[0],v=y[y.length-1],m=56,w=624,R=T=>h-(T-p)/(v-p)*(h-a),k=j("g",{},"fg-chart-axis");for(let T of y){k.append(j("line",{x1:m,x2:w,y1:R(T),y2:R(T)},T===0?"fg-chart-zero":"fg-chart-grid"));let D=j("text",{x:m-6,y:R(T)+4,"text-anchor":"end"});D.textContent=n.format(T),k.append(D)}let L=(w-m)/Math.max(1,s.length),I=Math.max(1,Math.ceil(s.length/Math.floor((w-m)/56)));s.forEach((T,D)=>{if(D%I)return;let P=j("text",{x:m+L*(D+.5),y:h+16,"text-anchor":"middle"}),N=Math.max(3,Math.min(12,Math.floor(L*I/10)));P.textContent=T.length>N?`${T.slice(0,N-1)}\u2026`:T,k.append(P)}),o.append(k);let b=j("g",{},"fg-chart-plot"),M=e.type==="combo";if(M){let T=L*.6,D=r[0];s.forEach((P,N)=>{let $=D==null?void 0:D.values[N];if($==null||!Number.isFinite($))return;let F=m+L*N+(L-T)/2,O=j("rect",{x:F,y:Math.min(R(0),R($)),width:Math.max(1,T-2),height:Math.max(.5,Math.abs(R($)-R(0))),fill:pe(0),rx:2},"fg-chart-bar");He(O,`${D.name} \xB7 ${P}: ${t.format($)}`),b.append(O)})}if(e.type==="bar"||f){let T=L*.72,D=f?T:T/Math.max(1,r.length);s.forEach((P,N)=>{let $=0,F=0;r.forEach((O,V)=>{let z=O.values[N];if(z==null||!Number.isFinite(z))return;let W=0,q=z;f&&(W=z>=0?$:F,q=W+z,z>=0?$=q:F=q);let K=m+L*N+(L-T)/2+(f?0:D*V),U=j("rect",{x:K,y:Math.min(R(W),R(q)),width:Math.max(1,D-2),height:Math.max(.5,Math.abs(R(q)-R(W))),fill:pe(V),rx:2},"fg-chart-bar");He(U,`${O.name} \xB7 ${P}: ${t.format(z)}`),b.append(U)})})}else r.forEach((T,D)=>{if(M&&D===0)return;let P=T.values.map((F,O)=>F==null||!Number.isFinite(F)?null:[m+L*(O+.5),R(F),F]),N="",$=!1;for(let F of P){if(!F){$=!1;continue}N+=`${$?"L":"M"}${F[0]},${F[1]}`,$=!0}if(e.type==="area"){let F=P.filter(O=>!!O);if(F.length){let O=`M${F[0][0]},${R(0)}${F.map(V=>`L${V[0]},${V[1]}`).join("")}L${F[F.length-1][0]},${R(0)}Z`;b.append(j("path",{d:O,fill:pe(D),"fill-opacity":.18},"fg-chart-area"))}}b.append(j("path",{d:N,fill:"none",stroke:pe(D),"stroke-width":2.2,"stroke-linejoin":"round"},"fg-chart-line")),P.forEach((F,O)=>{if(!F)return;let V=j("circle",{cx:F[0],cy:F[1],r:3.5,fill:pe(D)},"fg-chart-point");He(V,`${T.name} \xB7 ${s[O]}: ${t.format(F[2])}`),b.append(V)})});o.append(b,l),i.replaceChildren(o)}function ci(i,e,t,n,o,r,s){var R,k,L,I;let a=(k=(R=t[0])==null?void 0:R.values)!=null?k:[],l=t.slice(1),d=b=>b!=null&&Number.isFinite(b),c=a.filter(d),u=l.flatMap(b=>b.values.filter(d));if(!c.length||!u.length)return;let h=rn(Math.min(...c),Math.max(...c)),f=rn(Math.min(...u),Math.max(...u)),g=56,x=624,y=b=>g+(b-h[0])/(h[h.length-1]-h[0])*(x-g),p=b=>o-(b-f[0])/(f[f.length-1]-f[0])*(o-n),v=j("g",{},"fg-chart-axis");for(let b of f){v.append(j("line",{x1:g,x2:x,y1:p(b),y2:p(b)},b===0?"fg-chart-zero":"fg-chart-grid"));let M=j("text",{x:g-6,y:p(b)+4,"text-anchor":"end"});M.textContent=s.format(b),v.append(M)}h.forEach((b,M)=>{let S=M===0?"start":M===h.length-1?"end":"middle",E=j("text",{x:y(b),y:o+16,"text-anchor":S});E.textContent=s.format(b),v.append(E)});let m=j("text",{x,y:o+32,"text-anchor":"end"},"fg-chart-axis-name");m.textContent=`${(I=(L=t[0])==null?void 0:L.name)!=null?I:""} \u2192`,v.append(m),i.append(v);let w=j("g",{},"fg-chart-plot");a.forEach((b,M)=>{d(b)&&l.forEach((S,E)=>{var P;let T=S.values[M];if(!d(T))return;let D=j("circle",{cx:y(b),cy:p(T),r:4,fill:pe(E),"fill-opacity":.8},"fg-chart-point");He(D,`${(P=e.categories[M])!=null?P:""}: ${t[0].name} ${r.format(b)}, ${S.name} ${r.format(T)}`),w.append(D)})}),i.append(w)}var ui=12,go=500,sn=["bar","stackedBar","line","area","combo","pie","donut","scatter"],Mt=class{constructor(e){this.grid=e;this.handles=new Set}create(e={}){var x,y;let{grid:t}=this,n=sn.includes(e.type)?e.type:"bar",o=()=>t.store.state.locale,r=(x=e.range)!=null?x:t.store.state.range,s=null;if(r){let p=t.columns.getColumn(r.start.colId),v=t.columns.getColumn(r.end.colId);if(p&&v){let m=Ae({start:{rowIndex:r.start.rowIndex,colIndex:p.index},end:{rowIndex:r.end.rowIndex,colIndex:v.index}}),w=[];for(let R=m.r1;R<=m.r2&&w.length<go;R++){let k=t.rowModel.getRow(R);k&&!k.kind&&w.push(k.data)}s={rows:w,colIds:t.columns.displayed().slice(m.c1,m.c2+1).filter(R=>!A(R.id)).map(R=>R.id)}}}let a=()=>{var I;let p=s?s.rows:t.rowModel.dataRows().slice(0,go).map(b=>b.data),v=(s?s.colIds.map(b=>t.columns.getColumn(b)):t.columns.displayed().filter(b=>!A(b.id))).filter(b=>!!b),m=v[0]&&v[0].def.type!=="number"?v[0]:s?null:(I=v.find(b=>b.def.type!=="number"))!=null?I:null,w=b=>!!b.node.parent&&b.node.parent.id==="pivotgroup|total",R=v.filter(b=>b!==m&&b.def.type==="number"&&(s||!w(b))).slice(0,ui),k=b=>{var S,E,T;let M=[];for(let D=b.node.parent;D;D=D.parent)M.unshift((S=D.def.header)!=null?S:D.id);return M.push((T=(E=b.def.header)!=null?E:b.def.field)!=null?T:b.id),M.join(" \xB7 ")},L=m?_(m.def,o().code):null;return{categories:p.map((b,M)=>m&&L?L(B(m.def,b)):String(M+1)),series:R.map(b=>({name:k(b),values:p.map(M=>{let S=B(b.def,M),E=typeof S=="number"?S:S==null||S===""?NaN:Number(S);return Number.isFinite(E)?E:null})}))}},l=C("div","fg-chart-body"),d=null,c=()=>kt(l,{type:n,title:e.title,locale:o().code,...a()}),u=p=>({bar:o().chartBar,stackedBar:o().chartStacked,line:o().chartLine,area:o().chartArea,pie:o().chartPie,donut:o().chartDonut,combo:o().chartCombo,scatter:o().chartScatter})[p],h=()=>d==null?void 0:d.querySelectorAll(".fg-chart-type").forEach(p=>p.setAttribute("aria-pressed",String(p.dataset.type===n)));if(e.container)e.container.append(l);else{d=C("div","fg-chart-panel",{role:"dialog","aria-label":(y=e.title)!=null?y:u(n)});let p=C("div","fg-chart-head");for(let m of sn){let w=C("button","fg-chart-type",{type:"button",title:u(m)});w.dataset.type=m,w.textContent=u(m),w.addEventListener("click",()=>g.setType(m)),p.append(w)}let v=C("button","fg-chooser-close",{type:"button","aria-label":o().close});v.textContent="\xD7",v.addEventListener("click",()=>g.destroy()),p.append(C("span","fg-chart-spacer"),v),d.append(p,l),t.renderer.root.append(d)}let f=[t.events.on("cellValueChanged",()=>c()),t.events.on("rowsAdded",()=>c()),t.events.on("rowsRemoved",()=>c())];s||f.push(t.events.on("sortChange",()=>c()),t.events.on("filterChange",()=>c()));let g={el:l,setType:p=>{sn.includes(p)&&(n=p,h(),c())},update:()=>c(),destroy:()=>{f.forEach(p=>p()),(d!=null?d:l).remove(),this.handles.delete(g)}};return this.handles.add(g),h(),c(),g}destroy(){for(let e of[...this.handles])e.destroy()}};function mo(i,e,t){return typeof i=="number"&&typeof e=="number"?i-e:i instanceof Date&&e instanceof Date?i.getTime()-e.getTime():typeof i=="boolean"&&typeof e=="boolean"?Number(i)-Number(e):t.compare(String(i),String(e))}function hi(i,e){var t,n;if(G(e))return null;if(i.type==="number"){let o=typeof e=="number"?e:Number(e);return Number.isNaN(o)?null:o}return i.type==="date"?(n=(t=se(e))==null?void 0:t.getTime())!=null?n:null:e}function be(i,e,t){let n=G(i),o=G(e);return n||o?n===o?0:n?1:-1:mo(i,e,t)}function vo(i,e,t,n){let o=e.map(a=>({def:t(a.colId),mul:a.dir==="desc"?-1:1})).filter(a=>!!a.def);if(!o.length)return i;let r=o.map(a=>i.map(l=>{let d=B(a.def,l.data);return a.def.comparator?d:hi(a.def,d)})),s=i.map((a,l)=>l);return s.sort((a,l)=>{var d;for(let c=0;c<o.length;c++){let{def:u,mul:h}=o[c],f=r[c][a],g=r[c][l],x;if(u.comparator)try{x=(Number(u.comparator(f,g,i[a].data,i[l].data))||0)*h}catch{H(`comparator of column "${(d=u.id)!=null?d:u.field}" threw; treating values as equal`),x=0}else{let y=G(f),p=G(g);x=y||p?y===p?0:y?1:-1:mo(f,g,n)*h}if(x)return x}return a-l}),s.map(a=>i[a])}var wo=new WeakMap,fi=i=>typeof i=="function"?"custom":i;function an(i,e){var t,n,o;return{rows:((t=i.rows)!=null?t:[]).filter(e),columns:((n=i.columns)!=null?n:[]).filter(e),values:((o=i.values)!=null?o:[]).filter(r=>r&&e(r.colId)).map(r=>{var s;return{colId:r.colId,aggFunc:(s=r.aggFunc)!=null?s:"sum"}}),totals:i.totals!==!1}}function yo(i,e,t,n,o){let r=an(e,m=>!!t(m)),s=new Intl.Collator(o,{numeric:!0,sensitivity:"base"}),a=m=>t(m),l=(m,w)=>m.map(R=>J(B(a(R),w))).join(""),d=new Map;for(let m of i){let w=l(r.columns,m);d.has(w)||d.set(w,r.columns.map(R=>B(a(R),m)))}let c=[...d.entries()].sort((m,w)=>{for(let R=0;R<r.columns.length;R++){let k=be(m[1][R],w[1][R],s);if(k)return k}return 0});r.columns.length||c.splice(0,c.length,["",[]]);let u=[],h=(m,w,R)=>{var S,E;let k=r.values[w],L=a(k.colId),I=`pivot|${R}|${w}`;u.push({id:I,comboKey:m,valueIndex:w});let b=T=>m===null||l(r.columns,T)===m,M=k.aggFunc;return{id:I,field:I,header:`${(E=(S=L.header)!=null?S:L.field)!=null?E:k.colId} (${n.agg(fi(M))})`,type:"number",format:M==="count"?"integer":L.format,width:130,aggFunc:(T,D)=>{let P=D.flatMap(N=>{var $;return($=wo.get(N))!=null?$:[]}).filter(b);return P.length?Re(M,P.map(N=>B(L,N)),P):null}}},f=[],g=(m,w)=>{if(G(w))return n.blank;let R=a(m);return R.type==="number"&&!R.format?String(w):_(R,o)(w)};if(!r.columns.length)r.values.forEach((m,w)=>f.push(h("",w,0)));else{let m=(w,R,k)=>{let L=[],I=0;for(;I<w.length;){let b=w[I][1][R],M=J(b),S=I;for(;S<w.length&&J(w[S][1][R])===M;)S++;let E=w.slice(I,S),T=R===r.columns.length-1?r.values.map((D,P)=>h(E[0][0],P,k+I)):m(E,R+1,k+I);L.push({id:`pivotgroup|${R}|${k+I}`,header:g(r.columns[R],b),children:T}),I=S}return L};f.push(...m(c,0,0)),r.totals&&r.values.length&&f.push({id:"pivotgroup|total",header:n.total,children:r.values.map((w,R)=>h(null,R,"total"))})}let x=new Map;for(let m of i){let w=l(r.rows,m),R=x.get(w);R||x.set(w,R={values:r.rows.map(k=>B(a(k),m)),src:[]}),R.src.push(m)}let p=[...x.values()].sort((m,w)=>{for(let R=0;R<r.rows.length;R++){let k=be(m.values[R],w.values[R],s);if(k)return k}return 0}).map(m=>{var k;let w={};r.rows.forEach((L,I)=>{var b;w[(b=a(L).field)!=null?b:L]=m.values[I]});let R=new Map;if(r.columns.length)for(let L of m.src){let I=l(r.columns,L),b=R.get(I);b||R.set(I,b=[]),b.push(L)}for(let L of u){let I=r.values[L.valueIndex],b=L.comboKey===null||!r.columns.length?m.src:(k=R.get(L.comboKey))!=null?k:[],M=a(I.colId);w[L.id]=b.length?Re(I.aggFunc,b.map(S=>B(M,S)),b):null}return wo.set(w,m.src),w});return{columns:[...r.rows.map(m=>{var R,k,L,I;let w=a(m);return{id:m,field:(R=w.field)!=null?R:m,header:(L=(k=w.header)!=null?k:w.field)!=null?L:m,type:w.type,format:w.format,width:(I=w.width)!=null?I:140}}),...f],rows:p,groupBy:r.rows.slice(0,-1)}}var Be="1.0.0";var pi={kty:"EC",crv:"P-256",x:"sUTKkglZmk-HMKPNub8p7AeLBKesHCU8irIkw9rJlbE",y:"j0U_aKRDR7iApY9UpaD3hUemhBLZJwDv9-QiT_hUyw8"},ln="https://freegrid.app/pricing/",bo="https://freegrid.app/api/usage",gi="https://freegrid.app/api/domain-status",xo=i=>{let e=atob(i.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-i.length%4)%4));return Uint8Array.from(e,t=>t.charCodeAt(0))};function cn(i){let e=i.toLowerCase().replace(/^\[|\]$/g,"");return!e||e==="localhost"||e==="127.0.0.1"||e==="::1"||e==="0.0.0.0"||e.endsWith(".localhost")||e.endsWith(".test")||e.endsWith(".local")||/^(10|192\.168|172\.(1[6-9]|2\d|3[01]))\./.test(e)}function mi(i,e){let t=i.toLowerCase().replace(/\.$/,"");return e.some(n=>{let o=n.toLowerCase().replace(/\.$/,""),r=o.startsWith("*."),s=r?o.slice(2):o;return s?t===s||t===`www.${s}`?!0:r&&t.endsWith(`.${s}`):!1})}var vi=i=>`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`;async function un(i,e,t={}){var s,a;let n=typeof i=="string"?i.trim().split("."):[];if(n.length!==3||n[0]!=="FG1")return{ok:!1,reason:"format"};let o;try{if(o=JSON.parse(new TextDecoder().decode(xo(n[1]))),!Array.isArray(o.domains)||typeof o.expires!="string")return{ok:!1,reason:"format"}}catch{return{ok:!1,reason:"format"}}let r=typeof crypto!="undefined"?crypto.subtle:void 0;if(!r)return{ok:!1,reason:"unsupported",info:o};try{let l=await r.importKey("jwk",(s=t.publicKey)!=null?s:pi,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]),d=new TextEncoder().encode(`${n[0]}.${n[1]}`);if(!await r.verify({name:"ECDSA",hash:"SHA-256"},l,xo(n[2]),d))return{ok:!1,reason:"signature",info:o}}catch{return{ok:!1,reason:"signature",info:o}}return vi((a=t.now)!=null?a:new Date)>o.expires?{ok:!1,reason:"expired",info:o}:mi(e,o.domains)?{ok:!0,info:o}:{ok:!1,reason:"domain",info:o}}var dn,Co=new Map,ze=null;function ko(i){dn=i}var Ro={missing:`FreeGrid is free for personal use. Company use needs a domain license (\u20A9200,000 per domain per year): ${ln}
16
- FreeGrid\uB294 \uAC1C\uC778\uC5D0\uAC8C \uBB34\uB8CC\uC785\uB2C8\uB2E4. \uD68C\uC0AC\uC5D0\uC11C \uC4F0\uB824\uBA74 \uB3C4\uBA54\uC778 \uB77C\uC774\uC120\uC2A4(\uB3C4\uBA54\uC778\uB2F9 \uC5F0 20\uB9CC \uC6D0)\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4: ${ln}`,format:"FreeGrid: the license key is not in the right format. / \uB77C\uC774\uC120\uC2A4 \uD0A4 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",signature:"FreeGrid: the license key could not be verified. / \uB77C\uC774\uC120\uC2A4 \uD0A4\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",expired:"FreeGrid: the license key has expired. / \uB77C\uC774\uC120\uC2A4 \uAE30\uAC04\uC774 \uB05D\uB0AC\uC2B5\uB2C8\uB2E4.",domain:"FreeGrid: the license key is for a different domain. / \uB2E4\uB978 \uB3C4\uBA54\uC778\uC6A9 \uB77C\uC774\uC120\uC2A4 \uD0A4\uC785\uB2C8\uB2E4."};function So(i,e=typeof location!="undefined"?location.hostname:""){try{if(cn(e)||typeof navigator=="undefined")return;let t=new Date().toISOString().slice(0,10),n=`${e}|${t}|${i.licensed?1:0}`,o=typeof localStorage!="undefined"?localStorage:null;if((o==null?void 0:o.getItem("freegrid:usage"))===n)return;o==null||o.setItem("freegrid:usage",n);let r=JSON.stringify({version:i.version,licensed:i.licensed,company:i.company,url:`${location.origin}${location.pathname}`});typeof navigator.sendBeacon=="function"?navigator.sendBeacon(bo,r):typeof fetch=="function"&&fetch(bo,{method:"POST",body:r,mode:"no-cors",keepalive:!0}).catch(()=>{})}catch{}}function wi(i=dn,e=typeof location!="undefined"?location.hostname:""){if(cn(e))return Promise.resolve(!0);let t=i!=null?i:dn,n=`${t!=null?t:""}@${e}`,o=Co.get(n);return o||(t?o=un(t,e).then(r=>{if(So({version:Be,licensed:r.ok,company:r.ok?r.info.company:void 0},e),r.ok||r.reason==="unsupported")return r.ok||r.reason==="unsupported";let s=r.info?` (${r.info.domains.join(", ")}, ${r.info.expires})`:"";return console.warn(`${Ro[r.reason]}${s}
17
- ${ln}`),!1},()=>!1):(console.info(Ro.missing),So({version:Be,licensed:!1},e),o=Promise.resolve(!1)),Co.set(n,o),o)}function yi(i=typeof location!="undefined"?location.hostname:""){var n;if(cn(i)||typeof fetch!="function")return Promise.resolve(!1);if(ze)return ze;let e=new Date().toISOString().slice(0,10),t=null;try{t=typeof localStorage!="undefined"?localStorage:null;let o=JSON.parse((n=t==null?void 0:t.getItem("freegrid:badge"))!=null?n:"null");if(o&&o.host===i&&o.day===e)return ze=Promise.resolve(o.show)}catch{}return ze=fetch(gi,{mode:"cors",credentials:"omit"}).then(o=>o.ok?o.json():{badge:!1}).then(o=>{let r=o.badge===!0;try{t==null||t.setItem("freegrid:badge",JSON.stringify({host:i,day:e,show:r}))}catch{}return r},()=>!1),ze}async function Mo(i,e=typeof location!="undefined"?location.hostname:""){return await wi(i,e)?!1:yi(e)}var Ge={text:["contains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["eq","ne","lt","lte","gt","gte","between","blank","notBlank"],date:["equals","before","after","between","blank","notBlank"]},Eo=["blank","notBlank"],hn=500,Et=class{constructor(e){this.grid=e;this.popup=null;this.colId=null;this.off=[]}get openColumn(){return this.colId}toggle(e,t){this.colId===e?this.close():this.open(e,t)}open(e,t){var x;this.close();let n=this.grid.columns.getNode(e);if(!n||n.children||A(e))return;let o=this.grid.store.state.locale,r=n.def,s=C("div",`fg-menu fg-theme-${this.grid.store.state.theme}`,{role:"dialog","aria-label":o.columnMenu});this.grid.applyFontTo(s),ve(r)&&s.append(this.section([[o.sortAsc,()=>this.grid.setSort([{colId:e,dir:"asc"}])],[o.sortDesc,()=>this.grid.setSort([{colId:e,dir:"desc"}])],[o.clearSort,()=>this.grid.setSort(this.grid.store.state.sort.filter(y=>y.colId!==e))]])),s.append(this.section([[o.pinLeft,()=>this.grid.setPinned(e,"left")],[o.pinRight,()=>this.grid.setPinned(e,"right")],[o.unpin,()=>this.grid.setPinned(e,null)]]));let a=this.grid.getGroupBy();if(!this.grid.options.treeData&&(this.grid.options.groupPanel||a.length)){let y=a.includes(e)?[[o.ungroup,()=>this.grid.setGroupBy(a.filter(p=>p!==e))]]:[[o.groupByThis,()=>this.grid.setGroupBy([...a,e])]];a.length&&y.push([o.expandAll,()=>this.grid.expandAll(!0)],[o.collapseAll,()=>this.grid.expandAll(!1)]),s.append(this.section(y))}let l=[[o.autosizeThis,()=>this.grid.autoSize([e])],[o.autosizeAll,()=>this.grid.autoSize()]];r.lockVisible||l.push([o.hideColumn,()=>this.grid.setColumnsVisible([e],!1)]),l.push([o.chooseColumns,()=>this.grid.chooser.open()],[o.resetColumns,()=>this.grid.resetColumns()]),s.append(this.section(l));let d=this.filterSection(e,()=>this.close());d&&s.append(d),oe(this.grid.renderer.root).append(s);let c=t.getBoundingClientRect(),u=s.offsetWidth||248;s.style.left=`${Math.max(4,Math.min(c.right-u,window.innerWidth-u-4))}px`;let h=Math.max(4,Math.min(c.bottom+4,window.innerHeight-240));s.style.top=`${h}px`,s.style.maxHeight=`${Math.max(160,window.innerHeight-h-8)}px`,this.popup=s,this.colId=e;let f=y=>{fe(y,s,t)||this.close()},g=y=>{y.key==="Escape"&&(this.close(),this.grid.renderer.gridEl.focus())};document.addEventListener("pointerdown",f,!0),document.addEventListener("keydown",g,!0),this.off.push(()=>document.removeEventListener("pointerdown",f,!0),()=>document.removeEventListener("keydown",g,!0)),(x=s.querySelector(".fg-filter-value:not([hidden]), .fg-set-search, .fg-menu-item"))==null||x.focus()}filterSection(e,t){let n=this.grid.columns.getNode(e);if(!n||n.children)return null;let o=this.grid.store.state.locale,r=re(n.def);return r==="set"?this.setFilter(e,o,t):r?this.conditionFilter(e,r,o,t):null}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null,this.colId=null}section(e){let t=C("div","fg-menu-section");for(let[n,o]of e){let r=C("button","fg-menu-item",{type:"button"});r.textContent=n,r.addEventListener("click",()=>{o(),this.close()}),t.append(r)}return t}actions(e,t,n,o){let r=C("div","fg-menu-actions"),s=C("button","fg-btn",{type:"button"});s.textContent=t.reset,s.addEventListener("click",()=>{this.grid.setFilter(e,null),o()});let a=C("button","fg-btn fg-btn-primary",{type:"button"});return a.textContent=t.apply,a.addEventListener("click",n),r.append(s,a),r}title(e){let t=C("div","fg-menu-title");return t.textContent=e.filter,t}conditionRow(e,t,n,o,r){var f;let s=C("div","fg-filter-cond"),a=C("select","fg-filter-op",{"aria-label":t.filter});if(o){let g=C("option");g.value="",g.textContent="\u2014",a.append(g)}for(let g of Ge[e]){let x=C("option");x.value=g,x.textContent=t.ops[g],a.append(x)}a.value=(f=n==null?void 0:n.op)!=null?f:o?"":Ge[e][0];let l=e==="text"?"text":e,d=C("input","fg-input fg-filter-value",{type:l,placeholder:t.value,"aria-label":t.value}),c=C("input","fg-input fg-filter-value-to",{type:l,placeholder:t.valueTo,"aria-label":t.valueTo});n&&(d.value=n.value!=null?String(n.value):"",c.value="valueTo"in n&&n.valueTo!=null?String(n.valueTo):"");let u=()=>{d.hidden=!a.value||Eo.includes(a.value),c.hidden=a.value!=="between"};a.addEventListener("change",u),u();for(let g of[d,c])g.addEventListener("keydown",x=>x.key==="Enter"&&r());return s.append(a,d,c),{row:s,read:()=>{let g=a.value;if(!g)return null;let x=!Eo.includes(g);if(e==="number"){let y=d.value===""?void 0:Number(d.value),p=c.value===""?void 0:Number(c.value);return!x||y!==void 0?{type:e,op:g,value:y,valueTo:p}:null}return e==="date"?!x||d.value?{type:e,op:g,value:d.value||void 0,valueTo:c.value||void 0}:null:!x||d.value?{type:e,op:g,value:d.value}:null}}}conditionFilter(e,t,n,o){var x,y;let r=this.grid.store.state.filters[e],s=(r==null?void 0:r.type)==="combined"?r.conditions:r?[r]:[],a=((x=s[0])==null?void 0:x.type)===t?s[0]:void 0,l=((y=s[1])==null?void 0:y.type)===t?s[1]:void 0,d=C("div","fg-menu-section fg-filter"),c=()=>{var R;let p=u.read(),v=h.read(),m=((R=f.querySelector("input:checked"))==null?void 0:R.value)==="or"?"or":"and",w=p&&v?{type:"combined",operator:m,conditions:[p,v]}:p!=null?p:v;this.grid.setFilter(e,w),o()},u=this.conditionRow(t,n,a,!1,c),h=this.conditionRow(t,n,l,!0,c),f=C("div","fg-filter-join",{role:"radiogroup"}),g=`fg-join-${e}-${Math.random().toString(36).slice(2,7)}`;for(let p of["and","or"]){let v=C("label"),m=C("input","",{type:"radio",name:g,value:p});m.checked=((r==null?void 0:r.type)==="combined"?r.operator:"and")===p,v.append(m,` ${n[p]}`),f.append(v)}return d.append(this.title(n),u.row,f,h.row,this.actions(e,n,c,o)),d}setFilter(e,t,n){let{grid:o}=this,r=o.columns.getNode(e).def,s=_(r,t.code),a=o.collator(),l=new Map;for(let k of o.rowModel.allNodes()){let L=B(r,k.data),I=J(L);l.has(I)||l.set(I,L)}let d=[...l.entries()].sort((k,L)=>be(k[1],L[1],a)),c=o.store.state.filters[e],u=new Set((c==null?void 0:c.type)==="set"?c.values.map(J).filter(k=>l.has(k)):l.keys()),h=(k,L)=>k===""?t.blanks:s(L),f=C("div","fg-menu-section fg-filter fg-set-filter"),g=C("input","fg-input fg-set-search",{type:"search",placeholder:t.search,"aria-label":t.search}),x=C("label","fg-set-item fg-set-all"),y=C("input","fg-checkbox",{type:"checkbox"});x.append(y,document.createTextNode(t.selectAll));let p=C("div","fg-set-list"),v=()=>{let k=g.value.trim().toLowerCase();return k?d.filter(([L,I])=>h(L,I).toLowerCase().includes(k)):d},m=()=>{let k=v(),L=k.filter(([I])=>u.has(I)).length;y.checked=L>0&&L===k.length,y.indeterminate=L>0&&L<k.length},w=()=>{let k=v();if(p.replaceChildren(...k.slice(0,hn).map(([L,I])=>{let b=C("label","fg-set-item"),M=C("input","fg-checkbox",{type:"checkbox"});return M.checked=u.has(L),M.addEventListener("change",()=>{M.checked?u.add(L):u.delete(L),m()}),b.append(M,document.createTextNode(h(L,I))),b})),k.length>hn){let L=C("div","fg-set-more");L.textContent=`\u2026 +${k.length-hn}`,p.append(L)}m()};y.addEventListener("change",()=>{for(let[k]of v())y.checked?u.add(k):u.delete(k);w()}),g.addEventListener("input",w);let R=()=>{o.setFilter(e,u.size===l.size?null:{type:"set",values:d.filter(([k])=>u.has(k)).map(([,k])=>k)}),n()};return g.addEventListener("keydown",k=>k.key==="Enter"&&R()),w(),f.append(this.title(t),g,x,p,this.actions(e,t,R,n)),f}};var Lo=new WeakMap,bi=0;function xe(i){let e=Lo.get(i);return e||Lo.set(i,e=`r${++bi}`),e}var Lt=class{constructor(e){this.deps=e;this.stats={filterRuns:0,sortRuns:0};this.server=!1;this.full=[];this.last={};this.nodes=[];this.filtered=[];this.sorted=[];this.display=[];this.indexById=null;this.layoutCache=null}update(e){var u,h,f,g;let t=this.deps.collator(),n=e.display,o=!!(n!=null&&n.getParentId)!=!!((u=this.last.display)!=null&&u.getParentId),r=e.data!==this.last.data,s=r||o||e.filters!==this.last.filters||e.quickFilter!==this.last.quickFilter||e.advancedFilter!==this.last.advancedFilter,a=s||e.sort!==this.last.sort||t!==this.last.collator,l=a||(n==null?void 0:n.version)!==this.last.displayVersion||(n==null?void 0:n.groupBy)!==((h=this.last.display)==null?void 0:h.groupBy);if(r){let x=this.deps.getRowId;this.nodes=e.data.map((y,p)=>({id:x?String(x(y)):xe(y),data:y,sourceIndex:p}))}s&&(this.filtered=this.filter(e),this.stats.filterRuns++),a&&(this.sorted=vo(this.filtered,e.sort,x=>this.deps.columnDef(x),t),this.stats.sortRuns++),l&&(this.full=n?this.buildDisplay(n,e.sort,t):this.sorted);let d=(f=e.page)!=null?f:null,c=(g=this.last.page)!=null?g:null;(l||(d==null?void 0:d.index)!==(c==null?void 0:c.index)||(d==null?void 0:d.size)!==(c==null?void 0:c.size))&&(this.display=d?this.full.slice(d.index*d.size,(d.index+1)*d.size):this.full,this.indexById=null,this.layoutCache=null),this.last={...e,collator:t,displayVersion:n==null?void 0:n.version}}invalidate(){this.last={}}fullCount(){return this.full.length}dataCount(){return this.sorted.length}loading(){return!1}getRowCount(){return this.display.length}getRow(e){return this.display[e]}rows(){return this.display}dataRows(){return this.sorted}allNodes(){return this.nodes}idOf(e){return this.deps.getRowId?String(this.deps.getRowId(e)):xe(e)}indexOfId(e){var t;return this.indexById||(this.indexById=new Map(this.display.map((n,o)=>[n.id,o]))),(t=this.indexById.get(e))!=null?t:-1}layout(e,t,n,o=0,r){var u;let s=this.layoutCache;if(s&&s.rows===this.display&&s.rh===e&&s.dh===t&&s.hv===o)return s;let a=this.display.length,l=new Float64Array(a+1),d=!0,c=n&&n.size?n:null;for(let h=0;h<a;h++){let f=this.display[h],g=e;if(f.kind==="detail")g=t;else if(!f.kind){c&&(g=(u=c.get(f.id))!=null?u:e);let x=r==null?void 0:r(f.data);typeof x=="number"&&x>0&&(g=c?Math.max(g,x):x)}g!==e&&(d=!1),l[h+1]=l[h]+g}return this.layoutCache={rows:this.display,rh:e,dh:t,hv:o,offsets:l,uniform:d},this.layoutCache}filter(e){var c;let t=Object.entries(e.filters).map(([u,h])=>({def:this.deps.columnDef(u),pred:Je(h)})).filter(u=>!!u.def),n=Vn(e.quickFilter),o=n.length?this.deps.quickColumns():[],r=e.advancedFilter?Ot(e.advancedFilter,u=>this.deps.columnDef(u),B):null;if(!t.length&&!n.length&&!r)return this.nodes;let s=this.nodes.filter(u=>{for(let h of t)if(!h.pred(B(h.def,u.data)))return!1;if(r&&!r(u.data))return!1;if(n.length){let h=o.map(f=>this.deps.format(f,B(f,u.data))).join("").toLowerCase();if(!qn(n,h))return!1}return!0}),a=(c=e.display)==null?void 0:c.getParentId;if(!a)return s;let l=new Map(this.nodes.map(u=>[u.id,u])),d=new Set(s);for(let u of s){let h=a(u.data),f=new Set;for(;h!=null&&!f.has(h);){f.add(h);let g=l.get(String(h));if(!g)break;d.add(g),h=a(g.data)}}return this.nodes.filter(u=>d.has(u))}isOpen(e,t,n){let o=e.expanded.get(t);return o!==void 0?o:e.defaultExpanded===-1||n<e.defaultExpanded}withDetails(e,t,n){for(let o of t)n.push(o),e.detailOpen.has(o.id)&&(!e.isMaster||e.isMaster(o.data))&&n.push({id:`detail:${o.id}`,data:{},sourceIndex:-1,kind:"detail",detailOf:o})}buildDisplay(e,t,n){let o=[];if(e.getParentId)return this.buildTree(e,o),o;let r=e.groupBy.filter(a=>this.deps.columnDef(a));if(!r.length)return e.detailOpen.size?(this.withDetails(e,this.sorted,o),o):this.sorted;let s=(a,l,d)=>{var x;let c=r[l],u=this.deps.columnDef(c),h=new Map;for(let y of a){let p=B(u,y.data),v=G(p)?"":J(p),m=h.get(v);m||h.set(v,m={value:p,nodes:[]}),m.nodes.push(y)}let f=((x=t.find(y=>y.colId===c))==null?void 0:x.dir)==="desc"?-1:1,g=[...h.entries()].sort((y,p)=>be(y[1].value,p[1].value,n)*f);for(let[y,p]of g){let v=`${d}${c}:${y}`,m=this.isOpen(e,v,l);o.push({id:`group:${v}`,data:{},sourceIndex:-1,kind:"group",level:l,group:{key:v,colId:c,value:p.value,rows:p.nodes.map(w=>w.data),expanded:m}}),m&&(l+1<r.length?s(p.nodes,l+1,`${v}|`):this.withDetails(e,p.nodes.map(w=>({...w,level:l+1})),o))}};return s(this.sorted,0,""),o}buildTree(e,t){let n=new Set(this.sorted.map(a=>a.id)),o=new Map,r=[];for(let a of this.sorted){let l=e.getParentId(a.data),d=l==null?null:String(l);if(d!==null&&n.has(d)&&d!==a.id){let c=o.get(d);c||o.set(d,c=[]),c.push(a)}else r.push(a)}let s=(a,l,d)=>{var c,u,h;for(let f of a){if(d.has(f.id))continue;let g=(c=o.get(f.id))!=null?c:[],x=!g.length&&!!((u=e.lazyChildren)!=null&&u.call(e,f.id,f.data)),y=g.length>0&&this.isOpen(e,f.id,l),p={...f,level:l,hasChildren:g.length>0||x,expanded:y};x&&((h=e.loading)!=null&&h.has(f.id))&&(p.loading=!0),this.withDetails(e,[p],t),y&&s(g,l+1,new Set([...d,f.id]))}};s(r,0,new Set)}};var xi=1e4,Tt=class{constructor(e,t,n,o,r){this.datasource=e;this.getRowId=t;this.groupBy=n;this.query=o;this.onChange=r;this.levels=new Map;this.gen=0;this.display=null;this.ids=null;this.version=0;this.builtFor=-1}matches(e,t){return e.join("")===this.groupBy.join("")&&t.sort===this.query.sort&&t.filters===this.query.filters&&t.quickFilter===this.query.quickFilter&&t.advancedFilter===this.query.advancedFilter}purge(){this.gen++,this.levels.clear(),this.touch()}touch(){this.version++,this.display=null,this.ids=null}load(e,t,n){if(this.levels.has(e))return;let o=this.gen;this.levels.set(e,{state:"loading",nodes:[]});let r=n>=this.groupBy.length,s=this.query,a;try{a=Promise.resolve(this.datasource.getRows({start:0,end:xi,sort:[...s.sort],filters:{...s.filters},quickFilter:s.quickFilter,advancedFilter:s.advancedFilter,groupBy:[...this.groupBy],groupKeys:[...t]}))}catch(l){a=Promise.reject(l)}a.then(l=>{if(o!==this.gen)return;let d=Array.isArray(l==null?void 0:l.rows)?l.rows.filter(u=>u!==null&&typeof u=="object"):[];Array.isArray(l==null?void 0:l.rows)||H("datasource.getRows must resolve to { rows: Row[] }");let c=r?d.map((u,h)=>({id:this.getRowId?String(this.getRowId(u)):xe(u),data:u,sourceIndex:h,level:n})):d.map(u=>{let h=this.groupBy[n],f=u[h],g=`${e?`${e}|`:""}${h}:${J(f)}`,x=typeof u.count=="number"?u.count:typeof u.childCount=="number"?u.childCount:void 0;return{id:`group:${g}`,data:{},sourceIndex:-1,kind:"group",level:n,group:{key:g,colId:h,value:f,rows:[],expanded:!1,count:x,aggregates:u,keys:[...t,f]}}});this.levels.set(e,{state:"loaded",nodes:c}),this.touch(),this.onChange()},()=>{o===this.gen&&(this.levels.set(e,{state:"failed",nodes:[]}),this.touch(),this.onChange())})}isOpen(e,t,n){let o=e.expanded.get(t);return o!==void 0?o:e.defaultExpanded===-1||n<e.defaultExpanded}rows(e,t){if(this.display&&this.builtFor===t)return this.display;let n=[],o=(r,s,a)=>{var d;let l=this.levels.get(r);if(!l){this.load(r,s,a),n.push({id:`loading:${r}`,data:{},sourceIndex:-1,kind:"loading",level:a});return}if(l.state!=="loaded"){l.state==="loading"&&n.push({id:`loading:${r}`,data:{},sourceIndex:-1,kind:"loading",level:a});return}for(let c of l.nodes){if(c.kind!=="group"){n.push(c);continue}let u=c.group,h=this.isOpen(e,u.key,a),f={...c,group:{...u,expanded:h}};n.push(f),h&&o(u.key,(d=u.keys)!=null?d:[],a+1)}};return o("",[],0),this.display=n,this.builtFor=t,this.ids=null,n}dataRows(){let e=[];for(let t of this.levels.values())for(let n of t.nodes)n.kind||e.push(n);return e}dataCount(){let e=this.levels.get("");return(e==null?void 0:e.state)==="loaded"&&e.nodes.every(t=>{var n;return typeof((n=t.group)==null?void 0:n.count)=="number"})?e.nodes.reduce((t,n)=>{var o,r;return t+((r=(o=n.group)==null?void 0:o.count)!=null?r:0)},0):this.dataRows().length}loading(){for(let e of this.levels.values())if(e.state==="loading")return!0;return!1}indexOf(e){var t;return this.display?(this.ids||(this.ids=new Map,this.display.forEach((n,o)=>this.ids.set(n.id,o))),(t=this.ids.get(e))!=null?t:-1):-1}};var Ci=3e3,Ri=new Float64Array(0),Ve=class{constructor(e){this.deps=e;this.stats={filterRuns:0,sortRuns:0};this.server=!0;this.blocks=new Map;this.total=null;this.loadedEnd=0;this.gen=0;this.query=null;this.page=null;this.lastBlock=0;this.version=0;this.cache=null;this.groups=null;this.displayIn=null}get bs(){return this.page?this.page.size:this.deps.blockSize}get base(){return this.page?this.page.index*this.page.size:0}update(e){var a,l,d,c,u,h,f,g,x,y,p;let t=(l=(a=e.display)==null?void 0:a.groupBy)!=null?l:[];if(t.length&&!((d=e.display)!=null&&d.getParentId)){let v={sort:e.sort,filters:e.filters,quickFilter:e.quickFilter,advancedFilter:(c=e.advancedFilter)!=null?c:null};(!this.groups||!this.groups.matches(t,v))&&(this.groups=new Tt(this.deps.datasource,this.deps.getRowId,[...t],v,()=>this.deps.onLoaded(0,0,null)),this.touch()),this.displayIn=(u=e.display)!=null?u:null,this.query=null;return}this.groups&&(this.groups=null,this.query=null,this.touch());let n=this.query,o=!n||n.sort!==e.sort||n.filters!==e.filters||n.quickFilter!==e.quickFilter||n.advancedFilter!==((h=e.advancedFilter)!=null?h:null),r=(f=e.page)!=null?f:null,s=((g=r==null?void 0:r.size)!=null?g:0)!==((y=(x=this.page)==null?void 0:x.size)!=null?y:0);this.query={sort:e.sort,filters:e.filters,quickFilter:e.quickFilter,advancedFilter:(p=e.advancedFilter)!=null?p:null},this.page=r?{...r}:null,(o||s)&&this.purge(),this.ensure(Math.floor(this.base/this.bs))}invalidate(){}purge(){if(this.groups){this.groups.purge();return}this.gen++,this.blocks.clear(),this.total=null,this.loadedEnd=0,this.touch(),this.query&&this.ensure(Math.floor(this.base/this.bs))}touch(){this.version++,this.cache=null}fullCount(){if(this.total!==null)return this.total;if(!this.loadedEnd)return 0;let e=this.blocks.get(Math.floor((this.loadedEnd-1)/this.bs));return this.loadedEnd+(e&&e.nodes.length<this.bs?0:this.bs)}getRowCount(){if(this.groups)return this.groupRows().length;let e=this.fullCount();return this.page?Math.max(0,Math.min(this.page.size,e-this.base)):e}dataCount(){return this.groups?this.groups.dataCount():this.fullCount()}loading(){if(this.groups)return this.groups.loading();for(let e of this.blocks.values())if(e.state==="loading")return!0;return!1}placeholder(e){return{id:`loading:${e}`,data:{},sourceIndex:-1,kind:"loading"}}peek(e){var o;let t=Math.floor(e/this.bs),n=this.blocks.get(t);return(n==null?void 0:n.state)==="loaded"&&(o=n.nodes[e-t*this.bs])!=null?o:null}groupRows(){return this.groups.rows(this.displayIn,this.displayIn.version*1e6+this.groups.version)}getRow(e){if(this.groups)return this.groupRows()[e];let t=this.base+e,n=this.peek(t);return n||(e>=0&&e<this.getRowCount()&&this.ensure(Math.floor(t/this.bs)),this.placeholder(t))}ensure(e){var d;let t=this.blocks.get(e);if(t&&(t.state!=="failed"||Date.now()<((d=t.retryAt)!=null?d:0))||this.total!==null&&e*this.bs>=this.total&&e>0)return;let n=e*this.bs,o=n+this.bs,r=this.gen;this.lastBlock=e,this.blocks.set(e,{state:"loading",nodes:[]});let s=this.query,a=c=>{r===this.gen&&(this.blocks.set(e,{state:"failed",nodes:[],retryAt:Date.now()+Ci}),this.deps.onFailed(n,o,c))},l;try{l=Promise.resolve(this.deps.datasource.getRows({start:n,end:o,sort:[...s.sort],filters:{...s.filters},quickFilter:s.quickFilter,advancedFilter:s.advancedFilter}))}catch(c){l=Promise.reject(c)}l.then(c=>{if(r!==this.gen)return;let u=Array.isArray(c==null?void 0:c.rows)?c.rows.filter(g=>g!==null&&typeof g=="object"):null;if(!u){H("datasource.getRows must resolve to { rows: Row[], total?: number }"),a(new Error("invalid datasource response"));return}let h=this.deps.getRowId,f=u.slice(0,this.bs).map((g,x)=>({id:h?String(h(g)):xe(g),data:g,sourceIndex:n+x}));this.blocks.set(e,{state:"loaded",nodes:f}),typeof c.total=="number"&&c.total>=0?this.total=c.total:f.length<this.bs&&(this.total=n+f.length),this.loadedEnd=Math.max(this.loadedEnd,n+f.length),this.evict(),this.touch(),this.deps.onLoaded(n,n+f.length,this.total)},a)}evict(){let e=Math.max(2,this.deps.maxBlocks);if(this.blocks.size<=e)return;let t=[...this.blocks.keys()].sort((n,o)=>Math.abs(o-this.lastBlock)-Math.abs(n-this.lastBlock));for(let n of t){if(this.blocks.size<=e)break;this.blocks.get(n).state!=="loading"&&this.blocks.delete(n)}}built(){var n;if(((n=this.cache)==null?void 0:n.ver)===this.version)return this.cache;let e=[];for(let o of[...this.blocks.keys()].sort((r,s)=>r-s)){let r=this.blocks.get(o);r.state==="loaded"&&e.push(...r.nodes)}let t=new Map;for(let o of e)t.set(o.id,o.sourceIndex);return this.cache={ver:this.version,data:e,rows:null,ids:t},this.cache}rows(){var t;if(this.groups)return this.groupRows();let e=this.built();if(!e.rows){let n=this.getRowCount();e.rows=new Array(n);for(let o=0;o<n;o++)e.rows[o]=(t=this.peek(this.base+o))!=null?t:this.placeholder(this.base+o)}return e.rows}dataRows(){return this.groups?this.groups.dataRows():this.built().data}allNodes(){return this.groups?this.groups.dataRows():this.built().data}idOf(e){return this.deps.getRowId?String(this.deps.getRowId(e)):xe(e)}indexOfId(e){if(this.groups)return this.groupRows(),this.groups.indexOf(e);let t=this.built().ids.get(e);if(t===void 0)return-1;let n=t-this.base;return n>=0&&n<this.getRowCount()?n:-1}layout(){return{offsets:Ri,uniform:!0}}};function To(i){let e=i.idAt(i.index);if(i.mode==="single"){let t=new Set;return i.toggle&&i.selected.has(e)||t.add(e),{selected:t,anchorIndex:i.index}}if(i.range&&i.anchorIndex!=null){let t=i.toggle?new Set(i.selected):new Set,n=Math.min(i.anchorIndex,i.index),o=Math.max(i.anchorIndex,i.index);for(let r=n;r<=o;r++)t.add(i.idAt(r));return{selected:t,anchorIndex:i.anchorIndex}}if(i.toggle){let t=new Set(i.selected);return t.has(e)?t.delete(e):t.add(e),{selected:t,anchorIndex:i.index}}return{selected:new Set([e]),anchorIndex:i.index}}var It=class{constructor(e){this.bus=new Se;this.current=e}get state(){return this.current}set(e){let t=Object.keys(e).filter(n=>e[n]!==this.current[n]);t.length&&(this.current={...this.current,...e},this.bus.emit("change",t))}};var Si=500;function Io(i){let e=i.renderer.root,t=0,n=null,o=null,r=()=>{clearTimeout(t),n==null||n.remove(),n=null,o=null},s=c=>{var m;let u=c.dataset.col;if(!u||A(u))return null;let h=i.columns.getNode(u);if(!h)return null;if(c.classList.contains("fg-header-cell"))return(m=h.def.headerTooltip)!=null?m:null;let f=c.closest(".fg-row[data-row]");if(!f||!c.closest(".fg-body"))return null;let g=Number(f.dataset.row),x=i.rowModel.getRow(g);if(!x||x.kind)return null;let y=h.def,p=B(y,x.data),v=_(y,i.store.state.locale.code)(p);if(typeof y.tooltip=="function")try{let w=y.tooltip({value:p,formatted:v,row:x.data,rowIndex:g,column:y});return w?String(w):null}catch{return H(`tooltip of column "${u}" threw`),null}return y.tooltip===!0?v||null:i.options.overflowTooltip!==!1&&y.tooltip!==!1&&c.scrollWidth>c.clientWidth+1&&c.textContent||null},a=(c,u)=>{n==null||n.remove(),n=C("div",`fg-tooltip fg-theme-${i.store.state.theme}`,{role:"tooltip"}),n.textContent=u,i.applyFontTo(n),oe(e).append(n);let h=c.getBoundingClientRect(),f=n.offsetWidth,g=n.offsetHeight,x=window.innerWidth||1024,y=window.innerHeight||768,p=h.bottom+6+g>y?h.top-g-6:h.bottom+6;n.style.left=`${Math.max(4,Math.min(x-f-4,h.left))}px`,n.style.top=`${Math.max(4,p)}px`},l=c=>{var h,f;let u=(f=(h=c.target).closest)==null?void 0:f.call(h,".fg-cell, .fg-header-cell");!u||u===o||!e.contains(u)||(r(),o=u,t=window.setTimeout(()=>{if(o!==u||!u.isConnected)return;let g=s(u);g&&a(u,g)},Si))},d=c=>{let u=c.relatedTarget;o&&u&&o.contains(u)||r()};return e.addEventListener("pointerover",l),e.addEventListener("pointerout",d),e.addEventListener("pointerdown",r),e.addEventListener("keydown",r),e.addEventListener("wheel",r,{passive:!0}),()=>{r(),e.removeEventListener("pointerover",l),e.removeEventListener("pointerout",d),e.removeEventListener("pointerdown",r),e.removeEventListener("keydown",r),e.removeEventListener("wheel",r)}}var Do=["blank","notBlank"],Dt=class{constructor(e){this.grid=e;this.popup=null;this.off=[]}get isOpen(){return!!this.popup}columns(){return this.grid.columns.getState().map(e=>this.grid.columns.getNode(e.colId)).filter(e=>e&&!e.children&&!A(e.id)&&re(e.def)).map(e=>{var o,r;let t=re(e.def),n=t==="number"?"number":t==="date"?"date":"text";return{id:e.id,label:(r=(o=e.def.header)!=null?o:e.def.field)!=null?r:e.id,kind:n}})}open(){var b,M;this.close();let{grid:e}=this,t=e.store.state.locale,n=this.columns(),o=C("div",`fg-menu fg-filter-builder fg-theme-${e.store.state.theme}`,{role:"dialog","aria-label":t.advancedFilter});e.applyFontTo(o);let r=C("div","fg-chooser-head"),s=C("span","fg-menu-title");s.textContent=t.advancedFilter;let a=C("button","fg-chooser-close",{type:"button","aria-label":t.close});a.textContent="\xD7",a.addEventListener("click",()=>this.close()),r.append(s,a);let l=e.store.state.advancedFilter,d=C("div","fg-filter-join",{role:"radiogroup"}),c=`fg-fb-join-${Math.random().toString(36).slice(2,7)}`;for(let S of["and","or"]){let E=C("label"),T=C("input","",{type:"radio",name:c,value:S});T.checked=((b=l==null?void 0:l.operator)!=null?b:"and")===S,E.append(T,` ${t[S]}`),d.append(E)}let u=C("div","fg-fb-list"),h=[],f=S=>{h.splice(h.indexOf(S),1),S.el.remove()},g=S=>{let E=C("div","fg-fb-row"),T=C("select","fg-filter-op fg-fb-col",{"aria-label":t.columns});for(let q of n){let K=C("option");K.value=q.id,K.textContent=q.label,T.append(K)}let D=C("select","fg-filter-op fg-fb-op",{"aria-label":t.filter}),P=C("input","fg-input fg-fb-value",{type:"text",placeholder:t.value,"aria-label":t.value}),N=C("input","fg-input fg-fb-value-to",{type:"text",placeholder:t.valueTo,"aria-label":t.valueTo}),$=C("button","fg-chooser-close fg-fb-remove",{type:"button","aria-label":t.close});$.textContent="\xD7";let F=()=>{var q,K;return(K=(q=n.find(U=>U.id===T.value))==null?void 0:q.kind)!=null?K:"text"},O=q=>{let K=F();D.replaceChildren(...Ge[K].map(Z=>{let Q=C("option");return Q.value=Z,Q.textContent=t.ops[Z],Q})),q&&Ge[K].includes(q)&&(D.value=q);let U=K==="text"?"text":K;P.type=N.type=U,V()},V=()=>{P.hidden=Do.includes(D.value),N.hidden=D.value!=="between"};T.addEventListener("change",()=>O(D.value)),D.addEventListener("change",V),S&&n.some(q=>q.id===S.colId)&&(T.value=S.colId);let z=S==null?void 0:S.model;O(z==null?void 0:z.op),(z==null?void 0:z.value)!=null&&(P.value=String(z.value)),(z==null?void 0:z.valueTo)!=null&&(N.value=String(z.valueTo)),E.append(T,D,P,N,$);let W={el:E,read:()=>{let q=F(),K=D.value,U=!Do.includes(K),Z=null;if(q==="number"){let Q=P.value===""?void 0:Number(P.value),qe=N.value===""?void 0:Number(N.value);(!U||Q!==void 0&&!Number.isNaN(Q))&&(Z=K==="between"?{type:"number",op:K,value:Q,valueTo:qe}:{type:"number",op:K,value:Q})}else q==="date"?(!U||P.value)&&(Z=K==="between"?{type:"date",op:K,value:P.value,valueTo:N.value}:{type:"date",op:K,value:P.value||void 0}):(!U||P.value)&&(Z={type:"text",op:K,value:P.value});return Z?{colId:T.value,model:Z}:null}};return $.addEventListener("click",()=>f(W)),W},x=S=>{let E=C("div","fg-fb-row fg-fb-group"),T=C("span","fg-fb-group-label");T.textContent=`( ${S.conditions.length} \xD7 ${t[S.operator]} )`;let D=C("button","fg-chooser-close fg-fb-remove",{type:"button","aria-label":t.close});D.textContent="\xD7",E.append(T,D);let P={el:E,read:()=>S};return D.addEventListener("click",()=>f(P)),P},y=S=>{h.push(S),u.append(S.el)};for(let S of(M=l==null?void 0:l.conditions)!=null?M:[])y("conditions"in S?x(S):g(S));let p=C("button","fg-btn fg-fb-add",{type:"button"});p.textContent=`+ ${t.addCondition}`,p.addEventListener("click",()=>{let S=g();y(S),S.el.querySelector(".fg-fb-value").focus()});let v=C("div","fg-menu-actions"),m=C("button","fg-btn",{type:"button"});m.textContent=t.reset,m.addEventListener("click",()=>{e.setAdvancedFilter(null),this.close()});let w=C("button","fg-btn fg-btn-primary",{type:"button"});w.textContent=t.apply,w.addEventListener("click",()=>{var T;let S=h.map(D=>D.read()).filter(D=>!!D),E=((T=d.querySelector("input:checked"))==null?void 0:T.value)==="or"?"or":"and";e.setAdvancedFilter(S.length?{operator:E,conditions:S}:null),this.close()}),v.append(m,w),o.append(r,d,u,p,v),oe(e.renderer.root).append(o);let R=e.renderer.root.getBoundingClientRect(),k=o.offsetWidth||460;o.style.left=`${Math.max(4,Math.min(R.left+24,(window.innerWidth||1024)-k-4))}px`,o.style.top=`${Math.max(4,R.top+24)}px`,this.popup=o,h.length||p.click();let L=S=>{fe(S,o)||this.close()},I=S=>{S.key==="Escape"&&this.close()};document.addEventListener("pointerdown",L,!0),document.addEventListener("keydown",I,!0),this.off.push(()=>document.removeEventListener("pointerdown",L,!0),()=>document.removeEventListener("keydown",I,!0))}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null}};var Po=i=>Math.round(i*2.75),Ao=i=>Math.round(i*3.1),fn=13,pn={compact:[.8,.85],normal:[1,1],comfortable:[1.25,1.15]},ki=[],Mi=100,Ei=new Map;function ce(i){return i.every(e=>e!==null&&typeof e=="object")?i:(H("data contains entries that are not objects; they were skipped"),i.filter(e=>e!==null&&typeof e=="object"))}var gn=class{constructor(e,t){this.options=t;this.events=new Se;this.pinnedRows={top:[],bottom:[]};this.spanCache=null;this.editVersion=0;this.tracker=new wt;this.history=new vt;this.disposers=[];this.collatorCache=null;this.destroyed=!1;this.summaryOpts=null;this.summaryValues=[];this.groupBy=[];this.expanded=new Map;this.defaultExpanded=0;this.detailOpen=new Set;this.displayVersion=0;this.aggCache={ver:-1,map:new WeakMap};this.charts=new Mt(this);this.sourceDefs=[];this.pivotCfg=null;this.pivotData=null;this.savedGroup=null;this.page=0;this.pageSize=Mi;this.forcedOverlay=null;this.filterBuilder=new Dt(this);this.flashing=new Map;this.flashTimer=0;this.txQueue=[];this.txTimer=0;this.keepRange=!1;this.rowNumberCache=null;this.treeLoaded=new Set;this.treeLoading=new Set;this.lazyChildren=(e,t)=>{var n,o;if(this.treeLoaded.has(e))return!1;try{return!!((o=(n=this.options.treeData)==null?void 0:n.hasChildren)!=null&&o.call(n,t))}catch{return!1}};this.density="normal";this.selectionVersion=0;var s,a,l,d,c,u,h,f,g,x;Array.isArray(t.columns)||H("options.columns must be an array"),t.data!=null&&!Array.isArray(t.data)&&H("options.data must be an array"),this.store=new It({data:Array.isArray(t.data)?ce(t.data):[],sort:[],filters:{},quickFilter:"",selected:new Set,anchorId:null,focus:null,range:null,extraRanges:[],advancedFilter:null,locale:Te(t.locale),theme:(s=t.theme)!=null?s:"light"}),this.sourceDefs=Array.isArray(t.columns)?t.columns:[],this.columns=new Ue(this.withSelect(this.sourceDefs));let n=t.pagination;n&&typeof n=="object"&&n.pageSize!==void 0&&(Number.isInteger(n.pageSize)&&n.pageSize>0?this.pageSize=n.pageSize:H("pagination.pageSize must be a positive integer")),t.datasource&&typeof t.datasource.getRows!="function"&&H("datasource.getRows must be a function"),this.rowModel=t.datasource&&typeof t.datasource.getRows=="function"?new Ve({datasource:t.datasource,blockSize:Number.isInteger(t.blockSize)&&t.blockSize>0?t.blockSize:100,maxBlocks:Number.isInteger(t.maxBlocks)&&t.maxBlocks>0?t.maxBlocks:100,getRowId:t.getRowId,onLoaded:(y,p,v)=>this.serverLoaded(y,p,v),onFailed:(y,p,v)=>this.serverFailed(y,p,v)}):new Lt({getRowId:t.getRowId,columnDef:y=>{var p;return(p=this.columns.getNode(y))==null?void 0:p.def},quickColumns:()=>this.columns.displayed().filter(y=>!A(y.id)).map(y=>y.def),format:(y,p)=>_(y,this.store.state.locale.code)(p),collator:()=>this.collator()}),this.groupBy=this.validGroupBy((a=t.groupBy)!=null?a:[]),this.defaultExpanded=(l=t.groupDefaultExpanded)!=null?l:0,t.treeData&&!t.getRowId&&H("treeData needs getRowId so parent ids can be matched"),this.updateRows(),this.summaryOpts=(d=t.summary)!=null?d:null,this.refreshSummary();let o=t.fontSize!=null&&t.fontSize>0?t.fontSize:null;t.fontSize!=null&&!(t.fontSize>0)&&H("fontSize must be a positive number"),this.font={size:o,family:(c=t.fontFamily)!=null?c:null};let r=o!=null?o:fn;if(this.renderer=new nt(e,this,{rowHeight:(u=t.rowHeight)!=null?u:Math.round(Po(r)*pn[this.densityOf(t.density)][0]),headerHeight:(h=t.headerHeight)!=null?h:Math.round(Ao(r)*pn[this.densityOf(t.density)][1])}),this.density=this.densityOf(t.density),this.renderer.applyTheme(),this.renderer.applyFont(this.font.size,this.font.family),this.menu=new Et(this),this.chooser=new dt(this),this.contextMenu=new ut(this),this.editor=new mt(this),this.finder=new ft(this),this.fillHandle=new ht(this),this.groupPanel=t.groupPanel?new ot(this):null,this.pinnedRows={top:ce((f=t.pinnedTopRows)!=null?f:[]),bottom:ce((g=t.pinnedBottomRows)!=null?g:[])},this.sideBar=t.sideBar?new ct(this,typeof t.sideBar=="object"&&!!t.sideBar.open,(x=typeof t.sideBar=="object"?t.sideBar.panels:void 0)!=null?x:t.pivot||t.pivotPanel?["columns","filters","pivot"]:void 0):null,this.disposers.push(this.store.bus.on("change",y=>this.onChange(y)),io(this),Qn(this),()=>this.menu.close(),()=>this.chooser.close(),()=>this.contextMenu.destroy(),()=>this.editor.cancel(),()=>this.fillHandle.destroy(),()=>{var y;return(y=this.groupPanel)==null?void 0:y.destroy()},()=>this.charts.destroy(),()=>this.filterBuilder.close(),Io(this)),typeof ResizeObserver!="undefined"){let y=new ResizeObserver(()=>this.renderer.schedule());y.observe(this.renderer.main),this.disposers.push(()=>y.disconnect())}t.pivot&&this.setPivot(t.pivot),Mo(t.licenseKey).then(y=>{y&&!this.destroyed&&this.renderer.showFreeBadge()}),this.renderer.render(),this.api=this.createApi(),rt.set(this.renderer.root,this)}collator(){var t;let e=this.store.state.locale.code;return((t=this.collatorCache)==null?void 0:t.code)!==e&&(this.collatorCache={code:e,collator:new Intl.Collator(e,{numeric:!0,sensitivity:"base"})}),this.collatorCache.collator}layoutChanged(){this.renderer.invalidateHeights(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}columnsChanged(){this.rowModel.invalidate(),this.updateRows(),this.refreshSummary(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}display(){var e,t;return{groupBy:this.options.treeData?ki:this.groupBy,getParentId:(e=this.options.treeData)==null?void 0:e.getParentId,expanded:this.expanded,defaultExpanded:this.defaultExpanded,detailOpen:this.options.detailRenderer?this.detailOpen:new Set,isMaster:this.options.isRowMaster,lazyChildren:(t=this.options.treeData)!=null&&t.hasChildren?this.lazyChildren:void 0,loading:this.treeLoading,version:this.displayVersion}}updateRows(){var n;let e=!!this.options.pagination,t=(n=this.pivotData)!=null?n:this.store.state.data;this.rowModel.update({...this.store.state,data:t,display:this.display(),page:e?{index:this.page,size:this.pageSize}:null}),e&&this.page>=this.getPageCount()&&(this.page=this.getPageCount()-1,this.rowModel.update({...this.store.state,data:t,display:this.display(),page:{index:this.page,size:this.pageSize}}))}viewRows(){var e;return(e=this.pivotData)!=null?e:this.store.state.data}sourceLeaves(){let e=[],t=n=>{var o,r;for(let s of n)!s||typeof s!="object"||(Array.isArray(s.children)?t(s.children):((o=s.id)!=null?o:s.field)&&e.push({id:(r=s.id)!=null?r:s.field,def:s}))};return t(this.sourceDefs),e}getPivot(){let e=this.pivotCfg;if(!e)return null;let t={rows:[...e.rows],columns:[...e.columns],values:e.values.map(n=>({...n}))};return e.totals||(t.totals=!1),t}setPivot(e){if(e&&this.clientOnly("pivot"))return;if(e&&(typeof e!="object"||!Array.isArray(e.rows)||!Array.isArray(e.values))){H("setPivot: expected { rows: string[], values: [...] }");return}if(this.editor.cancel(),!e){if(!this.pivotCfg)return;this.pivotCfg=null,this.pivotData=null,this.columns.setDefs(this.withSelect(this.sourceDefs)),this.savedGroup&&(this.groupBy=this.savedGroup.groupBy,this.expanded=this.savedGroup.expanded,this.defaultExpanded=this.savedGroup.defaultExpanded,this.savedGroup=null),this.afterPivotSwitch();return}let t=new Set(this.sourceLeaves().map(n=>n.id));this.pivotCfg||(this.savedGroup={groupBy:this.groupBy,expanded:this.expanded,defaultExpanded:this.defaultExpanded}),this.pivotCfg=an(e,n=>t.has(n)),this.expanded=new Map,this.defaultExpanded=-1,this.rebuildPivot(!1),this.afterPivotSwitch()}afterPivotSwitch(){var e;this.page=0,this.store.set({sort:[],filters:{},range:null,focus:null}),this.rowModel.invalidate(),this.updateRows(),this.displayVersion++,this.updateRows(),(e=this.groupPanel)==null||e.refresh(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers(),this.events.emit("pivotChange",{pivot:this.getPivot()})}rebuildPivot(e=!0){let t=this.pivotCfg;if(!t)return;let n=this.store.state.locale,o=new Map(this.sourceLeaves().map(d=>[d.id,d.def])),r={sum:n.sum,avg:n.avg,min:n.min,max:n.max,count:n.count},s=yo(this.store.state.data,t,d=>o.get(d),{total:n.total,blank:n.blanks,agg:d=>{var c;return(c=r[d])!=null?c:d}},n.code);if(this.pivotData=s.rows,this.columns.setDefs(this.withSelect(s.columns)),this.groupBy=s.groupBy,!e)return;let a=d=>!!this.columns.getNode(d),l=this.store.state;(l.sort.some(d=>!a(d.colId))||Object.keys(l.filters).some(d=>!a(d)))&&this.store.set({sort:l.sort.filter(d=>a(d.colId)),filters:Object.fromEntries(Object.entries(l.filters).filter(([d])=>a(d)))}),this.rowModel.invalidate(),this.displayVersion++,this.updateRows(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}isFlashing(e,t){return this.flashing.size>0&&this.flashing.has(`${e}\0${t}`)}flash(e){let t=Date.now()+1e3;for(let o of e)this.flashing.set(o,t);if(this.flashTimer)return;let n=()=>{let o=Date.now();for(let[r,s]of this.flashing)s<=o&&this.flashing.delete(r);this.renderer.invalidate({rows:!0}),this.flashTimer=this.flashing.size&&!this.destroyed?window.setTimeout(n,250):0};this.flashTimer=window.setTimeout(n,1e3)}applyTransaction(e){var f,g,x,y,p;let t={added:[],updated:[],removed:[],notFound:[]};if(this.clientOnly("applyTransaction")||!e||typeof e!="object")return t;let n=this.store.state.data,o=this.options.getRowId,r=v=>{if(!v||typeof v!="object")return null;if(n.includes(v))return this.rowModel.idOf(v);try{return o?String(o(v)):null}catch{return null}},s=new Map(n.map(v=>[this.rowModel.idOf(v),v])),a=new Set;for(let v of(f=e.remove)!=null?f:[]){let m=r(v),w=m===null?void 0:s.get(m);w&&!a.has(w)?(a.add(w),t.removed.push(w)):w||t.notFound.push(v)}let l=new Map;for(let v of this.columns.getState()){let m=(g=this.columns.getNode(v.colId))==null?void 0:g.def.field;m&&l.set(m,[...(x=l.get(m))!=null?x:[],v.colId])}let d=[];for(let v of(y=e.update)!=null?y:[]){let m=r(v),w=m===null?void 0:s.get(m);if(!w||a.has(w)){t.notFound.push(v);continue}for(let[R,k]of Object.entries(v))if(!Object.is(w[R],k)){w[R]=k;for(let L of(p=l.get(R))!=null?p:[])d.push(`${m}\0${L}`)}t.updated.push(w)}let c=ce(Array.isArray(e.add)?e.add:[]);if(t.added.push(...c),!t.added.length&&!t.updated.length&&!t.removed.length)return t.notFound.length&&this.events.emit("transactionApplied",t),t;let u=a.size?n.filter(v=>!a.has(v)):[...n],h=typeof e.addIndex=="number"?Math.max(0,Math.min(u.length,Math.floor(e.addIndex))):u.length;u.splice(h,0,...c),this.editVersion++,this.renderer.invalidateHeights(),this.keepRange=!0;try{this.replaceData(u)}finally{this.keepRange=!1}return d.length&&this.options.flashCells!==!1&&this.flash(d),this.events.emit("transactionApplied",t),t}applyTransactionAsync(e){!e||typeof e!="object"||(this.txQueue.push(e),!this.txTimer&&(this.txTimer=window.setTimeout(()=>{var n;this.txTimer=0;let t=this.txQueue;this.txQueue=[],!(this.destroyed||!t.length)&&this.applyTransaction({add:t.flatMap(o=>{var r;return(r=o.add)!=null?r:[]}),addIndex:(n=t.find(o=>typeof o.addIndex=="number"))==null?void 0:n.addIndex,update:t.flatMap(o=>{var r;return(r=o.update)!=null?r:[]}),remove:t.flatMap(o=>{var r;return(r=o.remove)!=null?r:[]})})},50)))}setAdvancedFilter(e){let t=e&&typeof e=="object"&&Array.isArray(e.conditions)&&e.conditions.length?e:null;t!==this.store.state.advancedFilter&&(this.store.set({advancedFilter:t}),this.events.emit("advancedFilterChange",{advancedFilter:t}))}setColumnGroupOpened(e,t){this.columns.setGroupOpen(e,!!t)&&(this.layoutChanged(),this.events.emit("columnGroupOpened",{groupId:e,open:!!t}))}getState(){let e=this.store.state,t={columns:this.columns.getState(),columnGroups:this.columns.groupOpenState(),advancedFilter:e.advancedFilter?JSON.parse(JSON.stringify(e.advancedFilter)):null,sort:e.sort.map(n=>({...n})),filters:JSON.parse(JSON.stringify(e.filters)),quickFilter:e.quickFilter,groupBy:[...this.groupBy],pivot:this.pivotCfg?JSON.parse(JSON.stringify(this.pivotCfg)):null,expanded:Object.fromEntries(this.expanded),selected:[...e.selected]};return this.options.pagination&&(t.page=this.page,t.pageSize=this.pageSize),t}setState(e,t={}){var r,s;if(!e||typeof e!="object")return;let n=a=>e[a]!==void 0&&(!t.parts||t.parts.includes(a)),o=a=>!!this.columns.getNode(a);if(n("columns")&&Array.isArray(e.columns)&&(this.columns.applyState(e.columns.filter(a=>a&&o(a.colId))),this.columnsChanged()),n("columnGroups")&&e.columnGroups&&typeof e.columnGroups=="object")for(let[a,l]of Object.entries(e.columnGroups))typeof l=="boolean"&&this.setColumnGroupOpened(a,l);if(n("groupBy")&&Array.isArray(e.groupBy)&&this.setGroupBy(e.groupBy.filter(o)),n("pivot")&&this.setPivot((r=e.pivot)!=null?r:null),n("sort")&&Array.isArray(e.sort)&&this.setSort(e.sort.filter(a=>a&&o(a.colId))),n("filters")&&e.filters&&typeof e.filters=="object"){let a=Object.fromEntries(Object.entries(e.filters).filter(([l])=>o(l)));this.store.set({filters:a}),this.events.emit("filterChange",{filters:{...a}})}if(n("advancedFilter")&&this.setAdvancedFilter((s=e.advancedFilter)!=null?s:null),n("quickFilter")&&typeof e.quickFilter=="string"&&this.store.set({quickFilter:e.quickFilter}),n("expanded")&&e.expanded&&typeof e.expanded=="object"&&(this.expanded=new Map(Object.entries(e.expanded).filter(([,a])=>typeof a=="boolean")),this.displayChanged()),n("pageSize")&&typeof e.pageSize=="number"&&this.setPageSize(e.pageSize),n("page")&&typeof e.page=="number"&&this.setPage(e.page),n("selected")&&Array.isArray(e.selected)){let a=new Set(this.rowModel.allNodes().map(l=>l.id));this.setSelected(new Set(e.selected.map(String).filter(l=>a.has(l))))}}rowNumber(e){var o;let t=this.rowModel.rows();if(((o=this.rowNumberCache)==null?void 0:o.rows)!==t){let r=new Int32Array(t.length),s=0;t.forEach((a,l)=>{r[l]=a.kind?0:++s}),this.rowNumberCache={rows:t,nums:r}}let n=this.rowNumberCache.nums[e];return n?n+(this.options.pagination&&!this.rowModel.server?this.page*this.pageSize:0):null}getPage(){return this.options.pagination?this.page:0}getPageSize(){return this.options.pagination?this.pageSize:this.rowModel.fullCount()}getPageCount(){return this.options.pagination?Math.max(1,Math.ceil(this.rowModel.fullCount()/this.pageSize)):1}setPage(e){if(!this.options.pagination||!Number.isFinite(e))return;let t=Math.max(0,Math.min(this.getPageCount()-1,Math.floor(e)));t!==this.page&&(this.veto("beforePageChange",{page:t,pageSize:this.pageSize})||(this.page=t,this.pageMoved()))}setPageSize(e){if(!this.options.pagination)return;if(!Number.isInteger(e)||e<=0){H("setPageSize: size must be a positive integer");return}if(e===this.pageSize)return;let t=this.page*this.pageSize;this.veto("beforePageChange",{page:Math.floor(t/e),pageSize:e})||(this.pageSize=e,this.page=Math.floor(t/e),this.pageMoved())}pageMoved(){this.editor.cancel(),this.updateRows(),this.store.state.range&&this.setRange(null);let e=this.rowModel.getRowCount(),t=this.store.state.focus;t&&t.rowIndex>=e&&this.store.set({focus:e?{...t,rowIndex:e-1}:null}),this.renderer.scroller.scrollTop=0,this.finder.refresh(),this.renderer.invalidate({header:!0,rows:!0}),this.emitPage()}emitPage(){this.events.emit("pageChange",{page:this.page,pageSize:this.pageSize,pageCount:this.getPageCount()})}refreshRows(){this.rowModel instanceof Ve&&(this.rowModel.purge(),this.renderer.invalidate({rows:!0}))}serverLoaded(e,t,n){this.destroyed||(this.renderer.invalidate({header:!0,rows:!0}),this.events.emit("rowsLoaded",n===null?{start:e,end:t}:{start:e,end:t,total:n}))}serverFailed(e,t,n){this.destroyed||(H(`datasource.getRows failed for rows ${e}\u2013${t}`),this.toast(this.store.state.locale.loadFailed),this.renderer.invalidate({rows:!0}),this.events.emit("rowsLoadFailed",{start:e,end:t,error:n}))}syncScroll(e,t){if(!e||typeof e.setScrollPosition!="function"||e===this.api)return()=>{};let n=new Map,o=a=>`${a.top},${a.left}`,r=(a,l)=>a.on("scroll",d=>{if(n.get(a)===o(d)){n.delete(a);return}l.setScrollPosition(t==="vertical"?{top:d.top}:t==="horizontal"?{left:d.left}:d),n.set(l,o(l.getScrollPosition()))}),s=[r(this.api,e),r(e,this.api)];return()=>{for(let a of s)a()}}veto(e,t){let n=!1;return this.events.emit(e,{...t,cancel:()=>{n=!0}}),n}clientOnly(e){return this.rowModel.server?(H(`${e} is not available with a datasource`),!0):!1}displayChanged(){this.displayVersion++,this.updateRows(),this.store.state.range&&this.setRange(null);let e=this.rowModel.getRowCount(),t=this.store.state.focus;t&&t.rowIndex>=e&&this.store.set({focus:e?{...t,rowIndex:e-1}:null}),this.finder.refresh(),this.renderer.invalidate({header:!0,rows:!0})}validGroupBy(e){return Array.isArray(e)?[...new Set(e)].filter(t=>{let n=this.columns.getNode(t);return!n||n.children||A(t)?(H(`groupBy: unknown column "${t}"`),!1):!0}):[]}getGroupBy(){return[...this.groupBy]}setGroupBy(e){var n;let t=this.validGroupBy(e);t.join("")!==this.groupBy.join("")&&(this.groupBy=t,this.page=0,(n=this.groupPanel)==null||n.refresh(),this.displayChanged(),this.events.emit("groupChange",{groupBy:[...t]}))}isExpandable(e){return!!e&&(e.kind==="group"||!!e.hasChildren)}expandKey(e){return e.group?e.group.key:e.id}loadChildren(e){let t=this.options.treeData,n=e.id;if(this.treeLoading.has(n))return;if(typeof t.loadChildren!="function"){H("treeData.hasChildren needs treeData.loadChildren");return}this.treeLoading.add(n),this.displayChanged();let o=()=>(this.treeLoading.delete(n),!this.destroyed&&this.store.state.data.includes(e.data));Promise.resolve().then(()=>t.loadChildren(e.data)).then(r=>{if(!o())return;let s=ce(Array.isArray(r)?r:[]);this.treeLoaded.add(n),this.expanded.set(n,!0),s.length&&this.replaceData([...this.store.state.data,...s]),this.displayChanged(),this.events.emit("childrenLoaded",{row:e.data,rows:s}),this.events.emit("groupToggle",{key:n,expanded:!0})},r=>{o()&&(H(`treeData.loadChildren failed for row "${n}"`),this.displayChanged(),this.events.emit("childrenLoadFailed",{row:e.data,error:r}))})}setGroupExpanded(e,t){var r,s;let n=this.rowModel.rows().find(a=>this.isExpandable(a)&&this.expandKey(a)===e);if((n?!!((s=(r=n.group)==null?void 0:r.expanded)!=null?s:n.expanded):this.expanded.get(e))!==t){if(t&&n&&!n.group&&this.options.treeData&&this.lazyChildren(n.id,n.data)){this.loadChildren(n);return}this.expanded.set(e,t),this.displayChanged(),this.events.emit("groupToggle",{key:e,expanded:t})}}toggleRow(e){var n,o;let t=this.rowModel.getRow(e);this.isExpandable(t)&&this.setGroupExpanded(this.expandKey(t),!((o=(n=t.group)==null?void 0:n.expanded)!=null?o:t.expanded))}expandAll(e=!0){this.expanded.clear(),this.defaultExpanded=e?-1:0,this.displayChanged()}groupAggregate(e,t){var r,s;let n=(r=this.columns.getNode(t))==null?void 0:r.def;if(!e.group||!(n!=null&&n.aggFunc))return;if(e.group.aggregates)return(s=e.group.aggregates[t])!=null?s:n.field?e.group.aggregates[n.field]:void 0;this.aggCache.ver!==this.editVersion&&(this.aggCache={ver:this.editVersion,map:new WeakMap});let o=this.aggCache.map.get(e.group);if(o||this.aggCache.map.set(e.group,o=new Map),!o.has(t)){let a=e.group.rows;try{o.set(t,Re(n.aggFunc,a.map(l=>B(n,l)),a))}catch{H(`aggFunc of column "${t}" threw`),o.set(t,null)}}return o.get(t)}canExpandDetail(e){if(!this.options.detailRenderer)return!1;try{return!this.options.isRowMaster||!!this.options.isRowMaster(e)}catch{return!1}}isDetailExpanded(e){return!!e&&typeof e=="object"&&this.detailOpen.has(this.rowModel.idOf(e))}setDetailExpanded(e,t){if(!e||typeof e!="object"||t&&!this.canExpandDetail(e))return;let n=this.rowModel.idOf(e);this.detailOpen.has(n)!==t&&(t?this.detailOpen.add(n):(this.detailOpen.delete(n),this.renderer.dropDetail(n)),this.displayChanged(),this.events.emit("detailToggle",{row:e,expanded:t}))}canMoveRows(){let e=this.store.state,t=this.options.treeData;return!this.rowModel.server&&!e.sort.length&&!Object.keys(e.filters).length&&!e.quickFilter.trim()&&!this.groupBy.length&&(!t||typeof t.setParentId=="function")}get dragOptions(){let e=this.options.rowDrag;return e&&typeof e=="object"?e:{}}parentOf(e){let t=null;try{t=this.options.treeData.getParentId(e)}catch{t=null}return t==null?null:String(t)}rawParent(e){var t;try{return(t=this.options.treeData.getParentId(e))!=null?t:null}catch{return null}}idValue(e){let t=this.rowModel.idOf(e);for(let o of this.store.state.data){let r=this.rawParent(o);if(r!==null&&String(r)===t)return r}return this.store.state.data.some(o=>typeof this.rawParent(o)=="number")&&t.trim()!==""&&Number.isFinite(Number(t))?Number(t):t}canDropRow(e,t,n,o=this){if(!this.canMoveRows()||t===e)return!1;if(o===this&&this.options.treeData&&t){let s=this.rowModel.idOf(e),a=new Set;for(let l=this.rowModel.idOf(t);l!==null&&!a.has(l);){if(l===s)return!1;a.add(l);let d=this.rowModel.allNodes().find(c=>c.id===l);l=d?this.parentOf(d.data):null}}let r=this.dragOptions.canDrop;if(!r)return!0;try{return r({row:e,target:t,position:n,fromOtherGrid:o!==this})!==!1}catch{return H("rowDrag.canDrop threw; the drop was refused"),!1}}dropRow(e,t,n="after",o=this){var p,v;if(this.clientOnly("dropRow")||!e||typeof e!="object")return!1;let r=this.options.treeData;!r&&n==="inside"&&(n="after");let s=this.store.state.data,a=o!==this,l=a?-1:s.indexOf(e);if(!a&&l<0||t&&!s.includes(t)||a&&(!o.canMoveRows()||s.includes(e))||!this.canDropRow(e,t,n,o))return!1;let d=r?this.rawParent(e):null,c=!r||!t?null:n==="inside"?t:(p=this.store.state.data.find(m=>this.rowModel.idOf(m)===this.parentOf(t)))!=null?p:null,u=c?this.idValue(c):null,h=s.filter(m=>m!==e),f=!t||n==="inside"?h.length:h.indexOf(t)+(n==="after"?1:0);h.splice(f,0,e);let g=h.some((m,w)=>m!==s[w]);if(!a&&!g&&String(d!=null?d:"")===String(u!=null?u:""))return!1;let x=(m,w)=>{try{r.setParentId(e,m,w)}catch{H("treeData.setParentId threw")}},y=r&&(v=this.store.state.data.find(m=>this.rowModel.idOf(m)===this.parentOf(e)))!=null?v:null;return a?(o.removeRows([e]),r&&x(u,c),this.addRows([e],f)):(r&&x(u,c),this.replaceData(h),this.history.push({undo:()=>{r&&x(d,y),this.replaceData(s)},redo:()=>{r&&x(u,c),this.replaceData(h)}}),this.events.emit("rowDragEnd",{row:e,fromIndex:l,toIndex:f})),this.events.emit("rowDrop",{row:e,target:t,position:n,fromOtherGrid:a,fromGrid:a?o.api:null}),!0}moveRow(e,t,n=!0){if(this.clientOnly("moveRow")||!this.canMoveRows())return!1;let o=this.store.state.data,r=o.indexOf(e);if(r<0||!Number.isFinite(t))return!1;let s=Math.max(0,Math.min(o.length-1,Math.floor(t)));if(s===r)return!1;let a=[...o];return a.splice(r,1),a.splice(s,0,e),this.replaceData(a),n&&this.history.push({undo:()=>this.moveRow(e,r,!1),redo:()=>this.moveRow(e,s,!1)}),this.events.emit("rowDragEnd",{row:e,fromIndex:r,toIndex:s}),!0}setFont(e){let t=this.font.size;e.size!==void 0&&(typeof e.size=="number"&&e.size>0?t=e.size:H("setFont: size must be a positive number"));let n=e.family===void 0?this.font.family:e.family||null;this.font={size:t,family:n};let o=t!=null?t:fn;this.applyAutoHeights(o),this.renderer.applyFont(t,n),this.renderer.invalidateHeights(),this.menu.close(),this.layoutChanged()}densityOf(e){return e==="compact"||e==="comfortable"?e:"normal"}applyAutoHeights(e){let[t,n]=pn[this.density];this.options.rowHeight==null&&(this.renderer.opts.rowHeight=Math.round(Po(e)*t)),this.options.headerHeight==null&&(this.renderer.opts.headerHeight=Math.round(Ao(e)*n))}setDensity(e){var n;let t=this.densityOf(e);t!==this.density&&(this.density=t,this.renderer.applyTheme(),this.applyAutoHeights((n=this.font.size)!=null?n:fn),this.renderer.invalidateHeights(),this.layoutChanged())}applyFontTo(e){this.font.size&&e.style.setProperty("--fg-font-size",`${this.font.size}px`),this.font.family&&e.style.setProperty("--fg-font",this.font.family)}summary(){var e;return this.summaryOpts&&((e=this.summaryOpts.rows)!=null&&e.length)?{opts:this.summaryOpts,values:this.summaryValues}:null}setSummary(e){if(e&&!Array.isArray(e.rows)){H("setSummary: summary.rows must be an array");return}this.summaryOpts=e,this.refreshSummary(),this.renderer.invalidate({header:!0,rows:!0})}refreshSummary(){var o,r;let e=this.summaryOpts;if(!((o=e==null?void 0:e.rows)!=null&&o.length)){this.summaryValues=[];return}let t=(r=e.scope)!=null?r:"filtered",n=t==="all"?this.rowModel.allNodes().map(s=>s.data):t==="selected"?this.selectedRows():this.rowModel.dataRows().map(s=>s.data);this.summaryValues=Un(e.rows,n,s=>{var a;return(a=this.columns.getNode(s))==null?void 0:a.def})}dataColumns(){return this.columns.displayed().filter(e=>!A(e.id))}validRange(e){if(!e||this.options.rangeSelection===!1)return null;let t=this.rowModel.getRowCount(),n=o=>!!o&&!A(o.colId)&&!!this.columns.getColumn(o.colId)&&o.rowIndex>=0&&o.rowIndex<t;return n(e.start)&&n(e.end)?{start:{...e.start},end:{...e.end}}:null}setRange(e,t=!1){let n=this.validRange(e),o=t||!this.store.state.extraRanges.length?this.store.state.extraRanges:[],r=this.store.state.range;JSON.stringify(r)===JSON.stringify(n)&&o===this.store.state.extraRanges||(this.store.set({range:n,extraRanges:o}),this.events.emit("rangeChange",{range:n&&{start:{...n.start},end:{...n.end}}}))}addRange(e){let{range:t,focus:n}=this.store.state,o=this.validRange(t!=null?t:n?{start:n,end:n}:null);o&&this.store.set({extraRanges:[...this.store.state.extraRanges,o]}),this.setRange(e,!0)}getRanges(){let e=[...this.store.state.extraRanges];return this.store.state.range&&e.push(this.store.state.range),e.map(t=>({start:{...t.start},end:{...t.end}}))}setRanges(e){var n;let t=(Array.isArray(e)?e:[]).map(o=>this.validRange(o)).filter(o=>!!o);this.store.set({extraRanges:t.slice(0,-1)}),this.setRange((n=t[t.length-1])!=null?n:null,!0)}boundsOf(e){if(!e)return null;let t=this.columns.getColumn(e.start.colId),n=this.columns.getColumn(e.end.colId);return!t||!n?null:Ae({start:{rowIndex:e.start.rowIndex,colIndex:t.index},end:{rowIndex:e.end.rowIndex,colIndex:n.index}})}rangeBounds(){return this.boundsOf(this.store.state.range)}allRangeBounds(){return[...this.store.state.extraRanges,this.store.state.range].map(e=>this.boundsOf(e)).filter(e=>!!e)}rangeContains(e,t){let n=this.columns.getColumn(t);return!!n&&this.allRangeBounds().some(o=>oo(o,e,n.index))}selectAllCells(){let e=this.dataColumns(),t=this.rowModel.getRowCount();!e.length||!t||(this.store.state.focus||this.setFocus(0,e[0].id),this.setRange({start:{rowIndex:0,colId:e[0].id},end:{rowIndex:t-1,colId:e[e.length-1].id}}))}selectionTSV(e,t=!1){let n=this.store.state.locale.code,o=this.columns.displayed(),r=t?null:this.rangeBounds(),s=t,a,l,d=t?[]:this.allRangeBounds();if(d.length>1){let u=d.every(f=>f.c1===d[0].c1&&f.c2===d[0].c2),h=d.every(f=>f.r1===d[0].r1&&f.r2===d[0].r2);if(u||h){let f=[...d].sort((y,p)=>u?y.r1-p.r1:y.c1-p.c1),g=f.map(y=>this.rangeMatrix(y)),x=u?g.flat():g[0].map((y,p)=>g.flatMap(v=>{var m;return(m=v[p])!=null?m:[]}));return e&&x.unshift((u?f.slice(0,1):f).flatMap(y=>this.rangeHeaders(y))),Ut(x)}}if(r){a=[];for(let u=r.r1;u<=r.r2;u++){let h=this.rowModel.getRow(u);h.kind||a.push(h.data)}l=o.slice(r.c1,r.c2+1).filter(u=>!A(u.id))}else if(s){let u=this.store.state.selected;a=this.rowModel.dataRows().filter(h=>u.has(h.id)).map(h=>h.data),l=this.dataColumns()}else{let u=this.store.state.focus,h=u&&this.columns.getColumn(u.colId),f=u&&this.rowModel.getRow(u.rowIndex);if(!h||!f||f.kind||A(h.id))return"";a=[f.data],l=[h]}let c=a.map(u=>l.map(h=>this.copyCell(h.def,u,n)));return e&&c.unshift(l.map(u=>{var h,f;return(f=(h=u.def.header)!=null?h:u.def.field)!=null?f:u.id})),Ut(c)}rangeHeaders(e){return this.columns.displayed().slice(e.c1,e.c2+1).filter(t=>!A(t.id)).map(t=>{var n,o;return(o=(n=t.def.header)!=null?n:t.def.field)!=null?o:t.id})}rangeMatrix(e){let t=this.columns.displayed().slice(e.c1,e.c2+1).filter(r=>!A(r.id)),n=this.store.state.locale.code,o=[];for(let r=e.r1;r<=e.r2;r++){let s=this.rowModel.getRow(r);s&&!s.kind&&o.push(t.map(a=>this.copyCell(a.def,s.data,n)))}return o}copyCell(e,t,n){let o=B(e,t),r=e.copyable;if(r===!1)return"";if(typeof r=="function"){let s=!1;try{s=r({value:o,row:t,column:e})!==!1}catch{s=!1}if(!s)return""}return pt(e,o,n)}cutToClipboard(){let e=this.copyToClipboard(!1);return e&&this.clearCells(),e}copyToClipboard(e,t=!1){var o,r,s;let n=this.selectionTSV(e,t);if(n&&typeof navigator!="undefined"&&((o=navigator.clipboard)!=null&&o.writeText))try{(s=(r=navigator.clipboard.writeText(n))==null?void 0:r.catch)==null||s.call(r,()=>{})}catch{}return n}pasteText(e){var x;let t=to(e),n={changed:0,skipped:0};if(!t.length)return n;let o=this.columns.displayed(),r=this.rowModel.getRowCount(),s=this.rangeBounds(),a=this.store.state.focus,l=a&&this.columns.getColumn(a.colId),d,c;if(s)d=s.r1,c=s.c1;else if(a&&l&&!A(l.id))d=a.rowIndex,c=l.index;else return n;let u=[],h=t.length===1&&t[0].length===1,f=h&&s?s.r2-s.r1+1:t.length,g=h&&s?s.c2-s.c1+1:Math.max(...t.map(y=>y.length));for(let y=0;y<f;y++){let p=d+y;if(p>=r)break;let v=this.rowModel.getRow(p);if(!v.kind)for(let m=0;m<g;m++){let w=o[c+m];if(!w)break;if(A(w.id))continue;let R=h&&s?t[0][0]:(x=t[y])==null?void 0:x[m];if(R===void 0)continue;let k=w.def;if(!k.field||!ae(k,v.data,p)){n.skipped++;continue}let L=v.data[k.field],I=this.acceptText(k,v.data,R,L);if(!I.ok){n.skipped++;continue}this.writeCell(u,v.data,k.field,w.id,p,I.value)&&n.changed++}}return this.endCellTx(u),this.events.emit("paste",{...n}),n}acceptText(e,t,n,o){var a;let r,s=e.editor;if(s&&typeof s=="object"&&s.type==="select"){let l=(a=typeof s.options=="function"?s.options(t):s.options)!=null?a:[],d=n.trim().toLowerCase(),c=l.map(u=>u!==null&&typeof u=="object"&&"value"in u?u:{value:u,label:String(u),disabled:!1}).find(u=>{var h;return String(u.value).toLowerCase()===d||((h=u.label)!=null?h:"").toLowerCase()===d});if(!c||c.disabled)return{ok:!1};r=c.value}else if(e.formulas&&Ce(n.trim()))r=n.trim();else{let l=gt(e,n,o);if(!l.ok)return l;r=l.value}return this.cellError(e,t,r)!==null?{ok:!1}:{ok:!0,value:r}}cellError(e,t,n){let o=this.store.state.locale;if(e.required&&G(n))return o.required;if(e.unique&&e.field&&!G(n)){let r=n instanceof Date?n.getTime():String(n),s=e.field;if(this.store.state.data.some(a=>{if(a===t)return!1;let l=a[s];return!G(l)&&(l instanceof Date?l.getTime():String(l))===r}))return o.duplicate}if(e.validate){let r;try{r=e.validate(n,t)}catch{r=o.invalidValue}if(r!==!0)return typeof r=="string"&&r?r:o.invalidValue}return null}validateAll(){let e=[],t=this.columns.getState().map(n=>({id:n.colId,def:this.columns.getNode(n.colId).def})).filter(n=>n.def.field&&n.def.editable&&(n.def.required||n.def.unique||n.def.validate));return this.store.state.data.forEach((n,o)=>{let r=this.rowModel.idOf(n),s=this.rowModel.indexOfId(r);for(let a of t){if(!ae(a.def,n,s<0?o:s))continue;let l=this.cellError(a.def,n,n[a.def.field]);l!==null&&e.push({row:n,rowIndex:s,colId:a.id,message:l})}}),e}mergeSpans(){if(this.rowModel.server||!this.columns.displayed().some(r=>r.def.merge||r.def.rowSpan))return Ei;let e=this.rowModel.rows(),t=this.editVersion*1e6+this.columns.displayed().length;if(this.spanCache&&this.spanCache.rows===e&&this.spanCache.ver===t)return this.spanCache.spans;let n=new Map,o=this.columns.displayed().filter(r=>r.def.merge||r.def.rowSpan);if(o.length&&!e.some(r=>r.kind)){let r=e.map(s=>s.data);for(let s of o)n.set(s.id,et(r,s.def))}return this.spanCache={rows:e,ver:t,spans:n},n}rangeAggregates(){let e=this.allRangeBounds();if(!e.length)return null;let t=this.columns.displayed(),n={cells:0,count:0,numbers:0,sum:0,min:1/0,max:-1/0},o=e.length>1?new Set:null;for(let r of e)for(let s=r.r1;s<=r.r2;s++){let a=this.rowModel.getRow(s);if(!a||a.kind)continue;let l=a.data;for(let d of t.slice(r.c1,r.c2+1)){if(A(d.id))continue;if(o){let u=`${s},${d.index}`;if(o.has(u))continue;o.add(u)}n.cells++;let c=B(d.def,l);if(!G(c)&&(n.count++,typeof c=="number"||d.def.type==="number"&&!Number.isNaN(Number(c)))){let u=Number(c);n.numbers++,n.sum+=u,u<n.min&&(n.min=u),u>n.max&&(n.max=u)}}}return n}fillRange(e){var u;let t=(u=this.rangeBounds())!=null?u:(()=>{let h=this.store.state.focus,f=h&&this.columns.getColumn(h.colId);return h&&f&&!A(f.id)?{r1:h.rowIndex,r2:h.rowIndex,c1:f.index,c2:f.index}:null})(),n=this.columns.getColumn(e.start.colId),o=this.columns.getColumn(e.end.colId);if(!t||!n||!o)return;let r=Ae({start:{rowIndex:e.start.rowIndex,colIndex:n.index},end:{rowIndex:e.end.rowIndex,colIndex:o.index}}),s=this.rowModel.getRowCount();r.r1=Math.max(0,r.r1),r.r2=Math.min(s-1,r.r2);let a=this.columns.displayed(),l=[],d=(h,f,g)=>{let x=a[f],y=this.rowModel.getRow(h),p=x==null?void 0:x.def;!y||y.kind||!(p!=null&&p.field)||A(x.id)||!ae(p,y.data,h)||this.cellError(p,y.data,g)===null&&this.writeCell(l,y.data,p.field,x.id,h,g)},c=(h,f)=>B(a[f].def,this.rowModel.getRow(h).data);if(r.r1<t.r1||r.r2>t.r2)for(let h=t.c1;h<=t.c2;h++){let f=[],g=[];for(let x=t.r1;x<=t.r2;x++)f.push(c(x,h));for(let x=t.r2;x>=t.r1;x--)g.push(c(x,h));Pe(f,r.r2-t.r2).forEach((x,y)=>d(t.r2+1+y,h,x)),Pe(g,t.r1-r.r1).forEach((x,y)=>d(t.r1-1-y,h,x))}else if(r.c1<t.c1||r.c2>t.c2)for(let h=t.r1;h<=t.r2;h++){let f=[],g=[];for(let x=t.c1;x<=t.c2;x++)f.push(c(h,x));for(let x=t.c2;x>=t.c1;x--)g.push(c(h,x));Pe(f,r.c2-t.c2).forEach((x,y)=>d(h,t.c2+1+y,x)),Pe(g,t.c1-r.c1).forEach((x,y)=>d(h,t.c1-1-y,x))}else return;this.endCellTx(l),this.setRange({start:{rowIndex:r.r1,colId:a[r.c1].id},end:{rowIndex:r.r2,colId:a[r.c2].id}})}setPinnedRows(e){e.top&&(this.pinnedRows.top=ce(e.top)),e.bottom&&(this.pinnedRows.bottom=ce(e.bottom)),this.renderer.invalidate({rows:!0})}writeCell(e,t,n,o,r,s){let a=t[n];return Object.is(a,s)||this.veto("beforeCellChange",{row:t,rowIndex:r,colId:o,oldValue:a,newValue:s})?!1:(this.tracker.beforeChange(t),t[n]=s,e.push({row:t,field:n,colId:o,oldValue:a,newValue:s}),this.events.emit("cellValueChanged",{row:t,rowIndex:r,colId:o,oldValue:a,newValue:s}),!0)}endCellTx(e){if(!e.length)return;let t=(n,o)=>{for(let r of n){let s=r.row[r.field];r.row[r.field]=r[o],this.events.emit("cellValueChanged",{row:r.row,rowIndex:this.rowModel.indexOfId(this.rowModel.idOf(r.row)),colId:r.colId,oldValue:s,newValue:r[o]})}this.afterDataEdit()};this.history.push({undo:()=>t([...e].reverse(),"oldValue"),redo:()=>t(e,"newValue")}),this.afterDataEdit()}afterDataEdit(){this.renderer.invalidateHeights(),this.editVersion++,this.refreshSummary(),this.renderer.invalidate({rows:!0})}applyEdit(e,t,n){var a;let o=this.rowModel.getRow(e),r=(a=this.columns.getColumn(t))==null?void 0:a.def;if(!o||!(r!=null&&r.field))return;let s=[];this.writeCell(s,o.data,r.field,t,e,n),this.endCellTx(s)}clearCells(){var a,l;let e=this.columns.displayed(),t=this.allRangeBounds(),n=this.store.state.focus,o=n?(a=this.columns.getColumn(n.colId))==null?void 0:a.index:void 0,r=t.length?t:n&&o!==void 0?[{r1:n.rowIndex,r2:n.rowIndex,c1:o,c2:o}]:[];if(!r.length)return;let s=[];for(let d of r)for(let c=d.r1;c<=d.r2;c++){let u=this.rowModel.getRow(c);for(let h=d.c1;h<=d.c2;h++){let f=(l=e[h])==null?void 0:l.def;u&&!u.kind&&(f!=null&&f.field)&&ae(f,u.data,c)&&this.writeCell(s,u.data,f.field,e[h].id,c,null)}}this.endCellTx(s)}replaceData(e){this.store.set({data:e});let t=new Set(this.rowModel.allNodes().map(s=>s.id)),n=this.store.state.selected;[...n].some(s=>!t.has(s))&&this.setSelected(new Set([...n].filter(s=>t.has(s))));let o=this.rowModel.getRowCount(),r=this.store.state.focus;r&&r.rowIndex>=o&&this.store.set({focus:o?{...r,rowIndex:o-1}:null})}addRows(e,t,n=!0){if(this.clientOnly("addRows"))return[];let o=ce(Array.isArray(e)?e:[]);if(!o.length)return[];let r=[...this.store.state.data],s=t===void 0?r.length:Math.max(0,Math.min(r.length,t));r.splice(s,0,...o);for(let a of o)this.tracker.created.add(a);return this.replaceData(r),n&&this.history.push({undo:()=>this.removeRows(o,!1),redo:()=>this.addRows(o,s,!1)}),this.events.emit("rowsAdded",{rows:[...o]}),o}removeRows(e,t=!0){if(this.clientOnly("removeRows"))return[];let n=this.store.state.data,o=typeof e=="function"?e:(l=>d=>l.has(d))(new Set(e)),r=[];if(n.forEach((l,d)=>{let c=!1;try{c=!!o(l)}catch{c=!1}c&&r.push({row:l,index:d})}),!r.length)return[];let s=new Set(r.map(l=>l.row)),a=new Set(r.filter(l=>this.tracker.created.has(l.row)).map(l=>l.row));for(let{row:l,index:d}of r)a.has(l)?this.tracker.created.delete(l):this.tracker.deleted.set(l,d);return this.replaceData(n.filter(l=>!s.has(l))),t&&this.history.push({undo:()=>{let l=[...this.store.state.data];for(let{row:d,index:c}of r)l.splice(Math.min(c,l.length),0,d),this.tracker.deleted.delete(d),a.has(d)&&this.tracker.created.add(d);this.replaceData(l)},redo:()=>this.removeRows([...s],!1)}),this.events.emit("rowsRemoved",{rows:r.map(l=>l.row)}),r.map(l=>l.row)}trackedFields(){let e=[],t=n=>{for(let o of n)o.children?t(o.children):o.def.field&&!A(o.id)&&e.push({field:o.def.field,colId:o.id})};return t(this.columns.roots()),e}getChanges(){let e=this.trackedFields(),t=[];for(let[n,o]of this.tracker.originals)if(!this.tracker.deleted.has(n))for(let r of this.tracker.diff(n,e.map(s=>s.field)))t.push({row:n,colId:e.find(s=>s.field===r).colId,oldValue:o[r],newValue:n[r]});return t}getModifiedRows(){let e=this.trackedFields().map(n=>n.field),t=this.store.state.data;return{created:t.filter(n=>this.tracker.created.has(n)),updated:t.filter(n=>this.tracker.originals.has(n)&&this.tracker.diff(n,e).length>0),deleted:[...this.tracker.deleted.keys()]}}hasChanges(){let e=this.getModifiedRows();return e.created.length+e.updated.length+e.deleted.length>0}commitChanges(){this.tracker.reset(),this.renderer.invalidate({rows:!0})}revertChanges(){this.editor.cancel();for(let[n,o]of this.tracker.originals)Object.assign(n,o);let e=this.store.state.data.filter(n=>!this.tracker.created.has(n)),t=[...this.tracker.deleted.entries()].sort((n,o)=>n[1]-o[1]);e=[...e];for(let[n,o]of t)e.splice(Math.min(o,e.length),0,n);this.tracker.reset(),this.history.clear(),this.replaceData(e),this.afterDataEdit()}undo(){this.editor.cancel(),this.history.undo()}redo(){this.editor.cancel(),this.history.redo()}toast(e){let t=C("div","fg-toast",{role:"status"});t.textContent=e,this.renderer.root.append(t),setTimeout(()=>t.remove(),3500)}refreshChoosers(){var e;this.chooser.refresh(),(e=this.sideBar)==null||e.refresh()}setColumnsVisible(e,t){let n=[];for(let o of e){let r=this.columns.getNode(o);!r||r.children||r.hide===!t||(this.columns.setHide(o,!t),n.push(o))}if(n.length){this.columnsChanged();for(let o of n)this.events.emit("columnVisible",{colId:o,visible:t})}}autoSize(e){var l,d;let t=(e?e.map(c=>this.columns.getColumn(c)):this.columns.displayed()).filter(c=>!!c&&je(c.def)),{first:n,last:o}=this.renderer.renderedRange(),r=this.store.state.locale.code,s=66,a=24;for(let c of t){let u=this.renderer.measureText((d=(l=c.def.header)!=null?l:c.def.field)!=null?d:"",!0)+s,h=_(c.def,r);for(let g=n;g<=o;g++){let x=this.rowModel.getRow(g);x&&(u=Math.max(u,this.renderer.measureText(h(B(c.def,x.data)),!1)+a))}let f=this.columns.setWidth(c.id,Math.ceil(u));this.events.emit("columnResize",{colId:c.id,width:f})}this.layoutChanged()}resetColumns(){this.columns.reset(),this.columnsChanged()}setSort(e){let t=e.filter(n=>{let o=this.columns.getNode(n.colId);return!o||o.children?(H(`setSort: unknown column "${n.colId}"`),!1):n.dir==="asc"||n.dir==="desc"});this.veto("beforeSort",{sort:t.map(n=>({...n}))})||(this.store.set({sort:t}),this.events.emit("sortChange",{sort:[...t]}))}toggleSort(e,t){let n=this.store.state.sort,o=n.find(a=>a.colId===e),r=o?o.dir==="asc"?"desc":null:"asc",s;t?r?o?s=n.map(a=>a.colId===e?{colId:e,dir:r}:a):s=[...n,{colId:e,dir:r}]:s=n.filter(a=>a.colId!==e):s=r?[{colId:e,dir:r}]:[],this.setSort(s)}setFilter(e,t){let n=this.columns.getNode(e);if(!n||n.children){H(`setFilter: unknown column "${e}"`);return}if(this.veto("beforeFilter",{colId:e,model:t}))return;let o={...this.store.state.filters};t?o[e]=t:delete o[e],this.store.set({filters:o}),this.events.emit("filterChange",{filters:{...o}})}setPinned(e,t){this.columns.setPinned(e,t),this.layoutChanged()}setFocus(e,t){let n=this.store.state.focus;n&&n.rowIndex===e&&n.colId===t||(this.store.set({focus:{rowIndex:e,colId:t}}),this.events.emit("focusChange",{rowIndex:e,colId:t}))}setSelected(e,t=this.store.state.anchorId){this.selectionVersion++,this.store.set({selected:e,anchorId:t}),this.events.emit("selectionChange",{selected:this.selectedRows()})}rowSelectable(e){let t=this.options.isRowSelectable;if(!t)return!0;try{return!!t(e)}catch{return!1}}groupMemberIds(e){var a,l;if(e.group)return e.group.rows.filter(d=>this.rowSelectable(d)).map(d=>this.rowModel.idOf(d));let t=(a=this.options.treeData)==null?void 0:a.getParentId;if(!t)return[];let n=new Map;for(let d of this.store.state.data){let c=null;try{c=t(d)}catch{c=null}if(c==null)continue;let u=String(c),h=n.get(u);h?h.push(d):n.set(u,[d])}let o=[],r=new Set([e.id]),s=[e.id];for(;s.length;)for(let d of(l=n.get(s.shift()))!=null?l:[]){let c=this.rowModel.idOf(d);r.has(c)||(r.add(c),s.push(c),this.rowSelectable(d)&&o.push(c))}return o}groupSelection(e){let t=this.groupMemberIds(e),n=this.store.state.selected,o=t.filter(r=>n.has(r)).length;return o===0?"none":o===t.length?"all":"some"}toggleGroupSelection(e){if(this.options.rowSelection!=="multiple")return;let t=this.groupMemberIds(e),n=new Set(this.store.state.selected),o=t.length>0&&t.every(r=>n.has(r));for(let r of t)o?n.delete(r):n.add(r);this.setSelected(n)}selectFromClick(e,t,n){var a,l;let o=this.options.rowSelection;if(!o||e<0||e>=this.rowModel.getRowCount())return;let r=this.rowModel.getRow(e);if(r.kind||!this.rowSelectable(r.data))return;let s=To({selected:this.store.state.selected,anchorIndex:this.anchorIndex(),mode:o,index:e,idAt:d=>this.rowModel.getRow(d).id,toggle:t,range:n});if(this.rowModel.rows()!==this.rowModel.dataRows()||this.options.isRowSelectable)for(let d of s.selected){if(this.store.state.selected.has(d))continue;let c=this.rowModel.indexOfId(d),u=c>=0?this.rowModel.getRow(c):null;u&&(u.kind||!this.rowSelectable(u.data))&&s.selected.delete(d)}if(o==="multiple"&&this.options.groupSelectsChildren&&this.options.treeData&&r.hasChildren){let d=s.selected.has(r.id);for(let c of this.groupMemberIds(r))d?s.selected.add(c):s.selected.delete(c)}this.setSelected(s.selected,(l=(a=this.rowModel.getRow(s.anchorIndex))==null?void 0:a.id)!=null?l:null)}anchorIndex(){let e=this.store.state.anchorId;if(e==null)return null;let t=this.rowModel.indexOfId(e);return t<0?null:t}selectableRows(){let e=this.rowModel.dataRows();return this.options.isRowSelectable?e.filter(t=>this.rowSelectable(t.data)):e}toggleSelectAll(){let e=this.selectableRows(),t=this.store.state.selected,n=e.length>0&&e.every(r=>t.has(r.id)),o=new Set(t);for(let r of e)n?o.delete(r.id):o.add(r.id);this.setSelected(o)}selectedRows(){let e=this.store.state.selected;return e.size?this.rowModel.allNodes().filter(t=>e.has(t.id)).map(t=>t.data):[]}withSelect(e){let t=[],n=this.options.rowNumbers;if(n){let o=typeof n=="object"?n:{};t.push(Nn(typeof o.width=="number"&&o.width>0?o.width:void 0,typeof o.header=="string"?o.header:void 0))}return this.options.rowDrag&&t.push(Fn),this.options.rowSelection&&t.push($n),[...t,...e]}setData(e,t){if(this.clientOnly("setData"))return;if(!Array.isArray(e)){H("setData: rows must be an array");return}this.editor.cancel(),this.tracker.reset(),this.history.clear(),this.detailOpen.clear(),this.treeLoaded.clear(),this.treeLoading.clear(),this.renderer.dropDetail(),this.store.set({data:ce(e)}),t!=null&&t.scrollToTop&&this.renderer.setScroll({top:0,left:0});let n=this.store.state.selected;if(n.size)if(this.options.getRowId){let s=new Set(this.rowModel.allNodes().map(l=>l.id)),a=new Set([...n].filter(l=>s.has(l)));a.size!==n.size&&this.setSelected(a)}else this.setSelected(new Set,null);let o=this.rowModel.getRowCount(),r=this.store.state.focus;r&&r.rowIndex>=o&&this.store.set({focus:o?{...r,rowIndex:o-1}:null})}setColumns(e){var o;if(!Array.isArray(e)){H("setColumns: columns must be an array");return}if(this.menu.close(),this.sourceDefs=e,this.pivotCfg){this.rebuildPivot();return}this.columns.setDefs(this.withSelect(e));let t=r=>!!this.columns.getNode(r),n=this.groupBy.filter(t);n.length!==this.groupBy.length&&(this.groupBy=n,(o=this.groupPanel)==null||o.refresh(),this.events.emit("groupChange",{groupBy:[...n]})),this.store.set({sort:this.store.state.sort.filter(r=>t(r.colId)),filters:Object.fromEntries(Object.entries(this.store.state.filters).filter(([r])=>t(r))),focus:null}),this.columnsChanged()}onChange(e){var o,r,s,a;let t=(...l)=>l.some(d=>e.includes(d));this.pivotCfg&&t("data","locale")&&this.rebuildPivot(!1),t("locale")&&(this.menu.close(),this.chooser.close(),(o=this.sideBar)==null||o.refresh(),this.rowModel.invalidate());let n=t("sort","filters","quickFilter","advancedFilter")&&this.page!==0;n&&(this.page=0),t("data","sort","filters","quickFilter","advancedFilter","locale")&&this.updateRows(),n&&this.emitPage(),t("data","sort","filters","quickFilter","advancedFilter")&&this.store.state.range&&!this.keepRange&&this.setRange(null),t("data","sort","filters","quickFilter","advancedFilter","locale")&&this.finder.refresh(),(t("data","filters","quickFilter","advancedFilter","locale")||t("selected")&&((r=this.summaryOpts)==null?void 0:r.scope)==="selected")&&this.refreshSummary(),t("locale")&&((s=this.groupPanel)==null||s.refresh()),t("filters")&&((a=this.sideBar)==null||a.refresh()),t("theme")&&this.renderer.applyTheme(),this.renderer.invalidate({header:t("sort","filters","quickFilter","advancedFilter","locale","selected","data"),rows:t("data","sort","filters","quickFilter","advancedFilter","locale")})}createApi(){let e=t=>((...n)=>{if(this.destroyed){H("API called after destroy()");return}return t(...n)});return{setData:e((t,n)=>this.setData(t,n)),getData:e(()=>this.store.state.data),setColumns:e(t=>this.setColumns(t)),getColumnState:e(()=>this.columns.getState()),applyColumnState:e(t=>{this.columns.applyState(t),this.columnsChanged()}),setSort:e(t=>this.setSort(t)),getSort:e(()=>[...this.store.state.sort]),setFilter:e((t,n)=>this.setFilter(t,n)),getFilterModel:e(()=>({...this.store.state.filters})),setQuickFilter:e(t=>this.store.set({quickFilter:t!=null?t:""})),getSelectedRows:e(()=>this.selectedRows()),selectAll:e(()=>this.setSelected(new Set([...this.store.state.selected,...this.selectableRows().map(t=>t.id)]))),deselectAll:e(()=>this.setSelected(new Set,null)),getDisplayedRowCount:e(()=>this.rowModel.getRowCount()),scrollToRow:e(t=>this.renderer.scrollToRow(t)),validate:e(()=>this.validateAll()),setDensity:e(t=>this.setDensity(t)),getDensity:e(()=>this.density),showOverlay:e(t=>{this.forcedOverlay=t==="loading"||t==="noRows"?t:null,this.renderer.invalidate()}),getXlsxSheet:e(t=>nn(this,t)),print:e(t=>fo(Qt(this,t))),getPrintHtml:e(t=>Qt(this,t)),setColumnGroupOpened:e((t,n)=>this.setColumnGroupOpened(t,n)),setAdvancedFilter:e(t=>this.setAdvancedFilter(t)),getAdvancedFilter:e(()=>this.store.state.advancedFilter?JSON.parse(JSON.stringify(this.store.state.advancedFilter)):null),openFilterBuilder:e(()=>this.filterBuilder.open()),isColumnGroupOpened:e(t=>{var n;return!!((n=this.columns.getNode(t))!=null&&n.open)}),applyTransaction:e(t=>this.applyTransaction(t)),applyTransactionAsync:e(t=>this.applyTransactionAsync(t)),getState:e(()=>this.getState()),setState:e((t,n)=>this.setState(t,n)),getScrollPosition:e(()=>this.renderer.getScroll()),setScrollPosition:e(t=>this.renderer.setScroll(t!=null?t:{})),syncScroll:e((t,n="both")=>this.syncScroll(t,n)),setTheme:e(t=>this.store.set({theme:t})),setLocale:e(t=>this.store.set({locale:Te(t)})),setFont:e(t=>this.setFont(t)),setColumnVisible:e((t,n)=>this.setColumnsVisible([t],n)),autoSizeColumns:e(t=>this.autoSize(t)),resetColumnState:e(()=>this.resetColumns()),openColumnChooser:e(()=>this.chooser.open()),closeColumnChooser:e(()=>this.chooser.close()),toggleSideBar:e((t,n)=>{var o;return(o=this.sideBar)==null?void 0:o.toggle(t,n)}),setSummary:e(t=>this.setSummary(t)),getSummaryValues:e(()=>this.summaryValues.map(t=>({...t}))),getRange:e(()=>{let t=this.store.state.range;return t&&{start:{...t.start},end:{...t.end}}}),setRange:e(t=>this.setRange(t)),getRanges:e(()=>this.getRanges()),setRanges:e(t=>this.setRanges(t)),copySelection:e(t=>this.copyToClipboard(!!(t!=null&&t.headers),!!(t!=null&&t.rows))),pasteText:e(t=>this.pasteText(t)),cutSelection:e(()=>this.cutToClipboard()),stopRowEdit:e(t=>this.editor.endRow(!t)),startEdit:e((t,n)=>this.editor.start(t,n)),stopEdit:e(t=>t?this.editor.cancel():void this.editor.commit(null)),addRows:e((t,n)=>this.addRows(t,n)),removeRows:e(t=>this.removeRows(t)),removeSelectedRows:e(()=>this.removeRows(this.selectedRows())),getModifiedRows:e(()=>this.getModifiedRows()),getChanges:e(()=>this.getChanges()),hasChanges:e(()=>this.hasChanges()),commitChanges:e(()=>this.commitChanges()),revertChanges:e(()=>this.revertChanges()),undo:e(()=>this.undo()),redo:e(()=>this.redo()),canUndo:e(()=>this.history.canUndo()),canRedo:e(()=>this.history.canRedo()),fillRange:e(t=>this.fillRange(t)),setPinnedRows:e(t=>this.setPinnedRows(t)),find:e(t=>this.finder.find(t)),findNext:e(()=>this.finder.next()),findPrevious:e(()=>this.finder.previous()),clearFind:e(()=>this.finder.clear()),setGroupBy:e(t=>this.setGroupBy(t)),getGroupBy:e(()=>this.getGroupBy()),setGroupExpanded:e((t,n)=>this.setGroupExpanded(t,n)),expandAll:e(()=>this.expandAll(!0)),collapseAll:e(()=>this.expandAll(!1)),setDetailExpanded:e((t,n)=>this.setDetailExpanded(t,n)),isDetailExpanded:e(t=>this.isDetailExpanded(t)),moveRow:e((t,n)=>this.moveRow(t,n)),dropRow:e((t,n,o)=>this.dropRow(t,n,o)),setPage:e(t=>this.setPage(t)),getPage:e(()=>this.getPage()),getPageCount:e(()=>this.getPageCount()),setPageSize:e(t=>this.setPageSize(t)),getPageSize:e(()=>this.getPageSize()),refreshRows:e(()=>this.refreshRows()),setPivot:e(t=>this.setPivot(t)),getPivot:e(()=>this.getPivot()),createChart:e(t=>this.charts.create(t)),getCsv:e(t=>en(this,t)),exportCsv:e((t="export.csv",n)=>Oe(t,["\uFEFF",en(this,n)],"text/csv;charset=utf-8")),getXlsx:e(t=>tn(this,t)),exportXlsx:e((t="export.xlsx",n)=>Oe(t,[tn(this,n)],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")),importFile:e((t,n)=>po(this,t,n)),on:e((t,n)=>this.events.on(t,n)),destroy:()=>this.destroy()}}destroy(){if(!this.destroyed){this.destroyed=!0,rt.delete(this.renderer.root),clearTimeout(this.flashTimer),clearTimeout(this.txTimer);for(let e of this.disposers)e();this.renderer.destroy(),this.events.clear()}}};function $o(i,e){return new gn(i,e).api}function mn(i){let e=(Array.isArray(i)?i:[]).filter(t=>t&&t.grid&&typeof t.grid.getXlsxSheet=="function");return e.length?ye(e.map((t,n)=>{var o,r,s;return t.grid.getXlsxSheet({...t.options,sheetName:(s=(r=t.sheetName)!=null?r:(o=t.options)==null?void 0:o.sheetName)!=null?s:`Sheet${n+1}`})})):(H("buildWorkbook: no grids given; the file has one empty sheet"),ye([{name:"Sheet1",rows:[]}]))}function Fo(i,e){Oe(i||"export.xlsx",[mn(e)],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}var Li=i=>typeof i=="function"?i():i!=null?i:{};async function No(i,e,t,n){var l;let o=i,r={method:e,credentials:(l=n.credentials)!=null?l:"same-origin",headers:{Accept:"application/json",...Li(n.headers)}};if(e==="GET"){let d=new URLSearchParams;for(let[c,u]of Object.entries(t))d.set(c,typeof u=="string"?u:JSON.stringify(u));o+=(i.includes("?")?"&":"?")+d.toString()}else r.headers["Content-Type"]="application/json",r.body=JSON.stringify(t);let s=await fetch(o,r);if(!s.ok)throw new Error(`HTTP ${s.status} from ${i}`);let a=await s.text();return a?JSON.parse(a):null}function Ti(i){if(Array.isArray(i))return{rows:i};let e=i!=null?i:{},t=[e.rows,e.list,e.content,e.data,e.items,e.resultList].find(Array.isArray),n=[e.total,e.totalCount,e.totalElements,e.totCnt,e.count].find(o=>typeof o=="number");return{rows:t!=null?t:[],total:n}}function vn(i,e={}){return{async getRows(t){var s,a,l,d;let n=Math.max(1,t.end-t.start),o={start:t.start,end:t.end,page:Math.floor(t.start/n),size:n,sort:t.sort,filters:t.filters,quickFilter:t.quickFilter,...(a=(s=e.params)==null?void 0:s.call(e))!=null?a:{}},r=await No(i,(l=e.method)!=null?l:"POST",o,e);return((d=e.transform)!=null?d:Ti)(r)}}}async function Oo(i,e,t={}){var a,l;if(!i.hasChanges())return null;let{created:n,updated:o,deleted:r}=i.getModifiedRows(),s=await No(e,"POST",{created:n,updated:o,deleted:r,...(l=(a=t.params)==null?void 0:a.call(t))!=null?l:{}},t);return i.commitChanges(),s}async function Ho(i,e,t={}){var o;let{rows:n}=await vn(e,t).getRows({start:0,end:(o=t.maxRows)!=null?o:1e4,sort:[],filters:{},quickFilter:""});return i.setData(n),n}function Bo(i=document){var n,o;let e=(n=i.querySelector('meta[name="_csrf"]'))==null?void 0:n.content,t=((o=i.querySelector('meta[name="_csrf_header"]'))==null?void 0:o.content)||"X-CSRF-TOKEN";return e?{[t]:e}:{}}var zo={en:ie,ko:kn,"zh-CN":Mn,"zh-TW":En,ja:Sn,es:Cn,fr:Rn,de:xn,vi:Ln,th:Tn,id:In,ru:Dn,"pt-BR":Pn,it:An};for(let i of Object.values(zo))We(i);return Uo(Ii);})();
15
+ </style></head><body>${e.title?`<h1>${d}</h1>`:""}<table><thead>${e.headers===!1?"":a.join("")}</thead><tbody>${c}</tbody></table></body></html>`}function wo(i){if(typeof document=="undefined")return;let e=document.createElement("iframe");e.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0",document.body.append(e);let t=e.contentDocument;if(!t||!e.contentWindow){e.remove(),O("printing is not supported in this environment");return}t.open(),t.write(i),t.close();let n=e.contentWindow,o=()=>setTimeout(()=>e.remove(),1e3);n.addEventListener("afterprint",o),setTimeout(()=>{try{n.focus(),n.print()}catch{O("printing is not supported in this environment")}o()},50)}function tn(i,e={}){let t=Zt(i,e.columns),n=i.store.state.locale.code,o=typeof e.separator=="string"&&e.separator.length===1?e.separator:",",r=Qt(i,e.rows).map(s=>t.map(a=>{let l=G(a.def,s),c=a.def.type,d=gt(a.def,l,n);return{value:d,text:!(c==="number"||c==="date"||c==="boolean")||typeof l=="string"&&!fi.test(d)}}));return e.headers!==!1&&r.unshift(t.map(s=>({value:He(s.def,s.id),text:!0}))),co(r,o)}function pi(i){var r;let e=i.format;if(i.type==="date")return e==="datetime"?"yyyy-mm-dd hh:mm":e==="time"?"hh:mm":"yyyy-mm-dd";if(i.type!=="number"||e==null)return null;if(typeof e=="string")return e==="integer"?"#,##0":e==="percent"?"0%":e.startsWith("currency:")?"#,##0.##":/^[#0,.%]+$/.test(e)?e:null;let t=e,n=(r=t.maximumFractionDigits)!=null?r:t.minimumFractionDigits,o=n?`.${"0".repeat(Math.min(10,n))}`:"";return t.style==="percent"?`0${o}%`:`${t.useGrouping===!1?"0":"#,##0"}${o}`}function St(i){let e=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(i.trim());if(e)return`FF${(e[1].length===3?[...e[1]].map(r=>r+r).join(""):e[1]).toUpperCase()}`;let t=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)(?:[\s,/]+([\d.]+%?))?\s*\)$/i.exec(i.trim());return!t||!((t[4]===void 0?1:t[4].endsWith("%")?parseFloat(t[4])/100:parseFloat(t[4]))>0)?"":`FF${[t[1],t[2],t[3]].map(o=>Math.min(255,Number(o)).toString(16).padStart(2,"0")).join("").toUpperCase()}`}function gi(i){let e=i.renderer.root;if(typeof getComputedStyle!="function"||!e.isConnected)return{of:()=>({}),dispose:()=>{}};let t=document.createElement("div");t.className="fg-row",t.style.cssText="position:absolute;left:-9999px;top:0;visibility:hidden;pointer-events:none";let n=document.createElement("div");t.append(n),e.append(t);let o=a=>{n.className=a?`fg-cell ${a}`:"fg-cell";let l=getComputedStyle(n),c=l.fontWeight;return{color:l.color,fill:l.backgroundColor,bold:c==="bold"||Number(c)>=600}},r=o(""),s=new Map;return{of(a){let l=s.get(a);if(!l){let c=o(a);l={},c.color!==r.color&&St(c.color)&&(l.color=St(c.color)),c.fill!==r.fill&&St(c.fill)&&(l.fill=St(c.fill)),c.bold&&!r.bold&&(l.bold=!0),s.set(a,l)}return l},dispose:()=>t.remove()}}function nn(i,e={}){return be([on(i,e)])}function on(i,e={}){var y;let t=Zt(i,e.columns),n=i.store.state.locale.code,o=[],r=[],s=0;if(e.headers!==!1){let m=t.map(g=>{let v=[];for(let C=g.node;C;C=C.parent)v.unshift(C);return v});s=Math.max(1,...m.map(g=>g.length));let w=g=>{let v="";for(let C=g+1;C>0;C=Math.floor((C-1)/26))v=String.fromCharCode(65+(C-1)%26)+v;return v};for(let g=0;g<s;g++){let v=[];for(let C=0;C<t.length;C++){let R=m[C],k=R.length-1;if(g<k){let T=R[g],b=C>0?m[C-1][g]:null;if(v.push({v:b===T?null:He(T.def,T.id),header:!0}),b!==T){let M=C;for(;M+1<t.length&&m[M+1][g]===T;)M++;M>C&&r.push(`${w(C)}${g+1}:${w(M)}${g+1}`)}}else g===k?(v.push({v:He(t[C].def,t[C].id),header:!0}),s-1>g&&r.push(`${w(C)}${g+1}:${w(C)}${s}`)):v.push({v:null,header:!0})}o.push(v)}}let a=t.map(m=>pi(m.def)),l=t.map(m=>_(m.def,n)),c=Qt(i,e.rows),d=e.styles!==!1,u=d&&t.some(m=>m.def.cellClass)?gi(i):null,h=(m,w,g)=>{var C;if(z(g))return null;let v=(C=a[w])!=null?C:void 0;switch(m.def.type){case"number":{let R=typeof g=="number"?g:Number(g);return Number.isFinite(R)?{v:R,fmt:v}:String(g)}case"date":{let R=ae(g);return R?{v:R,fmt:v}:String(g)}case"boolean":return typeof g=="boolean"?g:String(g);default:return l[w](g)}};try{c.forEach((m,w)=>{o.push(t.map((g,v)=>{let C=G(g.def,m),R=h(g,v,C);if(!d)return R;let k=g.def.align?{align:g.def.align}:{};if(u&&g.def.cellClass){let T;try{T=typeof g.def.cellClass=="function"?g.def.cellClass({value:C,formatted:l[v](C),row:m,rowIndex:w,column:g.def}):g.def.cellClass}catch{T=void 0}T&&(k={...k,...u.of(T)})}return Object.keys(k).length?R!==null&&typeof R=="object"&&!(R instanceof Date)?{...R,...k}:{v:R,...k}:R}))})}finally{u==null||u.dispose()}let p=new Set,f=m=>{let w="";for(let g=m+1;g>0;g=Math.floor((g-1)/26))w=String.fromCharCode(65+(g-1)%26)+w;return w},x=(m,w,g,v)=>{for(let C=m;C<=g;C++)for(let R=w;R<=v;R++)if(p.has(`${C},${R}`))return;for(let C=m;C<=g;C++)for(let R=w;R<=v;R++)p.add(`${C},${R}`);r.push(`${f(w)}${s+m+1}:${f(v)}${s+g+1}`)};return c.forEach((m,w)=>t.forEach((g,v)=>{let C=g.def.colSpan?Ae(g.def.colSpan,g.def,m,w,t.length-v):1;C>1&&x(w,v,w,v+C-1)})),t.forEach((m,w)=>{if(!m.def.merge&&!m.def.rowSpan)return;let g=tt(c,m.def);for(let v=0;v<c.length;v++)g.start[v]===v&&g.end[v]>v&&x(v,w,g.end[v],w)}),{name:(y=e.sheetName)!=null?y:"Sheet1",rows:o,widths:t.map(m=>Math.round(m.width/7)),merges:r,freezeRows:s,autoFilter:s>0}}function Be(i,e,t){if(typeof URL=="undefined"||typeof URL.createObjectURL!="function"||typeof document=="undefined"){O("downloads are not supported in this environment");return}let n=URL.createObjectURL(new Blob(e,{type:t})),o=document.createElement("a");o.href=n,o.download=i,o.style.display="none",document.body.append(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e3)}var kt=i=>String(i!=null?i:"").trim().toLowerCase();function mi(i){var e;return i==null?"":i instanceof Date?i.getHours()||i.getMinutes()||i.getSeconds()?i.toISOString():(e=ee(i))!=null?e:"":String(i)}async function vo(i,e,t={}){var x;let n=e instanceof Uint8Array?e:new Uint8Array(e instanceof ArrayBuffer?e:await e.arrayBuffer()),o;if(xt(n)){let y=await Rt(n),m=typeof t.sheet=="string"?y.find(w=>w.name===t.sheet):y[typeof t.sheet=="number"?t.sheet:0];if(!m)throw new Error(`Sheet ${String(t.sheet)} not found`);o=m.rows}else{let y=new TextDecoder().decode(n);o=bt(y,Xt(y))}if(!o.length)return{rows:[],skipped:0};let r=[],s=y=>y.forEach(m=>m.children?s(m.children):!$(m.id)&&m.def.field&&r.push(m));s(i.columns.roots());let a=y=>{var w,g;let m=kt(y);return m&&(g=(w=r.find(v=>kt(v.def.header)===m))!=null?w:r.find(v=>kt(v.def.field)===m||kt(v.id)===m))!=null?g:null},l=1,c=new Set(o[0].map(a).filter(Boolean));for(;l<Math.min(o.length,5);){let m=((x=o[l])!=null?x:[]).filter(g=>g!=null&&String(g).trim()!==""),w=m.map(a).filter(g=>g&&!c.has(g));if(!m.length||!m.every(g=>typeof g=="string")||!w.length)break;w.forEach(g=>c.add(g)),l++}let d=Math.max(...o.slice(0,l).map(y=>{var m;return(m=y==null?void 0:y.length)!=null?m:0})),u=Array.from({length:d},(y,m)=>{var w;for(let g=l-1;g>=0;g--){let v=(w=o[g])==null?void 0:w[m];if(v!=null&&String(v).trim()!=="")return a(v)}return null}),h=i.store.state.data[0],p=0,f=[];for(let y of o.slice(l)){if(!y||y.every(w=>w==null||String(w).trim()===""))continue;let m={};u.forEach((w,g)=>{if(!w)return;let v=w.def,C=mi(y[g]),R=i.acceptText(v,m,C,h==null?void 0:h[v.field]);R.ok?C===""&&(R.value===null||R.value==="")||(m[v.field]=R.value):p++}),f.push(m)}return t.mode==="replace"?i.setData(f):i.addRows(f),{rows:f,skipped:p}}var wi="http://www.w3.org/2000/svg";var rn=["var(--fg-accent, #2563eb)","#f59e0b","#10b981","#ef4444","#8b5cf6","#06b6d4","#ec4899","#84cc16","#f97316","#64748b","#14b8a6","#a855f7"],ge=i=>rn[i%rn.length];function j(i,e={},t=""){let n=document.createElementNS(wi,i);t&&n.setAttribute("class",t);for(let[o,r]of Object.entries(e))n.setAttribute(o,String(r));return n}function Ge(i,e){let t=j("title");t.textContent=e,i.append(t)}function sn(i,e,t=5){let n=Math.min(0,i),o=Math.max(0,e);n===o&&(o=n+1);let r=(o-n)/t,s=10**Math.floor(Math.log10(r)),a=[1,2,5,10].map(c=>c*s).find(c=>c>=r);n=Math.floor(n/a)*a,o=Math.ceil(o/a)*a;let l=[];for(let c=n;c<=o+a/2;c+=a)l.push(Math.round(c/a)*a);return l}function Mt(i,e){var D,E;let t=new Intl.NumberFormat(e.locale,{maximumFractionDigits:2}),n=new Intl.NumberFormat(e.locale,{notation:"compact",maximumFractionDigits:1}),o=j("svg",{viewBox:"0 0 640 360",role:"img",preserveAspectRatio:"xMidYMid meet"},`fg-chart fg-chart-is-${e.type}`);e.title&&o.setAttribute("aria-label",e.title);let r=e.series.slice(0,rn.length),s=e.categories,a=16;if(e.title){let L=j("text",{x:320,y:22,"text-anchor":"middle"},"fg-chart-title");L.textContent=e.title,o.append(L),a=36}let l=j("g",{},"fg-chart-legend"),c=e.type==="pie"||e.type==="donut",d=c?s:e.type==="scatter"?r.slice(1).map(L=>L.name):r.map(L=>L.name),u=16;d.forEach((L,I)=>{let A=j("g",{transform:`translate(${u},350)`},"fg-chart-legend-item");A.append(j("rect",{x:0,y:-9,width:10,height:10,rx:2,fill:ge(I)}));let F=j("text",{x:14,y:0});F.textContent=L,A.append(F),l.append(A),u+=24+Math.min(140,L.length*7)});let h=308;if(e.type==="scatter"){vi(o,e,r,a,h,t,n),o.append(l),i.replaceChildren(o);return}if(c){let L=((E=(D=r[0])==null?void 0:D.values)!=null?E:[]).map(H=>H!==null&&H>0?H:0),I=L.reduce((H,B)=>H+B,0),A=640/2,F=(a+h)/2,P=Math.max(10,(h-a)/2-6),N=-Math.PI/2;L.forEach((H,B)=>{if(!H||!I)return;let W=N+H/I*Math.PI*2,q=W-N>Math.PI?1:0,U=J=>`${A+P*Math.cos(J)},${F+P*Math.sin(J)}`,K=H===I?`M${A-P},${F}a${P},${P} 0 1,0 ${2*P},0a${P},${P} 0 1,0 ${-2*P},0`:`M${A},${F}L${U(N)}A${P},${P} 0 ${q} 1 ${U(W)}Z`,V=j("path",{d:K,fill:ge(B)},"fg-chart-slice");Ge(V,`${s[B]}: ${t.format(H)} (${Math.round(H/I*1e3)/10}%)`),o.append(V),N=W}),e.type==="donut"&&o.append(j("circle",{cx:A,cy:F,r:P*.58,fill:"var(--fg-bg, #fff)"},"fg-chart-donut-hole")),o.append(l),i.replaceChildren(o);return}let p=e.type==="stackedBar",f=0,x=0;s.forEach((L,I)=>{let A=0,F=0;for(let P of r){let N=P.values[I];N==null||!Number.isFinite(N)||(p?N>=0?A+=N:F+=N:(x=Math.max(x,N),f=Math.min(f,N)))}p&&(x=Math.max(x,A),f=Math.min(f,F))});let y=sn(f,x),m=y[0],w=y[y.length-1],g=56,v=624,C=L=>h-(L-m)/(w-m)*(h-a),R=j("g",{},"fg-chart-axis");for(let L of y){R.append(j("line",{x1:g,x2:v,y1:C(L),y2:C(L)},L===0?"fg-chart-zero":"fg-chart-grid"));let I=j("text",{x:g-6,y:C(L)+4,"text-anchor":"end"});I.textContent=n.format(L),R.append(I)}let k=(v-g)/Math.max(1,s.length),T=Math.max(1,Math.ceil(s.length/Math.floor((v-g)/56)));s.forEach((L,I)=>{if(I%T)return;let A=j("text",{x:g+k*(I+.5),y:h+16,"text-anchor":"middle"}),F=Math.max(3,Math.min(12,Math.floor(k*T/10)));A.textContent=L.length>F?`${L.slice(0,F-1)}\u2026`:L,R.append(A)}),o.append(R);let b=j("g",{},"fg-chart-plot"),M=e.type==="combo";if(M){let L=k*.6,I=r[0];s.forEach((A,F)=>{let P=I==null?void 0:I.values[F];if(P==null||!Number.isFinite(P))return;let N=g+k*F+(k-L)/2,H=j("rect",{x:N,y:Math.min(C(0),C(P)),width:Math.max(1,L-2),height:Math.max(.5,Math.abs(C(P)-C(0))),fill:ge(0),rx:2},"fg-chart-bar");Ge(H,`${I.name} \xB7 ${A}: ${t.format(P)}`),b.append(H)})}if(e.type==="bar"||p){let L=k*.72,I=p?L:L/Math.max(1,r.length);s.forEach((A,F)=>{let P=0,N=0;r.forEach((H,B)=>{let W=H.values[F];if(W==null||!Number.isFinite(W))return;let q=0,U=W;p&&(q=W>=0?P:N,U=q+W,W>=0?P=U:N=U);let K=g+k*F+(k-L)/2+(p?0:I*B),V=j("rect",{x:K,y:Math.min(C(q),C(U)),width:Math.max(1,I-2),height:Math.max(.5,Math.abs(C(U)-C(q))),fill:ge(B),rx:2},"fg-chart-bar");Ge(V,`${H.name} \xB7 ${A}: ${t.format(W)}`),b.append(V)})})}else r.forEach((L,I)=>{if(M&&I===0)return;let A=L.values.map((N,H)=>N==null||!Number.isFinite(N)?null:[g+k*(H+.5),C(N),N]),F="",P=!1;for(let N of A){if(!N){P=!1;continue}F+=`${P?"L":"M"}${N[0]},${N[1]}`,P=!0}if(e.type==="area"){let N=A.filter(H=>!!H);if(N.length){let H=`M${N[0][0]},${C(0)}${N.map(B=>`L${B[0]},${B[1]}`).join("")}L${N[N.length-1][0]},${C(0)}Z`;b.append(j("path",{d:H,fill:ge(I),"fill-opacity":.18},"fg-chart-area"))}}b.append(j("path",{d:F,fill:"none",stroke:ge(I),"stroke-width":2.2,"stroke-linejoin":"round"},"fg-chart-line")),A.forEach((N,H)=>{if(!N)return;let B=j("circle",{cx:N[0],cy:N[1],r:3.5,fill:ge(I)},"fg-chart-point");Ge(B,`${L.name} \xB7 ${s[H]}: ${t.format(N[2])}`),b.append(B)})});o.append(b,l),i.replaceChildren(o)}function vi(i,e,t,n,o,r,s){var C,R,k,T;let a=(R=(C=t[0])==null?void 0:C.values)!=null?R:[],l=t.slice(1),c=b=>b!=null&&Number.isFinite(b),d=a.filter(c),u=l.flatMap(b=>b.values.filter(c));if(!d.length||!u.length)return;let h=sn(Math.min(...d),Math.max(...d)),p=sn(Math.min(...u),Math.max(...u)),f=56,x=624,y=b=>f+(b-h[0])/(h[h.length-1]-h[0])*(x-f),m=b=>o-(b-p[0])/(p[p.length-1]-p[0])*(o-n),w=j("g",{},"fg-chart-axis");for(let b of p){w.append(j("line",{x1:f,x2:x,y1:m(b),y2:m(b)},b===0?"fg-chart-zero":"fg-chart-grid"));let M=j("text",{x:f-6,y:m(b)+4,"text-anchor":"end"});M.textContent=s.format(b),w.append(M)}h.forEach((b,M)=>{let D=M===0?"start":M===h.length-1?"end":"middle",E=j("text",{x:y(b),y:o+16,"text-anchor":D});E.textContent=s.format(b),w.append(E)});let g=j("text",{x,y:o+32,"text-anchor":"end"},"fg-chart-axis-name");g.textContent=`${(T=(k=t[0])==null?void 0:k.name)!=null?T:""} \u2192`,w.append(g),i.append(w);let v=j("g",{},"fg-chart-plot");a.forEach((b,M)=>{c(b)&&l.forEach((D,E)=>{var A;let L=D.values[M];if(!c(L))return;let I=j("circle",{cx:y(b),cy:m(L),r:4,fill:ge(E),"fill-opacity":.8},"fg-chart-point");Ge(I,`${(A=e.categories[M])!=null?A:""}: ${t[0].name} ${r.format(b)}, ${D.name} ${r.format(L)}`),v.append(I)})}),i.append(v)}var yi=12,yo=500,an=["bar","stackedBar","line","area","combo","pie","donut","scatter"],Et=class{constructor(e){this.grid=e;this.handles=new Set}create(e={}){var x,y;let{grid:t}=this,n=an.includes(e.type)?e.type:"bar",o=()=>t.store.state.locale,r=(x=e.range)!=null?x:t.store.state.range,s=null;if(r){let m=t.columns.getColumn(r.start.colId),w=t.columns.getColumn(r.end.colId);if(m&&w){let g=Fe({start:{rowIndex:r.start.rowIndex,colIndex:m.index},end:{rowIndex:r.end.rowIndex,colIndex:w.index}}),v=[];for(let C=g.r1;C<=g.r2&&v.length<yo;C++){let R=t.rowModel.getRow(C);R&&!R.kind&&v.push(R.data)}s={rows:v,colIds:t.columns.displayed().slice(g.c1,g.c2+1).filter(C=>!$(C.id)).map(C=>C.id)}}}let a=()=>{var T;let m=s?s.rows:t.rowModel.dataRows().slice(0,yo).map(b=>b.data),w=(s?s.colIds.map(b=>t.columns.getColumn(b)):t.columns.displayed().filter(b=>!$(b.id))).filter(b=>!!b),g=w[0]&&w[0].def.type!=="number"?w[0]:s?null:(T=w.find(b=>b.def.type!=="number"))!=null?T:null,v=b=>!!b.node.parent&&b.node.parent.id==="pivotgroup|total",C=w.filter(b=>b!==g&&b.def.type==="number"&&(s||!v(b))).slice(0,yi),R=b=>{var D,E,L;let M=[];for(let I=b.node.parent;I;I=I.parent)M.unshift((D=I.def.header)!=null?D:I.id);return M.push((L=(E=b.def.header)!=null?E:b.def.field)!=null?L:b.id),M.join(" \xB7 ")},k=g?_(g.def,o().code):null;return{categories:m.map((b,M)=>g&&k?k(G(g.def,b)):String(M+1)),series:C.map(b=>({name:R(b),values:m.map(M=>{let D=G(b.def,M),E=typeof D=="number"?D:D==null||D===""?NaN:Number(D);return Number.isFinite(E)?E:null})}))}},l=S("div","fg-chart-body"),c=null,d=()=>Mt(l,{type:n,title:e.title,locale:o().code,...a()}),u=m=>({bar:o().chartBar,stackedBar:o().chartStacked,line:o().chartLine,area:o().chartArea,pie:o().chartPie,donut:o().chartDonut,combo:o().chartCombo,scatter:o().chartScatter})[m],h=()=>c==null?void 0:c.querySelectorAll(".fg-chart-type").forEach(m=>m.setAttribute("aria-pressed",String(m.dataset.type===n)));if(e.container)e.container.append(l);else{c=S("div","fg-chart-panel",{role:"dialog","aria-label":(y=e.title)!=null?y:u(n)});let m=S("div","fg-chart-head");for(let g of an){let v=S("button","fg-chart-type",{type:"button",title:u(g)});v.dataset.type=g,v.textContent=u(g),v.addEventListener("click",()=>f.setType(g)),m.append(v)}let w=S("button","fg-chooser-close",{type:"button","aria-label":o().close});w.textContent="\xD7",w.addEventListener("click",()=>f.destroy()),m.append(S("span","fg-chart-spacer"),w),c.append(m,l),t.renderer.root.append(c)}let p=[t.events.on("cellValueChanged",()=>d()),t.events.on("rowsAdded",()=>d()),t.events.on("rowsRemoved",()=>d())];s||p.push(t.events.on("sortChange",()=>d()),t.events.on("filterChange",()=>d()));let f={el:l,setType:m=>{an.includes(m)&&(n=m,h(),d())},update:()=>d(),destroy:()=>{p.forEach(m=>m()),(c!=null?c:l).remove(),this.handles.delete(f)}};return this.handles.add(f),h(),d(),f}destroy(){for(let e of[...this.handles])e.destroy()}};function bo(i,e,t){return typeof i=="number"&&typeof e=="number"?i-e:i instanceof Date&&e instanceof Date?i.getTime()-e.getTime():typeof i=="boolean"&&typeof e=="boolean"?Number(i)-Number(e):t.compare(String(i),String(e))}function bi(i,e){var t,n;if(z(e))return null;if(i.type==="number"){let o=typeof e=="number"?e:Number(e);return Number.isNaN(o)?null:o}return i.type==="date"?(n=(t=ae(e))==null?void 0:t.getTime())!=null?n:null:e}function xe(i,e,t){let n=z(i),o=z(e);return n||o?n===o?0:n?1:-1:bo(i,e,t)}function xo(i,e,t,n){let o=e.map(a=>({def:t(a.colId),mul:a.dir==="desc"?-1:1})).filter(a=>!!a.def);if(!o.length)return i;let r=o.map(a=>i.map(l=>{let c=G(a.def,l.data);return a.def.comparator?c:bi(a.def,c)})),s=i.map((a,l)=>l);return s.sort((a,l)=>{var c;for(let d=0;d<o.length;d++){let{def:u,mul:h}=o[d],p=r[d][a],f=r[d][l],x;if(u.comparator)try{x=(Number(u.comparator(p,f,i[a].data,i[l].data))||0)*h}catch{O(`comparator of column "${(c=u.id)!=null?c:u.field}" threw; treating values as equal`),x=0}else{let y=z(p),m=z(f);x=y||m?y===m?0:y?1:-1:bo(p,f,n)*h}if(x)return x}return a-l}),s.map(a=>i[a])}var Co=new WeakMap,xi=i=>typeof i=="function"?"custom":i;function ln(i,e){var t,n,o;return{rows:((t=i.rows)!=null?t:[]).filter(e),columns:((n=i.columns)!=null?n:[]).filter(e),values:((o=i.values)!=null?o:[]).filter(r=>r&&e(r.colId)).map(r=>{var s;return{colId:r.colId,aggFunc:(s=r.aggFunc)!=null?s:"sum"}}),totals:i.totals!==!1}}function Ro(i,e,t,n,o){let r=ln(e,g=>!!t(g)),s=new Intl.Collator(o,{numeric:!0,sensitivity:"base"}),a=g=>t(g),l=(g,v)=>g.map(C=>Z(G(a(C),v))).join(""),c=new Map;for(let g of i){let v=l(r.columns,g);c.has(v)||c.set(v,r.columns.map(C=>G(a(C),g)))}let d=[...c.entries()].sort((g,v)=>{for(let C=0;C<r.columns.length;C++){let R=xe(g[1][C],v[1][C],s);if(R)return R}return 0});r.columns.length||d.splice(0,d.length,["",[]]);let u=[],h=(g,v,C)=>{var D,E;let R=r.values[v],k=a(R.colId),T=`pivot|${C}|${v}`;u.push({id:T,comboKey:g,valueIndex:v});let b=L=>g===null||l(r.columns,L)===g,M=R.aggFunc;return{id:T,field:T,header:`${(E=(D=k.header)!=null?D:k.field)!=null?E:R.colId} (${n.agg(xi(M))})`,type:"number",format:M==="count"?"integer":k.format,width:130,aggFunc:(L,I)=>{let A=I.flatMap(F=>{var P;return(P=Co.get(F))!=null?P:[]}).filter(b);return A.length?Se(M,A.map(F=>G(k,F)),A):null}}},p=[],f=(g,v)=>{if(z(v))return n.blank;let C=a(g);return C.type==="number"&&!C.format?String(v):_(C,o)(v)};if(!r.columns.length)r.values.forEach((g,v)=>p.push(h("",v,0)));else{let g=(v,C,R)=>{let k=[],T=0;for(;T<v.length;){let b=v[T][1][C],M=Z(b),D=T;for(;D<v.length&&Z(v[D][1][C])===M;)D++;let E=v.slice(T,D),L=C===r.columns.length-1?r.values.map((I,A)=>h(E[0][0],A,R+T)):g(E,C+1,R+T);k.push({id:`pivotgroup|${C}|${R+T}`,header:f(r.columns[C],b),children:L}),T=D}return k};p.push(...g(d,0,0)),r.totals&&r.values.length&&p.push({id:"pivotgroup|total",header:n.total,children:r.values.map((v,C)=>h(null,C,"total"))})}let x=new Map;for(let g of i){let v=l(r.rows,g),C=x.get(v);C||x.set(v,C={values:r.rows.map(R=>G(a(R),g)),src:[]}),C.src.push(g)}let m=[...x.values()].sort((g,v)=>{for(let C=0;C<r.rows.length;C++){let R=xe(g.values[C],v.values[C],s);if(R)return R}return 0}).map(g=>{var R;let v={};r.rows.forEach((k,T)=>{var b;v[(b=a(k).field)!=null?b:k]=g.values[T]});let C=new Map;if(r.columns.length)for(let k of g.src){let T=l(r.columns,k),b=C.get(T);b||C.set(T,b=[]),b.push(k)}for(let k of u){let T=r.values[k.valueIndex],b=k.comboKey===null||!r.columns.length?g.src:(R=C.get(k.comboKey))!=null?R:[],M=a(T.colId);v[k.id]=b.length?Se(T.aggFunc,b.map(D=>G(M,D)),b):null}return Co.set(v,g.src),v});return{columns:[...r.rows.map(g=>{var C,R,k,T;let v=a(g);return{id:g,field:(C=v.field)!=null?C:g,header:(k=(R=v.header)!=null?R:v.field)!=null?k:g,type:v.type,format:v.format,width:(T=v.width)!=null?T:140}}),...p],rows:m,groupBy:r.rows.slice(0,-1)}}var ze="1.0.1";var Ci={kty:"EC",crv:"P-256",x:"sUTKkglZmk-HMKPNub8p7AeLBKesHCU8irIkw9rJlbE",y:"j0U_aKRDR7iApY9UpaD3hUemhBLZJwDv9-QiT_hUyw8"},dn="https://freegrid.app/pricing/",So="https://freegrid.app/api/usage",Ri="https://freegrid.app/api/domain-status",ko=i=>{let e=atob(i.replace(/-/g,"+").replace(/_/g,"/")+"=".repeat((4-i.length%4)%4));return Uint8Array.from(e,t=>t.charCodeAt(0))};function un(i){let e=i.toLowerCase().replace(/^\[|\]$/g,"");return!e||e==="localhost"||e==="127.0.0.1"||e==="::1"||e==="0.0.0.0"||e.endsWith(".localhost")||e.endsWith(".test")||e.endsWith(".local")||/^(10|192\.168|172\.(1[6-9]|2\d|3[01]))\./.test(e)}function Si(i,e){let t=i.toLowerCase().replace(/\.$/,"");return e.some(n=>{let o=n.toLowerCase().replace(/\.$/,""),r=o.startsWith("*."),s=r?o.slice(2):o;return s?t===s||t===`www.${s}`?!0:r&&t.endsWith(`.${s}`):!1})}var ki=i=>{let e=typeof i=="string"?/^(\d{4})-(\d{2})-(\d{2})$/.exec(i):null;if(!e)return!1;let t=new Date(Date.UTC(Number(e[1]),Number(e[2])-1,Number(e[3])));return t.getUTCMonth()===Number(e[2])-1&&t.getUTCDate()===Number(e[3])},Mi=i=>`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`;async function hn(i,e,t={}){var s,a;let n=typeof i=="string"?i.trim().split("."):[];if(n.length!==3||n[0]!=="FG1")return{ok:!1,reason:"format"};let o;try{if(o=JSON.parse(new TextDecoder().decode(ko(n[1]))),!Array.isArray(o.domains)||!ki(o.expires))return{ok:!1,reason:"format"}}catch{return{ok:!1,reason:"format"}}let r=typeof crypto!="undefined"?crypto.subtle:void 0;if(!r)return{ok:!1,reason:"unsupported",info:o};try{let l=await r.importKey("jwk",(s=t.publicKey)!=null?s:Ci,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"]),c=new TextEncoder().encode(`${n[0]}.${n[1]}`);if(!await r.verify({name:"ECDSA",hash:"SHA-256"},l,ko(n[2]),c))return{ok:!1,reason:"signature",info:o}}catch{return{ok:!1,reason:"signature",info:o}}return Mi((a=t.now)!=null?a:new Date)>o.expires?{ok:!1,reason:"expired",info:o}:Si(e,o.domains)?{ok:!0,info:o}:{ok:!1,reason:"domain",info:o}}var cn,Mo=new Map,Ve=null;function To(i){cn=i}var Eo={missing:`FreeGrid is free for personal use. Company use needs a domain license (\u20A9200,000 per domain per year): ${dn}
16
+ FreeGrid\uB294 \uAC1C\uC778\uC5D0\uAC8C \uBB34\uB8CC\uC785\uB2C8\uB2E4. \uD68C\uC0AC\uC5D0\uC11C \uC4F0\uB824\uBA74 \uB3C4\uBA54\uC778 \uB77C\uC774\uC120\uC2A4(\uB3C4\uBA54\uC778\uB2F9 \uC5F0 20\uB9CC \uC6D0)\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4: ${dn}`,format:"FreeGrid: the license key is not in the right format. / \uB77C\uC774\uC120\uC2A4 \uD0A4 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",signature:"FreeGrid: the license key could not be verified. / \uB77C\uC774\uC120\uC2A4 \uD0A4\uB97C \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",expired:"FreeGrid: the license key has expired. / \uB77C\uC774\uC120\uC2A4 \uAE30\uAC04\uC774 \uB05D\uB0AC\uC2B5\uB2C8\uB2E4.",domain:"FreeGrid: the license key is for a different domain. / \uB2E4\uB978 \uB3C4\uBA54\uC778\uC6A9 \uB77C\uC774\uC120\uC2A4 \uD0A4\uC785\uB2C8\uB2E4."};function Lo(i,e=typeof location!="undefined"?location.hostname:""){try{if(un(e)||typeof navigator=="undefined")return;let t=new Date().toISOString().slice(0,10),n=`${e}|${t}|${i.licensed?1:0}`,o=typeof localStorage!="undefined"?localStorage:null;if((o==null?void 0:o.getItem("freegrid:usage"))===n)return;o==null||o.setItem("freegrid:usage",n);let r=JSON.stringify({version:i.version,licensed:i.licensed,company:i.company,url:`${location.origin}${location.pathname}`});typeof navigator.sendBeacon=="function"?navigator.sendBeacon(So,r):typeof fetch=="function"&&fetch(So,{method:"POST",body:r,mode:"no-cors",keepalive:!0}).catch(()=>{})}catch{}}function Ei(i=cn,e=typeof location!="undefined"?location.hostname:""){if(un(e))return Promise.resolve(!0);let t=i!=null?i:cn,n=`${t!=null?t:""}@${e}`,o=Mo.get(n);return o||(t?o=hn(t,e).then(r=>{if(Lo({version:ze,licensed:r.ok,company:r.ok?r.info.company:void 0},e),r.ok||r.reason==="unsupported")return r.ok||r.reason==="unsupported";let s=r.info?` (${r.info.domains.join(", ")}, ${r.info.expires})`:"";return console.warn(`${Eo[r.reason]}${s}
17
+ ${dn}`),!1},()=>!1):(console.info(Eo.missing),Lo({version:ze,licensed:!1},e),o=Promise.resolve(!1)),Mo.set(n,o),o)}function Li(i=typeof location!="undefined"?location.hostname:""){var n;if(un(i)||typeof fetch!="function")return Promise.resolve(!1);if(Ve)return Ve;let e=new Date().toISOString().slice(0,10),t=null;try{t=typeof localStorage!="undefined"?localStorage:null;let o=JSON.parse((n=t==null?void 0:t.getItem("freegrid:badge"))!=null?n:"null");if(o&&o.host===i&&o.day===e)return Ve=Promise.resolve(o.show)}catch{}return Ve=fetch(Ri,{mode:"cors",credentials:"omit"}).then(o=>o.ok?o.json():{badge:!1}).then(o=>{let r=o.badge===!0;try{t==null||t.setItem("freegrid:badge",JSON.stringify({host:i,day:e,show:r}))}catch{}return r},()=>!1),Ve}async function Io(i,e=typeof location!="undefined"?location.hostname:""){return await Ei(i,e)?!1:Li(e)}var qe={text:["contains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["eq","ne","lt","lte","gt","gte","between","blank","notBlank"],date:["equals","before","after","between","blank","notBlank"]},Do=["blank","notBlank"],fn=500,Lt=class{constructor(e){this.grid=e;this.popup=null;this.colId=null;this.off=[]}get openColumn(){return this.colId}toggle(e,t){this.colId===e?this.close():this.open(e,t)}open(e,t){var x;this.close();let n=this.grid.columns.getNode(e);if(!n||n.children||$(e))return;let o=this.grid.store.state.locale,r=n.def,s=S("div",`fg-menu fg-theme-${this.grid.store.state.theme}`,{role:"dialog","aria-label":o.columnMenu});this.grid.applyFontTo(s),ve(r)&&s.append(this.section([[o.sortAsc,()=>this.grid.setSort([{colId:e,dir:"asc"}])],[o.sortDesc,()=>this.grid.setSort([{colId:e,dir:"desc"}])],[o.clearSort,()=>this.grid.setSort(this.grid.store.state.sort.filter(y=>y.colId!==e))]])),s.append(this.section([[o.pinLeft,()=>this.grid.setPinned(e,"left")],[o.pinRight,()=>this.grid.setPinned(e,"right")],[o.unpin,()=>this.grid.setPinned(e,null)]]));let a=this.grid.getGroupBy();if(!this.grid.options.treeData&&(this.grid.options.groupPanel||a.length)){let y=a.includes(e)?[[o.ungroup,()=>this.grid.setGroupBy(a.filter(m=>m!==e))]]:[[o.groupByThis,()=>this.grid.setGroupBy([...a,e])]];a.length&&y.push([o.expandAll,()=>this.grid.expandAll(!0)],[o.collapseAll,()=>this.grid.expandAll(!1)]),s.append(this.section(y))}let l=[[o.autosizeThis,()=>this.grid.autoSize([e])],[o.autosizeAll,()=>this.grid.autoSize()]];r.lockVisible||l.push([o.hideColumn,()=>this.grid.setColumnsVisible([e],!1)]),l.push([o.chooseColumns,()=>this.grid.chooser.open()],[o.resetColumns,()=>this.grid.resetColumns()]),s.append(this.section(l));let c=this.filterSection(e,()=>this.close());c&&s.append(c),oe(this.grid.renderer.root).append(s);let d=t.getBoundingClientRect(),u=s.offsetWidth||248;s.style.left=`${Math.max(4,Math.min(d.right-u,window.innerWidth-u-4))}px`;let h=Math.max(4,Math.min(d.bottom+4,window.innerHeight-240));s.style.top=`${h}px`,s.style.maxHeight=`${Math.max(160,window.innerHeight-h-8)}px`,this.popup=s,this.colId=e;let p=y=>{pe(y,s,t)||this.close()},f=y=>{y.key==="Escape"&&(this.close(),this.grid.renderer.gridEl.focus())};document.addEventListener("pointerdown",p,!0),document.addEventListener("keydown",f,!0),this.off.push(()=>document.removeEventListener("pointerdown",p,!0),()=>document.removeEventListener("keydown",f,!0)),(x=s.querySelector(".fg-filter-value:not([hidden]), .fg-set-search, .fg-menu-item"))==null||x.focus()}filterSection(e,t){let n=this.grid.columns.getNode(e);if(!n||n.children)return null;let o=this.grid.store.state.locale,r=ie(n.def);return r==="set"?this.setFilter(e,o,t):r?this.conditionFilter(e,r,o,t):null}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null,this.colId=null}section(e){let t=S("div","fg-menu-section");for(let[n,o]of e){let r=S("button","fg-menu-item",{type:"button"});r.textContent=n,r.addEventListener("click",()=>{o(),this.close()}),t.append(r)}return t}actions(e,t,n,o){let r=S("div","fg-menu-actions"),s=S("button","fg-btn",{type:"button"});s.textContent=t.reset,s.addEventListener("click",()=>{this.grid.setFilter(e,null),o()});let a=S("button","fg-btn fg-btn-primary",{type:"button"});return a.textContent=t.apply,a.addEventListener("click",n),r.append(s,a),r}title(e){let t=S("div","fg-menu-title");return t.textContent=e.filter,t}conditionRow(e,t,n,o,r){var p;let s=S("div","fg-filter-cond"),a=S("select","fg-filter-op",{"aria-label":t.filter});if(o){let f=S("option");f.value="",f.textContent="\u2014",a.append(f)}for(let f of qe[e]){let x=S("option");x.value=f,x.textContent=t.ops[f],a.append(x)}a.value=(p=n==null?void 0:n.op)!=null?p:o?"":qe[e][0];let l=e==="text"?"text":e,c=S("input","fg-input fg-filter-value",{type:l,placeholder:t.value,"aria-label":t.value}),d=S("input","fg-input fg-filter-value-to",{type:l,placeholder:t.valueTo,"aria-label":t.valueTo});n&&(c.value=n.value!=null?String(n.value):"",d.value="valueTo"in n&&n.valueTo!=null?String(n.valueTo):"");let u=()=>{c.hidden=!a.value||Do.includes(a.value),d.hidden=a.value!=="between"};a.addEventListener("change",u),u();for(let f of[c,d])f.addEventListener("keydown",x=>x.key==="Enter"&&r());return s.append(a,c,d),{row:s,read:()=>{let f=a.value;if(!f)return null;let x=!Do.includes(f);if(e==="number"){let y=c.value===""?void 0:Number(c.value),m=d.value===""?void 0:Number(d.value);return!x||y!==void 0?{type:e,op:f,value:y,valueTo:m}:null}return e==="date"?!x||c.value?{type:e,op:f,value:c.value||void 0,valueTo:d.value||void 0}:null:!x||c.value?{type:e,op:f,value:c.value}:null}}}conditionFilter(e,t,n,o){var x,y;let r=this.grid.store.state.filters[e],s=(r==null?void 0:r.type)==="combined"?r.conditions:r?[r]:[],a=((x=s[0])==null?void 0:x.type)===t?s[0]:void 0,l=((y=s[1])==null?void 0:y.type)===t?s[1]:void 0,c=S("div","fg-menu-section fg-filter"),d=()=>{var C;let m=u.read(),w=h.read(),g=((C=p.querySelector("input:checked"))==null?void 0:C.value)==="or"?"or":"and",v=m&&w?{type:"combined",operator:g,conditions:[m,w]}:m!=null?m:w;this.grid.setFilter(e,v),o()},u=this.conditionRow(t,n,a,!1,d),h=this.conditionRow(t,n,l,!0,d),p=S("div","fg-filter-join",{role:"radiogroup"}),f=`fg-join-${e}-${Math.random().toString(36).slice(2,7)}`;for(let m of["and","or"]){let w=S("label"),g=S("input","",{type:"radio",name:f,value:m});g.checked=((r==null?void 0:r.type)==="combined"?r.operator:"and")===m,w.append(g,` ${n[m]}`),p.append(w)}return c.append(this.title(n),u.row,p,h.row,this.actions(e,n,d,o)),c}setFilter(e,t,n){let{grid:o}=this,r=o.columns.getNode(e).def,s=_(r,t.code),a=o.collator(),l=new Map;for(let R of o.rowModel.allNodes()){let k=G(r,R.data),T=Z(k);l.has(T)||l.set(T,k)}let c=[...l.entries()].sort((R,k)=>xe(R[1],k[1],a)),d=o.store.state.filters[e],u=new Set((d==null?void 0:d.type)==="set"?d.values.map(Z).filter(R=>l.has(R)):l.keys()),h=(R,k)=>R===""?t.blanks:s(k),p=S("div","fg-menu-section fg-filter fg-set-filter"),f=S("input","fg-input fg-set-search",{type:"search",placeholder:t.search,"aria-label":t.search}),x=S("label","fg-set-item fg-set-all"),y=S("input","fg-checkbox",{type:"checkbox"});x.append(y,document.createTextNode(t.selectAll));let m=S("div","fg-set-list"),w=()=>{let R=f.value.trim().toLowerCase();return R?c.filter(([k,T])=>h(k,T).toLowerCase().includes(R)):c},g=()=>{let R=w(),k=R.filter(([T])=>u.has(T)).length;y.checked=k>0&&k===R.length,y.indeterminate=k>0&&k<R.length},v=()=>{let R=w();if(m.replaceChildren(...R.slice(0,fn).map(([k,T])=>{let b=S("label","fg-set-item"),M=S("input","fg-checkbox",{type:"checkbox"});return M.checked=u.has(k),M.addEventListener("change",()=>{M.checked?u.add(k):u.delete(k),g()}),b.append(M,document.createTextNode(h(k,T))),b})),R.length>fn){let k=S("div","fg-set-more");k.textContent=`\u2026 +${R.length-fn}`,m.append(k)}g()};y.addEventListener("change",()=>{for(let[R]of w())y.checked?u.add(R):u.delete(R);v()}),f.addEventListener("input",v);let C=()=>{o.setFilter(e,u.size===l.size?null:{type:"set",values:c.filter(([R])=>u.has(R)).map(([,R])=>R)}),n()};return f.addEventListener("keydown",R=>R.key==="Enter"&&C()),v(),p.append(this.title(t),f,x,m,this.actions(e,t,C,n)),p}};var Ao=new WeakMap,Ti=0;function Ce(i){let e=Ao.get(i);return e||Ao.set(i,e=`r${++Ti}`),e}var Tt=class{constructor(e){this.deps=e;this.stats={filterRuns:0,sortRuns:0};this.server=!1;this.full=[];this.last={};this.nodes=[];this.filtered=[];this.sorted=[];this.display=[];this.indexById=null;this.layoutCache=null}update(e){var u,h,p,f;let t=this.deps.collator(),n=e.display,o=!!(n!=null&&n.getParentId)!=!!((u=this.last.display)!=null&&u.getParentId),r=e.data!==this.last.data,s=r||o||e.filters!==this.last.filters||e.quickFilter!==this.last.quickFilter||e.advancedFilter!==this.last.advancedFilter,a=s||e.sort!==this.last.sort||t!==this.last.collator,l=a||(n==null?void 0:n.version)!==this.last.displayVersion||(n==null?void 0:n.groupBy)!==((h=this.last.display)==null?void 0:h.groupBy);if(r){let x=this.deps.getRowId;this.nodes=e.data.map((y,m)=>({id:x?String(x(y)):Ce(y),data:y,sourceIndex:m}))}s&&(this.filtered=this.filter(e),this.stats.filterRuns++),a&&(this.sorted=xo(this.filtered,e.sort,x=>this.deps.columnDef(x),t),this.stats.sortRuns++),l&&(this.full=n?this.buildDisplay(n,e.sort,t):this.sorted);let c=(p=e.page)!=null?p:null,d=(f=this.last.page)!=null?f:null;(l||(c==null?void 0:c.index)!==(d==null?void 0:d.index)||(c==null?void 0:c.size)!==(d==null?void 0:d.size))&&(this.display=c?this.full.slice(c.index*c.size,(c.index+1)*c.size):this.full,this.indexById=null,this.layoutCache=null),this.last={...e,collator:t,displayVersion:n==null?void 0:n.version}}invalidate(){this.last={}}fullCount(){return this.full.length}dataCount(){return this.sorted.length}loading(){return!1}getRowCount(){return this.display.length}getRow(e){return this.display[e]}rows(){return this.display}dataRows(){return this.sorted}allNodes(){return this.nodes}idOf(e){return this.deps.getRowId?String(this.deps.getRowId(e)):Ce(e)}indexOfId(e){var t;return this.indexById||(this.indexById=new Map(this.display.map((n,o)=>[n.id,o]))),(t=this.indexById.get(e))!=null?t:-1}layout(e,t,n,o=0,r){var u;let s=this.layoutCache;if(s&&s.rows===this.display&&s.rh===e&&s.dh===t&&s.hv===o)return s;let a=this.display.length,l=new Float64Array(a+1),c=!0,d=n&&n.size?n:null;for(let h=0;h<a;h++){let p=this.display[h],f=e;if(p.kind==="detail")f=t;else if(!p.kind){d&&(f=(u=d.get(p.id))!=null?u:e);let x=r==null?void 0:r(p.data);typeof x=="number"&&x>0&&(f=d?Math.max(f,x):x)}f!==e&&(c=!1),l[h+1]=l[h]+f}return this.layoutCache={rows:this.display,rh:e,dh:t,hv:o,offsets:l,uniform:c},this.layoutCache}filter(e){var d;let t=Object.entries(e.filters).map(([u,h])=>({def:this.deps.columnDef(u),pred:Qe(h)})).filter(u=>!!u.def),n=Un(e.quickFilter),o=n.length?this.deps.quickColumns():[],r=e.advancedFilter?Ht(e.advancedFilter,u=>this.deps.columnDef(u),G):null;if(!t.length&&!n.length&&!r)return this.nodes;let s=this.nodes.filter(u=>{for(let h of t)if(!h.pred(G(h.def,u.data)))return!1;if(r&&!r(u.data))return!1;if(n.length){let h=o.map(p=>this.deps.format(p,G(p,u.data))).join("").toLowerCase();if(!Kn(n,h))return!1}return!0}),a=(d=e.display)==null?void 0:d.getParentId;if(!a)return s;let l=new Map(this.nodes.map(u=>[u.id,u])),c=new Set(s);for(let u of s){let h=a(u.data),p=new Set;for(;h!=null&&!p.has(h);){p.add(h);let f=l.get(String(h));if(!f)break;c.add(f),h=a(f.data)}}return this.nodes.filter(u=>c.has(u))}isOpen(e,t,n){let o=e.expanded.get(t);return o!==void 0?o:e.defaultExpanded===-1||n<e.defaultExpanded}withDetails(e,t,n){for(let o of t)n.push(o),e.detailOpen.has(o.id)&&(!e.isMaster||e.isMaster(o.data))&&n.push({id:`detail:${o.id}`,data:{},sourceIndex:-1,kind:"detail",detailOf:o})}buildDisplay(e,t,n){let o=[];if(e.getParentId)return this.buildTree(e,o),o;let r=e.groupBy.filter(a=>this.deps.columnDef(a));if(!r.length)return e.detailOpen.size?(this.withDetails(e,this.sorted,o),o):this.sorted;let s=(a,l,c)=>{var x;let d=r[l],u=this.deps.columnDef(d),h=new Map;for(let y of a){let m=G(u,y.data),w=z(m)?"":Z(m),g=h.get(w);g||h.set(w,g={value:m,nodes:[]}),g.nodes.push(y)}let p=((x=t.find(y=>y.colId===d))==null?void 0:x.dir)==="desc"?-1:1,f=[...h.entries()].sort((y,m)=>xe(y[1].value,m[1].value,n)*p);for(let[y,m]of f){let w=`${c}${d}:${y}`,g=this.isOpen(e,w,l);o.push({id:`group:${w}`,data:{},sourceIndex:-1,kind:"group",level:l,group:{key:w,colId:d,value:m.value,rows:m.nodes.map(v=>v.data),expanded:g}}),g&&(l+1<r.length?s(m.nodes,l+1,`${w}|`):this.withDetails(e,m.nodes.map(v=>({...v,level:l+1})),o))}};return s(this.sorted,0,""),o}buildTree(e,t){let n=new Set(this.sorted.map(a=>a.id)),o=new Map,r=[];for(let a of this.sorted){let l=e.getParentId(a.data),c=l==null?null:String(l);if(c!==null&&n.has(c)&&c!==a.id){let d=o.get(c);d||o.set(c,d=[]),d.push(a)}else r.push(a)}let s=(a,l,c)=>{var d,u,h;for(let p of a){if(c.has(p.id))continue;let f=(d=o.get(p.id))!=null?d:[],x=!f.length&&!!((u=e.lazyChildren)!=null&&u.call(e,p.id,p.data)),y=f.length>0&&this.isOpen(e,p.id,l),m={...p,level:l,hasChildren:f.length>0||x,expanded:y};x&&((h=e.loading)!=null&&h.has(p.id))&&(m.loading=!0),this.withDetails(e,[m],t),y&&s(f,l+1,new Set([...c,p.id]))}};s(r,0,new Set)}};var Ii=1e4,pn=1e5,Di=4,gn=3e3,It=class{constructor(e,t,n,o,r,s){this.datasource=e;this.getRowId=t;this.groupBy=n;this.query=o;this.onChange=r;this.onFailed=s;this.levels=new Map;this.gen=0;this.display=null;this.ids=null;this.queue=[];this.inFlight=0;this.retryAt=0;this.version=0;this.builtFor=-1}matches(e,t){return e.join("")===this.groupBy.join("")&&t.sort===this.query.sort&&t.filters===this.query.filters&&t.quickFilter===this.query.quickFilter&&t.advancedFilter===this.query.advancedFilter}purge(){this.gen++,this.queue=[],this.levels.clear(),this.touch()}dispose(){this.gen++,this.queue=[]}touch(){this.version++,this.display=null,this.ids=null}load(e,t,n){this.levels.has(e)||(this.levels.set(e,{state:"loading",nodes:[]}),this.fetch({path:e,keys:t,level:n,start:0,gen:this.gen}))}fetch(e){this.queue.push(e),this.pump()}pump(){for(;this.inFlight<Di&&this.queue.length;){let e=this.queue.shift();e.gen===this.gen&&(this.inFlight++,this.request(e).finally(()=>{this.inFlight--,this.pump()}))}}request({path:e,keys:t,level:n,start:o,gen:r}){let s=n>=this.groupBy.length,a=this.query,l=o+Ii,c;try{c=Promise.resolve(this.datasource.getRows({start:o,end:l,sort:[...a.sort],filters:{...a.filters},quickFilter:a.quickFilter,advancedFilter:a.advancedFilter,groupBy:[...this.groupBy],groupKeys:[...t]}))}catch(d){c=Promise.reject(d)}return c.then(d=>{var y,m;if(r!==this.gen)return;let u=Array.isArray(d==null?void 0:d.rows)?d.rows.filter(w=>w!==null&&typeof w=="object"):[];Array.isArray(d==null?void 0:d.rows)||O("datasource.getRows must resolve to { rows: Row[] }");let h=s?u.map((w,g)=>({id:this.getRowId?String(this.getRowId(w)):Ce(w),data:w,sourceIndex:o+g,level:n})):u.map(w=>{let g=this.groupBy[n],v=w[g],C=`${e?`${e}|`:""}${g}:${Z(v)}`,R=typeof w.count=="number"?w.count:typeof w.childCount=="number"?w.childCount:void 0;return{id:`group:${C}`,data:{},sourceIndex:-1,kind:"group",level:n,group:{key:C,colId:g,value:v,rows:[],expanded:!1,count:R,aggregates:w,keys:[...t,v]}}}),p=o?[...(m=(y=this.levels.get(e))==null?void 0:y.nodes)!=null?m:[],...h]:h,f=typeof(d==null?void 0:d.total)=="number"&&d.total>=0?d.total:null,x=u.length>0&&(f!==null?p.length<f:u.length>=l-o);x&&p.length<pn?(this.levels.set(e,{state:"loading",nodes:p}),this.fetch({path:e,keys:t,level:n,start:p.length,gen:r})):(x&&O(`a server group level has more than ${pn} rows; only the first ${pn} are shown`),this.levels.set(e,{state:"loaded",nodes:p})),this.touch(),this.onChange()},d=>{r===this.gen&&(this.levels.set(e,{state:"failed",nodes:[],retryAt:Date.now()+gn}),this.touch(),this.onFailed(o,l,d))})}isOpen(e,t,n){let o=e.expanded.get(t);return o!==void 0?o:e.defaultExpanded===-1||n<e.defaultExpanded}rows(e,t){let n=Date.now();if(this.display&&this.builtFor===t&&!(this.retryAt&&n>=this.retryAt))return this.display;let o=[],r=0,s=(a,l,c)=>{var u,h,p;let d=this.levels.get(a);if((d==null?void 0:d.state)==="failed"&&n>=((u=d.retryAt)!=null?u:0)&&(this.levels.delete(a),d=void 0),!d){this.load(a,l,c),o.push({id:`loading:${a}`,data:{},sourceIndex:-1,kind:"loading",level:c});return}if(d.state==="failed"){let f=(h=d.retryAt)!=null?h:0;r=r?Math.min(r,f):f;return}for(let f of d.nodes){if(f.kind!=="group"){o.push(f);continue}let x=f.group,y=this.isOpen(e,x.key,c),m={...f,group:{...x,expanded:y}};o.push(m),y&&s(x.key,(p=x.keys)!=null?p:[],c+1)}d.state==="loading"&&o.push({id:`loading:${a}`,data:{},sourceIndex:-1,kind:"loading",level:c})};return s("",[],0),this.retryAt=r,this.display=o,this.builtFor=t,this.ids=null,o}dataRows(){let e=[];for(let t of this.levels.values())for(let n of t.nodes)n.kind||e.push(n);return e}dataCount(){let e=this.levels.get("");return(e==null?void 0:e.state)==="loaded"&&e.nodes.every(t=>{var n;return typeof((n=t.group)==null?void 0:n.count)=="number"})?e.nodes.reduce((t,n)=>{var o,r;return t+((r=(o=n.group)==null?void 0:o.count)!=null?r:0)},0):this.dataRows().length}loading(){for(let e of this.levels.values())if(e.state==="loading")return!0;return!1}indexOf(e){var t;return this.display?(this.ids||(this.ids=new Map,this.display.forEach((n,o)=>this.ids.set(n.id,o))),(t=this.ids.get(e))!=null?t:-1):-1}};var Ai=new Float64Array(0),We=class{constructor(e){this.deps=e;this.stats={filterRuns:0,sortRuns:0};this.server=!0;this.blocks=new Map;this.total=null;this.loadedEnd=0;this.gen=0;this.query=null;this.page=null;this.lastBlock=0;this.version=0;this.cache=null;this.groups=null;this.displayIn=null}get bs(){return this.page?this.page.size:this.deps.blockSize}get base(){return this.page?this.page.index*this.page.size:0}update(e){var a,l,c,d,u,h,p,f,x,y,m,w;let t=(l=(a=e.display)==null?void 0:a.groupBy)!=null?l:[];if(t.length&&!((c=e.display)!=null&&c.getParentId)){let g={sort:e.sort,filters:e.filters,quickFilter:e.quickFilter,advancedFilter:(d=e.advancedFilter)!=null?d:null};(!this.groups||!this.groups.matches(t,g))&&((u=this.groups)==null||u.dispose(),this.groups=new It(this.deps.datasource,this.deps.getRowId,[...t],g,()=>this.deps.onLoaded(0,0,null),(v,C,R)=>this.deps.onFailed(v,C,R)),this.touch()),this.displayIn=(h=e.display)!=null?h:null,this.query=null;return}this.groups&&(this.groups.dispose(),this.groups=null,this.query=null,this.touch());let n=this.query,o=!n||n.sort!==e.sort||n.filters!==e.filters||n.quickFilter!==e.quickFilter||n.advancedFilter!==((p=e.advancedFilter)!=null?p:null),r=(f=e.page)!=null?f:null,s=((x=r==null?void 0:r.size)!=null?x:0)!==((m=(y=this.page)==null?void 0:y.size)!=null?m:0);this.query={sort:e.sort,filters:e.filters,quickFilter:e.quickFilter,advancedFilter:(w=e.advancedFilter)!=null?w:null},this.page=r?{...r}:null,(o||s)&&this.purge(),this.ensure(Math.floor(this.base/this.bs))}invalidate(){}purge(){if(this.groups){this.groups.purge();return}this.gen++,this.blocks.clear(),this.total=null,this.loadedEnd=0,this.touch(),this.query&&this.ensure(Math.floor(this.base/this.bs))}touch(){this.version++,this.cache=null}fullCount(){if(this.total!==null)return this.total;if(!this.loadedEnd)return 0;let e=this.blocks.get(Math.floor((this.loadedEnd-1)/this.bs));return this.loadedEnd+(e&&e.nodes.length<this.bs?0:this.bs)}getRowCount(){if(this.groups)return this.groupRows().length;let e=this.fullCount();return this.page?Math.max(0,Math.min(this.page.size,e-this.base)):e}dataCount(){return this.groups?this.groups.dataCount():this.fullCount()}loading(){if(this.groups)return this.groups.loading();for(let e of this.blocks.values())if(e.state==="loading")return!0;return!1}placeholder(e){return{id:`loading:${e}`,data:{},sourceIndex:-1,kind:"loading"}}peek(e){var o;let t=Math.floor(e/this.bs),n=this.blocks.get(t);return(n==null?void 0:n.state)==="loaded"&&(o=n.nodes[e-t*this.bs])!=null?o:null}groupRows(){return this.groups.rows(this.displayIn,this.displayIn.version*1e6+this.groups.version)}getRow(e){if(this.groups)return this.groupRows()[e];let t=this.base+e,n=this.peek(t);return n||(e>=0&&e<this.getRowCount()&&this.ensure(Math.floor(t/this.bs)),this.placeholder(t))}ensure(e){var c;let t=this.blocks.get(e);if(t&&(t.state!=="failed"||Date.now()<((c=t.retryAt)!=null?c:0))||this.total!==null&&e*this.bs>=this.total&&e>0)return;let n=e*this.bs,o=n+this.bs,r=this.gen;this.lastBlock=e,this.blocks.set(e,{state:"loading",nodes:[]});let s=this.query,a=d=>{r===this.gen&&(this.blocks.set(e,{state:"failed",nodes:[],retryAt:Date.now()+gn}),this.deps.onFailed(n,o,d))},l;try{l=Promise.resolve(this.deps.datasource.getRows({start:n,end:o,sort:[...s.sort],filters:{...s.filters},quickFilter:s.quickFilter,advancedFilter:s.advancedFilter}))}catch(d){l=Promise.reject(d)}l.then(d=>{if(r!==this.gen)return;let u=Array.isArray(d==null?void 0:d.rows)?d.rows.filter(f=>f!==null&&typeof f=="object"):null;if(!u){O("datasource.getRows must resolve to { rows: Row[], total?: number }"),a(new Error("invalid datasource response"));return}let h=this.deps.getRowId,p=u.slice(0,this.bs).map((f,x)=>({id:h?String(h(f)):Ce(f),data:f,sourceIndex:n+x}));this.blocks.set(e,{state:"loaded",nodes:p}),typeof d.total=="number"&&d.total>=0?this.total=d.total:p.length<this.bs&&(this.total=n+p.length),this.loadedEnd=Math.max(this.loadedEnd,n+p.length),this.evict(),this.touch(),this.deps.onLoaded(n,n+p.length,this.total)},a)}evict(){let e=Math.max(2,this.deps.maxBlocks);if(this.blocks.size<=e)return;let t=[...this.blocks.keys()].sort((n,o)=>Math.abs(o-this.lastBlock)-Math.abs(n-this.lastBlock));for(let n of t){if(this.blocks.size<=e)break;this.blocks.get(n).state!=="loading"&&this.blocks.delete(n)}}built(){var n;if(((n=this.cache)==null?void 0:n.ver)===this.version)return this.cache;let e=[];for(let o of[...this.blocks.keys()].sort((r,s)=>r-s)){let r=this.blocks.get(o);r.state==="loaded"&&e.push(...r.nodes)}let t=new Map;for(let o of e)t.set(o.id,o.sourceIndex);return this.cache={ver:this.version,data:e,rows:null,ids:t},this.cache}rows(){var t;if(this.groups)return this.groupRows();let e=this.built();if(!e.rows){let n=this.getRowCount();e.rows=new Array(n);for(let o=0;o<n;o++)e.rows[o]=(t=this.peek(this.base+o))!=null?t:this.placeholder(this.base+o)}return e.rows}dataRows(){return this.groups?this.groups.dataRows():this.built().data}allNodes(){return this.groups?this.groups.dataRows():this.built().data}idOf(e){return this.deps.getRowId?String(this.deps.getRowId(e)):Ce(e)}indexOfId(e){if(this.groups)return this.groupRows(),this.groups.indexOf(e);let t=this.built().ids.get(e);if(t===void 0)return-1;let n=t-this.base;return n>=0&&n<this.getRowCount()?n:-1}layout(){return{offsets:Ai,uniform:!0}}};function Po(i){let e=i.idAt(i.index);if(i.mode==="single"){let t=new Set;return i.toggle&&i.selected.has(e)||t.add(e),{selected:t,anchorIndex:i.index}}if(i.range&&i.anchorIndex!=null){let t=i.toggle?new Set(i.selected):new Set,n=Math.min(i.anchorIndex,i.index),o=Math.max(i.anchorIndex,i.index);for(let r=n;r<=o;r++)t.add(i.idAt(r));return{selected:t,anchorIndex:i.anchorIndex}}if(i.toggle){let t=new Set(i.selected);return t.has(e)?t.delete(e):t.add(e),{selected:t,anchorIndex:i.index}}return{selected:new Set([e]),anchorIndex:i.index}}var Dt=class{constructor(e){this.bus=new ke;this.current=e}get state(){return this.current}set(e){let t=Object.keys(e).filter(n=>e[n]!==this.current[n]);t.length&&(this.current={...this.current,...e},this.bus.emit("change",t))}};var Pi=500;function $o(i){let e=i.renderer.root,t=0,n=null,o=null,r=()=>{clearTimeout(t),n==null||n.remove(),n=null,o=null},s=d=>{var g;let u=d.dataset.col;if(!u||$(u))return null;let h=i.columns.getNode(u);if(!h)return null;if(d.classList.contains("fg-header-cell"))return(g=h.def.headerTooltip)!=null?g:null;let p=d.closest(".fg-row[data-row]");if(!p||!d.closest(".fg-body"))return null;let f=Number(p.dataset.row),x=i.rowModel.getRow(f);if(!x||x.kind)return null;let y=h.def,m=G(y,x.data),w=_(y,i.store.state.locale.code)(m);if(typeof y.tooltip=="function")try{let v=y.tooltip({value:m,formatted:w,row:x.data,rowIndex:f,column:y});return v?String(v):null}catch{return O(`tooltip of column "${u}" threw`),null}return y.tooltip===!0?w||null:i.options.overflowTooltip!==!1&&y.tooltip!==!1&&d.scrollWidth>d.clientWidth+1&&d.textContent||null},a=(d,u)=>{n==null||n.remove(),n=S("div",`fg-tooltip fg-theme-${i.store.state.theme}`,{role:"tooltip"}),n.textContent=u,i.applyFontTo(n),oe(e).append(n);let h=d.getBoundingClientRect(),p=n.offsetWidth,f=n.offsetHeight,x=window.innerWidth||1024,y=window.innerHeight||768,m=h.bottom+6+f>y?h.top-f-6:h.bottom+6;n.style.left=`${Math.max(4,Math.min(x-p-4,h.left))}px`,n.style.top=`${Math.max(4,m)}px`},l=d=>{var h,p;let u=(p=(h=d.target).closest)==null?void 0:p.call(h,".fg-cell, .fg-header-cell");!u||u===o||!e.contains(u)||(r(),o=u,t=window.setTimeout(()=>{if(o!==u||!u.isConnected)return;let f=s(u);f&&a(u,f)},Pi))},c=d=>{let u=d.relatedTarget;o&&u&&o.contains(u)||r()};return e.addEventListener("pointerover",l),e.addEventListener("pointerout",c),e.addEventListener("pointerdown",r),e.addEventListener("keydown",r),e.addEventListener("wheel",r,{passive:!0}),()=>{r(),e.removeEventListener("pointerover",l),e.removeEventListener("pointerout",c),e.removeEventListener("pointerdown",r),e.removeEventListener("keydown",r),e.removeEventListener("wheel",r)}}var Fo=["blank","notBlank"],At=class{constructor(e){this.grid=e;this.popup=null;this.off=[]}get isOpen(){return!!this.popup}columns(){return this.grid.columns.getState().map(e=>this.grid.columns.getNode(e.colId)).filter(e=>e&&!e.children&&!$(e.id)&&ie(e.def)).map(e=>{var o,r;let t=ie(e.def),n=t==="number"?"number":t==="date"?"date":"text";return{id:e.id,label:(r=(o=e.def.header)!=null?o:e.def.field)!=null?r:e.id,kind:n}})}open(){var M,D;this.close();let{grid:e}=this,t=e.store.state.locale,n=this.columns(),o=S("div",`fg-menu fg-filter-builder fg-theme-${e.store.state.theme}`,{role:"dialog","aria-label":t.advancedFilter});e.applyFontTo(o);let r=S("div","fg-chooser-head"),s=S("span","fg-menu-title");s.textContent=t.advancedFilter;let a=S("button","fg-chooser-close",{type:"button","aria-label":t.close});a.textContent="\xD7",a.addEventListener("click",()=>this.close()),r.append(s,a);let l=e.store.state.advancedFilter,c=S("div","fg-filter-join",{role:"radiogroup"}),d=`fg-fb-join-${Math.random().toString(36).slice(2,7)}`;for(let E of["and","or"]){let L=S("label"),I=S("input","",{type:"radio",name:d,value:E});I.checked=((M=l==null?void 0:l.operator)!=null?M:"and")===E,L.append(I,` ${t[E]}`),c.append(L)}let u=S("div","fg-fb-list"),h=[],p=E=>{h.splice(h.indexOf(E),1),E.el.remove()},f=E=>{let L=S("div","fg-fb-row"),I=S("select","fg-filter-op fg-fb-col",{"aria-label":t.columns});for(let K of n){let V=S("option");V.value=K.id,V.textContent=K.label,I.append(V)}let A=S("select","fg-filter-op fg-fb-op",{"aria-label":t.filter}),F=S("input","fg-input fg-fb-value",{type:"text",placeholder:t.value,"aria-label":t.value}),P=S("input","fg-input fg-fb-value-to",{type:"text",placeholder:t.valueTo,"aria-label":t.valueTo}),N=S("button","fg-chooser-close fg-fb-remove",{type:"button","aria-label":t.close});N.textContent="\xD7";let H=()=>{var K,V;return(V=(K=n.find(J=>J.id===I.value))==null?void 0:K.kind)!=null?V:"text"},B=K=>{let V=H();A.replaceChildren(...qe[V].map(Q=>{let re=S("option");return re.value=Q,re.textContent=t.ops[Q],re})),K&&qe[V].includes(K)&&(A.value=K);let J=V==="text"?"text":V;F.type=P.type=J,W()},W=()=>{F.hidden=Fo.includes(A.value),P.hidden=A.value!=="between"};I.addEventListener("change",()=>B(A.value)),A.addEventListener("change",W),E&&n.some(K=>K.id===E.colId)&&(I.value=E.colId);let q=E==null?void 0:E.model;B(q==null?void 0:q.op),(q==null?void 0:q.value)!=null&&(F.value=String(q.value)),(q==null?void 0:q.valueTo)!=null&&(P.value=String(q.valueTo)),L.append(I,A,F,P,N);let U={el:L,read:()=>{let K=H(),V=A.value,J=!Fo.includes(V),Q=null;if(K==="number"){let re=F.value===""?void 0:Number(F.value),Ue=P.value===""?void 0:Number(P.value);(!J||re!==void 0&&!Number.isNaN(re))&&(Q=V==="between"?{type:"number",op:V,value:re,valueTo:Ue}:{type:"number",op:V,value:re})}else K==="date"?(!J||F.value)&&(Q=V==="between"?{type:"date",op:V,value:F.value,valueTo:P.value}:{type:"date",op:V,value:F.value||void 0}):(!J||F.value)&&(Q={type:"text",op:V,value:F.value});return Q?{colId:I.value,model:Q}:null}};return N.addEventListener("click",()=>p(U)),U},x=(E,L)=>{let I=S("div","fg-fb-row fg-fb-group"),A=S("span","fg-fb-group-label");A.textContent=L;let F=S("button","fg-chooser-close fg-fb-remove",{type:"button","aria-label":t.close});F.textContent="\xD7",I.append(A,F);let P={el:I,read:()=>E};return F.addEventListener("click",()=>p(P)),P},y=E=>{var F;if("conditions"in E)return x(E,`( ${E.conditions.length} \xD7 ${t[E.operator]} )`);let L=n.find(P=>P.id===E.colId),I=E.model;if(L&&I&&(I.type==="text"||I.type==="number"||I.type==="date"))return f(E);let A=(I==null?void 0:I.type)==="set"?I.values.map(String).join(", "):(I==null?void 0:I.type)==="combined"?`( ${I.conditions.length} \xD7 ${t[I.operator]} )`:"";return x(E,`${(F=L==null?void 0:L.label)!=null?F:E.colId}: ${A}`)},m=E=>{h.push(E),u.append(E.el)};for(let E of(D=l==null?void 0:l.conditions)!=null?D:[])m(y(E));let w=S("button","fg-btn fg-fb-add",{type:"button"});w.textContent=`+ ${t.addCondition}`,w.addEventListener("click",()=>{let E=f();m(E),E.el.querySelector(".fg-fb-value").focus()});let g=S("div","fg-menu-actions"),v=S("button","fg-btn",{type:"button"});v.textContent=t.reset,v.addEventListener("click",()=>{e.setAdvancedFilter(null),this.close()});let C=S("button","fg-btn fg-btn-primary",{type:"button"});C.textContent=t.apply,C.addEventListener("click",()=>{var I;let E=h.map(A=>A.read()).filter(A=>!!A),L=((I=c.querySelector("input:checked"))==null?void 0:I.value)==="or"?"or":"and";e.setAdvancedFilter(E.length?{operator:L,conditions:E}:null),this.close()}),g.append(v,C),o.append(r,c,u,w,g),oe(e.renderer.root).append(o);let R=e.renderer.root.getBoundingClientRect(),k=o.offsetWidth||460;o.style.left=`${Math.max(4,Math.min(R.left+24,(window.innerWidth||1024)-k-4))}px`,o.style.top=`${Math.max(4,R.top+24)}px`,this.popup=o,h.length||w.click();let T=E=>{pe(E,o)||this.close()},b=E=>{E.key==="Escape"&&this.close()};document.addEventListener("pointerdown",T,!0),document.addEventListener("keydown",b,!0),this.off.push(()=>document.removeEventListener("pointerdown",T,!0),()=>document.removeEventListener("keydown",b,!0))}close(){var e;for(let t of this.off)t();this.off=[],(e=this.popup)==null||e.remove(),this.popup=null}};var No=i=>Math.round(i*2.75),Oo=i=>Math.round(i*3.1),mn=13,wn={compact:[.8,.85],normal:[1,1],comfortable:[1.25,1.15]},$i=[],Fi=100,Ni=new Map;function ue(i){return i.every(e=>e!==null&&typeof e=="object")?i:(O("data contains entries that are not objects; they were skipped"),i.filter(e=>e!==null&&typeof e=="object"))}var vn=class{constructor(e,t){this.options=t;this.events=new ke;this.pinnedRows={top:[],bottom:[]};this.spanCache=null;this.editVersion=0;this.tracker=new yt;this.history=new vt;this.disposers=[];this.collatorCache=null;this.destroyed=!1;this.summaryOpts=null;this.summaryValues=[];this.groupBy=[];this.expanded=new Map;this.defaultExpanded=0;this.detailOpen=new Set;this.displayVersion=0;this.aggCache={ver:-1,map:new WeakMap};this.charts=new Et(this);this.sourceDefs=[];this.pivotCfg=null;this.pivotData=null;this.savedGroup=null;this.page=0;this.pageSize=Fi;this.forcedOverlay=null;this.filterBuilder=new At(this);this.flashing=new Map;this.flashTimer=0;this.txQueue=[];this.txTimer=0;this.keepRange=!1;this.rowNumberCache=null;this.treeLoaded=new Set;this.treeLoading=new Set;this.lazyChildren=(e,t)=>{var n,o;if(this.treeLoaded.has(e))return!1;try{return!!((o=(n=this.options.treeData)==null?void 0:n.hasChildren)!=null&&o.call(n,t))}catch{return!1}};this.density="normal";this.selectionVersion=0;var s,a,l,c,d,u,h,p,f,x;Array.isArray(t.columns)||O("options.columns must be an array"),t.data!=null&&!Array.isArray(t.data)&&O("options.data must be an array"),this.store=new Dt({data:Array.isArray(t.data)?ue(t.data):[],sort:[],filters:{},quickFilter:"",selected:new Set,anchorId:null,focus:null,range:null,extraRanges:[],advancedFilter:null,locale:Ie(t.locale),theme:(s=t.theme)!=null?s:"light"}),this.sourceDefs=Array.isArray(t.columns)?t.columns:[],this.columns=new _e(this.withSelect(this.sourceDefs));let n=t.pagination;n&&typeof n=="object"&&n.pageSize!==void 0&&(Number.isInteger(n.pageSize)&&n.pageSize>0?this.pageSize=n.pageSize:O("pagination.pageSize must be a positive integer")),t.datasource&&typeof t.datasource.getRows!="function"&&O("datasource.getRows must be a function"),this.rowModel=t.datasource&&typeof t.datasource.getRows=="function"?new We({datasource:t.datasource,blockSize:Number.isInteger(t.blockSize)&&t.blockSize>0?t.blockSize:100,maxBlocks:Number.isInteger(t.maxBlocks)&&t.maxBlocks>0?t.maxBlocks:100,getRowId:t.getRowId,onLoaded:(y,m,w)=>this.serverLoaded(y,m,w),onFailed:(y,m,w)=>this.serverFailed(y,m,w)}):new Tt({getRowId:t.getRowId,columnDef:y=>{var m;return(m=this.columns.getNode(y))==null?void 0:m.def},quickColumns:()=>this.columns.displayed().filter(y=>!$(y.id)).map(y=>y.def),format:(y,m)=>_(y,this.store.state.locale.code)(m),collator:()=>this.collator()}),this.groupBy=this.validGroupBy((a=t.groupBy)!=null?a:[]),this.defaultExpanded=(l=t.groupDefaultExpanded)!=null?l:0,t.treeData&&!t.getRowId&&O("treeData needs getRowId so parent ids can be matched"),this.updateRows(),this.summaryOpts=(c=t.summary)!=null?c:null,this.refreshSummary();let o=t.fontSize!=null&&t.fontSize>0?t.fontSize:null;t.fontSize!=null&&!(t.fontSize>0)&&O("fontSize must be a positive number"),this.font={size:o,family:(d=t.fontFamily)!=null?d:null};let r=o!=null?o:mn;if(this.renderer=new ot(e,this,{rowHeight:(u=t.rowHeight)!=null?u:Math.round(No(r)*wn[this.densityOf(t.density)][0]),headerHeight:(h=t.headerHeight)!=null?h:Math.round(Oo(r)*wn[this.densityOf(t.density)][1])}),this.density=this.densityOf(t.density),this.renderer.applyTheme(),this.renderer.applyFont(this.font.size,this.font.family),this.menu=new Lt(this),this.chooser=new ct(this),this.contextMenu=new ht(this),this.editor=new wt(this),this.finder=new pt(this),this.fillHandle=new ft(this),this.groupPanel=t.groupPanel?new rt(this):null,this.pinnedRows={top:ue((p=t.pinnedTopRows)!=null?p:[]),bottom:ue((f=t.pinnedBottomRows)!=null?f:[])},this.sideBar=t.sideBar?new ut(this,typeof t.sideBar=="object"&&!!t.sideBar.open,(x=typeof t.sideBar=="object"?t.sideBar.panels:void 0)!=null?x:t.pivot||t.pivotPanel?["columns","filters","pivot"]:void 0):null,this.disposers.push(this.store.bus.on("change",y=>this.onChange(y)),lo(this),no(this),()=>this.menu.close(),()=>this.chooser.close(),()=>this.contextMenu.destroy(),()=>this.editor.destroy(),()=>this.fillHandle.destroy(),()=>{var y;return(y=this.groupPanel)==null?void 0:y.destroy()},()=>this.charts.destroy(),()=>this.filterBuilder.close(),$o(this)),typeof ResizeObserver!="undefined"){let y=new ResizeObserver(()=>this.renderer.schedule());y.observe(this.renderer.main),this.disposers.push(()=>y.disconnect())}t.pivot&&this.setPivot(t.pivot),Io(t.licenseKey).then(y=>{y&&!this.destroyed&&this.renderer.showFreeBadge()}),this.renderer.render(),this.api=this.createApi(),it.set(this.renderer.root,this)}collator(){var t;let e=this.store.state.locale.code;return((t=this.collatorCache)==null?void 0:t.code)!==e&&(this.collatorCache={code:e,collator:new Intl.Collator(e,{numeric:!0,sensitivity:"base"})}),this.collatorCache.collator}layoutChanged(){this.renderer.invalidateHeights(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}columnsChanged(){this.rowModel.invalidate(),this.updateRows(),this.refreshSummary(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}display(){var e,t;return{groupBy:this.options.treeData?$i:this.groupBy,getParentId:(e=this.options.treeData)==null?void 0:e.getParentId,expanded:this.expanded,defaultExpanded:this.defaultExpanded,detailOpen:this.options.detailRenderer?this.detailOpen:new Set,isMaster:this.options.isRowMaster,lazyChildren:(t=this.options.treeData)!=null&&t.hasChildren?this.lazyChildren:void 0,loading:this.treeLoading,version:this.displayVersion}}updateRows(){var n;let e=!!this.options.pagination,t=(n=this.pivotData)!=null?n:this.store.state.data;this.rowModel.update({...this.store.state,data:t,display:this.display(),page:e?{index:this.page,size:this.pageSize}:null}),e&&this.page>=this.getPageCount()&&(this.page=this.getPageCount()-1,this.rowModel.update({...this.store.state,data:t,display:this.display(),page:{index:this.page,size:this.pageSize}}))}viewRows(){var e;return(e=this.pivotData)!=null?e:this.store.state.data}sourceLeaves(){let e=[],t=n=>{var o,r;for(let s of n)!s||typeof s!="object"||(Array.isArray(s.children)?t(s.children):((o=s.id)!=null?o:s.field)&&e.push({id:(r=s.id)!=null?r:s.field,def:s}))};return t(this.sourceDefs),e}getPivot(){let e=this.pivotCfg;if(!e)return null;let t={rows:[...e.rows],columns:[...e.columns],values:e.values.map(n=>({...n}))};return e.totals||(t.totals=!1),t}setPivot(e){if(e&&this.clientOnly("pivot"))return;if(e&&(typeof e!="object"||!Array.isArray(e.rows)||!Array.isArray(e.values))){O("setPivot: expected { rows: string[], values: [...] }");return}if(this.editor.cancel(),!e){if(!this.pivotCfg)return;this.pivotCfg=null,this.pivotData=null,this.columns.setDefs(this.withSelect(this.sourceDefs)),this.savedGroup&&(this.groupBy=this.savedGroup.groupBy,this.expanded=this.savedGroup.expanded,this.defaultExpanded=this.savedGroup.defaultExpanded,this.savedGroup=null),this.afterPivotSwitch();return}let t=new Set(this.sourceLeaves().map(n=>n.id));this.pivotCfg||(this.savedGroup={groupBy:this.groupBy,expanded:this.expanded,defaultExpanded:this.defaultExpanded}),this.pivotCfg=ln(e,n=>t.has(n)),this.expanded=new Map,this.defaultExpanded=-1,this.rebuildPivot(!1),this.afterPivotSwitch()}afterPivotSwitch(){var e;this.page=0,this.store.set({sort:[],filters:{},range:null,focus:null}),this.rowModel.invalidate(),this.updateRows(),this.displayVersion++,this.updateRows(),(e=this.groupPanel)==null||e.refresh(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers(),this.events.emit("pivotChange",{pivot:this.getPivot()})}rebuildPivot(e=!0){let t=this.pivotCfg;if(!t)return;let n=this.store.state.locale,o=new Map(this.sourceLeaves().map(c=>[c.id,c.def])),r={sum:n.sum,avg:n.avg,min:n.min,max:n.max,count:n.count},s=Ro(this.store.state.data,t,c=>o.get(c),{total:n.total,blank:n.blanks,agg:c=>{var d;return(d=r[c])!=null?d:c}},n.code);if(this.pivotData=s.rows,this.columns.setDefs(this.withSelect(s.columns)),this.groupBy=s.groupBy,!e)return;let a=c=>!!this.columns.getNode(c),l=this.store.state;(l.sort.some(c=>!a(c.colId))||Object.keys(l.filters).some(c=>!a(c)))&&this.store.set({sort:l.sort.filter(c=>a(c.colId)),filters:Object.fromEntries(Object.entries(l.filters).filter(([c])=>a(c)))}),this.rowModel.invalidate(),this.displayVersion++,this.updateRows(),this.renderer.invalidate({header:!0,rows:!0}),this.refreshChoosers()}isFlashing(e,t){return this.flashing.size>0&&this.flashing.has(`${e}\0${t}`)}flash(e){let t=Date.now()+1e3;for(let o of e)this.flashing.set(o,t);if(this.flashTimer)return;let n=()=>{let o=Date.now();for(let[r,s]of this.flashing)s<=o&&this.flashing.delete(r);this.renderer.invalidate({rows:!0}),this.flashTimer=this.flashing.size&&!this.destroyed?window.setTimeout(n,250):0};this.flashTimer=window.setTimeout(n,1e3)}applyTransaction(e){return!e||typeof e!="object"?{added:[],updated:[],removed:[],notFound:[]}:this.applyTransactions([e])}applyTransactions(e){var l,c;let t={added:[],updated:[],removed:[],notFound:[]};if(this.clientOnly("applyTransaction"))return t;let n=new Map;for(let d of this.columns.getState()){let u=(l=this.columns.getNode(d.colId))==null?void 0:l.def.field;u&&n.set(u,[...(c=n.get(u))!=null?c:[],d.colId])}let o=[],r=this.store.state.data,s=new Set(r),a=new Map(r.map(d=>[this.rowModel.idOf(d),d]));for(let d of e)d&&typeof d=="object"&&(r=this.txStep(d,r,{present:s,byId:a},t,o,n));if(!t.added.length&&!t.updated.length&&!t.removed.length)return t.notFound.length&&this.events.emit("transactionApplied",t),t;this.editVersion++,this.renderer.invalidateHeights(),this.keepRange=!0;try{this.replaceData(r===this.store.state.data?[...r]:r)}finally{this.keepRange=!1}return this.editor.sync(),o.length&&this.options.flashCells!==!1&&this.flash(o),this.events.emit("transactionApplied",t),t}txStep(e,t,n,o,r,s){var x,y,m;let a=this.options.getRowId,{present:l,byId:c}=n,d=w=>{if(!w||typeof w!="object")return null;if(l.has(w))return this.rowModel.idOf(w);try{return a?String(a(w)):null}catch{return null}},u=new Set;for(let w of(x=e.remove)!=null?x:[]){let g=d(w),v=g===null?void 0:c.get(g);v&&!u.has(v)?(u.add(v),l.delete(v),c.delete(g),o.removed.push(v),this.tracker.created.delete(v),this.tracker.originals.delete(v)):v||o.notFound.push(w)}for(let w of(y=e.update)!=null?y:[]){let g=d(w),v=g===null?void 0:c.get(g);if(!v||u.has(v)){o.notFound.push(w);continue}let C=this.tracker.originals.get(v);for(let[R,k]of Object.entries(w))if(C&&(C[R]=k),!Object.is(v[R],k)){v[R]=k;for(let T of(m=s.get(R))!=null?m:[])r.push(`${g}\0${T}`)}o.updated.push(v)}let h=ue(Array.isArray(e.add)?e.add:[]);o.added.push(...h);for(let w of h)l.add(w),c.set(this.rowModel.idOf(w),w);if(!u.size&&!h.length)return t;let p=u.size?t.filter(w=>!u.has(w)):[...t],f=typeof e.addIndex=="number"?Math.max(0,Math.min(p.length,Math.floor(e.addIndex))):p.length;return p.splice(f,0,...h),p}applyTransactionAsync(e){!e||typeof e!="object"||(this.txQueue.push(e),!this.txTimer&&(this.txTimer=window.setTimeout(()=>{this.txTimer=0;let t=this.txQueue;this.txQueue=[],!(this.destroyed||!t.length)&&this.applyTransactions(t)},50)))}setAdvancedFilter(e){let t=e&&typeof e=="object"&&Array.isArray(e.conditions)&&e.conditions.length?e:null;t!==this.store.state.advancedFilter&&(this.store.set({advancedFilter:t}),this.events.emit("advancedFilterChange",{advancedFilter:t}))}setColumnGroupOpened(e,t){this.columns.setGroupOpen(e,!!t)&&(this.layoutChanged(),this.events.emit("columnGroupOpened",{groupId:e,open:!!t}))}getState(){var r,s,a,l;let e=this.store.state,t=(s=(r=this.savedGroup)==null?void 0:r.groupBy)!=null?s:this.groupBy,n=(l=(a=this.savedGroup)==null?void 0:a.expanded)!=null?l:this.expanded,o={columns:this.columns.getState(),columnGroups:this.columns.groupOpenState(),advancedFilter:e.advancedFilter?JSON.parse(JSON.stringify(e.advancedFilter)):null,sort:e.sort.map(c=>({...c})),filters:JSON.parse(JSON.stringify(e.filters)),quickFilter:e.quickFilter,groupBy:[...t],pivot:this.pivotCfg?JSON.parse(JSON.stringify(this.pivotCfg)):null,expanded:Object.fromEntries(n),selected:[...e.selected]};return this.options.pagination&&(o.page=this.page,o.pageSize=this.pageSize),o}setState(e,t={}){var r,s;if(!e||typeof e!="object")return;let n=a=>e[a]!==void 0&&(!t.parts||t.parts.includes(a)),o=a=>!!this.columns.getNode(a);if(n("columns")&&Array.isArray(e.columns)&&(this.columns.applyState(e.columns.filter(a=>a&&o(a.colId))),this.columnsChanged()),n("columnGroups")&&e.columnGroups&&typeof e.columnGroups=="object")for(let[a,l]of Object.entries(e.columnGroups))typeof l=="boolean"&&this.setColumnGroupOpened(a,l);if(n("groupBy")&&Array.isArray(e.groupBy)&&this.setGroupBy(e.groupBy.filter(o)),n("pivot")&&this.setPivot((r=e.pivot)!=null?r:null),n("sort")&&Array.isArray(e.sort)&&this.setSort(e.sort.filter(a=>a&&o(a.colId))),n("filters")&&e.filters&&typeof e.filters=="object"){let a=Object.fromEntries(Object.entries(e.filters).filter(([l])=>o(l)));this.store.set({filters:a}),this.events.emit("filterChange",{filters:{...a}})}if(n("advancedFilter")&&this.setAdvancedFilter((s=e.advancedFilter)!=null?s:null),n("quickFilter")&&typeof e.quickFilter=="string"&&this.store.set({quickFilter:e.quickFilter}),n("expanded")&&e.expanded&&typeof e.expanded=="object"){let a=new Map(Object.entries(e.expanded).filter(([,l])=>typeof l=="boolean"));this.savedGroup?this.savedGroup.expanded=a:(this.expanded=a,this.displayChanged())}if(n("pageSize")&&typeof e.pageSize=="number"&&this.setPageSize(e.pageSize),n("page")&&typeof e.page=="number"&&this.setPage(e.page),n("selected")&&Array.isArray(e.selected)){let a=new Set(this.rowModel.allNodes().map(l=>l.id));this.setSelected(new Set(e.selected.map(String).filter(l=>a.has(l))))}}rowNumber(e){var o;let t=this.rowModel.rows();if(((o=this.rowNumberCache)==null?void 0:o.rows)!==t){let r=new Int32Array(t.length),s=0;t.forEach((a,l)=>{r[l]=a.kind?0:++s}),this.rowNumberCache={rows:t,nums:r}}let n=this.rowNumberCache.nums[e];return n?n+(this.options.pagination&&!this.rowModel.server?this.page*this.pageSize:0):null}getPage(){return this.options.pagination?this.page:0}getPageSize(){return this.options.pagination?this.pageSize:this.rowModel.fullCount()}getPageCount(){return this.options.pagination?Math.max(1,Math.ceil(this.rowModel.fullCount()/this.pageSize)):1}setPage(e){if(!this.options.pagination||!Number.isFinite(e))return;let t=Math.max(0,Math.min(this.getPageCount()-1,Math.floor(e)));t!==this.page&&(this.veto("beforePageChange",{page:t,pageSize:this.pageSize})||(this.page=t,this.pageMoved()))}setPageSize(e){if(!this.options.pagination)return;if(!Number.isInteger(e)||e<=0){O("setPageSize: size must be a positive integer");return}if(e===this.pageSize)return;let t=this.page*this.pageSize;this.veto("beforePageChange",{page:Math.floor(t/e),pageSize:e})||(this.pageSize=e,this.page=Math.floor(t/e),this.pageMoved())}pageMoved(){this.editor.cancel(),this.updateRows(),this.store.state.range&&this.setRange(null);let e=this.rowModel.getRowCount(),t=this.store.state.focus;t&&t.rowIndex>=e&&this.store.set({focus:e?{...t,rowIndex:e-1}:null}),this.renderer.scroller.scrollTop=0,this.finder.refresh(),this.renderer.invalidate({header:!0,rows:!0}),this.emitPage()}emitPage(){this.events.emit("pageChange",{page:this.page,pageSize:this.pageSize,pageCount:this.getPageCount()})}refreshRows(){this.rowModel instanceof We&&(this.rowModel.purge(),this.renderer.invalidate({rows:!0}))}serverLoaded(e,t,n){this.destroyed||(this.renderer.invalidate({header:!0,rows:!0}),this.events.emit("rowsLoaded",n===null?{start:e,end:t}:{start:e,end:t,total:n}))}serverFailed(e,t,n){this.destroyed||(O(`datasource.getRows failed for rows ${e}\u2013${t}`),this.toast(this.store.state.locale.loadFailed),this.renderer.invalidate({rows:!0}),this.events.emit("rowsLoadFailed",{start:e,end:t,error:n}))}syncScroll(e,t){if(!e||typeof e.setScrollPosition!="function"||e===this.api)return()=>{};let n=new Map,o=a=>`${a.top},${a.left}`,r=(a,l)=>a.on("scroll",c=>{if(n.get(a)===o(c)){n.delete(a);return}l.setScrollPosition(t==="vertical"?{top:c.top}:t==="horizontal"?{left:c.left}:c),n.set(l,o(l.getScrollPosition()))}),s=[r(this.api,e),r(e,this.api)];return()=>{for(let a of s)a()}}veto(e,t){let n=!1;return this.events.emit(e,{...t,cancel:()=>{n=!0}}),n}clientOnly(e){return this.rowModel.server?(O(`${e} is not available with a datasource`),!0):!1}displayChanged(){this.displayVersion++,this.updateRows(),this.store.state.range&&this.setRange(null);let e=this.rowModel.getRowCount(),t=this.store.state.focus;t&&t.rowIndex>=e&&this.store.set({focus:e?{...t,rowIndex:e-1}:null}),this.finder.refresh(),this.renderer.invalidate({header:!0,rows:!0})}validGroupBy(e){return Array.isArray(e)?[...new Set(e)].filter(t=>{let n=this.columns.getNode(t);return!n||n.children||$(t)?(O(`groupBy: unknown column "${t}"`),!1):!0}):[]}getGroupBy(){return[...this.groupBy]}setGroupBy(e){var n;let t=this.validGroupBy(e);t.join("")!==this.groupBy.join("")&&(this.groupBy=t,this.page=0,(n=this.groupPanel)==null||n.refresh(),this.displayChanged(),this.events.emit("groupChange",{groupBy:[...t]}))}isExpandable(e){return!!e&&(e.kind==="group"||!!e.hasChildren)}expandKey(e){return e.group?e.group.key:e.id}loadChildren(e){let t=this.options.treeData,n=e.id;if(this.treeLoading.has(n))return;if(typeof t.loadChildren!="function"){O("treeData.hasChildren needs treeData.loadChildren");return}this.treeLoading.add(n),this.displayChanged();let o=()=>(this.treeLoading.delete(n),!this.destroyed&&this.store.state.data.includes(e.data));Promise.resolve().then(()=>t.loadChildren(e.data)).then(r=>{if(!o())return;let s=ue(Array.isArray(r)?r:[]);this.treeLoaded.add(n),this.expanded.set(n,!0),s.length&&this.replaceData([...this.store.state.data,...s]),this.displayChanged(),this.events.emit("childrenLoaded",{row:e.data,rows:s}),this.events.emit("groupToggle",{key:n,expanded:!0})},r=>{o()&&(O(`treeData.loadChildren failed for row "${n}"`),this.displayChanged(),this.events.emit("childrenLoadFailed",{row:e.data,error:r}))})}setGroupExpanded(e,t){var r,s;let n=this.rowModel.rows().find(a=>this.isExpandable(a)&&this.expandKey(a)===e);if((n?!!((s=(r=n.group)==null?void 0:r.expanded)!=null?s:n.expanded):this.expanded.get(e))!==t){if(t&&n&&!n.group&&this.options.treeData&&this.lazyChildren(n.id,n.data)){this.loadChildren(n);return}this.expanded.set(e,t),this.displayChanged(),this.events.emit("groupToggle",{key:e,expanded:t})}}toggleRow(e){var n,o;let t=this.rowModel.getRow(e);this.isExpandable(t)&&this.setGroupExpanded(this.expandKey(t),!((o=(n=t.group)==null?void 0:n.expanded)!=null?o:t.expanded))}expandAll(e=!0){this.expanded.clear(),this.defaultExpanded=e?-1:0,this.displayChanged()}groupAggregate(e,t){var r,s;let n=(r=this.columns.getNode(t))==null?void 0:r.def;if(!e.group||!(n!=null&&n.aggFunc))return;if(e.group.aggregates)return(s=e.group.aggregates[t])!=null?s:n.field?e.group.aggregates[n.field]:void 0;this.aggCache.ver!==this.editVersion&&(this.aggCache={ver:this.editVersion,map:new WeakMap});let o=this.aggCache.map.get(e.group);if(o||this.aggCache.map.set(e.group,o=new Map),!o.has(t)){let a=e.group.rows;try{o.set(t,Se(n.aggFunc,a.map(l=>G(n,l)),a))}catch{O(`aggFunc of column "${t}" threw`),o.set(t,null)}}return o.get(t)}canExpandDetail(e){if(!this.options.detailRenderer)return!1;try{return!this.options.isRowMaster||!!this.options.isRowMaster(e)}catch{return!1}}isDetailExpanded(e){return!!e&&typeof e=="object"&&this.detailOpen.has(this.rowModel.idOf(e))}setDetailExpanded(e,t){if(!e||typeof e!="object"||t&&!this.canExpandDetail(e))return;let n=this.rowModel.idOf(e);this.detailOpen.has(n)!==t&&(t?this.detailOpen.add(n):(this.detailOpen.delete(n),this.renderer.dropDetail(n)),this.displayChanged(),this.events.emit("detailToggle",{row:e,expanded:t}))}canMoveRows(){let e=this.store.state,t=this.options.treeData;return!this.rowModel.server&&!e.sort.length&&!Object.keys(e.filters).length&&!e.quickFilter.trim()&&!this.groupBy.length&&(!t||typeof t.setParentId=="function")}get dragOptions(){let e=this.options.rowDrag;return e&&typeof e=="object"?e:{}}parentOf(e){let t=null;try{t=this.options.treeData.getParentId(e)}catch{t=null}return t==null?null:String(t)}rawParent(e){var t;try{return(t=this.options.treeData.getParentId(e))!=null?t:null}catch{return null}}idValue(e){let t=this.rowModel.idOf(e);for(let o of this.store.state.data){let r=this.rawParent(o);if(r!==null&&String(r)===t)return r}return this.store.state.data.some(o=>typeof this.rawParent(o)=="number")&&t.trim()!==""&&Number.isFinite(Number(t))?Number(t):t}canDropRow(e,t,n,o=this){if(!this.canMoveRows()||t===e)return!1;if(o===this&&this.options.treeData&&t){let s=this.rowModel.idOf(e),a=new Set;for(let l=this.rowModel.idOf(t);l!==null&&!a.has(l);){if(l===s)return!1;a.add(l);let c=this.rowModel.allNodes().find(d=>d.id===l);l=c?this.parentOf(c.data):null}}let r=this.dragOptions.canDrop;if(!r)return!0;try{return r({row:e,target:t,position:n,fromOtherGrid:o!==this})!==!1}catch{return O("rowDrag.canDrop threw; the drop was refused"),!1}}dropRow(e,t,n="after",o=this){var m,w;if(this.clientOnly("dropRow")||!e||typeof e!="object")return!1;let r=this.options.treeData;!r&&n==="inside"&&(n="after");let s=this.store.state.data,a=o!==this,l=a?-1:s.indexOf(e);if(!a&&l<0||t&&!s.includes(t)||a&&(!o.canMoveRows()||s.includes(e))||!this.canDropRow(e,t,n,o))return!1;let c=r?this.rawParent(e):null,d=!r||!t?null:n==="inside"?t:(m=this.store.state.data.find(g=>this.rowModel.idOf(g)===this.parentOf(t)))!=null?m:null,u=d?this.idValue(d):null,h=s.filter(g=>g!==e),p=!t||n==="inside"?h.length:h.indexOf(t)+(n==="after"?1:0);h.splice(p,0,e);let f=h.some((g,v)=>g!==s[v]);if(!a&&!f&&String(c!=null?c:"")===String(u!=null?u:""))return!1;let x=(g,v)=>{try{r.setParentId(e,g,v)}catch{O("treeData.setParentId threw")}},y=r&&(w=this.store.state.data.find(g=>this.rowModel.idOf(g)===this.parentOf(e)))!=null?w:null;return a?(o.removeRows([e]),r&&x(u,d),this.addRows([e],p)):(r&&x(u,d),this.replaceData(h),this.history.push({undo:()=>{r&&x(c,y),this.replaceData(s)},redo:()=>{r&&x(u,d),this.replaceData(h)}}),this.events.emit("rowDragEnd",{row:e,fromIndex:l,toIndex:p})),this.events.emit("rowDrop",{row:e,target:t,position:n,fromOtherGrid:a,fromGrid:a?o.api:null}),!0}moveRow(e,t,n=!0){if(this.clientOnly("moveRow")||!this.canMoveRows())return!1;let o=this.store.state.data,r=o.indexOf(e);if(r<0||!Number.isFinite(t))return!1;let s=Math.max(0,Math.min(o.length-1,Math.floor(t)));if(s===r)return!1;let a=[...o];return a.splice(r,1),a.splice(s,0,e),this.replaceData(a),n&&this.history.push({undo:()=>this.moveRow(e,r,!1),redo:()=>this.moveRow(e,s,!1)}),this.events.emit("rowDragEnd",{row:e,fromIndex:r,toIndex:s}),!0}setFont(e){let t=this.font.size;e.size!==void 0&&(typeof e.size=="number"&&e.size>0?t=e.size:O("setFont: size must be a positive number"));let n=e.family===void 0?this.font.family:e.family||null;this.font={size:t,family:n};let o=t!=null?t:mn;this.applyAutoHeights(o),this.renderer.applyFont(t,n),this.renderer.invalidateHeights(),this.menu.close(),this.layoutChanged()}densityOf(e){return e==="compact"||e==="comfortable"?e:"normal"}applyAutoHeights(e){let[t,n]=wn[this.density];this.options.rowHeight==null&&(this.renderer.opts.rowHeight=Math.round(No(e)*t)),this.options.headerHeight==null&&(this.renderer.opts.headerHeight=Math.round(Oo(e)*n))}setDensity(e){var n;let t=this.densityOf(e);t!==this.density&&(this.density=t,this.renderer.applyTheme(),this.applyAutoHeights((n=this.font.size)!=null?n:mn),this.renderer.invalidateHeights(),this.layoutChanged())}applyFontTo(e){this.font.size&&e.style.setProperty("--fg-font-size",`${this.font.size}px`),this.font.family&&e.style.setProperty("--fg-font",this.font.family)}summary(){var e;return this.summaryOpts&&((e=this.summaryOpts.rows)!=null&&e.length)?{opts:this.summaryOpts,values:this.summaryValues}:null}setSummary(e){if(e&&!Array.isArray(e.rows)){O("setSummary: summary.rows must be an array");return}this.summaryOpts=e,this.refreshSummary(),this.renderer.invalidate({header:!0,rows:!0})}refreshSummary(){var o,r;let e=this.summaryOpts;if(!((o=e==null?void 0:e.rows)!=null&&o.length)){this.summaryValues=[];return}let t=(r=e.scope)!=null?r:"filtered",n=t==="all"?this.rowModel.allNodes().map(s=>s.data):t==="selected"?this.selectedRows():this.rowModel.dataRows().map(s=>s.data);this.summaryValues=Xn(e.rows,n,s=>{var a;return(a=this.columns.getNode(s))==null?void 0:a.def})}dataColumns(){return this.columns.displayed().filter(e=>!$(e.id))}validRange(e){if(!e||this.options.rangeSelection===!1)return null;let t=this.rowModel.getRowCount(),n=o=>!!o&&!$(o.colId)&&!!this.columns.getColumn(o.colId)&&o.rowIndex>=0&&o.rowIndex<t;return n(e.start)&&n(e.end)?{start:{...e.start},end:{...e.end}}:null}setRange(e,t=!1){let n=this.validRange(e),o=t||!this.store.state.extraRanges.length?this.store.state.extraRanges:[],r=this.store.state.range;JSON.stringify(r)===JSON.stringify(n)&&o===this.store.state.extraRanges||(this.store.set({range:n,extraRanges:o}),this.events.emit("rangeChange",{range:n&&{start:{...n.start},end:{...n.end}}}))}addRange(e){let{range:t,focus:n}=this.store.state,o=this.validRange(t!=null?t:n?{start:n,end:n}:null);o&&this.store.set({extraRanges:[...this.store.state.extraRanges,o]}),this.setRange(e,!0)}getRanges(){let e=[...this.store.state.extraRanges];return this.store.state.range&&e.push(this.store.state.range),e.map(t=>({start:{...t.start},end:{...t.end}}))}setRanges(e){var n;let t=(Array.isArray(e)?e:[]).map(o=>this.validRange(o)).filter(o=>!!o);this.store.set({extraRanges:t.slice(0,-1)}),this.setRange((n=t[t.length-1])!=null?n:null,!0)}boundsOf(e){if(!e)return null;let t=this.columns.getColumn(e.start.colId),n=this.columns.getColumn(e.end.colId);return!t||!n?null:Fe({start:{rowIndex:e.start.rowIndex,colIndex:t.index},end:{rowIndex:e.end.rowIndex,colIndex:n.index}})}rangeBounds(){return this.boundsOf(this.store.state.range)}allRangeBounds(){return[...this.store.state.extraRanges,this.store.state.range].map(e=>this.boundsOf(e)).filter(e=>!!e)}rangeContains(e,t){let n=this.columns.getColumn(t);return!!n&&this.allRangeBounds().some(o=>so(o,e,n.index))}selectAllCells(){let e=this.dataColumns(),t=this.rowModel.getRowCount();!e.length||!t||(this.store.state.focus||this.setFocus(0,e[0].id),this.setRange({start:{rowIndex:0,colId:e[0].id},end:{rowIndex:t-1,colId:e[e.length-1].id}}))}selectionTSV(e,t=!1){let n=this.store.state.locale.code,o=this.columns.displayed(),r=t?null:this.rangeBounds(),s=t,a,l,c=t?[]:this.allRangeBounds();if(c.length>1){let u=c.every(p=>p.c1===c[0].c1&&p.c2===c[0].c2),h=c.every(p=>p.r1===c[0].r1&&p.r2===c[0].r2);if(this.rangesStack(c)){let p=[...c].sort((y,m)=>u?y.r1-m.r1:y.c1-m.c1),f=p.map(y=>this.rangeMatrix(y)),x=u?f.flat():f[0].map((y,m)=>f.flatMap(w=>{var g;return(g=w[m])!=null?g:[]}));return e&&x.unshift((u?p.slice(0,1):p).flatMap(y=>this.rangeHeaders(y))),jt(x)}}if(r){a=[];for(let u=r.r1;u<=r.r2;u++){let h=this.rowModel.getRow(u);h.kind||a.push(h.data)}l=o.slice(r.c1,r.c2+1).filter(u=>!$(u.id))}else if(s){let u=this.store.state.selected;a=this.rowModel.dataRows().filter(h=>u.has(h.id)).map(h=>h.data),l=this.dataColumns()}else{let u=this.store.state.focus,h=u&&this.columns.getColumn(u.colId),p=u&&this.rowModel.getRow(u.rowIndex);if(!h||!p||p.kind||$(h.id))return"";a=[p.data],l=[h]}let d=a.map(u=>l.map(h=>this.copyCell(h.def,u,n)));return e&&d.unshift(l.map(u=>{var h,p;return(p=(h=u.def.header)!=null?h:u.def.field)!=null?p:u.id})),jt(d)}rangesStack(e){return e.length>1&&(e.every(t=>t.c1===e[0].c1&&t.c2===e[0].c2)||e.every(t=>t.r1===e[0].r1&&t.r2===e[0].r2))}rangeHeaders(e){return this.columns.displayed().slice(e.c1,e.c2+1).filter(t=>!$(t.id)).map(t=>{var n,o;return(o=(n=t.def.header)!=null?n:t.def.field)!=null?o:t.id})}rangeMatrix(e){let t=this.columns.displayed().slice(e.c1,e.c2+1).filter(r=>!$(r.id)),n=this.store.state.locale.code,o=[];for(let r=e.r1;r<=e.r2;r++){let s=this.rowModel.getRow(r);s&&!s.kind&&o.push(t.map(a=>this.copyCell(a.def,s.data,n)))}return o}copyCell(e,t,n){return this.copyAllowed(e,t)?gt(e,G(e,t),n):""}copyAllowed(e,t){let n=e.copyable;if(typeof n!="function")return n!==!1;try{return n({value:G(e,t),row:t,column:e})!==!1}catch{return!1}}cutToClipboard(){let e=this.copyToClipboard(!1);return e&&this.clearCells(!0),e}copyToClipboard(e,t=!1){var o,r,s;let n=this.selectionTSV(e,t);if(n&&typeof navigator!="undefined"&&((o=navigator.clipboard)!=null&&o.writeText))try{(s=(r=navigator.clipboard.writeText(n))==null?void 0:r.catch)==null||s.call(r,()=>{})}catch{}return n}pasteText(e){var x;let t=ro(e),n={changed:0,skipped:0};if(!t.length)return n;let o=this.columns.displayed(),r=this.rowModel.getRowCount(),s=this.rangeBounds(),a=this.store.state.focus,l=a&&this.columns.getColumn(a.colId),c,d;if(s)c=s.r1,d=s.c1;else if(a&&l&&!$(l.id))c=a.rowIndex,d=l.index;else return n;let u=[],h=t.length===1&&t[0].length===1,p=h&&s?s.r2-s.r1+1:t.length,f=h&&s?s.c2-s.c1+1:Math.max(...t.map(y=>y.length));for(let y=0;y<p;y++){let m=c+y;if(m>=r)break;let w=this.rowModel.getRow(m);if(!w.kind)for(let g=0;g<f;g++){let v=o[d+g];if(!v)break;if($(v.id))continue;let C=h&&s?t[0][0]:(x=t[y])==null?void 0:x[g];if(C===void 0)continue;let R=v.def;if(!R.field||!le(R,w.data,m)){n.skipped++;continue}let k=w.data[R.field],T=this.acceptText(R,w.data,C,k);if(!T.ok){n.skipped++;continue}this.writeCell(u,w.data,R.field,v.id,m,T.value)&&n.changed++}}return this.endCellTx(u),this.events.emit("paste",{...n}),n}acceptText(e,t,n,o){var a;let r,s=e.editor;if(s&&typeof s=="object"&&s.type==="select"){let l=(a=typeof s.options=="function"?s.options(t):s.options)!=null?a:[],c=n.trim().toLowerCase(),d=l.map(u=>u!==null&&typeof u=="object"&&"value"in u?u:{value:u,label:String(u),disabled:!1}).find(u=>{var h;return String(u.value).toLowerCase()===c||((h=u.label)!=null?h:"").toLowerCase()===c});if(!d||d.disabled)return{ok:!1};r=d.value}else if(e.formulas&&Re(n.trim()))r=n.trim();else{let l=mt(e,n,o);if(!l.ok)return l;r=l.value}return this.cellError(e,t,r)!==null?{ok:!1}:{ok:!0,value:r}}cellError(e,t,n){let o=this.store.state.locale;if(e.required&&z(n))return o.required;if(e.unique&&e.field&&!z(n)){let r=n instanceof Date?n.getTime():String(n),s=e.field;if(this.store.state.data.some(a=>{if(a===t)return!1;let l=a[s];return!z(l)&&(l instanceof Date?l.getTime():String(l))===r}))return o.duplicate}if(e.validate){let r;try{r=e.validate(n,t)}catch{r=o.invalidValue}if(r!==!0)return typeof r=="string"&&r?r:o.invalidValue}return null}validateAll(){let e=[],t=this.columns.getState().map(n=>({id:n.colId,def:this.columns.getNode(n.colId).def})).filter(n=>n.def.field&&n.def.editable&&(n.def.required||n.def.unique||n.def.validate));return this.store.state.data.forEach((n,o)=>{let r=this.rowModel.idOf(n),s=this.rowModel.indexOfId(r);for(let a of t){if(!le(a.def,n,s<0?o:s))continue;let l=this.cellError(a.def,n,n[a.def.field]);l!==null&&e.push({row:n,rowIndex:s,colId:a.id,message:l})}}),e}mergeSpans(){if(this.rowModel.server||!this.columns.displayed().some(r=>r.def.merge||r.def.rowSpan))return Ni;let e=this.rowModel.rows(),t=this.editVersion*1e6+this.columns.displayed().length;if(this.spanCache&&this.spanCache.rows===e&&this.spanCache.ver===t)return this.spanCache.spans;let n=new Map,o=this.columns.displayed().filter(r=>r.def.merge||r.def.rowSpan);if(o.length&&!e.some(r=>r.kind)){let r=e.map(s=>s.data);for(let s of o)n.set(s.id,tt(r,s.def))}return this.spanCache={rows:e,ver:t,spans:n},n}rangeAggregates(){let e=this.allRangeBounds();if(!e.length)return null;let t=this.columns.displayed(),n={cells:0,count:0,numbers:0,sum:0,min:1/0,max:-1/0},o=e.length>1?new Set:null;for(let r of e)for(let s=r.r1;s<=r.r2;s++){let a=this.rowModel.getRow(s);if(!a||a.kind)continue;let l=a.data;for(let c of t.slice(r.c1,r.c2+1)){if($(c.id))continue;if(o){let u=`${s},${c.index}`;if(o.has(u))continue;o.add(u)}n.cells++;let d=G(c.def,l);if(!z(d)&&(n.count++,typeof d=="number"||c.def.type==="number"&&!Number.isNaN(Number(d)))){let u=Number(d);n.numbers++,n.sum+=u,u<n.min&&(n.min=u),u>n.max&&(n.max=u)}}}return n}fillRange(e){var u;let t=(u=this.rangeBounds())!=null?u:(()=>{let h=this.store.state.focus,p=h&&this.columns.getColumn(h.colId);return h&&p&&!$(p.id)?{r1:h.rowIndex,r2:h.rowIndex,c1:p.index,c2:p.index}:null})(),n=this.columns.getColumn(e.start.colId),o=this.columns.getColumn(e.end.colId);if(!t||!n||!o)return;let r=Fe({start:{rowIndex:e.start.rowIndex,colIndex:n.index},end:{rowIndex:e.end.rowIndex,colIndex:o.index}}),s=this.rowModel.getRowCount();r.r1=Math.max(0,r.r1),r.r2=Math.min(s-1,r.r2);let a=this.columns.displayed(),l=[],c=(h,p,f)=>{let x=a[p],y=this.rowModel.getRow(h),m=x==null?void 0:x.def;!y||y.kind||!(m!=null&&m.field)||$(x.id)||!le(m,y.data,h)||this.cellError(m,y.data,f)===null&&this.writeCell(l,y.data,m.field,x.id,h,f)},d=(h,p)=>G(a[p].def,this.rowModel.getRow(h).data);if(r.r1<t.r1||r.r2>t.r2)for(let h=t.c1;h<=t.c2;h++){let p=[],f=[];for(let x=t.r1;x<=t.r2;x++)p.push(d(x,h));for(let x=t.r2;x>=t.r1;x--)f.push(d(x,h));$e(p,r.r2-t.r2).forEach((x,y)=>c(t.r2+1+y,h,x)),$e(f,t.r1-r.r1).forEach((x,y)=>c(t.r1-1-y,h,x))}else if(r.c1<t.c1||r.c2>t.c2)for(let h=t.r1;h<=t.r2;h++){let p=[],f=[];for(let x=t.c1;x<=t.c2;x++)p.push(d(h,x));for(let x=t.c2;x>=t.c1;x--)f.push(d(h,x));$e(p,r.c2-t.c2).forEach((x,y)=>c(h,t.c2+1+y,x)),$e(f,t.c1-r.c1).forEach((x,y)=>c(h,t.c1-1-y,x))}else return;this.endCellTx(l),this.setRange({start:{rowIndex:r.r1,colId:a[r.c1].id},end:{rowIndex:r.r2,colId:a[r.c2].id}})}setPinnedRows(e){e.top&&(this.pinnedRows.top=ue(e.top)),e.bottom&&(this.pinnedRows.bottom=ue(e.bottom)),this.renderer.invalidate({rows:!0})}writeCell(e,t,n,o,r,s){let a=t[n];return Object.is(a,s)||this.veto("beforeCellChange",{row:t,rowIndex:r,colId:o,oldValue:a,newValue:s})?!1:(this.tracker.beforeChange(t),t[n]=s,e.push({row:t,field:n,colId:o,oldValue:a,newValue:s}),this.events.emit("cellValueChanged",{row:t,rowIndex:r,colId:o,oldValue:a,newValue:s}),!0)}endCellTx(e){if(!e.length)return;let t=(n,o)=>{for(let r of n){let s=r.row[r.field];r.row[r.field]=r[o],this.events.emit("cellValueChanged",{row:r.row,rowIndex:this.rowModel.indexOfId(this.rowModel.idOf(r.row)),colId:r.colId,oldValue:s,newValue:r[o]})}this.afterDataEdit()};this.history.push({undo:()=>t([...e].reverse(),"oldValue"),redo:()=>t(e,"newValue")}),this.afterDataEdit()}afterDataEdit(){this.renderer.invalidateHeights(),this.editVersion++,this.refreshSummary(),this.renderer.invalidate({rows:!0})}applyEdit(e,t,n){var a;let o=this.rowModel.getRow(e),r=(a=this.columns.getColumn(t))==null?void 0:a.def;if(!o||!(r!=null&&r.field))return;let s=[];this.writeCell(s,o.data,r.field,t,e,n),this.endCellTx(s)}clearCells(e=!1){var l,c;let t=this.columns.displayed(),n=this.allRangeBounds();if(e&&!this.rangesStack(n)){let d=this.rangeBounds();n=d?[d]:[]}let o=this.store.state.focus,r=o?(l=this.columns.getColumn(o.colId))==null?void 0:l.index:void 0,s=n.length?n:o&&r!==void 0?[{r1:o.rowIndex,r2:o.rowIndex,c1:r,c2:r}]:[];if(!s.length)return;let a=[];for(let d of s)for(let u=d.r1;u<=d.r2;u++){let h=this.rowModel.getRow(u);for(let p=d.c1;p<=d.c2;p++){let f=(c=t[p])==null?void 0:c.def;h&&!h.kind&&(f!=null&&f.field)&&le(f,h.data,u)&&(!e||this.copyAllowed(f,h.data))&&this.writeCell(a,h.data,f.field,t[p].id,u,null)}}this.endCellTx(a)}replaceData(e){this.store.set({data:e});let t=new Set(this.rowModel.allNodes().map(s=>s.id)),n=this.store.state.selected;[...n].some(s=>!t.has(s))&&this.setSelected(new Set([...n].filter(s=>t.has(s))));let o=this.rowModel.getRowCount(),r=this.store.state.focus;r&&r.rowIndex>=o&&this.store.set({focus:o?{...r,rowIndex:o-1}:null})}addRows(e,t,n=!0){if(this.clientOnly("addRows"))return[];let o=ue(Array.isArray(e)?e:[]);if(!o.length)return[];let r=[...this.store.state.data],s=t===void 0?r.length:Math.max(0,Math.min(r.length,t));r.splice(s,0,...o);for(let a of o)this.tracker.created.add(a);return this.replaceData(r),n&&this.history.push({undo:()=>this.removeRows(o,!1),redo:()=>this.addRows(o,s,!1)}),this.events.emit("rowsAdded",{rows:[...o]}),o}removeRows(e,t=!0){if(this.clientOnly("removeRows"))return[];let n=this.store.state.data,o=typeof e=="function"?e:(l=>c=>l.has(c))(new Set(e)),r=[];if(n.forEach((l,c)=>{let d=!1;try{d=!!o(l)}catch{d=!1}d&&r.push({row:l,index:c})}),!r.length)return[];let s=new Set(r.map(l=>l.row)),a=new Set(r.filter(l=>this.tracker.created.has(l.row)).map(l=>l.row));for(let{row:l,index:c}of r)a.has(l)?this.tracker.created.delete(l):this.tracker.deleted.set(l,c);return this.replaceData(n.filter(l=>!s.has(l))),t&&this.history.push({undo:()=>{let l=[...this.store.state.data];for(let{row:c,index:d}of r)l.splice(Math.min(d,l.length),0,c),this.tracker.deleted.delete(c),a.has(c)&&this.tracker.created.add(c);this.replaceData(l)},redo:()=>this.removeRows([...s],!1)}),this.events.emit("rowsRemoved",{rows:r.map(l=>l.row)}),r.map(l=>l.row)}trackedFields(){let e=[],t=n=>{for(let o of n)o.children?t(o.children):o.def.field&&!$(o.id)&&e.push({field:o.def.field,colId:o.id})};return t(this.columns.roots()),e}getChanges(){let e=this.trackedFields(),t=[];for(let[n,o]of this.tracker.originals)if(!this.tracker.deleted.has(n))for(let r of this.tracker.diff(n,e.map(s=>s.field)))t.push({row:n,colId:e.find(s=>s.field===r).colId,oldValue:o[r],newValue:n[r]});return t}getModifiedRows(){let e=this.trackedFields().map(n=>n.field),t=this.store.state.data;return{created:t.filter(n=>this.tracker.created.has(n)),updated:t.filter(n=>this.tracker.originals.has(n)&&this.tracker.diff(n,e).length>0),deleted:[...this.tracker.deleted.keys()]}}hasChanges(){let e=this.getModifiedRows();return e.created.length+e.updated.length+e.deleted.length>0}commitChanges(e){e&&e.rows instanceof Map?this.tracker.commit(e.rows,Array.isArray(e.deleted)?e.deleted:[]):this.tracker.reset(),this.renderer.invalidate({rows:!0})}revertChanges(){this.editor.cancel();for(let[n,o]of this.tracker.originals)Object.assign(n,o);let e=this.store.state.data.filter(n=>!this.tracker.created.has(n)),t=[...this.tracker.deleted.entries()].sort((n,o)=>n[1]-o[1]);e=[...e];for(let[n,o]of t)e.splice(Math.min(o,e.length),0,n);this.tracker.reset(),this.history.clear(),this.replaceData(e),this.afterDataEdit()}undo(){this.editor.cancel(),this.history.undo()}redo(){this.editor.cancel(),this.history.redo()}toast(e){let t=S("div","fg-toast",{role:"status"});t.textContent=e,this.renderer.root.append(t),setTimeout(()=>t.remove(),3500)}refreshChoosers(){var e;this.chooser.refresh(),(e=this.sideBar)==null||e.refresh()}setColumnsVisible(e,t){let n=[];for(let o of e){let r=this.columns.getNode(o);!r||r.children||r.hide===!t||(this.columns.setHide(o,!t),n.push(o))}if(n.length){this.columnsChanged();for(let o of n)this.events.emit("columnVisible",{colId:o,visible:t})}}autoSize(e){var l,c;let t=(e?e.map(d=>this.columns.getColumn(d)):this.columns.displayed()).filter(d=>!!d&&Xe(d.def)),{first:n,last:o}=this.renderer.renderedRange(),r=this.store.state.locale.code,s=66,a=24;for(let d of t){let u=this.renderer.measureText((c=(l=d.def.header)!=null?l:d.def.field)!=null?c:"",!0)+s,h=_(d.def,r);for(let f=n;f<=o;f++){let x=this.rowModel.getRow(f);x&&(u=Math.max(u,this.renderer.measureText(h(G(d.def,x.data)),!1)+a))}let p=this.columns.setWidth(d.id,Math.ceil(u));this.events.emit("columnResize",{colId:d.id,width:p})}this.layoutChanged()}resetColumns(){this.columns.reset(),this.columnsChanged()}setSort(e){let t=e.filter(n=>{let o=this.columns.getNode(n.colId);return!o||o.children?(O(`setSort: unknown column "${n.colId}"`),!1):n.dir==="asc"||n.dir==="desc"});this.veto("beforeSort",{sort:t.map(n=>({...n}))})||(this.store.set({sort:t}),this.events.emit("sortChange",{sort:[...t]}))}toggleSort(e,t){let n=this.store.state.sort,o=n.find(a=>a.colId===e),r=o?o.dir==="asc"?"desc":null:"asc",s;t?r?o?s=n.map(a=>a.colId===e?{colId:e,dir:r}:a):s=[...n,{colId:e,dir:r}]:s=n.filter(a=>a.colId!==e):s=r?[{colId:e,dir:r}]:[],this.setSort(s)}setFilter(e,t){let n=this.columns.getNode(e);if(!n||n.children){O(`setFilter: unknown column "${e}"`);return}if(this.veto("beforeFilter",{colId:e,model:t}))return;let o={...this.store.state.filters};t?o[e]=t:delete o[e],this.store.set({filters:o}),this.events.emit("filterChange",{filters:{...o}})}setPinned(e,t){this.columns.setPinned(e,t),this.layoutChanged()}setFocus(e,t){let n=this.store.state.focus;n&&n.rowIndex===e&&n.colId===t||(this.store.set({focus:{rowIndex:e,colId:t}}),this.events.emit("focusChange",{rowIndex:e,colId:t}))}setSelected(e,t=this.store.state.anchorId){this.selectionVersion++,this.store.set({selected:e,anchorId:t}),this.events.emit("selectionChange",{selected:this.selectedRows()})}rowSelectable(e){let t=this.options.isRowSelectable;if(!t)return!0;try{return!!t(e)}catch{return!1}}groupMemberIds(e){var a,l;if(e.group)return e.group.rows.filter(c=>this.rowSelectable(c)).map(c=>this.rowModel.idOf(c));let t=(a=this.options.treeData)==null?void 0:a.getParentId;if(!t)return[];let n=new Map;for(let c of this.store.state.data){let d=null;try{d=t(c)}catch{d=null}if(d==null)continue;let u=String(d),h=n.get(u);h?h.push(c):n.set(u,[c])}let o=[],r=new Set([e.id]),s=[e.id];for(;s.length;)for(let c of(l=n.get(s.shift()))!=null?l:[]){let d=this.rowModel.idOf(c);r.has(d)||(r.add(d),s.push(d),this.rowSelectable(c)&&o.push(d))}return o}groupSelection(e){let t=this.groupMemberIds(e),n=this.store.state.selected,o=t.filter(r=>n.has(r)).length;return o===0?"none":o===t.length?"all":"some"}toggleGroupSelection(e){if(this.options.rowSelection!=="multiple")return;let t=this.groupMemberIds(e),n=new Set(this.store.state.selected),o=t.length>0&&t.every(r=>n.has(r));for(let r of t)o?n.delete(r):n.add(r);this.setSelected(n)}selectFromClick(e,t,n){var a,l;let o=this.options.rowSelection;if(!o||e<0||e>=this.rowModel.getRowCount())return;let r=this.rowModel.getRow(e);if(r.kind||!this.rowSelectable(r.data))return;let s=Po({selected:this.store.state.selected,anchorIndex:this.anchorIndex(),mode:o,index:e,idAt:c=>this.rowModel.getRow(c).id,toggle:t,range:n});if(this.rowModel.rows()!==this.rowModel.dataRows()||this.options.isRowSelectable)for(let c of s.selected){if(this.store.state.selected.has(c))continue;let d=this.rowModel.indexOfId(c),u=d>=0?this.rowModel.getRow(d):null;u&&(u.kind||!this.rowSelectable(u.data))&&s.selected.delete(c)}if(o==="multiple"&&this.options.groupSelectsChildren&&this.options.treeData&&r.hasChildren){let c=s.selected.has(r.id);for(let d of this.groupMemberIds(r))c?s.selected.add(d):s.selected.delete(d)}this.setSelected(s.selected,(l=(a=this.rowModel.getRow(s.anchorIndex))==null?void 0:a.id)!=null?l:null)}anchorIndex(){let e=this.store.state.anchorId;if(e==null)return null;let t=this.rowModel.indexOfId(e);return t<0?null:t}selectableRows(){let e=this.rowModel.dataRows();return this.options.isRowSelectable?e.filter(t=>this.rowSelectable(t.data)):e}toggleSelectAll(){let e=this.selectableRows(),t=this.store.state.selected,n=e.length>0&&e.every(r=>t.has(r.id)),o=new Set(t);for(let r of e)n?o.delete(r.id):o.add(r.id);this.setSelected(o)}selectedRows(){let e=this.store.state.selected;return e.size?this.rowModel.allNodes().filter(t=>e.has(t.id)).map(t=>t.data):[]}withSelect(e){let t=[],n=this.options.rowNumbers;if(n){let o=typeof n=="object"?n:{};t.push(Bn(typeof o.width=="number"&&o.width>0?o.width:void 0,typeof o.header=="string"?o.header:void 0))}return this.options.rowDrag&&t.push(Hn),this.options.rowSelection&&t.push(On),[...t,...e]}setData(e,t){if(this.clientOnly("setData"))return;if(!Array.isArray(e)){O("setData: rows must be an array");return}this.editor.cancel(),this.tracker.reset(),this.history.clear(),this.detailOpen.clear(),this.treeLoaded.clear(),this.treeLoading.clear(),this.renderer.dropDetail(),this.store.set({data:ue(e)}),t!=null&&t.scrollToTop&&this.renderer.setScroll({top:0,left:0});let n=this.store.state.selected;if(n.size)if(this.options.getRowId){let s=new Set(this.rowModel.allNodes().map(l=>l.id)),a=new Set([...n].filter(l=>s.has(l)));a.size!==n.size&&this.setSelected(a)}else this.setSelected(new Set,null);let o=this.rowModel.getRowCount(),r=this.store.state.focus;r&&r.rowIndex>=o&&this.store.set({focus:o?{...r,rowIndex:o-1}:null})}setColumns(e){var o;if(!Array.isArray(e)){O("setColumns: columns must be an array");return}if(this.menu.close(),this.sourceDefs=e,this.pivotCfg){this.rebuildPivot();return}this.columns.setDefs(this.withSelect(e));let t=r=>!!this.columns.getNode(r),n=this.groupBy.filter(t);n.length!==this.groupBy.length&&(this.groupBy=n,(o=this.groupPanel)==null||o.refresh(),this.events.emit("groupChange",{groupBy:[...n]})),this.store.set({sort:this.store.state.sort.filter(r=>t(r.colId)),filters:Object.fromEntries(Object.entries(this.store.state.filters).filter(([r])=>t(r))),focus:null}),this.columnsChanged()}onChange(e){var o,r,s,a;let t=(...l)=>l.some(c=>e.includes(c));this.pivotCfg&&t("data","locale")&&this.rebuildPivot(!1),t("locale")&&(this.menu.close(),this.chooser.close(),(o=this.sideBar)==null||o.refresh(),this.rowModel.invalidate());let n=t("sort","filters","quickFilter","advancedFilter")&&this.page!==0;n&&(this.page=0),t("data","sort","filters","quickFilter","advancedFilter","locale")&&this.updateRows(),n&&this.emitPage(),t("data","sort","filters","quickFilter","advancedFilter")&&this.store.state.range&&!this.keepRange&&this.setRange(null),t("data","sort","filters","quickFilter","advancedFilter","locale")&&this.finder.refresh(),(t("data","filters","quickFilter","advancedFilter","locale")||t("selected")&&((r=this.summaryOpts)==null?void 0:r.scope)==="selected")&&this.refreshSummary(),t("locale")&&((s=this.groupPanel)==null||s.refresh()),t("filters")&&((a=this.sideBar)==null||a.refresh()),t("theme")&&this.renderer.applyTheme(),this.renderer.invalidate({header:t("sort","filters","quickFilter","advancedFilter","locale","selected","data"),rows:t("data","sort","filters","quickFilter","advancedFilter","locale")})}createApi(){let e=t=>((...n)=>{if(this.destroyed){O("API called after destroy()");return}return t(...n)});return{setData:e((t,n)=>this.setData(t,n)),getData:e(()=>this.store.state.data),setColumns:e(t=>this.setColumns(t)),getColumnState:e(()=>this.columns.getState()),applyColumnState:e(t=>{this.columns.applyState(t),this.columnsChanged()}),setSort:e(t=>this.setSort(t)),getSort:e(()=>[...this.store.state.sort]),setFilter:e((t,n)=>this.setFilter(t,n)),getFilterModel:e(()=>({...this.store.state.filters})),setQuickFilter:e(t=>this.store.set({quickFilter:t!=null?t:""})),getSelectedRows:e(()=>this.selectedRows()),selectAll:e(()=>this.setSelected(new Set([...this.store.state.selected,...this.selectableRows().map(t=>t.id)]))),deselectAll:e(()=>this.setSelected(new Set,null)),getDisplayedRowCount:e(()=>this.rowModel.getRowCount()),scrollToRow:e(t=>this.renderer.scrollToRow(t)),validate:e(()=>this.validateAll()),setDensity:e(t=>this.setDensity(t)),getDensity:e(()=>this.density),showOverlay:e(t=>{this.forcedOverlay=t==="loading"||t==="noRows"?t:null,this.renderer.invalidate()}),getXlsxSheet:e(t=>on(this,t)),print:e(t=>wo(en(this,t))),getPrintHtml:e(t=>en(this,t)),setColumnGroupOpened:e((t,n)=>this.setColumnGroupOpened(t,n)),setAdvancedFilter:e(t=>this.setAdvancedFilter(t)),getAdvancedFilter:e(()=>this.store.state.advancedFilter?JSON.parse(JSON.stringify(this.store.state.advancedFilter)):null),openFilterBuilder:e(()=>this.filterBuilder.open()),isColumnGroupOpened:e(t=>{var n;return!!((n=this.columns.getNode(t))!=null&&n.open)}),applyTransaction:e(t=>this.applyTransaction(t)),applyTransactionAsync:e(t=>this.applyTransactionAsync(t)),getState:e(()=>this.getState()),setState:e((t,n)=>this.setState(t,n)),getScrollPosition:e(()=>this.renderer.getScroll()),setScrollPosition:e(t=>this.renderer.setScroll(t!=null?t:{})),syncScroll:e((t,n="both")=>this.syncScroll(t,n)),setTheme:e(t=>this.store.set({theme:t})),setLocale:e(t=>this.store.set({locale:Ie(t)})),setFont:e(t=>this.setFont(t)),setColumnVisible:e((t,n)=>this.setColumnsVisible([t],n)),autoSizeColumns:e(t=>this.autoSize(t)),resetColumnState:e(()=>this.resetColumns()),openColumnChooser:e(()=>this.chooser.open()),closeColumnChooser:e(()=>this.chooser.close()),toggleSideBar:e((t,n)=>{var o;return(o=this.sideBar)==null?void 0:o.toggle(t,n)}),setSummary:e(t=>this.setSummary(t)),getSummaryValues:e(()=>this.summaryValues.map(t=>({...t}))),getRange:e(()=>{let t=this.store.state.range;return t&&{start:{...t.start},end:{...t.end}}}),setRange:e(t=>this.setRange(t)),getRanges:e(()=>this.getRanges()),setRanges:e(t=>this.setRanges(t)),copySelection:e(t=>this.copyToClipboard(!!(t!=null&&t.headers),!!(t!=null&&t.rows))),pasteText:e(t=>this.pasteText(t)),cutSelection:e(()=>this.cutToClipboard()),stopRowEdit:e(t=>this.editor.endRow(!t)),startEdit:e((t,n)=>this.editor.start(t,n)),stopEdit:e(t=>t?this.editor.cancel():void this.editor.commit(null)),addRows:e((t,n)=>this.addRows(t,n)),removeRows:e(t=>this.removeRows(t)),removeSelectedRows:e(()=>this.removeRows(this.selectedRows())),getModifiedRows:e(()=>this.getModifiedRows()),getChanges:e(()=>this.getChanges()),hasChanges:e(()=>this.hasChanges()),commitChanges:e(t=>this.commitChanges(t)),revertChanges:e(()=>this.revertChanges()),undo:e(()=>this.undo()),redo:e(()=>this.redo()),canUndo:e(()=>this.history.canUndo()),canRedo:e(()=>this.history.canRedo()),fillRange:e(t=>this.fillRange(t)),setPinnedRows:e(t=>this.setPinnedRows(t)),find:e(t=>this.finder.find(t)),findNext:e(()=>this.finder.next()),findPrevious:e(()=>this.finder.previous()),clearFind:e(()=>this.finder.clear()),setGroupBy:e(t=>this.setGroupBy(t)),getGroupBy:e(()=>this.getGroupBy()),setGroupExpanded:e((t,n)=>this.setGroupExpanded(t,n)),expandAll:e(()=>this.expandAll(!0)),collapseAll:e(()=>this.expandAll(!1)),setDetailExpanded:e((t,n)=>this.setDetailExpanded(t,n)),isDetailExpanded:e(t=>this.isDetailExpanded(t)),moveRow:e((t,n)=>this.moveRow(t,n)),dropRow:e((t,n,o)=>this.dropRow(t,n,o)),setPage:e(t=>this.setPage(t)),getPage:e(()=>this.getPage()),getPageCount:e(()=>this.getPageCount()),setPageSize:e(t=>this.setPageSize(t)),getPageSize:e(()=>this.getPageSize()),refreshRows:e(()=>this.refreshRows()),setPivot:e(t=>this.setPivot(t)),getPivot:e(()=>this.getPivot()),createChart:e(t=>this.charts.create(t)),getCsv:e(t=>tn(this,t)),exportCsv:e((t="export.csv",n)=>Be(t,["\uFEFF",tn(this,n)],"text/csv;charset=utf-8")),getXlsx:e(t=>nn(this,t)),exportXlsx:e((t="export.xlsx",n)=>Be(t,[nn(this,n)],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")),importFile:e((t,n)=>vo(this,t,n)),on:e((t,n)=>this.events.on(t,n)),destroy:()=>this.destroy()}}destroy(){if(!this.destroyed){this.destroyed=!0,it.delete(this.renderer.root),clearTimeout(this.flashTimer),clearTimeout(this.txTimer);for(let e of this.disposers)e();this.renderer.destroy(),this.events.clear()}}};function Ho(i,e){return new vn(i,e).api}function yn(i){let e=(Array.isArray(i)?i:[]).filter(t=>t&&t.grid&&typeof t.grid.getXlsxSheet=="function");return e.length?be(e.map((t,n)=>{var o,r,s;return t.grid.getXlsxSheet({...t.options,sheetName:(s=(r=t.sheetName)!=null?r:(o=t.options)==null?void 0:o.sheetName)!=null?s:`Sheet${n+1}`})})):(O("buildWorkbook: no grids given; the file has one empty sheet"),be([{name:"Sheet1",rows:[]}]))}function Bo(i,e){Be(i||"export.xlsx",[yn(e)],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")}var Oi=i=>typeof i=="function"?i():i!=null?i:{};async function Go(i,e,t,n){var c;let o=i,r=i.split(/[?#]/)[0],s={method:e,credentials:(c=n.credentials)!=null?c:"same-origin",headers:{Accept:"application/json",...Oi(n.headers)}};if(e==="GET"){let d=new URLSearchParams;for(let[u,h]of Object.entries(t))h!==void 0&&d.set(u,typeof h=="string"?h:JSON.stringify(h));o+=(i.includes("?")?"&":"?")+d.toString()}else s.headers["Content-Type"]="application/json",s.body=JSON.stringify(t);let a=await fetch(o,s);if(!a.ok)throw new Error(`HTTP ${a.status} from ${r}`);let l=await a.text();if(!l)return null;try{return JSON.parse(l)}catch{throw new Error(`HTTP ${a.status} from ${r}: the response is not JSON`)}}function Hi(i){if(Array.isArray(i))return{rows:i};let e=i!=null?i:{},t=[e.rows,e.list,e.content,e.data,e.items,e.resultList].find(Array.isArray),n=[e.total,e.totalCount,e.totalElements,e.totCnt,e.count].find(o=>typeof o=="number");return{rows:(t!=null?t:[]).filter(o=>o!==null&&typeof o=="object"),total:n}}function xn(i,e={}){return{async getRows(t){var s,a,l,c,d;let n=Math.max(1,t.end-t.start),o={start:t.start,end:t.end,page:Math.floor(t.start/n),size:n,sort:t.sort,filters:t.filters,quickFilter:t.quickFilter,advancedFilter:(s=t.advancedFilter)!=null?s:void 0,groupBy:t.groupBy,groupKeys:t.groupKeys,...(l=(a=e.params)==null?void 0:a.call(e))!=null?l:{}},r=await Go(i,(c=e.method)!=null?c:"POST",o,e);return((d=e.transform)!=null?d:Hi)(r)}}}var bn=new WeakMap;function zo(i,e,t={}){let n=bn.get(i);if(n)return n;if(!i.hasChanges())return Promise.resolve(null);let{created:o,updated:r,deleted:s}=i.getModifiedRows(),a=new Map([...o,...r].map(c=>[c,{...c}])),l=(async()=>{var d,u;let c=await Go(e,"POST",{created:o,updated:r,deleted:s,...(u=(d=t.params)==null?void 0:d.call(t))!=null?u:{}},t);return i.commitChanges({rows:a,deleted:s}),c})().finally(()=>bn.delete(i));return bn.set(i,l),l}async function Vo(i,e,t={}){var o;let{rows:n}=await xn(e,t).getRows({start:0,end:(o=t.maxRows)!=null?o:1e4,sort:[],filters:{},quickFilter:""});return i.setData(n),n}function qo(i=document){var n,o;let e=(n=i.querySelector('meta[name="_csrf"]'))==null?void 0:n.content,t=((o=i.querySelector('meta[name="_csrf_header"]'))==null?void 0:o.content)||"X-CSRF-TOKEN";return e?{[t]:e}:{}}var Wo={en:se,ko:Ln,"zh-CN":Tn,"zh-TW":In,ja:En,es:kn,fr:Mn,de:Sn,vi:Dn,th:An,id:Pn,ru:$n,"pt-BR":Fn,it:Nn};for(let i of Object.values(Wo))Ke(i);return Yo(Bi);})();