chaipro 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/dist/IconPicker-I7VNLYZ4.js +5 -0
- package/dist/actions-DM00SIUk.d.cts +899 -0
- package/dist/actions-DM00SIUk.d.ts +899 -0
- package/dist/actions-registery-SEJTZE5Q.js +1 -0
- package/dist/active-in-another-tab-SONDAONP.js +1 -0
- package/dist/add-new-language-page-TI6DUYYX.js +1 -0
- package/dist/add-new-page-LBHXICXO.js +1 -0
- package/dist/ai-block-floating-prompt-input-ESY5GQLZ.js +1 -0
- package/dist/ai-panel-content-62I6FDQF.css +1 -0
- package/dist/ai-panel-content-UZJZ463W.js +1 -0
- package/dist/ai-panel-default-lang-2ZXZYQRT.js +6 -0
- package/dist/ai-panel-default-lang-ETFOFFEF.css +1 -0
- package/dist/ai-panel-for-image-LADQP6VY.js +1 -0
- package/dist/ai-panel-other-lang-WDLC3M2M.js +1 -0
- package/dist/ai-panel-page-chat-7ZISZWY4.js +4 -0
- package/dist/ai-panel-page-chat-N4YFJGAM.css +1 -0
- package/dist/ai-prompt-input-CPT5ETQ4.js +1 -0
- package/dist/ai-theme-generator-7PS4BX52.js +1 -0
- package/dist/ai-translation-prompt-3VE2ECGR.js +1 -0
- package/dist/blocks-CMvgDlxw.d.ts +72 -0
- package/dist/blocks-CP-Pngaz.d.cts +72 -0
- package/dist/build-config-CCERdThN.d.ts +80 -0
- package/dist/build-config-DrerOPd9.d.cts +80 -0
- package/dist/builder.cjs +243 -0
- package/dist/builder.css +1 -0
- package/dist/builder.d.cts +352 -0
- package/dist/builder.d.ts +352 -0
- package/dist/builder.js +1 -0
- package/dist/chaibuilder-instance-DNz3Q-dY.d.cts +579 -0
- package/dist/chaibuilder-instance-qroszVwI.d.ts +579 -0
- package/dist/change-password-modal-NJL7ZLTY.js +1 -0
- package/dist/chunk-2AFM6557.js +3 -0
- package/dist/chunk-2N4IJZOR.js +1 -0
- package/dist/chunk-2NYUIXUX.js +1 -0
- package/dist/chunk-2PJZUYIZ.js +1 -0
- package/dist/chunk-32HH35VD.js +1 -0
- package/dist/chunk-346H4FEX.js +1 -0
- package/dist/chunk-34HIOUTE.js +1 -0
- package/dist/chunk-374QEK4F.js +1 -0
- package/dist/chunk-3E72DJSP.js +1 -0
- package/dist/chunk-3IT7IIAV.js +1 -0
- package/dist/chunk-3UEPBBE4.js +11 -0
- package/dist/chunk-3XSKJBPH.js +1 -0
- package/dist/chunk-45ELAD2J.js +1 -0
- package/dist/chunk-4JBHWPMO.js +1 -0
- package/dist/chunk-4P25MV5E.js +1 -0
- package/dist/chunk-4PQNBY3V.js +1 -0
- package/dist/chunk-4VNLL2IA.js +1 -0
- package/dist/chunk-55SU3QPU.js +1 -0
- package/dist/chunk-5ZC65NB6.js +1 -0
- package/dist/chunk-6M7V7BOM.js +1 -0
- package/dist/chunk-6TXCHU4K.js +1 -0
- package/dist/chunk-777N6WHB.js +1 -0
- package/dist/chunk-7C4EQOAR.js +12 -0
- package/dist/chunk-7EXZXKW2.js +1 -0
- package/dist/chunk-7QWMLDCG.js +1 -0
- package/dist/chunk-AOJE5WI3.js +1 -0
- package/dist/chunk-ATLMLDBS.js +1 -0
- package/dist/chunk-AVGF3YLU.js +17 -0
- package/dist/chunk-BQSLQHLD.js +1 -0
- package/dist/chunk-BWORNCTE.js +1 -0
- package/dist/chunk-BYGD5CDT.js +1 -0
- package/dist/chunk-CA5PVX24.js +1 -0
- package/dist/chunk-CFNOB42V.js +1 -0
- package/dist/chunk-CJP3BQH2.js +1 -0
- package/dist/chunk-CRJENCPR.js +1 -0
- package/dist/chunk-D5SKCKSB.js +1 -0
- package/dist/chunk-DZ72OHTD.js +1 -0
- package/dist/chunk-EPGOG22Q.js +0 -0
- package/dist/chunk-ERCY63ZW.js +1 -0
- package/dist/chunk-ESCX7KEH.js +1 -0
- package/dist/chunk-F2V4N3LT.js +156 -0
- package/dist/chunk-F7YMHPEA.js +1 -0
- package/dist/chunk-FERH2TPR.js +1 -0
- package/dist/chunk-FLSV2QGU.js +1 -0
- package/dist/chunk-FOKGOT6B.js +1 -0
- package/dist/chunk-GJOOCKUE.js +1 -0
- package/dist/chunk-HA7LF3RV.js +1 -0
- package/dist/chunk-HAKJOMCL.js +1 -0
- package/dist/chunk-HEKCKC7N.js +1 -0
- package/dist/chunk-HELRVKD2.js +3 -0
- package/dist/chunk-I7ODKVVX.js +1 -0
- package/dist/chunk-IAKCX2WB.js +1 -0
- package/dist/chunk-IB2C3TWH.js +1 -0
- package/dist/chunk-IH562KSP.js +1 -0
- package/dist/chunk-IP4JBQOX.js +1 -0
- package/dist/chunk-ITX7QWN6.js +1 -0
- package/dist/chunk-IUACZ3E6.js +6 -0
- package/dist/chunk-J7Q62EP7.js +1 -0
- package/dist/chunk-JBB5IJFA.js +1 -0
- package/dist/chunk-JPJRO4NU.js +1 -0
- package/dist/chunk-JUIS55JT.js +1 -0
- package/dist/chunk-JYBTQ3YX.js +5 -0
- package/dist/chunk-K5YWQY4U.js +1 -0
- package/dist/chunk-K6RHR4HT.js +1 -0
- package/dist/chunk-LNV5MRGV.js +1 -0
- package/dist/chunk-LRJREWRD.js +1 -0
- package/dist/chunk-LWYDGDPW.js +1 -0
- package/dist/chunk-MDMGXS5B.js +1 -0
- package/dist/chunk-MEROMQQX.js +1 -0
- package/dist/chunk-N7Z4RFFI.js +1 -0
- package/dist/chunk-NSQEQYEM.js +1 -0
- package/dist/chunk-OD3K76M6.js +1 -0
- package/dist/chunk-ODSL3KXG.js +1 -0
- package/dist/chunk-OJJDRACB.js +1 -0
- package/dist/chunk-ONSZ462E.js +1 -0
- package/dist/chunk-OQZ4EPOM.js +1 -0
- package/dist/chunk-OR7KKUYT.js +1 -0
- package/dist/chunk-OSGXFZTA.js +1 -0
- package/dist/chunk-PM3JNOZH.js +1 -0
- package/dist/chunk-PQHFT4TE.js +1 -0
- package/dist/chunk-QGVCH2NI.js +1 -0
- package/dist/chunk-QIGSSVEY.js +1 -0
- package/dist/chunk-R5ZTCDFD.js +1 -0
- package/dist/chunk-RBDZDQZR.js +1 -0
- package/dist/chunk-ROQRBSK6.js +1 -0
- package/dist/chunk-SSENH35Y.js +1 -0
- package/dist/chunk-SYPALJAE.js +1 -0
- package/dist/chunk-T2YYNX6Z.js +1 -0
- package/dist/chunk-T32TW3XV.js +1 -0
- package/dist/chunk-T56KQBE2.js +1 -0
- package/dist/chunk-TEL5ACJE.js +1 -0
- package/dist/chunk-TGJQC6VC.js +1 -0
- package/dist/chunk-TQ34DGOT.js +1 -0
- package/dist/chunk-TVF77C53.js +1 -0
- package/dist/chunk-UIDBBTCZ.js +3 -0
- package/dist/chunk-VKSRWZCO.js +1 -0
- package/dist/chunk-VL5WBPVV.js +1 -0
- package/dist/chunk-VUWHFLT7.js +22 -0
- package/dist/chunk-WEVKAJMV.js +1 -0
- package/dist/chunk-WHPIYGCY.js +1 -0
- package/dist/chunk-WNESLH23.js +1 -0
- package/dist/chunk-WOT6VMZA.js +1 -0
- package/dist/chunk-WSQ5SQBD.js +1 -0
- package/dist/chunk-XY4UJKHE.js +1 -0
- package/dist/chunk-Y2BHO7OO.js +1 -0
- package/dist/chunk-YDOQEFOK.js +1 -0
- package/dist/chunk-YEFMD4DS.js +1 -0
- package/dist/chunk-YQ5QQCRD.js +1 -0
- package/dist/chunk-YQPOFRXU.js +1 -0
- package/dist/chunk-YTPQSO7V.js +801 -0
- package/dist/chunk-ZAU65LBG.js +1 -0
- package/dist/chunk-ZRFCEMYU.js +1 -0
- package/dist/chunk-ZU2B5YT6.js +1 -0
- package/dist/chunk-ZXKKBKGV.js +1 -0
- package/dist/code-display-7346IUCO.js +1 -0
- package/dist/code-editor-UBGTTX2L.js +1 -0
- package/dist/components/ui/accordion.cjs +1 -0
- package/dist/components/ui/accordion.d.cts +9 -0
- package/dist/components/ui/accordion.d.ts +9 -0
- package/dist/components/ui/accordion.js +1 -0
- package/dist/components/ui/alert-dialog.cjs +1 -0
- package/dist/components/ui/alert-dialog.d.cts +23 -0
- package/dist/components/ui/alert-dialog.d.ts +23 -0
- package/dist/components/ui/alert-dialog.js +1 -0
- package/dist/components/ui/alert.cjs +1 -0
- package/dist/components/ui/alert.d.cts +11 -0
- package/dist/components/ui/alert.d.ts +11 -0
- package/dist/components/ui/alert.js +1 -0
- package/dist/components/ui/avatar.cjs +1 -0
- package/dist/components/ui/avatar.d.cts +8 -0
- package/dist/components/ui/avatar.d.ts +8 -0
- package/dist/components/ui/avatar.js +1 -0
- package/dist/components/ui/badge.cjs +1 -0
- package/dist/components/ui/badge.d.cts +13 -0
- package/dist/components/ui/badge.d.ts +13 -0
- package/dist/components/ui/badge.js +1 -0
- package/dist/components/ui/button.cjs +1 -0
- package/dist/components/ui/button.d.cts +15 -0
- package/dist/components/ui/button.d.ts +15 -0
- package/dist/components/ui/button.js +1 -0
- package/dist/components/ui/card.cjs +1 -0
- package/dist/components/ui/card.d.cts +10 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/card.js +1 -0
- package/dist/components/ui/checkbox.cjs +1 -0
- package/dist/components/ui/checkbox.d.cts +6 -0
- package/dist/components/ui/checkbox.d.ts +6 -0
- package/dist/components/ui/checkbox.js +1 -0
- package/dist/components/ui/command.cjs +1 -0
- package/dist/components/ui/command.d.cts +83 -0
- package/dist/components/ui/command.d.ts +83 -0
- package/dist/components/ui/command.js +1 -0
- package/dist/components/ui/context-menu.cjs +1 -0
- package/dist/components/ui/context-menu.d.cts +30 -0
- package/dist/components/ui/context-menu.d.ts +30 -0
- package/dist/components/ui/context-menu.js +1 -0
- package/dist/components/ui/dialog.cjs +1 -0
- package/dist/components/ui/dialog.d.cts +22 -0
- package/dist/components/ui/dialog.d.ts +22 -0
- package/dist/components/ui/dialog.js +1 -0
- package/dist/components/ui/dropdown-menu.cjs +1 -0
- package/dist/components/ui/dropdown-menu.d.cts +30 -0
- package/dist/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/components/ui/dropdown-menu.js +1 -0
- package/dist/components/ui/hover-card.cjs +1 -0
- package/dist/components/ui/hover-card.d.cts +8 -0
- package/dist/components/ui/hover-card.d.ts +8 -0
- package/dist/components/ui/hover-card.js +1 -0
- package/dist/components/ui/input.cjs +1 -0
- package/dist/components/ui/input.d.cts +5 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +1 -0
- package/dist/components/ui/label.cjs +1 -0
- package/dist/components/ui/label.d.cts +8 -0
- package/dist/components/ui/label.d.ts +8 -0
- package/dist/components/ui/label.js +1 -0
- package/dist/components/ui/loader.cjs +1 -0
- package/dist/components/ui/loader.d.cts +12 -0
- package/dist/components/ui/loader.d.ts +12 -0
- package/dist/components/ui/loader.js +1 -0
- package/dist/components/ui/navigation-menu.cjs +1 -0
- package/dist/components/ui/navigation-menu.d.cts +15 -0
- package/dist/components/ui/navigation-menu.d.ts +15 -0
- package/dist/components/ui/navigation-menu.js +1 -0
- package/dist/components/ui/popover.cjs +1 -0
- package/dist/components/ui/popover.d.cts +9 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/popover.js +1 -0
- package/dist/components/ui/progress.cjs +1 -0
- package/dist/components/ui/progress.d.cts +8 -0
- package/dist/components/ui/progress.d.ts +8 -0
- package/dist/components/ui/progress.js +1 -0
- package/dist/components/ui/scroll-area.cjs +1 -0
- package/dist/components/ui/scroll-area.d.cts +7 -0
- package/dist/components/ui/scroll-area.d.ts +7 -0
- package/dist/components/ui/scroll-area.js +1 -0
- package/dist/components/ui/select.cjs +1 -0
- package/dist/components/ui/select.d.cts +15 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/select.js +1 -0
- package/dist/components/ui/separator.cjs +1 -0
- package/dist/components/ui/separator.d.cts +6 -0
- package/dist/components/ui/separator.d.ts +6 -0
- package/dist/components/ui/separator.js +1 -0
- package/dist/components/ui/sheet.cjs +1 -0
- package/dist/components/ui/sheet.d.cts +29 -0
- package/dist/components/ui/sheet.d.ts +29 -0
- package/dist/components/ui/sheet.js +1 -0
- package/dist/components/ui/skeleton.cjs +1 -0
- package/dist/components/ui/skeleton.d.cts +5 -0
- package/dist/components/ui/skeleton.d.ts +5 -0
- package/dist/components/ui/skeleton.js +1 -0
- package/dist/components/ui/slider.cjs +1 -0
- package/dist/components/ui/slider.d.cts +6 -0
- package/dist/components/ui/slider.d.ts +6 -0
- package/dist/components/ui/slider.js +1 -0
- package/dist/components/ui/switch.cjs +1 -0
- package/dist/components/ui/switch.d.cts +9 -0
- package/dist/components/ui/switch.d.ts +9 -0
- package/dist/components/ui/switch.js +1 -0
- package/dist/components/ui/tabs.cjs +1 -0
- package/dist/components/ui/tabs.d.cts +9 -0
- package/dist/components/ui/tabs.d.ts +9 -0
- package/dist/components/ui/tabs.js +1 -0
- package/dist/components/ui/textarea.cjs +1 -0
- package/dist/components/ui/textarea.d.cts +5 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +1 -0
- package/dist/components/ui/toggle.cjs +1 -0
- package/dist/components/ui/toggle.d.cts +15 -0
- package/dist/components/ui/toggle.d.ts +15 -0
- package/dist/components/ui/toggle.js +1 -0
- package/dist/components/ui/tooltip.cjs +1 -0
- package/dist/components/ui/tooltip.d.cts +9 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.js +1 -0
- package/dist/config-registry-RSJCAKY5.js +1 -0
- package/dist/continue-editing-in-this-client-QBMOFRLL.js +1 -0
- package/dist/core-BNe4bA6z.d.cts +5455 -0
- package/dist/core-BNe4bA6z.d.ts +5455 -0
- package/dist/css-import-modal-NMFRQGCY.js +13 -0
- package/dist/db/better-sqlite3.cjs +1 -0
- package/dist/db/better-sqlite3.d.cts +16 -0
- package/dist/db/better-sqlite3.d.ts +16 -0
- package/dist/db/better-sqlite3.js +1 -0
- package/dist/db/d1.cjs +1 -0
- package/dist/db/d1.d.cts +17 -0
- package/dist/db/d1.d.ts +17 -0
- package/dist/db/d1.js +1 -0
- package/dist/db/libsql.cjs +1 -0
- package/dist/db/libsql.d.cts +23 -0
- package/dist/db/libsql.d.ts +23 -0
- package/dist/db/libsql.js +1 -0
- package/dist/db/node-pg.cjs +1 -0
- package/dist/db/node-pg.d.cts +21 -0
- package/dist/db/node-pg.d.ts +21 -0
- package/dist/db/node-pg.js +1 -0
- package/dist/db/postgres.cjs +1 -0
- package/dist/db/postgres.d.cts +28 -0
- package/dist/db/postgres.d.ts +28 -0
- package/dist/db/postgres.js +1 -0
- package/dist/delete-page-CGR6VXZC.css +1 -0
- package/dist/delete-page-FQYTEMBN.js +1 -0
- package/dist/digital-asset-manager-PIZMJEMX.js +1 -0
- package/dist/digital-asset-manager-PSTDGMY2.css +1 -0
- package/dist/dispatch-action-3IV56BNY.js +1 -0
- package/dist/duplicate-page-HPPMQRL3.js +1 -0
- package/dist/dynamic-page-selector-LFHJQLYY.js +1 -0
- package/dist/dynamic-page-selector-SXJQAIGL.css +1 -0
- package/dist/edit-url-panel-Q3NJCV55.js +1 -0
- package/dist/get-blocks-styles-SLZ5NDUF.js +1 -0
- package/dist/get-page-styles-Q4FWW5LX.js +1 -0
- package/dist/image-editor-PLXDYVKE.css +1 -0
- package/dist/image-editor-RSEHWRGV.js +1 -0
- package/dist/json-diff-viewer-FQYK2FUX.js +8 -0
- package/dist/lang-panel-57UGEL6B.css +1 -0
- package/dist/lang-panel-HH5LEOF4.js +1 -0
- package/dist/license-overlay-4Q525E53.js +1 -0
- package/dist/log-ai-request-LHPKU2C5.js +1 -0
- package/dist/manage-design-tokens-264H25A2.js +1 -0
- package/dist/manage-design-tokens-modal-OIWIZ53K.js +1 -0
- package/dist/mark-as-template-7TCCEMGC.js +1 -0
- package/dist/nested-path-selector-content-N4XN7QUS.js +1 -0
- package/dist/nextjs/render-client.cjs +1 -0
- package/dist/nextjs/render-client.css +1 -0
- package/dist/nextjs/render-client.d.cts +14 -0
- package/dist/nextjs/render-client.d.ts +14 -0
- package/dist/nextjs/render-client.js +1 -0
- package/dist/nextjs/render.cjs +829 -0
- package/dist/nextjs/render.d.cts +78 -0
- package/dist/nextjs/render.d.ts +78 -0
- package/dist/nextjs/render.js +1 -0
- package/dist/nextjs/server.cjs +807 -0
- package/dist/nextjs/server.d.cts +329 -0
- package/dist/nextjs/server.d.ts +329 -0
- package/dist/nextjs/server.js +1 -0
- package/dist/nextjs.cjs +1 -0
- package/dist/nextjs.d.cts +17 -0
- package/dist/nextjs.d.ts +17 -0
- package/dist/nextjs.js +1 -0
- package/dist/no-language-page-content-NQIROTIL.js +1 -0
- package/dist/no-language-page-dialog-CWG5PI7N.js +1 -0
- package/dist/page-creator-2L6L6EFV.js +1 -0
- package/dist/page-lock-7HMG34UJ.js +1 -0
- package/dist/page-locked-dialog-ACMWVAZX.js +1 -0
- package/dist/page-manager-new-SCZFNGKO.js +1 -0
- package/dist/page-manager-new-VWRASZTI.css +1 -0
- package/dist/page-manager-search-and-filter-7CHPYAPV.js +1 -0
- package/dist/page-manager-sheet-KZZBKQ6M.js +1 -0
- package/dist/page-manager-sheet-U5YEB5CS.css +1 -0
- package/dist/page-revisions-content-DHPEQ4CA.js +1 -0
- package/dist/page-revisions-trigger-XGC4HOTL.js +1 -0
- package/dist/pages-DlMX1Lj2.d.cts +21 -0
- package/dist/pages-Dol4CXrN.d.ts +21 -0
- package/dist/payload/builder.cjs +243 -0
- package/dist/payload/builder.css +1 -0
- package/dist/payload/builder.d.cts +13 -0
- package/dist/payload/builder.d.ts +13 -0
- package/dist/payload/builder.js +1 -0
- package/dist/payload.cjs +807 -0
- package/dist/payload.d.cts +603 -0
- package/dist/payload.d.ts +603 -0
- package/dist/payload.js +1 -0
- package/dist/preview-banner-SDDZGGRW.js +1 -0
- package/dist/publish-pages-content-3AZ45DYH.js +1 -0
- package/dist/registry.cjs +11 -0
- package/dist/registry.d.cts +74 -0
- package/dist/registry.d.ts +74 -0
- package/dist/registry.js +1 -0
- package/dist/relations-DDBTFCMR.js +1 -0
- package/dist/revalidate-G2DEOH4Z.js +1 -0
- package/dist/rte-widget-modal-7RXFEYHK.js +1 -0
- package/dist/save-to-lib-65EGTZE5.js +1 -0
- package/dist/schema-IVNMPI4V.js +1 -0
- package/dist/schema.sqlite-CYBLikNv.d.cts +5852 -0
- package/dist/schema.sqlite-CYBLikNv.d.ts +5852 -0
- package/dist/seo-panel-WQ47FNP4.css +1 -0
- package/dist/seo-panel-Z6OBXHQ4.js +2 -0
- package/dist/server-config-b29G6_aQ.d.cts +116 -0
- package/dist/server-config-oPlt3V1X.d.ts +116 -0
- package/dist/state-RAP56WXS.js +1 -0
- package/dist/take-over-request-EB464ZGU.js +1 -0
- package/dist/translation-warning-modal-EES6I2QV.js +1 -0
- package/dist/types.cjs +1 -0
- package/dist/types.d.cts +38 -0
- package/dist/types.d.ts +38 -0
- package/dist/types.js +1 -0
- package/dist/unmark-as-template-6STMTBP5.js +1 -0
- package/dist/unpublish-page-CE3CJK5C.js +1 -0
- package/dist/unpublished-partials-modal-OZBWBCLN.js +1 -0
- package/dist/utils.cjs +1 -0
- package/dist/utils.d.cts +168 -0
- package/dist/utils.d.ts +168 -0
- package/dist/utils.js +1 -0
- package/dist/web-blocks.cjs +1 -0
- package/dist/web-blocks.d.cts +3 -0
- package/dist/web-blocks.d.ts +3 -0
- package/dist/web-blocks.js +1 -0
- package/dist/web-preview-EIWOXGPY.js +1 -0
- package/package.json +322 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as jt}from"./chunk-CRJENCPR.js";import{b as Gt}from"./chunk-ITX7QWN6.js";import{a as F}from"./chunk-VKSRWZCO.js";import{f as X}from"./chunk-3UEPBBE4.js";import{compact as _s,get as Nt,map as Es,memoize as Rs,omit as vs}from"lodash-es";import{useCallback as Is}from"react";import{useAtom as Cs}from"jotai";import{each as He,first as Ue,keys as Ne,map as D}from"lodash-es";import{atom as v}from"jotai";import{selectAtom as Xt,splitAtom as je}from"jotai/utils";import{filter as qe,has as Ke,isEqual as ze,pick as Xe}from"lodash-es";import{filter as Pt,find as We,flatten as pt,has as Ge}from"lodash-es";var qt=t=>{let e=new Map;return t.forEach(o=>{if(!Ge(o,"_id"))return;let r=o._parent||null,n=e.get(r);n||(n=[],e.set(r,n)),n.push({_id:o._id,_type:o._type})}),e},Kt=(t,e)=>{if(t===e)return!0;if(t.size!==e.size)return!1;for(let[o,r]of t){let n=e.get(o);if(!n||n.length!==r.length)return!1;for(let s=0;s<r.length;s++)if(r[s]._id!==n[s]._id||r[s]._type!==n[s]._type)return!1}return!0};function zt(t,e,o){let r=Pt(t,s=>s._parent===e),n=[];for(let s=0;s<r.length;s++)if(Pt(t,{_parent:r[s]._id}).length>0){let a=F();n.push({...r[s],oldId:r[s]._id,_id:a,_parent:o}),n.push(pt(zt(t,r[s]._id,a)))}else n.push({...r[s],oldId:r[s]._id,_id:F(),_parent:o});return pt(n)}function ft(t){let e={};t.forEach(r=>{e[r._id]={...r,children:[]}});let o=[];return t.forEach(r=>{if(r._parent){let n=e[r._parent];n&&n.children.push(e[r._id])}else o.push(e[r._id])}),o}var Ds=(t,e,o=null)=>{let r=We(t,{_id:e});r={...r,oldId:r._id,_id:F()},o!==(r==null?void 0:r._parent)&&(r={...r,_parent:o});let n=[r];return Pt(t,{_parent:e}).length>0&&n.push(pt(zt(t,e,r._id))),pt(n)};var y=v([]);y.debugLabel="presentBlocksAtom";var Je=["_id","_parent","_type","_name","tag","_show","_libBlockId"],Jt=Xt(y,t=>t.map(e=>Xe(e,Je)),(t,e)=>t.length===e.length&&t.every((o,r)=>ze(o,e[r])));Jt.debugLabel="outlineBlocksAtom";var Ye=v(t=>ft(t(Jt)));Ye.debugLabel="treeDSBlocks";var gt=je(y);gt.debugLabel="pageBlocksAtomsAtom";var ht=v(t=>{let e=t(y),o=t(gt),r=new Map;return e.forEach((n,s)=>r.set(n._id,o[s])),r});ht.debugLabel="blockAtomsMapAtom";var Ze=Xt(y,qt,Kt);Ze.debugLabel="blockChildrenMapAtom";var Qe=v(t=>t(y).length>0);Qe.debugLabel="hasPageBlocksAtom";var tr=v("");tr.debugLabel="builderActivePageAtom";var er=v(-1);er.debugLabel="destinationDropIndexAtom";var Yt=v([]);Yt.debugLabel="buildingBlocksAtom";var rr=v(t=>{let e=t(Yt);return qe(e,o=>Ke(o,"blockId"))});rr.debugLabel="globalBlocksAtom";var $=v([]);$.debugLabel="structureErrorsAtom";var Z=v(!0);Z.debugLabel="structureValidationValidAtom";var Q=v(!1);Q.debugLabel="hasStructureErrorsAtom";var tt=v(!1);tt.debugLabel="hasStructureWarningsAtom";var or=v(t=>t($).filter(o=>o.severity==="error").length);or.debugLabel="structureErrorCountAtom";var sr=v(t=>t($).filter(o=>o.severity==="warning").length);sr.debugLabel="structureWarningCountAtom";var nr=v(t=>{let e=t($),o={};return e.forEach(r=>{r.blockId&&(o[r.blockId]||(o[r.blockId]=[]),o[r.blockId].push(r))}),o});nr.debugLabel="structureErrorsByBlockAtom";import{getDefaultStore as ar}from"jotai";var L=ar(),Gs=()=>L.get(y);import{atom as _t}from"jotai";var Ks=_t(null),zs=_t({isVisible:!1,isValid:!1,position:"inside",placeholderOrientation:"horizontal",isEmpty:!1,top:0,left:0,width:0,height:0}),ir=!1,Xs=t=>{ir=t},Zt=_t(0);import{useSetAtom as ps}from"jotai";import{each as fs,find as gs,omit as hs}from"lodash-es";import{useAtom as qo,useSetAtom as Pe}from"jotai";import{useCallback as Ko,useEffect as zo}from"react";import{atom as M,useAtomValue as Wr}from"jotai";import{useMemo as ue}from"react";import{useAtomValue as lr}from"jotai";import{get as cr}from"lodash-es";import{useMemo as ur}from"react";var h=(t,e)=>{let o=lr(Et);return ur(()=>cr(o,t,e),[o,t,e])};import{isObject as ae}from"@rjsf/utils";import{atom as Vr,useAtom as Or,useSetAtom as Hr}from"jotai";import{get as rt,isFunction as ie,pick as Ur,startsWith as Nr,values as Fr}from"lodash-es";import{useEffect as Tt,useRef as le,useState as $r}from"react";import{chunk as _r,forEach as Er,get as re,includes as Rr,isEmpty as vr,isString as Ir,keys as oe,omit as Lr,set as Tr,unset as wr}from"lodash-es";import{useCallback as Bt}from"react";import{atom as dr,useAtom as mr}from"jotai";var Qt=dr("");Qt.debugLabel="selectedLanguageAtom";var et=()=>{let t=h("languages",[]),e=h("fallbackLang","en"),[o,r]=mr(Qt),n=s=>{r(e===s?"":s)};return{languages:t==null?void 0:t.filter(s=>s!==e),fallbackLang:e,selectedLang:o,setSelectedLang:n}};import{atom as U,useAtom as pr,useAtomValue as te}from"jotai";import{atomWithStorage as fr}from"jotai/utils";import{compact as vt,get as gr,includes as hr,map as Rt,without as kr}from"lodash-es";import{useCallback as Br}from"react";var It=U([]);It.debugLabel="selectedBlockIdsAtom";var kt=U(t=>{let e=t(y),o={};return e.forEach(r=>{o[r._id]=r}),o});kt.debugLabel="blocksByIdAtom";var Lt=U(t=>{let e=t(kt),o=t(It);return vt(Rt(o,r=>e[r]))});Lt.debugLabel="selectedBlocksAtom";var J=U(t=>{let e=t(Lt);if(e.length!==0&&e.length===1)return e[0]});J.debugLabel="selectedBlockAtom";var dn=()=>te(J),Ar=t=>gr(t,"_parent",null),br=U(t=>{let e=t(Lt),o=t(kt),r=[...new Set(Rt(e,Ar))];return vt(Rt(r,n=>n?o[n]:void 0))});br.debugLabel="selectedBlocksParentsAtom";var yr=U(()=>!1);yr.debugLabel="selectedBlockFlexChildAtom";var Cr=U(()=>!1);Cr.debugLabel="selectedBlockGridChildAtom";var Sr=U("");Sr.debugLabel="styleStateAtom";var xr=fr("styleBreakpoint","xs");xr.debugLabel="styleBreakpointAtom";var Pr=U(t=>{let e=t(J),o=t(kt),r=e,n=[e];do{let s=r!=null&&r._parent?o[r._parent]:void 0;r=s,s&&n.push(s)}while(r!=null&&r._parent);return n}),mn=()=>vt(te(Pr)),ee=()=>{let[t,e]=pr(It),o=Br(r=>{e(n=>hr(n,r)?kr(n,r):[...n,r])},[e]);return[t,e,o]};var se=(t,e,o)=>{let r=X(re(o,"_type",""));if(!r)return t;let n={...t};return Er(oe(t),s=>{if(Rr(re(r,"i18nProps",[]),s)&&!vr(e)){let a=`${s}-${e}`;Tr(n,a,t[s]),wr(n,s)}}),n},yn=()=>{let{updateBlocks:t}=K(),{selectedLang:e}=et();return Bt((o,r,n)=>{let s=L.get(J),a=se(r,e,s);t(o,a,n)},[e,t])};var Dr=()=>{let{updateBlocksRuntime:t}=K();return Bt(async(e,o,r=30)=>{let n=oe(Lr(o,["_id"]));for(let s of n){let a=o[s];if(Ir(a)){let c=_r(a.split(""),12),l="";t([e],{[s]:""});for(let i=0;i<c.length;i++)l+=c[i].join(""),t([e],{[s]:l}),await new Promise(u=>setTimeout(u,r))}}},[t])},Cn=()=>{let{updateMultipleBlocksProps:t}=K(),e=Dr();return Bt(async o=>{for(let r of o)await e(r._id,r);t(o)},[e,t])},ne=()=>{let{updateBlocksRuntime:t}=K(),{selectedLang:e}=et();return Bt((o,r)=>{let n=L.get(J),s=se(r,e,n);t(o,s)},[e,t])};var wt=Vr({});wt.debugLabel="blockRepeaterDataAtom";var ce=()=>Or(wt),Ln=(t,e,o,r)=>{let n=ne(),s=h("getBlockAsyncProps",async d=>({})),a=Hr(wt),c=JSON.stringify([t==null?void 0:t._id,...Fr(Ur(t,o!=null?o:[]))]),l=(t==null?void 0:t._type)==="Repeater"&&Nr(t.repeaterItems,`{{${"#"}`),i=(t==null?void 0:t._type)!=="Repeater"&&e==="live",u=e==="mock"&&ie(r)||e==="live"&&(l||i),[m,k]=$r({status:u?"loading":"idle",props:{},error:void 0}),g=le(t);Tt(()=>{g.current=t},[t]);let _=le(n);return Tt(()=>{_.current=n},[n]),Tt(()=>{if(e==="mock"){ie(r)&&Promise.resolve().then(()=>{let d=r({block:g.current});if(!ae(d))throw new Error("mockDataProvider should return an object");k({status:"loaded",props:d})});return}e==="live"&&(!l&&!i||s({block:g.current}).then((d={})=>{l?(a(f=>({...f,[g.current._id]:{status:"loaded",props:rt(d,"items",[]),repeaterItems:g.current.repeaterItems}})),k({status:"loaded",props:{totalItems:rt(d,"totalItems")}}),_.current([g.current._id],{totalItems:rt(d,"totalItems")})):k({status:"loaded",props:ae(d)?d:{}})}).catch(d=>{l?(a(f=>({...f,[g.current._id]:{status:"error",error:d,props:[]}})),k({status:"error",error:d,props:{}})):k({status:"error",error:d,props:{}})}))},[c,l,i,r,e,s,a]),{$loading:rt(m,"status")==="loading",...t?rt(m,"props",{}):{}}};var Et=M(null);Et.debugLabel="chaiBuilderPropsAtom";var Gr=M({});Gr.debugLabel="chaiExternalDataAtom";var jr=M({});jr.debugLabel="chaiRjsfFieldsAtom";var qr=M({});qr.debugLabel="chaiRjsfWidgetsAtom";var Kr=M({});Kr.debugLabel="chaiRjsfTemplatesAtom";var de=M({});de.debugLabel="chaiPageExternalDataAtom";var zr=M({});zr.debugLabel="chaiDesignTokensAtom";var Vn=()=>{let[t]=ce(),e=ue(()=>{let r={};return Object.entries(t).forEach(([n,s])=>{s.status==="loaded"&&s.repeaterItems&&(r[s.repeaterItems.replace("}}",`/${n}`).replace("{{","")]=s.props)}),r},[t]),o=Wr(de);return ue(()=>({...o,...e}),[o,e])},ot=M(0),On=M({isOpen:!1,blockId:null}),Hn=M({isOpen:!1,blockId:null});import{useThrottledCallback as Ho}from"@react-hookz/web";import{atom as Uo,useAtom as No,useAtomValue as Ce,useSetAtom as ct}from"jotai";import{compact as Fo,has as $o,isEmpty as Wo,noop as Go}from"lodash-es";import{useCallback as Ht}from"react";import{atom as P}from"jotai";import{atomWithStorage as Dt}from"jotai/utils";var Xr=P(!1);Xr.debugLabel="readOnlyModeAtom";var Jr=P("online");Jr.debugLabel="networkModeAtom";var Wn=P(""),Yr=P(!1);Yr.debugLabel="editLayerNameAtom";var Zr=P("");Zr.debugLabel="activeLanguageAtom";var Qr=P("");Qr.debugLabel="primaryLanguageAtom";var st=P(null);st.debugLabel="canvasIframeAtom";var to=P("outline");to.debugLabel="activePanelAtom";var eo=P("");eo.debugLabel="showPredefinedBlockCategoryAtom";var ro=P(!1);ro.debugLabel="draggingFlagAtom";var oo=P(null);oo.debugLabel="treeRefAtom";var so=P({});so.debugLabel="canvasSettingsAtom";var no=P(!1);no.debugLabel="aiAssistantActiveAtom";var ao=P(!1);ao.debugLabel="codeEditorOpenAtom";var io=Dt("codeEditorHeight",500);io.debugLabel="codeEditorHeightAtom";var lo=P([]);lo.debugLabel="xShowBlocksAtom";var co=Dt("_selectedLibrary",null);co.debugLabel="selectedLibraryAtom";var uo=P(!0);uo.debugLabel="dataBindingActiveAtom";var Gn=Dt("chai-builder-theme",Gt);import{useDebouncedCallback as fo}from"@react-hookz/web";import{useAtomValue as go,useSetAtom as At}from"jotai";import{useCallback as ho}from"react";var T=t=>{let e=t.closest('[data-block-type="PartialBlock"]');return(e==null?void 0:e.getAttribute("data-block-id"))||void 0},mo=[{name:"no-nested-div-in-p",description:"Prevents div elements from being nested inside paragraph elements",validate:t=>{let e=[];return t.querySelectorAll('p [data-block-type="Box"]').forEach(r=>{let n=r.getAttribute("data-block-id");n&&e.push({id:`div-in-paragraph-${n}`,message:"Box (div) cannot be nested inside Paragraph elements",severity:"error",blockId:n,partialBlockId:T(r)})}),e}},{name:"no-interactive-nesting",description:"Prevents interactive elements (links, buttons with href) from being nested inside other interactive elements",validate:t=>{let e=[];return t.querySelectorAll('[data-block-type="Link"] [data-block-type="Link"]').forEach(n=>{let s=n.getAttribute("data-block-id");s&&e.push({id:`nested-interactive-link-${s}`,message:"Link cannot be nested inside another interactive element (link or button with link)",severity:"error",blockId:s,partialBlockId:T(n)})}),t.querySelectorAll('button [data-block-type="Link"]').forEach(n=>{let s=n.getAttribute("data-block-id");s&&e.push({id:`nested-interactive-link-in-button-${s}`,message:"Link cannot be nested inside another interactive element (link or button with link)",severity:"error",blockId:s,partialBlockId:T(n)})}),e}},{name:"listitem-in-list",description:"Ensures ListItems are only inside List containers",validate:t=>{let e=[];return t.querySelectorAll('li[data-block-type="ListItem"]').forEach(r=>{if(!r.closest("ul, ol")){let s=r.getAttribute("data-block-id");s&&e.push({id:`listitem-outside-list-${s}`,message:"List Item must be inside a List container",severity:"error",blockId:s,partialBlockId:T(r)})}}),e}},{name:"table-cell-structure",description:"Validates proper table hierarchy (TableCell -> TableRow -> TableHead/Body -> Table)",validate:t=>{let e=[];return t.querySelectorAll('td[data-block-type="TableCell"], th[data-block-type="TableCell"]').forEach(s=>{let a=s.closest("tr")!==null,c=s.closest("thead, tbody")!==null,l=s.closest("table")!==null;if(!a||!c||!l){let i=s.getAttribute("data-block-id");i&&e.push({id:`table-cell-structure-${i}`,message:"Table Cell must be inside a Table Row, which must be inside Table Head/Body, which must be inside a Table",severity:"error",blockId:i,partialBlockId:T(s)})}}),t.querySelectorAll('tr[data-block-type="TableRow"]').forEach(s=>{if(!(s.closest("table")!==null)){let c=s.getAttribute("data-block-id");c&&e.push({id:`table-row-outside-table-${c}`,message:"Table Row must be inside a Table (Table Head or Table Body)",severity:"error",blockId:c,partialBlockId:T(s)})}}),t.querySelectorAll('thead[data-block-type="TableHead"], tbody[data-block-type="TableBody"]').forEach(s=>{if(!(s.closest("table")!==null)){let c=s.getAttribute("data-block-id");c&&e.push({id:`table-section-outside-table-${c}`,message:"Table Head/Body must be inside a Table",severity:"error",blockId:c,partialBlockId:T(s)})}}),e}},{name:"no-nested-buttons",description:"Prevents buttons from being nested inside other buttons",validate:t=>{let e=[];return t.querySelectorAll('button button[data-block-type="Button"]').forEach(r=>{let n=r.getAttribute("data-block-id");n&&e.push({id:`nested-button-${n}`,message:"Button cannot be nested inside another button",severity:"error",blockId:n,partialBlockId:T(r)})}),e}},{name:"no-nested-forms",description:"Prevents forms from being nested inside other forms",validate:t=>{let e=[];return t.querySelectorAll('[data-block-type="Form"] [data-block-type="Form"]').forEach(r=>{let n=r.getAttribute("data-block-id");n&&e.push({id:`nested-form-${n}`,message:"Form cannot be nested inside another form",severity:"error",blockId:n,partialBlockId:T(r)})}),e}},{name:"no-nested-paragraphs",description:"Prevents paragraph elements from being nested inside other paragraph elements at any level",validate:t=>{let e=[];return t.querySelectorAll('p p[data-block-type="Paragraph"]').forEach(r=>{let n=r.getAttribute("data-block-id");n&&e.push({id:`nested-paragraph-${n}`,message:"Paragraph cannot be nested inside another paragraph",severity:"error",blockId:n,partialBlockId:T(r)})}),e}},{name:"heading-structure",description:"Checks for proper heading hierarchy and warns about skipped levels",validate:t=>{let e=[],o=[];t.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(n=>{if(n.getAttribute("data-block-type")==="Heading"){let a=n.tagName.toLowerCase(),c=parseInt(a.replace("h",""))||2,l=n.getAttribute("data-block-id");l&&o.push({level:c,blockId:l,element:n})}});for(let n=1;n<o.length;n++){let s=o[n],a=o[n-1];s.level>a.level+1&&e.push({id:`heading-level-skip-${s.blockId}`,message:`Heading level skipped: h${a.level} followed by h${s.level}. Consider using h${a.level+1}`,severity:"warning",blockId:s.blockId,partialBlockId:T(s.element)})}return e}}],po=[{name:"image-alt-text",description:"Warns if images are missing alt text",validate:t=>{let e=[];return t.querySelectorAll('img[data-block-type="Image"]').forEach(r=>{let n=r.getAttribute("alt");if(!n||n.trim()===""){let s=r.getAttribute("data-block-id");s&&e.push({id:`image-missing-alt-${s}`,message:"Image should have alt text for accessibility",severity:"warning",blockId:s,partialBlockId:T(r)})}}),e}},{name:"button-accessibility",description:"Ensures buttons have accessible labels",validate:t=>{let e=[];return t.querySelectorAll('button[data-block-type="Button"]').forEach(r=>{let n=r.textContent&&r.textContent.trim()!=="",s=r.children.length>0,a=(()=>{let l=r.getAttribute("aria-label");return l!==null&&l.trim()!==""})(),c=r.hasAttribute("aria-labelledby");if(!n&&!s&&!a&&!c){let l=r.getAttribute("data-block-id");l&&e.push({id:`button-no-label-${l}`,message:"Button should have accessible content (text or icon)",severity:"warning",blockId:l,partialBlockId:T(r)})}}),e}}],Mt=class{constructor(){this.rules=[...mo]}addRule(e){this.rules.push(e)}removeRule(e){let o=this.rules.findIndex(r=>r.name===e);return o>-1?(this.rules.splice(o,1),!0):!1}getRules(){return[...this.rules]}enableAccessibilityRules(){this.rules.push(...po)}getRuleNames(){return this.rules.map(e=>e.name)}},W=new Mt;var me=(t={})=>{let e=h("flags.validateStructure",!0),o=go(st),r=At($),n=At(Z),s=At(Q),a=At(tt),c=ho(()=>{var p;if(!e||!o)return;let i=o.contentDocument||((p=o.contentWindow)==null?void 0:p.document);if(!i)return;let u=[],m=W.getRules();t.enableAccessibilityRules&&(W.enableAccessibilityRules(),m=W.getRules()),t.customRules&&t.customRules.length>0&&m.push(...t.customRules),m.forEach(d=>{try{let f=d.validate(i);u.push(...f)}catch(f){console.error(`Error running structure rule "${d.name}":`,f)}});let k=u.filter(d=>d.severity==="error").length>0,g=u.filter(d=>d.severity==="warning").length>0,_=!k;r(u),n(_),s(k),a(g)},[e,o,t,r,n,s,a]);return fo(c,[e,o,t,r,n,s,a],500)},pe=(t,e={})=>{if(!t)return[];let o=[],r=W.getRules();return e.enableAccessibilityRules&&(W.enableAccessibilityRules(),r=W.getRules()),e.customRules&&e.customRules.length>0&&r.push(...e.customRules),r.forEach(n=>{try{let s=n.validate(t);o.push(...s)}catch(s){console.error(`Error running structure rule "${n.name}":`,s)}}),o};import{atom as ko,useAtom as Bo}from"jotai";var Ao=ko(!1),fe=()=>Bo(Ao);import{useCallback as bo}from"react";function yo(t){let e=t.indexOf(":");return e===-1?t:t.slice(0,e)}var bt=()=>{let t=h("permissions",null);return{hasPermission:bo(o=>t?t.length===0?!1:t.includes("*")||t.includes(o)?!0:t.includes(`${yo(o)}:*`):!0,[t])}};var G={},ca=(t,e)=>{G[t]||(G[t]=[]),G[t].push(e)},nt=async(t,e,o)=>{let r=G[t]||[],n=e;for(let s of r)try{let a=await s(n,o);a!==void 0&&(n=a)}catch(a){console.error(`[ChaiBuilder] Error in hook "${t}":`,a)}return n},ua=t=>G[t]||[],da=t=>{t?delete G[t]:Object.keys(G).forEach(e=>{delete G[e]})};var at={BEFORE_SAVE_PAGE:"before:save:page",AFTER_SAVE_PAGE:"after:save:page"};import{atom as ge}from"jotai";var N=ge({}),Vt=ge({});import{filter as Co,get as he}from"lodash-es";var it=t=>Co(t.map(e=>e._type==="PartialBlock"||e._type==="GlobalBlock"?(e==null?void 0:e._show)===!1||(e==null?void 0:e._show)==="false"?null:he(e,"partialBlockId",he(e,"globalBlock","")):null),Boolean);function yt(t,e,o,r=new Set){if(t===e)return!0;if(r.has(e))return!1;r.add(e);let n=o[e]||[];for(let s of n)if(s===t||yt(t,s,o,r))return!0;return!1}function lt(t,e,o=new Set){if(o.has(t))return 0;o.add(t);let r=e[t]||[];return r.length===0?1:1+Math.max(...r.map(n=>lt(n,e,new Set(o))))}import{useAtom as So}from"jotai";import{useCallback as xo,useEffect as Po,useState as ke}from"react";var _o=()=>{let[t,e]=ke(!1),[o,r]=ke(null),[n,s]=So(Vt),a=h("getPartialBlocks",async()=>({})),c=xo(async()=>{e(!0),r(null);try{let l=await a();s(l),e(!1)}catch(l){r(l instanceof Error?l.message:"Failed to fetch partial blocks"),e(!1)}},[a,s]);return Po(()=>{c()},[]),{data:n,isLoading:t,refetch:c,error:o}};import{useAtom as Eo}from"jotai";import{get as Ro}from"lodash-es";import{useCallback as Be}from"react";var vo=()=>{let[t,e]=Eo(N),o=Be(n=>Ro(t,`${n}.blocks`,[]),[t]),r=Be(()=>e({}),[e]);return{getPartialBlocks:o,reset:r}};import{useAtom as Io}from"jotai";import{useCallback as Lo,useMemo as To}from"react";var be=()=>{let[t]=Io(N);return To(()=>{let e={};return Object.entries(t).forEach(([o,r])=>{e[o]=r.dependencies}),e},[t])};var wo=()=>{let t=h("pageId",""),e=be();return Lo(o=>{if(!t)return{canAdd:!0};if(t===o)return{canAdd:!1,reason:"Cannot add a partial inside itself"};if(yt(t,o,e))return{canAdd:!1,reason:"Adding this partial would create a circular reference"};let r=lt(t,e),n=lt(o,e);return Math.max(r,1+n)>4?{canAdd:!1,reason:`Maximum nesting depth (${4} levels) would be exceeded`}:{canAdd:!0}},[t,e])};import{useAtom as Do}from"jotai";import{get as ye}from"lodash-es";import{useEffect as Mo,useMemo as Ot,useRef as Vo}from"react";var Oo=()=>{let[t]=j(),[e,o]=Do(N),r=h("getPartialBlockBlocks",async l=>[]),n=Vo(new Set),s=Ot(()=>t.filter(l=>l._type==="PartialBlock"||l._type==="GlobalBlock").map(l=>ye(l,"partialBlockId",ye(l,"globalBlock",""))).filter(Boolean),[t]),a=Ot(()=>{let l=[];return Object.values(e).forEach(i=>{i.status==="loaded"&&l.push(...i.dependencies)}),l},[e]),c=Ot(()=>[...new Set([...s,...a])],[s,a]);Mo(()=>{let l=c.filter(i=>{let u=e[i],m=n.current.has(i);return(!u||u.status==="idle")&&!m});l.length!==0&&(l.forEach(i=>n.current.add(i)),o(i=>{let u={};return l.forEach(m=>{u[m]={blocks:[],dependencies:[],status:"loading"}}),{...i,...u}}),Promise.all(l.map(async i=>{try{let u=await r(i),m=it(u);o(k=>({...k,[i]:{blocks:u,dependencies:m,status:"loaded"}}))}catch(u){o(m=>({...m,[i]:{blocks:[],dependencies:[],status:"error",error:u instanceof Error?u.message:"Failed to fetch"}}))}finally{n.current.delete(i)}})))},[c,e,o,r])};var Y=Uo("SAVED");Y.debugLabel="builderSaveStateAtom";var jo=(t,e)=>e?t.some(o=>{var r;if(!(o!=null&&o._type)||o._type==="PartialBlock")return!1;try{let n=X(o._type);return n?($o(n,"i18nProps")?(r=n.i18nProps)!=null?r:[]:[]).some(a=>{let c=`${a}-${e}`;return!o[c]||Wo(o[c])}):!1}catch(n){return console.warn(`Failed to get block definition for type: ${o._type}`,n),!1}}):!1,xe=()=>{let[t,e]=No(Y),o=h("onSave",async B=>{}),r=h("onSaveStateChange",Go),n=Se(),{hasPermission:s}=bt(),{selectedLang:a,fallbackLang:c}=et(),[l]=fe(),i=Ce(N),u=Ce(st),m=ct(ot),k=ct($),g=ct(Z),_=ct(Q),p=ct(tt),d=()=>{let B=n();return!a||a===c?!1:jo(B.blocks||[],a)},f=Ht(B=>{let b=new Set,S=it(B);for(;S.length>0;){let I=S.shift();if(b.has(I))continue;b.add(I);let x=i[I];(x==null?void 0:x.status)==="loaded"&&x.dependencies.length>0&&S.push(...x.dependencies)}return[...b]},[i]),C=Ht(B=>{let b=/pageType:[^:]+:([a-f0-9-]{36})/gi,S=/dt#[^ "]+/g,I=new Set,x={};for(let O of B){let q=JSON.stringify(O),H;for(;(H=b.exec(q))!==null;)H[1]&&I.add(H[1]);for(;(H=S.exec(q))!==null;)if(H[0]){let z=H[0];x[z]||(x[z]={}),x[z][O._id]=O._name||O._type}}return{linkPageIds:Fo([...I]),designTokens:x}},[]),A=Ht(B=>!B&&(!s("save_page")||!l)||!B&&t==="SAVED",[s,l,t]);return{savePage:Ho(async(B=!1,b=!1)=>{var H,z,Ft;if(A(b))return;let S=n();if(u){let $t=u.contentDocument||((H=u.contentWindow)==null?void 0:H.document);if($t){let St=pe($t),Wt=St.some(xt=>xt.severity==="error"),$e=St.some(xt=>xt.severity==="warning");k(St),g(!Wt),_(Wt),p($e)}}let I=await nt(at.BEFORE_SAVE_PAGE,S.blocks,{pageId:(z=S.currentPage)==null?void 0:z.id,operation:"update"});if(!Array.isArray(I)){console.error("[ChaiBuilder] BEFORE_SAVE_PAGE hook did not return a valid array. Aborting save.");return}let x=I;e("SAVING"),r("SAVING"),m(0);let{linkPageIds:O,designTokens:q}=C(x||[]);return await o({autoSave:B,blocks:x,needTranslations:d(),partialIds:f(x||[]),linkPageIds:O,designTokens:q}),await nt(at.AFTER_SAVE_PAGE,{pageId:(Ft=S.currentPage)==null?void 0:Ft.id,blocks:x},{operation:"update"}),setTimeout(()=>{e("SAVED"),r("SAVED")},100),!0},[A,n,e,m,o,r,l,u,f,C,k,g,_,p],3e3),savePageAsync:async(B=!1)=>{var O,q;if(A(B))return;let b=n(),S=await nt(at.BEFORE_SAVE_PAGE,b.blocks,{pageId:(O=b.currentPage)==null?void 0:O.id,operation:"update"});e("SAVING"),r("SAVING"),m(0);let{linkPageIds:I,designTokens:x}=C(S||[]);return await o({autoSave:!0,blocks:S,needTranslations:d(),partialIds:f(S||[]),linkPageIds:I,designTokens:x}),await nt(at.AFTER_SAVE_PAGE,{pageId:(q=b.currentPage)==null?void 0:q.id,blocks:S},{operation:"update"}),setTimeout(()=>{e("SAVED"),r("SAVED")},100),!0},saveState:t,setSaveState:e,needTranslations:d}};var yi=()=>{let{savePage:t,saveState:e}=xe(),o=h("autoSave",!0),r=h("autoSaveActionsCount",10),[n]=qo(ot);zo(()=>{o&&(e==="SAVED"||e==="SAVING"||n>=r&&t(!0))},[o,t,e,n,r])},_e=()=>{let t=Pe(ot),e=Pe(Y);return Ko(()=>{t(o=>o+1),e(o=>o!=="UNSAVED"?"UNSAVED":o)},[t,e])};function Ut(t,e,o,r){let n=[...e],s=[...t];if(o){let i=t.find(u=>u._id===o);if(i&&i.content!==void 0&&i.content!==""&&!t.some(m=>m._parent===o)){let k={_id:F(),_parent:o,_type:"Text",content:i.content};Object.keys(i).forEach(g=>{g.startsWith("content-")&&(k[g]=i[g])}),n.unshift(k),s=s.map(g=>{if(g._id===o){let _={...g,content:""};return Object.keys(_).forEach(p=>{p.startsWith("content-")&&(_[p]="")}),_}return g})}}let a=s.filter(i=>!i._parent);o&&(a=s.filter(i=>i._parent===o));let c=r!==void 0&&!isNaN(r)&&r>-1?Math.min(r,a.length):a.length,l=s.length;for(let i=0,u=0;i<s.length;i++)if(o!==void 0?s[i]._parent===o:!s[i]._parent){if(u===c){l=i;break}u++}return!o&&r!==void 0&&r>=a.length&&(l=s.length),[...s.slice(0,l),...n,...s.slice(l)]}import Xo from"tree-model";function Ee(t){return ft(t)}function Jo(t){let e=[];return t.walk(o=>(delete o.model.children,e.push(o.model),!0)),e}function Re(t,e){return t.first(o=>o.model._id===e)||null}function Yo(t,e,o,r){var i,u;let n=Re(t,e),s=Re(t,o);if(!n||!s)return!1;s.children||(s.model.children=[]);let a=(i=s==null?void 0:s.children)==null?void 0:i.findIndex(m=>m.model._id===e);n.drop(),a=Math.max(a,0);let l=(((u=n==null?void 0:n.model)==null?void 0:u._parent)||"root")===o&&a<=r?r-1:r;try{s.addChildAtIndex(n,l)}catch(m){return console.error("Error adding child to parent:",m),!1}return!0}function Zo(t,e){if(!e||!e._parent)return t;let o=e._parent,r=t.find(s=>s._id===o);if(!r)return t;let n=t.filter(s=>s._parent===o);if(n.length===2){let s=n.find(a=>a._id!==e._id);if(s&&s._type==="Text"&&"content"in r)return t.map(c=>{if(c._id===o){let l={...c,content:s.content};return Object.keys(s).forEach(i=>{i.startsWith("content-")&&(l[i]=s[i])}),l}return c}).filter(c=>c._id!==s._id)}return t}function Qo(t,e,o){if(!o||o==="root")return t;let r=t.find(n=>n._id===o);if(!r)return t;if(r.content!==void 0&&r.content!==""&&!t.some(s=>s._parent===o&&s._id!==e._id)){let a={_id:F(),_parent:o,_type:"Text",content:r.content};Object.keys(r).forEach(i=>{i.startsWith("content-")&&(a[i]=r[i])});let c=t.map(i=>{if(i._id===o){let u={...i,content:""};return Object.keys(u).forEach(m=>{m.startsWith("content-")&&(u[m]="")}),u}return i}),l=c.findIndex(i=>i._id===e._id);return l!==-1?[...c.slice(0,l),a,...c.slice(l)]:[a,...c]}return t}function ve(t,e,o,r){if(!e)return t;let n=t.find(i=>i._id===e);if(!n)return t;let s=Zo(t,n),a=o||"root",l=new Xo().parse({_id:"root",children:Ee(s)});if(Yo(l,e,a,r)){let i=Jo(l),u=i.find(m=>m._id===e);return u&&(u._parent=a==="root"?null:a),i.shift(),o&&(i=Qo(i,n,o)),i}return s}import{useDebouncedCallback as ts}from"@react-hookz/web";import{useEffect as es}from"react";var ut=new BroadcastChannel("chaibuilder"),Ie=()=>{let t=h("pageId","chaibuilder_page");return{postMessage:ts(o=>ut.postMessage({...o,pageId:t}),[t],200)}},Vi=()=>{let[,t]=j(),e=h("pageId","chaibuilder_page"),{updateBlocksProps:o}=Ct();es(()=>(ut.onmessageerror=r=>{console.log("error",r)},ut.onmessage=r=>{r.data.type==="blocks-updated"&&r.data.pageId===e&&t(r.data.blocks),r.data.type==="blocks-props-updated"&&r.data.pageId===e&&o(r.data.blocks)},()=>{ut.onmessage=null,ut.onmessageerror=null}),[t,e,o])};import{filter as rs,find as os,includes as Le,isEmpty as ss}from"lodash-es";import{useCallback as ns}from"react";var dt=(t,e)=>{let o=[...t],r=[];e.forEach(c=>{let l=o.find(m=>m._id===c);if(!l||!l._parent)return;let i=l._parent,u=o.filter(m=>m._parent===i);if(u.length===2){let m=u.find(k=>k._id!==c);if(m&&m._type==="Text"){let k=o.find(g=>g._id===i);k&&"content"in k&&(o=o.map(g=>{if(g._id===i){let _={...g,content:m.content};return Object.keys(m).forEach(p=>{p.startsWith("content-")&&(_[p]=m[p])}),_}return g}),r.push(m._id))}}});let n=[...e,...r],s=[],a=rs(o,c=>Le(n,c._id)||Le(n,c._parent)?(s.push(c._id),!1):!0);return ss(s)?a:dt(a,s)},Gi=()=>{let[t]=j(),[,e]=ee(),{setNewBlocks:o}=K(),{hasPermission:r}=bt();return ns(n=>{var a;if(!r(jt["pages:update"]))return;let s=((a=os(t,{_id:n[0]}))==null?void 0:a._parent)||null;o(dt(t,n)),setTimeout(()=>e(s?[s]:[]),200)},[r,t,o,e])};import{atom as as,useSetAtom as is}from"jotai";import{useAtomCallback as ls}from"jotai/utils";import{isString as cs}from"lodash-es";import{useCallback as us}from"react";var Te=new WeakMap,ds=(t,e)=>{if(e===gt)return t(ht);let o=t(e),r=Te.get(o);if(!r){r=new Map;for(let n of o)r.set(t(n)._id,n);Te.set(o,r)}return r},ms=as(null,(t,e,{id:o,props:r})=>{let n=t(ht).get(o);return n?e(n,{...t(n),...r}):null}),we=()=>is(ms);var Qi=t=>ls(us((e,o,r)=>{let n=cs(r)?r:e(r)._id,s=ds(e,t).get(n);return s||(console.warn(`Block with id ${n} not found`),null)},[t]),{store:L});var Ct=()=>{let t=ps(y),{postMessage:e}=Ie(),o=we(),r=me(),n=_e();return{setNewBlocks:s=>{t(s),e({type:"blocks-updated",blocks:s})},addBlocks:(s,a,c)=>{t(l=>{let i=Ut(l,s,a,c);return e({type:"blocks-updated",blocks:i}),r(),n(),i})},removeBlocks:s=>{t(a=>{let c=dt(a,s);return e({type:"blocks-updated",blocks:c}),r(),n(),c})},moveBlocks:(s,a,c)=>{t(l=>{let i=[...l];for(let u=0;u<s.length;u++)i=ve(i,s[u],a,c);return fs(s,u=>{let m=gs(i,k=>k._id===u);m&&o({id:u,props:{_parent:m._parent||null}})}),e({type:"blocks-updated",blocks:i}),r(),n(),i})},updateBlocksProps:s=>{s.forEach(a=>{let c=hs(a,"_id");o({id:a._id,props:c})}),e({type:"blocks-props-updated",blocks:s}),r(),n()},replaceBlocks:(s,a,c,l)=>{t(i=>{let u=dt(i,s);return u=Ut(u,a,c,l),e({type:"blocks-updated",blocks:u}),r(),n(),u})}}};import{atom as ks,useAtomValue as Bs,useSetAtom as De}from"jotai";import{noop as Me}from"lodash-es";import{useCallback as mt,useEffect as As,useMemo as bs}from"react";import ys from"undo-manager";var w=new ys;w.setLimit(50);var Ve=ks({canUndo:!1,canRedo:!1}),Bl=()=>Bs(Ve),Oe=()=>{let t=De(Y),e=De(Ve),o=h("onSaveStateChange",Me),r=mt(()=>{let l={canUndo:w.hasUndo(),canRedo:w.hasRedo()};e(l),t("UNSAVED"),o("UNSAVED")},[e,t,o]);As(()=>(w.setCallback(r),()=>{w.setCallback(Me)}),[r]);let n=mt(l=>{w.add(l),r()},[r]),s=mt(()=>{w.undo(),r()},[r]),a=mt(()=>{w.redo(),r()},[r]),c=mt(()=>{w.clear(),e({canUndo:!1,canRedo:!1})},[e]);return bs(()=>({add:n,undo:s,redo:a,hasUndo:()=>w.hasUndo(),hasRedo:()=>w.hasRedo(),clear:c}),[n,s,a,c])};var j=()=>Cs(y),V=()=>L.set(Zt,t=>t+1),K=()=>{let{add:t}=Oe(),{setNewBlocks:e,addBlocks:o,removeBlocks:r,moveBlocks:n,replaceBlocks:s,updateBlocksProps:a}=Ct();return{moveBlocks:(p,d,f)=>{let C=L.get(y),A=C.find(R=>R._id===p[0]);if(A){let R=A._parent||null,B=C.filter(b=>R?b._parent===R:!b._parent).map(b=>b._id);if(R===(d!=null?d:null)&&B.indexOf(p[0])===f)return}n(p,d!=null?d:null,f);let E=L.get(y);t({undo:()=>{e(C),V()},redo:()=>{e(E),V()}})},addBlocks:(p,d,f)=>{o(p,d,f),t({undo:()=>{r(D(p,"_id")),V()},redo:()=>{o(p,d,f),V()}})},removeBlocks:p=>{var E;let d=L.get(y),f=(E=Ue(p))==null?void 0:E._parent,A=d.filter(R=>f?R._parent===f:!R._parent).indexOf(Ue(p));r(D(p,"_id")),t({undo:()=>{o(p,f!=null?f:void 0,A),V()},redo:()=>{r(D(p,"_id")),V()}})},replaceBlocks:(p,d,f,C)=>{let A=D(p,"_id");s(A,d,f,C),t({undo:()=>{s(D(d,"_id"),p,f,C),V()},redo:()=>{s(A,d,f,C),V()}})},updateBlocks:(p,d,f)=>{let C=L.get(y),A=[];if(f)A=D(p,E=>({_id:E,...f}));else{let E=Ne(d),R=new Map(C.map(B=>[B._id,B]));A=D(p,B=>{let b=R.get(B),S={_id:B};return He(E,I=>S[I]=b[I]),S})}a(D(p,E=>({_id:E,...d}))),t({undo:()=>a(A),redo:()=>a(D(p,E=>({_id:E,...d})))})},updateBlocksRuntime:(p,d)=>{a(D(p,f=>({_id:f,...d})))},setNewBlocks:p=>{let d=L.get(y);e(p),t({undo:()=>{e(d),V()},redo:()=>{e(p),V()}})},updateMultipleBlocksProps:p=>{let d=L.get(y),f=new Map(d.map(A=>[A._id,A])),C=[];C=D(p,A=>{let E=Ne(A),R=f.get(A._id),B={_id:A._id};return He(E,b=>B[b]=R==null?void 0:R[b]),B}),a(p),t({undo:()=>a(C),redo:()=>a(p)})}}};import{atom as Ss,useAtomValue as xs}from"jotai";var Ps=Ss(null),Fe=()=>({currentPage:xs(Ps)});var Ls=Rs(t=>{let e=X(t),o=Nt(e,"schema.properties",{});return _s(Object.keys(o).map(r=>Nt(o[r],"builderProp",!1)||Nt(o[r],"runtime",!1)?r:null))}),Se=()=>{let{currentPage:t}=Fe(),[e]=j();return Is(()=>{let o=Es(e,r=>vs(r,Ls(r._type)));return{currentPage:t,blocks:o}},[t,e])};export{qt as a,Ds as b,y as c,Ye as d,gt as e,ht as f,Ze as g,Qe as h,$ as i,Z as j,Q as k,tt as l,or as m,sr as n,nr as o,L as p,Gs as q,Ks as r,zs as s,ir as t,Xs as u,Zt as v,st as w,eo as x,oo as y,no as z,co as A,uo as B,Gn as C,W as D,me as E,Se as F,Ao as G,bt as H,ca as I,nt as J,ua as K,da as L,_o as M,vo as N,wo as O,Oo as P,Y as Q,xe as R,yi as S,_e as T,ve as U,Ie as V,Vi as W,It as X,J as Y,dn as Z,Sr as _,xr as $,mn as aa,ee as ba,dt as ca,Gi as da,Qi as ea,w as fa,Bl as ga,Oe as ha,j as ia,K as ja,yn as ka,Cn as la,ne as ma,ce as na,Ln as oa,Et as pa,de as qa,zr as ra,Vn as sa,ot as ta,On as ua,Hn as va,h as wa,et as xa};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as i}from"./chunk-PQHFT4TE.js";import{d as r}from"./chunk-AOJE5WI3.js";import{a as n}from"./chunk-WEVKAJMV.js";import{useQuery as a}from"@tanstack/react-query";var m="AI_CONTEXT";function T(){let{data:t}=i(),o=r();return a({queryKey:[m,t==null?void 0:t.id],queryFn:async()=>{if(!(t!=null&&t.id))return null;let e=await o({body:{action:n.AI_GET_CONTEXT,data:{pageId:t.id}}});if(e!=null&&e.success&&e.aiData){let{app:u,page:s}=e.aiData;return{site:u,page:s}}return null},enabled:!!(t!=null&&t.id),staleTime:1/0,gcTime:1/0})}export{m as a,T as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as c}from"./chunk-3IT7IIAV.js";import{a as o}from"./chunk-LWYDGDPW.js";import{ArrowDownIcon as P}from"lucide-react";import{useCallback as b}from"react";import{StickToBottom as g,useStickToBottomContext as C}from"use-stick-to-bottom";import{Fragment as M,jsx as i,jsxs as d}from"react/jsx-runtime";var D=({className:t,...e})=>i(g,{className:o("relative flex-1 overflow-y-hidden",t),initial:"smooth",resize:"smooth",role:"log",...e}),V=({className:t,...e})=>i(g.Content,{className:o("flex flex-col gap-8 p-4",t),...e}),W=({className:t,title:e="No messages yet",description:s="Start a conversation to see messages here",icon:r,children:a,...l})=>i("div",{className:o("flex size-full flex-col items-center justify-center gap-3 px-3 py-12 text-center",t),...l,children:a!=null?a:d(M,{children:[r&&i("div",{className:"text-foreground/70",children:r}),d("div",{className:"space-y-1",children:[i("div",{className:"text-sm text-foreground",children:e}),s&&i("p",{className:"text-xs font-light text-foreground/50",children:s})]})]})}),U=({className:t,...e})=>{let{isAtBottom:s,scrollToBottom:r}=C(),a=b(()=>{r()},[r]);return!s&&i(c,{className:o("absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full",t),onClick:a,size:"icon",type:"button",variant:"outline",...e,children:i(P,{className:"size-4"})})};import{ChevronLeftIcon as mt,ChevronRightIcon as ut,PaperclipIcon as dt,XIcon as gt}from"lucide-react";import{createContext as N,memo as S,useContext as ht,useEffect as vt,useMemo as xt,useState as yt}from"react";import{Streamdown as w}from"streamdown";import{Slot as Y}from"@radix-ui/react-slot";import{cva as T}from"class-variance-authority";import{jsx as Z}from"react/jsx-runtime";var J=T("flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",{variants:{orientation:{horizontal:"[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",vertical:"flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}});import*as p from"@radix-ui/react-tooltip";import*as f from"react";import{jsx as B}from"react/jsx-runtime";var h=f.forwardRef(({className:t,sideOffset:e=4,...s},r)=>B(p.Content,{ref:r,sideOffset:e,className:o("z-50 origin-[--radix-tooltip-content-transform-origin] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s}));h.displayName=p.Content.displayName;import{Fragment as Rt,jsx as m,jsxs as At}from"react/jsx-runtime";var Nt=({className:t,from:e,...s})=>m("div",{className:o("group flex w-full max-w-[80%] flex-col gap-2",e==="user"?"is-user ml-auto justify-end":"is-assistant",t),...s}),St=({children:t,className:e,...s})=>m("div",{className:o("is-user:dark flex w-fit flex-col gap-2 overflow-hidden text-sm","group-[.is-user]:ml-auto group-[.is-user]:rounded-lg group-[.is-user]:bg-secondary group-[.is-user]:px-4 group-[.is-user]:py-3 group-[.is-user]:text-foreground","group-[.is-assistant]:text-foreground",e),...s,children:t});var wt=N(null);var z=S(({className:t,...e})=>m(w,{className:o("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",t),...e}),(t,e)=>t.children===e.children);z.displayName="MessageResponse";import{motion as n}from"motion/react";import{memo as A,useMemo as R}from"react";import{jsx as E}from"react/jsx-runtime";var v={p:n.p,span:n.span,div:n.div,h1:n.h1,h2:n.h2,h3:n.h3,h4:n.h4,h5:n.h5,h6:n.h6},k=({children:t,as:e="p",className:s,duration:r=2,spread:a=2})=>{let l=R(()=>{var u;return((u=t==null?void 0:t.length)!=null?u:0)*a},[t,a]),x=typeof e=="string"&&e in v?e:"p",y=v[x];return E(y,{animate:{backgroundPosition:"0% center"},className:o("relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent","[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-surface),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",s),initial:{backgroundPosition:"100% center"},style:{"--spread":`${l}px`,backgroundImage:"var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"},transition:{repeat:Number.POSITIVE_INFINITY,duration:r,ease:"linear"},children:t})},Ht=A(k);export{D as a,V as b,W as c,U as d,Nt as e,St as f,z as g,Ht as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=r=>{let t=r.trim();return t.startsWith("{")&&t.endsWith("}")?t.slice(1,-1).trim():r};export{e as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{atom as o,useAtom as a,useSetAtom as t}from"jotai";var e=o(!1);e.debugLabel="pageManagerOpenAtom";var g=()=>a(e),m=()=>t(e);export{g as a,m as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as R}from"./chunk-OD3K76M6.js";import{b as V,c as D}from"./chunk-K5YWQY4U.js";import{a as U}from"./chunk-FOKGOT6B.js";import{b as I,e as F}from"./chunk-YEFMD4DS.js";import{a as G}from"./chunk-HA7LF3RV.js";import{a as E}from"./chunk-WEVKAJMV.js";import{a as N,b as L,c as T}from"./chunk-FERH2TPR.js";import{a as A,b as x,c as b,d as S}from"./chunk-TVF77C53.js";import{a as M,d as j,g as z,i as y}from"./chunk-WSQ5SQBD.js";import{a as B}from"./chunk-2N4IJZOR.js";import{b as h}from"./chunk-3IT7IIAV.js";import{useQueryClient as _}from"@tanstack/react-query";import{filter as v,get as l,isEmpty as k,map as q}from"lodash-es";import{ChevronsDownUp as $,ChevronsUpDown as O,Filter as X,FilterXIcon as H,ListFilter as J,Plus as Y,RefreshCw as Z,Search as ee,Star as te}from"lucide-react";import{useEffect as ae,useMemo as se,useState as re}from"react";import{useTranslation as C}from"react-i18next";import{Fragment as K,jsx as e,jsxs as s}from"react/jsx-runtime";var oe=({selectedPageType:r,setSelectedPageType:n,category:g})=>{let{t:a}=C(),[o,c]=re(""),{data:i}=F(),P=!0,f=se(()=>i==null?void 0:i.some(t=>!["page","global"].includes(l(t,"key",""))),[i]);if(ae(()=>{!f&&r!=="all"&&n("all")},[f,r,n]),!f)return null;let d=t=>{if(!o)return!0;let m=o.toLowerCase(),u=w=>String(l(t,w,"")).toLowerCase().includes(m);return u("name")||u("key")},p=i==null?void 0:i.find(t=>t.key===r);return s(M,{onValueChange:n,value:r,children:[e(j,{className:`${r==="all"?"bg-muted/30 hover:bg-muted":"gap-x-1 border bg-muted/30 hover:bg-muted"} h-8 w-max min-w-[80px] overflow-hidden whitespace-nowrap rounded p-0 px-2 py-1 text-xs text-muted-foreground shadow-none ring-0 focus:ring-0 [&>svg]:hidden`,children:s("div",{className:"flex w-full items-center justify-between gap-x-1.5",children:[e("span",{className:"max-w-[150px] overflow-hidden truncate whitespace-nowrap font-medium leading-tight",children:(p==null?void 0:p.name)||a("All")}),e(J,{className:`${r!=="all"?"fill-sky-50 text-sky-500":""} pointer-events-none h-4 w-4 text-muted-foreground hover:bg-blue-300`})]})}),s(z,{children:[P&&e("div",{className:"sticky top-0 z-10 bg-surface pb-2",children:s("div",{className:"relative",children:[e(ee,{strokeWidth:2,className:"absolute left-2 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),e(B,{placeholder:a("Search page types..."),className:"h-8 w-full rounded border pl-8 text-xs shadow-none",value:o,onChange:t=>c(t.target.value),onKeyDown:t=>t.stopPropagation()})]})}),e(y,{value:"all",children:a("All")}),g==="pages"&&!k(v(i,t=>t.hasSlug&&d(t)))&&s(K,{children:[e("div",{className:"mt-2 border-t px-2 py-1.5 pt-2 text-xs font-semibold text-muted-foreground",children:a("Pages")}),q([...v(i,t=>t.hasSlug&&d(t))].sort((t,m)=>l(t,"name","").localeCompare(l(m,"name",""))),t=>e(y,{value:l(t,"key"),children:l(t,"name","")},l(t,"key")))]}),g==="partials"&&!k(v(i,t=>!t.hasSlug&&d(t)))&&s(K,{children:[e("div",{className:"mt-2 border-t px-2 py-1.5 pt-2 text-xs font-semibold text-muted-foreground",children:a("Partials")}),q([...v(i,t=>!t.hasSlug&&d(t))].sort((t,m)=>l(t,"name","").localeCompare(l(m,"name",""))),t=>e(y,{value:l(t,"key"),children:l(t,"name","")},l(t,"key")))]}),k(v(i,d))&&e("div",{className:"px-3 py-2 text-center text-sm text-muted-foreground",children:a("No matching page types found")})]})]})},ie=({pages:r})=>{let{t:n}=C(),{expandAll:g,collapseAll:a,expandedPages:o}=R(null),c=o.length>0;return e("div",{className:"flex gap-1",children:s(x,{children:[e(b,{asChild:!0,children:e(h,{variant:"outline",size:"icon-sm",onClick:()=>c?a():g(r),children:c?e($,{}):e(O,{})})}),e(S,{children:n(c?"Collapse All":"Expand All")})]})})},ne=({languages:r,selectedLanguage:n,setSelectedLanguage:g})=>{let a=I();return e(N,{onValueChange:o=>g(o.toLowerCase()),value:n,className:"flex h-7 max-h-full flex-col overflow-x-auto overflow-y-hidden",children:e(L,{className:"flex w-full items-center",children:r.map(o=>s(T,{value:o,className:"h-5 px-3 text-xs",children:[o===a&&e("span",{children:e(te,{className:"h-2.5 w-2.5"})}),G[o]||""]},o))})})},le=()=>{let{t:r}=C(),n=_();return s(x,{children:[e(b,{asChild:!0,children:e(h,{size:"icon-sm",variant:"outline",onClick:()=>n.invalidateQueries({queryKey:[E.GET_WEBSITE_PAGES]}),children:e(Z,{})})}),e(S,{side:"top",children:r("Refresh pages list")})]})},ce=({pages:r,search:n,setSearch:g,languages:a,onAddPage:o,selectedLanguage:c,setSelectedLanguage:i,selectedPageType:P,setSelectedPageType:f,showUntranslatedPages:d,setShowUntranslatedPages:p,category:t,setCategory:m})=>{let{t:u}=C(),w=D(),Q=a.length>1;return e(A,{children:s("div",{className:"space-y-3 border-b border-b-border px-4 pb-1",children:[e(N,{onValueChange:m,value:t,className:"flex h-8 w-48 items-center justify-center p-0",children:s(L,{className:"grid h-8 w-full grid-cols-2 items-center justify-center rounded bg-muted/50 p-0 px-0.5",children:[e(T,{value:"pages",className:"h-7 rounded-sm px-2 py-0.5 text-xs",children:u("Pages")}),e(T,{value:"partials",className:"h-7 rounded-sm px-2 py-0.5 text-xs",children:w})]})}),s("div",{className:"grid grid-cols-3",children:[s("div",{className:"col-span-2 flex items-center gap-1",children:[e(oe,{category:t,selectedPageType:P,setSelectedPageType:f}),e(U,{value:n,setValue:g,placeholder:V(t)})]}),s("div",{className:"flex items-center justify-end gap-1",children:[e(le,{}),e(ie,{pages:r}),t==="pages"&&s(h,{variant:"default",onClick:o,size:"sm",children:[e(Y,{}),e("span",{children:u("Add Page")})]})]})]}),t==="pages"&&Q?s("div",{className:"flex items-center justify-between gap-2",children:[e(ne,{languages:a,selectedLanguage:c,setSelectedLanguage:W=>{i(W),p(d&&(a==null?void 0:a[0])!==c)}}),e("div",{className:"flex items-center gap-x-2",children:(a==null?void 0:a[0])!==c&&s(x,{children:[e(b,{asChild:!0,children:e(h,{variant:"ghost",size:"icon-sm",onClick:()=>p(!d),children:d?e(H,{}):e(X,{})})}),e(S,{side:"bottom",children:u("Toggle Untranslated Pages")})]})})]}):e("div",{className:"flex items-center justify-between gap-2"})]})})},Le=ce;export{ne as a,Le as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as c}from"./chunk-LWYDGDPW.js";import*as e from"@radix-ui/react-accordion";import{ChevronDownIcon as m}from"@radix-ui/react-icons";import*as n from"react";import{jsx as r,jsxs as p}from"react/jsx-runtime";var A=e.Root,d=n.forwardRef(({className:o,...i},t)=>r(e.Item,{ref:t,className:c("border-b",o),...i}));d.displayName="AccordionItem";var s=n.forwardRef(({className:o,children:i,...t},a)=>r(e.Header,{className:"flex",children:p(e.Trigger,{ref:a,className:c("flex flex-1 items-center justify-between py-4 text-left text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",o),...t,children:[i,r(m,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));s.displayName=e.Trigger.displayName;var f=n.forwardRef(({className:o,children:i,...t},a)=>r(e.Content,{ref:a,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...t,children:r("div",{className:c("pb-4 pt-0",o),children:i})}));f.displayName=e.Content.displayName;export{A as a,d as b,s as c,f as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as l}from"./chunk-IP4JBQOX.js";import{a as t}from"./chunk-LWYDGDPW.js";import{Slot as b}from"@radix-ui/react-slot";import{cva as m}from"class-variance-authority";import*as c from"react";import{jsx as a,jsxs as x}from"react/jsx-runtime";var g=m("group/button cursor-pointer duration-300 inline-flex shrink-0 items-center justify-center rounded border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary hover:bg-primary/80 text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted/30 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-4 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}}),f=c.forwardRef(({className:n,variant:i,size:o,asChild:d=!1,loading:e=!1,children:r,disabled:v,...s},u)=>{let p=d?b:"button";return d?a(p,{className:t(g({variant:i,size:o,className:n})),ref:u,...s,children:r}):x(p,{className:t(g({variant:i,size:o,className:n})),ref:u,disabled:v||e,...s,children:[e&&a(l,{className:"absolute h-4 w-4 text-primary-foreground"}),e?a("span",{className:"opacity-0",children:r}):r]})});f.displayName="Button";export{g as a,f as b};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{each as V,get as O,intersection as y,isEmpty as K,keys as ee,omit as oe}from"lodash-es";var g="#styles:";var te="__ADD_BLOCK_INTERNAL_ROOT";import{cloneDeep as B,each as D,get as a,has as u,memoize as A,omitBy as L,set as l}from"lodash-es";import{useMemo as G}from"react";var n={},$=()=>n,H=()=>n,w=e=>G(()=>a(n,e,null),[e]),h=e=>a(n,e),C=e=>{let o=A(e),t=(r=>u(n,r)?o(r):e(r));return t.cache=o.cache,t},k=C(e=>{var c,s;let o=a(n,e),t=(s=(c=o==null?void 0:o.props)==null?void 0:c.schema)!=null?s:{},r=a(t,"properties",{}),i={};return D(r,(p,m)=>{u(p,"block")||l(i,m,p.default)}),i}),N=C(e=>a(n,`${e}.i18nProps`,[])),T=C(e=>a(n,`${e}.aiProps`,[])),I=C(e=>{var m,E,_,P;let o=h(e);if(!o)return;let t=(E=(m=o.props)==null?void 0:m.schema)!=null?E:{},r=(P=(_=o.props)==null?void 0:_.uiSchema)!=null?P:{},i=B(t),c=a(i,"properties",{}),s=L(c,S=>(S==null?void 0:S.styles)===!0);return l(i,"properties",s),{schema:i,uiSchema:r||{}}}),M=e=>{let o=I(e);if(o)return{schema:B(o.schema),uiSchema:B(o.uiSchema)}},b=[k,N,T,I],R=e=>{for(let o of b)o.cache.delete(e)},z=e=>e.map(o=>u(n,o._type)?{...k(o._type),...o}:o),U=(e,o)=>{let t=a(n,o.type);t?l(n,o.type,{...t,component:e,...o}):l(n,o.type,{component:e,...o}),R(o.type)},Y=(e,o)=>{U(e,{...o,category:o.category||"core"})};var ce=(e,o)=>{var r;let t=h(e);l(n,e,{...t,type:(r=t==null?void 0:t.type)!=null?r:e,dataProvider:o}),R(e)},v=(e,o)=>{let t=h(e);l(n,e,{...t,component:o}),R(e)},J=(e,o)=>({type:"null",block:e,prop:o,default:null,runtime:!0,ui:{"ui:widget":"hidden"}});import{compact as j,filter as X,has as x,map as W,uniqBy as F}from"lodash-es";var q=e=>{let o=X(j(W(e,d)),t=>x(t,"src"));return Z(o)},Z=e=>!e||e.length===0?"":F(e,"family").map(o=>o.src.map(t=>`@font-face {
|
|
2
|
+
font-family: "${o.family}";
|
|
3
|
+
src: url("${t.url}") format("${t.format}");
|
|
4
|
+
font-display: swap;
|
|
5
|
+
font-optical-sizing: auto;
|
|
6
|
+
${t.fontWeight?`font-weight: ${t.fontWeight};`:""}
|
|
7
|
+
${t.fontStyle?`font-style: ${t.fontStyle};`:""}
|
|
8
|
+
${t.fontStretch?`font-stretch: ${t.fontStretch};`:""}
|
|
9
|
+
}`).join(`
|
|
10
|
+
`)).join(`
|
|
11
|
+
`),Q=async(e,o)=>{let t=q([e,o]),r=[];return[e,...e!==o?[o]:[]].forEach(c=>{let s=d(c);s&&x(s,"src")&&s.src&&s.src.length>0&&r.push(s.src[0].url)}),{fontStyles:t,preloads:F(r,c=>c)}};var f=[{family:"Arial",fallback:"Helvetica, sans-serif"},{family:"Times New Roman",fallback:"Georgia, serif"},{family:"Courier New",fallback:"Courier, monospace"}],he=(e,o)=>{f.unshift({family:e,...o})},Ce=()=>f,d=e=>f.find(o=>o.family===e),fe=()=>f;var de=e=>{let o=["_type","_id","_parent","_bindings","_name"],t=["$loading","blockProps","inBuilder","lang","draft","pageProps","pageData","children"],r=ee(e.properties);if(y(r,o).length>0)throw new Error(`Reserved props are not allowed: ${y(r,o).join(", ")}`);if(y(r,t).length>0)throw new Error(`Runtime props are not allowed in schema: ${y(r,t).join(", ")}`);let i=O(e,"properties",{}),c={};return V(i,(s,p)=>{K(s.ui)||(c[p]={...s.ui},delete i[p].ui)}),{schema:K(i)?{}:{...oe(e,["ui"])},uiSchema:{...O(e,"ui",{}),...c}}},Ee=e=>{var o;return(o=e.props)==null?void 0:o.schema},_e=e=>{var o;return(o=e.props)==null?void 0:o.uiSchema},Pe=(e="")=>({type:"string",styles:!0,default:`${g},${e}`,ui:{"ui:widget":"hidden"}}),Te=e=>({builderProp:!0,...e}),Ie=e=>`${g},${e}`;export{g as a,te as b,$ as c,H as d,w as e,h as f,k as g,T as h,M as i,z as j,Y as k,ce as l,v as m,J as n,Q as o,he as p,Ce as q,d as r,fe as s,de as t,Ee as u,_e as v,Pe as w,Te as x,Ie as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as ye,j as De,l as z,n as Ae,o as we}from"./chunk-D5SKCKSB.js";import{a as ne}from"./chunk-FOKGOT6B.js";import{H as J,T as ue,ra as me,wa as Y}from"./chunk-2NYUIXUX.js";import{a as pe,b as ve,c as ee,d as te}from"./chunk-FERH2TPR.js";import{a as ge}from"./chunk-2N4IJZOR.js";import{a as fe}from"./chunk-4JBHWPMO.js";import{a as Te,e as ke,h as he,i as xe,j as be,k as Ce}from"./chunk-BWORNCTE.js";import{b as Ne}from"./chunk-TEL5ACJE.js";import{b as y}from"./chunk-3IT7IIAV.js";import{a as j}from"./chunk-CRJENCPR.js";import{a as S}from"./chunk-YDOQEFOK.js";import{useTranslation as ht}from"react-i18next";import{useAtom as at}from"jotai";import{nanoid as rt}from"nanoid";import{createContext as lt,useCallback as k,useContext as ct,useEffect as Se,useMemo as G,useRef as dt,useState as B}from"react";import{useTranslation as ut}from"react-i18next";import{toast as L}from"sonner";import{twMerge as mt}from"cnfast";var oe=e=>{let l=e.trim();return l.length===0||l.length>se?!1:/^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(l)},se=75,Ie=(e,l,c,o=!1,a)=>{let t=e.trim();return t.length===0?"":t.length>se?c("Token name must be {{max}} characters or less",{max:se}):/^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$/.test(t)?Object.entries(l).find(([d,b])=>b.name===t&&(!o||d!==a))?c("Token name already exists"):"":c("Only alphanumeric characters and hyphens allowed")},Ee=e=>e.replace(/\s+/g,"-");import{jsx as gt}from"react/jsx-runtime";var Be=lt(null),Le=({children:e,onActiveTokenChange:l,onDirtyStateChange:c,setCreatePreview:o})=>{let{t:a}=ut(),[t,u]=at(me),p=ue(),{saveDesignTokens:d,debouncedSaveDesignTokens:b}=Ae(),D=Y("pageId",""),A=Y("siteWideUsage",{}),[h,I]=B("builtin"),[r,N]=B("view"),[m,F]=B(null),[w,g]=B(null),[v,M]=B(""),[T,Q]=B(""),[Pe,W]=B(""),[Fe,$e]=B(""),[ze,U]=B(!1),X=dt(null),_e=G(()=>m?m in S:!1,[m]),Ve=k(n=>!(n in S)||!(n in t)?!1:t[n].value!==S[n].value,[t]),je=G(()=>Object.entries(S).map(([i,C])=>{let E=t[i];return[i,E||C]}),[t]),Qe=G(()=>Object.entries(t).filter(([n])=>!(n in S)),[t]),We=k(n=>{if(!A)return{pageCount:0,partialCount:0};let i=0,C=0;return Object.entries(A).forEach(([E,$])=>{if(E===D||!($!=null&&$.designTokens))return;Object.keys($.designTokens).some(ot=>ot===n)&&($.isPartial?C++:i++)}),{pageCount:i,partialCount:C}},[A,D]),q=G(()=>{if(r==="edit"||r==="add")return v&&T?{name:v,value:T,id:m||void 0}:null;if(r==="view"&&w){let n=t[w]||S[w];if(n)return{name:n.name,value:n.value,id:w}}return null},[r,v,T,m,w,t]);Se(()=>{l&&l(q)},[q,l]),Se(()=>{if(!c)return;let n=r==="add"&&(v&&v.trim().length>0||T&&T.trim().length>0);c(n)},[r,v,T,c]);let O=k(()=>{F(null),M(""),Q(""),W(""),U(!1),N("view"),o==null||o(null)},[o]),de=k((n,i)=>{!m||r!=="edit"||!n.trim()||!i.trim()||!oe(n)||Object.entries(t).find(([E,$])=>$.name===n.trim()&&E!==m)||(U(!0),X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{let E={...t,[m]:{name:n.trim(),value:i.trim()}};u(E),p(),b(),U(!1),L.success(a("Token updated successfully")),O()},10))},[m,r,t,u,p,b,a,O]),Ge=k(n=>{let i=t[n]||S[n];i&&(F(n),M(i.name),Q(i.value),W(""),N("edit"))},[t]),He=k(()=>{F(null),M(""),Q(""),W(""),N("add"),o==null||o({name:"",value:""})},[o]),Ze=k(()=>{O()},[O]),Ke=k(()=>{if(!v.trim()||!T.trim()){L.error(a("Please fill in both token name and classes"));return}if(!oe(v)){L.error(a("Invalid design token name format"));return}if(Object.entries(t).find(([i,C])=>C.name===v.trim()&&i!==m)){L.error(a("Token already exists"));return}if(r==="edit"&&m)de(v,T);else if(r==="add"){let i=`${"dt#"}${rt(12)}`,C={...t,[i]:{name:v.trim(),value:T.trim()}};u(C),p(),d(),L.success(a("Token added successfully")),O()}},[v,T,t,m,r,a,de,u,p,d,O]),Ue=k(n=>{if(!(n in S))return;let i={...t};delete i[n],u(i),p(),d(),L.success(a("Token reset to built-in")),O()},[t,u,p,d,a,O]),Xe=k(n=>{let i={...t,[n]:{...t[n],archived:!0}};u(i),p(),d(),L.success(a("Token archived successfully"))},[t,u,p,d,a]),qe=k(n=>{let i={...t,[n]:{name:t[n].name,value:t[n].value}};u(i),p(),d(),L.success(a("Token unarchived successfully"))},[t,u,p,d,a]),Je=k(n=>{let i={...t};delete i[n],u(i),p(),d(),L.success(a("Token deleted successfully"))},[t,u,p,d,a]),Ye=k(n=>{g(n)},[]),et=k(n=>{let i=Ee(n);M(i);let C=Ie(i,t,a,r==="edit",m||void 0);W(C),r==="add"&&o&&o(E=>({...E,name:n}))},[t,a,r,m,o]),V=k(n=>{Q(n),r==="add"&&o&&o(i=>({...i,value:n}))},[r,o]),tt=k(n=>{let i=ye(De(mt(T,n)));V(i)},[T,V]),nt=k(n=>{let i=T.split(" ").filter(C=>C!==n).join(" ");V(i)},[T,V]),st={designTokens:t,activeTab:h,viewMode:r,editingTokenId:m,selectedTokenId:w,activeToken:q,searchQuery:Fe,tokenName:v,classes:T,tokenNameError:Pe,isSaving:ze,isEditingBuiltIn:_e,builtInTokens:je,customTokens:Qe,setActiveTab:I,setSearchQuery:$e,startEdit:Ge,startAdd:He,cancelEdit:Ze,saveToken:Ke,resetToBuiltIn:Ue,archiveToken:Xe,unarchiveToken:qe,deleteToken:Je,selectToken:Ye,handleTokenNameChange:et,handleClassesChange:V,handleAddClass:tt,handleRemoveClass:nt,isTokenEdited:Ve,getTokenUsageCount:We};return gt(Be.Provider,{value:st,children:e})},P=()=>{let e=ct(Be);if(!e)throw new Error("useDesignTokensContext must be used within DesignTokensProvider");return e};import{ArrowLeftIcon as pt}from"@radix-ui/react-icons";import{useTranslation as vt}from"react-i18next";import{jsx as x,jsxs as _}from"react/jsx-runtime";var ie=()=>{let{t:e}=vt(),l=z("designTokens"),{viewMode:c,isEditingBuiltIn:o,tokenName:a,classes:t,tokenNameError:u,isSaving:p,editingTokenId:d,handleTokenNameChange:b,handleAddClass:D,handleRemoveClass:A,cancelEdit:h,saveToken:I,resetToBuiltIn:r}=P(),N=c==="edit",m=l.toLowerCase().endsWith("s")?l.slice(0,-1):l,F=N?`${e("Edit")} ${m}`:`${e("Add")} ${m}`,w=N?`${e("Update")} ${m.toLowerCase()}`:`${e("Create a reusable")} ${m.toLowerCase()}`;return _("div",{className:"flex h-full flex-col",children:[_("div",{className:"mb-3 flex items-center gap-2 rounded-md border border-border/50 bg-accent p-1.5",children:[x(y,{variant:"ghost",size:"icon-xs",className:"hover:bg-secondary",onClick:h,children:x(pt,{className:"h-3 w-3"})}),_("div",{className:"flex-1",children:[x("h3",{className:"text-xs font-semibold text-foreground",children:F}),x("p",{className:"text-[10px] font-light text-muted-foreground",children:w})]}),N&&p&&x("div",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:x("div",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-primary"})})]}),_("div",{className:"flex-1 space-y-3 overflow-y-auto",children:[_("div",{className:"space-y-1.5",children:[x(fe,{htmlFor:"token-name",children:e("Token Name")}),x(ge,{id:"token-name",placeholder:"Button-Primary",value:a,onChange:g=>b(g.target.value),className:"h-7 text-xs",disabled:o,readOnly:o}),u?x("span",{className:"text-[10px] text-destructive",children:u}):x("span",{className:"text-[10px] font-light text-muted-foreground",children:o?`${e("Built-in")} ${m.toLowerCase()} ${e("names cannot be changed")}`:e("Button-Primary, Card-Header, Text-Large etc.")})]}),x(we,{from:"designToken",classFromProps:t,onAddNew:D,onRemove:A,showDesignTokenSuggestions:!1}),_("div",{className:"mt-3 flex items-center justify-end gap-2 pt-3",children:[x(y,{variant:"ghost",onClick:h,size:"sm",children:e("Cancel")}),N&&o&&x(y,{variant:"outline",onClick:()=>d&&r(d),size:"sm",className:"border-primary/50 text-primary hover:bg-primary/10",children:e("Reset to Built-in")}),x(y,{onClick:I,disabled:!a.trim()||!t.trim()||!!u,size:"sm",children:e(N?"Save":"Add")})]})]})]})};import{MagnifyingGlassIcon as ft,Pencil1Icon as Tt,PlusIcon as Re}from"@radix-ui/react-icons";import{useMemo as H,useState as kt}from"react";import{useTranslation as ce}from"react-i18next";import{twMerge as ae}from"cnfast";import{Fragment as Z,jsx as s,jsxs as f}from"react/jsx-runtime";var re=({tokenId:e,token:l,isBuiltIn:c,isEdited:o,isSelected:a,isArchived:t=!1})=>{let{t:u}=ce(),{selectToken:p,startEdit:d,unarchiveToken:b,deleteToken:D}=P(),{hasPermission:A}=J(),h=A(j["design_tokens:edit"]),I=A(j["design_tokens:delete"]);return f("div",{onClick:()=>p(e),className:ae("group relative flex w-full cursor-pointer items-center justify-between rounded border p-1.5 transition-all",t?"border-muted bg-muted/30 opacity-60":a?"bg-accent/70":"hover:bg-muted/5"),children:[f("div",{className:"min-w-0 flex-1",children:[f("div",{className:"flex items-center gap-1.5",children:[s("div",{className:ae("truncate text-xs font-medium text-foreground/80",t&&"text-muted-foreground"),children:l.name}),o&&c&&!t&&s(Ne,{variant:"active",className:"h-4 px-1 py-0 text-[9px] font-normal",children:u("Edited")})]}),s("div",{className:ae("line-clamp-1 w-[90%] text-[10px] font-light text-foreground/30",t&&"opacity-70"),children:l.value})]}),s("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100",children:t?f(Z,{children:[h&&s(y,{variant:"ghost",size:"sm",onClick:r=>{r.stopPropagation(),b(e)},children:s("span",{className:"text-[10px]",children:"Restore"})}),I&&s(y,{variant:"ghost",size:"sm",onClick:r=>{r.stopPropagation(),D(e)},className:"text-destructive hover:text-destructive",children:s("span",{className:"text-[10px]",children:"Delete"})})]}):h&&s(y,{variant:"ghost",size:"icon-xs",onClick:r=>{r.stopPropagation(),d(e)},children:s(Tt,{className:"!h-3 !w-3"})})})]})},le=({icon:e,message:l,actionLabel:c,onAction:o})=>f("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-center",children:[e||s(ft,{className:"h-8 w-8 text-muted-foreground"}),s("p",{className:"text-xs text-muted-foreground",children:l}),c&&o&&f(y,{variant:"default",onClick:o,size:"sm",className:"mt-4 h-7 text-xs leading-tight",children:[s(Re,{className:"mr-1 h-3 w-3"}),c]})]}),Me=()=>{let{t:e}=ce(),l=z("designTokens"),{builtInTokens:c,searchQuery:o,setSearchQuery:a,selectedTokenId:t,isTokenEdited:u}=P(),p=H(()=>c.filter(([,d])=>d.name.toLowerCase().includes(o.toLowerCase())||d.value.toLowerCase().includes(o.toLowerCase())),[c,o]);return f("div",{className:"flex h-full flex-col gap-2",children:[s("div",{className:"flex-shrink-0",children:s(ne,{value:o,setValue:a,placeholder:e("Search built-in {{label}}",{label:l})})}),s("div",{className:"max-h-[550px] min-h-0 flex-1 overflow-y-auto",children:f("div",{className:"space-y-1 pr-4",children:[p.length===0?s(le,{message:e("No tokens match your search")}):s(Z,{children:p.map(([d,b])=>s(re,{token:b,tokenId:d,isSelected:t===d,isBuiltIn:!0,isEdited:u(d),isArchived:!1},d))}),s("div",{className:"h-4"})]})})]})},Oe=()=>{let{t:e}=ce(),l=z("designTokens"),{customTokens:c,searchQuery:o,setSearchQuery:a,selectedTokenId:t,startAdd:u,archiveToken:p,getTokenUsageCount:d}=P(),{hasPermission:b}=J(),D=b(j["design_tokens:create"]),A=b(j["design_tokens:edit"]),[h,I]=kt({isOpen:!1,tokenId:null,tokenName:"",pageCount:0,partialCount:0}),r=H(()=>c.filter(([,g])=>g.name.toLowerCase().includes(o.toLowerCase())||g.value.toLowerCase().includes(o.toLowerCase())),[c,o]),N=H(()=>r.filter(([,g])=>!g.archived),[r]),m=H(()=>r.filter(([,g])=>g.archived),[r]),F=(g,v)=>{let{pageCount:M,partialCount:T}=d(g);I({isOpen:!0,tokenId:g,tokenName:v,pageCount:M,partialCount:T})},w=()=>{h.tokenId&&p(h.tokenId),I({isOpen:!1,tokenId:null,tokenName:"",pageCount:0,partialCount:0})};return f("div",{className:"flex h-full flex-col gap-2",children:[c.length>0&&s("div",{className:"flex-shrink-0",children:f("div",{className:"flex items-center justify-between gap-x-2",children:[s(ne,{value:o,setValue:a,placeholder:e("Search tokens")}),D&&f(y,{variant:"outline",onClick:u,size:"sm",className:"h-8",children:[s(Re,{}),e("Add")]})]})}),s("div",{className:"min-h-0 flex-1 overflow-y-auto",children:f("div",{className:"space-y-1 pr-4",children:[c.length===0?s(le,{message:`${e("No custom")} ${l.toLowerCase()} ${e("yet")}`,actionLabel:D?e("Add custom {{items}}",{items:l.toLowerCase()}):void 0,onAction:D?u:void 0}):r.length===0?s(le,{message:e("No tokens match your search")}):f(Z,{children:[N.length>0&&s("div",{className:"space-y-1",children:N.map(([g,v])=>f("div",{className:"group relative",children:[s(re,{token:v,tokenId:g,isSelected:t===g,isBuiltIn:!1,isEdited:!1,isArchived:!1}),A&&s(y,{variant:"ghost",size:"icon-xs",className:"absolute right-8 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100",onClick:M=>{M.stopPropagation(),F(g,v.name)},children:s("span",{className:"text-[10px]",children:"Archive"})})]},g))}),m.length>0&&f("div",{className:"mt-4 space-y-1",children:[s("div",{className:"px-2 py-1 text-[10px] font-semibold text-muted-foreground",children:e("Archived")}),m.map(([g,v])=>s(re,{token:v,tokenId:g,isSelected:t===g,isBuiltIn:!1,isEdited:!1,isArchived:!0},g))]})]}),s("div",{className:"h-4"})]})}),s(Te,{open:h.isOpen,onOpenChange:g=>{g||I({isOpen:!1,tokenId:null,tokenName:"",pageCount:0,partialCount:0})},children:f(ke,{children:[s(he,{children:e("Archive Design Token")}),f(xe,{className:"space-y-3",children:[f("p",{children:[e("This token is used on")," ",s("span",{className:"font-semibold",children:h.pageCount})," ",e("pages"),h.partialCount>0&&f(Z,{children:[" ",e("and")," ",s("span",{className:"font-semibold",children:h.partialCount})," ",e("partials")]}),"."]}),s("p",{className:"text-sm text-destructive",children:e("Archiving this token will remove the styling for those blocks.")}),s("p",{children:e("Do you wish to continue?")})]}),f("div",{className:"flex justify-end gap-2",children:[s(Ce,{children:e("Cancel")}),s(be,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:e("Archive")})]})]})})]})};import{jsx as R,jsxs as K}from"react/jsx-runtime";var xt=()=>{let{t:e}=ht(),l=z("designTokens"),{activeTab:c,setActiveTab:o,viewMode:a}=P();return R("div",{className:"flex h-full w-full flex-col",children:K(pe,{value:c,onValueChange:t=>o(t),children:[K(ve,{className:"mb-3 w-full",children:[K(ee,{value:"builtin",className:"flex-1",children:[e("Built-in")," ",l]}),K(ee,{value:"custom",className:"flex-1",children:[e("Custom")," ",l]})]}),R(te,{value:"builtin",className:"mt-0 flex-1",children:a==="view"?R(Me,{}):R(ie,{})}),R(te,{value:"custom",className:"mt-0 flex-1",children:a==="view"?R(Oe,{}):R(ie,{})})]})})},bt=({onActiveTokenChange:e,onDirtyStateChange:l,setCreatePreview:c})=>R(Le,{onActiveTokenChange:e,onDirtyStateChange:l,setCreatePreview:c,children:R(xt,{})}),kn=bt;export{kn as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as o}from"./chunk-DZ72OHTD.js";var i={logQuery(r,e){o(r,e)}};export{i as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-LWYDGDPW.js";import*as e from"@radix-ui/react-label";import{cva as l}from"class-variance-authority";import*as o from"react";import{jsx as n}from"react/jsx-runtime";var p=l("text-xs font-light leading-none text-foreground/80 dark:text-foreground/60 peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),m=o.forwardRef(({className:a,...r},i)=>n(e.Root,{ref:i,className:t(p(),a),...r}));m.displayName=e.Root.displayName;export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as t}from"./chunk-LWYDGDPW.js";import*as o from"@radix-ui/react-separator";import*as e from"react";import{jsx as R}from"react/jsx-runtime";var f=e.forwardRef(({className:a,orientation:r="horizontal",decorative:i=!0,...p},m)=>R(o.Root,{ref:m,decorative:i,orientation:r,className:t("shrink-0 bg-border",r==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",a),...p}));f.displayName=o.Root.displayName;export{f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as C}from"./chunk-JYBTQ3YX.js";import{j as w,k as $}from"./chunk-DZ72OHTD.js";import{c as p,e as f,g as y,i as d}from"./chunk-OQZ4EPOM.js";import{consola as V}from"consola";import{cache as A}from"react";var T={persistentCache:(t=>t),invalidatePath:()=>{},invalidateTag:()=>{},runAfterResponse:t=>{Promise.resolve(t()).catch(console.error)},pageNotFound:()=>{throw new Error("Page not found")}},K=T,te=t=>{K={...T,...t}};var b=()=>K;import"server-only";function S(t,e){let n=e.map(F).join(":");return n?`${t}:${n}`:t}function k(t){return t.join(":")}function P(t,e){if(e.length===0)return t;let n=e.map(G).filter(Boolean);return n.length>0?n.join(" \xB7 "):t}function x(t){return t.map(e=>e.startsWith("website-settings-")?`app=${o(e.replace("website-settings-",""))}`:e.startsWith("pages-metadata-")?L(e):e.startsWith("page-by-slug-")?M(e):e.startsWith("page-slugs-batch-")?O(e):e.startsWith("page-slug-")?j(e):e.startsWith("alternate-")?E(e):e.startsWith("breadcrumb-")?D(e):e.startsWith("page-details-")?_(e):e.startsWith("full-page-")?N(e):e.startsWith("page-styles-")?q(e):e.includes("-")&&e.length>20?o(e):e).join(" \xB7 ")}function L(t){let e=t.slice(15),n=e.endsWith("-draft")?"draft":e.endsWith("-online")?"online":"unknown",r=e.replace(/-(draft|online)$/,"");return`app=${o(r)} \xB7 ${n}`}function m(t,e,n){let r=t.slice(e.length),i=r.endsWith("-draft")?"draft":r.endsWith("-online")?"online":"unknown",s=r.replace(/-(draft|online)(-.+)?$/,""),l=r.includes("-draft-")?r.split("-draft-")[1]:r.includes("-online-")?r.split("-online-")[1]:void 0;return l?`app=${o(s)} \xB7 ${i} \xB7 ${n}=${l.slice(0,12)}`:`app=${o(s)} \xB7 ${i}`}function M(t){return m(t,"page-by-slug-","slug")}function j(t){return m(t,"page-slug-","page")}function O(t){let e=t.slice(17),n=e.indexOf("-online-"),r=e.indexOf("-draft-");if(n>0){let i=e.slice(0,n),a=e.slice(n+8),s=a?a.split(",").filter(Boolean).length:0;return`app=${o(i)} \xB7 online \xB7 ids=${s}`}if(r>0){let i=e.slice(0,r),a=e.slice(r+7),s=a?a.split(",").filter(Boolean).length:0;return`app=${o(i)} \xB7 draft \xB7 ids=${s}`}return o(e)}function E(t){return m(t,"alternate-","alt")}function D(t){return m(t,"breadcrumb-","crumb")}function _(t){let e=t.slice(13);if(e.length<=36)return`app=${o(e)}`;let n=e.slice(0,36),r=e.slice(37);return`app=${o(n)} page=${o(r)}`}function N(t){let e=t.slice(10);if(e.length<=36)return`app=${o(e)}`;let n=e.slice(0,36),r=e.slice(37);return`app=${o(n)} page=${o(r)}`}function q(t){let e=t.slice(12);if(e.length<=36)return`app=${o(e)}`;let n=e.slice(0,36),r=e.slice(37);return`app=${o(n)} page=${o(r)}`}function F(t){if(t===null)return"null";if(t===void 0)return"undefined";if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);try{return JSON.stringify(t)}catch(e){return String(t)}}function G(t){if(typeof t=="string")return t.length>36&&t.includes("-")?o(t):t;if(typeof t=="number"||typeof t=="boolean")return String(t);if(t&&typeof t=="object"){let n=t;if(typeof n.slug=="string"||typeof n.pageType=="string"){let r=[typeof n.slug=="string"?`slug=${n.slug}`:null,typeof n.pageType=="string"?`type=${n.pageType}`:null,typeof n.pageLang=="string"?`lang=${n.pageLang}`:null,typeof n.pageId=="string"?`page=${o(n.pageId)}`:null].filter(Boolean);if(r.length>0)return r.join(" ")}if(typeof n.id=="string")return[`page=${o(n.id)}`,typeof n.slug=="string"?`slug=${n.slug}`:null,typeof n.lang=="string"?`lang=${n.lang}`:null].filter(Boolean).join(" ");if(Array.isArray(n))return`[${n.length} items]`}let e=F(t);return e.length>60?`${e.slice(0,57)}\u2026`:e}function o(t){return t.length<=8?t:t.slice(0,8)}function I(t,e){return e!=null?e:t.name||"anonymous"}function H(t,e){let n=I(t,e),r=A((...i)=>(p(1)&&$("request",n,P(n,i)),t(...i)));return((...i)=>{var u;let a=S(n,i),s=f(),l=(u=s==null?void 0:s.cacheKeys.has(a))!=null?u:!1;return l&&p(1)&&w("request",n,P(n,i)),s&&!l&&s.cacheKeys.set(a,!0),r(...i)})}function J(t,e,n=[],r=!1,i){let a=I(t,i),s=k(e),l=x(e),u=async(...h)=>{let g=f();return y(g,async()=>{let c=f();return c&&c.cacheKeys.set(`persistent:${s}`,!0),p(1)&&$("persistent",a,l),t(...h)})},R=b().persistentCache(u,e,{revalidate:r,tags:n});return A(async(...h)=>{let g=`persistent-pending:${s}`,c=f();c&&(c.cacheKeys.delete(`persistent:${s}`),c.cacheKeys.set(g,!0));let B=await y(c,()=>R(...h));return p(1)&&(c!=null&&c.cacheKeys.has(g))&&!c.cacheKeys.has(`persistent:${s}`)&&w("persistent",a,l),c==null||c.cacheKeys.delete(g),B})}function z(t,e,n,r=!1,i){if((d().draftMode?"memory":"persistent")==="memory")return H(t,i);if(!e)throw new Error("keyParts required for persistent cache strategy");return J(t,e,n,r,i)}import Q from"fs/promises";import U from"path";import W from"postcss";async function Y(){return U.resolve("./public/chaistyles.css")}async function v(t){try{let e=await Y(),n=await Q.readFile(e,"utf-8"),r=W.parse(n),i=W.parse(t),a=new Set;return r.walkRules(s=>{a.add(s.selector)}),i.walkRules(s=>{var u;let l=((u=s.parent)==null?void 0:u.type)==="atrule"&&"name"in s.parent&&s.parent.name==="media";a.has(s.selector)&&!l&&s.remove()}),i.toString()}catch(e){return console.error("Error filtering styles:",e),t}}var X=30,Z=V.withTag("ChaiPageStyles");async function ee(t){let e=t.length,n=performance.now();try{let i=(await C(t)).replace(/\s+/g," ").trim();return await v(i)}finally{let r=Math.round(performance.now()-n);r>X&&Z.warn(`Slow page styles compile: ${r}ms \xB7 blocks: ${e}`)}}var Ce=async(t,e)=>{let n=d();return await z(ee,[`page-styles-${n.appId}-${t}`],["page-styles",`page-${t}`],!1,"fetchPageStyles")(e)};export{te as a,b,H as c,J as d,z as e,ee as f,Ce as g};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-LWYDGDPW.js";import*as e from"@radix-ui/react-dropdown-menu";import{CheckIcon as m,ChevronRightIcon as u,CircleIcon as c}from"@radix-ui/react-icons";import*as d from"react";import{jsx as i,jsxs as p}from"react/jsx-runtime";var x=e.Root,l=d.forwardRef(({className:o,...t},n)=>i(e.Trigger,{ref:n,className:a("outline-none focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",o),...t}));l.displayName=e.Trigger.displayName;var N=e.Group,C=e.Portal,I=e.Sub,S=e.RadioGroup,f=d.forwardRef(({className:o,inset:t,children:n,...r},s)=>p(e.SubTrigger,{ref:s,className:a("flex cursor-default select-none items-center gap-1.5 rounded-sm px-2 py-1 text-xs outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-3.5 [&_svg]:shrink-0",t&&"pl-7",o),...r,children:[n,i(u,{className:"ml-auto h-3 w-3"})]}));f.displayName=e.SubTrigger.displayName;var w=d.forwardRef(({className:o,...t},n)=>i(e.SubContent,{ref:n,className:a("z-50 min-w-[7rem] origin-[--radix-dropdown-menu-content-transform-origin] overflow-hidden rounded-md border bg-popover p-0.5 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o),...t}));w.displayName=e.SubContent.displayName;var v=d.forwardRef(({className:o,sideOffset:t=4,...n},r)=>i(e.Portal,{children:i(e.Content,{ref:r,sideOffset:t,className:a("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[7rem] overflow-y-auto overflow-x-hidden rounded-sm border border-foreground/10 bg-popover text-popover-foreground shadow-2xl shadow-foreground/10","origin-[--radix-dropdown-menu-content-transform-origin] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o),...n})}));v.displayName=e.Content.displayName;var M=d.forwardRef(({className:o,inset:t,...n},r)=>i(e.Item,{ref:r,className:a("relative flex cursor-pointer select-none items-center gap-1.5 px-2 py-1 text-xs font-light outline-none transition-colors duration-300 hover:bg-accent focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-3.5 [&>svg]:shrink-0",t&&"pl-8",o),...n}));M.displayName=e.Item.displayName;var g=d.forwardRef(({className:o,children:t,checked:n,...r},s)=>p(e.CheckboxItem,{ref:s,className:a("relative flex cursor-pointer select-none items-center gap-1.5 py-1 pl-6 pr-2 text-xs font-light outline-none transition-colors duration-300 hover:bg-accent focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-3.5 [&>svg]:shrink-0",o),checked:n,...r,children:[i("span",{className:"absolute left-1.5 flex h-3 w-3 items-center justify-center",children:i(e.ItemIndicator,{children:i(m,{className:"h-3 w-3"})})}),t]}));g.displayName=e.CheckboxItem.displayName;var D=d.forwardRef(({className:o,children:t,...n},r)=>p(e.RadioItem,{ref:r,className:a("relative flex cursor-default select-none items-center rounded-sm py-1 pl-7 pr-2 text-xs outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o),...n,children:[i("span",{className:"absolute left-1.5 flex h-3 w-3 items-center justify-center",children:i(e.ItemIndicator,{children:i(c,{className:"h-1.5 w-1.5 fill-current"})})}),t]}));D.displayName=e.RadioItem.displayName;var R=d.forwardRef(({className:o,inset:t,...n},r)=>i(e.Label,{ref:r,className:a("border-none px-2 py-1 text-xs font-light text-foreground/50",t&&"pl-7",o),...n}));R.displayName=e.Label.displayName;var P=d.forwardRef(({className:o,...t},n)=>i(e.Separator,{ref:n,className:a("-mx-0.5 my-0.5 h-px border-b border-border",o),...t}));P.displayName=e.Separator.displayName;var b=({className:o,...t})=>i("span",{className:a("ml-auto text-xs tracking-widest opacity-60",o),...t});b.displayName="DropdownMenuShortcut";export{x as a,l as b,N as c,C as d,I as e,S as f,f as g,w as h,v as i,M as j,g as k,D as l,R as m,P as n,b as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isEmpty as l}from"lodash-es";import p,{useState as r}from"react";import{jsx as M}from"react/jsx-runtime";var v="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==",H=({src:e,alt:c="",fallbackSrc:t=v,onError:a,onLoad:i,loading:o="lazy",className:E,...Z})=>{let[n,s]=r(e||t),[m,g]=r(!1),d=I=>{m||(g(!0),s(t),a==null||a(I))},h=I=>{g(!1),i==null||i(I)};return p.useEffect(()=>{e&&e!==n&&!m&&s(e)},[e,n,m]),l(e)&&l(t)?null:M("img",{...Z,src:n,alt:c,loading:o,onError:d,onLoad:h,className:E})};export{H as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as n}from"./chunk-AOJE5WI3.js";import{b as i}from"./chunk-3IT7IIAV.js";import{Check as a,Sparkles as d}from"lucide-react";import{jsx as t,jsxs as r}from"react/jsx-runtime";var o=()=>r("div",{className:"bg-surface flex h-[600px] flex-col space-y-4",children:[t("div",{className:"grid grid-cols-1 gap-4 pb-4 md:grid-cols-3",children:[{id:"basic",name:"Basic Credits",credits:1e4,price:"$10",description:"Good for starting with AI features."},{id:"pro",name:"Pro Credits",credits:5e4,price:"$40",description:"Perfect for heavy AI content generation."},{id:"enterprise",name:"Enterprise Credits",credits:2e5,price:"$150",description:"Best for teams and large projects."}].map(e=>r("div",{className:"group relative overflow-hidden rounded-xl border p-4 transition-colors hover:border-primary/50",children:[r("div",{className:"mb-2 flex items-start justify-between",children:[t("h3",{className:"text-sm font-semibold",children:e.name}),t("span",{className:"text-sm font-bold text-primary",children:e.price})]}),t("p",{className:"mb-4 text-xs text-muted-foreground",children:e.description}),r("div",{className:"mt-auto flex items-center justify-between border-t border-dashed pt-2",children:[r("span",{className:"flex items-center gap-1 text-xs font-semibold",children:[t(d,{className:"h-3 w-3 text-primary"}),e.credits.toLocaleString()," Credits"]}),t(i,{size:"sm",className:"h-7 px-4 text-xs",children:"Buy Now"})]})]},e.id))}),t("div",{className:"rounded-xl bg-muted/30 p-4",children:r("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[t(a,{className:"mt-0.5 h-3.5 w-3.5 flex-shrink-0 text-emerald-500"}),r("span",{children:[t("b",{children:"No Expiration:"})," Add-on credits are added instantly to your account and never expire. They are used only after your monthly credits are exhausted."]})]})})]}),c="ai-addon-credits",m=()=>null,b={id:c,label:"Purchase Credits",panel:o,button:m,position:"top",width:800,view:"modal"};import{useQuery as l}from"@tanstack/react-query";var u="AI_CREDITS";function h(){let s=n();return l({queryKey:[u],queryFn:async()=>{let e=await s({body:{action:"AI_GET_CREDITS",data:{}}});return e!=null&&e.success&&e.credits?e.credits:null},staleTime:3e4,gcTime:6e4})}export{u as a,h as b,c,b as d};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=[{id:"google/gemini-2.5-flash",name:"Gemini 2.5 Flash",provider:"google",description:"0.5x Credits",multiplier:.5},{id:"google/gemini-2.5-pro",name:"Gemini 2.5 Pro",provider:"google",description:"1.25x Credits",multiplier:1.25},{id:"google/gemini-3-flash",name:"Gemini 3 Flash",provider:"google",description:"1x Credits",multiplier:1},{id:"google/gemini-3-pro",name:"Gemini 3 Pro",provider:"google",description:"2.5x Credits",multiplier:2.5},{id:"openai/gpt-5",name:"GPT-5",provider:"openai",description:"2x Credits",multiplier:2},{id:"anthropic/claude-haiku-4.5",name:"Claude Haiku 4.5",provider:"anthropic",description:"1x Credits",multiplier:1},{id:"anthropic/claude-sonnet-4",name:"Claude Sonnet 4",provider:"anthropic",description:"3x Credits",multiplier:3},{id:"anthropic/claude-sonnet-4.5",name:"Claude Sonnet 4.5",provider:"anthropic",description:"3x Credits",multiplier:3},{id:"openai/gpt-4.1",name:"GPT-4.1",provider:"openai",description:"2x Credits",multiplier:2}],o="google/gemini-3-flash";var r=()=>i.find(e=>e.id===o)||i[0];export{i as a,o as b,r as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-LWYDGDPW.js";import*as e from"@radix-ui/react-dialog";import{Cross1Icon as f}from"@radix-ui/react-icons";import{cva as c}from"class-variance-authority";import*as r from"react";import{jsx as o,jsxs as n}from"react/jsx-runtime";var N=e.Root,C=e.Trigger,b=e.Close,p=e.Portal,m=r.forwardRef(({className:t,...i},a)=>o(e.Overlay,{className:s("fixed inset-0 z-50 bg-background/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...i,ref:a}));m.displayName=e.Overlay.displayName;var h=c("fixed z-50 gap-4 bg-surface p-4 shadow-lg transition ease-in-out focus:outline-none data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),S=r.forwardRef(({side:t="right",className:i,children:a,...l},d)=>n(p,{children:[o(m,{}),n(e.Content,{ref:d,className:s(h({side:t}),i),...l,children:[n(e.Close,{className:"ring-offset-surface absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[o(f,{className:"h-4 w-4 text-foreground"}),o("span",{className:"sr-only",children:"Close"})]}),a]})]}));S.displayName=e.Content.displayName;var v=({className:t,...i})=>o("div",{className:s("flex flex-col space-y-2 text-center sm:text-left",t),...i});v.displayName="SheetHeader";var u=({className:t,...i})=>o("div",{className:s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...i});u.displayName="SheetFooter";var P=r.forwardRef(({className:t,...i},a)=>o(e.Title,{ref:a,className:s("text-sm font-medium leading-tight text-foreground",t),...i}));P.displayName=e.Title.displayName;var y=r.forwardRef(({className:t,...i},a)=>o(e.Description,{ref:a,className:s("text-sm text-muted-foreground",t),...i}));y.displayName=e.Description.displayName;export{N as a,C as b,b as c,p as d,m as e,S as f,v as g,u as h,P as i,y as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-LWYDGDPW.js";import*as o from"@radix-ui/react-popover";import*as n from"react";import{jsx as a}from"react/jsx-runtime";var v=o.Root,d=n.forwardRef(({className:e,...t},i)=>a(o.Trigger,{ref:i,className:r("outline-none focus:outline-none focus:ring-0",e),...t}));d.displayName=o.Trigger.displayName;var f=o.Anchor,s=n.forwardRef(({className:e,align:t="center",sideOffset:i=4,...p},m)=>a(o.Portal,{children:a(o.Content,{ref:m,align:t,sideOffset:i,className:r("z-50 w-72 origin-[--radix-popover-content-transform-origin] rounded-md border bg-popover p-2 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...p})}));s.displayName=o.Content.displayName;export{v as a,d as b,f as c,s as d};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function v(t){let i={class:"className",for:"htmlFor",tabindex:"tabIndex",readonly:"readOnly",maxlength:"maxLength",minlength:"minLength",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",novalidate:"noValidate",crossorigin:"crossOrigin",datetime:"dateTime",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",allowfullscreen:"allowFullScreen"};if(i[t.toLowerCase()])return i[t.toLowerCase()];let o={"accent-height":"accentHeight","alignment-baseline":"alignmentBaseline","arabic-form":"arabicForm","baseline-shift":"baselineShift","cap-height":"capHeight","clip-path":"clipPath","clip-rule":"clipRule","color-interpolation":"colorInterpolation","color-interpolation-filters":"colorInterpolationFilters","color-profile":"colorProfile","color-rendering":"colorRendering","dominant-baseline":"dominantBaseline","enable-background":"enableBackground","fill-opacity":"fillOpacity","fill-rule":"fillRule","flood-color":"floodColor","flood-opacity":"floodOpacity","font-family":"fontFamily","font-size":"fontSize","font-size-adjust":"fontSizeAdjust","font-stretch":"fontStretch","font-style":"fontStyle","font-variant":"fontVariant","font-weight":"fontWeight","glyph-name":"glyphName","glyph-orientation-horizontal":"glyphOrientationHorizontal","glyph-orientation-vertical":"glyphOrientationVertical","horiz-adv-x":"horizAdvX","horiz-origin-x":"horizOriginX","image-rendering":"imageRendering","letter-spacing":"letterSpacing","lighting-color":"lightingColor","marker-end":"markerEnd","marker-mid":"markerMid","marker-start":"markerStart","overline-position":"overlinePosition","overline-thickness":"overlineThickness","paint-order":"paintOrder","panose-1":"panose1","pointer-events":"pointerEvents","rendering-intent":"renderingIntent","shape-rendering":"shapeRendering","stop-color":"stopColor","stop-opacity":"stopOpacity","strikethrough-position":"strikethroughPosition","strikethrough-thickness":"strikethroughThickness","stroke-dasharray":"strokeDasharray","stroke-dashoffset":"strokeDashoffset","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","stroke-miterlimit":"strokeMiterlimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-anchor":"textAnchor","text-decoration":"textDecoration","text-rendering":"textRendering","underline-position":"underlinePosition","underline-thickness":"underlineThickness","unicode-bidi":"unicodeBidi","unicode-range":"unicodeRange","units-per-em":"unitsPerEm","v-alphabetic":"vAlphabetic","v-hanging":"vHanging","v-ideographic":"vIdeographic","v-mathematical":"vMathematical","vector-effect":"vectorEffect","vert-adv-y":"vertAdvY","vert-origin-x":"vertOriginX","vert-origin-y":"vertOriginY","word-spacing":"wordSpacing","writing-mode":"writingMode","x-height":"xHeight"};return o[t]?o[t]:t}function m(t,i=0){var y;if(Array.isArray(t)){if(t.length===0)return"";if(t.length===1)return m(t[0],i);let e=" ".repeat(i),a=`${e}<>
|
|
2
|
+
`;for(let n of t)a+=m(n,i+1);return a+=`${e}</>
|
|
3
|
+
`,a}let o=" ".repeat(i);if(t.nodeType===Node.TEXT_NODE){let e=(y=t.textContent)==null?void 0:y.trim();return e?`${o}${e}
|
|
4
|
+
`:""}if(t.nodeType!==Node.ELEMENT_NODE)return"";let s=t.tagName.toLowerCase();if(["img","br","hr","input","meta","link","area","base","col","embed","source","track","wbr"].includes(s)){let e=[];for(let n of t.attributes)if(n.name.startsWith("on")&&n.name!=="on"){let l=n.name.toLowerCase().replace(/on(\w)/,(c,p)=>"on"+p.toUpperCase());e.push(`${l}={${n.value}}`)}else if(n.name==="style"&&n.value){let l=n.value.split(";").reduce((c,p)=>{let[g,f]=p.split(":").map(h=>h.trim());if(g&&f){let h=g.replace(/-([a-z])/g,b=>b[1].toUpperCase());c[h]=f.replace(/['"]/g,"")}return c},{});e.push(`style={${JSON.stringify(l)}}`)}else{let l=v(n.name);e.push(`${l}="${n.value}"`)}let a=e.length>0?` ${e.join(" ")}`:"";return`${o}<${s}${a} />
|
|
5
|
+
`}let r=`${o}<${s}`,d=[];for(let e of t.attributes)if(e.name.startsWith("on")&&e.name!=="on"){let a=e.name.toLowerCase().replace(/on(\w)/,(n,l)=>"on"+l.toUpperCase());d.push(`${a}={${e.value}}`)}else if(e.name==="style"&&e.value){let a=e.value.split(";").reduce((n,l)=>{let[c,p]=l.split(":").map(g=>g.trim());if(c&&p){let g=c.replace(/-([a-z])/g,f=>f[1].toUpperCase());n[g]=p.replace(/['"]/g,"")}return n},{});d.push(`style={${JSON.stringify(a)}}`)}else{let a=v(e.name);d.push(`${a}="${e.value}"`)}d.length>0&&(r+=" "+d.join(" "));let u=Array.from(t.childNodes);if(!u.some(e=>{var a;return e.nodeType===Node.TEXT_NODE?(a=e.textContent)==null?void 0:a.trim():!0}))r+=` />
|
|
6
|
+
`;else{r+=`>
|
|
7
|
+
`;for(let e of u)r+=m(e,i+1);r+=`${o}</${s}>
|
|
8
|
+
`}return r}function w(t){if(!t)return"";let i="",o=0,s=" ";return t=t.replace(/>\s+</g,"><").trim(),t.split(/(<\/?[^>]+>)/g).filter(r=>r.trim()).forEach(r=>{r.match(/^<\/\w/)?(o=Math.max(0,o-1),i+=s.repeat(o)+r+`
|
|
9
|
+
`):r.match(/\/>$/)?i+=s.repeat(o)+r+`
|
|
10
|
+
`:r.match(/^<\w[^>]*[^\/]>$/)?(i+=s.repeat(o)+r+`
|
|
11
|
+
`,o++):r.trim()&&(i+=s.repeat(o)+r.trim()+`
|
|
12
|
+
`)}),i.trim()}import{atom as C,useAtom as x}from"jotai";var $=C(null),N=()=>x($);export{m as a,w as b,N as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-T2YYNX6Z.js";import{useCallback as o}from"react";var w=()=>{let[,s]=n();return o((r,t)=>{let a=new URLSearchParams(window.location.search).get("lang"),e=new URLSearchParams({page:r});a&&e.set("lang",a),window.history.pushState({},"",`?${e.toString()}`),s(e),window.dispatchEvent(new PopStateEvent("popstate")),t==null||t()},[s])};export{w as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as i}from"./chunk-32HH35VD.js";import{a as r}from"./chunk-LWYDGDPW.js";import{jsx as e,jsxs as d}from"react/jsx-runtime";var f=({className:a,content:s,isLoading:t=!1,...o})=>e("div",{className:r("is-assistant flex w-full max-w-[80%] flex-col gap-2",a),...o,children:e("div",{className:"flex w-fit flex-col gap-2 overflow-hidden text-sm",children:e("div",{className:"flex items-center gap-2 rounded-lg border border-muted-foreground/20 bg-muted/50 p-3",children:d("div",{className:"flex flex-1 items-center gap-2",children:[t&&e(i,{duration:1.5,children:s}),!t&&e("div",{className:"text-xs text-muted-foreground/80",children:s})]})})})});export{f as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as A}from"./chunk-ONSZ462E.js";import{b as p,d as h}from"./chunk-ZAU65LBG.js";import{useSetAtom as N}from"jotai";import{get as x,noop as m}from"lodash-es";import{useCallback as L}from"react";var C=async(t,e,n={},o)=>await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",...n},body:JSON.stringify(e),...(o==null?void 0:o.signal)instanceof AbortSignal?{signal:o.signal}:{}});var R="_cb_lx";function S(t){let e="";for(let n=0;n<t.length;n++)e+=String.fromCharCode(t.charCodeAt(n)^92);return e}function P(t){return btoa(S(String(t)))}function F(t){try{let e=Number(S(atob(t)));return Number.isFinite(e)&&e>0?e:null}catch(e){return null}}function k(){if(typeof window=="undefined")return null;try{let t=window.localStorage.getItem(R);return t?F(t):null}catch(t){return null}}function y(t){if(typeof window!="undefined")try{window.localStorage.setItem(R,P(t))}catch(e){}}var s=class extends Error{constructor(e,n,o,a){super(e),this.name="ChaiHttpActionRequestError",this.code=n,this.status=o,this.metadata=a}};function f(t){return!!(t&&typeof t=="object"&&"ok"in t&&t.ok===!1)}function b(t,e){if(t&&typeof t=="object"&&"ok"in t){let n=t;if(!n.ok)throw new s(n.error.message,n.error.code,n.error.status,n.error.metadata);return n.data}throw new s("Invalid action response","INVALID_RESPONSE",e)}var G=()=>{let t=O(),e=h();return L(async({body:n,headers:o={},url:a=e,streamResponse:d=!1,options:c})=>t(a,n,o,d,c),[t,e])},O=()=>{let t=p("onLogout",m),e=p("getAccessToken",m),n=p("beforeRequest",m),o=h(),a=N(A);return L(async(d=o,c,E={},T=!1,H)=>{let l=c;if(n)try{let r=await n({action:c.action,data:c.data});if(r===null)return console.log("Request cancelled by beforeRequest hook:",c.action),null;r&&typeof r=="object"&&"action"in r&&(l={action:r.action,data:r.data})}catch(r){console.error("Error in beforeRequest hook:",r)}let I=await e(),w=k();try{let r=x(l,"action","").toLowerCase(),u=await C(d+(r?`?action=${r}`:""),l,{...E,Authorization:`Bearer ${I}`,...w?{"x-chai-license-check":String(w)}:{}},H);if(T)return u;let i=await u.json(),g=x(i,"license");if(g&&(a(g),g.refreshed&&y(Date.now())),u.status===401||f(i)&&i.error.status===401)return console.log("401 Response",i),await t("SESSION_EXPIRED"),null;if(!u.ok||f(i))throw f(i)?new s(i.error.message,i.error.code,i.error.status,i.error.metadata):new s("Something went wrong.","INTERNAL_ERROR",u.status||500);return b(i,u.status)}catch(r){throw console.error("API request failed:",l,r),r}},[t,e,n,o,a])};export{C as a,f as b,b as c,G as d,O as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{H as i}from"./chunk-2NYUIXUX.js";var c=({permission:e,permissions:r,children:n,fallback:t=null})=>{let{hasPermission:s}=i();return e&&!s(e)||r&&!r.some(o=>s(o))?t:n},m=c;export{c as a,m as b};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{a}from"./chunk-HA7LF3RV.js";function p({userInput:t,language:o="en",currentHtml:e}){let n=a[o]||"English";if(e&&e.trim().length>0){let l=e.includes('data-ai-selected="true"')?`
|
|
2
|
+
NOTE: The element with data-ai-selected="true" is the user's current focus. While you have the full page context, prioritize changes to this selected element unless the user request explicitly requires broader changes.`:"";return`
|
|
3
|
+
MODE: EDIT
|
|
4
|
+
CURRENT HTML:
|
|
5
|
+
${e}
|
|
6
|
+
|
|
7
|
+
USER REQUEST: ${t}
|
|
8
|
+
Use ${n} language.${l}
|
|
9
|
+
`.trim()}return`
|
|
10
|
+
USER REQUEST: ${t}
|
|
11
|
+
Use ${n} language.
|
|
12
|
+
`.trim()}function c({fallbackLang:t,language:o,blocks:e=[],userInput:n}){let r=a[o]||"English";return`
|
|
13
|
+
USER REQUEST: ${n||"Translate the content"}
|
|
14
|
+
LANGUAGE TO TRANSLATE: ${r}
|
|
15
|
+
REQUESTED TRANSLATION LANGUAGE CODE: ${o}
|
|
16
|
+
FALLBACK LANGUAGE: ${a[t]}
|
|
17
|
+
BLOCKS: ${JSON.stringify(e)}`.trim()}export{p as a,c as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as r}from"./chunk-LWYDGDPW.js";import*as e from"@radix-ui/react-slider";import*as o from"react";import{jsx as i,jsxs as d}from"react/jsx-runtime";var m=o.forwardRef(({className:l,...t},a)=>d(e.Root,{ref:a,className:r("relative flex w-full touch-none select-none items-center",l),...t,children:[i(e.Track,{className:"relative h-1 w-full grow overflow-hidden rounded-full bg-muted",children:i(e.Range,{className:"absolute h-full bg-primary"})}),i(e.Thumb,{className:"block h-3 w-3 rounded-full border border-primary bg-primary shadow transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));m.displayName=e.Root.displayName;export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as s}from"./chunk-3IT7IIAV.js";import{a as o}from"./chunk-LWYDGDPW.js";import*as e from"@radix-ui/react-alert-dialog";import*as r from"react";import{jsx as l,jsxs as R}from"react/jsx-runtime";var y=e.Root,u=e.Trigger,n=e.Portal,m=r.forwardRef(({className:t,...i},a)=>l(e.Overlay,{className:o("fixed inset-0 z-50 bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...i,ref:a}));m.displayName=e.Overlay.displayName;var c=r.forwardRef(({className:t,...i},a)=>R(n,{children:[l(m,{}),l(e.Content,{ref:a,className:o("bg-surface fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...i})]}));c.displayName=e.Content.displayName;var f=({className:t,...i})=>l("div",{className:o("flex flex-col space-y-2 text-center sm:text-left",t),...i});f.displayName="AlertDialogHeader";var d=({className:t,...i})=>l("div",{className:o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...i});d.displayName="AlertDialogFooter";var p=r.forwardRef(({className:t,...i},a)=>l(e.Title,{ref:a,className:o("text-lg font-semibold text-foreground",t),...i}));p.displayName=e.Title.displayName;var g=r.forwardRef(({className:t,...i},a)=>l(e.Description,{ref:a,className:o("text-sm text-muted-foreground",t),...i}));g.displayName=e.Description.displayName;var A=r.forwardRef(({className:t,...i},a)=>l(e.Action,{ref:a,className:o(s(),t),...i}));A.displayName=e.Action.displayName;var D=r.forwardRef(({className:t,...i},a)=>l(e.Cancel,{ref:a,className:o(s({variant:"outline"}),"mt-2 sm:mt-0",t),...i}));D.displayName=e.Cancel.displayName;export{y as a,u as b,n as c,m as d,c as e,f,d as g,p as h,g as i,A as j,D as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as B,c as x}from"./chunk-VKSRWZCO.js";import{f as J,k as m,n as K,t as s,w as n}from"./chunk-3UEPBBE4.js";import*as ee from"react";import{jsx as M}from"react/jsx-runtime";var Tt=({className:e="",inBuilder:o})=>o?M("div",{className:x("pointer-events-none flex h-20 flex-col items-center justify-center p-2",e),children:M("div",{className:"h-full w-full rounded bg-gray-200 p-2 dark:bg-gray-800",children:M("div",{className:"flex h-full w-full items-center justify-center outline-dashed outline-1 -outline-offset-1 outline-gray-400 duration-300 dark:outline-gray-700"})})}):null,f=Tt;import{jsx as _t}from"react/jsx-runtime";var te=e=>{let{blockProps:o,inBuilder:t,backgroundImage:r,children:l,tag:i="div",styles:a}=e,p=l;l||(p=_t(f,{inBuilder:t}));let c={};return r&&(c={backgroundImage:`url(${r})`}),ee.createElement(i,{...o,...a,style:c},p)},oe={type:"Box",description:"Similar to a div or section elements in HTML",label:"Box",category:"core",group:"basic",props:s({properties:{styles:n(""),tag:{type:"string",default:"div",title:"Tag",oneOf:[{const:"div",title:"div"},{const:"header",title:"header"},{const:"footer",title:"footer"},{const:"section",title:"section"},{const:"article",title:"article"},{const:"aside",title:"aside"},{const:"main",title:"main"},{const:"nav",title:"nav"},{const:"figure",title:"figure"},{const:"details",title:"details"},{const:"summary",title:"summary"},{const:"dialog",title:"dialog"},{const:"strike",title:"strike"},{const:"caption",title:"caption"},{const:"legend",title:"legend"},{const:"figcaption",title:"figcaption"},{const:"mark",title:"mark"}]},backgroundImage:{type:"string",default:"",title:"Background Image",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}}),canAcceptBlock:()=>!0};import{ButtonIcon as Nt}from"@radix-ui/react-icons";import{get as H,isEmpty as Et}from"lodash-es";import{createElement as At}from"react";import{Fragment as Mt,jsx as N,jsxs as Ht}from"react/jsx-runtime";var re=e=>{let{blockProps:o,iconSize:t,icon:r,content:l,styles:i,children:a,iconPos:p,link:c,inBuilder:y}=e,d=r,C=a||Ht(Mt,{children:[l&&N("span",{children:l}),d&&N("div",{style:{width:t+"px"},className:p+" "+(l?p==="order-first"?"mr-2":"ml-2":"")||"",dangerouslySetInnerHTML:{__html:d}})]}),g=At("button",{...o,...i,type:"button","aria-label":l},C);return Et(H(c,"href"))?g:y?N("span",{children:g}):N("a",{"aria-label":l,href:H(c,"href")||"/",target:H(c,"target","_self"),children:g})},le={type:"Button",description:"similar to a button element in HTML",label:"Button",category:"core",icon:Nt,group:"basic",props:s({properties:{styles:n("dt#btn dt#btn-primary"),content:{type:"string",title:"Button label",default:"Button"},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:16},iconPos:{type:"string",title:"Icon position",default:"order-last",enum:["order-first","order-last"],enumNames:["Left","Right"]},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!0,title:"Prefetch Link"}}}),i18nProps:["content","link"],aiProps:["content"]};import{CodeIcon as Vt}from"@radix-ui/react-icons";import*as V from"react";import{jsx as Ft,jsxs as zt}from"react/jsx-runtime";var Dt=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,ie=e=>{let{blockProps:o,styles:t,htmlCode:r,inBuilder:l}=e;return l?zt("div",{className:"relative",...o,children:[l?Ft("div",{...t,className:"absolute z-20 h-full w-full"}):null,V.createElement("div",{...t,dangerouslySetInnerHTML:{__html:r.replace(Dt,"")}})]}):V.createElement("div",{...o,...t,dangerouslySetInnerHTML:{__html:r}})},se={type:"CustomHTML",description:"similar to a div or section elements in HTML",label:"Custom HTML",category:"core",icon:Vt,group:"advanced",props:s({properties:{styles:n(""),htmlCode:{type:"string",default:"<div><p>Enter your HTML code here...</p></div>",ui:{"ui:widget":"code"}}}}),i18nProps:["htmlCode"]};import{CodeIcon as qt}from"@radix-ui/react-icons";import{jsx as v}from"react/jsx-runtime";var ne=e=>{let{scripts:o,inBuilder:t,blockProps:r}=e;return t?v("div",{...r,children:v("div",{className:x("pointer-events-none flex flex-col items-center justify-center p-2",""),children:v("div",{className:"h-full w-full rounded bg-gray-200 p-1 dark:bg-gray-800",children:v("p",{className:"text-left text-xs text-gray-400",children:"Scripts will be only executed in preview and live mode. Place your script at the bottom of the"})})})}):v("div",{dangerouslySetInnerHTML:{__html:o}})},ae={type:"CustomScript",description:"similar to a script element in HTML",label:"Custom Script",category:"core",icon:qt,hidden:!0,group:"advanced",props:s({properties:{scripts:{type:"string",title:"Script",default:"",format:"code",placeholder:"<script>console.log('Hello, world!');</script>"}}})};import{FrameIcon as Ot}from"@radix-ui/react-icons";import*as ce from"react";import{jsx as Ut,jsxs as pe}from"react/jsx-runtime";var me=e=>{let{blockProps:o,inBuilder:t,children:r,globalBlock:l}=e;return t&&!l?pe("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[pe("h1",{children:["Global Block - ",l]}),Ut("p",{children:"Choose a block from the sidebar to add it to this page."})]}):ce.createElement("span",{...o},r)},de={type:"GlobalBlock",description:"A global block component",label:"Global Block",icon:Ot,category:"core",group:"basic",hidden:!0,props:s({properties:{globalBlock:{type:"string",title:"Global Block",default:"",ui:{"ui:widget":"hidden"}}}})};import{SketchLogoIcon as Wt}from"@radix-ui/react-icons";import{isEmpty as Gt}from"lodash-es";import*as ue from"react";var S=(e,...o)=>({...e,className:x(e.className,...o)});import{jsx as Zt}from"react/jsx-runtime";var ye=e=>{let{blockProps:o,icon:t,styles:r,width:l,inBuilder:i,height:a}=e,p=S(r,"");if(Gt(t))return Zt(f,{inBuilder:i,className:"h-8 w-14"});let c=t.replace(/<svg /g,'<svg class="w-[inherit] h-[inherit]" ');return ue.createElement("span",{...o,...p,style:{width:l?`${l}px`:"auto",height:a?`${a}px`:"auto"},dangerouslySetInnerHTML:{__html:c}})},ge={type:"Icon",label:"web_blocks.icon",category:"core",description:"Icon block is used to display an icon/svg.",icon:Wt,group:"media",props:s({properties:{styles:n(""),icon:{type:"string",title:"Icon",default:'<svg xmlns="http://www.w3.org/2000/svg" class="chai-default-svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-diamond-icon lucide-diamond"><path d="M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z"/></svg>',ui:{"ui:widget":"icon"}},width:{type:"number",default:16,title:"Width"},height:{type:"number",default:16,title:"Height"}}})};import{FrameIcon as $t}from"@radix-ui/react-icons";import*as Ce from"react";import{jsx as Yt,jsxs as fe}from"react/jsx-runtime";var he=e=>{let{blockProps:o,inBuilder:t,children:r,partialBlockId:l}=e;return t&&!l?fe("div",{className:"flex flex-col items-center justify-center gap-y-1 rounded-lg bg-gray-100 py-4 dark:bg-gray-800",...o,children:[fe("h1",{children:["Partial Block - ",l]}),Yt("p",{children:"Choose a block from the sidebar to add it to this page."})]}):Ce.createElement("span",{...o},r)},be={type:"PartialBlock",description:"A partial block component. Partial blocks are global blocks that can be used in multiple pages.",label:"Partial Block",icon:$t,category:"core",group:"basic",hidden:!0,props:s({properties:{partialBlockId:{type:"string",title:"Partial Block",default:"",ui:{"ui:widget":"hidden"}}}})};import{LayoutIcon as jt,RowsIcon as Xt}from"@radix-ui/react-icons";import{get as I}from"lodash-es";var E={SMALL:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},MEDIUM:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},LARGE:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}};import{jsx as D}from"react/jsx-runtime";var ke=e=>{let{blockProps:o,children:t,styles:r,colSpan:l,tabletColSpan:i,desktopColSpan:a}=e,c={className:[I(r,"className",""),I(E,["SMALL",isNaN(l)||!l?6:l],""),i?I(E,["MEDIUM",i||l],""):"",a?I(E,["LARGE",i||l],""):""].join(" ")};return D("div",{...o,...r,...c,children:t||D("div",{className:"h-full min-h-12 w-full border-2 border-dashed border-gray-400 bg-gray-100 dark:bg-gray-900"})})},Pe={type:"Column",description:"A column component",label:"Column",group:"basic",category:"core",icon:jt,wrapper:!0,hidden:!0,canDelete:()=>!0,canAcceptBlock:()=>!0,canBeNested:e=>e==="Row",props:s({properties:{styles:n(""),colSpan:{type:"number",title:"Column Span",default:6,enum:[1,2,3,4,5,6,7,8,9,10,11,12]},tabletColSpan:{type:"number",title:"Column Span (Tablet)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]},desktopColSpan:{type:"number",title:"Column Span (Desktop)",default:null,enumNames:["Default",1,2,3,4,5,6,7,8,9,10,11,12],enum:[null,1,2,3,4,5,6,7,8,9,10,11,12]}}})},Be=e=>{let{blockProps:o,children:t,styles:r,gutter:l}=e,a={className:[I(r,"className","")," grid grid-cols-12"].join()};return typeof(r==null?void 0:r.style)=="object"&&r.style!==null?a.style={...r.style,gap:`${l}px`}:a.style={gap:`${l}px`},D("div",{...o,...r,...a,children:t})},xe={type:"Row",description:"A row component",label:"Row",group:"basic",icon:Xt,hidden:!0,blocks:()=>[{_type:"Row",_id:"row",styles:"#styles:,p-1"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"},{_type:"Column",id:"column",_parent:"row",styles:"#styles:,"}],category:"core",wrapper:!0,canAcceptBlock:e=>e==="Column",props:s({properties:{styles:n(""),colCount:{type:"number",default:2,minimum:0,ui:{"ui:widget":"colCount"}},gutter:{type:"number",title:"Gutter (in px)",default:16,minimum:0}}})};import{DividerHorizontalIcon as Qt}from"@radix-ui/react-icons";import{createElement as Jt}from"react";var Se=e=>{let{blockProps:o,styles:t}=e;return Jt("hr",{...t,...o})},we={type:"Divider",description:"A horizontal line component",label:"Divider",category:"core",icon:Qt,group:"basic",props:s({properties:{styles:n("dt#separator")}})};import*as ve from"react";var Ie=e=>{let{blockProps:o,styles:t,backgroundImage:r}=e,l={};return r&&(l={backgroundImage:`url(${r})`}),ve.createElement("div",{...o,...t,style:l})},Le={type:"EmptyBox",description:"A box component with no children",label:"Empty Box",category:"core",group:"basic",props:s({properties:{styles:n(""),backgroundImage:{type:"string",title:"Background Image",default:"",ui:{"ui:widget":"image","ui:allowEmpty":!0}}}})};import{CheckboxIcon as Kt}from"@radix-ui/react-icons";import{jsx as F,jsxs as eo}from"react/jsx-runtime";var Re=e=>{let{blockProps:o,fieldName:t,label:r,styles:l,inputStyles:i,required:a,checked:p,showLabel:c=!0}=e;return c?eo("div",{...l,...o,children:[F("input",{...i,id:t,name:t,type:"checkbox",required:a,defaultChecked:p}),r&&F("label",{htmlFor:t,children:r})]}):F("input",{name:t,...o,...i,...l,type:"checkbox",required:a,defaultChecked:p})},Te={type:"Checkbox",label:"web_blocks.checkbox",category:"core",icon:Kt,group:"form",props:s({properties:{styles:n("flex items-center gap-x-2"),inputStyles:n("dt#checkbox"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]};import{FileTextIcon as to}from"@radix-ui/react-icons";import{jsx as _e,jsxs as oo}from"react/jsx-runtime";var Ne=e=>{let{children:o,blockProps:t,errorMessage:r,successMessage:l,action:i,styles:a,inBuilder:p}=e,c=o;return o||(c=_e(f,{inBuilder:p})),oo("form",{...{"x-data":"{}","x-on:submit.prevent":"post"},"data-error":r,"data-success":l,method:"post",action:i,...t,...a,children:[_e("div",{...{"x-html":"",":class":"{'text-red-500': formStatus === 'ERROR', 'text-green-500': formStatus === 'SUCCESS'}"}}),c]})},Ee={type:"Form",label:"Form",category:"core",icon:to,group:"form",blocks:()=>[{_type:"Form",_id:"form",styles:"#styles:p-1 space-y-2,"},{_type:"Input",_id:"form_input",_parent:"form",styles:"#styles:,"},{_type:"FormButton",_id:"form_submit_btn",_parent:"form",styles:"#styles:bg-black text-white rounded px-3 py-1,"}],props:s({properties:{styles:n(""),action:{type:"string",title:"Submit URL",default:"/api/form"},errorMessage:{type:"string",title:"Error Message",default:"Something went wrong. Please try again",ui:{"ui:widget":"richtext"}},successMessage:{type:"string",title:"Success Message",default:"Thank you for your submission.",ui:{"ui:widget":"richtext"}}}}),i18nProps:["errorMessage","successMessage"],aiProps:["errorMessage","successMessage"],canAcceptBlock:()=>!0};import{ButtonIcon as ro}from"@radix-ui/react-icons";import{jsx as lo,jsxs as io}from"react/jsx-runtime";var Ae=e=>{let{blockProps:o,inBuilder:t,label:r,styles:l,icon:i,iconSize:a,iconPos:p}=e;return io("button",{...l,...o||{},type:t?"button":"submit","aria-label":r,children:[r,i&&lo("div",{style:{width:a+"px"},className:p+" "+(p==="order-first"?"mr-2":"ml-2")||"",dangerouslySetInnerHTML:{__html:i}})]})},Me={type:"FormButton",label:"Submit Button",category:"core",icon:ro,group:"form",props:s({properties:{styles:n("dt#btn dt#btn-primary"),label:{type:"string",title:"Label",default:"Submit",ai:!0,i18n:!0},icon:{type:"string",title:"Icon",default:"",ui:{"ui:widget":"icon"}},iconSize:{type:"number",title:"Icon size",default:24},iconPos:{type:"string",title:"Icon Position",default:"order-last",enum:["order-first","order-last"]}}}),i18nProps:["label"],aiProps:["label"]};import{InputIcon as so}from"@radix-ui/react-icons";import{jsx as z,jsxs as ao}from"react/jsx-runtime";var no=e=>{let o={type:"text",autoComplete:"on"};return e?["text","password","number","hidden","range","color","date","time"].includes(e)?{type:e,autoComplete:"on"}:e==="email"?{type:"email",autoComplete:"email"}:e==="tel"?{type:"tel",autoComplete:"tel"}:e==="url"?{type:"url",autoComplete:"url"}:{off:{type:"text",autoComplete:"off"},on:{type:"text",autoComplete:"on"},name:{type:"text",autoComplete:"name"},"honorific-prefix":{type:"text",autoComplete:"honorific-prefix"},"given-name":{type:"text",autoComplete:"given-name"},"additional-name":{type:"text",autoComplete:"additional-name"},"family-name":{type:"text",autoComplete:"family-name"},"honorific-suffix":{type:"text",autoComplete:"honorific-suffix"},nickname:{type:"text",autoComplete:"nickname"},firstName:{type:"text",autoComplete:"given-name"},lastName:{type:"text",autoComplete:"family-name"},email:{type:"email",autoComplete:"email"},tel:{type:"tel",autoComplete:"tel"},"tel-country-code":{type:"tel",autoComplete:"tel-country-code"},"tel-national":{type:"tel",autoComplete:"tel-national"},"tel-area-code":{type:"tel",autoComplete:"tel-area-code"},"tel-local":{type:"tel",autoComplete:"tel-local"},"tel-extension":{type:"tel",autoComplete:"tel-extension"},"street-address":{type:"text",autoComplete:"street-address"},"address-line1":{type:"text",autoComplete:"address-line1"},"address-line2":{type:"text",autoComplete:"address-line2"},"address-line3":{type:"text",autoComplete:"address-line3"},"address-level1":{type:"text",autoComplete:"address-level1"},"address-level2":{type:"text",autoComplete:"address-level2"},"address-level3":{type:"text",autoComplete:"address-level3"},"address-level4":{type:"text",autoComplete:"address-level4"},country:{type:"text",autoComplete:"country"},"country-name":{type:"text",autoComplete:"country-name"},"postal-code":{type:"text",autoComplete:"postal-code"},"cc-name":{type:"text",autoComplete:"cc-name"},"cc-given-name":{type:"text",autoComplete:"cc-given-name"},"cc-additional-name":{type:"text",autoComplete:"cc-additional-name"},"cc-family-name":{type:"text",autoComplete:"cc-family-name"},"cc-number":{type:"text",autoComplete:"cc-number"},"cc-exp":{type:"text",autoComplete:"cc-exp"},"cc-exp-month":{type:"number",autoComplete:"cc-exp-month"},"cc-exp-year":{type:"number",autoComplete:"cc-exp-year"},"cc-csc":{type:"text",autoComplete:"cc-csc"},"cc-type":{type:"text",autoComplete:"cc-type"},bday:{type:"date",autoComplete:"bday"},"bday-day":{type:"number",autoComplete:"bday-day"},"bday-month":{type:"number",autoComplete:"bday-month"},"bday-year":{type:"number",autoComplete:"bday-year"},username:{type:"text",autoComplete:"username"},"new-password":{type:"password",autoComplete:"new-password"},"current-password":{type:"password",autoComplete:"current-password"},"one-time-code":{type:"text",autoComplete:"one-time-code"},"transaction-currency":{type:"text",autoComplete:"transaction-currency"},"transaction-amount":{type:"number",autoComplete:"transaction-amount"},url:{type:"url",autoComplete:"url"},photo:{type:"url",autoComplete:"photo"},sex:{type:"text",autoComplete:"sex"},"organization-title":{type:"text",autoComplete:"organization-title"},organization:{type:"text",autoComplete:"organization"},language:{type:"text",autoComplete:"language"}}[e]||o:o},He=e=>{let{blockProps:o,fieldName:t,label:r,placeholder:l,styles:i,inputStyles:a,showLabel:p,required:c,inputType:y,defaultValue:d}=e,{type:C,autoComplete:g}=no(y);return p?ao("div",{...i,...o,children:[p&&z("label",{htmlFor:t,children:r}),z("input",{id:t,name:t,...a,type:C,placeholder:l,required:c,autoComplete:g,...C==="hidden"?{value:d,readOnly:!0}:{defaultValue:d}})]}):z("input",{name:t,...o,...a,...i,type:C,placeholder:l,required:c,autoComplete:g,...C==="hidden"?{value:d,readOnly:!0}:{defaultValue:d}})},Ve={type:"Input",label:"web_blocks.input",category:"core",icon:so,group:"form",props:s({properties:{styles:n(""),inputStyles:n("dt#input"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},inputType:{type:"string",title:"Type",default:"email",oneOf:[{const:"text",title:"Text"},{const:"email",title:"Email"},{const:"password",title:"Password"},{const:"number",title:"Number"},{const:"tel",title:"Telephone"},{const:"hidden",title:"Hidden"},{const:"range",title:"Range"},{const:"color",title:"Color"},{const:"date",title:"Date"},{const:"time",title:"Time"},{const:"url",title:"URL"},{const:"name",title:"Name"},{const:"firstName",title:"First Name"},{const:"lastName",title:"Last Name"},{const:"tel-country-code",title:"Telephone Country Code"},{const:"tel-national",title:"Telephone National"},{const:"tel-area-code",title:"Telephone Area Code"},{const:"tel-local",title:"Telephone Local"},{const:"tel-extension",title:"Telephone Extension"},{const:"street-address",title:"Street Address"},{const:"address-line1",title:"Address Line 1"},{const:"address-line2",title:"Address Line 2"},{const:"address-line3",title:"Address Line 3"},{const:"address-level1",title:"Address Level 1"},{const:"address-level2",title:"Address Level 2"},{const:"address-level3",title:"Address Level 3"},{const:"address-level4",title:"Address Level 4"},{const:"country",title:"Country"},{const:"country-name",title:"Country Name"},{const:"postal-code",title:"Postal Code"},{const:"cc-name",title:"Credit Card Name"},{const:"cc-number",title:"Credit Card Number"},{const:"cc-exp",title:"Credit Card Expiry"},{const:"cc-exp-month",title:"Credit Card Expiry Month"},{const:"cc-exp-year",title:"Credit Card Expiry Year"},{const:"cc-csc",title:"Credit Card CSC"},{const:"cc-type",title:"Credit Card Type"},{const:"bday",title:"Birthday"},{const:"bday-day",title:"Birthday Day"},{const:"bday-month",title:"Birthday Month"},{const:"bday-year",title:"Birthday Year"},{const:"username",title:"Username"},{const:"new-password",title:"New Password"},{const:"current-password",title:"Current Password"},{const:"one-time-code",title:"One Time Code"},{const:"transaction-currency",title:"Transaction Currency"},{const:"transaction-amount",title:"Transaction Amount"},{const:"url",title:"URL"},{const:"photo",title:"Photo"},{const:"sex",title:"Sex"},{const:"organization-title",title:"Organization Title"},{const:"organization",title:"Organization"},{const:"language",title:"Language"}]},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ai:!0,i18n:!0},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]};import{LetterCaseToggleIcon as po}from"@radix-ui/react-icons";import*as q from"react";var De=e=>{let{blockProps:o,content:t,styles:r,children:l}=e,i={...r,...o};return l?q.createElement("label",i,l):q.createElement("label",{...i,dangerouslySetInnerHTML:{__html:t}})},Fe={type:"Label",label:"Label",category:"core",icon:po,group:"form",props:s({properties:{styles:n("dt#label"),content:{type:"string",title:"Content",default:""}}}),aiProps:["content"],i18nProps:["content"]};import{RadiobuttonIcon as co}from"@radix-ui/react-icons";import{jsx as O,jsxs as mo}from"react/jsx-runtime";var ze=e=>{let{blockProps:o,fieldName:t,label:r,styles:l,inputStyles:i,required:a,checked:p,showLabel:c=!0}=e;return c?mo("div",{...l,...o,children:[O("input",{...i,name:t,type:"radio",required:a,defaultChecked:p}),r&&O("label",{htmlFor:t,children:r})]}):O("input",{name:t,...o,...i,...l,type:"radio",required:a,checked:p})},qe={type:"Radio",label:"web_blocks.radio",category:"core",icon:co,group:"form",props:s({properties:{styles:n("flex items-center gap-x-2"),inputStyles:n(""),fieldName:{type:"string",title:"Field Name",default:"fieldName"},label:{type:"string",title:"Label",default:"Label"},checked:{type:"boolean",title:"Checked",default:!1},required:{type:"boolean",title:"Required",default:!1},showLabel:{type:"boolean",title:"Show Label",default:!0}}}),aiProps:["label"],i18nProps:["label"]};import{DropdownMenuIcon as uo}from"@radix-ui/react-icons";import{map as Oe}from"lodash-es";import{jsx as L,jsxs as U}from"react/jsx-runtime";var Ue=e=>{let{blockProps:o,fieldName:t,label:r,placeholder:l,styles:i,inputStyles:a,required:p,showLabel:c,_multiple:y,options:d,defaultValue:C}=e,g=y&&C?C.split(",").map(u=>u.trim()):C||"";return c?U("div",{...i,...o,children:[c&&L("label",{htmlFor:t,children:r}),U("select",{...a,required:p,multiple:y,name:t,defaultValue:g,children:[L("option",{value:"",disabled:!0,hidden:!0,children:l}),Oe(d,u=>L("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})]}):U("select",{...i,...o,required:p,multiple:y,name:t,defaultValue:g,children:[L("option",{value:"",disabled:!0,hidden:!0,children:l}),Oe(d,u=>L("option",{value:u==null?void 0:u.value,children:u==null?void 0:u.label},u==null?void 0:u.value))]})},We={type:"Select",label:"web_blocks.select",category:"core",icon:uo,group:"form",props:s({properties:{styles:n(""),inputStyles:n("w-full p-1"),fieldName:{type:"string",title:"Field Name",default:"fieldName"},showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label"},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:""},_multiple:{type:"boolean",title:"Multiple",default:!1},options:{title:"Options",type:"array",default:[],items:{type:"object",properties:{label:{type:"string",title:"Label",default:""},value:{type:"string",title:"Value",default:""}}}}}}),i18nProps:["label","placeholder","options"]};import{InputIcon as yo}from"@radix-ui/react-icons";import{jsx as W,jsxs as go}from"react/jsx-runtime";var Ge=e=>{let{blockProps:o,fieldName:t,label:r,placeholder:l,styles:i,inputStyles:a,rows:p,showLabel:c,required:y,defaultValue:d}=e;return c?go("div",{...i,...o,children:[c&&W("label",{htmlFor:t,children:r}),W("textarea",{name:t,...a,placeholder:l,rows:p,required:y,defaultValue:d})]}):W("textarea",{name:t,...o,...a,...i,placeholder:l,rows:p,required:y,defaultValue:d})},Ze={type:"TextArea",label:"web_blocks.textarea",category:"core",icon:yo,group:"form",props:s({properties:{fieldName:{type:"string",title:"Field Name",default:"fieldName"},styles:n(""),inputStyles:n("dt#textarea"),showLabel:{type:"boolean",title:"Show Label",default:!0},label:{type:"string",title:"Label",default:"Label",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}},placeholder:{type:"string",title:"Placeholder",default:"Placeholder"},rows:{type:"number",title:"Rows",default:3},required:{type:"boolean",title:"Required",default:!1},defaultValue:{type:"string",title:"Default Value",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["label","placeholder"],i18nProps:["label","placeholder"]};import{HeadingIcon as fo}from"@radix-ui/react-icons";import*as G from"react";var $e=e=>{let{blockProps:o,styles:t,content:r,tag:l="h1",children:i=null}=e;return i?G.createElement(l,{...t,...o},i):G.createElement(l,{...t,...o,dangerouslySetInnerHTML:{__html:r}})},Ye={type:"Heading",description:"A heading component similar to h1, h2, h3, h4, h5, h6 elements in HTML",label:"Heading",category:"core",icon:fo,group:"typography",props:s({properties:{tag:{type:"string",default:"h2",title:"Level",enum:["h1","h2","h3","h4","h5","h6"]},styles:n("text-3xl"),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea","ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0};import{createElement as Co}from"react";var je=e=>{let{blockProps:o,styles:t}=e;return Co("br",{...o,...t})},Xe={type:"LineBreak",label:"Line Break",category:"core",group:"basic",hidden:!0,props:s({properties:{styles:n("")}})};import{BorderAllIcon as ho,BorderTopIcon as bo,DragHandleHorizontalIcon as ko,TableIcon as Po,ViewHorizontalIcon as Bo}from"@radix-ui/react-icons";import{isEmpty as xo}from"lodash-es";import{createElement as w}from"react";import{jsx as T}from"react/jsx-runtime";var So=e=>{let{blockProps:o,children:t,styles:r}=e;return t?w("table",{...o,...r},t):T(f,{})},wo=e=>{let{blockProps:o,children:t,styles:r}=e;return t?w("thead",{...o,...r},t):T(f,{})},vo=e=>{let{blockProps:o,children:t,styles:r}=e;return t?w("tbody",{...o,...r},t):T(f,{})},Io=e=>{let{blockProps:o,children:t,styles:r}=e;return t?w("tr",{...o,...r},t):T(f,{})},Lo=e=>{let{blockProps:o,children:t,content:r,styles:l}=e;return!t&&xo(r)?T(f,{}):t?w("td",{...o,...l},t):w("td",{...o,...l,dangerouslySetInnerHTML:{__html:r}})};m(So,{type:"Table",label:"Table",category:"core",group:"table",hidden:!0,icon:Po,props:s({properties:{styles:n("")}}),blocks:R("Table")});m(wo,{type:"TableHead",label:"Table Head",category:"core",group:"table",hidden:!0,icon:bo,props:s({properties:{styles:n("")}}),blocks:R("TableHead")});m(vo,{type:"TableBody",label:"Table Body",category:"core",group:"table",hidden:!0,icon:ho,props:s({properties:{styles:n("")}}),blocks:R("TableBody")});m(Io,{type:"TableRow",label:"Table Row",category:"core",group:"table",hidden:!0,icon:Bo,props:s({properties:{styles:n("")}}),blocks:R("TableRow")});m(Lo,{type:"TableCell",label:"Table Cell",category:"core",group:"table",hidden:!0,icon:ko,props:s({properties:{styles:n(""),content:{type:"string",default:"Heading goes here",title:"Content",ui:{"ui:widget":"textarea"}}}}),blocks:R("TableCell"),i18nProps:["content"],aiProps:["content"]});function R(e){let o=(i,a)=>({_id:B(),_parent:i,_type:"TableCell",styles:"#styles:,",content:`${e==="TableHead"?"Table Head":"Table Cell "+a}`}),t=i=>{let a=B(),p={_type:"TableRow",_id:a,styles:"#styles:,border-b"};return i&&(p._parent=i),[p,o(a,"1"),o(a,"2"),o(a,"3")]},r=i=>{let a=B(),p={_id:a,_type:"TableHead",styles:"#styles:,font-medium"};return i&&(p._parent=i),[p,...t(a)]},l=i=>{let a=B(),p={_id:a,_type:"TableBody",styles:"#styles:,"};return i&&(p._parent=i),[p,...t(a),...t(a)]};if(e==="Table"){let i=B();return[{_id:i,_type:"Table",styles:"#styles:,w-full text-left text-gray-500 dark:text-gray-400"},...r(i),...l(i)]}return e==="TableRow"?t():e==="TableHead"?r():e==="TableBody"?l():[]}import{ImageIcon as Ro}from"@radix-ui/react-icons";import{isEmpty as To}from"lodash-es";import{jsx as Z,jsxs as No}from"react/jsx-runtime";var _o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAwIiBoZWlnaHQ9IjQwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSIjZjNmNGY2Ii8+PHRleHQgeD0iNTAlIiB5PSI1MCUiIGZvbnQtZmFtaWx5PSJBcmlhbCwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIxNiIgZmlsbD0iI2Q1ZDdkYSIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZHk9Ii4zZW0iPkltYWdlIFBsYWNlaG9sZGVyPC90ZXh0Pjwvc3ZnPg==",Qe=e=>{let{blockProps:o,image:t,mobileImage:r,styles:l,alt:i,height:a,width:p,lazyLoading:c,mobileWidth:y,mobileHeight:d}=e;return To(t)?Z(f,{className:"h-36"}):No("picture",{children:[r&&Z("source",{srcSet:r,media:"(max-width: 480px)",width:y,height:d}),Z("img",{...o,...l,src:t,alt:i,loading:c?"lazy":"eager",width:p,height:a})]})},Je={type:"Image",description:"A image component",label:"Image",category:"core",icon:Ro,group:"media",props:s({properties:{styles:n("w-full h-full object-cover"),image:{type:"string",title:"Image",default:_o,ui:{"ui:widget":"image"}},width:{type:"string",title:"Width",default:"",ui:{"ui:placeholder":"Enter width"}},height:{type:"string",title:"Height",default:"",ui:{"ui:placeholder":"Enter height"}},mobileImage:{type:"string",title:"Mobile Image",default:"",ui:{"ui:widget":"image"}},mobileWidth:{type:"string",title:"Mobile Width",default:"",ui:{"ui:placeholder":"Enter width"}},mobileHeight:{type:"string",title:"Mobile Height",default:"",ui:{"ui:placeholder":"Enter height"}},alt:{type:"string",title:"Alt text",default:"",ui:{"ui:placeholder":"Enter alt text"}},lazyLoading:{type:"boolean",title:"Lazy Load",default:!0}}}),aiProps:["alt"],i18nProps:["alt","image","_imageId","mobileImage","_mobileImageId"]};import{Link1Icon as Eo}from"@radix-ui/react-icons";import{isEmpty as Ao}from"lodash-es";import{createElement as Ke}from"react";import{jsx as et}from"react/jsx-runtime";var tt=e=>{let{blockProps:o,link:t,children:r,styles:l,inBuilder:i,content:a}=e,p={};return!r&&Ao(a)&&(p={minHeight:"50px",display:"flex",alignItems:"center",justifyContent:"center"}),i?r?et("span",{role:"link",...o,style:p,...l,children:r}):Ke("span",{...o,...l,style:p,role:"link"},a):r?et("a",{"aria-label":a,href:(t==null?void 0:t.href)||"#/",target:t==null?void 0:t.target,...o,...l,children:r}):Ke("a",{...o,...l,href:(t==null?void 0:t.href)||"#",target:(t==null?void 0:t.target)||"_self","aria-label":a},a)},ot={type:"Link",description:"A link component",label:"Link",category:"core",icon:Eo,group:"basic",props:s({properties:{styles:n("block"),content:{type:"string",default:"Link text goes here",title:"Content"},link:{type:"object",properties:{type:{type:"string"},href:{type:"string"},target:{type:"string"}},default:{type:"url",href:"",target:"_self"},ui:{"ui:field":"link"}},prefetchLink:{type:"boolean",default:!1,title:"Prefetch Link"}}}),aiProps:["content"],i18nProps:["content","link"],canAcceptBlock:e=>e!=="Link"};import{RowsIcon as Mo}from"@radix-ui/react-icons";import{isEmpty as Ho}from"lodash-es";import*as rt from"react";import{jsx as Vo}from"react/jsx-runtime";var lt=e=>{let{blockProps:o,children:t,styles:r,tag:l,inBuilder:i}=e;return!t&&Ho(r==null?void 0:r.className)?Vo(f,{inBuilder:i}):rt.createElement(l||"ul",{...o,...r},t)},it={type:"List",description:"A list component",label:"List",icon:Mo,category:"core",group:"basic",props:s({properties:{styles:n("")}}),canAcceptBlock:e=>e==="ListItem",blocks:[{_type:"List",_id:"a",styles:"#styles:,"},{_type:"ListItem",_id:"b",_parent:"a",styles:"#styles:,",content:"Item 1"},{_type:"ListItem",_id:"c",_parent:"a",styles:"#styles:,",content:"Item 2"},{_type:"ListItem",_id:"d",_parent:"a",styles:"#styles:,",content:"Item 3"}]};import{ColumnsIcon as Do}from"@radix-ui/react-icons";import*as $ from"react";var st=e=>{let{blockProps:o,content:t,styles:r,children:l,tag:i}=e;return l?$.createElement(i||"li",{...r,...o},l):$.createElement(i||"li",{...r,...o,dangerouslySetInnerHTML:{__html:t}})},nt={type:"ListItem",description:"A list item component",label:"List Item",icon:Do,category:"core",group:"basic",props:s({properties:{styles:n(""),content:{type:"string",default:"List item",title:"Content",ui:{"ui:widget":"textarea"}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e!=="ListItem",canBeNested:e=>e==="List"||e==="Repeater"};import{TextIcon as Fo}from"@radix-ui/react-icons";import{isNull as zo}from"lodash-es";import*as Y from"react";var at=e=>{let{blockProps:o,styles:t,content:r}=e;if(!zo(e.children))return Y.createElement("p",{...t,...o},e.children);let l=S(t,"rte");return Y.createElement("div",{...l,...o,dangerouslySetInnerHTML:{__html:r}})},pt={type:"Paragraph",description:"A paragraph component",label:"Paragraph",category:"core",icon:Fo,group:"typography",props:s({properties:{styles:n(""),content:{type:"string",title:"Content",default:"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.",ui:{"ui:widget":"richtext","ui:autosize":!0,"ui:rows":5}}}}),i18nProps:["content"],aiProps:["content"],canAcceptBlock:e=>e==="Span"||e==="Link"||e==="Text"};import{CursorTextIcon as qo}from"@radix-ui/react-icons";import{jsx as Oo}from"react/jsx-runtime";var ct=e=>{let{blockProps:o,content:t,styles:r}=e,l=S(r,"rte");return Oo("div",{...o,...l,dangerouslySetInnerHTML:{__html:t}})},mt={type:"RichText",description:"A rich text block",label:"Rich Text",hidden:!0,category:"core",icon:qo,group:"typography",props:s({properties:{styles:n(""),content:{type:"string",title:"Content",default:"<p>This is a rich text block. You can add text, and other content here.</p>",ui:{"ui:widget":"richtext"}}}}),aiProps:["content"],i18nProps:["content"]};import*as j from"react";var dt=e=>{let{blockProps:o,styles:t,content:r,children:l=null,tag:i}=e;return l?j.createElement("span",{...t,...o},l):j.createElement(i||"span",{...t,...o,dangerouslySetInnerHTML:{__html:r||""}})},ut={type:"Span",description:"A span component",label:"Span",category:"core",group:"basic",props:s({properties:{styles:n(""),content:{type:"string",title:"Content",default:"",ui:{"ui:widget":"textarea","ui:autosize":!0,"ui:rows":3}}}}),aiProps:["content"],i18nProps:["content"],canAcceptBlock:()=>!0};import{SpaceBetweenVerticallyIcon as Uo}from"@radix-ui/react-icons";import{jsx as Wo}from"react/jsx-runtime";var yt=e=>e.inBuilder||e.forceWrapper?Wo("span",{...e.blockProps,children:e.content}):`${e.content}`,gt={type:"Text",description:"A text component with no styling",label:"Text",category:"core",group:"typography",blocks:()=>[{_id:"a",_type:"Text",_name:"Text",content:""}],icon:Uo,props:s({properties:{styles:n("text-black"),content:{title:"Content",type:"string",default:""}}}),aiProps:["content"],i18nProps:["content"]};import{VideoIcon as Go}from"@radix-ui/react-icons";import{get as h,isEmpty as A,omit as Zo,pick as $o}from"lodash-es";import{jsx as k,jsxs as kt}from"react/jsx-runtime";import{createElement as Qo}from"react";var X={type:"object",title:"Controls",default:{autoplay:!0,controls:!1,loop:!0,muted:!0},properties:{autoplay:{type:"boolean",title:"Autoplay",default:!1},controls:{type:"boolean",title:"Show Controls",default:!0},loop:{type:"boolean",title:"Loop Video",default:!1},muted:{type:"boolean",title:"Muted",default:!1}}},ft=/^(https?:\/\/)?(www\.)?youtube\.com\/(watch\?v=|embed\/)([a-zA-Z0-9_-]{11})/,Ct=/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com\/(?:channels\/[\w]+\/|groups\/[^\/]+\/videos\/|album\/\d+\/video\/|video\/)?|player\.vimeo\.com\/video\/)(\d+)/,Yo=(e,o)=>{let t=h(o,"autoplay",!1),r=h(o,"controls",!1),l=h(o,"loop",!1),i=t||h(o,"muted",!0);if(ft.test(e)){let a=e.match(ft);if(a){let p=a[4],c=`https://www.youtube.com/embed/${p}`,y=[];return t&&y.push("autoplay=1"),l&&y.push("loop=1",`playlist=${p}`),i&&y.push("mute=1","muted=1"),y.push(r?"controls=1":"controls=0"),`${c}?${y.join("&")}`}}if(Ct.test(e)){let a=e.match(Ct);if(a){let p=a[1],c=[];return t&&c.push("autoplay=1"),c.push(r?"controls=1":"controls=0"),i&&c.push("muted=1"),l&&c.push("loop=1"),`https://player.vimeo.com/video/${p}?${c.join("&")}`}}return null},jo=e=>{let{url:o,blockProps:t,styles:r,controls:l,videoSource:i,inBuilder:a,title:p}=e,c=Yo(o,l);return kt("div",{...Zo(r,"className"),className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:[!c&&a?k("div",{className:"absolute flex h-full w-full items-center justify-center bg-gray-300 text-center",children:A(o)?`Provided ${i} video link in settings Video URL.`:`Provided ${i} video link is invalid.`}):k("iframe",{className:`absolute left-0 top-0 h-full w-full ${$o(r,"className").className||""}`,src:c!=null?c:"",title:p||"Video player",loading:"lazy",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}),a&&k("div",{...t,className:"absolute top-0 h-full w-full"})]})},Xo=e=>{let{url:o,styles:t,controls:r,sources:l,poster:i,blockProps:a,title:p}=e,c=i,y=[...h(l,"srcsets",[])||[]];o&&typeof o=="string"&&y.push({url:o,width:9999});let d=y.sort((g,u)=>g.width-u.width).filter(g=>!A(g.url)&&!A(g.width));d.length===0&&!c&&(c="https://placehold.co/300x200/EEE/ccc?text=Choose%20Video");let C=h(r,"autoplay",!1)||h(r,"muted",!0);return(c||!A(d))&&k("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:"56.25%"},children:Qo("video",{...t,...a,title:p||"Video player",key:JSON.stringify(d),controls:h(r,"controls",!1),autoPlay:h(r,"autoplay",!1),loop:h(r,"loop",!1),poster:c,...C?{muted:!0}:{}},d.map(g=>{if(!g.url||g.url.length<4||isNaN(g.width))return null;let u=`(max-width: ${g.width}px)`;return k("source",{src:g.url,media:u,type:g.type},g.url)}),"Your browser does not support the video tag.")})},ht=e=>{let{videoSource:o}=e;return o==="Custom"?k(Xo,{...e}):o==="Youtube"||o==="Vimeo"?k(jo,{...e}):kt("div",{children:["Invalid video source : ",o]})},bt={type:"Video",label:"Video",category:"core",icon:Go,group:"media",props:s({properties:{styles:n("absolute h-full w-full object-cover"),videoSource:{type:"string",default:"Custom",enum:["Custom","Youtube","Vimeo"],title:"Video source"},title:{type:"string",title:"Video Title",default:"Video player"}},allOf:[{if:{properties:{videoSource:{const:"Custom"}}},then:{properties:{url:{type:"string",title:"Video URL",default:""},poster:{type:"string",title:"Poster URL",default:""},sources:{type:"object",default:{srcsets:[]}},controls:{...X}}}},{if:{properties:{videoSource:{const:"Youtube"}}},then:{properties:{url:{type:"string",title:"Youtube Video URL",default:""},controls:{...X}}}},{if:{properties:{videoSource:{const:"Vimeo"}}},then:{properties:{url:{type:"string",title:"Vimeo Video URL",default:""},controls:{...X}}}}],ui:{url:{"ui:placeholder":"Enter Video URL"},sources:{"ui:field":"sources"},poster:{"ui:placeholder":"Enter poster URL"}}}),i18nProps:["url","title"]};import{LoopIcon as xt}from"@radix-ui/react-icons";import{isEmpty as rr,pick as lr}from"lodash-es";import*as _ from"react";import{ChevronLeftIcon as Jo,ChevronRightIcon as Ko}from"@radix-ui/react-icons";import{omit as er}from"lodash-es";import*as Pt from"react";import{Fragment as tr,jsx as b,jsxs as or}from"react/jsx-runtime";var Bt=e=>{let{paginationStyles:o}=e,t=J("Pagination");return b("div",{...o,children:t?Pt.createElement(t.component,{...er(e,["paginationStyles"]),blockProps:{}}):or(tr,{children:[b("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",disabled:!0,children:b(Jo,{className:"h-4 w-4"})}),b("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-blue-500 bg-blue-500 font-medium text-white",children:"1"}),b("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"2"}),b("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"3"}),b("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"4"}),b("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white font-medium text-gray-700 hover:bg-gray-50",children:"5"}),b("button",{className:"flex h-9 w-9 items-center justify-center rounded-md border border-gray-300 bg-white hover:bg-gray-50",children:b(Ko,{className:"h-4 w-4"})})]})})};import{Fragment as ir,jsx as P,jsxs as Q}from"react/jsx-runtime";var St=e=>{let{children:o,tag:t,styles:r,blockProps:l,$loading:i}=e,{pagination:a,inBuilder:p}=e,c=o;return rr(c)&&p&&(c=P("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Choose a collection to display items"})),t==="none"?i&&p?Array.from({length:2}).map((y,d)=>Q("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[P("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),P("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},d)):c:Q(ir,{children:[_.createElement(t,{...l,...r},i&&p?Array.from({length:2}).map((y,d)=>Q("div",{className:"animate-pulse rounded-md bg-primary/10 p-5",children:[P("div",{className:"h-6 w-1/2 rounded-md bg-primary/10"}),P("div",{className:"mt-2 h-4 w-1/2 rounded-md bg-primary/10"})]},d)):c),a&&P(Bt,{...lr(e,["limit","totalItems","paginationStrategy","inBuilder","draft","lang","paginationStyles"])})]})},wt={type:"Repeater",label:"Repeater",icon:xt,group:"basic",description:"Repeater block is used to display a list of items based on data binding in repeaterItems",dataProviderMode:"live",dataProviderDependencies:["filter","sort","limit","repeaterItems"],blocks:()=>[{_id:"A",_type:"Repeater",tag:"ul"},{_id:"B",_name:"Repeater Item",_type:"RepeaterItem",parentTag:"ul",_parent:"A"}],props:s({properties:{styles:n("grid gap-4 md:grid-cols-2 xl:grid-cols-3"),paginationStyles:n("flex items-center justify-center gap-2 p-4"),repeaterItems:{title:"Collection",type:"string",binding:"array",default:"",ui:{"ui:widget":"repeaterBinding","ui:readonly":!0}},tag:{title:"Tag",type:"string",default:"ul",enum:["none","div","ul","ol"]},filter:{title:"Filter by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},sort:{title:"Sort by",type:"string",default:"",ui:{"ui:widget":"collectionSelect"}},pagination:{title:"Pagination",type:"boolean",default:!1}},allOf:[{if:{properties:{pagination:{const:!0}}},then:{properties:{paginationStrategy:{type:"string",title:"Pagination Strategy",default:"segment",enum:["query","segment"]},limit:{type:"number",title:"Items Per Page",default:10,minimum:1}}}},{if:{properties:{pagination:{const:!1}}},then:{properties:{limit:{type:"number",title:"Max items",default:10,minimum:1}}}}]}),canAcceptBlock:e=>e==="Pagination"},vt=({children:e,blockProps:o,styles:t,parentTag:r,inBuilder:l})=>{let i="li";switch(r){case"ul":i="li";break;case"ol":i="li";break;default:i="div"}return!e&&l?_.createElement(i,{...o,...t},P("div",{className:"col-span-3 flex items-center justify-center bg-orange-50 p-5 text-sm text-muted-foreground",children:"Add children to repeater item"})):_.createElement(i,{...o,...t},e)},It={type:"RepeaterItem",label:"Repeater Item",icon:xt,hidden:!0,group:"basic",props:s({properties:{styles:n(""),parentTag:K("Repeater","tag")}}),canAcceptBlock:e=>e!=="RepeaterItem",canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1},Lt=({children:e,blockProps:o,styles:t})=>_.createElement("div",{...o,...t},e),Rt={type:"RepeaterEmptyState",label:"Empty State",hidden:!0,group:"basic",props:s({properties:{styles:n("p-5 flex items-center justify-center")}}),canAcceptBlock:()=>!0,canDelete:()=>!1,canMove:()=>!1,canDuplicate:()=>!1};var Rs=()=>{m(te,oe),m(Ie,Le),m(re,le),m($e,Ye),m(at,pt),m(dt,ut),m(ct,mt),m(tt,ot),m(lt,it),m(st,nt),m(ye,ge),m(Qe,Je),m(ht,bt),m(ie,se),m(ne,ae),m(yt,gt),m(Ne,Ee),m(Ae,Me),m(He,Ve),m(Re,Te),m(ze,qe),m(Ue,We),m(Ge,Ze),m(De,Fe),m(je,Xe),m(Se,we),m(me,de),m(he,be),m(Be,xe),m(ke,Pe),m(St,wt),m(vt,It),m(Lt,Rt)};export{Rs as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as u,f as c}from"./chunk-PQHFT4TE.js";import{a as m,e as p}from"./chunk-YEFMD4DS.js";import{xa as i}from"./chunk-2NYUIXUX.js";import{each as h,get as b,isEmpty as S}from"lodash-es";import{find as f}from"lodash-es";import{useMemo as l}from"react";var M=s=>{let{fallbackLang:t}=i(),{data:o}=m(),{data:g,isFetching:P}=u(),y=l(()=>{let e={[t]:!0};return h(b(o,"languages"),r=>{let L=f(g,{lang:r});e[r]=!!L}),e},[t,g,o]),{data:n}=p(),{data:a}=c(),d=l(()=>{let e=f(n,{key:a==null?void 0:a.pageType});return(e==null?void 0:e.hasSlug)===!1},[a==null?void 0:a.pageType,n]);return P||d||S(s)||s&&y[s]};export{M as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{z as s}from"./chunk-OSGXFZTA.js";var r=null,n=null,o="pg",a=null;function d(){a&&a(),r=null,n=null,o="pg",a=null}function u(e){var t,i,l,c;if(!(e!=null&&e.drizzle))throw new Error("ChaiBuilder: invalid `db` setup. Pass `db: createPostgresDB(...)` (or libsql/d1/better-sqlite3).");if(r!==null&&r===e.drizzle){n=e.schema,o=(t=e.dialect)!=null?t:"pg",a=(i=e.teardown)!=null?i:null;return}d(),r=e.drizzle,n=e.schema,o=(l=e.dialect)!=null?l:"pg",a=(c=e.teardown)!=null?c:null}function D(){return o}function p(){d()}async function h(){if(!r)throw new Error("ChaiBuilder database was not initialized. Pass `db` to `buildChaiBuilderConfig` (`db: createPostgresDB(...)`, `createLibsqlDB(...)`, etc.).")}function b(){if(!r)throw new Error("ChaiBuilder database was not initialized. Pass `db` to `buildChaiBuilderConfig` (`db: createPostgresDB(...)`, `createLibsqlDB(...)`, etc.).");return r}var g=new Proxy({},{get(e,t){return b()[t]}});async function f(e){try{return{data:await e(),error:null}}catch(t){return{data:null,error:t}}}var w=new Proxy({},{get(e,t){return(n||s)[t]}});export{u as a,D as b,p as c,h as d,b as e,g as f,f as g,w as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{wa as r}from"./chunk-2NYUIXUX.js";import{a,b as c}from"./chunk-ITX7QWN6.js";import{atom as h,useAtom as n}from"jotai";import{isEmpty as l}from"lodash-es";import{useMemo as m}from"react";var f=(e=a)=>{let o=c;return e.fontFamily&&(o.fontFamily=Object.entries(e.fontFamily).reduce((t,[s,i])=>({...t,[s.replace("font-","")]:i}),o.fontFamily)),o.borderRadius=e.borderRadius,e.colors&&(o.colors=e.colors.reduce((t,s)=>(Object.entries(s.items).forEach(([i,u])=>{i in t&&(t[i]=u)}),t),o.colors)),o},p=h({}),x=()=>{let e=T(),o=m(()=>f(e),[e]),t=r("theme",{}),[s,i]=n(p);return[m(()=>({...o,...!l(t)&&t,...!l(s)&&s}),[o,t,s]),i]},T=()=>{let e=r("themeOptions",t=>t);return m(()=>e(a),[e])},d=h("block"),A=()=>n(d),C=h("settings"),R=()=>n(C);export{p as a,x as b,T as c,A as d,R as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={"app:read":"app:read","app:update":"app:update","app:publish":"app:publish","app:settings":"app:settings","app:publish_theme":"app:publish_theme","pages:create":"pages:create","pages:read":"pages:read","pages:update":"pages:update","pages:delete":"pages:delete","pages:publish":"pages:publish","pages:unpublish":"pages:unpublish","pages:change_type":"pages:change_type","pages:force_takeover":"pages:force_takeover","pages:edit_seo":"pages:edit_seo","partials:create":"partials:create","partials:read":"partials:read","partials:update":"partials:update","partials:delete":"partials:delete","partials:publish":"partials:publish","partials:unpublish":"partials:unpublish","revisions:read":"revisions:read","revisions:restore":"revisions:restore","revisions:delete":"revisions:delete","assets:create":"assets:create","assets:read":"assets:read","assets:update":"assets:update","assets:delete":"assets:delete","library:create":"library:create","library:read":"library:read","library:update":"library:update","library:delete":"library:delete","ai:use":"ai:use","ai:read":"ai:read","ai:generate_image":"ai:generate_image","ai:generate_theme":"ai:generate_theme","theme:edit":"theme:edit","theme:publish":"theme:publish","design_tokens:read":"design_tokens:read","design_tokens:create":"design_tokens:create","design_tokens:edit":"design_tokens:edit","design_tokens:delete":"design_tokens:delete","design_tokens:publish":"design_tokens:publish","settings:edit":"settings:edit","domains:read":"domains:read","domains:manage":"domains:manage","users:read":"users:read","users:invite":"users:invite","users:update_role":"users:update_role","users:remove":"users:remove","roles:read":"roles:read","roles:create":"roles:create","roles:update":"roles:update","roles:delete":"roles:delete","trash:read":"trash:read","trash:restore":"trash:restore","trash:delete_permanently":"trash:delete_permanently"},s=Object.keys(e);export{e as a};
|