peerpigeon 1.1.0 → 1.1.2

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 (830) hide show
  1. package/dist/peerpigeon-browser.js +133 -34
  2. package/dist/peerpigeon-browser.js.map +2 -2
  3. package/docs/CLOUD_DEPLOYMENT.md +132 -0
  4. package/examples/browser/{app.js → vanilla/app.js} +52 -4
  5. package/examples/browser/{index.html → vanilla/index.html} +2 -2
  6. package/examples/{browser-2/dist → browser/vanilla}/peerpigeon-browser.js +882 -43
  7. package/examples/browser/vanilla/pigeonlogo.svg +51 -0
  8. package/examples/browser/vue/dist/assets/index-DJmfz_4i.js +57 -0
  9. package/examples/browser/vue/dist/assets/index-zmUJURg4.css +1 -0
  10. package/examples/{browser-2 → browser/vue}/dist/index.html +2 -2
  11. package/examples/{browser-2/public → browser/vue/dist}/peerpigeon-browser.js +882 -43
  12. package/examples/browser/vue/dist/pigeonlogo.svg +51 -0
  13. package/examples/browser/vue/node_modules/.package-lock.json +1305 -0
  14. package/examples/browser/vue/node_modules/.vue-global-types/vue_99_0.d.ts +136 -0
  15. package/examples/browser/vue/node_modules/@babel/helper-string-parser/LICENSE +22 -0
  16. package/examples/browser/vue/node_modules/@babel/helper-string-parser/README.md +19 -0
  17. package/examples/browser/vue/node_modules/@babel/helper-string-parser/lib/index.js +295 -0
  18. package/examples/browser/vue/node_modules/@babel/helper-string-parser/lib/index.js.map +1 -0
  19. package/examples/browser/vue/node_modules/@babel/helper-string-parser/package.json +31 -0
  20. package/examples/browser/vue/node_modules/@babel/helper-validator-identifier/LICENSE +22 -0
  21. package/examples/browser/vue/node_modules/@babel/helper-validator-identifier/README.md +19 -0
  22. package/examples/browser/vue/node_modules/@babel/helper-validator-identifier/lib/identifier.js +70 -0
  23. package/examples/browser/vue/node_modules/@babel/helper-validator-identifier/lib/identifier.js.map +1 -0
  24. package/examples/browser/vue/node_modules/@babel/helper-validator-identifier/lib/index.js +57 -0
  25. package/examples/browser/vue/node_modules/@babel/helper-validator-identifier/lib/index.js.map +1 -0
  26. package/examples/browser/vue/node_modules/@babel/helper-validator-identifier/lib/keyword.js +35 -0
  27. package/examples/browser/vue/node_modules/@babel/helper-validator-identifier/lib/keyword.js.map +1 -0
  28. package/examples/browser/vue/node_modules/@babel/helper-validator-identifier/package.json +31 -0
  29. package/examples/browser/vue/node_modules/@babel/parser/CHANGELOG.md +1073 -0
  30. package/examples/browser/vue/node_modules/@babel/parser/LICENSE +19 -0
  31. package/examples/browser/vue/node_modules/@babel/parser/README.md +19 -0
  32. package/examples/browser/vue/node_modules/@babel/parser/bin/babel-parser.js +15 -0
  33. package/examples/browser/vue/node_modules/@babel/parser/lib/index.js +14595 -0
  34. package/examples/browser/vue/node_modules/@babel/parser/lib/index.js.map +1 -0
  35. package/examples/browser/vue/node_modules/@babel/parser/package.json +50 -0
  36. package/examples/browser/vue/node_modules/@babel/parser/typings/babel-parser.d.ts +239 -0
  37. package/examples/browser/vue/node_modules/@babel/types/LICENSE +22 -0
  38. package/examples/browser/vue/node_modules/@babel/types/README.md +19 -0
  39. package/examples/browser/vue/node_modules/@babel/types/lib/asserts/assertNode.js +16 -0
  40. package/examples/browser/vue/node_modules/@babel/types/lib/asserts/assertNode.js.map +1 -0
  41. package/examples/browser/vue/node_modules/@babel/types/lib/asserts/generated/index.js +1251 -0
  42. package/examples/browser/vue/node_modules/@babel/types/lib/asserts/generated/index.js.map +1 -0
  43. package/examples/browser/vue/node_modules/@babel/types/lib/ast-types/generated/index.js +3 -0
  44. package/examples/browser/vue/node_modules/@babel/types/lib/ast-types/generated/index.js.map +1 -0
  45. package/examples/browser/vue/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js +18 -0
  46. package/examples/browser/vue/node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map +1 -0
  47. package/examples/browser/vue/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js +31 -0
  48. package/examples/browser/vue/node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js.map +1 -0
  49. package/examples/browser/vue/node_modules/@babel/types/lib/builders/generated/index.js +29 -0
  50. package/examples/browser/vue/node_modules/@babel/types/lib/builders/generated/index.js.map +1 -0
  51. package/examples/browser/vue/node_modules/@babel/types/lib/builders/generated/lowercase.js +2896 -0
  52. package/examples/browser/vue/node_modules/@babel/types/lib/builders/generated/lowercase.js.map +1 -0
  53. package/examples/browser/vue/node_modules/@babel/types/lib/builders/generated/uppercase.js +274 -0
  54. package/examples/browser/vue/node_modules/@babel/types/lib/builders/generated/uppercase.js.map +1 -0
  55. package/examples/browser/vue/node_modules/@babel/types/lib/builders/productions.js +12 -0
  56. package/examples/browser/vue/node_modules/@babel/types/lib/builders/productions.js.map +1 -0
  57. package/examples/browser/vue/node_modules/@babel/types/lib/builders/react/buildChildren.js +24 -0
  58. package/examples/browser/vue/node_modules/@babel/types/lib/builders/react/buildChildren.js.map +1 -0
  59. package/examples/browser/vue/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js +22 -0
  60. package/examples/browser/vue/node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js.map +1 -0
  61. package/examples/browser/vue/node_modules/@babel/types/lib/builders/validateNode.js +21 -0
  62. package/examples/browser/vue/node_modules/@babel/types/lib/builders/validateNode.js.map +1 -0
  63. package/examples/browser/vue/node_modules/@babel/types/lib/clone/clone.js +12 -0
  64. package/examples/browser/vue/node_modules/@babel/types/lib/clone/clone.js.map +1 -0
  65. package/examples/browser/vue/node_modules/@babel/types/lib/clone/cloneDeep.js +12 -0
  66. package/examples/browser/vue/node_modules/@babel/types/lib/clone/cloneDeep.js.map +1 -0
  67. package/examples/browser/vue/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js +12 -0
  68. package/examples/browser/vue/node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js.map +1 -0
  69. package/examples/browser/vue/node_modules/@babel/types/lib/clone/cloneNode.js +107 -0
  70. package/examples/browser/vue/node_modules/@babel/types/lib/clone/cloneNode.js.map +1 -0
  71. package/examples/browser/vue/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js +12 -0
  72. package/examples/browser/vue/node_modules/@babel/types/lib/clone/cloneWithoutLoc.js.map +1 -0
  73. package/examples/browser/vue/node_modules/@babel/types/lib/comments/addComment.js +15 -0
  74. package/examples/browser/vue/node_modules/@babel/types/lib/comments/addComment.js.map +1 -0
  75. package/examples/browser/vue/node_modules/@babel/types/lib/comments/addComments.js +22 -0
  76. package/examples/browser/vue/node_modules/@babel/types/lib/comments/addComments.js.map +1 -0
  77. package/examples/browser/vue/node_modules/@babel/types/lib/comments/inheritInnerComments.js +12 -0
  78. package/examples/browser/vue/node_modules/@babel/types/lib/comments/inheritInnerComments.js.map +1 -0
  79. package/examples/browser/vue/node_modules/@babel/types/lib/comments/inheritLeadingComments.js +12 -0
  80. package/examples/browser/vue/node_modules/@babel/types/lib/comments/inheritLeadingComments.js.map +1 -0
  81. package/examples/browser/vue/node_modules/@babel/types/lib/comments/inheritTrailingComments.js +12 -0
  82. package/examples/browser/vue/node_modules/@babel/types/lib/comments/inheritTrailingComments.js.map +1 -0
  83. package/examples/browser/vue/node_modules/@babel/types/lib/comments/inheritsComments.js +17 -0
  84. package/examples/browser/vue/node_modules/@babel/types/lib/comments/inheritsComments.js.map +1 -0
  85. package/examples/browser/vue/node_modules/@babel/types/lib/comments/removeComments.js +15 -0
  86. package/examples/browser/vue/node_modules/@babel/types/lib/comments/removeComments.js.map +1 -0
  87. package/examples/browser/vue/node_modules/@babel/types/lib/constants/generated/index.js +60 -0
  88. package/examples/browser/vue/node_modules/@babel/types/lib/constants/generated/index.js.map +1 -0
  89. package/examples/browser/vue/node_modules/@babel/types/lib/constants/index.js +33 -0
  90. package/examples/browser/vue/node_modules/@babel/types/lib/constants/index.js.map +1 -0
  91. package/examples/browser/vue/node_modules/@babel/types/lib/converters/ensureBlock.js +14 -0
  92. package/examples/browser/vue/node_modules/@babel/types/lib/converters/ensureBlock.js.map +1 -0
  93. package/examples/browser/vue/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js +66 -0
  94. package/examples/browser/vue/node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map +1 -0
  95. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js +14 -0
  96. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toBindingIdentifierName.js.map +1 -0
  97. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toBlock.js +29 -0
  98. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toBlock.js.map +1 -0
  99. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toComputedKey.js +14 -0
  100. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toComputedKey.js.map +1 -0
  101. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toExpression.js +28 -0
  102. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toExpression.js.map +1 -0
  103. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toIdentifier.js +25 -0
  104. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toIdentifier.js.map +1 -0
  105. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toKeyAlias.js +38 -0
  106. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toKeyAlias.js.map +1 -0
  107. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toSequenceExpression.js +20 -0
  108. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toSequenceExpression.js.map +1 -0
  109. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toStatement.js +39 -0
  110. package/examples/browser/vue/node_modules/@babel/types/lib/converters/toStatement.js.map +1 -0
  111. package/examples/browser/vue/node_modules/@babel/types/lib/converters/valueToNode.js +89 -0
  112. package/examples/browser/vue/node_modules/@babel/types/lib/converters/valueToNode.js.map +1 -0
  113. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/core.js +1659 -0
  114. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/core.js.map +1 -0
  115. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/deprecated-aliases.js +11 -0
  116. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map +1 -0
  117. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/experimental.js +126 -0
  118. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/experimental.js.map +1 -0
  119. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/flow.js +495 -0
  120. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/flow.js.map +1 -0
  121. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/index.js +100 -0
  122. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/index.js.map +1 -0
  123. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/jsx.js +157 -0
  124. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/jsx.js.map +1 -0
  125. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/misc.js +33 -0
  126. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/misc.js.map +1 -0
  127. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/placeholders.js +27 -0
  128. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/placeholders.js.map +1 -0
  129. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/typescript.js +528 -0
  130. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/typescript.js.map +1 -0
  131. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/utils.js +292 -0
  132. package/examples/browser/vue/node_modules/@babel/types/lib/definitions/utils.js.map +1 -0
  133. package/examples/browser/vue/node_modules/@babel/types/lib/index-legacy.d.ts +2797 -0
  134. package/examples/browser/vue/node_modules/@babel/types/lib/index.d.ts +3308 -0
  135. package/examples/browser/vue/node_modules/@babel/types/lib/index.js +584 -0
  136. package/examples/browser/vue/node_modules/@babel/types/lib/index.js.flow +2650 -0
  137. package/examples/browser/vue/node_modules/@babel/types/lib/index.js.map +1 -0
  138. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js +15 -0
  139. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/appendToMemberExpression.js.map +1 -0
  140. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js +65 -0
  141. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map +1 -0
  142. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/inherits.js +28 -0
  143. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/inherits.js.map +1 -0
  144. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js +17 -0
  145. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/prependToMemberExpression.js.map +1 -0
  146. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/removeProperties.js +24 -0
  147. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/removeProperties.js.map +1 -0
  148. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js +14 -0
  149. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/removePropertiesDeep.js.map +1 -0
  150. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js +66 -0
  151. package/examples/browser/vue/node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map +1 -0
  152. package/examples/browser/vue/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js +48 -0
  153. package/examples/browser/vue/node_modules/@babel/types/lib/retrievers/getAssignmentIdentifiers.js.map +1 -0
  154. package/examples/browser/vue/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js +102 -0
  155. package/examples/browser/vue/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map +1 -0
  156. package/examples/browser/vue/node_modules/@babel/types/lib/retrievers/getFunctionName.js +63 -0
  157. package/examples/browser/vue/node_modules/@babel/types/lib/retrievers/getFunctionName.js.map +1 -0
  158. package/examples/browser/vue/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js +13 -0
  159. package/examples/browser/vue/node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js.map +1 -0
  160. package/examples/browser/vue/node_modules/@babel/types/lib/traverse/traverse.js +50 -0
  161. package/examples/browser/vue/node_modules/@babel/types/lib/traverse/traverse.js.map +1 -0
  162. package/examples/browser/vue/node_modules/@babel/types/lib/traverse/traverseFast.js +40 -0
  163. package/examples/browser/vue/node_modules/@babel/types/lib/traverse/traverseFast.js.map +1 -0
  164. package/examples/browser/vue/node_modules/@babel/types/lib/utils/deprecationWarning.js +44 -0
  165. package/examples/browser/vue/node_modules/@babel/types/lib/utils/deprecationWarning.js.map +1 -0
  166. package/examples/browser/vue/node_modules/@babel/types/lib/utils/inherit.js +13 -0
  167. package/examples/browser/vue/node_modules/@babel/types/lib/utils/inherit.js.map +1 -0
  168. package/examples/browser/vue/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js +40 -0
  169. package/examples/browser/vue/node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map +1 -0
  170. package/examples/browser/vue/node_modules/@babel/types/lib/utils/shallowEqual.js +17 -0
  171. package/examples/browser/vue/node_modules/@babel/types/lib/utils/shallowEqual.js.map +1 -0
  172. package/examples/browser/vue/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js +13 -0
  173. package/examples/browser/vue/node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js.map +1 -0
  174. package/examples/browser/vue/node_modules/@babel/types/lib/validators/generated/index.js +2797 -0
  175. package/examples/browser/vue/node_modules/@babel/types/lib/validators/generated/index.js.map +1 -0
  176. package/examples/browser/vue/node_modules/@babel/types/lib/validators/is.js +27 -0
  177. package/examples/browser/vue/node_modules/@babel/types/lib/validators/is.js.map +1 -0
  178. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isBinding.js +27 -0
  179. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isBinding.js.map +1 -0
  180. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isBlockScoped.js +13 -0
  181. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isBlockScoped.js.map +1 -0
  182. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isImmutable.js +21 -0
  183. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isImmutable.js.map +1 -0
  184. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isLet.js +17 -0
  185. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isLet.js.map +1 -0
  186. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isNode.js +12 -0
  187. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isNode.js.map +1 -0
  188. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isNodesEquivalent.js +57 -0
  189. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map +1 -0
  190. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isPlaceholderType.js +15 -0
  191. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isPlaceholderType.js.map +1 -0
  192. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isReferenced.js +96 -0
  193. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isReferenced.js.map +1 -0
  194. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isScope.js +18 -0
  195. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isScope.js.map +1 -0
  196. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isSpecifierDefault.js +14 -0
  197. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map +1 -0
  198. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isType.js +17 -0
  199. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isType.js.map +1 -0
  200. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isValidES3Identifier.js +13 -0
  201. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map +1 -0
  202. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isValidIdentifier.js +18 -0
  203. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isValidIdentifier.js.map +1 -0
  204. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isVar.js +19 -0
  205. package/examples/browser/vue/node_modules/@babel/types/lib/validators/isVar.js.map +1 -0
  206. package/examples/browser/vue/node_modules/@babel/types/lib/validators/matchesPattern.js +44 -0
  207. package/examples/browser/vue/node_modules/@babel/types/lib/validators/matchesPattern.js.map +1 -0
  208. package/examples/browser/vue/node_modules/@babel/types/lib/validators/react/isCompatTag.js +11 -0
  209. package/examples/browser/vue/node_modules/@babel/types/lib/validators/react/isCompatTag.js.map +1 -0
  210. package/examples/browser/vue/node_modules/@babel/types/lib/validators/react/isReactComponent.js +11 -0
  211. package/examples/browser/vue/node_modules/@babel/types/lib/validators/react/isReactComponent.js.map +1 -0
  212. package/examples/browser/vue/node_modules/@babel/types/lib/validators/validate.js +42 -0
  213. package/examples/browser/vue/node_modules/@babel/types/lib/validators/validate.js.map +1 -0
  214. package/examples/browser/vue/node_modules/@babel/types/package.json +39 -0
  215. package/examples/browser/vue/node_modules/@esbuild/darwin-arm64/README.md +3 -0
  216. package/examples/browser/vue/node_modules/@esbuild/darwin-arm64/bin/esbuild +0 -0
  217. package/examples/browser/vue/node_modules/@esbuild/darwin-arm64/package.json +20 -0
  218. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/LICENSE +19 -0
  219. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/README.md +264 -0
  220. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +423 -0
  221. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +6 -0
  222. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +464 -0
  223. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +6 -0
  224. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/package.json +63 -0
  225. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts +345 -0
  226. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts +111 -0
  227. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/src/strings.ts +65 -0
  228. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts +55 -0
  229. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts +50 -0
  230. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map +1 -0
  231. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts +50 -0
  232. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map +1 -0
  233. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts +9 -0
  234. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map +1 -0
  235. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts +9 -0
  236. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map +1 -0
  237. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts +16 -0
  238. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map +1 -0
  239. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts +16 -0
  240. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map +1 -0
  241. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts +7 -0
  242. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map +1 -0
  243. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts +7 -0
  244. package/examples/browser/vue/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map +1 -0
  245. package/examples/browser/vue/node_modules/@rollup/rollup-darwin-arm64/README.md +3 -0
  246. package/examples/browser/vue/node_modules/@rollup/rollup-darwin-arm64/package.json +22 -0
  247. package/examples/browser/vue/node_modules/@rollup/rollup-darwin-arm64/rollup.darwin-arm64.node +0 -0
  248. package/examples/browser/vue/node_modules/@types/estree/LICENSE +21 -0
  249. package/examples/browser/vue/node_modules/@types/estree/README.md +15 -0
  250. package/examples/browser/vue/node_modules/@types/estree/flow.d.ts +167 -0
  251. package/examples/browser/vue/node_modules/@types/estree/index.d.ts +694 -0
  252. package/examples/browser/vue/node_modules/@types/estree/package.json +27 -0
  253. package/examples/browser/vue/node_modules/@types/web-bluetooth/LICENSE +21 -0
  254. package/examples/browser/vue/node_modules/@types/web-bluetooth/README.md +15 -0
  255. package/examples/browser/vue/node_modules/@types/web-bluetooth/index.d.ts +193 -0
  256. package/examples/browser/vue/node_modules/@types/web-bluetooth/package.json +40 -0
  257. package/examples/browser/vue/node_modules/@vitejs/plugin-vue/LICENSE +21 -0
  258. package/examples/browser/vue/node_modules/@vitejs/plugin-vue/README.md +278 -0
  259. package/examples/browser/vue/node_modules/@vitejs/plugin-vue/dist/index.cjs +3105 -0
  260. package/examples/browser/vue/node_modules/@vitejs/plugin-vue/dist/index.d.cts +113 -0
  261. package/examples/browser/vue/node_modules/@vitejs/plugin-vue/dist/index.d.mts +111 -0
  262. package/examples/browser/vue/node_modules/@vitejs/plugin-vue/dist/index.d.ts +113 -0
  263. package/examples/browser/vue/node_modules/@vitejs/plugin-vue/dist/index.mjs +3090 -0
  264. package/examples/browser/vue/node_modules/@vitejs/plugin-vue/package.json +50 -0
  265. package/examples/browser/vue/node_modules/@vue/compiler-core/LICENSE +21 -0
  266. package/examples/browser/vue/node_modules/@vue/compiler-core/README.md +1 -0
  267. package/examples/browser/vue/node_modules/@vue/compiler-core/dist/compiler-core.cjs.js +6864 -0
  268. package/examples/browser/vue/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6741 -0
  269. package/examples/browser/vue/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +1096 -0
  270. package/examples/browser/vue/node_modules/@vue/compiler-core/dist/compiler-core.esm-bundler.js +5814 -0
  271. package/examples/browser/vue/node_modules/@vue/compiler-core/index.js +7 -0
  272. package/examples/browser/vue/node_modules/@vue/compiler-core/package.json +58 -0
  273. package/examples/browser/vue/node_modules/@vue/compiler-dom/LICENSE +21 -0
  274. package/examples/browser/vue/node_modules/@vue/compiler-dom/README.md +1 -0
  275. package/examples/browser/vue/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.js +934 -0
  276. package/examples/browser/vue/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
  277. package/examples/browser/vue/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +45 -0
  278. package/examples/browser/vue/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.js +6623 -0
  279. package/examples/browser/vue/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-browser.prod.js +14 -0
  280. package/examples/browser/vue/node_modules/@vue/compiler-dom/dist/compiler-dom.esm-bundler.js +690 -0
  281. package/examples/browser/vue/node_modules/@vue/compiler-dom/dist/compiler-dom.global.js +6790 -0
  282. package/examples/browser/vue/node_modules/@vue/compiler-dom/dist/compiler-dom.global.prod.js +14 -0
  283. package/examples/browser/vue/node_modules/@vue/compiler-dom/index.js +7 -0
  284. package/examples/browser/vue/node_modules/@vue/compiler-dom/package.json +57 -0
  285. package/examples/browser/vue/node_modules/@vue/compiler-sfc/LICENSE +21 -0
  286. package/examples/browser/vue/node_modules/@vue/compiler-sfc/README.md +80 -0
  287. package/examples/browser/vue/node_modules/@vue/compiler-sfc/dist/compiler-sfc.cjs.js +25084 -0
  288. package/examples/browser/vue/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +485 -0
  289. package/examples/browser/vue/node_modules/@vue/compiler-sfc/dist/compiler-sfc.esm-browser.js +50571 -0
  290. package/examples/browser/vue/node_modules/@vue/compiler-sfc/package.json +67 -0
  291. package/examples/browser/vue/node_modules/@vue/compiler-ssr/LICENSE +21 -0
  292. package/examples/browser/vue/node_modules/@vue/compiler-ssr/README.md +1 -0
  293. package/examples/browser/vue/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1411 -0
  294. package/examples/browser/vue/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +4 -0
  295. package/examples/browser/vue/node_modules/@vue/compiler-ssr/package.json +34 -0
  296. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/api/api.js +2 -0
  297. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/api/app.js +2 -0
  298. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/api/component.js +2 -0
  299. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/api/context.js +2 -0
  300. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/api/hooks.js +2 -0
  301. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/api/index.js +22 -0
  302. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/api/util.js +2 -0
  303. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/const.js +5 -0
  304. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/env.js +17 -0
  305. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/index.js +45 -0
  306. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/plugin.js +2 -0
  307. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/proxy.js +111 -0
  308. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/cjs/time.js +28 -0
  309. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts +108 -0
  310. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/api.js +1 -0
  311. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts +1 -0
  312. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/app.js +1 -0
  313. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts +78 -0
  314. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/component.js +1 -0
  315. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts +5 -0
  316. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/context.js +1 -0
  317. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts +180 -0
  318. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/hooks.js +1 -0
  319. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts +6 -0
  320. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/index.js +6 -0
  321. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts +4 -0
  322. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/api/util.js +1 -0
  323. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/const.d.ts +2 -0
  324. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/const.js +2 -0
  325. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/env.d.ts +15 -0
  326. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/env.js +12 -0
  327. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/index.d.ts +18 -0
  328. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/index.js +27 -0
  329. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts +47 -0
  330. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/plugin.js +1 -0
  331. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts +20 -0
  332. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/proxy.js +107 -0
  333. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/time.d.ts +2 -0
  334. package/examples/browser/vue/node_modules/@vue/devtools-api/lib/esm/time.js +23 -0
  335. package/examples/browser/vue/node_modules/@vue/devtools-api/package.json +37 -0
  336. package/examples/browser/vue/node_modules/@vue/reactivity/LICENSE +21 -0
  337. package/examples/browser/vue/node_modules/@vue/reactivity/README.md +19 -0
  338. package/examples/browser/vue/node_modules/@vue/reactivity/dist/reactivity.cjs.js +1963 -0
  339. package/examples/browser/vue/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1807 -0
  340. package/examples/browser/vue/node_modules/@vue/reactivity/dist/reactivity.d.ts +757 -0
  341. package/examples/browser/vue/node_modules/@vue/reactivity/dist/reactivity.esm-browser.js +1961 -0
  342. package/examples/browser/vue/node_modules/@vue/reactivity/dist/reactivity.esm-browser.prod.js +5 -0
  343. package/examples/browser/vue/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js +1920 -0
  344. package/examples/browser/vue/node_modules/@vue/reactivity/dist/reactivity.global.js +2017 -0
  345. package/examples/browser/vue/node_modules/@vue/reactivity/dist/reactivity.global.prod.js +5 -0
  346. package/examples/browser/vue/node_modules/@vue/reactivity/index.js +7 -0
  347. package/examples/browser/vue/node_modules/@vue/reactivity/package.json +55 -0
  348. package/examples/browser/vue/node_modules/@vue/runtime-core/LICENSE +21 -0
  349. package/examples/browser/vue/node_modules/@vue/runtime-core/README.md +28 -0
  350. package/examples/browser/vue/node_modules/@vue/runtime-core/dist/runtime-core.cjs.js +8586 -0
  351. package/examples/browser/vue/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6732 -0
  352. package/examples/browser/vue/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +1839 -0
  353. package/examples/browser/vue/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +8515 -0
  354. package/examples/browser/vue/node_modules/@vue/runtime-core/index.js +7 -0
  355. package/examples/browser/vue/node_modules/@vue/runtime-core/package.json +52 -0
  356. package/examples/browser/vue/node_modules/@vue/runtime-dom/LICENSE +21 -0
  357. package/examples/browser/vue/node_modules/@vue/runtime-dom/README.md +13 -0
  358. package/examples/browser/vue/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.js +1851 -0
  359. package/examples/browser/vue/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1703 -0
  360. package/examples/browser/vue/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +1409 -0
  361. package/examples/browser/vue/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.js +12499 -0
  362. package/examples/browser/vue/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.prod.js +6 -0
  363. package/examples/browser/vue/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js +1892 -0
  364. package/examples/browser/vue/node_modules/@vue/runtime-dom/dist/runtime-dom.global.js +12550 -0
  365. package/examples/browser/vue/node_modules/@vue/runtime-dom/dist/runtime-dom.global.prod.js +6 -0
  366. package/examples/browser/vue/node_modules/@vue/runtime-dom/index.js +7 -0
  367. package/examples/browser/vue/node_modules/@vue/runtime-dom/package.json +60 -0
  368. package/examples/browser/vue/node_modules/@vue/server-renderer/LICENSE +21 -0
  369. package/examples/browser/vue/node_modules/@vue/server-renderer/README.md +178 -0
  370. package/examples/browser/vue/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js +1151 -0
  371. package/examples/browser/vue/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +879 -0
  372. package/examples/browser/vue/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +65 -0
  373. package/examples/browser/vue/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.js +8488 -0
  374. package/examples/browser/vue/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js +5 -0
  375. package/examples/browser/vue/node_modules/@vue/server-renderer/dist/server-renderer.esm-bundler.js +1088 -0
  376. package/examples/browser/vue/node_modules/@vue/server-renderer/index.js +7 -0
  377. package/examples/browser/vue/node_modules/@vue/server-renderer/package.json +55 -0
  378. package/examples/browser/vue/node_modules/@vue/shared/LICENSE +21 -0
  379. package/examples/browser/vue/node_modules/@vue/shared/README.md +3 -0
  380. package/examples/browser/vue/node_modules/@vue/shared/dist/shared.cjs.js +612 -0
  381. package/examples/browser/vue/node_modules/@vue/shared/dist/shared.cjs.prod.js +604 -0
  382. package/examples/browser/vue/node_modules/@vue/shared/dist/shared.d.ts +334 -0
  383. package/examples/browser/vue/node_modules/@vue/shared/dist/shared.esm-bundler.js +536 -0
  384. package/examples/browser/vue/node_modules/@vue/shared/index.js +7 -0
  385. package/examples/browser/vue/node_modules/@vue/shared/package.json +47 -0
  386. package/examples/browser/vue/node_modules/@vueuse/core/LICENSE +21 -0
  387. package/examples/browser/vue/node_modules/@vueuse/core/README.md +124 -0
  388. package/examples/browser/vue/node_modules/@vueuse/core/index.cjs +7660 -0
  389. package/examples/browser/vue/node_modules/@vueuse/core/index.d.cts +5382 -0
  390. package/examples/browser/vue/node_modules/@vueuse/core/index.d.mts +5382 -0
  391. package/examples/browser/vue/node_modules/@vueuse/core/index.d.ts +5382 -0
  392. package/examples/browser/vue/node_modules/@vueuse/core/index.iife.js +7780 -0
  393. package/examples/browser/vue/node_modules/@vueuse/core/index.iife.min.js +1 -0
  394. package/examples/browser/vue/node_modules/@vueuse/core/index.mjs +7486 -0
  395. package/examples/browser/vue/node_modules/@vueuse/core/metadata.cjs +1 -0
  396. package/examples/browser/vue/node_modules/@vueuse/core/metadata.d.cts +1 -0
  397. package/examples/browser/vue/node_modules/@vueuse/core/metadata.d.mts +1 -0
  398. package/examples/browser/vue/node_modules/@vueuse/core/metadata.d.ts +1 -0
  399. package/examples/browser/vue/node_modules/@vueuse/core/metadata.mjs +1 -0
  400. package/examples/browser/vue/node_modules/@vueuse/core/package.json +45 -0
  401. package/examples/browser/vue/node_modules/@vueuse/metadata/LICENSE +21 -0
  402. package/examples/browser/vue/node_modules/@vueuse/metadata/index.cjs +2638 -0
  403. package/examples/browser/vue/node_modules/@vueuse/metadata/index.d.cts +76 -0
  404. package/examples/browser/vue/node_modules/@vueuse/metadata/index.d.mts +76 -0
  405. package/examples/browser/vue/node_modules/@vueuse/metadata/index.d.ts +76 -0
  406. package/examples/browser/vue/node_modules/@vueuse/metadata/index.json +2584 -0
  407. package/examples/browser/vue/node_modules/@vueuse/metadata/index.mjs +2626 -0
  408. package/examples/browser/vue/node_modules/@vueuse/metadata/package.json +39 -0
  409. package/examples/browser/vue/node_modules/@vueuse/shared/LICENSE +21 -0
  410. package/examples/browser/vue/node_modules/@vueuse/shared/index.cjs +1695 -0
  411. package/examples/browser/vue/node_modules/@vueuse/shared/index.d.cts +1221 -0
  412. package/examples/browser/vue/node_modules/@vueuse/shared/index.d.mts +1221 -0
  413. package/examples/browser/vue/node_modules/@vueuse/shared/index.d.ts +1221 -0
  414. package/examples/browser/vue/node_modules/@vueuse/shared/index.iife.js +1816 -0
  415. package/examples/browser/vue/node_modules/@vueuse/shared/index.iife.min.js +1 -0
  416. package/examples/browser/vue/node_modules/@vueuse/shared/index.mjs +1575 -0
  417. package/examples/browser/vue/node_modules/@vueuse/shared/package.json +37 -0
  418. package/examples/browser/vue/node_modules/csstype/LICENSE +19 -0
  419. package/examples/browser/vue/node_modules/csstype/README.md +277 -0
  420. package/examples/browser/vue/node_modules/csstype/index.d.ts +21297 -0
  421. package/examples/browser/vue/node_modules/csstype/index.js.flow +6612 -0
  422. package/examples/browser/vue/node_modules/csstype/package.json +66 -0
  423. package/examples/browser/vue/node_modules/entities/LICENSE +11 -0
  424. package/examples/browser/vue/node_modules/entities/lib/decode.d.ts +211 -0
  425. package/examples/browser/vue/node_modules/entities/lib/decode.d.ts.map +1 -0
  426. package/examples/browser/vue/node_modules/entities/lib/decode.js +536 -0
  427. package/examples/browser/vue/node_modules/entities/lib/decode.js.map +1 -0
  428. package/examples/browser/vue/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
  429. package/examples/browser/vue/node_modules/entities/lib/decode_codepoint.d.ts.map +1 -0
  430. package/examples/browser/vue/node_modules/entities/lib/decode_codepoint.js +76 -0
  431. package/examples/browser/vue/node_modules/entities/lib/decode_codepoint.js.map +1 -0
  432. package/examples/browser/vue/node_modules/entities/lib/encode.d.ts +22 -0
  433. package/examples/browser/vue/node_modules/entities/lib/encode.d.ts.map +1 -0
  434. package/examples/browser/vue/node_modules/entities/lib/encode.js +77 -0
  435. package/examples/browser/vue/node_modules/entities/lib/encode.js.map +1 -0
  436. package/examples/browser/vue/node_modules/entities/lib/escape.d.ts +43 -0
  437. package/examples/browser/vue/node_modules/entities/lib/escape.d.ts.map +1 -0
  438. package/examples/browser/vue/node_modules/entities/lib/escape.js +122 -0
  439. package/examples/browser/vue/node_modules/entities/lib/escape.js.map +1 -0
  440. package/examples/browser/vue/node_modules/entities/lib/esm/decode.d.ts +211 -0
  441. package/examples/browser/vue/node_modules/entities/lib/esm/decode.d.ts.map +1 -0
  442. package/examples/browser/vue/node_modules/entities/lib/esm/decode.js +496 -0
  443. package/examples/browser/vue/node_modules/entities/lib/esm/decode.js.map +1 -0
  444. package/examples/browser/vue/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
  445. package/examples/browser/vue/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +1 -0
  446. package/examples/browser/vue/node_modules/entities/lib/esm/decode_codepoint.js +71 -0
  447. package/examples/browser/vue/node_modules/entities/lib/esm/decode_codepoint.js.map +1 -0
  448. package/examples/browser/vue/node_modules/entities/lib/esm/encode.d.ts +22 -0
  449. package/examples/browser/vue/node_modules/entities/lib/esm/encode.d.ts.map +1 -0
  450. package/examples/browser/vue/node_modules/entities/lib/esm/encode.js +69 -0
  451. package/examples/browser/vue/node_modules/entities/lib/esm/encode.js.map +1 -0
  452. package/examples/browser/vue/node_modules/entities/lib/esm/escape.d.ts +43 -0
  453. package/examples/browser/vue/node_modules/entities/lib/esm/escape.d.ts.map +1 -0
  454. package/examples/browser/vue/node_modules/entities/lib/esm/escape.js +116 -0
  455. package/examples/browser/vue/node_modules/entities/lib/esm/escape.js.map +1 -0
  456. package/examples/browser/vue/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
  457. package/examples/browser/vue/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +1 -0
  458. package/examples/browser/vue/node_modules/entities/lib/esm/generated/decode-data-html.js +7 -0
  459. package/examples/browser/vue/node_modules/entities/lib/esm/generated/decode-data-html.js.map +1 -0
  460. package/examples/browser/vue/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
  461. package/examples/browser/vue/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +1 -0
  462. package/examples/browser/vue/node_modules/entities/lib/esm/generated/decode-data-xml.js +7 -0
  463. package/examples/browser/vue/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +1 -0
  464. package/examples/browser/vue/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
  465. package/examples/browser/vue/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +1 -0
  466. package/examples/browser/vue/node_modules/entities/lib/esm/generated/encode-html.js +10 -0
  467. package/examples/browser/vue/node_modules/entities/lib/esm/generated/encode-html.js.map +1 -0
  468. package/examples/browser/vue/node_modules/entities/lib/esm/index.d.ts +96 -0
  469. package/examples/browser/vue/node_modules/entities/lib/esm/index.d.ts.map +1 -0
  470. package/examples/browser/vue/node_modules/entities/lib/esm/index.js +99 -0
  471. package/examples/browser/vue/node_modules/entities/lib/esm/index.js.map +1 -0
  472. package/examples/browser/vue/node_modules/entities/lib/esm/package.json +1 -0
  473. package/examples/browser/vue/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
  474. package/examples/browser/vue/node_modules/entities/lib/generated/decode-data-html.d.ts.map +1 -0
  475. package/examples/browser/vue/node_modules/entities/lib/generated/decode-data-html.js +9 -0
  476. package/examples/browser/vue/node_modules/entities/lib/generated/decode-data-html.js.map +1 -0
  477. package/examples/browser/vue/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
  478. package/examples/browser/vue/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +1 -0
  479. package/examples/browser/vue/node_modules/entities/lib/generated/decode-data-xml.js +9 -0
  480. package/examples/browser/vue/node_modules/entities/lib/generated/decode-data-xml.js.map +1 -0
  481. package/examples/browser/vue/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
  482. package/examples/browser/vue/node_modules/entities/lib/generated/encode-html.d.ts.map +1 -0
  483. package/examples/browser/vue/node_modules/entities/lib/generated/encode-html.js +12 -0
  484. package/examples/browser/vue/node_modules/entities/lib/generated/encode-html.js.map +1 -0
  485. package/examples/browser/vue/node_modules/entities/lib/index.d.ts +96 -0
  486. package/examples/browser/vue/node_modules/entities/lib/index.d.ts.map +1 -0
  487. package/examples/browser/vue/node_modules/entities/lib/index.js +126 -0
  488. package/examples/browser/vue/node_modules/entities/lib/index.js.map +1 -0
  489. package/examples/browser/vue/node_modules/entities/package.json +90 -0
  490. package/examples/browser/vue/node_modules/entities/readme.md +122 -0
  491. package/examples/browser/vue/node_modules/esbuild/LICENSE.md +21 -0
  492. package/examples/browser/vue/node_modules/esbuild/README.md +3 -0
  493. package/examples/browser/vue/node_modules/esbuild/bin/esbuild +0 -0
  494. package/examples/browser/vue/node_modules/esbuild/install.js +285 -0
  495. package/examples/browser/vue/node_modules/esbuild/lib/main.d.ts +705 -0
  496. package/examples/browser/vue/node_modules/esbuild/lib/main.js +2239 -0
  497. package/examples/browser/vue/node_modules/esbuild/package.json +46 -0
  498. package/examples/browser/vue/node_modules/estree-walker/CHANGELOG.md +92 -0
  499. package/examples/browser/vue/node_modules/estree-walker/LICENSE +7 -0
  500. package/examples/browser/vue/node_modules/estree-walker/README.md +48 -0
  501. package/examples/browser/vue/node_modules/estree-walker/dist/esm/estree-walker.js +333 -0
  502. package/examples/browser/vue/node_modules/estree-walker/dist/esm/package.json +1 -0
  503. package/examples/browser/vue/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
  504. package/examples/browser/vue/node_modules/estree-walker/package.json +37 -0
  505. package/examples/browser/vue/node_modules/estree-walker/src/async.js +118 -0
  506. package/examples/browser/vue/node_modules/estree-walker/src/index.js +35 -0
  507. package/examples/browser/vue/node_modules/estree-walker/src/package.json +1 -0
  508. package/examples/browser/vue/node_modules/estree-walker/src/sync.js +118 -0
  509. package/examples/browser/vue/node_modules/estree-walker/src/walker.js +61 -0
  510. package/examples/browser/vue/node_modules/estree-walker/types/async.d.ts +53 -0
  511. package/examples/browser/vue/node_modules/estree-walker/types/index.d.ts +56 -0
  512. package/examples/browser/vue/node_modules/estree-walker/types/sync.d.ts +53 -0
  513. package/examples/browser/vue/node_modules/estree-walker/types/tsconfig.tsbuildinfo +345 -0
  514. package/examples/browser/vue/node_modules/estree-walker/types/walker.d.ts +37 -0
  515. package/examples/browser/vue/node_modules/fsevents/LICENSE +22 -0
  516. package/examples/browser/vue/node_modules/fsevents/README.md +89 -0
  517. package/examples/browser/vue/node_modules/fsevents/fsevents.d.ts +46 -0
  518. package/examples/browser/vue/node_modules/fsevents/fsevents.js +83 -0
  519. package/examples/browser/vue/node_modules/fsevents/fsevents.node +0 -0
  520. package/examples/browser/vue/node_modules/fsevents/package.json +62 -0
  521. package/examples/browser/vue/node_modules/magic-string/LICENSE +7 -0
  522. package/examples/browser/vue/node_modules/magic-string/README.md +324 -0
  523. package/examples/browser/vue/node_modules/magic-string/dist/magic-string.cjs.d.ts +289 -0
  524. package/examples/browser/vue/node_modules/magic-string/dist/magic-string.cjs.js +1594 -0
  525. package/examples/browser/vue/node_modules/magic-string/dist/magic-string.cjs.js.map +1 -0
  526. package/examples/browser/vue/node_modules/magic-string/dist/magic-string.es.d.mts +289 -0
  527. package/examples/browser/vue/node_modules/magic-string/dist/magic-string.es.mjs +1588 -0
  528. package/examples/browser/vue/node_modules/magic-string/dist/magic-string.es.mjs.map +1 -0
  529. package/examples/browser/vue/node_modules/magic-string/dist/magic-string.umd.js +1682 -0
  530. package/examples/browser/vue/node_modules/magic-string/dist/magic-string.umd.js.map +1 -0
  531. package/examples/browser/vue/node_modules/magic-string/package.json +70 -0
  532. package/examples/browser/vue/node_modules/nanoid/LICENSE +20 -0
  533. package/examples/browser/vue/node_modules/nanoid/README.md +39 -0
  534. package/examples/browser/vue/node_modules/nanoid/async/index.browser.cjs +69 -0
  535. package/examples/browser/vue/node_modules/nanoid/async/index.browser.js +34 -0
  536. package/examples/browser/vue/node_modules/nanoid/async/index.cjs +71 -0
  537. package/examples/browser/vue/node_modules/nanoid/async/index.d.ts +56 -0
  538. package/examples/browser/vue/node_modules/nanoid/async/index.js +35 -0
  539. package/examples/browser/vue/node_modules/nanoid/async/index.native.js +26 -0
  540. package/examples/browser/vue/node_modules/nanoid/async/package.json +12 -0
  541. package/examples/browser/vue/node_modules/nanoid/bin/nanoid.cjs +55 -0
  542. package/examples/browser/vue/node_modules/nanoid/index.browser.cjs +72 -0
  543. package/examples/browser/vue/node_modules/nanoid/index.browser.js +34 -0
  544. package/examples/browser/vue/node_modules/nanoid/index.cjs +85 -0
  545. package/examples/browser/vue/node_modules/nanoid/index.d.cts +91 -0
  546. package/examples/browser/vue/node_modules/nanoid/index.d.ts +91 -0
  547. package/examples/browser/vue/node_modules/nanoid/index.js +45 -0
  548. package/examples/browser/vue/node_modules/nanoid/nanoid.js +1 -0
  549. package/examples/browser/vue/node_modules/nanoid/non-secure/index.cjs +34 -0
  550. package/examples/browser/vue/node_modules/nanoid/non-secure/index.d.ts +33 -0
  551. package/examples/browser/vue/node_modules/nanoid/non-secure/index.js +21 -0
  552. package/examples/browser/vue/node_modules/nanoid/non-secure/package.json +6 -0
  553. package/examples/browser/vue/node_modules/nanoid/package.json +89 -0
  554. package/examples/browser/vue/node_modules/nanoid/url-alphabet/index.cjs +7 -0
  555. package/examples/browser/vue/node_modules/nanoid/url-alphabet/index.js +3 -0
  556. package/examples/browser/vue/node_modules/nanoid/url-alphabet/package.json +6 -0
  557. package/examples/browser/vue/node_modules/picocolors/LICENSE +15 -0
  558. package/examples/browser/vue/node_modules/picocolors/README.md +21 -0
  559. package/examples/browser/vue/node_modules/picocolors/package.json +25 -0
  560. package/examples/browser/vue/node_modules/picocolors/picocolors.browser.js +4 -0
  561. package/examples/browser/vue/node_modules/picocolors/picocolors.d.ts +5 -0
  562. package/examples/browser/vue/node_modules/picocolors/picocolors.js +75 -0
  563. package/examples/browser/vue/node_modules/picocolors/types.d.ts +51 -0
  564. package/examples/browser/vue/node_modules/pinia/LICENSE +21 -0
  565. package/examples/browser/vue/node_modules/pinia/README.md +24 -0
  566. package/examples/browser/vue/node_modules/pinia/dist/pinia.cjs +2061 -0
  567. package/examples/browser/vue/node_modules/pinia/dist/pinia.d.ts +1074 -0
  568. package/examples/browser/vue/node_modules/pinia/dist/pinia.esm-browser.js +2036 -0
  569. package/examples/browser/vue/node_modules/pinia/dist/pinia.iife.js +2223 -0
  570. package/examples/browser/vue/node_modules/pinia/dist/pinia.iife.prod.js +7 -0
  571. package/examples/browser/vue/node_modules/pinia/dist/pinia.mjs +2044 -0
  572. package/examples/browser/vue/node_modules/pinia/dist/pinia.prod.cjs +846 -0
  573. package/examples/browser/vue/node_modules/pinia/index.cjs +7 -0
  574. package/examples/browser/vue/node_modules/pinia/index.js +7 -0
  575. package/examples/browser/vue/node_modules/pinia/package.json +96 -0
  576. package/examples/browser/vue/node_modules/postcss/LICENSE +20 -0
  577. package/examples/browser/vue/node_modules/postcss/README.md +29 -0
  578. package/examples/browser/vue/node_modules/postcss/lib/at-rule.d.ts +140 -0
  579. package/examples/browser/vue/node_modules/postcss/lib/at-rule.js +25 -0
  580. package/examples/browser/vue/node_modules/postcss/lib/comment.d.ts +68 -0
  581. package/examples/browser/vue/node_modules/postcss/lib/comment.js +13 -0
  582. package/examples/browser/vue/node_modules/postcss/lib/container.d.ts +483 -0
  583. package/examples/browser/vue/node_modules/postcss/lib/container.js +447 -0
  584. package/examples/browser/vue/node_modules/postcss/lib/css-syntax-error.d.ts +248 -0
  585. package/examples/browser/vue/node_modules/postcss/lib/css-syntax-error.js +133 -0
  586. package/examples/browser/vue/node_modules/postcss/lib/declaration.d.ts +151 -0
  587. package/examples/browser/vue/node_modules/postcss/lib/declaration.js +24 -0
  588. package/examples/browser/vue/node_modules/postcss/lib/document.d.ts +69 -0
  589. package/examples/browser/vue/node_modules/postcss/lib/document.js +33 -0
  590. package/examples/browser/vue/node_modules/postcss/lib/fromJSON.d.ts +9 -0
  591. package/examples/browser/vue/node_modules/postcss/lib/fromJSON.js +54 -0
  592. package/examples/browser/vue/node_modules/postcss/lib/input.d.ts +227 -0
  593. package/examples/browser/vue/node_modules/postcss/lib/input.js +265 -0
  594. package/examples/browser/vue/node_modules/postcss/lib/lazy-result.d.ts +190 -0
  595. package/examples/browser/vue/node_modules/postcss/lib/lazy-result.js +550 -0
  596. package/examples/browser/vue/node_modules/postcss/lib/list.d.ts +60 -0
  597. package/examples/browser/vue/node_modules/postcss/lib/list.js +58 -0
  598. package/examples/browser/vue/node_modules/postcss/lib/map-generator.js +368 -0
  599. package/examples/browser/vue/node_modules/postcss/lib/no-work-result.d.ts +46 -0
  600. package/examples/browser/vue/node_modules/postcss/lib/no-work-result.js +138 -0
  601. package/examples/browser/vue/node_modules/postcss/lib/node.d.ts +556 -0
  602. package/examples/browser/vue/node_modules/postcss/lib/node.js +449 -0
  603. package/examples/browser/vue/node_modules/postcss/lib/parse.d.ts +9 -0
  604. package/examples/browser/vue/node_modules/postcss/lib/parse.js +42 -0
  605. package/examples/browser/vue/node_modules/postcss/lib/parser.js +611 -0
  606. package/examples/browser/vue/node_modules/postcss/lib/postcss.d.mts +69 -0
  607. package/examples/browser/vue/node_modules/postcss/lib/postcss.d.ts +458 -0
  608. package/examples/browser/vue/node_modules/postcss/lib/postcss.js +101 -0
  609. package/examples/browser/vue/node_modules/postcss/lib/postcss.mjs +30 -0
  610. package/examples/browser/vue/node_modules/postcss/lib/previous-map.d.ts +81 -0
  611. package/examples/browser/vue/node_modules/postcss/lib/previous-map.js +144 -0
  612. package/examples/browser/vue/node_modules/postcss/lib/processor.d.ts +115 -0
  613. package/examples/browser/vue/node_modules/postcss/lib/processor.js +67 -0
  614. package/examples/browser/vue/node_modules/postcss/lib/result.d.ts +205 -0
  615. package/examples/browser/vue/node_modules/postcss/lib/result.js +42 -0
  616. package/examples/browser/vue/node_modules/postcss/lib/root.d.ts +87 -0
  617. package/examples/browser/vue/node_modules/postcss/lib/root.js +61 -0
  618. package/examples/browser/vue/node_modules/postcss/lib/rule.d.ts +126 -0
  619. package/examples/browser/vue/node_modules/postcss/lib/rule.js +27 -0
  620. package/examples/browser/vue/node_modules/postcss/lib/stringifier.d.ts +46 -0
  621. package/examples/browser/vue/node_modules/postcss/lib/stringifier.js +353 -0
  622. package/examples/browser/vue/node_modules/postcss/lib/stringify.d.ts +9 -0
  623. package/examples/browser/vue/node_modules/postcss/lib/stringify.js +11 -0
  624. package/examples/browser/vue/node_modules/postcss/lib/symbols.js +5 -0
  625. package/examples/browser/vue/node_modules/postcss/lib/terminal-highlight.js +70 -0
  626. package/examples/browser/vue/node_modules/postcss/lib/tokenize.js +266 -0
  627. package/examples/browser/vue/node_modules/postcss/lib/warn-once.js +13 -0
  628. package/examples/browser/vue/node_modules/postcss/lib/warning.d.ts +147 -0
  629. package/examples/browser/vue/node_modules/postcss/lib/warning.js +37 -0
  630. package/examples/browser/vue/node_modules/postcss/package.json +88 -0
  631. package/examples/browser/vue/node_modules/rollup/LICENSE.md +679 -0
  632. package/examples/browser/vue/node_modules/rollup/README.md +134 -0
  633. package/examples/browser/vue/node_modules/rollup/dist/bin/rollup +1912 -0
  634. package/examples/browser/vue/node_modules/rollup/dist/es/getLogFilter.js +64 -0
  635. package/examples/browser/vue/node_modules/rollup/dist/es/package.json +1 -0
  636. package/examples/browser/vue/node_modules/rollup/dist/es/parseAst.js +12 -0
  637. package/examples/browser/vue/node_modules/rollup/dist/es/rollup.js +17 -0
  638. package/examples/browser/vue/node_modules/rollup/dist/es/shared/node-entry.js +23920 -0
  639. package/examples/browser/vue/node_modules/rollup/dist/es/shared/parseAst.js +2086 -0
  640. package/examples/browser/vue/node_modules/rollup/dist/es/shared/watch.js +9297 -0
  641. package/examples/browser/vue/node_modules/rollup/dist/getLogFilter.d.ts +5 -0
  642. package/examples/browser/vue/node_modules/rollup/dist/getLogFilter.js +69 -0
  643. package/examples/browser/vue/node_modules/rollup/dist/loadConfigFile.d.ts +20 -0
  644. package/examples/browser/vue/node_modules/rollup/dist/loadConfigFile.js +29 -0
  645. package/examples/browser/vue/node_modules/rollup/dist/native.js +129 -0
  646. package/examples/browser/vue/node_modules/rollup/dist/parseAst.d.ts +4 -0
  647. package/examples/browser/vue/node_modules/rollup/dist/parseAst.js +22 -0
  648. package/examples/browser/vue/node_modules/rollup/dist/rollup.d.ts +1185 -0
  649. package/examples/browser/vue/node_modules/rollup/dist/rollup.js +127 -0
  650. package/examples/browser/vue/node_modules/rollup/dist/shared/fsevents-importer.js +37 -0
  651. package/examples/browser/vue/node_modules/rollup/dist/shared/index.js +9003 -0
  652. package/examples/browser/vue/node_modules/rollup/dist/shared/loadConfigFile.js +572 -0
  653. package/examples/browser/vue/node_modules/rollup/dist/shared/parseAst.js +2318 -0
  654. package/examples/browser/vue/node_modules/rollup/dist/shared/rollup.js +23842 -0
  655. package/examples/browser/vue/node_modules/rollup/dist/shared/watch-cli.js +542 -0
  656. package/examples/browser/vue/node_modules/rollup/dist/shared/watch.js +324 -0
  657. package/examples/browser/vue/node_modules/rollup/package.json +273 -0
  658. package/examples/browser/vue/node_modules/source-map-js/LICENSE +28 -0
  659. package/examples/browser/vue/node_modules/source-map-js/README.md +765 -0
  660. package/examples/browser/vue/node_modules/source-map-js/lib/array-set.js +121 -0
  661. package/examples/browser/vue/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  662. package/examples/browser/vue/node_modules/source-map-js/lib/base64.js +67 -0
  663. package/examples/browser/vue/node_modules/source-map-js/lib/binary-search.js +111 -0
  664. package/examples/browser/vue/node_modules/source-map-js/lib/mapping-list.js +79 -0
  665. package/examples/browser/vue/node_modules/source-map-js/lib/quick-sort.js +132 -0
  666. package/examples/browser/vue/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
  667. package/examples/browser/vue/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  668. package/examples/browser/vue/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
  669. package/examples/browser/vue/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  670. package/examples/browser/vue/node_modules/source-map-js/lib/source-node.d.ts +1 -0
  671. package/examples/browser/vue/node_modules/source-map-js/lib/source-node.js +413 -0
  672. package/examples/browser/vue/node_modules/source-map-js/lib/util.js +594 -0
  673. package/examples/browser/vue/node_modules/source-map-js/package.json +71 -0
  674. package/examples/browser/vue/node_modules/source-map-js/source-map.d.ts +104 -0
  675. package/examples/browser/vue/node_modules/source-map-js/source-map.js +8 -0
  676. package/examples/browser/vue/node_modules/vite/LICENSE.md +3423 -0
  677. package/examples/browser/vue/node_modules/vite/README.md +20 -0
  678. package/examples/browser/vue/node_modules/vite/bin/openChrome.applescript +95 -0
  679. package/examples/browser/vue/node_modules/vite/bin/vite.js +61 -0
  680. package/examples/browser/vue/node_modules/vite/client.d.ts +256 -0
  681. package/examples/browser/vue/node_modules/vite/dist/client/client.mjs +829 -0
  682. package/examples/browser/vue/node_modules/vite/dist/client/env.mjs +24 -0
  683. package/examples/browser/vue/node_modules/vite/dist/node/chunks/dep-D-7KCb9p.js +7960 -0
  684. package/examples/browser/vue/node_modules/vite/dist/node/chunks/dep-D_zLpgQd.js +67047 -0
  685. package/examples/browser/vue/node_modules/vite/dist/node/chunks/dep-IQS-Za7F.js +561 -0
  686. package/examples/browser/vue/node_modules/vite/dist/node/chunks/dep-YkMKzX4u.js +993 -0
  687. package/examples/browser/vue/node_modules/vite/dist/node/chunks/dep-e9kYborm.js +7004 -0
  688. package/examples/browser/vue/node_modules/vite/dist/node/cli.js +917 -0
  689. package/examples/browser/vue/node_modules/vite/dist/node/constants.js +113 -0
  690. package/examples/browser/vue/node_modules/vite/dist/node/index.d.ts +3627 -0
  691. package/examples/browser/vue/node_modules/vite/dist/node/index.js +261 -0
  692. package/examples/browser/vue/node_modules/vite/dist/node/runtime.d.ts +63 -0
  693. package/examples/browser/vue/node_modules/vite/dist/node/runtime.js +1066 -0
  694. package/examples/browser/vue/node_modules/vite/dist/node/types.d-aGj9QkWt.d.ts +281 -0
  695. package/examples/browser/vue/node_modules/vite/dist/node-cjs/publicUtils.cjs +6171 -0
  696. package/examples/browser/vue/node_modules/vite/index.cjs +60 -0
  697. package/examples/browser/vue/node_modules/vite/index.d.cts +6 -0
  698. package/examples/browser/vue/node_modules/vite/package.json +191 -0
  699. package/examples/browser/vue/node_modules/vite/types/customEvent.d.ts +39 -0
  700. package/examples/browser/vue/node_modules/vite/types/hmrPayload.d.ts +65 -0
  701. package/examples/browser/vue/node_modules/vite/types/hot.d.ts +36 -0
  702. package/examples/browser/vue/node_modules/vite/types/import-meta.d.ts +5 -0
  703. package/examples/browser/vue/node_modules/vite/types/importGlob.d.ts +75 -0
  704. package/examples/browser/vue/node_modules/vite/types/importMeta.d.ts +22 -0
  705. package/examples/browser/vue/node_modules/vite/types/metadata.d.ts +10 -0
  706. package/examples/browser/vue/node_modules/vite/types/package.json +4 -0
  707. package/examples/browser/vue/node_modules/vue/LICENSE +21 -0
  708. package/examples/browser/vue/node_modules/vue/README.md +62 -0
  709. package/examples/browser/vue/node_modules/vue/compiler-sfc/index.browser.js +1 -0
  710. package/examples/browser/vue/node_modules/vue/compiler-sfc/index.browser.mjs +1 -0
  711. package/examples/browser/vue/node_modules/vue/compiler-sfc/index.d.mts +1 -0
  712. package/examples/browser/vue/node_modules/vue/compiler-sfc/index.d.ts +1 -0
  713. package/examples/browser/vue/node_modules/vue/compiler-sfc/index.js +3 -0
  714. package/examples/browser/vue/node_modules/vue/compiler-sfc/index.mjs +3 -0
  715. package/examples/browser/vue/node_modules/vue/compiler-sfc/package.json +4 -0
  716. package/examples/browser/vue/node_modules/vue/compiler-sfc/register-ts.js +3 -0
  717. package/examples/browser/vue/node_modules/vue/dist/vue.cjs.js +80 -0
  718. package/examples/browser/vue/node_modules/vue/dist/vue.cjs.prod.js +66 -0
  719. package/examples/browser/vue/node_modules/vue/dist/vue.d.mts +7 -0
  720. package/examples/browser/vue/node_modules/vue/dist/vue.d.ts +7 -0
  721. package/examples/browser/vue/node_modules/vue/dist/vue.esm-browser.js +18392 -0
  722. package/examples/browser/vue/node_modules/vue/dist/vue.esm-browser.prod.js +12 -0
  723. package/examples/browser/vue/node_modules/vue/dist/vue.esm-bundler.js +71 -0
  724. package/examples/browser/vue/node_modules/vue/dist/vue.global.js +18272 -0
  725. package/examples/browser/vue/node_modules/vue/dist/vue.global.prod.js +12 -0
  726. package/examples/browser/vue/node_modules/vue/dist/vue.runtime.esm-browser.js +12522 -0
  727. package/examples/browser/vue/node_modules/vue/dist/vue.runtime.esm-browser.prod.js +6 -0
  728. package/examples/browser/vue/node_modules/vue/dist/vue.runtime.esm-bundler.js +26 -0
  729. package/examples/browser/vue/node_modules/vue/dist/vue.runtime.global.js +12574 -0
  730. package/examples/browser/vue/node_modules/vue/dist/vue.runtime.global.prod.js +6 -0
  731. package/examples/browser/vue/node_modules/vue/index.js +7 -0
  732. package/examples/browser/vue/node_modules/vue/index.mjs +1 -0
  733. package/examples/browser/vue/node_modules/vue/jsx-runtime/index.d.ts +25 -0
  734. package/examples/browser/vue/node_modules/vue/jsx-runtime/index.js +15 -0
  735. package/examples/browser/vue/node_modules/vue/jsx-runtime/index.mjs +12 -0
  736. package/examples/browser/vue/node_modules/vue/jsx-runtime/package.json +5 -0
  737. package/examples/browser/vue/node_modules/vue/jsx.d.ts +22 -0
  738. package/examples/browser/vue/node_modules/vue/package.json +112 -0
  739. package/examples/browser/vue/node_modules/vue/server-renderer/index.d.mts +1 -0
  740. package/examples/browser/vue/node_modules/vue/server-renderer/index.d.ts +1 -0
  741. package/examples/browser/vue/node_modules/vue/server-renderer/index.js +1 -0
  742. package/examples/browser/vue/node_modules/vue/server-renderer/index.mjs +1 -0
  743. package/examples/browser/vue/node_modules/vue/server-renderer/package.json +4 -0
  744. package/examples/browser/vue/node_modules/vue-demi/LICENSE +21 -0
  745. package/examples/browser/vue/node_modules/vue-demi/README.md +229 -0
  746. package/examples/browser/vue/node_modules/vue-demi/bin/vue-demi-fix.js +3 -0
  747. package/examples/browser/vue/node_modules/vue-demi/bin/vue-demi-switch.js +3 -0
  748. package/examples/browser/vue/node_modules/vue-demi/lib/index.cjs +29 -0
  749. package/examples/browser/vue/node_modules/vue-demi/lib/index.d.ts +22 -0
  750. package/examples/browser/vue/node_modules/vue-demi/lib/index.iife.js +126 -0
  751. package/examples/browser/vue/node_modules/vue-demi/lib/index.mjs +34 -0
  752. package/examples/browser/vue/node_modules/vue-demi/lib/v2/index.cjs +34 -0
  753. package/examples/browser/vue/node_modules/vue-demi/lib/v2/index.d.ts +33 -0
  754. package/examples/browser/vue/node_modules/vue-demi/lib/v2/index.mjs +49 -0
  755. package/examples/browser/vue/node_modules/vue-demi/lib/v2.7/index.cjs +60 -0
  756. package/examples/browser/vue/node_modules/vue-demi/lib/v2.7/index.d.ts +38 -0
  757. package/examples/browser/vue/node_modules/vue-demi/lib/v2.7/index.mjs +80 -0
  758. package/examples/browser/vue/node_modules/vue-demi/lib/v3/index.cjs +29 -0
  759. package/examples/browser/vue/node_modules/vue-demi/lib/v3/index.d.ts +22 -0
  760. package/examples/browser/vue/node_modules/vue-demi/lib/v3/index.mjs +34 -0
  761. package/examples/browser/vue/node_modules/vue-demi/package.json +47 -0
  762. package/examples/browser/vue/node_modules/vue-demi/scripts/postinstall.js +19 -0
  763. package/examples/browser/vue/node_modules/vue-demi/scripts/switch-cli.js +18 -0
  764. package/examples/browser/vue/node_modules/vue-demi/scripts/utils.js +62 -0
  765. package/examples/browser/vue/node_modules/vue-router/LICENSE +21 -0
  766. package/examples/browser/vue/node_modules/vue-router/README.md +111 -0
  767. package/examples/browser/vue/node_modules/vue-router/dist/devtools-BLCumUwL.mjs +1218 -0
  768. package/examples/browser/vue/node_modules/vue-router/dist/experimental/index.d.mts +38 -0
  769. package/examples/browser/vue/node_modules/vue-router/dist/experimental/index.mjs +754 -0
  770. package/examples/browser/vue/node_modules/vue-router/dist/router-BbqN7H95.d.mts +1928 -0
  771. package/examples/browser/vue/node_modules/vue-router/dist/vue-router.cjs +2797 -0
  772. package/examples/browser/vue/node_modules/vue-router/dist/vue-router.d.mts +393 -0
  773. package/examples/browser/vue/node_modules/vue-router/dist/vue-router.esm-browser.js +2743 -0
  774. package/examples/browser/vue/node_modules/vue-router/dist/vue-router.esm-browser.prod.js +6 -0
  775. package/examples/browser/vue/node_modules/vue-router/dist/vue-router.esm-bundler.js +2 -0
  776. package/examples/browser/vue/node_modules/vue-router/dist/vue-router.global.js +3040 -0
  777. package/examples/browser/vue/node_modules/vue-router/dist/vue-router.global.prod.js +6 -0
  778. package/examples/browser/vue/node_modules/vue-router/dist/vue-router.mjs +1557 -0
  779. package/examples/browser/vue/node_modules/vue-router/dist/vue-router.prod.cjs +23 -0
  780. package/examples/browser/vue/node_modules/vue-router/index.js +7 -0
  781. package/examples/browser/vue/node_modules/vue-router/package.json +154 -0
  782. package/examples/browser/vue/node_modules/vue-router/vetur/attributes.json +32 -0
  783. package/examples/browser/vue/node_modules/vue-router/vetur/tags.json +10 -0
  784. package/examples/browser/vue/node_modules/vue-router/vue-router-auto-resolver.d.mts +22 -0
  785. package/examples/browser/vue/node_modules/vue-router/vue-router-auto-routes.d.ts +4 -0
  786. package/examples/browser/vue/node_modules/vue-router/vue-router-auto.d.ts +1 -0
  787. package/examples/browser/vue/node_modules/vue-router/vue-router.node.mjs +2 -0
  788. package/examples/{browser-2 → browser/vue}/package.json +2 -2
  789. package/examples/browser/vue/public/peerpigeon-browser.js +13322 -0
  790. package/examples/browser/vue/public/pigeonlogo.svg +51 -0
  791. package/examples/{browser-2 → browser/vue}/src/App.vue +1 -1
  792. package/examples/{browser-2 → browser/vue}/src/components/DHTView.vue +6 -6
  793. package/examples/{browser-2 → browser/vue}/src/components/DebugView.vue +10 -0
  794. package/examples/{browser-2 → browser/vue}/src/components/MediaView.vue +159 -10
  795. package/examples/{browser-2 → browser/vue}/src/components/MessagingView.vue +40 -12
  796. package/examples/{browser-2 → browser/vue}/src/components/NetworkView.vue +11 -11
  797. package/examples/{browser-2 → browser/vue}/src/router.js +1 -1
  798. package/examples/{browser-2 → browser/vue}/src/stores/peerpigeon.js +387 -9
  799. package/examples/browser/vue/test-vue-restructured-2.log +18 -0
  800. package/examples/browser/vue/test-vue-restructured-3.log +18 -0
  801. package/examples/{browser-2 → browser/vue}/vite.config.js +2 -0
  802. package/package.json +7 -2
  803. package/server/index.js +337 -120
  804. package/src/ConnectionManager.js +62 -10
  805. package/src/GossipManager.js +12 -1
  806. package/src/PeerConnection.js +26 -15
  807. package/src/PeerDiscovery.js +11 -0
  808. package/src/PeerPigeonMesh.js +59 -1
  809. package/src/SignalingClient.js +25 -11
  810. package/src/browser-entry.js +6 -0
  811. package/examples/browser-2/dist/assets/index-Cck_6WJV.css +0 -1
  812. package/examples/browser-2/dist/assets/index-D8-cNlWQ.js +0 -57
  813. /package/examples/browser/{README.md → vanilla/README.md} +0 -0
  814. /package/examples/browser/{minimal → vanilla/minimal}/README.md +0 -0
  815. /package/examples/browser/{minimal → vanilla/minimal}/index.html +0 -0
  816. /package/examples/browser/{minimal → vanilla/minimal}/minimal.js +0 -0
  817. /package/examples/browser/{styles.css → vanilla/styles.css} +0 -0
  818. /package/examples/browser/{test-bundle.html → vanilla/test-bundle.html} +0 -0
  819. /package/examples/{browser-2 → browser/vue}/EXPRESS_SOLUTION.md +0 -0
  820. /package/examples/{browser-2 → browser/vue}/ICE_DEBUG.md +0 -0
  821. /package/examples/{browser-2 → browser/vue}/IMPLEMENTATION.md +0 -0
  822. /package/examples/{browser-2 → browser/vue}/QUICK_START.md +0 -0
  823. /package/examples/{browser-2 → browser/vue}/README.md +0 -0
  824. /package/examples/{browser-2 → browser/vue}/index.html +0 -0
  825. /package/examples/{browser-2 → browser/vue}/package-lock.json +0 -0
  826. /package/examples/{browser-2 → browser/vue}/src/App-simple.vue +0 -0
  827. /package/examples/{browser-2 → browser/vue}/src/components/CryptoView.vue +0 -0
  828. /package/examples/{browser-2 → browser/vue}/src/components/StorageView.vue +0 -0
  829. /package/examples/{browser-2 → browser/vue}/src/components/TestingView.vue +0 -0
  830. /package/examples/{browser-2 → browser/vue}/src/main.js +0 -0
