@velora-cms/server 0.11.0

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 (367) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +65 -0
  3. package/dist/admin-bundle/assets/__virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-Ng0fOpdU.js +1 -0
  4. package/dist/admin-bundle/assets/__virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-oc1i_iBU.js +9 -0
  5. package/dist/admin-bundle/assets/_virtual_mf-localSharedImportMap___mfe_internal__velora_admin__mf_owner__1-DOKdWYyj.js +1 -0
  6. package/dist/admin-bundle/assets/_virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare___mf_0_velora_mf_2_cms_mf_1_plugin_mf_2_sdk__loadShare__.js-C1-ZAxwO.js +2 -0
  7. package/dist/admin-bundle/assets/_virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react__loadShare__.js-BuUBskgj.js +9 -0
  8. package/dist/admin-bundle/assets/_virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DMaku-HC.js +9 -0
  9. package/dist/admin-bundle/assets/_virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js-DYfqn12F.js +1 -0
  10. package/dist/admin-bundle/assets/_virtual_mf___mfe_internal__velora_admin__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-BPoj3DC9.js +25 -0
  11. package/dist/admin-bundle/assets/content-trash.schema-DfXHkC-w.js +72 -0
  12. package/dist/admin-bundle/assets/hostInit--C4xK6nj.js +1 -0
  13. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  14. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  15. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  16. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  17. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  18. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  19. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  20. package/dist/admin-bundle/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  21. package/dist/admin-bundle/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  22. package/dist/admin-bundle/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  23. package/dist/admin-bundle/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  24. package/dist/admin-bundle/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  25. package/dist/admin-bundle/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  26. package/dist/admin-bundle/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  27. package/dist/admin-bundle/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  28. package/dist/admin-bundle/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  29. package/dist/admin-bundle/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  30. package/dist/admin-bundle/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  31. package/dist/admin-bundle/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  32. package/dist/admin-bundle/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  33. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-400-normal-CyU-ddYS.woff2 +0 -0
  34. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-400-normal-EA1o-u_Q.woff +0 -0
  35. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-500-normal-C4MQITzh.woff2 +0 -0
  36. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-500-normal-DPXcppbm.woff +0 -0
  37. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-600-normal-0pRdybE_.woff2 +0 -0
  38. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-arabic-600-normal-MJZ0liF5.woff +0 -0
  39. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-400-normal-Bo5KPYvw.woff2 +0 -0
  40. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-400-normal-CFZh1unN.woff +0 -0
  41. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-500-normal-BletK1Hp.woff +0 -0
  42. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-500-normal-Cd6jVIg7.woff2 +0 -0
  43. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-600-normal-Dk5eISD_.woff +0 -0
  44. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-600-normal-KrqB56Mw.woff2 +0 -0
  45. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-400-normal-BeVLg08x.woff +0 -0
  46. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-400-normal-BpLfq-63.woff2 +0 -0
  47. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-500-normal-Ck_W4G78.woff2 +0 -0
  48. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-500-normal-eJxPnL1P.woff +0 -0
  49. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-600-normal-DT29Q8HW.woff +0 -0
  50. package/dist/admin-bundle/assets/ibm-plex-sans-arabic-latin-ext-600-normal-DjDAeNQD.woff2 +0 -0
  51. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-400-normal-BTotfTJu.woff +0 -0
  52. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-400-normal-DZqxrq2p.woff2 +0 -0
  53. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-500-normal-ByOcLdNv.woff +0 -0
  54. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-500-normal-CocWQlwt.woff2 +0 -0
  55. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-600-normal-71GNu3SW.woff2 +0 -0
  56. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-600-normal-BGq0mW3O.woff +0 -0
  57. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-400-normal-Dsrv2Tcn.woff +0 -0
  58. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-400-normal-g30qAdWV.woff2 +0 -0
  59. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-500-normal-Cs5J6C77.woff2 +0 -0
  60. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-500-normal-DB5PtV2g.woff +0 -0
  61. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-600-normal-Bz0x94Yp.woff +0 -0
  62. package/dist/admin-bundle/assets/ibm-plex-sans-cyrillic-ext-600-normal-DUMzJB7m.woff2 +0 -0
  63. package/dist/admin-bundle/assets/ibm-plex-sans-greek-400-normal-D9ESIMu3.woff +0 -0
  64. package/dist/admin-bundle/assets/ibm-plex-sans-greek-400-normal-_efipK4i.woff2 +0 -0
  65. package/dist/admin-bundle/assets/ibm-plex-sans-greek-500-normal-CuWXN6rf.woff +0 -0
  66. package/dist/admin-bundle/assets/ibm-plex-sans-greek-500-normal-JMMifIXV.woff2 +0 -0
  67. package/dist/admin-bundle/assets/ibm-plex-sans-greek-600-normal-D-CqTdkO.woff +0 -0
  68. package/dist/admin-bundle/assets/ibm-plex-sans-greek-600-normal-DzTrcv_p.woff2 +0 -0
  69. package/dist/admin-bundle/assets/ibm-plex-sans-latin-400-normal-CDDApCn2.woff2 +0 -0
  70. package/dist/admin-bundle/assets/ibm-plex-sans-latin-400-normal-CYLoc0-x.woff +0 -0
  71. package/dist/admin-bundle/assets/ibm-plex-sans-latin-500-normal-6ng42L7E.woff2 +0 -0
  72. package/dist/admin-bundle/assets/ibm-plex-sans-latin-500-normal-BgVn5rGT.woff +0 -0
  73. package/dist/admin-bundle/assets/ibm-plex-sans-latin-600-normal-Cu4Hd6ag.woff +0 -0
  74. package/dist/admin-bundle/assets/ibm-plex-sans-latin-600-normal-CuJfVYMP.woff2 +0 -0
  75. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-400-normal-C5H60-Va.woff2 +0 -0
  76. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-400-normal-RBey6euL.woff +0 -0
  77. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-500-normal-D0aIdm-b.woff +0 -0
  78. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-500-normal-DakdToA3.woff2 +0 -0
  79. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-600-normal-DIrixKbi.woff +0 -0
  80. package/dist/admin-bundle/assets/ibm-plex-sans-latin-ext-600-normal-DOrvGEcy.woff2 +0 -0
  81. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-400-normal-DG4YqDda.woff2 +0 -0
  82. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-400-normal-fK1oJ5dG.woff +0 -0
  83. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-500-normal-BEb3_waV.woff +0 -0
  84. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-500-normal-e4dixQRQ.woff2 +0 -0
  85. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-600-normal-DgdngZtN.woff +0 -0
  86. package/dist/admin-bundle/assets/ibm-plex-sans-vietnamese-600-normal-DpPYBSTl.woff2 +0 -0
  87. package/dist/admin-bundle/assets/index-BIAF0ShP.js +542 -0
  88. package/dist/admin-bundle/assets/index-DhMY-0sC.js +148 -0
  89. package/dist/admin-bundle/assets/index-DnZV_gsg.css +1 -0
  90. package/dist/admin-bundle/assets/index-Do71v6NZ.js +7 -0
  91. package/dist/admin-bundle/assets/literata-cyrillic-ext-opsz-italic-5yUt4G_9.woff2 +0 -0
  92. package/dist/admin-bundle/assets/literata-cyrillic-ext-opsz-normal-C5tfwALZ.woff2 +0 -0
  93. package/dist/admin-bundle/assets/literata-cyrillic-opsz-italic-Bj0ndbyp.woff2 +0 -0
  94. package/dist/admin-bundle/assets/literata-cyrillic-opsz-normal-DgmypKXX.woff2 +0 -0
  95. package/dist/admin-bundle/assets/literata-greek-ext-opsz-italic-DFpO5j-Z.woff2 +0 -0
  96. package/dist/admin-bundle/assets/literata-greek-ext-opsz-normal-DGm64vGR.woff2 +0 -0
  97. package/dist/admin-bundle/assets/literata-greek-opsz-italic-CHERNRFq.woff2 +0 -0
  98. package/dist/admin-bundle/assets/literata-greek-opsz-normal-DFglUmAd.woff2 +0 -0
  99. package/dist/admin-bundle/assets/literata-latin-ext-opsz-italic-4y8iAqqs.woff2 +0 -0
  100. package/dist/admin-bundle/assets/literata-latin-ext-opsz-normal-STiTPs0F.woff2 +0 -0
  101. package/dist/admin-bundle/assets/literata-latin-opsz-italic-CJ93D38p.woff2 +0 -0
  102. package/dist/admin-bundle/assets/literata-latin-opsz-normal-BHZsWIlc.woff2 +0 -0
  103. package/dist/admin-bundle/assets/literata-vietnamese-opsz-italic-BdcrZMcO.woff2 +0 -0
  104. package/dist/admin-bundle/assets/literata-vietnamese-opsz-normal-Gqw5JQlq.woff2 +0 -0
  105. package/dist/admin-bundle/assets/mf-entry-bootstrap-0-aef015cd.js +41 -0
  106. package/dist/admin-bundle/assets/remoteEntry-CNyN68bc.js +14 -0
  107. package/dist/admin-bundle/assets/virtualExposes-BDCSo5OS.js +1 -0
  108. package/dist/admin-bundle/assets/vite-preload-helper-Cgledu0r.js +1 -0
  109. package/dist/admin-bundle/index.html +16 -0
  110. package/dist/app.d.ts +8 -0
  111. package/dist/app.js +252 -0
  112. package/dist/auth/api-content-author.d.ts +2 -0
  113. package/dist/auth/api-content-author.js +27 -0
  114. package/dist/auth/api-keys.d.ts +7 -0
  115. package/dist/auth/api-keys.js +85 -0
  116. package/dist/auth/jwt-payload.d.ts +16 -0
  117. package/dist/auth/jwt-payload.js +1 -0
  118. package/dist/auth/preview-tokens.d.ts +7 -0
  119. package/dist/auth/preview-tokens.js +76 -0
  120. package/dist/auth/rate-limit.d.ts +16 -0
  121. package/dist/auth/rate-limit.js +283 -0
  122. package/dist/auth/require-auth.d.ts +4 -0
  123. package/dist/auth/require-auth.js +28 -0
  124. package/dist/auth/route-rate-limits.d.ts +31 -0
  125. package/dist/auth/route-rate-limits.js +155 -0
  126. package/dist/auth/tokens.d.ts +15 -0
  127. package/dist/auth/tokens.js +38 -0
  128. package/dist/bin.d.ts +2 -0
  129. package/dist/bin.js +6 -0
  130. package/dist/boot/core-migration-gate.d.ts +12 -0
  131. package/dist/boot/core-migration-gate.js +52 -0
  132. package/dist/boot/resolve-boot-mode.d.ts +6 -0
  133. package/dist/boot/resolve-boot-mode.js +206 -0
  134. package/dist/bundled-templates/com.velora.blog/manifest.json +39 -0
  135. package/dist/bundled-templates/com.velora.blog/package.tar.gz +0 -0
  136. package/dist/bundled-templates/com.velora.blog/sample-content.json +14 -0
  137. package/dist/config/admin-ui.d.ts +1 -0
  138. package/dist/config/admin-ui.js +10 -0
  139. package/dist/config/cors.d.ts +7 -0
  140. package/dist/config/cors.js +53 -0
  141. package/dist/config/env-file-path.d.ts +2 -0
  142. package/dist/config/env-file-path.js +22 -0
  143. package/dist/config/graphql-limits.d.ts +2 -0
  144. package/dist/config/graphql-limits.js +26 -0
  145. package/dist/config/headless.d.ts +1 -0
  146. package/dist/config/headless.js +8 -0
  147. package/dist/config/license-revalidation.d.ts +2 -0
  148. package/dist/config/license-revalidation.js +16 -0
  149. package/dist/config/load-env.d.ts +1 -0
  150. package/dist/config/load-env.js +53 -0
  151. package/dist/config/marketplace.d.ts +11 -0
  152. package/dist/config/marketplace.js +19 -0
  153. package/dist/config/preview.d.ts +3 -0
  154. package/dist/config/preview.js +39 -0
  155. package/dist/config/public-docs.d.ts +1 -0
  156. package/dist/config/public-docs.js +9 -0
  157. package/dist/config/site.d.ts +7 -0
  158. package/dist/config/site.js +12 -0
  159. package/dist/config/trust-proxy.d.ts +2 -0
  160. package/dist/config/trust-proxy.js +42 -0
  161. package/dist/data-types/validate-data-type-settings.d.ts +1 -0
  162. package/dist/data-types/validate-data-type-settings.js +33 -0
  163. package/dist/db/content-db.d.ts +16 -0
  164. package/dist/db/content-db.js +109 -0
  165. package/dist/db/core-migrations/index.d.ts +14 -0
  166. package/dist/db/core-migrations/index.js +184 -0
  167. package/dist/db/core-migrations/steps.d.ts +4 -0
  168. package/dist/db/core-migrations/steps.js +66 -0
  169. package/dist/db/load-prisma-client.d.ts +2 -0
  170. package/dist/db/load-prisma-client.js +44 -0
  171. package/dist/db/prisma.d.ts +3 -0
  172. package/dist/db/prisma.js +67 -0
  173. package/dist/db/resolve-client-dir.d.ts +2 -0
  174. package/dist/db/resolve-client-dir.js +83 -0
  175. package/dist/docs/filter-public-api-spec.d.ts +2 -0
  176. package/dist/docs/filter-public-api-spec.js +52 -0
  177. package/dist/docs-bundle/404.html +41 -0
  178. package/dist/docs-bundle/_astro/MobileTableOfContents.astro_astro_type_script_index_0_lang.BcSo_yiZ.js +1 -0
  179. package/dist/docs-bundle/_astro/Search.astro_astro_type_script_index_0_lang.CavldbAs.js +1 -0
  180. package/dist/docs-bundle/_astro/TableOfContents.astro_astro_type_script_index_0_lang.Csloo1VZ.js +1 -0
  181. package/dist/docs-bundle/_astro/common.DTXA7sXM.css +3 -0
  182. package/dist/docs-bundle/_astro/ec.0vx5m.js +3 -0
  183. package/dist/docs-bundle/_astro/ec.w36nc.css +1 -0
  184. package/dist/docs-bundle/_astro/page.Dwipeu-R.js +1 -0
  185. package/dist/docs-bundle/_astro/print.ehPL0gv-.css +1 -0
  186. package/dist/docs-bundle/_astro/starlight-toc.CTCQXEge.js +1 -0
  187. package/dist/docs-bundle/_astro/ui-core.D-7Scnhs.js +2 -0
  188. package/dist/docs-bundle/favicon.svg +1 -0
  189. package/dist/docs-bundle/index.html +1 -0
  190. package/dist/docs-bundle/pagefind/fragment/en_18a36d7.pf_fragment +0 -0
  191. package/dist/docs-bundle/pagefind/fragment/en_1d9eb24.pf_fragment +0 -0
  192. package/dist/docs-bundle/pagefind/fragment/en_1ef320c.pf_fragment +0 -0
  193. package/dist/docs-bundle/pagefind/fragment/en_3099406.pf_fragment +0 -0
  194. package/dist/docs-bundle/pagefind/fragment/en_4a5b6fe.pf_fragment +0 -0
  195. package/dist/docs-bundle/pagefind/fragment/en_9aa652e.pf_fragment +0 -0
  196. package/dist/docs-bundle/pagefind/fragment/en_baccdf6.pf_fragment +0 -0
  197. package/dist/docs-bundle/pagefind/fragment/en_d81f3fe.pf_fragment +0 -0
  198. package/dist/docs-bundle/pagefind/fragment/en_d855550.pf_fragment +0 -0
  199. package/dist/docs-bundle/pagefind/fragment/en_e6d88d8.pf_fragment +0 -0
  200. package/dist/docs-bundle/pagefind/fragment/en_e9d3189.pf_fragment +0 -0
  201. package/dist/docs-bundle/pagefind/index/en_5feeed7.pf_index +0 -0
  202. package/dist/docs-bundle/pagefind/index/en_c6981f9.pf_index +0 -0
  203. package/dist/docs-bundle/pagefind/index/en_ce4f6bf.pf_index +0 -0
  204. package/dist/docs-bundle/pagefind/pagefind-component-ui.css +1509 -0
  205. package/dist/docs-bundle/pagefind/pagefind-component-ui.js +56 -0
  206. package/dist/docs-bundle/pagefind/pagefind-entry.json +1 -0
  207. package/dist/docs-bundle/pagefind/pagefind-highlight.js +1070 -0
  208. package/dist/docs-bundle/pagefind/pagefind-modular-ui.css +214 -0
  209. package/dist/docs-bundle/pagefind/pagefind-modular-ui.js +8 -0
  210. package/dist/docs-bundle/pagefind/pagefind-ui.css +1 -0
  211. package/dist/docs-bundle/pagefind/pagefind-ui.js +2 -0
  212. package/dist/docs-bundle/pagefind/pagefind-worker.js +6 -0
  213. package/dist/docs-bundle/pagefind/pagefind.en_1e94abd852.pf_meta +0 -0
  214. package/dist/docs-bundle/pagefind/pagefind.js +6 -0
  215. package/dist/docs-bundle/pagefind/wasm.en.pagefind +0 -0
  216. package/dist/docs-bundle/pagefind/wasm.unknown.pagefind +0 -0
  217. package/dist/docs-bundle/v1/index.html +86 -0
  218. package/dist/docs-bundle/v1/using-velora/build-a-headless-frontend/index.html +413 -0
  219. package/dist/docs-bundle/v1/using-velora/content-model/index.html +858 -0
  220. package/dist/docs-bundle/v1/using-velora/editing/index.html +748 -0
  221. package/dist/docs-bundle/v1/using-velora/getting-started/index.html +588 -0
  222. package/dist/docs-bundle/v1/using-velora/headless-api/index.html +1620 -0
  223. package/dist/docs-bundle/v1/using-velora/index.html +215 -0
  224. package/dist/docs-bundle/v1/using-velora/installation/index.html +886 -0
  225. package/dist/docs-bundle/v1/using-velora/installing-plugins/index.html +836 -0
  226. package/dist/docs-bundle/v1/using-velora/media/index.html +468 -0
  227. package/dist/docs-bundle/v1/using-velora/users-and-roles/index.html +561 -0
  228. package/dist/graphql/field-count-rule.d.ts +5 -0
  229. package/dist/graphql/field-count-rule.js +59 -0
  230. package/dist/graphql/schema.d.ts +12 -0
  231. package/dist/graphql/schema.js +330 -0
  232. package/dist/index.d.ts +1 -0
  233. package/dist/index.js +180 -0
  234. package/dist/lib.d.ts +2 -0
  235. package/dist/lib.js +39 -0
  236. package/dist/marketplace/install-bundle-members.d.ts +33 -0
  237. package/dist/marketplace/install-bundle-members.js +137 -0
  238. package/dist/marketplace/install-from-marketplace.d.ts +60 -0
  239. package/dist/marketplace/install-from-marketplace.js +581 -0
  240. package/dist/marketplace/license-revalidation-job.d.ts +38 -0
  241. package/dist/marketplace/license-revalidation-job.js +139 -0
  242. package/dist/marketplace/marketplace-client.d.ts +43 -0
  243. package/dist/marketplace/marketplace-client.js +228 -0
  244. package/dist/marketplace/revalidate-license.d.ts +39 -0
  245. package/dist/marketplace/revalidate-license.js +103 -0
  246. package/dist/media/media-service.d.ts +36 -0
  247. package/dist/media/media-service.js +162 -0
  248. package/dist/plugins/boot-plugin-loader.d.ts +32 -0
  249. package/dist/plugins/boot-plugin-loader.js +57 -0
  250. package/dist/plugins/hook-dispatcher.d.ts +13 -0
  251. package/dist/plugins/hook-dispatcher.js +68 -0
  252. package/dist/plugins/install-built-package.d.ts +36 -0
  253. package/dist/plugins/install-built-package.js +199 -0
  254. package/dist/plugins/install-package-tarball.d.ts +25 -0
  255. package/dist/plugins/install-package-tarball.js +73 -0
  256. package/dist/plugins/plugin-context.d.ts +5 -0
  257. package/dist/plugins/plugin-context.js +26 -0
  258. package/dist/plugins/plugin-package-store.d.ts +31 -0
  259. package/dist/plugins/plugin-package-store.js +64 -0
  260. package/dist/plugins/plugin-registry-service.d.ts +227 -0
  261. package/dist/plugins/plugin-registry-service.js +636 -0
  262. package/dist/plugins/seed-template-content.d.ts +23 -0
  263. package/dist/plugins/seed-template-content.js +198 -0
  264. package/dist/plugins/server-serializers.d.ts +3 -0
  265. package/dist/plugins/server-serializers.js +16 -0
  266. package/dist/plugins/simple-storage-api.d.ts +9 -0
  267. package/dist/plugins/simple-storage-api.js +26 -0
  268. package/dist/plugins/snapshot-groups.d.ts +16 -0
  269. package/dist/plugins/snapshot-groups.js +81 -0
  270. package/dist/plugins/structured-query-builder.d.ts +21 -0
  271. package/dist/plugins/structured-query-builder.js +60 -0
  272. package/dist/plugins/structured-snapshot-service.d.ts +16 -0
  273. package/dist/plugins/structured-snapshot-service.js +286 -0
  274. package/dist/plugins/structured-storage-api.d.ts +22 -0
  275. package/dist/plugins/structured-storage-api.js +91 -0
  276. package/dist/plugins/structured-storage-transaction.d.ts +22 -0
  277. package/dist/plugins/structured-storage-transaction.js +63 -0
  278. package/dist/plugins/structured-table-naming.d.ts +1 -0
  279. package/dist/plugins/structured-table-naming.js +18 -0
  280. package/dist/plugins/trusted-keys.d.ts +11 -0
  281. package/dist/plugins/trusted-keys.js +67 -0
  282. package/dist/plugins/trusted-signing-keys.d.ts +27 -0
  283. package/dist/plugins/trusted-signing-keys.js +40 -0
  284. package/dist/plugins/uninstall-bundle.d.ts +29 -0
  285. package/dist/plugins/uninstall-bundle.js +150 -0
  286. package/dist/plugins/verify-package.d.ts +36 -0
  287. package/dist/plugins/verify-package.js +121 -0
  288. package/dist/routes/admin-static.d.ts +8 -0
  289. package/dist/routes/admin-static.js +196 -0
  290. package/dist/routes/api-keys.d.ts +2 -0
  291. package/dist/routes/api-keys.js +95 -0
  292. package/dist/routes/api-playground.d.ts +2 -0
  293. package/dist/routes/api-playground.js +21 -0
  294. package/dist/routes/auth.d.ts +2 -0
  295. package/dist/routes/auth.js +102 -0
  296. package/dist/routes/content.d.ts +3 -0
  297. package/dist/routes/content.js +471 -0
  298. package/dist/routes/data-types.d.ts +3 -0
  299. package/dist/routes/data-types.js +100 -0
  300. package/dist/routes/docs-static.d.ts +8 -0
  301. package/dist/routes/docs-static.js +137 -0
  302. package/dist/routes/document-types.d.ts +3 -0
  303. package/dist/routes/document-types.js +149 -0
  304. package/dist/routes/headless-bridge.d.ts +10 -0
  305. package/dist/routes/headless-bridge.js +207 -0
  306. package/dist/routes/health.d.ts +2 -0
  307. package/dist/routes/health.js +15 -0
  308. package/dist/routes/marketplace-proxy.d.ts +8 -0
  309. package/dist/routes/marketplace-proxy.js +135 -0
  310. package/dist/routes/media.d.ts +6 -0
  311. package/dist/routes/media.js +93 -0
  312. package/dist/routes/plugin-api-routes.d.ts +12 -0
  313. package/dist/routes/plugin-api-routes.js +224 -0
  314. package/dist/routes/plugin-assets.d.ts +8 -0
  315. package/dist/routes/plugin-assets.js +51 -0
  316. package/dist/routes/plugin-management.d.ts +7 -0
  317. package/dist/routes/plugin-management.js +525 -0
  318. package/dist/routes/plugin-storage.d.ts +8 -0
  319. package/dist/routes/plugin-storage.js +104 -0
  320. package/dist/routes/plugins.d.ts +2 -0
  321. package/dist/routes/plugins.js +36 -0
  322. package/dist/routes/public-api.d.ts +9 -0
  323. package/dist/routes/public-api.js +545 -0
  324. package/dist/routes/published-item.d.ts +57 -0
  325. package/dist/routes/published-item.js +236 -0
  326. package/dist/routes/setup.d.ts +9 -0
  327. package/dist/routes/setup.js +477 -0
  328. package/dist/routes/snapshots.d.ts +3 -0
  329. package/dist/routes/snapshots.js +65 -0
  330. package/dist/routes/templates.d.ts +3 -0
  331. package/dist/routes/templates.js +37 -0
  332. package/dist/routes/themes.d.ts +2 -0
  333. package/dist/routes/themes.js +30 -0
  334. package/dist/routes/users.d.ts +2 -0
  335. package/dist/routes/users.js +113 -0
  336. package/dist/sandbox/register-local-plugin.d.ts +36 -0
  337. package/dist/sandbox/register-local-plugin.js +108 -0
  338. package/dist/sandbox/seed-sandbox.d.ts +20 -0
  339. package/dist/sandbox/seed-sandbox.js +122 -0
  340. package/dist/scripts/copy-admin-bundle.d.ts +1 -0
  341. package/dist/scripts/copy-admin-bundle.js +24 -0
  342. package/dist/scripts/copy-docs-bundle.d.ts +1 -0
  343. package/dist/scripts/copy-docs-bundle.js +22 -0
  344. package/dist/scripts/create-api-key.d.ts +5 -0
  345. package/dist/scripts/create-api-key.js +56 -0
  346. package/dist/scripts/generate-prisma-clients.d.ts +6 -0
  347. package/dist/scripts/generate-prisma-clients.js +125 -0
  348. package/dist/scripts/pack-bundled-templates.d.ts +1 -0
  349. package/dist/scripts/pack-bundled-templates.js +87 -0
  350. package/dist/setup/build-connection-string.d.ts +19 -0
  351. package/dist/setup/build-connection-string.js +14 -0
  352. package/dist/setup/bundled-templates.d.ts +19 -0
  353. package/dist/setup/bundled-templates.js +121 -0
  354. package/dist/setup/ensure-prisma-client.d.ts +3 -0
  355. package/dist/setup/ensure-prisma-client.js +23 -0
  356. package/dist/setup/install-starter.d.ts +14 -0
  357. package/dist/setup/install-starter.js +76 -0
  358. package/dist/setup/normalize-database-url.d.ts +2 -0
  359. package/dist/setup/normalize-database-url.js +35 -0
  360. package/dist/setup/persist-env-config.d.ts +2 -0
  361. package/dist/setup/persist-env-config.js +63 -0
  362. package/dist/setup/provision-database.d.ts +2 -0
  363. package/dist/setup/provision-database.js +89 -0
  364. package/dist/setup-app.d.ts +4 -0
  365. package/dist/setup-app.js +43 -0
  366. package/package.json +96 -0
  367. package/prisma/schema.prisma +303 -0
