@openclaw/matrix 2026.7.2-beta.7 → 2026.7.34

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 (368) hide show
  1. package/README.md +1 -1
  2. package/dist/{account-selection-kqquRzCf.js → .setup/account-selection-BOQeTqax.mjs} +18 -17
  3. package/dist/{approval-handler.runtime-DSeaIsGa.js → .setup/approval-handler.runtime-CEXm9_-p.mjs} +18 -28
  4. package/dist/{approval-ids-BdJGPAJT.js → .setup/approval-ids-DdFnDB3h.mjs} +1 -1
  5. package/dist/{approval-reaction-auth-BjOpELxu.js → .setup/approval-reaction-auth-CREvd7S7.mjs} +2 -2
  6. package/dist/.setup/approval-reactions-Cltyp8nL.mjs +113 -0
  7. package/dist/.setup/async-lock-BcLS4KOc.mjs +19 -0
  8. package/dist/{channel-vj788dNZ.js → .setup/channel-an4umty1.mjs} +186 -144
  9. package/dist/{channel.runtime-CLoF2S9T.js → .setup/channel.runtime-GHcIBJ7H.mjs} +51 -45
  10. package/dist/{cli-DMqfDE-q.js → .setup/cli-B3WYmv5U.mjs} +882 -901
  11. package/dist/{cli-metadata-C7D53SND.js → .setup/cli-metadata-RUKCn0wJ.mjs} +1 -1
  12. package/dist/{client-6eRENr7k.js → .setup/client-Ct0bUHCo.mjs} +5 -5
  13. package/dist/{shared-CUMWxcMz.js → .setup/client-DFBQtzCe.mjs} +422 -179
  14. package/dist/.setup/client-bootstrap-Be8jvNle.mjs +74 -0
  15. package/dist/{config-schema-Djxw3C6b.js → .setup/config-schema-D9J_vUF6.mjs} +89 -70
  16. package/dist/.setup/credentials-BhZlA0kL.mjs +56 -0
  17. package/dist/.setup/credentials-read-CRHg6XPm.mjs +114 -0
  18. package/dist/{credentials-write.runtime-Be9zNSUw.js → .setup/credentials-write.runtime-dWuLafsk.mjs} +1 -1
  19. package/dist/{crypto-runtime-D9_6J5tZ.js → .setup/crypto-runtime-D-cZa8P0.mjs} +81 -35
  20. package/dist/.setup/crypto-state-store-B43k3z3W.mjs +352 -0
  21. package/dist/{deps-CcVJfvRM.js → .setup/deps-Dy6yreL4.mjs} +92 -25
  22. package/dist/{device-health-B4-YXtJR.js → .setup/device-health-D4LBxuPq.mjs} +1 -6
  23. package/dist/{directory-live-C8dVBiCc.js → .setup/directory-live-BTEYxMwy.mjs} +10 -9
  24. package/dist/.setup/doctor-BGnvMzOR.mjs +169 -0
  25. package/dist/.setup/doctor-contract-DNJw0fdq.mjs +246 -0
  26. package/dist/{draft-stream-CtvOXq0Z.js → .setup/draft-stream-C-_OhpE8.mjs} +1 -6
  27. package/dist/{encryption-guidance-CbEFe38F.js → .setup/encryption-guidance-CpuuwmjL.mjs} +4 -3
  28. package/dist/{env-auth-CQsYbz-p.js → .setup/env-auth-CYJL1jNl.mjs} +2 -2
  29. package/dist/{env-vars-B0NxQnPk.js → .setup/env-vars-KzaYveuy.mjs} +1 -3
  30. package/dist/{exec-approval-resolver-BCgqRtZS.js → .setup/exec-approval-resolver-f9j6staN.mjs} +1 -2
  31. package/dist/{file-sync-store-DiiFsayX.js → .setup/file-sync-store-DU0cnYAz.mjs} +30 -25
  32. package/dist/{http-client-CycYxU9-.js → .setup/http-client-C954In2D.mjs} +45 -25
  33. package/dist/{idb-persistence-B6x7dMsF.js → .setup/idb-persistence-_HKTXkVC.mjs} +76 -78
  34. package/dist/{idb-persistence-lock-DAJ49nZX.js → .setup/idb-persistence-lock-B3fZXyF_.mjs} +1 -1
  35. package/dist/.setup/legacy-crypto-inspector-Byp8LCys.mjs +42 -0
  36. package/dist/.setup/legacy-crypto-restore-YQVoK1B2.mjs +93 -0
  37. package/dist/{logger-D0GCSDQq.js → .setup/logger-DpoogOgz.mjs} +1 -1
  38. package/dist/{logging-DV-p52N0.js → .setup/logging-CgxQOJJP.mjs} +2 -9
  39. package/dist/.setup/matrix-migration.runtime-BDH5c3fN.mjs +530 -0
  40. package/dist/{media-text-BTwzADS_.js → .setup/media-text-Cib-dxkn.mjs} +1 -1
  41. package/dist/{messages-DxQJkhxs.js → .setup/messages-D4DYGHYX.mjs} +15 -67
  42. package/dist/.setup/migration-snapshot-backup-CpgYhiUp.mjs +70 -0
  43. package/dist/.setup/migration-snapshot.runtime-O8qkMVaC.mjs +2 -0
  44. package/dist/{monitor-VyWlSLwo.js → .setup/monitor-DNcW_oAN.mjs} +2525 -2361
  45. package/dist/.setup/probe.runtime-CMPh0mFk.mjs +2 -0
  46. package/dist/{profile-update-CffmyW_4.js → .setup/profile-update-DzOL3Wiw.mjs} +5 -4
  47. package/dist/{reaction-events-B00WSi98.js → .setup/reaction-events-BcvgXxHb.mjs} +14 -64
  48. package/dist/{resolve-targets-nm2L48sh.js → .setup/resolve-targets-Bq80X9Sn.mjs} +3 -3
  49. package/dist/{resolver.runtime-DS6uPaEe.js → .setup/resolver.runtime-CeBHR9-T.mjs} +1 -1
  50. package/dist/{runtime-api-D1xI_cvh.js → .setup/runtime-api-CEsWNdil.mjs} +4 -4
  51. package/dist/.setup/runtime-setter-api-DGMubGUq.mjs +3 -0
  52. package/dist/{sdk-bUytQHx7.js → .setup/sdk-He1quVAq.mjs} +592 -261
  53. package/dist/.setup/secret-contract-api-CiTJ7pd5.mjs +3 -0
  54. package/dist/{secret-contract-M3hRmGO-.js → .setup/secret-contract-phPvlNfV.mjs} +53 -28
  55. package/dist/{send-BldGYG8g.js → .setup/send-CGgl0uTn.mjs} +133 -660
  56. package/dist/{setup-bootstrap-Deleiibz.js → .setup/setup-bootstrap-DUXBC8X2.mjs} +4 -4
  57. package/dist/{setup-core-BVfBv2ai.js → .setup/setup-core-bhdcEo7v.mjs} +239 -189
  58. package/dist/.setup/setup-plugin-api-CAwZ_Bi7.mjs +43 -0
  59. package/dist/.setup/setup-plugin-api-DIFVsOs3.mjs +2 -0
  60. package/dist/{setup-surface-BBq3WeqX.js → .setup/setup-surface-05_G-MnT.mjs} +149 -92
  61. package/dist/{startup-verification-wm3_i88s.js → .setup/startup-verification-BTwIGu1J.mjs} +7 -6
  62. package/dist/.setup/storage-NGZq5zet.mjs +432 -0
  63. package/dist/{storage-paths-gUmSydsW.js → .setup/storage-paths-BWo_ZEMC.mjs} +13 -2
  64. package/dist/{subagent-hooks-dkPAF6Et.js → .setup/subagent-hooks-BSWPJEmo.mjs} +2 -2
  65. package/dist/{thread-binding-api-DRbBZlhS.js → .setup/thread-binding-api-B7UaOoKv.mjs} +1 -1
  66. package/dist/{thread-bindings-DGbl3vDW.js → .setup/thread-bindings-DqmjG2on.mjs} +8 -8
  67. package/dist/{tool-actions.runtime-uu9blSqO.js → .setup/tool-actions.runtime-CXDLk2jg.mjs} +196 -332
  68. package/dist/{verification-DYMQ1QpI.js → .setup/verification-DeWOtZJr.mjs} +4 -3
  69. package/dist/api.js +9 -9
  70. package/dist/auth-presence.js +21 -13
  71. package/dist/channel-plugin-api.js +1 -1
  72. package/dist/cli-metadata.js +1 -1
  73. package/dist/contract-api.js +2 -2
  74. package/dist/doctor-contract-api.js +99 -524
  75. package/dist/helper-api.js +4 -4
  76. package/dist/index.js +1 -1
  77. package/dist/plugin-entry.handlers.runtime.js +2 -2
  78. package/dist/runtime-api.js +8 -8
  79. package/dist/runtime-heavy-api.js +3 -0
  80. package/dist/runtime-setter-api.js +1 -1
  81. package/dist/secret-contract-api.js +1 -1
  82. package/dist/session-binding-contract-api.js +3 -3
  83. package/dist/setup-entry.js +4 -3
  84. package/dist/setup-plugin-api.js +1 -44
  85. package/dist/subagent-hooks-api.js +1 -1
  86. package/dist/thread-binding-api.js +1 -1
  87. package/dist/thread-bindings-runtime.js +1 -1
  88. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/package.json +1 -1
  89. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm.d.ts +2 -14
  90. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs +384 -409
  91. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js +224 -246
  92. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm +0 -0
  93. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts +58 -59
  94. package/node_modules/markdown-it/README.md +18 -294
  95. package/node_modules/markdown-it/bin/markdown-it.mjs +2 -2
  96. package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs +3013 -0
  97. package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs.map +1 -0
  98. package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js +14 -0
  99. package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js.map +1 -0
  100. package/node_modules/markdown-it/dist/markdown-it.cjs.js +4420 -0
  101. package/node_modules/markdown-it/dist/markdown-it.cjs.js.map +1 -0
  102. package/node_modules/markdown-it/dist/markdown-it.d.cts +19 -0
  103. package/node_modules/markdown-it/dist/markdown-it.d.mts +950 -0
  104. package/node_modules/markdown-it/dist/{index.cjs.js → markdown-it.mjs} +1504 -1525
  105. package/node_modules/markdown-it/dist/markdown-it.mjs.map +1 -0
  106. package/node_modules/markdown-it/node_modules/argparse/LICENSE +1 -208
  107. package/node_modules/markdown-it/node_modules/argparse/README.md +46 -41
  108. package/node_modules/markdown-it/node_modules/argparse/lib/_colorize.js +72 -0
  109. package/node_modules/markdown-it/node_modules/argparse/lib/argparse.d.ts +292 -0
  110. package/node_modules/markdown-it/node_modules/argparse/{argparse.js → lib/argparse.js} +1142 -1029
  111. package/node_modules/markdown-it/node_modules/argparse/lib/difflib.js +190 -0
  112. package/node_modules/markdown-it/node_modules/argparse/lib/sub.js +4 -4
  113. package/node_modules/markdown-it/node_modules/argparse/lib/textwrap.js +28 -28
  114. package/node_modules/markdown-it/node_modules/argparse/package.json +18 -11
  115. package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.d.ts +8 -0
  116. package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.d.ts.map +1 -0
  117. package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.js +46 -0
  118. package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.js.map +1 -0
  119. package/node_modules/markdown-it/node_modules/entities/{lib → dist}/decode.d.ts +28 -45
  120. package/node_modules/markdown-it/node_modules/entities/dist/decode.d.ts.map +1 -0
  121. package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/decode.js +189 -141
  122. package/node_modules/markdown-it/node_modules/entities/dist/decode.js.map +1 -0
  123. package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/encode.d.ts +4 -2
  124. package/node_modules/markdown-it/node_modules/entities/dist/encode.d.ts.map +1 -0
  125. package/node_modules/markdown-it/node_modules/entities/dist/encode.js +90 -0
  126. package/node_modules/markdown-it/node_modules/entities/dist/encode.js.map +1 -0
  127. package/node_modules/markdown-it/node_modules/entities/{lib → dist}/escape.d.ts +15 -10
  128. package/node_modules/markdown-it/node_modules/entities/dist/escape.d.ts.map +1 -0
  129. package/node_modules/markdown-it/node_modules/entities/dist/escape.js +132 -0
  130. package/node_modules/markdown-it/node_modules/entities/dist/escape.js.map +1 -0
  131. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.d.ts +3 -0
  132. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.d.ts.map +1 -0
  133. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.js +5 -0
  134. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.js.map +1 -0
  135. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.d.ts +3 -0
  136. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.d.ts.map +1 -0
  137. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.js +5 -0
  138. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.js.map +1 -0
  139. package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.d.ts +5 -0
  140. package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.d.ts.map +1 -0
  141. package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.js +12 -0
  142. package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.js.map +1 -0
  143. package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/index.d.ts +14 -21
  144. package/node_modules/markdown-it/node_modules/entities/dist/index.d.ts.map +1 -0
  145. package/node_modules/markdown-it/node_modules/entities/dist/index.js +91 -0
  146. package/node_modules/markdown-it/node_modules/entities/dist/index.js.map +1 -0
  147. package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.d.ts +17 -0
  148. package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.d.ts.map +1 -0
  149. package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.js +18 -0
  150. package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.js.map +1 -0
  151. package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.d.ts +7 -0
  152. package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.d.ts.map +1 -0
  153. package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.js +17 -0
  154. package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.js.map +1 -0
  155. package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.d.ts +33 -0
  156. package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.d.ts.map +1 -0
  157. package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.js +93 -0
  158. package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.js.map +1 -0
  159. package/node_modules/markdown-it/node_modules/entities/package.json +63 -70
  160. package/node_modules/markdown-it/node_modules/entities/readme.md +54 -45
  161. package/node_modules/markdown-it/node_modules/entities/src/decode-codepoint.ts +50 -0
  162. package/node_modules/markdown-it/node_modules/entities/src/decode.ts +671 -0
  163. package/node_modules/markdown-it/node_modules/entities/src/encode.ts +95 -0
  164. package/node_modules/markdown-it/node_modules/entities/src/escape.ts +160 -0
  165. package/node_modules/markdown-it/node_modules/entities/src/generated/decode-data-html.ts +7 -0
  166. package/node_modules/markdown-it/node_modules/entities/src/generated/decode-data-xml.ts +7 -0
  167. package/node_modules/markdown-it/node_modules/entities/src/generated/encode-html.ts +18 -0
  168. package/node_modules/markdown-it/node_modules/entities/src/index.ts +162 -0
  169. package/node_modules/markdown-it/node_modules/entities/src/internal/bin-trie-flags.ts +16 -0
  170. package/node_modules/markdown-it/node_modules/entities/src/internal/decode-shared.ts +18 -0
  171. package/node_modules/markdown-it/node_modules/entities/src/internal/encode-shared.ts +123 -0
  172. package/node_modules/markdown-it/node_modules/linkify-it/README.md +49 -86
  173. package/node_modules/markdown-it/node_modules/linkify-it/build/index.cjs.js +636 -825
  174. package/node_modules/markdown-it/node_modules/linkify-it/build/index.cjs.js.map +1 -0
  175. package/node_modules/markdown-it/node_modules/linkify-it/build/index.d.ts +236 -0
  176. package/node_modules/markdown-it/node_modules/linkify-it/build/index.mjs +538 -0
  177. package/node_modules/markdown-it/node_modules/linkify-it/build/index.mjs.map +1 -0
  178. package/node_modules/markdown-it/node_modules/linkify-it/package.json +23 -20
  179. package/node_modules/markdown-it/node_modules/uc.micro/README.md +18 -1
  180. package/node_modules/markdown-it/node_modules/uc.micro/build/index.cjs.js +13 -18
  181. package/node_modules/markdown-it/node_modules/uc.micro/build/index.d.ts +6 -0
  182. package/node_modules/markdown-it/node_modules/uc.micro/build/index.mjs +8 -0
  183. package/node_modules/markdown-it/node_modules/uc.micro/package.json +12 -17
  184. package/node_modules/markdown-it/package.json +47 -30
  185. package/node_modules/matrix-js-sdk/CHANGELOG.md +0 -11
  186. package/node_modules/matrix-js-sdk/package.json +1 -1
  187. package/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
  188. package/node_modules/music-metadata/lib/common/Util.js +1 -7
  189. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +3 -23
  190. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
  191. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
  192. package/node_modules/music-metadata/lib/mp4/AtomToken.js +13 -38
  193. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
  194. package/node_modules/music-metadata/package.json +6 -6
  195. package/node_modules/typebox/build/compile/validator.d.mts +4 -1
  196. package/node_modules/typebox/build/guard/guard.d.mts +1 -1
  197. package/node_modules/typebox/build/guard/guard.mjs +2 -5
  198. package/node_modules/typebox/build/guard/string.mjs +4 -16
  199. package/node_modules/typebox/build/schema/engine/_functions.mjs +15 -34
  200. package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
  201. package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -8
  202. package/node_modules/typebox/build/typebox.d.mts +1 -1
  203. package/node_modules/typebox/build/typebox.mjs +1 -1
  204. package/node_modules/typebox/package.json +1 -1
  205. package/node_modules/typebox/readme.md +32 -29
  206. package/openclaw.plugin.json +146 -152
  207. package/package.json +31 -114
  208. package/dist/accounts-DfngqebB.js +0 -130
  209. package/dist/active-client-DXvz2gCo.js +0 -20
  210. package/dist/approval-reactions-D-BxBK_L.js +0 -202
  211. package/dist/client-Dbso3-0V.js +0 -30
  212. package/dist/client-bootstrap-XsIkHNt0.js +0 -110
  213. package/dist/create-client-BmSU-q-D.js +0 -61
  214. package/dist/credentials-W2EmwRhu.js +0 -65
  215. package/dist/credentials-read-DVmFCm7X.js +0 -77
  216. package/dist/doctor-CM8ijNpW.js +0 -64
  217. package/dist/doctor-contract-BMSJkkAE.js +0 -167
  218. package/dist/inbound-dedupe-CaBLblef.js +0 -48
  219. package/dist/probe.runtime-BuieqmS3.js +0 -3
  220. package/dist/record-shared-CWWx6fvI.js +0 -2
  221. package/dist/recovery-key-store-BNnHvXdk.js +0 -275
  222. package/dist/room-info-CAFZ3Z9J.js +0 -87
  223. package/dist/route-DY6at4qJ.js +0 -161
  224. package/dist/storage-BvAkgzvT.js +0 -685
  225. package/node_modules/markdown-it/dist/index.cjs.js.map +0 -1
  226. package/node_modules/markdown-it/dist/markdown-it.js +0 -3975
  227. package/node_modules/markdown-it/dist/markdown-it.js.map +0 -1
  228. package/node_modules/markdown-it/dist/markdown-it.min.js +0 -3
  229. package/node_modules/markdown-it/dist/markdown-it.min.js.map +0 -1
  230. package/node_modules/markdown-it/index.mjs +0 -1
  231. package/node_modules/markdown-it/lib/common/html_blocks.mjs +0 -67
  232. package/node_modules/markdown-it/lib/common/html_re.mjs +0 -25
  233. package/node_modules/markdown-it/lib/common/utils.mjs +0 -324
  234. package/node_modules/markdown-it/lib/helpers/index.mjs +0 -11
  235. package/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs +0 -77
  236. package/node_modules/markdown-it/lib/helpers/parse_link_label.mjs +0 -49
  237. package/node_modules/markdown-it/lib/helpers/parse_link_title.mjs +0 -66
  238. package/node_modules/markdown-it/lib/index.mjs +0 -565
  239. package/node_modules/markdown-it/lib/parser_block.mjs +0 -134
  240. package/node_modules/markdown-it/lib/parser_core.mjs +0 -62
  241. package/node_modules/markdown-it/lib/parser_inline.mjs +0 -197
  242. package/node_modules/markdown-it/lib/presets/commonmark.mjs +0 -88
  243. package/node_modules/markdown-it/lib/presets/default.mjs +0 -47
  244. package/node_modules/markdown-it/lib/presets/zero.mjs +0 -70
  245. package/node_modules/markdown-it/lib/renderer.mjs +0 -322
  246. package/node_modules/markdown-it/lib/ruler.mjs +0 -340
  247. package/node_modules/markdown-it/lib/rules_block/blockquote.mjs +0 -209
  248. package/node_modules/markdown-it/lib/rules_block/code.mjs +0 -30
  249. package/node_modules/markdown-it/lib/rules_block/fence.mjs +0 -94
  250. package/node_modules/markdown-it/lib/rules_block/heading.mjs +0 -51
  251. package/node_modules/markdown-it/lib/rules_block/hr.mjs +0 -40
  252. package/node_modules/markdown-it/lib/rules_block/html_block.mjs +0 -80
  253. package/node_modules/markdown-it/lib/rules_block/lheading.mjs +0 -85
  254. package/node_modules/markdown-it/lib/rules_block/list.mjs +0 -331
  255. package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +0 -48
  256. package/node_modules/markdown-it/lib/rules_block/reference.mjs +0 -212
  257. package/node_modules/markdown-it/lib/rules_block/state_block.mjs +0 -220
  258. package/node_modules/markdown-it/lib/rules_block/table.mjs +0 -228
  259. package/node_modules/markdown-it/lib/rules_core/block.mjs +0 -13
  260. package/node_modules/markdown-it/lib/rules_core/inline.mjs +0 -11
  261. package/node_modules/markdown-it/lib/rules_core/linkify.mjs +0 -134
  262. package/node_modules/markdown-it/lib/rules_core/normalize.mjs +0 -17
  263. package/node_modules/markdown-it/lib/rules_core/replacements.mjs +0 -101
  264. package/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +0 -209
  265. package/node_modules/markdown-it/lib/rules_core/state_core.mjs +0 -17
  266. package/node_modules/markdown-it/lib/rules_core/text_join.mjs +0 -43
  267. package/node_modules/markdown-it/lib/rules_inline/autolink.mjs +0 -72
  268. package/node_modules/markdown-it/lib/rules_inline/backticks.mjs +0 -60
  269. package/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +0 -124
  270. package/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +0 -123
  271. package/node_modules/markdown-it/lib/rules_inline/entity.mjs +0 -51
  272. package/node_modules/markdown-it/lib/rules_inline/escape.mjs +0 -83
  273. package/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs +0 -38
  274. package/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +0 -50
  275. package/node_modules/markdown-it/lib/rules_inline/image.mjs +0 -138
  276. package/node_modules/markdown-it/lib/rules_inline/link.mjs +0 -139
  277. package/node_modules/markdown-it/lib/rules_inline/linkify.mjs +0 -63
  278. package/node_modules/markdown-it/lib/rules_inline/newline.mjs +0 -42
  279. package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +0 -154
  280. package/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +0 -127
  281. package/node_modules/markdown-it/lib/rules_inline/text.mjs +0 -86
  282. package/node_modules/markdown-it/lib/token.mjs +0 -191
  283. package/node_modules/markdown-it/node_modules/argparse/CHANGELOG.md +0 -216
  284. package/node_modules/markdown-it/node_modules/entities/lib/decode.d.ts.map +0 -1
  285. package/node_modules/markdown-it/node_modules/entities/lib/decode.js +0 -536
  286. package/node_modules/markdown-it/node_modules/entities/lib/decode.js.map +0 -1
  287. package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.d.ts +0 -19
  288. package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.d.ts.map +0 -1
  289. package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.js +0 -76
  290. package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.js.map +0 -1
  291. package/node_modules/markdown-it/node_modules/entities/lib/encode.d.ts +0 -22
  292. package/node_modules/markdown-it/node_modules/entities/lib/encode.d.ts.map +0 -1
  293. package/node_modules/markdown-it/node_modules/entities/lib/encode.js +0 -77
  294. package/node_modules/markdown-it/node_modules/entities/lib/encode.js.map +0 -1
  295. package/node_modules/markdown-it/node_modules/entities/lib/escape.d.ts.map +0 -1
  296. package/node_modules/markdown-it/node_modules/entities/lib/escape.js +0 -122
  297. package/node_modules/markdown-it/node_modules/entities/lib/escape.js.map +0 -1
  298. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.d.ts +0 -211
  299. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.d.ts.map +0 -1
  300. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.js.map +0 -1
  301. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.d.ts +0 -19
  302. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +0 -1
  303. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.js +0 -71
  304. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.js.map +0 -1
  305. package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.d.ts.map +0 -1
  306. package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.js +0 -69
  307. package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.js.map +0 -1
  308. package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.d.ts +0 -43
  309. package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.d.ts.map +0 -1
  310. package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.js +0 -116
  311. package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.js.map +0 -1
  312. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +0 -3
  313. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +0 -1
  314. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.js +0 -7
  315. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.js.map +0 -1
  316. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +0 -3
  317. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +0 -1
  318. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.js +0 -7
  319. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +0 -1
  320. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.d.ts +0 -8
  321. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +0 -1
  322. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.js +0 -10
  323. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.js.map +0 -1
  324. package/node_modules/markdown-it/node_modules/entities/lib/esm/index.d.ts.map +0 -1
  325. package/node_modules/markdown-it/node_modules/entities/lib/esm/index.js +0 -99
  326. package/node_modules/markdown-it/node_modules/entities/lib/esm/index.js.map +0 -1
  327. package/node_modules/markdown-it/node_modules/entities/lib/esm/package.json +0 -1
  328. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.d.ts +0 -3
  329. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.d.ts.map +0 -1
  330. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.js +0 -9
  331. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.js.map +0 -1
  332. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.d.ts +0 -3
  333. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +0 -1
  334. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.js +0 -9
  335. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.js.map +0 -1
  336. package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.d.ts +0 -8
  337. package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.d.ts.map +0 -1
  338. package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.js +0 -12
  339. package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.js.map +0 -1
  340. package/node_modules/markdown-it/node_modules/entities/lib/index.d.ts +0 -96
  341. package/node_modules/markdown-it/node_modules/entities/lib/index.d.ts.map +0 -1
  342. package/node_modules/markdown-it/node_modules/entities/lib/index.js +0 -126
  343. package/node_modules/markdown-it/node_modules/entities/lib/index.js.map +0 -1
  344. package/node_modules/markdown-it/node_modules/linkify-it/index.mjs +0 -646
  345. package/node_modules/markdown-it/node_modules/linkify-it/lib/re.mjs +0 -193
  346. package/node_modules/markdown-it/node_modules/uc.micro/categories/Cc/regex.mjs +0 -1
  347. package/node_modules/markdown-it/node_modules/uc.micro/categories/Cf/regex.mjs +0 -1
  348. package/node_modules/markdown-it/node_modules/uc.micro/categories/P/regex.mjs +0 -1
  349. package/node_modules/markdown-it/node_modules/uc.micro/categories/S/regex.mjs +0 -1
  350. package/node_modules/markdown-it/node_modules/uc.micro/categories/Z/regex.mjs +0 -1
  351. package/node_modules/markdown-it/node_modules/uc.micro/index.mjs +0 -8
  352. package/node_modules/markdown-it/node_modules/uc.micro/properties/Any/regex.mjs +0 -1
  353. /package/dist/{account-config-BZWN9tGS.js → .setup/account-config-BZWN9tGS.mjs} +0 -0
  354. /package/dist/{backup-health-Dm_YMVFT.js → .setup/backup-health-Dm_YMVFT.mjs} +0 -0
  355. /package/dist/{config-paths-CnREYb1Y.js → .setup/config-paths-CnREYb1Y.mjs} +0 -0
  356. /package/dist/{config-secret-input.runtime-CwsP3--c.js → .setup/config-secret-input.runtime-CwsP3--c.mjs} +0 -0
  357. /package/dist/{crypto-node.runtime-6Aj_ltHQ.js → .setup/crypto-node.runtime-6Aj_ltHQ.mjs} +0 -0
  358. /package/dist/{errors-C47hvAF8.js → .setup/errors-C47hvAF8.mjs} +0 -0
  359. /package/dist/{preflight-audio.runtime-BZxxQsxY.js → .setup/preflight-audio.runtime-BZxxQsxY.mjs} +0 -0
  360. /package/dist/{reaction-common-DkrQdBSZ.js → .setup/reaction-common-DkrQdBSZ.mjs} +0 -0
  361. /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
  362. /package/dist/{runtime-6S3DNFNv.js → .setup/runtime-6S3DNFNv.mjs} +0 -0
  363. /package/dist/{runtime-BefyhPWv.js → .setup/runtime-BefyhPWv.mjs} +0 -0
  364. /package/dist/{sync-state-CWbp0QSY.js → .setup/sync-state-CWbp0QSY.mjs} +0 -0
  365. /package/dist/{target-ids-B-5aQxwn.js → .setup/target-ids-B-5aQxwn.mjs} +0 -0
  366. /package/dist/{thread-bindings-shared-CKnY4LSd.js → .setup/thread-bindings-shared-CKnY4LSd.mjs} +0 -0
  367. /package/dist/{timeout-abort-signal-DMrgRFIy.js → .setup/timeout-abort-signal-DMrgRFIy.mjs} +0 -0
  368. /package/dist/{url-validation-GRHde6lq.js → .setup/url-validation-GRHde6lq.mjs} +0 -0
