n8n-editor-ui 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/dist/assets/{AddDataTableModal-C07v9Nxn.js → AddDataTableModal-DdQPndvj.js} +11 -11
  2. package/dist/assets/{AgentEditorModal-BrtNn_I9.js → AgentEditorModal-13IKfi65.js} +14 -14
  3. package/dist/assets/{Alert-CjCTAWnZ.js → Alert-DOlbYzaP.js} +1 -1
  4. package/dist/assets/{AnnotationTagsDropdown.ee-BLpUZufe.js → AnnotationTagsDropdown.ee-BV5N0QpC.js} +2 -2
  5. package/dist/assets/{AuthView-CqAePJa9.js → AuthView-XL99nUn8.js} +4 -4
  6. package/dist/assets/{BottomMenu-Cej7gwr4.js → BottomMenu-Urdm-sib.js} +9 -9
  7. package/dist/assets/{ChangePasswordView-BuzmSLJ8.js → ChangePasswordView-BE2ZGJcQ.js} +8 -8
  8. package/dist/assets/{ChatAgentAvatar-CwpeLqqo.js → ChatAgentAvatar-DWOQygP6.js} +5 -5
  9. package/dist/assets/{ChatLayout-Baw4DF5I.js → ChatLayout--VoBX0db.js} +5 -5
  10. package/dist/assets/{ChatPersonalAgentsView-B9Pt0vxY.js → ChatPersonalAgentsView-C0AZXJ21.js} +11 -11
  11. package/dist/assets/{ChatSidebar-Cmc2-HvU.js → ChatSidebar-C7kpSeSL.js} +29 -29
  12. package/dist/assets/{ChatView-C2ezV2fz.js → ChatView-DPBUfiCx.js} +15 -15
  13. package/dist/assets/{ChatWorkflowAgentsView-DBmwl58I.js → ChatWorkflowAgentsView-CPDjKGeW.js} +11 -11
  14. package/dist/assets/CollectionParameter-PHj-nQX_.js +50 -0
  15. package/dist/assets/{CommunityNodeUpdateInfo-DjXh6DHu.js → CommunityNodeUpdateInfo-C8_mLrZ5.js} +6 -6
  16. package/dist/assets/{CopyInput-D-Z7pmxS.js → CopyInput-D4IqeIwh.js} +3 -3
  17. package/dist/assets/{CredentialIcon-ClX-2bGh.js → CredentialIcon-uhIIYjQ5.js} +3 -3
  18. package/dist/assets/{CredentialPicker-CrCc144c.js → CredentialPicker-CHj_u87Q.js} +4 -4
  19. package/dist/assets/{CredentialSelectorModal-Da2na5my.js → CredentialSelectorModal-BgjG3ACX.js} +10 -10
  20. package/dist/assets/{CredentialsView-CqNF_Gka.js → CredentialsView-GgHi3Nwa.js} +23 -23
  21. package/dist/assets/{DataTableActions-D0ibHSoF.js → DataTableActions-D8jtOheL.js} +4 -4
  22. package/dist/assets/{DataTableDetailsView-BRY9rVV1.js → DataTableDetailsView-BQKJhJRx.js} +14 -14
  23. package/dist/assets/{DataTableView-D4ujwn7I.js → DataTableView-CRpaR8O2.js} +20 -20
  24. package/dist/assets/{DemoFooter-fhB0ZsZi.js → DemoFooter-Cxu0hnvC.js} +28 -28
  25. package/dist/assets/{Draggable-Bs1jTk_8.js → Draggable-CeRLORdu.js} +1 -1
  26. package/dist/assets/{EmptySharedSectionActionBox-BBB3j3rf.js → EmptySharedSectionActionBox-WNc5syUl.js} +3 -3
  27. package/dist/assets/{EnterpriseEdition.ee-_BSL-rxT.js → EnterpriseEdition.ee-D0ixqMOk.js} +1 -1
  28. package/dist/assets/{EntityNotFound-8qJnYCXt.js → EntityNotFound-CuNhWBrZ.js} +2 -2
  29. package/dist/assets/{EntityUnAuthorised-CYu0UXzr.js → EntityUnAuthorised-ProWKTPU.js} +2 -2
  30. package/dist/assets/{ErrorView-CrDo6qHL.js → ErrorView-jBBYrV1n.js} +3 -3
  31. package/dist/assets/{EvaluationsRootView-C_7tPZ3q.js → EvaluationsRootView-D70Tp2Up.js} +16 -16
  32. package/dist/assets/{EvaluationsView-DTmT_Mjm.js → EvaluationsView-DPKBS6PJ.js} +10 -10
  33. package/dist/assets/{ExecutionsTime-ncZBFujs.js → ExecutionsTime-CQneihIO.js} +8 -8
  34. package/dist/assets/{ExecutionsView-DKx5PCwr.js → ExecutionsView-Vg6JvFFQ.js} +22 -22
  35. package/dist/assets/{ExternalSecretsProviderConnectionSwitch.ee-DQZ57stj.js → ExternalSecretsProviderConnectionSwitch.ee-B9I0rKT4.js} +3 -3
  36. package/dist/assets/{FixedCollectionParameter-BJZ0eM-5.js → FixedCollectionParameter-Dgp7H09p.js} +31 -31
  37. package/dist/assets/{ForgotMyPasswordView-D_k_YvIG.js → ForgotMyPasswordView-DqcF_Z2q.js} +8 -8
  38. package/dist/assets/{InsightsDashboard--1f1U32C.js → InsightsDashboard-CiJyVecp.js} +17 -17
  39. package/dist/assets/{InsightsPaywall-DwtdewB6.js → InsightsPaywall-CINaGtwo.js} +8 -8
  40. package/dist/assets/{InsightsSummary-DWzL1ePo.js → InsightsSummary-CgA8vOKu.js} +4 -4
  41. package/dist/assets/{InsightsTableWorkflows-CHoJdUEl.js → InsightsTableWorkflows-YYoh5C57.js} +8 -8
  42. package/dist/assets/{ItemsRenderer-Bju44b_S.js → ItemsRenderer-Bkvm6ylT.js} +7 -7
  43. package/dist/assets/{KeyboardShortcutTooltip-srIzApSu.js → KeyboardShortcutTooltip-BErFISFN.js} +1 -1
  44. package/dist/assets/LogsPanel-1rVp7yTV.js +50 -0
  45. package/dist/assets/{LogsPanel-C9nCXiIh.js → LogsPanel-wqHn7duZ.js} +17 -17
  46. package/dist/assets/{MCPConnectWorkflowsModal-CR5hRPTJ.js → MCPConnectWorkflowsModal-zndEVWiT.js} +26 -26
  47. package/dist/assets/{MainHeader-Dtf7ohow.js → MainHeader-S9F1mef-.js} +43 -43
  48. package/dist/assets/{MainSidebar-_37xftBv.js → MainSidebar-nlRQuq4m.js} +30 -30
  49. package/dist/assets/{MigrationRuleDetail-CCO__jC7.js → MigrationRuleDetail-MPJH8woH.js} +13 -13
  50. package/dist/assets/{MigrationRules-B0SPwFyT.js → MigrationRules-CXWOU2h7.js} +6 -6
  51. package/dist/assets/{Modal-DrkMFWe3.js → Modal-Bx0XYuv8.js} +4 -4
  52. package/dist/assets/{ModelByIdSelectorModal-CoQLLeXk.js → ModelByIdSelectorModal-BI7ckDXC.js} +9 -9
  53. package/dist/assets/{NDVEmptyState-DKrc1TFh.js → NDVEmptyState-YMeX60Ni.js} +1 -1
  54. package/dist/assets/{NodeCreation-k3pkIHZY.js → NodeCreation-BaNMWutd.js} +30 -30
  55. package/dist/assets/{NodeCreator-B6D9_1wn.js → NodeCreator-C852UqEf.js} +21 -21
  56. package/dist/assets/{NodeDetailsView-DfMYS7Pz.js → NodeDetailsView-GXMPg1-K.js} +42 -42
  57. package/dist/assets/{NodeDetailsViewV2-DOCw_zWY.js → NodeDetailsViewV2-DCnVXlNg.js} +43 -43
  58. package/dist/assets/{NodeIcon-DL6ucXJC.js → NodeIcon-UuZXMI3b.js} +2 -2
  59. package/dist/assets/{NodeSettings-CS2iUNwL.js → NodeSettings-sGW3h0b4.js} +16 -16
  60. package/dist/assets/{NodeView-0XOeMCB7.js → NodeView-i2FqlrZg.js} +53 -53
  61. package/dist/assets/{OAuthConsentView-WGFrtRYZ.js → OAuthConsentView-BCnyFvFE.js} +6 -6
  62. package/dist/assets/{ParameterInputList-DTEJwrQm.js → ParameterInputList-Br9nDZxe.js} +23 -23
  63. package/dist/assets/{PrebuiltAgentTemplatesView-CJ6VJ0XJ.js → PrebuiltAgentTemplatesView-CKUzZatm.js} +9 -9
  64. package/dist/assets/{ProjectBreadcrumb-FtcudW_2.js → ProjectBreadcrumb-ByT1IATl.js} +3 -3
  65. package/dist/assets/{ProjectCardBadge-C42B_oyx.js → ProjectCardBadge-DjNmgRAP.js} +4 -4
  66. package/dist/assets/{ProjectHeader-UBLuSGFT.js → ProjectHeader-Cl-v-GMx.js} +7 -7
  67. package/dist/assets/{ProjectIcon-CEp8nyYM.js → ProjectIcon-CVhr6466.js} +1 -1
  68. package/dist/assets/{ProjectRoleView-BQvsQqjp.js → ProjectRoleView-3D060erL.js} +7 -7
  69. package/dist/assets/{ProjectRolesView-CksItD9m.js → ProjectRolesView-DvZkoFBe.js} +9 -9
  70. package/dist/assets/{ProjectSettings-DUSQ3i-j.js → ProjectSettings-0C6lnj8u.js} +19 -19
  71. package/dist/assets/{ProjectSharing-DcKfaqUD.js → ProjectSharing-CtOlIYg8.js} +4 -4
  72. package/dist/assets/{ProjectVariables-BEwMAsZl.js → ProjectVariables-COktFANb.js} +21 -21
  73. package/dist/assets/{ProviderSettingsModal-D9LOoiTP.js → ProviderSettingsModal-B-btuOfV.js} +11 -11
  74. package/dist/assets/{PushConnectionTracker-CYhR1yeo.js → PushConnectionTracker-C4wioF1a.js} +2 -2
  75. package/dist/assets/{ResolversView-MhtoNdHP.js → ResolversView-qWEf4KSk.js} +8 -8
  76. package/dist/assets/{ResourceFiltersDropdown-DJG8zh1q.js → ResourceFiltersDropdown-BikLhLzy.js} +5 -5
  77. package/dist/assets/{ResourcesListLayout-CBYWFTvd.js → ResourcesListLayout-DjbDZ485.js} +7 -7
  78. package/dist/assets/{RunDataJson-hUd8I9Iw.js → RunDataJson-xNt8TeT7.js} +9 -9
  79. package/dist/assets/{RunDataJsonActions-mj5kInPr.js → RunDataJsonActions-ZnTJFjPn.js} +8 -8
  80. package/dist/assets/{RunDataParsedAiContent-DQYrKUHo.js → RunDataParsedAiContent-BCJUkbqC.js} +5 -5
  81. package/dist/assets/{RunDataParsedAiContent-DhKdg7Ux.js → RunDataParsedAiContent-DqRKhrSB.js} +9 -9
  82. package/dist/assets/{RunDataSearch-BanmtjON.js → RunDataSearch-BAwHZr-P.js} +4 -4
  83. package/dist/assets/{RunDataTable-CLw-U45I.js → RunDataTable-YYViC6gq.js} +9 -9
  84. package/dist/assets/{SamlOnboarding-CL7FFqOA.js → SamlOnboarding-C5Tr3Slo.js} +8 -8
  85. package/dist/assets/{SaveButton-DdOVpjST.js → SaveButton-92mEEoEP.js} +2 -2
  86. package/dist/assets/{SelectedItemsInfo-DBuH5w0D.js → SelectedItemsInfo-DzkrxhPo.js} +1 -1
  87. package/dist/assets/{SettingsApiView-C0aDHviI.js → SettingsApiView-CJyqNNAX.js} +10 -10
  88. package/dist/assets/{SettingsChatHubView-xXbgxwbM.js → SettingsChatHubView-DpdcfBor.js} +9 -9
  89. package/dist/assets/{SettingsCommunityNodesView-BAxes_Db.js → SettingsCommunityNodesView-BCvCmXWC.js} +21 -21
  90. package/dist/assets/{SettingsExternalSecrets-B6jdgfB7.js → SettingsExternalSecrets-CtuNjOHB.js} +10 -10
  91. package/dist/assets/{SettingsLdapView-CR2IAnRQ.js → SettingsLdapView-CB2PN4XF.js} +11 -11
  92. package/dist/assets/{SettingsLogStreamingView-DSRc5q9w.js → SettingsLogStreamingView-BkeGZzXU.js} +10 -10
  93. package/dist/assets/{SettingsMCPView-C7HQFidB.js → SettingsMCPView-CfaP3OAo.js} +26 -26
  94. package/dist/assets/{SettingsPersonalView-DOH_Ml9N.js → SettingsPersonalView-DqyIIYiM.js} +8 -8
  95. package/dist/assets/{SettingsSourceControl-DH0mZaa0.js → SettingsSourceControl-DTKvyQ-E.js} +10 -10
  96. package/dist/assets/{SettingsSso-CrWkteb1.js → SettingsSso-BqSa2kyP.js} +13 -13
  97. package/dist/assets/{SettingsUsageAndPlan-DQzF59ve.js → SettingsUsageAndPlan-DjxRwtnH.js} +10 -10
  98. package/dist/assets/{SettingsUsersView-BZrQxtA7.js → SettingsUsersView-DTtMD45S.js} +14 -14
  99. package/dist/assets/{SettingsView-LDjLlP2V.js → SettingsView-LehjcLhP.js} +7 -7
  100. package/dist/assets/{SetupTemplateFormStep-CwgC9pY3.js → SetupTemplateFormStep-DH5EaAC-.js} +6 -6
  101. package/dist/assets/{SetupView-wJeD4wwM.js → SetupView-CNpqI-Mm.js} +8 -8
  102. package/dist/assets/{SetupWorkflowCredentialsButton-kVNSvjYZ.js → SetupWorkflowCredentialsButton-Cd6MsYCC.js} +7 -7
  103. package/dist/assets/{SetupWorkflowFromTemplateView-CBTduGfH.js → SetupWorkflowFromTemplateView-CKYEo2_N.js} +14 -14
  104. package/dist/assets/{SeverityTag-CuF3dVKd.js → SeverityTag-CjL6aCgr.js} +2 -2
  105. package/dist/assets/{SigninView-DjWIkUJe.js → SigninView-BFhXhQy_.js} +9 -9
  106. package/dist/assets/{SignoutView-CP6UttCg.js → SignoutView-C5Rqj0rG.js} +5 -5
  107. package/dist/assets/{SignupView-DKWZNap-.js → SignupView-pkWEAwT4.js} +8 -8
  108. package/dist/assets/{SkeletonAgentCard-DcV1dSF-.js → SkeletonAgentCard-CFbUHoJ_.js} +4 -4
  109. package/dist/assets/{TagsDropdown-CuT_jHbX.js → TagsDropdown-Ckp4w5RZ.js} +2 -2
  110. package/dist/assets/{TemplateCard-DY1aPA-a.js → TemplateCard-CVIt847s.js} +5 -5
  111. package/dist/assets/{TemplateDetails-Cstu-YNP.js → TemplateDetails-CU_WdmN6.js} +5 -5
  112. package/dist/assets/{TemplateList-BfBs1Bpa.js → TemplateList-CI2Xi3Nr.js} +4 -4
  113. package/dist/assets/{TemplatesCollectionView-DgKv-274.js → TemplatesCollectionView-9nTVlhmd.js} +15 -15
  114. package/dist/assets/{TemplatesSearchView-BgdaZIha.js → TemplatesSearchView-5sECuF70.js} +12 -12
  115. package/dist/assets/{TemplatesView-HPIEGoX2.js → TemplatesView-BwDvsLzl.js} +2 -2
  116. package/dist/assets/{TemplatesWorkflowView-3-fxkWIH.js → TemplatesWorkflowView-BUJF5y7g.js} +16 -16
  117. package/dist/assets/{TestRunDetailView-D9tH7Ptp.js → TestRunDetailView-CpbEtZB0.js} +11 -11
  118. package/dist/assets/{TimeAgo-BpAJIqal.js → TimeAgo-wOp8Jlnz.js} +2 -2
  119. package/dist/assets/{ToolsSelectorModal-DSyXV7Ag.js → ToolsSelectorModal-B4Id-oqD.js} +10 -10
  120. package/dist/assets/{TriggerPanel-DDzH4j34.js → TriggerPanel-ClTWEUV8.js} +16 -16
  121. package/dist/assets/VirtualSchema-Bf4iCl-D.js +35 -0
  122. package/dist/assets/{VirtualSchema-BN0NQDyh.js → VirtualSchema-CnYo2buH.js} +13 -13
  123. package/dist/assets/{VueMarkdown-D7yo0t2n.js → VueMarkdown-DQtBIjcr.js} +1 -1
  124. package/dist/assets/{WorkerView-DeYRT0mS.js → WorkerView-BFEeByTA.js} +23 -23
  125. package/dist/assets/{WorkflowActivator-Cj1x_nLm.js → WorkflowActivator-Bxd-bB8P.js} +6 -6
  126. package/dist/assets/{WorkflowExecutionsInfoAccordion-DOW8-lUO.js → WorkflowExecutionsInfoAccordion-BbBvNiqB.js} +4 -4
  127. package/dist/assets/{WorkflowExecutionsLandingPage-D-k97H81.js → WorkflowExecutionsLandingPage-C9EEWnxX.js} +7 -7
  128. package/dist/assets/{WorkflowExecutionsPreview-bwSmtqxL.js → WorkflowExecutionsPreview-bL404UdF.js} +14 -14
  129. package/dist/assets/{WorkflowExecutionsView-BoJYR4A-.js → WorkflowExecutionsView-Bpxaw8Vh.js} +22 -22
  130. package/dist/assets/{WorkflowHistory-DDwFxfgs.js → WorkflowHistory-CORp6hCd.js} +11 -11
  131. package/dist/assets/{WorkflowLocation-BcPFmw0j.js → WorkflowLocation-tnhpuBX7.js} +3 -3
  132. package/dist/assets/{WorkflowOnboardingView-CQjMFn6h.js → WorkflowOnboardingView-BEawbzt-.js} +5 -5
  133. package/dist/assets/{WorkflowPreview-C2LPnLG1.js → WorkflowPreview-CEDUFgeD.js} +3 -3
  134. package/dist/assets/{WorkflowTagsDropdown-ChfpozQB.js → WorkflowTagsDropdown-XEtouCaM.js} +2 -2
  135. package/dist/assets/{WorkflowsView-C3nCkxzz.js → WorkflowsView-ClQilsPp.js} +36 -36
  136. package/dist/assets/{_baseOrderBy-CesQfsb9.js → _baseOrderBy-xWA0TcWm.js} +2 -2
  137. package/dist/assets/{_initCloneObject-DrYdt_vX.js → _initCloneObject-DZFc-F-b.js} +2 -2
  138. package/dist/assets/{aiTemplatesStarterCollection.store-Bz4IH9Sr.js → aiTemplatesStarterCollection.store-zMePNJbZ.js} +4 -4
  139. package/dist/assets/{apiKeys.store-W8uXGfoe.js → apiKeys.store-BzgIQpBj.js} +2 -2
  140. package/dist/assets/{assistant.store-Cn9sEjYD.js → assistant.store-B5OR1Bze.js} +4 -4
  141. package/dist/assets/{auth.eventBus-D9L5FHI4.js → auth.eventBus-D3nU98SE.js} +1 -1
  142. package/dist/assets/{banners.store-CRNqMmnn.js → banners.store-B7CxzJ2_.js} +3 -3
  143. package/dist/assets/{builder.store-YujiPssa.js → builder.store-DoNE5iKP.js} +4 -4
  144. package/dist/assets/{chat.store-YbHxxnni.js → chat.store-YIaykMtq.js} +3 -3
  145. package/dist/assets/{chatPanel.store-DmxMXfyE.js → chatPanel.store-zWZ0Jjvi.js} +5 -5
  146. package/dist/assets/{col-oSGwUVsR.js → col-Cj8t34XN.js} +1 -1
  147. package/dist/assets/{constants-D52YoOSp.js → constants-BiRoCM0c.js} +4 -3
  148. package/dist/assets/{dataTable.store-CUsh5p9b.js → dataTable.store-BXKAnmr0.js} +3 -3
  149. package/dist/assets/{date-picker-DeUybCvv.js → date-picker-CNwAHb3n.js} +2 -2
  150. package/dist/assets/{dialog-C4MrWHj5.js → dialog-Bot5nr0N.js} +3 -3
  151. package/dist/assets/{evaluation.constants-0Qe9Ioy2.js → evaluation.constants-QH_qT6UD.js} +3 -3
  152. package/dist/assets/{executions.store-Dodf4hZt.js → executions.store-O0Cs6kyK.js} +2 -2
  153. package/dist/assets/{externalSecrets.ee.store-CRomIb5E.js → externalSecrets.ee.store-D1gmVgZF.js} +3 -3
  154. package/dist/assets/{folders.store-Bld2a-oS.js → folders.store-vVDyrOf9.js} +2 -2
  155. package/dist/assets/{index-BFbfC2Dj.js → index-D6qelrIy.js} +83 -83
  156. package/dist/assets/{insights.store-CwovPTtG.js → insights.store-CEm0oAQ1.js} +3 -3
  157. package/dist/assets/{isEmpty-OfTBXDAe.js → isEmpty-DCuynolj.js} +21 -21
  158. package/dist/assets/{logStreaming.store-fF1gjMD8.js → logStreaming.store-rSlN8vmt.js} +2 -2
  159. package/dist/assets/{mcp.store-CaNRXC4L.js → mcp.store-NBibfYnt.js} +2 -2
  160. package/dist/assets/{nodeCreator.store-CnQC3Thy.js → nodeCreator.store-C5ZiFH88.js} +5 -5
  161. package/dist/assets/{nodeIcon-Bcr-G7rB.js → nodeIcon-CPowiQry.js} +3 -3
  162. package/dist/assets/{nodeTransforms-DK79e95H.js → nodeTransforms-B7ZrYsoY.js} +2 -2
  163. package/dist/assets/{orderBy-YGC4g6w9.js → orderBy-C7nKLQm8.js} +1 -1
  164. package/dist/assets/{personalizedTemplatesV3.store-BKxUzmKZ.js → personalizedTemplatesV3.store-C-6ck-eG.js} +3 -3
  165. package/dist/assets/{pickBy-BnWwuV2u.js → pickBy-CegO_wl5.js} +2 -2
  166. package/dist/assets/{radio-DyB--77Q.js → radio-BQbSXowV.js} +1 -1
  167. package/dist/assets/{readyToRun.store-BRvUlRSD.js → readyToRun.store-B87q35Mr.js} +5 -5
  168. package/dist/assets/{readyToRunWorkflows.store-BNsVPNB9.js → readyToRunWorkflows.store-DYQM88iU.js} +4 -4
  169. package/dist/assets/{roles.store-pbRRxt0E.js → roles.store-D6uYJEc8.js} +3 -3
  170. package/dist/assets/{router-nTea-Urj.js → router-BeB9V_IR.js} +84 -84
  171. package/dist/assets/{schemaPreview.store-D6CQiOeI.js → schemaPreview.store-C7il53qQ.js} +3 -3
  172. package/dist/assets/{semver-CrR9VADA.js → semver-DQ1spAwG.js} +2 -2
  173. package/dist/assets/{sourceControl.eventBus-KIeXsiU7.js → sourceControl.eventBus-C4ZTxfD6.js} +1 -1
  174. package/dist/assets/{src-DTY1hJHs.js → src-Czua7QS4.js} +33 -18
  175. package/dist/assets/{sso.store-Di00dtDC.js → sso.store-XplLjdjE.js} +2 -2
  176. package/dist/assets/{table-VmuGzK7A.js → table-BaJV0PMz.js} +3 -3
  177. package/dist/assets/{templateActions-DIWkQgOn.js → templateActions-CnKsqyQX.js} +5 -5
  178. package/dist/assets/{templateTransforms-BYfEDiSK.js → templateTransforms-tCNgggoI.js} +1 -1
  179. package/dist/assets/{truncate-ByNK2lRy.js → truncate-4AS2exV3.js} +2203 -2203
  180. package/dist/assets/{uniqBy-CJFaA-UD.js → uniqBy-DYX8cQbP.js} +1 -1
  181. package/dist/assets/{usage.store-BY4g7MNp.js → usage.store---1xT3dr.js} +2 -2
  182. package/dist/assets/{useActions-CBZGt3Kf.js → useActions-SqyZSpq8.js} +3 -3
  183. package/dist/assets/{useBeforeUnload-CQAM_lAW.js → useBeforeUnload-Frc3kJwY.js} +2 -2
  184. package/dist/assets/{useCanvasMapping-C0deX2fv.js → useCanvasMapping-ckk9p3Z_.js} +16 -16
  185. package/dist/assets/{useCanvasOperations-BQyHvbXi.js → useCanvasOperations-B0_VkwYO.js} +9 -9
  186. package/dist/assets/{useClipboard-CqFyEHaX.js → useClipboard-aAhMBccX.js} +1 -1
  187. package/dist/assets/{useCommandBar-I9Rh00u6.js → useCommandBar-B-FM_q4D.js} +18 -18
  188. package/dist/assets/{useCredentialResolvers-CaMKldsZ.js → useCredentialResolvers-BUdqGvmz.js} +3 -3
  189. package/dist/assets/{useCustomAgent-DLwpqJcm.js → useCustomAgent-CpSjLLmx.js} +7 -7
  190. package/dist/assets/{useDebounce-DGSOfe85.js → useDebounce-BT72iAmz.js} +1 -1
  191. package/dist/assets/{useExecutionData-BocEX1BJ.js → useExecutionData-CcJxqQ4P.js} +1 -1
  192. package/dist/assets/{useExecutionDebugging-CsWzUsUi.js → useExecutionDebugging-CtsTTYUP.js} +5 -5
  193. package/dist/assets/{useExecutionHelpers-BWgzEc86.js → useExecutionHelpers-BT28_NgQ.js} +3 -3
  194. package/dist/assets/{useImportCurlCommand-DGIgJik0.js → useImportCurlCommand-iPI3t0bK.js} +5 -5
  195. package/dist/assets/{useKeybindings-DD-ZZkmj.js → useKeybindings-CdqRqeMq.js} +3 -3
  196. package/dist/assets/{useLogsTreeExpand-BQmkJc3D.js → useLogsTreeExpand-U4aHj0YH.js} +8 -8
  197. package/dist/assets/{useMcp-CtPU_6al.js → useMcp-DqpgReET.js} +2 -2
  198. package/dist/assets/{usePageRedirectionHelper-TzgTKFxt.js → usePageRedirectionHelper-WQFPPEkJ.js} +3 -3
  199. package/dist/assets/{usePinnedData-Dztv0dCp.js → usePinnedData-DY18UrR8.js} +3 -3
  200. package/dist/assets/{usePushConnection-Ce3EppRV.js → usePushConnection-DLXKs6Pl.js} +10 -10
  201. package/dist/assets/{useRecentResources-fniP3oOE.js → useRecentResources-Dmyse5sV.js} +6 -6
  202. package/dist/assets/{useRunWorkflow-CJgkc0Iq.js → useRunWorkflow-qvHcKYK-.js} +6 -6
  203. package/dist/assets/{useSettingsItems-Ds8JJZE_.js → useSettingsItems-BnPf2JrE.js} +3 -3
  204. package/dist/assets/{useTelemetryContext-Ds7-s6ZC.js → useTelemetryContext-k7tFigHj.js} +1 -1
  205. package/dist/assets/{useWorkflowActivate-DocAQ9u8.js → useWorkflowActivate-B8Z7d2ST.js} +4 -4
  206. package/dist/assets/{useWorkflowsCache-BXhjK2ZF.js → useWorkflowsCache-Bph0PnSk.js} +1 -1
  207. package/dist/assets/{userRoleProvisioning.store-DNmA1ftX.js → userRoleProvisioning.store-DD9VUV4g.js} +2 -2
  208. package/dist/assets/{versions.store-qQUmfjg3.js → versions.store-BTPqbzUV.js} +3 -3
  209. package/dist/index.html +81 -81
  210. package/package.json +1 -1
  211. package/dist/assets/CollectionParameter-DvlRV-HR.js +0 -50
  212. package/dist/assets/LogsPanel-z0W4CHve.js +0 -50
  213. package/dist/assets/VirtualSchema-rizWsPXH.js +0 -35
@@ -4037,1477 +4037,6 @@ function createEventBus() {
4037
4037
  }
4038
4038
  };
4039
4039
  }
