@sheetxl/studio-mui 0.7.26 → 0.7.28-beta.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.
- package/README.md +2 -2
- package/browser/cjs/BQJKf40kttQWOzLw.cjs +20 -0
- package/browser/cjs/BTZ5uzK0wHzpiZGC.cjs +1 -0
- package/browser/cjs/B_D3JKseVvpRyX-E.cjs +1 -0
- package/browser/cjs/B_WyRpeiesnEiNP4.cjs +11 -0
- package/browser/cjs/BeKpqOx8It0RD0Rf.cjs +2 -0
- package/browser/cjs/Bj-EvSYeDfqmU0V6.cjs +2 -0
- package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +1 -0
- package/browser/cjs/ByIEqNsvj52sihT9.cjs +5 -0
- package/browser/cjs/C3moehR3VOd0LnmM.cjs +1 -0
- package/browser/cjs/C97KHSuikAbr1qVM.cjs +1 -0
- package/browser/cjs/CJLwX_A3y3TQUmzj.cjs +1 -0
- package/browser/cjs/CPSc2VSYZeZ1B9mi.cjs +1 -0
- package/browser/cjs/CPcBvw4ZPwHVTUZF.cjs +1 -0
- package/browser/cjs/CZm1jVZaHQ246prW.cjs +1 -0
- package/browser/cjs/CdDYyAfccXme8w6m.cjs +1 -0
- package/browser/cjs/DBJLJGiCGXesx5n6.cjs +1 -0
- package/browser/cjs/DLScL5AOXhHu9O9H.cjs +7 -0
- package/browser/cjs/Djsiad0Qha1Y-YaS.cjs +1 -0
- package/browser/cjs/IASAYG6qgv7lJY7y.cjs +1 -0
- package/browser/cjs/KZvriGbhEOVkQD0b.cjs +1 -0
- package/browser/cjs/UnMhi28mbvLiOXQe.cjs +1 -0
- package/browser/cjs/Vbigo0kFP3PFfmeA.cjs +1 -0
- package/browser/cjs/iMWEL01eC83oU-YY.cjs +1 -0
- package/browser/cjs/index.cjs +2 -7
- package/browser/cjs/w2GjebPlOFv3pCbm.cjs +1 -0
- package/browser/cjs/zQsyZpeXAvcVXJMs.cjs +1 -0
- package/browser/esm/0EONOhVZ7oT0C_G2.mjs +1150 -0
- package/browser/esm/5x7evORpymnb5SfW.mjs +129 -0
- package/browser/esm/BACBR1jjcpJbhOWA.mjs +191 -0
- package/browser/esm/BPZne8WpzrkWOH6L.mjs +47 -0
- package/browser/esm/BeKa8xVj69hAVKRN.mjs +155 -0
- package/browser/esm/BeQ9bqOvNNP-arFP.mjs +219 -0
- package/browser/esm/Bf3PIOM6U-NmWk2O.mjs +20 -0
- package/browser/esm/C4BPDYeqgN59wMGp.mjs +411 -0
- package/browser/esm/CGbn_xdhgTvk2mvb.mjs +612 -0
- package/browser/esm/CKADOp3hTx0MSNY7.mjs +52 -0
- package/browser/esm/CR2sUEZyRqVv2SNl.mjs +105 -0
- package/browser/esm/CTN8J8c1AneJu3Lu.mjs +2207 -0
- package/browser/esm/Cc5akPEmIwbgKIfc.mjs +516 -0
- package/browser/esm/CePKCTL6D05kDy2E.mjs +82 -0
- package/browser/esm/DBM1blcMTZMAM-eR.mjs +217 -0
- package/browser/esm/DPBnKqhSuJ414Pxx.mjs +99 -0
- package/browser/esm/F51tGfYHocox80zY.mjs +468 -0
- package/browser/esm/SDzKpaiuhQux7tAh.mjs +5391 -0
- package/browser/esm/TDH9XceS8cAkO5d3.mjs +508 -0
- package/browser/esm/XKVlG-x_9q5dbVIW.mjs +8878 -0
- package/browser/esm/fJiwyUQJ18X-cCQz.mjs +1376 -0
- package/browser/esm/fel6EbPAcZOsBmks.mjs +42 -0
- package/browser/esm/flvjZEXrSDrtDzLB.mjs +113 -0
- package/browser/esm/index.mjs +152 -91
- package/licenses/dependencies.txt +137 -627
- package/node/esm/B9-0usA1hSoD0Nk3.mjs +679 -0
- package/node/esm/BO1vNzjGWYdZdbq9.mjs +113 -0
- package/node/esm/BYigefA8bf9FOVib.mjs +47 -0
- package/node/esm/BdrLZp98HQaVMykZ.mjs +82 -0
- package/node/esm/BlubX7gm8wTUNiZ-.mjs +106 -0
- package/node/esm/C8a6QwMGW1tMiWA6.mjs +516 -0
- package/node/esm/CCCnorMn30oUDDIY.mjs +4536 -0
- package/node/esm/CKpik3HRSANKEy4G.mjs +99 -0
- package/node/esm/CTZcfST8pUcLMail.mjs +509 -0
- package/node/esm/D1K9Ji7iQwnOnd1-.mjs +190 -0
- package/node/esm/DuUiuB59bQRPQi-D.mjs +155 -0
- package/node/esm/eKP73GEWmonTXpfv.mjs +470 -0
- package/node/esm/g3y8kxL1Ln214UNr.mjs +129 -0
- package/node/esm/index.mjs +10603 -2832
- package/package.json +27 -27
- package/resources/contents.json +30 -0
- package/resources/locales/contents.json +44 -0
- package/resources/locales/de/groups.cmd.json +219 -0
- package/resources/locales/de/studio.cmd.json +159 -0
- package/resources/locales/de/ui.msg.json +507 -0
- package/resources/locales/en/groups.cmd.json +219 -0
- package/resources/locales/en/studio.cmd.json +159 -0
- package/resources/locales/en/ui.msg.json +508 -0
- package/types/index.d.ts +2 -1761
- package/types/src/anchorItems/AnchorItemsDescriptor.d.ts +131 -0
- package/types/src/anchorItems/AnchorItemsPanel.d.ts +29 -0
- package/types/src/anchorItems/index.d.ts +3 -0
- package/types/src/border/BorderPopupButton.d.ts +30 -0
- package/types/src/border/BorderStylePopupButton.d.ts +40 -0
- package/types/src/border/index.d.ts +3 -0
- package/types/src/chart/command/InsertChartCommandButton.d.ts +10 -0
- package/types/src/chart/command/index.d.ts +2 -0
- package/types/src/color/Alpha.d.ts +36 -0
- package/types/src/color/Checkboard.d.ts +11 -0
- package/types/src/color/CheckboardUtils.d.ts +3 -0
- package/types/src/color/ColorButton.d.ts +21 -0
- package/types/src/color/ColorButtonList.d.ts +17 -0
- package/types/src/color/ColorPanel.d.ts +71 -0
- package/types/src/color/ColorPopupButton.d.ts +29 -0
- package/types/src/color/CustomColorPanel.d.ts +16 -0
- package/types/src/color/EditableInput.d.ts +22 -0
- package/types/src/color/Hue.d.ts +29 -0
- package/types/src/color/Saturation.d.ts +45 -0
- package/types/src/color/SketchFields.d.ts +9 -0
- package/types/src/color/Swatch.d.ts +16 -0
- package/types/src/color/Types.d.ts +11 -0
- package/types/src/color/_Utils.d.ts +4 -0
- package/types/src/color/index.d.ts +7 -0
- package/types/src/command/AccountingStyleCommandButton.d.ts +18 -0
- package/types/src/command/AppearanceCommandButton.d.ts +3 -0
- package/types/src/command/BorderCommandButton.d.ts +20 -0
- package/types/src/command/ColorCommandButton.d.ts +23 -0
- package/types/src/command/DocThemeCommandButton.d.ts +19 -0
- package/types/src/command/FileCommandButton.d.ts +8 -0
- package/types/src/command/FontFamilyCommandButton.d.ts +9 -0
- package/types/src/command/FontSizeCommandButton.d.ts +21 -0
- package/types/src/command/InsertFunctionCommandPopupButton.d.ts +9 -0
- package/types/src/command/InsertFunctionSumCommandPopupButton.d.ts +8 -0
- package/types/src/command/LanguageCommandButton.d.ts +19 -0
- package/types/src/command/LocaleCommandButton.d.ts +17 -0
- package/types/src/command/NumberFormatCommandButton.d.ts +6 -0
- package/types/src/command/PasteCommandButton.d.ts +14 -0
- package/types/src/command/PresetCellStylesCommandButton.d.ts +11 -0
- package/types/src/command/PresetTableStylesCommandButton.d.ts +12 -0
- package/types/src/command/RegisterCatalog.d.ts +3 -0
- package/types/src/command/SheetCommandGroups.d.ts +10 -0
- package/types/src/command/SheetZoomCommandButton.d.ts +9 -0
- package/types/src/command/StudioCommandGroups.d.ts +11 -0
- package/types/src/command/TextEffectsCommandButton.d.ts +6 -0
- package/types/src/command/TextRotateGroupButton.d.ts +14 -0
- package/types/src/command/UndoRedoCommandButton.d.ts +14 -0
- package/types/src/command/WalkingCopyCommandButton.d.ts +6 -0
- package/types/src/command/WorkbookCommandGroups.d.ts +11 -0
- package/types/src/command/index.d.ts +23 -0
- package/types/src/conditionalFormat/ColorScaleRulePanel.d.ts +18 -0
- package/types/src/conditionalFormat/ConditionalFormatDetailsPanel.d.ts +23 -0
- package/types/src/conditionalFormat/ConditionalFormatDetailsTaskPane.d.ts +4 -0
- package/types/src/conditionalFormat/ConditionalFormatEditorPanel.d.ts +20 -0
- package/types/src/conditionalFormat/ConditionalFormatPlugin.d.ts +2 -0
- package/types/src/conditionalFormat/ConditionalFormatRangeField.d.ts +32 -0
- package/types/src/conditionalFormat/ConditionalFormatStylePicker.d.ts +34 -0
- package/types/src/conditionalFormat/ConditionalFormatTitle.d.ts +10 -0
- package/types/src/conditionalFormat/DataBarRulePanel.d.ts +23 -0
- package/types/src/conditionalFormat/IconSetRulePanel.d.ts +23 -0
- package/types/src/conditionalFormat/PresetChip.d.ts +30 -0
- package/types/src/conditionalFormat/PresetScalesCommandButton.d.ts +20 -0
- package/types/src/conditionalFormat/RulePreview.d.ts +23 -0
- package/types/src/conditionalFormat/RuleSection.d.ts +20 -0
- package/types/src/conditionalFormat/ScaleMiniGrid.d.ts +59 -0
- package/types/src/conditionalFormat/ScaleStopRow.d.ts +34 -0
- package/types/src/conditionalFormat/index.d.ts +3 -0
- package/types/src/conditionalFormat/previewColor.d.ts +50 -0
- package/types/src/conditions/AverageOption.d.ts +25 -0
- package/types/src/conditions/BetweenOption.d.ts +25 -0
- package/types/src/conditions/BooleanOption.d.ts +24 -0
- package/types/src/conditions/CombinatorOption.d.ts +41 -0
- package/types/src/conditions/ConditionEditor.d.ts +57 -0
- package/types/src/conditions/ConditionUtils.d.ts +83 -0
- package/types/src/conditions/DateTimeOption.d.ts +43 -0
- package/types/src/conditions/ExpressionOption.d.ts +26 -0
- package/types/src/conditions/InSetOption.d.ts +37 -0
- package/types/src/conditions/NumberOption.d.ts +24 -0
- package/types/src/conditions/OperatorAndParamEditor.d.ts +55 -0
- package/types/src/conditions/OperatorSelect.d.ts +35 -0
- package/types/src/conditions/OperatorSelectPopupButton.d.ts +39 -0
- package/types/src/conditions/ScalarOption.d.ts +29 -0
- package/types/src/conditions/SelectorSelect.d.ts +43 -0
- package/types/src/conditions/StringOption.d.ts +24 -0
- package/types/src/conditions/TimePeriodOption.d.ts +25 -0
- package/types/src/conditions/TopNOption.d.ts +25 -0
- package/types/src/conditions/index.d.ts +13 -0
- package/types/src/dataValidation/DataValidationDetailsPanel.d.ts +16 -0
- package/types/src/dataValidation/DataValidationDetailsTaskPane.d.ts +3 -0
- package/types/src/dataValidation/DataValidationEditorPanel.d.ts +12 -0
- package/types/src/dataValidation/DataValidationPlugin.d.ts +2 -0
- package/types/src/dataValidation/index.d.ts +2 -0
- package/types/src/debug/DebugUtils.d.ts +4 -0
- package/types/src/debug/index.d.ts +2 -0
- package/types/src/dialog/CommentsDialog.d.ts +11 -0
- package/types/src/dialog/FindReplaceWindow.d.ts +13 -0
- package/types/src/dialog/HyperlinkDialog.d.ts +28 -0
- package/types/src/dialog/InsertFunctionDialog.d.ts +25 -0
- package/types/src/dialog/NamedReferenceDialog.d.ts +17 -0
- package/types/src/dialog/NumberFormatDialog.d.ts +12 -0
- package/types/src/dialog/ResizeHeaderDialog.d.ts +15 -0
- package/types/src/dialog/ShortcutKeysDialog.d.ts +9 -0
- package/types/src/dialog/ShortcutKeysPanel.d.ts +28 -0
- package/types/src/dialog/SortDialog.d.ts +9 -0
- package/types/src/dialog/TableNewDialog.d.ts +14 -0
- package/types/src/dialog/WorkbookStatisticsDialog.d.ts +13 -0
- package/types/src/dialog/index.d.ts +10 -0
- package/types/src/filter/ColumnMenu.d.ts +13 -0
- package/types/src/filter/FilterList.d.ts +28 -0
- package/types/src/filter/index.d.ts +3 -0
- package/types/src/form/FormulaField.d.ts +221 -0
- package/types/src/form/InputField.d.ts +89 -0
- package/types/src/form/index.d.ts +3 -0
- package/types/src/formulaBar/FormulaBar.d.ts +8 -0
- package/types/src/formulaBar/IFormulaBar.d.ts +51 -0
- package/types/src/formulaBar/index.d.ts +3 -0
- package/types/src/function/FunctionArgumentsPanel.d.ts +57 -0
- package/types/src/function/FunctionSearchPanel.d.ts +35 -0
- package/types/src/function/InsertFunctionWizard.d.ts +79 -0
- package/types/src/function/index.d.ts +4 -0
- package/types/src/function/paneMetrics.d.ts +33 -0
- package/types/src/index.d.ts +21 -0
- package/types/src/itemsPanel/EditorPanel.d.ts +21 -0
- package/types/src/itemsPanel/ItemCard.d.ts +57 -0
- package/types/src/itemsPanel/ItemsDescriptor.d.ts +215 -0
- package/types/src/itemsPanel/ItemsPanel.d.ts +45 -0
- package/types/src/itemsPanel/SortableCards.d.ts +67 -0
- package/types/src/itemsPanel/index.d.ts +6 -0
- package/types/src/movable/MovableContextMenu.d.ts +13 -0
- package/types/src/movable/index.d.ts +2 -0
- package/types/src/named/INamedCollectionEditor.d.ts +37 -0
- package/types/src/named/NamedCollectionEditor.d.ts +7 -0
- package/types/src/named/NamedDetailsPanel.d.ts +11 -0
- package/types/src/named/NamedDetailsTaskPane.d.ts +3 -0
- package/types/src/named/NamedDraft.d.ts +68 -0
- package/types/src/named/NamedEditorPanel.d.ts +19 -0
- package/types/src/named/NamedPlugin.d.ts +2 -0
- package/types/src/named/index.d.ts +8 -0
- package/types/src/numberFormat/NumberFormatPanel.d.ts +29 -0
- package/types/src/numberFormat/NumberFormatTaskPane.d.ts +12 -0
- package/types/src/numberFormat/index.d.ts +8 -0
- package/types/src/protectedRange/ProtectedRangeDetailsPanel.d.ts +20 -0
- package/types/src/protectedRange/ProtectedRangeDetailsTaskPane.d.ts +3 -0
- package/types/src/protectedRange/ProtectedRangeEditorPanel.d.ts +27 -0
- package/types/src/protectedRange/ProtectedRangePlugin.d.ts +2 -0
- package/types/src/protectedRange/index.d.ts +2 -0
- package/types/src/protection/WorkbookProtectionDialog.d.ts +23 -0
- package/types/src/protection/WorkbookProtectionPanel.d.ts +51 -0
- package/types/src/protection/index.d.ts +3 -0
- package/types/src/sheet/SheetTabMenu.d.ts +21 -0
- package/types/src/sheet/SheetsAllMenu.d.ts +16 -0
- package/types/src/sheet/index.d.ts +3 -0
- package/types/src/statusBar/NumberStats.d.ts +27 -0
- package/types/src/statusBar/SheetZoomScale.d.ts +11 -0
- package/types/src/statusBar/StatusBar.d.ts +35 -0
- package/types/src/statusBar/index.d.ts +4 -0
- package/types/src/studio/CommandsWrapper.d.ts +36 -0
- package/types/src/studio/DefaultLogo.d.ts +3 -0
- package/types/src/studio/EagerStudio.d.ts +5 -0
- package/types/src/studio/Studio.d.ts +26 -0
- package/types/src/studio/StudioCommandProvider.d.ts +26 -0
- package/types/src/studio/StudioCommands.d.ts +115 -0
- package/types/src/studio/StudioNotifierProvider.d.ts +10 -0
- package/types/src/studio/StudioProps.d.ts +372 -0
- package/types/src/studio/StudioSplitPane.d.ts +60 -0
- package/types/src/studio/StudioTaskPaneArea.d.ts +8 -0
- package/types/src/studio/StudioToolbar.d.ts +37 -0
- package/types/src/studio/index.d.ts +4 -0
- package/types/src/studio/useStudioApp.d.ts +51 -0
- package/types/src/table/TableDetailsPanel.d.ts +17 -0
- package/types/src/table/TableDetailsTaskPane.d.ts +3 -0
- package/types/src/table/TablePlugin.d.ts +2 -0
- package/types/src/table/TableStyleCanvasPreview.d.ts +21 -0
- package/types/src/table/TableStyleOptionsPanel.d.ts +38 -0
- package/types/src/table/TableStylePreview.d.ts +43 -0
- package/types/src/table/index.d.ts +7 -0
- package/types/src/theme/ThemeSelectButton.d.ts +23 -0
- package/types/src/theme/ThemeSelectPanel.d.ts +17 -0
- package/types/src/theme/ThemeSelectPopupButton.d.ts +24 -0
- package/types/src/theme/ThemeUtils.d.ts +57 -0
- package/types/src/theme/index.d.ts +5 -0
- package/types/src/toast/ToastError.d.ts +10 -0
- package/types/src/toast/index.d.ts +2 -0
- package/types/src/toolbar/WorkbookToolbars.d.ts +46 -0
- package/types/src/toolbar/index.d.ts +2 -0
- package/types/src/workbook/DefaultRenderers.d.ts +23 -0
- package/types/src/workbook/DocumentTitle.d.ts +69 -0
- package/types/src/workbook/WorkbookContextMenu.d.ts +13 -0
- package/types/src/workbook/WorkbookElement.d.ts +12 -0
- package/types/src/workbook/WorkbookStrip.d.ts +37 -0
- package/types/src/workbook/index.d.ts +7 -0
- package/browser/cjs/52tjAlO48FpZgfzG.cjs +0 -6
- package/browser/cjs/BGu2_YqVJMQjYx4D.cjs +0 -18
- package/browser/cjs/C83Rzj_Jwq-o69wr.cjs +0 -42
- package/browser/cjs/CldYLQnjFC_g8o3t.cjs +0 -6
- package/browser/cjs/Cpv3j_Ra1h-axLRG.cjs +0 -6
- package/browser/cjs/D-5Cg1Y0zALF_JEs.cjs +0 -7
- package/browser/cjs/D58sOTRZwQ59CgOf.cjs +0 -6
- package/browser/cjs/DEd-0xEuUoELRnQb.cjs +0 -6
- package/browser/cjs/DahKlfm68zudpndW.cjs +0 -20
- package/browser/cjs/Dd7t0gfO3bzS0-B8.cjs +0 -6
- package/browser/cjs/DxAU6DV3UCUDVoSH.cjs +0 -6
- package/browser/cjs/uj7GSwDaUyTKEjrN.cjs +0 -6
- package/browser/esm/BLuR1D2n--9QSJL9.mjs +0 -26
- package/browser/esm/BSOhdb74viwmCi54.mjs +0 -2159
- package/browser/esm/BTAhrEfV-DH0-Ldk.mjs +0 -640
- package/browser/esm/BgsyX5QL9OLy0DN3.mjs +0 -4533
- package/browser/esm/CFPGs5_tLGrpkW8L.mjs +0 -25
- package/browser/esm/CbCX3t0hx-h6pV7Q.mjs +0 -46
- package/browser/esm/D3dDP89ml0258MGb.mjs +0 -53
- package/browser/esm/DYk55y6IEOCytW3g.mjs +0 -50
- package/browser/esm/DfUqOxFfhJcaq847.mjs +0 -2411
- package/browser/esm/DhWeeZyxUc-LbP8E.mjs +0 -50
- package/browser/esm/DqLDLUCqiFovdBf0.mjs +0 -155
- package/browser/esm/Dvo0k3olgFuAso_O.mjs +0 -54
- package/node/assets/style.css +0 -1
- package/node/esm/BM_pvbGlgXydGNT3.mjs +0 -52
- package/node/esm/CFBcwLP2q2_EUXvE.mjs +0 -156
- package/node/esm/Cg9JFB8nOnVfR0Uo.mjs +0 -26
- package/node/esm/D3kxA1LpG-PpZvCb.mjs +0 -25
- package/node/esm/D_s6w_GWb8l7uGW3.mjs +0 -53
- package/node/esm/XI3nj4zD7mXOyxSm.mjs +0 -57
- package/node/esm/YXQgUYqP1qsi_MPX.mjs +0 -46
- package/node/esm/m2lejeU-ViEhFj_N.mjs +0 -91
- package/node/esm/sevERUPIPJCb-jYL.mjs +0 -88
- package/node/esm/zdjaq7yEfEvgHrDi.mjs +0 -50
|
@@ -0,0 +1,1150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.7.28-beta.1
|
|
3
|
+
*
|
|
4
|
+
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
function e(e) {
|
|
8
|
+
return Array.isArray ? Array.isArray(e) : c(e) === "[object Array]";
|
|
9
|
+
}
|
|
10
|
+
function t(e) {
|
|
11
|
+
return e == null ? "" : function(e) {
|
|
12
|
+
if (typeof e == "string") return e;
|
|
13
|
+
if (typeof e == "bigint") return e.toString();
|
|
14
|
+
let t = e + "";
|
|
15
|
+
return t == "0" && 1 / e == -Infinity ? "-0" : t;
|
|
16
|
+
}(e);
|
|
17
|
+
}
|
|
18
|
+
function n(e) {
|
|
19
|
+
return typeof e == "string";
|
|
20
|
+
}
|
|
21
|
+
function r(e) {
|
|
22
|
+
return typeof e == "number";
|
|
23
|
+
}
|
|
24
|
+
function i(e) {
|
|
25
|
+
return !0 === e || !1 === e || function(e) {
|
|
26
|
+
return a(e) && e !== null;
|
|
27
|
+
}(e) && c(e) == "[object Boolean]";
|
|
28
|
+
}
|
|
29
|
+
function a(e) {
|
|
30
|
+
return typeof e == "object";
|
|
31
|
+
}
|
|
32
|
+
function o(e) {
|
|
33
|
+
return e != null;
|
|
34
|
+
}
|
|
35
|
+
function s(e) {
|
|
36
|
+
return !e.trim().length;
|
|
37
|
+
}
|
|
38
|
+
function c(e) {
|
|
39
|
+
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
40
|
+
}
|
|
41
|
+
var l = "Invalid doc index: must be a non-negative integer within the bounds of the docs array", u = Object.prototype.hasOwnProperty, d = class {
|
|
42
|
+
constructor(e) {
|
|
43
|
+
this._keys = [], this._keyMap = {};
|
|
44
|
+
let t = 0;
|
|
45
|
+
e.forEach((e) => {
|
|
46
|
+
let n = f(e);
|
|
47
|
+
this._keys.push(n), this._keyMap[n.id] = n, t += n.weight;
|
|
48
|
+
}), this._keys.forEach((e) => {
|
|
49
|
+
e.weight /= t;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
get(e) {
|
|
53
|
+
return this._keyMap[e];
|
|
54
|
+
}
|
|
55
|
+
keys() {
|
|
56
|
+
return this._keys;
|
|
57
|
+
}
|
|
58
|
+
toJSON() {
|
|
59
|
+
return JSON.stringify(this._keys);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
function f(t) {
|
|
63
|
+
let r = null, i = null, a = null, o = 1, s = null;
|
|
64
|
+
if (n(t) || e(t)) a = t, r = p(t), i = m(t);
|
|
65
|
+
else {
|
|
66
|
+
if (!u.call(t, "name")) throw Error(((e) => `Missing ${e} property in key`)("name"));
|
|
67
|
+
let e = t.name;
|
|
68
|
+
if (a = e, u.call(t, "weight") && t.weight !== void 0 && (o = t.weight, o <= 0)) throw Error(((e) => `Property 'weight' in key '${e}' must be a positive integer`)(m(e)));
|
|
69
|
+
r = p(e), i = m(e), s = t.getFn ?? null;
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
path: r,
|
|
73
|
+
id: i,
|
|
74
|
+
weight: o,
|
|
75
|
+
src: a,
|
|
76
|
+
getFn: s
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function p(t) {
|
|
80
|
+
return e(t) ? t : t.split(".");
|
|
81
|
+
}
|
|
82
|
+
function m(t) {
|
|
83
|
+
return e(t) ? t.join(".") : t;
|
|
84
|
+
}
|
|
85
|
+
var h = Object.freeze({
|
|
86
|
+
isCaseSensitive: !1,
|
|
87
|
+
ignoreDiacritics: !1,
|
|
88
|
+
includeScore: !1,
|
|
89
|
+
keys: [],
|
|
90
|
+
shouldSort: !0,
|
|
91
|
+
sortFn: (e, t) => e.score === t.score ? e.idx < t.idx ? -1 : 1 : e.score < t.score ? -1 : 1,
|
|
92
|
+
includeMatches: !1,
|
|
93
|
+
findAllMatches: !1,
|
|
94
|
+
minMatchCharLength: 1,
|
|
95
|
+
location: 0,
|
|
96
|
+
threshold: .6,
|
|
97
|
+
distance: 100,
|
|
98
|
+
useExtendedSearch: !1,
|
|
99
|
+
useTokenSearch: !1,
|
|
100
|
+
tokenize: void 0,
|
|
101
|
+
tokenMatch: "any",
|
|
102
|
+
getFn: function(a, s) {
|
|
103
|
+
let c = [], l = !1, u = (a, s, d, f) => {
|
|
104
|
+
if (o(a)) if (s[d]) {
|
|
105
|
+
let p = a[s[d]];
|
|
106
|
+
if (!o(p)) return;
|
|
107
|
+
if (d === s.length - 1 && (n(p) || r(p) || i(p) || typeof p == "bigint")) c.push(f === void 0 ? t(p) : {
|
|
108
|
+
v: t(p),
|
|
109
|
+
i: f
|
|
110
|
+
});
|
|
111
|
+
else if (e(p)) {
|
|
112
|
+
l = !0;
|
|
113
|
+
for (let e = 0, t = p.length; e < t; e += 1) u(p[e], s, d + 1, e);
|
|
114
|
+
} else s.length && u(p, s, d + 1, f);
|
|
115
|
+
} else c.push(f === void 0 ? a : {
|
|
116
|
+
v: a,
|
|
117
|
+
i: f
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
return u(a, n(s) ? s.split(".") : s, 0), l ? c : c[0];
|
|
121
|
+
},
|
|
122
|
+
ignoreLocation: !1,
|
|
123
|
+
ignoreFieldNorm: !1,
|
|
124
|
+
fieldNormWeight: 1
|
|
125
|
+
});
|
|
126
|
+
function g(e) {
|
|
127
|
+
return e >= 9 && e <= 13 || e === 32 || e === 160;
|
|
128
|
+
}
|
|
129
|
+
var _ = class {
|
|
130
|
+
constructor({ getFn: e = h.getFn, fieldNormWeight: t = h.fieldNormWeight } = {}) {
|
|
131
|
+
this.norm = function(e = 1, t = 3) {
|
|
132
|
+
let n = /* @__PURE__ */ new Map(), r = 10 ** t;
|
|
133
|
+
return {
|
|
134
|
+
get(t) {
|
|
135
|
+
let i = 0, a = !1;
|
|
136
|
+
for (let e = 0; e < t.length; e++) g(t.charCodeAt(e)) ? a = !1 : a ||= (i++, !0);
|
|
137
|
+
if (i === 0 && (i = 1), n.has(i)) return n.get(i);
|
|
138
|
+
let o = Math.round(r / i ** (.5 * e)) / r;
|
|
139
|
+
return n.set(i, o), o;
|
|
140
|
+
},
|
|
141
|
+
clear() {
|
|
142
|
+
n.clear();
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}(t, 3), this.getFn = e, this.isCreated = !1, this.docs = [], this.keys = [], this._keysMap = {}, this.setIndexRecords();
|
|
146
|
+
}
|
|
147
|
+
setSources(e = []) {
|
|
148
|
+
this.docs = e;
|
|
149
|
+
}
|
|
150
|
+
setIndexRecords(e = []) {
|
|
151
|
+
this.records = e;
|
|
152
|
+
}
|
|
153
|
+
setKeys(e = []) {
|
|
154
|
+
this.keys = e, this._keysMap = {}, e.forEach((e, t) => {
|
|
155
|
+
this._keysMap[e.id] = t;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
create() {
|
|
159
|
+
if (this.isCreated || !this.docs.length) return;
|
|
160
|
+
this.isCreated = !0;
|
|
161
|
+
let e = this.docs.length;
|
|
162
|
+
this.records = Array(e);
|
|
163
|
+
let t = 0;
|
|
164
|
+
if (n(this.docs[0])) for (let n = 0; n < e; n++) {
|
|
165
|
+
let e = this._createStringRecord(this.docs[n], n);
|
|
166
|
+
e && (this.records[t++] = e);
|
|
167
|
+
}
|
|
168
|
+
else for (let n = 0; n < e; n++) this.records[t++] = this._createObjectRecord(this.docs[n], n);
|
|
169
|
+
this.records.length = t, this.norm.clear();
|
|
170
|
+
}
|
|
171
|
+
add(e, t) {
|
|
172
|
+
if (!Number.isInteger(t) || t < 0) throw Error(l);
|
|
173
|
+
if (n(e)) {
|
|
174
|
+
let n = this._createStringRecord(e, t);
|
|
175
|
+
return n && this.records.push(n), n;
|
|
176
|
+
}
|
|
177
|
+
let r = this._createObjectRecord(e, t);
|
|
178
|
+
return this.records.push(r), r;
|
|
179
|
+
}
|
|
180
|
+
removeAt(e) {
|
|
181
|
+
if (!Number.isInteger(e) || e < 0) throw Error(l);
|
|
182
|
+
for (let t = 0, n = this.records.length; t < n; t += 1) if (this.records[t].i === e) {
|
|
183
|
+
this.records.splice(t, 1);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
for (let t = 0, n = this.records.length; t < n; t += 1) this.records[t].i > e && --this.records[t].i;
|
|
187
|
+
}
|
|
188
|
+
removeAll(e) {
|
|
189
|
+
let t = /* @__PURE__ */ new Set();
|
|
190
|
+
for (let n of e) Number.isInteger(n) && n >= 0 && t.add(n);
|
|
191
|
+
if (t.size === 0) return;
|
|
192
|
+
this.records = this.records.filter((e) => !t.has(e.i));
|
|
193
|
+
let n = Array.from(t).sort((e, t) => e - t);
|
|
194
|
+
for (let e of this.records) {
|
|
195
|
+
let t = 0, r = n.length;
|
|
196
|
+
for (; t < r;) {
|
|
197
|
+
let i = t + r >>> 1;
|
|
198
|
+
n[i] < e.i ? t = i + 1 : r = i;
|
|
199
|
+
}
|
|
200
|
+
e.i -= t;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
getValueForItemAtKeyId(e, t) {
|
|
204
|
+
return e[this._keysMap[t]];
|
|
205
|
+
}
|
|
206
|
+
size() {
|
|
207
|
+
return this.records.length;
|
|
208
|
+
}
|
|
209
|
+
_createStringRecord(e, t) {
|
|
210
|
+
return !o(e) || s(e) ? null : {
|
|
211
|
+
v: e,
|
|
212
|
+
i: t,
|
|
213
|
+
n: this.norm.get(e)
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
_createObjectRecord(r, i) {
|
|
217
|
+
let a = {
|
|
218
|
+
i,
|
|
219
|
+
$: {}
|
|
220
|
+
};
|
|
221
|
+
for (let i = 0, c = this.keys.length; i < c; i++) {
|
|
222
|
+
let c = this.keys[i], l = c.getFn ? c.getFn(r) : this.getFn(r, c.path);
|
|
223
|
+
if (o(l)) {
|
|
224
|
+
if (e(l)) {
|
|
225
|
+
let e = [];
|
|
226
|
+
for (let r = 0, i = l.length; r < i; r += 1) {
|
|
227
|
+
let i = l[r];
|
|
228
|
+
if (o(i)) {
|
|
229
|
+
if (n(i)) {
|
|
230
|
+
if (!s(i)) {
|
|
231
|
+
let t = {
|
|
232
|
+
v: i,
|
|
233
|
+
i: r,
|
|
234
|
+
n: this.norm.get(i)
|
|
235
|
+
};
|
|
236
|
+
e.push(t);
|
|
237
|
+
}
|
|
238
|
+
} else if (o(i.v)) {
|
|
239
|
+
let r = n(i.v) ? i.v : t(i.v);
|
|
240
|
+
if (!s(r)) {
|
|
241
|
+
let t = {
|
|
242
|
+
v: r,
|
|
243
|
+
i: i.i,
|
|
244
|
+
n: this.norm.get(r)
|
|
245
|
+
};
|
|
246
|
+
e.push(t);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
a.$[i] = e;
|
|
252
|
+
} else if (n(l) && !s(l)) {
|
|
253
|
+
let e = {
|
|
254
|
+
v: l,
|
|
255
|
+
n: this.norm.get(l)
|
|
256
|
+
};
|
|
257
|
+
a.$[i] = e;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
return a;
|
|
262
|
+
}
|
|
263
|
+
toJSON() {
|
|
264
|
+
return {
|
|
265
|
+
keys: this.keys.map(({ getFn: e, ...t }) => t),
|
|
266
|
+
records: this.records
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
function v(e, t, { getFn: n = h.getFn, fieldNormWeight: r = h.fieldNormWeight } = {}) {
|
|
271
|
+
let i = new _({
|
|
272
|
+
getFn: n,
|
|
273
|
+
fieldNormWeight: r
|
|
274
|
+
});
|
|
275
|
+
return i.setKeys(e.map(f)), i.setSources(t), i.create(), i;
|
|
276
|
+
}
|
|
277
|
+
function y(e, t, n, { location: r = h.location, distance: i = h.distance, threshold: a = h.threshold, findAllMatches: o = h.findAllMatches, minMatchCharLength: s = h.minMatchCharLength, includeMatches: c = h.includeMatches, ignoreLocation: l = h.ignoreLocation } = {}) {
|
|
278
|
+
if (t.length > 32) throw Error("Pattern length exceeds max of 32.");
|
|
279
|
+
let u = t.length, d = e.length, f = Math.max(0, Math.min(r, d)), p = a, m = f, g = (e, t) => {
|
|
280
|
+
let n = e / u;
|
|
281
|
+
if (l) return n;
|
|
282
|
+
let r = Math.abs(f - t);
|
|
283
|
+
return i ? n + r / i : r ? 1 : n;
|
|
284
|
+
}, _ = s > 1 || c, v = _ ? Array(d) : [], y;
|
|
285
|
+
for (; (y = e.indexOf(t, m)) > -1;) {
|
|
286
|
+
let e = g(0, y);
|
|
287
|
+
if (p = Math.min(e, p), m = y + u, _) {
|
|
288
|
+
let e = 0;
|
|
289
|
+
for (; e < u;) v[y + e] = 1, e += 1;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
m = -1;
|
|
293
|
+
let b = [], x = 1, S = 0, C = u + d, w = 1 << u - 1;
|
|
294
|
+
for (let t = 0; t < u; t += 1) {
|
|
295
|
+
let r = 0, i = C;
|
|
296
|
+
for (; r < i;) g(t, f + i) <= p ? r = i : C = i, i = Math.floor((C - r) / 2 + r);
|
|
297
|
+
C = i;
|
|
298
|
+
let a = Math.max(1, f - i + 1), s = o ? d : Math.min(f + i, d) + u, c = Array(s + 2);
|
|
299
|
+
c[s + 1] = (1 << t) - 1;
|
|
300
|
+
for (let r = s; r >= a; --r) {
|
|
301
|
+
let i = r - 1, o = n[e[i]];
|
|
302
|
+
if (c[r] = (c[r + 1] << 1 | 1) & o, t && (c[r] |= (b[r + 1] | b[r]) << 1 | 1 | b[r + 1]), c[r] & w && (x = g(t, i), x <= p)) {
|
|
303
|
+
if (p = x, m = i, S = t, m <= f) break;
|
|
304
|
+
a = Math.max(1, 2 * f - m);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (g(t + 1, f) > p) break;
|
|
308
|
+
b = c;
|
|
309
|
+
}
|
|
310
|
+
if (_ && m >= 0) {
|
|
311
|
+
let t = Math.min(d - 1, m + u - 1 + S);
|
|
312
|
+
for (let r = m; r <= t; r += 1) n[e[r]] && (v[r] = 1);
|
|
313
|
+
}
|
|
314
|
+
let T = {
|
|
315
|
+
isMatch: m >= 0,
|
|
316
|
+
score: Math.max(.001, x)
|
|
317
|
+
};
|
|
318
|
+
if (_) {
|
|
319
|
+
let e = function(e = [], t = h.minMatchCharLength) {
|
|
320
|
+
let n = [], r = -1, i = -1, a = 0;
|
|
321
|
+
for (let o = e.length; a < o; a += 1) {
|
|
322
|
+
let o = e[a];
|
|
323
|
+
o && r === -1 ? r = a : o || r === -1 || (i = a - 1, i - r + 1 >= t && n.push([r, i]), r = -1);
|
|
324
|
+
}
|
|
325
|
+
return e[a - 1] && a - r >= t && n.push([r, a - 1]), n;
|
|
326
|
+
}(v, s);
|
|
327
|
+
e.length ? c && (T.indices = e) : T.isMatch = !1;
|
|
328
|
+
}
|
|
329
|
+
return T;
|
|
330
|
+
}
|
|
331
|
+
function b(e) {
|
|
332
|
+
let t = {};
|
|
333
|
+
for (let n = 0, r = e.length; n < r; n += 1) {
|
|
334
|
+
let i = e.charAt(n);
|
|
335
|
+
t[i] = (t[i] || 0) | 1 << r - n - 1;
|
|
336
|
+
}
|
|
337
|
+
return t;
|
|
338
|
+
}
|
|
339
|
+
function x(e) {
|
|
340
|
+
if (e.length <= 1) return e;
|
|
341
|
+
e.sort((e, t) => e[0] - t[0] || e[1] - t[1]);
|
|
342
|
+
let t = [e[0]];
|
|
343
|
+
for (let n = 1, r = e.length; n < r; n += 1) {
|
|
344
|
+
let r = t[t.length - 1], i = e[n];
|
|
345
|
+
i[0] <= r[1] + 1 ? r[1] = Math.max(r[1], i[1]) : t.push(i);
|
|
346
|
+
}
|
|
347
|
+
return t;
|
|
348
|
+
}
|
|
349
|
+
var S = {
|
|
350
|
+
ł: "l",
|
|
351
|
+
Ł: "L",
|
|
352
|
+
đ: "d",
|
|
353
|
+
Đ: "D",
|
|
354
|
+
ø: "o",
|
|
355
|
+
Ø: "O",
|
|
356
|
+
ħ: "h",
|
|
357
|
+
Ħ: "H",
|
|
358
|
+
ŧ: "t",
|
|
359
|
+
Ŧ: "T",
|
|
360
|
+
ı: "i",
|
|
361
|
+
ß: "ss"
|
|
362
|
+
}, C = RegExp("[" + Object.keys(S).join("") + "]", "g"), w = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g, "").replace(C, (e) => S[e]) : (e) => e, T = class {
|
|
363
|
+
constructor(e, { location: t = h.location, threshold: n = h.threshold, distance: r = h.distance, includeMatches: i = h.includeMatches, findAllMatches: a = h.findAllMatches, minMatchCharLength: o = h.minMatchCharLength, isCaseSensitive: s = h.isCaseSensitive, ignoreDiacritics: c = h.ignoreDiacritics, ignoreLocation: l = h.ignoreLocation } = {}) {
|
|
364
|
+
if (this.options = {
|
|
365
|
+
location: t,
|
|
366
|
+
threshold: n,
|
|
367
|
+
distance: r,
|
|
368
|
+
includeMatches: i,
|
|
369
|
+
findAllMatches: a,
|
|
370
|
+
minMatchCharLength: o,
|
|
371
|
+
isCaseSensitive: s,
|
|
372
|
+
ignoreDiacritics: c,
|
|
373
|
+
ignoreLocation: l
|
|
374
|
+
}, e = s ? e : e.toLowerCase(), e = c ? w(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length) return;
|
|
375
|
+
let u = (e, t) => {
|
|
376
|
+
this.chunks.push({
|
|
377
|
+
pattern: e,
|
|
378
|
+
alphabet: b(e),
|
|
379
|
+
startIndex: t
|
|
380
|
+
});
|
|
381
|
+
}, d = this.pattern.length;
|
|
382
|
+
if (d > 32) {
|
|
383
|
+
let e = 0, t = d % 32, n = d - t;
|
|
384
|
+
for (; e < n;) u(this.pattern.substr(e, 32), e), e += 32;
|
|
385
|
+
if (t) {
|
|
386
|
+
let e = d - 32;
|
|
387
|
+
u(this.pattern.substr(e), e);
|
|
388
|
+
}
|
|
389
|
+
} else u(this.pattern, 0);
|
|
390
|
+
}
|
|
391
|
+
searchIn(e) {
|
|
392
|
+
let { isCaseSensitive: t, ignoreDiacritics: n, includeMatches: r } = this.options;
|
|
393
|
+
if (e = t ? e : e.toLowerCase(), e = n ? w(e) : e, this.pattern === e) {
|
|
394
|
+
if (e.length < this.options.minMatchCharLength) return {
|
|
395
|
+
isMatch: !1,
|
|
396
|
+
score: 1
|
|
397
|
+
};
|
|
398
|
+
let t = {
|
|
399
|
+
isMatch: !0,
|
|
400
|
+
score: 0
|
|
401
|
+
};
|
|
402
|
+
return r && (t.indices = [[0, e.length - 1]]), t;
|
|
403
|
+
}
|
|
404
|
+
let { location: i, distance: a, threshold: o, findAllMatches: s, minMatchCharLength: c, ignoreLocation: l } = this.options, u = [], d = 0, f = !1;
|
|
405
|
+
this.chunks.forEach(({ pattern: t, alphabet: n, startIndex: p }) => {
|
|
406
|
+
let { isMatch: m, score: h, indices: g } = y(e, t, n, {
|
|
407
|
+
location: i + p,
|
|
408
|
+
distance: a,
|
|
409
|
+
threshold: o,
|
|
410
|
+
findAllMatches: s,
|
|
411
|
+
minMatchCharLength: c,
|
|
412
|
+
includeMatches: r,
|
|
413
|
+
ignoreLocation: l
|
|
414
|
+
});
|
|
415
|
+
m && (f = !0), d += h, m && g && u.push(...g);
|
|
416
|
+
});
|
|
417
|
+
let p = {
|
|
418
|
+
isMatch: f,
|
|
419
|
+
score: f ? d / this.chunks.length : 1
|
|
420
|
+
};
|
|
421
|
+
return f && r && (p.indices = x(u)), p;
|
|
422
|
+
}
|
|
423
|
+
}, E = /* @__PURE__ */ new Set(["fuzzy", "include"]);
|
|
424
|
+
function D(e) {
|
|
425
|
+
return e.startsWith("inverse");
|
|
426
|
+
}
|
|
427
|
+
var O = [
|
|
428
|
+
{
|
|
429
|
+
type: "exact",
|
|
430
|
+
multiRegex: /^="(.*)"$/,
|
|
431
|
+
singleRegex: /^=(.*)$/,
|
|
432
|
+
create: (e) => ({
|
|
433
|
+
type: "exact",
|
|
434
|
+
search(t) {
|
|
435
|
+
let n = t === e;
|
|
436
|
+
return {
|
|
437
|
+
isMatch: n,
|
|
438
|
+
score: +!n,
|
|
439
|
+
indices: [0, e.length - 1]
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
})
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
type: "include",
|
|
446
|
+
multiRegex: /^'"(.*)"$/,
|
|
447
|
+
singleRegex: /^'(.*)$/,
|
|
448
|
+
create: (e) => ({
|
|
449
|
+
type: "include",
|
|
450
|
+
search(t) {
|
|
451
|
+
let n, r = 0, i = [], a = e.length;
|
|
452
|
+
for (; (n = t.indexOf(e, r)) > -1;) r = n + a, i.push([n, r - 1]);
|
|
453
|
+
let o = !!i.length;
|
|
454
|
+
return {
|
|
455
|
+
isMatch: o,
|
|
456
|
+
score: +!o,
|
|
457
|
+
indices: i
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
})
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
type: "prefix-exact",
|
|
464
|
+
multiRegex: /^\^"(.*)"$/,
|
|
465
|
+
singleRegex: /^\^(.*)$/,
|
|
466
|
+
create: (e) => ({
|
|
467
|
+
type: "prefix-exact",
|
|
468
|
+
search(t) {
|
|
469
|
+
let n = t.startsWith(e);
|
|
470
|
+
return {
|
|
471
|
+
isMatch: n,
|
|
472
|
+
score: +!n,
|
|
473
|
+
indices: [0, e.length - 1]
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
})
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
type: "inverse-prefix-exact",
|
|
480
|
+
multiRegex: /^!\^"(.*)"$/,
|
|
481
|
+
singleRegex: /^!\^(.*)$/,
|
|
482
|
+
create: (e) => ({
|
|
483
|
+
type: "inverse-prefix-exact",
|
|
484
|
+
search(t) {
|
|
485
|
+
let n = !t.startsWith(e);
|
|
486
|
+
return {
|
|
487
|
+
isMatch: n,
|
|
488
|
+
score: +!n,
|
|
489
|
+
indices: [0, t.length - 1]
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
})
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
type: "inverse-suffix-exact",
|
|
496
|
+
multiRegex: /^!"(.*)"\$$/,
|
|
497
|
+
singleRegex: /^!(.*)\$$/,
|
|
498
|
+
create: (e) => ({
|
|
499
|
+
type: "inverse-suffix-exact",
|
|
500
|
+
search(t) {
|
|
501
|
+
let n = !t.endsWith(e);
|
|
502
|
+
return {
|
|
503
|
+
isMatch: n,
|
|
504
|
+
score: +!n,
|
|
505
|
+
indices: [0, t.length - 1]
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
})
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
type: "suffix-exact",
|
|
512
|
+
multiRegex: /^"(.*)"\$$/,
|
|
513
|
+
singleRegex: /^(.*)\$$/,
|
|
514
|
+
create: (e) => ({
|
|
515
|
+
type: "suffix-exact",
|
|
516
|
+
search(t) {
|
|
517
|
+
let n = t.endsWith(e);
|
|
518
|
+
return {
|
|
519
|
+
isMatch: n,
|
|
520
|
+
score: +!n,
|
|
521
|
+
indices: [t.length - e.length, t.length - 1]
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
})
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
type: "inverse-exact",
|
|
528
|
+
multiRegex: /^!"(.*)"$/,
|
|
529
|
+
singleRegex: /^!(.*)$/,
|
|
530
|
+
create: (e) => ({
|
|
531
|
+
type: "inverse-exact",
|
|
532
|
+
search(t) {
|
|
533
|
+
let n = t.indexOf(e) === -1;
|
|
534
|
+
return {
|
|
535
|
+
isMatch: n,
|
|
536
|
+
score: +!n,
|
|
537
|
+
indices: [0, t.length - 1]
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
})
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
type: "fuzzy",
|
|
544
|
+
multiRegex: /^"(.*)"$/,
|
|
545
|
+
singleRegex: /^(.*)$/,
|
|
546
|
+
create: (e, t = {}) => {
|
|
547
|
+
let n = new T(e, {
|
|
548
|
+
location: t.location ?? h.location,
|
|
549
|
+
threshold: t.threshold ?? h.threshold,
|
|
550
|
+
distance: t.distance ?? h.distance,
|
|
551
|
+
includeMatches: t.includeMatches ?? h.includeMatches,
|
|
552
|
+
findAllMatches: t.findAllMatches ?? h.findAllMatches,
|
|
553
|
+
minMatchCharLength: t.minMatchCharLength ?? h.minMatchCharLength,
|
|
554
|
+
isCaseSensitive: t.isCaseSensitive ?? h.isCaseSensitive,
|
|
555
|
+
ignoreDiacritics: t.ignoreDiacritics ?? h.ignoreDiacritics,
|
|
556
|
+
ignoreLocation: t.ignoreLocation ?? h.ignoreLocation
|
|
557
|
+
});
|
|
558
|
+
return {
|
|
559
|
+
type: "fuzzy",
|
|
560
|
+
search: (e) => n.searchIn(e)
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
], k = O.length;
|
|
565
|
+
function A(e, t) {
|
|
566
|
+
let n = e.match(t);
|
|
567
|
+
return n ? n[1] : null;
|
|
568
|
+
}
|
|
569
|
+
var j = [];
|
|
570
|
+
function M(...e) {
|
|
571
|
+
j.push(...e);
|
|
572
|
+
}
|
|
573
|
+
function N(e, t) {
|
|
574
|
+
for (let n = 0, r = j.length; n < r; n += 1) {
|
|
575
|
+
let r = j[n];
|
|
576
|
+
if (r.condition(e, t)) return new r(e, t);
|
|
577
|
+
}
|
|
578
|
+
return new T(e, t);
|
|
579
|
+
}
|
|
580
|
+
var P = "$and", F = "$or", I = "$path", L = "$val", R = (e) => !(!e[P] && !e[F]), z = (e) => ({ [P]: Object.keys(e).map((t) => ({ [t]: e[t] })) });
|
|
581
|
+
function B(t, r, { auto: i = !0 } = {}) {
|
|
582
|
+
let o = (t) => {
|
|
583
|
+
if (n(t)) {
|
|
584
|
+
let e = {
|
|
585
|
+
keyId: null,
|
|
586
|
+
pattern: t
|
|
587
|
+
};
|
|
588
|
+
return i && (e.searcher = N(t, r)), e;
|
|
589
|
+
}
|
|
590
|
+
let s = Object.keys(t), c = ((e) => !!e[I])(t);
|
|
591
|
+
if (!c && s.length > 1 && !R(t)) return o(z(t));
|
|
592
|
+
if (((t) => !e(t) && a(t) && !R(t))(t)) {
|
|
593
|
+
let e = c ? t[I] : s[0], a = c ? t[L] : t[e];
|
|
594
|
+
if (!n(a)) throw Error(((e) => `Invalid value for key ${e}`)(e));
|
|
595
|
+
let o = {
|
|
596
|
+
keyId: m(e),
|
|
597
|
+
pattern: a
|
|
598
|
+
};
|
|
599
|
+
return i && (o.searcher = N(a, r)), o;
|
|
600
|
+
}
|
|
601
|
+
let l = {
|
|
602
|
+
children: [],
|
|
603
|
+
operator: s[0]
|
|
604
|
+
};
|
|
605
|
+
return s.forEach((n) => {
|
|
606
|
+
let r = t[n];
|
|
607
|
+
e(r) && r.forEach((e) => {
|
|
608
|
+
l.children.push(o(e));
|
|
609
|
+
});
|
|
610
|
+
}), l;
|
|
611
|
+
};
|
|
612
|
+
return R(t) || (t = z(t)), o(t);
|
|
613
|
+
}
|
|
614
|
+
function V(e, { ignoreFieldNorm: t = h.ignoreFieldNorm }) {
|
|
615
|
+
let n = 1;
|
|
616
|
+
return e.forEach(({ key: e, norm: r, score: i }) => {
|
|
617
|
+
let a = e ? e.weight : null;
|
|
618
|
+
n *= (i === 0 && a ? 2 ** -52 : i) ** +((a || 1) * (t ? 1 : r));
|
|
619
|
+
}), n;
|
|
620
|
+
}
|
|
621
|
+
var H = class {
|
|
622
|
+
constructor(e, t) {
|
|
623
|
+
this.limit = e, this.heap = [], this.comparator = t;
|
|
624
|
+
}
|
|
625
|
+
get size() {
|
|
626
|
+
return this.heap.length;
|
|
627
|
+
}
|
|
628
|
+
insert(e) {
|
|
629
|
+
this.size < this.limit ? (this.heap.push(e), this._bubbleUp(this.size - 1)) : this.comparator(e, this.heap[0]) < 0 && (this.heap[0] = e, this._sinkDown(0));
|
|
630
|
+
}
|
|
631
|
+
extractSorted() {
|
|
632
|
+
return this.heap.sort(this.comparator);
|
|
633
|
+
}
|
|
634
|
+
_bubbleUp(e) {
|
|
635
|
+
let t = this.heap;
|
|
636
|
+
for (; e > 0;) {
|
|
637
|
+
let n = e - 1 >> 1;
|
|
638
|
+
if (this.comparator(t[e], t[n]) <= 0) break;
|
|
639
|
+
let r = t[e];
|
|
640
|
+
t[e] = t[n], t[n] = r, e = n;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
_sinkDown(e) {
|
|
644
|
+
let t = this.heap, n = t.length, r = e;
|
|
645
|
+
do {
|
|
646
|
+
let i = 2 * (e = r) + 1, a = 2 * e + 2;
|
|
647
|
+
if (i < n && this.comparator(t[i], t[r]) > 0 && (r = i), a < n && this.comparator(t[a], t[r]) > 0 && (r = a), r !== e) {
|
|
648
|
+
let n = t[e];
|
|
649
|
+
t[e] = t[r], t[r] = n;
|
|
650
|
+
}
|
|
651
|
+
} while (r !== e);
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
function U(e, t, { includeMatches: n = h.includeMatches, includeScore: r = h.includeScore } = {}) {
|
|
655
|
+
return e.map((e) => {
|
|
656
|
+
let { idx: i } = e, a = {
|
|
657
|
+
item: t[i],
|
|
658
|
+
refIndex: i
|
|
659
|
+
};
|
|
660
|
+
return n && (a.matches = function(e) {
|
|
661
|
+
let t = [];
|
|
662
|
+
return e.matches.forEach((e) => {
|
|
663
|
+
if (!o(e.indices) || !e.indices.length) return;
|
|
664
|
+
let n = {
|
|
665
|
+
indices: e.indices,
|
|
666
|
+
value: e.value
|
|
667
|
+
};
|
|
668
|
+
e.key && (n.key = e.key.id), e.idx > -1 && (n.refIndex = e.idx), t.push(n);
|
|
669
|
+
}), t;
|
|
670
|
+
}(e)), r && (a.score = e.score), a;
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
var W = /[\p{L}\p{M}\p{N}_]+/gu, G = /* @__PURE__ */ new WeakSet();
|
|
674
|
+
function K(e) {
|
|
675
|
+
if (typeof e == "function") {
|
|
676
|
+
let t = !1;
|
|
677
|
+
return (n) => {
|
|
678
|
+
let r = e(n);
|
|
679
|
+
if (!t && (t = !0, !Array.isArray(r) || r.some((e) => typeof e != "string"))) throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r) ? "array containing non-strings" : typeof r}.`);
|
|
680
|
+
return r;
|
|
681
|
+
};
|
|
682
|
+
}
|
|
683
|
+
return e instanceof RegExp ? (e.global || (t = e, G.has(t) || (G.add(t), console.warn(`[Fuse] tokenize regex ${t} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))), (t) => t.match(e) || []) : (e) => e.match(W) || [];
|
|
684
|
+
var t;
|
|
685
|
+
}
|
|
686
|
+
function q({ isCaseSensitive: e = !1, ignoreDiacritics: t = !1, tokenize: n } = {}) {
|
|
687
|
+
let r = K(n);
|
|
688
|
+
return { tokenize: (n) => (e || (n = n.toLowerCase()), t && (n = w(n)), r(n)) };
|
|
689
|
+
}
|
|
690
|
+
function J(e, t, n, r) {
|
|
691
|
+
let i = r.tokenize(t);
|
|
692
|
+
if (!i.length) return;
|
|
693
|
+
e.fieldCount++, e.docFieldCount.set(n, (e.docFieldCount.get(n) || 0) + 1);
|
|
694
|
+
let a = new Set(i), o = e.docTermFieldHits.get(n);
|
|
695
|
+
o || (o = /* @__PURE__ */ new Map(), e.docTermFieldHits.set(n, o));
|
|
696
|
+
for (let t of a) o.set(t, (o.get(t) || 0) + 1), e.df.set(t, (e.df.get(t) || 0) + 1);
|
|
697
|
+
}
|
|
698
|
+
function Y(e, t, n, r) {
|
|
699
|
+
let { i, v: a, $: o } = t;
|
|
700
|
+
if (a === void 0) {
|
|
701
|
+
if (o) for (let t = 0; t < n; t++) {
|
|
702
|
+
let n = o[t];
|
|
703
|
+
if (n) if (Array.isArray(n)) for (let t of n) J(e, t.v, i, r);
|
|
704
|
+
else J(e, n.v, i, r);
|
|
705
|
+
}
|
|
706
|
+
} else J(e, a, i, r);
|
|
707
|
+
}
|
|
708
|
+
function X(e, t) {
|
|
709
|
+
let n = e.docFieldCount.get(t);
|
|
710
|
+
if (n === void 0) return;
|
|
711
|
+
e.fieldCount -= n, e.docFieldCount.delete(t);
|
|
712
|
+
let r = e.docTermFieldHits.get(t);
|
|
713
|
+
if (r) {
|
|
714
|
+
for (let [t, n] of r) {
|
|
715
|
+
let r = (e.df.get(t) || 0) - n;
|
|
716
|
+
r <= 0 ? e.df.delete(t) : e.df.set(t, r);
|
|
717
|
+
}
|
|
718
|
+
e.docTermFieldHits.delete(t);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
function Z(e, t) {
|
|
722
|
+
if (t.length === 0) return;
|
|
723
|
+
let n = Array.from(new Set(t)).sort((e, t) => e - t);
|
|
724
|
+
for (let t of n) X(e, t);
|
|
725
|
+
let r = (e) => {
|
|
726
|
+
let t = 0, r = n.length;
|
|
727
|
+
for (; t < r;) {
|
|
728
|
+
let i = t + r >>> 1;
|
|
729
|
+
n[i] < e ? t = i + 1 : r = i;
|
|
730
|
+
}
|
|
731
|
+
return e - t;
|
|
732
|
+
}, i = n[0], a = /* @__PURE__ */ new Map();
|
|
733
|
+
for (let [t, n] of e.docFieldCount) a.set(t > i ? r(t) : t, n);
|
|
734
|
+
e.docFieldCount = a;
|
|
735
|
+
let o = /* @__PURE__ */ new Map();
|
|
736
|
+
for (let [t, n] of e.docTermFieldHits) o.set(t > i ? r(t) : t, n);
|
|
737
|
+
e.docTermFieldHits = o;
|
|
738
|
+
}
|
|
739
|
+
var Q = class {
|
|
740
|
+
constructor(e, t, n) {
|
|
741
|
+
this.options = {
|
|
742
|
+
...h,
|
|
743
|
+
...t
|
|
744
|
+
}, this.options.useExtendedSearch, this.options.useTokenSearch, this._keyStore = new d(this.options.keys), this._docs = e, this._myIndex = null, this._invertedIndex = null, this.setCollection(e, n), this._lastQuery = null, this._lastSearcher = null;
|
|
745
|
+
}
|
|
746
|
+
_getSearcher(e) {
|
|
747
|
+
if (this._lastQuery === e) return this._lastSearcher;
|
|
748
|
+
let t = N(e, this._invertedIndex ? {
|
|
749
|
+
...this.options,
|
|
750
|
+
_invertedIndex: this._invertedIndex
|
|
751
|
+
} : this.options);
|
|
752
|
+
return this._lastQuery = e, this._lastSearcher = t, t;
|
|
753
|
+
}
|
|
754
|
+
setCollection(e, t) {
|
|
755
|
+
if (this._docs = e, t && !(t instanceof _)) throw Error("Incorrect 'index' type");
|
|
756
|
+
if (this._myIndex = t || v(this.options.keys, this._docs, {
|
|
757
|
+
getFn: this.options.getFn,
|
|
758
|
+
fieldNormWeight: this.options.fieldNormWeight
|
|
759
|
+
}), this.options.useTokenSearch) {
|
|
760
|
+
let e = q({
|
|
761
|
+
isCaseSensitive: this.options.isCaseSensitive,
|
|
762
|
+
ignoreDiacritics: this.options.ignoreDiacritics,
|
|
763
|
+
tokenize: this.options.tokenize
|
|
764
|
+
});
|
|
765
|
+
this._invertedIndex = function(e, t, n) {
|
|
766
|
+
let r = {
|
|
767
|
+
fieldCount: 0,
|
|
768
|
+
df: /* @__PURE__ */ new Map(),
|
|
769
|
+
docFieldCount: /* @__PURE__ */ new Map(),
|
|
770
|
+
docTermFieldHits: /* @__PURE__ */ new Map()
|
|
771
|
+
};
|
|
772
|
+
for (let i of e) Y(r, i, t, n);
|
|
773
|
+
return r;
|
|
774
|
+
}(this._myIndex.records, this._myIndex.keys.length, e);
|
|
775
|
+
}
|
|
776
|
+
this._invalidateSearcherCache();
|
|
777
|
+
}
|
|
778
|
+
add(e) {
|
|
779
|
+
if (!o(e)) return;
|
|
780
|
+
this._docs.push(e);
|
|
781
|
+
let t = this._myIndex.add(e, this._docs.length - 1);
|
|
782
|
+
if (this._invertedIndex && t) {
|
|
783
|
+
let e = q({
|
|
784
|
+
isCaseSensitive: this.options.isCaseSensitive,
|
|
785
|
+
ignoreDiacritics: this.options.ignoreDiacritics,
|
|
786
|
+
tokenize: this.options.tokenize
|
|
787
|
+
});
|
|
788
|
+
(function(e, t, n, r) {
|
|
789
|
+
Y(e, t, n, r);
|
|
790
|
+
})(this._invertedIndex, t, this._myIndex.keys.length, e);
|
|
791
|
+
}
|
|
792
|
+
this._invalidateSearcherCache();
|
|
793
|
+
}
|
|
794
|
+
remove(e = () => !1) {
|
|
795
|
+
let t = [], n = [];
|
|
796
|
+
for (let r = 0, i = this._docs.length; r < i; r += 1) e(this._docs[r], r) && (t.push(this._docs[r]), n.push(r));
|
|
797
|
+
if (n.length) {
|
|
798
|
+
this._invertedIndex && Z(this._invertedIndex, n);
|
|
799
|
+
let e = new Set(n);
|
|
800
|
+
this._docs = this._docs.filter((t, n) => !e.has(n)), this._myIndex.removeAll(n), this._invalidateSearcherCache();
|
|
801
|
+
}
|
|
802
|
+
return t;
|
|
803
|
+
}
|
|
804
|
+
removeAt(e) {
|
|
805
|
+
if (!Number.isInteger(e) || e < 0 || e >= this._docs.length) throw Error(l);
|
|
806
|
+
this._invertedIndex && Z(this._invertedIndex, [e]);
|
|
807
|
+
let t = this._docs.splice(e, 1)[0];
|
|
808
|
+
return this._myIndex.removeAt(e), this._invalidateSearcherCache(), t;
|
|
809
|
+
}
|
|
810
|
+
_invalidateSearcherCache() {
|
|
811
|
+
this._lastQuery = null, this._lastSearcher = null;
|
|
812
|
+
}
|
|
813
|
+
getIndex() {
|
|
814
|
+
return this._myIndex;
|
|
815
|
+
}
|
|
816
|
+
_normalizedKeys() {
|
|
817
|
+
return this._myIndex.keys.map((e) => this._keyStore.get(e.id) || e);
|
|
818
|
+
}
|
|
819
|
+
search(e, t) {
|
|
820
|
+
let { limit: i = -1 } = t || {}, { includeMatches: a, includeScore: o, shouldSort: s, sortFn: c, ignoreFieldNorm: l } = this.options;
|
|
821
|
+
if (n(e) && !e.trim()) {
|
|
822
|
+
let e = this._docs.map((e, t) => ({
|
|
823
|
+
item: e,
|
|
824
|
+
refIndex: t
|
|
825
|
+
}));
|
|
826
|
+
return r(i) && i > -1 && (e = e.slice(0, i)), e;
|
|
827
|
+
}
|
|
828
|
+
let u = s && r(i) && i > 0 && n(e), d = c, f = (e, t) => d(e, t) || e.idx - t.idx, p;
|
|
829
|
+
if (u) {
|
|
830
|
+
let t = new H(i, f);
|
|
831
|
+
n(this._docs[0]) ? this._searchStringList(e, {
|
|
832
|
+
heap: t,
|
|
833
|
+
ignoreFieldNorm: l
|
|
834
|
+
}) : this._searchObjectList(e, {
|
|
835
|
+
heap: t,
|
|
836
|
+
ignoreFieldNorm: l
|
|
837
|
+
}), p = t.extractSorted();
|
|
838
|
+
} else p = n(e) ? n(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e), function(e, { ignoreFieldNorm: t = h.ignoreFieldNorm }) {
|
|
839
|
+
e.forEach((e) => {
|
|
840
|
+
e.score = V(e.matches, { ignoreFieldNorm: t });
|
|
841
|
+
});
|
|
842
|
+
}(p, { ignoreFieldNorm: l }), s && p.sort(n(e) ? f : d), r(i) && i > -1 && (p = p.slice(0, i));
|
|
843
|
+
return U(p, this._docs, {
|
|
844
|
+
includeMatches: a,
|
|
845
|
+
includeScore: o
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
_searchStringList(e, { heap: t, ignoreFieldNorm: n } = {}) {
|
|
849
|
+
let r = this._getSearcher(e), i = this.options.useTokenSearch && this.options.tokenMatch === "all", { records: a } = this._myIndex, s = t ? null : [];
|
|
850
|
+
return a.forEach(({ v: e, i: a, n: c }) => {
|
|
851
|
+
if (!o(e)) return;
|
|
852
|
+
let l = r.searchIn(e);
|
|
853
|
+
if (l.isMatch) {
|
|
854
|
+
let r = {
|
|
855
|
+
score: l.score,
|
|
856
|
+
value: e,
|
|
857
|
+
norm: c,
|
|
858
|
+
indices: l.indices
|
|
859
|
+
};
|
|
860
|
+
i && (r.matchedMask = l.matchedMask, r.matchedTerms = l.matchedTerms, r.termCount = l.termCount);
|
|
861
|
+
let o = [r];
|
|
862
|
+
if (!i || this._coversAllTokens(o)) {
|
|
863
|
+
let r = {
|
|
864
|
+
item: e,
|
|
865
|
+
idx: a,
|
|
866
|
+
matches: o
|
|
867
|
+
};
|
|
868
|
+
t ? (r.score = V(r.matches, { ignoreFieldNorm: n }), t.insert(r)) : s.push(r);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
}), s;
|
|
872
|
+
}
|
|
873
|
+
_searchLogical(e) {
|
|
874
|
+
let t = B(e, this.options), n = this._normalizedKeys(), r = (e, t, i) => {
|
|
875
|
+
if (!("children" in e)) {
|
|
876
|
+
let { keyId: r, searcher: a } = e, o;
|
|
877
|
+
return r === null ? (o = [], n.forEach((e, n) => {
|
|
878
|
+
o.push(...this._findMatches({
|
|
879
|
+
key: e,
|
|
880
|
+
value: t[n],
|
|
881
|
+
searcher: a
|
|
882
|
+
}));
|
|
883
|
+
})) : o = this._findMatches({
|
|
884
|
+
key: this._keyStore.get(r),
|
|
885
|
+
value: this._myIndex.getValueForItemAtKeyId(t, r),
|
|
886
|
+
searcher: a
|
|
887
|
+
}), o && o.length ? [{
|
|
888
|
+
idx: i,
|
|
889
|
+
item: t,
|
|
890
|
+
matches: o
|
|
891
|
+
}] : [];
|
|
892
|
+
}
|
|
893
|
+
let { children: a, operator: o } = e, s = [];
|
|
894
|
+
for (let e = 0, n = a.length; e < n; e += 1) {
|
|
895
|
+
let n = a[e], c = r(n, t, i);
|
|
896
|
+
if (c.length) s.push(...c);
|
|
897
|
+
else if (o === P) return [];
|
|
898
|
+
}
|
|
899
|
+
return s;
|
|
900
|
+
}, i = this._myIndex.records, a = /* @__PURE__ */ new Map(), s = [];
|
|
901
|
+
return i.forEach(({ $: e, i: n }) => {
|
|
902
|
+
if (o(e)) {
|
|
903
|
+
let i = r(t, e, n);
|
|
904
|
+
i.length && (a.has(n) || (a.set(n, {
|
|
905
|
+
idx: n,
|
|
906
|
+
item: e,
|
|
907
|
+
matches: []
|
|
908
|
+
}), s.push(a.get(n))), i.forEach(({ matches: e }) => {
|
|
909
|
+
a.get(n).matches.push(...e);
|
|
910
|
+
}));
|
|
911
|
+
}
|
|
912
|
+
}), s;
|
|
913
|
+
}
|
|
914
|
+
_searchObjectList(e, { heap: t, ignoreFieldNorm: n } = {}) {
|
|
915
|
+
let r = this._getSearcher(e), i = this.options.useTokenSearch && this.options.tokenMatch === "all", { records: a } = this._myIndex, s = this._normalizedKeys(), c = t ? null : [];
|
|
916
|
+
return a.forEach(({ $: e, i: a }) => {
|
|
917
|
+
if (!o(e)) return;
|
|
918
|
+
let l = [], u = !1, d = !1;
|
|
919
|
+
if (s.forEach((t, n) => {
|
|
920
|
+
let i = this._findMatches({
|
|
921
|
+
key: t,
|
|
922
|
+
value: e[n],
|
|
923
|
+
searcher: r
|
|
924
|
+
});
|
|
925
|
+
i.length ? (l.push(...i), i[0].hasInverse && (d = !0)) : u = !0;
|
|
926
|
+
}), (!d || !u) && l.length && (!i || this._coversAllTokens(l))) {
|
|
927
|
+
let r = {
|
|
928
|
+
idx: a,
|
|
929
|
+
item: e,
|
|
930
|
+
matches: l
|
|
931
|
+
};
|
|
932
|
+
t ? (r.score = V(r.matches, { ignoreFieldNorm: n }), t.insert(r)) : c.push(r);
|
|
933
|
+
}
|
|
934
|
+
}), c;
|
|
935
|
+
}
|
|
936
|
+
_findMatches({ key: t, value: n, searcher: r }) {
|
|
937
|
+
if (!o(n)) return [];
|
|
938
|
+
let i = [];
|
|
939
|
+
if (e(n)) n.forEach(({ v: e, i: n, n: a }) => {
|
|
940
|
+
if (!o(e)) return;
|
|
941
|
+
let s = r.searchIn(e);
|
|
942
|
+
if (s.isMatch) {
|
|
943
|
+
let r = {
|
|
944
|
+
score: s.score,
|
|
945
|
+
key: t,
|
|
946
|
+
value: e,
|
|
947
|
+
idx: n,
|
|
948
|
+
norm: a,
|
|
949
|
+
indices: s.indices,
|
|
950
|
+
hasInverse: s.hasInverse
|
|
951
|
+
};
|
|
952
|
+
s.termCount !== void 0 && (r.matchedMask = s.matchedMask, r.matchedTerms = s.matchedTerms, r.termCount = s.termCount), i.push(r);
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
else {
|
|
956
|
+
let { v: e, n: a } = n, o = r.searchIn(e);
|
|
957
|
+
if (o.isMatch) {
|
|
958
|
+
let n = {
|
|
959
|
+
score: o.score,
|
|
960
|
+
key: t,
|
|
961
|
+
value: e,
|
|
962
|
+
norm: a,
|
|
963
|
+
indices: o.indices,
|
|
964
|
+
hasInverse: o.hasInverse
|
|
965
|
+
};
|
|
966
|
+
o.termCount !== void 0 && (n.matchedMask = o.matchedMask, n.matchedTerms = o.matchedTerms, n.termCount = o.termCount), i.push(n);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
return i;
|
|
970
|
+
}
|
|
971
|
+
_coversAllTokens(e) {
|
|
972
|
+
let t = e.length ? e[0].termCount : void 0;
|
|
973
|
+
if (t === void 0) return !0;
|
|
974
|
+
if (t <= 31) {
|
|
975
|
+
let n = 0;
|
|
976
|
+
for (let t = 0; t < e.length; t++) n |= e[t].matchedMask || 0;
|
|
977
|
+
return n === 2 ** t - 1;
|
|
978
|
+
}
|
|
979
|
+
let n = /* @__PURE__ */ new Set();
|
|
980
|
+
for (let t = 0; t < e.length; t++) {
|
|
981
|
+
let r = e[t].matchedTerms;
|
|
982
|
+
if (r) for (let e of r) n.add(e);
|
|
983
|
+
}
|
|
984
|
+
return n.size === t;
|
|
985
|
+
}
|
|
986
|
+
};
|
|
987
|
+
Q.version = "7.5.0", Q.createIndex = v, Q.parseIndex = function(e, { getFn: t = h.getFn, fieldNormWeight: n = h.fieldNormWeight } = {}) {
|
|
988
|
+
let { keys: r, records: i } = e, a = new _({
|
|
989
|
+
getFn: t,
|
|
990
|
+
fieldNormWeight: n
|
|
991
|
+
});
|
|
992
|
+
return a.setKeys(r), a.setIndexRecords(i), a;
|
|
993
|
+
}, Q.config = h, Q.match = function(e, t, n) {
|
|
994
|
+
if (n && n.useTokenSearch) throw Error("Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.");
|
|
995
|
+
return N(e, {
|
|
996
|
+
...h,
|
|
997
|
+
...n
|
|
998
|
+
}).searchIn(t);
|
|
999
|
+
}, Q.parseQuery = B, M(class {
|
|
1000
|
+
constructor(e, { isCaseSensitive: t = h.isCaseSensitive, ignoreDiacritics: n = h.ignoreDiacritics, includeMatches: r = h.includeMatches, minMatchCharLength: i = h.minMatchCharLength, ignoreLocation: a = h.ignoreLocation, findAllMatches: o = h.findAllMatches, location: s = h.location, threshold: c = h.threshold, distance: l = h.distance } = {}) {
|
|
1001
|
+
this.query = null, this.options = {
|
|
1002
|
+
isCaseSensitive: t,
|
|
1003
|
+
ignoreDiacritics: n,
|
|
1004
|
+
includeMatches: r,
|
|
1005
|
+
minMatchCharLength: i,
|
|
1006
|
+
findAllMatches: o,
|
|
1007
|
+
ignoreLocation: a,
|
|
1008
|
+
location: s,
|
|
1009
|
+
threshold: c,
|
|
1010
|
+
distance: l
|
|
1011
|
+
}, e = t ? e : e.toLowerCase(), e = n ? w(e) : e, this.pattern = e, this.query = function(e, t = {}) {
|
|
1012
|
+
return e.replace(/\\\|/g, "\0").split("|").map((e) => {
|
|
1013
|
+
let n = function(e) {
|
|
1014
|
+
let t = [], n = e.length, r = 0;
|
|
1015
|
+
for (; r < n;) {
|
|
1016
|
+
for (; r < n && e[r] === " ";) r++;
|
|
1017
|
+
if (r >= n) break;
|
|
1018
|
+
let i = r;
|
|
1019
|
+
for (; i < n && e[i] !== " " && e[i] !== "\"";) i++;
|
|
1020
|
+
if (i < n && e[i] === "\"") {
|
|
1021
|
+
for (i++; i < n;) {
|
|
1022
|
+
if (e[i] === "\"") {
|
|
1023
|
+
let t = i + 1;
|
|
1024
|
+
if (t >= n || e[t] === " ") {
|
|
1025
|
+
i++;
|
|
1026
|
+
break;
|
|
1027
|
+
}
|
|
1028
|
+
if (e[t] === "$" && (t + 1 >= n || e[t + 1] === " ")) {
|
|
1029
|
+
i += 2;
|
|
1030
|
+
break;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
i++;
|
|
1034
|
+
}
|
|
1035
|
+
t.push(e.substring(r, i)), r = i;
|
|
1036
|
+
} else {
|
|
1037
|
+
for (; i < n && e[i] !== " ";) i++;
|
|
1038
|
+
t.push(e.substring(r, i)), r = i;
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
return t;
|
|
1042
|
+
}(e.replace(/\u0000/g, "|").trim()).filter((e) => e && !!e.trim()), r = [];
|
|
1043
|
+
for (let e = 0, i = n.length; e < i; e += 1) {
|
|
1044
|
+
let i = n[e], a = !1, o = -1;
|
|
1045
|
+
for (; !a && ++o < k;) {
|
|
1046
|
+
let e = O[o], n = A(i, e.multiRegex);
|
|
1047
|
+
n && (r.push(e.create(n, t)), a = !0);
|
|
1048
|
+
}
|
|
1049
|
+
if (!a) for (o = -1; ++o < k;) {
|
|
1050
|
+
let e = O[o], n = A(i, e.singleRegex);
|
|
1051
|
+
if (n) {
|
|
1052
|
+
r.push(e.create(n, t));
|
|
1053
|
+
break;
|
|
1054
|
+
}
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
return r;
|
|
1058
|
+
});
|
|
1059
|
+
}(this.pattern, this.options);
|
|
1060
|
+
}
|
|
1061
|
+
static condition(e, t) {
|
|
1062
|
+
return t.useExtendedSearch;
|
|
1063
|
+
}
|
|
1064
|
+
searchIn(e) {
|
|
1065
|
+
let t = this.query;
|
|
1066
|
+
if (!t) return {
|
|
1067
|
+
isMatch: !1,
|
|
1068
|
+
score: 1
|
|
1069
|
+
};
|
|
1070
|
+
let { includeMatches: n, isCaseSensitive: r, ignoreDiacritics: i } = this.options;
|
|
1071
|
+
e = r ? e : e.toLowerCase(), e = i ? w(e) : e;
|
|
1072
|
+
let a = 0, o = [], s = 0, c = !1;
|
|
1073
|
+
for (let r = 0, i = t.length; r < i; r += 1) {
|
|
1074
|
+
let i = t[r];
|
|
1075
|
+
o.length = 0, a = 0, c = !1;
|
|
1076
|
+
for (let t = 0, r = i.length; t < r; t += 1) {
|
|
1077
|
+
let r = i[t], { isMatch: l, indices: u, score: d } = r.search(e);
|
|
1078
|
+
if (!l) {
|
|
1079
|
+
s = 0, a = 0, o.length = 0, c = !1;
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
a += 1, s += d, D(r.type) && (c = !0), n && (E.has(r.type) ? o.push(...u) : o.push(u));
|
|
1083
|
+
}
|
|
1084
|
+
if (a) {
|
|
1085
|
+
let e = {
|
|
1086
|
+
isMatch: !0,
|
|
1087
|
+
score: s / a
|
|
1088
|
+
};
|
|
1089
|
+
return c && (e.hasInverse = !0), n && (e.indices = x(o)), e;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
return {
|
|
1093
|
+
isMatch: !1,
|
|
1094
|
+
score: 1
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
}), M(class {
|
|
1098
|
+
static condition(e, t) {
|
|
1099
|
+
return t.useTokenSearch;
|
|
1100
|
+
}
|
|
1101
|
+
constructor(e, t) {
|
|
1102
|
+
this.options = t, this.analyzer = q({
|
|
1103
|
+
isCaseSensitive: t.isCaseSensitive,
|
|
1104
|
+
ignoreDiacritics: t.ignoreDiacritics,
|
|
1105
|
+
tokenize: t.tokenize
|
|
1106
|
+
});
|
|
1107
|
+
let n = this.analyzer.tokenize(e), { df: r, fieldCount: i } = t._invertedIndex;
|
|
1108
|
+
this.termSearchers = [], this.idfWeights = [];
|
|
1109
|
+
for (let e of n) {
|
|
1110
|
+
this.termSearchers.push(new T(e, {
|
|
1111
|
+
location: t.location,
|
|
1112
|
+
threshold: t.threshold,
|
|
1113
|
+
distance: t.distance,
|
|
1114
|
+
includeMatches: t.includeMatches,
|
|
1115
|
+
findAllMatches: t.findAllMatches,
|
|
1116
|
+
minMatchCharLength: t.minMatchCharLength,
|
|
1117
|
+
isCaseSensitive: t.isCaseSensitive,
|
|
1118
|
+
ignoreDiacritics: t.ignoreDiacritics,
|
|
1119
|
+
ignoreLocation: !0
|
|
1120
|
+
}));
|
|
1121
|
+
let n = r.get(e) || 0, a = Math.log(1 + (i - n + .5) / (n + .5));
|
|
1122
|
+
this.idfWeights.push(a);
|
|
1123
|
+
}
|
|
1124
|
+
this.combineAll = t.tokenMatch === "all", this.numTerms = this.termSearchers.length, this.useMask = this.numTerms <= 31;
|
|
1125
|
+
}
|
|
1126
|
+
searchIn(e) {
|
|
1127
|
+
if (!this.termSearchers.length) return {
|
|
1128
|
+
isMatch: !1,
|
|
1129
|
+
score: 1
|
|
1130
|
+
};
|
|
1131
|
+
let t = [], n = 0, r = 0, i = 0, a = 0, o = this.combineAll && !this.useMask ? /* @__PURE__ */ new Set() : null;
|
|
1132
|
+
for (let s = 0; s < this.termSearchers.length; s++) {
|
|
1133
|
+
let c = this.termSearchers[s].searchIn(e), l = this.idfWeights[s];
|
|
1134
|
+
r += l, c.isMatch && (i++, n += l * (1 - c.score), c.indices && t.push(...c.indices), this.combineAll && (this.useMask ? a |= 1 << s : o.add(s)));
|
|
1135
|
+
}
|
|
1136
|
+
if (i === 0) return {
|
|
1137
|
+
isMatch: !1,
|
|
1138
|
+
score: 1
|
|
1139
|
+
};
|
|
1140
|
+
let s = r > 0 ? 1 - n / r : 0, c = {
|
|
1141
|
+
isMatch: !0,
|
|
1142
|
+
score: Math.max(.001, s)
|
|
1143
|
+
};
|
|
1144
|
+
return this.options.includeMatches && t.length && (c.indices = x(t)), this.combineAll && (this.useMask ? c.matchedMask = a : c.matchedTerms = o, c.termCount = this.numTerms), c;
|
|
1145
|
+
}
|
|
1146
|
+
}), Q.use = function(...e) {
|
|
1147
|
+
e.forEach((e) => M(e));
|
|
1148
|
+
};
|
|
1149
|
+
var $ = Q;
|
|
1150
|
+
export { $ as default };
|