@@ -1,840 +1,651 @@
1
- 'use strict';
2
-
3
- var uc_micro = require('uc.micro');
4
-
5
- function reFactory (opts) {
6
- const re = {};
7
- opts = opts || {};
8
-
9
- re.src_Any = uc_micro.Any.source;
10
- re.src_Cc = uc_micro.Cc.source;
11
- re.src_Z = uc_micro.Z.source;
12
- re.src_P = uc_micro.P.source;
13
-
14
- // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation)
15
- re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join('|');
16
-
17
- // \p{\Z\Cc} (white spaces + control)
18
- re.src_ZCc = [re.src_Z, re.src_Cc].join('|');
19
-
20
- // Experimental. List of chars, completely prohibited in links
21
- // because can separate it from other part of text
22
- const text_separators = '[><\uff5c]';
23
-
24
- // All possible word characters (everything without punctuation, spaces & controls)
25
- // Defined via punctuation & spaces to save space
26
- // Should be something like \p{\L\N\S\M} (\w but without `_`)
27
- re.src_pseudo_letter = `(?:(?!${text_separators}|${re.src_ZPCc})${re.src_Any})`;
28
- // The same as abothe but without [0-9]
29
- // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
30
-
31
- re.src_ip4 =
32
-
33
- '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
34
-
35
- // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
36
- // Length is capped to exclude possible rescans till the end and avoid O(n^2)
37
- // DoS. No standard limit, just take something reasonable.
38
- re.src_auth = `(?:(?:(?!${re.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`;
39
-
40
- re.src_port =
41
-
42
- '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?';
43
-
44
- re.src_host_terminator =
45
-
46
- `(?=$|${text_separators}|${re.src_ZPCc})` +
47
- `(?!${opts['---'] ? '-(?!--)|' : '-|'}_|:\\d|\\.-|\\.(?!$|${re.src_ZPCc}))`;
48
-
49
- re.src_path =
50
-
51
- '(?:' +
52
- '[/?#]' +
53
- '(?:' +
54
- `(?!${re.src_ZCc}|${text_separators}|[()[\\]{}.,"'?!\\-;]).|` +
55
- `\\[(?:(?!${re.src_ZCc}|\\]).)*\\]|` +
56
- `\\((?:(?!${re.src_ZCc}|[)]).)*\\)|` +
57
- `\\{(?:(?!${re.src_ZCc}|[}]).)*\\}|` +
58
- `\\"(?:(?!${re.src_ZCc}|["]).)+\\"|` +
59
- `\\'(?:(?!${re.src_ZCc}|[']).)+\\'|` +
60
-
61
- // allow `I'm_king` if no pair found
62
- `\\'(?=${re.src_pseudo_letter}|[-])|` +
63
-
64
- // google has many dots in "google search" links (#66, #81).
65
- // github has ... in commit range links,
66
- // Restrict to
67
- // - english
68
- // - percent-encoded
69
- // - parts of file path
70
- // - params separator
71
- // until more examples found.
72
- '\\.{2,}[a-zA-Z0-9%/&]|' +
73
-
74
- `\\.(?!${re.src_ZCc}|[.]|$)|` +
75
- (opts['---']
76
- ? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
77
- : '\\-+|'
78
- ) +
79
- // allow `,,,` in paths
80
- `,(?!${re.src_ZCc}|$)|` +
81
-
82
- // allow `;` if not followed by space-like char
83
- `;(?!${re.src_ZCc}|$)|` +
84
-
85
- // allow `!!!` in paths, but not at the end
86
- `\\!+(?!${re.src_ZCc}|[!]|$)|` +
87
-
88
- `\\?(?!${re.src_ZCc}|[?]|$)` +
89
- ')+' +
90
- '|\\/' +
91
- ')?';
92
-
93
- // Allow anything in markdown spec, forbid quote (") at the first position
94
- // because emails enclosed in quotes are far more common
95
- // Max name length capped to 64 chars (RFC 5321). This also prevents O(n^2)
96
- // rescans to the end on inputs like `mailto:mailto:...`
97
- re.src_email_name =
98
-
99
- '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}';
100
-
101
- re.src_xn =
102
-
103
- 'xn--[a-z0-9\\-]{1,59}';
104
-
105
- // More to read about domain names
106
- // http://serverfault.com/questions/638260/
107
-
108
- re.src_domain_root =
109
-
110
- // Allow letters & digits (http://test1)
111
- '(?:' +
112
- re.src_xn +
113
- '|' +
114
- `${re.src_pseudo_letter}{1,63}` +
115
- ')';
116
-
117
- re.src_domain =
118
-
119
- '(?:' +
120
- re.src_xn +
121
- '|' +
122
- `(?:${re.src_pseudo_letter})` +
123
- '|' +
124
- `(?:${re.src_pseudo_letter}(?:-|${re.src_pseudo_letter}){0,61}${re.src_pseudo_letter})` +
125
- ')';
126
-
127
- re.src_host =
128
-
129
- '(?:' +
130
- // Don't need IP check, because digits are already allowed in normal domain names
131
- // src_ip4 +
132
- // '|' +
133
- `(?:(?:(?:${re.src_domain})\\.)*${re.src_domain})`/* _root */ +
134
- ')';
135
-
136
- re.tpl_host_fuzzy =
137
-
138
- '(?:' +
139
- re.src_ip4 +
140
- '|' +
141
- `(?:(?:(?:${re.src_domain})\\.)+(?:%TLDS%))` +
142
- ')';
143
-
144
- re.tpl_host_no_ip_fuzzy =
145
-
146
- `(?:(?:(?:${re.src_domain})\\.)+(?:%TLDS%))`;
147
-
148
- re.src_host_strict =
149
-
150
- re.src_host + re.src_host_terminator;
151
-
152
- re.tpl_host_fuzzy_strict =
153
-
154
- re.tpl_host_fuzzy + re.src_host_terminator;
155
-
156
- re.src_host_port_strict =
157
-
158
- re.src_host + re.src_port + re.src_host_terminator;
159
-
160
- re.tpl_host_port_fuzzy_strict =
161
-
162
- re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
163
-
164
- re.tpl_host_port_no_ip_fuzzy_strict =
165
-
166
- re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
167
-
168
- //
169
- // Main rules
170
- //
171
-
172
- // Rude test fuzzy links by host, for quick deny
173
- re.tpl_host_fuzzy_test =
174
-
175
- `localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${re.src_ZPCc}|>|$))`;
176
-
177
- re.tpl_email_fuzzy =
178
-
179
- `(^|${text_separators}|"|\\(|${re.src_ZCc})` +
180
- `(${re.src_email_name}@${re.tpl_host_fuzzy_strict})`;
181
-
182
- re.tpl_link_fuzzy =
183
- // Fuzzy link can't be prepended with .:/\- and non punctuation.
184
- // but can start with > (markdown blockquote)
185
- `(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${re.src_ZPCc}))` +
186
- `((?![$+<=>^\`|\uff5c])${re.tpl_host_port_fuzzy_strict}${re.src_path})`;
187
-
188
- re.tpl_link_no_ip_fuzzy =
189
- // Fuzzy link can't be prepended with .:/\- and non punctuation.
190
- // but can start with > (markdown blockquote)
191
- `(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${re.src_ZPCc}))` +
192
- `((?![$+<=>^\`|\uff5c])${re.tpl_host_port_no_ip_fuzzy_strict}${re.src_path})`;
193
-
194
- return re
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ let uc_micro = require("uc.micro");
3
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/typeof.js
4
+ function _typeof(o) {
5
+ "@babel/helpers - typeof";
6
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
7
+ return typeof o;
8
+ } : function(o) {
9
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
10
+ }, _typeof(o);
195
11
  }
