@templatical/editor 0.57.0 → 0.57.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiAltTextPopover-BjClNscQ.js → AiAltTextPopover-B4cg0jQG.js} +1 -1
- package/dist/{AiAltTextReview-DeMdVbtT.js → AiAltTextReview-Dni8I9eV.js} +1 -1
- package/dist/{AiChatPanel-Cros4ZCM.js → AiChatPanel-QWqGhy2s.js} +8 -8
- package/dist/{AiPanels-D_CdHqFZ.js → AiPanels-DE2ysIV1.js} +1 -1
- package/dist/{AiRewriteMenu-BSzj1dKC.js → AiRewriteMenu-B25gpnip.js} +8 -8
- package/dist/{BlockIssueBadge-i2cZy5PB.js → BlockIssueBadge-Ri7dQhuz.js} +2 -2
- package/dist/{BlockPreviewCanvas-D-If_vd_.js → BlockPreviewCanvas-yr5MmQql.js} +4 -4
- package/dist/{CloudPanels-DPeK_siQ.js → CloudPanels-ZOR9By8W.js} +3 -3
- package/dist/{CollaborationNotices-DkYX-ose.js → CollaborationNotices-COS_YvTq.js} +1 -1
- package/dist/{CollaboratorBar-xDweDvB6.js → CollaboratorBar-jq6HH0fb.js} +1 -1
- package/dist/{CommentsPanel-t3w16YUl.js → CommentsPanel-B0_Ob2vO.js} +1 -1
- package/dist/{CommentsSidebar-B3M90RY_.js → CommentsSidebar-DFoLon5D.js} +10 -10
- package/dist/{CountdownToolbar-DBu2ZqC6.js → CountdownToolbar-BtP0n0yZ.js} +4 -4
- package/dist/{IssuesPanel-BnUut-p-.js → IssuesPanel-CarJYQFu.js} +9 -9
- package/dist/{LanguageMenu-DfTxrbvp.js → LanguageMenu-confz89v.js} +10 -10
- package/dist/{LocaleNotices-D6zk-QCL.js → LocaleNotices-D8aE167E.js} +2 -2
- package/dist/{LogicTagInsertButton-CJ1Jk6jv.js → LogicTagInsertButton-DFL3kvGK.js} +6 -6
- package/dist/{MediaEditModal-BxbwZxnf.js → MediaEditModal-BWOqjEZN.js} +1 -1
- package/dist/{MediaPanels-BiUxsTMM.js → MediaPanels-C-XrldMu.js} +1 -1
- package/dist/{MergeTagInput-CV-z85s9.js → MergeTagInput-BuGJeeyA.js} +1 -1
- package/dist/{MergeTagModeToggle-CixgX5C_.js → MergeTagModeToggle-D7482NZf.js} +4 -4
- package/dist/{MergeTagTextarea-B1zOC_Nr.js → MergeTagTextarea-Qt9_NeY4.js} +3 -3
- package/dist/{ParagraphEditor-C9UhWvRB.js → ParagraphEditor-Cd-CBE_l.js} +45 -45
- package/dist/{RestoreVersionDialog-Do7fZWpT.js → RestoreVersionDialog-Clh4l0Bn.js} +3 -3
- package/dist/{RichTextEditorContent-wW_SMun2.js → RichTextEditorContent-Dw_Z9zhi.js} +4 -4
- package/dist/{SaveBlockDialog-CCHIUfR-.js → SaveBlockDialog-kboYvk_a.js} +7 -7
- package/dist/{SavedBlocksBrowserModal-DtPHhfw9.js → SavedBlocksBrowserModal-wVGMC6My.js} +9 -9
- package/dist/{SavedBlocksPanels-CYIby5pR.js → SavedBlocksPanels-C9AHYfYR.js} +1 -1
- package/dist/{SavedBlocksPickBar-CCwBugqN.js → SavedBlocksPickBar-CVbV5MVL.js} +2 -2
- package/dist/{TemplateSettings-B8IVy5q9.js → TemplateSettings-ChCm5_2b.js} +8 -8
- package/dist/{TestEmailModal-CS5JoKRH.js → TestEmailModal-CYq9Ec7x.js} +7 -7
- package/dist/{TestEmailPanel-sOIZfKzc.js → TestEmailPanel-7Ua54CYL.js} +1 -1
- package/dist/{TitleEditor-ZlBcq9_P.js → TitleEditor-DXMOgW-9.js} +9 -9
- package/dist/{Toolbar-c4_rLLJT.js → Toolbar-CVHJl6i4.js} +30 -30
- package/dist/{TplModal-DnFFEulp.js → TplModal-BErE8I3p.js} +1 -1
- package/dist/{VersionHistoryMenu-Cd2IaHgT.js → VersionHistoryMenu-P3P00KqQ.js} +5 -5
- package/dist/{VersionHistoryPanels-TdGaMaa_.js → VersionHistoryPanels-DES1b1Pq.js} +1 -1
- package/dist/{VersionPreviewBanner-lkAf7tc8.js → VersionPreviewBanner-D2TtR9I5.js} +1 -1
- package/dist/{WrapperBlock-BiW4ye3w.js → WrapperBlock-B1zI7POT.js} +3 -3
- package/dist/{blockTypeIcons-D1aYMC1M.js → blockTypeIcons-Dp540i74.js} +3 -3
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiAltTextPopover-CfGJNBOb.js → AiAltTextPopover-sx3bmRiV.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextPopover-CfGJNBOb.js.map → AiAltTextPopover-sx3bmRiV.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-PKe31R_g.js → AiAltTextReview-Cj3PKInZ.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextReview-PKe31R_g.js.map → AiAltTextReview-Cj3PKInZ.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-DNCUpV8n.js → AiChatPanel-DibkqrqY.js} +2 -2
- package/dist/cdn/chunks/{AiChatPanel-DNCUpV8n.js.map → AiChatPanel-DibkqrqY.js.map} +1 -1
- package/dist/cdn/chunks/{AiPanels-IV0VEkBL.js → AiPanels-DVs4r8sY.js} +2 -2
- package/dist/cdn/chunks/{AiPanels-IV0VEkBL.js.map → AiPanels-DVs4r8sY.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-ZDBwReuU.js → AiRewriteMenu-BbZ9NRoe.js} +6 -6
- package/dist/cdn/chunks/{AiRewriteMenu-ZDBwReuU.js.map → AiRewriteMenu-BbZ9NRoe.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-DIlFDDwh.js → BlockIssueBadge-BWIth1y6.js} +2 -2
- package/dist/cdn/chunks/{BlockIssueBadge-DIlFDDwh.js.map → BlockIssueBadge-BWIth1y6.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-D7U6nQ7t.js → BlockPreviewCanvas-BDZ6pMHq.js} +5 -5
- package/dist/cdn/chunks/{BlockPreviewCanvas-D7U6nQ7t.js.map → BlockPreviewCanvas-BDZ6pMHq.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-EXXNMLbs.js → CloudPanels-BI_hJwcJ.js} +3 -3
- package/dist/cdn/chunks/{CloudPanels-EXXNMLbs.js.map → CloudPanels-BI_hJwcJ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaborationNotices-DGA8XRZJ.js → CollaborationNotices-yKOt4o7B.js} +2 -2
- package/dist/cdn/chunks/{CollaborationNotices-DGA8XRZJ.js.map → CollaborationNotices-yKOt4o7B.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-BWL1Shc1.js → CollaboratorBar-D5fycyLP.js} +2 -2
- package/dist/cdn/chunks/{CollaboratorBar-BWL1Shc1.js.map → CollaboratorBar-D5fycyLP.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-4mrl4zMK.js → CommentsPanel-BPoa1lBK.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-4mrl4zMK.js.map → CommentsPanel-BPoa1lBK.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-BJ87vc7i.js → CommentsSidebar-DLn9qWtv.js} +2 -2
- package/dist/cdn/chunks/{CommentsSidebar-BJ87vc7i.js.map → CommentsSidebar-DLn9qWtv.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-BN2_zvRj.js → CountdownToolbar-D5_QBuhO.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-BN2_zvRj.js.map → CountdownToolbar-D5_QBuhO.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-BDwegn0s.js → IssuesPanel-BzVpxRkq.js} +4 -4
- package/dist/cdn/chunks/{IssuesPanel-BDwegn0s.js.map → IssuesPanel-BzVpxRkq.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-DXq9cXUd.js → LanguageMenu-GEbUX5Oe.js} +5 -5
- package/dist/cdn/chunks/{LanguageMenu-DXq9cXUd.js.map → LanguageMenu-GEbUX5Oe.js.map} +1 -1
- package/dist/cdn/chunks/{LocaleNotices-CUN5K5QJ.js → LocaleNotices-CWRS_G-4.js} +2 -2
- package/dist/cdn/chunks/{LocaleNotices-CUN5K5QJ.js.map → LocaleNotices-CWRS_G-4.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-BEArlbra.js → LogicTagInsertButton-CrkAz1t_.js} +5 -5
- package/dist/cdn/chunks/{LogicTagInsertButton-BEArlbra.js.map → LogicTagInsertButton-CrkAz1t_.js.map} +1 -1
- package/dist/cdn/chunks/{MediaEditModal-BHTMNHx0.js → MediaEditModal-CfgN7Jyi.js} +2 -2
- package/dist/cdn/chunks/{MediaEditModal-BHTMNHx0.js.map → MediaEditModal-CfgN7Jyi.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-BlianNRh.js → MediaPanels-Cb5vsgb-.js} +2 -2
- package/dist/cdn/chunks/{MediaPanels-BlianNRh.js.map → MediaPanels-Cb5vsgb-.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-B3SLXXzL.js → MergeTagInput-DkCATtfE.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-B3SLXXzL.js.map → MergeTagInput-DkCATtfE.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-Dywp9ntA.js → MergeTagModeToggle-DYAFxyoB.js} +3 -3
- package/dist/cdn/chunks/{MergeTagModeToggle-Dywp9ntA.js.map → MergeTagModeToggle-DYAFxyoB.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-B9TM7FgM.js → MergeTagTextarea-DRS6pXSE.js} +4 -4
- package/dist/cdn/chunks/{MergeTagTextarea-B9TM7FgM.js.map → MergeTagTextarea-DRS6pXSE.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-CVGtTYta.js → ParagraphEditor-rEdKBett.js} +25 -25
- package/dist/cdn/chunks/{ParagraphEditor-CVGtTYta.js.map → ParagraphEditor-rEdKBett.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-Dt_0qOOW.js → RestoreVersionDialog-B7eTijWD.js} +3 -3
- package/dist/cdn/chunks/{RestoreVersionDialog-Dt_0qOOW.js.map → RestoreVersionDialog-B7eTijWD.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-BjN4mnzL.js → RichTextEditorContent-EtUIYzHB.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-BjN4mnzL.js.map → RichTextEditorContent-EtUIYzHB.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-D9eBjE99.js → SaveBlockDialog-BquE_Brz.js} +6 -6
- package/dist/cdn/chunks/{SaveBlockDialog-D9eBjE99.js.map → SaveBlockDialog-BquE_Brz.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-ClsTpkdk.js → SavedBlocksBrowserModal--fNlId5y.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-ClsTpkdk.js.map → SavedBlocksBrowserModal--fNlId5y.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-CxlNHhUs.js → SavedBlocksPanels-0Z0dELDm.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-CxlNHhUs.js.map → SavedBlocksPanels-0Z0dELDm.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-C7_Z8phX.js → SavedBlocksPickBar-yezZxZeP.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPickBar-C7_Z8phX.js.map → SavedBlocksPickBar-yezZxZeP.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-B6zDtjSs.js → TemplateSettings-DFetnT9P.js} +6 -6
- package/dist/cdn/chunks/{TemplateSettings-B6zDtjSs.js.map → TemplateSettings-DFetnT9P.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-CJ_QYFua.js → TestEmailModal-DJpwpEZs.js} +7 -7
- package/dist/cdn/chunks/{TestEmailModal-CJ_QYFua.js.map → TestEmailModal-DJpwpEZs.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-CsFrTq_a.js → TestEmailPanel-C2dxmmoW.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-CsFrTq_a.js.map → TestEmailPanel-C2dxmmoW.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CuKJptyw.js → TitleEditor-Bq62I2SC.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-CuKJptyw.js.map → TitleEditor-Bq62I2SC.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-TS2WwlPW.js → Toolbar-CwmW8wAI.js} +19 -19
- package/dist/cdn/chunks/{Toolbar-TS2WwlPW.js.map → Toolbar-CwmW8wAI.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-CsadClrH.js → TplModal-DE6BniBg.js} +2 -2
- package/dist/cdn/chunks/{TplModal-CsadClrH.js.map → TplModal-DE6BniBg.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-BNPxnWiO.js → VersionHistoryMenu-BBYU71Ua.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryMenu-BNPxnWiO.js.map → VersionHistoryMenu-BBYU71Ua.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-CieY91f0.js → VersionHistoryPanels-mMMqnf3O.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-CieY91f0.js.map → VersionHistoryPanels-mMMqnf3O.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-BldFvgxJ.js → VersionPreviewBanner-tBz-3lGg.js} +2 -2
- package/dist/cdn/chunks/{VersionPreviewBanner-BldFvgxJ.js.map → VersionPreviewBanner-tBz-3lGg.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-DtnRuKWE.js → WrapperBlock-B9XxtFql.js} +4 -4
- package/dist/cdn/chunks/{WrapperBlock-DtnRuKWE.js.map → WrapperBlock-B9XxtFql.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-19xd5ZPi.js → blockTypeIcons-CGxNYHVA.js} +6 -6
- package/dist/cdn/chunks/{blockTypeIcons-19xd5ZPi.js.map → blockTypeIcons-CGxNYHVA.js.map} +1 -1
- package/dist/cdn/chunks/{composables-CUIiW9OD.js → composables-CkthyXi9.js} +12 -12
- package/dist/cdn/chunks/{composables-CUIiW9OD.js.map → composables-CkthyXi9.js.map} +1 -1
- package/dist/cdn/chunks/{createCloudRuntime-B7D04wKf.js → createCloudRuntime-k12jYbXP.js} +3 -3
- package/dist/cdn/chunks/{createCloudRuntime-B7D04wKf.js.map → createCloudRuntime-k12jYbXP.js.map} +1 -1
- package/dist/cdn/chunks/{editor-modal-CarOiAYJ.js → editor-modal-CXSSZplR.js} +4 -4
- package/dist/cdn/chunks/{editor-modal-CarOiAYJ.js.map → editor-modal-CXSSZplR.js.map} +1 -1
- package/dist/cdn/chunks/en-DYMYt1TN.js +1 -0
- package/dist/cdn/chunks/{extensions-Cbvk9i08.js → extensions-Djyg5slk.js} +5 -5
- package/dist/cdn/chunks/{extensions-Cbvk9i08.js.map → extensions-Djyg5slk.js.map} +1 -1
- package/dist/cdn/chunks/{icons-Cl4oR2mf.js → icons-C7vjUBLn.js} +47 -47
- package/dist/cdn/chunks/{icons-Cl4oR2mf.js.map → icons-C7vjUBLn.js.map} +1 -1
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-BJ-MnCqF.js → normalizeMergeTagMarkup-nDyYIXvL.js} +2 -2
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-BJ-MnCqF.js.map → normalizeMergeTagMarkup-nDyYIXvL.js.map} +1 -1
- package/dist/cdn/chunks/{preRenderCustomBlocks-D2wISRHq.js → preRenderCustomBlocks-CxwYcAQe.js} +2 -2
- package/dist/cdn/chunks/{preRenderCustomBlocks-D2wISRHq.js.map → preRenderCustomBlocks-CxwYcAQe.js.map} +1 -1
- package/dist/cdn/chunks/{sanitizeHtml-CB7fjHFs.js → sanitizeHtml-5T_KaDcp.js} +2 -2
- package/dist/cdn/chunks/{sanitizeHtml-CB7fjHFs.js.map → sanitizeHtml-5T_KaDcp.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-C_yggK1_.js → socialIcons-CkgQUpim.js} +3 -3
- package/dist/cdn/chunks/{socialIcons-C_yggK1_.js.map → socialIcons-CkgQUpim.js.map} +1 -1
- package/dist/cdn/chunks/{src-Bp7bZcuD.js → src-BRyzUujm.js} +2 -2
- package/dist/cdn/chunks/{src-Bp7bZcuD.js.map → src-BRyzUujm.js.map} +1 -1
- package/dist/cdn/chunks/{src-CdVAke9t.js → src-CVHGPKSW.js} +553 -547
- package/dist/cdn/chunks/src-CVHGPKSW.js.map +1 -0
- package/dist/cdn/chunks/{src-D-URHI0Z.js → src-CpUX1Mhb.js} +3 -3
- package/dist/cdn/chunks/{src-D-URHI0Z.js.map → src-CpUX1Mhb.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-BPiZqxCt.js → tiptap-B7gxx0aJ.js} +2578 -2570
- package/dist/cdn/chunks/tiptap-B7gxx0aJ.js.map +1 -0
- package/dist/cdn/chunks/{useLocalizedDisplay-slFOCPrh.js → useLocalizedDisplay-7iwZ1UhB.js} +2 -2
- package/dist/cdn/chunks/{useLocalizedDisplay-slFOCPrh.js.map → useLocalizedDisplay-7iwZ1UhB.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-lPjCGeGC.js → useLogicTag-YXRBcfgG.js} +2 -2
- package/dist/cdn/chunks/{useLogicTag-lPjCGeGC.js.map → useLogicTag-YXRBcfgG.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-BKNBwIry.js → useMergeTag-lb-Wrw-B.js} +2 -2
- package/dist/cdn/chunks/{useMergeTag-BKNBwIry.js.map → useMergeTag-lb-Wrw-B.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-CzTFFaJA.js → withCurrentFont-BaeBoPQZ.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-CzTFFaJA.js.map → withCurrentFont-BaeBoPQZ.js.map} +1 -1
- package/dist/cdn/editor.js +25 -25
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-C7ua4TAK.js → check-ErKdPXG6.js} +1 -1
- package/dist/{chevron-down-DftQrAkI.js → chevron-down-C_vv5fZE.js} +1 -1
- package/dist/{chevron-right-B-DULGbg.js → chevron-right-Cw4GpjFA.js} +1 -1
- package/dist/{chevron-up-CeYsyD8c.js → chevron-up-uijYZoph.js} +1 -1
- package/dist/{circle-exclamation-point-DHjORV_I.js → circle-exclamation-point-CIYHx5Tw.js} +1 -1
- package/dist/{clock-CajOtLEZ.js → clock-tnC1IvZk.js} +1 -1
- package/dist/{composables-DbjgUQlV.js → composables-BrzGZQkd.js} +17 -17
- package/dist/{createCloudRuntime-Cnh2M6iT.js → createCloudRuntime-DgQfMi22.js} +2 -2
- package/dist/{createLucideIcon-D-mELTSY.js → createLucideIcon-CssArtUe.js} +5 -5
- package/dist/{dist-B3G4Yvpd.js → dist-BTUMr4Pb.js} +2 -2
- package/dist/{dist-CAvsz9cW.js → dist-BTjObRcv.js} +349 -343
- package/dist/{dist-B15BvV94.js → dist-BlrlMP8f.js} +2 -2
- package/dist/{dist-CMBOqk9I.js → dist-C-NRkFsp.js} +5 -5
- package/dist/{dist-BmV-2uBJ.js → dist-CkHJRChP.js} +2 -2
- package/dist/dist-CkIeJEsa.js +4 -0
- package/dist/{dist-DI_8rB1X.js → dist-Clfx1JeL.js} +2 -2
- package/dist/{dist-BxKFi2h_.js → dist-CsplpC_6.js} +2 -2
- package/dist/{dist-CXTsTO5h.js → dist-DY3WbyCO.js} +2 -2
- package/dist/{dist-DENg3ORe.js → dist-DwpKFWF4.js} +1206 -1198
- package/dist/{dist-D5BUcCjv.js → dist-HKEDfp__.js} +2 -2
- package/dist/{dist-DAdrn64r.js → dist-bWIkrMkM.js} +2 -2
- package/dist/dist-eAgG-nCb.js +4 -0
- package/dist/{editor-modal-CgsaLpwB.js → editor-modal-BWvxfSj8.js} +15 -15
- package/dist/en-DvCaYqiR.js +1 -0
- package/dist/{extensions-7fb-XtNJ.js → extensions-Cyp2x7cD.js} +6 -6
- package/dist/{eye-fe5sKF_K.js → eye-DK4--qHk.js} +1 -1
- package/dist/{image-CUC7SZiW.js → image-B5pJOw5Q.js} +1 -1
- package/dist/{info-DDbLU4pT.js → info-DKM0_thN.js} +1 -1
- package/dist/{link-C2icj0iH.js → link-BNgTZ_Sw.js} +1 -1
- package/dist/{list-KYC_Jb5A.js → list-Bqynqm7o.js} +1 -1
- package/dist/{loader-circle-DmyagWpc.js → loader-circle-BMc3fVpa.js} +1 -1
- package/dist/{message-circle-ijyWn6UJ.js → message-circle-D_TpvAJh.js} +1 -1
- package/dist/{normalizeMergeTagMarkup-GrXJfXsQ.js → normalizeMergeTagMarkup-fgoVMKAc.js} +1 -1
- package/dist/{package-CKYm_jQY.js → package-D2fov5PU.js} +1 -1
- package/dist/{pencil-C2TRSR-Y.js → pencil-BNdkJyfY.js} +1 -1
- package/dist/{plus-CotJVDxb.js → plus-CWmBmMx-.js} +1 -1
- package/dist/{preRenderCustomBlocks-DuXtzD-F.js → preRenderCustomBlocks-CgPtlLGL.js} +1 -1
- package/dist/{refresh-cw-CuCRV6D5.js → refresh-cw-Ryg1j66N.js} +1 -1
- package/dist/{rotate-ccw-BlnQ3y6R.js → rotate-ccw-D8j7gXXv.js} +1 -1
- package/dist/{sanitizeHtml-eV4_BpI6.js → sanitizeHtml-D2wueiEe.js} +2 -2
- package/dist/{search-Dxw6oFrZ.js → search-CX2JkSHz.js} +1 -1
- package/dist/{send-C-blQBZ9.js → send-BLR1b-p5.js} +1 -1
- package/dist/{smartphone-rLz4X-Dd.js → smartphone-Co8m0LLg.js} +1 -1
- package/dist/{socialIcons-brRkK9Om.js → socialIcons-ZfH8PyV2.js} +4 -4
- package/dist/{sparkles-JWQlUiSn.js → sparkles-Dc3Undp5.js} +1 -1
- package/dist/{square-DshDy1Il.js → square-CPw_cyX8.js} +1 -1
- package/dist/templatical-editor.js +34 -34
- package/dist/{text-align-start-CyasaQtr.js → text-align-start-2VZGhCiK.js} +13 -13
- package/dist/{trash-B1lZp2Tv.js → trash-t6XXliVc.js} +1 -1
- package/dist/{triangle-exclamation-point-BhJvBEoT.js → triangle-exclamation-point-_YYWE2ZH.js} +1 -1
- package/dist/{upload-CNK8JX38.js → upload-BWYXWYHb.js} +1 -1
- package/dist/{useLocalizedDisplay-DoaT7nWk.js → useLocalizedDisplay-9RqT2y_Y.js} +1 -1
- package/dist/{useLogicTag-cTC2KbWd.js → useLogicTag-BTCtn-uG.js} +1 -1
- package/dist/{useMergeTag-D2YDZ8vR.js → useMergeTag-QlXUjCWT.js} +1 -1
- package/dist/{useScrollToBlock-vf_KD0FM.js → useScrollToBlock-DruzlN2h.js} +1 -1
- package/dist/{withCurrentFont-DAmED4fN.js → withCurrentFont-BXZ7g-K6.js} +1 -1
- package/dist/{x-DbLX5Qdm.js → x-CTKOxIyZ.js} +1 -1
- package/package.json +22 -22
- package/dist/cdn/chunks/en-B4s_0ryk.js +0 -1
- package/dist/cdn/chunks/src-CdVAke9t.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BPiZqxCt.js.map +0 -1
- package/dist/dist-D9cbSSSx.js +0 -4
- package/dist/dist-ELLEk-lS.js +0 -4
- package/dist/en-DBLcB-CW.js +0 -1
|
@@ -343,23 +343,23 @@ function xe(e) {
|
|
|
343
343
|
}
|
|
344
344
|
return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, h(t, e) ? e : t;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function b(e) {
|
|
347
347
|
let t = xe(e);
|
|
348
348
|
if (t.type === "wrapper") {
|
|
349
|
-
let e = t.children.map(
|
|
349
|
+
let e = t.children.map(b);
|
|
350
350
|
return e.some((e, n) => e !== t.children[n]) ? {
|
|
351
351
|
...t,
|
|
352
352
|
children: e
|
|
353
353
|
} : t;
|
|
354
354
|
}
|
|
355
355
|
if (t.type !== "section") return t;
|
|
356
|
-
let n = t.children.map((e) => e.map(
|
|
356
|
+
let n = t.children.map((e) => e.map(b));
|
|
357
357
|
return n.some((e, n) => e.some((e, r) => e !== t.children[n][r])) ? {
|
|
358
358
|
...t,
|
|
359
359
|
children: n
|
|
360
360
|
} : t;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
362
|
+
function Se(e, t, n) {
|
|
363
363
|
if (e.type === "custom") return !1;
|
|
364
364
|
if (e.type === "section") return t === "columns";
|
|
365
365
|
let r = e.type === "menu" ? "items" : e.type === "social" ? "icons" : e.type === "table" ? "rows" : null;
|
|
@@ -380,10 +380,10 @@ function Ce(e, t, n) {
|
|
|
380
380
|
}
|
|
381
381
|
return !1;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
383
|
+
function Ce(e) {
|
|
384
384
|
return xe(e);
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function x(e, t, n) {
|
|
387
387
|
if (!v(t)) return !1;
|
|
388
388
|
let r = t.split("."), i = r.pop(), a = r.reduce(be, e);
|
|
389
389
|
if (Array.isArray(a)) {
|
|
@@ -392,21 +392,21 @@ function b(e, t, n) {
|
|
|
392
392
|
}
|
|
393
393
|
return _(a) ? (n === null ? delete a[i] : a[i] = m(n), !0) : !1;
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function we(e, t) {
|
|
396
396
|
let [n, ...r] = t.split(".");
|
|
397
397
|
if (n === void 0) return [""];
|
|
398
398
|
let i = [];
|
|
399
399
|
if (n === "*") {
|
|
400
400
|
let t = Array.isArray(e) ? e : [];
|
|
401
|
-
for (let e of t) if (_(e) && typeof e.id == "string") for (let t of r.length ?
|
|
401
|
+
for (let e of t) if (_(e) && typeof e.id == "string") for (let t of r.length ? we(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
|
|
402
402
|
return i;
|
|
403
403
|
}
|
|
404
404
|
let a = _(e) ? e[n] : void 0;
|
|
405
405
|
if (r.length === 0) return a === void 0 ? [] : [n];
|
|
406
|
-
for (let e of
|
|
406
|
+
for (let e of we(a, r.join("."))) i.push(`${n}.${e}`);
|
|
407
407
|
return i;
|
|
408
408
|
}
|
|
409
|
-
function
|
|
409
|
+
function S(e, t = []) {
|
|
410
410
|
if (e.type === "custom") {
|
|
411
411
|
let n = t.find((t) => t.type === e.customType), r = new Set((n?.fields ?? []).filter((e) => e.type === "text" || e.type === "textarea").map((e) => e.key)), i = e.fieldValues;
|
|
412
412
|
return _(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
|
|
@@ -421,42 +421,42 @@ function x(e, t = []) {
|
|
|
421
421
|
cells: e.cells.filter(n)
|
|
422
422
|
}))
|
|
423
423
|
} : e;
|
|
424
|
-
return (_e[e.type] ?? []).flatMap((e) =>
|
|
424
|
+
return (_e[e.type] ?? []).flatMap((e) => we(r, e));
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Te(e, t) {
|
|
427
427
|
return (_e[e] ?? []).some((e) => {
|
|
428
428
|
let n = e.split("."), r = t.split(".");
|
|
429
429
|
return n.length === r.length && n.every((e, t) => e === "*" || e === r[t]);
|
|
430
430
|
});
|
|
431
431
|
}
|
|
432
|
-
function
|
|
432
|
+
function C(e) {
|
|
433
433
|
let t = 2166136261;
|
|
434
434
|
for (let n of new TextEncoder().encode(e)) t ^= n, t = Math.imul(t, 16777619) >>> 0;
|
|
435
435
|
return t.toString(16).padStart(8, "0");
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function Ee(e) {
|
|
438
438
|
let { l10n: t, ...n } = e;
|
|
439
439
|
return n;
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function De(e = {}) {
|
|
442
442
|
return Object.entries(e).sort(([e], [t]) => e.split(".").length - t.split(".").length);
|
|
443
443
|
}
|
|
444
444
|
function Oe(e, t, n) {
|
|
445
|
-
return ke(e, m(
|
|
445
|
+
return ke(e, m(Ee(e)), t, n);
|
|
446
446
|
}
|
|
447
447
|
function ke(e, t, n, r) {
|
|
448
448
|
let i = e;
|
|
449
449
|
if (n === r) return t;
|
|
450
450
|
let a = i.l10n?.[n];
|
|
451
451
|
if (!a) return t;
|
|
452
|
-
for (let [e, n] of
|
|
453
|
-
for (let [n, r] of Object.entries(a.text ?? {})) y(e, n) !== void 0 &&
|
|
452
|
+
for (let [e, n] of De(a.set)) x(t, e, n);
|
|
453
|
+
for (let [n, r] of Object.entries(a.text ?? {})) y(e, n) !== void 0 && x(t, n, r.value);
|
|
454
454
|
return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete t.renderedHtml, t;
|
|
455
455
|
}
|
|
456
456
|
function Ae(e, t, n) {
|
|
457
457
|
let r = e;
|
|
458
458
|
if (r.type !== "section" && r.type !== "wrapper" || !Array.isArray(r.children)) return Oe(e, t, n);
|
|
459
|
-
let { children: i, ...a } =
|
|
459
|
+
let { children: i, ...a } = Ee(r), o = m(a);
|
|
460
460
|
return o.children = i, ke(e, o, t, n);
|
|
461
461
|
}
|
|
462
462
|
function je(e, t) {
|
|
@@ -481,8 +481,8 @@ function Ne(e, t, n) {
|
|
|
481
481
|
return a.type === "section" && Array.isArray(a.children) ? a.children = a.children.map((e) => i(e)) : a.type === "wrapper" && Array.isArray(a.children) && (a.children = i(a.children)), [a];
|
|
482
482
|
}), a = m(Me(e.settings)), o = e.settings?.l10n?.[t];
|
|
483
483
|
if (t !== r && o) {
|
|
484
|
-
for (let [e, t] of
|
|
485
|
-
for (let [t, n] of Object.entries(o.text ?? {})) y(e.settings, t) !== void 0 &&
|
|
484
|
+
for (let [e, t] of De(o.set)) x(a, e, t);
|
|
485
|
+
for (let [t, n] of Object.entries(o.text ?? {})) y(e.settings, t) !== void 0 && x(a, t, n.value);
|
|
486
486
|
}
|
|
487
487
|
return a.locale = t, {
|
|
488
488
|
blocks: i(e.blocks),
|
|
@@ -499,13 +499,13 @@ function Pe(e, t, n = []) {
|
|
|
499
499
|
let n = y(t, a);
|
|
500
500
|
if (typeof n != "string") continue;
|
|
501
501
|
let o = i?.[a];
|
|
502
|
-
(o || n !== "") && (o ? o.sourceHash ===
|
|
502
|
+
(o || n !== "") && (o ? o.sourceHash === C(n) ? r.translated.push(`${e}/${a}`) : r.stale.push(`${e}/${a}`) : r.missing.push(`${e}/${a}`));
|
|
503
503
|
}
|
|
504
504
|
}, a = (e) => {
|
|
505
505
|
for (let r of e) {
|
|
506
506
|
if (je(r, t)) continue;
|
|
507
507
|
let e = r.l10n?.[t];
|
|
508
|
-
i(r.id, r,
|
|
508
|
+
i(r.id, r, S(r, n), e?.text);
|
|
509
509
|
let o = r.children;
|
|
510
510
|
if (r.type === "section" && Array.isArray(o)) for (let e of o) a(e);
|
|
511
511
|
else r.type === "wrapper" && Array.isArray(o) && a(o);
|
|
@@ -525,7 +525,7 @@ function Ie(e, t, n = []) {
|
|
|
525
525
|
let r = [], i = (e, n, i) => {
|
|
526
526
|
r.push(...Le(n, t, i).map((t) => `${e}/${t}`));
|
|
527
527
|
}, a = (e) => {
|
|
528
|
-
for (let t of e) i(t.id, t,
|
|
528
|
+
for (let t of e) i(t.id, t, S(t, n)), t.type === "section" ? t.children.forEach(a) : t.type === "wrapper" && a(t.children);
|
|
529
529
|
};
|
|
530
530
|
return a(e.blocks), i("settings", e.settings, g), r;
|
|
531
531
|
}
|
|
@@ -540,8 +540,8 @@ function Re(e, t, n = {}) {
|
|
|
540
540
|
let r = w(e), i = (e, n, i) => {
|
|
541
541
|
let a = Le(e, t, i), o = m(e.l10n ?? {}), s = o[t] ?? {}, c = m(e);
|
|
542
542
|
delete c.l10n;
|
|
543
|
-
for (let [e, t] of
|
|
544
|
-
for (let [t, n] of Object.entries(s.text ?? {})) y(e, t) !== void 0 &&
|
|
543
|
+
for (let [e, t] of De(s.set)) x(c, e, t);
|
|
544
|
+
for (let [t, n] of Object.entries(s.text ?? {})) y(e, t) !== void 0 && x(c, t, n.value);
|
|
545
545
|
delete o[t];
|
|
546
546
|
let l = {}, u = /* @__PURE__ */ new Set([
|
|
547
547
|
...Object.keys(s.set ?? {}),
|
|
@@ -552,10 +552,10 @@ function Re(e, t, n = {}) {
|
|
|
552
552
|
let r = y(e, t), i = y(c, t);
|
|
553
553
|
h(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
|
|
554
554
|
value: r,
|
|
555
|
-
sourceHash:
|
|
555
|
+
sourceHash: C(r)
|
|
556
556
|
}) : n(t) && typeof r == "string" && typeof i == "string" ? (l.text ??= {})[t] = {
|
|
557
557
|
value: r,
|
|
558
|
-
sourceHash:
|
|
558
|
+
sourceHash: C(i)
|
|
559
559
|
} : (l.set ??= {})[t] = r === void 0 ? null : m(r);
|
|
560
560
|
}
|
|
561
561
|
let d = (e, t) => {
|
|
@@ -579,21 +579,21 @@ function Re(e, t, n = {}) {
|
|
|
579
579
|
};
|
|
580
580
|
for (let t of Object.values(o)) {
|
|
581
581
|
let n = m(e);
|
|
582
|
-
for (let [e, r] of
|
|
583
|
-
for (let [r, i] of Object.entries(t.text ?? {})) y(e, r) !== void 0 &&
|
|
582
|
+
for (let [e, r] of De(t.set)) x(n, e, r);
|
|
583
|
+
for (let [r, i] of Object.entries(t.text ?? {})) y(e, r) !== void 0 && x(n, r, i.value);
|
|
584
584
|
for (let [n, r] of Object.entries(t.text ?? {})) {
|
|
585
585
|
let i = y(c, n);
|
|
586
586
|
if (typeof i != "string") (t.set ??= {})[n] = r.value, delete t.text[n];
|
|
587
587
|
else {
|
|
588
588
|
let t = y(e, n);
|
|
589
|
-
typeof t == "string" && r.sourceHash ===
|
|
589
|
+
typeof t == "string" && r.sourceHash === C(t) && (r.sourceHash = C(i));
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
592
|
d(t, n);
|
|
593
593
|
}
|
|
594
594
|
return Object.keys(l).length && (d(l, e), o[r] = l), Object.keys(o).length && (c.l10n = o), c;
|
|
595
595
|
}, a = (e) => e.map((e) => {
|
|
596
|
-
let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] :
|
|
596
|
+
let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] : S(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : Te(e.type, n), t);
|
|
597
597
|
return e.type === "custom" && r.type === "custom" && !h(e.fieldValues, r.fieldValues) && delete r.renderedHtml, r.type === "section" ? r.children = r.children.map(a) : r.type === "wrapper" && (r.children = a(r.children)), r;
|
|
598
598
|
}), o = i(e.settings, (e) => g.includes(e), g);
|
|
599
599
|
return o.locale = t, o.locales = e.settings.locales.map((e) => e === t ? r : e), {
|
|
@@ -604,9 +604,9 @@ function Re(e, t, n = {}) {
|
|
|
604
604
|
// ../types/src/operations.ts
|
|
605
605
|
var ze = "Sections with a wrapper cannot be placed inside wrappers.";
|
|
606
606
|
function Be(e, t, n = []) {
|
|
607
|
-
let r = Object.fromEntries(
|
|
607
|
+
let r = Object.fromEntries(I(e.blocks).flatMap((e) => {
|
|
608
608
|
if (e.type !== "custom") return [];
|
|
609
|
-
let t =
|
|
609
|
+
let t = S(e, n).filter((t) => typeof y(e, t) == "string");
|
|
610
610
|
return t.length && Ke.has(e.id) && D("invalid_operation", 0, qe), t.length ? [[e.id, t]] : [];
|
|
611
611
|
}));
|
|
612
612
|
return {
|
|
@@ -635,7 +635,7 @@ function E(e, t, n = {}) {
|
|
|
635
635
|
locks: n.locks ?? [],
|
|
636
636
|
session: n.session ?? null
|
|
637
637
|
};
|
|
638
|
-
t.forEach((t, n) =>
|
|
638
|
+
t.forEach((t, n) => ut(e, t, n, r));
|
|
639
639
|
}
|
|
640
640
|
var Ue = /* @__PURE__ */ new Set([
|
|
641
641
|
"id",
|
|
@@ -660,14 +660,14 @@ function O(e) {
|
|
|
660
660
|
function k(e) {
|
|
661
661
|
return e.type === "section";
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function A(e) {
|
|
664
664
|
return Array.isArray(e.blocks) ? e.blocks : [];
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function Je(e) {
|
|
667
667
|
let t = e.children;
|
|
668
668
|
return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
|
|
669
669
|
}
|
|
670
|
-
function*
|
|
670
|
+
function* Ye(e, t) {
|
|
671
671
|
for (let n = 0; n < e.length; n++) {
|
|
672
672
|
let r = e[n];
|
|
673
673
|
if (O(r) && (yield {
|
|
@@ -676,47 +676,47 @@ function* Xe(e, t) {
|
|
|
676
676
|
index: n,
|
|
677
677
|
parent: t
|
|
678
678
|
}, typeof r.id == "string")) {
|
|
679
|
-
if (k(r)) for (let [e, t] of
|
|
679
|
+
if (k(r)) for (let [e, t] of Je(r).entries()) yield* Ye(t, {
|
|
680
680
|
sectionId: r.id,
|
|
681
681
|
column: e
|
|
682
682
|
});
|
|
683
|
-
else r.type === "wrapper" && Array.isArray(r.children) && (yield*
|
|
683
|
+
else r.type === "wrapper" && Array.isArray(r.children) && (yield* Ye(r.children, { wrapperId: r.id }));
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
|
-
function
|
|
688
|
-
for (let n of
|
|
687
|
+
function j(e, t) {
|
|
688
|
+
for (let n of Ye(A(e), null)) if (n.block.id === t) return n;
|
|
689
689
|
return null;
|
|
690
690
|
}
|
|
691
|
-
function
|
|
691
|
+
function M(e) {
|
|
692
692
|
if (!O(e)) return [];
|
|
693
693
|
let t = typeof e.id == "string" ? [e.id] : [];
|
|
694
|
-
if (k(e)) for (let n of
|
|
695
|
-
else if (e.type === "wrapper" && Array.isArray(e.children)) for (let n of
|
|
694
|
+
if (k(e)) for (let n of Je(e)) for (let e of Xe(n)) t.push(e);
|
|
695
|
+
else if (e.type === "wrapper" && Array.isArray(e.children)) for (let n of Xe(e.children)) t.push(n);
|
|
696
696
|
return t;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
699
|
-
return e.flatMap(
|
|
698
|
+
function Xe(e) {
|
|
699
|
+
return e.flatMap(M);
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function N(e, t) {
|
|
702
702
|
return typeof e.blockId != "string" || e.blockId === "" ? D("invalid_operation", t, "blockId must be a block id.") : e.blockId;
|
|
703
703
|
}
|
|
704
|
-
function
|
|
704
|
+
function Ze(e, t) {
|
|
705
705
|
let n = e.parent;
|
|
706
706
|
return n === null ? null : O(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
|
|
707
707
|
sectionId: n.sectionId,
|
|
708
708
|
column: n.column
|
|
709
709
|
} : O(n) && typeof n.wrapperId == "string" && n.wrapperId !== "" && !Object.hasOwn(n, "sectionId") && !Object.hasOwn(n, "column") ? { wrapperId: n.wrapperId } : D("invalid_operation", t, "parent must be null, { \"sectionId\", \"column\" }, or { \"wrapperId\" }.");
|
|
710
710
|
}
|
|
711
|
-
function
|
|
711
|
+
function Qe(e, t) {
|
|
712
712
|
let n = e.after;
|
|
713
713
|
return n === null ? null : typeof n == "string" && n !== "" ? n : D("invalid_operation", t, "after must be null or a block id.");
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function P(e, t) {
|
|
716
716
|
let n = e.expect;
|
|
717
717
|
return n == null ? null : O(n) ? n : D("invalid_operation", t, "expect must be an object.");
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function $e(e, t, n) {
|
|
720
720
|
let r = e.set ?? null, i = e.unset ?? [];
|
|
721
721
|
(r === null || O(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || D("invalid_operation", t, "set must be an object and unset a list of keys.");
|
|
722
722
|
let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
|
|
@@ -728,49 +728,49 @@ function et(e, t, n) {
|
|
|
728
728
|
unset: i
|
|
729
729
|
};
|
|
730
730
|
}
|
|
731
|
-
function
|
|
731
|
+
function et(e, t, n) {
|
|
732
732
|
if (O(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || D("invalid_operation", t, "A block needs a non-empty string id and a string type."), e.type === "wrapper") {
|
|
733
733
|
n !== "root" && D("invalid_operation", t, n === "column" ? "Wrappers can only be placed at the top level." : "Wrappers cannot be placed inside wrappers."), Array.isArray(e.children) || D("invalid_operation", t, "A wrapper needs children: a list of blocks.");
|
|
734
|
-
for (let n of e.children)
|
|
734
|
+
for (let n of e.children) et(n, t, "wrapper");
|
|
735
735
|
return;
|
|
736
736
|
}
|
|
737
737
|
if (!k(e)) return;
|
|
738
738
|
n === "column" && D("invalid_operation", t, "Sections can only be placed at the top level."), n === "wrapper" && e.wrapper && D("invalid_operation", t, ze);
|
|
739
739
|
let r = e.children;
|
|
740
740
|
Array.isArray(r) && r.every((e) => Array.isArray(e)) || D("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
|
|
741
|
-
for (let e of r) for (let n of e)
|
|
741
|
+
for (let e of r) for (let n of e) et(n, t, "column");
|
|
742
742
|
}
|
|
743
|
-
function
|
|
743
|
+
function F(e, t) {
|
|
744
744
|
return e.session === null || t.sessionId !== e.session;
|
|
745
745
|
}
|
|
746
|
-
function
|
|
747
|
-
let r = e.locks.find((n) => t.includes(n.blockId) &&
|
|
746
|
+
function tt(e, t, n) {
|
|
747
|
+
let r = e.locks.find((n) => t.includes(n.blockId) && F(e, n));
|
|
748
748
|
r && D("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
e.locks.find((r) =>
|
|
750
|
+
function nt(e, t, n, r) {
|
|
751
|
+
e.locks.find((r) => F(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && D("lock_held", r, `Block "${t}" is being edited in another session.`, t);
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function rt(e, t, n, r) {
|
|
754
754
|
for (let [i, a] of Object.entries(t)) a !== void 0 && (h(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || D("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
|
|
755
755
|
}
|
|
756
|
-
function
|
|
756
|
+
function it(e, t, n) {
|
|
757
757
|
if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
|
|
758
758
|
if ("wrapperId" in t) {
|
|
759
|
-
let r =
|
|
759
|
+
let r = j(e, t.wrapperId);
|
|
760
760
|
return r ? r.block.type === "wrapper" ? Array.isArray(r.block.children) ? r.block.children : D("invalid_operation", n, `Wrapper "${t.wrapperId}" has no children list.`) : D("invalid_operation", n, `Block "${t.wrapperId}" isn't a wrapper.`) : D("block_missing", n, `No wrapper with id "${t.wrapperId}".`, t.wrapperId);
|
|
761
761
|
}
|
|
762
|
-
let r =
|
|
762
|
+
let r = j(e, t.sectionId);
|
|
763
763
|
if (!r) return D("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
|
|
764
764
|
if (!k(r.block)) return D("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
|
|
765
765
|
let i = r.block.children;
|
|
766
766
|
return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? D("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function at(e, t, n) {
|
|
769
769
|
if (t === null) return 0;
|
|
770
770
|
let r = e.findIndex((e) => O(e) && e.id === t);
|
|
771
771
|
return r === -1 ? D("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
|
|
772
772
|
}
|
|
773
|
-
function
|
|
773
|
+
function ot(e, t, n, r) {
|
|
774
774
|
let i = Ve(t), a = Array.isArray(e.children) ? e.children : [];
|
|
775
775
|
for (let e = i; e < a.length; e++) {
|
|
776
776
|
let t = a[e];
|
|
@@ -780,7 +780,7 @@ function st(e, t, n, r) {
|
|
|
780
780
|
for (; o.length < i;) o.push([]);
|
|
781
781
|
e.children = o;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function st(e, t, n) {
|
|
784
784
|
for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
|
|
785
785
|
value: m(r),
|
|
786
786
|
writable: !0,
|
|
@@ -789,7 +789,7 @@ function ct(e, t, n) {
|
|
|
789
789
|
}) : e[n] = m(r);
|
|
790
790
|
for (let t of n) delete e[t];
|
|
791
791
|
}
|
|
792
|
-
function
|
|
792
|
+
function ct(e) {
|
|
793
793
|
return me(e).map((t) => {
|
|
794
794
|
let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
|
|
795
795
|
return {
|
|
@@ -798,113 +798,113 @@ function lt(e) {
|
|
|
798
798
|
};
|
|
799
799
|
});
|
|
800
800
|
}
|
|
801
|
-
function
|
|
802
|
-
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ?
|
|
801
|
+
function lt(e, t, n) {
|
|
802
|
+
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? ct(n).map(r) : []), a = ct(e).find((e) => !i.has(r(e)));
|
|
803
803
|
a && D("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
|
|
804
804
|
}
|
|
805
|
-
function
|
|
805
|
+
function ut(e, t, n, r) {
|
|
806
806
|
let i = t;
|
|
807
807
|
switch (O(i) && typeof i.op == "string" || D("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
|
|
808
|
-
case "addBlock": return
|
|
809
|
-
case "moveBlock": return
|
|
810
|
-
case "deleteBlock": return
|
|
811
|
-
case "updateBlock": return
|
|
812
|
-
case "updateSettings": return
|
|
813
|
-
case "setContent": return
|
|
814
|
-
case "setDefaultLocale": return
|
|
815
|
-
case "addLocale": return
|
|
816
|
-
case "removeLocale": return
|
|
817
|
-
case "updateBlockLocale": return
|
|
818
|
-
case "updateSettingsLocale": return
|
|
808
|
+
case "addBlock": return dt(e, i, n);
|
|
809
|
+
case "moveBlock": return ft(e, i, n, r);
|
|
810
|
+
case "deleteBlock": return pt(e, i, n, r);
|
|
811
|
+
case "updateBlock": return mt(e, i, n, r);
|
|
812
|
+
case "updateSettings": return ht(e, i, n);
|
|
813
|
+
case "setContent": return At(e, i, n, r);
|
|
814
|
+
case "setDefaultLocale": return jt(e, i, n, r);
|
|
815
|
+
case "addLocale": return vt(e, i, n);
|
|
816
|
+
case "removeLocale": return bt(e, i, n);
|
|
817
|
+
case "updateBlockLocale": return Ot(e, i, n, r);
|
|
818
|
+
case "updateSettingsLocale": return kt(e, i, n);
|
|
819
819
|
default: D("invalid_operation", n, `Unknown operation "${i.op}".`);
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
|
-
function
|
|
823
|
-
let r =
|
|
824
|
-
|
|
822
|
+
function dt(e, t, n) {
|
|
823
|
+
let r = Ze(t, n), i = Qe(t, n), a = t.block;
|
|
824
|
+
et(a, n, r === null ? "root" : "wrapperId" in r ? "wrapper" : "column"), lt({
|
|
825
825
|
blocks: [a],
|
|
826
826
|
settings: e.settings
|
|
827
827
|
}, n);
|
|
828
|
-
let o = new Set(
|
|
829
|
-
for (let e of
|
|
830
|
-
let c =
|
|
831
|
-
|
|
828
|
+
let o = new Set(Xe(A(e))), s = /* @__PURE__ */ new Set();
|
|
829
|
+
for (let e of M(a)) (o.has(e) || s.has(e)) && D("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
|
|
830
|
+
let c = it(e, r, n), l = at(c, i, n);
|
|
831
|
+
Dt(e, a, r, n, !0), c.splice(l, 0, m(a));
|
|
832
832
|
}
|
|
833
|
-
function
|
|
834
|
-
let i =
|
|
833
|
+
function ft(e, t, n, r) {
|
|
834
|
+
let i = N(t, n), a = Ze(t, n), o = Qe(t, n), s = P(t, n), c = s && s.parent !== void 0 ? Ze({ parent: s.parent }, n) : null, l = j(e, i);
|
|
835
835
|
if (!l) return D("block_missing", n, `No block with id "${i}".`, i);
|
|
836
|
-
if (
|
|
836
|
+
if (tt(r, M(l.block), n), s) {
|
|
837
837
|
let e = l.index > 0 ? l.list[l.index - 1] : null, t = O(e) ? e.id ?? null : null;
|
|
838
838
|
h(l.parent, c) && h(t, s.after ?? null) || D("precondition_failed", n, `Block "${i}" has moved since.`, i);
|
|
839
839
|
}
|
|
840
|
-
a !== null && ("wrapperId" in a ? a.wrapperId : a.sectionId) === i && D("invalid_operation", n, "A block cannot be moved into itself or its descendants."), a !== null &&
|
|
841
|
-
let u =
|
|
842
|
-
|
|
840
|
+
a !== null && ("wrapperId" in a ? a.wrapperId : a.sectionId) === i && D("invalid_operation", n, "A block cannot be moved into itself or its descendants."), a !== null && M(l.block).includes("wrapperId" in a ? a.wrapperId : a.sectionId) && D("invalid_operation", n, "A block cannot be moved into itself or its descendants."), k(l.block) && a !== null && "sectionId" in a && D("invalid_operation", n, "Sections can only be placed at the top level."), k(l.block) && l.block.wrapper && a !== null && "wrapperId" in a && D("invalid_operation", n, ze), l.block.type === "wrapper" && a !== null && D("invalid_operation", n, "wrapperId" in a ? "Wrappers cannot be placed inside wrappers." : "Wrappers can only be placed at the top level."), o === i && D("invalid_operation", n, "A block can't be placed after itself.");
|
|
841
|
+
let u = it(e, a, n);
|
|
842
|
+
at(u.filter((e) => e !== l.block), o, n), Dt(e, l.block, a, n, !1), l.list.splice(l.index, 1), u.splice(at(u, o, n), 0, l.block);
|
|
843
843
|
}
|
|
844
|
-
function
|
|
845
|
-
let i =
|
|
844
|
+
function pt(e, t, n, r) {
|
|
845
|
+
let i = N(t, n), a = P(t, n), o = j(e, i);
|
|
846
846
|
if (!o) return D("block_missing", n, `No block with id "${i}".`, i);
|
|
847
|
-
|
|
847
|
+
tt(r, M(o.block), n), a && !h(o.block, a.block ?? null) && D("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
|
|
848
848
|
}
|
|
849
|
-
function
|
|
850
|
-
let i =
|
|
849
|
+
function mt(e, t, n, r) {
|
|
850
|
+
let i = N(t, n), { set: a, unset: o } = $e(t, n, Ue), s = P(t, n), c = j(e, i);
|
|
851
851
|
if (!c) return D("block_missing", n, `No block with id "${i}".`, i);
|
|
852
852
|
let l = c.block, u = k(l);
|
|
853
|
-
u && o.includes("columns") && D("invalid_operation", n, "A section's columns can't be unset; set another layout instead."),
|
|
853
|
+
u && o.includes("columns") && D("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), tt(r, [i], n), s && rt(l, s, n, i), u && c.parent !== null && "wrapperId" in c.parent && a.wrapper && D("invalid_operation", n, ze);
|
|
854
854
|
let d = { ...l };
|
|
855
|
-
|
|
855
|
+
st(d, a, o), lt({
|
|
856
856
|
blocks: [d],
|
|
857
857
|
settings: e.settings
|
|
858
858
|
}, n, {
|
|
859
859
|
blocks: [l],
|
|
860
860
|
settings: e.settings
|
|
861
|
-
}), u && Object.hasOwn(a, "columns") &&
|
|
862
|
-
let f =
|
|
861
|
+
}), u && Object.hasOwn(a, "columns") && ot(l, a.columns, n, i), st(l, a, o);
|
|
862
|
+
let f = b(l);
|
|
863
863
|
h(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), (u || l.type === "wrapper") && !h(l.children, f.children) && (l.children = f.children);
|
|
864
864
|
}
|
|
865
|
-
function
|
|
866
|
-
let { set: r, unset: i } =
|
|
865
|
+
function ht(e, t, n) {
|
|
866
|
+
let { set: r, unset: i } = $e(t, n, We), a = P(t, n);
|
|
867
867
|
e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && D("invalid_operation", n, "The default locale can't change while language versions exist."), O(e.settings) || (e.settings = {});
|
|
868
868
|
let o = e.settings;
|
|
869
|
-
a &&
|
|
870
|
-
let s =
|
|
869
|
+
a && rt(o, a, n), st(o, r, i);
|
|
870
|
+
let s = Ce(e.settings);
|
|
871
871
|
h(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function gt(e, t) {
|
|
874
874
|
let n = e.locale;
|
|
875
875
|
return ve(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || D("invalid_operation", t, "locale must be a language tag."), n;
|
|
876
876
|
}
|
|
877
|
-
function
|
|
878
|
-
let r =
|
|
877
|
+
function _t(e, t, n) {
|
|
878
|
+
let r = gt(t, n);
|
|
879
879
|
return e.settings.locales?.includes(r) || D("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
|
|
880
880
|
}
|
|
881
|
-
function
|
|
882
|
-
let r =
|
|
881
|
+
function vt(e, t, n) {
|
|
882
|
+
let r = gt(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
|
|
883
883
|
(w(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && D("invalid_operation", n, "The locale already exists or its insertion position is invalid."), e.settings.locales || (e.settings.locales = []), e.settings.locales.splice(o, 0, r);
|
|
884
884
|
}
|
|
885
|
-
function
|
|
886
|
-
return e.flatMap((e) => O(e) ? [e, ...k(e) ?
|
|
885
|
+
function I(e) {
|
|
886
|
+
return e.flatMap((e) => O(e) ? [e, ...k(e) ? Je(e).flatMap(I) : e.type === "wrapper" && Array.isArray(e.children) ? I(e.children) : []] : []);
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function yt(e, t) {
|
|
889
889
|
let n = e.l10n;
|
|
890
890
|
return O(n) && O(n[t]) ? n[t] : {};
|
|
891
891
|
}
|
|
892
|
-
function
|
|
893
|
-
let r =
|
|
892
|
+
function bt(e, t, n) {
|
|
893
|
+
let r = _t(e, t, n), i = P(t, n);
|
|
894
894
|
i && (!O(i.blocks) || i.settings !== void 0 && !O(i.settings)) && D("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
|
|
895
|
-
let a = e.settings, o =
|
|
895
|
+
let a = e.settings, o = I(A(e)), s = Object.fromEntries(o.flatMap((e) => O(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
|
|
896
896
|
!i || h(s, i.blocks) && h(O(a.l10n) ? a.l10n[r] : void 0, i.settings) || D("precondition_failed", n, `Locale "${r}" has changed since.`);
|
|
897
897
|
for (let e of [...o, a]) O(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
|
|
898
898
|
e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
|
|
899
899
|
}
|
|
900
|
-
function
|
|
900
|
+
function xt(e, t, n) {
|
|
901
901
|
(e.text === void 0 || ((e) => O(e) && Object.values(e).every((e) => O(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || O(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && v(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
|
|
902
902
|
"text",
|
|
903
903
|
"set",
|
|
904
904
|
"unset",
|
|
905
905
|
...n ? [] : ["hidden"]
|
|
906
906
|
].some((t) => e[t] !== void 0) || D("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
|
|
907
|
-
let r =
|
|
907
|
+
let r = P(e, t);
|
|
908
908
|
return r && (r.text !== void 0 && !O(r.text) || r.set !== void 0 && !O(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && D("invalid_operation", t, "The locale layer expect is malformed."), {
|
|
909
909
|
text: e.text ?? {},
|
|
910
910
|
set: e.set ?? {},
|
|
@@ -913,88 +913,87 @@ function St(e, t, n) {
|
|
|
913
913
|
expect: r
|
|
914
914
|
};
|
|
915
915
|
}
|
|
916
|
-
function
|
|
917
|
-
for (let i of Object.keys(t.text)) v(i) && (r ? g.includes(i) :
|
|
916
|
+
function St(e, t, n, r) {
|
|
917
|
+
for (let i of Object.keys(t.text)) v(i) && (r ? g.includes(i) : Te(String(e.type), i)) && y(e, i) !== void 0 || D("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
|
|
918
918
|
for (let i of Object.keys(t.set)) {
|
|
919
919
|
let a = i.split("."), o = r ? Ge : Ue, s = a.length === 1 ? e : y(e, a.slice(0, -1).join("."));
|
|
920
|
-
(!v(i) || o.has(a[0]) || !r &&
|
|
920
|
+
(!v(i) || o.has(a[0]) || !r && Se(e, i, t.set[i]) || y(e, i) === void 0 && !O(s)) && D("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
|
|
921
921
|
}
|
|
922
922
|
}
|
|
923
|
-
function
|
|
923
|
+
function Ct(e, t, n, r) {
|
|
924
924
|
if (t) {
|
|
925
925
|
for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) h(e[i]?.[a] ?? null, o) || D("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
|
|
926
926
|
t.hidden !== void 0 && !h(e.hidden === !0, t.hidden) && D("precondition_failed", n, "The locale's hidden state has changed since.", r);
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function wt(e, t, n) {
|
|
930
930
|
O(e.l10n) || (e.l10n = {});
|
|
931
|
-
let r = e.l10n;
|
|
932
|
-
|
|
933
|
-
let
|
|
934
|
-
for (let e of n.
|
|
935
|
-
for (let [e, t] of Object.entries(n.
|
|
936
|
-
|
|
937
|
-
n.hidden === !0 ? i.hidden = !0 : n.hidden === !1 && delete i.hidden, i.text && Object.keys(i.text).length === 0 && delete i.text, i.set && Object.keys(i.set).length === 0 && delete i.set, Object.keys(i).length === 0 && delete r[t], Object.keys(r).length === 0 && delete e.l10n;
|
|
931
|
+
let r = e.l10n, i = Object.prototype.hasOwnProperty.call(r, t) ? r[t] : void 0, a = O(i) ? i : {};
|
|
932
|
+
a !== i && (r[t] = a);
|
|
933
|
+
for (let e of n.unset) a.text && delete a.text[e], a.set && delete a.set[e];
|
|
934
|
+
for (let [e, t] of Object.entries(n.text)) a.text ||= {}, a.text[e] = m(t), a.set && delete a.set[e];
|
|
935
|
+
for (let [e, t] of Object.entries(n.set)) a.set ||= {}, a.set[e] = m(t), a.text && delete a.text[e];
|
|
936
|
+
n.hidden === !0 ? a.hidden = !0 : n.hidden === !1 && delete a.hidden, a.text && Object.keys(a.text).length === 0 && delete a.text, a.set && Object.keys(a.set).length === 0 && delete a.set, Object.keys(a).length === 0 && delete r[t], Object.keys(r).length === 0 && delete e.l10n;
|
|
938
937
|
}
|
|
939
|
-
function
|
|
940
|
-
return O(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(
|
|
938
|
+
function L(e) {
|
|
939
|
+
return O(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(L) : L(e)) : !1;
|
|
941
940
|
}
|
|
942
|
-
function
|
|
941
|
+
function Tt(e) {
|
|
943
942
|
return O(e) && O(e.l10n) && Object.values(e.l10n).some((e) => O(e) && e.hidden === !0);
|
|
944
943
|
}
|
|
945
|
-
function
|
|
946
|
-
return !O(e) || !
|
|
944
|
+
function Et(e) {
|
|
945
|
+
return !O(e) || !L(e) ? !1 : Tt(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(Et) : Et(e));
|
|
947
946
|
}
|
|
948
|
-
function
|
|
949
|
-
if (!
|
|
947
|
+
function Dt(e, t, n, r, i) {
|
|
948
|
+
if (!L(t)) return;
|
|
950
949
|
let a = n, o = !1;
|
|
951
950
|
for (; a !== null;) {
|
|
952
|
-
let t =
|
|
951
|
+
let t = j(e, "wrapperId" in a ? a.wrapperId : a.sectionId);
|
|
953
952
|
if (!t) break;
|
|
954
|
-
|
|
953
|
+
Tt(t.block) && (o = !0), a = t.parent;
|
|
955
954
|
}
|
|
956
|
-
(o || i &&
|
|
955
|
+
(o || i && Et(t)) && D("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", O(t) && typeof t.id == "string" ? t.id : void 0);
|
|
957
956
|
}
|
|
958
|
-
function
|
|
959
|
-
let i =
|
|
960
|
-
s || D("block_missing", n, `No block with id "${a}".`, a),
|
|
957
|
+
function Ot(e, t, n, r) {
|
|
958
|
+
let i = _t(e, t, n), a = N(t, n), o = xt(t, n, !1), s = I(A(e)).find((e) => e.id === a);
|
|
959
|
+
s || D("block_missing", n, `No block with id "${a}".`, a), St(s, o, n, !1), nt(r, a, i, n), Ct(yt(s, i), o.expect, n, a), o.hidden === !0 && L(s) && D("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), wt(s, i, o);
|
|
961
960
|
}
|
|
962
|
-
function
|
|
963
|
-
let r =
|
|
964
|
-
|
|
961
|
+
function kt(e, t, n) {
|
|
962
|
+
let r = _t(e, t, n), i = xt(t, n, !0), a = e.settings;
|
|
963
|
+
St(a, i, n, !0), Ct(yt(a, r), i.expect, n), wt(a, r, i);
|
|
965
964
|
}
|
|
966
|
-
function
|
|
965
|
+
function At(e, t, n, r) {
|
|
967
966
|
let i = t.content;
|
|
968
967
|
if (!O(i) || !Array.isArray(i.blocks) || !O(i.settings)) return D("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
|
|
969
|
-
|
|
970
|
-
let a = r.locks.find((e) =>
|
|
968
|
+
lt(i, n, e);
|
|
969
|
+
let a = r.locks.find((e) => F(r, e));
|
|
971
970
|
a && D("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = m(i.blocks), e.settings = m(i.settings);
|
|
972
971
|
}
|
|
973
|
-
function
|
|
974
|
-
let i =
|
|
972
|
+
function jt(e, t, n, r) {
|
|
973
|
+
let i = gt(t, n);
|
|
975
974
|
e.settings.locales?.includes(i) || D("invalid_operation", n, `"${i}" is not a language version of this template.`);
|
|
976
975
|
let a = Fe(e, i);
|
|
977
976
|
a.length && D("invalid_operation", n, a.length === 1 ? `1 block is hidden in "${i}". Show it before making it the default.` : `${a.length} blocks are hidden in "${i}". Show them before making it the default.`, a[0]);
|
|
978
|
-
let o = r.locks.find((e) =>
|
|
977
|
+
let o = r.locks.find((e) => F(r, e));
|
|
979
978
|
o && D("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
|
|
980
979
|
let s = t.customTextFields;
|
|
981
980
|
if (s !== void 0) {
|
|
982
|
-
let t =
|
|
981
|
+
let t = I(e.blocks);
|
|
983
982
|
(!O(s) || Object.getOwnPropertyNames(s).some((e) => {
|
|
984
983
|
if (Ke.has(e)) return !0;
|
|
985
984
|
let n = s[e], r = t.find((t) => t.id === e);
|
|
986
|
-
return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !v(e) || !
|
|
985
|
+
return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !v(e) || !Te("custom", e) || typeof y(r, e) != "string");
|
|
987
986
|
})) && D("invalid_operation", n, qe);
|
|
988
987
|
}
|
|
989
988
|
let c = Re(e, i, t.customTextFields);
|
|
990
989
|
e.blocks = c.blocks, e.settings = c.settings;
|
|
991
990
|
}
|
|
992
991
|
// ../types/src/invert-operations.ts
|
|
993
|
-
function
|
|
992
|
+
function Mt(e) {
|
|
994
993
|
let t = e.children;
|
|
995
994
|
return e.type === "section" && Array.isArray(t) ? t : [];
|
|
996
995
|
}
|
|
997
|
-
function
|
|
996
|
+
function Nt(e, t, n = null) {
|
|
998
997
|
for (let r = 0; r < e.length; r++) {
|
|
999
998
|
let i = e[r];
|
|
1000
999
|
if (i.id === t) return {
|
|
@@ -1002,28 +1001,28 @@ function Pt(e, t, n = null) {
|
|
|
1002
1001
|
parent: n,
|
|
1003
1002
|
after: r > 0 ? e[r - 1].id : null
|
|
1004
1003
|
};
|
|
1005
|
-
let a =
|
|
1004
|
+
let a = Mt(i);
|
|
1006
1005
|
for (let e = 0; e < a.length; e++) {
|
|
1007
1006
|
if (!Array.isArray(a[e])) continue;
|
|
1008
|
-
let n =
|
|
1007
|
+
let n = Nt(a[e], t, {
|
|
1009
1008
|
sectionId: i.id,
|
|
1010
1009
|
column: e
|
|
1011
1010
|
});
|
|
1012
1011
|
if (n) return n;
|
|
1013
1012
|
}
|
|
1014
1013
|
if (i.type === "wrapper" && Array.isArray(i.children)) {
|
|
1015
|
-
let e =
|
|
1014
|
+
let e = Nt(i.children, t, { wrapperId: i.id });
|
|
1016
1015
|
if (e) return e;
|
|
1017
1016
|
}
|
|
1018
1017
|
}
|
|
1019
1018
|
return null;
|
|
1020
1019
|
}
|
|
1021
|
-
function
|
|
1022
|
-
let r =
|
|
1020
|
+
function Pt(e, t, n) {
|
|
1021
|
+
let r = Nt(e.blocks, t);
|
|
1023
1022
|
if (!r) throw new T("block_missing", n, `No block with id "${t}".`, t);
|
|
1024
1023
|
return r;
|
|
1025
1024
|
}
|
|
1026
|
-
function
|
|
1025
|
+
function Ft(e, t, n) {
|
|
1027
1026
|
let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
|
|
1028
1027
|
for (let n of o) {
|
|
1029
1028
|
let o = e[n];
|
|
@@ -1037,10 +1036,10 @@ function It(e, t, n) {
|
|
|
1037
1036
|
expect: a
|
|
1038
1037
|
};
|
|
1039
1038
|
}
|
|
1040
|
-
function
|
|
1039
|
+
function R(e, t) {
|
|
1041
1040
|
return e.l10n?.[t] ?? {};
|
|
1042
1041
|
}
|
|
1043
|
-
function
|
|
1042
|
+
function z(e, t, n, r) {
|
|
1044
1043
|
let i = {}, a = {}, o = {};
|
|
1045
1044
|
n.length && (o.text = {}, o.set = {});
|
|
1046
1045
|
for (let r of n) e.text?.[r] !== void 0 && (i[r] = m(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = m(e.set[r])), o.text[r] = m(t.text?.[r] ?? null), o.set[r] = m(t.set?.[r] ?? null);
|
|
@@ -1052,21 +1051,21 @@ function R(e, t, n, r) {
|
|
|
1052
1051
|
expect: o
|
|
1053
1052
|
};
|
|
1054
1053
|
}
|
|
1055
|
-
function
|
|
1056
|
-
let { unset: t, ...n } =
|
|
1054
|
+
function It(e) {
|
|
1055
|
+
let { unset: t, ...n } = z(e, {}, [.../* @__PURE__ */ new Set([...Object.keys(e.text ?? {}), ...Object.keys(e.set ?? {})])], e.hidden === !0);
|
|
1057
1056
|
return n;
|
|
1058
1057
|
}
|
|
1059
|
-
function
|
|
1060
|
-
return e.flatMap((e) => [e, ...e.type === "wrapper" ?
|
|
1058
|
+
function B(e) {
|
|
1059
|
+
return e.flatMap((e) => [e, ...e.type === "wrapper" ? B(e.children) : Mt(e).flatMap(B)]);
|
|
1061
1060
|
}
|
|
1062
|
-
function
|
|
1061
|
+
function Lt(e, t) {
|
|
1063
1062
|
let n = m(e);
|
|
1064
1063
|
E(n, [t]);
|
|
1065
1064
|
let r = [], i = (e, t, n) => {
|
|
1066
1065
|
for (let [i, a] of Object.entries(e.l10n ?? {})) {
|
|
1067
1066
|
let e = t.l10n?.[i] ?? {}, o = [.../* @__PURE__ */ new Set([...Object.keys(a.text ?? {}).filter((t) => !Object.hasOwn(e.text ?? {}, t)), ...Object.keys(a.set ?? {}).filter((t) => !Object.hasOwn(e.set ?? {}, t))])];
|
|
1068
1067
|
if (!o.length) continue;
|
|
1069
|
-
let s =
|
|
1068
|
+
let s = z(a, e, o, !1);
|
|
1070
1069
|
r.push(n === void 0 ? {
|
|
1071
1070
|
op: "updateSettingsLocale",
|
|
1072
1071
|
locale: i,
|
|
@@ -1081,15 +1080,15 @@ function Rt(e, t) {
|
|
|
1081
1080
|
};
|
|
1082
1081
|
if (t.op === "updateSettings") i(e.settings, n.settings);
|
|
1083
1082
|
else {
|
|
1084
|
-
let t = new Map(
|
|
1085
|
-
for (let n of
|
|
1083
|
+
let t = new Map(B(n.blocks).map((e) => [e.id, e]));
|
|
1084
|
+
for (let n of B(e.blocks)) {
|
|
1086
1085
|
let e = t.get(n.id);
|
|
1087
1086
|
e && i(n, e, n.id);
|
|
1088
1087
|
}
|
|
1089
1088
|
}
|
|
1090
1089
|
return r;
|
|
1091
1090
|
}
|
|
1092
|
-
function
|
|
1091
|
+
function Rt(e, t, n) {
|
|
1093
1092
|
switch (t.op) {
|
|
1094
1093
|
case "addBlock": return {
|
|
1095
1094
|
op: "deleteBlock",
|
|
@@ -1097,7 +1096,7 @@ function zt(e, t, n) {
|
|
|
1097
1096
|
expect: { block: m(t.block) }
|
|
1098
1097
|
};
|
|
1099
1098
|
case "deleteBlock": {
|
|
1100
|
-
let r =
|
|
1099
|
+
let r = Pt(e, t.blockId, n);
|
|
1101
1100
|
return {
|
|
1102
1101
|
op: "addBlock",
|
|
1103
1102
|
block: m(r.block),
|
|
@@ -1106,7 +1105,7 @@ function zt(e, t, n) {
|
|
|
1106
1105
|
};
|
|
1107
1106
|
}
|
|
1108
1107
|
case "moveBlock": {
|
|
1109
|
-
let r =
|
|
1108
|
+
let r = Pt(e, t.blockId, n);
|
|
1110
1109
|
return {
|
|
1111
1110
|
op: "moveBlock",
|
|
1112
1111
|
blockId: t.blockId,
|
|
@@ -1119,23 +1118,23 @@ function zt(e, t, n) {
|
|
|
1119
1118
|
};
|
|
1120
1119
|
}
|
|
1121
1120
|
case "updateBlock": {
|
|
1122
|
-
let r =
|
|
1121
|
+
let r = Pt(e, t.blockId, n).block, { set: i, unset: a, expect: o } = Ft(r, t.set, t.unset);
|
|
1123
1122
|
return [{
|
|
1124
1123
|
op: "updateBlock",
|
|
1125
1124
|
blockId: t.blockId,
|
|
1126
1125
|
...Object.keys(i).length > 0 ? { set: i } : {},
|
|
1127
1126
|
...a.length > 0 ? { unset: a } : {},
|
|
1128
1127
|
expect: o
|
|
1129
|
-
}, ...
|
|
1128
|
+
}, ...Lt(e, t)];
|
|
1130
1129
|
}
|
|
1131
1130
|
case "updateSettings": {
|
|
1132
|
-
let { set: n, unset: r, expect: i } =
|
|
1131
|
+
let { set: n, unset: r, expect: i } = Ft(e.settings, t.set, t.unset);
|
|
1133
1132
|
return [{
|
|
1134
1133
|
op: "updateSettings",
|
|
1135
1134
|
...Object.keys(n).length > 0 ? { set: n } : {},
|
|
1136
1135
|
...r.length > 0 ? { unset: r } : {},
|
|
1137
1136
|
expect: i
|
|
1138
|
-
}, ...
|
|
1137
|
+
}, ...Lt(e, t)];
|
|
1139
1138
|
}
|
|
1140
1139
|
case "addLocale": return {
|
|
1141
1140
|
op: "removeLocale",
|
|
@@ -1148,18 +1147,18 @@ function zt(e, t, n) {
|
|
|
1148
1147
|
locale: t.locale,
|
|
1149
1148
|
position: e.settings.locales?.indexOf(t.locale)
|
|
1150
1149
|
}];
|
|
1151
|
-
for (let r of
|
|
1150
|
+
for (let r of B(e.blocks)) {
|
|
1152
1151
|
let e = r.l10n?.[t.locale];
|
|
1153
1152
|
e && n.push({
|
|
1154
1153
|
op: "updateBlockLocale",
|
|
1155
1154
|
blockId: r.id,
|
|
1156
1155
|
locale: t.locale,
|
|
1157
|
-
...
|
|
1156
|
+
...It(e)
|
|
1158
1157
|
});
|
|
1159
1158
|
}
|
|
1160
1159
|
let r = e.settings.l10n?.[t.locale];
|
|
1161
1160
|
if (r) {
|
|
1162
|
-
let { hidden: e, ...i } =
|
|
1161
|
+
let { hidden: e, ...i } = It(r);
|
|
1163
1162
|
n.push({
|
|
1164
1163
|
op: "updateSettingsLocale",
|
|
1165
1164
|
locale: t.locale,
|
|
@@ -1178,15 +1177,15 @@ function zt(e, t, n) {
|
|
|
1178
1177
|
...t.unset ?? []
|
|
1179
1178
|
])];
|
|
1180
1179
|
if (t.op === "updateBlockLocale") {
|
|
1181
|
-
let i =
|
|
1180
|
+
let i = B(e.blocks).find((e) => e.id === t.blockId), a = B(n.blocks).find((e) => e.id === t.blockId);
|
|
1182
1181
|
return {
|
|
1183
1182
|
op: "updateBlockLocale",
|
|
1184
1183
|
blockId: t.blockId,
|
|
1185
1184
|
locale: t.locale,
|
|
1186
|
-
...R(
|
|
1185
|
+
...z(R(i, t.locale), R(a, t.locale), r, t.hidden !== void 0)
|
|
1187
1186
|
};
|
|
1188
1187
|
}
|
|
1189
|
-
let { hidden: i, ...a } = R(
|
|
1188
|
+
let { hidden: i, ...a } = z(R(e.settings, t.locale), R(n.settings, t.locale), r, !1);
|
|
1190
1189
|
return {
|
|
1191
1190
|
op: "updateSettingsLocale",
|
|
1192
1191
|
locale: t.locale,
|
|
@@ -1203,11 +1202,11 @@ function zt(e, t, n) {
|
|
|
1203
1202
|
};
|
|
1204
1203
|
}
|
|
1205
1204
|
}
|
|
1206
|
-
function
|
|
1205
|
+
function zt(e, t) {
|
|
1207
1206
|
let n = m(e), r = [];
|
|
1208
1207
|
return t.forEach((e, t) => {
|
|
1209
1208
|
try {
|
|
1210
|
-
let i =
|
|
1209
|
+
let i = Rt(n, e, t);
|
|
1211
1210
|
r.push(...Array.isArray(i) ? [...i].reverse() : [i]), E(n, [e]);
|
|
1212
1211
|
} catch (e) {
|
|
1213
1212
|
throw e instanceof T ? new T(e.code, t, e.message, e.blockId) : e;
|
|
@@ -1215,77 +1214,77 @@ function Bt(e, t) {
|
|
|
1215
1214
|
}), r.reverse();
|
|
1216
1215
|
}
|
|
1217
1216
|
// ../types/src/collaboration.ts
|
|
1218
|
-
function
|
|
1217
|
+
function Bt(e) {
|
|
1219
1218
|
return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
|
|
1220
1219
|
}
|
|
1221
|
-
var
|
|
1220
|
+
var Vt = class extends ge {
|
|
1222
1221
|
opIndex;
|
|
1223
1222
|
holder;
|
|
1224
1223
|
holders;
|
|
1225
1224
|
constructor(e, t) {
|
|
1226
|
-
super(e, t.status ??
|
|
1225
|
+
super(e, t.status ?? Bt(t.code), t.code), this.name = "CollaborationConflict", t.opIndex !== void 0 && (this.opIndex = t.opIndex), t.holder !== void 0 && (this.holder = t.holder), t.holders !== void 0 && (this.holders = t.holders);
|
|
1227
1226
|
}
|
|
1228
1227
|
};
|
|
1229
1228
|
// ../types/src/guards.ts
|
|
1230
|
-
function
|
|
1229
|
+
function Ht(e) {
|
|
1231
1230
|
return e.type === "section";
|
|
1232
1231
|
}
|
|
1233
|
-
function
|
|
1232
|
+
function Ut(e) {
|
|
1234
1233
|
return e.type === "title";
|
|
1235
1234
|
}
|
|
1236
|
-
function
|
|
1235
|
+
function Wt(e) {
|
|
1237
1236
|
return e.type === "paragraph";
|
|
1238
1237
|
}
|
|
1239
|
-
function
|
|
1238
|
+
function Gt(e) {
|
|
1240
1239
|
return e.type === "image";
|
|
1241
1240
|
}
|
|
1242
|
-
function
|
|
1241
|
+
function Kt(e) {
|
|
1243
1242
|
return e.type === "button";
|
|
1244
1243
|
}
|
|
1245
|
-
function
|
|
1244
|
+
function qt(e) {
|
|
1246
1245
|
return e.type === "divider";
|
|
1247
1246
|
}
|
|
1248
|
-
function
|
|
1247
|
+
function Jt(e) {
|
|
1249
1248
|
return e.type === "video";
|
|
1250
1249
|
}
|
|
1251
|
-
function
|
|
1250
|
+
function Yt(e) {
|
|
1252
1251
|
return e.type === "social";
|
|
1253
1252
|
}
|
|
1254
|
-
function
|
|
1253
|
+
function Xt(e) {
|
|
1255
1254
|
return e.type === "spacer";
|
|
1256
1255
|
}
|
|
1257
|
-
function
|
|
1256
|
+
function Zt(e) {
|
|
1258
1257
|
return e.type === "html";
|
|
1259
1258
|
}
|
|
1260
|
-
function
|
|
1259
|
+
function Qt(e) {
|
|
1261
1260
|
return e.type === "menu";
|
|
1262
1261
|
}
|
|
1263
|
-
function
|
|
1262
|
+
function $t(e) {
|
|
1264
1263
|
return e.type === "table";
|
|
1265
1264
|
}
|
|
1266
|
-
function
|
|
1265
|
+
function en(e) {
|
|
1267
1266
|
return e.type === "countdown";
|
|
1268
1267
|
}
|
|
1269
|
-
function
|
|
1268
|
+
function tn(e) {
|
|
1270
1269
|
return e.type === "custom";
|
|
1271
1270
|
}
|
|
1272
|
-
function
|
|
1271
|
+
function V(e) {
|
|
1273
1272
|
return e.type === "slot";
|
|
1274
1273
|
}
|
|
1275
|
-
function
|
|
1274
|
+
function H(e) {
|
|
1276
1275
|
return e.type === "wrapper";
|
|
1277
1276
|
}
|
|
1278
1277
|
// ../types/src/defaults.ts
|
|
1279
|
-
var
|
|
1278
|
+
var nn = {
|
|
1280
1279
|
content: "<p>Enter your title</p>",
|
|
1281
1280
|
level: 2,
|
|
1282
1281
|
textAlign: "left"
|
|
1283
|
-
},
|
|
1282
|
+
}, rn = { content: "<p>Enter your text here</p>" }, an = {
|
|
1284
1283
|
src: "",
|
|
1285
1284
|
alt: "",
|
|
1286
1285
|
width: "full",
|
|
1287
1286
|
align: "center"
|
|
1288
|
-
},
|
|
1287
|
+
}, on = {
|
|
1289
1288
|
text: "Click Here",
|
|
1290
1289
|
url: "",
|
|
1291
1290
|
backgroundColor: "#333333",
|
|
@@ -1299,36 +1298,36 @@ var rn = {
|
|
|
1299
1298
|
left: 24
|
|
1300
1299
|
},
|
|
1301
1300
|
align: "center"
|
|
1302
|
-
},
|
|
1301
|
+
}, sn = {
|
|
1303
1302
|
lineStyle: "solid",
|
|
1304
1303
|
color: "#e0e0e0",
|
|
1305
1304
|
thickness: 1,
|
|
1306
1305
|
width: "full"
|
|
1307
|
-
},
|
|
1306
|
+
}, cn = { columns: "1" }, ln = {
|
|
1308
1307
|
url: "",
|
|
1309
1308
|
thumbnailUrl: "",
|
|
1310
1309
|
alt: "Video",
|
|
1311
1310
|
width: "full",
|
|
1312
1311
|
align: "center"
|
|
1313
|
-
},
|
|
1312
|
+
}, un = {
|
|
1314
1313
|
iconStyle: "solid",
|
|
1315
1314
|
iconSize: "medium",
|
|
1316
1315
|
spacing: 10,
|
|
1317
1316
|
align: "center"
|
|
1318
|
-
},
|
|
1317
|
+
}, dn = { height: 24 }, fn = { content: "" }, pn = {
|
|
1319
1318
|
fontSize: 15,
|
|
1320
1319
|
textAlign: "center",
|
|
1321
1320
|
separator: "|",
|
|
1322
1321
|
separatorColor: "#e0e0e0",
|
|
1323
1322
|
spacing: 10
|
|
1324
|
-
},
|
|
1323
|
+
}, mn = {
|
|
1325
1324
|
hasHeaderRow: !0,
|
|
1326
1325
|
borderColor: "#e0e0e0",
|
|
1327
1326
|
borderWidth: 1,
|
|
1328
1327
|
cellPadding: 8,
|
|
1329
1328
|
fontSize: 15,
|
|
1330
1329
|
textAlign: "left"
|
|
1331
|
-
},
|
|
1330
|
+
}, hn = {
|
|
1332
1331
|
targetDate: "",
|
|
1333
1332
|
timezone: "UTC",
|
|
1334
1333
|
showDays: !0,
|
|
@@ -1348,21 +1347,21 @@ var rn = {
|
|
|
1348
1347
|
expiredMessage: "This offer has expired",
|
|
1349
1348
|
expiredImageUrl: "",
|
|
1350
1349
|
hideOnExpiry: !1
|
|
1350
|
+
}, gn = {
|
|
1351
|
+
title: nn,
|
|
1352
|
+
paragraph: rn,
|
|
1353
|
+
image: an,
|
|
1354
|
+
button: on,
|
|
1355
|
+
divider: sn,
|
|
1356
|
+
section: cn,
|
|
1357
|
+
video: ln,
|
|
1358
|
+
social: un,
|
|
1359
|
+
spacer: dn,
|
|
1360
|
+
html: fn,
|
|
1361
|
+
menu: pn,
|
|
1362
|
+
table: mn,
|
|
1363
|
+
countdown: hn
|
|
1351
1364
|
}, _n = {
|
|
1352
|
-
title: rn,
|
|
1353
|
-
paragraph: an,
|
|
1354
|
-
image: on,
|
|
1355
|
-
button: sn,
|
|
1356
|
-
divider: cn,
|
|
1357
|
-
section: ln,
|
|
1358
|
-
video: un,
|
|
1359
|
-
social: dn,
|
|
1360
|
-
spacer: fn,
|
|
1361
|
-
html: pn,
|
|
1362
|
-
menu: mn,
|
|
1363
|
-
table: hn,
|
|
1364
|
-
countdown: gn
|
|
1365
|
-
}, vn = {
|
|
1366
1365
|
width: 600,
|
|
1367
1366
|
backgroundColor: "#ffffff",
|
|
1368
1367
|
textColor: "#1a1a1a",
|
|
@@ -1370,30 +1369,30 @@ var rn = {
|
|
|
1370
1369
|
fontFamily: "Arial",
|
|
1371
1370
|
locale: "en"
|
|
1372
1371
|
};
|
|
1373
|
-
function
|
|
1372
|
+
function vn(e) {
|
|
1374
1373
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
|
|
1375
1374
|
}
|
|
1376
|
-
function
|
|
1375
|
+
function yn(e, t) {
|
|
1377
1376
|
let n = { ...e };
|
|
1378
1377
|
for (let r of Object.keys(t)) {
|
|
1379
1378
|
let i = e[r], a = t[r];
|
|
1380
|
-
a !== void 0 && (n[r] =
|
|
1379
|
+
a !== void 0 && (n[r] = vn(i) && vn(a) ? yn(i, a) : a);
|
|
1381
1380
|
}
|
|
1382
1381
|
return n;
|
|
1383
1382
|
}
|
|
1384
1383
|
// ../types/src/template.ts
|
|
1385
|
-
function
|
|
1384
|
+
function bn(e = "Arial", t) {
|
|
1386
1385
|
return {
|
|
1387
1386
|
blocks: [],
|
|
1388
1387
|
settings: {
|
|
1389
|
-
...
|
|
1388
|
+
..._n,
|
|
1390
1389
|
fontFamily: e,
|
|
1391
1390
|
...t
|
|
1392
1391
|
}
|
|
1393
1392
|
};
|
|
1394
1393
|
}
|
|
1395
1394
|
// ../types/src/direction.ts
|
|
1396
|
-
var
|
|
1395
|
+
var xn = [
|
|
1397
1396
|
"ar",
|
|
1398
1397
|
"he",
|
|
1399
1398
|
"iw",
|
|
@@ -1407,24 +1406,24 @@ var Sn = [
|
|
|
1407
1406
|
"ckb",
|
|
1408
1407
|
"ks"
|
|
1409
1408
|
];
|
|
1410
|
-
function
|
|
1409
|
+
function Sn(e) {
|
|
1411
1410
|
let t = e?.trim().replace(/_/g, "-").split("-")[0]?.toLowerCase();
|
|
1412
|
-
return !!t &&
|
|
1411
|
+
return !!t && xn.includes(t);
|
|
1413
1412
|
}
|
|
1414
|
-
function
|
|
1415
|
-
return e.direction === "ltr" || e.direction === "rtl" ? e.direction :
|
|
1413
|
+
function Cn(e) {
|
|
1414
|
+
return e.direction === "ltr" || e.direction === "rtl" ? e.direction : Sn(e.locale) ? "rtl" : "ltr";
|
|
1416
1415
|
}
|
|
1417
1416
|
// ../types/src/translation.ts
|
|
1418
|
-
var
|
|
1419
|
-
function
|
|
1417
|
+
var wn = 2e4, Tn = /* @__PURE__ */ new Set(["\"", "'"]);
|
|
1418
|
+
function En(e, t) {
|
|
1420
1419
|
let n = null, r = "tag";
|
|
1421
1420
|
for (let i = t; i < e.length; i++) {
|
|
1422
1421
|
let t = e[i];
|
|
1423
1422
|
if (n !== null) t === n && (n = null);
|
|
1424
1423
|
else {
|
|
1425
1424
|
if (r === "beforeValue") {
|
|
1426
|
-
if (
|
|
1427
|
-
if (
|
|
1425
|
+
if (U(t)) continue;
|
|
1426
|
+
if (Tn.has(t)) {
|
|
1428
1427
|
n = t, r = "tag";
|
|
1429
1428
|
continue;
|
|
1430
1429
|
}
|
|
@@ -1432,19 +1431,19 @@ function Dn(e, t) {
|
|
|
1432
1431
|
}
|
|
1433
1432
|
if (r === "unquotedValue") {
|
|
1434
1433
|
if (t === ">") return i;
|
|
1435
|
-
|
|
1434
|
+
U(t) && (r = "tag");
|
|
1436
1435
|
} else if (t === "=") r = "beforeValue";
|
|
1437
1436
|
else if (t === ">") return i;
|
|
1438
1437
|
}
|
|
1439
1438
|
}
|
|
1440
1439
|
return -1;
|
|
1441
1440
|
}
|
|
1442
|
-
function
|
|
1441
|
+
function Dn(e, t) {
|
|
1443
1442
|
let n = null;
|
|
1444
1443
|
for (let r = t; r < e.length; r++) {
|
|
1445
1444
|
let t = e[r];
|
|
1446
1445
|
if (n !== null) t === n && (n = null);
|
|
1447
|
-
else if (
|
|
1446
|
+
else if (Tn.has(t)) n = t;
|
|
1448
1447
|
else if (t === ">") return {
|
|
1449
1448
|
end: r,
|
|
1450
1449
|
nextSpan: -1
|
|
@@ -1459,13 +1458,13 @@ function On(e, t) {
|
|
|
1459
1458
|
nextSpan: -1
|
|
1460
1459
|
};
|
|
1461
1460
|
}
|
|
1462
|
-
function
|
|
1461
|
+
function On(e) {
|
|
1463
1462
|
return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
|
|
1464
1463
|
}
|
|
1465
|
-
function
|
|
1464
|
+
function U(e) {
|
|
1466
1465
|
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
1467
1466
|
}
|
|
1468
|
-
var
|
|
1467
|
+
var kn = {
|
|
1469
1468
|
AMP: "&",
|
|
1470
1469
|
COPY: "©",
|
|
1471
1470
|
GT: ">",
|
|
@@ -1726,54 +1725,54 @@ var An = {
|
|
|
1726
1725
|
zwj: "",
|
|
1727
1726
|
zwnj: ""
|
|
1728
1727
|
};
|
|
1729
|
-
function
|
|
1728
|
+
function W(e) {
|
|
1730
1729
|
return e.includes("&") ? e.replace(/&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (e, t) => {
|
|
1731
1730
|
if (t[0] === "#") {
|
|
1732
1731
|
let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
|
|
1733
1732
|
return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
|
|
1734
1733
|
}
|
|
1735
|
-
return Object.hasOwn(
|
|
1734
|
+
return Object.hasOwn(kn, t) ? kn[t] : e;
|
|
1736
1735
|
}) : e;
|
|
1737
1736
|
}
|
|
1738
|
-
function
|
|
1737
|
+
function An(e, t) {
|
|
1739
1738
|
let n = t.toLowerCase(), r = 0;
|
|
1740
1739
|
for (; r < e.length;) {
|
|
1741
|
-
for (; r < e.length && (
|
|
1740
|
+
for (; r < e.length && (U(e[r]) || e[r] === "/");) r++;
|
|
1742
1741
|
if (r >= e.length) break;
|
|
1743
1742
|
let t = r;
|
|
1744
|
-
for (; r < e.length &&
|
|
1743
|
+
for (; r < e.length && On(e[r]);) r++;
|
|
1745
1744
|
let i = e.substring(t, r).toLowerCase();
|
|
1746
1745
|
if (i === "") {
|
|
1747
1746
|
r++;
|
|
1748
1747
|
continue;
|
|
1749
1748
|
}
|
|
1750
|
-
for (; r < e.length &&
|
|
1749
|
+
for (; r < e.length && U(e[r]);) r++;
|
|
1751
1750
|
if (e[r] !== "=") continue;
|
|
1752
|
-
for (r++; r < e.length &&
|
|
1751
|
+
for (r++; r < e.length && U(e[r]);) r++;
|
|
1753
1752
|
let a = e[r];
|
|
1754
|
-
if (
|
|
1753
|
+
if (Tn.has(a)) {
|
|
1755
1754
|
let t = r + 1, o = e.indexOf(a, t);
|
|
1756
1755
|
if (o === -1) return null;
|
|
1757
|
-
if (i === n) return
|
|
1756
|
+
if (i === n) return W(e.substring(t, o));
|
|
1758
1757
|
r = o + 1;
|
|
1759
1758
|
continue;
|
|
1760
1759
|
}
|
|
1761
1760
|
let o = r;
|
|
1762
|
-
for (; r < e.length && !
|
|
1763
|
-
if (i === n) return
|
|
1761
|
+
for (; r < e.length && !U(e[r]) && e[r] !== ">";) r++;
|
|
1762
|
+
if (i === n) return W(e.substring(o, r));
|
|
1764
1763
|
}
|
|
1765
1764
|
return null;
|
|
1766
1765
|
}
|
|
1767
1766
|
// ../types/src/merge-tag-html.ts
|
|
1768
|
-
function
|
|
1769
|
-
return
|
|
1767
|
+
function jn(e) {
|
|
1768
|
+
return Pn(e, (e) => e, !1);
|
|
1770
1769
|
}
|
|
1771
|
-
function
|
|
1772
|
-
return
|
|
1770
|
+
function Mn(e, t) {
|
|
1771
|
+
return Pn(e, t, !0);
|
|
1773
1772
|
}
|
|
1774
|
-
function
|
|
1773
|
+
function Nn(e) {
|
|
1775
1774
|
let t = [];
|
|
1776
|
-
return
|
|
1775
|
+
return Pn(e, (n, r, i) => {
|
|
1777
1776
|
let a = e.slice(r, i);
|
|
1778
1777
|
return t.push({
|
|
1779
1778
|
start: r,
|
|
@@ -1782,7 +1781,7 @@ function Pn(e) {
|
|
|
1782
1781
|
}), a;
|
|
1783
1782
|
}, !0), t;
|
|
1784
1783
|
}
|
|
1785
|
-
function
|
|
1784
|
+
function Pn(e, t, n) {
|
|
1786
1785
|
let r = "", i = 0;
|
|
1787
1786
|
for (; i < e.length;) {
|
|
1788
1787
|
let a = e.indexOf("<span", i);
|
|
@@ -1795,7 +1794,7 @@ function Fn(e, t, n) {
|
|
|
1795
1794
|
r += e.substring(i, a + 5), i = a + 5;
|
|
1796
1795
|
continue;
|
|
1797
1796
|
}
|
|
1798
|
-
let { end: s, nextSpan: c } =
|
|
1797
|
+
let { end: s, nextSpan: c } = Dn(e, a + 5);
|
|
1799
1798
|
if (c !== -1) {
|
|
1800
1799
|
r += e.substring(i, c), i = c;
|
|
1801
1800
|
continue;
|
|
@@ -1804,12 +1803,12 @@ function Fn(e, t, n) {
|
|
|
1804
1803
|
r += e.substring(i);
|
|
1805
1804
|
break;
|
|
1806
1805
|
}
|
|
1807
|
-
let l = e.substring(a + 5, s), u =
|
|
1806
|
+
let l = e.substring(a + 5, s), u = In(l, "data-merge-tag") ?? In(l, "data-logic-merge-tag");
|
|
1808
1807
|
if (u === null) {
|
|
1809
1808
|
r += e.substring(i, s + 1), i = s + 1;
|
|
1810
1809
|
continue;
|
|
1811
1810
|
}
|
|
1812
|
-
let d =
|
|
1811
|
+
let d = Fn(e, s + 1, n);
|
|
1813
1812
|
if (d === -1) {
|
|
1814
1813
|
r += e.substring(i);
|
|
1815
1814
|
break;
|
|
@@ -1818,7 +1817,7 @@ function Fn(e, t, n) {
|
|
|
1818
1817
|
}
|
|
1819
1818
|
return r;
|
|
1820
1819
|
}
|
|
1821
|
-
function
|
|
1820
|
+
function Fn(e, t, n) {
|
|
1822
1821
|
if (!n) {
|
|
1823
1822
|
let n = e.indexOf("</span>", t);
|
|
1824
1823
|
return n === -1 ? -1 : n + 7;
|
|
@@ -1827,7 +1826,7 @@ function In(e, t, n) {
|
|
|
1827
1826
|
for (; i < e.length;) {
|
|
1828
1827
|
let t = e.indexOf("<", i);
|
|
1829
1828
|
if (t === -1) return -1;
|
|
1830
|
-
let n =
|
|
1829
|
+
let n = En(e, t + 1);
|
|
1831
1830
|
if (n === -1) return -1;
|
|
1832
1831
|
let a = e.startsWith("</span", t), o = e.startsWith("<span", t), s = e[t + (a ? 6 : 5)];
|
|
1833
1832
|
if ((o || a) && (s === ">" || s === "/" || /\s/.test(s)) && (r += a ? -1 : 1, r === 0)) return n + 1;
|
|
@@ -1835,11 +1834,11 @@ function In(e, t, n) {
|
|
|
1835
1834
|
}
|
|
1836
1835
|
return -1;
|
|
1837
1836
|
}
|
|
1838
|
-
function
|
|
1839
|
-
return
|
|
1837
|
+
function In(e, t) {
|
|
1838
|
+
return An(e, t);
|
|
1840
1839
|
}
|
|
1841
1840
|
// ../types/src/merge-tags.ts
|
|
1842
|
-
var
|
|
1841
|
+
var G = {
|
|
1843
1842
|
liquid: {
|
|
1844
1843
|
value: /\{\{.+?\}\}/g,
|
|
1845
1844
|
logic: /\{%-?\s*(\w+).*?-?%\}/g,
|
|
@@ -1865,13 +1864,13 @@ var W = {
|
|
|
1865
1864
|
closer: "=%%"
|
|
1866
1865
|
}
|
|
1867
1866
|
};
|
|
1868
|
-
function
|
|
1869
|
-
return Object.keys(
|
|
1870
|
-
let n =
|
|
1867
|
+
function K(e) {
|
|
1868
|
+
return Object.keys(G).find((t) => {
|
|
1869
|
+
let n = G[t];
|
|
1871
1870
|
return (e.value === n.value || e.value.source === n.value.source && e.value.flags.replace(/[gy]/g, "") === n.value.flags.replace(/[gy]/g, "")) && (e.logic === n.logic || e.logic.source === n.logic.source && e.logic.flags.replace(/[gy]/g, "") === n.logic.flags.replace(/[gy]/g, ""));
|
|
1872
1871
|
});
|
|
1873
1872
|
}
|
|
1874
|
-
function
|
|
1873
|
+
function Ln(e, t, n) {
|
|
1875
1874
|
for (let r = n; r < e.length; r++) {
|
|
1876
1875
|
let n = e.charCodeAt(r);
|
|
1877
1876
|
if (n === 10 || n === 13 || n === 8232 || n === 8233) return {
|
|
@@ -1888,8 +1887,8 @@ function Rn(e, t, n) {
|
|
|
1888
1887
|
lineBreak: -1
|
|
1889
1888
|
};
|
|
1890
1889
|
}
|
|
1891
|
-
function
|
|
1892
|
-
let a =
|
|
1890
|
+
function q(e, t, n, r = 0, i = Infinity) {
|
|
1891
|
+
let a = K(t);
|
|
1893
1892
|
if (!a) {
|
|
1894
1893
|
let a = t[n], o = new RegExp(a.source, a.flags.replace(/[gy]/g, "") + "g");
|
|
1895
1894
|
return o.lastIndex = r, [...e.matchAll(o)].slice(0, i).map((e) => ({
|
|
@@ -1913,7 +1912,7 @@ function K(e, t, n, r = 0, i = Infinity) {
|
|
|
1913
1912
|
let r = u?.lastIndex ?? t + s.length, i = a === "mailchimp" && n === "value" ? {
|
|
1914
1913
|
close: e.startsWith(c, r) ? r : -1,
|
|
1915
1914
|
lineBreak: -1
|
|
1916
|
-
} :
|
|
1915
|
+
} : Ln(e, c, Math.max(r, t + s.length + +(n === "value")));
|
|
1917
1916
|
if (i.lineBreak >= 0) {
|
|
1918
1917
|
let r = i.lineBreak, o = n === "logic" && (a === "liquid" || a === "ampscript") ? e.lastIndexOf(s, r) : -1;
|
|
1919
1918
|
p = o > t ? o : r + 1;
|
|
@@ -1935,8 +1934,8 @@ function K(e, t, n, r = 0, i = Infinity) {
|
|
|
1935
1934
|
}
|
|
1936
1935
|
return f;
|
|
1937
1936
|
}
|
|
1938
|
-
function
|
|
1939
|
-
let n =
|
|
1937
|
+
function Rn(e, t) {
|
|
1938
|
+
let n = K(t);
|
|
1940
1939
|
if (!n) {
|
|
1941
1940
|
let n = RegExp(`(${t.value.source}|${t.logic.source})`, "g");
|
|
1942
1941
|
return [...e.matchAll(n)].map((e) => ({
|
|
@@ -1944,7 +1943,7 @@ function zn(e, t) {
|
|
|
1944
1943
|
value: e[0]
|
|
1945
1944
|
}));
|
|
1946
1945
|
}
|
|
1947
|
-
if (n === "handlebars") return
|
|
1946
|
+
if (n === "handlebars") return q(e, t, "value");
|
|
1948
1947
|
if (n === "mailchimp") {
|
|
1949
1948
|
let n = [], r = new RegExp(t.value.source, "y"), i = new RegExp(t.logic.source, "y"), a = /\*\|\w+[:|]/y, o = 0;
|
|
1950
1949
|
for (; o < e.length;) {
|
|
@@ -1963,7 +1962,7 @@ function zn(e, t) {
|
|
|
1963
1962
|
o = t + 2;
|
|
1964
1963
|
continue;
|
|
1965
1964
|
}
|
|
1966
|
-
let c =
|
|
1965
|
+
let c = Ln(e, "|*", a.lastIndex);
|
|
1967
1966
|
if (c.lineBreak >= 0) {
|
|
1968
1967
|
o = c.lineBreak + 1;
|
|
1969
1968
|
continue;
|
|
@@ -1978,78 +1977,78 @@ function zn(e, t) {
|
|
|
1978
1977
|
}
|
|
1979
1978
|
return n;
|
|
1980
1979
|
}
|
|
1981
|
-
let r = [], i = 0, a =
|
|
1980
|
+
let r = [], i = 0, a = q(e, t, "value", i, 1)[0], o = q(e, t, "logic", i, 1)[0];
|
|
1982
1981
|
for (; a || o;) {
|
|
1983
1982
|
let n = !o || a && a.index <= o.index ? a : o;
|
|
1984
|
-
r.push(n), i = n.index + n.value.length, (n === a || a && a.index < i) && (a =
|
|
1983
|
+
r.push(n), i = n.index + n.value.length, (n === a || a && a.index < i) && (a = q(e, t, "value", i, 1)[0]), (n === o || o && o.index < i) && (o = q(e, t, "logic", i, 1)[0]);
|
|
1985
1984
|
}
|
|
1986
1985
|
return r;
|
|
1987
1986
|
}
|
|
1988
|
-
function
|
|
1987
|
+
function zn(e) {
|
|
1989
1988
|
return typeof e == "string" && e.trim() !== "" ? e : null;
|
|
1990
1989
|
}
|
|
1990
|
+
function Bn(e) {
|
|
1991
|
+
return Object.values(G).find((t) => t.value.source === e.value.source) ?? null;
|
|
1992
|
+
}
|
|
1991
1993
|
function Vn(e) {
|
|
1992
|
-
return
|
|
1994
|
+
return zn(e.opener) ?? Bn(e)?.opener ?? null;
|
|
1993
1995
|
}
|
|
1994
1996
|
function Hn(e) {
|
|
1995
|
-
return
|
|
1997
|
+
return zn(e.closer) ?? Bn(e)?.closer ?? null;
|
|
1996
1998
|
}
|
|
1997
1999
|
function Un(e) {
|
|
1998
|
-
return
|
|
2000
|
+
return e ? typeof e == "string" ? G[e] ?? G.liquid : e : G.liquid;
|
|
1999
2001
|
}
|
|
2000
2002
|
function Wn(e) {
|
|
2001
|
-
return e ? typeof e == "string" ? W[e] ?? W.liquid : e : W.liquid;
|
|
2002
|
-
}
|
|
2003
|
-
function Gn(e) {
|
|
2004
2003
|
let t = e.source, n = e.flags.replace("g", "");
|
|
2005
2004
|
return RegExp(`^${t}$`, n);
|
|
2006
2005
|
}
|
|
2007
|
-
function
|
|
2006
|
+
function Gn(e, t) {
|
|
2008
2007
|
let n = e?.trim() || "";
|
|
2009
|
-
return !
|
|
2008
|
+
return !Wn(t.logic).test(n) && Wn(t.value).test(n);
|
|
2010
2009
|
}
|
|
2011
|
-
function
|
|
2010
|
+
function Kn(e, t) {
|
|
2012
2011
|
let n = t.find((t) => t.value === e);
|
|
2013
2012
|
return n ? n.label : e;
|
|
2014
2013
|
}
|
|
2015
|
-
function
|
|
2016
|
-
return
|
|
2014
|
+
function qn(e, t) {
|
|
2015
|
+
return rr(e, "data-merge-tag", (e) => Kn(e, t));
|
|
2017
2016
|
}
|
|
2018
|
-
function
|
|
2017
|
+
function Jn(e, t) {
|
|
2019
2018
|
return t.find((t) => t.value === e)?.sample;
|
|
2020
2019
|
}
|
|
2021
|
-
function
|
|
2022
|
-
return
|
|
2020
|
+
function Yn(e, t) {
|
|
2021
|
+
return rr(e, "data-merge-tag", (e) => Qn(Jn(e, t) ?? Kn(e, t)), { unwrap: (e) => Jn(e, t) !== void 0 });
|
|
2023
2022
|
}
|
|
2024
|
-
function
|
|
2023
|
+
function Xn(e) {
|
|
2025
2024
|
return e.some((e) => e.sample !== void 0);
|
|
2026
2025
|
}
|
|
2027
|
-
function
|
|
2026
|
+
function Zn(e, t) {
|
|
2028
2027
|
if (!e) return e;
|
|
2029
2028
|
let n = e;
|
|
2030
2029
|
for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
|
|
2031
2030
|
return n;
|
|
2032
2031
|
}
|
|
2033
|
-
function
|
|
2032
|
+
function Qn(e) {
|
|
2034
2033
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2035
2034
|
}
|
|
2036
|
-
function
|
|
2035
|
+
function $n(e, t) {
|
|
2037
2036
|
if (!e) return !1;
|
|
2038
|
-
if (
|
|
2037
|
+
if (K(t)) return q(e, t, "value", 0, 1).length > 0 || q(e, t, "logic", 0, 1).length > 0;
|
|
2039
2038
|
let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
|
|
2040
2039
|
return n.test(e) || r.test(e);
|
|
2041
2040
|
}
|
|
2042
|
-
function
|
|
2043
|
-
return
|
|
2041
|
+
function er(e, t) {
|
|
2042
|
+
return Wn(t.logic).test(e?.trim() || "");
|
|
2044
2043
|
}
|
|
2045
|
-
function
|
|
2044
|
+
function tr(e, t) {
|
|
2046
2045
|
let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
|
|
2047
2046
|
return r && r[1] ? r[1].toUpperCase() : e;
|
|
2048
2047
|
}
|
|
2049
|
-
function
|
|
2050
|
-
return
|
|
2048
|
+
function nr(e, t) {
|
|
2049
|
+
return rr(e, "data-logic-merge-tag", (e) => tr(e, t));
|
|
2051
2050
|
}
|
|
2052
|
-
function
|
|
2051
|
+
function rr(e, t, n, r) {
|
|
2053
2052
|
let i = "", a = 0;
|
|
2054
2053
|
for (; a < e.length;) {
|
|
2055
2054
|
let o = e.indexOf("<span", a);
|
|
@@ -2062,7 +2061,7 @@ function ir(e, t, n, r) {
|
|
|
2062
2061
|
i += e.substring(a, o + 5), a = o + 5;
|
|
2063
2062
|
continue;
|
|
2064
2063
|
}
|
|
2065
|
-
let { end: c, nextSpan: l } =
|
|
2064
|
+
let { end: c, nextSpan: l } = Dn(e, o + 5);
|
|
2066
2065
|
if (l !== -1) {
|
|
2067
2066
|
i += e.substring(a, l), a = l;
|
|
2068
2067
|
continue;
|
|
@@ -2071,7 +2070,7 @@ function ir(e, t, n, r) {
|
|
|
2071
2070
|
i += e.substring(a);
|
|
2072
2071
|
break;
|
|
2073
2072
|
}
|
|
2074
|
-
let u =
|
|
2073
|
+
let u = An(e.substring(o + 5, c), t);
|
|
2075
2074
|
if (u === null) {
|
|
2076
2075
|
i += e.substring(a, c + 1), a = c + 1;
|
|
2077
2076
|
continue;
|
|
@@ -2087,14 +2086,14 @@ function ir(e, t, n, r) {
|
|
|
2087
2086
|
return i;
|
|
2088
2087
|
}
|
|
2089
2088
|
// ../types/src/locale-strings.ts
|
|
2090
|
-
var
|
|
2089
|
+
var ir = {
|
|
2091
2090
|
title: ["content"],
|
|
2092
2091
|
paragraph: ["content"]
|
|
2093
2092
|
};
|
|
2094
|
-
function
|
|
2093
|
+
function ar(e) {
|
|
2095
2094
|
let t = [], n = /<[a-z][\w:-]*\b/gi;
|
|
2096
2095
|
for (; n.exec(e);) {
|
|
2097
|
-
let r =
|
|
2096
|
+
let r = En(e, n.lastIndex);
|
|
2098
2097
|
if (r < 0) break;
|
|
2099
2098
|
let i = n.lastIndex, a = e.slice(i, r), o = /[^\s"'<>/=]+\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;
|
|
2100
2099
|
for (let e; e = o.exec(a);) {
|
|
@@ -2108,12 +2107,12 @@ function or(e) {
|
|
|
2108
2107
|
}
|
|
2109
2108
|
return t;
|
|
2110
2109
|
}
|
|
2111
|
-
function
|
|
2112
|
-
let r = n === "html" ?
|
|
2110
|
+
function or(e, t, n) {
|
|
2111
|
+
let r = n === "html" ? Nn(e) : [], i = n === "html" ? ar(e) : [], a = r.map((e) => ({
|
|
2113
2112
|
...e,
|
|
2114
2113
|
attribute: !1
|
|
2115
|
-
})), o = 0, s =
|
|
2116
|
-
let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) =>
|
|
2114
|
+
})), o = 0, s = K(t) !== void 0, c = (n, r) => {
|
|
2115
|
+
let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) => q(c, t, e, 0, 1)[0]) : [void 0, void 0], d = s ? null : [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), f = 0;
|
|
2117
2116
|
for (; f < c.length;) {
|
|
2118
2117
|
let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e, t) => {
|
|
2119
2118
|
let n = u[t];
|
|
@@ -2138,20 +2137,20 @@ function sr(e, t, n) {
|
|
|
2138
2137
|
end: ee,
|
|
2139
2138
|
markup: r.value,
|
|
2140
2139
|
attribute: i[o] !== void 0 && p >= i[o].start && ee <= i[o].end
|
|
2141
|
-
}), f = r.index + r.value.length, s) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] =
|
|
2140
|
+
}), f = r.index + r.value.length, s) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] = q(c, t, l[e], f, 1)[0]);
|
|
2142
2141
|
}
|
|
2143
2142
|
}, l = 0;
|
|
2144
2143
|
for (let e of r) c(l, e.start), l = e.end;
|
|
2145
2144
|
return c(l, e.length), a.sort((e, t) => e.start - t.start);
|
|
2146
2145
|
}
|
|
2147
|
-
function
|
|
2146
|
+
function sr(e) {
|
|
2148
2147
|
if (!e.includes("&")) return { text: e };
|
|
2149
2148
|
let t = "", n = [0], r = 0, i = (i) => {
|
|
2150
2149
|
for (t += e.slice(r, i); r < i;) n.push(++r);
|
|
2151
2150
|
};
|
|
2152
2151
|
for (let a of e.matchAll(/&(?:#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g)) {
|
|
2153
2152
|
i(a.index);
|
|
2154
|
-
let e =
|
|
2153
|
+
let e = W(a[0]);
|
|
2155
2154
|
t += e;
|
|
2156
2155
|
for (let t = 1; t < e.length; t++) n.push(-1);
|
|
2157
2156
|
r = a.index + a[0].length, n.push(r);
|
|
@@ -2161,17 +2160,17 @@ function cr(e) {
|
|
|
2161
2160
|
offsets: n
|
|
2162
2161
|
};
|
|
2163
2162
|
}
|
|
2164
|
-
var
|
|
2165
|
-
function
|
|
2166
|
-
let t = JSON.stringify(e), n =
|
|
2163
|
+
var J = /* @__PURE__ */ new Map(), cr = 32;
|
|
2164
|
+
function lr(e) {
|
|
2165
|
+
let t = JSON.stringify(e), n = J.get(t);
|
|
2167
2166
|
if (n === void 0) {
|
|
2168
2167
|
let r = e.map((e) => e.trim()).filter(Boolean).sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
2169
|
-
n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null,
|
|
2168
|
+
n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, J.size >= cr && J.delete(J.keys().next().value), J.set(t, n);
|
|
2170
2169
|
}
|
|
2171
2170
|
return n;
|
|
2172
2171
|
}
|
|
2173
|
-
function
|
|
2174
|
-
let r = n.length ?
|
|
2172
|
+
function ur(e, t, n) {
|
|
2173
|
+
let r = n.length ? lr(n) : null;
|
|
2175
2174
|
if (!r) return [];
|
|
2176
2175
|
let i = [];
|
|
2177
2176
|
if (t === "text") i.push({
|
|
@@ -2180,7 +2179,7 @@ function dr(e, t, n) {
|
|
|
2180
2179
|
attribute: !1
|
|
2181
2180
|
});
|
|
2182
2181
|
else {
|
|
2183
|
-
i.push(...
|
|
2182
|
+
i.push(...ar(e).map((e) => ({
|
|
2184
2183
|
...e,
|
|
2185
2184
|
attribute: !0
|
|
2186
2185
|
})));
|
|
@@ -2191,7 +2190,7 @@ function dr(e, t, n) {
|
|
|
2191
2190
|
end: r.index,
|
|
2192
2191
|
attribute: !1
|
|
2193
2192
|
});
|
|
2194
|
-
let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) :
|
|
2193
|
+
let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : En(e, t.lastIndex);
|
|
2195
2194
|
if (a < 0) return [];
|
|
2196
2195
|
n = a + (r[0] === "<!--" ? 3 : 1), t.lastIndex = n;
|
|
2197
2196
|
}
|
|
@@ -2204,7 +2203,7 @@ function dr(e, t, n) {
|
|
|
2204
2203
|
let a = [];
|
|
2205
2204
|
for (let n of i) {
|
|
2206
2205
|
r.lastIndex = 0;
|
|
2207
|
-
let i = e.slice(n.start, n.end), o = t === "html" ?
|
|
2206
|
+
let i = e.slice(n.start, n.end), o = t === "html" ? sr(i) : {
|
|
2208
2207
|
text: i,
|
|
2209
2208
|
offsets: void 0
|
|
2210
2209
|
};
|
|
@@ -2223,40 +2222,40 @@ function dr(e, t, n) {
|
|
|
2223
2222
|
}
|
|
2224
2223
|
return a;
|
|
2225
2224
|
}
|
|
2226
|
-
function
|
|
2227
|
-
let i =
|
|
2225
|
+
function dr(e, t, n, r) {
|
|
2226
|
+
let i = or(e, t, n), a = ur(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
|
|
2228
2227
|
return [...i, ...a].sort((e, t) => e.start - t.start);
|
|
2229
2228
|
}
|
|
2230
|
-
function
|
|
2229
|
+
function fr(e, t, n) {
|
|
2231
2230
|
let r = "", i = 0;
|
|
2232
2231
|
return t.forEach((t, a) => {
|
|
2233
2232
|
r += e.slice(i, t.start), r += t.attribute ? `__x${n[a]}__` : `<x id="${n[a]}"/>`, i = t.end;
|
|
2234
2233
|
}), r + e.slice(i);
|
|
2235
2234
|
}
|
|
2236
|
-
function
|
|
2237
|
-
let i =
|
|
2235
|
+
function pr(e, t, n, r) {
|
|
2236
|
+
let i = dr(e, t, n, r);
|
|
2238
2237
|
return {
|
|
2239
|
-
text:
|
|
2238
|
+
text: fr(e, i, i.map((e, t) => t + 1)),
|
|
2240
2239
|
tokens: i.map((e) => e.markup)
|
|
2241
2240
|
};
|
|
2242
2241
|
}
|
|
2243
|
-
function
|
|
2242
|
+
function mr(e, t) {
|
|
2244
2243
|
let n = /* @__PURE__ */ new Set(), r = !0, i = e.replace(/<x id="(\d+)"\s*\/>|<x id="(\d+)"><\/x>|__x(\d+)__/g, (e, i, a, o) => {
|
|
2245
2244
|
let s = Number(i ?? a ?? o);
|
|
2246
2245
|
return (s < 1 || s > t.length || n.has(s)) && (r = !1), n.add(s), t[s - 1] ?? "";
|
|
2247
2246
|
});
|
|
2248
2247
|
return r && n.size === t.length ? i : null;
|
|
2249
2248
|
}
|
|
2250
|
-
function
|
|
2251
|
-
let a =
|
|
2249
|
+
function hr(e, t, n, r, i) {
|
|
2250
|
+
let a = dr(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
2252
2251
|
let n = t.findIndex((t, n) => !o.has(n) && e(t));
|
|
2253
2252
|
return n >= 0 && o.add(n), n;
|
|
2254
2253
|
}, c = a.map((e) => s((t) => t === e.markup));
|
|
2255
2254
|
return a.forEach((e, t) => {
|
|
2256
|
-
c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) =>
|
|
2257
|
-
}), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null :
|
|
2255
|
+
c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => W(t) === e.term));
|
|
2256
|
+
}), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : fr(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
|
|
2258
2257
|
}
|
|
2259
|
-
function
|
|
2258
|
+
function gr(e, t, n = []) {
|
|
2260
2259
|
let r = /* @__PURE__ */ new Map();
|
|
2261
2260
|
if (t === w(e) || !e.settings.locales?.includes(t)) return r;
|
|
2262
2261
|
let i = (e, n, i, a) => {
|
|
@@ -2267,7 +2266,7 @@ function _r(e, t, n = []) {
|
|
|
2267
2266
|
target: e,
|
|
2268
2267
|
path: t,
|
|
2269
2268
|
source: i,
|
|
2270
|
-
format: a &&
|
|
2269
|
+
format: a && ir[a]?.includes(t) ? "html" : "text",
|
|
2271
2270
|
text: o?.text?.[t]
|
|
2272
2271
|
});
|
|
2273
2272
|
}
|
|
@@ -2276,22 +2275,22 @@ function _r(e, t, n = []) {
|
|
|
2276
2275
|
if (r.type !== "html" && i({
|
|
2277
2276
|
kind: "block",
|
|
2278
2277
|
blockId: r.id
|
|
2279
|
-
}, r,
|
|
2278
|
+
}, r, S(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
|
|
2280
2279
|
else r.type === "wrapper" && a(r.children);
|
|
2281
2280
|
}
|
|
2282
2281
|
};
|
|
2283
2282
|
return a(e.blocks), i({ kind: "settings" }, e.settings, g), r;
|
|
2284
2283
|
}
|
|
2285
|
-
function
|
|
2284
|
+
function _r(e, t, n) {
|
|
2286
2285
|
let r = n.only === "all" ? null : Pe(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
|
|
2287
|
-
for (let [r, s] of
|
|
2286
|
+
for (let [r, s] of gr(e, t, n.definitions)) {
|
|
2288
2287
|
if (i && !i.has(r) || n.blockId !== void 0 && (s.target.kind !== "block" || s.target.blockId !== n.blockId)) continue;
|
|
2289
|
-
let e =
|
|
2288
|
+
let e = pr(s.source, n.syntax, s.format, n), t = s.text ? hr(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
|
|
2290
2289
|
a.push({
|
|
2291
2290
|
id: r,
|
|
2292
2291
|
format: s.format,
|
|
2293
2292
|
source: e.text,
|
|
2294
|
-
sourceHash:
|
|
2293
|
+
sourceHash: C(s.source),
|
|
2295
2294
|
...t == null ? {} : { text: t }
|
|
2296
2295
|
}), o[r] = e.tokens;
|
|
2297
2296
|
}
|
|
@@ -2300,8 +2299,8 @@ function vr(e, t, n) {
|
|
|
2300
2299
|
tokens: o
|
|
2301
2300
|
};
|
|
2302
2301
|
}
|
|
2303
|
-
function
|
|
2304
|
-
let i =
|
|
2302
|
+
function vr(e, t, n, r) {
|
|
2303
|
+
let i = gr(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
|
|
2305
2304
|
for (let t of e) if (a.set(t.id, t), t.type === "section") for (let e of t.children) o(e);
|
|
2306
2305
|
else t.type === "wrapper" && o(t.children);
|
|
2307
2306
|
};
|
|
@@ -2317,8 +2316,8 @@ function yr(e, t, n, r) {
|
|
|
2317
2316
|
});
|
|
2318
2317
|
continue;
|
|
2319
2318
|
}
|
|
2320
|
-
let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ?
|
|
2321
|
-
if (!o || u === null ||
|
|
2319
|
+
let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? mr(t.text, o) : null;
|
|
2320
|
+
if (!o || u === null || hr(u, o, r.syntax, n.format, r) === null) {
|
|
2322
2321
|
l.push({
|
|
2323
2322
|
id: t.id,
|
|
2324
2323
|
reason: "tags_changed"
|
|
@@ -2348,26 +2347,29 @@ function yr(e, t, n, r) {
|
|
|
2348
2347
|
};
|
|
2349
2348
|
}
|
|
2350
2349
|
// ../types/src/custom-block-liquid.ts
|
|
2351
|
-
|
|
2350
|
+
var yr = 1e7, br = 2e3;
|
|
2351
|
+
function xr(e) {
|
|
2352
2352
|
return new e.Liquid({
|
|
2353
2353
|
strictVariables: !1,
|
|
2354
2354
|
strictFilters: !1,
|
|
2355
2355
|
outputEscape: "escape",
|
|
2356
|
+
memoryLimit: yr,
|
|
2357
|
+
renderLimit: br,
|
|
2356
2358
|
templates: {}
|
|
2357
2359
|
});
|
|
2358
2360
|
}
|
|
2359
2361
|
// ../types/src/factory.ts
|
|
2360
|
-
function
|
|
2362
|
+
function Y(e, t) {
|
|
2361
2363
|
let n = m(e);
|
|
2362
|
-
return !t || Object.keys(t).length === 0 ? n :
|
|
2364
|
+
return !t || Object.keys(t).length === 0 ? n : yn(n, t);
|
|
2363
2365
|
}
|
|
2364
|
-
function
|
|
2366
|
+
function X(e) {
|
|
2365
2367
|
return e === void 0 ? void 0 : m(e);
|
|
2366
2368
|
}
|
|
2367
|
-
function
|
|
2369
|
+
function Z() {
|
|
2368
2370
|
return crypto.randomUUID();
|
|
2369
2371
|
}
|
|
2370
|
-
function
|
|
2372
|
+
function Sr(e = 0) {
|
|
2371
2373
|
return {
|
|
2372
2374
|
top: e,
|
|
2373
2375
|
right: e,
|
|
@@ -2375,135 +2377,135 @@ function xr(e = 0) {
|
|
|
2375
2377
|
left: e
|
|
2376
2378
|
};
|
|
2377
2379
|
}
|
|
2378
|
-
function
|
|
2379
|
-
return { padding:
|
|
2380
|
+
function Q(e = 10) {
|
|
2381
|
+
return { padding: Sr(e) };
|
|
2380
2382
|
}
|
|
2381
|
-
function
|
|
2382
|
-
return
|
|
2383
|
-
id:
|
|
2383
|
+
function Cr(e = {}) {
|
|
2384
|
+
return Y({
|
|
2385
|
+
id: Z(),
|
|
2384
2386
|
type: "title",
|
|
2385
|
-
...
|
|
2386
|
-
styles:
|
|
2387
|
+
...nn,
|
|
2388
|
+
styles: Q()
|
|
2387
2389
|
}, e);
|
|
2388
2390
|
}
|
|
2389
|
-
function
|
|
2390
|
-
return
|
|
2391
|
-
id:
|
|
2391
|
+
function wr(e = {}) {
|
|
2392
|
+
return Y({
|
|
2393
|
+
id: Z(),
|
|
2392
2394
|
type: "paragraph",
|
|
2393
|
-
...
|
|
2394
|
-
styles:
|
|
2395
|
+
...rn,
|
|
2396
|
+
styles: Q()
|
|
2395
2397
|
}, e);
|
|
2396
2398
|
}
|
|
2397
|
-
function
|
|
2398
|
-
return
|
|
2399
|
-
id:
|
|
2399
|
+
function Tr(e = {}) {
|
|
2400
|
+
return Y({
|
|
2401
|
+
id: Z(),
|
|
2400
2402
|
type: "image",
|
|
2401
|
-
...
|
|
2402
|
-
styles:
|
|
2403
|
+
...an,
|
|
2404
|
+
styles: Q()
|
|
2403
2405
|
}, e);
|
|
2404
2406
|
}
|
|
2405
|
-
function
|
|
2406
|
-
return
|
|
2407
|
-
id:
|
|
2407
|
+
function Er(e = {}) {
|
|
2408
|
+
return Y({
|
|
2409
|
+
id: Z(),
|
|
2408
2410
|
type: "button",
|
|
2409
|
-
...
|
|
2410
|
-
styles:
|
|
2411
|
+
...on,
|
|
2412
|
+
styles: Q()
|
|
2411
2413
|
}, e);
|
|
2412
2414
|
}
|
|
2413
|
-
function
|
|
2414
|
-
return
|
|
2415
|
-
id:
|
|
2415
|
+
function Dr(e = {}) {
|
|
2416
|
+
return Y({
|
|
2417
|
+
id: Z(),
|
|
2416
2418
|
type: "divider",
|
|
2417
|
-
...
|
|
2418
|
-
styles:
|
|
2419
|
+
...sn,
|
|
2420
|
+
styles: Q(20)
|
|
2419
2421
|
}, e);
|
|
2420
2422
|
}
|
|
2421
|
-
function
|
|
2422
|
-
return
|
|
2423
|
-
id:
|
|
2423
|
+
function Or(e = {}) {
|
|
2424
|
+
return Y({
|
|
2425
|
+
id: Z(),
|
|
2424
2426
|
type: "section",
|
|
2425
|
-
...
|
|
2427
|
+
...cn,
|
|
2426
2428
|
children: [[]],
|
|
2427
|
-
styles:
|
|
2429
|
+
styles: Q(20)
|
|
2428
2430
|
}, e);
|
|
2429
2431
|
}
|
|
2430
|
-
function
|
|
2431
|
-
return
|
|
2432
|
-
id:
|
|
2432
|
+
function kr(e = {}) {
|
|
2433
|
+
return Y({
|
|
2434
|
+
id: Z(),
|
|
2433
2435
|
type: "video",
|
|
2434
|
-
...
|
|
2435
|
-
styles:
|
|
2436
|
+
...ln,
|
|
2437
|
+
styles: Q()
|
|
2436
2438
|
}, e);
|
|
2437
2439
|
}
|
|
2438
|
-
function
|
|
2439
|
-
return
|
|
2440
|
-
id:
|
|
2440
|
+
function Ar(e = {}) {
|
|
2441
|
+
return Y({
|
|
2442
|
+
id: Z(),
|
|
2441
2443
|
type: "social",
|
|
2442
2444
|
icons: [],
|
|
2443
|
-
...
|
|
2444
|
-
styles:
|
|
2445
|
+
...un,
|
|
2446
|
+
styles: Q()
|
|
2445
2447
|
}, e);
|
|
2446
2448
|
}
|
|
2447
|
-
function
|
|
2448
|
-
return
|
|
2449
|
-
id:
|
|
2449
|
+
function jr(e = {}) {
|
|
2450
|
+
return Y({
|
|
2451
|
+
id: Z(),
|
|
2450
2452
|
type: "spacer",
|
|
2451
|
-
...
|
|
2452
|
-
styles:
|
|
2453
|
+
...dn,
|
|
2454
|
+
styles: Q(0)
|
|
2453
2455
|
}, e);
|
|
2454
2456
|
}
|
|
2455
|
-
function
|
|
2456
|
-
return
|
|
2457
|
-
id:
|
|
2457
|
+
function Mr(e = {}) {
|
|
2458
|
+
return Y({
|
|
2459
|
+
id: Z(),
|
|
2458
2460
|
type: "html",
|
|
2459
|
-
...
|
|
2460
|
-
styles:
|
|
2461
|
+
...fn,
|
|
2462
|
+
styles: Q()
|
|
2461
2463
|
}, e);
|
|
2462
2464
|
}
|
|
2463
|
-
function
|
|
2464
|
-
return
|
|
2465
|
-
id:
|
|
2465
|
+
function Nr(e = {}) {
|
|
2466
|
+
return Y({
|
|
2467
|
+
id: Z(),
|
|
2466
2468
|
type: "menu",
|
|
2467
2469
|
items: [],
|
|
2468
|
-
...
|
|
2469
|
-
styles:
|
|
2470
|
+
...pn,
|
|
2471
|
+
styles: Q()
|
|
2470
2472
|
}, e);
|
|
2471
2473
|
}
|
|
2472
|
-
function
|
|
2474
|
+
function Pr(e, t) {
|
|
2473
2475
|
return Array.from({ length: t }, () => ({
|
|
2474
|
-
id:
|
|
2476
|
+
id: Z(),
|
|
2475
2477
|
cells: Array.from({ length: e }, () => ({
|
|
2476
|
-
id:
|
|
2478
|
+
id: Z(),
|
|
2477
2479
|
content: ""
|
|
2478
2480
|
}))
|
|
2479
2481
|
}));
|
|
2480
2482
|
}
|
|
2481
|
-
function
|
|
2482
|
-
return
|
|
2483
|
-
id:
|
|
2483
|
+
function Fr(e = {}) {
|
|
2484
|
+
return Y({
|
|
2485
|
+
id: Z(),
|
|
2484
2486
|
type: "table",
|
|
2485
|
-
rows:
|
|
2486
|
-
...
|
|
2487
|
-
styles:
|
|
2487
|
+
rows: Pr(3, 3),
|
|
2488
|
+
...mn,
|
|
2489
|
+
styles: Q()
|
|
2488
2490
|
}, e);
|
|
2489
2491
|
}
|
|
2490
|
-
function
|
|
2491
|
-
return
|
|
2492
|
-
id:
|
|
2492
|
+
function Ir(e = {}) {
|
|
2493
|
+
return Y({
|
|
2494
|
+
id: Z(),
|
|
2493
2495
|
type: "countdown",
|
|
2494
|
-
...
|
|
2495
|
-
styles:
|
|
2496
|
+
...hn,
|
|
2497
|
+
styles: Q()
|
|
2496
2498
|
}, e);
|
|
2497
2499
|
}
|
|
2498
|
-
function
|
|
2500
|
+
function Lr(e) {
|
|
2499
2501
|
return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
|
|
2500
2502
|
}
|
|
2501
|
-
function
|
|
2503
|
+
function Rr(e) {
|
|
2502
2504
|
let t = {};
|
|
2503
|
-
for (let n of e.fields) t[n.key] =
|
|
2504
|
-
let n =
|
|
2505
|
+
for (let n of e.fields) t[n.key] = X(Lr(n));
|
|
2506
|
+
let n = Y(Q(), X(e.defaultStyles));
|
|
2505
2507
|
return {
|
|
2506
|
-
id:
|
|
2508
|
+
id: Z(),
|
|
2507
2509
|
type: "custom",
|
|
2508
2510
|
customType: e.type,
|
|
2509
2511
|
fieldValues: t,
|
|
@@ -2511,42 +2513,42 @@ function Lr(e) {
|
|
|
2511
2513
|
...e.dataSource ? { dataSourceFetched: !1 } : {}
|
|
2512
2514
|
};
|
|
2513
2515
|
}
|
|
2514
|
-
function
|
|
2516
|
+
function zr() {
|
|
2515
2517
|
return {
|
|
2516
|
-
id:
|
|
2518
|
+
id: Z(),
|
|
2517
2519
|
type: "slot",
|
|
2518
|
-
styles:
|
|
2520
|
+
styles: Q(0)
|
|
2519
2521
|
};
|
|
2520
2522
|
}
|
|
2521
|
-
function
|
|
2522
|
-
return
|
|
2523
|
-
id:
|
|
2523
|
+
function Br(e = {}) {
|
|
2524
|
+
return Y({
|
|
2525
|
+
id: Z(),
|
|
2524
2526
|
type: "wrapper",
|
|
2525
2527
|
children: [],
|
|
2526
|
-
styles:
|
|
2528
|
+
styles: Q(0)
|
|
2527
2529
|
}, e);
|
|
2528
2530
|
}
|
|
2529
|
-
function
|
|
2531
|
+
function Vr(e, t) {
|
|
2530
2532
|
switch (e) {
|
|
2531
|
-
case "section": return
|
|
2532
|
-
case "title": return
|
|
2533
|
-
case "paragraph": return
|
|
2534
|
-
case "image": return
|
|
2535
|
-
case "button": return
|
|
2536
|
-
case "divider": return
|
|
2537
|
-
case "video": return
|
|
2538
|
-
case "social": return
|
|
2539
|
-
case "spacer": return
|
|
2540
|
-
case "html": return
|
|
2541
|
-
case "menu": return
|
|
2542
|
-
case "table": return
|
|
2543
|
-
case "countdown": return
|
|
2533
|
+
case "section": return Or(X(t?.section));
|
|
2534
|
+
case "title": return Cr(X(t?.title));
|
|
2535
|
+
case "paragraph": return wr(X(t?.paragraph));
|
|
2536
|
+
case "image": return Tr(X(t?.image));
|
|
2537
|
+
case "button": return Er(X(t?.button));
|
|
2538
|
+
case "divider": return Dr(X(t?.divider));
|
|
2539
|
+
case "video": return kr(X(t?.video));
|
|
2540
|
+
case "social": return Ar(X(t?.social));
|
|
2541
|
+
case "spacer": return jr(X(t?.spacer));
|
|
2542
|
+
case "html": return Mr(X(t?.html));
|
|
2543
|
+
case "menu": return Nr(X(t?.menu));
|
|
2544
|
+
case "table": return Fr(X(t?.table));
|
|
2545
|
+
case "countdown": return Ir(X(t?.countdown));
|
|
2544
2546
|
case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
|
|
2545
2547
|
case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
|
|
2546
2548
|
default: throw Error(`Unknown block type: ${e}`);
|
|
2547
2549
|
}
|
|
2548
2550
|
}
|
|
2549
|
-
function
|
|
2551
|
+
function Hr(e, t) {
|
|
2550
2552
|
let n = e.l10n;
|
|
2551
2553
|
if (!n || t.size === 0) return;
|
|
2552
2554
|
let r = (n) => {
|
|
@@ -2561,92 +2563,96 @@ function Vr(e, t) {
|
|
|
2561
2563
|
n && (e[t] = Object.fromEntries(Object.entries(n).map(([e, t]) => [r(e), t])));
|
|
2562
2564
|
}
|
|
2563
2565
|
}
|
|
2564
|
-
function
|
|
2565
|
-
let t = JSON.parse(JSON.stringify(e))
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2566
|
+
function Ur(e) {
|
|
2567
|
+
let t = JSON.parse(JSON.stringify(e)), n = (e) => {
|
|
2568
|
+
e.id = Z();
|
|
2569
|
+
let t = /* @__PURE__ */ new Map(), r = (e, n) => {
|
|
2570
|
+
let r = e.id;
|
|
2571
|
+
e.id = Z();
|
|
2572
|
+
let i = t.get(n);
|
|
2573
|
+
return i || (i = /* @__PURE__ */ new Map(), t.set(n, i)), i.set(r, e.id), r;
|
|
2574
|
+
};
|
|
2575
|
+
if (e.type === "table") for (let t of e.rows) {
|
|
2576
|
+
let e = r(t, "rows");
|
|
2577
|
+
for (let n of t.cells) r(n, `rows.${e}.cells`);
|
|
2578
|
+
}
|
|
2579
|
+
if (e.type === "menu") for (let t of e.items) r(t, "items");
|
|
2580
|
+
if (e.type === "social") for (let t of e.icons) r(t, "icons");
|
|
2581
|
+
if (e.type === "section") for (let t of e.children) for (let e of t) n(e);
|
|
2582
|
+
if (e.type === "wrapper") for (let t of e.children) n(t);
|
|
2583
|
+
Hr(e, t);
|
|
2572
2584
|
};
|
|
2573
|
-
|
|
2574
|
-
let t = r(e, "rows");
|
|
2575
|
-
for (let n of e.cells) r(n, `rows.${t}.cells`);
|
|
2576
|
-
}
|
|
2577
|
-
if (t.type === "menu") for (let e of t.items) r(e, "items");
|
|
2578
|
-
if (t.type === "social") for (let e of t.icons) r(e, "icons");
|
|
2579
|
-
return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Q(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Q(e))), Vr(t, n), t;
|
|
2585
|
+
return n(t), t;
|
|
2580
2586
|
}
|
|
2581
2587
|
// ../types/src/layout.ts
|
|
2582
|
-
var
|
|
2588
|
+
var Wr = "[Templatical] layout: must contain exactly one slot block", Gr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", Kr = "[Templatical] layout: a wrapper cannot contain a wrapper", qr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Jr = "[Templatical] slot is not a valid content block", Yr = "[Templatical] layout: a wrapper cannot contain a section with its own wrapper (section.wrapper)", Xr = "[Templatical] wrapper is not a valid content block";
|
|
2583
2589
|
function $(e, t, n = null, r = !1, i = !1) {
|
|
2584
|
-
for (let a of e) if (t(a, n, r, i),
|
|
2585
|
-
else
|
|
2590
|
+
for (let a of e) if (t(a, n, r, i), Ht(a)) for (let e of a.children) $(e, t, a, !0, i);
|
|
2591
|
+
else H(a) && $(a.children, t, a, r, !0);
|
|
2586
2592
|
}
|
|
2587
|
-
function
|
|
2593
|
+
function Zr(e) {
|
|
2588
2594
|
let t = 0;
|
|
2589
2595
|
if ($(e.blocks, (e, n, r, i) => {
|
|
2590
|
-
if (i &&
|
|
2591
|
-
if (
|
|
2592
|
-
if (
|
|
2593
|
-
if (r) throw Error(
|
|
2594
|
-
if (e.children.some(
|
|
2596
|
+
if (i && Ht(e) && e.wrapper) throw Error(Yr);
|
|
2597
|
+
if (V(e) && (t += 1, r)) throw Error(Gr);
|
|
2598
|
+
if (H(e)) {
|
|
2599
|
+
if (r) throw Error(Gr);
|
|
2600
|
+
if (e.children.some(H)) throw Error(Kr);
|
|
2595
2601
|
}
|
|
2596
|
-
}), t !== 1) throw Error(
|
|
2602
|
+
}), t !== 1) throw Error(Wr);
|
|
2597
2603
|
}
|
|
2598
|
-
function
|
|
2604
|
+
function Qr(e) {
|
|
2599
2605
|
$(e.blocks, (e) => {
|
|
2600
|
-
if (
|
|
2606
|
+
if (V(e)) throw Error(Jr);
|
|
2601
2607
|
});
|
|
2602
2608
|
}
|
|
2603
|
-
function
|
|
2609
|
+
function $r(e) {
|
|
2604
2610
|
$(e.blocks, (e) => {
|
|
2605
|
-
if (
|
|
2611
|
+
if (H(e)) throw Error(Xr);
|
|
2606
2612
|
});
|
|
2607
2613
|
}
|
|
2608
|
-
function
|
|
2614
|
+
function ei(e) {
|
|
2609
2615
|
let t = !1;
|
|
2610
2616
|
return $(e.blocks, (e, n) => {
|
|
2611
|
-
|
|
2617
|
+
V(e) && n !== null && H(n) && (t = !0);
|
|
2612
2618
|
}), t;
|
|
2613
2619
|
}
|
|
2614
|
-
function
|
|
2615
|
-
if (
|
|
2616
|
-
if (
|
|
2617
|
-
let t =
|
|
2620
|
+
function ti(e) {
|
|
2621
|
+
if (V(e)) return e;
|
|
2622
|
+
if (H(e)) {
|
|
2623
|
+
let t = Ur({
|
|
2618
2624
|
...e,
|
|
2619
2625
|
children: []
|
|
2620
2626
|
});
|
|
2621
|
-
return t.children = e.children.map(
|
|
2627
|
+
return t.children = e.children.map(ti), t;
|
|
2622
2628
|
}
|
|
2623
|
-
return
|
|
2629
|
+
return Ur(e);
|
|
2624
2630
|
}
|
|
2625
|
-
function
|
|
2631
|
+
function ni(e) {
|
|
2626
2632
|
for (let t = 0; t < e.length; t++) {
|
|
2627
2633
|
let n = e[t];
|
|
2628
|
-
if (
|
|
2634
|
+
if (V(n)) return {
|
|
2629
2635
|
parent: e,
|
|
2630
2636
|
index: t
|
|
2631
2637
|
};
|
|
2632
|
-
if (
|
|
2633
|
-
let e =
|
|
2638
|
+
if (H(n)) {
|
|
2639
|
+
let e = ni(n.children);
|
|
2634
2640
|
if (e) return e;
|
|
2635
2641
|
}
|
|
2636
2642
|
}
|
|
2637
2643
|
return null;
|
|
2638
2644
|
}
|
|
2639
|
-
function
|
|
2640
|
-
for (let t of e) if (
|
|
2645
|
+
function ri(e) {
|
|
2646
|
+
for (let t of e) if (Ht(t)) {
|
|
2641
2647
|
if (t.wrapper) return !0;
|
|
2642
|
-
for (let e of t.children) if (
|
|
2648
|
+
for (let e of t.children) if (ri(e)) return !0;
|
|
2643
2649
|
}
|
|
2644
2650
|
return !1;
|
|
2645
2651
|
}
|
|
2646
|
-
function
|
|
2647
|
-
if (
|
|
2648
|
-
let n = e.blocks.map(
|
|
2649
|
-
if (!r) throw Error(
|
|
2652
|
+
function ii(e, t) {
|
|
2653
|
+
if (Zr(e), Qr(t), $r(t), ei(e) && ri(t.blocks)) throw Error(qr);
|
|
2654
|
+
let n = e.blocks.map(ti), r = ni(n);
|
|
2655
|
+
if (!r) throw Error(Wr);
|
|
2650
2656
|
return r.parent.splice(r.index, 1, ...m(t.blocks)), {
|
|
2651
2657
|
blocks: n,
|
|
2652
2658
|
settings: {
|
|
@@ -2656,7 +2662,7 @@ function ni(e, t) {
|
|
|
2656
2662
|
};
|
|
2657
2663
|
}
|
|
2658
2664
|
// ../types/src/url-policy.ts
|
|
2659
|
-
var
|
|
2665
|
+
var ai = Object.freeze([
|
|
2660
2666
|
"http",
|
|
2661
2667
|
"https",
|
|
2662
2668
|
"mailto",
|
|
@@ -2666,44 +2672,44 @@ var ri = Object.freeze([
|
|
|
2666
2672
|
"sms",
|
|
2667
2673
|
"xmpp",
|
|
2668
2674
|
"cid"
|
|
2669
|
-
]),
|
|
2675
|
+
]), oi = Object.freeze([
|
|
2670
2676
|
"javascript",
|
|
2671
2677
|
"data",
|
|
2672
2678
|
"vbscript"
|
|
2673
2679
|
]);
|
|
2674
|
-
function
|
|
2680
|
+
function si(e) {
|
|
2675
2681
|
return e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
2676
2682
|
}
|
|
2677
|
-
function
|
|
2678
|
-
let t = /^([a-z][a-z0-9+.-]*):/i.exec(
|
|
2683
|
+
function ci(e) {
|
|
2684
|
+
let t = /^([a-z][a-z0-9+.-]*):/i.exec(si(e));
|
|
2679
2685
|
return t ? t[1].toLowerCase() : null;
|
|
2680
2686
|
}
|
|
2681
|
-
var
|
|
2687
|
+
var li = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, ui = Object.freeze([
|
|
2682
2688
|
"href",
|
|
2683
2689
|
"xlink:href",
|
|
2684
2690
|
"background",
|
|
2685
2691
|
"poster",
|
|
2686
2692
|
"src"
|
|
2687
|
-
]),
|
|
2693
|
+
]), di = Object.freeze([
|
|
2688
2694
|
"srcdoc",
|
|
2689
2695
|
"ping",
|
|
2690
2696
|
"formaction",
|
|
2691
2697
|
"action"
|
|
2692
2698
|
]);
|
|
2693
|
-
function
|
|
2694
|
-
let n =
|
|
2695
|
-
return r === null ||
|
|
2699
|
+
function fi(e, t) {
|
|
2700
|
+
let n = si(e), r = ci(n);
|
|
2701
|
+
return r === null || ai.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && li.test(n);
|
|
2696
2702
|
}
|
|
2697
2703
|
// ../types/src/rich-text.ts
|
|
2698
|
-
var
|
|
2699
|
-
function
|
|
2700
|
-
return e.replace(
|
|
2704
|
+
var pi = /<\/?p\b[^<>]*>/gi, mi = /<p\b([^<>]*)>\s*<\/p>/gi;
|
|
2705
|
+
function hi(e) {
|
|
2706
|
+
return e.replace(pi, "").trim() === "";
|
|
2701
2707
|
}
|
|
2702
|
-
function
|
|
2703
|
-
return
|
|
2708
|
+
function gi(e) {
|
|
2709
|
+
return hi(e) ? e : e.replace(mi, "<p$1> </p>");
|
|
2704
2710
|
}
|
|
2705
2711
|
// ../types/src/fonts.ts
|
|
2706
|
-
var
|
|
2712
|
+
var _i = {
|
|
2707
2713
|
arial: "Arial, sans-serif",
|
|
2708
2714
|
helvetica: "Helvetica, sans-serif",
|
|
2709
2715
|
georgia: "Georgia, serif",
|
|
@@ -2712,13 +2718,13 @@ var hi = {
|
|
|
2712
2718
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
2713
2719
|
"courier new": "'Courier New', monospace",
|
|
2714
2720
|
tahoma: "Tahoma, sans-serif"
|
|
2715
|
-
},
|
|
2721
|
+
}, vi = /* @__PURE__ */ new Set([
|
|
2716
2722
|
"inherit",
|
|
2717
2723
|
"initial",
|
|
2718
2724
|
"unset",
|
|
2719
2725
|
"revert",
|
|
2720
2726
|
"revert-layer"
|
|
2721
|
-
]),
|
|
2727
|
+
]), yi = /* @__PURE__ */ new Set([
|
|
2722
2728
|
"serif",
|
|
2723
2729
|
"sans-serif",
|
|
2724
2730
|
"monospace",
|
|
@@ -2733,14 +2739,14 @@ var hi = {
|
|
|
2733
2739
|
"math",
|
|
2734
2740
|
"fangsong"
|
|
2735
2741
|
]);
|
|
2736
|
-
function
|
|
2742
|
+
function bi(e) {
|
|
2737
2743
|
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
2738
2744
|
}
|
|
2739
|
-
function
|
|
2745
|
+
function xi(e) {
|
|
2740
2746
|
if (typeof e != "string") return [];
|
|
2741
2747
|
let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
|
|
2742
2748
|
for (;;) {
|
|
2743
|
-
for (; r < t.length &&
|
|
2749
|
+
for (; r < t.length && bi(t[r]);) r++;
|
|
2744
2750
|
if (r >= t.length) return [];
|
|
2745
2751
|
let e = t[r];
|
|
2746
2752
|
if (e === "\"" || e === "'") {
|
|
@@ -2757,7 +2763,7 @@ function yi(e) {
|
|
|
2757
2763
|
}
|
|
2758
2764
|
}
|
|
2759
2765
|
if (!o) return [];
|
|
2760
|
-
for (; a < t.length &&
|
|
2766
|
+
for (; a < t.length && bi(t[a]);) a++;
|
|
2761
2767
|
if (a < t.length && t[a] !== ",") return [];
|
|
2762
2768
|
n.push({
|
|
2763
2769
|
name: i,
|
|
@@ -2765,7 +2771,7 @@ function yi(e) {
|
|
|
2765
2771
|
}), r = a;
|
|
2766
2772
|
} else {
|
|
2767
2773
|
let e = t.indexOf(",", r), i = e === -1 ? t.length : e, a = t.slice(r, i).trim().split(/\s+/).join(" ");
|
|
2768
|
-
if (a === "" || a.includes("\"") || a.includes("'") ||
|
|
2774
|
+
if (a === "" || a.includes("\"") || a.includes("'") || vi.has(a.toLowerCase())) return [];
|
|
2769
2775
|
n.push({
|
|
2770
2776
|
name: a,
|
|
2771
2777
|
quoted: !1
|
|
@@ -2775,27 +2781,27 @@ function yi(e) {
|
|
|
2775
2781
|
r++;
|
|
2776
2782
|
}
|
|
2777
2783
|
}
|
|
2778
|
-
function
|
|
2784
|
+
function Si(e) {
|
|
2779
2785
|
return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
|
|
2780
2786
|
}
|
|
2781
|
-
function
|
|
2782
|
-
return !e.quoted &&
|
|
2787
|
+
function Ci(e) {
|
|
2788
|
+
return !e.quoted && yi.has(e.name.toLowerCase());
|
|
2783
2789
|
}
|
|
2784
|
-
function
|
|
2785
|
-
return
|
|
2790
|
+
function wi(e) {
|
|
2791
|
+
return xi(e)[0]?.name ?? "";
|
|
2786
2792
|
}
|
|
2787
|
-
function
|
|
2788
|
-
let n = (e) => `${
|
|
2793
|
+
function Ti(e, t) {
|
|
2794
|
+
let n = (e) => `${Si(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
|
|
2789
2795
|
if (i) return n(i);
|
|
2790
|
-
let a =
|
|
2796
|
+
let a = xi(e);
|
|
2791
2797
|
if (a.length !== 1) return e;
|
|
2792
2798
|
let [o] = a, s = o.name.toLowerCase(), c = t.customFonts.find((e) => e.name.toLowerCase() === s);
|
|
2793
|
-
return c ? n(c) :
|
|
2799
|
+
return c ? n(c) : _i[s] || (Ci(o) ? e : `${Si(o.name)}, ${t.defaultFallback}`);
|
|
2794
2800
|
}
|
|
2795
2801
|
// ../types/src/preview-resolution.ts
|
|
2796
|
-
function
|
|
2802
|
+
function Ei(e) {
|
|
2797
2803
|
return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
|
|
2798
2804
|
}
|
|
2799
|
-
export {
|
|
2805
|
+
export { nr as $, Ne as $t, Ar as A, Jt as At, _r as B, g as Bt, Dr as C, n as Cn, Wt as Ct, wr as D, Xt as Dt, Nr as E, t as En, Yt as Et, Br as F, He as Ft, tr as G, Se as Gt, G as H, w as Ht, Z as I, E as It, Hn as J, Fe as Jt, Kn as K, Te as Kt, xr as L, M as Lt, Fr as M, Vt as Mt, Cr as N, zt as Nt, Or as O, $t as Ot, kr as P, T as Pt, Gn as Q, y as Qt, ir as R, Be as Rt, Rr as S, c as Sn, Qt as St, Tr as T, o as Tn, V as Tt, K as U, ve as Ut, mr as V, Ie as Vt, $n as W, v as Wt, Xn as X, b as Xt, Vn as Y, Oe as Yt, er as Z, Ce as Zt, Zr as _, i as _n, en as _t, gi as a, se as an, Zn as at, Er as b, s as bn, Zt as bt, di as c, pe as cn, W as ct, ci as d, ie as dn, Cn as dt, C as en, qn as et, fi as f, f as fn, bn as ft, ei as g, ne as gn, Kt as gt, $r as h, te as hn, yn as ht, Ti as i, m as in, Yn as it, jr as j, H as jt, zr as k, Ut as kt, ui as l, fe as ln, En as lt, Qr as m, ee as mn, _n as mt, wi as n, ge as nn, Rn as nt, hi as o, de as on, jn as ot, ii as p, p as pn, gn as pt, Jn as q, Pe as qt, xi as r, h as rn, q as rt, oi as s, ue as sn, Mn as st, Ei as t, S as tn, Un as tt, ai as u, oe as un, wn as ut, Ur as v, e as vn, tn as vt, Mr as w, r as wn, Ht as wt, Ir as x, u as xn, Gt as xt, Vr as y, l as yn, qt as yt, vr as z, Ve as zt };
|
|
2800
2806
|
|
|
2801
|
-
//# sourceMappingURL=src-
|
|
2807
|
+
//# sourceMappingURL=src-CVHGPKSW.js.map
|