@@ -0,0 +1,1070 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
28
+
29
+ // node_modules/mark.js/dist/mark.js
30
+ var require_mark = __commonJS({
31
+ "node_modules/mark.js/dist/mark.js"(exports, module) {
32
+ (function(global, factory) {
33
+ typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : global.Mark = factory();
34
+ })(exports, (function() {
35
+ "use strict";
36
+ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
37
+ return typeof obj;
38
+ } : function(obj) {
39
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
40
+ };
41
+ var classCallCheck = function(instance, Constructor) {
42
+ if (!(instance instanceof Constructor)) {
43
+ throw new TypeError("Cannot call a class as a function");
44
+ }
45
+ };
46
+ var createClass = /* @__PURE__ */ (function() {
47
+ function defineProperties(target, props) {
48
+ for (var i = 0; i < props.length; i++) {
49
+ var descriptor = props[i];
50
+ descriptor.enumerable = descriptor.enumerable || false;
51
+ descriptor.configurable = true;
52
+ if ("value" in descriptor) descriptor.writable = true;
53
+ Object.defineProperty(target, descriptor.key, descriptor);
54
+ }
55
+ }
56
+ return function(Constructor, protoProps, staticProps) {
57
+ if (protoProps) defineProperties(Constructor.prototype, protoProps);
58
+ if (staticProps) defineProperties(Constructor, staticProps);
59
+ return Constructor;
60
+ };
61
+ })();
62
+ var _extends = Object.assign || function(target) {
63
+ for (var i = 1; i < arguments.length; i++) {
64
+ var source = arguments[i];
65
+ for (var key in source) {
66
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
67
+ target[key] = source[key];
68
+ }
69
+ }
70
+ }
71
+ return target;
72
+ };
73
+ var DOMIterator = (function() {
74
+ function DOMIterator2(ctx) {
75
+ var iframes = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
76
+ var exclude = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
77
+ var iframesTimeout = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 5e3;
78
+ classCallCheck(this, DOMIterator2);
79
+ this.ctx = ctx;
80
+ this.iframes = iframes;
81
+ this.exclude = exclude;
82
+ this.iframesTimeout = iframesTimeout;
83
+ }
84
+ createClass(DOMIterator2, [{
85
+ key: "getContexts",
86
+ value: function getContexts() {
87
+ var ctx = void 0, filteredCtx = [];
88
+ if (typeof this.ctx === "undefined" || !this.ctx) {
89
+ ctx = [];
90
+ } else if (NodeList.prototype.isPrototypeOf(this.ctx)) {
91
+ ctx = Array.prototype.slice.call(this.ctx);
92
+ } else if (Array.isArray(this.ctx)) {
93
+ ctx = this.ctx;
94
+ } else if (typeof this.ctx === "string") {
95
+ ctx = Array.prototype.slice.call(document.querySelectorAll(this.ctx));
96
+ } else {
97
+ ctx = [this.ctx];
98
+ }
99
+ ctx.forEach(function(ctx2) {
100
+ var isDescendant = filteredCtx.filter(function(contexts) {
101
+ return contexts.contains(ctx2);
102
+ }).length > 0;
103
+ if (filteredCtx.indexOf(ctx2) === -1 && !isDescendant) {
104
+ filteredCtx.push(ctx2);
105
+ }
106
+ });
107
+ return filteredCtx;
108
+ }
109
+ }, {
110
+ key: "getIframeContents",
111
+ value: function getIframeContents(ifr, successFn) {
112
+ var errorFn = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function() {
113
+ };
114
+ var doc = void 0;
115
+ try {
116
+ var ifrWin = ifr.contentWindow;
117
+ doc = ifrWin.document;
118
+ if (!ifrWin || !doc) {
119
+ throw new Error("iframe inaccessible");
120
+ }
121
+ } catch (e) {
122
+ errorFn();
123
+ }
124
+ if (doc) {
125
+ successFn(doc);
126
+ }
127
+ }
128
+ }, {
129
+ key: "isIframeBlank",
130
+ value: function isIframeBlank(ifr) {
131
+ var bl = "about:blank", src = ifr.getAttribute("src").trim(), href = ifr.contentWindow.location.href;
132
+ return href === bl && src !== bl && src;
133
+ }
134
+ }, {
135
+ key: "observeIframeLoad",
136
+ value: function observeIframeLoad(ifr, successFn, errorFn) {
137
+ var _this = this;
138
+ var called = false, tout = null;
139
+ var listener = function listener2() {
140
+ if (called) {
141
+ return;
142
+ }
143
+ called = true;
144
+ clearTimeout(tout);
145
+ try {
146
+ if (!_this.isIframeBlank(ifr)) {
147
+ ifr.removeEventListener("load", listener2);
148
+ _this.getIframeContents(ifr, successFn, errorFn);
149
+ }
150
+ } catch (e) {
151
+ errorFn();
152
+ }
153
+ };
154
+ ifr.addEventListener("load", listener);
155
+ tout = setTimeout(listener, this.iframesTimeout);
156
+ }
157
+ }, {
158
+ key: "onIframeReady",
159
+ value: function onIframeReady(ifr, successFn, errorFn) {
160
+ try {
161
+ if (ifr.contentWindow.document.readyState === "complete") {
162
+ if (this.isIframeBlank(ifr)) {
163
+ this.observeIframeLoad(ifr, successFn, errorFn);
164
+ } else {
165
+ this.getIframeContents(ifr, successFn, errorFn);
166
+ }
167
+ } else {
168
+ this.observeIframeLoad(ifr, successFn, errorFn);
169
+ }
170
+ } catch (e) {
171
+ errorFn();
172
+ }
173
+ }
174
+ }, {
175
+ key: "waitForIframes",
176
+ value: function waitForIframes(ctx, done) {
177
+ var _this2 = this;
178
+ var eachCalled = 0;
179
+ this.forEachIframe(ctx, function() {
180
+ return true;
181
+ }, function(ifr) {
182
+ eachCalled++;
183
+ _this2.waitForIframes(ifr.querySelector("html"), function() {
184
+ if (!--eachCalled) {
185
+ done();
186
+ }
187
+ });
188
+ }, function(handled) {
189
+ if (!handled) {
190
+ done();
191
+ }
192
+ });
193
+ }
194
+ }, {
195
+ key: "forEachIframe",
196
+ value: function forEachIframe(ctx, filter, each) {
197
+ var _this3 = this;
198
+ var end = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : function() {
199
+ };
200
+ var ifr = ctx.querySelectorAll("iframe"), open = ifr.length, handled = 0;
201
+ ifr = Array.prototype.slice.call(ifr);
202
+ var checkEnd = function checkEnd2() {
203
+ if (--open <= 0) {
204
+ end(handled);
205
+ }
206
+ };
207
+ if (!open) {
208
+ checkEnd();
209
+ }
210
+ ifr.forEach(function(ifr2) {
211
+ if (DOMIterator2.matches(ifr2, _this3.exclude)) {
212
+ checkEnd();
213
+ } else {
214
+ _this3.onIframeReady(ifr2, function(con) {
215
+ if (filter(ifr2)) {
216
+ handled++;
217
+ each(con);
218
+ }
219
+ checkEnd();
220
+ }, checkEnd);
221
+ }
222
+ });
223
+ }
224
+ }, {
225
+ key: "createIterator",
226
+ value: function createIterator(ctx, whatToShow, filter) {
227
+ return document.createNodeIterator(ctx, whatToShow, filter, false);
228
+ }
229
+ }, {
230
+ key: "createInstanceOnIframe",
231
+ value: function createInstanceOnIframe(contents) {
232
+ return new DOMIterator2(contents.querySelector("html"), this.iframes);
233
+ }
234
+ }, {
235
+ key: "compareNodeIframe",
236
+ value: function compareNodeIframe(node, prevNode, ifr) {
237
+ var compCurr = node.compareDocumentPosition(ifr), prev = Node.DOCUMENT_POSITION_PRECEDING;
238
+ if (compCurr & prev) {
239
+ if (prevNode !== null) {
240
+ var compPrev = prevNode.compareDocumentPosition(ifr), after = Node.DOCUMENT_POSITION_FOLLOWING;
241
+ if (compPrev & after) {
242
+ return true;
243
+ }
244
+ } else {
245
+ return true;
246
+ }
247
+ }
248
+ return false;
249
+ }
250
+ }, {
251
+ key: "getIteratorNode",
252
+ value: function getIteratorNode(itr) {
253
+ var prevNode = itr.previousNode();
254
+ var node = void 0;
255
+ if (prevNode === null) {
256
+ node = itr.nextNode();
257
+ } else {
258
+ node = itr.nextNode() && itr.nextNode();
259
+ }
260
+ return {
261
+ prevNode,
262
+ node
263
+ };
264
+ }
265
+ }, {
266
+ key: "checkIframeFilter",
267
+ value: function checkIframeFilter(node, prevNode, currIfr, ifr) {
268
+ var key = false, handled = false;
269
+ ifr.forEach(function(ifrDict, i) {
270
+ if (ifrDict.val === currIfr) {
271
+ key = i;
272
+ handled = ifrDict.handled;
273
+ }
274
+ });
275
+ if (this.compareNodeIframe(node, prevNode, currIfr)) {
276
+ if (key === false && !handled) {
277
+ ifr.push({
278
+ val: currIfr,
279
+ handled: true
280
+ });
281
+ } else if (key !== false && !handled) {
282
+ ifr[key].handled = true;
283
+ }
284
+ return true;
285
+ }
286
+ if (key === false) {
287
+ ifr.push({
288
+ val: currIfr,
289
+ handled: false
290
+ });
291
+ }
292
+ return false;
293
+ }
294
+ }, {
295
+ key: "handleOpenIframes",
296
+ value: function handleOpenIframes(ifr, whatToShow, eCb, fCb) {
297
+ var _this4 = this;
298
+ ifr.forEach(function(ifrDict) {
299
+ if (!ifrDict.handled) {
300
+ _this4.getIframeContents(ifrDict.val, function(con) {
301
+ _this4.createInstanceOnIframe(con).forEachNode(whatToShow, eCb, fCb);
302
+ });
303
+ }
304
+ });
305
+ }
306
+ }, {
307
+ key: "iterateThroughNodes",
308
+ value: function iterateThroughNodes(whatToShow, ctx, eachCb, filterCb, doneCb) {
309
+ var _this5 = this;
310
+ var itr = this.createIterator(ctx, whatToShow, filterCb);
311
+ var ifr = [], elements = [], node = void 0, prevNode = void 0, retrieveNodes = function retrieveNodes2() {
312
+ var _getIteratorNode = _this5.getIteratorNode(itr);
313
+ prevNode = _getIteratorNode.prevNode;
314
+ node = _getIteratorNode.node;
315
+ return node;
316
+ };
317
+ while (retrieveNodes()) {
318
+ if (this.iframes) {
319
+ this.forEachIframe(ctx, function(currIfr) {
320
+ return _this5.checkIframeFilter(node, prevNode, currIfr, ifr);
321
+ }, function(con) {
322
+ _this5.createInstanceOnIframe(con).forEachNode(whatToShow, function(ifrNode) {
323
+ return elements.push(ifrNode);
324
+ }, filterCb);
325
+ });
326
+ }
327
+ elements.push(node);
328
+ }
329
+ elements.forEach(function(node2) {
330
+ eachCb(node2);
331
+ });
332
+ if (this.iframes) {
333
+ this.handleOpenIframes(ifr, whatToShow, eachCb, filterCb);
334
+ }
335
+ doneCb();
336
+ }
337
+ }, {
338
+ key: "forEachNode",
339
+ value: function forEachNode(whatToShow, each, filter) {
340
+ var _this6 = this;
341
+ var done = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : function() {
342
+ };
343
+ var contexts = this.getContexts();
344
+ var open = contexts.length;
345
+ if (!open) {
346
+ done();
347
+ }
348
+ contexts.forEach(function(ctx) {
349
+ var ready = function ready2() {
350
+ _this6.iterateThroughNodes(whatToShow, ctx, each, filter, function() {
351
+ if (--open <= 0) {
352
+ done();
353
+ }
354
+ });
355
+ };
356
+ if (_this6.iframes) {
357
+ _this6.waitForIframes(ctx, ready);
358
+ } else {
359
+ ready();
360
+ }
361
+ });
362
+ }
363
+ }], [{
364
+ key: "matches",
365
+ value: function matches(element, selector) {
366
+ var selectors = typeof selector === "string" ? [selector] : selector, fn = element.matches || element.matchesSelector || element.msMatchesSelector || element.mozMatchesSelector || element.oMatchesSelector || element.webkitMatchesSelector;
367
+ if (fn) {
368
+ var match = false;
369
+ selectors.every(function(sel) {
370
+ if (fn.call(element, sel)) {
371
+ match = true;
372
+ return false;
373
+ }
374
+ return true;
375
+ });
376
+ return match;
377
+ } else {
378
+ return false;
379
+ }
380
+ }
381
+ }]);
382
+ return DOMIterator2;
383
+ })();
384
+ var Mark$1 = (function() {
385
+ function Mark3(ctx) {
386
+ classCallCheck(this, Mark3);
387
+ this.ctx = ctx;
388
+ this.ie = false;
389
+ var ua = window.navigator.userAgent;
390
+ if (ua.indexOf("MSIE") > -1 || ua.indexOf("Trident") > -1) {
391
+ this.ie = true;
392
+ }
393
+ }
394
+ createClass(Mark3, [{
395
+ key: "log",
396
+ value: function log(msg) {
397
+ var level = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "debug";
398
+ var log2 = this.opt.log;
399
+ if (!this.opt.debug) {
400
+ return;
401
+ }
402
+ if ((typeof log2 === "undefined" ? "undefined" : _typeof(log2)) === "object" && typeof log2[level] === "function") {
403
+ log2[level]("mark.js: " + msg);
404
+ }
405
+ }
406
+ }, {
407
+ key: "escapeStr",
408
+ value: function escapeStr(str) {
409
+ return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
410
+ }
411
+ }, {
412
+ key: "createRegExp",
413
+ value: function createRegExp(str) {
414
+ if (this.opt.wildcards !== "disabled") {
415
+ str = this.setupWildcardsRegExp(str);
416
+ }
417
+ str = this.escapeStr(str);
418
+ if (Object.keys(this.opt.synonyms).length) {
419
+ str = this.createSynonymsRegExp(str);
420
+ }
421
+ if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
422
+ str = this.setupIgnoreJoinersRegExp(str);
423
+ }
424
+ if (this.opt.diacritics) {
425
+ str = this.createDiacriticsRegExp(str);
426
+ }
427
+ str = this.createMergedBlanksRegExp(str);
428
+ if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
429
+ str = this.createJoinersRegExp(str);
430
+ }
431
+ if (this.opt.wildcards !== "disabled") {
432
+ str = this.createWildcardsRegExp(str);
433
+ }
434
+ str = this.createAccuracyRegExp(str);
435
+ return str;
436
+ }
437
+ }, {
438
+ key: "createSynonymsRegExp",
439
+ value: function createSynonymsRegExp(str) {
440
+ var syn = this.opt.synonyms, sens = this.opt.caseSensitive ? "" : "i", joinerPlaceholder = this.opt.ignoreJoiners || this.opt.ignorePunctuation.length ? "\0" : "";
441
+ for (var index in syn) {
442
+ if (syn.hasOwnProperty(index)) {
443
+ var value = syn[index], k1 = this.opt.wildcards !== "disabled" ? this.setupWildcardsRegExp(index) : this.escapeStr(index), k2 = this.opt.wildcards !== "disabled" ? this.setupWildcardsRegExp(value) : this.escapeStr(value);
444
+ if (k1 !== "" && k2 !== "") {
445
+ str = str.replace(new RegExp("(" + this.escapeStr(k1) + "|" + this.escapeStr(k2) + ")", "gm" + sens), joinerPlaceholder + ("(" + this.processSynomyms(k1) + "|") + (this.processSynomyms(k2) + ")") + joinerPlaceholder);
446
+ }
447
+ }
448
+ }
449
+ return str;
450
+ }
451
+ }, {
452
+ key: "processSynomyms",
453
+ value: function processSynomyms(str) {
454
+ if (this.opt.ignoreJoiners || this.opt.ignorePunctuation.length) {
455
+ str = this.setupIgnoreJoinersRegExp(str);
456
+ }
457
+ return str;
458
+ }
459
+ }, {
460
+ key: "setupWildcardsRegExp",
461
+ value: function setupWildcardsRegExp(str) {
462
+ str = str.replace(/(?:\\)*\?/g, function(val) {
463
+ return val.charAt(0) === "\\" ? "?" : "";
464
+ });
465
+ return str.replace(/(?:\\)*\*/g, function(val) {
466
+ return val.charAt(0) === "\\" ? "*" : "";
467
+ });
468
+ }
469
+ }, {
470
+ key: "createWildcardsRegExp",
471
+ value: function createWildcardsRegExp(str) {
472
+ var spaces = this.opt.wildcards === "withSpaces";
473
+ return str.replace(/\u0001/g, spaces ? "[\\S\\s]?" : "\\S?").replace(/\u0002/g, spaces ? "[\\S\\s]*?" : "\\S*");
474
+ }
475
+ }, {
476
+ key: "setupIgnoreJoinersRegExp",
477
+ value: function setupIgnoreJoinersRegExp(str) {
478
+ return str.replace(/[^(|)\\]/g, function(val, indx, original) {
479
+ var nextChar = original.charAt(indx + 1);
480
+ if (/[(|)\\]/.test(nextChar) || nextChar === "") {
481
+ return val;
482
+ } else {
483
+ return val + "\0";
484
+ }
485
+ });
486
+ }
487
+ }, {
488
+ key: "createJoinersRegExp",
489
+ value: function createJoinersRegExp(str) {
490
+ var joiner = [];
491
+ var ignorePunctuation = this.opt.ignorePunctuation;
492
+ if (Array.isArray(ignorePunctuation) && ignorePunctuation.length) {
493
+ joiner.push(this.escapeStr(ignorePunctuation.join("")));
494
+ }
495
+ if (this.opt.ignoreJoiners) {
496
+ joiner.push("\\u00ad\\u200b\\u200c\\u200d");
497
+ }
498
+ return joiner.length ? str.split(/\u0000+/).join("[" + joiner.join("") + "]*") : str;
499
+ }
500
+ }, {
501
+ key: "createDiacriticsRegExp",
502
+ value: function createDiacriticsRegExp(str) {
503
+ var sens = this.opt.caseSensitive ? "" : "i", dct = this.opt.caseSensitive ? ["a\xE0\xE1\u1EA3\xE3\u1EA1\u0103\u1EB1\u1EAF\u1EB3\u1EB5\u1EB7\xE2\u1EA7\u1EA5\u1EA9\u1EAB\u1EAD\xE4\xE5\u0101\u0105", "A\xC0\xC1\u1EA2\xC3\u1EA0\u0102\u1EB0\u1EAE\u1EB2\u1EB4\u1EB6\xC2\u1EA6\u1EA4\u1EA8\u1EAA\u1EAC\xC4\xC5\u0100\u0104", "c\xE7\u0107\u010D", "C\xC7\u0106\u010C", "d\u0111\u010F", "D\u0110\u010E", "e\xE8\xE9\u1EBB\u1EBD\u1EB9\xEA\u1EC1\u1EBF\u1EC3\u1EC5\u1EC7\xEB\u011B\u0113\u0119", "E\xC8\xC9\u1EBA\u1EBC\u1EB8\xCA\u1EC0\u1EBE\u1EC2\u1EC4\u1EC6\xCB\u011A\u0112\u0118", "i\xEC\xED\u1EC9\u0129\u1ECB\xEE\xEF\u012B", "I\xCC\xCD\u1EC8\u0128\u1ECA\xCE\xCF\u012A", "l\u0142", "L\u0141", "n\xF1\u0148\u0144", "N\xD1\u0147\u0143", "o\xF2\xF3\u1ECF\xF5\u1ECD\xF4\u1ED3\u1ED1\u1ED5\u1ED7\u1ED9\u01A1\u1EDF\u1EE1\u1EDB\u1EDD\u1EE3\xF6\xF8\u014D", "O\xD2\xD3\u1ECE\xD5\u1ECC\xD4\u1ED2\u1ED0\u1ED4\u1ED6\u1ED8\u01A0\u1EDE\u1EE0\u1EDA\u1EDC\u1EE2\xD6\xD8\u014C", "r\u0159", "R\u0158", "s\u0161\u015B\u0219\u015F", "S\u0160\u015A\u0218\u015E", "t\u0165\u021B\u0163", "T\u0164\u021A\u0162", "u\xF9\xFA\u1EE7\u0169\u1EE5\u01B0\u1EEB\u1EE9\u1EED\u1EEF\u1EF1\xFB\xFC\u016F\u016B", "U\xD9\xDA\u1EE6\u0168\u1EE4\u01AF\u1EEA\u1EE8\u1EEC\u1EEE\u1EF0\xDB\xDC\u016E\u016A", "y\xFD\u1EF3\u1EF7\u1EF9\u1EF5\xFF", "Y\xDD\u1EF2\u1EF6\u1EF8\u1EF4\u0178", "z\u017E\u017C\u017A", "Z\u017D\u017B\u0179"] : ["a\xE0\xE1\u1EA3\xE3\u1EA1\u0103\u1EB1\u1EAF\u1EB3\u1EB5\u1EB7\xE2\u1EA7\u1EA5\u1EA9\u1EAB\u1EAD\xE4\xE5\u0101\u0105A\xC0\xC1\u1EA2\xC3\u1EA0\u0102\u1EB0\u1EAE\u1EB2\u1EB4\u1EB6\xC2\u1EA6\u1EA4\u1EA8\u1EAA\u1EAC\xC4\xC5\u0100\u0104", "c\xE7\u0107\u010DC\xC7\u0106\u010C", "d\u0111\u010FD\u0110\u010E", "e\xE8\xE9\u1EBB\u1EBD\u1EB9\xEA\u1EC1\u1EBF\u1EC3\u1EC5\u1EC7\xEB\u011B\u0113\u0119E\xC8\xC9\u1EBA\u1EBC\u1EB8\xCA\u1EC0\u1EBE\u1EC2\u1EC4\u1EC6\xCB\u011A\u0112\u0118", "i\xEC\xED\u1EC9\u0129\u1ECB\xEE\xEF\u012BI\xCC\xCD\u1EC8\u0128\u1ECA\xCE\xCF\u012A", "l\u0142L\u0141", "n\xF1\u0148\u0144N\xD1\u0147\u0143", "o\xF2\xF3\u1ECF\xF5\u1ECD\xF4\u1ED3\u1ED1\u1ED5\u1ED7\u1ED9\u01A1\u1EDF\u1EE1\u1EDB\u1EDD\u1EE3\xF6\xF8\u014DO\xD2\xD3\u1ECE\xD5\u1ECC\xD4\u1ED2\u1ED0\u1ED4\u1ED6\u1ED8\u01A0\u1EDE\u1EE0\u1EDA\u1EDC\u1EE2\xD6\xD8\u014C", "r\u0159R\u0158", "s\u0161\u015B\u0219\u015FS\u0160\u015A\u0218\u015E", "t\u0165\u021B\u0163T\u0164\u021A\u0162", "u\xF9\xFA\u1EE7\u0169\u1EE5\u01B0\u1EEB\u1EE9\u1EED\u1EEF\u1EF1\xFB\xFC\u016F\u016BU\xD9\xDA\u1EE6\u0168\u1EE4\u01AF\u1EEA\u1EE8\u1EEC\u1EEE\u1EF0\xDB\xDC\u016E\u016A", "y\xFD\u1EF3\u1EF7\u1EF9\u1EF5\xFFY\xDD\u1EF2\u1EF6\u1EF8\u1EF4\u0178", "z\u017E\u017C\u017AZ\u017D\u017B\u0179"];
504
+ var handled = [];
505
+ str.split("").forEach(function(ch) {
506
+ dct.every(function(dct2) {
507
+ if (dct2.indexOf(ch) !== -1) {
508
+ if (handled.indexOf(dct2) > -1) {
509
+ return false;
510
+ }
511
+ str = str.replace(new RegExp("[" + dct2 + "]", "gm" + sens), "[" + dct2 + "]");
512
+ handled.push(dct2);
513
+ }
514
+ return true;
515
+ });
516
+ });
517
+ return str;
518
+ }
519
+ }, {
520
+ key: "createMergedBlanksRegExp",
521
+ value: function createMergedBlanksRegExp(str) {
522
+ return str.replace(/[\s]+/gmi, "[\\s]+");
523
+ }
524
+ }, {
525
+ key: "createAccuracyRegExp",
526
+ value: function createAccuracyRegExp(str) {
527
+ var _this = this;
528
+ var chars = "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\xA1\xBF";
529
+ var acc = this.opt.accuracy, val = typeof acc === "string" ? acc : acc.value, ls = typeof acc === "string" ? [] : acc.limiters, lsJoin = "";
530
+ ls.forEach(function(limiter) {
531
+ lsJoin += "|" + _this.escapeStr(limiter);
532
+ });
533
+ switch (val) {
534
+ case "partially":
535
+ default:
536
+ return "()(" + str + ")";
537
+ case "complementary":
538
+ lsJoin = "\\s" + (lsJoin ? lsJoin : this.escapeStr(chars));
539
+ return "()([^" + lsJoin + "]*" + str + "[^" + lsJoin + "]*)";
540
+ case "exactly":
541
+ return "(^|\\s" + lsJoin + ")(" + str + ")(?=$|\\s" + lsJoin + ")";
542
+ }
543
+ }
544
+ }, {
545
+ key: "getSeparatedKeywords",
546
+ value: function getSeparatedKeywords(sv) {
547
+ var _this2 = this;
548
+ var stack = [];
549
+ sv.forEach(function(kw) {
550
+ if (!_this2.opt.separateWordSearch) {
551
+ if (kw.trim() && stack.indexOf(kw) === -1) {
552
+ stack.push(kw);
553
+ }
554
+ } else {
555
+ kw.split(" ").forEach(function(kwSplitted) {
556
+ if (kwSplitted.trim() && stack.indexOf(kwSplitted) === -1) {
557
+ stack.push(kwSplitted);
558
+ }
559
+ });
560
+ }
561
+ });
562
+ return {
563
+ "keywords": stack.sort(function(a, b) {
564
+ return b.length - a.length;
565
+ }),
566
+ "length": stack.length
567
+ };
568
+ }
569
+ }, {
570
+ key: "isNumeric",
571
+ value: function isNumeric(value) {
572
+ return Number(parseFloat(value)) == value;
573
+ }
574
+ }, {
575
+ key: "checkRanges",
576
+ value: function checkRanges(array) {
577
+ var _this3 = this;
578
+ if (!Array.isArray(array) || Object.prototype.toString.call(array[0]) !== "[object Object]") {
579
+ this.log("markRanges() will only accept an array of objects");
580
+ this.opt.noMatch(array);
581
+ return [];
582
+ }
583
+ var stack = [];
584
+ var last = 0;
585
+ array.sort(function(a, b) {
586
+ return a.start - b.start;
587
+ }).forEach(function(item) {
588
+ var _callNoMatchOnInvalid = _this3.callNoMatchOnInvalidRanges(item, last), start = _callNoMatchOnInvalid.start, end = _callNoMatchOnInvalid.end, valid = _callNoMatchOnInvalid.valid;
589
+ if (valid) {
590
+ item.start = start;
591
+ item.length = end - start;
592
+ stack.push(item);
593
+ last = end;
594
+ }
595
+ });
596
+ return stack;
597
+ }
598
+ }, {
599
+ key: "callNoMatchOnInvalidRanges",
600
+ value: function callNoMatchOnInvalidRanges(range, last) {
601
+ var start = void 0, end = void 0, valid = false;
602
+ if (range && typeof range.start !== "undefined") {
603
+ start = parseInt(range.start, 10);
604
+ end = start + parseInt(range.length, 10);
605
+ if (this.isNumeric(range.start) && this.isNumeric(range.length) && end - last > 0 && end - start > 0) {
606
+ valid = true;
607
+ } else {
608
+ this.log("Ignoring invalid or overlapping range: " + ("" + JSON.stringify(range)));
609
+ this.opt.noMatch(range);
610
+ }
611
+ } else {
612
+ this.log("Ignoring invalid range: " + JSON.stringify(range));
613
+ this.opt.noMatch(range);
614
+ }
615
+ return {
616
+ start,
617
+ end,
618
+ valid
619
+ };
620
+ }
621
+ }, {
622
+ key: "checkWhitespaceRanges",
623
+ value: function checkWhitespaceRanges(range, originalLength, string) {
624
+ var end = void 0, valid = true, max = string.length, offset = originalLength - max, start = parseInt(range.start, 10) - offset;
625
+ start = start > max ? max : start;
626
+ end = start + parseInt(range.length, 10);
627
+ if (end > max) {
628
+ end = max;
629
+ this.log("End range automatically set to the max value of " + max);
630
+ }
631
+ if (start < 0 || end - start < 0 || start > max || end > max) {
632
+ valid = false;
633
+ this.log("Invalid range: " + JSON.stringify(range));
634
+ this.opt.noMatch(range);
635
+ } else if (string.substring(start, end).replace(/\s+/g, "") === "") {
636
+ valid = false;
637
+ this.log("Skipping whitespace only range: " + JSON.stringify(range));
638
+ this.opt.noMatch(range);
639
+ }
640
+ return {
641
+ start,
642
+ end,
643
+ valid
644
+ };
645
+ }
646
+ }, {
647
+ key: "getTextNodes",
648
+ value: function getTextNodes(cb) {
649
+ var _this4 = this;
650
+ var val = "", nodes = [];
651
+ this.iterator.forEachNode(NodeFilter.SHOW_TEXT, function(node) {
652
+ nodes.push({
653
+ start: val.length,
654
+ end: (val += node.textContent).length,
655
+ node
656
+ });
657
+ }, function(node) {
658
+ if (_this4.matchesExclude(node.parentNode)) {
659
+ return NodeFilter.FILTER_REJECT;
660
+ } else {
661
+ return NodeFilter.FILTER_ACCEPT;
662
+ }
663
+ }, function() {
664
+ cb({
665
+ value: val,
666
+ nodes
667
+ });
668
+ });
669
+ }
670
+ }, {
671
+ key: "matchesExclude",
672
+ value: function matchesExclude(el) {
673
+ return DOMIterator.matches(el, this.opt.exclude.concat(["script", "style", "title", "head", "html"]));
674
+ }
675
+ }, {
676
+ key: "wrapRangeInTextNode",
677
+ value: function wrapRangeInTextNode(node, start, end) {
678
+ var hEl = !this.opt.element ? "mark" : this.opt.element, startNode = node.splitText(start), ret = startNode.splitText(end - start);
679
+ var repl = document.createElement(hEl);
680
+ repl.setAttribute("data-markjs", "true");
681
+ if (this.opt.className) {
682
+ repl.setAttribute("class", this.opt.className);
683
+ }
684
+ repl.textContent = startNode.textContent;
685
+ startNode.parentNode.replaceChild(repl, startNode);
686
+ return ret;
687
+ }
688
+ }, {
689
+ key: "wrapRangeInMappedTextNode",
690
+ value: function wrapRangeInMappedTextNode(dict, start, end, filterCb, eachCb) {
691
+ var _this5 = this;
692
+ dict.nodes.every(function(n, i) {
693
+ var sibl = dict.nodes[i + 1];
694
+ if (typeof sibl === "undefined" || sibl.start > start) {
695
+ if (!filterCb(n.node)) {
696
+ return false;
697
+ }
698
+ var s = start - n.start, e = (end > n.end ? n.end : end) - n.start, startStr = dict.value.substr(0, n.start), endStr = dict.value.substr(e + n.start);
699
+ n.node = _this5.wrapRangeInTextNode(n.node, s, e);
700
+ dict.value = startStr + endStr;
701
+ dict.nodes.forEach(function(k, j) {
702
+ if (j >= i) {
703
+ if (dict.nodes[j].start > 0 && j !== i) {
704
+ dict.nodes[j].start -= e;
705
+ }
706
+ dict.nodes[j].end -= e;
707
+ }
708
+ });
709
+ end -= e;
710
+ eachCb(n.node.previousSibling, n.start);
711
+ if (end > n.end) {
712
+ start = n.end;
713
+ } else {
714
+ return false;
715
+ }
716
+ }
717
+ return true;
718
+ });
719
+ }
720
+ }, {
721
+ key: "wrapMatches",
722
+ value: function wrapMatches(regex, ignoreGroups, filterCb, eachCb, endCb) {
723
+ var _this6 = this;
724
+ var matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1;
725
+ this.getTextNodes(function(dict) {
726
+ dict.nodes.forEach(function(node) {
727
+ node = node.node;
728
+ var match = void 0;
729
+ while ((match = regex.exec(node.textContent)) !== null && match[matchIdx] !== "") {
730
+ if (!filterCb(match[matchIdx], node)) {
731
+ continue;
732
+ }
733
+ var pos = match.index;
734
+ if (matchIdx !== 0) {
735
+ for (var i = 1; i < matchIdx; i++) {
736
+ pos += match[i].length;
737
+ }
738
+ }
739
+ node = _this6.wrapRangeInTextNode(node, pos, pos + match[matchIdx].length);
740
+ eachCb(node.previousSibling);
741
+ regex.lastIndex = 0;
742
+ }
743
+ });
744
+ endCb();
745
+ });
746
+ }
747
+ }, {
748
+ key: "wrapMatchesAcrossElements",
749
+ value: function wrapMatchesAcrossElements(regex, ignoreGroups, filterCb, eachCb, endCb) {
750
+ var _this7 = this;
751
+ var matchIdx = ignoreGroups === 0 ? 0 : ignoreGroups + 1;
752
+ this.getTextNodes(function(dict) {
753
+ var match = void 0;
754
+ while ((match = regex.exec(dict.value)) !== null && match[matchIdx] !== "") {
755
+ var start = match.index;
756
+ if (matchIdx !== 0) {
757
+ for (var i = 1; i < matchIdx; i++) {
758
+ start += match[i].length;
759
+ }
760
+ }
761
+ var end = start + match[matchIdx].length;
762
+ _this7.wrapRangeInMappedTextNode(dict, start, end, function(node) {
763
+ return filterCb(match[matchIdx], node);
764
+ }, function(node, lastIndex) {
765
+ regex.lastIndex = lastIndex;
766
+ eachCb(node);
767
+ });
768
+ }
769
+ endCb();
770
+ });
771
+ }
772
+ }, {
773
+ key: "wrapRangeFromIndex",
774
+ value: function wrapRangeFromIndex(ranges, filterCb, eachCb, endCb) {
775
+ var _this8 = this;
776
+ this.getTextNodes(function(dict) {
777
+ var originalLength = dict.value.length;
778
+ ranges.forEach(function(range, counter) {
779
+ var _checkWhitespaceRange = _this8.checkWhitespaceRanges(range, originalLength, dict.value), start = _checkWhitespaceRange.start, end = _checkWhitespaceRange.end, valid = _checkWhitespaceRange.valid;
780
+ if (valid) {
781
+ _this8.wrapRangeInMappedTextNode(dict, start, end, function(node) {
782
+ return filterCb(node, range, dict.value.substring(start, end), counter);
783
+ }, function(node) {
784
+ eachCb(node, range);
785
+ });
786
+ }
787
+ });
788
+ endCb();
789
+ });
790
+ }
791
+ }, {
792
+ key: "unwrapMatches",
793
+ value: function unwrapMatches(node) {
794
+ var parent = node.parentNode;
795
+ var docFrag = document.createDocumentFragment();
796
+ while (node.firstChild) {
797
+ docFrag.appendChild(node.removeChild(node.firstChild));
798
+ }
799
+ parent.replaceChild(docFrag, node);
800
+ if (!this.ie) {
801
+ parent.normalize();
802
+ } else {
803
+ this.normalizeTextNode(parent);
804
+ }
805
+ }
806
+ }, {
807
+ key: "normalizeTextNode",
808
+ value: function normalizeTextNode(node) {
809
+ if (!node) {
810
+ return;
811
+ }
812
+ if (node.nodeType === 3) {
813
+ while (node.nextSibling && node.nextSibling.nodeType === 3) {
814
+ node.nodeValue += node.nextSibling.nodeValue;
815
+ node.parentNode.removeChild(node.nextSibling);
816
+ }
817
+ } else {
818
+ this.normalizeTextNode(node.firstChild);
819
+ }
820
+ this.normalizeTextNode(node.nextSibling);
821
+ }
822
+ }, {
823
+ key: "markRegExp",
824
+ value: function markRegExp(regexp, opt) {
825
+ var _this9 = this;
826
+ this.opt = opt;
827
+ this.log('Searching with expression "' + regexp + '"');
828
+ var totalMatches = 0, fn = "wrapMatches";
829
+ var eachCb = function eachCb2(element) {
830
+ totalMatches++;
831
+ _this9.opt.each(element);
832
+ };
833
+ if (this.opt.acrossElements) {
834
+ fn = "wrapMatchesAcrossElements";
835
+ }
836
+ this[fn](regexp, this.opt.ignoreGroups, function(match, node) {
837
+ return _this9.opt.filter(node, match, totalMatches);
838
+ }, eachCb, function() {
839
+ if (totalMatches === 0) {
840
+ _this9.opt.noMatch(regexp);
841
+ }
842
+ _this9.opt.done(totalMatches);
843
+ });
844
+ }
845
+ }, {
846
+ key: "mark",
847
+ value: function mark(sv, opt) {
848
+ var _this10 = this;
849
+ this.opt = opt;
850
+ var totalMatches = 0, fn = "wrapMatches";
851
+ var _getSeparatedKeywords = this.getSeparatedKeywords(typeof sv === "string" ? [sv] : sv), kwArr = _getSeparatedKeywords.keywords, kwArrLen = _getSeparatedKeywords.length, sens = this.opt.caseSensitive ? "" : "i", handler = function handler2(kw) {
852
+ var regex = new RegExp(_this10.createRegExp(kw), "gm" + sens), matches = 0;
853
+ _this10.log('Searching with expression "' + regex + '"');
854
+ _this10[fn](regex, 1, function(term, node) {
855
+ return _this10.opt.filter(node, kw, totalMatches, matches);
856
+ }, function(element) {
857
+ matches++;
858
+ totalMatches++;
859
+ _this10.opt.each(element);
860
+ }, function() {
861
+ if (matches === 0) {
862
+ _this10.opt.noMatch(kw);
863
+ }
864
+ if (kwArr[kwArrLen - 1] === kw) {
865
+ _this10.opt.done(totalMatches);
866
+ } else {
867
+ handler2(kwArr[kwArr.indexOf(kw) + 1]);
868
+ }
869
+ });
870
+ };
871
+ if (this.opt.acrossElements) {
872
+ fn = "wrapMatchesAcrossElements";
873
+ }
874
+ if (kwArrLen === 0) {
875
+ this.opt.done(totalMatches);
876
+ } else {
877
+ handler(kwArr[0]);
878
+ }
879
+ }
880
+ }, {
881
+ key: "markRanges",
882
+ value: function markRanges(rawRanges, opt) {
883
+ var _this11 = this;
884
+ this.opt = opt;
885
+ var totalMatches = 0, ranges = this.checkRanges(rawRanges);
886
+ if (ranges && ranges.length) {
887
+ this.log("Starting to mark with the following ranges: " + JSON.stringify(ranges));
888
+ this.wrapRangeFromIndex(ranges, function(node, range, match, counter) {
889
+ return _this11.opt.filter(node, range, match, counter);
890
+ }, function(element, range) {
891
+ totalMatches++;
892
+ _this11.opt.each(element, range);
893
+ }, function() {
894
+ _this11.opt.done(totalMatches);
895
+ });
896
+ } else {
897
+ this.opt.done(totalMatches);
898
+ }
899
+ }
900
+ }, {
901
+ key: "unmark",
902
+ value: function unmark(opt) {
903
+ var _this12 = this;
904
+ this.opt = opt;
905
+ var sel = this.opt.element ? this.opt.element : "*";
906
+ sel += "[data-markjs]";
907
+ if (this.opt.className) {
908
+ sel += "." + this.opt.className;
909
+ }
910
+ this.log('Removal selector "' + sel + '"');
911
+ this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT, function(node) {
912
+ _this12.unwrapMatches(node);
913
+ }, function(node) {
914
+ var matchesSel = DOMIterator.matches(node, sel), matchesExclude = _this12.matchesExclude(node);
915
+ if (!matchesSel || matchesExclude) {
916
+ return NodeFilter.FILTER_REJECT;
917
+ } else {
918
+ return NodeFilter.FILTER_ACCEPT;
919
+ }
920
+ }, this.opt.done);
921
+ }
922
+ }, {
923
+ key: "opt",
924
+ set: function set$$1(val) {
925
+ this._opt = _extends({}, {
926
+ "element": "",
927
+ "className": "",
928
+ "exclude": [],
929
+ "iframes": false,
930
+ "iframesTimeout": 5e3,
931
+ "separateWordSearch": true,
932
+ "diacritics": true,
933
+ "synonyms": {},
934
+ "accuracy": "partially",
935
+ "acrossElements": false,
936
+ "caseSensitive": false,
937
+ "ignoreJoiners": false,
938
+ "ignoreGroups": 0,
939
+ "ignorePunctuation": [],
940
+ "wildcards": "disabled",
941
+ "each": function each() {
942
+ },
943
+ "noMatch": function noMatch() {
944
+ },
945
+ "filter": function filter() {
946
+ return true;
947
+ },
948
+ "done": function done() {
949
+ },
950
+ "debug": false,
951
+ "log": window.console
952
+ }, val);
953
+ },
954
+ get: function get$$1() {
955
+ return this._opt;
956
+ }
957
+ }, {
958
+ key: "iterator",
959
+ get: function get$$1() {
960
+ return new DOMIterator(this.ctx, this.opt.iframes, this.opt.exclude, this.opt.iframesTimeout);
961
+ }
962
+ }]);
963
+ return Mark3;
964
+ })();
965
+ function Mark2(ctx) {
966
+ var _this = this;
967
+ var instance = new Mark$1(ctx);
968
+ this.mark = function(sv, opt) {
969
+ instance.mark(sv, opt);
970
+ return _this;
971
+ };
972
+ this.markRegExp = function(sv, opt) {
973
+ instance.markRegExp(sv, opt);
974
+ return _this;
975
+ };
976
+ this.markRanges = function(sv, opt) {
977
+ instance.markRanges(sv, opt);
978
+ return _this;
979
+ };
980
+ this.unmark = function(opt) {
981
+ instance.unmark(opt);
982
+ return _this;
983
+ };
984
+ return this;
985
+ }
986
+ return Mark2;
987
+ }));
988
+ }
989
+ });
990
+
991
+ // lib/highlight.ts
992
+ var import_mark = __toESM(require_mark(), 1);
993
+ var PagefindHighlight = class {
994
+ constructor(options = {
995
+ markContext: null,
996
+ highlightParam: "pagefind-highlight",
997
+ markOptions: {
998
+ className: "pagefind-highlight",
999
+ exclude: ["[data-pagefind-ignore]", "[data-pagefind-ignore] *"]
1000
+ },
1001
+ addStyles: true
1002
+ }) {
1003
+ __publicField(this, "highlightParam");
1004
+ __publicField(this, "markContext");
1005
+ __publicField(this, "markOptions");
1006
+ __publicField(this, "addStyles");
1007
+ var _a, _b;
1008
+ const { highlightParam, markContext, markOptions, addStyles } = options;
1009
+ this.highlightParam = highlightParam ?? "pagefind-highlight";
1010
+ this.addStyles = addStyles ?? true;
1011
+ this.markContext = markContext !== void 0 ? markContext : null;
1012
+ this.markOptions = markOptions !== void 0 ? markOptions : {
1013
+ className: "pagefind-highlight",
1014
+ exclude: ["[data-pagefind-ignore]", "[data-pagefind-ignore] *"]
1015
+ };
1016
+ (_a = this.markOptions).className ?? (_a.className = "pagefind__highlight");
1017
+ (_b = this.markOptions).exclude ?? (_b.exclude = [
1018
+ "[data-pagefind-ignore]",
1019
+ "[data-pagefind-ignore] *"
1020
+ ]);
1021
+ this.markOptions.separateWordSearch = false;
1022
+ this.highlight();
1023
+ }
1024
+ getHighlightParams(paramName) {
1025
+ const urlParams = new URLSearchParams(window.location.search);
1026
+ return urlParams.getAll(paramName);
1027
+ }
1028
+ // Inline styles might be too hard to override
1029
+ addHighlightStyles(className) {
1030
+ if (!className) return;
1031
+ const styleElement = document.createElement("style");
1032
+ styleElement.innerText = `:where(.${className}) { background-color: yellow; color: black; }`;
1033
+ document.head.appendChild(styleElement);
1034
+ }
1035
+ createMarkInstance() {
1036
+ if (this.markContext) {
1037
+ return new import_mark.default(this.markContext);
1038
+ }
1039
+ const pagefindBody = document.querySelectorAll("[data-pagefind-body]");
1040
+ if (pagefindBody.length !== 0) {
1041
+ return new import_mark.default(pagefindBody);
1042
+ } else {
1043
+ return new import_mark.default(document.body);
1044
+ }
1045
+ }
1046
+ markText(instance, text) {
1047
+ instance.mark(text, this.markOptions);
1048
+ }
1049
+ highlight() {
1050
+ const params = this.getHighlightParams(this.highlightParam);
1051
+ if (!params || params.length === 0) return;
1052
+ this.addStyles && this.addHighlightStyles(this.markOptions.className);
1053
+ const markInstance = this.createMarkInstance();
1054
+ this.markText(markInstance, params);
1055
+ }
1056
+ };
1057
+ window.PagefindHighlight = PagefindHighlight;
1058
+ export {
1059
+ PagefindHighlight as default
1060
+ };
1061
+ /*! Bundled license information:
1062
+
1063
+ mark.js/dist/mark.js:
1064
+ (*!***************************************************
1065
+ * mark.js v8.11.1
1066
+ * https://markjs.io/
1067
+ * Copyright (c) 2014–2018, Julian Kühnel
1068
+ * Released under the MIT license https://git.io/vwTVl
1069
+ *****************************************************)
1070
+ */