196
-
197
- //
198
- // Helpers
199
- //
200
-
201
- // Merge objects
202
- //
203
- function assign (obj /* from1, from2, from3, ... */) {
204
- const sources = Array.prototype.slice.call(arguments, 1);
205
-
206
- sources.forEach(function (source) {
207
- if (!source) { return }
208
-
209
- Object.keys(source).forEach(function (key) {
210
- obj[key] = source[key];
211
- });
212
- });
213
-
214
- return obj
12
+ //#endregion
13
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/toPrimitive.js
14
+ function toPrimitive(t, r) {
15
+ if ("object" != _typeof(t) || !t) return t;
16
+ var e = t[Symbol.toPrimitive];
17
+ if (void 0 !== e) {
18
+ var i = e.call(t, r || "default");
19
+ if ("object" != _typeof(i)) return i;
20
+ throw new TypeError("@@toPrimitive must return a primitive value.");
21
+ }
22
+ return ("string" === r ? String : Number)(t);
215
23
  }
216
-
217
- function _class (obj) { return Object.prototype.toString.call(obj) }
218
- function isString (obj) { return _class(obj) === '[object String]' }
219
- function isObject (obj) { return _class(obj) === '[object Object]' }
220
- function isRegExp (obj) { return _class(obj) === '[object RegExp]' }
221
- function isFunction (obj) { return _class(obj) === '[object Function]' }
222
-
223
- function escapeRE (str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&') }
224
-
225
- //
226
-
227
- const defaultOptions = {
228
- fuzzyLink: true,
229
- fuzzyEmail: true,
230
- fuzzyIP: false
231
- };
232
-
233
- function isOptionsObj (obj) {
234
- return Object.keys(obj || {}).reduce(function (acc, k) {
235
- /* eslint-disable-next-line no-prototype-builtins */
236
- return acc || defaultOptions.hasOwnProperty(k)
237
- }, false)
24
+ //#endregion
25
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/toPropertyKey.js
26
+ function toPropertyKey(t) {
27
+ var i = toPrimitive(t, "string");
28
+ return "symbol" == _typeof(i) ? i : i + "";
238
29
  }
239
-
240
- const defaultSchemas = {
241
- 'http:': {
242
- validate: function (text, pos, self) {
243
- const tail = text.slice(pos);
244
-
245
- if (!self.re.http) {
246
- // compile lazily, because "host"-containing variables can change on tlds update.
247
- self.re.http = new RegExp(
248
- `^\\/\\/${self.re.src_auth}${self.re.src_host_port_strict}${self.re.src_path}`, 'i'
249
- );
250
- }
251
- if (self.re.http.test(tail)) {
252
- return tail.match(self.re.http)[0].length
253
- }
254
- return 0
255
- }
256
- },
257
- 'https:': 'http:',
258
- 'ftp:': 'http:',
259
- '//': {
260
- validate: function (text, pos, self) {
261
- const tail = text.slice(pos);
262
-
263
- if (!self.re.no_http) {
264
- // compile lazily, because "host"-containing variables can change on tlds update.
265
- self.re.no_http = new RegExp(
266
- '^' +
267
- self.re.src_auth +
268
- // Don't allow single-level domains, because of false positives like '//test'
269
- // with code comments
270
- `(?:localhost|(?:(?:${self.re.src_domain})\\.)+${self.re.src_domain_root})` +
271
- self.re.src_port +
272
- self.re.src_host_terminator +
273
- self.re.src_path,
274
-
275
- 'i'
276
- );
277
- }
278
-
279
- if (self.re.no_http.test(tail)) {
280
- // should not be `://` & `///`, that protects from errors in protocol name
281
- if (pos >= 3 && text[pos - 3] === ':') { return 0 }
282
- if (pos >= 3 && text[pos - 3] === '/') { return 0 }
283
- return tail.match(self.re.no_http)[0].length
284
- }
285
- return 0
286
- }
287
- },
288
- 'mailto:': {
289
- validate: function (text, pos, self) {
290
- const tail = text.slice(pos);
291
-
292
- if (!self.re.mailto) {
293
- self.re.mailto = new RegExp(
294
- `^${self.re.src_email_name}@${self.re.src_host_strict}`, 'i'
295
- );
296
- }
297
- if (self.re.mailto.test(tail)) {
298
- return tail.match(self.re.mailto)[0].length
299
- }
300
- return 0
301
- }
302
- }
303
- };
304
-
305
- // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
306
- const tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
307
-
308
- // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
309
- const tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|');
310
-
311
- function createValidator (re) {
312
- return function (text, pos) {
313
- const tail = text.slice(pos);
314
-
315
- if (re.test(tail)) {
316
- return tail.match(re)[0].length
317
- }
318
- return 0
319
- }
30
+ //#endregion
31
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/defineProperty.js
32
+ function _defineProperty(e, r, t) {
33
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
34
+ value: t,
35
+ enumerable: !0,
36
+ configurable: !0,
37
+ writable: !0
38
+ }) : e[r] = t, e;
320
39
  }
321
-
322
- function createNormalizer () {
323
- return function (match, self) {
324
- self.normalize(match);
325
- }
40
+ //#endregion
41
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/objectSpread2.js
42
+ function ownKeys(e, r) {
43
+ var t = Object.keys(e);
44
+ if (Object.getOwnPropertySymbols) {
45
+ var o = Object.getOwnPropertySymbols(e);
46
+ r && (o = o.filter(function(r) {
47
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
48
+ })), t.push.apply(t, o);
49
+ }
50
+ return t;
326
51
  }
327
-
328
- // Schemas compiler. Build regexps.
329
- //
330
- function compile (self) {
331
- // Load & clone RE patterns.
332
- const re = self.re = reFactory(self.__opts__);
333
-
334
- // Define dynamic patterns
335
- const tlds = self.__tlds__.slice();
336
-
337
- self.onCompile();
338
-
339
- if (!self.__tlds_replaced__) {
340
- tlds.push(tlds_2ch_src_re);
341
- }
342
- tlds.push(re.src_xn);
343
-
344
- re.src_tlds = tlds.join('|');
345
-
346
- function untpl (tpl) { return tpl.replace('%TLDS%', re.src_tlds) }
347
-
348
- re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i');
349
- re.email_fuzzy_global = RegExp(untpl(re.tpl_email_fuzzy), 'ig');
350
- re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i');
351
- re.link_fuzzy_global = RegExp(untpl(re.tpl_link_fuzzy), 'ig');
352
- re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i');
353
- re.link_no_ip_fuzzy_global = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'ig');
354
- re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i');
355
-
356
- //
357
- // Compile each schema
358
- //
359
-
360
- const aliases = [];
361
-
362
- self.__compiled__ = {}; // Reset compiled data
363
-
364
- function schemaError (name, val) {
365
- throw new Error(`(LinkifyIt) Invalid schema "${name}": ${val}`)
366
- }
367
-
368
- Object.keys(self.__schemas__).forEach(function (name) {
369
- const val = self.__schemas__[name];
370
-
371
- // skip disabled methods
372
- if (val === null) { return }
373
-
374
- const compiled = { validate: null, link: null };
375
-
376
- self.__compiled__[name] = compiled;
377
-
378
- if (isObject(val)) {
379
- if (isRegExp(val.validate)) {
380
- compiled.validate = createValidator(val.validate);
381
- } else if (isFunction(val.validate)) {
382
- compiled.validate = val.validate;
383
- } else {
384
- schemaError(name, val);
385
- }
386
-
387
- if (isFunction(val.normalize)) {
388
- compiled.normalize = val.normalize;
389
- } else if (!val.normalize) {
390
- compiled.normalize = createNormalizer();
391
- } else {
392
- schemaError(name, val);
393
- }
394
-
395
- return
396
- }
397
-
398
- if (isString(val)) {
399
- aliases.push(name);
400
- return
401
- }
402
-
403
- schemaError(name, val);
404
- });
405
-
406
- //
407
- // Compile postponed aliases
408
- //
409
-
410
- aliases.forEach(function (alias) {
411
- if (!self.__compiled__[self.__schemas__[alias]]) {
412
- // Silently fail on missed schemas to avoid errons on disable.
413
- // schemaError(alias, self.__schemas__[alias]);
414
- return
415
- }
416
-
417
- self.__compiled__[alias].validate =
418
- self.__compiled__[self.__schemas__[alias]].validate;
419
- self.__compiled__[alias].normalize =
420
- self.__compiled__[self.__schemas__[alias]].normalize;
421
- });
422
-
423
- //
424
- // Fake record for guessed links
425
- //
426
- self.__compiled__[''] = { validate: null, normalize: createNormalizer() };
427
-
428
- //
429
- // Build schema condition
430
- //
431
- const slist = Object.keys(self.__compiled__)
432
- .filter(function (name) {
433
- // Filter disabled & fake schemas
434
- return name.length > 0 && self.__compiled__[name]
435
- })
436
- .map(escapeRE)
437
- .join('|');
438
- // (?!_) cause 1.5x slowdown
439
- self.re.schema_test = RegExp(`(^|(?!_)(?:[><\uff5c]|${re.src_ZPCc}))(${slist})`, 'i');
440
- self.re.schema_search = RegExp(`(^|(?!_)(?:[><\uff5c]|${re.src_ZPCc}))(${slist})`, 'ig');
441
- self.re.schema_at_start = RegExp(`^${self.re.schema_search.source}`, 'i');
442
-
443
- self.re.pretest = RegExp(
444
- `(${self.re.schema_test.source})|(${self.re.host_fuzzy_test.source})|@`,
445
- 'i'
446
- );
52
+ function _objectSpread2(e) {
53
+ for (var r = 1; r < arguments.length; r++) {
54
+ var t = null != arguments[r] ? arguments[r] : {};
55
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
56
+ _defineProperty(e, r, t[r]);
57
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
58
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
59
+ });
60
+ }
61
+ return e;
447
62
  }
448
-
449
- /**
450
- * class Match
451
- *
452
- * Match result. Single element of array, returned by [[LinkifyIt#match]]
453
- **/
454
- function Match (text, schema, index, lastIndex) {
455
- const raw = text.slice(index, lastIndex);
456
-
457
- /**
458
- * Match#schema -> String
459
- *
460
- * Prefix (protocol) for matched string.
461
- **/
462
- this.schema = schema.toLowerCase();
463
- /**
464
- * Match#index -> Number
465
- *
466
- * First position of matched string.
467
- **/
468
- this.index = index;
469
- /**
470
- * Match#lastIndex -> Number
471
- *
472
- * Next position after matched string.
473
- **/
474
- this.lastIndex = lastIndex;
475
- /**
476
- * Match#raw -> String
477
- *
478
- * Matched string.
479
- **/
480
- this.raw = raw;
481
- /**
482
- * Match#text -> String
483
- *
484
- * Notmalized text of matched string.
485
- **/
486
- this.text = raw;
487
- /**
488
- * Match#url -> String
489
- *
490
- * Normalized url of matched string.
491
- **/
492
- this.url = raw;
63
+ //#endregion
64
+ //#region src/rebuilder.ts
65
+ var REBuilder = class {
66
+ constructor(opts = {}) {
67
+ _defineProperty(this, "src_Any", uc_micro.Any.source);
68
+ _defineProperty(this, "src_Cc", uc_micro.Cc.source);
69
+ _defineProperty(this, "src_Z", uc_micro.Z.source);
70
+ _defineProperty(this, "src_P", uc_micro.P.source);
71
+ _defineProperty(this, "src_ZPCc", [
72
+ this.src_Z,
73
+ this.src_P,
74
+ this.src_Cc
75
+ ].join("|"));
76
+ _defineProperty(this, "src_ZCc", [this.src_Z, this.src_Cc].join("|"));
77
+ _defineProperty(this, "cache", {});
78
+ _defineProperty(this, "opts", {
79
+ maxLength: 1e4,
80
+ urlAuth: false,
81
+ schema_names: []
82
+ });
83
+ this.opts = _objectSpread2(_objectSpread2({}, this.opts), opts);
84
+ }
85
+ set(opts = {}) {
86
+ this.opts = _objectSpread2(_objectSpread2({}, this.opts), opts);
87
+ this.cache = {};
88
+ return this;
89
+ }
90
+ escapeRE(str) {
91
+ return str.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
92
+ }
93
+ nestedPairRE(open, close, depth = 4) {
94
+ const openRE = this.escapeRE(open);
95
+ const closeRE = this.escapeRE(close);
96
+ const atom = `(?:(?!${this.src_ZCc}|${openRE}|${closeRE}).)`;
97
+ let pair = `${openRE}${atom}{0,1000}${closeRE}`;
98
+ for (let level = 2; level <= depth; level++) pair = `${openRE}(?:${atom}|${pair}){0,1000}${closeRE}`;
99
+ return pair;
100
+ }
101
+ get_text_separators() {
102
+ var _this$cache, _this$cache$text_sepa;
103
+ return (_this$cache$text_sepa = (_this$cache = this.cache).text_separators) !== null && _this$cache$text_sepa !== void 0 ? _this$cache$text_sepa : _this$cache.text_separators = /[><\uff5c]/;
104
+ }
105
+ get_pseudo_letter() {
106
+ var _this$cache2, _this$cache2$src_pseu;
107
+ return (_this$cache2$src_pseu = (_this$cache2 = this.cache).src_pseudo_letter) !== null && _this$cache2$src_pseu !== void 0 ? _this$cache2$src_pseu : _this$cache2.src_pseudo_letter = new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`);
108
+ }
109
+ get_ipv4_addr() {
110
+ var _this$cache3, _this$cache3$src_ip;
111
+ return (_this$cache3$src_ip = (_this$cache3 = this.cache).src_ip4) !== null && _this$cache3$src_ip !== void 0 ? _this$cache3$src_ip : _this$cache3.src_ip4 = /* @__PURE__ */ new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])");
112
+ }
113
+ get_ipv6_addr() {
114
+ var _this$cache4, _this$cache4$src_ip6_;
115
+ const h16 = "[0-9A-Fa-f]{1,4}";
116
+ const ls32 = `(?:(?:${h16}:${h16})|${this.get_ipv4_addr().source})`;
117
+ return (_this$cache4$src_ip6_ = (_this$cache4 = this.cache).src_ip6_addr) !== null && _this$cache4$src_ip6_ !== void 0 ? _this$cache4$src_ip6_ : _this$cache4.src_ip6_addr = new RegExp(`(?:(?:${h16}:){6}${ls32}|::(?:${h16}:){5}${ls32}|(?:${h16})?::(?:${h16}:){4}${ls32}|(?:(?:${h16}:){0,1}${h16})?::(?:${h16}:){3}${ls32}|(?:(?:${h16}:){0,2}${h16})?::(?:${h16}:){2}${ls32}|(?:(?:${h16}:){0,3}${h16})?::${h16}:${ls32}|(?:(?:${h16}:){0,4}${h16})?::${ls32}|(?:(?:${h16}:){0,5}${h16})?::${h16}|(?:(?:${h16}:){0,6}${h16})?::)`);
118
+ }
119
+ get_ipv6_url_host() {
120
+ var _this$cache5, _this$cache5$src_ip6_;
121
+ return (_this$cache5$src_ip6_ = (_this$cache5 = this.cache).src_ip6_host) !== null && _this$cache5$src_ip6_ !== void 0 ? _this$cache5$src_ip6_ : _this$cache5.src_ip6_host = new RegExp(`\\[${this.get_ipv6_addr().source}\\]`);
122
+ }
123
+ get_ipv6_mail_host() {
124
+ var _this$cache6, _this$cache6$src_ipv;
125
+ return (_this$cache6$src_ipv = (_this$cache6 = this.cache).src_ipv6_mail_host) !== null && _this$cache6$src_ipv !== void 0 ? _this$cache6$src_ipv : _this$cache6.src_ipv6_mail_host = new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`);
126
+ }
127
+ get_auth() {
128
+ var _this$cache7, _this$cache7$src_auth;
129
+ return (_this$cache7$src_auth = (_this$cache7 = this.cache).src_auth) !== null && _this$cache7$src_auth !== void 0 ? _this$cache7$src_auth : _this$cache7.src_auth = new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`);
130
+ }
131
+ get_port() {
132
+ var _this$cache8, _this$cache8$src_port;
133
+ return (_this$cache8$src_port = (_this$cache8 = this.cache).src_port) !== null && _this$cache8$src_port !== void 0 ? _this$cache8$src_port : _this$cache8.src_port = /* @__PURE__ */ new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?");
134
+ }
135
+ get_host_terminator() {
136
+ var _this$cache9, _this$cache9$src_host;
137
+ return (_this$cache9$src_host = (_this$cache9 = this.cache).src_host_terminator) !== null && _this$cache9$src_host !== void 0 ? _this$cache9$src_host : _this$cache9.src_host_terminator = new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"] ? "-(?!--)|" : "-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`);
138
+ }
139
+ get_path_terminator() {
140
+ var _this$cache10, _this$cache10$src_pat;
141
+ return (_this$cache10$src_pat = (_this$cache10 = this.cache).src_path_terminator) !== null && _this$cache10$src_pat !== void 0 ? _this$cache10$src_pat : _this$cache10.src_path_terminator = new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`);
142
+ }
143
+ get_path() {
144
+ var _this$cache11, _this$cache11$src_pat;
145
+ return (_this$cache11$src_pat = (_this$cache11 = this.cache).src_path) !== null && _this$cache11$src_pat !== void 0 ? _this$cache11$src_pat : _this$cache11.src_path = new RegExp(`(?:[/?#](?:${this.nestedPairRE("[", "]")}|${this.nestedPairRE("(", ")")}|${this.nestedPairRE("{", "}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|` + (this.opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-{0,19})|" : "\\-{1,20}|") + `,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|` + this.get_path_extra().source + `[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`);
146
+ }
147
+ get_mail_name() {
148
+ var _this$cache12, _this$cache12$src_mai;
149
+ return (_this$cache12$src_mai = (_this$cache12 = this.cache).src_mail_name) !== null && _this$cache12$src_mai !== void 0 ? _this$cache12$src_mai : _this$cache12.src_mail_name = /* @__PURE__ */ new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}");
150
+ }
151
+ get_xn() {
152
+ var _this$cache13, _this$cache13$src_xn;
153
+ return (_this$cache13$src_xn = (_this$cache13 = this.cache).src_xn) !== null && _this$cache13$src_xn !== void 0 ? _this$cache13$src_xn : _this$cache13.src_xn = /* @__PURE__ */ new RegExp("xn--[a-z0-9\\-]{1,59}");
154
+ }
155
+ get_tld() {
156
+ if (this.cache.tld) return this.cache.tld;
157
+ const tlds_src = [...new Set(this.opts.tlds || [])].sort().reverse().join("|");
158
+ this.cache.tld = new RegExp(`${tlds_src || "$#none#$"}|${this.get_xn().source}`);
159
+ return this.cache.tld;
160
+ }
161
+ get_domain_root() {
162
+ var _this$cache14, _this$cache14$src_dom;
163
+ return (_this$cache14$src_dom = (_this$cache14 = this.cache).src_domain_root) !== null && _this$cache14$src_dom !== void 0 ? _this$cache14$src_dom : _this$cache14.src_domain_root = new RegExp("(?:" + this.get_xn().source + `|${this.get_pseudo_letter().source}{1,63})`);
164
+ }
165
+ get_domain() {
166
+ var _this$cache15, _this$cache15$src_dom;
167
+ return (_this$cache15$src_dom = (_this$cache15 = this.cache).src_domain) !== null && _this$cache15$src_dom !== void 0 ? _this$cache15$src_dom : _this$cache15.src_domain = new RegExp("(?:" + this.get_xn().source + `|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`);
168
+ }
169
+ get_url_host_port() {
170
+ var _this$cache16, _this$cache16$url_hos;
171
+ return (_this$cache16$url_hos = (_this$cache16 = this.cache).url_host_port) !== null && _this$cache16$url_hos !== void 0 ? _this$cache16$url_hos : _this$cache16.url_host_port = new RegExp("(?:" + this.get_ipv6_url_host().source + `|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))` + this.get_port().source + this.get_host_terminator().source);
172
+ }
173
+ get_fuzzy_url_host_port() {
174
+ var _this$cache17, _this$cache17$fuzzy_u;
175
+ return (_this$cache17$fuzzy_u = (_this$cache17 = this.cache).fuzzy_url_host_port) !== null && _this$cache17$fuzzy_u !== void 0 ? _this$cache17$fuzzy_u : _this$cache17.fuzzy_url_host_port = new RegExp("(?:" + (this.opts.fuzzyIP ? this.get_ipv4_addr().source + "|" : "") + `(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))` + this.get_host_terminator().source);
176
+ }
177
+ get_mail_host() {
178
+ var _this$cache18, _this$cache18$src_mai;
179
+ return (_this$cache18$src_mai = (_this$cache18 = this.cache).src_mail_host) !== null && _this$cache18$src_mai !== void 0 ? _this$cache18$src_mai : _this$cache18.src_mail_host = new RegExp("(?:" + this.get_ipv6_mail_host().source + `|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))` + this.get_host_terminator().source);
180
+ }
181
+ get_fuzzy_mail_host() {
182
+ var _this$cache19, _this$cache19$src_fuz;
183
+ return (_this$cache19$src_fuz = (_this$cache19 = this.cache).src_fuzzy_mail_host) !== null && _this$cache19$src_fuz !== void 0 ? _this$cache19$src_fuz : _this$cache19.src_fuzzy_mail_host = new RegExp("(?:" + this.get_ipv6_mail_host().source + `|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))` + this.get_host_terminator().source);
184
+ }
185
+ get_path_extra() {
186
+ var _this$cache20, _this$cache20$src_pat;
187
+ return (_this$cache20$src_pat = (_this$cache20 = this.cache).src_path_extra) !== null && _this$cache20$src_pat !== void 0 ? _this$cache20$src_pat : _this$cache20.src_path_extra = /* @__PURE__ */ new RegExp("");
188
+ }
189
+ get_fuzzy_mail_host_search() {
190
+ var _this$cache21, _this$cache21$mail_fu;
191
+ return (_this$cache21$mail_fu = (_this$cache21 = this.cache).mail_fuzzy_host_search) !== null && _this$cache21$mail_fu !== void 0 ? _this$cache21$mail_fu : _this$cache21.mail_fuzzy_host_search = new RegExp(`@${this.get_fuzzy_mail_host().source}`, "ig");
192
+ }
193
+ get_fuzzy_link_search() {
194
+ var _this$cache22, _this$cache22$link_fu;
195
+ return (_this$cache22$link_fu = (_this$cache22 = this.cache).link_fuzzy_search) !== null && _this$cache22$link_fu !== void 0 ? _this$cache22$link_fu : _this$cache22.link_fuzzy_search = new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${this.src_ZPCc}))(?:(?![$+<=>^\`|\uff5c])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`, "ig");
196
+ }
197
+ get_http_validator() {
198
+ var _this$cache23, _this$cache23$http_va;
199
+ return (_this$cache23$http_va = (_this$cache23 = this.cache).http_validator) !== null && _this$cache23$http_va !== void 0 ? _this$cache23$http_va : _this$cache23.http_validator = new RegExp("\\/\\/" + (this.opts.urlAuth ? this.get_auth().source : "") + this.get_url_host_port().source + this.get_path().source, "iy");
200
+ }
201
+ get_relative_proto_validator() {
202
+ var _this$cache24, _this$cache24$relativ;
203
+ return (_this$cache24$relativ = (_this$cache24 = this.cache).relative_proto_validator) !== null && _this$cache24$relativ !== void 0 ? _this$cache24$relativ : _this$cache24.relative_proto_validator = new RegExp((this.opts.urlAuth ? this.get_auth().source : "") + `(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})` + this.get_port().source + this.get_host_terminator().source + this.get_path().source, "iy");
204
+ }
205
+ get_mail_name_validator() {
206
+ var _this$cache25, _this$cache25$mail_na;
207
+ return (_this$cache25$mail_na = (_this$cache25 = this.cache).mail_name_validator) !== null && _this$cache25$mail_na !== void 0 ? _this$cache25$mail_na : _this$cache25.mail_name_validator = new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`);
208
+ }
209
+ get_mailto_validator() {
210
+ var _this$cache26, _this$cache26$mailto_;
211
+ return (_this$cache26$mailto_ = (_this$cache26 = this.cache).mailto_validator) !== null && _this$cache26$mailto_ !== void 0 ? _this$cache26$mailto_ : _this$cache26.mailto_validator = new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`, "iy");
212
+ }
213
+ get_schema_names() {
214
+ var _this$cache27, _this$cache27$schema_;
215
+ return (_this$cache27$schema_ = (_this$cache27 = this.cache).schema_names) !== null && _this$cache27$schema_ !== void 0 ? _this$cache27$schema_ : _this$cache27.schema_names = new RegExp((this.opts.schema_names || []).map((name) => this.escapeRE(name)).join("|"));
216
+ }
217
+ get_schema_search() {
218
+ var _this$cache28, _this$cache28$schema_;
219
+ return (_this$cache28$schema_ = (_this$cache28 = this.cache).schema_search) !== null && _this$cache28$schema_ !== void 0 ? _this$cache28$schema_ : _this$cache28.schema_search = new RegExp(`(^|(?!_)(?:[><\uff5c]|${this.src_ZPCc}))(${this.get_schema_names().source})`, "ig");
220
+ }
221
+ get_schema_at_start() {
222
+ var _this$cache29, _this$cache29$schema_;
223
+ return (_this$cache29$schema_ = (_this$cache29 = this.cache).schema_at_start) !== null && _this$cache29$schema_ !== void 0 ? _this$cache29$schema_ : _this$cache29.schema_at_start = new RegExp(`^${this.get_schema_search().source}`, "i");
224
+ }
225
+ };
226
+ //#endregion
227
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/objectWithoutPropertiesLoose.js
228
+ function _objectWithoutPropertiesLoose(r, e) {
229
+ if (null == r) return {};
230
+ var t = {};
231
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
232
+ if (e.includes(n)) continue;
233
+ t[n] = r[n];
234
+ }
235
+ return t;
493
236
  }