@@ -0,0 +1,2743 @@
1
+ /*!
2
+ * vue-router v4.6.3
3
+ * (c) 2025 Eduardo San Martin Morote
4
+ * @license MIT
5
+ */
6
+ import { computed, defineComponent, getCurrentInstance, h, inject, nextTick, onActivated, onDeactivated, onUnmounted, provide, reactive, ref, shallowReactive, shallowRef, unref, watch, watchEffect } from "vue";
7
+ import { setupDevtoolsPlugin } from "@vue/devtools-api";
8
+
9
+ //#region src/utils/env.ts
10
+ const isBrowser = typeof document !== "undefined";
11
+
12
+ //#endregion
13
+ //#region src/utils/index.ts
14
+ /**
15
+ * Allows differentiating lazy components from functional components and vue-class-component
16
+ * @internal
17
+ *
18
+ * @param component
19
+ */
20
+ function isRouteComponent(component) {
21
+ return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
22
+ }
23
+ function isESModule(obj) {
24
+ return obj.__esModule || obj[Symbol.toStringTag] === "Module" || obj.default && isRouteComponent(obj.default);
25
+ }
26
+ const assign = Object.assign;
27
+ function applyToParams(fn, params) {
28
+ const newParams = {};
29
+ for (const key in params) {
30
+ const value = params[key];
31
+ newParams[key] = isArray(value) ? value.map(fn) : fn(value);
32
+ }
33
+ return newParams;
34
+ }
35
+ const noop = () => {};
36
+ /**
37
+ * Typesafe alternative to Array.isArray
38
+ * https://github.com/microsoft/TypeScript/pull/48228
39
+ */
40
+ const isArray = Array.isArray;
41
+ function mergeOptions(defaults, partialOptions) {
42
+ const options = {};
43
+ for (const key in defaults) options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
44
+ return options;
45
+ }
46
+
47
+ //#endregion
48
+ //#region src/warning.ts
49
+ function warn(msg) {
50
+ const args = Array.from(arguments).slice(1);
51
+ console.warn.apply(console, ["[Vue Router warn]: " + msg].concat(args));
52
+ }
53
+
54
+ //#endregion
55
+ //#region src/encoding.ts
56
+ /**
57
+ * Encoding Rules (␣ = Space)
58
+ * - Path: ␣ " < > # ? { }
59
+ * - Query: ␣ " < > # & =
60
+ * - Hash: ␣ " < > `
61
+ *
62
+ * On top of that, the RFC3986 (https://tools.ietf.org/html/rfc3986#section-2.2)
63
+ * defines some extra characters to be encoded. Most browsers do not encode them
64
+ * in encodeURI https://github.com/whatwg/url/issues/369, so it may be safer to
65
+ * also encode `!'()*`. Leaving un-encoded only ASCII alphanumeric(`a-zA-Z0-9`)
66
+ * plus `-._~`. This extra safety should be applied to query by patching the
67
+ * string returned by encodeURIComponent encodeURI also encodes `[\]^`. `\`
68
+ * should be encoded to avoid ambiguity. Browsers (IE, FF, C) transform a `\`
69
+ * into a `/` if directly typed in. The _backtick_ (`````) should also be
70
+ * encoded everywhere because some browsers like FF encode it when directly
71
+ * written while others don't. Safari and IE don't encode ``"<>{}``` in hash.
72
+ */
73
+ const HASH_RE = /#/g;
74
+ const AMPERSAND_RE = /&/g;
75
+ const SLASH_RE = /\//g;
76
+ const EQUAL_RE = /=/g;
77
+ const IM_RE = /\?/g;
78
+ const PLUS_RE = /\+/g;
79
+ /**
80
+ * NOTE: It's not clear to me if we should encode the + symbol in queries, it
81
+ * seems to be less flexible than not doing so and I can't find out the legacy
82
+ * systems requiring this for regular requests like text/html. In the standard,
83
+ * the encoding of the plus character is only mentioned for
84
+ * application/x-www-form-urlencoded
85
+ * (https://url.spec.whatwg.org/#urlencoded-parsing) and most browsers seems lo
86
+ * leave the plus character as is in queries. To be more flexible, we allow the
87
+ * plus character on the query, but it can also be manually encoded by the user.
88
+ *
89
+ * Resources:
90
+ * - https://url.spec.whatwg.org/#urlencoded-parsing
91
+ * - https://stackoverflow.com/questions/1634271/url-encoding-the-space-character-or-20
92
+ */
93
+ const ENC_BRACKET_OPEN_RE = /%5B/g;
94
+ const ENC_BRACKET_CLOSE_RE = /%5D/g;
95
+ const ENC_CARET_RE = /%5E/g;
96
+ const ENC_BACKTICK_RE = /%60/g;
97
+ const ENC_CURLY_OPEN_RE = /%7B/g;
98
+ const ENC_PIPE_RE = /%7C/g;
99
+ const ENC_CURLY_CLOSE_RE = /%7D/g;
100
+ const ENC_SPACE_RE = /%20/g;
101
+ /**
102
+ * Encode characters that need to be encoded on the path, search and hash
103
+ * sections of the URL.
104
+ *
105
+ * @internal
106
+ * @param text - string to encode
107
+ * @returns encoded string
108
+ */
109
+ function commonEncode(text) {
110
+ return text == null ? "" : encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
111
+ }
112
+ /**
113
+ * Encode characters that need to be encoded on the hash section of the URL.
114
+ *
115
+ * @param text - string to encode
116
+ * @returns encoded string
117
+ */
118
+ function encodeHash(text) {
119
+ return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
120
+ }
121
+ /**
122
+ * Encode characters that need to be encoded query values on the query
123
+ * section of the URL.
124
+ *
125
+ * @param text - string to encode
126
+ * @returns encoded string
127
+ */
128
+ function encodeQueryValue(text) {
129
+ return commonEncode(text).replace(PLUS_RE, "%2B").replace(ENC_SPACE_RE, "+").replace(HASH_RE, "%23").replace(AMPERSAND_RE, "%26").replace(ENC_BACKTICK_RE, "`").replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
130
+ }
131
+ /**
132
+ * Like `encodeQueryValue` but also encodes the `=` character.
133
+ *
134
+ * @param text - string to encode
135
+ */
136
+ function encodeQueryKey(text) {
137
+ return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
138
+ }
139
+ /**
140
+ * Encode characters that need to be encoded on the path section of the URL.
141
+ *
142
+ * @param text - string to encode
143
+ * @returns encoded string
144
+ */
145
+ function encodePath(text) {
146
+ return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
147
+ }
148
+ /**
149
+ * Encode characters that need to be encoded on the path section of the URL as a
150
+ * param. This function encodes everything {@link encodePath} does plus the
151
+ * slash (`/`) character. If `text` is `null` or `undefined`, returns an empty
152
+ * string instead.
153
+ *
154
+ * @param text - string to encode
155
+ * @returns encoded string
156
+ */
157
+ function encodeParam(text) {
158
+ return encodePath(text).replace(SLASH_RE, "%2F");
159
+ }
160
+ function decode(text) {
161
+ if (text == null) return null;
162
+ try {
163
+ return decodeURIComponent("" + text);
164
+ } catch (err) {
165
+ warn(`Error decoding "${text}". Using original value`);
166
+ }
167
+ return "" + text;
168
+ }
169
+
170
+ //#endregion
171
+ //#region src/location.ts
172
+ const TRAILING_SLASH_RE = /\/$/;
173
+ const removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
174
+ /**
175
+ * Transforms a URI into a normalized history location
176
+ *
177
+ * @param parseQuery
178
+ * @param location - URI to normalize
179
+ * @param currentLocation - current absolute location. Allows resolving relative
180
+ * paths. Must start with `/`. Defaults to `/`
181
+ * @returns a normalized history location
182
+ */
183
+ function parseURL(parseQuery$1, location$1, currentLocation = "/") {
184
+ let path, query = {}, searchString = "", hash = "";
185
+ const hashPos = location$1.indexOf("#");
186
+ let searchPos = location$1.indexOf("?");
187
+ searchPos = hashPos >= 0 && searchPos > hashPos ? -1 : searchPos;
188
+ if (searchPos >= 0) {
189
+ path = location$1.slice(0, searchPos);
190
+ searchString = location$1.slice(searchPos, hashPos > 0 ? hashPos : location$1.length);
191
+ query = parseQuery$1(searchString.slice(1));
192
+ }
193
+ if (hashPos >= 0) {
194
+ path = path || location$1.slice(0, hashPos);
195
+ hash = location$1.slice(hashPos, location$1.length);
196
+ }
197
+ path = resolveRelativePath(path != null ? path : location$1, currentLocation);
198
+ return {
199
+ fullPath: path + searchString + hash,
200
+ path,
201
+ query,
202
+ hash: decode(hash)
203
+ };
204
+ }
205
+ /**
206
+ * Stringifies a URL object
207
+ *
208
+ * @param stringifyQuery
209
+ * @param location
210
+ */
211
+ function stringifyURL(stringifyQuery$1, location$1) {
212
+ const query = location$1.query ? stringifyQuery$1(location$1.query) : "";
213
+ return location$1.path + (query && "?") + query + (location$1.hash || "");
214
+ }
215
+ /**
216
+ * Strips off the base from the beginning of a location.pathname in a non-case-sensitive way.
217
+ *
218
+ * @param pathname - location.pathname
219
+ * @param base - base to strip off
220
+ */
221
+ function stripBase(pathname, base) {
222
+ if (!base || !pathname.toLowerCase().startsWith(base.toLowerCase())) return pathname;
223
+ return pathname.slice(base.length) || "/";
224
+ }
225
+ /**
226
+ * Checks if two RouteLocation are equal. This means that both locations are
227
+ * pointing towards the same {@link RouteRecord} and that all `params`, `query`
228
+ * parameters and `hash` are the same
229
+ *
230
+ * @param stringifyQuery - A function that takes a query object of type LocationQueryRaw and returns a string representation of it.
231
+ * @param a - first {@link RouteLocation}
232
+ * @param b - second {@link RouteLocation}
233
+ */
234
+ function isSameRouteLocation(stringifyQuery$1, a, b) {
235
+ const aLastIndex = a.matched.length - 1;
236
+ const bLastIndex = b.matched.length - 1;
237
+ return aLastIndex > -1 && aLastIndex === bLastIndex && isSameRouteRecord(a.matched[aLastIndex], b.matched[bLastIndex]) && isSameRouteLocationParams(a.params, b.params) && stringifyQuery$1(a.query) === stringifyQuery$1(b.query) && a.hash === b.hash;
238
+ }
239
+ /**
240
+ * Check if two `RouteRecords` are equal. Takes into account aliases: they are
241
+ * considered equal to the `RouteRecord` they are aliasing.
242
+ *
243
+ * @param a - first {@link RouteRecord}
244
+ * @param b - second {@link RouteRecord}
245
+ */
246
+ function isSameRouteRecord(a, b) {
247
+ return (a.aliasOf || a) === (b.aliasOf || b);
248
+ }
249
+ function isSameRouteLocationParams(a, b) {
250
+ if (Object.keys(a).length !== Object.keys(b).length) return false;
251
+ for (const key in a) if (!isSameRouteLocationParamsValue(a[key], b[key])) return false;
252
+ return true;
253
+ }
254
+ function isSameRouteLocationParamsValue(a, b) {
255
+ return isArray(a) ? isEquivalentArray(a, b) : isArray(b) ? isEquivalentArray(b, a) : a === b;
256
+ }
257
+ /**
258
+ * Check if two arrays are the same or if an array with one single entry is the
259
+ * same as another primitive value. Used to check query and parameters
260
+ *
261
+ * @param a - array of values
262
+ * @param b - array of values or a single value
263
+ */
264
+ function isEquivalentArray(a, b) {
265
+ return isArray(b) ? a.length === b.length && a.every((value, i) => value === b[i]) : a.length === 1 && a[0] === b;
266
+ }
267
+ /**
268
+ * Resolves a relative path that starts with `.`.
269
+ *
270
+ * @param to - path location we are resolving
271
+ * @param from - currentLocation.path, should start with `/`
272
+ */
273
+ function resolveRelativePath(to, from) {
274
+ if (to.startsWith("/")) return to;
275
+ if (!from.startsWith("/")) {
276
+ warn(`Cannot resolve a relative location without an absolute path. Trying to resolve "${to}" from "${from}". It should look like "/${from}".`);
277
+ return to;
278
+ }
279
+ if (!to) return from;
280
+ const fromSegments = from.split("/");
281
+ const toSegments = to.split("/");
282
+ const lastToSegment = toSegments[toSegments.length - 1];
283
+ if (lastToSegment === ".." || lastToSegment === ".") toSegments.push("");
284
+ let position = fromSegments.length - 1;
285
+ let toPosition;
286
+ let segment;
287
+ for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
288
+ segment = toSegments[toPosition];
289
+ if (segment === ".") continue;
290
+ if (segment === "..") {
291
+ if (position > 1) position--;
292
+ } else break;
293
+ }
294
+ return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition).join("/");
295
+ }
296
+ /**
297
+ * Initial route location where the router is. Can be used in navigation guards
298
+ * to differentiate the initial navigation.
299
+ *
300
+ * @example
301
+ * ```js
302
+ * import { START_LOCATION } from 'vue-router'
303
+ *
304
+ * router.beforeEach((to, from) => {
305
+ * if (from === START_LOCATION) {
306
+ * // initial navigation
307
+ * }
308
+ * })
309
+ * ```
310
+ */
311
+ const START_LOCATION_NORMALIZED = {
312
+ path: "/",
313
+ name: void 0,
314
+ params: {},
315
+ query: {},
316
+ hash: "",
317
+ fullPath: "/",
318
+ matched: [],
319
+ meta: {},
320
+ redirectedFrom: void 0
321
+ };
322
+
323
+ //#endregion
324
+ //#region src/history/common.ts
325
+ let NavigationType = /* @__PURE__ */ function(NavigationType$1) {
326
+ NavigationType$1["pop"] = "pop";
327
+ NavigationType$1["push"] = "push";
328
+ return NavigationType$1;
329
+ }({});
330
+ let NavigationDirection = /* @__PURE__ */ function(NavigationDirection$1) {
331
+ NavigationDirection$1["back"] = "back";
332
+ NavigationDirection$1["forward"] = "forward";
333
+ NavigationDirection$1["unknown"] = "";
334
+ return NavigationDirection$1;
335
+ }({});
336
+ /**
337
+ * Starting location for Histories
338
+ */
339
+ const START = "";
340
+ /**
341
+ * Normalizes a base by removing any trailing slash and reading the base tag if
342
+ * present.
343
+ *
344
+ * @param base - base to normalize
345
+ */
346
+ function normalizeBase(base) {
347
+ if (!base) if (isBrowser) {
348
+ const baseEl = document.querySelector("base");
349
+ base = baseEl && baseEl.getAttribute("href") || "/";
350
+ base = base.replace(/^\w+:\/\/[^\/]+/, "");
351
+ } else base = "/";
352
+ if (base[0] !== "/" && base[0] !== "#") base = "/" + base;
353
+ return removeTrailingSlash(base);
354
+ }
355
+ const BEFORE_HASH_RE = /^[^#]+#/;
356
+ function createHref(base, location$1) {
357
+ return base.replace(BEFORE_HASH_RE, "#") + location$1;
358
+ }
359
+
360
+ //#endregion
361
+ //#region src/scrollBehavior.ts
362
+ function getElementPosition(el, offset) {
363
+ const docRect = document.documentElement.getBoundingClientRect();
364
+ const elRect = el.getBoundingClientRect();
365
+ return {
366
+ behavior: offset.behavior,
367
+ left: elRect.left - docRect.left - (offset.left || 0),
368
+ top: elRect.top - docRect.top - (offset.top || 0)
369
+ };
370
+ }
371
+ const computeScrollPosition = () => ({
372
+ left: window.scrollX,
373
+ top: window.scrollY
374
+ });
375
+ function scrollToPosition(position) {
376
+ let scrollToOptions;
377
+ if ("el" in position) {
378
+ const positionEl = position.el;
379
+ const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
380
+ /**
381
+ * `id`s can accept pretty much any characters, including CSS combinators
382
+ * like `>` or `~`. It's still possible to retrieve elements using
383
+ * `document.getElementById('~')` but it needs to be escaped when using
384
+ * `document.querySelector('#\\~')` for it to be valid. The only
385
+ * requirements for `id`s are them to be unique on the page and to not be
386
+ * empty (`id=""`). Because of that, when passing an id selector, it should
387
+ * be properly escaped for it to work with `querySelector`. We could check
388
+ * for the id selector to be simple (no CSS combinators `+ >~`) but that
389
+ * would make things inconsistent since they are valid characters for an
390
+ * `id` but would need to be escaped when using `querySelector`, breaking
391
+ * their usage and ending up in no selector returned. Selectors need to be
392
+ * escaped:
393
+ *
394
+ * - `#1-thing` becomes `#\31 -thing`
395
+ * - `#with~symbols` becomes `#with\\~symbols`
396
+ *
397
+ * - More information about the topic can be found at
398
+ * https://mathiasbynens.be/notes/html5-id-class.
399
+ * - Practical example: https://mathiasbynens.be/demo/html5-id
400
+ */
401
+ if (typeof position.el === "string") {
402
+ if (!isIdSelector || !document.getElementById(position.el.slice(1))) try {
403
+ const foundEl = document.querySelector(position.el);
404
+ if (isIdSelector && foundEl) {
405
+ warn(`The selector "${position.el}" should be passed as "el: document.querySelector('${position.el}')" because it starts with "#".`);
406
+ return;
407
+ }
408
+ } catch (err) {
409
+ warn(`The selector "${position.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);
410
+ return;
411
+ }
412
+ }
413
+ const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
414
+ if (!el) {
415
+ warn(`Couldn't find element using selector "${position.el}" returned by scrollBehavior.`);
416
+ return;
417
+ }
418
+ scrollToOptions = getElementPosition(el, position);
419
+ } else scrollToOptions = position;
420
+ if ("scrollBehavior" in document.documentElement.style) window.scrollTo(scrollToOptions);
421
+ else window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
422
+ }
423
+ function getScrollKey(path, delta) {
424
+ return (history.state ? history.state.position - delta : -1) + path;
425
+ }
426
+ const scrollPositions = /* @__PURE__ */ new Map();
427
+ function saveScrollPosition(key, scrollPosition) {
428
+ scrollPositions.set(key, scrollPosition);
429
+ }
430
+ function getSavedScrollPosition(key) {
431
+ const scroll = scrollPositions.get(key);
432
+ scrollPositions.delete(key);
433
+ return scroll;
434
+ }
435
+ /**
436
+ * ScrollBehavior instance used by the router to compute and restore the scroll
437
+ * position when navigating.
438
+ */
439
+
440
+ //#endregion
441
+ //#region src/history/html5.ts
442
+ let createBaseLocation = () => location.protocol + "//" + location.host;
443
+ /**
444
+ * Creates a normalized history location from a window.location object
445
+ * @param base - The base path
446
+ * @param location - The window.location object
447
+ */
448
+ function createCurrentLocation(base, location$1) {
449
+ const { pathname, search, hash } = location$1;
450
+ const hashPos = base.indexOf("#");
451
+ if (hashPos > -1) {
452
+ let slicePos = hash.includes(base.slice(hashPos)) ? base.slice(hashPos).length : 1;
453
+ let pathFromHash = hash.slice(slicePos);
454
+ if (pathFromHash[0] !== "/") pathFromHash = "/" + pathFromHash;
455
+ return stripBase(pathFromHash, "");
456
+ }
457
+ return stripBase(pathname, base) + search + hash;
458
+ }
459
+ function useHistoryListeners(base, historyState, currentLocation, replace) {
460
+ let listeners = [];
461
+ let teardowns = [];
462
+ let pauseState = null;
463
+ const popStateHandler = ({ state }) => {
464
+ const to = createCurrentLocation(base, location);
465
+ const from = currentLocation.value;
466
+ const fromState = historyState.value;
467
+ let delta = 0;
468
+ if (state) {
469
+ currentLocation.value = to;
470
+ historyState.value = state;
471
+ if (pauseState && pauseState === from) {
472
+ pauseState = null;
473
+ return;
474
+ }
475
+ delta = fromState ? state.position - fromState.position : 0;
476
+ } else replace(to);
477
+ listeners.forEach((listener) => {
478
+ listener(currentLocation.value, from, {
479
+ delta,
480
+ type: NavigationType.pop,
481
+ direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
482
+ });
483
+ });
484
+ };
485
+ function pauseListeners() {
486
+ pauseState = currentLocation.value;
487
+ }
488
+ function listen(callback) {
489
+ listeners.push(callback);
490
+ const teardown = () => {
491
+ const index = listeners.indexOf(callback);
492
+ if (index > -1) listeners.splice(index, 1);
493
+ };
494
+ teardowns.push(teardown);
495
+ return teardown;
496
+ }
497
+ function beforeUnloadListener() {
498
+ if (document.visibilityState === "hidden") {
499
+ const { history: history$1 } = window;
500
+ if (!history$1.state) return;
501
+ history$1.replaceState(assign({}, history$1.state, { scroll: computeScrollPosition() }), "");
502
+ }
503
+ }
504
+ function destroy() {
505
+ for (const teardown of teardowns) teardown();
506
+ teardowns = [];
507
+ window.removeEventListener("popstate", popStateHandler);
508
+ window.removeEventListener("pagehide", beforeUnloadListener);
509
+ document.removeEventListener("visibilitychange", beforeUnloadListener);
510
+ }
511
+ window.addEventListener("popstate", popStateHandler);
512
+ window.addEventListener("pagehide", beforeUnloadListener);
513
+ document.addEventListener("visibilitychange", beforeUnloadListener);
514
+ return {
515
+ pauseListeners,
516
+ listen,
517
+ destroy
518
+ };
519
+ }
520
+ /**
521
+ * Creates a state object
522
+ */
523
+ function buildState(back, current, forward, replaced = false, computeScroll = false) {
524
+ return {
525
+ back,
526
+ current,
527
+ forward,
528
+ replaced,
529
+ position: window.history.length,
530
+ scroll: computeScroll ? computeScrollPosition() : null
531
+ };
532
+ }
533
+ function useHistoryStateNavigation(base) {
534
+ const { history: history$1, location: location$1 } = window;
535
+ const currentLocation = { value: createCurrentLocation(base, location$1) };
536
+ const historyState = { value: history$1.state };
537
+ if (!historyState.value) changeLocation(currentLocation.value, {
538
+ back: null,
539
+ current: currentLocation.value,
540
+ forward: null,
541
+ position: history$1.length - 1,
542
+ replaced: true,
543
+ scroll: null
544
+ }, true);
545
+ function changeLocation(to, state, replace$1) {
546
+ /**
547
+ * if a base tag is provided, and we are on a normal domain, we have to
548
+ * respect the provided `base` attribute because pushState() will use it and
549
+ * potentially erase anything before the `#` like at
550
+ * https://github.com/vuejs/router/issues/685 where a base of
551
+ * `/folder/#` but a base of `/` would erase the `/folder/` section. If
552
+ * there is no host, the `<base>` tag makes no sense and if there isn't a
553
+ * base tag we can just use everything after the `#`.
554
+ */
555
+ const hashIndex = base.indexOf("#");
556
+ const url = hashIndex > -1 ? (location$1.host && document.querySelector("base") ? base : base.slice(hashIndex)) + to : createBaseLocation() + base + to;
557
+ try {
558
+ history$1[replace$1 ? "replaceState" : "pushState"](state, "", url);
559
+ historyState.value = state;
560
+ } catch (err) {
561
+ warn("Error with push/replace State", err);
562
+ location$1[replace$1 ? "replace" : "assign"](url);
563
+ }
564
+ }
565
+ function replace(to, data) {
566
+ changeLocation(to, assign({}, history$1.state, buildState(historyState.value.back, to, historyState.value.forward, true), data, { position: historyState.value.position }), true);
567
+ currentLocation.value = to;
568
+ }
569
+ function push(to, data) {
570
+ const currentState = assign({}, historyState.value, history$1.state, {
571
+ forward: to,
572
+ scroll: computeScrollPosition()
573
+ });
574
+ if (!history$1.state) warn("history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:\n\nhistory.replaceState(history.state, '', url)\n\nYou can find more information at https://router.vuejs.org/guide/migration/#Usage-of-history-state");
575
+ changeLocation(currentState.current, currentState, true);
576
+ changeLocation(to, assign({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data), false);
577
+ currentLocation.value = to;
578
+ }
579
+ return {
580
+ location: currentLocation,
581
+ state: historyState,
582
+ push,
583
+ replace
584
+ };
585
+ }
586
+ /**
587
+ * Creates an HTML5 history. Most common history for single page applications.
588
+ *
589
+ * @param base -
590
+ */
591
+ function createWebHistory(base) {
592
+ base = normalizeBase(base);
593
+ const historyNavigation = useHistoryStateNavigation(base);
594
+ const historyListeners = useHistoryListeners(base, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
595
+ function go(delta, triggerListeners = true) {
596
+ if (!triggerListeners) historyListeners.pauseListeners();
597
+ history.go(delta);
598
+ }
599
+ const routerHistory = assign({
600
+ location: "",
601
+ base,
602
+ go,
603
+ createHref: createHref.bind(null, base)
604
+ }, historyNavigation, historyListeners);
605
+ Object.defineProperty(routerHistory, "location", {
606
+ enumerable: true,
607
+ get: () => historyNavigation.location.value
608
+ });
609
+ Object.defineProperty(routerHistory, "state", {
610
+ enumerable: true,
611
+ get: () => historyNavigation.state.value
612
+ });
613
+ return routerHistory;
614
+ }
615
+
616
+ //#endregion
617
+ //#region src/history/memory.ts
618
+ /**
619
+ * Creates an in-memory based history. The main purpose of this history is to handle SSR. It starts in a special location that is nowhere.
620
+ * It's up to the user to replace that location with the starter location by either calling `router.push` or `router.replace`.
621
+ *
622
+ * @param base - Base applied to all urls, defaults to '/'
623
+ * @returns a history object that can be passed to the router constructor
624
+ */
625
+ function createMemoryHistory(base = "") {
626
+ let listeners = [];
627
+ let queue = [[START, {}]];
628
+ let position = 0;
629
+ base = normalizeBase(base);
630
+ function setLocation(location$1, state = {}) {
631
+ position++;
632
+ if (position !== queue.length) queue.splice(position);
633
+ queue.push([location$1, state]);
634
+ }
635
+ function triggerListeners(to, from, { direction, delta }) {
636
+ const info = {
637
+ direction,
638
+ delta,
639
+ type: NavigationType.pop
640
+ };
641
+ for (const callback of listeners) callback(to, from, info);
642
+ }
643
+ const routerHistory = {
644
+ location: START,
645
+ state: {},
646
+ base,
647
+ createHref: createHref.bind(null, base),
648
+ replace(to, state) {
649
+ queue.splice(position--, 1);
650
+ setLocation(to, state);
651
+ },
652
+ push(to, state) {
653
+ setLocation(to, state);
654
+ },
655
+ listen(callback) {
656
+ listeners.push(callback);
657
+ return () => {
658
+ const index = listeners.indexOf(callback);
659
+ if (index > -1) listeners.splice(index, 1);
660
+ };
661
+ },
662
+ destroy() {
663
+ listeners = [];
664
+ queue = [[START, {}]];
665
+ position = 0;
666
+ },
667
+ go(delta, shouldTrigger = true) {
668
+ const from = this.location;
669
+ const direction = delta < 0 ? NavigationDirection.back : NavigationDirection.forward;
670
+ position = Math.max(0, Math.min(position + delta, queue.length - 1));
671
+ if (shouldTrigger) triggerListeners(this.location, from, {
672
+ direction,
673
+ delta
674
+ });
675
+ }
676
+ };
677
+ Object.defineProperty(routerHistory, "location", {
678
+ enumerable: true,
679
+ get: () => queue[position][0]
680
+ });
681
+ Object.defineProperty(routerHistory, "state", {
682
+ enumerable: true,
683
+ get: () => queue[position][1]
684
+ });
685
+ return routerHistory;
686
+ }
687
+
688
+ //#endregion
689
+ //#region src/history/hash.ts
690
+ /**
691
+ * Creates a hash history. Useful for web applications with no host (e.g. `file://`) or when configuring a server to
692
+ * handle any URL is not possible.
693
+ *
694
+ * @param base - optional base to provide. Defaults to `location.pathname + location.search` If there is a `<base>` tag
695
+ * in the `head`, its value will be ignored in favor of this parameter **but note it affects all the history.pushState()
696
+ * calls**, meaning that if you use a `<base>` tag, it's `href` value **has to match this parameter** (ignoring anything
697
+ * after the `#`).
698
+ *
699
+ * @example
700
+ * ```js
701
+ * // at https://example.com/folder
702
+ * createWebHashHistory() // gives a url of `https://example.com/folder#`
703
+ * createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
704
+ * // if the `#` is provided in the base, it won't be added by `createWebHashHistory`
705
+ * createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
706
+ * // you should avoid doing this because it changes the original url and breaks copying urls
707
+ * createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
708
+ *
709
+ * // at file:///usr/etc/folder/index.html
710
+ * // for locations with no `host`, the base is ignored
711
+ * createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
712
+ * ```
713
+ */
714
+ function createWebHashHistory(base) {
715
+ base = location.host ? base || location.pathname + location.search : "";
716
+ if (!base.includes("#")) base += "#";
717
+ if (!base.endsWith("#/") && !base.endsWith("#")) warn(`A hash base must end with a "#":\n"${base}" should be "${base.replace(/#.*$/, "#")}".`);
718
+ return createWebHistory(base);
719
+ }
720
+
721
+ //#endregion
722
+ //#region src/types/typeGuards.ts
723
+ function isRouteLocation(route) {
724
+ return typeof route === "string" || route && typeof route === "object";
725
+ }
726
+ function isRouteName(name) {
727
+ return typeof name === "string" || typeof name === "symbol";
728
+ }
729
+
730
+ //#endregion
731
+ //#region src/errors.ts
732
+ /**
733
+ * Flags so we can combine them when checking for multiple errors. This is the internal version of
734
+ * {@link NavigationFailureType}.
735
+ *
736
+ * @internal
737
+ */
738
+ let ErrorTypes = /* @__PURE__ */ function(ErrorTypes$1) {
739
+ ErrorTypes$1[ErrorTypes$1["MATCHER_NOT_FOUND"] = 1] = "MATCHER_NOT_FOUND";
740
+ ErrorTypes$1[ErrorTypes$1["NAVIGATION_GUARD_REDIRECT"] = 2] = "NAVIGATION_GUARD_REDIRECT";
741
+ ErrorTypes$1[ErrorTypes$1["NAVIGATION_ABORTED"] = 4] = "NAVIGATION_ABORTED";
742
+ ErrorTypes$1[ErrorTypes$1["NAVIGATION_CANCELLED"] = 8] = "NAVIGATION_CANCELLED";
743
+ ErrorTypes$1[ErrorTypes$1["NAVIGATION_DUPLICATED"] = 16] = "NAVIGATION_DUPLICATED";
744
+ return ErrorTypes$1;
745
+ }({});
746
+ const NavigationFailureSymbol = Symbol("navigation failure");
747
+ /**
748
+ * Enumeration with all possible types for navigation failures. Can be passed to
749
+ * {@link isNavigationFailure} to check for specific failures.
750
+ */
751
+ let NavigationFailureType = /* @__PURE__ */ function(NavigationFailureType$1) {
752
+ /**
753
+ * An aborted navigation is a navigation that failed because a navigation
754
+ * guard returned `false` or called `next(false)`
755
+ */
756
+ NavigationFailureType$1[NavigationFailureType$1["aborted"] = 4] = "aborted";
757
+ /**
758
+ * A cancelled navigation is a navigation that failed because a more recent
759
+ * navigation finished started (not necessarily finished).
760
+ */
761
+ NavigationFailureType$1[NavigationFailureType$1["cancelled"] = 8] = "cancelled";
762
+ /**
763
+ * A duplicated navigation is a navigation that failed because it was
764
+ * initiated while already being at the exact same location.
765
+ */
766
+ NavigationFailureType$1[NavigationFailureType$1["duplicated"] = 16] = "duplicated";
767
+ return NavigationFailureType$1;
768
+ }({});
769
+ const ErrorTypeMessages = {
770
+ [ErrorTypes.MATCHER_NOT_FOUND]({ location: location$1, currentLocation }) {
771
+ return `No match for\n ${JSON.stringify(location$1)}${currentLocation ? "\nwhile being at\n" + JSON.stringify(currentLocation) : ""}`;
772
+ },
773
+ [ErrorTypes.NAVIGATION_GUARD_REDIRECT]({ from, to }) {
774
+ return `Redirected from "${from.fullPath}" to "${stringifyRoute(to)}" via a navigation guard.`;
775
+ },
776
+ [ErrorTypes.NAVIGATION_ABORTED]({ from, to }) {
777
+ return `Navigation aborted from "${from.fullPath}" to "${to.fullPath}" via a navigation guard.`;
778
+ },
779
+ [ErrorTypes.NAVIGATION_CANCELLED]({ from, to }) {
780
+ return `Navigation cancelled from "${from.fullPath}" to "${to.fullPath}" with a new navigation.`;
781
+ },
782
+ [ErrorTypes.NAVIGATION_DUPLICATED]({ from, to }) {
783
+ return `Avoided redundant navigation to current location: "${from.fullPath}".`;
784
+ }
785
+ };
786
+ /**
787
+ * Creates a typed NavigationFailure object.
788
+ * @internal
789
+ * @param type - NavigationFailureType
790
+ * @param params - { from, to }
791
+ */
792
+ function createRouterError(type, params) {
793
+ return assign(new Error(ErrorTypeMessages[type](params)), {
794
+ type,
795
+ [NavigationFailureSymbol]: true
796
+ }, params);
797
+ }
798
+ function isNavigationFailure(error, type) {
799
+ return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
800
+ }
801
+ const propertiesToLog = [
802
+ "params",
803
+ "query",
804
+ "hash"
805
+ ];
806
+ function stringifyRoute(to) {
807
+ if (typeof to === "string") return to;
808
+ if (to.path != null) return to.path;
809
+ const location$1 = {};
810
+ for (const key of propertiesToLog) if (key in to) location$1[key] = to[key];
811
+ return JSON.stringify(location$1, null, 2);
812
+ }
813
+
814
+ //#endregion
815
+ //#region src/matcher/pathTokenizer.ts
816
+ let TokenType = /* @__PURE__ */ function(TokenType$1) {
817
+ TokenType$1[TokenType$1["Static"] = 0] = "Static";
818
+ TokenType$1[TokenType$1["Param"] = 1] = "Param";
819
+ TokenType$1[TokenType$1["Group"] = 2] = "Group";
820
+ return TokenType$1;
821
+ }({});
822
+ var TokenizerState = /* @__PURE__ */ function(TokenizerState$1) {
823
+ TokenizerState$1[TokenizerState$1["Static"] = 0] = "Static";
824
+ TokenizerState$1[TokenizerState$1["Param"] = 1] = "Param";
825
+ TokenizerState$1[TokenizerState$1["ParamRegExp"] = 2] = "ParamRegExp";
826
+ TokenizerState$1[TokenizerState$1["ParamRegExpEnd"] = 3] = "ParamRegExpEnd";
827
+ TokenizerState$1[TokenizerState$1["EscapeNext"] = 4] = "EscapeNext";
828
+ return TokenizerState$1;
829
+ }(TokenizerState || {});
830
+ const ROOT_TOKEN = {
831
+ type: TokenType.Static,
832
+ value: ""
833
+ };
834
+ const VALID_PARAM_RE = /[a-zA-Z0-9_]/;
835
+ function tokenizePath(path) {
836
+ if (!path) return [[]];
837
+ if (path === "/") return [[ROOT_TOKEN]];
838
+ if (!path.startsWith("/")) throw new Error(`Route paths should start with a "/": "${path}" should be "/${path}".`);
839
+ function crash(message) {
840
+ throw new Error(`ERR (${state})/"${buffer}": ${message}`);
841
+ }
842
+ let state = TokenizerState.Static;
843
+ let previousState = state;
844
+ const tokens = [];
845
+ let segment;
846
+ function finalizeSegment() {
847
+ if (segment) tokens.push(segment);
848
+ segment = [];
849
+ }
850
+ let i = 0;
851
+ let char;
852
+ let buffer = "";
853
+ let customRe = "";
854
+ function consumeBuffer() {
855
+ if (!buffer) return;
856
+ if (state === TokenizerState.Static) segment.push({
857
+ type: TokenType.Static,
858
+ value: buffer
859
+ });
860
+ else if (state === TokenizerState.Param || state === TokenizerState.ParamRegExp || state === TokenizerState.ParamRegExpEnd) {
861
+ if (segment.length > 1 && (char === "*" || char === "+")) crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
862
+ segment.push({
863
+ type: TokenType.Param,
864
+ value: buffer,
865
+ regexp: customRe,
866
+ repeatable: char === "*" || char === "+",
867
+ optional: char === "*" || char === "?"
868
+ });
869
+ } else crash("Invalid state to consume buffer");
870
+ buffer = "";
871
+ }
872
+ function addCharToBuffer() {
873
+ buffer += char;
874
+ }
875
+ while (i < path.length) {
876
+ char = path[i++];
877
+ if (char === "\\" && state !== TokenizerState.ParamRegExp) {
878
+ previousState = state;
879
+ state = TokenizerState.EscapeNext;
880
+ continue;
881
+ }
882
+ switch (state) {
883
+ case TokenizerState.Static:
884
+ if (char === "/") {
885
+ if (buffer) consumeBuffer();
886
+ finalizeSegment();
887
+ } else if (char === ":") {
888
+ consumeBuffer();
889
+ state = TokenizerState.Param;
890
+ } else addCharToBuffer();
891
+ break;
892
+ case TokenizerState.EscapeNext:
893
+ addCharToBuffer();
894
+ state = previousState;
895
+ break;
896
+ case TokenizerState.Param:
897
+ if (char === "(") state = TokenizerState.ParamRegExp;
898
+ else if (VALID_PARAM_RE.test(char)) addCharToBuffer();
899
+ else {
900
+ consumeBuffer();
901
+ state = TokenizerState.Static;
902
+ if (char !== "*" && char !== "?" && char !== "+") i--;
903
+ }
904
+ break;
905
+ case TokenizerState.ParamRegExp:
906
+ if (char === ")") if (customRe[customRe.length - 1] == "\\") customRe = customRe.slice(0, -1) + char;
907
+ else state = TokenizerState.ParamRegExpEnd;
908
+ else customRe += char;
909
+ break;
910
+ case TokenizerState.ParamRegExpEnd:
911
+ consumeBuffer();
912
+ state = TokenizerState.Static;
913
+ if (char !== "*" && char !== "?" && char !== "+") i--;
914
+ customRe = "";
915
+ break;
916
+ default:
917
+ crash("Unknown state");
918
+ break;
919
+ }
920
+ }
921
+ if (state === TokenizerState.ParamRegExp) crash(`Unfinished custom RegExp for param "${buffer}"`);
922
+ consumeBuffer();
923
+ finalizeSegment();
924
+ return tokens;
925
+ }
926
+
927
+ //#endregion
928
+ //#region src/matcher/pathParserRanker.ts
929
+ const BASE_PARAM_PATTERN = "[^/]+?";
930
+ const BASE_PATH_PARSER_OPTIONS = {
931
+ sensitive: false,
932
+ strict: false,
933
+ start: true,
934
+ end: true
935
+ };
936
+ var PathScore = /* @__PURE__ */ function(PathScore$1) {
937
+ PathScore$1[PathScore$1["_multiplier"] = 10] = "_multiplier";
938
+ PathScore$1[PathScore$1["Root"] = 90] = "Root";
939
+ PathScore$1[PathScore$1["Segment"] = 40] = "Segment";
940
+ PathScore$1[PathScore$1["SubSegment"] = 30] = "SubSegment";
941
+ PathScore$1[PathScore$1["Static"] = 40] = "Static";
942
+ PathScore$1[PathScore$1["Dynamic"] = 20] = "Dynamic";
943
+ PathScore$1[PathScore$1["BonusCustomRegExp"] = 10] = "BonusCustomRegExp";
944
+ PathScore$1[PathScore$1["BonusWildcard"] = -50] = "BonusWildcard";
945
+ PathScore$1[PathScore$1["BonusRepeatable"] = -20] = "BonusRepeatable";
946
+ PathScore$1[PathScore$1["BonusOptional"] = -8] = "BonusOptional";
947
+ PathScore$1[PathScore$1["BonusStrict"] = .7000000000000001] = "BonusStrict";
948
+ PathScore$1[PathScore$1["BonusCaseSensitive"] = .25] = "BonusCaseSensitive";
949
+ return PathScore$1;
950
+ }(PathScore || {});
951
+ const REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
952
+ /**
953
+ * Creates a path parser from an array of Segments (a segment is an array of Tokens)
954
+ *
955
+ * @param segments - array of segments returned by tokenizePath
956
+ * @param extraOptions - optional options for the regexp
957
+ * @returns a PathParser
958
+ */
959
+ function tokensToParser(segments, extraOptions) {
960
+ const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
961
+ const score = [];
962
+ let pattern = options.start ? "^" : "";
963
+ const keys = [];
964
+ for (const segment of segments) {
965
+ const segmentScores = segment.length ? [] : [PathScore.Root];
966
+ if (options.strict && !segment.length) pattern += "/";
967
+ for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
968
+ const token = segment[tokenIndex];
969
+ let subSegmentScore = PathScore.Segment + (options.sensitive ? PathScore.BonusCaseSensitive : 0);
970
+ if (token.type === TokenType.Static) {
971
+ if (!tokenIndex) pattern += "/";
972
+ pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
973
+ subSegmentScore += PathScore.Static;
974
+ } else if (token.type === TokenType.Param) {
975
+ const { value, repeatable, optional, regexp } = token;
976
+ keys.push({
977
+ name: value,
978
+ repeatable,
979
+ optional
980
+ });
981
+ const re$1 = regexp ? regexp : BASE_PARAM_PATTERN;
982
+ if (re$1 !== BASE_PARAM_PATTERN) {
983
+ subSegmentScore += PathScore.BonusCustomRegExp;
984
+ try {
985
+ `${re$1}`;
986
+ } catch (err) {
987
+ throw new Error(`Invalid custom RegExp for param "${value}" (${re$1}): ` + err.message);
988
+ }
989
+ }
990
+ let subPattern = repeatable ? `((?:${re$1})(?:/(?:${re$1}))*)` : `(${re$1})`;
991
+ if (!tokenIndex) subPattern = optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
992
+ if (optional) subPattern += "?";
993
+ pattern += subPattern;
994
+ subSegmentScore += PathScore.Dynamic;
995
+ if (optional) subSegmentScore += PathScore.BonusOptional;
996
+ if (repeatable) subSegmentScore += PathScore.BonusRepeatable;
997
+ if (re$1 === ".*") subSegmentScore += PathScore.BonusWildcard;
998
+ }
999
+ segmentScores.push(subSegmentScore);
1000
+ }
1001
+ score.push(segmentScores);
1002
+ }
1003
+ if (options.strict && options.end) {
1004
+ const i = score.length - 1;
1005
+ score[i][score[i].length - 1] += PathScore.BonusStrict;
1006
+ }
1007
+ if (!options.strict) pattern += "/?";
1008
+ if (options.end) pattern += "$";
1009
+ else if (options.strict && !pattern.endsWith("/")) pattern += "(?:/|$)";
1010
+ const re = new RegExp(pattern, options.sensitive ? "" : "i");
1011
+ function parse(path) {
1012
+ const match = path.match(re);
1013
+ const params = {};
1014
+ if (!match) return null;
1015
+ for (let i = 1; i < match.length; i++) {
1016
+ const value = match[i] || "";
1017
+ const key = keys[i - 1];
1018
+ params[key.name] = value && key.repeatable ? value.split("/") : value;
1019
+ }
1020
+ return params;
1021
+ }
1022
+ function stringify(params) {
1023
+ let path = "";
1024
+ let avoidDuplicatedSlash = false;
1025
+ for (const segment of segments) {
1026
+ if (!avoidDuplicatedSlash || !path.endsWith("/")) path += "/";
1027
+ avoidDuplicatedSlash = false;
1028
+ for (const token of segment) if (token.type === TokenType.Static) path += token.value;
1029
+ else if (token.type === TokenType.Param) {
1030
+ const { value, repeatable, optional } = token;
1031
+ const param = value in params ? params[value] : "";
1032
+ if (isArray(param) && !repeatable) throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
1033
+ const text = isArray(param) ? param.join("/") : param;
1034
+ if (!text) if (optional) {
1035
+ if (segment.length < 2) if (path.endsWith("/")) path = path.slice(0, -1);
1036
+ else avoidDuplicatedSlash = true;
1037
+ } else throw new Error(`Missing required param "${value}"`);
1038
+ path += text;
1039
+ }
1040
+ }
1041
+ return path || "/";
1042
+ }
1043
+ return {
1044
+ re,
1045
+ score,
1046
+ keys,
1047
+ parse,
1048
+ stringify
1049
+ };
1050
+ }
1051
+ /**
1052
+ * Compares an array of numbers as used in PathParser.score and returns a
1053
+ * number. This function can be used to `sort` an array
1054
+ *
1055
+ * @param a - first array of numbers
1056
+ * @param b - second array of numbers
1057
+ * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
1058
+ * should be sorted first
1059
+ */
1060
+ function compareScoreArray(a, b) {
1061
+ let i = 0;
1062
+ while (i < a.length && i < b.length) {
1063
+ const diff = b[i] - a[i];
1064
+ if (diff) return diff;
1065
+ i++;
1066
+ }
1067
+ if (a.length < b.length) return a.length === 1 && a[0] === PathScore.Static + PathScore.Segment ? -1 : 1;
1068
+ else if (a.length > b.length) return b.length === 1 && b[0] === PathScore.Static + PathScore.Segment ? 1 : -1;
1069
+ return 0;
1070
+ }
1071
+ /**
1072
+ * Compare function that can be used with `sort` to sort an array of PathParser
1073
+ *
1074
+ * @param a - first PathParser
1075
+ * @param b - second PathParser
1076
+ * @returns 0 if both are equal, < 0 if a should be sorted first, > 0 if b
1077
+ */
1078
+ function comparePathParserScore(a, b) {
1079
+ let i = 0;
1080
+ const aScore = a.score;
1081
+ const bScore = b.score;
1082
+ while (i < aScore.length && i < bScore.length) {
1083
+ const comp = compareScoreArray(aScore[i], bScore[i]);
1084
+ if (comp) return comp;
1085
+ i++;
1086
+ }
1087
+ if (Math.abs(bScore.length - aScore.length) === 1) {
1088
+ if (isLastScoreNegative(aScore)) return 1;
1089
+ if (isLastScoreNegative(bScore)) return -1;
1090
+ }
1091
+ return bScore.length - aScore.length;
1092
+ }
1093
+ /**
1094
+ * This allows detecting splats at the end of a path: /home/:id(.*)*
1095
+ *
1096
+ * @param score - score to check
1097
+ * @returns true if the last entry is negative
1098
+ */
1099
+ function isLastScoreNegative(score) {
1100
+ const last = score[score.length - 1];
1101
+ return score.length > 0 && last[last.length - 1] < 0;
1102
+ }
1103
+ const PATH_PARSER_OPTIONS_DEFAULTS = {
1104
+ strict: false,
1105
+ end: true,
1106
+ sensitive: false
1107
+ };
1108
+
1109
+ //#endregion
1110
+ //#region src/matcher/pathMatcher.ts
1111
+ function createRouteRecordMatcher(record, parent, options) {
1112
+ const parser = tokensToParser(tokenizePath(record.path), options);
1113
+ {
1114
+ const existingKeys = /* @__PURE__ */ new Set();
1115
+ for (const key of parser.keys) {
1116
+ if (existingKeys.has(key.name)) warn(`Found duplicated params with name "${key.name}" for path "${record.path}". Only the last one will be available on "$route.params".`);
1117
+ existingKeys.add(key.name);
1118
+ }
1119
+ }
1120
+ const matcher = assign(parser, {
1121
+ record,
1122
+ parent,
1123
+ children: [],
1124
+ alias: []
1125
+ });
1126
+ if (parent) {
1127
+ if (!matcher.record.aliasOf === !parent.record.aliasOf) parent.children.push(matcher);
1128
+ }
1129
+ return matcher;
1130
+ }
1131
+
1132
+ //#endregion
1133
+ //#region src/matcher/index.ts
1134
+ /**
1135
+ * Creates a Router Matcher.
1136
+ *
1137
+ * @internal
1138
+ * @param routes - array of initial routes
1139
+ * @param globalOptions - global route options
1140
+ */
1141
+ function createRouterMatcher(routes, globalOptions) {
1142
+ const matchers = [];
1143
+ const matcherMap = /* @__PURE__ */ new Map();
1144
+ globalOptions = mergeOptions(PATH_PARSER_OPTIONS_DEFAULTS, globalOptions);
1145
+ function getRecordMatcher(name) {
1146
+ return matcherMap.get(name);
1147
+ }
1148
+ function addRoute(record, parent, originalRecord) {
1149
+ const isRootAdd = !originalRecord;
1150
+ const mainNormalizedRecord = normalizeRouteRecord(record);
1151
+ checkChildMissingNameWithEmptyPath(mainNormalizedRecord, parent);
1152
+ mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
1153
+ const options = mergeOptions(globalOptions, record);
1154
+ const normalizedRecords = [mainNormalizedRecord];
1155
+ if ("alias" in record) {
1156
+ const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
1157
+ for (const alias of aliases) normalizedRecords.push(normalizeRouteRecord(assign({}, mainNormalizedRecord, {
1158
+ components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
1159
+ path: alias,
1160
+ aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
1161
+ })));
1162
+ }
1163
+ let matcher;
1164
+ let originalMatcher;
1165
+ for (const normalizedRecord of normalizedRecords) {
1166
+ const { path } = normalizedRecord;
1167
+ if (parent && path[0] !== "/") {
1168
+ const parentPath = parent.record.path;
1169
+ const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
1170
+ normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
1171
+ }
1172
+ if (normalizedRecord.path === "*") throw new Error("Catch all routes (\"*\") must now be defined using a param with a custom regexp.\nSee more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.");
1173
+ matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
1174
+ if (parent && path[0] === "/") checkMissingParamsInAbsolutePath(matcher, parent);
1175
+ if (originalRecord) {
1176
+ originalRecord.alias.push(matcher);
1177
+ checkSameParams(originalRecord, matcher);
1178
+ } else {
1179
+ originalMatcher = originalMatcher || matcher;
1180
+ if (originalMatcher !== matcher) originalMatcher.alias.push(matcher);
1181
+ if (isRootAdd && record.name && !isAliasRecord(matcher)) {
1182
+ checkSameNameAsAncestor(record, parent);
1183
+ removeRoute(record.name);
1184
+ }
1185
+ }
1186
+ if (isMatchable(matcher)) insertMatcher(matcher);
1187
+ if (mainNormalizedRecord.children) {
1188
+ const children = mainNormalizedRecord.children;
1189
+ for (let i = 0; i < children.length; i++) addRoute(children[i], matcher, originalRecord && originalRecord.children[i]);
1190
+ }
1191
+ originalRecord = originalRecord || matcher;
1192
+ }
1193
+ return originalMatcher ? () => {
1194
+ removeRoute(originalMatcher);
1195
+ } : noop;
1196
+ }
1197
+ function removeRoute(matcherRef) {
1198
+ if (isRouteName(matcherRef)) {
1199
+ const matcher = matcherMap.get(matcherRef);
1200
+ if (matcher) {
1201
+ matcherMap.delete(matcherRef);
1202
+ matchers.splice(matchers.indexOf(matcher), 1);
1203
+ matcher.children.forEach(removeRoute);
1204
+ matcher.alias.forEach(removeRoute);
1205
+ }
1206
+ } else {
1207
+ const index = matchers.indexOf(matcherRef);
1208
+ if (index > -1) {
1209
+ matchers.splice(index, 1);
1210
+ if (matcherRef.record.name) matcherMap.delete(matcherRef.record.name);
1211
+ matcherRef.children.forEach(removeRoute);
1212
+ matcherRef.alias.forEach(removeRoute);
1213
+ }
1214
+ }
1215
+ }
1216
+ function getRoutes() {
1217
+ return matchers;
1218
+ }
1219
+ function insertMatcher(matcher) {
1220
+ const index = findInsertionIndex(matcher, matchers);
1221
+ matchers.splice(index, 0, matcher);
1222
+ if (matcher.record.name && !isAliasRecord(matcher)) matcherMap.set(matcher.record.name, matcher);
1223
+ }
1224
+ function resolve(location$1, currentLocation) {
1225
+ let matcher;
1226
+ let params = {};
1227
+ let path;
1228
+ let name;
1229
+ if ("name" in location$1 && location$1.name) {
1230
+ matcher = matcherMap.get(location$1.name);
1231
+ if (!matcher) throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND, { location: location$1 });
1232
+ {
1233
+ const invalidParams = Object.keys(location$1.params || {}).filter((paramName) => !matcher.keys.find((k) => k.name === paramName));
1234
+ if (invalidParams.length) warn(`Discarded invalid param(s) "${invalidParams.join("\", \"")}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
1235
+ }
1236
+ name = matcher.record.name;
1237
+ params = assign(pickParams(currentLocation.params, matcher.keys.filter((k) => !k.optional).concat(matcher.parent ? matcher.parent.keys.filter((k) => k.optional) : []).map((k) => k.name)), location$1.params && pickParams(location$1.params, matcher.keys.map((k) => k.name)));
1238
+ path = matcher.stringify(params);
1239
+ } else if (location$1.path != null) {
1240
+ path = location$1.path;
1241
+ if (!path.startsWith("/")) warn(`The Matcher cannot resolve relative paths but received "${path}". Unless you directly called \`matcher.resolve("${path}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`);
1242
+ matcher = matchers.find((m) => m.re.test(path));
1243
+ if (matcher) {
1244
+ params = matcher.parse(path);
1245
+ name = matcher.record.name;
1246
+ }
1247
+ } else {
1248
+ matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers.find((m) => m.re.test(currentLocation.path));
1249
+ if (!matcher) throw createRouterError(ErrorTypes.MATCHER_NOT_FOUND, {
1250
+ location: location$1,
1251
+ currentLocation
1252
+ });
1253
+ name = matcher.record.name;
1254
+ params = assign({}, currentLocation.params, location$1.params);
1255
+ path = matcher.stringify(params);
1256
+ }
1257
+ const matched = [];
1258
+ let parentMatcher = matcher;
1259
+ while (parentMatcher) {
1260
+ matched.unshift(parentMatcher.record);
1261
+ parentMatcher = parentMatcher.parent;
1262
+ }
1263
+ return {
1264
+ name,
1265
+ path,
1266
+ params,
1267
+ matched,
1268
+ meta: mergeMetaFields(matched)
1269
+ };
1270
+ }
1271
+ routes.forEach((route) => addRoute(route));
1272
+ function clearRoutes() {
1273
+ matchers.length = 0;
1274
+ matcherMap.clear();
1275
+ }
1276
+ return {
1277
+ addRoute,
1278
+ resolve,
1279
+ removeRoute,
1280
+ clearRoutes,
1281
+ getRoutes,
1282
+ getRecordMatcher
1283
+ };
1284
+ }
1285
+ /**
1286
+ * Picks an object param to contain only specified keys.
1287
+ *
1288
+ * @param params - params object to pick from
1289
+ * @param keys - keys to pick
1290
+ */
1291
+ function pickParams(params, keys) {
1292
+ const newParams = {};
1293
+ for (const key of keys) if (key in params) newParams[key] = params[key];
1294
+ return newParams;
1295
+ }
1296
+ /**
1297
+ * Normalizes a RouteRecordRaw. Creates a copy
1298
+ *
1299
+ * @param record
1300
+ * @returns the normalized version
1301
+ */
1302
+ function normalizeRouteRecord(record) {
1303
+ const normalized = {
1304
+ path: record.path,
1305
+ redirect: record.redirect,
1306
+ name: record.name,
1307
+ meta: record.meta || {},
1308
+ aliasOf: record.aliasOf,
1309
+ beforeEnter: record.beforeEnter,
1310
+ props: normalizeRecordProps(record),
1311
+ children: record.children || [],
1312
+ instances: {},
1313
+ leaveGuards: /* @__PURE__ */ new Set(),
1314
+ updateGuards: /* @__PURE__ */ new Set(),
1315
+ enterCallbacks: {},
1316
+ components: "components" in record ? record.components || null : record.component && { default: record.component }
1317
+ };
1318
+ Object.defineProperty(normalized, "mods", { value: {} });
1319
+ return normalized;
1320
+ }
1321
+ /**
1322
+ * Normalize the optional `props` in a record to always be an object similar to
1323
+ * components. Also accept a boolean for components.
1324
+ * @param record
1325
+ */
1326
+ function normalizeRecordProps(record) {
1327
+ const propsObject = {};
1328
+ const props = record.props || false;
1329
+ if ("component" in record) propsObject.default = props;
1330
+ else for (const name in record.components) propsObject[name] = typeof props === "object" ? props[name] : props;
1331
+ return propsObject;
1332
+ }
1333
+ /**
1334
+ * Checks if a record or any of its parent is an alias
1335
+ * @param record
1336
+ */
1337
+ function isAliasRecord(record) {
1338
+ while (record) {
1339
+ if (record.record.aliasOf) return true;
1340
+ record = record.parent;
1341
+ }
1342
+ return false;
1343
+ }
1344
+ /**
1345
+ * Merge meta fields of an array of records
1346
+ *
1347
+ * @param matched - array of matched records
1348
+ */
1349
+ function mergeMetaFields(matched) {
1350
+ return matched.reduce((meta, record) => assign(meta, record.meta), {});
1351
+ }
1352
+ function isSameParam(a, b) {
1353
+ return a.name === b.name && a.optional === b.optional && a.repeatable === b.repeatable;
1354
+ }
1355
+ /**
1356
+ * Check if a path and its alias have the same required params
1357
+ *
1358
+ * @param a - original record
1359
+ * @param b - alias record
1360
+ */
1361
+ function checkSameParams(a, b) {
1362
+ for (const key of a.keys) if (!key.optional && !b.keys.find(isSameParam.bind(null, key))) return warn(`Alias "${b.record.path}" and the original record: "${a.record.path}" must have the exact same param named "${key.name}"`);
1363
+ for (const key of b.keys) if (!key.optional && !a.keys.find(isSameParam.bind(null, key))) return warn(`Alias "${b.record.path}" and the original record: "${a.record.path}" must have the exact same param named "${key.name}"`);
1364
+ }
1365
+ /**
1366
+ * A route with a name and a child with an empty path without a name should warn when adding the route
1367
+ *
1368
+ * @param mainNormalizedRecord - RouteRecordNormalized
1369
+ * @param parent - RouteRecordMatcher
1370
+ */
1371
+ function checkChildMissingNameWithEmptyPath(mainNormalizedRecord, parent) {
1372
+ if (parent && parent.record.name && !mainNormalizedRecord.name && !mainNormalizedRecord.path) warn(`The route named "${String(parent.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`);
1373
+ }
1374
+ function checkSameNameAsAncestor(record, parent) {
1375
+ for (let ancestor = parent; ancestor; ancestor = ancestor.parent) if (ancestor.record.name === record.name) throw new Error(`A route named "${String(record.name)}" has been added as a ${parent === ancestor ? "child" : "descendant"} of a route with the same name. Route names must be unique and a nested route cannot use the same name as an ancestor.`);
1376
+ }
1377
+ function checkMissingParamsInAbsolutePath(record, parent) {
1378
+ for (const key of parent.keys) if (!record.keys.find(isSameParam.bind(null, key))) return warn(`Absolute path "${record.record.path}" must have the exact same param named "${key.name}" as its parent "${parent.record.path}".`);
1379
+ }
1380
+ /**
1381
+ * Performs a binary search to find the correct insertion index for a new matcher.
1382
+ *
1383
+ * Matchers are primarily sorted by their score. If scores are tied then we also consider parent/child relationships,
1384
+ * with descendants coming before ancestors. If there's still a tie, new routes are inserted after existing routes.
1385
+ *
1386
+ * @param matcher - new matcher to be inserted
1387
+ * @param matchers - existing matchers
1388
+ */
1389
+ function findInsertionIndex(matcher, matchers) {
1390
+ let lower = 0;
1391
+ let upper = matchers.length;
1392
+ while (lower !== upper) {
1393
+ const mid = lower + upper >> 1;
1394
+ if (comparePathParserScore(matcher, matchers[mid]) < 0) upper = mid;
1395
+ else lower = mid + 1;
1396
+ }
1397
+ const insertionAncestor = getInsertionAncestor(matcher);
1398
+ if (insertionAncestor) {
1399
+ upper = matchers.lastIndexOf(insertionAncestor, upper - 1);
1400
+ if (upper < 0) warn(`Finding ancestor route "${insertionAncestor.record.path}" failed for "${matcher.record.path}"`);
1401
+ }
1402
+ return upper;
1403
+ }
1404
+ function getInsertionAncestor(matcher) {
1405
+ let ancestor = matcher;
1406
+ while (ancestor = ancestor.parent) if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0) return ancestor;
1407
+ }
1408
+ /**
1409
+ * Checks if a matcher can be reachable. This means if it's possible to reach it as a route. For example, routes without
1410
+ * a component, or name, or redirect, are just used to group other routes.
1411
+ * @param matcher
1412
+ * @param matcher.record record of the matcher
1413
+ * @returns
1414
+ */
1415
+ function isMatchable({ record }) {
1416
+ return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
1417
+ }
1418
+
1419
+ //#endregion
1420
+ //#region src/query.ts
1421
+ /**
1422
+ * Transforms a queryString into a {@link LocationQuery} object. Accept both, a
1423
+ * version with the leading `?` and without Should work as URLSearchParams
1424
+
1425
+ * @internal
1426
+ *
1427
+ * @param search - search string to parse
1428
+ * @returns a query object
1429
+ */
1430
+ function parseQuery(search) {
1431
+ const query = {};
1432
+ if (search === "" || search === "?") return query;
1433
+ const searchParams = (search[0] === "?" ? search.slice(1) : search).split("&");
1434
+ for (let i = 0; i < searchParams.length; ++i) {
1435
+ const searchParam = searchParams[i].replace(PLUS_RE, " ");
1436
+ const eqPos = searchParam.indexOf("=");
1437
+ const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
1438
+ const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
1439
+ if (key in query) {
1440
+ let currentValue = query[key];
1441
+ if (!isArray(currentValue)) currentValue = query[key] = [currentValue];
1442
+ currentValue.push(value);
1443
+ } else query[key] = value;
1444
+ }
1445
+ return query;
1446
+ }
1447
+ /**
1448
+ * Stringifies a {@link LocationQueryRaw} object. Like `URLSearchParams`, it
1449
+ * doesn't prepend a `?`
1450
+ *
1451
+ * @internal
1452
+ *
1453
+ * @param query - query object to stringify
1454
+ * @returns string version of the query without the leading `?`
1455
+ */
1456
+ function stringifyQuery(query) {
1457
+ let search = "";
1458
+ for (let key in query) {
1459
+ const value = query[key];
1460
+ key = encodeQueryKey(key);
1461
+ if (value == null) {
1462
+ if (value !== void 0) search += (search.length ? "&" : "") + key;
1463
+ continue;
1464
+ }
1465
+ (isArray(value) ? value.map((v) => v && encodeQueryValue(v)) : [value && encodeQueryValue(value)]).forEach((value$1) => {
1466
+ if (value$1 !== void 0) {
1467
+ search += (search.length ? "&" : "") + key;
1468
+ if (value$1 != null) search += "=" + value$1;
1469
+ }
1470
+ });
1471
+ }
1472
+ return search;
1473
+ }
1474
+ /**
1475
+ * Transforms a {@link LocationQueryRaw} into a {@link LocationQuery} by casting
1476
+ * numbers into strings, removing keys with an undefined value and replacing
1477
+ * undefined with null in arrays
1478
+ *
1479
+ * @param query - query object to normalize
1480
+ * @returns a normalized query object
1481
+ */
1482
+ function normalizeQuery(query) {
1483
+ const normalizedQuery = {};
1484
+ for (const key in query) {
1485
+ const value = query[key];
1486
+ if (value !== void 0) normalizedQuery[key] = isArray(value) ? value.map((v) => v == null ? null : "" + v) : value == null ? value : "" + value;
1487
+ }
1488
+ return normalizedQuery;
1489
+ }
1490
+
1491
+ //#endregion
1492
+ //#region src/injectionSymbols.ts
1493
+ /**
1494
+ * RouteRecord being rendered by the closest ancestor Router View. Used for
1495
+ * `onBeforeRouteUpdate` and `onBeforeRouteLeave`. rvlm stands for Router View
1496
+ * Location Matched
1497
+ *
1498
+ * @internal
1499
+ */
1500
+ const matchedRouteKey = Symbol("router view location matched");
1501
+ /**
1502
+ * Allows overriding the router view depth to control which component in
1503
+ * `matched` is rendered. rvd stands for Router View Depth
1504
+ *
1505
+ * @internal
1506
+ */
1507
+ const viewDepthKey = Symbol("router view depth");
1508
+ /**
1509
+ * Allows overriding the router instance returned by `useRouter` in tests. r
1510
+ * stands for router
1511
+ *
1512
+ * @internal
1513
+ */
1514
+ const routerKey = Symbol("router");
1515
+ /**
1516
+ * Allows overriding the current route returned by `useRoute` in tests. rl
1517
+ * stands for route location
1518
+ *
1519
+ * @internal
1520
+ */
1521
+ const routeLocationKey = Symbol("route location");
1522
+ /**
1523
+ * Allows overriding the current route used by router-view. Internally this is
1524
+ * used when the `route` prop is passed.
1525
+ *
1526
+ * @internal
1527
+ */
1528
+ const routerViewLocationKey = Symbol("router view location");
1529
+
1530
+ //#endregion
1531
+ //#region src/utils/callbacks.ts
1532
+ /**
1533
+ * Create a list of callbacks that can be reset. Used to create before and after navigation guards list
1534
+ */
1535
+ function useCallbacks() {
1536
+ let handlers = [];
1537
+ function add(handler) {
1538
+ handlers.push(handler);
1539
+ return () => {
1540
+ const i = handlers.indexOf(handler);
1541
+ if (i > -1) handlers.splice(i, 1);
1542
+ };
1543
+ }
1544
+ function reset() {
1545
+ handlers = [];
1546
+ }
1547
+ return {
1548
+ add,
1549
+ list: () => handlers.slice(),
1550
+ reset
1551
+ };
1552
+ }
1553
+
1554
+ //#endregion
1555
+ //#region src/navigationGuards.ts
1556
+ function registerGuard(record, name, guard) {
1557
+ const removeFromList = () => {
1558
+ record[name].delete(guard);
1559
+ };
1560
+ onUnmounted(removeFromList);
1561
+ onDeactivated(removeFromList);
1562
+ onActivated(() => {
1563
+ record[name].add(guard);
1564
+ });
1565
+ record[name].add(guard);
1566
+ }
1567
+ /**
1568
+ * Add a navigation guard that triggers whenever the component for the current
1569
+ * location is about to be left. Similar to {@link beforeRouteLeave} but can be
1570
+ * used in any component. The guard is removed when the component is unmounted.
1571
+ *
1572
+ * @param leaveGuard - {@link NavigationGuard}
1573
+ */
1574
+ function onBeforeRouteLeave(leaveGuard) {
1575
+ if (!getCurrentInstance()) {
1576
+ warn("getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function");
1577
+ return;
1578
+ }
1579
+ const activeRecord = inject(matchedRouteKey, {}).value;
1580
+ if (!activeRecord) {
1581
+ warn("No active route record was found when calling `onBeforeRouteLeave()`. Make sure you call this function inside a component child of <router-view>. Maybe you called it inside of App.vue?");
1582
+ return;
1583
+ }
1584
+ registerGuard(activeRecord, "leaveGuards", leaveGuard);
1585
+ }
1586
+ /**
1587
+ * Add a navigation guard that triggers whenever the current location is about
1588
+ * to be updated. Similar to {@link beforeRouteUpdate} but can be used in any
1589
+ * component. The guard is removed when the component is unmounted.
1590
+ *
1591
+ * @param updateGuard - {@link NavigationGuard}
1592
+ */
1593
+ function onBeforeRouteUpdate(updateGuard) {
1594
+ if (!getCurrentInstance()) {
1595
+ warn("getCurrentInstance() returned null. onBeforeRouteUpdate() must be called at the top of a setup function");
1596
+ return;
1597
+ }
1598
+ const activeRecord = inject(matchedRouteKey, {}).value;
1599
+ if (!activeRecord) {
1600
+ warn("No active route record was found when calling `onBeforeRouteUpdate()`. Make sure you call this function inside a component child of <router-view>. Maybe you called it inside of App.vue?");
1601
+ return;
1602
+ }
1603
+ registerGuard(activeRecord, "updateGuards", updateGuard);
1604
+ }
1605
+ function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn) => fn()) {
1606
+ const enterCallbackArray = record && (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
1607
+ return () => new Promise((resolve, reject) => {
1608
+ const next = (valid) => {
1609
+ if (valid === false) reject(createRouterError(ErrorTypes.NAVIGATION_ABORTED, {
1610
+ from,
1611
+ to
1612
+ }));
1613
+ else if (valid instanceof Error) reject(valid);
1614
+ else if (isRouteLocation(valid)) reject(createRouterError(ErrorTypes.NAVIGATION_GUARD_REDIRECT, {
1615
+ from: to,
1616
+ to: valid
1617
+ }));
1618
+ else {
1619
+ if (enterCallbackArray && record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") enterCallbackArray.push(valid);
1620
+ resolve();
1621
+ }
1622
+ };
1623
+ const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, canOnlyBeCalledOnce(next, to, from)));
1624
+ let guardCall = Promise.resolve(guardReturn);
1625
+ if (guard.length < 3) guardCall = guardCall.then(next);
1626
+ if (guard.length > 2) {
1627
+ const message = `The "next" callback was never called inside of ${guard.name ? "\"" + guard.name + "\"" : ""}:\n${guard.toString()}\n. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;
1628
+ if (typeof guardReturn === "object" && "then" in guardReturn) guardCall = guardCall.then((resolvedValue) => {
1629
+ if (!next._called) {
1630
+ warn(message);
1631
+ return Promise.reject(/* @__PURE__ */ new Error("Invalid navigation guard"));
1632
+ }
1633
+ return resolvedValue;
1634
+ });
1635
+ else if (guardReturn !== void 0) {
1636
+ if (!next._called) {
1637
+ warn(message);
1638
+ reject(/* @__PURE__ */ new Error("Invalid navigation guard"));
1639
+ return;
1640
+ }
1641
+ }
1642
+ }
1643
+ guardCall.catch((err) => reject(err));
1644
+ });
1645
+ }
1646
+ function canOnlyBeCalledOnce(next, to, from) {
1647
+ let called = 0;
1648
+ return function() {
1649
+ if (called++ === 1) warn(`The "next" callback was called more than once in one navigation guard when going from "${from.fullPath}" to "${to.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`);
1650
+ next._called = true;
1651
+ if (called === 1) next.apply(null, arguments);
1652
+ };
1653
+ }
1654
+ function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn) => fn()) {
1655
+ const guards = [];
1656
+ for (const record of matched) {
1657
+ if (!record.components && record.children && !record.children.length) warn(`Record with path "${record.path}" is either missing a "component(s)" or "children" property.`);
1658
+ for (const name in record.components) {
1659
+ let rawComponent = record.components[name];
1660
+ if (!rawComponent || typeof rawComponent !== "object" && typeof rawComponent !== "function") {
1661
+ warn(`Component "${name}" in record with path "${record.path}" is not a valid component. Received "${String(rawComponent)}".`);
1662
+ throw new Error("Invalid route component");
1663
+ } else if ("then" in rawComponent) {
1664
+ warn(`Component "${name}" in record with path "${record.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);
1665
+ const promise = rawComponent;
1666
+ rawComponent = () => promise;
1667
+ } else if (rawComponent.__asyncLoader && !rawComponent.__warnedDefineAsync) {
1668
+ rawComponent.__warnedDefineAsync = true;
1669
+ warn(`Component "${name}" in record with path "${record.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`);
1670
+ }
1671
+ if (guardType !== "beforeRouteEnter" && !record.instances[name]) continue;
1672
+ if (isRouteComponent(rawComponent)) {
1673
+ const guard = (rawComponent.__vccOpts || rawComponent)[guardType];
1674
+ guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
1675
+ } else {
1676
+ let componentPromise = rawComponent();
1677
+ if (!("catch" in componentPromise)) {
1678
+ warn(`Component "${name}" in record with path "${record.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`);
1679
+ componentPromise = Promise.resolve(componentPromise);
1680
+ }
1681
+ guards.push(() => componentPromise.then((resolved) => {
1682
+ if (!resolved) throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
1683
+ const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
1684
+ record.mods[name] = resolved;
1685
+ record.components[name] = resolvedComponent;
1686
+ const guard = (resolvedComponent.__vccOpts || resolvedComponent)[guardType];
1687
+ return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
1688
+ }));
1689
+ }
1690
+ }
1691
+ }
1692
+ return guards;
1693
+ }
1694
+ /**
1695
+ * Ensures a route is loaded, so it can be passed as o prop to `<RouterView>`.
1696
+ *
1697
+ * @param route - resolved route to load
1698
+ */
1699
+ function loadRouteLocation(route) {
1700
+ return route.matched.every((record) => record.redirect) ? Promise.reject(/* @__PURE__ */ new Error("Cannot load a route that redirects.")) : Promise.all(route.matched.map((record) => record.components && Promise.all(Object.keys(record.components).reduce((promises, name) => {
1701
+ const rawComponent = record.components[name];
1702
+ if (typeof rawComponent === "function" && !("displayName" in rawComponent)) promises.push(rawComponent().then((resolved) => {
1703
+ if (!resolved) return Promise.reject(/* @__PURE__ */ new Error(`Couldn't resolve component "${name}" at "${record.path}". Ensure you passed a function that returns a promise.`));
1704
+ const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
1705
+ record.mods[name] = resolved;
1706
+ record.components[name] = resolvedComponent;
1707
+ }));
1708
+ return promises;
1709
+ }, [])))).then(() => route);
1710
+ }
1711
+ /**
1712
+ * Split the leaving, updating, and entering records.
1713
+ * @internal
1714
+ *
1715
+ * @param to - Location we are navigating to
1716
+ * @param from - Location we are navigating from
1717
+ */
1718
+ function extractChangingRecords(to, from) {
1719
+ const leavingRecords = [];
1720
+ const updatingRecords = [];
1721
+ const enteringRecords = [];
1722
+ const len = Math.max(from.matched.length, to.matched.length);
1723
+ for (let i = 0; i < len; i++) {
1724
+ const recordFrom = from.matched[i];
1725
+ if (recordFrom) if (to.matched.find((record) => isSameRouteRecord(record, recordFrom))) updatingRecords.push(recordFrom);
1726
+ else leavingRecords.push(recordFrom);
1727
+ const recordTo = to.matched[i];
1728
+ if (recordTo) {
1729
+ if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) enteringRecords.push(recordTo);
1730
+ }
1731
+ }
1732
+ return [
1733
+ leavingRecords,
1734
+ updatingRecords,
1735
+ enteringRecords
1736
+ ];
1737
+ }
1738
+
1739
+ //#endregion
1740
+ //#region src/RouterLink.ts
1741
+ /**
1742
+ * Returns the internal behavior of a {@link RouterLink} without the rendering part.
1743
+ *
1744
+ * @param props - a `to` location and an optional `replace` flag
1745
+ */
1746
+ function useLink(props) {
1747
+ const router = inject(routerKey);
1748
+ const currentRoute = inject(routeLocationKey);
1749
+ let hasPrevious = false;
1750
+ let previousTo = null;
1751
+ const route = computed(() => {
1752
+ const to = unref(props.to);
1753
+ if (!hasPrevious || to !== previousTo) {
1754
+ if (!isRouteLocation(to)) if (hasPrevious) warn(`Invalid value for prop "to" in useLink()\n- to:`, to, `\n- previous to:`, previousTo, `\n- props:`, props);
1755
+ else warn(`Invalid value for prop "to" in useLink()\n- to:`, to, `\n- props:`, props);
1756
+ previousTo = to;
1757
+ hasPrevious = true;
1758
+ }
1759
+ return router.resolve(to);
1760
+ });
1761
+ const activeRecordIndex = computed(() => {
1762
+ const { matched } = route.value;
1763
+ const { length } = matched;
1764
+ const routeMatched = matched[length - 1];
1765
+ const currentMatched = currentRoute.matched;
1766
+ if (!routeMatched || !currentMatched.length) return -1;
1767
+ const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
1768
+ if (index > -1) return index;
1769
+ const parentRecordPath = getOriginalPath(matched[length - 2]);
1770
+ return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index;
1771
+ });
1772
+ const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
1773
+ const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
1774
+ function navigate(e = {}) {
1775
+ if (guardEvent(e)) {
1776
+ const p = router[unref(props.replace) ? "replace" : "push"](unref(props.to)).catch(noop);
1777
+ if (props.viewTransition && typeof document !== "undefined" && "startViewTransition" in document) document.startViewTransition(() => p);
1778
+ return p;
1779
+ }
1780
+ return Promise.resolve();
1781
+ }
1782
+ if (isBrowser) {
1783
+ const instance = getCurrentInstance();
1784
+ if (instance) {
1785
+ const linkContextDevtools = {
1786
+ route: route.value,
1787
+ isActive: isActive.value,
1788
+ isExactActive: isExactActive.value,
1789
+ error: null
1790
+ };
1791
+ instance.__vrl_devtools = instance.__vrl_devtools || [];
1792
+ instance.__vrl_devtools.push(linkContextDevtools);
1793
+ watchEffect(() => {
1794
+ linkContextDevtools.route = route.value;
1795
+ linkContextDevtools.isActive = isActive.value;
1796
+ linkContextDevtools.isExactActive = isExactActive.value;
1797
+ linkContextDevtools.error = isRouteLocation(unref(props.to)) ? null : "Invalid \"to\" value";
1798
+ }, { flush: "post" });
1799
+ }
1800
+ }
1801
+ /**
1802
+ * NOTE: update {@link _RouterLinkI}'s `$slots` type when updating this
1803
+ */
1804
+ return {
1805
+ route,
1806
+ href: computed(() => route.value.href),
1807
+ isActive,
1808
+ isExactActive,
1809
+ navigate
1810
+ };
1811
+ }
1812
+ function preferSingleVNode(vnodes) {
1813
+ return vnodes.length === 1 ? vnodes[0] : vnodes;
1814
+ }
1815
+ const RouterLinkImpl = /* @__PURE__ */ defineComponent({
1816
+ name: "RouterLink",
1817
+ compatConfig: { MODE: 3 },
1818
+ props: {
1819
+ to: {
1820
+ type: [String, Object],
1821
+ required: true
1822
+ },
1823
+ replace: Boolean,
1824
+ activeClass: String,
1825
+ exactActiveClass: String,
1826
+ custom: Boolean,
1827
+ ariaCurrentValue: {
1828
+ type: String,
1829
+ default: "page"
1830
+ },
1831
+ viewTransition: Boolean
1832
+ },
1833
+ useLink,
1834
+ setup(props, { slots }) {
1835
+ const link = reactive(useLink(props));
1836
+ const { options } = inject(routerKey);
1837
+ const elClass = computed(() => ({
1838
+ [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
1839
+ [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
1840
+ }));
1841
+ return () => {
1842
+ const children = slots.default && preferSingleVNode(slots.default(link));
1843
+ return props.custom ? children : h("a", {
1844
+ "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
1845
+ href: link.href,
1846
+ onClick: link.navigate,
1847
+ class: elClass.value
1848
+ }, children);
1849
+ };
1850
+ }
1851
+ });
1852
+ /**
1853
+ * Component to render a link that triggers a navigation on click.
1854
+ */
1855
+ const RouterLink = RouterLinkImpl;
1856
+ function guardEvent(e) {
1857
+ if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
1858
+ if (e.defaultPrevented) return;
1859
+ if (e.button !== void 0 && e.button !== 0) return;
1860
+ if (e.currentTarget && e.currentTarget.getAttribute) {
1861
+ const target = e.currentTarget.getAttribute("target");
1862
+ if (/\b_blank\b/i.test(target)) return;
1863
+ }
1864
+ if (e.preventDefault) e.preventDefault();
1865
+ return true;
1866
+ }
1867
+ function includesParams(outer, inner) {
1868
+ for (const key in inner) {
1869
+ const innerValue = inner[key];
1870
+ const outerValue = outer[key];
1871
+ if (typeof innerValue === "string") {
1872
+ if (innerValue !== outerValue) return false;
1873
+ } else if (!isArray(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value !== outerValue[i])) return false;
1874
+ }
1875
+ return true;
1876
+ }
1877
+ /**
1878
+ * Get the original path value of a record by following its aliasOf
1879
+ * @param record
1880
+ */
1881
+ function getOriginalPath(record) {
1882
+ return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
1883
+ }
1884
+ /**
1885
+ * Utility class to get the active class based on defaults.
1886
+ * @param propClass
1887
+ * @param globalClass
1888
+ * @param defaultClass
1889
+ */
1890
+ const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
1891
+
1892
+ //#endregion
1893
+ //#region src/RouterView.ts
1894
+ const RouterViewImpl = /* @__PURE__ */ defineComponent({
1895
+ name: "RouterView",
1896
+ inheritAttrs: false,
1897
+ props: {
1898
+ name: {
1899
+ type: String,
1900
+ default: "default"
1901
+ },
1902
+ route: Object
1903
+ },
1904
+ compatConfig: { MODE: 3 },
1905
+ setup(props, { attrs, slots }) {
1906
+ warnDeprecatedUsage();
1907
+ const injectedRoute = inject(routerViewLocationKey);
1908
+ const routeToDisplay = computed(() => props.route || injectedRoute.value);
1909
+ const injectedDepth = inject(viewDepthKey, 0);
1910
+ const depth = computed(() => {
1911
+ let initialDepth = unref(injectedDepth);
1912
+ const { matched } = routeToDisplay.value;
1913
+ let matchedRoute;
1914
+ while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) initialDepth++;
1915
+ return initialDepth;
1916
+ });
1917
+ const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
1918
+ provide(viewDepthKey, computed(() => depth.value + 1));
1919
+ provide(matchedRouteKey, matchedRouteRef);
1920
+ provide(routerViewLocationKey, routeToDisplay);
1921
+ const viewRef = ref();
1922
+ watch(() => [
1923
+ viewRef.value,
1924
+ matchedRouteRef.value,
1925
+ props.name
1926
+ ], ([instance, to, name], [oldInstance, from, oldName]) => {
1927
+ if (to) {
1928
+ to.instances[name] = instance;
1929
+ if (from && from !== to && instance && instance === oldInstance) {
1930
+ if (!to.leaveGuards.size) to.leaveGuards = from.leaveGuards;
1931
+ if (!to.updateGuards.size) to.updateGuards = from.updateGuards;
1932
+ }
1933
+ }
1934
+ if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance)) (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
1935
+ }, { flush: "post" });
1936
+ return () => {
1937
+ const route = routeToDisplay.value;
1938
+ const currentName = props.name;
1939
+ const matchedRoute = matchedRouteRef.value;
1940
+ const ViewComponent = matchedRoute && matchedRoute.components[currentName];
1941
+ if (!ViewComponent) return normalizeSlot(slots.default, {
1942
+ Component: ViewComponent,
1943
+ route
1944
+ });
1945
+ const routePropsOption = matchedRoute.props[currentName];
1946
+ const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
1947
+ const onVnodeUnmounted = (vnode) => {
1948
+ if (vnode.component.isUnmounted) matchedRoute.instances[currentName] = null;
1949
+ };
1950
+ const component = h(ViewComponent, assign({}, routeProps, attrs, {
1951
+ onVnodeUnmounted,
1952
+ ref: viewRef
1953
+ }));
1954
+ if (isBrowser && component.ref) {
1955
+ const info = {
1956
+ depth: depth.value,
1957
+ name: matchedRoute.name,
1958
+ path: matchedRoute.path,
1959
+ meta: matchedRoute.meta
1960
+ };
1961
+ (isArray(component.ref) ? component.ref.map((r) => r.i) : [component.ref.i]).forEach((instance) => {
1962
+ instance.__vrv_devtools = info;
1963
+ });
1964
+ }
1965
+ return normalizeSlot(slots.default, {
1966
+ Component: component,
1967
+ route
1968
+ }) || component;
1969
+ };
1970
+ }
1971
+ });
1972
+ function normalizeSlot(slot, data) {
1973
+ if (!slot) return null;
1974
+ const slotContent = slot(data);
1975
+ return slotContent.length === 1 ? slotContent[0] : slotContent;
1976
+ }
1977
+ /**
1978
+ * Component to display the current route the user is at.
1979
+ */
1980
+ const RouterView = RouterViewImpl;
1981
+ function warnDeprecatedUsage() {
1982
+ const instance = getCurrentInstance();
1983
+ const parentName = instance.parent && instance.parent.type.name;
1984
+ const parentSubTreeType = instance.parent && instance.parent.subTree && instance.parent.subTree.type;
1985
+ if (parentName && (parentName === "KeepAlive" || parentName.includes("Transition")) && typeof parentSubTreeType === "object" && parentSubTreeType.name === "RouterView") {
1986
+ const comp = parentName === "KeepAlive" ? "keep-alive" : "transition";
1987
+ warn(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
1988
+ Use slot props instead:
1989
+
1990
+ <router-view v-slot="{ Component }">
1991
+ <${comp}>\n <component :is="Component" />\n </${comp}>\n</router-view>`);
1992
+ }
1993
+ }
1994
+
1995
+ //#endregion
1996
+ //#region src/devtools.ts
1997
+ /**
1998
+ * Copies a route location and removes any problematic properties that cannot be shown in devtools (e.g. Vue instances).
1999
+ *
2000
+ * @param routeLocation - routeLocation to format
2001
+ * @param tooltip - optional tooltip
2002
+ * @returns a copy of the routeLocation
2003
+ */
2004
+ function formatRouteLocation(routeLocation, tooltip) {
2005
+ const copy = assign({}, routeLocation, { matched: routeLocation.matched.map((matched) => omit(matched, [
2006
+ "instances",
2007
+ "children",
2008
+ "aliasOf"
2009
+ ])) });
2010
+ return { _custom: {
2011
+ type: null,
2012
+ readOnly: true,
2013
+ display: routeLocation.fullPath,
2014
+ tooltip,
2015
+ value: copy
2016
+ } };
2017
+ }
2018
+ function formatDisplay(display) {
2019
+ return { _custom: { display } };
2020
+ }
2021
+ let routerId = 0;
2022
+ function addDevtools(app, router, matcher) {
2023
+ if (router.__hasDevtools) return;
2024
+ router.__hasDevtools = true;
2025
+ const id = routerId++;
2026
+ setupDevtoolsPlugin({
2027
+ id: "org.vuejs.router" + (id ? "." + id : ""),
2028
+ label: "Vue Router",
2029
+ packageName: "vue-router",
2030
+ homepage: "https://router.vuejs.org",
2031
+ logo: "https://router.vuejs.org/logo.png",
2032
+ componentStateTypes: ["Routing"],
2033
+ app
2034
+ }, (api) => {
2035
+ if (typeof api.now !== "function") warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.");
2036
+ api.on.inspectComponent((payload, ctx) => {
2037
+ if (payload.instanceData) payload.instanceData.state.push({
2038
+ type: "Routing",
2039
+ key: "$route",
2040
+ editable: false,
2041
+ value: formatRouteLocation(router.currentRoute.value, "Current Route")
2042
+ });
2043
+ });
2044
+ api.on.visitComponentTree(({ treeNode: node, componentInstance }) => {
2045
+ if (componentInstance.__vrv_devtools) {
2046
+ const info = componentInstance.__vrv_devtools;
2047
+ node.tags.push({
2048
+ label: (info.name ? `${info.name.toString()}: ` : "") + info.path,
2049
+ textColor: 0,
2050
+ tooltip: "This component is rendered by &lt;router-view&gt;",
2051
+ backgroundColor: PINK_500
2052
+ });
2053
+ }
2054
+ if (isArray(componentInstance.__vrl_devtools)) {
2055
+ componentInstance.__devtoolsApi = api;
2056
+ componentInstance.__vrl_devtools.forEach((devtoolsData) => {
2057
+ let label = devtoolsData.route.path;
2058
+ let backgroundColor = ORANGE_400;
2059
+ let tooltip = "";
2060
+ let textColor = 0;
2061
+ if (devtoolsData.error) {
2062
+ label = devtoolsData.error;
2063
+ backgroundColor = RED_100;
2064
+ textColor = RED_700;
2065
+ } else if (devtoolsData.isExactActive) {
2066
+ backgroundColor = LIME_500;
2067
+ tooltip = "This is exactly active";
2068
+ } else if (devtoolsData.isActive) {
2069
+ backgroundColor = BLUE_600;
2070
+ tooltip = "This link is active";
2071
+ }
2072
+ node.tags.push({
2073
+ label,
2074
+ textColor,
2075
+ tooltip,
2076
+ backgroundColor
2077
+ });
2078
+ });
2079
+ }
2080
+ });
2081
+ watch(router.currentRoute, () => {
2082
+ refreshRoutesView();
2083
+ api.notifyComponentUpdate();
2084
+ api.sendInspectorTree(routerInspectorId);
2085
+ api.sendInspectorState(routerInspectorId);
2086
+ });
2087
+ const navigationsLayerId = "router:navigations:" + id;
2088
+ api.addTimelineLayer({
2089
+ id: navigationsLayerId,
2090
+ label: `Router${id ? " " + id : ""} Navigations`,
2091
+ color: 4237508
2092
+ });
2093
+ router.onError((error, to) => {
2094
+ api.addTimelineEvent({
2095
+ layerId: navigationsLayerId,
2096
+ event: {
2097
+ title: "Error during Navigation",
2098
+ subtitle: to.fullPath,
2099
+ logType: "error",
2100
+ time: api.now(),
2101
+ data: { error },
2102
+ groupId: to.meta.__navigationId
2103
+ }
2104
+ });
2105
+ });
2106
+ let navigationId = 0;
2107
+ router.beforeEach((to, from) => {
2108
+ const data = {
2109
+ guard: formatDisplay("beforeEach"),
2110
+ from: formatRouteLocation(from, "Current Location during this navigation"),
2111
+ to: formatRouteLocation(to, "Target location")
2112
+ };
2113
+ Object.defineProperty(to.meta, "__navigationId", { value: navigationId++ });
2114
+ api.addTimelineEvent({
2115
+ layerId: navigationsLayerId,
2116
+ event: {
2117
+ time: api.now(),
2118
+ title: "Start of navigation",
2119
+ subtitle: to.fullPath,
2120
+ data,
2121
+ groupId: to.meta.__navigationId
2122
+ }
2123
+ });
2124
+ });
2125
+ router.afterEach((to, from, failure) => {
2126
+ const data = { guard: formatDisplay("afterEach") };
2127
+ if (failure) {
2128
+ data.failure = { _custom: {
2129
+ type: Error,
2130
+ readOnly: true,
2131
+ display: failure ? failure.message : "",
2132
+ tooltip: "Navigation Failure",
2133
+ value: failure
2134
+ } };
2135
+ data.status = formatDisplay("❌");
2136
+ } else data.status = formatDisplay("✅");
2137
+ data.from = formatRouteLocation(from, "Current Location during this navigation");
2138
+ data.to = formatRouteLocation(to, "Target location");
2139
+ api.addTimelineEvent({
2140
+ layerId: navigationsLayerId,
2141
+ event: {
2142
+ title: "End of navigation",
2143
+ subtitle: to.fullPath,
2144
+ time: api.now(),
2145
+ data,
2146
+ logType: failure ? "warning" : "default",
2147
+ groupId: to.meta.__navigationId
2148
+ }
2149
+ });
2150
+ });
2151
+ /**
2152
+ * Inspector of Existing routes
2153
+ */
2154
+ const routerInspectorId = "router-inspector:" + id;
2155
+ api.addInspector({
2156
+ id: routerInspectorId,
2157
+ label: "Routes" + (id ? " " + id : ""),
2158
+ icon: "book",
2159
+ treeFilterPlaceholder: "Search routes"
2160
+ });
2161
+ function refreshRoutesView() {
2162
+ if (!activeRoutesPayload) return;
2163
+ const payload = activeRoutesPayload;
2164
+ let routes = matcher.getRoutes().filter((route) => !route.parent || !route.parent.record.components);
2165
+ routes.forEach(resetMatchStateOnRouteRecord);
2166
+ if (payload.filter) routes = routes.filter((route) => isRouteMatching(route, payload.filter.toLowerCase()));
2167
+ routes.forEach((route) => markRouteRecordActive(route, router.currentRoute.value));
2168
+ payload.rootNodes = routes.map(formatRouteRecordForInspector);
2169
+ }
2170
+ let activeRoutesPayload;
2171
+ api.on.getInspectorTree((payload) => {
2172
+ activeRoutesPayload = payload;
2173
+ if (payload.app === app && payload.inspectorId === routerInspectorId) refreshRoutesView();
2174
+ });
2175
+ /**
2176
+ * Display information about the currently selected route record
2177
+ */
2178
+ api.on.getInspectorState((payload) => {
2179
+ if (payload.app === app && payload.inspectorId === routerInspectorId) {
2180
+ const route = matcher.getRoutes().find((route$1) => route$1.record.__vd_id === payload.nodeId);
2181
+ if (route) payload.state = { options: formatRouteRecordMatcherForStateInspector(route) };
2182
+ }
2183
+ });
2184
+ api.sendInspectorTree(routerInspectorId);
2185
+ api.sendInspectorState(routerInspectorId);
2186
+ });
2187
+ }
2188
+ function modifierForKey(key) {
2189
+ if (key.optional) return key.repeatable ? "*" : "?";
2190
+ else return key.repeatable ? "+" : "";
2191
+ }
2192
+ function formatRouteRecordMatcherForStateInspector(route) {
2193
+ const { record } = route;
2194
+ const fields = [{
2195
+ editable: false,
2196
+ key: "path",
2197
+ value: record.path
2198
+ }];
2199
+ if (record.name != null) fields.push({
2200
+ editable: false,
2201
+ key: "name",
2202
+ value: record.name
2203
+ });
2204
+ fields.push({
2205
+ editable: false,
2206
+ key: "regexp",
2207
+ value: route.re
2208
+ });
2209
+ if (route.keys.length) fields.push({
2210
+ editable: false,
2211
+ key: "keys",
2212
+ value: { _custom: {
2213
+ type: null,
2214
+ readOnly: true,
2215
+ display: route.keys.map((key) => `${key.name}${modifierForKey(key)}`).join(" "),
2216
+ tooltip: "Param keys",
2217
+ value: route.keys
2218
+ } }
2219
+ });
2220
+ if (record.redirect != null) fields.push({
2221
+ editable: false,
2222
+ key: "redirect",
2223
+ value: record.redirect
2224
+ });
2225
+ if (route.alias.length) fields.push({
2226
+ editable: false,
2227
+ key: "aliases",
2228
+ value: route.alias.map((alias) => alias.record.path)
2229
+ });
2230
+ if (Object.keys(route.record.meta).length) fields.push({
2231
+ editable: false,
2232
+ key: "meta",
2233
+ value: route.record.meta
2234
+ });
2235
+ fields.push({
2236
+ key: "score",
2237
+ editable: false,
2238
+ value: { _custom: {
2239
+ type: null,
2240
+ readOnly: true,
2241
+ display: route.score.map((score) => score.join(", ")).join(" | "),
2242
+ tooltip: "Score used to sort routes",
2243
+ value: route.score
2244
+ } }
2245
+ });
2246
+ return fields;
2247
+ }
2248
+ /**
2249
+ * Extracted from tailwind palette
2250
+ */
2251
+ const PINK_500 = 15485081;
2252
+ const BLUE_600 = 2450411;
2253
+ const LIME_500 = 8702998;
2254
+ const CYAN_400 = 2282478;
2255
+ const ORANGE_400 = 16486972;
2256
+ const DARK = 6710886;
2257
+ const RED_100 = 16704226;
2258
+ const RED_700 = 12131356;
2259
+ function formatRouteRecordForInspector(route) {
2260
+ const tags = [];
2261
+ const { record } = route;
2262
+ if (record.name != null) tags.push({
2263
+ label: String(record.name),
2264
+ textColor: 0,
2265
+ backgroundColor: CYAN_400
2266
+ });
2267
+ if (record.aliasOf) tags.push({
2268
+ label: "alias",
2269
+ textColor: 0,
2270
+ backgroundColor: ORANGE_400
2271
+ });
2272
+ if (route.__vd_match) tags.push({
2273
+ label: "matches",
2274
+ textColor: 0,
2275
+ backgroundColor: PINK_500
2276
+ });
2277
+ if (route.__vd_exactActive) tags.push({
2278
+ label: "exact",
2279
+ textColor: 0,
2280
+ backgroundColor: LIME_500
2281
+ });
2282
+ if (route.__vd_active) tags.push({
2283
+ label: "active",
2284
+ textColor: 0,
2285
+ backgroundColor: BLUE_600
2286
+ });
2287
+ if (record.redirect) tags.push({
2288
+ label: typeof record.redirect === "string" ? `redirect: ${record.redirect}` : "redirects",
2289
+ textColor: 16777215,
2290
+ backgroundColor: DARK
2291
+ });
2292
+ let id = record.__vd_id;
2293
+ if (id == null) {
2294
+ id = String(routeRecordId++);
2295
+ record.__vd_id = id;
2296
+ }
2297
+ return {
2298
+ id,
2299
+ label: record.path,
2300
+ tags,
2301
+ children: route.children.map(formatRouteRecordForInspector)
2302
+ };
2303
+ }
2304
+ let routeRecordId = 0;
2305
+ const EXTRACT_REGEXP_RE = /^\/(.*)\/([a-z]*)$/;
2306
+ function markRouteRecordActive(route, currentRoute) {
2307
+ const isExactActive = currentRoute.matched.length && isSameRouteRecord(currentRoute.matched[currentRoute.matched.length - 1], route.record);
2308
+ route.__vd_exactActive = route.__vd_active = isExactActive;
2309
+ if (!isExactActive) route.__vd_active = currentRoute.matched.some((match) => isSameRouteRecord(match, route.record));
2310
+ route.children.forEach((childRoute) => markRouteRecordActive(childRoute, currentRoute));
2311
+ }
2312
+ function resetMatchStateOnRouteRecord(route) {
2313
+ route.__vd_match = false;
2314
+ route.children.forEach(resetMatchStateOnRouteRecord);
2315
+ }
2316
+ function isRouteMatching(route, filter) {
2317
+ const found = String(route.re).match(EXTRACT_REGEXP_RE);
2318
+ route.__vd_match = false;
2319
+ if (!found || found.length < 3) return false;
2320
+ if (new RegExp(found[1].replace(/\$$/, ""), found[2]).test(filter)) {
2321
+ route.children.forEach((child) => isRouteMatching(child, filter));
2322
+ if (route.record.path !== "/" || filter === "/") {
2323
+ route.__vd_match = route.re.test(filter);
2324
+ return true;
2325
+ }
2326
+ return false;
2327
+ }
2328
+ const path = route.record.path.toLowerCase();
2329
+ const decodedPath = decode(path);
2330
+ if (!filter.startsWith("/") && (decodedPath.includes(filter) || path.includes(filter))) return true;
2331
+ if (decodedPath.startsWith(filter) || path.startsWith(filter)) return true;
2332
+ if (route.record.name && String(route.record.name).includes(filter)) return true;
2333
+ return route.children.some((child) => isRouteMatching(child, filter));
2334
+ }
2335
+ function omit(obj, keys) {
2336
+ const ret = {};
2337
+ for (const key in obj) if (!keys.includes(key)) ret[key] = obj[key];
2338
+ return ret;
2339
+ }
2340
+
2341
+ //#endregion
2342
+ //#region src/router.ts
2343
+ /**
2344
+ * Creates a Router instance that can be used by a Vue app.
2345
+ *
2346
+ * @param options - {@link RouterOptions}
2347
+ */
2348
+ function createRouter(options) {
2349
+ const matcher = createRouterMatcher(options.routes, options);
2350
+ const parseQuery$1 = options.parseQuery || parseQuery;
2351
+ const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
2352
+ const routerHistory = options.history;
2353
+ if (!routerHistory) throw new Error("Provide the \"history\" option when calling \"createRouter()\": https://router.vuejs.org/api/interfaces/RouterOptions.html#history");
2354
+ const beforeGuards = useCallbacks();
2355
+ const beforeResolveGuards = useCallbacks();
2356
+ const afterGuards = useCallbacks();
2357
+ const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
2358
+ let pendingLocation = START_LOCATION_NORMALIZED;
2359
+ if (isBrowser && options.scrollBehavior && "scrollRestoration" in history) history.scrollRestoration = "manual";
2360
+ const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
2361
+ const encodeParams = applyToParams.bind(null, encodeParam);
2362
+ const decodeParams = applyToParams.bind(null, decode);
2363
+ function addRoute(parentOrRoute, route) {
2364
+ let parent;
2365
+ let record;
2366
+ if (isRouteName(parentOrRoute)) {
2367
+ parent = matcher.getRecordMatcher(parentOrRoute);
2368
+ if (!parent) warn(`Parent route "${String(parentOrRoute)}" not found when adding child route`, route);
2369
+ record = route;
2370
+ } else record = parentOrRoute;
2371
+ return matcher.addRoute(record, parent);
2372
+ }
2373
+ function removeRoute(name) {
2374
+ const recordMatcher = matcher.getRecordMatcher(name);
2375
+ if (recordMatcher) matcher.removeRoute(recordMatcher);
2376
+ else warn(`Cannot remove non-existent route "${String(name)}"`);
2377
+ }
2378
+ function getRoutes() {
2379
+ return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
2380
+ }
2381
+ function hasRoute(name) {
2382
+ return !!matcher.getRecordMatcher(name);
2383
+ }
2384
+ function resolve(rawLocation, currentLocation) {
2385
+ currentLocation = assign({}, currentLocation || currentRoute.value);
2386
+ if (typeof rawLocation === "string") {
2387
+ const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
2388
+ const matchedRoute$1 = matcher.resolve({ path: locationNormalized.path }, currentLocation);
2389
+ const href$1 = routerHistory.createHref(locationNormalized.fullPath);
2390
+ if (href$1.startsWith("//")) warn(`Location "${rawLocation}" resolved to "${href$1}". A resolved location cannot start with multiple slashes.`);
2391
+ else if (!matchedRoute$1.matched.length) warn(`No match found for location with path "${rawLocation}"`);
2392
+ return assign(locationNormalized, matchedRoute$1, {
2393
+ params: decodeParams(matchedRoute$1.params),
2394
+ hash: decode(locationNormalized.hash),
2395
+ redirectedFrom: void 0,
2396
+ href: href$1
2397
+ });
2398
+ }
2399
+ if (!isRouteLocation(rawLocation)) {
2400
+ warn(`router.resolve() was passed an invalid location. This will fail in production.\n- Location:`, rawLocation);
2401
+ return resolve({});
2402
+ }
2403
+ let matcherLocation;
2404
+ if (rawLocation.path != null) {
2405
+ if ("params" in rawLocation && !("name" in rawLocation) && Object.keys(rawLocation.params).length) warn(`Path "${rawLocation.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`);
2406
+ matcherLocation = assign({}, rawLocation, { path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path });
2407
+ } else {
2408
+ const targetParams = assign({}, rawLocation.params);
2409
+ for (const key in targetParams) if (targetParams[key] == null) delete targetParams[key];
2410
+ matcherLocation = assign({}, rawLocation, { params: encodeParams(targetParams) });
2411
+ currentLocation.params = encodeParams(currentLocation.params);
2412
+ }
2413
+ const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
2414
+ const hash = rawLocation.hash || "";
2415
+ if (hash && !hash.startsWith("#")) warn(`A \`hash\` should always start with the character "#". Replace "${hash}" with "#${hash}".`);
2416
+ matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
2417
+ const fullPath = stringifyURL(stringifyQuery$1, assign({}, rawLocation, {
2418
+ hash: encodeHash(hash),
2419
+ path: matchedRoute.path
2420
+ }));
2421
+ const href = routerHistory.createHref(fullPath);
2422
+ if (href.startsWith("//")) warn(`Location "${rawLocation}" resolved to "${href}". A resolved location cannot start with multiple slashes.`);
2423
+ else if (!matchedRoute.matched.length) warn(`No match found for location with path "${rawLocation.path != null ? rawLocation.path : rawLocation}"`);
2424
+ return assign({
2425
+ fullPath,
2426
+ hash,
2427
+ query: stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
2428
+ }, matchedRoute, {
2429
+ redirectedFrom: void 0,
2430
+ href
2431
+ });
2432
+ }
2433
+ function locationAsObject(to) {
2434
+ return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign({}, to);
2435
+ }
2436
+ function checkCanceledNavigation(to, from) {
2437
+ if (pendingLocation !== to) return createRouterError(ErrorTypes.NAVIGATION_CANCELLED, {
2438
+ from,
2439
+ to
2440
+ });
2441
+ }
2442
+ function push(to) {
2443
+ return pushWithRedirect(to);
2444
+ }
2445
+ function replace(to) {
2446
+ return push(assign(locationAsObject(to), { replace: true }));
2447
+ }
2448
+ function handleRedirectRecord(to, from) {
2449
+ const lastMatched = to.matched[to.matched.length - 1];
2450
+ if (lastMatched && lastMatched.redirect) {
2451
+ const { redirect } = lastMatched;
2452
+ let newTargetLocation = typeof redirect === "function" ? redirect(to, from) : redirect;
2453
+ if (typeof newTargetLocation === "string") {
2454
+ newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : { path: newTargetLocation };
2455
+ newTargetLocation.params = {};
2456
+ }
2457
+ if (newTargetLocation.path == null && !("name" in newTargetLocation)) {
2458
+ warn(`Invalid redirect found:\n${JSON.stringify(newTargetLocation, null, 2)}\n when navigating to "${to.fullPath}". A redirect must contain a name or path. This will break in production.`);
2459
+ throw new Error("Invalid redirect");
2460
+ }
2461
+ return assign({
2462
+ query: to.query,
2463
+ hash: to.hash,
2464
+ params: newTargetLocation.path != null ? {} : to.params
2465
+ }, newTargetLocation);
2466
+ }
2467
+ }
2468
+ function pushWithRedirect(to, redirectedFrom) {
2469
+ const targetLocation = pendingLocation = resolve(to);
2470
+ const from = currentRoute.value;
2471
+ const data = to.state;
2472
+ const force = to.force;
2473
+ const replace$1 = to.replace === true;
2474
+ const shouldRedirect = handleRedirectRecord(targetLocation, from);
2475
+ if (shouldRedirect) return pushWithRedirect(assign(locationAsObject(shouldRedirect), {
2476
+ state: typeof shouldRedirect === "object" ? assign({}, data, shouldRedirect.state) : data,
2477
+ force,
2478
+ replace: replace$1
2479
+ }), redirectedFrom || targetLocation);
2480
+ const toLocation = targetLocation;
2481
+ toLocation.redirectedFrom = redirectedFrom;
2482
+ let failure;
2483
+ if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
2484
+ failure = createRouterError(ErrorTypes.NAVIGATION_DUPLICATED, {
2485
+ to: toLocation,
2486
+ from
2487
+ });
2488
+ handleScroll(from, from, true, false);
2489
+ }
2490
+ return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure$1) => {
2491
+ if (failure$1) {
2492
+ if (isNavigationFailure(failure$1, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) {
2493
+ if (isSameRouteLocation(stringifyQuery$1, resolve(failure$1.to), toLocation) && redirectedFrom && (redirectedFrom._count = redirectedFrom._count ? redirectedFrom._count + 1 : 1) > 30) {
2494
+ warn(`Detected a possibly infinite redirection in a navigation guard when going from "${from.fullPath}" to "${toLocation.fullPath}". Aborting to avoid a Stack Overflow.\n Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`);
2495
+ return Promise.reject(/* @__PURE__ */ new Error("Infinite redirect in navigation guard"));
2496
+ }
2497
+ return pushWithRedirect(assign({ replace: replace$1 }, locationAsObject(failure$1.to), {
2498
+ state: typeof failure$1.to === "object" ? assign({}, data, failure$1.to.state) : data,
2499
+ force
2500
+ }), redirectedFrom || toLocation);
2501
+ }
2502
+ } else failure$1 = finalizeNavigation(toLocation, from, true, replace$1, data);
2503
+ triggerAfterEach(toLocation, from, failure$1);
2504
+ return failure$1;
2505
+ });
2506
+ }
2507
+ /**
2508
+ * Helper to reject and skip all navigation guards if a new navigation happened
2509
+ * @param to
2510
+ * @param from
2511
+ */
2512
+ function checkCanceledNavigationAndReject(to, from) {
2513
+ const error = checkCanceledNavigation(to, from);
2514
+ return error ? Promise.reject(error) : Promise.resolve();
2515
+ }
2516
+ function runWithContext(fn) {
2517
+ const app = installedApps.values().next().value;
2518
+ return app && typeof app.runWithContext === "function" ? app.runWithContext(fn) : fn();
2519
+ }
2520
+ function navigate(to, from) {
2521
+ let guards;
2522
+ const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
2523
+ guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
2524
+ for (const record of leavingRecords) record.leaveGuards.forEach((guard) => {
2525
+ guards.push(guardToPromiseFn(guard, to, from));
2526
+ });
2527
+ const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
2528
+ guards.push(canceledNavigationCheck);
2529
+ return runGuardQueue(guards).then(() => {
2530
+ guards = [];
2531
+ for (const guard of beforeGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
2532
+ guards.push(canceledNavigationCheck);
2533
+ return runGuardQueue(guards);
2534
+ }).then(() => {
2535
+ guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
2536
+ for (const record of updatingRecords) record.updateGuards.forEach((guard) => {
2537
+ guards.push(guardToPromiseFn(guard, to, from));
2538
+ });
2539
+ guards.push(canceledNavigationCheck);
2540
+ return runGuardQueue(guards);
2541
+ }).then(() => {
2542
+ guards = [];
2543
+ for (const record of enteringRecords) if (record.beforeEnter) if (isArray(record.beforeEnter)) for (const beforeEnter of record.beforeEnter) guards.push(guardToPromiseFn(beforeEnter, to, from));
2544
+ else guards.push(guardToPromiseFn(record.beforeEnter, to, from));
2545
+ guards.push(canceledNavigationCheck);
2546
+ return runGuardQueue(guards);
2547
+ }).then(() => {
2548
+ to.matched.forEach((record) => record.enterCallbacks = {});
2549
+ guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
2550
+ guards.push(canceledNavigationCheck);
2551
+ return runGuardQueue(guards);
2552
+ }).then(() => {
2553
+ guards = [];
2554
+ for (const guard of beforeResolveGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
2555
+ guards.push(canceledNavigationCheck);
2556
+ return runGuardQueue(guards);
2557
+ }).catch((err) => isNavigationFailure(err, ErrorTypes.NAVIGATION_CANCELLED) ? err : Promise.reject(err));
2558
+ }
2559
+ function triggerAfterEach(to, from, failure) {
2560
+ afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
2561
+ }
2562
+ /**
2563
+ * - Cleans up any navigation guards
2564
+ * - Changes the url if necessary
2565
+ * - Calls the scrollBehavior
2566
+ */
2567
+ function finalizeNavigation(toLocation, from, isPush, replace$1, data) {
2568
+ const error = checkCanceledNavigation(toLocation, from);
2569
+ if (error) return error;
2570
+ const isFirstNavigation = from === START_LOCATION_NORMALIZED;
2571
+ const state = !isBrowser ? {} : history.state;
2572
+ if (isPush) if (replace$1 || isFirstNavigation) routerHistory.replace(toLocation.fullPath, assign({ scroll: isFirstNavigation && state && state.scroll }, data));
2573
+ else routerHistory.push(toLocation.fullPath, data);
2574
+ currentRoute.value = toLocation;
2575
+ handleScroll(toLocation, from, isPush, isFirstNavigation);
2576
+ markAsReady();
2577
+ }
2578
+ let removeHistoryListener;
2579
+ function setupListeners() {
2580
+ if (removeHistoryListener) return;
2581
+ removeHistoryListener = routerHistory.listen((to, _from, info) => {
2582
+ if (!router.listening) return;
2583
+ const toLocation = resolve(to);
2584
+ const shouldRedirect = handleRedirectRecord(toLocation, router.currentRoute.value);
2585
+ if (shouldRedirect) {
2586
+ pushWithRedirect(assign(shouldRedirect, {
2587
+ replace: true,
2588
+ force: true
2589
+ }), toLocation).catch(noop);
2590
+ return;
2591
+ }
2592
+ pendingLocation = toLocation;
2593
+ const from = currentRoute.value;
2594
+ if (isBrowser) saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
2595
+ navigate(toLocation, from).catch((error) => {
2596
+ if (isNavigationFailure(error, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_CANCELLED)) return error;
2597
+ if (isNavigationFailure(error, ErrorTypes.NAVIGATION_GUARD_REDIRECT)) {
2598
+ pushWithRedirect(assign(locationAsObject(error.to), { force: true }), toLocation).then((failure) => {
2599
+ if (isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED) && !info.delta && info.type === NavigationType.pop) routerHistory.go(-1, false);
2600
+ }).catch(noop);
2601
+ return Promise.reject();
2602
+ }
2603
+ if (info.delta) routerHistory.go(-info.delta, false);
2604
+ return triggerError(error, toLocation, from);
2605
+ }).then((failure) => {
2606
+ failure = failure || finalizeNavigation(toLocation, from, false);
2607
+ if (failure) {
2608
+ if (info.delta && !isNavigationFailure(failure, ErrorTypes.NAVIGATION_CANCELLED)) routerHistory.go(-info.delta, false);
2609
+ else if (info.type === NavigationType.pop && isNavigationFailure(failure, ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED)) routerHistory.go(-1, false);
2610
+ }
2611
+ triggerAfterEach(toLocation, from, failure);
2612
+ }).catch(noop);
2613
+ });
2614
+ }
2615
+ let readyHandlers = useCallbacks();
2616
+ let errorListeners = useCallbacks();
2617
+ let ready;
2618
+ /**
2619
+ * Trigger errorListeners added via onError and throws the error as well
2620
+ *
2621
+ * @param error - error to throw
2622
+ * @param to - location we were navigating to when the error happened
2623
+ * @param from - location we were navigating from when the error happened
2624
+ * @returns the error as a rejected promise
2625
+ */
2626
+ function triggerError(error, to, from) {
2627
+ markAsReady(error);
2628
+ const list = errorListeners.list();
2629
+ if (list.length) list.forEach((handler) => handler(error, to, from));
2630
+ else {
2631
+ warn("uncaught error during route navigation:");
2632
+ console.error(error);
2633
+ }
2634
+ return Promise.reject(error);
2635
+ }
2636
+ function isReady() {
2637
+ if (ready && currentRoute.value !== START_LOCATION_NORMALIZED) return Promise.resolve();
2638
+ return new Promise((resolve$1, reject) => {
2639
+ readyHandlers.add([resolve$1, reject]);
2640
+ });
2641
+ }
2642
+ function markAsReady(err) {
2643
+ if (!ready) {
2644
+ ready = !err;
2645
+ setupListeners();
2646
+ readyHandlers.list().forEach(([resolve$1, reject]) => err ? reject(err) : resolve$1());
2647
+ readyHandlers.reset();
2648
+ }
2649
+ return err;
2650
+ }
2651
+ function handleScroll(to, from, isPush, isFirstNavigation) {
2652
+ const { scrollBehavior } = options;
2653
+ if (!isBrowser || !scrollBehavior) return Promise.resolve();
2654
+ const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
2655
+ return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
2656
+ }
2657
+ const go = (delta) => routerHistory.go(delta);
2658
+ let started;
2659
+ const installedApps = /* @__PURE__ */ new Set();
2660
+ const router = {
2661
+ currentRoute,
2662
+ listening: true,
2663
+ addRoute,
2664
+ removeRoute,
2665
+ clearRoutes: matcher.clearRoutes,
2666
+ hasRoute,
2667
+ getRoutes,
2668
+ resolve,
2669
+ options,
2670
+ push,
2671
+ replace,
2672
+ go,
2673
+ back: () => go(-1),
2674
+ forward: () => go(1),
2675
+ beforeEach: beforeGuards.add,
2676
+ beforeResolve: beforeResolveGuards.add,
2677
+ afterEach: afterGuards.add,
2678
+ onError: errorListeners.add,
2679
+ isReady,
2680
+ install(app) {
2681
+ app.component("RouterLink", RouterLink);
2682
+ app.component("RouterView", RouterView);
2683
+ app.config.globalProperties.$router = router;
2684
+ Object.defineProperty(app.config.globalProperties, "$route", {
2685
+ enumerable: true,
2686
+ get: () => unref(currentRoute)
2687
+ });
2688
+ if (isBrowser && !started && currentRoute.value === START_LOCATION_NORMALIZED) {
2689
+ started = true;
2690
+ push(routerHistory.location).catch((err) => {
2691
+ warn("Unexpected error when starting the router:", err);
2692
+ });
2693
+ }
2694
+ const reactiveRoute = {};
2695
+ for (const key in START_LOCATION_NORMALIZED) Object.defineProperty(reactiveRoute, key, {
2696
+ get: () => currentRoute.value[key],
2697
+ enumerable: true
2698
+ });
2699
+ app.provide(routerKey, router);
2700
+ app.provide(routeLocationKey, shallowReactive(reactiveRoute));
2701
+ app.provide(routerViewLocationKey, currentRoute);
2702
+ const unmountApp = app.unmount;
2703
+ installedApps.add(app);
2704
+ app.unmount = function() {
2705
+ installedApps.delete(app);
2706
+ if (installedApps.size < 1) {
2707
+ pendingLocation = START_LOCATION_NORMALIZED;
2708
+ removeHistoryListener && removeHistoryListener();
2709
+ removeHistoryListener = null;
2710
+ currentRoute.value = START_LOCATION_NORMALIZED;
2711
+ started = false;
2712
+ ready = false;
2713
+ }
2714
+ unmountApp();
2715
+ };
2716
+ if (isBrowser) addDevtools(app, router, matcher);
2717
+ }
2718
+ };
2719
+ function runGuardQueue(guards) {
2720
+ return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
2721
+ }
2722
+ return router;
2723
+ }
2724
+
2725
+ //#endregion
2726
+ //#region src/useApi.ts
2727
+ /**
2728
+ * Returns the router instance. Equivalent to using `$router` inside
2729
+ * templates.
2730
+ */
2731
+ function useRouter() {
2732
+ return inject(routerKey);
2733
+ }
2734
+ /**
2735
+ * Returns the current route location. Equivalent to using `$route` inside
2736
+ * templates.
2737
+ */
2738
+ function useRoute(_name) {
2739
+ return inject(routeLocationKey);
2740
+ }
2741
+
2742
+ //#endregion
2743
+ export { NavigationFailureType, RouterLink, RouterView, START_LOCATION_NORMALIZED as START_LOCATION, createMemoryHistory, createRouter, createRouterMatcher, createWebHashHistory, createWebHistory, isNavigationFailure, loadRouteLocation, matchedRouteKey, onBeforeRouteLeave, onBeforeRouteUpdate, parseQuery, routeLocationKey, routerKey, routerViewLocationKey, stringifyQuery, useLink, useRoute, useRouter, viewDepthKey };