4040
- function isTaskAbortedMessage(msg) {
4041
- return msg.type === "text" && "aborted" in msg && msg.aborted;
4042
- }
4043
- function isWorkflowUpdatedMessage(msg) {
4044
- return msg.type === "workflow-updated";
4045
- }
4046
- function isToolMessage(msg) {
4047
- return msg.type === "tool";
4048
- }
4049
- function isThinkingGroupMessage(msg) {
4050
- return msg.type === "thinking-group";
4051
- }
4052
- var isBrowser = typeof document !== "undefined";
4053
- function isRouteComponent(component) {
4054
- return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
4055
- }
4056
- function isESModule(obj) {
4057
- return obj.__esModule || obj[Symbol.toStringTag] === "Module" || obj.default && isRouteComponent(obj.default);
4058
- }
4059
- var assign = Object.assign;
4060
- function applyToParams(fn, params) {
4061
- const newParams = {};
4062
- for (const key in params) {
4063
- const value = params[key];
4064
- newParams[key] = isArray$3(value) ? value.map(fn) : fn(value);
4065
- }
4066
- return newParams;
4067
- }
4068
- var noop = () => {};
4069
- var isArray$3 = Array.isArray;
4070
- var HASH_RE = /#/g;
4071
- var AMPERSAND_RE = /&/g;
4072
- var SLASH_RE = /\//g;
4073
- var EQUAL_RE = /=/g;
4074
- var IM_RE = /\?/g;
4075
- var PLUS_RE = /\+/g;
4076
- var ENC_BRACKET_OPEN_RE = /%5B/g;
4077
- var ENC_BRACKET_CLOSE_RE = /%5D/g;
4078
- var ENC_CARET_RE = /%5E/g;
4079
- var ENC_BACKTICK_RE = /%60/g;
4080
- var ENC_CURLY_OPEN_RE = /%7B/g;
4081
- var ENC_PIPE_RE = /%7C/g;
4082
- var ENC_CURLY_CLOSE_RE = /%7D/g;
4083
- var ENC_SPACE_RE = /%20/g;
4084
- function commonEncode(text) {
4085
- return encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
4086
- }
4087
- function encodeHash(text) {
4088
- return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
4089
- }
4090
- function encodeQueryValue(text) {
4091
- 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, "^");
4092
- }
4093
- function encodeQueryKey(text) {
4094
- return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
4095
- }
4096
- function encodePath(text) {
4097
- return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
4098
- }
4099
- function encodeParam(text) {
4100
- return text == null ? "" : encodePath(text).replace(SLASH_RE, "%2F");
4101
- }
4102
- function decode(text) {
4103
- try {
4104
- return decodeURIComponent("" + text);
4105
- } catch (err) {}
4106
- return "" + text;
4107
- }
4108
- var TRAILING_SLASH_RE = /\/$/;
4109
- var removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
4110
- function parseURL(parseQuery$1, location$1, currentLocation = "/") {
4111
- let path, query = {}, searchString = "", hash = "";
4112
- const hashPos = location$1.indexOf("#");
4113
- let searchPos = location$1.indexOf("?");
4114
- if (hashPos < searchPos && hashPos >= 0) searchPos = -1;
4115
- if (searchPos > -1) {
4116
- path = location$1.slice(0, searchPos);
4117
- searchString = location$1.slice(searchPos + 1, hashPos > -1 ? hashPos : location$1.length);
4118
- query = parseQuery$1(searchString);
4119
- }
4120
- if (hashPos > -1) {
4121
- path = path || location$1.slice(0, hashPos);
4122
- hash = location$1.slice(hashPos, location$1.length);
4123
- }
4124
- path = resolveRelativePath(path != null ? path : location$1, currentLocation);
4125
- return {
4126
- fullPath: path + (searchString && "?") + searchString + hash,
4127
- path,
4128
- query,
4129
- hash: decode(hash)
4130
- };
4131
- }
4132
- function stringifyURL(stringifyQuery$1, location$1) {
4133
- const query = location$1.query ? stringifyQuery$1(location$1.query) : "";
4134
- return location$1.path + (query && "?") + query + (location$1.hash || "");
4135
- }
4136
- function stripBase(pathname, base) {
4137
- if (!base || !pathname.toLowerCase().startsWith(base.toLowerCase())) return pathname;
4138
- return pathname.slice(base.length) || "/";
4139
- }
4140
- function isSameRouteLocation(stringifyQuery$1, a, b) {
4141
- const aLastIndex = a.matched.length - 1;
4142
- const bLastIndex = b.matched.length - 1;
4143
- 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;
4144
- }
4145
- function isSameRouteRecord(a, b) {
4146
- return (a.aliasOf || a) === (b.aliasOf || b);
4147
- }
4148
- function isSameRouteLocationParams(a, b) {
4149
- if (Object.keys(a).length !== Object.keys(b).length) return false;
4150
- for (const key in a) if (!isSameRouteLocationParamsValue(a[key], b[key])) return false;
4151
- return true;
4152
- }
4153
- function isSameRouteLocationParamsValue(a, b) {
4154
- return isArray$3(a) ? isEquivalentArray(a, b) : isArray$3(b) ? isEquivalentArray(b, a) : a === b;
4155
- }
4156
- function isEquivalentArray(a, b) {
4157
- return isArray$3(b) ? a.length === b.length && a.every((value, i$1) => value === b[i$1]) : a.length === 1 && a[0] === b;
4158
- }
4159
- function resolveRelativePath(to, from) {
4160
- if (to.startsWith("/")) return to;
4161
- if (!to) return from;
4162
- const fromSegments = from.split("/");
4163
- const toSegments = to.split("/");
4164
- const lastToSegment = toSegments[toSegments.length - 1];
4165
- if (lastToSegment === ".." || lastToSegment === ".") toSegments.push("");
4166
- let position = fromSegments.length - 1;
4167
- let toPosition;
4168
- let segment;
4169
- for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
4170
- segment = toSegments[toPosition];
4171
- if (segment === ".") continue;
4172
- if (segment === "..") {
4173
- if (position > 1) position--;
4174
- } else break;
4175
- }
4176
- return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition).join("/");
4177
- }
4178
- var START_LOCATION_NORMALIZED = {
4179
- path: "/",
4180
- name: void 0,
4181
- params: {},
4182
- query: {},
4183
- hash: "",
4184
- fullPath: "/",
4185
- matched: [],
4186
- meta: {},
4187
- redirectedFrom: void 0
4188
- };
4189
- var NavigationType;
4190
- (function(NavigationType$1) {
4191
- NavigationType$1["pop"] = "pop";
4192
- NavigationType$1["push"] = "push";
4193
- })(NavigationType || (NavigationType = {}));
4194
- var NavigationDirection;
4195
- (function(NavigationDirection$1) {
4196
- NavigationDirection$1["back"] = "back";
4197
- NavigationDirection$1["forward"] = "forward";
4198
- NavigationDirection$1["unknown"] = "";
4199
- })(NavigationDirection || (NavigationDirection = {}));
4200
- function normalizeBase(base) {
4201
- if (!base) if (isBrowser) {
4202
- const baseEl = document.querySelector("base");
4203
- base = baseEl && baseEl.getAttribute("href") || "/";
4204
- base = base.replace(/^\w+:\/\/[^\/]+/, "");
4205
- } else base = "/";
4206
- if (base[0] !== "/" && base[0] !== "#") base = "/" + base;
4207
- return removeTrailingSlash(base);
4208
- }
4209
- var BEFORE_HASH_RE = /^[^#]+#/;
4210
- function createHref(base, location$1) {
4211
- return base.replace(BEFORE_HASH_RE, "#") + location$1;
4212
- }
4213
- function getElementPosition(el, offset) {
4214
- const docRect = document.documentElement.getBoundingClientRect();
4215
- const elRect = el.getBoundingClientRect();
4216
- return {
4217
- behavior: offset.behavior,
4218
- left: elRect.left - docRect.left - (offset.left || 0),
4219
- top: elRect.top - docRect.top - (offset.top || 0)
4220
- };
4221
- }
4222
- var computeScrollPosition = () => ({
4223
- left: window.scrollX,
4224
- top: window.scrollY
4225
- });
4226
- function scrollToPosition(position) {
4227
- let scrollToOptions;
4228
- if ("el" in position) {
4229
- const positionEl = position.el;
4230
- const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
4231
- const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
4232
- if (!el) return;
4233
- scrollToOptions = getElementPosition(el, position);
4234
- } else scrollToOptions = position;
4235
- if ("scrollBehavior" in document.documentElement.style) window.scrollTo(scrollToOptions);
4236
- else window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
4237
- }
4238
- function getScrollKey(path, delta) {
4239
- return (history.state ? history.state.position - delta : -1) + path;
4240
- }
4241
- var scrollPositions = /* @__PURE__ */ new Map();
4242
- function saveScrollPosition(key, scrollPosition) {
4243
- scrollPositions.set(key, scrollPosition);
4244
- }
4245
- function getSavedScrollPosition(key) {
4246
- const scroll = scrollPositions.get(key);
4247
- scrollPositions.delete(key);
4248
- return scroll;
4249
- }
4250
- var createBaseLocation = () => location.protocol + "//" + location.host;
4251
- function createCurrentLocation(base, location$1) {
4252
- const { pathname, search, hash } = location$1;
4253
- const hashPos = base.indexOf("#");
4254
- if (hashPos > -1) {
4255
- let slicePos = hash.includes(base.slice(hashPos)) ? base.slice(hashPos).length : 1;
4256
- let pathFromHash = hash.slice(slicePos);
4257
- if (pathFromHash[0] !== "/") pathFromHash = "/" + pathFromHash;
4258
- return stripBase(pathFromHash, "");
4259
- }
4260
- return stripBase(pathname, base) + search + hash;
4261
- }
4262
- function useHistoryListeners(base, historyState, currentLocation, replace) {
4263
- let listeners = [];
4264
- let teardowns = [];
4265
- let pauseState = null;
4266
- const popStateHandler = ({ state }) => {
4267
- const to = createCurrentLocation(base, location);
4268
- const from = currentLocation.value;
4269
- const fromState = historyState.value;
4270
- let delta = 0;
4271
- if (state) {
4272
- currentLocation.value = to;
4273
- historyState.value = state;
4274
- if (pauseState && pauseState === from) {
4275
- pauseState = null;
4276
- return;
4277
- }
4278
- delta = fromState ? state.position - fromState.position : 0;
4279
- } else replace(to);
4280
- listeners.forEach((listener) => {
4281
- listener(currentLocation.value, from, {
4282
- delta,
4283
- type: NavigationType.pop,
4284
- direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
4285
- });
4286
- });
4287
- };
4288
- function pauseListeners() {
4289
- pauseState = currentLocation.value;
4290
- }
4291
- function listen(callback) {
4292
- listeners.push(callback);
4293
- const teardown = () => {
4294
- const index = listeners.indexOf(callback);
4295
- if (index > -1) listeners.splice(index, 1);
4296
- };
4297
- teardowns.push(teardown);
4298
- return teardown;
4299
- }
4300
- function beforeUnloadListener() {
4301
- const { history: history$1 } = window;
4302
- if (!history$1.state) return;
4303
- history$1.replaceState(assign({}, history$1.state, { scroll: computeScrollPosition() }), "");
4304
- }
4305
- function destroy() {
4306
- for (const teardown of teardowns) teardown();
4307
- teardowns = [];
4308
- window.removeEventListener("popstate", popStateHandler);
4309
- window.removeEventListener("beforeunload", beforeUnloadListener);
4310
- }
4311
- window.addEventListener("popstate", popStateHandler);
4312
- window.addEventListener("beforeunload", beforeUnloadListener, { passive: true });
4313
- return {
4314
- pauseListeners,
4315
- listen,
4316
- destroy
4317
- };
4318
- }
4319
- function buildState(back, current, forward, replaced = false, computeScroll = false) {
4320
- return {
4321
- back,
4322
- current,
4323
- forward,
4324
- replaced,
4325
- position: window.history.length,
4326
- scroll: computeScroll ? computeScrollPosition() : null
4327
- };
4328
- }
4329
- function useHistoryStateNavigation(base) {
4330
- const { history: history$1, location: location$1 } = window;
4331
- const currentLocation = { value: createCurrentLocation(base, location$1) };
4332
- const historyState = { value: history$1.state };
4333
- if (!historyState.value) changeLocation(currentLocation.value, {
4334
- back: null,
4335
- current: currentLocation.value,
4336
- forward: null,
4337
- position: history$1.length - 1,
4338
- replaced: true,
4339
- scroll: null
4340
- }, true);
4341
- function changeLocation(to, state, replace$1) {
4342
- const hashIndex = base.indexOf("#");
4343
- const url = hashIndex > -1 ? (location$1.host && document.querySelector("base") ? base : base.slice(hashIndex)) + to : createBaseLocation() + base + to;
4344
- try {
4345
- history$1[replace$1 ? "replaceState" : "pushState"](state, "", url);
4346
- historyState.value = state;
4347
- } catch (err) {
4348
- console.error(err);
4349
- location$1[replace$1 ? "replace" : "assign"](url);
4350
- }
4351
- }
4352
- function replace(to, data) {
4353
- changeLocation(to, assign({}, history$1.state, buildState(historyState.value.back, to, historyState.value.forward, true), data, { position: historyState.value.position }), true);
4354
- currentLocation.value = to;
4355
- }
4356
- function push(to, data) {
4357
- const currentState = assign({}, historyState.value, history$1.state, {
4358
- forward: to,
4359
- scroll: computeScrollPosition()
4360
- });
4361
- changeLocation(currentState.current, currentState, true);
4362
- changeLocation(to, assign({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data), false);
4363
- currentLocation.value = to;
4364
- }
4365
- return {
4366
- location: currentLocation,
4367
- state: historyState,
4368
- push,
4369
- replace
4370
- };
4371
- }
4372
- function createWebHistory(base) {
4373
- base = normalizeBase(base);
4374
- const historyNavigation = useHistoryStateNavigation(base);
4375
- const historyListeners = useHistoryListeners(base, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
4376
- function go(delta, triggerListeners = true) {
4377
- if (!triggerListeners) historyListeners.pauseListeners();
4378
- history.go(delta);
4379
- }
4380
- const routerHistory = assign({
4381
- location: "",
4382
- base,
4383
- go,
4384
- createHref: createHref.bind(null, base)
4385
- }, historyNavigation, historyListeners);
4386
- Object.defineProperty(routerHistory, "location", {
4387
- enumerable: true,
4388
- get: () => historyNavigation.location.value
4389
- });
4390
- Object.defineProperty(routerHistory, "state", {
4391
- enumerable: true,
4392
- get: () => historyNavigation.state.value
4393
- });
4394
- return routerHistory;
4395
- }
4396
- function isRouteLocation(route) {
4397
- return typeof route === "string" || route && typeof route === "object";
4398
- }
4399
- function isRouteName(name) {
4400
- return typeof name === "string" || typeof name === "symbol";
4401
- }
4402
- var NavigationFailureSymbol = Symbol("");
4403
- var NavigationFailureType;
4404
- (function(NavigationFailureType$1) {
4405
- NavigationFailureType$1[NavigationFailureType$1["aborted"] = 4] = "aborted";
4406
- NavigationFailureType$1[NavigationFailureType$1["cancelled"] = 8] = "cancelled";
4407
- NavigationFailureType$1[NavigationFailureType$1["duplicated"] = 16] = "duplicated";
4408
- })(NavigationFailureType || (NavigationFailureType = {}));
4409
- function createRouterError(type, params) {
4410
- return assign(/* @__PURE__ */ new Error(), {
4411
- type,
4412
- [NavigationFailureSymbol]: true
4413
- }, params);
4414
- }
4415
- function isNavigationFailure(error, type) {
4416
- return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
4417
- }
4418
- var BASE_PARAM_PATTERN = "[^/]+?";
4419
- var BASE_PATH_PARSER_OPTIONS = {
4420
- sensitive: false,
4421
- strict: false,
4422
- start: true,
4423
- end: true
4424
- };
4425
- var REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
4426
- function tokensToParser(segments, extraOptions) {
4427
- const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
4428
- const score = [];
4429
- let pattern = options.start ? "^" : "";
4430
- const keys = [];
4431
- for (const segment of segments) {
4432
- const segmentScores = segment.length ? [] : [90];
4433
- if (options.strict && !segment.length) pattern += "/";
4434
- for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
4435
- const token = segment[tokenIndex];
4436
- let subSegmentScore = 40 + (options.sensitive ? .25 : 0);
4437
- if (token.type === 0) {
4438
- if (!tokenIndex) pattern += "/";
4439
- pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
4440
- subSegmentScore += 40;
4441
- } else if (token.type === 1) {
4442
- const { value, repeatable, optional, regexp } = token;
4443
- keys.push({
4444
- name: value,
4445
- repeatable,
4446
- optional
4447
- });
4448
- const re$1 = regexp ? regexp : BASE_PARAM_PATTERN;
4449
- if (re$1 !== BASE_PARAM_PATTERN) {
4450
- subSegmentScore += 10;
4451
- try {
4452
- `${re$1}`;
4453
- } catch (err) {
4454
- throw new Error(`Invalid custom RegExp for param "${value}" (${re$1}): ` + err.message);
4455
- }
4456
- }
4457
- let subPattern = repeatable ? `((?:${re$1})(?:/(?:${re$1}))*)` : `(${re$1})`;
4458
- if (!tokenIndex) subPattern = optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
4459
- if (optional) subPattern += "?";
4460
- pattern += subPattern;
4461
- subSegmentScore += 20;
4462
- if (optional) subSegmentScore += -8;
4463
- if (repeatable) subSegmentScore += -20;
4464
- if (re$1 === ".*") subSegmentScore += -50;
4465
- }
4466
- segmentScores.push(subSegmentScore);
4467
- }
4468
- score.push(segmentScores);
4469
- }
4470
- if (options.strict && options.end) {
4471
- const i$1 = score.length - 1;
4472
- score[i$1][score[i$1].length - 1] += .7000000000000001;
4473
- }
4474
- if (!options.strict) pattern += "/?";
4475
- if (options.end) pattern += "$";
4476
- else if (options.strict && !pattern.endsWith("/")) pattern += "(?:/|$)";
4477
- const re = new RegExp(pattern, options.sensitive ? "" : "i");
4478
- function parse(path) {
4479
- const match = path.match(re);
4480
- const params = {};
4481
- if (!match) return null;
4482
- for (let i$1 = 1; i$1 < match.length; i$1++) {
4483
- const value = match[i$1] || "";
4484
- const key = keys[i$1 - 1];
4485
- params[key.name] = value && key.repeatable ? value.split("/") : value;
4486
- }
4487
- return params;
4488
- }
4489
- function stringify(params) {
4490
- let path = "";
4491
- let avoidDuplicatedSlash = false;
4492
- for (const segment of segments) {
4493
- if (!avoidDuplicatedSlash || !path.endsWith("/")) path += "/";
4494
- avoidDuplicatedSlash = false;
4495
- for (const token of segment) if (token.type === 0) path += token.value;
4496
- else if (token.type === 1) {
4497
- const { value, repeatable, optional } = token;
4498
- const param = value in params ? params[value] : "";
4499
- if (isArray$3(param) && !repeatable) throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
4500
- const text = isArray$3(param) ? param.join("/") : param;
4501
- if (!text) if (optional) {
4502
- if (segment.length < 2) if (path.endsWith("/")) path = path.slice(0, -1);
4503
- else avoidDuplicatedSlash = true;
4504
- } else throw new Error(`Missing required param "${value}"`);
4505
- path += text;
4506
- }
4507
- }
4508
- return path || "/";
4509
- }
4510
- return {
4511
- re,
4512
- score,
4513
- keys,
4514
- parse,
4515
- stringify
4516
- };
4517
- }
4518
- function compareScoreArray(a, b) {
4519
- let i$1 = 0;
4520
- while (i$1 < a.length && i$1 < b.length) {
4521
- const diff = b[i$1] - a[i$1];
4522
- if (diff) return diff;
4523
- i$1++;
4524
- }
4525
- if (a.length < b.length) return a.length === 1 && a[0] === 80 ? -1 : 1;
4526
- else if (a.length > b.length) return b.length === 1 && b[0] === 80 ? 1 : -1;
4527
- return 0;
4528
- }
4529
- function comparePathParserScore(a, b) {
4530
- let i$1 = 0;
4531
- const aScore = a.score;
4532
- const bScore = b.score;
4533
- while (i$1 < aScore.length && i$1 < bScore.length) {
4534
- const comp = compareScoreArray(aScore[i$1], bScore[i$1]);
4535
- if (comp) return comp;
4536
- i$1++;
4537
- }
4538
- if (Math.abs(bScore.length - aScore.length) === 1) {
4539
- if (isLastScoreNegative(aScore)) return 1;
4540
- if (isLastScoreNegative(bScore)) return -1;
4541
- }
4542
- return bScore.length - aScore.length;
4543
- }
4544
- function isLastScoreNegative(score) {
4545
- const last = score[score.length - 1];
4546
- return score.length > 0 && last[last.length - 1] < 0;
4547
- }
4548
- var ROOT_TOKEN = {
4549
- type: 0,
4550
- value: ""
4551
- };
4552
- var VALID_PARAM_RE = /[a-zA-Z0-9_]/;
4553
- function tokenizePath(path) {
4554
- if (!path) return [[]];
4555
- if (path === "/") return [[ROOT_TOKEN]];
4556
- if (!path.startsWith("/")) throw new Error(`Invalid path "${path}"`);
4557
- function crash(message) {
4558
- throw new Error(`ERR (${state})/"${buffer}": ${message}`);
4559
- }
4560
- let state = 0;
4561
- let previousState = state;
4562
- const tokens = [];
4563
- let segment;
4564
- function finalizeSegment() {
4565
- if (segment) tokens.push(segment);
4566
- segment = [];
4567
- }
4568
- let i$1 = 0;
4569
- let char;
4570
- let buffer = "";
4571
- let customRe = "";
4572
- function consumeBuffer() {
4573
- if (!buffer) return;
4574
- if (state === 0) segment.push({
4575
- type: 0,
4576
- value: buffer
4577
- });
4578
- else if (state === 1 || state === 2 || state === 3) {
4579
- if (segment.length > 1 && (char === "*" || char === "+")) crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
4580
- segment.push({
4581
- type: 1,
4582
- value: buffer,
4583
- regexp: customRe,
4584
- repeatable: char === "*" || char === "+",
4585
- optional: char === "*" || char === "?"
4586
- });
4587
- } else crash("Invalid state to consume buffer");
4588
- buffer = "";
4589
- }
4590
- function addCharToBuffer() {
4591
- buffer += char;
4592
- }
4593
- while (i$1 < path.length) {
4594
- char = path[i$1++];
4595
- if (char === "\\" && state !== 2) {
4596
- previousState = state;
4597
- state = 4;
4598
- continue;
4599
- }
4600
- switch (state) {
4601
- case 0:
4602
- if (char === "/") {
4603
- if (buffer) consumeBuffer();
4604
- finalizeSegment();
4605
- } else if (char === ":") {
4606
- consumeBuffer();
4607
- state = 1;
4608
- } else addCharToBuffer();
4609
- break;
4610
- case 4:
4611
- addCharToBuffer();
4612
- state = previousState;
4613
- break;
4614
- case 1:
4615
- if (char === "(") state = 2;
4616
- else if (VALID_PARAM_RE.test(char)) addCharToBuffer();
4617
- else {
4618
- consumeBuffer();
4619
- state = 0;
4620
- if (char !== "*" && char !== "?" && char !== "+") i$1--;
4621
- }
4622
- break;
4623
- case 2:
4624
- if (char === ")") if (customRe[customRe.length - 1] == "\\") customRe = customRe.slice(0, -1) + char;
4625
- else state = 3;
4626
- else customRe += char;
4627
- break;
4628
- case 3:
4629
- consumeBuffer();
4630
- state = 0;
4631
- if (char !== "*" && char !== "?" && char !== "+") i$1--;
4632
- customRe = "";
4633
- break;
4634
- default:
4635
- crash("Unknown state");
4636
- break;
4637
- }
4638
- }
4639
- if (state === 2) crash(`Unfinished custom RegExp for param "${buffer}"`);
4640
- consumeBuffer();
4641
- finalizeSegment();
4642
- return tokens;
4643
- }
4644
- function createRouteRecordMatcher(record, parent, options) {
4645
- const matcher = assign(tokensToParser(tokenizePath(record.path), options), {
4646
- record,
4647
- parent,
4648
- children: [],
4649
- alias: []
4650
- });
4651
- if (parent) {
4652
- if (!matcher.record.aliasOf === !parent.record.aliasOf) parent.children.push(matcher);
4653
- }
4654
- return matcher;
4655
- }
4656
- function createRouterMatcher(routes, globalOptions) {
4657
- const matchers$1 = [];
4658
- const matcherMap = /* @__PURE__ */ new Map();
4659
- globalOptions = mergeOptions({
4660
- strict: false,
4661
- end: true,
4662
- sensitive: false
4663
- }, globalOptions);
4664
- function getRecordMatcher(name) {
4665
- return matcherMap.get(name);
4666
- }
4667
- function addRoute(record, parent, originalRecord) {
4668
- const isRootAdd = !originalRecord;
4669
- const mainNormalizedRecord = normalizeRouteRecord(record);
4670
- mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
4671
- const options = mergeOptions(globalOptions, record);
4672
- const normalizedRecords = [mainNormalizedRecord];
4673
- if ("alias" in record) {
4674
- const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
4675
- for (const alias of aliases) normalizedRecords.push(normalizeRouteRecord(assign({}, mainNormalizedRecord, {
4676
- components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
4677
- path: alias,
4678
- aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
4679
- })));
4680
- }
4681
- let matcher;
4682
- let originalMatcher;
4683
- for (const normalizedRecord of normalizedRecords) {
4684
- const { path } = normalizedRecord;
4685
- if (parent && path[0] !== "/") {
4686
- const parentPath = parent.record.path;
4687
- const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
4688
- normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
4689
- }
4690
- matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
4691
- if (originalRecord) originalRecord.alias.push(matcher);
4692
- else {
4693
- originalMatcher = originalMatcher || matcher;
4694
- if (originalMatcher !== matcher) originalMatcher.alias.push(matcher);
4695
- if (isRootAdd && record.name && !isAliasRecord(matcher)) removeRoute(record.name);
4696
- }
4697
- if (isMatchable(matcher)) insertMatcher(matcher);
4698
- if (mainNormalizedRecord.children) {
4699
- const children = mainNormalizedRecord.children;
4700
- for (let i$1 = 0; i$1 < children.length; i$1++) addRoute(children[i$1], matcher, originalRecord && originalRecord.children[i$1]);
4701
- }
4702
- originalRecord = originalRecord || matcher;
4703
- }
4704
- return originalMatcher ? () => {
4705
- removeRoute(originalMatcher);
4706
- } : noop;
4707
- }
4708
- function removeRoute(matcherRef) {
4709
- if (isRouteName(matcherRef)) {
4710
- const matcher = matcherMap.get(matcherRef);
4711
- if (matcher) {
4712
- matcherMap.delete(matcherRef);
4713
- matchers$1.splice(matchers$1.indexOf(matcher), 1);
4714
- matcher.children.forEach(removeRoute);
4715
- matcher.alias.forEach(removeRoute);
4716
- }
4717
- } else {
4718
- const index = matchers$1.indexOf(matcherRef);
4719
- if (index > -1) {
4720
- matchers$1.splice(index, 1);
4721
- if (matcherRef.record.name) matcherMap.delete(matcherRef.record.name);
4722
- matcherRef.children.forEach(removeRoute);
4723
- matcherRef.alias.forEach(removeRoute);
4724
- }
4725
- }
4726
- }
4727
- function getRoutes() {
4728
- return matchers$1;
4729
- }
4730
- function insertMatcher(matcher) {
4731
- const index = findInsertionIndex(matcher, matchers$1);
4732
- matchers$1.splice(index, 0, matcher);
4733
- if (matcher.record.name && !isAliasRecord(matcher)) matcherMap.set(matcher.record.name, matcher);
4734
- }
4735
- function resolve(location$1, currentLocation) {
4736
- let matcher;
4737
- let params = {};
4738
- let path;
4739
- let name;
4740
- if ("name" in location$1 && location$1.name) {
4741
- matcher = matcherMap.get(location$1.name);
4742
- if (!matcher) throw createRouterError(1, { location: location$1 });
4743
- name = matcher.record.name;
4744
- params = assign(paramsFromLocation(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 && paramsFromLocation(location$1.params, matcher.keys.map((k) => k.name)));
4745
- path = matcher.stringify(params);
4746
- } else if (location$1.path != null) {
4747
- path = location$1.path;
4748
- matcher = matchers$1.find((m) => m.re.test(path));
4749
- if (matcher) {
4750
- params = matcher.parse(path);
4751
- name = matcher.record.name;
4752
- }
4753
- } else {
4754
- matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers$1.find((m) => m.re.test(currentLocation.path));
4755
- if (!matcher) throw createRouterError(1, {
4756
- location: location$1,
4757
- currentLocation
4758
- });
4759
- name = matcher.record.name;
4760
- params = assign({}, currentLocation.params, location$1.params);
4761
- path = matcher.stringify(params);
4762
- }
4763
- const matched = [];
4764
- let parentMatcher = matcher;
4765
- while (parentMatcher) {
4766
- matched.unshift(parentMatcher.record);
4767
- parentMatcher = parentMatcher.parent;
4768
- }
4769
- return {
4770
- name,
4771
- path,
4772
- params,
4773
- matched,
4774
- meta: mergeMetaFields(matched)
4775
- };
4776
- }
4777
- routes.forEach((route) => addRoute(route));
4778
- function clearRoutes() {
4779
- matchers$1.length = 0;
4780
- matcherMap.clear();
4781
- }
4782
- return {
4783
- addRoute,
4784
- resolve,
4785
- removeRoute,
4786
- clearRoutes,
4787
- getRoutes,
4788
- getRecordMatcher
4789
- };
4790
- }
4791
- function paramsFromLocation(params, keys) {
4792
- const newParams = {};
4793
- for (const key of keys) if (key in params) newParams[key] = params[key];
4794
- return newParams;
4795
- }
4796
- function normalizeRouteRecord(record) {
4797
- const normalized = {
4798
- path: record.path,
4799
- redirect: record.redirect,
4800
- name: record.name,
4801
- meta: record.meta || {},
4802
- aliasOf: record.aliasOf,
4803
- beforeEnter: record.beforeEnter,
4804
- props: normalizeRecordProps(record),
4805
- children: record.children || [],
4806
- instances: {},
4807
- leaveGuards: /* @__PURE__ */ new Set(),
4808
- updateGuards: /* @__PURE__ */ new Set(),
4809
- enterCallbacks: {},
4810
- components: "components" in record ? record.components || null : record.component && { default: record.component }
4811
- };
4812
- Object.defineProperty(normalized, "mods", { value: {} });
4813
- return normalized;
4814
- }
4815
- function normalizeRecordProps(record) {
4816
- const propsObject = {};
4817
- const props = record.props || false;
4818
- if ("component" in record) propsObject.default = props;
4819
- else for (const name in record.components) propsObject[name] = typeof props === "object" ? props[name] : props;
4820
- return propsObject;
4821
- }
4822
- function isAliasRecord(record) {
4823
- while (record) {
4824
- if (record.record.aliasOf) return true;
4825
- record = record.parent;
4826
- }
4827
- return false;
4828
- }
4829
- function mergeMetaFields(matched) {
4830
- return matched.reduce((meta, record) => assign(meta, record.meta), {});
4831
- }
4832
- function mergeOptions(defaults, partialOptions) {
4833
- const options = {};
4834
- for (const key in defaults) options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
4835
- return options;
4836
- }
4837
- function findInsertionIndex(matcher, matchers$1) {
4838
- let lower = 0;
4839
- let upper = matchers$1.length;
4840
- while (lower !== upper) {
4841
- const mid = lower + upper >> 1;
4842
- if (comparePathParserScore(matcher, matchers$1[mid]) < 0) upper = mid;
4843
- else lower = mid + 1;
4844
- }
4845
- const insertionAncestor = getInsertionAncestor(matcher);
4846
- if (insertionAncestor) upper = matchers$1.lastIndexOf(insertionAncestor, upper - 1);
4847
- return upper;
4848
- }
4849
- function getInsertionAncestor(matcher) {
4850
- let ancestor = matcher;
4851
- while (ancestor = ancestor.parent) if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0) return ancestor;
4852
- }
4853
- function isMatchable({ record }) {
4854
- return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
4855
- }
4856
- function parseQuery(search) {
4857
- const query = {};
4858
- if (search === "" || search === "?") return query;
4859
- const searchParams = (search[0] === "?" ? search.slice(1) : search).split("&");
4860
- for (let i$1 = 0; i$1 < searchParams.length; ++i$1) {
4861
- const searchParam = searchParams[i$1].replace(PLUS_RE, " ");
4862
- const eqPos = searchParam.indexOf("=");
4863
- const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
4864
- const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
4865
- if (key in query) {
4866
- let currentValue = query[key];
4867
- if (!isArray$3(currentValue)) currentValue = query[key] = [currentValue];
4868
- currentValue.push(value);
4869
- } else query[key] = value;
4870
- }
4871
- return query;
4872
- }
4873
- function stringifyQuery(query) {
4874
- let search = "";
4875
- for (let key in query) {
4876
- const value = query[key];
4877
- key = encodeQueryKey(key);
4878
- if (value == null) {
4879
- if (value !== void 0) search += (search.length ? "&" : "") + key;
4880
- continue;
4881
- }
4882
- (isArray$3(value) ? value.map((v) => v && encodeQueryValue(v)) : [value && encodeQueryValue(value)]).forEach((value$1) => {
4883
- if (value$1 !== void 0) {
4884
- search += (search.length ? "&" : "") + key;
4885
- if (value$1 != null) search += "=" + value$1;
4886
- }
4887
- });
4888
- }
4889
- return search;
4890
- }
4891
- function normalizeQuery(query) {
4892
- const normalizedQuery = {};
4893
- for (const key in query) {
4894
- const value = query[key];
4895
- if (value !== void 0) normalizedQuery[key] = isArray$3(value) ? value.map((v) => v == null ? null : "" + v) : value == null ? value : "" + value;
4896
- }
4897
- return normalizedQuery;
4898
- }
4899
- var matchedRouteKey = Symbol("");
4900
- var viewDepthKey = Symbol("");
4901
- var routerKey = Symbol("");
4902
- var routeLocationKey = Symbol("");
4903
- var routerViewLocationKey = Symbol("");
4904
- function useCallbacks() {
4905
- let handlers$1 = [];
4906
- function add(handler) {
4907
- handlers$1.push(handler);
4908
- return () => {
4909
- const i$1 = handlers$1.indexOf(handler);
4910
- if (i$1 > -1) handlers$1.splice(i$1, 1);
4911
- };
4912
- }
4913
- function reset() {
4914
- handlers$1 = [];
4915
- }
4916
- return {
4917
- add,
4918
- list: () => handlers$1.slice(),
4919
- reset
4920
- };
4921
- }
4922
- function registerGuard(record, name, guard) {
4923
- const removeFromList = () => {
4924
- record[name].delete(guard);
4925
- };
4926
- onUnmounted(removeFromList);
4927
- onDeactivated(removeFromList);
4928
- onActivated(() => {
4929
- record[name].add(guard);
4930
- });
4931
- record[name].add(guard);
4932
- }
4933
- function onBeforeRouteLeave(leaveGuard) {
4934
- const activeRecord = inject(matchedRouteKey, {}).value;
4935
- if (!activeRecord) return;
4936
- registerGuard(activeRecord, "leaveGuards", leaveGuard);
4937
- }
4938
- function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn) => fn()) {
4939
- const enterCallbackArray = record && (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
4940
- return () => new Promise((resolve, reject) => {
4941
- const next = (valid) => {
4942
- if (valid === false) reject(createRouterError(4, {
4943
- from,
4944
- to
4945
- }));
4946
- else if (valid instanceof Error) reject(valid);
4947
- else if (isRouteLocation(valid)) reject(createRouterError(2, {
4948
- from: to,
4949
- to: valid
4950
- }));
4951
- else {
4952
- if (enterCallbackArray && record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") enterCallbackArray.push(valid);
4953
- resolve();
4954
- }
4955
- };
4956
- const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
4957
- let guardCall = Promise.resolve(guardReturn);
4958
- if (guard.length < 3) guardCall = guardCall.then(next);
4959
- guardCall.catch((err) => reject(err));
4960
- });
4961
- }
4962
- function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn) => fn()) {
4963
- const guards = [];
4964
- for (const record of matched) for (const name in record.components) {
4965
- let rawComponent = record.components[name];
4966
- if (guardType !== "beforeRouteEnter" && !record.instances[name]) continue;
4967
- if (isRouteComponent(rawComponent)) {
4968
- const guard = (rawComponent.__vccOpts || rawComponent)[guardType];
4969
- guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
4970
- } else {
4971
- let componentPromise = rawComponent();
4972
- guards.push(() => componentPromise.then((resolved) => {
4973
- if (!resolved) throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
4974
- const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
4975
- record.mods[name] = resolved;
4976
- record.components[name] = resolvedComponent;
4977
- const guard = (resolvedComponent.__vccOpts || resolvedComponent)[guardType];
4978
- return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
4979
- }));
4980
- }
4981
- }
4982
- return guards;
4983
- }
4984
- function useLink(props) {
4985
- const router = inject(routerKey);
4986
- const currentRoute = inject(routeLocationKey);
4987
- const route = computed(() => {
4988
- const to = unref(props.to);
4989
- return router.resolve(to);
4990
- });
4991
- const activeRecordIndex = computed(() => {
4992
- const { matched } = route.value;
4993
- const { length } = matched;
4994
- const routeMatched = matched[length - 1];
4995
- const currentMatched = currentRoute.matched;
4996
- if (!routeMatched || !currentMatched.length) return -1;
4997
- const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
4998
- if (index > -1) return index;
4999
- const parentRecordPath = getOriginalPath(matched[length - 2]);
5000
- return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index;
5001
- });
5002
- const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
5003
- const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
5004
- function navigate(e = {}) {
5005
- if (guardEvent(e)) {
5006
- const p = router[unref(props.replace) ? "replace" : "push"](unref(props.to)).catch(noop);
5007
- if (props.viewTransition && typeof document !== "undefined" && "startViewTransition" in document) document.startViewTransition(() => p);
5008
- return p;
5009
- }
5010
- return Promise.resolve();
5011
- }
5012
- return {
5013
- route,
5014
- href: computed(() => route.value.href),
5015
- isActive,
5016
- isExactActive,
5017
- navigate
5018
- };
5019
- }
5020
- function preferSingleVNode(vnodes) {
5021
- return vnodes.length === 1 ? vnodes[0] : vnodes;
5022
- }
5023
- var RouterLink = /* @__PURE__ */ defineComponent({
5024
- name: "RouterLink",
5025
- compatConfig: { MODE: 3 },
5026
- props: {
5027
- to: {
5028
- type: [String, Object],
5029
- required: true
5030
- },
5031
- replace: Boolean,
5032
- activeClass: String,
5033
- exactActiveClass: String,
5034
- custom: Boolean,
5035
- ariaCurrentValue: {
5036
- type: String,
5037
- default: "page"
5038
- }
5039
- },
5040
- useLink,
5041
- setup(props, { slots }) {
5042
- const link = reactive(useLink(props));
5043
- const { options } = inject(routerKey);
5044
- const elClass = computed(() => ({
5045
- [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
5046
- [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
5047
- }));
5048
- return () => {
5049
- const children = slots.default && preferSingleVNode(slots.default(link));
5050
- return props.custom ? children : h("a", {
5051
- "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
5052
- href: link.href,
5053
- onClick: link.navigate,
5054
- class: elClass.value
5055
- }, children);
5056
- };
5057
- }
5058
- });
5059
- function guardEvent(e) {
5060
- if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
5061
- if (e.defaultPrevented) return;
5062
- if (e.button !== void 0 && e.button !== 0) return;
5063
- if (e.currentTarget && e.currentTarget.getAttribute) {
5064
- const target = e.currentTarget.getAttribute("target");
5065
- if (/\b_blank\b/i.test(target)) return;
5066
- }
5067
- if (e.preventDefault) e.preventDefault();
5068
- return true;
5069
- }
5070
- function includesParams(outer, inner) {
5071
- for (const key in inner) {
5072
- const innerValue = inner[key];
5073
- const outerValue = outer[key];
5074
- if (typeof innerValue === "string") {
5075
- if (innerValue !== outerValue) return false;
5076
- } else if (!isArray$3(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i$1) => value !== outerValue[i$1])) return false;
5077
- }
5078
- return true;
5079
- }
5080
- function getOriginalPath(record) {
5081
- return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
5082
- }
5083
- var getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
5084
- var RouterViewImpl = /* @__PURE__ */ defineComponent({
5085
- name: "RouterView",
5086
- inheritAttrs: false,
5087
- props: {
5088
- name: {
5089
- type: String,
5090
- default: "default"
5091
- },
5092
- route: Object
5093
- },
5094
- compatConfig: { MODE: 3 },
5095
- setup(props, { attrs, slots }) {
5096
- const injectedRoute = inject(routerViewLocationKey);
5097
- const routeToDisplay = computed(() => props.route || injectedRoute.value);
5098
- const injectedDepth = inject(viewDepthKey, 0);
5099
- const depth = computed(() => {
5100
- let initialDepth = unref(injectedDepth);
5101
- const { matched } = routeToDisplay.value;
5102
- let matchedRoute;
5103
- while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) initialDepth++;
5104
- return initialDepth;
5105
- });
5106
- const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
5107
- provide(viewDepthKey, computed(() => depth.value + 1));
5108
- provide(matchedRouteKey, matchedRouteRef);
5109
- provide(routerViewLocationKey, routeToDisplay);
5110
- const viewRef = ref();
5111
- watch(() => [
5112
- viewRef.value,
5113
- matchedRouteRef.value,
5114
- props.name
5115
- ], ([instance, to, name], [oldInstance, from, oldName]) => {
5116
- if (to) {
5117
- to.instances[name] = instance;
5118
- if (from && from !== to && instance && instance === oldInstance) {
5119
- if (!to.leaveGuards.size) to.leaveGuards = from.leaveGuards;
5120
- if (!to.updateGuards.size) to.updateGuards = from.updateGuards;
5121
- }
5122
- }
5123
- if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance)) (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
5124
- }, { flush: "post" });
5125
- return () => {
5126
- const route = routeToDisplay.value;
5127
- const currentName = props.name;
5128
- const matchedRoute = matchedRouteRef.value;
5129
- const ViewComponent = matchedRoute && matchedRoute.components[currentName];
5130
- if (!ViewComponent) return normalizeSlot(slots.default, {
5131
- Component: ViewComponent,
5132
- route
5133
- });
5134
- const routePropsOption = matchedRoute.props[currentName];
5135
- const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
5136
- const onVnodeUnmounted = (vnode) => {
5137
- if (vnode.component.isUnmounted) matchedRoute.instances[currentName] = null;
5138
- };
5139
- const component = h(ViewComponent, assign({}, routeProps, attrs, {
5140
- onVnodeUnmounted,
5141
- ref: viewRef
5142
- }));
5143
- return normalizeSlot(slots.default, {
5144
- Component: component,
5145
- route
5146
- }) || component;
5147
- };
5148
- }
5149
- });
5150
- function normalizeSlot(slot, data) {
5151
- if (!slot) return null;
5152
- const slotContent = slot(data);
5153
- return slotContent.length === 1 ? slotContent[0] : slotContent;
5154
- }
5155
- var RouterView = RouterViewImpl;
5156
- function createRouter(options) {
5157
- const matcher = createRouterMatcher(options.routes, options);
5158
- const parseQuery$1 = options.parseQuery || parseQuery;
5159
- const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
5160
- const routerHistory = options.history;
5161
- const beforeGuards = useCallbacks();
5162
- const beforeResolveGuards = useCallbacks();
5163
- const afterGuards = useCallbacks();
5164
- const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
5165
- let pendingLocation = START_LOCATION_NORMALIZED;
5166
- if (isBrowser && options.scrollBehavior && "scrollRestoration" in history) history.scrollRestoration = "manual";
5167
- const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
5168
- const encodeParams = applyToParams.bind(null, encodeParam);
5169
- const decodeParams = applyToParams.bind(null, decode);
5170
- function addRoute(parentOrRoute, route) {
5171
- let parent;
5172
- let record;
5173
- if (isRouteName(parentOrRoute)) {
5174
- parent = matcher.getRecordMatcher(parentOrRoute);
5175
- record = route;
5176
- } else record = parentOrRoute;
5177
- return matcher.addRoute(record, parent);
5178
- }
5179
- function removeRoute(name) {
5180
- const recordMatcher = matcher.getRecordMatcher(name);
5181
- if (recordMatcher) matcher.removeRoute(recordMatcher);
5182
- }
5183
- function getRoutes() {
5184
- return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
5185
- }
5186
- function hasRoute(name) {
5187
- return !!matcher.getRecordMatcher(name);
5188
- }
5189
- function resolve(rawLocation, currentLocation) {
5190
- currentLocation = assign({}, currentLocation || currentRoute.value);
5191
- if (typeof rawLocation === "string") {
5192
- const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
5193
- const matchedRoute$1 = matcher.resolve({ path: locationNormalized.path }, currentLocation);
5194
- const href$1 = routerHistory.createHref(locationNormalized.fullPath);
5195
- return assign(locationNormalized, matchedRoute$1, {
5196
- params: decodeParams(matchedRoute$1.params),
5197
- hash: decode(locationNormalized.hash),
5198
- redirectedFrom: void 0,
5199
- href: href$1
5200
- });
5201
- }
5202
- let matcherLocation;
5203
- if (rawLocation.path != null) matcherLocation = assign({}, rawLocation, { path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path });
5204
- else {
5205
- const targetParams = assign({}, rawLocation.params);
5206
- for (const key in targetParams) if (targetParams[key] == null) delete targetParams[key];
5207
- matcherLocation = assign({}, rawLocation, { params: encodeParams(targetParams) });
5208
- currentLocation.params = encodeParams(currentLocation.params);
5209
- }
5210
- const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
5211
- const hash = rawLocation.hash || "";
5212
- matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
5213
- const fullPath = stringifyURL(stringifyQuery$1, assign({}, rawLocation, {
5214
- hash: encodeHash(hash),
5215
- path: matchedRoute.path
5216
- }));
5217
- const href = routerHistory.createHref(fullPath);
5218
- return assign({
5219
- fullPath,
5220
- hash,
5221
- query: stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
5222
- }, matchedRoute, {
5223
- redirectedFrom: void 0,
5224
- href
5225
- });
5226
- }
5227
- function locationAsObject(to) {
5228
- return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign({}, to);
5229
- }
5230
- function checkCanceledNavigation(to, from) {
5231
- if (pendingLocation !== to) return createRouterError(8, {
5232
- from,
5233
- to
5234
- });
5235
- }
5236
- function push(to) {
5237
- return pushWithRedirect(to);
5238
- }
5239
- function replace(to) {
5240
- return push(assign(locationAsObject(to), { replace: true }));
5241
- }
5242
- function handleRedirectRecord(to) {
5243
- const lastMatched = to.matched[to.matched.length - 1];
5244
- if (lastMatched && lastMatched.redirect) {
5245
- const { redirect } = lastMatched;
5246
- let newTargetLocation = typeof redirect === "function" ? redirect(to) : redirect;
5247
- if (typeof newTargetLocation === "string") {
5248
- newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : { path: newTargetLocation };
5249
- newTargetLocation.params = {};
5250
- }
5251
- return assign({
5252
- query: to.query,
5253
- hash: to.hash,
5254
- params: newTargetLocation.path != null ? {} : to.params
5255
- }, newTargetLocation);
5256
- }
5257
- }
5258
- function pushWithRedirect(to, redirectedFrom) {
5259
- const targetLocation = pendingLocation = resolve(to);
5260
- const from = currentRoute.value;
5261
- const data = to.state;
5262
- const force = to.force;
5263
- const replace$1 = to.replace === true;
5264
- const shouldRedirect = handleRedirectRecord(targetLocation);
5265
- if (shouldRedirect) return pushWithRedirect(assign(locationAsObject(shouldRedirect), {
5266
- state: typeof shouldRedirect === "object" ? assign({}, data, shouldRedirect.state) : data,
5267
- force,
5268
- replace: replace$1
5269
- }), redirectedFrom || targetLocation);
5270
- const toLocation = targetLocation;
5271
- toLocation.redirectedFrom = redirectedFrom;
5272
- let failure;
5273
- if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
5274
- failure = createRouterError(16, {
5275
- to: toLocation,
5276
- from
5277
- });
5278
- handleScroll(from, from, true, false);
5279
- }
5280
- return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, 2) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure$1) => {
5281
- if (failure$1) {
5282
- if (isNavigationFailure(failure$1, 2)) return pushWithRedirect(assign({ replace: replace$1 }, locationAsObject(failure$1.to), {
5283
- state: typeof failure$1.to === "object" ? assign({}, data, failure$1.to.state) : data,
5284
- force
5285
- }), redirectedFrom || toLocation);
5286
- } else failure$1 = finalizeNavigation(toLocation, from, true, replace$1, data);
5287
- triggerAfterEach(toLocation, from, failure$1);
5288
- return failure$1;
5289
- });
5290
- }
5291
- function checkCanceledNavigationAndReject(to, from) {
5292
- const error = checkCanceledNavigation(to, from);
5293
- return error ? Promise.reject(error) : Promise.resolve();
5294
- }
5295
- function runWithContext(fn) {
5296
- const app = installedApps.values().next().value;
5297
- return app && typeof app.runWithContext === "function" ? app.runWithContext(fn) : fn();
5298
- }
5299
- function navigate(to, from) {
5300
- let guards;
5301
- const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
5302
- guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
5303
- for (const record of leavingRecords) record.leaveGuards.forEach((guard) => {
5304
- guards.push(guardToPromiseFn(guard, to, from));
5305
- });
5306
- const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
5307
- guards.push(canceledNavigationCheck);
5308
- return runGuardQueue(guards).then(() => {
5309
- guards = [];
5310
- for (const guard of beforeGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
5311
- guards.push(canceledNavigationCheck);
5312
- return runGuardQueue(guards);
5313
- }).then(() => {
5314
- guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
5315
- for (const record of updatingRecords) record.updateGuards.forEach((guard) => {
5316
- guards.push(guardToPromiseFn(guard, to, from));
5317
- });
5318
- guards.push(canceledNavigationCheck);
5319
- return runGuardQueue(guards);
5320
- }).then(() => {
5321
- guards = [];
5322
- for (const record of enteringRecords) if (record.beforeEnter) if (isArray$3(record.beforeEnter)) for (const beforeEnter of record.beforeEnter) guards.push(guardToPromiseFn(beforeEnter, to, from));
5323
- else guards.push(guardToPromiseFn(record.beforeEnter, to, from));
5324
- guards.push(canceledNavigationCheck);
5325
- return runGuardQueue(guards);
5326
- }).then(() => {
5327
- to.matched.forEach((record) => record.enterCallbacks = {});
5328
- guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
5329
- guards.push(canceledNavigationCheck);
5330
- return runGuardQueue(guards);
5331
- }).then(() => {
5332
- guards = [];
5333
- for (const guard of beforeResolveGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
5334
- guards.push(canceledNavigationCheck);
5335
- return runGuardQueue(guards);
5336
- }).catch((err) => isNavigationFailure(err, 8) ? err : Promise.reject(err));
5337
- }
5338
- function triggerAfterEach(to, from, failure) {
5339
- afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
5340
- }
5341
- function finalizeNavigation(toLocation, from, isPush, replace$1, data) {
5342
- const error = checkCanceledNavigation(toLocation, from);
5343
- if (error) return error;
5344
- const isFirstNavigation = from === START_LOCATION_NORMALIZED;
5345
- const state = !isBrowser ? {} : history.state;
5346
- if (isPush) if (replace$1 || isFirstNavigation) routerHistory.replace(toLocation.fullPath, assign({ scroll: isFirstNavigation && state && state.scroll }, data));
5347
- else routerHistory.push(toLocation.fullPath, data);
5348
- currentRoute.value = toLocation;
5349
- handleScroll(toLocation, from, isPush, isFirstNavigation);
5350
- markAsReady();
5351
- }
5352
- let removeHistoryListener;
5353
- function setupListeners() {
5354
- if (removeHistoryListener) return;
5355
- removeHistoryListener = routerHistory.listen((to, _from, info) => {
5356
- if (!router.listening) return;
5357
- const toLocation = resolve(to);
5358
- const shouldRedirect = handleRedirectRecord(toLocation);
5359
- if (shouldRedirect) {
5360
- pushWithRedirect(assign(shouldRedirect, {
5361
- replace: true,
5362
- force: true
5363
- }), toLocation).catch(noop);
5364
- return;
5365
- }
5366
- pendingLocation = toLocation;
5367
- const from = currentRoute.value;
5368
- if (isBrowser) saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
5369
- navigate(toLocation, from).catch((error) => {
5370
- if (isNavigationFailure(error, 12)) return error;
5371
- if (isNavigationFailure(error, 2)) {
5372
- pushWithRedirect(assign(locationAsObject(error.to), { force: true }), toLocation).then((failure) => {
5373
- if (isNavigationFailure(failure, 20) && !info.delta && info.type === NavigationType.pop) routerHistory.go(-1, false);
5374
- }).catch(noop);
5375
- return Promise.reject();
5376
- }
5377
- if (info.delta) routerHistory.go(-info.delta, false);
5378
- return triggerError(error, toLocation, from);
5379
- }).then((failure) => {
5380
- failure = failure || finalizeNavigation(toLocation, from, false);
5381
- if (failure) {
5382
- if (info.delta && !isNavigationFailure(failure, 8)) routerHistory.go(-info.delta, false);
5383
- else if (info.type === NavigationType.pop && isNavigationFailure(failure, 20)) routerHistory.go(-1, false);
5384
- }
5385
- triggerAfterEach(toLocation, from, failure);
5386
- }).catch(noop);
5387
- });
5388
- }
5389
- let readyHandlers = useCallbacks();
5390
- let errorListeners = useCallbacks();
5391
- let ready;
5392
- function triggerError(error, to, from) {
5393
- markAsReady(error);
5394
- const list = errorListeners.list();
5395
- if (list.length) list.forEach((handler) => handler(error, to, from));
5396
- else console.error(error);
5397
- return Promise.reject(error);
5398
- }
5399
- function isReady() {
5400
- if (ready && currentRoute.value !== START_LOCATION_NORMALIZED) return Promise.resolve();
5401
- return new Promise((resolve$1, reject) => {
5402
- readyHandlers.add([resolve$1, reject]);
5403
- });
5404
- }
5405
- function markAsReady(err) {
5406
- if (!ready) {
5407
- ready = !err;
5408
- setupListeners();
5409
- readyHandlers.list().forEach(([resolve$1, reject]) => err ? reject(err) : resolve$1());
5410
- readyHandlers.reset();
5411
- }
5412
- return err;
5413
- }
5414
- function handleScroll(to, from, isPush, isFirstNavigation) {
5415
- const { scrollBehavior } = options;
5416
- if (!isBrowser || !scrollBehavior) return Promise.resolve();
5417
- const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
5418
- return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
5419
- }
5420
- const go = (delta) => routerHistory.go(delta);
5421
- let started;
5422
- const installedApps = /* @__PURE__ */ new Set();
5423
- const router = {
5424
- currentRoute,
5425
- listening: true,
5426
- addRoute,
5427
- removeRoute,
5428
- clearRoutes: matcher.clearRoutes,
5429
- hasRoute,
5430
- getRoutes,
5431
- resolve,
5432
- options,
5433
- push,
5434
- replace,
5435
- go,
5436
- back: () => go(-1),
5437
- forward: () => go(1),
5438
- beforeEach: beforeGuards.add,
5439
- beforeResolve: beforeResolveGuards.add,
5440
- afterEach: afterGuards.add,
5441
- onError: errorListeners.add,
5442
- isReady,
5443
- install(app) {
5444
- const router$1 = this;
5445
- app.component("RouterLink", RouterLink);
5446
- app.component("RouterView", RouterView);
5447
- app.config.globalProperties.$router = router$1;
5448
- Object.defineProperty(app.config.globalProperties, "$route", {
5449
- enumerable: true,
5450
- get: () => unref(currentRoute)
5451
- });
5452
- if (isBrowser && !started && currentRoute.value === START_LOCATION_NORMALIZED) {
5453
- started = true;
5454
- push(routerHistory.location).catch((err) => {});
5455
- }
5456
- const reactiveRoute = {};
5457
- for (const key in START_LOCATION_NORMALIZED) Object.defineProperty(reactiveRoute, key, {
5458
- get: () => currentRoute.value[key],
5459
- enumerable: true
5460
- });
5461
- app.provide(routerKey, router$1);
5462
- app.provide(routeLocationKey, shallowReactive(reactiveRoute));
5463
- app.provide(routerViewLocationKey, currentRoute);
5464
- const unmountApp = app.unmount;
5465
- installedApps.add(app);
5466
- app.unmount = function() {
5467
- installedApps.delete(app);
5468
- if (installedApps.size < 1) {
5469
- pendingLocation = START_LOCATION_NORMALIZED;
5470
- removeHistoryListener && removeHistoryListener();
5471
- removeHistoryListener = null;
5472
- currentRoute.value = START_LOCATION_NORMALIZED;
5473
- started = false;
5474
- ready = false;
5475
- }
5476
- unmountApp();
5477
- };
5478
- }
5479
- };
5480
- function runGuardQueue(guards) {
5481
- return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
5482
- }
5483
- return router;
5484
- }
5485
- function extractChangingRecords(to, from) {
5486
- const leavingRecords = [];
5487
- const updatingRecords = [];
5488
- const enteringRecords = [];
5489
- const len = Math.max(from.matched.length, to.matched.length);
5490
- for (let i$1 = 0; i$1 < len; i$1++) {
5491
- const recordFrom = from.matched[i$1];
5492
- if (recordFrom) if (to.matched.find((record) => isSameRouteRecord(record, recordFrom))) updatingRecords.push(recordFrom);
5493
- else leavingRecords.push(recordFrom);
5494
- const recordTo = to.matched[i$1];
5495
- if (recordTo) {
5496
- if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) enteringRecords.push(recordTo);
5497
- }
5498
- }
5499
- return [
5500
- leavingRecords,
5501
- updatingRecords,
5502
- enteringRecords
5503
- ];
5504
- }
5505
- function useRouter() {
5506
- return inject(routerKey);
5507
- }
5508
- function useRoute(_name) {
5509
- return inject(routeLocationKey);
5510
- }
5511
4040
  var require_default$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