494
-
495
- /**
496
- * class LinkifyIt
497
- **/
498
-
499
- /**
500
- * new LinkifyIt(schemas, options)
501
- * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)
502
- * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
503
- *
504
- * Creates new linkifier instance with optional additional schemas.
505
- * Can be called without `new` keyword for convenience.
506
- *
507
- * By default understands:
508
- *
509
- * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
510
- * - "fuzzy" links and emails (example.com, foo@bar.com).
511
- *
512
- * `schemas` is an object, where each key/value describes protocol/rule:
513
- *
514
- * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`
515
- * for example). `linkify-it` makes shure that prefix is not preceeded with
516
- * alphanumeric char and symbols. Only whitespaces and punctuation allowed.
517
- * - __value__ - rule to check tail after link prefix
518
- * - _String_ - just alias to existing rule
519
- * - _Object_
520
- * - _validate_ - validator function (should return matched length on success),
521
- * or `RegExp`.
522
- * - _normalize_ - optional function to normalize text & url of matched result
523
- * (for example, for @twitter mentions).
524
- *
525
- * `options`:
526
- *
527
- * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.
528
- * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts
529
- * like version numbers. Default `false`.
530
- * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.
531
- *
532
- **/
533
- function LinkifyIt (schemas, options) {
534
- if (!(this instanceof LinkifyIt)) {
535
- return new LinkifyIt(schemas, options)
536
- }
537
-
538
- if (!options) {
539
- if (isOptionsObj(schemas)) {
540
- options = schemas;
541
- schemas = {};
542
- }
543
- }
544
-
545
- this.__opts__ = assign({}, defaultOptions, options);
546
-
547
- this.__schemas__ = assign({}, defaultSchemas, schemas);
548
- this.__compiled__ = {};
549
-
550
- this.__tlds__ = tlds_default;
551
- this.__tlds_replaced__ = false;
552
-
553
- this.re = {};
554
-
555
- compile(this);
237
+ //#endregion
238
+ //#region \0@oxc-project+runtime@0.138.0/helpers/esm/objectWithoutProperties.js
239
+ function _objectWithoutProperties(e, t) {
240
+ if (null == e) return {};
241
+ var o, r, i = _objectWithoutPropertiesLoose(e, t);
242
+ if (Object.getOwnPropertySymbols) {
243
+ var s = Object.getOwnPropertySymbols(e);
244
+ for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
245
+ }
246
+ return i;
556
247
  }
557
-
558
- /** chainable
559
- * LinkifyIt#add(schema, definition)
560
- * - schema (String): rule name (fixed pattern prefix)
561
- * - definition (String|RegExp|Object): schema definition
562
- *
563
- * Add new rule definition. See constructor description for details.
564
- **/
565
- LinkifyIt.prototype.add = function add (schema, definition) {
566
- this.__schemas__[schema] = definition;
567
- compile(this);
568
- return this
569
- };
570
-
571
- /** chainable
572
- * LinkifyIt#set(options)
573
- * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }
574
- *
575
- * Set recognition options for links without schema.
576
- **/
577
- LinkifyIt.prototype.set = function set (options) {
578
- this.__opts__ = assign(this.__opts__, options);
579
- return this
580
- };
581
-
582
- /**
583
- * LinkifyIt#test(text) -> Boolean
584
- *
585
- * Searches linkifiable pattern and returns `true` on success or `false` on fail.
586
- **/
587
- LinkifyIt.prototype.test = function test (text) {
588
- if (!text.length) { return false }
589
-
590
- let m, re;
591
-
592
- // try to scan for link with schema - that's the most simple rule
593
- if (this.re.schema_test.test(text)) {
594
- re = this.re.schema_search;
595
- re.lastIndex = 0;
596
- while ((m = re.exec(text)) !== null) {
597
- if (this.testSchemaAt(text, m[2], re.lastIndex)) { return true }
598
- }
599
- }
600
-
601
- if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
602
- // guess schemaless links
603
- if (text.search(this.re.host_fuzzy_test) >= 0) {
604
- if (text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy) !== null) {
605
- return true
606
- }
607
- }
608
- }
609
-
610
- if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
611
- // guess schemaless emails
612
- if (text.indexOf('@') >= 0) {
613
- // We can't skip this check, because this cases are possible:
614
- // 192.168.1.1@gmail.com, my.in@example.com
615
- if (text.match(this.re.email_fuzzy) !== null) { return true }
616
- }
617
- }
618
-
619
- return false
620
- };
621
-
622
- /**
623
- * LinkifyIt#pretest(text) -> Boolean
624
- *
625
- * Very quick check, that can give false positives. Returns true if link MAY BE
626
- * can exists. Can be used for speed optimization, when you need to check that
627
- * link NOT exists.
628
- **/
629
- LinkifyIt.prototype.pretest = function pretest (text) {
630
- return this.re.pretest.test(text)
631
- };
632
-
633
- /**
634
- * LinkifyIt#testSchemaAt(text, name, position) -> Number
635
- * - text (String): text to scan
636
- * - name (String): rule (schema) name
637
- * - position (Number): text offset to check from
638
- *
639
- * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly
640
- * at given position. Returns length of found pattern (0 on fail).
641
- **/
642
- LinkifyIt.prototype.testSchemaAt = function testSchemaAt (text, schema, pos) {
643
- // If not supported schema check requested - terminate
644
- if (!this.__compiled__[schema.toLowerCase()]) {
645
- return 0
646
- }
647
- return this.__compiled__[schema.toLowerCase()].validate(text, pos, this)
648
- };
649
-
650
- /**
651
- * LinkifyIt#match(text) -> Array|null
652
- *
653
- * Returns array of found link descriptions or `null` on fail. We strongly
654
- * recommend to use [[LinkifyIt#test]] first, for best speed.
655
- *
656
- * ##### Result match description
657
- *
658
- * - __schema__ - link schema, can be empty for fuzzy links, or `//` for
659
- * protocol-neutral links.
660
- * - __index__ - offset of matched text
661
- * - __lastIndex__ - index of next char after mathch end
662
- * - __raw__ - matched text
663
- * - __text__ - normalized text
664
- * - __url__ - link, generated from matched text
665
- **/
666
- LinkifyIt.prototype.match = function match (text) {
667
- const result = [];
668
- const type_schemed = [];
669
- const type_fuzzy_link = [];
670
- const type_fuzzy_email = [];
671
- let m, len, re;
672
-
673
- function choose (a, b) {
674
- if (!a) { return b }
675
- if (!b) { return a }
676
- if (a.index !== b.index) { return a.index < b.index ? a : b }
677
- return a.lastIndex >= b.lastIndex ? a : b
678
- }
679
-
680
- if (!text.length) { return null }
681
-
682
- // scan for links with schema
683
- if (this.re.schema_test.test(text)) {
684
- re = this.re.schema_search;
685
- re.lastIndex = 0;
686
- while ((m = re.exec(text)) !== null) {
687
- len = this.testSchemaAt(text, m[2], re.lastIndex);
688
- if (len) {
689
- type_schemed.push({
690
- schema: m[2],
691
- index: m.index + m[1].length,
692
- lastIndex: m.index + m[0].length + len
693
- });
694
- }
695
- }
696
- }
697
-
698
- if (this.__opts__.fuzzyLink && this.__compiled__['http:']) {
699
- re = this.__opts__.fuzzyIP ? this.re.link_fuzzy_global : this.re.link_no_ip_fuzzy_global;
700
- re.lastIndex = 0;
701
- while ((m = re.exec(text)) !== null) {
702
- type_fuzzy_link.push({
703
- schema: '',
704
- index: m.index + m[1].length,
705
- lastIndex: m.index + m[0].length
706
- });
707
- }
708
- }
709
-
710
- if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) {
711
- re = this.re.email_fuzzy_global;
712
- re.lastIndex = 0;
713
- while ((m = re.exec(text)) !== null) {
714
- type_fuzzy_email.push({
715
- schema: 'mailto:',
716
- index: m.index + m[1].length,
717
- lastIndex: m.index + m[0].length
718
- });
719
- }
720
- }
721
-
722
- const indexes = [0, 0, 0];
723
- let lastIndex = 0;
724
-
725
- for (;;) {
726
- const candidates = [
727
- type_schemed[indexes[0]],
728
- type_fuzzy_email[indexes[1]],
729
- type_fuzzy_link[indexes[2]]
730
- ];
731
-
732
- const candidate = choose(choose(candidates[0], candidates[1]), candidates[2]);
733
-
734
- if (!candidate) { break }
735
-
736
- if (candidate === candidates[0]) {
737
- indexes[0]++;
738
- } else if (candidate === candidates[1]) {
739
- indexes[1]++;
740
- } else {
741
- indexes[2]++;
742
- }
743
-
744
- if (candidate.index < lastIndex) { continue }
745
-
746
- const match = new Match(text, candidate.schema, candidate.index, candidate.lastIndex);
747
- this.__compiled__[match.schema].normalize(match, this);
748
- result.push(match);
749
- lastIndex = candidate.lastIndex;
750
- }
751
-
752
- if (result.length) {
753
- return result
754
- }
755
-
756
- return null
248
+ //#endregion
249
+ //#region src/linkifyit.ts
250
+ var _excluded = ["rebuilder"];
251
+ var web_schema = {
252
+ validate: (text, pos, self) => {
253
+ const re = self.re.get_http_validator();
254
+ re.lastIndex = pos;
255
+ const m = re.exec(text);
256
+ return m ? m[0].length : 0;
257
+ },
258
+ normalize: (match, self) => self.normalize(match)
757
259
  };
