@sheetxl/studio-vanilla 0.4.12 → 0.4.14

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.
Files changed (252) hide show
  1. package/README.md +2 -2
  2. package/browser/cjs/10IK8MFijJb-yvV6.cjs +7 -0
  3. package/browser/cjs/1bCMnueqxHW3rn0c.cjs +6 -0
  4. package/browser/cjs/AnJTeEGq7VP4T1b7.cjs +161 -0
  5. package/browser/cjs/BH3MYcOF7rxLX3Bk.cjs +15 -0
  6. package/browser/cjs/BQ4QeJYaIhLaInyR.cjs +6 -0
  7. package/browser/cjs/BU5k1OZewc-Z-kR9.cjs +6 -0
  8. package/browser/cjs/BlwK-VslgEVH2cgX.cjs +145 -0
  9. package/browser/cjs/Bm9fNNMIOLIwq-94.cjs +6 -0
  10. package/browser/cjs/BtiY-n4sGy6WaqNg.cjs +32 -0
  11. package/browser/cjs/BxgDhdrrKrJMEaXd.cjs +6 -0
  12. package/browser/cjs/BzT1y15V6Zs7c_zX.cjs +6 -0
  13. package/browser/cjs/C0ySf2emOB0Mslc-.cjs +6 -0
  14. package/browser/cjs/CE5U7gB5L-PE17gV.cjs +6 -0
  15. package/browser/cjs/CHd9vauNLHnOLflj.cjs +6 -0
  16. package/browser/cjs/CJZtyunL_qaXFylY.cjs +12 -0
  17. package/browser/cjs/CJoJ19i1z94kndlS.cjs +19 -0
  18. package/browser/cjs/CNcsGELwCAV-A5oH.cjs +16 -0
  19. package/browser/cjs/CTuM_aZX8wZICUe_.cjs +6 -0
  20. package/browser/cjs/CWW_yQpIswo7DEAT.cjs +6 -0
  21. package/browser/cjs/CXIHULOe7x4DYKXw.cjs +12 -0
  22. package/browser/cjs/CYLnJHryQcQO4XoG.cjs +6 -0
  23. package/browser/cjs/C_mbaid3FQ52usBI.cjs +6 -0
  24. package/browser/cjs/Cj_1qUo5cZ3FnOpK.cjs +6 -0
  25. package/browser/cjs/Cl0XSnWVDoaHTIlF.cjs +6 -0
  26. package/browser/cjs/CnLdhURNkVXo_0Eg.cjs +6 -0
  27. package/browser/cjs/CpIIsygD5mnJyl47.cjs +1501 -0
  28. package/browser/cjs/CpRfx14is2_4Wgp3.cjs +6 -0
  29. package/browser/cjs/Cuq8Nim-ol5Gdehe.cjs +6 -0
  30. package/browser/cjs/D4NcrJlqcLExwCNT.cjs +124 -0
  31. package/browser/cjs/D4vbOk4hD8-b-c10.cjs +6 -0
  32. package/browser/cjs/D5YUIQeOcujtq6XS.cjs +7 -0
  33. package/browser/cjs/D6uIvR-6Y690_Em2.cjs +11 -0
  34. package/browser/cjs/DAbScbuk-sjZXMIC.cjs +11 -0
  35. package/browser/cjs/DBNXGIWfZmgb_sHL.cjs +6 -0
  36. package/browser/cjs/DCd5OZXj2IRbxEF2.cjs +6 -0
  37. package/browser/cjs/DFNisISrsMnZrV4B.cjs +6 -0
  38. package/browser/cjs/DIYOARVcGtRjKpjZ.cjs +6 -0
  39. package/browser/cjs/DL4HgriZ3TY2K-QP.cjs +6 -0
  40. package/browser/cjs/DPbzY4ppgKPrdbWc.cjs +6 -0
  41. package/browser/cjs/DQGdVVTxixgptLdj.cjs +366 -0
  42. package/browser/cjs/DWzQm8Q32qNP7qKL.cjs +6 -0
  43. package/browser/cjs/D_7RtbQABH1zdcjr.cjs +7 -0
  44. package/browser/cjs/D_Q0s9KLnWHwKxTK.cjs +6 -0
  45. package/browser/cjs/DdTcwutSPJMeCIv3.cjs +6 -0
  46. package/browser/cjs/DlnKrZRyxBfbqaTi.cjs +13 -0
  47. package/browser/cjs/DtpB0PMEtamaB-Hv.cjs +6 -0
  48. package/browser/cjs/Dv8SE05ABKNLPY6A.cjs +6 -0
  49. package/browser/cjs/DxBLU16_E62Umowp.cjs +6 -0
  50. package/browser/cjs/VU_KaqGTjvnisS9e.cjs +6 -0
  51. package/browser/cjs/bS_BOH9cvVCFy36v.cjs +6 -0
  52. package/browser/cjs/dbUUj8LyIitsdYpk.cjs +6 -0
  53. package/browser/cjs/eZGLUWbfY3JdZRM5.cjs +6 -0
  54. package/browser/cjs/index.cjs +3 -4
  55. package/browser/cjs/mBk4Z4LZ65b3f58_.cjs +6 -0
  56. package/browser/cjs/rIOsSIPwxoXlIawS.cjs +6 -0
  57. package/browser/cjs/sMBG5eQ3-iacLXUm.cjs +6 -0
  58. package/browser/cjs/tShlMZrIxsGZSeHX.cjs +42 -0
  59. package/browser/cjs/xDqIifM_--oXscCV.cjs +6 -0
  60. package/browser/cjs/yBSdtSSuNERefFhR.cjs +15 -0
  61. package/browser/esm/4eRu4yzXkvCBip8J.mjs +10 -0
  62. package/browser/esm/73gcCsbqgbW3KIoA.mjs +1346 -0
  63. package/browser/esm/B383N9irNfyfYC2l.mjs +20 -0
  64. package/browser/esm/B4ji-HZTY0uvH8r7.mjs +10 -0
  65. package/browser/esm/B8TNpfJ8ymQcPriE.mjs +24 -0
  66. package/{cdn/assets/CiY3HumGDc_5bMtR.js → browser/esm/BBDu-GNDE7ZA-1sJ.mjs} +15 -17
  67. package/browser/esm/BF5nlSYZ38RJ0dPX.mjs +10 -0
  68. package/browser/esm/BHy77Km4i4t5U7ka.mjs +10 -0
  69. package/browser/esm/BIUVt79NHXdZx2Dz.mjs +10 -0
  70. package/browser/esm/BP6hA-zc0dMuMOIA.mjs +3755 -0
  71. package/browser/esm/BPen6C7JE2sWVgdi.mjs +10 -0
  72. package/browser/esm/BUqd1uVUNoWmepd2.mjs +148 -0
  73. package/browser/esm/BXABqQEa6kQQcjmt.mjs +820 -0
  74. package/browser/esm/BZxAttR2mi9td3k1.mjs +10 -0
  75. package/browser/esm/B_pEA9HeXKvEOCdS.mjs +10 -0
  76. package/browser/esm/BbW_1O3cEhZ4aSgS.mjs +55785 -0
  77. package/browser/esm/BdFNxdtES-3_yQ9R.mjs +421 -0
  78. package/browser/esm/BfFDvyaRcdKS0wPD.mjs +10 -0
  79. package/browser/esm/Bqqcb80cNalBs-sB.mjs +939 -0
  80. package/browser/esm/BrEcIDq0-c5AiQEf.mjs +21 -0
  81. package/browser/esm/BvYUsRgBXLSuaQ-S.mjs +10 -0
  82. package/browser/esm/BzE-61bmpRQzEVPt.mjs +10 -0
  83. package/browser/esm/C28AZ0Rwo79iGg0v.mjs +13208 -0
  84. package/browser/esm/C5GgK_mW25DZYw-I.mjs +2344 -0
  85. package/{cdn/assets/CfObTzh8pGdd8D23.js → browser/esm/CHjb5a2xwEWs4RgS.mjs} +505 -513
  86. package/browser/esm/CITPwlsNzJvv551I.mjs +10 -0
  87. package/browser/esm/CJiHNujoVUdO_G7X.mjs +46 -0
  88. package/browser/esm/CN73n4VDayKh_l1J.mjs +10 -0
  89. package/browser/esm/CcARDY0PFSWkqsG9.mjs +21 -0
  90. package/browser/esm/CeF0ZRfeSy83i80_.mjs +1575 -0
  91. package/browser/esm/Cmtx4dAVZrwq5cVO.mjs +10 -0
  92. package/browser/esm/Crza3kRJdEVylOfk.mjs +29 -0
  93. package/browser/esm/D3L89e08b7ewR6mt.mjs +21 -0
  94. package/browser/esm/D4G17ip9xxOX5jDd.mjs +3934 -0
  95. package/browser/esm/D9eVsUckA6bWBHni.mjs +10 -0
  96. package/browser/esm/DAscSzG63-mM5p50.mjs +41 -0
  97. package/browser/esm/DCyJNVtrh6kEt73Q.mjs +84 -0
  98. package/{cdn/assets/DWJE3K3jMKMTCi3o.js → browser/esm/DFwxjsVr4xKLPTGf.mjs} +65 -68
  99. package/browser/esm/DHPHhaCxihdR9Hl6.mjs +10 -0
  100. package/browser/esm/DKbJ-iVPuUbr3iZ_.mjs +47 -0
  101. package/browser/esm/DQLk_UmdpJBt-zZi.mjs +5582 -0
  102. package/browser/esm/DR7oVoNSe0FFWHOr.mjs +48 -0
  103. package/browser/esm/DVRMAeHUj0-TY-vK.mjs +10 -0
  104. package/browser/esm/DXIWAG-DUKHzNlRl.mjs +12 -0
  105. package/browser/esm/DbZJQpjZJIcz2ypV.mjs +39 -0
  106. package/browser/esm/Dft4BSeY0bp0A6z0.mjs +10 -0
  107. package/browser/esm/DgO85Q5iHe-ZmvtQ.mjs +633 -0
  108. package/browser/esm/DwRHGEuscm3FvnkM.mjs +1665 -0
  109. package/browser/esm/HyTvrvH0vItPFnFG.mjs +472 -0
  110. package/{cdn/assets/DgLPO_EQ9DYoGgec.js → browser/esm/Pkb6GWdyZdze_XAw.mjs} +174 -172
  111. package/browser/esm/QZikWr_NQfcFWCBV.mjs +44 -0
  112. package/browser/esm/aLv-xujBO4X6ilhV.mjs +10 -0
  113. package/{cdn/assets/DJQOS9qxVAlpgDMt.js → browser/esm/c9fba0RuWGogsH0X.mjs} +21 -23
  114. package/browser/esm/index.mjs +6 -2
  115. package/browser/esm/jkSJc6Omxbf-rPQY.mjs +10 -0
  116. package/browser/esm/uuCmCmYQQXgwyRSd.mjs +10 -0
  117. package/browser/esm/w3TGaFTjdsc4XTcz.mjs +1466 -0
  118. package/browser/esm/wV8riZWKJE7AoKQk.mjs +1365 -0
  119. package/browser/esm/wxvli1IH1NkfqE6-.mjs +10 -0
  120. package/cdn/assets/0fI22OQK5IczUH6s.js +29 -0
  121. package/cdn/assets/4eRu4yzXkvCBip8J.js +10 -0
  122. package/cdn/assets/5HYy7pIZxQRDUQl-.js +50 -0
  123. package/cdn/assets/6oc_f4xkoSmftsRd.js +22 -0
  124. package/cdn/assets/73gcCsbqgbW3KIoA.js +1346 -0
  125. package/cdn/assets/B3TPDOzYf_VRBIr6.js +2177 -0
  126. package/cdn/assets/B4HW_cy7gbE01jar.js +390 -0
  127. package/cdn/assets/B4ji-HZTY0uvH8r7.js +10 -0
  128. package/cdn/assets/B7Ky6m4VWP8vxhPt.js +1702 -0
  129. package/cdn/assets/B8TNpfJ8ymQcPriE.js +24 -0
  130. package/cdn/assets/BEfetwH6zTr6B51I.js +3755 -0
  131. package/cdn/assets/BF5nlSYZ38RJ0dPX.js +10 -0
  132. package/cdn/assets/BHy77Km4i4t5U7ka.js +10 -0
  133. package/cdn/assets/BIUVt79NHXdZx2Dz.js +10 -0
  134. package/cdn/assets/BPen6C7JE2sWVgdi.js +10 -0
  135. package/cdn/assets/BS1p7DgoyO-WkvB8.js +41 -0
  136. package/cdn/assets/BZxAttR2mi9td3k1.js +10 -0
  137. package/cdn/assets/B_pEA9HeXKvEOCdS.js +10 -0
  138. package/cdn/assets/BdFNxdtES-3_yQ9R.js +421 -0
  139. package/cdn/assets/BfFDvyaRcdKS0wPD.js +10 -0
  140. package/cdn/assets/{phYz0vGgqIEQ2hco.js → BiKaXKU3o287mgkN.js} +1 -1
  141. package/cdn/assets/BvYUsRgBXLSuaQ-S.js +10 -0
  142. package/cdn/assets/BzE-61bmpRQzEVPt.js +10 -0
  143. package/cdn/assets/C0yI-QYraFhnJUdD.js +49 -0
  144. package/cdn/assets/C28AZ0Rwo79iGg0v.js +13208 -0
  145. package/cdn/assets/{qA23x9VVBL9R4qxN.js → C3FTuqvfGalOVHql.js} +9 -9
  146. package/cdn/assets/{BSAH88RG1oubICau.js → C3W0xsNrt-Was9g-.js} +26 -26
  147. package/cdn/assets/C8rQWD8C7ccUHNZL.js +3934 -0
  148. package/cdn/assets/CITPwlsNzJvv551I.js +10 -0
  149. package/cdn/assets/CN73n4VDayKh_l1J.js +10 -0
  150. package/cdn/assets/CWkF-50YF43t7qge.js +472 -0
  151. package/cdn/assets/{Bv0Xb6DdcQbPYJKo.js → CaKPs_ILqLIWfUUN.js} +10 -11
  152. package/cdn/assets/CcARDY0PFSWkqsG9.js +21 -0
  153. package/cdn/assets/Cdx6LrqtHZKbwl63.js +425 -0
  154. package/cdn/assets/ChB-XZno7w9v221u.js +1575 -0
  155. package/cdn/assets/CkY7wM_4OGwZvJ4f.js +942 -0
  156. package/cdn/assets/Cmtx4dAVZrwq5cVO.js +10 -0
  157. package/cdn/assets/{dk2teWHDODYNarJY.js → CrBywNOOyPHSBoTT.js} +4 -4
  158. package/cdn/assets/D9eVsUckA6bWBHni.js +10 -0
  159. package/cdn/assets/DBpku3D2DSTmW4II.js +820 -0
  160. package/cdn/assets/DEOxG6u6itV8bGym.js +2346 -0
  161. package/cdn/assets/DHPHhaCxihdR9Hl6.js +10 -0
  162. package/cdn/assets/DMWARnjq06oQnfrL.js +58 -0
  163. package/cdn/assets/{BoOefjrM4kZ-YXxa.js → DRa6yXWuTlAjuaKT.js} +2 -2
  164. package/cdn/assets/DVRMAeHUj0-TY-vK.js +10 -0
  165. package/cdn/assets/DXIWAG-DUKHzNlRl.js +12 -0
  166. package/cdn/assets/{B3kbBB6oxKBErwzn.js → DYowHOSLHcADsXuK.js} +3 -3
  167. package/cdn/assets/{DkS6quwH1okWaho6.js → DZNoPrlxULASVlOi.js} +14 -14
  168. package/cdn/assets/{BB66NDz7S3ocEfRB.js → DaUJajqmQYuM0Gew.js} +51 -51
  169. package/cdn/assets/DcdQwhlGoI1knRUy.js +46 -0
  170. package/cdn/assets/Dft4BSeY0bp0A6z0.js +10 -0
  171. package/cdn/assets/DgO85Q5iHe-ZmvtQ.js +633 -0
  172. package/cdn/assets/{DDW1WJ2IM_9ZUfKm.js → Dm0hrXCbV7DITOhi.js} +2 -2
  173. package/cdn/assets/DnWjhq4ZlgIuFcii.js +21 -0
  174. package/cdn/assets/DwRHGEuscm3FvnkM.js +1665 -0
  175. package/cdn/assets/{BT5EcMEFBsphczwC.js → DzyNujjbHLXo9UmH.js} +565 -568
  176. package/cdn/assets/EYTSqAG9YOdb1vKx.js +48823 -0
  177. package/cdn/assets/{D_5RgqgwXsoqLJDR.js → Ux2jUY_EwSsYBCov.js} +1 -1
  178. package/cdn/assets/{DfmaL8DmDaFAv8M_.js → XoKiuP2ZFq0cNGkH.js} +4 -4
  179. package/cdn/assets/Zi3E5Kzxw2FPtLVL.js +5582 -0
  180. package/cdn/assets/aLv-xujBO4X6ilhV.js +10 -0
  181. package/cdn/assets/jkSJc6Omxbf-rPQY.js +10 -0
  182. package/cdn/assets/uuCmCmYQQXgwyRSd.js +10 -0
  183. package/cdn/assets/wV8riZWKJE7AoKQk.js +1365 -0
  184. package/cdn/assets/wxvli1IH1NkfqE6-.js +10 -0
  185. package/cdn/index.js +2 -2
  186. package/cdn/loader.js +1 -1
  187. package/package.json +3 -5
  188. package/types/index.d.ts +1 -0
  189. package/browser/cjs/B35OZ0mE8aINQPP9.cjs +0 -7
  190. package/browser/cjs/BPzEQNENF-gEBkg9.cjs +0 -7
  191. package/browser/cjs/BUokV6yuzE-_8MyK.cjs +0 -7
  192. package/browser/cjs/BeZHmOKfa37mFNAu.cjs +0 -7
  193. package/browser/cjs/BflJ_0gT9lQtDvY_.cjs +0 -7
  194. package/browser/cjs/BwN8vKi5o3-PbIMo.cjs +0 -7
  195. package/browser/cjs/C3OizZPVuxO2fjSG.cjs +0 -7
  196. package/browser/cjs/CBL6KkiWI2RPflEN.cjs +0 -7
  197. package/browser/cjs/CN6-6xpZMpFqSS8M.cjs +0 -7
  198. package/browser/cjs/CTrEV_UpxC0W6cZZ.cjs +0 -7
  199. package/browser/cjs/CU30GVjjFXl44vEU.cjs +0 -7
  200. package/browser/cjs/CZWBxvUXzfpn_zmc.cjs +0 -7
  201. package/browser/cjs/Ccs2ouvlLekaLGH0.cjs +0 -7
  202. package/browser/cjs/Ce-8L4Viq3I_6j0i.cjs +0 -7
  203. package/browser/cjs/CtNjLzIHB8WX63Bl.cjs +0 -7
  204. package/browser/cjs/DAHpsyykuPBkoh-Z.cjs +0 -7
  205. package/browser/cjs/DJbKKxeeTEHHA1gR.cjs +0 -107
  206. package/browser/cjs/D_VQzwC1zzTJyKtG.cjs +0 -7
  207. package/browser/cjs/GrsZZ_mEdsM5dEMA.cjs +0 -7
  208. package/browser/cjs/JKEGlXjMwGnXk_Gv.cjs +0 -7
  209. package/browser/cjs/L1iE_VcelYZIy0wI.cjs +0 -7
  210. package/browser/cjs/Q_VvA-yUQx3xFKiJ.cjs +0 -7
  211. package/browser/cjs/fTGpiXzFm3K_u2Fm.cjs +0 -7
  212. package/browser/cjs/hwDUzorB6aCvH1eL.cjs +0 -7
  213. package/browser/cjs/no5c2H18QD2qmOH6.cjs +0 -7
  214. package/browser/esm/B4Mm5gczpI_k2zzN.mjs +0 -7
  215. package/browser/esm/B8ISUdOxsJMYWzNN.mjs +0 -7
  216. package/browser/esm/BnJiF38TGudjoHzT.mjs +0 -7
  217. package/browser/esm/Bts4nCgfCAUpTfxz.mjs +0 -7
  218. package/browser/esm/C3cyAbIH8Qc8MIFN.mjs +0 -107
  219. package/browser/esm/C4jlaVv8bELgiHyE.mjs +0 -7
  220. package/browser/esm/CYIhGb86r-kKOrP5.mjs +0 -7
  221. package/browser/esm/CcpskguvlvemArQn.mjs +0 -7
  222. package/browser/esm/CeRfALx1iU5fqOUg.mjs +0 -7
  223. package/browser/esm/CfYWmP_Hots5f0f6.mjs +0 -7
  224. package/browser/esm/CkarbqNx_lhlBnw7.mjs +0 -7
  225. package/browser/esm/D2PlWNQjrTgf6GuR.mjs +0 -7
  226. package/browser/esm/D3KNxvnrwR6_fTJE.mjs +0 -7
  227. package/browser/esm/DIJyH94oCzUnlcNZ.mjs +0 -7
  228. package/browser/esm/DVAG1NxFe3cMjLE1.mjs +0 -7
  229. package/browser/esm/DVqga7g7j0FUiM6p.mjs +0 -7
  230. package/browser/esm/DcX8yGEBX6qi9RCe.mjs +0 -7
  231. package/browser/esm/DeXfOSxGE_Ez7DZq.mjs +0 -7
  232. package/browser/esm/DzgM_rkwyIHsCb6I.mjs +0 -7
  233. package/browser/esm/M4hZ25330e96seUM.mjs +0 -7
  234. package/browser/esm/Qp2Toeh_EbJH_f_6.mjs +0 -7
  235. package/browser/esm/SAyRTPVprOHZ8Up8.mjs +0 -7
  236. package/browser/esm/_ft7JYO6QdDbIu3d.mjs +0 -7
  237. package/browser/esm/dpdy0BU4GGI5lZrX.mjs +0 -7
  238. package/browser/esm/oLCocGFRAwsVsOSE.mjs +0 -7
  239. package/cdn/assets/7_O6nILzn1fSVvkO.js +0 -13449
  240. package/cdn/assets/BCK7yhx9JfzU2rF0.js +0 -22
  241. package/cdn/assets/BcWoqhD_sX85c7Mh.js +0 -1701
  242. package/cdn/assets/BtweFYnoj_aEfydW.js +0 -1371
  243. package/cdn/assets/CC-S4NMYhLg3WgqO.js +0 -3875
  244. package/cdn/assets/CJhyHcQcrhbtC33r.js +0 -50
  245. package/cdn/assets/CUc6gRjjRGTFWSHD.js +0 -50
  246. package/cdn/assets/CpPLN0-hDsTIFHZV.js +0 -46
  247. package/cdn/assets/Cq94woVmlxhjWVRI.js +0 -21
  248. package/cdn/assets/CsjftXmSYQRHNKdq.js +0 -41
  249. package/cdn/assets/DBL4jY0AVc53RGNm.js +0 -637
  250. package/cdn/assets/DxMu6URURFWj9aXM.js +0 -2373
  251. package/cdn/assets/Jhm2DAcrfAqiM-Y-.js +0 -26490
  252. package/cdn/assets/MRBi3juXAW0lA_mj.js +0 -1358
