@kinetis/vector-ui 0.12.5 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +98 -3
- package/README.md +13 -5
- package/app/components/Vx/Cell/Markdown.vue +1 -1
- package/app/components/Vx/Cell/RichText.vue +1 -1
- package/app/components/Vx/CommandPalette.vue +16 -2
- package/app/components/Vx/FieldsForm.vue +10 -2
- package/app/components/Vx/Input/KeyValue.vue +2 -2
- package/app/components/Vx/Input/Markdown.vue +5 -0
- package/app/components/Vx/Input/Money.vue +1 -1
- package/app/components/Vx/Input/RichText.vue +6 -1
- package/app/components/Vx/Input/Text.vue +18 -2
- package/app/components/Vx/Input/Textarea.vue +19 -2
- package/app/components/Vx/InputAddons.vue +45 -0
- package/app/components/Vx/Layout.vue +1 -1
- package/app/components/Vx/List/Pager.vue +1 -1
- package/app/components/Vx/List/ViewMenu.vue +1 -1
- package/app/components/Vx/Queues/Failed.vue +2 -2
- package/app/components/Vx/Queues/FailedDetail.vue +2 -2
- package/app/components/Vx/Queues/Metrics.vue +1 -1
- package/app/components/Vx/Queues/Overview.vue +2 -2
- package/app/components/Vx/Resource/Audit.vue +4 -0
- package/app/components/Vx/Resource/Form.vue +9 -1
- package/app/components/Vx/Resource/RelationPanel.vue +1 -1
- package/app/components/Vx/Resource/Table.vue +25 -2
- package/app/components/Vx/Widget/Card.vue +2 -2
- package/app/components/VxAi/ApprovalCard.vue +115 -0
- package/app/components/VxAi/Assistant.vue +189 -0
- package/app/components/VxAi/Credentials.vue +111 -0
- package/app/components/VxAi/FilterAsk.vue +176 -0
- package/app/components/VxAi/WritingAddon.vue +127 -0
- package/app/components/VxAi/WritingMenu.vue +91 -0
- package/app/components/VxAi/WritingResult.vue +48 -0
- package/app/components/VxAi/WritingToolbarItem.vue +189 -0
- package/app/composables/useConfirm.ts +1 -1
- package/app/composables/useVectorApi.ts +4 -4
- package/app/composables/useVectorAssistant.ts +342 -0
- package/app/composables/useVectorAuthStore.ts +1 -1
- package/app/composables/useVectorExtend.ts +157 -0
- package/app/composables/useVectorExtensions.ts +64 -6
- package/app/composables/useVectorFields.ts +1 -1
- package/app/composables/useVectorIdle.ts +1 -1
- package/app/composables/useVectorLocale.ts +2 -2
- package/app/composables/useVectorSchema.ts +1 -1
- package/app/composables/useVectorVersion.ts +2 -2
- package/app/composables/useVectorWriting.ts +72 -0
- package/app/i18n/ar/ai.ts +93 -0
- package/app/i18n/ar/index.ts +2 -1
- package/app/i18n/ar/record.ts +4 -0
- package/app/i18n/ar/shell.ts +1 -0
- package/app/i18n/de/ai.ts +93 -0
- package/app/i18n/de/index.ts +2 -1
- package/app/i18n/de/record.ts +4 -0
- package/app/i18n/de/shell.ts +1 -0
- package/app/i18n/en/ai.ts +93 -0
- package/app/i18n/en/index.ts +2 -1
- package/app/i18n/en/record.ts +4 -0
- package/app/i18n/en/shell.ts +1 -0
- package/app/i18n/es/ai.ts +93 -0
- package/app/i18n/es/index.ts +2 -1
- package/app/i18n/es/record.ts +4 -0
- package/app/i18n/es/shell.ts +1 -0
- package/app/i18n/fr/ai.ts +93 -0
- package/app/i18n/fr/index.ts +2 -1
- package/app/i18n/fr/record.ts +4 -0
- package/app/i18n/fr/shell.ts +1 -0
- package/app/i18n/he/ai.ts +93 -0
- package/app/i18n/he/index.ts +2 -1
- package/app/i18n/he/record.ts +4 -0
- package/app/i18n/he/shell.ts +1 -0
- package/app/i18n/index.ts +1 -1
- package/app/i18n/it/ai.ts +93 -0
- package/app/i18n/it/index.ts +2 -1
- package/app/i18n/it/record.ts +4 -0
- package/app/i18n/it/shell.ts +1 -0
- package/app/i18n/ja/ai.ts +93 -0
- package/app/i18n/ja/index.ts +2 -1
- package/app/i18n/ja/record.ts +4 -0
- package/app/i18n/ja/shell.ts +1 -0
- package/app/i18n/ko/ai.ts +93 -0
- package/app/i18n/ko/index.ts +2 -1
- package/app/i18n/ko/record.ts +4 -0
- package/app/i18n/ko/shell.ts +1 -0
- package/app/i18n/nl/ai.ts +93 -0
- package/app/i18n/nl/index.ts +2 -1
- package/app/i18n/nl/record.ts +4 -0
- package/app/i18n/nl/shell.ts +1 -0
- package/app/i18n/pl/ai.ts +93 -0
- package/app/i18n/pl/index.ts +2 -1
- package/app/i18n/pl/record.ts +4 -0
- package/app/i18n/pl/shell.ts +1 -0
- package/app/i18n/pt/ai.ts +93 -0
- package/app/i18n/pt/index.ts +2 -1
- package/app/i18n/pt/record.ts +4 -0
- package/app/i18n/pt/shell.ts +1 -0
- package/app/i18n/pt-BR/ai.ts +93 -0
- package/app/i18n/pt-BR/index.ts +2 -1
- package/app/i18n/pt-BR/record.ts +4 -0
- package/app/i18n/pt-BR/shell.ts +1 -0
- package/app/i18n/ru/ai.ts +93 -0
- package/app/i18n/ru/index.ts +2 -1
- package/app/i18n/ru/record.ts +4 -0
- package/app/i18n/ru/shell.ts +1 -0
- package/app/i18n/tr/ai.ts +93 -0
- package/app/i18n/tr/index.ts +2 -1
- package/app/i18n/tr/record.ts +4 -0
- package/app/i18n/tr/shell.ts +1 -0
- package/app/i18n/uk/ai.ts +93 -0
- package/app/i18n/uk/index.ts +2 -1
- package/app/i18n/uk/record.ts +4 -0
- package/app/i18n/uk/shell.ts +1 -0
- package/app/i18n/zh-Hans/ai.ts +93 -0
- package/app/i18n/zh-Hans/index.ts +2 -1
- package/app/i18n/zh-Hans/record.ts +4 -0
- package/app/i18n/zh-Hans/shell.ts +1 -0
- package/app/layouts/vector.vue +4 -1
- package/app/pages/settings.vue +7 -1
- package/app/plugins/vector-ai.client.ts +54 -0
- package/app/plugins/vector-extensions.client.ts +28 -37
- package/app/types/vector.ts +40 -3
- package/app/utils/aiAvailability.ts +55 -0
- package/app/utils/assistantBody.ts +69 -0
- package/app/utils/assistantStream.ts +133 -0
- package/app/utils/assistantTools.ts +45 -0
- package/app/utils/followScroll.ts +110 -0
- package/app/utils/format.ts +3 -3
- package/app/utils/internal/paths.ts +1 -1
- package/app/utils/queues.ts +1 -1
- package/app/utils/recordLinks.ts +45 -0
- package/app/utils/richtext.ts +3 -3
- package/app/utils/translate.ts +2 -2
- package/dist/static/200.html +1 -1
- package/dist/static/404.html +1 -1
- package/dist/static/_nuxt/-ksGenLl.js +1 -0
- package/dist/static/_nuxt/{DDJY3JL5.js → 0Q9tQaGZ.js} +1 -1
- package/dist/static/_nuxt/2mrvZCJz.js +3 -0
- package/dist/static/_nuxt/{C2PH7r9_.js → 2u7wMpR1.js} +1 -1
- package/dist/static/_nuxt/72BATg3-.js +1 -0
- package/dist/static/_nuxt/{BKtgreqG.js → 7hLwEPpo.js} +1 -1
- package/dist/static/_nuxt/{D5vg-NJ4.js → 7rwxDW6j.js} +1 -1
- package/dist/static/_nuxt/{Pj99sh0X.js → AbcTnLPe.js} +1 -1
- package/dist/static/_nuxt/B-b861aP.js +1 -0
- package/dist/static/_nuxt/{Cuw0JSbz.js → B2rZ5lwu.js} +1 -1
- package/dist/static/_nuxt/B4hfz7cN.js +1 -0
- package/dist/static/_nuxt/B65UlNtP.js +1 -0
- package/dist/static/_nuxt/{oThorgNS.js → B8JL5gwX.js} +1 -1
- package/dist/static/_nuxt/{D5Woe3YR.js → B8wNbnS0.js} +1 -1
- package/dist/static/_nuxt/{BDM1yKDf.js → B9FqenNL.js} +1 -1
- package/dist/static/_nuxt/{wLSd0d84.js → B9s6vEby.js} +1 -1
- package/dist/static/_nuxt/BE6e_jlD.js +1 -0
- package/dist/static/_nuxt/{Dx8sj9kP.js → BFZfZyte.js} +1 -1
- package/dist/static/_nuxt/{Dnl_Q9LX.js → BJSRjsBt.js} +1 -1
- package/dist/static/_nuxt/{lRmDd_Kx.js → BJh6qVAK.js} +1 -1
- package/dist/static/_nuxt/{DBmDhhWl.js → BJxaGigr.js} +1 -1
- package/dist/static/_nuxt/{CmoDOC5e.js → BL2SeM_r.js} +1 -1
- package/dist/static/_nuxt/BPT7yI6j.js +1 -0
- package/dist/static/_nuxt/BQ47h6Wh.js +1 -0
- package/dist/static/_nuxt/{CalcRVj7.js → BQitPbA5.js} +1 -1
- package/dist/static/_nuxt/{D9unnd4n.js → BSj4WTjT.js} +1 -1
- package/dist/static/_nuxt/{D3cKZbMy.js → BVrihF-G.js} +1 -1
- package/dist/static/_nuxt/BW9qBvMR.js +1 -0
- package/dist/static/_nuxt/{DU1KpHiJ.js → BWscDCZb.js} +1 -1
- package/dist/static/_nuxt/{JGAhx20W.js → BXnWvqRw.js} +1 -1
- package/dist/static/_nuxt/BcSEGymu.js +2 -0
- package/dist/static/_nuxt/Bj-QksVr.js +2 -0
- package/dist/static/_nuxt/{CvMhFq5K.js → Bl4F_9Di.js} +1 -1
- package/dist/static/_nuxt/{BRbbmSpl.js → BowgCQje.js} +1 -1
- package/dist/static/_nuxt/{DgVB5umK.js → BuTE4a2w.js} +1 -1
- package/dist/static/_nuxt/Bw6FrC2B.js +1 -0
- package/dist/static/_nuxt/{Cv0_BbF0.js → Byf6uyFv.js} +1 -1
- package/dist/static/_nuxt/Bzvft7RG.js +1 -0
- package/dist/static/_nuxt/C1y0neXX.js +1 -0
- package/dist/static/_nuxt/{BUF7Jq4U.js → C48zuAYh.js} +1 -1
- package/dist/static/_nuxt/{DJFQLDk5.js → C52FYB-5.js} +1 -1
- package/dist/static/_nuxt/CAXk9Oc1.js +1 -0
- package/dist/static/_nuxt/{C7fSyjDf.js → CD5zJmlk.js} +1 -1
- package/dist/static/_nuxt/CDnV5Q2S.js +2 -0
- package/dist/static/_nuxt/{CzTUD5Qk.js → CE5HzlKJ.js} +1 -1
- package/dist/static/_nuxt/{7K6MnLUx.js → CF_C4t63.js} +1 -1
- package/dist/static/_nuxt/CFuvN8kq.js +1 -0
- package/dist/static/_nuxt/{CqMf6Lsu.js → CHIGMs2v.js} +1 -1
- package/dist/static/_nuxt/CIcNJyjb.js +1 -0
- package/dist/static/_nuxt/{Dyz4VrUP.js → CLJSzUt5.js} +1 -1
- package/dist/static/_nuxt/CQvUQgZO.js +2 -0
- package/dist/static/_nuxt/{N6Uxr2YO.js → CRAHgjs4.js} +1 -1
- package/dist/static/_nuxt/{B6NDob-m.js → CSezMYzn.js} +1 -1
- package/dist/static/_nuxt/{B7CwuqHQ.js → CSgLLbCN.js} +1 -1
- package/dist/static/_nuxt/{1EmobxKy.js → CTHBH7-N.js} +1 -1
- package/dist/static/_nuxt/CVGEoUmj.js +1 -0
- package/dist/static/_nuxt/{bm6plv74.js → CVePRzEp.js} +1 -1
- package/dist/static/_nuxt/{R3rw3hPp.js → CWfptrnU.js} +1 -1
- package/dist/static/_nuxt/{C1djf5sc.js → CXSf4TOH.js} +1 -1
- package/dist/static/_nuxt/CbOoWXps.js +1 -0
- package/dist/static/_nuxt/Cf2NM87n.js +1 -0
- package/dist/static/_nuxt/{ycmL3bWs.js → CjYmnU-l.js} +1 -1
- package/dist/static/_nuxt/Ckm05LT2.js +1 -0
- package/dist/static/_nuxt/{DHtEcXUO.js → Cl2jXKkl.js} +1 -1
- package/dist/static/_nuxt/{CF1K6UXb.js → Clx69IQe.js} +1 -1
- package/dist/static/_nuxt/{BZDOVMsw.js → CmJ0ekjX.js} +1 -1
- package/dist/static/_nuxt/{DkCRR-Zt.js → Cpel4vlt.js} +1 -1
- package/dist/static/_nuxt/{CUAnR2FD.js → CrYfHi9E.js} +1 -1
- package/dist/static/_nuxt/CvTgOEOS.js +1 -0
- package/dist/static/_nuxt/CvVbTdaI.js +1 -0
- package/dist/static/_nuxt/{DoNlTJTo.js → D2ovGjnz.js} +1 -1
- package/dist/static/_nuxt/{BOHl_j0c.js → D3cIKCPa.js} +1 -1
- package/dist/static/_nuxt/{CvtjhXJ1.js → D3jC5ZAK.js} +1 -1
- package/dist/static/_nuxt/{FzhpMR1D.js → D3xofh1k.js} +1 -1
- package/dist/static/_nuxt/{BfuFZvSA.js → D7dC5VYH.js} +1 -1
- package/dist/static/_nuxt/{DfVLYfcR.js → D7eR_J9I.js} +1 -1
- package/dist/static/_nuxt/DAXm0JlI.js +1 -0
- package/dist/static/_nuxt/DDsQjoa8.js +1 -0
- package/dist/static/_nuxt/DFIqxsd4.js +1 -0
- package/dist/static/_nuxt/DGQrzV9s.js +1 -0
- package/dist/static/_nuxt/{1_Uuyt8D.js → DHNZ4ANp.js} +1 -1
- package/dist/static/_nuxt/{AXpHq_M6.js → DKOyYUi8.js} +1 -1
- package/dist/static/_nuxt/DOEj9Txc.js +1 -0
- package/dist/static/_nuxt/{CJepLjEa.js → DOq2YmIE.js} +1 -1
- package/dist/static/_nuxt/DOxWca9k.js +1 -0
- package/dist/static/_nuxt/{D7JW3pi_.js → DVyeIIya.js} +1 -1
- package/dist/static/_nuxt/{DT1zmKvw.js → DW3p59oX.js} +1 -1
- package/dist/static/_nuxt/{ERkvasWH.js → DXZAXwNd.js} +1 -1
- package/dist/static/_nuxt/{5VLAMAEq.js → DYPYEI74.js} +1 -1
- package/dist/static/_nuxt/D_hQWjK3.js +1 -0
- package/dist/static/_nuxt/{ZNfE-M4g.js → Dao3p0cp.js} +1 -1
- package/dist/static/_nuxt/{D3xqGGYp.js → DcC5rHQt.js} +1 -1
- package/dist/static/_nuxt/DdYMnBKs.js +1 -0
- package/dist/static/_nuxt/{DOOLWZFN.js → DeZyAt_3.js} +1 -1
- package/dist/static/_nuxt/DfApYreK.js +10 -0
- package/dist/static/_nuxt/{BEcvuouq.js → DjRWYJ_r.js} +1 -1
- package/dist/static/_nuxt/{DqVTouT1.js → DllQuWrz.js} +1 -1
- package/dist/static/_nuxt/DryMzf1V.js +1 -0
- package/dist/static/_nuxt/{BEu939QZ.js → DsLys5JK.js} +1 -1
- package/dist/static/_nuxt/DvEvjhbF.js +1 -0
- package/dist/static/_nuxt/{B1lIMV_o.js → Dw7WalTb.js} +1 -1
- package/dist/static/_nuxt/{DYm7SUSn.js → DwpSsR4l.js} +1 -1
- package/dist/static/_nuxt/FfebEZGy.js +1 -0
- package/dist/static/_nuxt/{DPDZkh6Z.js → GdAHGVsW.js} +1 -1
- package/dist/static/_nuxt/{qFGHTGtX.js → HdAGfEVj.js} +1 -1
- package/dist/static/_nuxt/{CsakM5cG.js → IxgCkjBe.js} +1 -1
- package/dist/static/_nuxt/{BJiySRJW.js → Jl8QPdwt.js} +1 -1
- package/dist/static/_nuxt/{4_OCizmC.js → KWfizXHd.js} +1 -1
- package/dist/static/_nuxt/KeyValue.CWzmqYlQ.css +1 -0
- package/dist/static/_nuxt/Notifications.CAlaWnJg.css +1 -0
- package/dist/static/_nuxt/PqTF-5Vs.js +1 -0
- package/dist/static/_nuxt/SacKuioS.js +65 -0
- package/dist/static/_nuxt/TlyrWgih.js +1 -0
- package/dist/static/_nuxt/{oj_DzV60.js → WAarVmAq.js} +1 -1
- package/dist/static/_nuxt/{DcWEOxVe.js → XnbMqODk.js} +1 -1
- package/dist/static/_nuxt/{R_5D07UV.js → Y2iAEIYr.js} +1 -1
- package/dist/static/_nuxt/_resource_.Q2lVCG-n.css +1 -0
- package/dist/static/_nuxt/{BSj7_50x.js → b2bdl3qT.js} +1 -1
- package/dist/static/_nuxt/bNqxxQg2.js +1 -0
- package/dist/static/_nuxt/builds/latest.json +1 -1
- package/dist/static/_nuxt/builds/meta/febd0fe3-67f9-4afd-94c3-97178a3ef2b1.json +1 -0
- package/dist/static/_nuxt/{yO0LqdZ2.js → e2dpeiRT.js} +1 -1
- package/dist/static/_nuxt/{entry.DmwuXgFN.css → entry.B2UXd7Ey.css} +1 -1
- package/dist/static/_nuxt/error-404.D5YWHu6f.css +1 -0
- package/dist/static/_nuxt/error-500.BP1eYUQR.css +1 -0
- package/dist/static/_nuxt/{CB-gmtNU.js → fLsGnP3B.js} +1 -1
- package/dist/static/_nuxt/gYmJEXHP.js +1 -0
- package/dist/static/_nuxt/{B-nBg1Xv.js → jI4JB4sB.js} +1 -1
- package/dist/static/_nuxt/{DebXB2Xn.js → qoAbHCOq.js} +1 -1
- package/dist/static/_nuxt/rYfJ_RlJ.js +1 -0
- package/dist/static/_nuxt/{CrGsoVt3.js → tGXqY3hN.js} +1 -1
- package/dist/static/_nuxt/{Bk4XXIda.js → tv5vSe5Y.js} +1 -1
- package/dist/static/_nuxt/vbxP0T99.js +185 -0
- package/dist/static/_nuxt/vector.NgmG3ZDn.css +1 -0
- package/dist/static/_nuxt/{BEX0oVSL.js → wSbLQ3i5.js} +2 -2
- package/dist/static/_nuxt/{0Vkqk5K3.js → y5gvPoD3.js} +1 -1
- package/dist/static/_nuxt/{DyweGZi4.js → yIw8BzU6.js} +1 -1
- package/dist/static/_nuxt/{NTQyXsYJ.js → zA0zNamO.js} +1 -1
- package/dist/static/index.html +1 -1
- package/dist/static/jobs/index.html +1 -1
- package/dist/static/login/index.html +1 -1
- package/dist/static/queues/index.html +1 -1
- package/dist/static/settings/index.html +1 -1
- package/dist/static/vector-bundle.json +148 -152
- package/package.json +19 -18
- package/dist/static/_nuxt/B6S9Z6WQ.js +0 -1
- package/dist/static/_nuxt/BDNMzG2s.js +0 -1
- package/dist/static/_nuxt/BDhmmehP.js +0 -2
- package/dist/static/_nuxt/BJhRZpbP.js +0 -1
- package/dist/static/_nuxt/BZXFBS4d.js +0 -1
- package/dist/static/_nuxt/Baf8k6rK.js +0 -1
- package/dist/static/_nuxt/BlcK9t0n.js +0 -1
- package/dist/static/_nuxt/Bp1wYuAu.js +0 -2
- package/dist/static/_nuxt/BqIYBnn1.js +0 -1
- package/dist/static/_nuxt/BzcHWzF1.js +0 -1
- package/dist/static/_nuxt/C-dF6TjJ.js +0 -1
- package/dist/static/_nuxt/C0BqlrB-.js +0 -1
- package/dist/static/_nuxt/C5lrJzwj.js +0 -67
- package/dist/static/_nuxt/C6kvBrux.js +0 -1
- package/dist/static/_nuxt/C9pCrKWL.js +0 -1
- package/dist/static/_nuxt/CBIdPVBN.js +0 -1
- package/dist/static/_nuxt/CE4w7ySf.js +0 -1
- package/dist/static/_nuxt/CIIjiec-.js +0 -1
- package/dist/static/_nuxt/CJUKNdMD.js +0 -1
- package/dist/static/_nuxt/CL8kR7Jl.js +0 -1
- package/dist/static/_nuxt/CTQUNAVB.js +0 -1
- package/dist/static/_nuxt/CTqdSnzX.js +0 -1
- package/dist/static/_nuxt/ChHwRItD.js +0 -1
- package/dist/static/_nuxt/ClGaGEq-.js +0 -1
- package/dist/static/_nuxt/ClTuaRRz.js +0 -1
- package/dist/static/_nuxt/CojXjKit.js +0 -1
- package/dist/static/_nuxt/CpCuvz_Q.js +0 -1
- package/dist/static/_nuxt/Cv4Z1VpR.js +0 -65
- package/dist/static/_nuxt/D1s1ZPEA.js +0 -2
- package/dist/static/_nuxt/D8p7N22I.js +0 -1
- package/dist/static/_nuxt/DBXnb1tR.js +0 -1
- package/dist/static/_nuxt/DCZnllp3.js +0 -1
- package/dist/static/_nuxt/DL237dS3.js +0 -1
- package/dist/static/_nuxt/DPH3RfAz.js +0 -1
- package/dist/static/_nuxt/DVKVuUv9.js +0 -1
- package/dist/static/_nuxt/Djb5b_0H.js +0 -1
- package/dist/static/_nuxt/DlpIJgqB.js +0 -1
- package/dist/static/_nuxt/DrEHkKjX.js +0 -10
- package/dist/static/_nuxt/DuYZsH0p.js +0 -1
- package/dist/static/_nuxt/DujOg9oz.js +0 -2
- package/dist/static/_nuxt/IhWbQWqt.js +0 -1
- package/dist/static/_nuxt/KeyValue.CczYMB-Q.css +0 -1
- package/dist/static/_nuxt/NOtHifBs.js +0 -105
- package/dist/static/_nuxt/Notifications.AEytcgEO.css +0 -1
- package/dist/static/_nuxt/OyqHv1Hk.js +0 -1
- package/dist/static/_nuxt/Pe8cg_oY.js +0 -1
- package/dist/static/_nuxt/QTRQ5bvA.js +0 -1
- package/dist/static/_nuxt/Un35xD_q.js +0 -1
- package/dist/static/_nuxt/UoJt16Vw.js +0 -1
- package/dist/static/_nuxt/VSpacer.DfbUir7X.css +0 -1
- package/dist/static/_nuxt/_resource_.CZ-hvn3L.css +0 -1
- package/dist/static/_nuxt/builds/meta/3c8a90b7-4dbd-4b44-8b52-44303c3d88d5.json +0 -1
- package/dist/static/_nuxt/error-404.DIb-VIQ0.css +0 -1
- package/dist/static/_nuxt/error-500.BvRwBykK.css +0 -1
- package/dist/static/_nuxt/vector.ClRRJOjR.css +0 -1
- package/dist/static/_nuxt/wlpNGAAZ.js +0 -3
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import{$ as e,D as t,E as n,Ft as r,Ht as i,On as a,Yt as o,Zn as s,_ as c,b as l,bt as u,et as d,g as f,it as p,k as m,mt as h,o as g,qt as _,tr as v,un as ee,v as y,vn as te,wt as ne,y as b}from"./2mrvZCJz.js";import{C as re,S as ie,w as ae}from"./CDnV5Q2S.js";import{t as oe}from"./CWfptrnU.js";import{t as x}from"./D3jC5ZAK.js";import{t as se}from"./WAarVmAq.js";import{t as ce}from"./DeZyAt_3.js";import{t as le}from"./Dw7WalTb.js";import{C as S,R as ue,S as C,T as de,U as fe,_ as pe,at as me,b as he,d as ge,g as w,h as T,m as E,n as _e,p as D,r as ve,v as O,w as k,x as A,y as j}from"#entry";import{n as ye,t as be}from"./TlyrWgih.js";function M(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var N=M();function P(e){N=e}var F={exec:()=>null};function I(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(L.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var xe=(()=>{try{return!0}catch{return!1}})(),L={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Se=/^(?:[ \t]*(?:\n|$))+/,Ce=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,we=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,R=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Te=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ee=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,De=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Oe=I(De).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ke=I(De).replace(/bull/g,Ee).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ae=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,je=/^[^\n]+/,Me=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ne=I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Me).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Pe=I(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ee).getRegex(),z=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,Fe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ie=I(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,Fe).replace(`tag`,z).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le=I(Ae).replace(`hr`,R).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,z).getRegex(),Re={blockquote:I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Le).getRegex(),code:Ce,def:Ne,fences:we,heading:Te,hr:R,html:Ie,lheading:Oe,list:Pe,newline:Se,paragraph:Le,table:F,text:je},ze=I(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,R).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,z).getRegex(),Be={...Re,lheading:ke,table:ze,paragraph:I(Ae).replace(`hr`,R).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,ze).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,z).getRegex()},Ve={...Re,html:I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,Fe).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:F,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(Ae).replace(`hr`,R).replace(`heading`,` *#{1,6} *[^
|
|
2
|
+
]`).replace(`lheading`,Oe).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},He=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ue=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,We=/^( {2,}|\\)\n(?!\s*$)/,Ge=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,B=/[\p{P}\p{S}]/u,V=/[\s\p{P}\p{S}]/u,Ke=/[^\s\p{P}\p{S}]/u,qe=I(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,V).getRegex(),Je=/(?!~)[\p{P}\p{S}]/u,Ye=/(?!~)[\s\p{P}\p{S}]/u,Xe=/(?:[^\s\p{P}\p{S}]|~)/u,Ze=I(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,xe?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Qe=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,$e=I(Qe,`u`).replace(/punct/g,B).getRegex(),et=I(Qe,`u`).replace(/punct/g,Je).getRegex(),tt=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,nt=I(tt,`gu`).replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),rt=I(tt,`gu`).replace(/notPunctSpace/g,Xe).replace(/punctSpace/g,Ye).replace(/punct/g,Je).getRegex(),it=I(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),at=I(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,B).getRegex(),ot=I(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,Ke).replace(/punctSpace/g,V).replace(/punct/g,B).getRegex(),st=I(/\\(punct)/,`gu`).replace(/punct/g,B).getRegex(),ct=I(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),lt=I(Fe).replace(`(?:-->|$)`,`-->`).getRegex(),ut=I(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,lt).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),H=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,dt=I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,H).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ft=I(/^!?\[(label)\]\[(ref)\]/).replace(`label`,H).replace(`ref`,Me).getRegex(),pt=I(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Me).getRegex(),mt=I(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,ft).replace(`nolink`,pt).getRegex(),ht=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,gt={_backpedal:F,anyPunctuation:st,autolink:ct,blockSkip:Ze,br:We,code:Ue,del:F,delLDelim:F,delRDelim:F,emStrongLDelim:$e,emStrongRDelimAst:nt,emStrongRDelimUnd:it,escape:He,link:dt,nolink:pt,punctuation:qe,reflink:ft,reflinkSearch:mt,tag:ut,text:Ge,url:F},_t={...gt,link:I(/^!?\[(label)\]\((.*?)\)/).replace(`label`,H).getRegex(),reflink:I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,H).getRegex()},vt={...gt,emStrongRDelimAst:rt,emStrongLDelim:et,delLDelim:at,delRDelim:ot,url:I(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,ht).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:I(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,ht).getRegex()},yt={...vt,br:I(We).replace(`{2,}`,`*`).getRegex(),text:I(vt.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},U={normal:Re,gfm:Be,pedantic:Ve},W={normal:gt,gfm:vt,breaks:yt,pedantic:_t},bt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},xt=e=>bt[e];function G(e,t){if(t){if(L.escapeTest.test(e))return e.replace(L.escapeReplace,xt)}else if(L.escapeTestNoEncode.test(e))return e.replace(L.escapeReplaceNoEncode,xt);return e}function St(e){try{e=encodeURI(e).replace(L.percentDecode,`%`)}catch{return null}return e}function Ct(e,t){let n=e.replace(L.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(L.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(L.slashPipe,`|`);return n}function K(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function wt(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Tt(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Et(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Dt(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
3
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
4
|
+
`)}var q=class{options;rules;lexer;constructor(e){this.options=e||N}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:K(e,`
|
|
5
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Dt(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=K(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:K(t[0],`
|
|
6
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=K(t[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
9
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
11
|
+
${s}`:s,r=r?`${r}
|
|
12
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
13
|
+
`+e.join(`
|
|
14
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
15
|
+
`+e.join(`
|
|
16
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
17
|
+
`)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=Tt(t[2].split(`
|
|
18
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
19
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
20
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
21
|
+
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
22
|
+
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
23
|
+
`+l}u=!l.trim(),r+=p+`
|
|
24
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ct(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
25
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Ct(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
26
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=K(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=wt(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Et(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Et(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},J=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||N,this.options.tokenizer=this.options.tokenizer||new q,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:L,block:U.normal,inline:W.normal};this.options.pedantic?(t.block=U.pedantic,t.inline=W.pedantic):this.options.gfm&&(t.block=U.gfm,t.inline=this.options.breaks?W.breaks:W.gfm),this.tokenizer.rules=t}static get rules(){return{block:U,inline:W}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(L.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(L.tabCharGlobal,` `).replace(L.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
28
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
29
|
+
`)?``:`
|
|
30
|
+
`)+r.raw,n.text+=`
|
|
31
|
+
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
32
|
+
`)?``:`
|
|
33
|
+
`)+r.raw,n.text+=`
|
|
34
|
+
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
35
|
+
`)?``:`
|
|
36
|
+
`)+r.raw,a.text+=`
|
|
37
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
38
|
+
`)?``:`
|
|
39
|
+
`)+r.raw,n.text+=`
|
|
40
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,o))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e,n,o))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},Y=class{options;parser;constructor(e){this.options=e||N}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(L.notSpaceStart)?.[0],i=e.replace(L.endingNewline,``)+`
|
|
41
|
+
`;return r?`<pre><code class="language-`+G(r)+`">`+(n?i:G(i,!0))+`</code></pre>
|
|
42
|
+
`:`<pre><code>`+(n?i:G(i,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(e)}</blockquote>
|
|
45
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
46
|
+
`}hr(e){return`<hr>
|
|
47
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
48
|
+
`+r+`</`+i+`>
|
|
49
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
50
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
51
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+t+`</thead>
|
|
54
|
+
`+r+`</table>
|
|
55
|
+
`}tablerow({text:e}){return`<tr>
|
|
56
|
+
${e}</tr>
|
|
57
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
58
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${G(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=St(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+G(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=St(e);if(i===null)return G(n);e=i;let a=`<img src="${e}" alt="${G(n)}"`;return t&&(a+=` title="${G(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:G(e.text)}},Ot=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},X=class e{options;renderer;textRenderer;constructor(e){this.options=e||N,this.options.renderer=this.options.renderer||new Y,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ot}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Z=class{options;block;constructor(e){this.options=e||N}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?J.lex:J.lexInline}provideParser(e=this.block){return e?X.parse:X.parseInline}},Q=new class{defaults=M();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=X;Renderer=Y;TextRenderer=Ot;Lexer=J;Tokenizer=q;Hooks=Z;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Y(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new q(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Z;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Z.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return J.lex(e,t??this.defaults)}parser(e,t){return X.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?J.lex:J.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?X.parse:X.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?J.lex:J.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?X.parse:X.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+G(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Q.parse(e,t)}$.options=$.setOptions=function(e){return Q.setOptions(e),$.defaults=Q.defaults,P($.defaults),$},$.getDefaults=M,$.defaults=N,$.use=function(...e){return Q.use(...e),$.defaults=Q.defaults,P($.defaults),$},$.walkTokens=function(e,t){return Q.walkTokens(e,t)},$.parseInline=Q.parseInline,$.Parser=X,$.parser=X.parse,$.Renderer=Y,$.TextRenderer=Ot,$.Lexer=J,$.lexer=J.lex,$.Tokenizer=q,$.Hooks=Z,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,X.parse,J.lex;var kt=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function At(e){return e.flatMap((t,n)=>{if(t.type===`space`||e[n+1]?.type===`space`)return[t];let r=(t.raw||``).match(kt);return r?[{...t,raw:(t.raw||``).slice(0,-r[0].length)},{type:`space`,raw:r[0]}]:[t]})}function jt(e,t){let n=t.split(`
|
|
60
|
+
`).flatMap(e=>[e,``]).map(t=>`${e}${t}`).join(`
|
|
61
|
+
`);return n.slice(0,n.length-1)}function Mt(e,t){let n=[];return Array.from(e.entries()).forEach(([e,r])=>{t&&(t.marks||[]).find(t=>t.type===e&&E(t.attrs,r.attrs))||n.push(e)}),n}function Nt(e,t){let n=[];return Array.from(t.entries()).forEach(([t,r])=>{let i=e.get(t);i&&E(i.attrs,r.attrs)||n.push({type:t,mark:r})}),n}function Pt(e,t,n,r){let i=!n,a=n&&(!n.marks||n.marks.length===0),o=n&&n.marks&&!r(t,new Map(n.marks.map(e=>[e.type,e]))),s=[];return(i||a||o)&&(n&&n.marks?Array.from(e.entries()).reverse().forEach(([e,t])=>{n.marks.find(n=>n.type===e&&E(n.attrs,t.attrs))||s.push(e)}):(i||a)&&s.push(...Array.from(e.keys()).reverse())),s}function Ft(e,t){let n=``;return Array.from(e.keys()).reverse().forEach(r=>{let i=t(r,e.get(r));i&&(n=i+n)}),e.clear(),n}function It(e,t,n){let r=``;return Array.from(e.entries()).forEach(([e,i])=>{let a=n(e,i);a&&(r+=a),t.set(e,i)}),r}function Lt(e){let t=(e.raw||e.text||``).match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return t?{isTask:!0,checked:t[2].toLowerCase()===`x`,indentLevel:t[1].length}:{isTask:!1,indentLevel:0}}function Rt(e,t){return typeof e==`string`?t:`json`}function zt(e){let t=e.map(()=>new Map),n=new Map,r=e=>{let r=n.get(e);r&&(r.indexes.forEach(n=>t[n].set(e,r.text)),n.delete(e))};return e.forEach((e,t)=>{if(e.type!==`text`){Array.from(n.keys()).forEach(r);return}let i=new Set((e.marks||[]).map(e=>e.type));Array.from(n.keys()).filter(e=>!i.has(e)).forEach(r),i.forEach(r=>{let i=n.get(r)||{indexes:[],text:``};i.indexes.push(t),i.text+=e.text||``,n.set(r,i)})}),Array.from(n.keys()).forEach(r),t}var Bt=new Set(`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.svg.circle.clippath.defs.ellipse.foreignobject.g.image.line.lineargradient.mask.path.polygon.polyline.radialgradient.rect.stop.switch.symbol.textpath.tspan.use.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`)),Vt=/<\/?([a-zA-Z][\w-]*)/g;function Ht(e){let t=[],n;for(;(n=Vt.exec(e))!==null;)t.push(n[1].toLowerCase());return t}function Ut(e){let t=e.toLowerCase();return!t.includes(`-`)&&!Bt.has(t)}function Wt(e,t){return Ht(e).some(e=>Ut(e)?!t.has(e):!1)}var Gt=class{constructor(e){var t,n;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=e?.marked??$,this.indentStyle=(e==null||(t=e.indentation)==null?void 0:t.style)??`space`,this.indentSize=(e==null||(n=e.indentation)==null?void 0:n.size)??2,this.baseExtensions=e?.extensions||[],e?.markedOptions&&typeof this.markedInstance.setOptions==`function`&&this.markedInstance.setOptions(e.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,e?.extensions&&(this.baseExtensions=e.extensions,k(j(e.extensions)).forEach(e=>this.registerExtension(e)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle===`space`?` `:` `}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(e){this.extensions.push(e);let t=T(A(e,`code`)),n=e.name,r={name:n,options:e.options,storage:e.storage};t&&this.codeTypes.add(n),this.extensionRanks.has(n)||this.extensionRanks.set(n,this.extensionRanks.size);let i=A(e,`markdownTokenName`,r)||n,a=A(e,`parseMarkdown`,r),o=A(e,`renderMarkdown`,r),s=A(e,`markdownTokenizer`,r),c=A(e,`markdownOptions`,r)??null,l={tokenName:i,nodeName:n,parseMarkdown:a,renderMarkdown:o,isIndenting:c?.indentsContent??!1,htmlReopen:c?.htmlReopen,tokenizer:s};if(i&&a){let e=this.registry.get(i)||[];e.push(l),this.registry.set(i,e)}if(o){let e=this.nodeTypeRegistry.get(n)||[];e.push(l),this.nodeTypeRegistry.set(n,e)}s&&this.hasMarked()&&this.registerTokenizer(s)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(e){return{inlineTokens:t=>e.inlineTokens(t),blockTokens:t=>{let n=e.state.top;try{return e.blockTokens(t)}finally{e.state.top=n}},isParagraphContinuation:t=>{var n,r;let i=new this.markedInstance.Lexer({...this.markedInstance.defaults,extensions:void 0,tokenizer:void 0}),a=`text\n${t}\n`,o=i.blockTokens(a)[0];if(o?.type!==`paragraph`||o.raw!==a)return!1;let s=this.createLexer();s.state.top=e.state.top;let c=this.markedInstance.defaults.extensions;return c!=null&&(n=c.startBlock)!=null&&n.some(e=>{let n=e.call({lexer:s},t);return typeof n==`number`&&n>=0})?!1:!(c!=null&&(r=c.block)!=null&&r.some(e=>e.call({lexer:s},`${t}\n`,[])))}}}tokenizeInline(e){return(this.activeParseLexer??this.createLexer()).inlineTokens(e)}registerTokenizer(e){if(!this.hasMarked())return;let{name:t,start:n,level:r=`inline`,tokenize:i}=e,a=this.createTokenizerHelpers.bind(this),o=this.createLexer.bind(this),s;s=n?typeof n==`function`?n:e=>e.indexOf(n):e=>{let t=i(e,[],this.createTokenizerHelpers(this.createLexer()));return t&&t.raw?e.indexOf(t.raw):-1};let c={name:t,level:r,start:s,tokenizer(e,n){let r=this.lexer?a(this.lexer):a(o()),s=i(e,n,r);if(s&&s.type)return{...s,type:s.type||t,raw:s.raw||``,tokens:s.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[c]})}getHandlersForToken(e){try{return this.registry.get(e)||[]}catch{return[]}}getHandlerForToken(e){let t=this.getHandlersForToken(e);if(t.length>0)return t[0];let n=this.getHandlersForNodeType(e);return n.length>0?n[0]:void 0}getHandlersForNodeType(e){try{return this.nodeTypeRegistry.get(e)||[]}catch{return[]}}serialize(e){if(!e)return``;let t=this.renderNodes(e,e);return this.isEmptyOutput(t)?``:t}isEmptyOutput(e){return!e||e.trim()===``||e.replace(/ /g,``).replace(/\u00A0/g,``).trim()===``}parse(e){if(!this.hasMarked())throw Error(`No marked instance available for parsing`);let t=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{let t=n.lex(e);return{type:`doc`,content:this.parseTokens(t,!0)}}finally{this.activeParseLexer=t}}parseTokens(e,t=!1){let n=t?At(e):e,r=n.reduce((e,t,n)=>(t.type!==`space`&&e.push(n),e),[]),i=-1,a=0;return n.flatMap((e,n)=>{for(;a<r.length&&r[a]<n;)i=r[a],a+=1;if(t&&e.type===`space`){let t=r[a]??-1;return this.createImplicitEmptyParagraphsFromSpace(e,i,t)}let o=this.parseToken(e,t);return o===null?[]:Array.isArray(o)?o:[o]})}createImplicitEmptyParagraphsFromSpace(e,t,n){let r=this.countParagraphSeparators(e.raw||``);if(r===0)return[];let i=Math.max(r-(t===-1||n===-1?0:1),0);return Array.from({length:i},()=>({type:`paragraph`,content:[]}))}countParagraphSeparators(e){return(e.replace(/\r\n/g,`
|
|
62
|
+
`).match(/\n\n/g)||[]).length}parseToken(e,t=!1){if(!e.type)return null;if(e.type===`list`)return this.parseListToken(e);let n=this.getHandlersForToken(e.type),r=this.createParseHelpers();if(n.find(t=>{if(!t.parseMarkdown)return!1;let n=t.parseMarkdown(e,r),i=this.normalizeParseResult(n);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){let e=this.lastParseResult;return this.lastParseResult=null,e}return this.parseFallbackToken(e,t)}parseListToken(e){if(!e.items||e.items.length===0)return this.parseTokenWithHandlers(e);let t=e.items.some(e=>Lt(e).isTask),n=e.items.some(e=>!Lt(e).isTask);if(!t||!n||this.getHandlersForToken(`taskList`).length===0)return this.parseTokenWithHandlers(e);let r=[],i=[],a=null;for(let t=0;t<e.items.length;t+=1){let n=e.items[t],{isTask:o,checked:s,indentLevel:c}=Lt(n),l=n;if(o){let e=(n.raw||n.text||``).split(`
|
|
63
|
+
`),t=e[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),r=t?t[2]:``,i=[];if(e.length>1&&e.slice(1).join(`
|
|
64
|
+
`).trim()){let t=e.slice(1),n=t.filter(e=>e.trim());if(n.length>0){let e=Math.min(...n.map(e=>e.length-e.trimStart().length)),r=t.map(t=>t.trim()?t.slice(e):``).join(`
|
|
65
|
+
`).trim();r&&(i=this.markedInstance.lexer(`${r}\n`))}}l={type:`taskItem`,raw:``,mainContent:r,indentLevel:c,checked:s??!1,text:r,tokens:this.tokenizeInline(r),nestedTokens:i}}let u=o?`taskList`:`list`;a===u?i.push(l):(i.length>0&&r.push({type:a,items:i}),i=[l],a=u)}i.length>0&&r.push({type:a,items:i});let o=[];for(let t=0;t<r.length;t+=1){let n=r[t],i={...e,type:n.type,items:n.items},a=this.parseToken(i);a&&(Array.isArray(a)?o.push(...a):o.push(a))}return o.length>0?o:null}parseTokenWithHandlers(e){if(!e.type)return null;let t=this.getHandlersForToken(e.type),n=this.createParseHelpers();if(t.find(t=>{if(!t.parseMarkdown)return!1;let r=t.parseMarkdown(e,n),i=this.normalizeParseResult(r);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){let e=this.lastParseResult;return this.lastParseResult=null,e}return this.parseFallbackToken(e)}createParseHelpers(){return{parseInline:e=>this.parseInlineTokens(e),tokenizeInline:e=>this.tokenizeInline(e),parseChildren:e=>this.parseTokens(e),parseBlockChildren:e=>this.parseTokens(e,!0),createTextNode:(e,t)=>({type:`text`,text:e,marks:t||void 0}),createNode:(e,t,n)=>{let r={type:e,attrs:t||void 0,content:n||void 0};return t&&Object.keys(t).length!==0||delete r.attrs,r},applyMark:(e,t,n)=>({mark:e,content:t,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}parseInlineTokens(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(r.type===`text`)t.push({type:`text`,text:pe(r.text||``)});else if(r.type===`escape`)t.push({type:`text`,text:r.text||``});else if(r.type===`html`){let i=(r.raw??r.text??``).toString(),a=/^<\/[\s]*[\w-]+/i.test(i),o=i.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!a&&o&&!/\/>$/.test(i)){let r=o[1],a=this.escapeRegex(r),s=RegExp(`^<\\/\\s*${a}\\b`,`i`),c=-1,l=[i];for(let t=n+1;t<e.length;t+=1){let n=e[t],r=(n.raw??n.text??``).toString();if(l.push(r),n.type===`html`&&s.test(r)){c=t;break}}if(c!==-1){let e=l.join(``),r={type:`html`,raw:e,text:e,block:!1},i=this.parseHTMLToken(r);if(i){let e=this.normalizeParseResult(i);Array.isArray(e)?t.push(...e):e&&t.push(e)}n=c;continue}}let s=this.parseHTMLToken(r);if(s){let e=this.normalizeParseResult(s);Array.isArray(e)?t.push(...e):e&&t.push(e)}}else if(r.type){let e=this.getHandlerForToken(r.type);if(e&&e.parseMarkdown){let n=this.createParseHelpers(),i=e.parseMarkdown(r,n);if(this.isMarkResult(i)){let e=this.applyMarkToContent(i.mark,i.content,i.attrs);t.push(...e)}else{let e=this.normalizeParseResult(i);Array.isArray(e)?t.push(...e):e&&t.push(e)}}else r.tokens&&t.push(...this.parseInlineTokens(r.tokens))}}for(let e=t.length-1;e>0;--e){let n=t[e],r=t[e-1];if(n.type===`text`&&r.type===`text`){let i=n.marks||[],a=r.marks||[];S(i,a)&&(r.text=(r.text||``)+(n.text||``),t.splice(e,1))}}return t}applyMarkToContent(e,t,n){return t.map(t=>{if(t.type===`text`){let r=t.marks||[],i=n?{type:e,attrs:n}:{type:e};return{...t,marks:[...r,i]}}return{...t,content:t.content?this.applyMarkToContent(e,t.content,n):void 0}})}isMarkResult(e){return e&&typeof e==`object`&&`mark`in e}normalizeParseResult(e){return e?this.isMarkResult(e)?e.content:e:null}parseFallbackToken(e,t=!1){switch(e.type){case`paragraph`:return{type:`paragraph`,content:e.tokens?this.parseInlineTokens(e.tokens):[]};case`heading`:return{type:`heading`,attrs:{level:e.depth||1},content:e.tokens?this.parseInlineTokens(e.tokens):[]};case`text`:return{type:`text`,text:pe(e.text||``)};case`html`:return this.parseHTMLToken(e);case`escape`:return{type:`text`,text:e.text||``};case`space`:return null;default:return e.tokens?this.parseTokens(e.tokens,t):null}}parseHTMLToken(e){let t=e.text||e.raw||``;if(!t.trim())return null;if(this.isUnrecognizedHtml(t)||typeof window>`u`||window.DOMParser===void 0)return this.htmlAsLiteralText(t,!!e.block);try{let n=he(t,this.baseExtensions);if(n.type===`doc`&&n.content){if(e.block)return n.content;let t=this.toInlineContent(n.content);return t.length>0?t:null}return n}catch(e){throw Error(`Failed to parse HTML in markdown: ${e}`)}}toInlineContent(e){let t=this.getInlineNodeTypes();return e.flatMap(e=>e.type&&t.has(e.type)?[e]:e.content?this.toInlineContent(e.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;let e=new Set([`text`]);try{let t=C(this.baseExtensions);Object.values(t.nodes).forEach(t=>{t.isInline&&e.add(t.name)})}catch{}return this.inlineNodeTypesCache=e,e}isUnrecognizedHtml(e){return Wt(e,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;let e=new Set;try{let t=C(this.baseExtensions),n=t=>{let n=t?.parseDOM;Array.isArray(n)&&n.forEach(t=>{if(typeof t?.tag==`string`){let n=t.tag.match(/^[a-zA-Z][\w-]*/);n&&e.add(n[0].toLowerCase())}})};Object.values(t.nodes).forEach(e=>n(e.spec)),Object.values(t.marks).forEach(e=>n(e.spec))}catch{}return this.schemaParseDomTagsCache=e,e}htmlAsLiteralText(e,t){let n=e.replace(/\s+$/,``);return n?t?{type:`paragraph`,content:[{type:`text`,text:n}]}:{type:`text`,text:n}:null}encodeTextForMarkdown(e,t,n){return n?.type!=null&&this.codeTypes.has(n.type)||(t.marks||[]).some(e=>this.codeTypes.has(typeof e==`string`?e:e.type))?e:this.escapeMarkdownSyntax(O(e))}escapeMarkdownSyntax(e){return e.replace(/([\\`*_[\]~])/g,`\\$1`)}renderNodeToMarkdown(e,t,n=0,r=0,i={}){if(e.type===`text`)return this.encodeTextForMarkdown(e.text||``,e,t);if(!e.type)return``;let a=this.getHandlerForToken(e.type);if(!a)return``;let o=Array.isArray(t?.content)&&n>0?t.content[n-1]:void 0,s={renderChildren:(t,i)=>{let o=a.isIndenting?r+1:r;return!Array.isArray(t)&&t.content?this.renderNodes(t.content,e,i||``,n,o):this.renderNodes(t,e,i||``,n,o)},renderChild:(t,n)=>{let i=a.isIndenting?r+1:r;return this.renderNodeToMarkdown(t,e,n,i)},indent:e=>this.indentString+e,wrapInBlock:jt},c={index:n,level:r,parentType:t?.type,previousNode:o,meta:{parentAttrs:t?.attrs,...i}};return a.renderMarkdown?.call(a,e,s,c)||``}renderNodes(e,t,n=``,r=0,i=0){return Array.isArray(e)?this.renderNodesWithMarkBoundaries(e,t,n,i):e.type?this.renderNodeToMarkdown(e,t,r,i):``}renderNodesWithMarkBoundaries(e,t,n=``,r=0){let i=[],a=new Map,o=new Set,s=new Map,c=zt(e);if(e.forEach((n,l)=>{let u=l<e.length-1?e[l+1]:null;if(n.type){if(n.type===`text`){let e=this.encodeTextForMarkdown(n.text||``,n,t),r=new Map((n.marks||[]).map(e=>[e.type,e])),d=this.getMarksToOpenForSerialization(a,r,u),f=Mt(r,u);if(e.length>0&&e.trim().length===0&&r.size>0){let e=new Set(f.filter(e=>!a.has(e)));e.size>0&&(r=new Map(Array.from(r).filter(([t])=>!e.has(t))),d=this.getMarksToOpenForSerialization(a,r,u),f=Mt(r,u))}let p=f.filter(e=>a.has(e)),m=p.length>0&&d.length>0,h=``;if(f.length>0&&!m){let t=e.match(/(\s+)$/);t&&(h=t[1],e=e.slice(0,-h.length))}m||f.slice().reverse().forEach(t=>{if(!a.has(t))return;let n=r.get(t),i=this.getMarkClosing(t,n,s.get(t),c[l]?.get(t));i&&(e+=i),a.has(t)&&(a.delete(t),s.delete(t))});let g=``;if(d.length>0){let t=e.match(/^(\s+)/);t&&(g=t[1],e=e.slice(g.length))}d.forEach(({type:t,mark:n})=>{let r=o.has(t)?`html`:`markdown`,i=this.getMarkOpening(t,n,r,c[l]?.get(t));i&&(e=i+e),s.set(t,r),o.delete(t)}),m||d.slice().reverse().forEach(({type:e,mark:t})=>{a.set(e,t)}),e=g+e;let _;if(m){let e=new Set((u?.marks||[]).map(e=>e.type));d.forEach(({type:t})=>{e.has(t)&&this.getHtmlReopenTags(t)&&o.add(t)});let t=Array.from(a.keys()),n=p.slice().sort((e,n)=>t.indexOf(n)-t.indexOf(e));_=[...d.map(e=>e.type),...n]}else _=Pt(a,r,u,this.markSetsEqual.bind(this));let v=``;if(_.length>0){let t=e.match(/(\s+)$/);t&&(v=t[1],e=e.slice(0,-v.length))}_.forEach(t=>{let n=a.get(t)??r.get(t),i=this.getMarkClosing(t,n,s.get(t),c[l]?.get(t));i&&(e+=i),a.delete(t),s.delete(t)}),e+=v,e+=h,i.push(e)}else{let e=new Set((n.marks||[]).map(e=>e.type)),o=new Map,u=new Map;a.forEach((t,n)=>{e.has(n)&&(o.set(n,t),u.set(n,s.get(n)??`markdown`))});let d=Ft(a,(e,t)=>this.getMarkClosing(e,t,s.get(e),c[l-1]?.get(e)));s.clear();let f=this.renderNodeToMarkdown(n,t,l,r),p=n.type===`hardBreak`?``:It(o,a,(e,t)=>{let n=u.get(e)??`markdown`;return s.set(e,n),this.getMarkOpening(e,t,n,c[l+1]?.get(e))});i.push(d+f+p)}}}),n===``){let e=-1;i.forEach((t,n)=>{if(t){if(e>=0&&t.startsWith(`[`)){let t=/(\\*)!$/.exec(i[e]);t&&t[1].length%2==0&&(i[e]=`${i[e].slice(0,-1)}\\!`)}e=n}})}return i.join(n)}getMarkOpening(e,t,n=`markdown`,r){if(n===`html`)return this.getHtmlReopenTags(e)?.open||``;let i=this.getHandlersForNodeType(e),a=i.length>0?i[0]:void 0;if(!a||!a.renderMarkdown)return``;let o=`__TIPTAP_MARKDOWN_PLACEHOLDER__`,s={type:e,attrs:t.attrs||{},content:[{type:`text`,text:o}]};try{let e=a.renderMarkdown(s,{renderChildren:()=>o,renderChild:()=>o,indent:e=>e,wrapInBlock:(e,t)=>e+t},{index:0,level:0,parentType:`text`,meta:{markText:r}}),t=e.indexOf(o);return t>=0?e.substring(0,t):``}catch(t){throw Error(`Failed to get mark opening for ${e}: ${t}`)}}getMarkClosing(e,t,n=`markdown`,r){if(n===`html`)return this.getHtmlReopenTags(e)?.close||``;let i=this.getHandlersForNodeType(e),a=i.length>0?i[0]:void 0;if(!a||!a.renderMarkdown)return``;let o=`__TIPTAP_MARKDOWN_PLACEHOLDER__`,s={type:e,attrs:t.attrs||{},content:[{type:`text`,text:o}]};try{let e=a.renderMarkdown(s,{renderChildren:()=>o,renderChild:()=>o,indent:e=>e,wrapInBlock:(e,t)=>e+t},{index:0,level:0,parentType:`text`,meta:{markText:r}}),t=e.indexOf(o),n=t+33;return t>=0?e.substring(n):``}catch(t){throw Error(`Failed to get mark closing for ${e}: ${t}`)}}getHtmlReopenTags(e){let t=this.getHandlersForNodeType(e);return(t.length>0?t[0]:void 0)?.htmlReopen}markSetsEqual(e,t){return e.size===t.size&&Array.from(e.entries()).every(([e,n])=>{let r=t.get(e);return r&&E(n.attrs,r.attrs)})}getMarksToOpenForSerialization(e,t,n){let r=Nt(e,t);if(r.length<=1)return r;let i=n?.marks||[],a=(e,t)=>i.some(n=>n.type===e&&E(n.attrs,t)),o=(e,t)=>{let n=this.extensionRanks.get(e.type)??2**53-1,r=this.extensionRanks.get(t.type)??2**53-1;return n===r?e.type.localeCompare(t.type):r-n},s=r.filter(e=>!a(e.type,e.mark.attrs)).sort(o),c=r.filter(e=>a(e.type,e.mark.attrs)).sort(o);return[...s,...c]}},Kt=D.create({name:`markdown`,addOptions(){return{indentation:{style:`space`,size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(e,t)=>{if(!t?.contentType||Rt(e,t?.contentType)!==`markdown`||!this.editor.markdown)return w.setContent(e,t);let n=this.editor.markdown.parse(e);return w.setContent(n,t)},insertContent:(e,t)=>{if(!t?.contentType||Rt(e,t?.contentType)!==`markdown`||!this.editor.markdown)return w.insertContent(e,t);let n=this.editor.markdown.parse(e);return w.insertContent(n,t)},insertContentAt:(e,t,n)=>{if(!n?.contentType||Rt(t,n?.contentType)!==`markdown`||!this.editor.markdown)return w.insertContentAt(e,t,n);let r=this.editor.markdown.parse(t);return w.insertContentAt(e,r,n)}}},addStorage(){return{manager:new Gt({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new Gt({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||Rt(this.editor.options.content,this.editor.options.contentType)!==`markdown`)return;if(!this.editor.markdown)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!=`string`)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');let e=this.editor.markdown.parse(this.editor.options.content);e.content?.length&&(this.editor.options.content=e)}}),qt={class:`text-caption text-medium-emphasis px-3 pt-2`},Jt=[`aria-label`],Yt={class:`d-flex justify-end ga-2`},Xt=Object.assign(m({__name:`Markdown`,props:e({field:{},rules:{},errorMessages:{},record:{},resource:{}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let m=e,S=r(e,`modelValue`),{t:C}=_e(),{editorToolbar:pe}=me(),he=f(()=>m.field.markdown?.toolbar??[`bold`,`italic`,`strike`,`code`,`heading`,`list`,`blockquote`,`codeBlock`,`horizontalRule`,`link`]),w=e=>he.value.includes(e),T=te(!1),E=!1,D=ye({extensions:[ge.configure({link:{openOnClick:!1,autolink:!0,protocols:[],isAllowedUri:e=>ve(e)},heading:{levels:[1,2,3,4]}}),Kt],injectNonce:window.__VECTOR__?.cspNonce??void 0,editorProps:{attributes:{class:`vx-richtext-content`,"aria-label":m.field.label,role:`textbox`,"aria-multiline":`true`}},onCreate:({editor:e})=>{e.commands.setContent(S.value??``,{contentType:`markdown`,emitUpdate:!1})},onUpdate:({editor:e})=>{let t=e.getMarkdown().trim();E=!0,S.value=t===``?null:t}});i(S,e=>{E?E=!1:T.value||D.value?.commands.setContent(e??``,{contentType:`markdown`,emitUpdate:!1})}),i(T,e=>{e||D.value?.commands.setContent(S.value??``,{contentType:`markdown`,emitUpdate:!1})}),p(()=>D.value?.destroy());let O=(e,t)=>D.value?.isActive(e,t)??!1,k=e=>{D.value&&e(D.value)},A=te(!1),j=te(``),M=f(()=>j.value.trim()!==``&&!ve(j.value.trim())?C(`fields.richtext.linkRefused`):null);function N(){j.value=String(D.value?.getAttributes(`link`).href??``),A.value=!0}function P(){let e=j.value.trim();M.value||(k(t=>e===``?t.chain().focus().unsetLink().run():t.chain().focus().extendMarkRange(`link`).setLink({href:e}).run()),A.value=!1)}return(r,i)=>(h(),y(se,{"model-value":S.value,rules:e.rules,"error-messages":e.errorMessages,hint:e.field.help??void 0,"persistent-hint":!!e.field.help,class:`vx-richtext`},{default:_(()=>[c(`div`,{class:s([`vx-richtext-frame`,{"vx-richtext-frame--error":e.errorMessages.length>0}])},[c(`div`,qt,v(e.field.label),1),c(`div`,{class:`vx-richtext-toolbar d-flex flex-wrap align-center ga-1 px-2 py-1`,role:`toolbar`,"aria-label":a(C)(`fields.richtext.toolbar`,{label:e.field.label}),onMousedown:i[13]||=ae(()=>{},[`prevent`])},[a(T)?b(``,!0):(h(),l(g,{key:0},[w(`bold`)?(h(),y(x,{key:0,icon:`mdi-format-bold`,size:`small`,variant:`text`,active:O(`bold`),"aria-label":a(C)(`fields.richtext.bold`),onClick:i[0]||=e=>k(e=>e.chain().focus().toggleBold().run())},null,8,[`active`,`aria-label`])):b(``,!0),w(`italic`)?(h(),y(x,{key:1,icon:`mdi-format-italic`,size:`small`,variant:`text`,active:O(`italic`),"aria-label":a(C)(`fields.richtext.italic`),onClick:i[1]||=e=>k(e=>e.chain().focus().toggleItalic().run())},null,8,[`active`,`aria-label`])):b(``,!0),w(`strike`)?(h(),y(x,{key:2,icon:`mdi-format-strikethrough`,size:`small`,variant:`text`,active:O(`strike`),"aria-label":a(C)(`fields.richtext.strike`),onClick:i[2]||=e=>k(e=>e.chain().focus().toggleStrike().run())},null,8,[`active`,`aria-label`])):b(``,!0),w(`code`)?(h(),y(x,{key:3,icon:`mdi-code-tags`,size:`small`,variant:`text`,active:O(`code`),"aria-label":a(C)(`fields.richtext.code`),onClick:i[3]||=e=>k(e=>e.chain().focus().toggleCode().run())},null,8,[`active`,`aria-label`])):b(``,!0),w(`heading`)?(h(),l(g,{key:4},[t(ce,{vertical:``,class:`mx-1`}),(h(),l(g,null,u([1,2,3],e=>t(x,{key:e,icon:`mdi-format-header-${e}`,size:`small`,variant:`text`,active:O(`heading`,{level:e}),"aria-label":a(C)(`fields.richtext.heading`,{level:e}),onClick:t=>k(t=>t.chain().focus().toggleHeading({level:e}).run())},null,8,[`icon`,`active`,`aria-label`,`onClick`])),64))],64)):b(``,!0),w(`list`)?(h(),l(g,{key:5},[t(ce,{vertical:``,class:`mx-1`}),t(x,{icon:`mdi-format-list-bulleted`,size:`small`,variant:`text`,active:O(`bulletList`),"aria-label":a(C)(`fields.richtext.bulletList`),onClick:i[4]||=e=>k(e=>e.chain().focus().toggleBulletList().run())},null,8,[`active`,`aria-label`]),t(x,{icon:`mdi-format-list-numbered`,size:`small`,variant:`text`,active:O(`orderedList`),"aria-label":a(C)(`fields.richtext.orderedList`),onClick:i[5]||=e=>k(e=>e.chain().focus().toggleOrderedList().run())},null,8,[`active`,`aria-label`])],64)):b(``,!0),w(`blockquote`)?(h(),y(x,{key:6,icon:`mdi-format-quote-close`,size:`small`,variant:`text`,active:O(`blockquote`),"aria-label":a(C)(`fields.richtext.blockquote`),onClick:i[6]||=e=>k(e=>e.chain().focus().toggleBlockquote().run())},null,8,[`active`,`aria-label`])):b(``,!0),w(`codeBlock`)?(h(),y(x,{key:7,icon:`mdi-code-braces`,size:`small`,variant:`text`,active:O(`codeBlock`),"aria-label":a(C)(`fields.richtext.codeBlock`),onClick:i[7]||=e=>k(e=>e.chain().focus().toggleCodeBlock().run())},null,8,[`active`,`aria-label`])):b(``,!0),w(`horizontalRule`)?(h(),y(x,{key:8,icon:`mdi-minus`,size:`small`,variant:`text`,"aria-label":a(C)(`fields.richtext.horizontalRule`),onClick:i[8]||=e=>k(e=>e.chain().focus().setHorizontalRule().run())},null,8,[`aria-label`])):b(``,!0),w(`link`)?(h(),y(oe,{key:9,modelValue:a(A),"onUpdate:modelValue":i[11]||=e=>ee(A)?A.value=e:null,"close-on-content-click":!1,location:`bottom`},{activator:_(({props:e})=>[t(x,d(e,{icon:`mdi-link-variant`,size:`small`,variant:`text`,active:O(`link`),"aria-label":a(C)(`fields.richtext.link`),onClick:N}),null,16,[`active`,`aria-label`])]),default:_(()=>[t(fe,{"min-width":`320`,class:`pa-3`},{default:_(()=>[t(le,{modelValue:a(j),"onUpdate:modelValue":i[9]||=e=>ee(j)?j.value=e:null,label:a(C)(`fields.richtext.linkUrl`),"error-messages":a(M)?[a(M)]:[],autofocus:``,onKeydown:re(ae(P,[`prevent`]),[`enter`])},null,8,[`modelValue`,`label`,`error-messages`,`onKeydown`]),c(`div`,Yt,[t(x,{variant:`text`,onClick:i[10]||=e=>{j.value=``,P()}},{default:_(()=>[n(v(a(C)(`common.remove`)),1)]),_:1}),t(x,{color:`primary`,disabled:!!a(M),onClick:P},{default:_(()=>[n(v(a(C)(`common.apply`)),1)]),_:1},8,[`disabled`])])]),_:1})]),_:1},8,[`modelValue`])):b(``,!0)],64)),a(D)?(h(!0),l(g,{key:1},u(a(pe),([t,n])=>(h(),y(ne(n),{key:t,"data-editor-toolbar-item":t,editor:a(D),field:e.field},null,8,[`data-editor-toolbar-item`,`editor`,`field`]))),128)):b(``,!0),t(ue),t(x,{size:`small`,variant:`text`,"prepend-icon":a(T)?`mdi-eye-outline`:`mdi-language-markdown-outline`,"aria-pressed":a(T),onClick:i[12]||=e=>T.value=!a(T)},{default:_(()=>[n(v(a(T)?a(C)(`fields.richtext.visual`):a(C)(`fields.richtext.source`)),1)]),_:1},8,[`prepend-icon`,`aria-pressed`])],40,Jt),t(ce),a(T)?(h(),y(de,{key:0,modelValue:S.value,"onUpdate:modelValue":i[14]||=e=>S.value=e,"aria-label":a(C)(`fields.richtext.sourceOf`,{label:e.field.label}),variant:`plain`,"auto-grow":``,rows:`6`,"hide-details":``,class:`px-3 font-monospace`},null,8,[`modelValue`,`aria-label`])):b(``,!0),o(t(a(be),{editor:a(D),class:`vx-richtext-editor`},null,8,[`editor`]),[[ie,!a(T)]])],2)]),_:1},8,[`model-value`,`rules`,`error-messages`,`hint`,`persistent-hint`]))}}),{__name:`VxInputMarkdown`});export{Xt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,L as t,On as n,Ut as r,ct as i,fn as a,it as o,k as s,nn as c,tt as l,vn as u,xn as d}from"./2mrvZCJz.js";import{f}from"#entry";function p(e){return c((t,n)=>({get(){return t(),e},set(t){e=t,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}var m=class extends f{constructor(e={}){return super(e),this.contentComponent=null,this.appContext=null,this.reactiveState=p(this.view.state),this.reactiveExtensionStorage=p(this.extensionStorage),this.on(`beforeTransaction`,({nextState:e})=>{this.reactiveState.value=e,this.reactiveExtensionStorage.value=this.extensionStorage}),a(this)}get state(){var e;return(e=this.reactiveState)==null||e.value,super.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){let n=super.registerPlugin(e,t);return this.reactiveState&&(this.reactiveState.value=n),n}unregisterPlugin(e){let t=super.unregisterPlugin(e);return this.reactiveState&&t&&(this.reactiveState.value=t),t}},h=s({name:`EditorContent`,props:{editor:{default:null,type:Object}},setup(e){let i=u(),a=t();return r(()=>{let t=e.editor;t&&t.options.element&&i.value&&l(()=>{if(!i.value||!t.view.dom?.parentNode)return;let e=n(i.value);i.value.append(...t.view.dom.parentNode.childNodes),t.view.updateRoot(),t.contentComponent=a.ctx._,a&&(t.appContext={...a.appContext,provides:a.provides}),t.setOptions({element:e}),t.createNodeViews()})}),o(()=>{let t=e.editor;t&&(t.contentComponent=null,t.appContext=null)}),{rootEl:i}},render(){return e(`div`,{ref:e=>{this.rootEl=e}})}});s({name:`NodeViewContent`,props:{as:{type:String,default:`div`}},inject:{nodeViewContentRef:{default:void 0}},mounted(){let e=this.nodeViewContentRef;e&&this.$el&&e(this.$el)},beforeUnmount(){let e=this.nodeViewContentRef;e&&e(null)},render(){return e(this.as,{style:{whiteSpace:`pre-wrap`},"data-node-view-content":``})}}),s({name:`NodeViewWrapper`,props:{as:{type:String,default:`div`}},inject:[`onDragStart`,`decorationClasses`],render(){var t;return e(this.as,{class:this.decorationClasses,style:{whiteSpace:`normal`},"data-node-view-wrapper":``,onDragstart:this.onDragStart},(t=this.$slots).default?.call(t))}});var g=(e={})=>{let t=d();return i(()=>{t.value=new m(e)}),o(()=>{var e;(e=t.value)==null||e.destroy()}),t};s({name:`MarkViewContent`,props:{as:{type:String,default:`span`}},render(){return e(this.as,{style:{whiteSpace:`inherit`},"data-mark-view-content":``})}});export{g as n,h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,Ht as t,J as n,On as r,Pt as i,Zn as a,_ as o,ct as s,er as c,et as l,g as u,it as d,rt as f,tt as p,vn as m,wn as h,xn as g}from"./
|
|
1
|
+
import{D as e,Ht as t,J as n,On as r,Pt as i,Zn as a,_ as o,ct as s,er as c,et as l,g as u,it as d,rt as f,tt as p,vn as m,wn as h,xn as g}from"./2mrvZCJz.js";import{Lt as _,Mt as v,O as y,S as b,b as x,bt as S,c as C,k as w,mt as T,p as E,r as D,s as O,u as k,x as A,y as j,zt as M}from"./DfApYreK.js";import{a as N,c as P,o as F,s as I}from"./DllQuWrz.js";import{a as L,t as R}from"./qoAbHCOq.js";import{a as z}from"./7rwxDW6j.js";import{n as B,t as V}from"./BuTE4a2w.js";import{n as H,t as U}from"./C48zuAYh.js";import{n as W,t as G}from"./Jl8QPdwt.js";import{i as K}from"./yIw8BzU6.js";var q=b({text:String,onClick:y(),...A(),...O()},`VLabel`),J=E()({name:`VLabel`,props:q(),setup(e,{slots:t}){return k(()=>o(`label`,{class:a([`v-label`,{"v-label--clickable":!!e.onClick},e.class]),style:c(e.style),onClick:e.onClick},[e.text,t.default?.()])),{}}});function Y(t){let{t:n}=N();function r({name:r,color:i,...a}){let o={prepend:`prependAction`,prependInner:`prependAction`,append:`appendAction`,appendInner:`appendAction`,clear:`clear`}[r],s=t[`onClick:${r}`];function c(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),w(s,new PointerEvent(`click`,e)))}let u=s&&o?n(`$vuetify.input.${o}`,t.label??``):void 0;return e(R,l({icon:t[`${r}Icon`],"aria-label":u,onClick:s,onKeydown:c,color:i},a),null)}return{InputIcon:r}}var X=b({active:Boolean,color:String,messages:{type:[Array,String],default:()=>[]},...A(),...W({transition:{component:z,leaveAbsolute:!0,group:!0}})},`VMessages`),ee=E()({name:`VMessages`,props:X(),setup(t,{slots:n}){let r=u(()=>S(t.messages)),{textColorClasses:i,textColorStyles:s}=D(()=>t.color);return k(()=>e(G,{transition:t.transition,tag:`div`,class:a([`v-messages`,i.value,t.class]),style:c([s.value,t.style])},{default:()=>[t.active&&r.value.map((e,t)=>o(`div`,{class:`v-messages__message`,key:`${t}-${r.value}`},[n.message?n.message({message:e}):e]))]})),{}}}),Z=b({focused:Boolean,"onUpdate:focused":y()},`focus`);function te(e,t=x()){let n=I(e,`focused`),r=h(()=>({[`${t}--focused`]:n.value}));function i(){n.value=!0}function a(){n.value=!1}return{focusClasses:r,isFocused:n,focus:i,blur:a}}function ne(e,t){let{t:n}=t,r={required:e=>t=>t===0||!!t||n(e||`$vuetify.rules.required`),email:e=>t=>!t||_(t)&&/^.+@\S+\.\S+$/.test(t)||n(e||`$vuetify.rules.email`),number:e=>t=>!t||!isNaN(Number(t))||n(e||`$vuetify.rules.number`),integer:e=>t=>/^[\d]*$/.test(t)||n(e||`$vuetify.rules.integer`),capital:e=>t=>/^[A-Z]*$/.test(t)||n(e||`$vuetify.rules.capital`),maxLength:(e,t)=>r=>!r||r.length<=e||n(t||`$vuetify.rules.maxLength`,e),minLength:(e,t)=>r=>!r||r.length>=e||n(t||`$vuetify.rules.minLength`,e),strictLength:(e,t)=>r=>!r||r.length===e||n(t||`$vuetify.rules.strictLength`,e),exclude:(e,t)=>r=>{let i=!0;for(let a of e)r.includes(a)&&(i=t||n(`$vuetify.rules.exclude`,a));return i},notEmpty:e=>t=>t&&t.length>0||n(e||`$vuetify.rules.notEmpty`),pattern:(e,t)=>r=>!r||e.test(r)||n(t||`$vuetify.rules.pattern`),...e?.aliases};function i(e){return u(()=>e().map(e=>{let t=null,n=[void 0];return Array.isArray(e)?(t=e[0],n=e.slice(1)):_(e)&&(t=e),t?(t.startsWith(`$`)&&(t=t.slice(1)),r[t]?.(...n)):e}))}return{resolve:i,aliases:r}}var Q=Symbol.for(`vuetify:rules`);function re(e){let t=n(Q,null);if(!e){if(!t)throw Error(`Could not find Vuetify rules injection`);return t.aliases}return t?.resolve(e)??h(e)}var ie=b({disabled:{type:Boolean,default:null},error:Boolean,errorMessages:{type:[Array,String],default:()=>[]},maxErrors:{type:[Number,String],default:1},name:String,label:String,readonly:{type:Boolean,default:null},rules:{type:Array,default:()=>[]},modelValue:null,validateOn:String,validationValue:null,...Z()},`validation`);function ae(e,n=x(),a=i()){let o=I(e,`modelValue`),c=u(()=>M(e.validationValue)?o.value:e.validationValue),l=K(e),h=re(()=>e.rules),y=m([]),b=g(!0),C=u(()=>!!(S(o.value===``?null:o.value).length||S(c.value===``?null:c.value).length)),w=u(()=>e.errorMessages?.length?S(e.errorMessages).concat(y.value).slice(0,Math.max(0,Number(e.maxErrors))):y.value),T=u(()=>{let t=(e.validateOn??l.validateOn?.value)||`input`;t===`lazy`&&(t=`input lazy`),t===`eager`&&(t=`input eager`);let n=new Set(t?.split(` `)??[]);return{input:n.has(`input`),blur:n.has(`blur`)||n.has(`input`)||n.has(`invalid-input`),invalidInput:n.has(`invalid-input`),lazy:n.has(`lazy`),eager:n.has(`eager`)}}),E=u(()=>e.error||e.errorMessages?.length?!1:e.rules.length?b.value?y.value.length||T.value.lazy?null:!0:!y.value.length:!0),D=g(!1),O=!1,k=u(()=>({[`${n}--error`]:E.value===!1,[`${n}--dirty`]:C.value,[`${n}--disabled`]:l.isDisabled.value,[`${n}--readonly`]:l.isReadonly.value})),A=j(`validation`),N=u(()=>e.name??r(a));f(()=>{l.register?.({id:N.value,vm:A,validate:R,reset:F,resetValidation:L})}),d(()=>{l.unregister?.(N.value)}),s(async()=>{T.value.lazy||await R(!T.value.eager),l.update?.(N.value,E.value,w.value)}),P(()=>T.value.input||T.value.invalidInput&&E.value===!1,()=>{t(c,()=>{O||R()})}),P(()=>T.value.blur,()=>{t(()=>e.focused,e=>{e||R()})}),t([E,w],()=>{l.update?.(N.value,E.value,w.value)});async function F(){O=!0,o.value=null,await p(),O=!1,await L()}async function L(){b.value=!0,T.value.lazy?y.value=[]:await R(!T.value.eager)}async function R(t=!1){let n=[];D.value=!0;for(let t of h.value){if(n.length>=Number(e.maxErrors??1))break;let r=await(v(t)?t:()=>t)(c.value);r!==!0&&(r!==!1&&!_(r)?console.warn(`${r} is not a valid value. Rule functions must return boolean true or a string.`):n.push(r||``))}return y.value=n,D.value=!1,b.value=t,y.value}return{errorMessages:w,isDirty:C,isDisabled:l.isDisabled,isReadonly:l.isReadonly,isPristine:b,isValid:E,isValidating:D,reset:F,resetValidation:L,validate:R,validationClasses:k}}var $=b({id:String,appendIcon:L,baseColor:String,centerAffix:{type:Boolean,default:!0},color:String,glow:Boolean,iconColor:[Boolean,String],prependIcon:L,detailsActive:{type:Boolean,default:null},hideDetails:[Boolean,String],hideSpinButtons:Boolean,hint:String,indentDetails:{type:Boolean,default:null},persistentHint:Boolean,messages:{type:[Array,String],default:()=>[]},direction:{type:String,default:`horizontal`,validator:e=>[`horizontal`,`vertical`].includes(e)},"onClick:prepend":y(),"onClick:append":y(),...A(),...V(),...T(U(),[`maxWidth`,`minWidth`,`width`]),...O(),...ie()},`VInput`),oe=E()({name:`VInput`,props:{...$()},emits:{"update:modelValue":e=>!0},setup(t,{attrs:n,slots:r,emit:s}){let{densityClasses:l}=B(t),{dimensionStyles:d}=H(t),{themeClasses:f}=C(t),{rtlClasses:p}=F(),{InputIcon:m}=Y(t),g=i(),_=u(()=>t.id||`input-${g}`),{errorMessages:v,isDirty:y,isDisabled:b,isReadonly:x,isPristine:S,isValid:w,isValidating:T,reset:E,resetValidation:D,validate:O,validationClasses:A}=ae(t,`v-input`,_),j=u(()=>t.errorMessages?.length||!S.value&&v.value.length?v.value:t.hint&&(t.persistentHint||t.focused)?t.hint:t.messages),M=h(()=>j.value.length>0),N=h(()=>!t.hideDetails||t.hideDetails===`auto`&&(M.value||(t.detailsActive??!!r.details))),P=u(()=>N.value?`${_.value}-messages`:void 0),I=u(()=>({id:_,messagesId:P,isDirty:y,isDisabled:b,isReadonly:x,isPristine:S,isValid:w,isValidating:T,hasDetails:N,reset:E,resetValidation:D,validate:O})),L=h(()=>t.error||t.disabled?void 0:t.focused?t.color:t.baseColor),R=h(()=>{if(t.iconColor)return t.iconColor===!0?L.value:t.iconColor});return k(()=>{let n=!!(r.prepend||t.prependIcon),i=!!(r.append||t.appendIcon);return o(`div`,{class:a([`v-input`,`v-input--${t.direction}`,{"v-input--center-affix":t.centerAffix,"v-input--focused":t.focused,"v-input--glow":t.glow,"v-input--hide-spin-buttons":t.hideSpinButtons,"v-input--indent-details":t.indentDetails},l.value,f.value,p.value,A.value,t.class]),style:c([d.value,t.style])},[n&&o(`div`,{key:`prepend`,class:`v-input__prepend`},[r.prepend?r.prepend(I.value):t.prependIcon&&e(m,{key:`prepend-icon`,name:`prepend`,color:R.value},null)]),r.default&&o(`div`,{class:`v-input__control`},[r.default?.(I.value)]),i&&o(`div`,{key:`append`,class:`v-input__append`},[r.append?r.append(I.value):t.appendIcon&&e(m,{key:`append-icon`,name:`append`,color:R.value},null)]),t.hideDetails!==!0&&o(`div`,{id:P.value,class:a([`v-input__details`,{"v-input__details--hidden":!N.value}]),role:`alert`,"aria-live":`polite`},[e(ee,{active:M.value,messages:j.value},{message:r.message}),r.details?.(I.value)])])}),{reset:E,resetValidation:D,validate:O,isValid:w,errorMessages:v}}});export{Z as a,J as c,ne as i,$ as n,te as o,Q as r,Y as s,oe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,On as t,_ as n,b as r,k as i,mt as a,tr as o}from"./
|
|
1
|
+
import{D as e,On as t,_ as n,b as r,k as i,mt as a,tr as o}from"./2mrvZCJz.js";import{t as s}from"./D3xofh1k.js";import{n as c}from"#entry";var l={key:0,class:`d-inline-flex align-center ga-2`},u={key:1,class:`text-disabled`},d=Object.assign(i({__name:`Color`,props:{value:{}},setup(i){let{t:d}=c();return(c,f)=>typeof i.value==`string`&&i.value?(a(),r(`span`,l,[e(s,{color:i.value,size:`16`},null,8,[`color`]),n(`code`,null,o(i.value),1)])):(a(),r(`span`,u,o(t(d)(`common.none`)),1))}}),{__name:`VxCellColor`});export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,er as s,g as c,k as l,mt as u,o as d,tr as f,y as p}from"./
|
|
1
|
+
import{D as e,E as t,On as n,Zn as r,_ as i,b as a,bt as o,er as s,g as c,k as l,mt as u,o as d,tr as f,y as p}from"./2mrvZCJz.js";import{t as m}from"./qoAbHCOq.js";import{n as h}from"#entry";import{t as g}from"./Cn3RmOLp.js";var _={class:`d-flex rounded overflow-hidden mb-3`,style:{height:`12px`}},v=[`title`],y={class:`d-flex align-center ga-2`},b={class:`font-weight-medium`},x={class:`text-medium-emphasis`},S={key:0,class:`text-medium-emphasis text-body-2`},C=Object.assign(l({__name:`Partition`,props:{data:{}},setup(l){let C=l,{t:w}=h(),T=c(()=>C.data.slices??[]),E=c(()=>T.value.reduce((e,t)=>e+t.value,0));return(c,h)=>(u(),a(`div`,null,[i(`div`,_,[(u(!0),a(d,null,o(n(T),e=>(u(),a(`div`,{key:e.label,class:r(`bg-${e.color??`primary`}`),style:s({width:`${n(E)?e.value/n(E)*100:0}%`}),title:e.label},null,14,v))),128))]),(u(!0),a(d,null,o(n(T),r=>(u(),a(`div`,{key:r.label,class:`d-flex justify-space-between text-body-2 py-1`},[i(`span`,y,[e(m,{size:`x-small`,icon:`mdi-circle`,color:r.color??`primary`},null,8,[`color`]),t(f(r.label),1)]),i(`span`,b,[t(f((`formatWidgetValue`in c?c.formatWidgetValue:n(g))(r.value,l.data.format))+` `,1),i(`span`,x,`(`+f(n(w)(`dashboard.percent`,{value:n(E)?Math.round(r.value/n(E)*100):0}))+`)`,1)])]))),128)),n(T).length===0?(u(),a(`div`,S,f(n(w)(`dashboard.partition.empty`)),1)):p(``,!0)]))}}),{__name:`VxWidgetPartition`});export{C as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.vx-fieldset[data-v-dad410be]{border:0;min-width:0;margin:0;padding:0}.vx-inline-cell[data-v-9c02f16a]{cursor:text;color:inherit;font:inherit;text-align:inherit;background:0 0;border:0;border-radius:4px;align-items:center;gap:4px;margin:-2px -4px;padding:2px 4px;display:inline-flex}.vx-inline-cell[data-v-9c02f16a]:focus-visible,.vx-inline-cell[data-v-9c02f16a]:hover{outline:1px dashed rgba(var(--v-theme-primary),.6)}.vx-inline-pencil[data-v-9c02f16a]{opacity:0}.vx-inline-cell:focus-visible .vx-inline-pencil[data-v-9c02f16a],.vx-inline-cell:hover .vx-inline-pencil[data-v-9c02f16a]{opacity:.6}.vx-inline-editor[data-v-9c02f16a]{min-width:140px;padding-block:4px}.vx-inline-changed[data-v-9c02f16a]{background:rgba(var(--v-theme-warning),.12);border-radius:4px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./BDLrTt6l.js";import{c as t,o as n}from"./BgBmuOuJ.js";import{
|
|
1
|
+
import{r as e}from"./BDLrTt6l.js";import{c as t,o as n}from"./BgBmuOuJ.js";import{dt as r,ft as i}from"#entry";var a=36500,o=10080,s=5e3;function c(e){let t=e;return t?.status??t?.statusCode??t?.response?.status??null}function l(t){switch(c(t)){case 403:return e(`queues.errors.forbidden`);case 404:return e(`queues.errors.notFound`);case 409:return e(`queues.errors.conflict`,{detail:i(t)});case 422:return e(`queues.errors.invalid`,{detail:i(t)});default:return e(`queues.errors.failed`,{detail:i(t)})}}function u(e){let t=c(e);return t===403||t===404}function d(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==``&&e!=null))}function f(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toISOString().replace(/\.\d{3}Z$/,`Z`)}function p(e){return!e||!Number.isNaN(new Date(e).getTime())}function m(n){return typeof n==`number`?t(n):e(`queues.none`)}function h(n){return typeof n==`number`?t(Math.round(n*10)/10):e(`queues.none`)}function g(t){return typeof t==`number`?e(`queues.percent`,{value:(t*100).toFixed(1)}):e(`queues.none`)}function _(t){return t==null||t===``?e(`queues.none`):n(typeof t==`number`?new Date(t*1e3).toISOString():t)}function v(t){return t.maxAttempts===null?m(t.attempts):e(`queues.failed.attemptsOf`,{attempts:t.attempts,max:t.maxAttempts})}function y(t){let n=e=>t.filter(t=>t.status===e).length;return{text:e(`queues.failed.retried`,{retried:n(`retried`),notFound:n(`not_found`),failed:n(`failed`)}),ok:n(`retried`)===t.length}}function b(e){let t=String(e??``).trim();if(!/^[1-9]\d*$/.test(t))return null;let n=Number(t);return n>36500?null:n}function x(e){let t={succeeded:0,released:0,failed:0,max:null,duration:0};for(let n of e?.queues??[])t.succeeded+=n.succeeded,t.released+=n.released,t.failed+=n.failed,t.duration+=n.averageDurationMs*(n.succeeded+n.released+n.failed),t.max=Math.max(t.max??0,n.maxDurationMs);let n=t.succeeded+t.released+t.failed,r=t.succeeded+t.failed;return{succeeded:t.succeeded,released:t.released,failed:t.failed,maxDurationMs:t.max,failureRate:r===0?null:t.failed/r,averageDurationMs:n===0?null:t.duration/n}}function S(e){let t=e.map(e=>e.succeeded+e.released+e.failed),n=Math.max(1,Math.ceil(t.length/240)),r=[];for(let e=0;e<t.length;e+=n)r.push(t.slice(e,e+n).reduce((e,t)=>e+t,0));let i=Math.max(1,...r);return{width:Math.max(1,r.length-1),points:r.map((e,t)=>`${t},${(40-e/i*38-1).toFixed(2)}`).join(` `)}}var C=[15,60,360,1440,o];function w(){let e=r(),t=e=>`/vector/queues/${encodeURIComponent(e)}`;async function n(){return(await e(`/vector/queues`)).data}async function i(){return await e(`/vector/queues/permissions`)}async function a(n,r){return(await e(`${t(n)}/clear`,{method:`POST`,body:{confirm:r}})).data.cleared}async function o(t,n=null){let r=d({queue:t.queue,class:t.class.trim(),failedFrom:f(t.failedFrom),failedTo:f(t.failedTo),cursor:n});return await e(`/vector/queues/failed`,{query:r})}async function s(t){return(await e(`/vector/queues/failed/${encodeURIComponent(t)}`)).data}async function c(t){return(await e(`/vector/queues/failed/retry`,{method:`POST`,body:{ids:t}})).data}async function l(t){await e(`/vector/queues/failed/${encodeURIComponent(t)}`,{method:`DELETE`})}async function u(t){return(await e(`/vector/queues/failed/prune`,{method:`POST`,body:{days:t}})).data.deleted}async function p(t,n){let r=Math.floor(Date.now()/6e4)*60,i=r-(n-1)*60;return(await e(`/vector/queues/metrics`,{query:d({queue:t,from:i,to:r})})).data}return{overview:n,permissions:i,clear:a,failed:o,failedJob:s,retry:c,forget:l,prune:u,metrics:p}}export{_,l as a,c,h as d,m as f,S as g,y as h,C as i,p as l,g as m,a as n,u as o,b as p,s as r,v as s,w as t,x as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,et as c,g as l,gn as u,k as d,mt as f,o as p,qt as m,tr as h,v as g,vn as _,wt as v,xt as y,y as b}from"./2mrvZCJz.js";import{w as x}from"./CDnV5Q2S.js";import{a as S,t as ee}from"./BW9qBvMR.js";import{t as C}from"./qoAbHCOq.js";import{t as w}from"./CWfptrnU.js";import{r as T,t as E}from"./D3jC5ZAK.js";import{n as D}from"./D3xofh1k.js";import{t as te}from"./DeZyAt_3.js";import{n as O,t as ne}from"./CD5zJmlk.js";import{i as re}from"./B9s6vEby.js";import{D as k,E as A,F as j,I as M,J as ie,L as N,O as P,P as F,Q as ae,R as oe,U as se,W as ce,ft as I,k as L,lt as le,mt as ue,n as de,pt as fe}from"#entry";import{n as pe}from"./zA0zNamO.js";import{t as me}from"./BVrihF-G.js";import{a as he,i as ge,n as _e,r as ve,t as ye}from"./BcSEGymu.js";var R={class:`font-weight-medium`},z={key:0,class:`text-body-2 text-medium-emphasis mb-4`},B={key:0,class:`text-body-2 text-medium-emphasis mb-4`},V={key:0,class:`text-subtitle-1 font-weight-medium mt-2`},H=Object.assign(d({__name:`Layout`,props:{nodes:{},columns:{default:2},shown:{},errors:{default:()=>[]},defaultSpan:{}},setup(c){let d=c;function _(e){return e.kind===`field`?[e.name]:(e.children??[]).flatMap(_)}let v=e=>_(e).some(e=>d.shown(e)),x=e=>_(e).some(e=>d.errors.includes(e)),S=l(()=>d.nodes.map((e,t)=>({node:e,key:String(t)})).filter(({node:e})=>v(e)));function ee(e){let t=e.span??d.defaultSpan(e.name);return t===`full`?12:Math.round(12*Math.min(t,d.columns)/d.columns)}let w=u(Object.fromEntries(d.nodes.map((e,t)=>[String(t),!e.collapsed]))),T=u({}),E=e=>(e.children??[]).filter(v);return n(()=>d.errors,()=>{for(let{node:e,key:t}of S.value)if(e.kind===`section`&&x(e)&&(w[t]=!0),e.kind===`tabs`){let n=E(e),r=n.find(e=>e.label===(T[t]??n[0]?.label)),i=n.find(x);!i||r&&x(r)||(T[t]=i.label??void 0)}},{deep:!0,immediate:!0}),(n,l)=>{let u=H;return f(),g(ne,{density:`compact`},{default:m(()=>[(f(!0),o(p,null,s(r(S),({node:l,key:d})=>(f(),o(p,{key:d},[l.kind===`field`?(f(),g(O,{key:0,cols:`12`,md:ee(l),"data-layout-field":l.name},{default:m(()=>[y(n.$slots,`field`,{field:l.name})]),_:2},1032,[`md`,`data-layout-field`])):l.kind===`section`?(f(),g(O,{key:1,cols:`12`,class:`vx-layout-section`,"data-layout-section":l.label},{default:m(()=>[l.collapsible?(f(),g(F,{key:0,"model-value":r(w)[d]?[0]:[],variant:`accordion`,"onUpdate:modelValue":e=>r(w)[d]=Array.isArray(e)&&e.length>0},{default:m(()=>[e(j,{value:0},{default:m(()=>[e(M,null,{default:m(()=>[a(`span`,R,h(l.label),1),x(l)?(f(),g(C,{key:0,icon:`mdi-alert-circle`,color:`error`,size:`small`,class:`ms-2`})):b(``,!0)]),_:2},1024),e(N,{eager:``},{default:m(()=>[l.description?(f(),o(`p`,z,h(l.description),1)):b(``,!0),e(u,{nodes:l.children??[],columns:l.columns??2,shown:c.shown,errors:c.errors,"default-span":c.defaultSpan},{field:m(({field:e})=>[y(n.$slots,`field`,{field:e})]),_:3},8,[`nodes`,`columns`,`shown`,`errors`,`default-span`])]),_:2},1024)]),_:2},1024)]),_:2},1032,[`model-value`,`onUpdate:modelValue`])):(f(),o(p,{key:1},[a(`div`,{class:i([`text-subtitle-1 font-weight-medium mt-2`,l.description?`mb-1`:`mb-4`])},h(l.label),3),l.description?(f(),o(`p`,B,h(l.description),1)):b(``,!0),e(u,{nodes:l.children??[],columns:l.columns??2,shown:c.shown,errors:c.errors,"default-span":c.defaultSpan},{field:m(({field:e})=>[y(n.$slots,`field`,{field:e})]),_:3},8,[`nodes`,`columns`,`shown`,`errors`,`default-span`])],64))]),_:2},1032,[`data-layout-section`])):l.kind===`tabs`?(f(),g(O,{key:2,cols:`12`,class:`vx-layout-tabs`},{default:m(()=>[l.label?(f(),o(`div`,V,h(l.label),1)):b(``,!0),e(A,{"model-value":r(T)[d]??E(l)[0]?.label??void 0,density:`compact`,color:`primary`,"onUpdate:modelValue":e=>r(T)[d]=String(e)},{default:m(()=>[(f(!0),o(p,null,s(E(l),e=>(f(),g(L,{key:e.label??``,value:e.label,"data-layout-tab":e.label},{default:m(()=>[t(h(e.label)+` `,1),x(e)?(f(),g(D,{key:0,dot:``,inline:``,color:`error`,class:`ms-1`})):b(``,!0)]),_:2},1032,[`value`,`data-layout-tab`]))),128))]),_:2},1032,[`model-value`,`onUpdate:modelValue`]),e(te,{class:`mb-2`}),e(P,{"model-value":r(T)[d]??E(l)[0]?.label??void 0},{default:m(()=>[(f(!0),o(p,null,s(E(l),t=>(f(),g(k,{key:t.label??``,value:t.label,eager:``,class:`pt-3`},{default:m(()=>[e(u,{nodes:t.children??[],columns:t.columns??2,shown:c.shown,errors:c.errors,"default-span":c.defaultSpan},{field:m(({field:e})=>[y(n.$slots,`field`,{field:e})]),_:3},8,[`nodes`,`columns`,`shown`,`errors`,`default-span`])]),_:2},1032,[`value`]))),128))]),_:2},1032,[`model-value`])]),_:2},1024)):b(``,!0)],64))),128))]),_:3})}}}),{__name:`VxLayout`}),be={key:0},U=Object.assign(d({__name:`Form`,props:{resource:{},operation:{},record:{},preset:{},variants:{type:Boolean},copyOf:{}},emits:[`saved`,`cancel`],setup(n,{expose:i,emit:a}){let d=n,y=a,{t:C}=de(),{inputFor:D,editable:te}=he(),{resource:O}=le(),ne=fe(),k=pe(()=>d.resource.slug),A=u({}),j=_(!1),M=_(null),N=u(new Set),P=l(()=>d.resource.fields.filter(e=>te(e,d.operation))),F=u({}),L=u({}),R=e=>e===void 0?void 0:JSON.parse(JSON.stringify(e)),z=e=>d.operation===`create`&&d.copyOf!==void 0&&e.unique!==!0&&![`file`,`image`,`manyToMany`,`hasMany`].includes(e.type);function B(e){return d.operation===`create`&&e.hasDefault?JSON.parse(JSON.stringify(e.default??null)):U(e)}function V(){for(let e of P.value){let t=d.preset?.[e.name]??d.record?.[e.name]??(z(e)?d.copyOf[e.name]:void 0),n=t===void 0?B(e):t;e.type===`belongsTo`&&t&&typeof t==`object`&&`id`in t&&(n=t.id),(e.type===`manyToMany`||e.type===`hasMany`)&&(n=[]),F[e.name]=n,L[e.name]=R(n)}}V();function U(e){return e.type===`boolean`?!1:e.type===`manyToMany`||e.type===`hasMany`?[]:null}let W=d.operation===`update`?d.record:d.copyOf;if(W){for(let e of P.value.filter(e=>e.type===`manyToMany`))xe(W.id,e).then(t=>{F[e.name]=t,L[e.name]=[...t]}).catch(t=>{N.add(e.name),M.value=I(t)});for(let e of P.value.filter(e=>e.repeater))k.rows(W.id,e.name).catch(t=>(N.add(e.name),M.value=I(t),null)).then(t=>{if(t===null)return;let n=t.data.map(t=>Object.fromEntries([...d.operation===`update`?[[`id`,t.id]]:[],...e.repeater.fields.map(e=>{let n=t[e];return[e,n&&typeof n==`object`&&`id`in n?n.id:n]})]));F[e.name]=n,L[e.name]=JSON.parse(JSON.stringify(n))})}async function xe(e,t){let n=(t.relation?O(t.relation.resource)?.table.maxPerPage:void 0)??100,r=[];for(let i=1;;i++){let a=await k.related(e,t.name,{page:i,perPage:n});if(r.push(...a.data.map(e=>e.id)),a.lastPage===null?!a.hasMore:i>=a.lastPage)return r}}let Se=e=>[`markdown`,`richtext`,`text`,`json`,`keyValue`].includes(e.type)||!!e.repeater,G=_([]),Ce=e=>`vx-field-${e}`,we=l(()=>P.value.some(e=>!N.has(e.name)&&JSON.stringify(F[e.name]??null)!==JSON.stringify(L[e.name]??null))),K=ue();K.load().catch(()=>void 0);let Te=l(()=>d.operation===`create`?[`close`,`continue`,`another`]:[`close`,`continue`]),q=l(()=>{let e=K.get(`form.saveVariant`);return e&&Te.value.includes(e)?e:`close`}),Ee=e=>{let t=d.operation===`create`?`create`:`save`;return C(e===`close`?`common.${t}`:`record.variants.${t}${e===`continue`?`Continue`:`Another`}`)},J=_(null),Y=null;async function De(e){e!==q.value&&K.put({"form.saveVariant":e}).catch(()=>void 0),Y=e;let t=await J.value?.validate();t&&await ke(t)}me(window,`keydown`,e=>{d.variants&&(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`s`&&(e.preventDefault(),j.value||De(q.value).catch(X))});async function Oe(e){await ke(await e)}async function ke({valid:e,errors:t}){let n=Y??q.value;if(Y=null,G.value=t.map(e=>String(e.id)).filter(e=>e.startsWith(`vx-field-`)).map(e=>e.slice(9)),e){j.value=!0,M.value=null;for(let e of Object.keys(A))delete A[e];try{let e=await Ae();ne.success(C(`record.saved`,{label:d.resource.labelSingular}));for(let e of P.value)L[e.name]=R(F[e.name]);y(`saved`,e.data,n)}catch(e){X(e)}finally{j.value=!1}}}function Ae(){if(d.operation===`create`)return k.create(Me(!1));let e=d.record?._version;return k.update(d.record.id,Me(!0),e)}function X(e){let t=e,n=t?.data?.errors;if((t?.status??t?.statusCode)!==422||!Array.isArray(n))M.value=I(e);else{for(let e of ye(n))je(e);!M.value&&Object.keys(A).length===0&&(M.value=C(`common.serverRejected`))}}function je(e){let t=e.path.length>=3&&P.value.some(t=>t.name===e.path[0]&&t.repeater),n=t?e.path.slice(0,3).join(`.`):String(e.path[0]??``);n&&(n in F||t)?(A[n]??=[],A[n].push(`${e.message.charAt(0).toUpperCase()}${e.message.slice(1)}`)):M.value=e.message}function Me(e){let t={};for(let n of P.value){let r=F[n.name];N.has(n.name)||e&&JSON.stringify(r)===JSON.stringify(L[n.name])||(e||r!==null&&r!==``||n.nullable===!0||n.type===`manyToMany`)&&(t[n.name]=r===``?null:r)}return t}function Ne(e){delete A[e]}function Pe(){for(let e of Object.keys(A))delete A[e];M.value=null,G.value=[],V(),J.value?.resetValidation()}i({dirty:we,reset:Pe});let Z=l(()=>{let e={...d.record,...F};return Object.fromEntries(P.value.map(t=>[t.name,ve(t,e)]))}),Fe=l(()=>P.value.filter(e=>Z.value[e.name]?.visible!==!1&&!(d.preset&&e.name in d.preset))),Q=l(()=>new Map(P.value.map(e=>[e.name,e]))),Ie=l(()=>({...F,id:d.record?.id})),Le=l(()=>new Set(Fe.value.map(e=>e.name))),Re=l(()=>d.resource.layout?.form??P.value.map(e=>({kind:`field`,label:null,description:null,collapsible:!1,collapsed:!1,columns:null,span:null,name:e.name,children:null}))),ze=e=>{let t=Q.value.get(e);return t&&Se(t)?`full`:1},Be=l(()=>[...new Set([...Object.entries(A).filter(([,e])=>e.length>0).map(([e])=>e.split(`.`)[0]),...G.value])]),$=l(()=>Object.entries(A).map(([e,t])=>[e.split(`.`)[0],t]).filter(([e])=>!Le.value.has(e)).flatMap(([e,t])=>t.map(t=>`${Q.value.get(e)?.label??e}: ${t}`)));return(i,a)=>{let l=_e,u=H;return f(),g(re,{ref_key:`formRef`,ref:J,"validate-on":`blur lazy`,onSubmit:x(Oe,[`prevent`])},{default:m(()=>[e(se,null,{default:m(()=>[e(ce,null,{default:m(()=>[r(M)||r($).length?(f(),g(ae,{key:0,type:`error`,variant:`tonal`,class:`mb-4`},{default:m(()=>[r(M)?(f(),o(`div`,be,h(r(M)),1)):b(``,!0),(f(!0),o(p,null,s(r($),e=>(f(),o(`div`,{key:e},h(e),1))),128))]),_:1})):b(``,!0),e(u,{nodes:r(Re),shown:e=>r(Le).has(e),errors:r(Be),"default-span":ze},{field:m(({field:t})=>[(f(),g(v(r(D)(r(Q).get(t))),c({id:Ce(t),modelValue:r(F)[t],"onUpdate:modelValue":e=>r(F)[t]=e,field:r(Q).get(t),disabled:r(Z)[t]?.disabled===!0,rules:(`rulesFor`in i?i.rulesFor:r(ge))(r(Q).get(t),n.operation,r(Z)[t]),"error-messages":r(A)[t]??[],record:r(Ie),resource:n.resource.slug},r(Q).get(t).repeater?{serverErrors:r(A)}:{},{"onUpdate:modelValue":e=>Ne(t)}),null,16,[`id`,`modelValue`,`onUpdate:modelValue`,`field`,`disabled`,`rules`,`error-messages`,`record`,`resource`])),e(l,{field:r(Q).get(t),resource:n.resource.slug,record:r(Ie),"model-value":r(F)[t],disabled:r(Z)[t]?.disabled===!0,"onUpdate:modelValue":e=>{r(F)[t]=e,Ne(t)}},null,8,[`field`,`resource`,`record`,`model-value`,`disabled`,`onUpdate:modelValue`])]),_:1},8,[`nodes`,`shown`,`errors`])]),_:1}),e(ie,null,{default:m(()=>[e(oe),e(E,{variant:`text`,onClick:a[0]||=e=>y(`cancel`)},{default:m(()=>[t(h(r(C)(`common.cancel`)),1)]),_:1}),n.variants?(f(),g(T,{key:1,color:`primary`,density:`comfortable`,divided:``},{default:m(()=>[e(E,{type:`submit`,loading:r(j)},{default:m(()=>[t(h(Ee(r(q))),1)]),_:1},8,[`loading`]),e(w,{location:`top end`},{activator:m(({props:t})=>[e(E,c(t,{icon:`mdi-menu-down`,"aria-label":r(C)(`record.variants.menu`),disabled:r(j)}),null,16,[`aria-label`,`disabled`])]),default:m(()=>[e(ee,{density:`compact`},{default:m(()=>[(f(!0),o(p,null,s(r(Te),e=>(f(),g(S,{key:e,title:Ee(e),active:e===r(q),onClick:t=>De(e)},null,8,[`title`,`active`,`onClick`]))),128))]),_:1})]),_:1})]),_:1})):(f(),g(E,{key:0,type:`submit`,color:`primary`,loading:r(j)},{default:m(()=>[t(h(n.operation===`create`?r(C)(`common.create`):r(C)(`common.save`)),1)]),_:1},8,[`loading`]))]),_:1})]),_:1})]),_:1},512)}}}),{__name:`VxResourceForm`});export{H as n,U as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"febd0fe3-67f9-4afd-94c3-97178a3ef2b1","timestamp":1795442525021}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"febd0fe3-67f9-4afd-94c3-97178a3ef2b1","timestamp":1795442525021,"prerendered":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{dt as e}from"#entry";import{t}from"./zA0zNamO.js";function n(){let n=e();async function r(){return(await n(`/vector/jobs`)).data}async function i(e){return(await n(`/vector/jobs/${e}`)).data}async function a(e,t,n){let r=1e3;for(;;){let a=await i(e);if(t?.(a),a.status===`done`||a.status===`failed`||a.status===`stalled`||n?.aborted||(await new Promise(e=>{let t=()=>{clearTimeout(i),n?.removeEventListener(`abort`,t),e()},i=setTimeout(t,r);n?.addEventListener(`abort`,t,{once:!0})}),n?.aborted))return a;r=Math.min(5e3,r+500)}}async function o(e){let r=await t(()=>n.raw(`/vector/jobs/${e.id}/download`,{responseType:`blob`})),i=URL.createObjectURL(r._data),a=document.createElement(`a`);a.href=i,a.download=e.fileName??`job-${e.id}`,document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(i),1e3)}return{list:r,show:i,watch:a,download:o}}export{n as t};
|