758
-
759
- /**
760
- * LinkifyIt#matchAtStart(text) -> Match|null
761
- *
762
- * Returns fully-formed (not fuzzy) link if it starts at the beginning
763
- * of the string, and null otherwise.
764
- **/
765
- LinkifyIt.prototype.matchAtStart = function matchAtStart (text) {
766
- if (!text.length) return null
767
-
768
- const m = this.re.schema_at_start.exec(text);
769
- if (!m) return null
770
-
771
- const len = this.testSchemaAt(text, m[2], m[0].length);
772
- if (!len) return null
773
-
774
- const match = new Match(text, m[2], m.index + m[1].length, m.index + m[0].length + len);
775
-
776
- this.__compiled__[match.schema].normalize(match, this);
777
- return match
260
+ var defaultSchemas = {
261
+ "http:": web_schema,
262
+ "https:": web_schema,
263
+ "ftp:": web_schema,
264
+ "//": {
265
+ validate: function(text, pos, self) {
266
+ const re = self.re.get_relative_proto_validator();
267
+ re.lastIndex = pos;
268
+ const m = re.exec(text);
269
+ if (m) {
270
+ if (pos >= 3 && text[pos - 3] === ":") return 0;
271
+ if (pos >= 3 && text[pos - 3] === "/") return 0;
272
+ return m[0].length;
273
+ }
274
+ return 0;
275
+ },
276
+ normalize: (match, self) => self.normalize(match)
277
+ },
278
+ "mailto:": {
279
+ validate: function(text, pos, self) {
280
+ const re = self.re.get_mailto_validator();
281
+ re.lastIndex = pos;
282
+ const m = re.exec(text);
283
+ return m ? m[0].length : 0;
284
+ },
285
+ normalize: (match, self) => self.normalize(match)
286
+ }
778
287
  };
779
-
780
- /** chainable
781
- * LinkifyIt#tlds(list [, keepOld]) -> this
782
- * - list (Array): list of tlds
783
- * - keepOld (Boolean): merge with current list if `true` (`false` by default)
784
- *
785
- * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)
786
- * to avoid false positives. By default this algorythm used:
787
- *
788
- * - hostname with any 2-letter root zones are ok.
789
- * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
790
- * are ok.
791
- * - encoded (`xn--...`) root zones are ok.
792
- *
793
- * If list is replaced, then exact match for 2-chars root zones will be checked.
794
- **/
795
- LinkifyIt.prototype.tlds = function tlds (list, keepOld) {
796
- list = Array.isArray(list) ? list : [list];
797
-
798
- if (!keepOld) {
799
- this.__tlds__ = list.slice();
800
- this.__tlds_replaced__ = true;
801
- compile(this);
802
- return this
803
- }
804
-
805
- this.__tlds__ = this.__tlds__.concat(list)
806
- .sort()
807
- .filter(function (el, idx, arr) {
808
- return el !== arr[idx - 1]
809
- })
810
- .reverse();
811
-
812
- compile(this);
813
- return this
288
+ var tlds_2ch = "a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw";
289
+ var tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";
290
+ function unpackTlds() {
291
+ const result = tlds_default.split("|");
292
+ tlds_2ch.split("|").forEach((item) => {
293
+ const sep = item.indexOf(":");
294
+ const prefix = item.slice(0, sep);
295
+ for (const suffix of item.slice(sep + 1)) result.push(prefix + suffix);
296
+ });
297
+ return result;
298
+ }
299
+ var defaultOptions = {
300
+ fuzzyLink: false,
301
+ fuzzyEmail: true,
302
+ fuzzyIP: false,
303
+ "---": false,
304
+ tlds: unpackTlds(),
305
+ urlAuth: false,
306
+ maxLength: 1e4
814
307
  };
815
-
816
308
  /**
817
- * LinkifyIt#normalize(match)
818
- *
819
- * Default normalizer (if schema does not define it's own).
820
- **/
821
- LinkifyIt.prototype.normalize = function normalize (match) {
822
- // Do minimal possible changes by default. Need to collect feedback prior
823
- // to move forward https://github.com/markdown-it/linkify-it/issues/1
824
-
825
- if (!match.schema) { match.url = `http://${match.url}`; }
826
-
827
- if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
828
- match.url = `mailto:${match.url}`;
829
- }
309
+ * Match result returned by {@link LinkifyIt.match} and
310
+ * {@link LinkifyIt.matchAtStart}.
311
+ *
312
+ * @category types
313
+ */
314
+ var Match = class {
315
+ constructor(text, schema, index, lastIndex) {
316
+ _defineProperty(
317
+ this,
318
+ /** Prefix (protocol) for matched string. Empty for fuzzy links. */
319
+ "schema",
320
+ void 0
321
+ );
322
+ _defineProperty(
323
+ this,
324
+ /** First position of matched string. */
325
+ "index",
326
+ void 0
327
+ );
328
+ _defineProperty(
329
+ this,
330
+ /** Next position after matched string. */
331
+ "lastIndex",
332
+ void 0
333
+ );
334
+ _defineProperty(
335
+ this,
336
+ /** Matched string. */
337
+ "raw",
338
+ void 0
339
+ );
340
+ _defineProperty(
341
+ this,
342
+ /** Normalized text of matched string. */
343
+ "text",
344
+ void 0
345
+ );
346
+ _defineProperty(
347
+ this,
348
+ /** Normalized URL of matched string. */
349
+ "url",
350
+ void 0
351
+ );
352
+ const raw = text.slice(index, lastIndex);
353
+ this.schema = schema.toLowerCase();
354
+ this.index = index;
355
+ this.lastIndex = lastIndex;
356
+ this.raw = raw;
357
+ this.text = raw;
358
+ this.url = raw;
359
+ }
830
360
  };
831
-
832
- /**
833
- * LinkifyIt#onCompile()
834
- *
835
- * Override to modify basic RegExp-s.
836
- **/
837
- LinkifyIt.prototype.onCompile = function onCompile () {
361
+ /** Linkifier instance. */
362
+ var LinkifyIt = class {
363
+ /**
364
+ * Creates new linkifier instance.
365
+ *
366
+ * By default understands:
367
+ *
368
+ * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links
369
+ * - "fuzzy" emails (foo@bar.com).
370
+ *
371
+ * See {@link LinkifyConstructorOptions} for available options.
372
+ *
373
+ * @param options Recognition options.
374
+ *
375
+ * @example
376
+ * ```javascript
377
+ * import { LinkifyIt } from 'linkify-it'
378
+ *
379
+ * const linkify = new LinkifyIt({ fuzzyLink: true })
380
+ *
381
+ * linkify
382
+ * .tlds(require('tlds')) // Reload with full TLD list
383
+ * .tlds('onion', true) // Add unofficial `.onion` domain
384
+ * .add('ftp:', null) // Disable `ftp:` protocol
385
+ * .set({ fuzzyIP: true }) // Enable IPs in fuzzy links
386
+ *
387
+ * console.log(linkify.test('Site github.com!')) // true
388
+ * console.log(linkify.match('Site github.com!'))
389
+ * ```
390
+ */
391
+ constructor(options = {}) {
392
+ _defineProperty(this, "__opts__", void 0);
393
+ _defineProperty(this, "__schemas__", void 0);
394
+ _defineProperty(this, "re", void 0);
395
+ const { rebuilder } = options, linkifyOptions = _objectWithoutProperties(options, _excluded);
396
+ this.__opts__ = _objectSpread2(_objectSpread2({}, defaultOptions), linkifyOptions);
397
+ this.__schemas__ = _objectSpread2({}, defaultSchemas);
398
+ this.re = rebuilder || new REBuilder();
399
+ this.re.set(_objectSpread2(_objectSpread2({}, this.__opts__), {}, { schema_names: Object.keys(this.__schemas__) }));
400
+ }
401
+ /**
402
+ * Add new rule definition.
403
+ *
404
+ * `schema` is a link prefix (usually, protocol name with `:` at the end,
405
+ * `skype:` for example). `linkify-it` makes sure that prefix is not
406
+ * preceded with alphanumeric char and symbols. Only whitespaces and
407
+ * punctuation allowed.
408
+ *
409
+ * `definition` is a rule to check tail after link prefix. To disable an
410
+ * existing rule, pass `null`.
411
+ *
412
+ * @param schema Rule name (fixed pattern prefix).
413
+ * @param definition Schema definition, or `null` to disable the rule.
414
+ *
415
+ * See [twitter mentions example](https://github.com/markdown-it/linkify-it/blob/master/examples/twitter.mjs).
416
+ */
417
+ add(schema, definition = null) {
418
+ if (!definition) delete this.__schemas__[schema];
419
+ else {
420
+ const def = _objectSpread2({ normalize: (match, self) => self.normalize(match) }, definition);
421
+ this.__schemas__[schema] = def;
422
+ }
423
+ this.re.set(_objectSpread2(_objectSpread2({}, this.__opts__), {}, { schema_names: Object.keys(this.__schemas__) }));
424
+ return this;
425
+ }
426
+ /**
427
+ * Set recognition options for links without schema.
428
+ *
429
+ * @param options Recognition options.
430
+ */
431
+ set(options = {}) {
432
+ this.__opts__ = _objectSpread2(_objectSpread2({}, this.__opts__), options);
433
+ this.re.set(_objectSpread2(_objectSpread2({}, this.__opts__), {}, { schema_names: Object.keys(this.__schemas__) }));
434
+ return this;
435
+ }
436
+ /**
437
+ * Searches linkifiable pattern and returns `true` on success or `false` on fail.
438
+ *
439
+ * @param text Text to scan.
440
+ */
441
+ test(text) {
442
+ if (!text.length) return false;
443
+ let m, re;
444
+ re = this.re.get_schema_search();
445
+ re.lastIndex = 0;
446
+ while ((m = re.exec(text)) !== null) if (this.testSchemaAt(text, m[2], re.lastIndex)) return true;
447
+ if (this.__opts__.fuzzyLink && this.__schemas__["http:"]) {
448
+ re = this.re.get_fuzzy_link_search();
449
+ re.lastIndex = 0;
450
+ if (re.exec(text) !== null) return true;
451
+ }
452
+ if (this.__opts__.fuzzyEmail && this.__schemas__["mailto:"]) {
453
+ if (text.indexOf("@") >= 0) {
454
+ const mailHostRe = this.re.get_fuzzy_mail_host_search();
455
+ const mailNameRe = this.re.get_mail_name_validator();
456
+ mailHostRe.lastIndex = 0;
457
+ while ((m = mailHostRe.exec(text)) !== null) {
458
+ const name = text.slice(Math.max(0, m.index - 65), m.index);
459
+ if (mailNameRe.test(name)) return true;
460
+ }
461
+ }
462
+ }
463
+ return false;
464
+ }
465
+ /**
466
+ * Similar to {@link LinkifyIt.test} but checks only specific protocol tail exactly
467
+ * at given position. Returns length of found pattern (0 on fail).
468
+ *
469
+ * @param text Text to scan.
470
+ * @param schema Rule (schema) name.
471
+ * @param pos Text offset to check from.
472
+ */
473
+ testSchemaAt(text, schema, pos) {
474
+ if (!this.__schemas__[schema.toLowerCase()]) return 0;
475
+ return this.__schemas__[schema.toLowerCase()].validate(text.slice(0, pos + this.__opts__.maxLength), pos, this);
476
+ }
477
+ /**
478
+ * Returns array of found link descriptions or `null` on fail. We strongly
479
+ * recommend to use {@link LinkifyIt.test} first, for best speed.
480
+ *
481
+ * @param text Text to scan.
482
+ */
483
+ match(text) {
484
+ const result = [];
485
+ const schemaRe = this.re.get_schema_search();
486
+ let fuzzyLinkRe;
487
+ let mailHostRe;
488
+ let mailNameRe;
489
+ let fuzzyLinkCandidate;
490
+ let fuzzyEmailCandidate;
491
+ let schemaPrefix;
492
+ let schemaDone = false;
493
+ let fuzzyLinkDone = false;
494
+ let fuzzyEmailDone = false;
495
+ let pos = 0;
496
+ if (!text.length) return null;
497
+ schemaRe.lastIndex = 0;
498
+ if (this.__opts__.fuzzyLink && this.__schemas__["http:"]) {
499
+ fuzzyLinkRe = this.re.get_fuzzy_link_search();
500
+ fuzzyLinkRe.lastIndex = 0;
501
+ }
502
+ if (this.__opts__.fuzzyEmail && this.__schemas__["mailto:"]) {
503
+ mailHostRe = this.re.get_fuzzy_mail_host_search();
504
+ mailHostRe.lastIndex = 0;
505
+ mailNameRe = this.re.get_mail_name_validator();
506
+ }
507
+ for (;;) {
508
+ const scanFrom = Math.max(pos - 1, 0);
509
+ if (mailHostRe && mailNameRe && !fuzzyEmailDone && (!fuzzyEmailCandidate || fuzzyEmailCandidate.index < pos)) {
510
+ if (mailHostRe.lastIndex < scanFrom) mailHostRe.lastIndex = scanFrom;
511
+ for (;;) {
512
+ const m = mailHostRe.exec(text);
513
+ if (!m) {
514
+ fuzzyEmailDone = true;
515
+ fuzzyEmailCandidate = void 0;
516
+ break;
517
+ }
518
+ const name = mailNameRe.exec(text.slice(Math.max(0, m.index - 65), m.index));
519
+ if (!name) continue;
520
+ fuzzyEmailCandidate = {
521
+ schema: "mailto:",
522
+ index: m.index - name[1].length,
523
+ lastIndex: m.index + m[0].length
524
+ };
525
+ if (fuzzyEmailCandidate.index >= pos) break;
526
+ if (mailHostRe.lastIndex < scanFrom) mailHostRe.lastIndex = scanFrom;
527
+ }
528
+ }
529
+ if (fuzzyLinkRe && !fuzzyLinkDone && (!fuzzyLinkCandidate || fuzzyLinkCandidate.index < pos)) {
530
+ if (fuzzyLinkRe.lastIndex < scanFrom) fuzzyLinkRe.lastIndex = scanFrom;
531
+ for (;;) {
532
+ const m = fuzzyLinkRe.exec(text);
533
+ if (!m) {
534
+ fuzzyLinkDone = true;
535
+ fuzzyLinkCandidate = void 0;
536
+ break;
537
+ }
538
+ fuzzyLinkCandidate = {
539
+ schema: "",
540
+ index: m.index + m[1].length,
541
+ lastIndex: m.index + m[0].length
542
+ };
543
+ if (fuzzyLinkCandidate.index >= pos) break;
544
+ if (fuzzyLinkRe.lastIndex < scanFrom) fuzzyLinkRe.lastIndex = scanFrom;
545
+ }
546
+ }
547
+ let fuzzyCandidate = fuzzyEmailCandidate;
548
+ if (!fuzzyCandidate || fuzzyLinkCandidate && (fuzzyLinkCandidate.index < fuzzyCandidate.index || fuzzyLinkCandidate.index === fuzzyCandidate.index && fuzzyLinkCandidate.lastIndex > fuzzyCandidate.lastIndex)) fuzzyCandidate = fuzzyLinkCandidate;
549
+ let schemaCandidate;
550
+ if (!schemaDone) for (;;) {
551
+ if (!schemaPrefix) {
552
+ if (schemaRe.lastIndex < scanFrom) schemaRe.lastIndex = scanFrom;
553
+ const m = schemaRe.exec(text);
554
+ if (!m) {
555
+ schemaDone = true;
556
+ break;
557
+ }
558
+ schemaPrefix = {
559
+ schema: m[2],
560
+ index: m.index + m[1].length,
561
+ lastIndex: m.index + m[0].length
562
+ };
563
+ }
564
+ if (schemaPrefix.index < pos) {
565
+ schemaPrefix = void 0;
566
+ continue;
567
+ }
568
+ if (fuzzyCandidate && schemaPrefix.index > fuzzyCandidate.index) break;
569
+ const prefix = schemaPrefix;
570
+ schemaPrefix = void 0;
571
+ const len = this.testSchemaAt(text, prefix.schema, prefix.lastIndex);
572
+ if (len) {
573
+ schemaCandidate = {
574
+ schema: prefix.schema,
575
+ index: prefix.index,
576
+ lastIndex: prefix.lastIndex + len
577
+ };
578
+ break;
579
+ }
580
+ }
581
+ let candidate = schemaCandidate;
582
+ if (!candidate || fuzzyEmailCandidate && (fuzzyEmailCandidate.index < candidate.index || fuzzyEmailCandidate.index === candidate.index && fuzzyEmailCandidate.lastIndex > candidate.lastIndex)) candidate = fuzzyEmailCandidate;
583
+ if (!candidate || fuzzyLinkCandidate && (fuzzyLinkCandidate.index < candidate.index || fuzzyLinkCandidate.index === candidate.index && fuzzyLinkCandidate.lastIndex > candidate.lastIndex)) candidate = fuzzyLinkCandidate;
584
+ if (!candidate) break;
585
+ if (candidate === fuzzyEmailCandidate) fuzzyEmailCandidate = void 0;
586
+ else if (candidate === fuzzyLinkCandidate) fuzzyLinkCandidate = void 0;
587
+ const match = new Match(text, candidate.schema, candidate.index, candidate.lastIndex);
588
+ if (match.schema) this.__schemas__[match.schema].normalize(match, this);
589
+ else this.normalize(match);
590
+ result.push(match);
591
+ pos = candidate.lastIndex;
592
+ }
593
+ if (result.length) return result;
594
+ return null;
595
+ }
596
+ /**
597
+ * Returns fully-formed (not fuzzy) link if it starts at the beginning
598
+ * of the string, and null otherwise.
599
+ *
600
+ * @param text Text to scan.
601
+ */
602
+ matchAtStart(text) {
603
+ if (!text.length) return null;
604
+ const m = this.re.get_schema_at_start().exec(text);
605
+ if (!m) return null;
606
+ const len = this.testSchemaAt(text, m[2], m[0].length);
607
+ if (!len) return null;
608
+ const match = new Match(text, m[2], m.index + m[1].length, m.index + m[0].length + len);
609
+ this.__schemas__[match.schema].normalize(match, this);
610
+ return match;
611
+ }
612
+ /**
613
+ * Load (or merge) new TLDs list. Those are used for fuzzy links (without
614
+ * prefix) to avoid false positives. By default this algorithm is used:
615
+ *
616
+ * - hostname with any 2-letter root zones are ok.
617
+ * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф
618
+ * are ok.
619
+ * - encoded (`xn--...`) root zones are ok.
620
+ *
621
+ * If list is replaced, then exact match for 2-chars root zones will be checked.
622
+ *
623
+ * @param list List of TLDs.
624
+ * @param keepOld Merge with current list if `true` (`false` by default).
625
+ */
626
+ tlds(list, keepOld = false) {
627
+ list = Array.isArray(list) ? list : [list];
628
+ if (!keepOld) this.__opts__.tlds = list;
629
+ else this.__opts__.tlds = this.__opts__.tlds.concat(list);
630
+ this.re.set(_objectSpread2(_objectSpread2({}, this.__opts__), {}, { schema_names: Object.keys(this.__schemas__) }));
631
+ return this;
632
+ }
633
+ /**
634
+ * Default normalizer (if schema does not define its own).
635
+ *
636
+ * @param match Match to normalize.
637
+ */
638
+ normalize(match) {
639
+ if (!match.schema) match.url = `http://${match.url}`;
640
+ if (match.schema === "mailto:" && !/^mailto:/i.test(match.url)) match.url = `mailto:${match.url}`;
641
+ }
838
642
  };
643
+ function linkifyit(options = {}) {
644
+ return new LinkifyIt(options);
645
+ }
646
+ //#endregion
647
+ exports.LinkifyIt = LinkifyIt;
648
+ exports.REBuilder = REBuilder;
649
+ exports.linkifyit = linkifyit;
839
650
 
840
- module.exports = LinkifyIt;
651
+ //# sourceMappingURL=index.cjs.js.map