5512
4041
  function getDefaultWhiteList$1() {
5513
4042
  var whiteList = {};
@@ -5848,798 +4377,2269 @@ var require_default$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
5848
4377
  whiteList["z-index"] = false;
5849
4378
  return whiteList;
5850
4379
  }
5851
- function onAttr(name, value, options) {}
5852
- function onIgnoreAttr(name, value, options) {}
5853
- var REGEXP_URL_JAVASCRIPT = /javascript\s*\:/gim;
5854
- function safeAttrValue$1(name, value) {
5855
- if (REGEXP_URL_JAVASCRIPT.test(value)) return "";
5856
- return value;
4380
+ function onAttr(name, value, options) {}
4381
+ function onIgnoreAttr(name, value, options) {}
4382
+ var REGEXP_URL_JAVASCRIPT = /javascript\s*\:/gim;
4383
+ function safeAttrValue$1(name, value) {
4384
+ if (REGEXP_URL_JAVASCRIPT.test(value)) return "";
4385
+ return value;
4386
+ }
4387
+ exports.whiteList = getDefaultWhiteList$1();
4388
+ exports.getDefaultWhiteList = getDefaultWhiteList$1;
4389
+ exports.onAttr = onAttr;
4390
+ exports.onIgnoreAttr = onIgnoreAttr;
4391
+ exports.safeAttrValue = safeAttrValue$1;
4392
+ }));
4393
+ var require_util$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4394
+ module.exports = {
4395
+ indexOf: function(arr, item) {
4396
+ var i$1, j;
4397
+ if (Array.prototype.indexOf) return arr.indexOf(item);
4398
+ for (i$1 = 0, j = arr.length; i$1 < j; i$1++) if (arr[i$1] === item) return i$1;
4399
+ return -1;
4400
+ },
4401
+ forEach: function(arr, fn, scope) {
4402
+ var i$1, j;
4403
+ if (Array.prototype.forEach) return arr.forEach(fn, scope);
4404
+ for (i$1 = 0, j = arr.length; i$1 < j; i$1++) fn.call(scope, arr[i$1], i$1, arr);
4405
+ },
4406
+ trim: function(str) {
4407
+ if (String.prototype.trim) return str.trim();
4408
+ return str.replace(/(^\s*)|(\s*$)/g, "");
4409
+ },
4410
+ trimRight: function(str) {
4411
+ if (String.prototype.trimRight) return str.trimRight();
4412
+ return str.replace(/(\s*$)/g, "");
4413
+ }
4414
+ };
4415
+ }));
4416
+ var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4417
+ var _$3 = require_util$1();
4418
+ function parseStyle$1(css, onAttr$1) {
4419
+ css = _$3.trimRight(css);
4420
+ if (css[css.length - 1] !== ";") css += ";";
4421
+ var cssLength = css.length;
4422
+ var isParenthesisOpen = false;
4423
+ var lastPos = 0;
4424
+ var i$1 = 0;
4425
+ var retCSS = "";
4426
+ function addNewAttr() {
4427
+ if (!isParenthesisOpen) {
4428
+ var source = _$3.trim(css.slice(lastPos, i$1));
4429
+ var j$1 = source.indexOf(":");
4430
+ if (j$1 !== -1) {
4431
+ var name = _$3.trim(source.slice(0, j$1));
4432
+ var value = _$3.trim(source.slice(j$1 + 1));
4433
+ if (name) {
4434
+ var ret = onAttr$1(lastPos, retCSS.length, name, value, source);
4435
+ if (ret) retCSS += ret + "; ";
4436
+ }
4437
+ }
4438
+ }
4439
+ lastPos = i$1 + 1;
4440
+ }
4441
+ for (; i$1 < cssLength; i$1++) {
4442
+ var c = css[i$1];
4443
+ if (c === "/" && css[i$1 + 1] === "*") {
4444
+ var j = css.indexOf("*/", i$1 + 2);
4445
+ if (j === -1) break;
4446
+ i$1 = j + 1;
4447
+ lastPos = i$1 + 1;
4448
+ isParenthesisOpen = false;
4449
+ } else if (c === "(") isParenthesisOpen = true;
4450
+ else if (c === ")") isParenthesisOpen = false;
4451
+ else if (c === ";") if (isParenthesisOpen) {} else addNewAttr();
4452
+ else if (c === "\n") addNewAttr();
4453
+ }
4454
+ return _$3.trim(retCSS);
4455
+ }
4456
+ module.exports = parseStyle$1;
4457
+ }));
4458
+ var require_css = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4459
+ var DEFAULT$3 = require_default$1();
4460
+ var parseStyle = require_parser$1();
4461
+ require_util$1();
4462
+ function isNull$1(obj) {
4463
+ return obj === void 0 || obj === null;
4464
+ }
4465
+ function shallowCopyObject$1(obj) {
4466
+ var ret = {};
4467
+ for (var i$1 in obj) ret[i$1] = obj[i$1];
4468
+ return ret;
4469
+ }
4470
+ function FilterCSS$3(options) {
4471
+ options = shallowCopyObject$1(options || {});
4472
+ options.whiteList = options.whiteList || DEFAULT$3.whiteList;
4473
+ options.onAttr = options.onAttr || DEFAULT$3.onAttr;
4474
+ options.onIgnoreAttr = options.onIgnoreAttr || DEFAULT$3.onIgnoreAttr;
4475
+ options.safeAttrValue = options.safeAttrValue || DEFAULT$3.safeAttrValue;
4476
+ this.options = options;
4477
+ }
4478
+ FilterCSS$3.prototype.process = function(css) {
4479
+ css = css || "";
4480
+ css = css.toString();
4481
+ if (!css) return "";
4482
+ var options = this.options;
4483
+ var whiteList = options.whiteList;
4484
+ var onAttr$1 = options.onAttr;
4485
+ var onIgnoreAttr$1 = options.onIgnoreAttr;
4486
+ var safeAttrValue$2 = options.safeAttrValue;
4487
+ return parseStyle(css, function(sourcePosition, position, name, value, source) {
4488
+ var check = whiteList[name];
4489
+ var isWhite = false;
4490
+ if (check === true) isWhite = check;
4491
+ else if (typeof check === "function") isWhite = check(value);
4492
+ else if (check instanceof RegExp) isWhite = check.test(value);
4493
+ if (isWhite !== true) isWhite = false;
4494
+ value = safeAttrValue$2(name, value);
4495
+ if (!value) return;
4496
+ var opts = {
4497
+ position,
4498
+ sourcePosition,
4499
+ source,
4500
+ isWhite
4501
+ };
4502
+ if (isWhite) {
4503
+ var ret = onAttr$1(name, value, opts);
4504
+ if (isNull$1(ret)) return name + ":" + value;
4505
+ else return ret;
4506
+ } else {
4507
+ var ret = onIgnoreAttr$1(name, value, opts);
4508
+ if (!isNull$1(ret)) return ret;
4509
+ }
4510
+ });
4511
+ };
4512
+ module.exports = FilterCSS$3;
4513
+ }));
4514
+ var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4515
+ var DEFAULT$2 = require_default$1();
4516
+ var FilterCSS$2 = require_css();
4517
+ function filterCSS(html, options) {
4518
+ return new FilterCSS$2(options).process(html);
4519
+ }
4520
+ exports = module.exports = filterCSS;
4521
+ exports.FilterCSS = FilterCSS$2;
4522
+ for (var i in DEFAULT$2) exports[i] = DEFAULT$2[i];
4523
+ if (typeof window !== "undefined") window.filterCSS = module.exports;
4524
+ }));
4525
+ var require_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4526
+ module.exports = {
4527
+ indexOf: function(arr, item) {
4528
+ var i$1, j;
4529
+ if (Array.prototype.indexOf) return arr.indexOf(item);
4530
+ for (i$1 = 0, j = arr.length; i$1 < j; i$1++) if (arr[i$1] === item) return i$1;
4531
+ return -1;
4532
+ },
4533
+ forEach: function(arr, fn, scope) {
4534
+ var i$1, j;
4535
+ if (Array.prototype.forEach) return arr.forEach(fn, scope);
4536
+ for (i$1 = 0, j = arr.length; i$1 < j; i$1++) fn.call(scope, arr[i$1], i$1, arr);
4537
+ },
4538
+ trim: function(str) {
4539
+ if (String.prototype.trim) return str.trim();
4540
+ return str.replace(/(^\s*)|(\s*$)/g, "");
4541
+ },
4542
+ spaceIndex: function(str) {
4543
+ var match = /\s|\n|\t/.exec(str);
4544
+ return match ? match.index : -1;
4545
+ }
4546
+ };
4547
+ }));
4548
+ var require_default = /* @__PURE__ */ __commonJSMin(((exports) => {
4549
+ var FilterCSS$1 = require_lib$1().FilterCSS;
4550
+ var getDefaultCSSWhiteList = require_lib$1().getDefaultWhiteList;
4551
+ var _$2 = require_util();
4552
+ function getDefaultWhiteList() {
4553
+ return {
4554
+ a: [
4555
+ "target",
4556
+ "href",
4557
+ "title"
4558
+ ],
4559
+ abbr: ["title"],
4560
+ address: [],
4561
+ area: [
4562
+ "shape",
4563
+ "coords",
4564
+ "href",
4565
+ "alt"
4566
+ ],
4567
+ article: [],
4568
+ aside: [],
4569
+ audio: [
4570
+ "autoplay",
4571
+ "controls",
4572
+ "crossorigin",
4573
+ "loop",
4574
+ "muted",
4575
+ "preload",
4576
+ "src"
4577
+ ],
4578
+ b: [],
4579
+ bdi: ["dir"],
4580
+ bdo: ["dir"],
4581
+ big: [],
4582
+ blockquote: ["cite"],
4583
+ br: [],
4584
+ caption: [],
4585
+ center: [],
4586
+ cite: [],
4587
+ code: [],
4588
+ col: [
4589
+ "align",
4590
+ "valign",
4591
+ "span",
4592
+ "width"
4593
+ ],
4594
+ colgroup: [
4595
+ "align",
4596
+ "valign",
4597
+ "span",
4598
+ "width"
4599
+ ],
4600
+ dd: [],
4601
+ del: ["datetime"],
4602
+ details: ["open"],
4603
+ div: [],
4604
+ dl: [],
4605
+ dt: [],
4606
+ em: [],
4607
+ figcaption: [],
4608
+ figure: [],
4609
+ font: [
4610
+ "color",
4611
+ "size",
4612
+ "face"
4613
+ ],
4614
+ footer: [],
4615
+ h1: [],
4616
+ h2: [],
4617
+ h3: [],
4618
+ h4: [],
4619
+ h5: [],
4620
+ h6: [],
4621
+ header: [],
4622
+ hr: [],
4623
+ i: [],
4624
+ img: [
4625
+ "src",
4626
+ "alt",
4627
+ "title",
4628
+ "width",
4629
+ "height",
4630
+ "loading"
4631
+ ],
4632
+ ins: ["datetime"],
4633
+ kbd: [],
4634
+ li: [],
4635
+ mark: [],
4636
+ nav: [],
4637
+ ol: [],
4638
+ p: [],
4639
+ pre: [],
4640
+ s: [],
4641
+ section: [],
4642
+ small: [],
4643
+ span: [],
4644
+ sub: [],
4645
+ summary: [],
4646
+ sup: [],
4647
+ strong: [],
4648
+ strike: [],
4649
+ table: [
4650
+ "width",
4651
+ "border",
4652
+ "align",
4653
+ "valign"
4654
+ ],
4655
+ tbody: ["align", "valign"],
4656
+ td: [
4657
+ "width",
4658
+ "rowspan",
4659
+ "colspan",
4660
+ "align",
4661
+ "valign"
4662
+ ],
4663
+ tfoot: ["align", "valign"],
4664
+ th: [
4665
+ "width",
4666
+ "rowspan",
4667
+ "colspan",
4668
+ "align",
4669
+ "valign"
4670
+ ],
4671
+ thead: ["align", "valign"],
4672
+ tr: [
4673
+ "rowspan",
4674
+ "align",
4675
+ "valign"
4676
+ ],
4677
+ tt: [],
4678
+ u: [],
4679
+ ul: [],
4680
+ video: [
4681
+ "autoplay",
4682
+ "controls",
4683
+ "crossorigin",
4684
+ "loop",
4685
+ "muted",
4686
+ "playsinline",
4687
+ "poster",
4688
+ "preload",
4689
+ "src",
4690
+ "height",
4691
+ "width"
4692
+ ]
4693
+ };
4694
+ }
4695
+ var defaultCSSFilter = new FilterCSS$1();
4696
+ function onTag(tag, html, options) {}
4697
+ function onIgnoreTag(tag, html, options) {}
4698
+ function onTagAttr(tag, name, value) {}
4699
+ function onIgnoreTagAttr(tag, name, value) {}
4700
+ function escapeHtml(html) {
4701
+ return html.replace(REGEXP_LT, "&lt;").replace(REGEXP_GT, "&gt;");
4702
+ }
4703
+ function safeAttrValue(tag, name, value, cssFilter) {
4704
+ value = friendlyAttrValue(value);
4705
+ if (name === "href" || name === "src") {
4706
+ value = _$2.trim(value);
4707
+ if (value === "#") return "#";
4708
+ if (!(value.substr(0, 7) === "http://" || value.substr(0, 8) === "https://" || value.substr(0, 7) === "mailto:" || value.substr(0, 4) === "tel:" || value.substr(0, 11) === "data:image/" || value.substr(0, 6) === "ftp://" || value.substr(0, 2) === "./" || value.substr(0, 3) === "../" || value[0] === "#" || value[0] === "/")) return "";
4709
+ } else if (name === "background") {
4710
+ REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
4711
+ if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) return "";
4712
+ } else if (name === "style") {
4713
+ REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex = 0;
4714
+ if (REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)) return "";
4715
+ REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex = 0;
4716
+ if (REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)) {
4717
+ REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
4718
+ if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) return "";
4719
+ }
4720
+ if (cssFilter !== false) {
4721
+ cssFilter = cssFilter || defaultCSSFilter;
4722
+ value = cssFilter.process(value);
4723
+ }
4724
+ }
4725
+ value = escapeAttrValue(value);
4726
+ return value;
4727
+ }
4728
+ var REGEXP_LT = /</g;
4729
+ var REGEXP_GT = />/g;
4730
+ var REGEXP_QUOTE = /"/g;
4731
+ var REGEXP_QUOTE_2 = /&quot;/g;
4732
+ var REGEXP_ATTR_VALUE_1 = /&#([a-zA-Z0-9]*);?/gim;
4733
+ var REGEXP_ATTR_VALUE_COLON = /&colon;?/gim;
4734
+ var REGEXP_ATTR_VALUE_NEWLINE = /&newline;?/gim;
4735
+ var REGEXP_DEFAULT_ON_TAG_ATTR_4 = /((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi;
4736
+ var REGEXP_DEFAULT_ON_TAG_ATTR_7 = /e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi;
4737
+ var REGEXP_DEFAULT_ON_TAG_ATTR_8 = /u\s*r\s*l\s*\(.*/gi;
4738
+ function escapeQuote(str) {
4739
+ return str.replace(REGEXP_QUOTE, "&quot;");
4740
+ }
4741
+ function unescapeQuote(str) {
4742
+ return str.replace(REGEXP_QUOTE_2, "\"");
4743
+ }
4744
+ function escapeHtmlEntities(str) {
4745
+ return str.replace(REGEXP_ATTR_VALUE_1, function replaceUnicode(str$1, code) {
4746
+ return code[0] === "x" || code[0] === "X" ? String.fromCharCode(parseInt(code.substr(1), 16)) : String.fromCharCode(parseInt(code, 10));
4747
+ });
4748
+ }
4749
+ function escapeDangerHtml5Entities(str) {
4750
+ return str.replace(REGEXP_ATTR_VALUE_COLON, ":").replace(REGEXP_ATTR_VALUE_NEWLINE, " ");
4751
+ }
4752
+ function clearNonPrintableCharacter(str) {
4753
+ var str2 = "";
4754
+ for (var i$1 = 0, len = str.length; i$1 < len; i$1++) str2 += str.charCodeAt(i$1) < 32 ? " " : str.charAt(i$1);
4755
+ return _$2.trim(str2);
4756
+ }
4757
+ function friendlyAttrValue(str) {
4758
+ str = unescapeQuote(str);
4759
+ str = escapeHtmlEntities(str);
4760
+ str = escapeDangerHtml5Entities(str);
4761
+ str = clearNonPrintableCharacter(str);
4762
+ return str;
4763
+ }
4764
+ function escapeAttrValue(str) {
4765
+ str = escapeQuote(str);
4766
+ str = escapeHtml(str);
4767
+ return str;
4768
+ }
4769
+ function onIgnoreTagStripAll() {
4770
+ return "";
4771
+ }
4772
+ function StripTagBody(tags, next) {
4773
+ if (typeof next !== "function") next = function() {};
4774
+ var isRemoveAllTag = !Array.isArray(tags);
4775
+ function isRemoveTag(tag) {
4776
+ if (isRemoveAllTag) return true;
4777
+ return _$2.indexOf(tags, tag) !== -1;
4778
+ }
4779
+ var removeList = [];
4780
+ var posStart = false;
4781
+ return {
4782
+ onIgnoreTag: function(tag, html, options) {
4783
+ if (isRemoveTag(tag)) if (options.isClosing) {
4784
+ var ret = "[/removed]";
4785
+ var end = options.position + ret.length;
4786
+ removeList.push([posStart !== false ? posStart : options.position, end]);
4787
+ posStart = false;
4788
+ return ret;
4789
+ } else {
4790
+ if (!posStart) posStart = options.position;
4791
+ return "[removed]";
4792
+ }
4793
+ else return next(tag, html, options);
4794
+ },
4795
+ remove: function(html) {
4796
+ var rethtml = "";
4797
+ var lastPos = 0;
4798
+ _$2.forEach(removeList, function(pos) {
4799
+ rethtml += html.slice(lastPos, pos[0]);
4800
+ lastPos = pos[1];
4801
+ });
4802
+ rethtml += html.slice(lastPos);
4803
+ return rethtml;
4804
+ }
4805
+ };
4806
+ }
4807
+ function stripCommentTag(html) {
4808
+ var retHtml = "";
4809
+ var lastPos = 0;
4810
+ while (lastPos < html.length) {
4811
+ var i$1 = html.indexOf("<!--", lastPos);
4812
+ if (i$1 === -1) {
4813
+ retHtml += html.slice(lastPos);
4814
+ break;
4815
+ }
4816
+ retHtml += html.slice(lastPos, i$1);
4817
+ var j = html.indexOf("-->", i$1);
4818
+ if (j === -1) break;
4819
+ lastPos = j + 3;
4820
+ }
4821
+ return retHtml;
4822
+ }
4823
+ function stripBlankChar(html) {
4824
+ var chars = html.split("");
4825
+ chars = chars.filter(function(char) {
4826
+ var c = char.charCodeAt(0);
4827
+ if (c === 127) return false;
4828
+ if (c <= 31) {
4829
+ if (c === 10 || c === 13) return true;
4830
+ return false;
4831
+ }
4832
+ return true;
4833
+ });
4834
+ return chars.join("");
4835
+ }
4836
+ exports.whiteList = getDefaultWhiteList();
4837
+ exports.getDefaultWhiteList = getDefaultWhiteList;
4838
+ exports.onTag = onTag;
4839
+ exports.onIgnoreTag = onIgnoreTag;
4840
+ exports.onTagAttr = onTagAttr;
4841
+ exports.onIgnoreTagAttr = onIgnoreTagAttr;
4842
+ exports.safeAttrValue = safeAttrValue;
4843
+ exports.escapeHtml = escapeHtml;
4844
+ exports.escapeQuote = escapeQuote;
4845
+ exports.unescapeQuote = unescapeQuote;
4846
+ exports.escapeHtmlEntities = escapeHtmlEntities;
4847
+ exports.escapeDangerHtml5Entities = escapeDangerHtml5Entities;
4848
+ exports.clearNonPrintableCharacter = clearNonPrintableCharacter;
4849
+ exports.friendlyAttrValue = friendlyAttrValue;
4850
+ exports.escapeAttrValue = escapeAttrValue;
4851
+ exports.onIgnoreTagStripAll = onIgnoreTagStripAll;
4852
+ exports.StripTagBody = StripTagBody;
4853
+ exports.stripCommentTag = stripCommentTag;
4854
+ exports.stripBlankChar = stripBlankChar;
4855
+ exports.attributeWrapSign = "\"";
4856
+ exports.cssFilter = defaultCSSFilter;
4857
+ exports.getDefaultCSSWhiteList = getDefaultCSSWhiteList;
4858
+ }));
4859
+ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
4860
+ var _$1 = require_util();
4861
+ function getTagName(html) {
4862
+ var i$1 = _$1.spaceIndex(html);
4863
+ var tagName;
4864
+ if (i$1 === -1) tagName = html.slice(1, -1);
4865
+ else tagName = html.slice(1, i$1 + 1);
4866
+ tagName = _$1.trim(tagName).toLowerCase();
4867
+ if (tagName.slice(0, 1) === "/") tagName = tagName.slice(1);
4868
+ if (tagName.slice(-1) === "/") tagName = tagName.slice(0, -1);
4869
+ return tagName;
4870
+ }
4871
+ function isClosing(html) {
4872
+ return html.slice(0, 2) === "</";
4873
+ }
4874
+ function parseTag$1(html, onTag$1, escapeHtml$1) {
4875
+ var rethtml = "";
4876
+ var lastPos = 0;
4877
+ var tagStart = false;
4878
+ var quoteStart = false;
4879
+ var currentPos = 0;
4880
+ var len = html.length;
4881
+ var currentTagName = "";
4882
+ var currentHtml = "";
4883
+ chariterator: for (currentPos = 0; currentPos < len; currentPos++) {
4884
+ var c = html.charAt(currentPos);
4885
+ if (tagStart === false) {
4886
+ if (c === "<") {
4887
+ tagStart = currentPos;
4888
+ continue;
4889
+ }
4890
+ } else if (quoteStart === false) {
4891
+ if (c === "<") {
4892
+ rethtml += escapeHtml$1(html.slice(lastPos, currentPos));
4893
+ tagStart = currentPos;
4894
+ lastPos = currentPos;
4895
+ continue;
4896
+ }
4897
+ if (c === ">" || currentPos === len - 1) {
4898
+ rethtml += escapeHtml$1(html.slice(lastPos, tagStart));
4899
+ currentHtml = html.slice(tagStart, currentPos + 1);
4900
+ currentTagName = getTagName(currentHtml);
4901
+ rethtml += onTag$1(tagStart, rethtml.length, currentTagName, currentHtml, isClosing(currentHtml));
4902
+ lastPos = currentPos + 1;
4903
+ tagStart = false;
4904
+ continue;
4905
+ }
4906
+ if (c === "\"" || c === "'") {
4907
+ var i$1 = 1;
4908
+ var ic = html.charAt(currentPos - i$1);
4909
+ while (ic.trim() === "" || ic === "=") {
4910
+ if (ic === "=") {
4911
+ quoteStart = c;
4912
+ continue chariterator;
4913
+ }
4914
+ ic = html.charAt(currentPos - ++i$1);
4915
+ }
4916
+ }
4917
+ } else if (c === quoteStart) {
4918
+ quoteStart = false;
4919
+ continue;
4920
+ }
4921
+ }
4922
+ if (lastPos < len) rethtml += escapeHtml$1(html.substr(lastPos));
4923
+ return rethtml;
4924
+ }
4925
+ var REGEXP_ILLEGAL_ATTR_NAME = /[^a-zA-Z0-9\\_:.-]/gim;
4926
+ function parseAttr$1(html, onAttr$1) {
4927
+ var lastPos = 0;
4928
+ var lastMarkPos = 0;
4929
+ var retAttrs = [];
4930
+ var tmpName = false;
4931
+ var len = html.length;
4932
+ function addAttr(name, value) {
4933
+ name = _$1.trim(name);
4934
+ name = name.replace(REGEXP_ILLEGAL_ATTR_NAME, "").toLowerCase();
4935
+ if (name.length < 1) return;
4936
+ var ret = onAttr$1(name, value || "");
4937
+ if (ret) retAttrs.push(ret);
4938
+ }
4939
+ for (var i$1 = 0; i$1 < len; i$1++) {
4940
+ var c = html.charAt(i$1);
4941
+ var v, j;
4942
+ if (tmpName === false && c === "=") {
4943
+ tmpName = html.slice(lastPos, i$1);
4944
+ lastPos = i$1 + 1;
4945
+ lastMarkPos = html.charAt(lastPos) === "\"" || html.charAt(lastPos) === "'" ? lastPos : findNextQuotationMark(html, i$1 + 1);
4946
+ continue;
4947
+ }
4948
+ if (tmpName !== false) {
4949
+ if (i$1 === lastMarkPos) {
4950
+ j = html.indexOf(c, i$1 + 1);
4951
+ if (j === -1) break;
4952
+ else {
4953
+ v = _$1.trim(html.slice(lastMarkPos + 1, j));
4954
+ addAttr(tmpName, v);
4955
+ tmpName = false;
4956
+ i$1 = j;
4957
+ lastPos = i$1 + 1;
4958
+ continue;
4959
+ }
4960
+ }
4961
+ }
4962
+ if (/\s|\n|\t/.test(c)) {
4963
+ html = html.replace(/\s|\n|\t/g, " ");
4964
+ if (tmpName === false) {
4965
+ j = findNextEqual(html, i$1);
4966
+ if (j === -1) {
4967
+ v = _$1.trim(html.slice(lastPos, i$1));
4968
+ addAttr(v);
4969
+ tmpName = false;
4970
+ lastPos = i$1 + 1;
4971
+ continue;
4972
+ } else {
4973
+ i$1 = j - 1;
4974
+ continue;
4975
+ }
4976
+ } else {
4977
+ j = findBeforeEqual(html, i$1 - 1);
4978
+ if (j === -1) {
4979
+ v = _$1.trim(html.slice(lastPos, i$1));
4980
+ v = stripQuoteWrap(v);
4981
+ addAttr(tmpName, v);
4982
+ tmpName = false;
4983
+ lastPos = i$1 + 1;
4984
+ continue;
4985
+ } else continue;
4986
+ }
4987
+ }
4988
+ }
4989
+ if (lastPos < html.length) if (tmpName === false) addAttr(html.slice(lastPos));
4990
+ else addAttr(tmpName, stripQuoteWrap(_$1.trim(html.slice(lastPos))));
4991
+ return _$1.trim(retAttrs.join(" "));
4992
+ }
4993
+ function findNextEqual(str, i$1) {
4994
+ for (; i$1 < str.length; i$1++) {
4995
+ var c = str[i$1];
4996
+ if (c === " ") continue;
4997
+ if (c === "=") return i$1;
4998
+ return -1;
4999
+ }
5000
+ }
5001
+ function findNextQuotationMark(str, i$1) {
5002
+ for (; i$1 < str.length; i$1++) {
5003
+ var c = str[i$1];
5004
+ if (c === " ") continue;
5005
+ if (c === "'" || c === "\"") return i$1;
5006
+ return -1;
5007
+ }
5008
+ }
5009
+ function findBeforeEqual(str, i$1) {
5010
+ for (; i$1 > 0; i$1--) {
5011
+ var c = str[i$1];
5012
+ if (c === " ") continue;
5013
+ if (c === "=") return i$1;
5014
+ return -1;
5015
+ }
5016
+ }
5017
+ function isQuoteWrapString(text) {
5018
+ if (text[0] === "\"" && text[text.length - 1] === "\"" || text[0] === "'" && text[text.length - 1] === "'") return true;
5019
+ else return false;
5020
+ }
5021
+ function stripQuoteWrap(text) {
5022
+ if (isQuoteWrapString(text)) return text.substr(1, text.length - 2);
5023
+ else return text;
5024
+ }
5025
+ exports.parseTag = parseTag$1;
5026
+ exports.parseAttr = parseAttr$1;
5027
+ }));
5028
+ var require_xss = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5029
+ var FilterCSS = require_lib$1().FilterCSS;
5030
+ var DEFAULT$1 = require_default();
5031
+ var parser$1 = require_parser();
5032
+ var parseTag = parser$1.parseTag;
5033
+ var parseAttr = parser$1.parseAttr;
5034
+ var _ = require_util();
5035
+ function isNull(obj) {
5036
+ return obj === void 0 || obj === null;
5037
+ }
5038
+ function getAttrs(html) {
5039
+ var i$1 = _.spaceIndex(html);
5040
+ if (i$1 === -1) return {
5041
+ html: "",
5042
+ closing: html[html.length - 2] === "/"
5043
+ };
5044
+ html = _.trim(html.slice(i$1 + 1, -1));
5045
+ var isClosing$1 = html[html.length - 1] === "/";
5046
+ if (isClosing$1) html = _.trim(html.slice(0, -1));
5047
+ return {
5048
+ html,
5049
+ closing: isClosing$1
5050
+ };
5051
+ }
5052
+ function shallowCopyObject(obj) {
5053
+ var ret = {};
5054
+ for (var i$1 in obj) ret[i$1] = obj[i$1];
5055
+ return ret;
5056
+ }
5057
+ function keysToLowerCase(obj) {
5058
+ var ret = {};
5059
+ for (var i$1 in obj) if (Array.isArray(obj[i$1])) ret[i$1.toLowerCase()] = obj[i$1].map(function(item) {
5060
+ return item.toLowerCase();
5061
+ });
5062
+ else ret[i$1.toLowerCase()] = obj[i$1];
5063
+ return ret;
5064
+ }
5065
+ function FilterXSS$1(options) {
5066
+ options = shallowCopyObject(options || {});
5067
+ if (options.stripIgnoreTag) {
5068
+ if (options.onIgnoreTag) console.error("Notes: cannot use these two options \"stripIgnoreTag\" and \"onIgnoreTag\" at the same time");
5069
+ options.onIgnoreTag = DEFAULT$1.onIgnoreTagStripAll;
5070
+ }
5071
+ if (options.whiteList || options.allowList) options.whiteList = keysToLowerCase(options.whiteList || options.allowList);
5072
+ else options.whiteList = DEFAULT$1.whiteList;
5073
+ this.attributeWrapSign = options.singleQuotedAttributeValue === true ? "'" : DEFAULT$1.attributeWrapSign;
5074
+ options.onTag = options.onTag || DEFAULT$1.onTag;
5075
+ options.onTagAttr = options.onTagAttr || DEFAULT$1.onTagAttr;
5076
+ options.onIgnoreTag = options.onIgnoreTag || DEFAULT$1.onIgnoreTag;
5077
+ options.onIgnoreTagAttr = options.onIgnoreTagAttr || DEFAULT$1.onIgnoreTagAttr;
5078
+ options.safeAttrValue = options.safeAttrValue || DEFAULT$1.safeAttrValue;
5079
+ options.escapeHtml = options.escapeHtml || DEFAULT$1.escapeHtml;
5080
+ this.options = options;
5081
+ if (options.css === false) this.cssFilter = false;
5082
+ else {
5083
+ options.css = options.css || {};
5084
+ this.cssFilter = new FilterCSS(options.css);
5085
+ }
5086
+ }
5087
+ FilterXSS$1.prototype.process = function(html) {
5088
+ html = html || "";
5089
+ html = html.toString();
5090
+ if (!html) return "";
5091
+ var me = this;
5092
+ var options = me.options;
5093
+ var whiteList = options.whiteList;
5094
+ var onTag$1 = options.onTag;
5095
+ var onIgnoreTag$1 = options.onIgnoreTag;
5096
+ var onTagAttr$1 = options.onTagAttr;
5097
+ var onIgnoreTagAttr$1 = options.onIgnoreTagAttr;
5098
+ var safeAttrValue$2 = options.safeAttrValue;
5099
+ var escapeHtml$1 = options.escapeHtml;
5100
+ var attributeWrapSign = me.attributeWrapSign;
5101
+ var cssFilter = me.cssFilter;
5102
+ if (options.stripBlankChar) html = DEFAULT$1.stripBlankChar(html);
5103
+ if (!options.allowCommentTag) html = DEFAULT$1.stripCommentTag(html);
5104
+ var stripIgnoreTagBody = false;
5105
+ if (options.stripIgnoreTagBody) {
5106
+ stripIgnoreTagBody = DEFAULT$1.StripTagBody(options.stripIgnoreTagBody, onIgnoreTag$1);
5107
+ onIgnoreTag$1 = stripIgnoreTagBody.onIgnoreTag;
5108
+ }
5109
+ var retHtml = parseTag(html, function(sourcePosition, position, tag, html$1, isClosing$1) {
5110
+ var info = {
5111
+ sourcePosition,
5112
+ position,
5113
+ isClosing: isClosing$1,
5114
+ isWhite: Object.prototype.hasOwnProperty.call(whiteList, tag)
5115
+ };
5116
+ var ret = onTag$1(tag, html$1, info);
5117
+ if (!isNull(ret)) return ret;
5118
+ if (info.isWhite) {
5119
+ if (info.isClosing) return "</" + tag + ">";
5120
+ var attrs = getAttrs(html$1);
5121
+ var whiteAttrList = whiteList[tag];
5122
+ var attrsHtml = parseAttr(attrs.html, function(name, value) {
5123
+ var isWhiteAttr = _.indexOf(whiteAttrList, name) !== -1;
5124
+ var ret$1 = onTagAttr$1(tag, name, value, isWhiteAttr);
5125
+ if (!isNull(ret$1)) return ret$1;
5126
+ if (isWhiteAttr) {
5127
+ value = safeAttrValue$2(tag, name, value, cssFilter);
5128
+ if (value) return name + "=" + attributeWrapSign + value + attributeWrapSign;
5129
+ else return name;
5130
+ } else {
5131
+ ret$1 = onIgnoreTagAttr$1(tag, name, value, isWhiteAttr);
5132
+ if (!isNull(ret$1)) return ret$1;
5133
+ return;
5134
+ }
5135
+ });
5136
+ html$1 = "<" + tag;
5137
+ if (attrsHtml) html$1 += " " + attrsHtml;
5138
+ if (attrs.closing) html$1 += " /";
5139
+ html$1 += ">";
5140
+ return html$1;
5141
+ } else {
5142
+ ret = onIgnoreTag$1(tag, html$1, info);
5143
+ if (!isNull(ret)) return ret;
5144
+ return escapeHtml$1(html$1);
5145
+ }
5146
+ }, escapeHtml$1);
5147
+ if (stripIgnoreTagBody) retHtml = stripIgnoreTagBody.remove(retHtml);
5148
+ return retHtml;
5149
+ };
5150
+ module.exports = FilterXSS$1;
5151
+ }));
5152
+ var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5153
+ var DEFAULT = require_default();
5154
+ var parser = require_parser();
5155
+ var FilterXSS = require_xss();
5156
+ function filterXSS(html, options) {
5157
+ return new FilterXSS(options).process(html);
5158
+ }
5159
+ exports = module.exports = filterXSS;
5160
+ exports.filterXSS = filterXSS;
5161
+ exports.FilterXSS = FilterXSS;
5162
+ (function() {
5163
+ for (var i$1 in DEFAULT) exports[i$1] = DEFAULT[i$1];
5164
+ for (var j in parser) exports[j] = parser[j];
5165
+ })();
5166
+ if (typeof window !== "undefined") window.filterXSS = module.exports;
5167
+ function isWorkerEnv() {
5168
+ return typeof self !== "undefined" && typeof DedicatedWorkerGlobalScope !== "undefined" && self instanceof DedicatedWorkerGlobalScope;
5169
+ }
5170
+ if (isWorkerEnv()) self.filterXSS = module.exports;
5171
+ }));
5172
+ function isTaskAbortedMessage(msg) {
5173
+ return msg.type === "text" && "aborted" in msg && msg.aborted;
5174
+ }
5175
+ function isWorkflowUpdatedMessage(msg) {
5176
+ return msg.type === "workflow-updated";
5177
+ }
5178
+ function isToolMessage(msg) {
5179
+ return msg.type === "tool";
5180
+ }
5181
+ function isThinkingGroupMessage(msg) {
5182
+ return msg.type === "thinking-group";
5183
+ }
5184
+ var isBrowser = typeof document !== "undefined";
5185
+ function isRouteComponent(component) {
5186
+ return typeof component === "object" || "displayName" in component || "props" in component || "__vccOpts" in component;
5187
+ }
5188
+ function isESModule(obj) {
5189
+ return obj.__esModule || obj[Symbol.toStringTag] === "Module" || obj.default && isRouteComponent(obj.default);
5190
+ }
5191
+ var assign = Object.assign;
5192
+ function applyToParams(fn, params) {
5193
+ const newParams = {};
5194
+ for (const key in params) {
5195
+ const value = params[key];
5196
+ newParams[key] = isArray$3(value) ? value.map(fn) : fn(value);
5197
+ }
5198
+ return newParams;
5199
+ }
5200
+ var noop = () => {};
5201
+ var isArray$3 = Array.isArray;
5202
+ var HASH_RE = /#/g;
5203
+ var AMPERSAND_RE = /&/g;
5204
+ var SLASH_RE = /\//g;
5205
+ var EQUAL_RE = /=/g;
5206
+ var IM_RE = /\?/g;
5207
+ var PLUS_RE = /\+/g;
5208
+ var ENC_BRACKET_OPEN_RE = /%5B/g;
5209
+ var ENC_BRACKET_CLOSE_RE = /%5D/g;
5210
+ var ENC_CARET_RE = /%5E/g;
5211
+ var ENC_BACKTICK_RE = /%60/g;
5212
+ var ENC_CURLY_OPEN_RE = /%7B/g;
5213
+ var ENC_PIPE_RE = /%7C/g;
5214
+ var ENC_CURLY_CLOSE_RE = /%7D/g;
5215
+ var ENC_SPACE_RE = /%20/g;
5216
+ function commonEncode(text) {
5217
+ return encodeURI("" + text).replace(ENC_PIPE_RE, "|").replace(ENC_BRACKET_OPEN_RE, "[").replace(ENC_BRACKET_CLOSE_RE, "]");
5218
+ }
5219
+ function encodeHash(text) {
5220
+ return commonEncode(text).replace(ENC_CURLY_OPEN_RE, "{").replace(ENC_CURLY_CLOSE_RE, "}").replace(ENC_CARET_RE, "^");
5221
+ }
5222
+ function encodeQueryValue(text) {
5223
+ 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, "^");
5224
+ }
5225
+ function encodeQueryKey(text) {
5226
+ return encodeQueryValue(text).replace(EQUAL_RE, "%3D");
5227
+ }
5228
+ function encodePath(text) {
5229
+ return commonEncode(text).replace(HASH_RE, "%23").replace(IM_RE, "%3F");
5230
+ }
5231
+ function encodeParam(text) {
5232
+ return text == null ? "" : encodePath(text).replace(SLASH_RE, "%2F");
5233
+ }
5234
+ function decode(text) {
5235
+ try {
5236
+ return decodeURIComponent("" + text);
5237
+ } catch (err) {}
5238
+ return "" + text;
5239
+ }
5240
+ var TRAILING_SLASH_RE = /\/$/;
5241
+ var removeTrailingSlash = (path) => path.replace(TRAILING_SLASH_RE, "");
5242
+ function parseURL(parseQuery$1, location$1, currentLocation = "/") {
5243
+ let path, query = {}, searchString = "", hash = "";
5244
+ const hashPos = location$1.indexOf("#");
5245
+ let searchPos = location$1.indexOf("?");
5246
+ if (hashPos < searchPos && hashPos >= 0) searchPos = -1;
5247
+ if (searchPos > -1) {
5248
+ path = location$1.slice(0, searchPos);
5249
+ searchString = location$1.slice(searchPos + 1, hashPos > -1 ? hashPos : location$1.length);
5250
+ query = parseQuery$1(searchString);
5251
+ }
5252
+ if (hashPos > -1) {
5253
+ path = path || location$1.slice(0, hashPos);
5254
+ hash = location$1.slice(hashPos, location$1.length);
5255
+ }
5256
+ path = resolveRelativePath(path != null ? path : location$1, currentLocation);
5257
+ return {
5258
+ fullPath: path + (searchString && "?") + searchString + hash,
5259
+ path,
5260
+ query,
5261
+ hash: decode(hash)
5262
+ };
5263
+ }
5264
+ function stringifyURL(stringifyQuery$1, location$1) {
5265
+ const query = location$1.query ? stringifyQuery$1(location$1.query) : "";
5266
+ return location$1.path + (query && "?") + query + (location$1.hash || "");
5267
+ }
5268
+ function stripBase(pathname, base) {
5269
+ if (!base || !pathname.toLowerCase().startsWith(base.toLowerCase())) return pathname;
5270
+ return pathname.slice(base.length) || "/";
5271
+ }
5272
+ function isSameRouteLocation(stringifyQuery$1, a, b) {
5273
+ const aLastIndex = a.matched.length - 1;
5274
+ const bLastIndex = b.matched.length - 1;
5275
+ 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;
5276
+ }
5277
+ function isSameRouteRecord(a, b) {
5278
+ return (a.aliasOf || a) === (b.aliasOf || b);
5279
+ }
5280
+ function isSameRouteLocationParams(a, b) {
5281
+ if (Object.keys(a).length !== Object.keys(b).length) return false;
5282
+ for (const key in a) if (!isSameRouteLocationParamsValue(a[key], b[key])) return false;
5283
+ return true;
5284
+ }
5285
+ function isSameRouteLocationParamsValue(a, b) {
5286
+ return isArray$3(a) ? isEquivalentArray(a, b) : isArray$3(b) ? isEquivalentArray(b, a) : a === b;
5287
+ }
5288
+ function isEquivalentArray(a, b) {
5289
+ return isArray$3(b) ? a.length === b.length && a.every((value, i$1) => value === b[i$1]) : a.length === 1 && a[0] === b;
5290
+ }
5291
+ function resolveRelativePath(to, from) {
5292
+ if (to.startsWith("/")) return to;
5293
+ if (!to) return from;
5294
+ const fromSegments = from.split("/");
5295
+ const toSegments = to.split("/");
5296
+ const lastToSegment = toSegments[toSegments.length - 1];
5297
+ if (lastToSegment === ".." || lastToSegment === ".") toSegments.push("");
5298
+ let position = fromSegments.length - 1;
5299
+ let toPosition;
5300
+ let segment;
5301
+ for (toPosition = 0; toPosition < toSegments.length; toPosition++) {
5302
+ segment = toSegments[toPosition];
5303
+ if (segment === ".") continue;
5304
+ if (segment === "..") {
5305
+ if (position > 1) position--;
5306
+ } else break;
5307
+ }
5308
+ return fromSegments.slice(0, position).join("/") + "/" + toSegments.slice(toPosition).join("/");
5309
+ }
5310
+ var START_LOCATION_NORMALIZED = {
5311
+ path: "/",
5312
+ name: void 0,
5313
+ params: {},
5314
+ query: {},
5315
+ hash: "",
5316
+ fullPath: "/",
5317
+ matched: [],
5318
+ meta: {},
5319
+ redirectedFrom: void 0
5320
+ };
5321
+ var NavigationType;
5322
+ (function(NavigationType$1) {
5323
+ NavigationType$1["pop"] = "pop";
5324
+ NavigationType$1["push"] = "push";
5325
+ })(NavigationType || (NavigationType = {}));
5326
+ var NavigationDirection;
5327
+ (function(NavigationDirection$1) {
5328
+ NavigationDirection$1["back"] = "back";
5329
+ NavigationDirection$1["forward"] = "forward";
5330
+ NavigationDirection$1["unknown"] = "";
5331
+ })(NavigationDirection || (NavigationDirection = {}));
5332
+ function normalizeBase(base) {
5333
+ if (!base) if (isBrowser) {
5334
+ const baseEl = document.querySelector("base");
5335
+ base = baseEl && baseEl.getAttribute("href") || "/";
5336
+ base = base.replace(/^\w+:\/\/[^\/]+/, "");
5337
+ } else base = "/";
5338
+ if (base[0] !== "/" && base[0] !== "#") base = "/" + base;
5339
+ return removeTrailingSlash(base);
5340
+ }
5341
+ var BEFORE_HASH_RE = /^[^#]+#/;
5342
+ function createHref(base, location$1) {
5343
+ return base.replace(BEFORE_HASH_RE, "#") + location$1;
5344
+ }
5345
+ function getElementPosition(el, offset) {
5346
+ const docRect = document.documentElement.getBoundingClientRect();
5347
+ const elRect = el.getBoundingClientRect();
5348
+ return {
5349
+ behavior: offset.behavior,
5350
+ left: elRect.left - docRect.left - (offset.left || 0),
5351
+ top: elRect.top - docRect.top - (offset.top || 0)
5352
+ };
5353
+ }
5354
+ var computeScrollPosition = () => ({
5355
+ left: window.scrollX,
5356
+ top: window.scrollY
5357
+ });
5358
+ function scrollToPosition(position) {
5359
+ let scrollToOptions;
5360
+ if ("el" in position) {
5361
+ const positionEl = position.el;
5362
+ const isIdSelector = typeof positionEl === "string" && positionEl.startsWith("#");
5363
+ const el = typeof positionEl === "string" ? isIdSelector ? document.getElementById(positionEl.slice(1)) : document.querySelector(positionEl) : positionEl;
5364
+ if (!el) return;
5365
+ scrollToOptions = getElementPosition(el, position);
5366
+ } else scrollToOptions = position;
5367
+ if ("scrollBehavior" in document.documentElement.style) window.scrollTo(scrollToOptions);
5368
+ else window.scrollTo(scrollToOptions.left != null ? scrollToOptions.left : window.scrollX, scrollToOptions.top != null ? scrollToOptions.top : window.scrollY);
5369
+ }
5370
+ function getScrollKey(path, delta) {
5371
+ return (history.state ? history.state.position - delta : -1) + path;
5372
+ }
5373
+ var scrollPositions = /* @__PURE__ */ new Map();
5374
+ function saveScrollPosition(key, scrollPosition) {
5375
+ scrollPositions.set(key, scrollPosition);
5376
+ }
5377
+ function getSavedScrollPosition(key) {
5378
+ const scroll = scrollPositions.get(key);
5379
+ scrollPositions.delete(key);
5380
+ return scroll;
5381
+ }
5382
+ var createBaseLocation = () => location.protocol + "//" + location.host;
5383
+ function createCurrentLocation(base, location$1) {
5384
+ const { pathname, search, hash } = location$1;
5385
+ const hashPos = base.indexOf("#");
5386
+ if (hashPos > -1) {
5387
+ let slicePos = hash.includes(base.slice(hashPos)) ? base.slice(hashPos).length : 1;
5388
+ let pathFromHash = hash.slice(slicePos);
5389
+ if (pathFromHash[0] !== "/") pathFromHash = "/" + pathFromHash;
5390
+ return stripBase(pathFromHash, "");
5857
5391
  }
5858
- exports.whiteList = getDefaultWhiteList$1();
5859
- exports.getDefaultWhiteList = getDefaultWhiteList$1;
5860
- exports.onAttr = onAttr;
5861
- exports.onIgnoreAttr = onIgnoreAttr;
5862
- exports.safeAttrValue = safeAttrValue$1;
5863
- }));
5864
- var require_util$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5865
- module.exports = {
5866
- indexOf: function(arr, item) {
5867
- var i$1, j;
5868
- if (Array.prototype.indexOf) return arr.indexOf(item);
5869
- for (i$1 = 0, j = arr.length; i$1 < j; i$1++) if (arr[i$1] === item) return i$1;
5870
- return -1;
5871
- },
5872
- forEach: function(arr, fn, scope) {
5873
- var i$1, j;
5874
- if (Array.prototype.forEach) return arr.forEach(fn, scope);
5875
- for (i$1 = 0, j = arr.length; i$1 < j; i$1++) fn.call(scope, arr[i$1], i$1, arr);
5876
- },
5877
- trim: function(str) {
5878
- if (String.prototype.trim) return str.trim();
5879
- return str.replace(/(^\s*)|(\s*$)/g, "");
5880
- },
5881
- trimRight: function(str) {
5882
- if (String.prototype.trimRight) return str.trimRight();
5883
- return str.replace(/(\s*$)/g, "");
5392
+ return stripBase(pathname, base) + search + hash;
5393
+ }
5394
+ function useHistoryListeners(base, historyState, currentLocation, replace) {
5395
+ let listeners = [];
5396
+ let teardowns = [];
5397
+ let pauseState = null;
5398
+ const popStateHandler = ({ state }) => {
5399
+ const to = createCurrentLocation(base, location);
5400
+ const from = currentLocation.value;
5401
+ const fromState = historyState.value;
5402
+ let delta = 0;
5403
+ if (state) {
5404
+ currentLocation.value = to;
5405
+ historyState.value = state;
5406
+ if (pauseState && pauseState === from) {
5407
+ pauseState = null;
5408
+ return;
5409
+ }
5410
+ delta = fromState ? state.position - fromState.position : 0;
5411
+ } else replace(to);
5412
+ listeners.forEach((listener) => {
5413
+ listener(currentLocation.value, from, {
5414
+ delta,
5415
+ type: NavigationType.pop,
5416
+ direction: delta ? delta > 0 ? NavigationDirection.forward : NavigationDirection.back : NavigationDirection.unknown
5417
+ });
5418
+ });
5419
+ };
5420
+ function pauseListeners() {
5421
+ pauseState = currentLocation.value;
5422
+ }
5423
+ function listen(callback) {
5424
+ listeners.push(callback);
5425
+ const teardown = () => {
5426
+ const index = listeners.indexOf(callback);
5427
+ if (index > -1) listeners.splice(index, 1);
5428
+ };
5429
+ teardowns.push(teardown);
5430
+ return teardown;
5431
+ }
5432
+ function beforeUnloadListener() {
5433
+ const { history: history$1 } = window;
5434
+ if (!history$1.state) return;
5435
+ history$1.replaceState(assign({}, history$1.state, { scroll: computeScrollPosition() }), "");
5436
+ }
5437
+ function destroy() {
5438
+ for (const teardown of teardowns) teardown();
5439
+ teardowns = [];
5440
+ window.removeEventListener("popstate", popStateHandler);
5441
+ window.removeEventListener("beforeunload", beforeUnloadListener);
5442
+ }
5443
+ window.addEventListener("popstate", popStateHandler);
5444
+ window.addEventListener("beforeunload", beforeUnloadListener, { passive: true });
5445
+ return {
5446
+ pauseListeners,
5447
+ listen,
5448
+ destroy
5449
+ };
5450
+ }
5451
+ function buildState(back, current, forward, replaced = false, computeScroll = false) {
5452
+ return {
5453
+ back,
5454
+ current,
5455
+ forward,
5456
+ replaced,
5457
+ position: window.history.length,
5458
+ scroll: computeScroll ? computeScrollPosition() : null
5459
+ };
5460
+ }
5461
+ function useHistoryStateNavigation(base) {
5462
+ const { history: history$1, location: location$1 } = window;
5463
+ const currentLocation = { value: createCurrentLocation(base, location$1) };
5464
+ const historyState = { value: history$1.state };
5465
+ if (!historyState.value) changeLocation(currentLocation.value, {
5466
+ back: null,
5467
+ current: currentLocation.value,
5468
+ forward: null,
5469
+ position: history$1.length - 1,
5470
+ replaced: true,
5471
+ scroll: null
5472
+ }, true);
5473
+ function changeLocation(to, state, replace$1) {
5474
+ const hashIndex = base.indexOf("#");
5475
+ const url = hashIndex > -1 ? (location$1.host && document.querySelector("base") ? base : base.slice(hashIndex)) + to : createBaseLocation() + base + to;
5476
+ try {
5477
+ history$1[replace$1 ? "replaceState" : "pushState"](state, "", url);
5478
+ historyState.value = state;
5479
+ } catch (err) {
5480
+ console.error(err);
5481
+ location$1[replace$1 ? "replace" : "assign"](url);
5884
5482
  }
5483
+ }
5484
+ function replace(to, data) {
5485
+ changeLocation(to, assign({}, history$1.state, buildState(historyState.value.back, to, historyState.value.forward, true), data, { position: historyState.value.position }), true);
5486
+ currentLocation.value = to;
5487
+ }
5488
+ function push(to, data) {
5489
+ const currentState = assign({}, historyState.value, history$1.state, {
5490
+ forward: to,
5491
+ scroll: computeScrollPosition()
5492
+ });
5493
+ changeLocation(currentState.current, currentState, true);
5494
+ changeLocation(to, assign({}, buildState(currentLocation.value, to, null), { position: currentState.position + 1 }, data), false);
5495
+ currentLocation.value = to;
5496
+ }
5497
+ return {
5498
+ location: currentLocation,
5499
+ state: historyState,
5500
+ push,
5501
+ replace
5885
5502
  };
5886
- }));
5887
- var require_parser$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5888
- var _$3 = require_util$1();
5889
- function parseStyle$1(css, onAttr$1) {
5890
- css = _$3.trimRight(css);
5891
- if (css[css.length - 1] !== ";") css += ";";
5892
- var cssLength = css.length;
5893
- var isParenthesisOpen = false;
5894
- var lastPos = 0;
5895
- var i$1 = 0;
5896
- var retCSS = "";
5897
- function addNewAttr() {
5898
- if (!isParenthesisOpen) {
5899
- var source = _$3.trim(css.slice(lastPos, i$1));
5900
- var j$1 = source.indexOf(":");
5901
- if (j$1 !== -1) {
5902
- var name = _$3.trim(source.slice(0, j$1));
5903
- var value = _$3.trim(source.slice(j$1 + 1));
5904
- if (name) {
5905
- var ret = onAttr$1(lastPos, retCSS.length, name, value, source);
5906
- if (ret) retCSS += ret + "; ";
5503
+ }
5504
+ function createWebHistory(base) {
5505
+ base = normalizeBase(base);
5506
+ const historyNavigation = useHistoryStateNavigation(base);
5507
+ const historyListeners = useHistoryListeners(base, historyNavigation.state, historyNavigation.location, historyNavigation.replace);
5508
+ function go(delta, triggerListeners = true) {
5509
+ if (!triggerListeners) historyListeners.pauseListeners();
5510
+ history.go(delta);
5511
+ }
5512
+ const routerHistory = assign({
5513
+ location: "",
5514
+ base,
5515
+ go,
5516
+ createHref: createHref.bind(null, base)
5517
+ }, historyNavigation, historyListeners);
5518
+ Object.defineProperty(routerHistory, "location", {
5519
+ enumerable: true,
5520
+ get: () => historyNavigation.location.value
5521
+ });
5522
+ Object.defineProperty(routerHistory, "state", {
5523
+ enumerable: true,
5524
+ get: () => historyNavigation.state.value
5525
+ });
5526
+ return routerHistory;
5527
+ }
5528
+ function isRouteLocation(route) {
5529
+ return typeof route === "string" || route && typeof route === "object";
5530
+ }
5531
+ function isRouteName(name) {
5532
+ return typeof name === "string" || typeof name === "symbol";
5533
+ }
5534
+ var NavigationFailureSymbol = Symbol("");
5535
+ var NavigationFailureType;
5536
+ (function(NavigationFailureType$1) {
5537
+ NavigationFailureType$1[NavigationFailureType$1["aborted"] = 4] = "aborted";
5538
+ NavigationFailureType$1[NavigationFailureType$1["cancelled"] = 8] = "cancelled";
5539
+ NavigationFailureType$1[NavigationFailureType$1["duplicated"] = 16] = "duplicated";
5540
+ })(NavigationFailureType || (NavigationFailureType = {}));
5541
+ function createRouterError(type, params) {
5542
+ return assign(/* @__PURE__ */ new Error(), {
5543
+ type,
5544
+ [NavigationFailureSymbol]: true
5545
+ }, params);
5546
+ }
5547
+ function isNavigationFailure(error, type) {
5548
+ return error instanceof Error && NavigationFailureSymbol in error && (type == null || !!(error.type & type));
5549
+ }
5550
+ var BASE_PARAM_PATTERN = "[^/]+?";
5551
+ var BASE_PATH_PARSER_OPTIONS = {
5552
+ sensitive: false,
5553
+ strict: false,
5554
+ start: true,
5555
+ end: true
5556
+ };
5557
+ var REGEX_CHARS_RE = /[.+*?^${}()[\]/\\]/g;
5558
+ function tokensToParser(segments, extraOptions) {
5559
+ const options = assign({}, BASE_PATH_PARSER_OPTIONS, extraOptions);
5560
+ const score = [];
5561
+ let pattern = options.start ? "^" : "";
5562
+ const keys = [];
5563
+ for (const segment of segments) {
5564
+ const segmentScores = segment.length ? [] : [90];
5565
+ if (options.strict && !segment.length) pattern += "/";
5566
+ for (let tokenIndex = 0; tokenIndex < segment.length; tokenIndex++) {
5567
+ const token = segment[tokenIndex];
5568
+ let subSegmentScore = 40 + (options.sensitive ? .25 : 0);
5569
+ if (token.type === 0) {
5570
+ if (!tokenIndex) pattern += "/";
5571
+ pattern += token.value.replace(REGEX_CHARS_RE, "\\$&");
5572
+ subSegmentScore += 40;
5573
+ } else if (token.type === 1) {
5574
+ const { value, repeatable, optional, regexp } = token;
5575
+ keys.push({
5576
+ name: value,
5577
+ repeatable,
5578
+ optional
5579
+ });
5580
+ const re$1 = regexp ? regexp : BASE_PARAM_PATTERN;
5581
+ if (re$1 !== BASE_PARAM_PATTERN) {
5582
+ subSegmentScore += 10;
5583
+ try {
5584
+ `${re$1}`;
5585
+ } catch (err) {
5586
+ throw new Error(`Invalid custom RegExp for param "${value}" (${re$1}): ` + err.message);
5907
5587
  }
5908
5588
  }
5589
+ let subPattern = repeatable ? `((?:${re$1})(?:/(?:${re$1}))*)` : `(${re$1})`;
5590
+ if (!tokenIndex) subPattern = optional && segment.length < 2 ? `(?:/${subPattern})` : "/" + subPattern;
5591
+ if (optional) subPattern += "?";
5592
+ pattern += subPattern;
5593
+ subSegmentScore += 20;
5594
+ if (optional) subSegmentScore += -8;
5595
+ if (repeatable) subSegmentScore += -20;
5596
+ if (re$1 === ".*") subSegmentScore += -50;
5909
5597
  }
5910
- lastPos = i$1 + 1;
5598
+ segmentScores.push(subSegmentScore);
5911
5599
  }
5912
- for (; i$1 < cssLength; i$1++) {
5913
- var c = css[i$1];
5914
- if (c === "/" && css[i$1 + 1] === "*") {
5915
- var j = css.indexOf("*/", i$1 + 2);
5916
- if (j === -1) break;
5917
- i$1 = j + 1;
5918
- lastPos = i$1 + 1;
5919
- isParenthesisOpen = false;
5920
- } else if (c === "(") isParenthesisOpen = true;
5921
- else if (c === ")") isParenthesisOpen = false;
5922
- else if (c === ";") if (isParenthesisOpen) {} else addNewAttr();
5923
- else if (c === "\n") addNewAttr();
5600
+ score.push(segmentScores);
5601
+ }
5602
+ if (options.strict && options.end) {
5603
+ const i$1 = score.length - 1;
5604
+ score[i$1][score[i$1].length - 1] += .7000000000000001;
5605
+ }
5606
+ if (!options.strict) pattern += "/?";
5607
+ if (options.end) pattern += "$";
5608
+ else if (options.strict && !pattern.endsWith("/")) pattern += "(?:/|$)";
5609
+ const re = new RegExp(pattern, options.sensitive ? "" : "i");
5610
+ function parse(path) {
5611
+ const match = path.match(re);
5612
+ const params = {};
5613
+ if (!match) return null;
5614
+ for (let i$1 = 1; i$1 < match.length; i$1++) {
5615
+ const value = match[i$1] || "";
5616
+ const key = keys[i$1 - 1];
5617
+ params[key.name] = value && key.repeatable ? value.split("/") : value;
5924
5618
  }
5925
- return _$3.trim(retCSS);
5619
+ return params;
5926
5620
  }
5927
- module.exports = parseStyle$1;
5928
- }));
5929
- var require_css = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5930
- var DEFAULT$3 = require_default$1();
5931
- var parseStyle = require_parser$1();
5932
- require_util$1();
5933
- function isNull$1(obj) {
5934
- return obj === void 0 || obj === null;
5621
+ function stringify(params) {
5622
+ let path = "";
5623
+ let avoidDuplicatedSlash = false;
5624
+ for (const segment of segments) {
5625
+ if (!avoidDuplicatedSlash || !path.endsWith("/")) path += "/";
5626
+ avoidDuplicatedSlash = false;
5627
+ for (const token of segment) if (token.type === 0) path += token.value;
5628
+ else if (token.type === 1) {
5629
+ const { value, repeatable, optional } = token;
5630
+ const param = value in params ? params[value] : "";
5631
+ if (isArray$3(param) && !repeatable) throw new Error(`Provided param "${value}" is an array but it is not repeatable (* or + modifiers)`);
5632
+ const text = isArray$3(param) ? param.join("/") : param;
5633
+ if (!text) if (optional) {
5634
+ if (segment.length < 2) if (path.endsWith("/")) path = path.slice(0, -1);
5635
+ else avoidDuplicatedSlash = true;
5636
+ } else throw new Error(`Missing required param "${value}"`);
5637
+ path += text;
5638
+ }
5639
+ }
5640
+ return path || "/";
5935
5641
  }
5936
- function shallowCopyObject$1(obj) {
5937
- var ret = {};
5938
- for (var i$1 in obj) ret[i$1] = obj[i$1];
5939
- return ret;
5642
+ return {
5643
+ re,
5644
+ score,
5645
+ keys,
5646
+ parse,
5647
+ stringify
5648
+ };
5649
+ }
5650
+ function compareScoreArray(a, b) {
5651
+ let i$1 = 0;
5652
+ while (i$1 < a.length && i$1 < b.length) {
5653
+ const diff = b[i$1] - a[i$1];
5654
+ if (diff) return diff;
5655
+ i$1++;
5940
5656
  }
5941
- function FilterCSS$3(options) {
5942
- options = shallowCopyObject$1(options || {});
5943
- options.whiteList = options.whiteList || DEFAULT$3.whiteList;
5944
- options.onAttr = options.onAttr || DEFAULT$3.onAttr;
5945
- options.onIgnoreAttr = options.onIgnoreAttr || DEFAULT$3.onIgnoreAttr;
5946
- options.safeAttrValue = options.safeAttrValue || DEFAULT$3.safeAttrValue;
5947
- this.options = options;
5657
+ if (a.length < b.length) return a.length === 1 && a[0] === 80 ? -1 : 1;
5658
+ else if (a.length > b.length) return b.length === 1 && b[0] === 80 ? 1 : -1;
5659
+ return 0;
5660
+ }
5661
+ function comparePathParserScore(a, b) {
5662
+ let i$1 = 0;
5663
+ const aScore = a.score;
5664
+ const bScore = b.score;
5665
+ while (i$1 < aScore.length && i$1 < bScore.length) {
5666
+ const comp = compareScoreArray(aScore[i$1], bScore[i$1]);
5667
+ if (comp) return comp;
5668
+ i$1++;
5948
5669
  }
5949
- FilterCSS$3.prototype.process = function(css) {
5950
- css = css || "";
5951
- css = css.toString();
5952
- if (!css) return "";
5953
- var options = this.options;
5954
- var whiteList = options.whiteList;
5955
- var onAttr$1 = options.onAttr;
5956
- var onIgnoreAttr$1 = options.onIgnoreAttr;
5957
- var safeAttrValue$2 = options.safeAttrValue;
5958
- return parseStyle(css, function(sourcePosition, position, name, value, source) {
5959
- var check = whiteList[name];
5960
- var isWhite = false;
5961
- if (check === true) isWhite = check;
5962
- else if (typeof check === "function") isWhite = check(value);
5963
- else if (check instanceof RegExp) isWhite = check.test(value);
5964
- if (isWhite !== true) isWhite = false;
5965
- value = safeAttrValue$2(name, value);
5966
- if (!value) return;
5967
- var opts = {
5968
- position,
5969
- sourcePosition,
5970
- source,
5971
- isWhite
5972
- };
5973
- if (isWhite) {
5974
- var ret = onAttr$1(name, value, opts);
5975
- if (isNull$1(ret)) return name + ":" + value;
5976
- else return ret;
5977
- } else {
5978
- var ret = onIgnoreAttr$1(name, value, opts);
5979
- if (!isNull$1(ret)) return ret;
5980
- }
5670
+ if (Math.abs(bScore.length - aScore.length) === 1) {
5671
+ if (isLastScoreNegative(aScore)) return 1;
5672
+ if (isLastScoreNegative(bScore)) return -1;
5673
+ }
5674
+ return bScore.length - aScore.length;
5675
+ }
5676
+ function isLastScoreNegative(score) {
5677
+ const last = score[score.length - 1];
5678
+ return score.length > 0 && last[last.length - 1] < 0;
5679
+ }
5680
+ var ROOT_TOKEN = {
5681
+ type: 0,
5682
+ value: ""
5683
+ };
5684
+ var VALID_PARAM_RE = /[a-zA-Z0-9_]/;
5685
+ function tokenizePath(path) {
5686
+ if (!path) return [[]];
5687
+ if (path === "/") return [[ROOT_TOKEN]];
5688
+ if (!path.startsWith("/")) throw new Error(`Invalid path "${path}"`);
5689
+ function crash(message) {
5690
+ throw new Error(`ERR (${state})/"${buffer}": ${message}`);
5691
+ }
5692
+ let state = 0;
5693
+ let previousState = state;
5694
+ const tokens = [];
5695
+ let segment;
5696
+ function finalizeSegment() {
5697
+ if (segment) tokens.push(segment);
5698
+ segment = [];
5699
+ }
5700
+ let i$1 = 0;
5701
+ let char;
5702
+ let buffer = "";
5703
+ let customRe = "";
5704
+ function consumeBuffer() {
5705
+ if (!buffer) return;
5706
+ if (state === 0) segment.push({
5707
+ type: 0,
5708
+ value: buffer
5981
5709
  });
5982
- };
5983
- module.exports = FilterCSS$3;
5984
- }));
5985
- var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5986
- var DEFAULT$2 = require_default$1();
5987
- var FilterCSS$2 = require_css();
5988
- function filterCSS(html, options) {
5989
- return new FilterCSS$2(options).process(html);
5710
+ else if (state === 1 || state === 2 || state === 3) {
5711
+ if (segment.length > 1 && (char === "*" || char === "+")) crash(`A repeatable param (${buffer}) must be alone in its segment. eg: '/:ids+.`);
5712
+ segment.push({
5713
+ type: 1,
5714
+ value: buffer,
5715
+ regexp: customRe,
5716
+ repeatable: char === "*" || char === "+",
5717
+ optional: char === "*" || char === "?"
5718
+ });
5719
+ } else crash("Invalid state to consume buffer");
5720
+ buffer = "";
5990
5721
  }
5991
- exports = module.exports = filterCSS;
5992
- exports.FilterCSS = FilterCSS$2;
5993
- for (var i in DEFAULT$2) exports[i] = DEFAULT$2[i];
5994
- if (typeof window !== "undefined") window.filterCSS = module.exports;
5995
- }));
5996
- var require_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5997
- module.exports = {
5998
- indexOf: function(arr, item) {
5999
- var i$1, j;
6000
- if (Array.prototype.indexOf) return arr.indexOf(item);
6001
- for (i$1 = 0, j = arr.length; i$1 < j; i$1++) if (arr[i$1] === item) return i$1;
6002
- return -1;
6003
- },
6004
- forEach: function(arr, fn, scope) {
6005
- var i$1, j;
6006
- if (Array.prototype.forEach) return arr.forEach(fn, scope);
6007
- for (i$1 = 0, j = arr.length; i$1 < j; i$1++) fn.call(scope, arr[i$1], i$1, arr);
6008
- },
6009
- trim: function(str) {
6010
- if (String.prototype.trim) return str.trim();
6011
- return str.replace(/(^\s*)|(\s*$)/g, "");
6012
- },
6013
- spaceIndex: function(str) {
6014
- var match = /\s|\n|\t/.exec(str);
6015
- return match ? match.index : -1;
5722
+ function addCharToBuffer() {
5723
+ buffer += char;
5724
+ }
5725
+ while (i$1 < path.length) {
5726
+ char = path[i$1++];
5727
+ if (char === "\\" && state !== 2) {
5728
+ previousState = state;
5729
+ state = 4;
5730
+ continue;
5731
+ }
5732
+ switch (state) {
5733
+ case 0:
5734
+ if (char === "/") {
5735
+ if (buffer) consumeBuffer();
5736
+ finalizeSegment();
5737
+ } else if (char === ":") {
5738
+ consumeBuffer();
5739
+ state = 1;
5740
+ } else addCharToBuffer();
5741
+ break;
5742
+ case 4:
5743
+ addCharToBuffer();
5744
+ state = previousState;
5745
+ break;
5746
+ case 1:
5747
+ if (char === "(") state = 2;
5748
+ else if (VALID_PARAM_RE.test(char)) addCharToBuffer();
5749
+ else {
5750
+ consumeBuffer();
5751
+ state = 0;
5752
+ if (char !== "*" && char !== "?" && char !== "+") i$1--;
5753
+ }
5754
+ break;
5755
+ case 2:
5756
+ if (char === ")") if (customRe[customRe.length - 1] == "\\") customRe = customRe.slice(0, -1) + char;
5757
+ else state = 3;
5758
+ else customRe += char;
5759
+ break;
5760
+ case 3:
5761
+ consumeBuffer();
5762
+ state = 0;
5763
+ if (char !== "*" && char !== "?" && char !== "+") i$1--;
5764
+ customRe = "";
5765
+ break;
5766
+ default:
5767
+ crash("Unknown state");
5768
+ break;
6016
5769
  }
6017
- };
6018
- }));
6019
- var require_default = /* @__PURE__ */ __commonJSMin(((exports) => {
6020
- var FilterCSS$1 = require_lib$1().FilterCSS;
6021
- var getDefaultCSSWhiteList = require_lib$1().getDefaultWhiteList;
6022
- var _$2 = require_util();
6023
- function getDefaultWhiteList() {
6024
- return {
6025
- a: [
6026
- "target",
6027
- "href",
6028
- "title"
6029
- ],
6030
- abbr: ["title"],
6031
- address: [],
6032
- area: [
6033
- "shape",
6034
- "coords",
6035
- "href",
6036
- "alt"
6037
- ],
6038
- article: [],
6039
- aside: [],
6040
- audio: [
6041
- "autoplay",
6042
- "controls",
6043
- "crossorigin",
6044
- "loop",
6045
- "muted",
6046
- "preload",
6047
- "src"
6048
- ],
6049
- b: [],
6050
- bdi: ["dir"],
6051
- bdo: ["dir"],
6052
- big: [],
6053
- blockquote: ["cite"],
6054
- br: [],
6055
- caption: [],
6056
- center: [],
6057
- cite: [],
6058
- code: [],
6059
- col: [
6060
- "align",
6061
- "valign",
6062
- "span",
6063
- "width"
6064
- ],
6065
- colgroup: [
6066
- "align",
6067
- "valign",
6068
- "span",
6069
- "width"
6070
- ],
6071
- dd: [],
6072
- del: ["datetime"],
6073
- details: ["open"],
6074
- div: [],
6075
- dl: [],
6076
- dt: [],
6077
- em: [],
6078
- figcaption: [],
6079
- figure: [],
6080
- font: [
6081
- "color",
6082
- "size",
6083
- "face"
6084
- ],
6085
- footer: [],
6086
- h1: [],
6087
- h2: [],
6088
- h3: [],
6089
- h4: [],
6090
- h5: [],
6091
- h6: [],
6092
- header: [],
6093
- hr: [],
6094
- i: [],
6095
- img: [
6096
- "src",
6097
- "alt",
6098
- "title",
6099
- "width",
6100
- "height",
6101
- "loading"
6102
- ],
6103
- ins: ["datetime"],
6104
- kbd: [],
6105
- li: [],
6106
- mark: [],
6107
- nav: [],
6108
- ol: [],
6109
- p: [],
6110
- pre: [],
6111
- s: [],
6112
- section: [],
6113
- small: [],
6114
- span: [],
6115
- sub: [],
6116
- summary: [],
6117
- sup: [],
6118
- strong: [],
6119
- strike: [],
6120
- table: [
6121
- "width",
6122
- "border",
6123
- "align",
6124
- "valign"
6125
- ],
6126
- tbody: ["align", "valign"],
6127
- td: [
6128
- "width",
6129
- "rowspan",
6130
- "colspan",
6131
- "align",
6132
- "valign"
6133
- ],
6134
- tfoot: ["align", "valign"],
6135
- th: [
6136
- "width",
6137
- "rowspan",
6138
- "colspan",
6139
- "align",
6140
- "valign"
6141
- ],
6142
- thead: ["align", "valign"],
6143
- tr: [
6144
- "rowspan",
6145
- "align",
6146
- "valign"
6147
- ],
6148
- tt: [],
6149
- u: [],
6150
- ul: [],
6151
- video: [
6152
- "autoplay",
6153
- "controls",
6154
- "crossorigin",
6155
- "loop",
6156
- "muted",
6157
- "playsinline",
6158
- "poster",
6159
- "preload",
6160
- "src",
6161
- "height",
6162
- "width"
6163
- ]
6164
- };
6165
5770
  }
6166
- var defaultCSSFilter = new FilterCSS$1();
6167
- function onTag(tag, html, options) {}
6168
- function onIgnoreTag(tag, html, options) {}
6169
- function onTagAttr(tag, name, value) {}
6170
- function onIgnoreTagAttr(tag, name, value) {}
6171
- function escapeHtml(html) {
6172
- return html.replace(REGEXP_LT, "&lt;").replace(REGEXP_GT, "&gt;");
5771
+ if (state === 2) crash(`Unfinished custom RegExp for param "${buffer}"`);
5772
+ consumeBuffer();
5773
+ finalizeSegment();
5774
+ return tokens;
5775
+ }
5776
+ function createRouteRecordMatcher(record, parent, options) {
5777
+ const matcher = assign(tokensToParser(tokenizePath(record.path), options), {
5778
+ record,
5779
+ parent,
5780
+ children: [],
5781
+ alias: []
5782
+ });
5783
+ if (parent) {
5784
+ if (!matcher.record.aliasOf === !parent.record.aliasOf) parent.children.push(matcher);
6173
5785
  }
6174
- function safeAttrValue(tag, name, value, cssFilter) {
6175
- value = friendlyAttrValue(value);
6176
- if (name === "href" || name === "src") {
6177
- value = _$2.trim(value);
6178
- if (value === "#") return "#";
6179
- if (!(value.substr(0, 7) === "http://" || value.substr(0, 8) === "https://" || value.substr(0, 7) === "mailto:" || value.substr(0, 4) === "tel:" || value.substr(0, 11) === "data:image/" || value.substr(0, 6) === "ftp://" || value.substr(0, 2) === "./" || value.substr(0, 3) === "../" || value[0] === "#" || value[0] === "/")) return "";
6180
- } else if (name === "background") {
6181
- REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
6182
- if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) return "";
6183
- } else if (name === "style") {
6184
- REGEXP_DEFAULT_ON_TAG_ATTR_7.lastIndex = 0;
6185
- if (REGEXP_DEFAULT_ON_TAG_ATTR_7.test(value)) return "";
6186
- REGEXP_DEFAULT_ON_TAG_ATTR_8.lastIndex = 0;
6187
- if (REGEXP_DEFAULT_ON_TAG_ATTR_8.test(value)) {
6188
- REGEXP_DEFAULT_ON_TAG_ATTR_4.lastIndex = 0;
6189
- if (REGEXP_DEFAULT_ON_TAG_ATTR_4.test(value)) return "";
5786
+ return matcher;
5787
+ }
5788
+ function createRouterMatcher(routes, globalOptions) {
5789
+ const matchers$1 = [];
5790
+ const matcherMap = /* @__PURE__ */ new Map();
5791
+ globalOptions = mergeOptions({
5792
+ strict: false,
5793
+ end: true,
5794
+ sensitive: false
5795
+ }, globalOptions);
5796
+ function getRecordMatcher(name) {
5797
+ return matcherMap.get(name);
5798
+ }
5799
+ function addRoute(record, parent, originalRecord) {
5800
+ const isRootAdd = !originalRecord;
5801
+ const mainNormalizedRecord = normalizeRouteRecord(record);
5802
+ mainNormalizedRecord.aliasOf = originalRecord && originalRecord.record;
5803
+ const options = mergeOptions(globalOptions, record);
5804
+ const normalizedRecords = [mainNormalizedRecord];
5805
+ if ("alias" in record) {
5806
+ const aliases = typeof record.alias === "string" ? [record.alias] : record.alias;
5807
+ for (const alias of aliases) normalizedRecords.push(normalizeRouteRecord(assign({}, mainNormalizedRecord, {
5808
+ components: originalRecord ? originalRecord.record.components : mainNormalizedRecord.components,
5809
+ path: alias,
5810
+ aliasOf: originalRecord ? originalRecord.record : mainNormalizedRecord
5811
+ })));
5812
+ }
5813
+ let matcher;
5814
+ let originalMatcher;
5815
+ for (const normalizedRecord of normalizedRecords) {
5816
+ const { path } = normalizedRecord;
5817
+ if (parent && path[0] !== "/") {
5818
+ const parentPath = parent.record.path;
5819
+ const connectingSlash = parentPath[parentPath.length - 1] === "/" ? "" : "/";
5820
+ normalizedRecord.path = parent.record.path + (path && connectingSlash + path);
6190
5821
  }
6191
- if (cssFilter !== false) {
6192
- cssFilter = cssFilter || defaultCSSFilter;
6193
- value = cssFilter.process(value);
5822
+ matcher = createRouteRecordMatcher(normalizedRecord, parent, options);
5823
+ if (originalRecord) originalRecord.alias.push(matcher);
5824
+ else {
5825
+ originalMatcher = originalMatcher || matcher;
5826
+ if (originalMatcher !== matcher) originalMatcher.alias.push(matcher);
5827
+ if (isRootAdd && record.name && !isAliasRecord(matcher)) removeRoute(record.name);
5828
+ }
5829
+ if (isMatchable(matcher)) insertMatcher(matcher);
5830
+ if (mainNormalizedRecord.children) {
5831
+ const children = mainNormalizedRecord.children;
5832
+ for (let i$1 = 0; i$1 < children.length; i$1++) addRoute(children[i$1], matcher, originalRecord && originalRecord.children[i$1]);
6194
5833
  }
5834
+ originalRecord = originalRecord || matcher;
6195
5835
  }
6196
- value = escapeAttrValue(value);
6197
- return value;
5836
+ return originalMatcher ? () => {
5837
+ removeRoute(originalMatcher);
5838
+ } : noop;
6198
5839
  }
6199
- var REGEXP_LT = /</g;
6200
- var REGEXP_GT = />/g;
6201
- var REGEXP_QUOTE = /"/g;
6202
- var REGEXP_QUOTE_2 = /&quot;/g;
6203
- var REGEXP_ATTR_VALUE_1 = /&#([a-zA-Z0-9]*);?/gim;
6204
- var REGEXP_ATTR_VALUE_COLON = /&colon;?/gim;
6205
- var REGEXP_ATTR_VALUE_NEWLINE = /&newline;?/gim;
6206
- var REGEXP_DEFAULT_ON_TAG_ATTR_4 = /((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi;
6207
- var REGEXP_DEFAULT_ON_TAG_ATTR_7 = /e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi;
6208
- var REGEXP_DEFAULT_ON_TAG_ATTR_8 = /u\s*r\s*l\s*\(.*/gi;
6209
- function escapeQuote(str) {
6210
- return str.replace(REGEXP_QUOTE, "&quot;");
5840
+ function removeRoute(matcherRef) {
5841
+ if (isRouteName(matcherRef)) {
5842
+ const matcher = matcherMap.get(matcherRef);
5843
+ if (matcher) {
5844
+ matcherMap.delete(matcherRef);
5845
+ matchers$1.splice(matchers$1.indexOf(matcher), 1);
5846
+ matcher.children.forEach(removeRoute);
5847
+ matcher.alias.forEach(removeRoute);
5848
+ }
5849
+ } else {
5850
+ const index = matchers$1.indexOf(matcherRef);
5851
+ if (index > -1) {
5852
+ matchers$1.splice(index, 1);
5853
+ if (matcherRef.record.name) matcherMap.delete(matcherRef.record.name);
5854
+ matcherRef.children.forEach(removeRoute);
5855
+ matcherRef.alias.forEach(removeRoute);
5856
+ }
5857
+ }
5858
+ }
5859
+ function getRoutes() {
5860
+ return matchers$1;
5861
+ }
5862
+ function insertMatcher(matcher) {
5863
+ const index = findInsertionIndex(matcher, matchers$1);
5864
+ matchers$1.splice(index, 0, matcher);
5865
+ if (matcher.record.name && !isAliasRecord(matcher)) matcherMap.set(matcher.record.name, matcher);
5866
+ }
5867
+ function resolve(location$1, currentLocation) {
5868
+ let matcher;
5869
+ let params = {};
5870
+ let path;
5871
+ let name;
5872
+ if ("name" in location$1 && location$1.name) {
5873
+ matcher = matcherMap.get(location$1.name);
5874
+ if (!matcher) throw createRouterError(1, { location: location$1 });
5875
+ name = matcher.record.name;
5876
+ params = assign(paramsFromLocation(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 && paramsFromLocation(location$1.params, matcher.keys.map((k) => k.name)));
5877
+ path = matcher.stringify(params);
5878
+ } else if (location$1.path != null) {
5879
+ path = location$1.path;
5880
+ matcher = matchers$1.find((m) => m.re.test(path));
5881
+ if (matcher) {
5882
+ params = matcher.parse(path);
5883
+ name = matcher.record.name;
5884
+ }
5885
+ } else {
5886
+ matcher = currentLocation.name ? matcherMap.get(currentLocation.name) : matchers$1.find((m) => m.re.test(currentLocation.path));
5887
+ if (!matcher) throw createRouterError(1, {
5888
+ location: location$1,
5889
+ currentLocation
5890
+ });
5891
+ name = matcher.record.name;
5892
+ params = assign({}, currentLocation.params, location$1.params);
5893
+ path = matcher.stringify(params);
5894
+ }
5895
+ const matched = [];
5896
+ let parentMatcher = matcher;
5897
+ while (parentMatcher) {
5898
+ matched.unshift(parentMatcher.record);
5899
+ parentMatcher = parentMatcher.parent;
5900
+ }
5901
+ return {
5902
+ name,
5903
+ path,
5904
+ params,
5905
+ matched,
5906
+ meta: mergeMetaFields(matched)
5907
+ };
5908
+ }
5909
+ routes.forEach((route) => addRoute(route));
5910
+ function clearRoutes() {
5911
+ matchers$1.length = 0;
5912
+ matcherMap.clear();
5913
+ }
5914
+ return {
5915
+ addRoute,
5916
+ resolve,
5917
+ removeRoute,
5918
+ clearRoutes,
5919
+ getRoutes,
5920
+ getRecordMatcher
5921
+ };
5922
+ }
5923
+ function paramsFromLocation(params, keys) {
5924
+ const newParams = {};
5925
+ for (const key of keys) if (key in params) newParams[key] = params[key];
5926
+ return newParams;
5927
+ }
5928
+ function normalizeRouteRecord(record) {
5929
+ const normalized = {
5930
+ path: record.path,
5931
+ redirect: record.redirect,
5932
+ name: record.name,
5933
+ meta: record.meta || {},
5934
+ aliasOf: record.aliasOf,
5935
+ beforeEnter: record.beforeEnter,
5936
+ props: normalizeRecordProps(record),
5937
+ children: record.children || [],
5938
+ instances: {},
5939
+ leaveGuards: /* @__PURE__ */ new Set(),
5940
+ updateGuards: /* @__PURE__ */ new Set(),
5941
+ enterCallbacks: {},
5942
+ components: "components" in record ? record.components || null : record.component && { default: record.component }
5943
+ };
5944
+ Object.defineProperty(normalized, "mods", { value: {} });
5945
+ return normalized;
5946
+ }
5947
+ function normalizeRecordProps(record) {
5948
+ const propsObject = {};
5949
+ const props = record.props || false;
5950
+ if ("component" in record) propsObject.default = props;
5951
+ else for (const name in record.components) propsObject[name] = typeof props === "object" ? props[name] : props;
5952
+ return propsObject;
5953
+ }
5954
+ function isAliasRecord(record) {
5955
+ while (record) {
5956
+ if (record.record.aliasOf) return true;
5957
+ record = record.parent;
5958
+ }
5959
+ return false;
5960
+ }
5961
+ function mergeMetaFields(matched) {
5962
+ return matched.reduce((meta, record) => assign(meta, record.meta), {});
5963
+ }
5964
+ function mergeOptions(defaults, partialOptions) {
5965
+ const options = {};
5966
+ for (const key in defaults) options[key] = key in partialOptions ? partialOptions[key] : defaults[key];
5967
+ return options;
5968
+ }
5969
+ function findInsertionIndex(matcher, matchers$1) {
5970
+ let lower = 0;
5971
+ let upper = matchers$1.length;
5972
+ while (lower !== upper) {
5973
+ const mid = lower + upper >> 1;
5974
+ if (comparePathParserScore(matcher, matchers$1[mid]) < 0) upper = mid;
5975
+ else lower = mid + 1;
6211
5976
  }
6212
- function unescapeQuote(str) {
6213
- return str.replace(REGEXP_QUOTE_2, "\"");
5977
+ const insertionAncestor = getInsertionAncestor(matcher);
5978
+ if (insertionAncestor) upper = matchers$1.lastIndexOf(insertionAncestor, upper - 1);
5979
+ return upper;
5980
+ }
5981
+ function getInsertionAncestor(matcher) {
5982
+ let ancestor = matcher;
5983
+ while (ancestor = ancestor.parent) if (isMatchable(ancestor) && comparePathParserScore(matcher, ancestor) === 0) return ancestor;
5984
+ }
5985
+ function isMatchable({ record }) {
5986
+ return !!(record.name || record.components && Object.keys(record.components).length || record.redirect);
5987
+ }
5988
+ function parseQuery(search) {
5989
+ const query = {};
5990
+ if (search === "" || search === "?") return query;
5991
+ const searchParams = (search[0] === "?" ? search.slice(1) : search).split("&");
5992
+ for (let i$1 = 0; i$1 < searchParams.length; ++i$1) {
5993
+ const searchParam = searchParams[i$1].replace(PLUS_RE, " ");
5994
+ const eqPos = searchParam.indexOf("=");
5995
+ const key = decode(eqPos < 0 ? searchParam : searchParam.slice(0, eqPos));
5996
+ const value = eqPos < 0 ? null : decode(searchParam.slice(eqPos + 1));
5997
+ if (key in query) {
5998
+ let currentValue = query[key];
5999
+ if (!isArray$3(currentValue)) currentValue = query[key] = [currentValue];
6000
+ currentValue.push(value);
6001
+ } else query[key] = value;
6214
6002
  }
6215
- function escapeHtmlEntities(str) {
6216
- return str.replace(REGEXP_ATTR_VALUE_1, function replaceUnicode(str$1, code) {
6217
- return code[0] === "x" || code[0] === "X" ? String.fromCharCode(parseInt(code.substr(1), 16)) : String.fromCharCode(parseInt(code, 10));
6003
+ return query;
6004
+ }
6005
+ function stringifyQuery(query) {
6006
+ let search = "";
6007
+ for (let key in query) {
6008
+ const value = query[key];
6009
+ key = encodeQueryKey(key);
6010
+ if (value == null) {
6011
+ if (value !== void 0) search += (search.length ? "&" : "") + key;
6012
+ continue;
6013
+ }
6014
+ (isArray$3(value) ? value.map((v) => v && encodeQueryValue(v)) : [value && encodeQueryValue(value)]).forEach((value$1) => {
6015
+ if (value$1 !== void 0) {
6016
+ search += (search.length ? "&" : "") + key;
6017
+ if (value$1 != null) search += "=" + value$1;
6018
+ }
6218
6019
  });
6219
6020
  }
6220
- function escapeDangerHtml5Entities(str) {
6221
- return str.replace(REGEXP_ATTR_VALUE_COLON, ":").replace(REGEXP_ATTR_VALUE_NEWLINE, " ");
6021
+ return search;
6022
+ }
6023
+ function normalizeQuery(query) {
6024
+ const normalizedQuery = {};
6025
+ for (const key in query) {
6026
+ const value = query[key];
6027
+ if (value !== void 0) normalizedQuery[key] = isArray$3(value) ? value.map((v) => v == null ? null : "" + v) : value == null ? value : "" + value;
6222
6028
  }
6223
- function clearNonPrintableCharacter(str) {
6224
- var str2 = "";
6225
- for (var i$1 = 0, len = str.length; i$1 < len; i$1++) str2 += str.charCodeAt(i$1) < 32 ? " " : str.charAt(i$1);
6226
- return _$2.trim(str2);
6029
+ return normalizedQuery;
6030
+ }
6031
+ var matchedRouteKey = Symbol("");
6032
+ var viewDepthKey = Symbol("");
6033
+ var routerKey = Symbol("");
6034
+ var routeLocationKey = Symbol("");
6035
+ var routerViewLocationKey = Symbol("");
6036
+ function useCallbacks() {
6037
+ let handlers$1 = [];
6038
+ function add(handler) {
6039
+ handlers$1.push(handler);
6040
+ return () => {
6041
+ const i$1 = handlers$1.indexOf(handler);
6042
+ if (i$1 > -1) handlers$1.splice(i$1, 1);
6043
+ };
6227
6044
  }
6228
- function friendlyAttrValue(str) {
6229
- str = unescapeQuote(str);
6230
- str = escapeHtmlEntities(str);
6231
- str = escapeDangerHtml5Entities(str);
6232
- str = clearNonPrintableCharacter(str);
6233
- return str;
6045
+ function reset() {
6046
+ handlers$1 = [];
6234
6047
  }
6235
- function escapeAttrValue(str) {
6236
- str = escapeQuote(str);
6237
- str = escapeHtml(str);
6238
- return str;
6048
+ return {
6049
+ add,
6050
+ list: () => handlers$1.slice(),
6051
+ reset
6052
+ };
6053
+ }
6054
+ function registerGuard(record, name, guard) {
6055
+ const removeFromList = () => {
6056
+ record[name].delete(guard);
6057
+ };
6058
+ onUnmounted(removeFromList);
6059
+ onDeactivated(removeFromList);
6060
+ onActivated(() => {
6061
+ record[name].add(guard);
6062
+ });
6063
+ record[name].add(guard);
6064
+ }
6065
+ function onBeforeRouteLeave(leaveGuard) {
6066
+ const activeRecord = inject(matchedRouteKey, {}).value;
6067
+ if (!activeRecord) return;
6068
+ registerGuard(activeRecord, "leaveGuards", leaveGuard);
6069
+ }
6070
+ function guardToPromiseFn(guard, to, from, record, name, runWithContext = (fn) => fn()) {
6071
+ const enterCallbackArray = record && (record.enterCallbacks[name] = record.enterCallbacks[name] || []);
6072
+ return () => new Promise((resolve, reject) => {
6073
+ const next = (valid) => {
6074
+ if (valid === false) reject(createRouterError(4, {
6075
+ from,
6076
+ to
6077
+ }));
6078
+ else if (valid instanceof Error) reject(valid);
6079
+ else if (isRouteLocation(valid)) reject(createRouterError(2, {
6080
+ from: to,
6081
+ to: valid
6082
+ }));
6083
+ else {
6084
+ if (enterCallbackArray && record.enterCallbacks[name] === enterCallbackArray && typeof valid === "function") enterCallbackArray.push(valid);
6085
+ resolve();
6086
+ }
6087
+ };
6088
+ const guardReturn = runWithContext(() => guard.call(record && record.instances[name], to, from, next));
6089
+ let guardCall = Promise.resolve(guardReturn);
6090
+ if (guard.length < 3) guardCall = guardCall.then(next);
6091
+ guardCall.catch((err) => reject(err));
6092
+ });
6093
+ }
6094
+ function extractComponentsGuards(matched, guardType, to, from, runWithContext = (fn) => fn()) {
6095
+ const guards = [];
6096
+ for (const record of matched) for (const name in record.components) {
6097
+ let rawComponent = record.components[name];
6098
+ if (guardType !== "beforeRouteEnter" && !record.instances[name]) continue;
6099
+ if (isRouteComponent(rawComponent)) {
6100
+ const guard = (rawComponent.__vccOpts || rawComponent)[guardType];
6101
+ guard && guards.push(guardToPromiseFn(guard, to, from, record, name, runWithContext));
6102
+ } else {
6103
+ let componentPromise = rawComponent();
6104
+ guards.push(() => componentPromise.then((resolved) => {
6105
+ if (!resolved) throw new Error(`Couldn't resolve component "${name}" at "${record.path}"`);
6106
+ const resolvedComponent = isESModule(resolved) ? resolved.default : resolved;
6107
+ record.mods[name] = resolved;
6108
+ record.components[name] = resolvedComponent;
6109
+ const guard = (resolvedComponent.__vccOpts || resolvedComponent)[guardType];
6110
+ return guard && guardToPromiseFn(guard, to, from, record, name, runWithContext)();
6111
+ }));
6112
+ }
6239
6113
  }
6240
- function onIgnoreTagStripAll() {
6241
- return "";
6114
+ return guards;
6115
+ }
6116
+ function useLink(props) {
6117
+ const router = inject(routerKey);
6118
+ const currentRoute = inject(routeLocationKey);
6119
+ const route = computed(() => {
6120
+ const to = unref(props.to);
6121
+ return router.resolve(to);
6122
+ });
6123
+ const activeRecordIndex = computed(() => {
6124
+ const { matched } = route.value;
6125
+ const { length } = matched;
6126
+ const routeMatched = matched[length - 1];
6127
+ const currentMatched = currentRoute.matched;
6128
+ if (!routeMatched || !currentMatched.length) return -1;
6129
+ const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
6130
+ if (index > -1) return index;
6131
+ const parentRecordPath = getOriginalPath(matched[length - 2]);
6132
+ return length > 1 && getOriginalPath(routeMatched) === parentRecordPath && currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index;
6133
+ });
6134
+ const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
6135
+ const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
6136
+ function navigate(e = {}) {
6137
+ if (guardEvent(e)) {
6138
+ const p = router[unref(props.replace) ? "replace" : "push"](unref(props.to)).catch(noop);
6139
+ if (props.viewTransition && typeof document !== "undefined" && "startViewTransition" in document) document.startViewTransition(() => p);
6140
+ return p;
6141
+ }
6142
+ return Promise.resolve();
6242
6143
  }
6243
- function StripTagBody(tags, next) {
6244
- if (typeof next !== "function") next = function() {};
6245
- var isRemoveAllTag = !Array.isArray(tags);
6246
- function isRemoveTag(tag) {
6247
- if (isRemoveAllTag) return true;
6248
- return _$2.indexOf(tags, tag) !== -1;
6144
+ return {
6145
+ route,
6146
+ href: computed(() => route.value.href),
6147
+ isActive,
6148
+ isExactActive,
6149
+ navigate
6150
+ };
6151
+ }
6152
+ function preferSingleVNode(vnodes) {
6153
+ return vnodes.length === 1 ? vnodes[0] : vnodes;
6154
+ }
6155
+ var RouterLink = /* @__PURE__ */ defineComponent({
6156
+ name: "RouterLink",
6157
+ compatConfig: { MODE: 3 },
6158
+ props: {
6159
+ to: {
6160
+ type: [String, Object],
6161
+ required: true
6162
+ },
6163
+ replace: Boolean,
6164
+ activeClass: String,
6165
+ exactActiveClass: String,
6166
+ custom: Boolean,
6167
+ ariaCurrentValue: {
6168
+ type: String,
6169
+ default: "page"
6249
6170
  }
6250
- var removeList = [];
6251
- var posStart = false;
6252
- return {
6253
- onIgnoreTag: function(tag, html, options) {
6254
- if (isRemoveTag(tag)) if (options.isClosing) {
6255
- var ret = "[/removed]";
6256
- var end = options.position + ret.length;
6257
- removeList.push([posStart !== false ? posStart : options.position, end]);
6258
- posStart = false;
6259
- return ret;
6260
- } else {
6261
- if (!posStart) posStart = options.position;
6262
- return "[removed]";
6171
+ },
6172
+ useLink,
6173
+ setup(props, { slots }) {
6174
+ const link = reactive(useLink(props));
6175
+ const { options } = inject(routerKey);
6176
+ const elClass = computed(() => ({
6177
+ [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
6178
+ [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
6179
+ }));
6180
+ return () => {
6181
+ const children = slots.default && preferSingleVNode(slots.default(link));
6182
+ return props.custom ? children : h("a", {
6183
+ "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
6184
+ href: link.href,
6185
+ onClick: link.navigate,
6186
+ class: elClass.value
6187
+ }, children);
6188
+ };
6189
+ }
6190
+ });
6191
+ function guardEvent(e) {
6192
+ if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) return;
6193
+ if (e.defaultPrevented) return;
6194
+ if (e.button !== void 0 && e.button !== 0) return;
6195
+ if (e.currentTarget && e.currentTarget.getAttribute) {
6196
+ const target = e.currentTarget.getAttribute("target");
6197
+ if (/\b_blank\b/i.test(target)) return;
6198
+ }
6199
+ if (e.preventDefault) e.preventDefault();
6200
+ return true;
6201
+ }
6202
+ function includesParams(outer, inner) {
6203
+ for (const key in inner) {
6204
+ const innerValue = inner[key];
6205
+ const outerValue = outer[key];
6206
+ if (typeof innerValue === "string") {
6207
+ if (innerValue !== outerValue) return false;
6208
+ } else if (!isArray$3(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i$1) => value !== outerValue[i$1])) return false;
6209
+ }
6210
+ return true;
6211
+ }
6212
+ function getOriginalPath(record) {
6213
+ return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
6214
+ }
6215
+ var getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
6216
+ var RouterViewImpl = /* @__PURE__ */ defineComponent({
6217
+ name: "RouterView",
6218
+ inheritAttrs: false,
6219
+ props: {
6220
+ name: {
6221
+ type: String,
6222
+ default: "default"
6223
+ },
6224
+ route: Object
6225
+ },
6226
+ compatConfig: { MODE: 3 },
6227
+ setup(props, { attrs, slots }) {
6228
+ const injectedRoute = inject(routerViewLocationKey);
6229
+ const routeToDisplay = computed(() => props.route || injectedRoute.value);
6230
+ const injectedDepth = inject(viewDepthKey, 0);
6231
+ const depth = computed(() => {
6232
+ let initialDepth = unref(injectedDepth);
6233
+ const { matched } = routeToDisplay.value;
6234
+ let matchedRoute;
6235
+ while ((matchedRoute = matched[initialDepth]) && !matchedRoute.components) initialDepth++;
6236
+ return initialDepth;
6237
+ });
6238
+ const matchedRouteRef = computed(() => routeToDisplay.value.matched[depth.value]);
6239
+ provide(viewDepthKey, computed(() => depth.value + 1));
6240
+ provide(matchedRouteKey, matchedRouteRef);
6241
+ provide(routerViewLocationKey, routeToDisplay);
6242
+ const viewRef = ref();
6243
+ watch(() => [
6244
+ viewRef.value,
6245
+ matchedRouteRef.value,
6246
+ props.name
6247
+ ], ([instance, to, name], [oldInstance, from, oldName]) => {
6248
+ if (to) {
6249
+ to.instances[name] = instance;
6250
+ if (from && from !== to && instance && instance === oldInstance) {
6251
+ if (!to.leaveGuards.size) to.leaveGuards = from.leaveGuards;
6252
+ if (!to.updateGuards.size) to.updateGuards = from.updateGuards;
6263
6253
  }
6264
- else return next(tag, html, options);
6265
- },
6266
- remove: function(html) {
6267
- var rethtml = "";
6268
- var lastPos = 0;
6269
- _$2.forEach(removeList, function(pos) {
6270
- rethtml += html.slice(lastPos, pos[0]);
6271
- lastPos = pos[1];
6272
- });
6273
- rethtml += html.slice(lastPos);
6274
- return rethtml;
6275
6254
  }
6255
+ if (instance && to && (!from || !isSameRouteRecord(to, from) || !oldInstance)) (to.enterCallbacks[name] || []).forEach((callback) => callback(instance));
6256
+ }, { flush: "post" });
6257
+ return () => {
6258
+ const route = routeToDisplay.value;
6259
+ const currentName = props.name;
6260
+ const matchedRoute = matchedRouteRef.value;
6261
+ const ViewComponent = matchedRoute && matchedRoute.components[currentName];
6262
+ if (!ViewComponent) return normalizeSlot(slots.default, {
6263
+ Component: ViewComponent,
6264
+ route
6265
+ });
6266
+ const routePropsOption = matchedRoute.props[currentName];
6267
+ const routeProps = routePropsOption ? routePropsOption === true ? route.params : typeof routePropsOption === "function" ? routePropsOption(route) : routePropsOption : null;
6268
+ const onVnodeUnmounted = (vnode) => {
6269
+ if (vnode.component.isUnmounted) matchedRoute.instances[currentName] = null;
6270
+ };
6271
+ const component = h(ViewComponent, assign({}, routeProps, attrs, {
6272
+ onVnodeUnmounted,
6273
+ ref: viewRef
6274
+ }));
6275
+ return normalizeSlot(slots.default, {
6276
+ Component: component,
6277
+ route
6278
+ }) || component;
6276
6279
  };
6277
6280
  }
6278
- function stripCommentTag(html) {
6279
- var retHtml = "";
6280
- var lastPos = 0;
6281
- while (lastPos < html.length) {
6282
- var i$1 = html.indexOf("<!--", lastPos);
6283
- if (i$1 === -1) {
6284
- retHtml += html.slice(lastPos);
6285
- break;
6286
- }
6287
- retHtml += html.slice(lastPos, i$1);
6288
- var j = html.indexOf("-->", i$1);
6289
- if (j === -1) break;
6290
- lastPos = j + 3;
6291
- }
6292
- return retHtml;
6281
+ });
6282
+ function normalizeSlot(slot, data) {
6283
+ if (!slot) return null;
6284
+ const slotContent = slot(data);
6285
+ return slotContent.length === 1 ? slotContent[0] : slotContent;
6286
+ }
6287
+ var RouterView = RouterViewImpl;
6288
+ function createRouter(options) {
6289
+ const matcher = createRouterMatcher(options.routes, options);
6290
+ const parseQuery$1 = options.parseQuery || parseQuery;
6291
+ const stringifyQuery$1 = options.stringifyQuery || stringifyQuery;
6292
+ const routerHistory = options.history;
6293
+ const beforeGuards = useCallbacks();
6294
+ const beforeResolveGuards = useCallbacks();
6295
+ const afterGuards = useCallbacks();
6296
+ const currentRoute = shallowRef(START_LOCATION_NORMALIZED);
6297
+ let pendingLocation = START_LOCATION_NORMALIZED;
6298
+ if (isBrowser && options.scrollBehavior && "scrollRestoration" in history) history.scrollRestoration = "manual";
6299
+ const normalizeParams = applyToParams.bind(null, (paramValue) => "" + paramValue);
6300
+ const encodeParams = applyToParams.bind(null, encodeParam);
6301
+ const decodeParams = applyToParams.bind(null, decode);
6302
+ function addRoute(parentOrRoute, route) {
6303
+ let parent;
6304
+ let record;
6305
+ if (isRouteName(parentOrRoute)) {
6306
+ parent = matcher.getRecordMatcher(parentOrRoute);
6307
+ record = route;
6308
+ } else record = parentOrRoute;
6309
+ return matcher.addRoute(record, parent);
6293
6310
  }
6294
- function stripBlankChar(html) {
6295
- var chars = html.split("");
6296
- chars = chars.filter(function(char) {
6297
- var c = char.charCodeAt(0);
6298
- if (c === 127) return false;
6299
- if (c <= 31) {
6300
- if (c === 10 || c === 13) return true;
6301
- return false;
6302
- }
6303
- return true;
6304
- });
6305
- return chars.join("");
6311
+ function removeRoute(name) {
6312
+ const recordMatcher = matcher.getRecordMatcher(name);
6313
+ if (recordMatcher) matcher.removeRoute(recordMatcher);
6306
6314
  }
6307
- exports.whiteList = getDefaultWhiteList();
6308
- exports.getDefaultWhiteList = getDefaultWhiteList;
6309
- exports.onTag = onTag;
6310
- exports.onIgnoreTag = onIgnoreTag;
6311
- exports.onTagAttr = onTagAttr;
6312
- exports.onIgnoreTagAttr = onIgnoreTagAttr;
6313
- exports.safeAttrValue = safeAttrValue;
6314
- exports.escapeHtml = escapeHtml;
6315
- exports.escapeQuote = escapeQuote;
6316
- exports.unescapeQuote = unescapeQuote;
6317
- exports.escapeHtmlEntities = escapeHtmlEntities;
6318
- exports.escapeDangerHtml5Entities = escapeDangerHtml5Entities;
6319
- exports.clearNonPrintableCharacter = clearNonPrintableCharacter;
6320
- exports.friendlyAttrValue = friendlyAttrValue;
6321
- exports.escapeAttrValue = escapeAttrValue;
6322
- exports.onIgnoreTagStripAll = onIgnoreTagStripAll;
6323
- exports.StripTagBody = StripTagBody;
6324
- exports.stripCommentTag = stripCommentTag;
6325
- exports.stripBlankChar = stripBlankChar;
6326
- exports.attributeWrapSign = "\"";
6327
- exports.cssFilter = defaultCSSFilter;
6328
- exports.getDefaultCSSWhiteList = getDefaultCSSWhiteList;
6329
- }));
6330
- var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
6331
- var _$1 = require_util();
6332
- function getTagName(html) {
6333
- var i$1 = _$1.spaceIndex(html);
6334
- var tagName;
6335
- if (i$1 === -1) tagName = html.slice(1, -1);
6336
- else tagName = html.slice(1, i$1 + 1);
6337
- tagName = _$1.trim(tagName).toLowerCase();
6338
- if (tagName.slice(0, 1) === "/") tagName = tagName.slice(1);
6339
- if (tagName.slice(-1) === "/") tagName = tagName.slice(0, -1);
6340
- return tagName;
6315
+ function getRoutes() {
6316
+ return matcher.getRoutes().map((routeMatcher) => routeMatcher.record);
6341
6317
  }
6342
- function isClosing(html) {
6343
- return html.slice(0, 2) === "</";
6318
+ function hasRoute(name) {
6319
+ return !!matcher.getRecordMatcher(name);
6344
6320
  }
6345
- function parseTag$1(html, onTag$1, escapeHtml$1) {
6346
- var rethtml = "";
6347
- var lastPos = 0;
6348
- var tagStart = false;
6349
- var quoteStart = false;
6350
- var currentPos = 0;
6351
- var len = html.length;
6352
- var currentTagName = "";
6353
- var currentHtml = "";
6354
- chariterator: for (currentPos = 0; currentPos < len; currentPos++) {
6355
- var c = html.charAt(currentPos);
6356
- if (tagStart === false) {
6357
- if (c === "<") {
6358
- tagStart = currentPos;
6359
- continue;
6360
- }
6361
- } else if (quoteStart === false) {
6362
- if (c === "<") {
6363
- rethtml += escapeHtml$1(html.slice(lastPos, currentPos));
6364
- tagStart = currentPos;
6365
- lastPos = currentPos;
6366
- continue;
6367
- }
6368
- if (c === ">" || currentPos === len - 1) {
6369
- rethtml += escapeHtml$1(html.slice(lastPos, tagStart));
6370
- currentHtml = html.slice(tagStart, currentPos + 1);
6371
- currentTagName = getTagName(currentHtml);
6372
- rethtml += onTag$1(tagStart, rethtml.length, currentTagName, currentHtml, isClosing(currentHtml));
6373
- lastPos = currentPos + 1;
6374
- tagStart = false;
6375
- continue;
6376
- }
6377
- if (c === "\"" || c === "'") {
6378
- var i$1 = 1;
6379
- var ic = html.charAt(currentPos - i$1);
6380
- while (ic.trim() === "" || ic === "=") {
6381
- if (ic === "=") {
6382
- quoteStart = c;
6383
- continue chariterator;
6384
- }
6385
- ic = html.charAt(currentPos - ++i$1);
6386
- }
6387
- }
6388
- } else if (c === quoteStart) {
6389
- quoteStart = false;
6390
- continue;
6391
- }
6321
+ function resolve(rawLocation, currentLocation) {
6322
+ currentLocation = assign({}, currentLocation || currentRoute.value);
6323
+ if (typeof rawLocation === "string") {
6324
+ const locationNormalized = parseURL(parseQuery$1, rawLocation, currentLocation.path);
6325
+ const matchedRoute$1 = matcher.resolve({ path: locationNormalized.path }, currentLocation);
6326
+ const href$1 = routerHistory.createHref(locationNormalized.fullPath);
6327
+ return assign(locationNormalized, matchedRoute$1, {
6328
+ params: decodeParams(matchedRoute$1.params),
6329
+ hash: decode(locationNormalized.hash),
6330
+ redirectedFrom: void 0,
6331
+ href: href$1
6332
+ });
6333
+ }
6334
+ let matcherLocation;
6335
+ if (rawLocation.path != null) matcherLocation = assign({}, rawLocation, { path: parseURL(parseQuery$1, rawLocation.path, currentLocation.path).path });
6336
+ else {
6337
+ const targetParams = assign({}, rawLocation.params);
6338
+ for (const key in targetParams) if (targetParams[key] == null) delete targetParams[key];
6339
+ matcherLocation = assign({}, rawLocation, { params: encodeParams(targetParams) });
6340
+ currentLocation.params = encodeParams(currentLocation.params);
6392
6341
  }
6393
- if (lastPos < len) rethtml += escapeHtml$1(html.substr(lastPos));
6394
- return rethtml;
6342
+ const matchedRoute = matcher.resolve(matcherLocation, currentLocation);
6343
+ const hash = rawLocation.hash || "";
6344
+ matchedRoute.params = normalizeParams(decodeParams(matchedRoute.params));
6345
+ const fullPath = stringifyURL(stringifyQuery$1, assign({}, rawLocation, {
6346
+ hash: encodeHash(hash),
6347
+ path: matchedRoute.path
6348
+ }));
6349
+ const href = routerHistory.createHref(fullPath);
6350
+ return assign({
6351
+ fullPath,
6352
+ hash,
6353
+ query: stringifyQuery$1 === stringifyQuery ? normalizeQuery(rawLocation.query) : rawLocation.query || {}
6354
+ }, matchedRoute, {
6355
+ redirectedFrom: void 0,
6356
+ href
6357
+ });
6395
6358
  }
6396
- var REGEXP_ILLEGAL_ATTR_NAME = /[^a-zA-Z0-9\\_:.-]/gim;
6397
- function parseAttr$1(html, onAttr$1) {
6398
- var lastPos = 0;
6399
- var lastMarkPos = 0;
6400
- var retAttrs = [];
6401
- var tmpName = false;
6402
- var len = html.length;
6403
- function addAttr(name, value) {
6404
- name = _$1.trim(name);
6405
- name = name.replace(REGEXP_ILLEGAL_ATTR_NAME, "").toLowerCase();
6406
- if (name.length < 1) return;
6407
- var ret = onAttr$1(name, value || "");
6408
- if (ret) retAttrs.push(ret);
6409
- }
6410
- for (var i$1 = 0; i$1 < len; i$1++) {
6411
- var c = html.charAt(i$1);
6412
- var v, j;
6413
- if (tmpName === false && c === "=") {
6414
- tmpName = html.slice(lastPos, i$1);
6415
- lastPos = i$1 + 1;
6416
- lastMarkPos = html.charAt(lastPos) === "\"" || html.charAt(lastPos) === "'" ? lastPos : findNextQuotationMark(html, i$1 + 1);
6417
- continue;
6418
- }
6419
- if (tmpName !== false) {
6420
- if (i$1 === lastMarkPos) {
6421
- j = html.indexOf(c, i$1 + 1);
6422
- if (j === -1) break;
6423
- else {
6424
- v = _$1.trim(html.slice(lastMarkPos + 1, j));
6425
- addAttr(tmpName, v);
6426
- tmpName = false;
6427
- i$1 = j;
6428
- lastPos = i$1 + 1;
6429
- continue;
6430
- }
6431
- }
6432
- }
6433
- if (/\s|\n|\t/.test(c)) {
6434
- html = html.replace(/\s|\n|\t/g, " ");
6435
- if (tmpName === false) {
6436
- j = findNextEqual(html, i$1);
6437
- if (j === -1) {
6438
- v = _$1.trim(html.slice(lastPos, i$1));
6439
- addAttr(v);
6440
- tmpName = false;
6441
- lastPos = i$1 + 1;
6442
- continue;
6443
- } else {
6444
- i$1 = j - 1;
6445
- continue;
6446
- }
6447
- } else {
6448
- j = findBeforeEqual(html, i$1 - 1);
6449
- if (j === -1) {
6450
- v = _$1.trim(html.slice(lastPos, i$1));
6451
- v = stripQuoteWrap(v);
6452
- addAttr(tmpName, v);
6453
- tmpName = false;
6454
- lastPos = i$1 + 1;
6455
- continue;
6456
- } else continue;
6457
- }
6359
+ function locationAsObject(to) {
6360
+ return typeof to === "string" ? parseURL(parseQuery$1, to, currentRoute.value.path) : assign({}, to);
6361
+ }
6362
+ function checkCanceledNavigation(to, from) {
6363
+ if (pendingLocation !== to) return createRouterError(8, {
6364
+ from,
6365
+ to
6366
+ });
6367
+ }
6368
+ function push(to) {
6369
+ return pushWithRedirect(to);
6370
+ }
6371
+ function replace(to) {
6372
+ return push(assign(locationAsObject(to), { replace: true }));
6373
+ }
6374
+ function handleRedirectRecord(to) {
6375
+ const lastMatched = to.matched[to.matched.length - 1];
6376
+ if (lastMatched && lastMatched.redirect) {
6377
+ const { redirect } = lastMatched;
6378
+ let newTargetLocation = typeof redirect === "function" ? redirect(to) : redirect;
6379
+ if (typeof newTargetLocation === "string") {
6380
+ newTargetLocation = newTargetLocation.includes("?") || newTargetLocation.includes("#") ? newTargetLocation = locationAsObject(newTargetLocation) : { path: newTargetLocation };
6381
+ newTargetLocation.params = {};
6458
6382
  }
6383
+ return assign({
6384
+ query: to.query,
6385
+ hash: to.hash,
6386
+ params: newTargetLocation.path != null ? {} : to.params
6387
+ }, newTargetLocation);
6459
6388
  }
6460
- if (lastPos < html.length) if (tmpName === false) addAttr(html.slice(lastPos));
6461
- else addAttr(tmpName, stripQuoteWrap(_$1.trim(html.slice(lastPos))));
6462
- return _$1.trim(retAttrs.join(" "));
6463
6389
  }
6464
- function findNextEqual(str, i$1) {
6465
- for (; i$1 < str.length; i$1++) {
6466
- var c = str[i$1];
6467
- if (c === " ") continue;
6468
- if (c === "=") return i$1;
6469
- return -1;
6390
+ function pushWithRedirect(to, redirectedFrom) {
6391
+ const targetLocation = pendingLocation = resolve(to);
6392
+ const from = currentRoute.value;
6393
+ const data = to.state;
6394
+ const force = to.force;
6395
+ const replace$1 = to.replace === true;
6396
+ const shouldRedirect = handleRedirectRecord(targetLocation);
6397
+ if (shouldRedirect) return pushWithRedirect(assign(locationAsObject(shouldRedirect), {
6398
+ state: typeof shouldRedirect === "object" ? assign({}, data, shouldRedirect.state) : data,
6399
+ force,
6400
+ replace: replace$1
6401
+ }), redirectedFrom || targetLocation);
6402
+ const toLocation = targetLocation;
6403
+ toLocation.redirectedFrom = redirectedFrom;
6404
+ let failure;
6405
+ if (!force && isSameRouteLocation(stringifyQuery$1, from, targetLocation)) {
6406
+ failure = createRouterError(16, {
6407
+ to: toLocation,
6408
+ from
6409
+ });
6410
+ handleScroll(from, from, true, false);
6470
6411
  }
6412
+ return (failure ? Promise.resolve(failure) : navigate(toLocation, from)).catch((error) => isNavigationFailure(error) ? isNavigationFailure(error, 2) ? error : markAsReady(error) : triggerError(error, toLocation, from)).then((failure$1) => {
6413
+ if (failure$1) {
6414
+ if (isNavigationFailure(failure$1, 2)) return pushWithRedirect(assign({ replace: replace$1 }, locationAsObject(failure$1.to), {
6415
+ state: typeof failure$1.to === "object" ? assign({}, data, failure$1.to.state) : data,
6416
+ force
6417
+ }), redirectedFrom || toLocation);
6418
+ } else failure$1 = finalizeNavigation(toLocation, from, true, replace$1, data);
6419
+ triggerAfterEach(toLocation, from, failure$1);
6420
+ return failure$1;
6421
+ });
6471
6422
  }
6472
- function findNextQuotationMark(str, i$1) {
6473
- for (; i$1 < str.length; i$1++) {
6474
- var c = str[i$1];
6475
- if (c === " ") continue;
6476
- if (c === "'" || c === "\"") return i$1;
6477
- return -1;
6478
- }
6423
+ function checkCanceledNavigationAndReject(to, from) {
6424
+ const error = checkCanceledNavigation(to, from);
6425
+ return error ? Promise.reject(error) : Promise.resolve();
6479
6426
  }
6480
- function findBeforeEqual(str, i$1) {
6481
- for (; i$1 > 0; i$1--) {
6482
- var c = str[i$1];
6483
- if (c === " ") continue;
6484
- if (c === "=") return i$1;
6485
- return -1;
6486
- }
6427
+ function runWithContext(fn) {
6428
+ const app = installedApps.values().next().value;
6429
+ return app && typeof app.runWithContext === "function" ? app.runWithContext(fn) : fn();
6487
6430
  }
6488
- function isQuoteWrapString(text) {
6489
- if (text[0] === "\"" && text[text.length - 1] === "\"" || text[0] === "'" && text[text.length - 1] === "'") return true;
6490
- else return false;
6431
+ function navigate(to, from) {
6432
+ let guards;
6433
+ const [leavingRecords, updatingRecords, enteringRecords] = extractChangingRecords(to, from);
6434
+ guards = extractComponentsGuards(leavingRecords.reverse(), "beforeRouteLeave", to, from);
6435
+ for (const record of leavingRecords) record.leaveGuards.forEach((guard) => {
6436
+ guards.push(guardToPromiseFn(guard, to, from));
6437
+ });
6438
+ const canceledNavigationCheck = checkCanceledNavigationAndReject.bind(null, to, from);
6439
+ guards.push(canceledNavigationCheck);
6440
+ return runGuardQueue(guards).then(() => {
6441
+ guards = [];
6442
+ for (const guard of beforeGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
6443
+ guards.push(canceledNavigationCheck);
6444
+ return runGuardQueue(guards);
6445
+ }).then(() => {
6446
+ guards = extractComponentsGuards(updatingRecords, "beforeRouteUpdate", to, from);
6447
+ for (const record of updatingRecords) record.updateGuards.forEach((guard) => {
6448
+ guards.push(guardToPromiseFn(guard, to, from));
6449
+ });
6450
+ guards.push(canceledNavigationCheck);
6451
+ return runGuardQueue(guards);
6452
+ }).then(() => {
6453
+ guards = [];
6454
+ for (const record of enteringRecords) if (record.beforeEnter) if (isArray$3(record.beforeEnter)) for (const beforeEnter of record.beforeEnter) guards.push(guardToPromiseFn(beforeEnter, to, from));
6455
+ else guards.push(guardToPromiseFn(record.beforeEnter, to, from));
6456
+ guards.push(canceledNavigationCheck);
6457
+ return runGuardQueue(guards);
6458
+ }).then(() => {
6459
+ to.matched.forEach((record) => record.enterCallbacks = {});
6460
+ guards = extractComponentsGuards(enteringRecords, "beforeRouteEnter", to, from, runWithContext);
6461
+ guards.push(canceledNavigationCheck);
6462
+ return runGuardQueue(guards);
6463
+ }).then(() => {
6464
+ guards = [];
6465
+ for (const guard of beforeResolveGuards.list()) guards.push(guardToPromiseFn(guard, to, from));
6466
+ guards.push(canceledNavigationCheck);
6467
+ return runGuardQueue(guards);
6468
+ }).catch((err) => isNavigationFailure(err, 8) ? err : Promise.reject(err));
6491
6469
  }
6492
- function stripQuoteWrap(text) {
6493
- if (isQuoteWrapString(text)) return text.substr(1, text.length - 2);
6494
- else return text;
6470
+ function triggerAfterEach(to, from, failure) {
6471
+ afterGuards.list().forEach((guard) => runWithContext(() => guard(to, from, failure)));
6495
6472
  }
6496
- exports.parseTag = parseTag$1;
6497
- exports.parseAttr = parseAttr$1;
6498
- }));
6499
- var require_xss = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6500
- var FilterCSS = require_lib$1().FilterCSS;
6501
- var DEFAULT$1 = require_default();
6502
- var parser$1 = require_parser();
6503
- var parseTag = parser$1.parseTag;
6504
- var parseAttr = parser$1.parseAttr;
6505
- var _ = require_util();
6506
- function isNull(obj) {
6507
- return obj === void 0 || obj === null;
6473
+ function finalizeNavigation(toLocation, from, isPush, replace$1, data) {
6474
+ const error = checkCanceledNavigation(toLocation, from);
6475
+ if (error) return error;
6476
+ const isFirstNavigation = from === START_LOCATION_NORMALIZED;
6477
+ const state = !isBrowser ? {} : history.state;
6478
+ if (isPush) if (replace$1 || isFirstNavigation) routerHistory.replace(toLocation.fullPath, assign({ scroll: isFirstNavigation && state && state.scroll }, data));
6479
+ else routerHistory.push(toLocation.fullPath, data);
6480
+ currentRoute.value = toLocation;
6481
+ handleScroll(toLocation, from, isPush, isFirstNavigation);
6482
+ markAsReady();
6508
6483
  }
6509
- function getAttrs(html) {
6510
- var i$1 = _.spaceIndex(html);
6511
- if (i$1 === -1) return {
6512
- html: "",
6513
- closing: html[html.length - 2] === "/"
6514
- };
6515
- html = _.trim(html.slice(i$1 + 1, -1));
6516
- var isClosing$1 = html[html.length - 1] === "/";
6517
- if (isClosing$1) html = _.trim(html.slice(0, -1));
6518
- return {
6519
- html,
6520
- closing: isClosing$1
6521
- };
6484
+ let removeHistoryListener;
6485
+ function setupListeners() {
6486
+ if (removeHistoryListener) return;
6487
+ removeHistoryListener = routerHistory.listen((to, _from, info) => {
6488
+ if (!router.listening) return;
6489
+ const toLocation = resolve(to);
6490
+ const shouldRedirect = handleRedirectRecord(toLocation);
6491
+ if (shouldRedirect) {
6492
+ pushWithRedirect(assign(shouldRedirect, {
6493
+ replace: true,
6494
+ force: true
6495
+ }), toLocation).catch(noop);
6496
+ return;
6497
+ }
6498
+ pendingLocation = toLocation;
6499
+ const from = currentRoute.value;
6500
+ if (isBrowser) saveScrollPosition(getScrollKey(from.fullPath, info.delta), computeScrollPosition());
6501
+ navigate(toLocation, from).catch((error) => {
6502
+ if (isNavigationFailure(error, 12)) return error;
6503
+ if (isNavigationFailure(error, 2)) {
6504
+ pushWithRedirect(assign(locationAsObject(error.to), { force: true }), toLocation).then((failure) => {
6505
+ if (isNavigationFailure(failure, 20) && !info.delta && info.type === NavigationType.pop) routerHistory.go(-1, false);
6506
+ }).catch(noop);
6507
+ return Promise.reject();
6508
+ }
6509
+ if (info.delta) routerHistory.go(-info.delta, false);
6510
+ return triggerError(error, toLocation, from);
6511
+ }).then((failure) => {
6512
+ failure = failure || finalizeNavigation(toLocation, from, false);
6513
+ if (failure) {
6514
+ if (info.delta && !isNavigationFailure(failure, 8)) routerHistory.go(-info.delta, false);
6515
+ else if (info.type === NavigationType.pop && isNavigationFailure(failure, 20)) routerHistory.go(-1, false);
6516
+ }
6517
+ triggerAfterEach(toLocation, from, failure);
6518
+ }).catch(noop);
6519
+ });
6522
6520
  }
6523
- function shallowCopyObject(obj) {
6524
- var ret = {};
6525
- for (var i$1 in obj) ret[i$1] = obj[i$1];
6526
- return ret;
6521
+ let readyHandlers = useCallbacks();
6522
+ let errorListeners = useCallbacks();
6523
+ let ready;
6524
+ function triggerError(error, to, from) {
6525
+ markAsReady(error);
6526
+ const list = errorListeners.list();
6527
+ if (list.length) list.forEach((handler) => handler(error, to, from));
6528
+ else console.error(error);
6529
+ return Promise.reject(error);
6527
6530
  }
6528
- function keysToLowerCase(obj) {
6529
- var ret = {};
6530
- for (var i$1 in obj) if (Array.isArray(obj[i$1])) ret[i$1.toLowerCase()] = obj[i$1].map(function(item) {
6531
- return item.toLowerCase();
6531
+ function isReady() {
6532
+ if (ready && currentRoute.value !== START_LOCATION_NORMALIZED) return Promise.resolve();
6533
+ return new Promise((resolve$1, reject) => {
6534
+ readyHandlers.add([resolve$1, reject]);
6532
6535
  });
6533
- else ret[i$1.toLowerCase()] = obj[i$1];
6534
- return ret;
6535
6536
  }
6536
- function FilterXSS$1(options) {
6537
- options = shallowCopyObject(options || {});
6538
- if (options.stripIgnoreTag) {
6539
- if (options.onIgnoreTag) console.error("Notes: cannot use these two options \"stripIgnoreTag\" and \"onIgnoreTag\" at the same time");
6540
- options.onIgnoreTag = DEFAULT$1.onIgnoreTagStripAll;
6541
- }
6542
- if (options.whiteList || options.allowList) options.whiteList = keysToLowerCase(options.whiteList || options.allowList);
6543
- else options.whiteList = DEFAULT$1.whiteList;
6544
- this.attributeWrapSign = options.singleQuotedAttributeValue === true ? "'" : DEFAULT$1.attributeWrapSign;
6545
- options.onTag = options.onTag || DEFAULT$1.onTag;
6546
- options.onTagAttr = options.onTagAttr || DEFAULT$1.onTagAttr;
6547
- options.onIgnoreTag = options.onIgnoreTag || DEFAULT$1.onIgnoreTag;
6548
- options.onIgnoreTagAttr = options.onIgnoreTagAttr || DEFAULT$1.onIgnoreTagAttr;
6549
- options.safeAttrValue = options.safeAttrValue || DEFAULT$1.safeAttrValue;
6550
- options.escapeHtml = options.escapeHtml || DEFAULT$1.escapeHtml;
6551
- this.options = options;
6552
- if (options.css === false) this.cssFilter = false;
6553
- else {
6554
- options.css = options.css || {};
6555
- this.cssFilter = new FilterCSS(options.css);
6537
+ function markAsReady(err) {
6538
+ if (!ready) {
6539
+ ready = !err;
6540
+ setupListeners();
6541
+ readyHandlers.list().forEach(([resolve$1, reject]) => err ? reject(err) : resolve$1());
6542
+ readyHandlers.reset();
6556
6543
  }
6544
+ return err;
6557
6545
  }
6558
- FilterXSS$1.prototype.process = function(html) {
6559
- html = html || "";
6560
- html = html.toString();
6561
- if (!html) return "";
6562
- var me = this;
6563
- var options = me.options;
6564
- var whiteList = options.whiteList;
6565
- var onTag$1 = options.onTag;
6566
- var onIgnoreTag$1 = options.onIgnoreTag;
6567
- var onTagAttr$1 = options.onTagAttr;
6568
- var onIgnoreTagAttr$1 = options.onIgnoreTagAttr;
6569
- var safeAttrValue$2 = options.safeAttrValue;
6570
- var escapeHtml$1 = options.escapeHtml;
6571
- var attributeWrapSign = me.attributeWrapSign;
6572
- var cssFilter = me.cssFilter;
6573
- if (options.stripBlankChar) html = DEFAULT$1.stripBlankChar(html);
6574
- if (!options.allowCommentTag) html = DEFAULT$1.stripCommentTag(html);
6575
- var stripIgnoreTagBody = false;
6576
- if (options.stripIgnoreTagBody) {
6577
- stripIgnoreTagBody = DEFAULT$1.StripTagBody(options.stripIgnoreTagBody, onIgnoreTag$1);
6578
- onIgnoreTag$1 = stripIgnoreTagBody.onIgnoreTag;
6579
- }
6580
- var retHtml = parseTag(html, function(sourcePosition, position, tag, html$1, isClosing$1) {
6581
- var info = {
6582
- sourcePosition,
6583
- position,
6584
- isClosing: isClosing$1,
6585
- isWhite: Object.prototype.hasOwnProperty.call(whiteList, tag)
6586
- };
6587
- var ret = onTag$1(tag, html$1, info);
6588
- if (!isNull(ret)) return ret;
6589
- if (info.isWhite) {
6590
- if (info.isClosing) return "</" + tag + ">";
6591
- var attrs = getAttrs(html$1);
6592
- var whiteAttrList = whiteList[tag];
6593
- var attrsHtml = parseAttr(attrs.html, function(name, value) {
6594
- var isWhiteAttr = _.indexOf(whiteAttrList, name) !== -1;
6595
- var ret$1 = onTagAttr$1(tag, name, value, isWhiteAttr);
6596
- if (!isNull(ret$1)) return ret$1;
6597
- if (isWhiteAttr) {
6598
- value = safeAttrValue$2(tag, name, value, cssFilter);
6599
- if (value) return name + "=" + attributeWrapSign + value + attributeWrapSign;
6600
- else return name;
6601
- } else {
6602
- ret$1 = onIgnoreTagAttr$1(tag, name, value, isWhiteAttr);
6603
- if (!isNull(ret$1)) return ret$1;
6604
- return;
6605
- }
6606
- });
6607
- html$1 = "<" + tag;
6608
- if (attrsHtml) html$1 += " " + attrsHtml;
6609
- if (attrs.closing) html$1 += " /";
6610
- html$1 += ">";
6611
- return html$1;
6612
- } else {
6613
- ret = onIgnoreTag$1(tag, html$1, info);
6614
- if (!isNull(ret)) return ret;
6615
- return escapeHtml$1(html$1);
6546
+ function handleScroll(to, from, isPush, isFirstNavigation) {
6547
+ const { scrollBehavior } = options;
6548
+ if (!isBrowser || !scrollBehavior) return Promise.resolve();
6549
+ const scrollPosition = !isPush && getSavedScrollPosition(getScrollKey(to.fullPath, 0)) || (isFirstNavigation || !isPush) && history.state && history.state.scroll || null;
6550
+ return nextTick().then(() => scrollBehavior(to, from, scrollPosition)).then((position) => position && scrollToPosition(position)).catch((err) => triggerError(err, to, from));
6551
+ }
6552
+ const go = (delta) => routerHistory.go(delta);
6553
+ let started;
6554
+ const installedApps = /* @__PURE__ */ new Set();
6555
+ const router = {
6556
+ currentRoute,
6557
+ listening: true,
6558
+ addRoute,
6559
+ removeRoute,
6560
+ clearRoutes: matcher.clearRoutes,
6561
+ hasRoute,
6562
+ getRoutes,
6563
+ resolve,
6564
+ options,
6565
+ push,
6566
+ replace,
6567
+ go,
6568
+ back: () => go(-1),
6569
+ forward: () => go(1),
6570
+ beforeEach: beforeGuards.add,
6571
+ beforeResolve: beforeResolveGuards.add,
6572
+ afterEach: afterGuards.add,
6573
+ onError: errorListeners.add,
6574
+ isReady,
6575
+ install(app) {
6576
+ const router$1 = this;
6577
+ app.component("RouterLink", RouterLink);
6578
+ app.component("RouterView", RouterView);
6579
+ app.config.globalProperties.$router = router$1;
6580
+ Object.defineProperty(app.config.globalProperties, "$route", {
6581
+ enumerable: true,
6582
+ get: () => unref(currentRoute)
6583
+ });
6584
+ if (isBrowser && !started && currentRoute.value === START_LOCATION_NORMALIZED) {
6585
+ started = true;
6586
+ push(routerHistory.location).catch((err) => {});
6616
6587
  }
6617
- }, escapeHtml$1);
6618
- if (stripIgnoreTagBody) retHtml = stripIgnoreTagBody.remove(retHtml);
6619
- return retHtml;
6588
+ const reactiveRoute = {};
6589
+ for (const key in START_LOCATION_NORMALIZED) Object.defineProperty(reactiveRoute, key, {
6590
+ get: () => currentRoute.value[key],
6591
+ enumerable: true
6592
+ });
6593
+ app.provide(routerKey, router$1);
6594
+ app.provide(routeLocationKey, shallowReactive(reactiveRoute));
6595
+ app.provide(routerViewLocationKey, currentRoute);
6596
+ const unmountApp = app.unmount;
6597
+ installedApps.add(app);
6598
+ app.unmount = function() {
6599
+ installedApps.delete(app);
6600
+ if (installedApps.size < 1) {
6601
+ pendingLocation = START_LOCATION_NORMALIZED;
6602
+ removeHistoryListener && removeHistoryListener();
6603
+ removeHistoryListener = null;
6604
+ currentRoute.value = START_LOCATION_NORMALIZED;
6605
+ started = false;
6606
+ ready = false;
6607
+ }
6608
+ unmountApp();
6609
+ };
6610
+ }
6620
6611
  };
6621
- module.exports = FilterXSS$1;
6622
- }));
6623
- var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6624
- var DEFAULT = require_default();
6625
- var parser = require_parser();
6626
- var FilterXSS = require_xss();
6627
- function filterXSS(html, options) {
6628
- return new FilterXSS(options).process(html);
6612
+ function runGuardQueue(guards) {
6613
+ return guards.reduce((promise, guard) => promise.then(() => runWithContext(guard)), Promise.resolve());
6629
6614
  }
6630
- exports = module.exports = filterXSS;
6631
- exports.filterXSS = filterXSS;
6632
- exports.FilterXSS = FilterXSS;
6633
- (function() {
6634
- for (var i$1 in DEFAULT) exports[i$1] = DEFAULT[i$1];
6635
- for (var j in parser) exports[j] = parser[j];
6636
- })();
6637
- if (typeof window !== "undefined") window.filterXSS = module.exports;
6638
- function isWorkerEnv() {
6639
- return typeof self !== "undefined" && typeof DedicatedWorkerGlobalScope !== "undefined" && self instanceof DedicatedWorkerGlobalScope;
6615
+ return router;
6616
+ }
6617
+ function extractChangingRecords(to, from) {
6618
+ const leavingRecords = [];
6619
+ const updatingRecords = [];
6620
+ const enteringRecords = [];
6621
+ const len = Math.max(from.matched.length, to.matched.length);
6622
+ for (let i$1 = 0; i$1 < len; i$1++) {
6623
+ const recordFrom = from.matched[i$1];
6624
+ if (recordFrom) if (to.matched.find((record) => isSameRouteRecord(record, recordFrom))) updatingRecords.push(recordFrom);
6625
+ else leavingRecords.push(recordFrom);
6626
+ const recordTo = to.matched[i$1];
6627
+ if (recordTo) {
6628
+ if (!from.matched.find((record) => isSameRouteRecord(record, recordTo))) enteringRecords.push(recordTo);
6629
+ }
6640
6630
  }
6641
- if (isWorkerEnv()) self.filterXSS = module.exports;
6642
- }));
6631
+ return [
6632
+ leavingRecords,
6633
+ updatingRecords,
6634
+ enteringRecords
6635
+ ];
6636
+ }
6637
+ function useRouter() {
6638
+ return inject(routerKey);
6639
+ }
6640
+ function useRoute(_name) {
6641
+ return inject(routeLocationKey);
6642
+ }
6643
6643
  var require_isSymbol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6644
6644
  var baseGetTag = require__baseGetTag(), isObjectLike = require_isObjectLike();
6645
6645
  var symbolTag = "[object Symbol]";
@@ -6786,4 +6786,4 @@ function truncateBeforeLast(text, maxLength, lastCharsLength = 5) {
6786
6786
  if (lastCharsLength < 1) return chars.slice(0, maxLength).join("") + ellipsis;
6787
6787
  return chars.slice(0, maxLength - lastCharsLength - ellipsisLength).join("") + ellipsis + chars.slice(-lastCharsLength).join("");
6788
6788
  }
6789
- export { flattedChildren as $, escapeStringRegexp as $t, ElInput as A, _Symbol_default as An, d_arrow_right_default as At, useFocusController as B, computedEager as Bn, zoom_in_default as Bt, isToolMessage as C, isFunction_default as Cn, calendar_default as Ct, TinyColor as D, isSymbol_default as Dn, clock_default as Dt, ElButton as E, _arrayMap_default as En, circle_close_default as Et, formItemContextKey as F, useDocumentVisibility as Fn, more_default as Ft, defaultNamespace as G, obtainAllFocusableElements$1 as Gn, getStyle as Gt, useZIndex as H, isIOS as Hn, scrollIntoView as Ht, ElIcon as I, useEventListener as In, more_filled_default as It, useLocale as J, debugWarn as Jt, useGetDerivedNamespace as K, triggerEvent as Kn, hasClass as Kt, _export_sfc as L, useResizeObserver as Ln, picture_filled_default as Lt, useFormItemInputId as M, _freeGlobal_default as Mn, document_default as Mt, useFormDisabled as N, onClickOutside as Nn, loading_default as Nt, ElFocusTrap as O, isObjectLike_default as On, close_default as Ot, useFormSize as P, unrefElement as Pn, minus_default as Pt, PatchFlags as Q, capitalize$1 as Qt, useGlobalComponentSettings as R, useVModel as Rn, plus_default as Rt, isThinkingGroupMessage as S, _toSource_default as Sn, arrow_up_default as St, createEventBus as T, isArray_default as Tn, circle_check_default as Tt, useId as U, tryOnScopeDispose as Un, addClass as Ut, useSizeProp as V, isClient as Vn, getScrollBarWidth as Vt, useIdInjection as W, useTimeoutFn as Wn, addUnit as Wt, mutable as X, entriesOf as Xt, useDeprecated as Y, throwError as Yt, isKorean as Z, getProp as Zt, isNavigationFailure as _, eq_default as _n, buildProps as _t, require__toKey as a, _baseSet_default as an, UPDATE_MODEL_EVENT as at, useRouter as b, _defineProperty_default as bn, arrow_left_default as bt, require__arrayMap as c, get_default as cn, withInstall as ct, require_isSymbol as d, _castPath_default as dn, CloseComponents as dt, isBoolean as en, isValidComponentSize as et, require_lib as f, _MapCache_default as fn, TypeComponents as ft, createWebHistory as g, _assignValue_default as gn, buildProp as gt, createRouter as h, _isKey_default as hn, iconPropType as ht, require__baseGet as i, isUndefined as in, INPUT_EVENT as it, useFormItem as j, _root_default as jn, delete_default as jt, FOCUS_TRAP_INJECTION_KEY as k, _baseGetTag_default as kn, d_arrow_left_default as kt, require_memoize as l, _baseGet_default as ln, withInstallFunction as lt, RouterView as m, _ListCache_default as mn, ValidateComponentsMap as mt, truncateBeforeLast as n, isEmpty as nn, componentSizes as nt, require__castPath as o, isNil_default as on, datePickTypes as ot, RouterLink as p, _Map_default as pn, TypeComponentsMap as pt, useNamespace as q, removeClass as qt, require_get as r, isNumber as rn, CHANGE_EVENT as rt, require_toString as s, fromPairs_default as sn, EVENT_CODE as st, truncate as t, isElement as tn, componentSizeMap as tt, require__isKey as u, _toKey_default as un, withNoopInstall as ut, onBeforeRouteLeave as v, _baseAssignValue_default as vn, definePropType as vt, isWorkflowUpdatedMessage as w, isObject_default as wn, check_default as wt, isTaskAbortedMessage as x, _getNative_default as xn, arrow_right_default as xt, useRoute as y, _isIndex_default as yn, arrow_down_default as yt, useGlobalConfig as z, useWindowFocus as zn, warning_filled_default as zt };
6789
+ export { flattedChildren as $, escapeStringRegexp as $t, ElInput as A, _Symbol_default as An, d_arrow_right_default as At, useFocusController as B, computedEager as Bn, zoom_in_default as Bt, isWorkflowUpdatedMessage as C, isFunction_default as Cn, calendar_default as Ct, TinyColor as D, isSymbol_default as Dn, clock_default as Dt, ElButton as E, _arrayMap_default as En, circle_close_default as Et, formItemContextKey as F, useDocumentVisibility as Fn, more_default as Ft, defaultNamespace as G, obtainAllFocusableElements$1 as Gn, getStyle as Gt, useZIndex as H, isIOS as Hn, scrollIntoView as Ht, ElIcon as I, useEventListener as In, more_filled_default as It, useLocale as J, debugWarn as Jt, useGetDerivedNamespace as K, triggerEvent as Kn, hasClass as Kt, _export_sfc as L, useResizeObserver as Ln, picture_filled_default as Lt, useFormItemInputId as M, _freeGlobal_default as Mn, document_default as Mt, useFormDisabled as N, onClickOutside as Nn, loading_default as Nt, ElFocusTrap as O, isObjectLike_default as On, close_default as Ot, useFormSize as P, unrefElement as Pn, minus_default as Pt, PatchFlags as Q, capitalize$1 as Qt, useGlobalComponentSettings as R, useVModel as Rn, plus_default as Rt, isToolMessage as S, _toSource_default as Sn, arrow_up_default as St, createEventBus as T, isArray_default as Tn, circle_check_default as Tt, useId as U, tryOnScopeDispose as Un, addClass as Ut, useSizeProp as V, isClient as Vn, getScrollBarWidth as Vt, useIdInjection as W, useTimeoutFn as Wn, addUnit as Wt, mutable as X, entriesOf as Xt, useDeprecated as Y, throwError as Yt, isKorean as Z, getProp as Zt, onBeforeRouteLeave as _, eq_default as _n, buildProps as _t, require__toKey as a, _baseSet_default as an, UPDATE_MODEL_EVENT as at, isTaskAbortedMessage as b, _defineProperty_default as bn, arrow_left_default as bt, require__arrayMap as c, get_default as cn, withInstall as ct, require_isSymbol as d, _castPath_default as dn, CloseComponents as dt, isBoolean as en, isValidComponentSize as et, RouterLink as f, _MapCache_default as fn, TypeComponents as ft, isNavigationFailure as g, _assignValue_default as gn, buildProp as gt, createWebHistory as h, _isKey_default as hn, iconPropType as ht, require__baseGet as i, isUndefined as in, INPUT_EVENT as it, useFormItem as j, _root_default as jn, delete_default as jt, FOCUS_TRAP_INJECTION_KEY as k, _baseGetTag_default as kn, d_arrow_left_default as kt, require_memoize as l, _baseGet_default as ln, withInstallFunction as lt, createRouter as m, _ListCache_default as mn, ValidateComponentsMap as mt, truncateBeforeLast as n, isEmpty as nn, componentSizes as nt, require__castPath as o, isNil_default as on, datePickTypes as ot, RouterView as p, _Map_default as pn, TypeComponentsMap as pt, useNamespace as q, removeClass as qt, require_get as r, isNumber as rn, CHANGE_EVENT as rt, require_toString as s, fromPairs_default as sn, EVENT_CODE as st, truncate as t, isElement as tn, componentSizeMap as tt, require__isKey as u, _toKey_default as un, withNoopInstall as ut, useRoute as v, _baseAssignValue_default as vn, definePropType as vt, require_lib as w, isObject_default as wn, check_default as wt, isThinkingGroupMessage as x, _getNative_default as xn, arrow_right_default as xt, useRouter as y, _isIndex_default as yn, arrow_down_default as yt, useGlobalConfig as z, useWindowFocus as zn, warning_filled_default as zt };