@@ -1,637 +0,0 @@
1
- /**
2
- * @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.12
3
- *
4
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- function S(t) {
8
- return Array.isArray ? Array.isArray(t) : ne(t) === "[object Array]";
9
- }
10
- function v(t) {
11
- return typeof t == "string";
12
- }
13
- function te(t) {
14
- return typeof t == "number";
15
- }
16
- function ae(t) {
17
- return t === !0 || t === !1 || function(e) {
18
- return ie(e) && e !== null;
19
- }(t) && ne(t) == "[object Boolean]";
20
- }
21
- function ie(t) {
22
- return typeof t == "object";
23
- }
24
- function E(t) {
25
- return t != null;
26
- }
27
- function K(t) {
28
- return !t.trim().length;
29
- }
30
- function ne(t) {
31
- return t == null ? t === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(t);
32
- }
33
- const H = Object.prototype.hasOwnProperty;
34
- class le {
35
- constructor(e) {
36
- this._keys = [], this._keyMap = {};
37
- let i = 0;
38
- e.forEach((s) => {
39
- let n = se(s);
40
- this._keys.push(n), this._keyMap[n.id] = n, i += n.weight;
41
- }), this._keys.forEach((s) => {
42
- s.weight /= i;
43
- });
44
- }
45
- get(e) {
46
- return this._keyMap[e];
47
- }
48
- keys() {
49
- return this._keys;
50
- }
51
- toJSON() {
52
- return JSON.stringify(this._keys);
53
- }
54
- }
55
- function se(t) {
56
- let e = null, i = null, s = null, n = 1, u = null;
57
- if (v(t) || S(t)) s = t, e = T(t), i = q(t);
58
- else {
59
- if (!H.call(t, "name")) throw new Error("Missing name property in key");
60
- const c = t.name;
61
- if (s = c, H.call(t, "weight") && (n = t.weight, n <= 0)) throw new Error(((o) => `Property 'weight' in key '${o}' must be a positive integer`)(c));
62
- e = T(c), i = q(c), u = t.getFn;
63
- }
64
- return { path: e, id: i, weight: n, src: s, getFn: u };
65
- }
66
- function T(t) {
67
- return S(t) ? t : t.split(".");
68
- }
69
- function q(t) {
70
- return S(t) ? t.join(".") : t;
71
- }
72
- var l = { isCaseSensitive: !1, ignoreDiacritics: !1, includeScore: !1, keys: [], shouldSort: !0, sortFn: (t, e) => t.score === e.score ? t.idx < e.idx ? -1 : 1 : t.score < e.score ? -1 : 1, includeMatches: !1, findAllMatches: !1, minMatchCharLength: 1, location: 0, threshold: 0.6, distance: 100, useExtendedSearch: !1, getFn: function(t, e) {
73
- let i = [], s = !1;
74
- const n = (u, c, o) => {
75
- if (E(u)) if (c[o]) {
76
- const r = u[c[o]];
77
- if (!E(r)) return;
78
- if (o === c.length - 1 && (v(r) || te(r) || ae(r))) i.push(function(a) {
79
- return a == null ? "" : function(h) {
80
- if (typeof h == "string") return h;
81
- let d = h + "";
82
- return d == "0" && 1 / h == -1 / 0 ? "-0" : d;
83
- }(a);
84
- }(r));
85
- else if (S(r)) {
86
- s = !0;
87
- for (let a = 0, h = r.length; a < h; a += 1) n(r[a], c, o + 1);
88
- } else c.length && n(r, c, o + 1);
89
- } else i.push(u);
90
- };
91
- return n(t, v(e) ? e.split(".") : e, 0), s ? i : i[0];
92
- }, ignoreLocation: !1, ignoreFieldNorm: !1, fieldNormWeight: 1 };
93
- const de = /[^ ]+/g;
94
- class U {
95
- constructor({ getFn: e = l.getFn, fieldNormWeight: i = l.fieldNormWeight } = {}) {
96
- this.norm = function(s = 1, n = 3) {
97
- const u = /* @__PURE__ */ new Map(), c = Math.pow(10, n);
98
- return { get(o) {
99
- const r = o.match(de).length;
100
- if (u.has(r)) return u.get(r);
101
- const a = 1 / Math.pow(r, 0.5 * s), h = parseFloat(Math.round(a * c) / c);
102
- return u.set(r, h), h;
103
- }, clear() {
104
- u.clear();
105
- } };
106
- }(i, 3), this.getFn = e, this.isCreated = !1, this.setIndexRecords();
107
- }
108
- setSources(e = []) {
109
- this.docs = e;
110
- }
111
- setIndexRecords(e = []) {
112
- this.records = e;
113
- }
114
- setKeys(e = []) {
115
- this.keys = e, this._keysMap = {}, e.forEach((i, s) => {
116
- this._keysMap[i.id] = s;
117
- });
118
- }
119
- create() {
120
- !this.isCreated && this.docs.length && (this.isCreated = !0, v(this.docs[0]) ? this.docs.forEach((e, i) => {
121
- this._addString(e, i);
122
- }) : this.docs.forEach((e, i) => {
123
- this._addObject(e, i);
124
- }), this.norm.clear());
125
- }
126
- add(e) {
127
- const i = this.size();
128
- v(e) ? this._addString(e, i) : this._addObject(e, i);
129
- }
130
- removeAt(e) {
131
- this.records.splice(e, 1);
132
- for (let i = e, s = this.size(); i < s; i += 1) this.records[i].i -= 1;
133
- }
134
- getValueForItemAtKeyId(e, i) {
135
- return e[this._keysMap[i]];
136
- }
137
- size() {
138
- return this.records.length;
139
- }
140
- _addString(e, i) {
141
- if (!E(e) || K(e)) return;
142
- let s = { v: e, i, n: this.norm.get(e) };
143
- this.records.push(s);
144
- }
145
- _addObject(e, i) {
146
- let s = { i, $: {} };
147
- this.keys.forEach((n, u) => {
148
- let c = n.getFn ? n.getFn(e) : this.getFn(e, n.path);
149
- if (E(c)) {
150
- if (S(c)) {
151
- let o = [];
152
- const r = [{ nestedArrIndex: -1, value: c }];
153
- for (; r.length; ) {
154
- const { nestedArrIndex: a, value: h } = r.pop();
155
- if (E(h)) if (v(h) && !K(h)) {
156
- let d = { v: h, i: a, n: this.norm.get(h) };
157
- o.push(d);
158
- } else S(h) && h.forEach((d, f) => {
159
- r.push({ nestedArrIndex: f, value: d });
160
- });
161
- }
162
- s.$[u] = o;
163
- } else if (v(c) && !K(c)) {
164
- let o = { v: c, n: this.norm.get(c) };
165
- s.$[u] = o;
166
- }
167
- }
168
- }), this.records.push(s);
169
- }
170
- toJSON() {
171
- return { keys: this.keys, records: this.records };
172
- }
173
- }
174
- function re(t, e, { getFn: i = l.getFn, fieldNormWeight: s = l.fieldNormWeight } = {}) {
175
- const n = new U({ getFn: i, fieldNormWeight: s });
176
- return n.setKeys(t.map(se)), n.setSources(e), n.create(), n;
177
- }
178
- function j(t, { errors: e = 0, currentLocation: i = 0, expectedLocation: s = 0, distance: n = l.distance, ignoreLocation: u = l.ignoreLocation } = {}) {
179
- const c = e / t.length;
180
- if (u) return c;
181
- const o = Math.abs(s - i);
182
- return n ? c + o / n : o ? 1 : c;
183
- }
184
- const N = 32;
185
- function ge(t, e, i, { location: s = l.location, distance: n = l.distance, threshold: u = l.threshold, findAllMatches: c = l.findAllMatches, minMatchCharLength: o = l.minMatchCharLength, includeMatches: r = l.includeMatches, ignoreLocation: a = l.ignoreLocation } = {}) {
186
- if (e.length > N) throw new Error("Pattern length exceeds max of 32.");
187
- const h = e.length, d = t.length, f = Math.max(0, Math.min(s, d));
188
- let g = u, A = f;
189
- const p = o > 1 || r, m = p ? Array(d) : [];
190
- let F;
191
- for (; (F = t.indexOf(e, A)) > -1; ) {
192
- let y = j(e, { currentLocation: F, expectedLocation: f, distance: n, ignoreLocation: a });
193
- if (g = Math.min(y, g), A = F + h, p) {
194
- let B = 0;
195
- for (; B < h; ) m[F + B] = 1, B += 1;
196
- }
197
- }
198
- A = -1;
199
- let L = [], D = 1, M = h + d;
200
- const w = 1 << h - 1;
201
- for (let y = 0; y < h; y += 1) {
202
- let B = 0, k = M;
203
- for (; B < k; ) j(e, { errors: y, currentLocation: f + k, expectedLocation: f, distance: n, ignoreLocation: a }) <= g ? B = k : M = k, k = Math.floor((M - B) / 2 + B);
204
- M = k;
205
- let $ = Math.max(1, f - k + 1), x = c ? d : Math.min(f + k, d) + h, _ = Array(x + 2);
206
- _[x + 1] = (1 << y) - 1;
207
- for (let C = x; C >= $; C -= 1) {
208
- let b = C - 1, R = i[t.charAt(b)];
209
- if (p && (m[b] = +!!R), _[C] = (_[C + 1] << 1 | 1) & R, y && (_[C] |= (L[C + 1] | L[C]) << 1 | 1 | L[C + 1]), _[C] & w && (D = j(e, { errors: y, currentLocation: b, expectedLocation: f, distance: n, ignoreLocation: a }), D <= g)) {
210
- if (g = D, A = b, A <= f) break;
211
- $ = Math.max(1, 2 * f - A);
212
- }
213
- }
214
- if (j(e, { errors: y + 1, currentLocation: f, expectedLocation: f, distance: n, ignoreLocation: a }) > g) break;
215
- L = _;
216
- }
217
- const z = { isMatch: A >= 0, score: Math.max(1e-3, D) };
218
- if (p) {
219
- const y = function(B = [], k = l.minMatchCharLength) {
220
- let $ = [], x = -1, _ = -1, C = 0;
221
- for (let b = B.length; C < b; C += 1) {
222
- let R = B[C];
223
- R && x === -1 ? x = C : R || x === -1 || (_ = C - 1, _ - x + 1 >= k && $.push([x, _]), x = -1);
224
- }
225
- return B[C - 1] && C - x >= k && $.push([x, C - 1]), $;
226
- }(m, o);
227
- y.length ? r && (z.indices = y) : z.isMatch = !1;
228
- }
229
- return z;
230
- }
231
- function fe(t) {
232
- let e = {};
233
- for (let i = 0, s = t.length; i < s; i += 1) {
234
- const n = t.charAt(i);
235
- e[n] = (e[n] || 0) | 1 << s - i - 1;
236
- }
237
- return e;
238
- }
239
- const W = String.prototype.normalize ? (t) => t.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, "") : (t) => t;
240
- class ue {
241
- constructor(e, { location: i = l.location, threshold: s = l.threshold, distance: n = l.distance, includeMatches: u = l.includeMatches, findAllMatches: c = l.findAllMatches, minMatchCharLength: o = l.minMatchCharLength, isCaseSensitive: r = l.isCaseSensitive, ignoreDiacritics: a = l.ignoreDiacritics, ignoreLocation: h = l.ignoreLocation } = {}) {
242
- if (this.options = { location: i, threshold: s, distance: n, includeMatches: u, findAllMatches: c, minMatchCharLength: o, isCaseSensitive: r, ignoreDiacritics: a, ignoreLocation: h }, e = r ? e : e.toLowerCase(), e = a ? W(e) : e, this.pattern = e, this.chunks = [], !this.pattern.length) return;
243
- const d = (g, A) => {
244
- this.chunks.push({ pattern: g, alphabet: fe(g), startIndex: A });
245
- }, f = this.pattern.length;
246
- if (f > N) {
247
- let g = 0;
248
- const A = f % N, p = f - A;
249
- for (; g < p; ) d(this.pattern.substr(g, N), g), g += N;
250
- if (A) {
251
- const m = f - N;
252
- d(this.pattern.substr(m), m);
253
- }
254
- } else d(this.pattern, 0);
255
- }
256
- searchIn(e) {
257
- const { isCaseSensitive: i, ignoreDiacritics: s, includeMatches: n } = this.options;
258
- if (e = i ? e : e.toLowerCase(), e = s ? W(e) : e, this.pattern === e) {
259
- let p = { isMatch: !0, score: 0 };
260
- return n && (p.indices = [[0, e.length - 1]]), p;
261
- }
262
- const { location: u, distance: c, threshold: o, findAllMatches: r, minMatchCharLength: a, ignoreLocation: h } = this.options;
263
- let d = [], f = 0, g = !1;
264
- this.chunks.forEach(({ pattern: p, alphabet: m, startIndex: F }) => {
265
- const { isMatch: L, score: D, indices: M } = ge(e, p, m, { location: u + F, distance: c, threshold: o, findAllMatches: r, minMatchCharLength: a, includeMatches: n, ignoreLocation: h });
266
- L && (g = !0), f += D, L && M && (d = [...d, ...M]);
267
- });
268
- let A = { isMatch: g, score: g ? f / this.chunks.length : 1 };
269
- return g && n && (A.indices = d), A;
270
- }
271
- }
272
- class I {
273
- constructor(e) {
274
- this.pattern = e;
275
- }
276
- static isMultiMatch(e) {
277
- return X(e, this.multiRegex);
278
- }
279
- static isSingleMatch(e) {
280
- return X(e, this.singleRegex);
281
- }
282
- search() {
283
- }
284
- }
285
- function X(t, e) {
286
- const i = t.match(e);
287
- return i ? i[1] : null;
288
- }
289
- class ce extends I {
290
- constructor(e, { location: i = l.location, threshold: s = l.threshold, distance: n = l.distance, includeMatches: u = l.includeMatches, findAllMatches: c = l.findAllMatches, minMatchCharLength: o = l.minMatchCharLength, isCaseSensitive: r = l.isCaseSensitive, ignoreDiacritics: a = l.ignoreDiacritics, ignoreLocation: h = l.ignoreLocation } = {}) {
291
- super(e), this._bitapSearch = new ue(e, { location: i, threshold: s, distance: n, includeMatches: u, findAllMatches: c, minMatchCharLength: o, isCaseSensitive: r, ignoreDiacritics: a, ignoreLocation: h });
292
- }
293
- static get type() {
294
- return "fuzzy";
295
- }
296
- static get multiRegex() {
297
- return /^"(.*)"$/;
298
- }
299
- static get singleRegex() {
300
- return /^(.*)$/;
301
- }
302
- search(e) {
303
- return this._bitapSearch.searchIn(e);
304
- }
305
- }
306
- class oe extends I {
307
- constructor(e) {
308
- super(e);
309
- }
310
- static get type() {
311
- return "include";
312
- }
313
- static get multiRegex() {
314
- return /^'"(.*)"$/;
315
- }
316
- static get singleRegex() {
317
- return /^'(.*)$/;
318
- }
319
- search(e) {
320
- let i, s = 0;
321
- const n = [], u = this.pattern.length;
322
- for (; (i = e.indexOf(this.pattern, s)) > -1; ) s = i + u, n.push([i, s - 1]);
323
- const c = !!n.length;
324
- return { isMatch: c, score: c ? 0 : 1, indices: n };
325
- }
326
- }
327
- const J = [class extends I {
328
- constructor(t) {
329
- super(t);
330
- }
331
- static get type() {
332
- return "exact";
333
- }
334
- static get multiRegex() {
335
- return /^="(.*)"$/;
336
- }
337
- static get singleRegex() {
338
- return /^=(.*)$/;
339
- }
340
- search(t) {
341
- const e = t === this.pattern;
342
- return { isMatch: e, score: e ? 0 : 1, indices: [0, this.pattern.length - 1] };
343
- }
344
- }, oe, class extends I {
345
- constructor(t) {
346
- super(t);
347
- }
348
- static get type() {
349
- return "prefix-exact";
350
- }
351
- static get multiRegex() {
352
- return /^\^"(.*)"$/;
353
- }
354
- static get singleRegex() {
355
- return /^\^(.*)$/;
356
- }
357
- search(t) {
358
- const e = t.startsWith(this.pattern);
359
- return { isMatch: e, score: e ? 0 : 1, indices: [0, this.pattern.length - 1] };
360
- }
361
- }, class extends I {
362
- constructor(t) {
363
- super(t);
364
- }
365
- static get type() {
366
- return "inverse-prefix-exact";
367
- }
368
- static get multiRegex() {
369
- return /^!\^"(.*)"$/;
370
- }
371
- static get singleRegex() {
372
- return /^!\^(.*)$/;
373
- }
374
- search(t) {
375
- const e = !t.startsWith(this.pattern);
376
- return { isMatch: e, score: e ? 0 : 1, indices: [0, t.length - 1] };
377
- }
378
- }, class extends I {
379
- constructor(t) {
380
- super(t);
381
- }
382
- static get type() {
383
- return "inverse-suffix-exact";
384
- }
385
- static get multiRegex() {
386
- return /^!"(.*)"\$$/;
387
- }
388
- static get singleRegex() {
389
- return /^!(.*)\$$/;
390
- }
391
- search(t) {
392
- const e = !t.endsWith(this.pattern);
393
- return { isMatch: e, score: e ? 0 : 1, indices: [0, t.length - 1] };
394
- }
395
- }, class extends I {
396
- constructor(t) {
397
- super(t);
398
- }
399
- static get type() {
400
- return "suffix-exact";
401
- }
402
- static get multiRegex() {
403
- return /^"(.*)"\$$/;
404
- }
405
- static get singleRegex() {
406
- return /^(.*)\$$/;
407
- }
408
- search(t) {
409
- const e = t.endsWith(this.pattern);
410
- return { isMatch: e, score: e ? 0 : 1, indices: [t.length - this.pattern.length, t.length - 1] };
411
- }
412
- }, class extends I {
413
- constructor(t) {
414
- super(t);
415
- }
416
- static get type() {
417
- return "inverse-exact";
418
- }
419
- static get multiRegex() {
420
- return /^!"(.*)"$/;
421
- }
422
- static get singleRegex() {
423
- return /^!(.*)$/;
424
- }
425
- search(t) {
426
- const e = t.indexOf(this.pattern) === -1;
427
- return { isMatch: e, score: e ? 0 : 1, indices: [0, t.length - 1] };
428
- }
429
- }, ce], Y = J.length, Ae = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/, pe = /* @__PURE__ */ new Set([ce.type, oe.type]), V = [];
430
- function Q(t, e) {
431
- for (let i = 0, s = V.length; i < s; i += 1) {
432
- let n = V[i];
433
- if (n.condition(t, e)) return new n(t, e);
434
- }
435
- return new ue(t, e);
436
- }
437
- const G = "$and", Z = "$path", P = (t) => !(!t[G] && !t.$or), ee = (t) => ({ [G]: Object.keys(t).map((e) => ({ [e]: t[e] })) });
438
- function he(t, e, { auto: i = !0 } = {}) {
439
- const s = (n) => {
440
- let u = Object.keys(n);
441
- const c = ((r) => !!r[Z])(n);
442
- if (!c && u.length > 1 && !P(n)) return s(ee(n));
443
- if (((r) => !S(r) && ie(r) && !P(r))(n)) {
444
- const r = c ? n[Z] : u[0], a = c ? n.$val : n[r];
445
- if (!v(a)) throw new Error(((d) => `Invalid value for key ${d}`)(r));
446
- const h = { keyId: q(r), pattern: a };
447
- return i && (h.searcher = Q(a, e)), h;
448
- }
449
- let o = { children: [], operator: u[0] };
450
- return u.forEach((r) => {
451
- const a = n[r];
452
- S(a) && a.forEach((h) => {
453
- o.children.push(s(h));
454
- });
455
- }), o;
456
- };
457
- return P(t) || (t = ee(t)), s(t);
458
- }
459
- function Ce(t, e) {
460
- const i = t.matches;
461
- e.matches = [], E(i) && i.forEach((s) => {
462
- if (!E(s.indices) || !s.indices.length) return;
463
- const { indices: n, value: u } = s;
464
- let c = { indices: n, value: u };
465
- s.key && (c.key = s.key.src), s.idx > -1 && (c.refIndex = s.idx), e.matches.push(c);
466
- });
467
- }
468
- function me(t, e) {
469
- e.score = t.score;
470
- }
471
- class O {
472
- constructor(e, i = {}, s) {
473
- this.options = { ...l, ...i }, this.options.useExtendedSearch, this._keyStore = new le(this.options.keys), this.setCollection(e, s);
474
- }
475
- setCollection(e, i) {
476
- if (this._docs = e, i && !(i instanceof U)) throw new Error("Incorrect 'index' type");
477
- this._myIndex = i || re(this.options.keys, this._docs, { getFn: this.options.getFn, fieldNormWeight: this.options.fieldNormWeight });
478
- }
479
- add(e) {
480
- E(e) && (this._docs.push(e), this._myIndex.add(e));
481
- }
482
- remove(e = () => !1) {
483
- const i = [];
484
- for (let s = 0, n = this._docs.length; s < n; s += 1) {
485
- const u = this._docs[s];
486
- e(u, s) && (this.removeAt(s), s -= 1, n -= 1, i.push(u));
487
- }
488
- return i;
489
- }
490
- removeAt(e) {
491
- this._docs.splice(e, 1), this._myIndex.removeAt(e);
492
- }
493
- getIndex() {
494
- return this._myIndex;
495
- }
496
- search(e, { limit: i = -1 } = {}) {
497
- const { includeMatches: s, includeScore: n, shouldSort: u, sortFn: c, ignoreFieldNorm: o } = this.options;
498
- let r = v(e) ? v(this._docs[0]) ? this._searchStringList(e) : this._searchObjectList(e) : this._searchLogical(e);
499
- return function(a, { ignoreFieldNorm: h = l.ignoreFieldNorm }) {
500
- a.forEach((d) => {
501
- let f = 1;
502
- d.matches.forEach(({ key: g, norm: A, score: p }) => {
503
- const m = g ? g.weight : null;
504
- f *= Math.pow(p === 0 && m ? Number.EPSILON : p, (m || 1) * (h ? 1 : A));
505
- }), d.score = f;
506
- });
507
- }(r, { ignoreFieldNorm: o }), u && r.sort(c), te(i) && i > -1 && (r = r.slice(0, i)), function(a, h, { includeMatches: d = l.includeMatches, includeScore: f = l.includeScore } = {}) {
508
- const g = [];
509
- return d && g.push(Ce), f && g.push(me), a.map((A) => {
510
- const { idx: p } = A, m = { item: h[p], refIndex: p };
511
- return g.length && g.forEach((F) => {
512
- F(A, m);
513
- }), m;
514
- });
515
- }(r, this._docs, { includeMatches: s, includeScore: n });
516
- }
517
- _searchStringList(e) {
518
- const i = Q(e, this.options), { records: s } = this._myIndex, n = [];
519
- return s.forEach(({ v: u, i: c, n: o }) => {
520
- if (!E(u)) return;
521
- const { isMatch: r, score: a, indices: h } = i.searchIn(u);
522
- r && n.push({ item: u, idx: c, matches: [{ score: a, value: u, norm: o, indices: h }] });
523
- }), n;
524
- }
525
- _searchLogical(e) {
526
- const i = he(e, this.options), s = (o, r, a) => {
527
- if (!o.children) {
528
- const { keyId: d, searcher: f } = o, g = this._findMatches({ key: this._keyStore.get(d), value: this._myIndex.getValueForItemAtKeyId(r, d), searcher: f });
529
- return g && g.length ? [{ idx: a, item: r, matches: g }] : [];
530
- }
531
- const h = [];
532
- for (let d = 0, f = o.children.length; d < f; d += 1) {
533
- const g = o.children[d], A = s(g, r, a);
534
- if (A.length) h.push(...A);
535
- else if (o.operator === G) return [];
536
- }
537
- return h;
538
- }, n = this._myIndex.records, u = {}, c = [];
539
- return n.forEach(({ $: o, i: r }) => {
540
- if (E(o)) {
541
- let a = s(i, o, r);
542
- a.length && (u[r] || (u[r] = { idx: r, item: o, matches: [] }, c.push(u[r])), a.forEach(({ matches: h }) => {
543
- u[r].matches.push(...h);
544
- }));
545
- }
546
- }), c;
547
- }
548
- _searchObjectList(e) {
549
- const i = Q(e, this.options), { keys: s, records: n } = this._myIndex, u = [];
550
- return n.forEach(({ $: c, i: o }) => {
551
- if (!E(c)) return;
552
- let r = [];
553
- s.forEach((a, h) => {
554
- r.push(...this._findMatches({ key: a, value: c[h], searcher: i }));
555
- }), r.length && u.push({ idx: o, item: c, matches: r });
556
- }), u;
557
- }
558
- _findMatches({ key: e, value: i, searcher: s }) {
559
- if (!E(i)) return [];
560
- let n = [];
561
- if (S(i)) i.forEach(({ v: u, i: c, n: o }) => {
562
- if (!E(u)) return;
563
- const { isMatch: r, score: a, indices: h } = s.searchIn(u);
564
- r && n.push({ score: a, key: e, value: u, idx: c, norm: o, indices: h });
565
- });
566
- else {
567
- const { v: u, n: c } = i, { isMatch: o, score: r, indices: a } = s.searchIn(u);
568
- o && n.push({ score: r, key: e, value: u, norm: c, indices: a });
569
- }
570
- return n;
571
- }
572
- }
573
- O.version = "7.1.0", O.createIndex = re, O.parseIndex = function(t, { getFn: e = l.getFn, fieldNormWeight: i = l.fieldNormWeight } = {}) {
574
- const { keys: s, records: n } = t, u = new U({ getFn: e, fieldNormWeight: i });
575
- return u.setKeys(s), u.setIndexRecords(n), u;
576
- }, O.config = l, O.parseQuery = he, function(...t) {
577
- V.push(...t);
578
- }(class {
579
- constructor(t, { isCaseSensitive: e = l.isCaseSensitive, ignoreDiacritics: i = l.ignoreDiacritics, includeMatches: s = l.includeMatches, minMatchCharLength: n = l.minMatchCharLength, ignoreLocation: u = l.ignoreLocation, findAllMatches: c = l.findAllMatches, location: o = l.location, threshold: r = l.threshold, distance: a = l.distance } = {}) {
580
- this.query = null, this.options = { isCaseSensitive: e, ignoreDiacritics: i, includeMatches: s, minMatchCharLength: n, findAllMatches: c, ignoreLocation: u, location: o, threshold: r, distance: a }, t = e ? t : t.toLowerCase(), t = i ? W(t) : t, this.pattern = t, this.query = function(h, d = {}) {
581
- return h.split("|").map((f) => {
582
- let g = f.trim().split(Ae).filter((p) => p && !!p.trim()), A = [];
583
- for (let p = 0, m = g.length; p < m; p += 1) {
584
- const F = g[p];
585
- let L = !1, D = -1;
586
- for (; !L && ++D < Y; ) {
587
- const M = J[D];
588
- let w = M.isMultiMatch(F);
589
- w && (A.push(new M(w, d)), L = !0);
590
- }
591
- if (!L) for (D = -1; ++D < Y; ) {
592
- const M = J[D];
593
- let w = M.isSingleMatch(F);
594
- if (w) {
595
- A.push(new M(w, d));
596
- break;
597
- }
598
- }
599
- }
600
- return A;
601
- });
602
- }(this.pattern, this.options);
603
- }
604
- static condition(t, e) {
605
- return e.useExtendedSearch;
606
- }
607
- searchIn(t) {
608
- const e = this.query;
609
- if (!e) return { isMatch: !1, score: 1 };
610
- const { includeMatches: i, isCaseSensitive: s, ignoreDiacritics: n } = this.options;
611
- t = s ? t : t.toLowerCase(), t = n ? W(t) : t;
612
- let u = 0, c = [], o = 0;
613
- for (let r = 0, a = e.length; r < a; r += 1) {
614
- const h = e[r];
615
- c.length = 0, u = 0;
616
- for (let d = 0, f = h.length; d < f; d += 1) {
617
- const g = h[d], { isMatch: A, indices: p, score: m } = g.search(t);
618
- if (!A) {
619
- o = 0, u = 0, c.length = 0;
620
- break;
621
- }
622
- if (u += 1, o += m, i) {
623
- const F = g.constructor.type;
624
- pe.has(F) ? c = [...c, ...p] : c.push(p);
625
- }
626
- }
627
- if (u) {
628
- let d = { isMatch: !0, score: o / u };
629
- return i && (d.indices = c), d;
630
- }
631
- }
632
- return { isMatch: !1, score: 1 };
633
- }
634
- });
635
- export {
636
- O as default
637
- };