@chaibuilder/sdk 4.0.0-beta.31 → 4.0.0-beta.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/dist/{2SSKDMRQ-gmj-yWTy.js → 2SSKDMRQ-BXAXoR9y.js} +5 -5
  2. package/dist/{2SSKDMRQ-BksFOLpD.cjs → 2SSKDMRQ-BqOsh3tf.cjs} +1 -1
  3. package/dist/{AP7HFJJL-kVgc0R61.js → AP7HFJJL-B78LfetW.js} +1 -1
  4. package/dist/{AP7HFJJL-CO-deD_p.cjs → AP7HFJJL-Cv6sqAAd.cjs} +1 -1
  5. package/dist/{IconPicker-D_GRfhwS.js → IconPicker-BlO5Pnyu.js} +1 -1
  6. package/dist/{IconPicker-BJHUCDn4.cjs → IconPicker-D4yq_b-k.cjs} +1 -1
  7. package/dist/{WDYDFRGG-C9_E3QW0.js → WDYDFRGG-BE7jgVqa.js} +4 -4
  8. package/dist/{WDYDFRGG-KPpWFul_.cjs → WDYDFRGG-Dz9d3cVW.cjs} +1 -1
  9. package/dist/{actions-registery-Bj-j1k5i.js → actions-registery-D3-4Yha7.js} +1108 -1061
  10. package/dist/{actions-registery-Cy1lqUVI.cjs → actions-registery-vPaY-3dZ.cjs} +25 -25
  11. package/dist/actions.cjs +1 -1
  12. package/dist/actions.js +2 -2
  13. package/dist/{active-in-another-tab-1GoKTVcF.js → active-in-another-tab-CA47uafJ.js} +2 -2
  14. package/dist/{active-in-another-tab-iEd5fZD0.cjs → active-in-another-tab-CNn_R-55.cjs} +1 -1
  15. package/dist/{add-new-language-page-B3GUvWdP.js → add-new-language-page-B-kPbhFd.js} +3 -3
  16. package/dist/{add-new-language-page-Cq8R42Ro.cjs → add-new-language-page-QAZbAFQe.cjs} +1 -1
  17. package/dist/{add-new-page-DiHnECAR.cjs → add-new-page-D4nbAHOp.cjs} +1 -1
  18. package/dist/add-new-page-Y0d9tHh0.js +31 -0
  19. package/dist/{ai-panel-content-BPpawv4D.cjs → ai-panel-content-DXbebC-m.cjs} +1 -1
  20. package/dist/{ai-panel-content-tExD3yhH.js → ai-panel-content-WMOeK5pF.js} +5 -5
  21. package/dist/{ai-panel-default-lang-DnYLHSaS.js → ai-panel-default-lang-CM_psX_h.js} +7 -7
  22. package/dist/{ai-panel-default-lang-C6N4wUUF.cjs → ai-panel-default-lang-hmfyAYPM.cjs} +2 -2
  23. package/dist/{ai-panel-other-lang-D1pCJluY.js → ai-panel-other-lang-BKANRJAb.js} +13 -13
  24. package/dist/{ai-panel-other-lang-C65lVVtZ.cjs → ai-panel-other-lang-D4GL1b-W.cjs} +1 -1
  25. package/dist/{ai-prompt-input-Dws5BHhQ.cjs → ai-prompt-input-Dwd0-pcD.cjs} +1 -1
  26. package/dist/{ai-prompt-input-B2q30bhR.js → ai-prompt-input-mxXtWptn.js} +13 -13
  27. package/dist/{ai-translation-prompt-DnwG2BmF.cjs → ai-translation-prompt-7M2aEZ1w.cjs} +1 -1
  28. package/dist/{ai-translation-prompt-Dnn6i_t3.js → ai-translation-prompt-C_Pb7BE4.js} +1 -1
  29. package/dist/{apply-binding-chfbBKi2.js → apply-binding-BYCW1k2l.js} +1 -1
  30. package/dist/{apply-binding-9XSrYzAE.cjs → apply-binding-xiigK7eK.cjs} +1 -1
  31. package/dist/{change-password-modal-LKtYY-8V.cjs → change-password-modal-BYZoefwT.cjs} +1 -1
  32. package/dist/{change-password-modal-C0MMizgl.js → change-password-modal-Dqf_mleR.js} +5 -5
  33. package/dist/{code-editor-CWOmKcUc.js → code-editor-1fSEocLK.js} +1 -1
  34. package/dist/{code-editor-Cim6jQVF.cjs → code-editor-uN7W7KMD.cjs} +1 -1
  35. package/dist/{continue-editing-in-this-client-oxYWGWON.js → continue-editing-in-this-client-DD7bBhjD.js} +2 -2
  36. package/dist/{continue-editing-in-this-client-Dd6nKIvX.cjs → continue-editing-in-this-client-DDM65ror.cjs} +1 -1
  37. package/dist/{core-BWQrViOY.cjs → core-czmLeR0h.cjs} +1 -1
  38. package/dist/{core-QlWEXm1d.js → core-nSRy3D7z.js} +16 -15
  39. package/dist/core.cjs +1 -1
  40. package/dist/core.d.ts +14 -2
  41. package/dist/core.js +19 -19
  42. package/dist/{css-import-modal-CXulmaB4.cjs → css-import-modal-BU7bJAaT.cjs} +1 -1
  43. package/dist/{css-import-modal-6bMTRlCg.js → css-import-modal-pBNRVmGj.js} +1 -1
  44. package/dist/default-theme-options-DN-3gIjM.cjs +22 -0
  45. package/dist/{plugin-BSjgGgwo.js → default-theme-options-saBIkWGT.js} +114 -114
  46. package/dist/{delete-page-D0tdn6VW.cjs → delete-page-8oEYsHPE.cjs} +1 -1
  47. package/dist/delete-page-B53nkF74.js +71 -0
  48. package/dist/{design-token-usage-D-hrcKz1.cjs → design-token-usage-Cm9m4AMz.cjs} +1 -1
  49. package/dist/{design-token-usage-lf7N_uOk.js → design-token-usage-DzWav2ip.js} +14 -14
  50. package/dist/{digital-asset-manager-DJhRhLGC.js → digital-asset-manager-1yLYGPuf.js} +5 -5
  51. package/dist/digital-asset-manager-BaTvMY8Q.cjs +1 -0
  52. package/dist/{duplicate-page-ChSp1TYN.cjs → duplicate-page-C2DZI4U0.cjs} +1 -1
  53. package/dist/{duplicate-page-CXzYy7vx.js → duplicate-page-DCRVR-kF.js} +6 -6
  54. package/dist/{dynamic-page-selector-btGtkyyv.cjs → dynamic-page-selector-CZJQnc-Q.cjs} +1 -1
  55. package/dist/{dynamic-page-selector-r5IR9_7k.js → dynamic-page-selector-DCGWkLVV.js} +12 -12
  56. package/dist/get-chai-builder-theme-C_qofMh_.cjs +1 -0
  57. package/dist/{get-chai-builder-theme-BpuwSLeS.js → get-chai-builder-theme-CyOkIlte.js} +1 -1
  58. package/dist/{image-compression-DsZ1oqpb.js → image-compression-DPFITwOL.js} +2 -2
  59. package/dist/image-compression-UaU7Bwqe.cjs +1 -0
  60. package/dist/{image-editor-CilPMtAC.js → image-editor-C0EYZJY_.js} +1 -1
  61. package/dist/{image-editor-BdW476J8.cjs → image-editor-DkgZrSGr.cjs} +1 -1
  62. package/dist/{index-DtMksfXx.js → index-BDrc0HJQ.js} +1729 -1680
  63. package/dist/index-BuXfCtgR.cjs +5 -0
  64. package/dist/{index-DsQXiNA_.js → index-C7bidKtE.js} +2786 -2752
  65. package/dist/index-DKjYF53r.cjs +160 -0
  66. package/dist/{json-diff-viewer-BkrnLb3B.cjs → json-diff-viewer-88jEhq8D.cjs} +1 -1
  67. package/dist/{json-diff-viewer-D3N3w3Ax.js → json-diff-viewer-wmzIZcuQ.js} +34 -34
  68. package/dist/{lang-panel-BAaaP4Qc.js → lang-panel--kWBnU_W.js} +7 -7
  69. package/dist/{lang-panel-BjDRrpwN.cjs → lang-panel-I_ABfjOZ.cjs} +1 -1
  70. package/dist/manage-design-tokens-CslCEOXU.cjs +1 -0
  71. package/dist/manage-design-tokens-JdVKj09s.js +445 -0
  72. package/dist/manage-design-tokens-modal-DA15ou0u.cjs +1 -0
  73. package/dist/{manage-design-tokens-modal-9qpcb-EC.js → manage-design-tokens-modal-xKxC72Bc.js} +9 -9
  74. package/dist/{mark-as-template-DNHYNjI9.js → mark-as-template-AbZrkEYl.js} +7 -7
  75. package/dist/{mark-as-template-IYRjta97.cjs → mark-as-template-ClQjC2p2.cjs} +1 -1
  76. package/dist/{nested-path-selector-content-Be-pbnVl.js → nested-path-selector-content-B04k-PPB.js} +1 -1
  77. package/dist/{nested-path-selector-content-CWmPgU-L.cjs → nested-path-selector-content-dFwZaM1r.cjs} +1 -1
  78. package/dist/{no-language-page-content-C-ltY7bj.js → no-language-page-content-CbUqxuC4.js} +2 -2
  79. package/dist/{no-language-page-content-8_J6y-cm.cjs → no-language-page-content-pzkWJAg6.cjs} +1 -1
  80. package/dist/{no-language-page-dialog-D5NXpDHi.js → no-language-page-dialog-AavD_Mmc.js} +2 -2
  81. package/dist/{no-language-page-dialog-BOZZZzqx.cjs → no-language-page-dialog-DhlOVXUm.cjs} +1 -1
  82. package/dist/{page-creator-BuHHnqiQ.js → page-creator-2OZveMsR.js} +95 -95
  83. package/dist/{page-creator-wtbae2U7.cjs → page-creator-DMjnStPf.cjs} +1 -1
  84. package/dist/{page-lock-pPGlTxj7.js → page-lock-5MwwTWe8.js} +2 -2
  85. package/dist/{page-lock-DN4iJc-V.cjs → page-lock-B3CpoFTs.cjs} +1 -1
  86. package/dist/{page-locked-dialog-Bl-ojgIW.js → page-locked-dialog-BhNZC9wZ.js} +13 -13
  87. package/dist/{page-locked-dialog-B_vdgv24.cjs → page-locked-dialog-ZOvjnxRI.cjs} +1 -1
  88. package/dist/page-manager-new-BcI-1Dms.cjs +1 -0
  89. package/dist/{page-manager-new-Bg8H6yrg.js → page-manager-new-l68-Lc9h.js} +85 -88
  90. package/dist/{page-manager-search-and-filter-CDXunXNd.cjs → page-manager-search-and-filter-BOpne6v-.cjs} +1 -1
  91. package/dist/{page-manager-search-and-filter-CyfO7O96.js → page-manager-search-and-filter-DJn98D02.js} +31 -30
  92. package/dist/{page-revisions-content-BKT8S9_g.cjs → page-revisions-content-B00tDCzu.cjs} +1 -1
  93. package/dist/{page-revisions-content-B-egQgoZ.js → page-revisions-content-Bqp-9bae.js} +23 -23
  94. package/dist/pages.cjs +1 -1
  95. package/dist/pages.d.ts +14 -2
  96. package/dist/pages.js +12 -12
  97. package/dist/{publish-pages-content-D2B_ScCQ.js → publish-pages-content-CtZLSG6O.js} +68 -75
  98. package/dist/publish-pages-content-DfYG0biw.cjs +1 -0
  99. package/dist/render.cjs +1 -1
  100. package/dist/render.js +5 -5
  101. package/dist/{rte-widget-modal-c3T09VeO.js → rte-widget-modal-DGEWoQ1b.js} +1 -1
  102. package/dist/{rte-widget-modal-CC1KcrAT.cjs → rte-widget-modal-DX66uSPv.cjs} +1 -1
  103. package/dist/runtime.cjs +6 -6
  104. package/dist/runtime.d.ts +2 -0
  105. package/dist/runtime.js +36 -35
  106. package/dist/{save-to-lib-dT1NDd5w.js → save-to-lib-CCxX5ZmQ.js} +26 -26
  107. package/dist/{save-to-lib-CiM0wiIr.cjs → save-to-lib-DmAjdhzU.cjs} +1 -1
  108. package/dist/sdk.css +1 -1
  109. package/dist/{selected-block-display-BgqcPsXI.cjs → selected-block-display-Csce27bR.cjs} +1 -1
  110. package/dist/{selected-block-display-BQndDPcY.js → selected-block-display-Cv6jBhJD.js} +20 -20
  111. package/dist/{seo-panel-DXZvGYEM.cjs → seo-panel-BZYXeYzE.cjs} +1 -1
  112. package/dist/{seo-panel-Z93Zf_bz.js → seo-panel-Ctstjs-d.js} +25 -25
  113. package/dist/{shared-json-ld-DwvUDGAS.cjs → shared-json-ld-BDWtjHgw.cjs} +1 -1
  114. package/dist/{shared-json-ld-Ct68RlWD.js → shared-json-ld-BNHGmUBd.js} +45 -45
  115. package/dist/{slug-input-CAqkFZBq.js → slug-input-Bui1Qmvh.js} +1 -1
  116. package/dist/{slug-input-Curnt2n3.cjs → slug-input-IAl_jfHr.cjs} +1 -1
  117. package/dist/supabase-actions.cjs +1 -1
  118. package/dist/supabase-actions.js +272 -206
  119. package/dist/{take-over-request-D6y2HcDr.cjs → take-over-request-Bl6jS1cK.cjs} +1 -1
  120. package/dist/{take-over-request-C6ngP1QR.js → take-over-request-Ceuqyk5K.js} +13 -13
  121. package/dist/{translation-warning-modal-B876S5yp.cjs → translation-warning-modal-CCmmwz1C.cjs} +1 -1
  122. package/dist/{translation-warning-modal-kRcfrPgo.js → translation-warning-modal-DA5dt2FA.js} +9 -9
  123. package/dist/types.d.ts +14 -2
  124. package/dist/{unmark-as-template-DeeWUTco.js → unmark-as-template-CKVMibvu.js} +13 -13
  125. package/dist/{unmark-as-template-f1dl_YTz.cjs → unmark-as-template-OEUqo0uc.cjs} +1 -1
  126. package/dist/unpublish-page-A5qn6E6g.js +28 -0
  127. package/dist/{unpublish-page-DEPFjGuu.cjs → unpublish-page-C81bYHLI.cjs} +1 -1
  128. package/dist/{unpublished-partials-modal-Ts5ZhAK9.js → unpublished-partials-modal-FqzTp5el.js} +3 -3
  129. package/dist/{unpublished-partials-modal-CEFXp1D1.cjs → unpublished-partials-modal-af5uDL7Y.cjs} +1 -1
  130. package/dist/utils.cjs +1 -1
  131. package/dist/utils.js +1 -1
  132. package/dist/web-blocks.cjs +1 -1
  133. package/dist/web-blocks.js +1 -1
  134. package/dist/{web-preview-CoT8r96b.js → web-preview-vge6uUSa.js} +1 -1
  135. package/dist/{web-preview-DTDoIE-c.cjs → web-preview-xtKkQOXy.cjs} +1 -1
  136. package/package.json +2 -7
  137. package/dist/add-new-page-C5HlQfzy.js +0 -31
  138. package/dist/delete-page-LnzR01A8.js +0 -71
  139. package/dist/digital-asset-manager-eCJHNSjj.cjs +0 -1
  140. package/dist/get-chai-builder-theme-B5RkBTsB.cjs +0 -1
  141. package/dist/image-compression-DZ9WMmyn.cjs +0 -1
  142. package/dist/index-CAhDwfHE.cjs +0 -5
  143. package/dist/index-mPCp0j2h.cjs +0 -160
  144. package/dist/manage-design-tokens-BknGNAKE.cjs +0 -1
  145. package/dist/manage-design-tokens-Co5677WS.js +0 -428
  146. package/dist/manage-design-tokens-modal-BcgdwEXE.cjs +0 -1
  147. package/dist/page-manager-new-5W5M9_ue.cjs +0 -1
  148. package/dist/plugin-DHpuZZXz.cjs +0 -22
  149. package/dist/publish-pages-content-WJHTVYnx.cjs +0 -1
  150. package/dist/theme-panel-footer-CGZL2F7R.js +0 -26
  151. package/dist/theme-panel-footer-IgGj-_OA.cjs +0 -1
  152. package/dist/unpublish-page-U_79Pwc0.js +0 -28
@@ -1 +1 @@
1
- "use strict";const m=require("./STRINGS-FNnfjF5H.cjs"),T=require("./common-functions-B3a4xKt_.cjs"),e=require("lodash-es"),k=require("himalaya"),q=require("./core-BWQrViOY.cjs"),O=require("tailwind-merge"),R=s=>{if(s=s.replace(m.STYLES_KEY,""),!s)return{baseClasses:"",classes:""};const l=s.split(/,(?![^\[]*\])/);if(l.length===1)return{baseClasses:"",classes:l[0].trim()};const[t,...n]=l;return{baseClasses:t.trim(),classes:n.join(",").trim().replace(/ +(?= )/g,"")}};function F(s,l,t){const n=e.get(t,"i18nProps",[]);if(e.isEmpty(l)||e.isEmpty(n))return s;const a=e.cloneDeep(s);return e.forEach(e.keys(a),i=>{if(e.includes(n,i)&&!e.isEmpty(l)){const r=e.get(a,i),o=e.get(a,`${i}-${l}`,"");e.isString(r)?a[i]=e.isString(o)&&!e.isEmpty(o.trim())&&o.trimStart()||r:a[i]=e.isEmpty(o)?r:o}}),a}const Y=(s,l)=>{const{baseClasses:t,classes:n}=R(s),i=n.split(" ").filter(o=>o.startsWith(m.DESIGN_TOKEN_PREFIX)).map(o=>{var d;return(d=l[o])==null?void 0:d.value}),r=n.split(" ").filter(o=>!o.startsWith(m.DESIGN_TOKEN_PREFIX)).join(" ");return O.twMerge.apply(null,[t,...i,r])};function K(s,l){return e.get(s,`${l}_attrs`,{})}function z(s,l=!0,t={}){const n={};return Object.keys(s).forEach(a=>{if(e.isString(s[a])&&s[a].startsWith(m.STYLES_KEY)){const i=Y(s[a],t),r=K(s,a);n[a]={...!e.isEmpty(i)&&{className:i},...r,...l?{"data-style-prop":a,"data-block-parent":s._id,"data-style-id":`${a}-${s._id}`}:{}}}}),n}const U=e.memoize(s=>{const l=q.getRegisteredChaiBlock(s),t=e.get(l,"schema.properties",{});return Object.fromEntries(Object.entries(t).filter(([,n])=>e.get(n,"runtime",!1)))}),G=(s,l)=>{if(!e.isArray(s))return s;let t=s,n;return typeof l.limit=="number"&&l.limit>0&&(n=l.limit),n!==void 0&&(t=t.slice(0,n)),t},X=(s,l)=>{const t=e.cloneDeep(s);return e.forEach(e.keys(t),n=>{if(e.isString(t[n])&&!e.startsWith(n,"_")){let a=t[n];n==="repeaterItems"&&(t.repeaterItemsBinding=a);const i=/\{\{(.*?)\}\}/g,r=a.match(i);r&&r.forEach(o=>{let d=o.slice(2,-2);const c=e.get(l,d,o);a=e.isArray(c)?c:a.replace(o,c)}),t[n]=a}}),t},Z=s=>{const l=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,t=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return l.test(s)||t.test(s)},Q=s=>{if(e.isEmpty(s))return s;const l=/<video[^>]+src=['"]([^'">]+)['"]/,t=/<iframe[^>]+src=['"]([^'">]+)['"]/,n=s.match(l),a=s.match(t),i=n?n[1]:a?a[1]:null,r=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,o=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return i&&(r.test(i)||o.test(i))?i:s},H=["chai-name","data-chai-name"],ee={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"},form:{action:"action"}},te=(s,l)=>{var t;return((t=s.children)==null?void 0:t.length)===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link","RichText"],l._type)},v=s=>s.map(l=>l.type==="text"?e.get(l,"content",""):e.isEmpty(l.children)?"":v(l.children||[])).join(""),B=s=>s===null?"":s,M=s=>{const l=e.compact(e.map(s.split(/\s+/),e.trim)),t=e.find(l,o=>/^w-/.test(o)),n=e.find(l,o=>/^h-/.test(o));if(!n||!t)return{height:"",width:""};const a=o=>{if(!o)return;const d=o.match(/^[wh]-(?:\[(.*?)\]|(.+))$/);if(!d)return;if(d[1])return d[1];const c=d[2];return/^\d+(\.\d+)?$/.test(c)?`${Number(c)*4}px`:c==="auto"||e.includes(c,"%")?c:"16px"},i=a(t),r=a(n);return{width:e.includes(i,"px")?i:"16px",height:e.includes(r,"px")?r:"16px"}},V=s=>{if(s.tagName==="svg")return{};const l={},t=ee[s.tagName||""]||{},n=s.attributes||[];return e.forEach(n,({key:a,value:i})=>{var r;if(!e.includes(H,a))if(a==="bid"&&(l._bid=B(i)),t[a]){if(s.tagName==="img"&&a==="src"&&!i.startsWith("http")){const o=e.find(s.attributes,{key:"width"}),d=e.find(s.attributes,{key:"height"});o&&d?i=`https://picsum.photos/${o==null?void 0:o.value}x${d==null?void 0:d.value}`:i="https://picsum.photos/150x150"}else if(s.tagName==="a"){const o=e.find(s.attributes,{key:"href"});o&&typeof(o==null?void 0:o.value)=="string"&&((r=o==null?void 0:o.value)!=null&&r.startsWith("pageType:"))&&e.set(l,"link.type","pageType")}e.set(l,t[a],B(i))}else e.includes(["style","class","srcset","bid"],a)||(l.styles_attrs=l.styles_attrs||{},e.startsWith(a,"@")&&(a=a.replace("@","x-on:")),l.styles_attrs[`${a}`]=B(i))}),delete l.class,l},se=(s,l="styles")=>{if(!s.attributes)return{[l]:`${m.STYLES_KEY},`};const t=e.find(s.attributes,{key:"class"});if(t){const n=t.value;return{[l]:`${m.STYLES_KEY},${n}`}}return{[l]:`${m.STYLES_KEY},`}},ne=s=>{const l=e.get(s,"attributes",[]),t=l.find(c=>c.key==="data-chai-richtext"||c.key==="chai-richtext"),n=l.find(c=>c.key==="data-chai-lightbox"||c.key==="chai-lightbox"),a=l.find(c=>c.key==="data-chai-dropdown"||c.key==="chai-dropdown"),i=l.find(c=>c.key==="data-chai-dropdown-button"||c.key==="chai-dropdown-button"),r=l.find(c=>c.key==="data-chai-dropdown-content"||c.key==="chai-dropdown-content"),o=l.find(c=>c.key==="class"),d=o&&o.value.split(/\s+/).includes("rte");if(a)return{_type:"Dropdown"};if(i)return{_type:"DropdownButton"};if(r)return{_type:"DropdownContent"};if(t||d)return{_type:"Paragraph"};if(n)return{_type:"LightBoxLink"};switch(s.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:s.tagName,_listType:s.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:s.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:s.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Box",_name:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:s.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:s.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:{const c=e.get(s,"children",[]).length>0?"Box":"EmptyBox";return{_type:c,tag:s.tagName,_name:c=="EmptyBox"||s.tagName==="div"?c:e.capitalize(s.tagName)}}}},E=(s,l=null)=>e.flatMapDeep(s,t=>{var S,D,I,$,C,N,L,W,A,j;if(t.type==="comment")return[];let n={_id:T.generateUUID()};if(l&&(n._parent=l.block._id),t.type==="text")return e.isEmpty(e.get(t,"content",""))?[]:l&&te(l.node,l.block)?(e.set(l,"block.content",e.get(t,"content","")),[]):{...n,_type:"Text",content:e.get(t,"content","")};if(e.startsWith(t.tagName,"chai-")){const p=t.attributes||[],u=e.find(p,{key:"chai-type"}),y=(u==null?void 0:u.value)||e.startCase(e.camelCase(t.tagName||"")).replace(/ /g,"").replace(/\s+/g,"");n._type=y,e.forEach(p,({key:h,value:P})=>{if(h==="about-this-component"||h==="chai-type"||h==="can-move"||h==="can-delete")return;if(h==="id"){n._id=P;return}const J=e.startsWith(h,"_")?h:e.camelCase(h);let f=B(P);typeof f=="string"&&e.startsWith(f,"#styles:")&&(f=f.replace("#styles:","#styles:,")),n[J]=f});const g=E(t.children||[],{block:n,node:t});return[n,...g]}const a=e.get(t,"attributes",[]),i=t.tagName==="p"||a.find(p=>p.key==="data-chai-richtext"||p.key==="chai-richtext"),r=a.find(p=>p.key==="class"),o=r&&r.value.split(/\s+/).includes("rte"),d=a.find(p=>p.key==="data-chai-lightbox"||p.key==="chai-lightbox"),c=a.find(p=>p.key==="data-chai-dropdown"||p.key==="chai-dropdown"),b=a.find(p=>p.key==="data-chai-dropdown-button"||p.key==="chai-dropdown-button"),_=a.find(p=>p.key==="data-chai-dropdown-content"||p.key==="chai-dropdown-content");if(n={...n,...ne(t),...V(t),...se(t)},t.attributes){const p=t.attributes.find(u=>e.includes(H,u.key));p&&(n._name=p.value)}if(i||o)return n.content=`<p>${k.stringify(t.children||[])}</p>`,e.has(n,"styles_attrs.data-chai-richtext")&&delete n.styles_attrs["data-chai-richtext"],e.has(n,"styles_attrs.chai-richtext")&&delete n.styles_attrs["chai-richtext"],[n];if(d){const p=["data-chai-lightbox","chai-lightbox","data-vbtype","data-autoplay","data-maxwidth","data-overlay","data-gall","href"];n={...n,href:((S=a.find(u=>u.key==="href"))==null?void 0:S.value)||"",hrefType:((D=a.find(u=>u.key==="data-vbtype"))==null?void 0:D.value)||"video",autoplay:((I=a.find(u=>u.key==="data-autoplay"))==null?void 0:I.value)==="true"?"true":"false",maxWidth:((C=($=a.find(u=>u.key==="data-maxwidth"))==null?void 0:$.value)==null?void 0:C.replace("px",""))||"",backdropColor:((N=a.find(u=>u.key==="data-overlay"))==null?void 0:N.value)||"",galleryName:((L=a.find(u=>u.key==="data-gall"))==null?void 0:L.value)||""},e.forEach(p,u=>{e.has(n,`styles_attrs.${u}`)&&delete n.styles_attrs[u]})}if(c&&(delete n.styles_attrs,n.showDropdown=!1),_&&delete n.styles_attrs,b){delete n.styles_attrs;const p=e.filter(t.children||[],y=>(y==null?void 0:y.tagName)!=="span");n.content=v(p);const u=e.find(t.children||[],y=>(y==null?void 0:y.tagName)==="span"&&e.some(y.children||[],g=>(g==null?void 0:g.tagName)==="svg"));if(u){const y=e.find(u.children||[],g=>(g==null?void 0:g.tagName)==="svg");if(y){n.icon=k.stringify([y]);const{height:g,width:h}=ae(y,"16px","16px");n.iconHeight=g,n.iconWidth=h}}return[n]}if(n._type==="Input"){const p=n.inputType||"text";p==="checkbox"?e.set(n,"_type","Checkbox"):p==="radio"&&e.set(n,"_type","Radio")}else if(t.tagName==="video"||t.tagName==="iframe"){const p=k.stringify([t]);return Z(p)&&(e.set(n,"_type","Video"),e.set(n,"url",Q(p)),e.set(n,"styles",`${m.STYLES_KEY},`),e.set(n,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),n.content=p,[n]}else if(t.tagName==="svg"){const p=e.get(e.find(t.attributes,{key:"class"}),"value",""),{height:u,width:y}=M(p);if(u&&y)n.styles=`${m.STYLES_KEY}, ${T.cn(`w-${y} h-${u}`,p)}`.trim(),n.height=u==null?void 0:u.replace("px",""),n.width=y==null?void 0:y.replace("px","");else{const g=(W=e.find(t.attributes,{key:"height"}))==null?void 0:W.value,h=(A=e.find(t.attributes,{key:"width"}))==null?void 0:A.value;g&&h?(n.styles=`${m.STYLES_KEY}, ${T.cn(`w-[${h}px] h-[${g}px]`,p)}`.trim(),n.height=g,n.width=h):n.styles=`${m.STYLES_KEY}, ${T.cn("w-full h-full",p)}`.trim()}return t.attributes=e.filter(t.attributes,g=>!e.includes(["style","width","height","class"],g.key)),n.icon=k.stringify([t]),[n]}else if(t.tagName=="option"&&l&&((j=l.block)==null?void 0:j._type)==="Select")return l.block.options.push({label:v(t.children||[]),...V(t)}),[];const x=E(t.children||[],{block:n,node:t});return[n,...x]}),ae=(s,l,t)=>{var d,c;const n=e.get(s,"attributes",[]),{height:a,width:i}=M(e.get(e.find(n,{key:"class"}),"value",""));if(a&&i)return{height:`[${a}px]`,width:`[${i}px]`};const r=(d=e.find(n,{key:"height"}))==null?void 0:d.value,o=(c=e.find(n,{key:"width"}))==null?void 0:c.value;return{height:r?`[${r}px]`:t,width:o?`[${o}px]`:l}},le=s=>{s=s.replace(/(\w+)=\\?"(.*?)\\?"/g,(n,a,i)=>{let r=i.replace(/\\"/g,'"');return r=r.replace(/{([^}]+)}/g,o=>o.replace(/"/g,'\\"')),`${a}="${r.replace(/\\"/g,'"')}"`}),s=s.replace(/\\n/g," ").replace(/\\\\/g,"").replace(/\\([/<>])/g,"$1").replace(/\\./g,"").replace(/[\n\r\t\f\v]/g," "),s=s.replace(/\$name="[^"]*"/g,"");const l=s.match(/<body[^>]*>[\s\S]*?<\/body>/);return(l&&l.length>0?l[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):s).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},ie=(s,l)=>e.find(s,{_id:l}),oe=(s,l)=>e.isEmpty(l)?s.map(t=>(e.unset(t,"_bid"),t)):e.map(s,t=>{const n=e.isEmpty(t._bid)?void 0:ie(l,t._bid);if(n){n._type==="Icon"&&e.get(t,"icon","").match(/chai-default-svg/)&&delete t.icon;const a={...n,...t};return e.unset(a,"_bid"),a}return e.unset(t,"_bid"),t}),re=s=>{const l=k.parse(le(s));if(e.isEmpty(s))return[];const t=e.flatten(E(l));return q.syncBlocksWithDefaultProps(t)},ce=(s,l)=>s.map(t=>{const n=e.keys(t).filter(a=>e.isString(t[a])&&t[a].startsWith(m.STYLES_KEY));return e.each(n,a=>{t[a]=`${m.STYLES_KEY},${Y(t[a],l)}`}),t}),pe=s=>{const l=e.last(s);return s.map(t=>{const n=Object.keys(t);for(let a=0;a<n.length;a++)if(e.isString(t[n[a]])&&e.startsWith(n[a],"content")){const i=t===l?"":" ";t[n[a]]=`${t[n[a]].trim()}${i}`}return t})},w=(s,l,{index:t,key:n},a)=>{if(e.isString(s)){let i=s;const r=/\{\{(.*?)\}\}/g,o=s.match(r);if(o){const d=a==="image"||a==="mobileImage";o.forEach(c=>{let b=c.slice(2,-2).trim(),_=n.slice(2,-2).trim();t!==-1&&e.startsWith(b,"$index.")?b=`${_}.${t}.${b.slice(7)}`:t!==-1&&e.startsWith(b,"$index")&&(b=`${_}.${t}`);const x=e.get(l,b);x===void 0?i=i.replace(c,""):d&&!e.isArray(x)?i=x:i=e.isArray(x)?x:i.replace(c,x)})}return i}if(e.isArray(s))return s.map(i=>w(i,l,{index:t,key:n},a));if(s&&typeof s=="object"){const i={};return e.forEach(e.keys(s),r=>{!e.startsWith(r,"_")&&r!=="$repeaterItemsKey"?i[r]=w(s[r],l,{index:t,key:n},r):i[r]=s[r]}),i}return s},ue=(s,l,{index:t,key:n})=>{let a=e.cloneDeep(s);return a.repeaterItems&&(a.$repeaterItemsKey=a.repeaterItems,e.startsWith(a.repeaterItems,`{{${m.COLLECTION_PREFIX}`)&&(a.$repeaterItemsKey=a.repeaterItems=`${a.repeaterItems.replace("}}",`/${a._id}}}`)}`),!e.isEmpty(a.repeaterItems)&&a.pagination&&(a.repeaterTotalItems=`${a.repeaterItems.replace("}}",`/${a._id}/totalItems}}`)}`)),w(a,l,{index:t,key:n})};exports.adjustSpacingInContentBlocks=pe;exports.applyBindingToBlockProps=ue;exports.applyChaiDataBinding=X;exports.applyDesignTokens=ce;exports.applyLanguage=F;exports.applyLimit=G;exports.getBlockRuntimeProps=U;exports.getBlockTagAttributes=z;exports.getBlocksFromHTML=re;exports.getSplitChaiClasses=R;exports.mergeBlocksWithExisting=oe;
1
+ "use strict";const m=require("./STRINGS-FNnfjF5H.cjs"),T=require("./common-functions-B3a4xKt_.cjs"),e=require("lodash-es"),k=require("himalaya"),q=require("./core-czmLeR0h.cjs"),O=require("tailwind-merge"),R=s=>{if(s=s.replace(m.STYLES_KEY,""),!s)return{baseClasses:"",classes:""};const l=s.split(/,(?![^\[]*\])/);if(l.length===1)return{baseClasses:"",classes:l[0].trim()};const[t,...n]=l;return{baseClasses:t.trim(),classes:n.join(",").trim().replace(/ +(?= )/g,"")}};function F(s,l,t){const n=e.get(t,"i18nProps",[]);if(e.isEmpty(l)||e.isEmpty(n))return s;const a=e.cloneDeep(s);return e.forEach(e.keys(a),i=>{if(e.includes(n,i)&&!e.isEmpty(l)){const r=e.get(a,i),o=e.get(a,`${i}-${l}`,"");e.isString(r)?a[i]=e.isString(o)&&!e.isEmpty(o.trim())&&o.trimStart()||r:a[i]=e.isEmpty(o)?r:o}}),a}const Y=(s,l)=>{const{baseClasses:t,classes:n}=R(s),i=n.split(" ").filter(o=>o.startsWith(m.DESIGN_TOKEN_PREFIX)).map(o=>{var d;return(d=l[o])==null?void 0:d.value}),r=n.split(" ").filter(o=>!o.startsWith(m.DESIGN_TOKEN_PREFIX)).join(" ");return O.twMerge.apply(null,[t,...i,r])};function K(s,l){return e.get(s,`${l}_attrs`,{})}function z(s,l=!0,t={}){const n={};return Object.keys(s).forEach(a=>{if(e.isString(s[a])&&s[a].startsWith(m.STYLES_KEY)){const i=Y(s[a],t),r=K(s,a);n[a]={...!e.isEmpty(i)&&{className:i},...r,...l?{"data-style-prop":a,"data-block-parent":s._id,"data-style-id":`${a}-${s._id}`}:{}}}}),n}const U=e.memoize(s=>{const l=q.getRegisteredChaiBlock(s),t=e.get(l,"schema.properties",{});return Object.fromEntries(Object.entries(t).filter(([,n])=>e.get(n,"runtime",!1)))}),G=(s,l)=>{if(!e.isArray(s))return s;let t=s,n;return typeof l.limit=="number"&&l.limit>0&&(n=l.limit),n!==void 0&&(t=t.slice(0,n)),t},X=(s,l)=>{const t=e.cloneDeep(s);return e.forEach(e.keys(t),n=>{if(e.isString(t[n])&&!e.startsWith(n,"_")){let a=t[n];n==="repeaterItems"&&(t.repeaterItemsBinding=a);const i=/\{\{(.*?)\}\}/g,r=a.match(i);r&&r.forEach(o=>{let d=o.slice(2,-2);const c=e.get(l,d,o);a=e.isArray(c)?c:a.replace(o,c)}),t[n]=a}}),t},Z=s=>{const l=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,t=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return l.test(s)||t.test(s)},Q=s=>{if(e.isEmpty(s))return s;const l=/<video[^>]+src=['"]([^'">]+)['"]/,t=/<iframe[^>]+src=['"]([^'">]+)['"]/,n=s.match(l),a=s.match(t),i=n?n[1]:a?a[1]:null,r=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,o=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return i&&(r.test(i)||o.test(i))?i:s},H=["chai-name","data-chai-name"],ee={img:{alt:"alt",width:"width",height:"height",src:"image"},video:{src:"url",autoplay:"controls.autoPlay",muted:"controls.muted",loop:"controls.loop",controls:"controls.widgets"},a:{href:"link.href",target:"link.target",type:""},input:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},textarea:{placeholder:"placeholder",required:"required",type:"inputType",name:"fieldName"},select:{placeholder:"placeholder",required:"required",multiple:"multiple",name:"fieldName"},form:{action:"action"}},te=(s,l)=>{var t;return((t=s.children)==null?void 0:t.length)===1&&e.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link","RichText"],l._type)},v=s=>s.map(l=>l.type==="text"?e.get(l,"content",""):e.isEmpty(l.children)?"":v(l.children||[])).join(""),B=s=>s===null?"":s,M=s=>{const l=e.compact(e.map(s.split(/\s+/),e.trim)),t=e.find(l,o=>/^w-/.test(o)),n=e.find(l,o=>/^h-/.test(o));if(!n||!t)return{height:"",width:""};const a=o=>{if(!o)return;const d=o.match(/^[wh]-(?:\[(.*?)\]|(.+))$/);if(!d)return;if(d[1])return d[1];const c=d[2];return/^\d+(\.\d+)?$/.test(c)?`${Number(c)*4}px`:c==="auto"||e.includes(c,"%")?c:"16px"},i=a(t),r=a(n);return{width:e.includes(i,"px")?i:"16px",height:e.includes(r,"px")?r:"16px"}},V=s=>{if(s.tagName==="svg")return{};const l={},t=ee[s.tagName||""]||{},n=s.attributes||[];return e.forEach(n,({key:a,value:i})=>{var r;if(!e.includes(H,a))if(a==="bid"&&(l._bid=B(i)),t[a]){if(s.tagName==="img"&&a==="src"&&!i.startsWith("http")){const o=e.find(s.attributes,{key:"width"}),d=e.find(s.attributes,{key:"height"});o&&d?i=`https://picsum.photos/${o==null?void 0:o.value}x${d==null?void 0:d.value}`:i="https://picsum.photos/150x150"}else if(s.tagName==="a"){const o=e.find(s.attributes,{key:"href"});o&&typeof(o==null?void 0:o.value)=="string"&&((r=o==null?void 0:o.value)!=null&&r.startsWith("pageType:"))&&e.set(l,"link.type","pageType")}e.set(l,t[a],B(i))}else e.includes(["style","class","srcset","bid"],a)||(l.styles_attrs=l.styles_attrs||{},e.startsWith(a,"@")&&(a=a.replace("@","x-on:")),l.styles_attrs[`${a}`]=B(i))}),delete l.class,l},se=(s,l="styles")=>{if(!s.attributes)return{[l]:`${m.STYLES_KEY},`};const t=e.find(s.attributes,{key:"class"});if(t){const n=t.value;return{[l]:`${m.STYLES_KEY},${n}`}}return{[l]:`${m.STYLES_KEY},`}},ne=s=>{const l=e.get(s,"attributes",[]),t=l.find(c=>c.key==="data-chai-richtext"||c.key==="chai-richtext"),n=l.find(c=>c.key==="data-chai-lightbox"||c.key==="chai-lightbox"),a=l.find(c=>c.key==="data-chai-dropdown"||c.key==="chai-dropdown"),i=l.find(c=>c.key==="data-chai-dropdown-button"||c.key==="chai-dropdown-button"),r=l.find(c=>c.key==="data-chai-dropdown-content"||c.key==="chai-dropdown-content"),o=l.find(c=>c.key==="class"),d=o&&o.value.split(/\s+/).includes("rte");if(a)return{_type:"Dropdown"};if(i)return{_type:"DropdownButton"};if(r)return{_type:"DropdownContent"};if(t||d)return{_type:"Paragraph"};if(n)return{_type:"LightBoxLink"};switch(s.tagName){case"img":return{_type:"Image"};case"input":return{_type:"Input",showLabel:!1};case"hr":return{_type:"Divider"};case"br":return{_type:"LineBreak"};case"textarea":return{_type:"TextArea",showLabel:!1};case"audio":return{_type:"Audio"};case"canvas":return{_type:"Canvas"};case"video":case"iframe":return{_type:"CustomHTML"};case"svg":return{_type:"Icon"};case"select":return{_type:"Select",options:[]};case"option":return{_type:"Option"};case"ul":case"ol":case"dl":return{_type:"List",tag:s.tagName,_listType:s.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:s.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:s.tagName};case"p":return{_type:"Paragraph",content:""};case"a":return{_type:"Link"};case"form":return{_type:"Form"};case"label":return{_type:"Label"};case"button":return{_type:"Button"};case"code":return{_type:"Box",_name:"Code"};case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return{_type:"Heading",tag:s.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:s.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:{const c=e.get(s,"children",[]).length>0?"Box":"EmptyBox";return{_type:c,tag:s.tagName,_name:c=="EmptyBox"||s.tagName==="div"?c:e.capitalize(s.tagName)}}}},E=(s,l=null)=>e.flatMapDeep(s,t=>{var S,D,I,$,C,N,L,W,A,j;if(t.type==="comment")return[];let n={_id:T.generateUUID()};if(l&&(n._parent=l.block._id),t.type==="text")return e.isEmpty(e.get(t,"content",""))?[]:l&&te(l.node,l.block)?(e.set(l,"block.content",e.get(t,"content","")),[]):{...n,_type:"Text",content:e.get(t,"content","")};if(e.startsWith(t.tagName,"chai-")){const p=t.attributes||[],u=e.find(p,{key:"chai-type"}),y=(u==null?void 0:u.value)||e.startCase(e.camelCase(t.tagName||"")).replace(/ /g,"").replace(/\s+/g,"");n._type=y,e.forEach(p,({key:h,value:P})=>{if(h==="about-this-component"||h==="chai-type"||h==="can-move"||h==="can-delete")return;if(h==="id"){n._id=P;return}const J=e.startsWith(h,"_")?h:e.camelCase(h);let f=B(P);typeof f=="string"&&e.startsWith(f,"#styles:")&&(f=f.replace("#styles:","#styles:,")),n[J]=f});const g=E(t.children||[],{block:n,node:t});return[n,...g]}const a=e.get(t,"attributes",[]),i=t.tagName==="p"||a.find(p=>p.key==="data-chai-richtext"||p.key==="chai-richtext"),r=a.find(p=>p.key==="class"),o=r&&r.value.split(/\s+/).includes("rte"),d=a.find(p=>p.key==="data-chai-lightbox"||p.key==="chai-lightbox"),c=a.find(p=>p.key==="data-chai-dropdown"||p.key==="chai-dropdown"),b=a.find(p=>p.key==="data-chai-dropdown-button"||p.key==="chai-dropdown-button"),_=a.find(p=>p.key==="data-chai-dropdown-content"||p.key==="chai-dropdown-content");if(n={...n,...ne(t),...V(t),...se(t)},t.attributes){const p=t.attributes.find(u=>e.includes(H,u.key));p&&(n._name=p.value)}if(i||o)return n.content=`<p>${k.stringify(t.children||[])}</p>`,e.has(n,"styles_attrs.data-chai-richtext")&&delete n.styles_attrs["data-chai-richtext"],e.has(n,"styles_attrs.chai-richtext")&&delete n.styles_attrs["chai-richtext"],[n];if(d){const p=["data-chai-lightbox","chai-lightbox","data-vbtype","data-autoplay","data-maxwidth","data-overlay","data-gall","href"];n={...n,href:((S=a.find(u=>u.key==="href"))==null?void 0:S.value)||"",hrefType:((D=a.find(u=>u.key==="data-vbtype"))==null?void 0:D.value)||"video",autoplay:((I=a.find(u=>u.key==="data-autoplay"))==null?void 0:I.value)==="true"?"true":"false",maxWidth:((C=($=a.find(u=>u.key==="data-maxwidth"))==null?void 0:$.value)==null?void 0:C.replace("px",""))||"",backdropColor:((N=a.find(u=>u.key==="data-overlay"))==null?void 0:N.value)||"",galleryName:((L=a.find(u=>u.key==="data-gall"))==null?void 0:L.value)||""},e.forEach(p,u=>{e.has(n,`styles_attrs.${u}`)&&delete n.styles_attrs[u]})}if(c&&(delete n.styles_attrs,n.showDropdown=!1),_&&delete n.styles_attrs,b){delete n.styles_attrs;const p=e.filter(t.children||[],y=>(y==null?void 0:y.tagName)!=="span");n.content=v(p);const u=e.find(t.children||[],y=>(y==null?void 0:y.tagName)==="span"&&e.some(y.children||[],g=>(g==null?void 0:g.tagName)==="svg"));if(u){const y=e.find(u.children||[],g=>(g==null?void 0:g.tagName)==="svg");if(y){n.icon=k.stringify([y]);const{height:g,width:h}=ae(y,"16px","16px");n.iconHeight=g,n.iconWidth=h}}return[n]}if(n._type==="Input"){const p=n.inputType||"text";p==="checkbox"?e.set(n,"_type","Checkbox"):p==="radio"&&e.set(n,"_type","Radio")}else if(t.tagName==="video"||t.tagName==="iframe"){const p=k.stringify([t]);return Z(p)&&(e.set(n,"_type","Video"),e.set(n,"url",Q(p)),e.set(n,"styles",`${m.STYLES_KEY},`),e.set(n,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),n.content=p,[n]}else if(t.tagName==="svg"){const p=e.get(e.find(t.attributes,{key:"class"}),"value",""),{height:u,width:y}=M(p);if(u&&y)n.styles=`${m.STYLES_KEY}, ${T.cn(`w-${y} h-${u}`,p)}`.trim(),n.height=u==null?void 0:u.replace("px",""),n.width=y==null?void 0:y.replace("px","");else{const g=(W=e.find(t.attributes,{key:"height"}))==null?void 0:W.value,h=(A=e.find(t.attributes,{key:"width"}))==null?void 0:A.value;g&&h?(n.styles=`${m.STYLES_KEY}, ${T.cn(`w-[${h}px] h-[${g}px]`,p)}`.trim(),n.height=g,n.width=h):n.styles=`${m.STYLES_KEY}, ${T.cn("w-full h-full",p)}`.trim()}return t.attributes=e.filter(t.attributes,g=>!e.includes(["style","width","height","class"],g.key)),n.icon=k.stringify([t]),[n]}else if(t.tagName=="option"&&l&&((j=l.block)==null?void 0:j._type)==="Select")return l.block.options.push({label:v(t.children||[]),...V(t)}),[];const x=E(t.children||[],{block:n,node:t});return[n,...x]}),ae=(s,l,t)=>{var d,c;const n=e.get(s,"attributes",[]),{height:a,width:i}=M(e.get(e.find(n,{key:"class"}),"value",""));if(a&&i)return{height:`[${a}px]`,width:`[${i}px]`};const r=(d=e.find(n,{key:"height"}))==null?void 0:d.value,o=(c=e.find(n,{key:"width"}))==null?void 0:c.value;return{height:r?`[${r}px]`:t,width:o?`[${o}px]`:l}},le=s=>{s=s.replace(/(\w+)=\\?"(.*?)\\?"/g,(n,a,i)=>{let r=i.replace(/\\"/g,'"');return r=r.replace(/{([^}]+)}/g,o=>o.replace(/"/g,'\\"')),`${a}="${r.replace(/\\"/g,'"')}"`}),s=s.replace(/\\n/g," ").replace(/\\\\/g,"").replace(/\\([/<>])/g,"$1").replace(/\\./g,"").replace(/[\n\r\t\f\v]/g," "),s=s.replace(/\$name="[^"]*"/g,"");const l=s.match(/<body[^>]*>[\s\S]*?<\/body>/);return(l&&l.length>0?l[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):s).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},ie=(s,l)=>e.find(s,{_id:l}),oe=(s,l)=>e.isEmpty(l)?s.map(t=>(e.unset(t,"_bid"),t)):e.map(s,t=>{const n=e.isEmpty(t._bid)?void 0:ie(l,t._bid);if(n){n._type==="Icon"&&e.get(t,"icon","").match(/chai-default-svg/)&&delete t.icon;const a={...n,...t};return e.unset(a,"_bid"),a}return e.unset(t,"_bid"),t}),re=s=>{const l=k.parse(le(s));if(e.isEmpty(s))return[];const t=e.flatten(E(l));return q.syncBlocksWithDefaultProps(t)},ce=(s,l)=>s.map(t=>{const n=e.keys(t).filter(a=>e.isString(t[a])&&t[a].startsWith(m.STYLES_KEY));return e.each(n,a=>{t[a]=`${m.STYLES_KEY},${Y(t[a],l)}`}),t}),pe=s=>{const l=e.last(s);return s.map(t=>{const n=Object.keys(t);for(let a=0;a<n.length;a++)if(e.isString(t[n[a]])&&e.startsWith(n[a],"content")){const i=t===l?"":" ";t[n[a]]=`${t[n[a]].trim()}${i}`}return t})},w=(s,l,{index:t,key:n},a)=>{if(e.isString(s)){let i=s;const r=/\{\{(.*?)\}\}/g,o=s.match(r);if(o){const d=a==="image"||a==="mobileImage";o.forEach(c=>{let b=c.slice(2,-2).trim(),_=n.slice(2,-2).trim();t!==-1&&e.startsWith(b,"$index.")?b=`${_}.${t}.${b.slice(7)}`:t!==-1&&e.startsWith(b,"$index")&&(b=`${_}.${t}`);const x=e.get(l,b);x===void 0?i=i.replace(c,""):d&&!e.isArray(x)?i=x:i=e.isArray(x)?x:i.replace(c,x)})}return i}if(e.isArray(s))return s.map(i=>w(i,l,{index:t,key:n},a));if(s&&typeof s=="object"){const i={};return e.forEach(e.keys(s),r=>{!e.startsWith(r,"_")&&r!=="$repeaterItemsKey"?i[r]=w(s[r],l,{index:t,key:n},r):i[r]=s[r]}),i}return s},ue=(s,l,{index:t,key:n})=>{let a=e.cloneDeep(s);return a.repeaterItems&&(a.$repeaterItemsKey=a.repeaterItems,e.startsWith(a.repeaterItems,`{{${m.COLLECTION_PREFIX}`)&&(a.$repeaterItemsKey=a.repeaterItems=`${a.repeaterItems.replace("}}",`/${a._id}}}`)}`),!e.isEmpty(a.repeaterItems)&&a.pagination&&(a.repeaterTotalItems=`${a.repeaterItems.replace("}}",`/${a._id}/totalItems}}`)}`)),w(a,l,{index:t,key:n})};exports.adjustSpacingInContentBlocks=pe;exports.applyBindingToBlockProps=ue;exports.applyChaiDataBinding=X;exports.applyDesignTokens=ce;exports.applyLanguage=F;exports.applyLimit=G;exports.getBlockRuntimeProps=U;exports.getBlockTagAttributes=z;exports.getBlocksFromHTML=re;exports.getSplitChaiClasses=R;exports.mergeBlocksWithExisting=oe;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("./register-chai-top-bar-DyW9GPzV.cjs"),n=require("./index-mPCp0j2h.cjs"),u=require("./index-CAhDwfHE.cjs"),A=require("@tanstack/react-query"),F=require("lucide-react"),d=require("react"),k=require("react-i18next"),m=require("zod"),E=()=>{const r=u.useApiUrl(),o=u.useFetch();return A.useMutation({mutationKey:[u.ACTIONS.CHANGE_PASSWORD],mutationFn:async e=>{const t=await o(r,{action:u.ACTIONS.CHANGE_PASSWORD,data:e});return t==null?void 0:t.data}})},L=r=>m.z.object({oldPassword:m.z.string().min(1,r("Current password is required")),newPassword:m.z.string().min(8,r("Password must be at least 8 characters")).max(128,r("Password must be less than 128 characters")).regex(/[A-Z]/,r("Password must contain at least one uppercase letter")).regex(/[a-z]/,r("Password must contain at least one lowercase letter")).regex(/[0-9]/,r("Password must contain at least one number")).regex(/[!@#$%^&*(),.?":{}|<>]/,r("Password must contain at least one special character")),confirmPassword:m.z.string().min(1,r("Confirm password is required"))}).refine(o=>o.newPassword===o.confirmPassword,{message:r("New password and confirm password do not match"),path:["confirmPassword"]}).refine(o=>o.oldPassword!==o.newPassword,{message:r("New password must be different from current password"),path:["newPassword"]}),T=({open:r,onOpenChange:o})=>{const{t:e}=k.useTranslation(),t=u.usePagesProp("currentUser",null),{mutate:q,isPending:h,isSuccess:p,reset:P}=E(),[x,f]=d.useState(""),[j,C]=d.useState(""),[N,v]=d.useState(""),[b,i]=d.useState(null),S=d.useCallback(()=>{f(""),C(""),v(""),i(null),P()},[P]),w=d.useCallback(a=>{o(a),a||S()},[o,S]);d.useEffect(()=>{if(p){const a=setTimeout(()=>{w(!1)},2e3);return()=>clearTimeout(a)}},[p,w]);const D=()=>{var y;i(null);const a={oldPassword:x.trim(),newPassword:j.trim(),confirmPassword:N.trim()},c=L(e).safeParse(a);if(!c.success){i(((y=c.error.issues[0])==null?void 0:y.message)||e("Validation failed"));return}if(!(t!=null&&t.email)){i(e("User email not found"));return}q({email:t.email,oldPassword:c.data.oldPassword,newPassword:c.data.newPassword,confirmPassword:c.data.confirmPassword},{onError:g=>{i((g==null?void 0:g.message)||e("Failed to change password"))}})};return s.jsx(n.Dialog,{open:r,onOpenChange:w,children:s.jsx(n.DialogContent,{className:"sm:max-w-[425px]",children:h?s.jsx("div",{className:"flex h-[340px] items-center justify-center",children:s.jsx(F.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):p?s.jsxs("div",{className:"flex h-[340px] flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"rounded-full bg-green-100 p-3",children:s.jsx("svg",{className:"h-6 w-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),s.jsx("p",{className:"text-lg font-medium",children:e("Password updated successfully")})]}):s.jsxs(s.Fragment,{children:[s.jsxs(n.DialogHeader,{children:[s.jsx(n.DialogTitle,{children:e("Change Password")}),s.jsx(n.DialogDescription,{children:e("Enter your current password and a new password.")})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"old-password",children:e("Current Password")}),s.jsx(l.Input,{id:"old-password",type:"password",value:x,onChange:a=>f(a.target.value),placeholder:e("Enter current password")})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"new-password",children:e("New Password")}),s.jsx(l.Input,{id:"new-password",type:"password",value:j,onChange:a=>C(a.target.value),placeholder:e("Enter new password")})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"confirm-password",children:e("Confirm Password")}),s.jsx(l.Input,{id:"confirm-password",type:"password",value:N,onChange:a=>v(a.target.value),placeholder:e("Confirm new password")})]}),b&&s.jsx("p",{className:"text-sm text-destructive",children:b})]}),s.jsxs(n.DialogFooter,{children:[s.jsx(l.Button,{variant:"outline",onClick:()=>w(!1),disabled:h,children:e("Cancel")}),s.jsx(l.Button,{onClick:D,disabled:h,children:e("Change Password")})]})]})})})};exports.ChangePasswordModal=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("./register-chai-top-bar-DyW9GPzV.cjs"),n=require("./index-DKjYF53r.cjs"),u=require("./index-BuXfCtgR.cjs"),A=require("@tanstack/react-query"),F=require("lucide-react"),d=require("react"),k=require("react-i18next"),m=require("zod"),E=()=>{const r=u.useApiUrl(),o=u.useFetch();return A.useMutation({mutationKey:[u.ACTIONS.CHANGE_PASSWORD],mutationFn:async e=>{const t=await o(r,{action:u.ACTIONS.CHANGE_PASSWORD,data:e});return t==null?void 0:t.data}})},L=r=>m.z.object({oldPassword:m.z.string().min(1,r("Current password is required")),newPassword:m.z.string().min(8,r("Password must be at least 8 characters")).max(128,r("Password must be less than 128 characters")).regex(/[A-Z]/,r("Password must contain at least one uppercase letter")).regex(/[a-z]/,r("Password must contain at least one lowercase letter")).regex(/[0-9]/,r("Password must contain at least one number")).regex(/[!@#$%^&*(),.?":{}|<>]/,r("Password must contain at least one special character")),confirmPassword:m.z.string().min(1,r("Confirm password is required"))}).refine(o=>o.newPassword===o.confirmPassword,{message:r("New password and confirm password do not match"),path:["confirmPassword"]}).refine(o=>o.oldPassword!==o.newPassword,{message:r("New password must be different from current password"),path:["newPassword"]}),T=({open:r,onOpenChange:o})=>{const{t:e}=k.useTranslation(),t=u.usePagesProp("currentUser",null),{mutate:q,isPending:h,isSuccess:p,reset:P}=E(),[x,f]=d.useState(""),[j,C]=d.useState(""),[N,v]=d.useState(""),[b,i]=d.useState(null),S=d.useCallback(()=>{f(""),C(""),v(""),i(null),P()},[P]),w=d.useCallback(a=>{o(a),a||S()},[o,S]);d.useEffect(()=>{if(p){const a=setTimeout(()=>{w(!1)},2e3);return()=>clearTimeout(a)}},[p,w]);const D=()=>{var y;i(null);const a={oldPassword:x.trim(),newPassword:j.trim(),confirmPassword:N.trim()},c=L(e).safeParse(a);if(!c.success){i(((y=c.error.issues[0])==null?void 0:y.message)||e("Validation failed"));return}if(!(t!=null&&t.email)){i(e("User email not found"));return}q({email:t.email,oldPassword:c.data.oldPassword,newPassword:c.data.newPassword,confirmPassword:c.data.confirmPassword},{onError:g=>{i((g==null?void 0:g.message)||e("Failed to change password"))}})};return s.jsx(n.Dialog,{open:r,onOpenChange:w,children:s.jsx(n.DialogContent,{className:"sm:max-w-[425px]",children:h?s.jsx("div",{className:"flex h-[340px] items-center justify-center",children:s.jsx(F.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):p?s.jsxs("div",{className:"flex h-[340px] flex-col items-center justify-center gap-2",children:[s.jsx("div",{className:"rounded-full bg-green-100 p-3",children:s.jsx("svg",{className:"h-6 w-6 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),s.jsx("p",{className:"text-lg font-medium",children:e("Password updated successfully")})]}):s.jsxs(s.Fragment,{children:[s.jsxs(n.DialogHeader,{children:[s.jsx(n.DialogTitle,{children:e("Change Password")}),s.jsx(n.DialogDescription,{children:e("Enter your current password and a new password.")})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"old-password",children:e("Current Password")}),s.jsx(l.Input,{id:"old-password",type:"password",value:x,onChange:a=>f(a.target.value),placeholder:e("Enter current password")})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"new-password",children:e("New Password")}),s.jsx(l.Input,{id:"new-password",type:"password",value:j,onChange:a=>C(a.target.value),placeholder:e("Enter new password")})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(n.Label,{htmlFor:"confirm-password",children:e("Confirm Password")}),s.jsx(l.Input,{id:"confirm-password",type:"password",value:N,onChange:a=>v(a.target.value),placeholder:e("Confirm new password")})]}),b&&s.jsx("p",{className:"text-sm text-destructive",children:b})]}),s.jsxs(n.DialogFooter,{children:[s.jsx(l.Button,{variant:"outline",onClick:()=>w(!1),disabled:h,children:e("Cancel")}),s.jsx(l.Button,{onClick:D,disabled:h,children:e("Change Password")})]})]})})})};exports.ChangePasswordModal=T;
@@ -1,7 +1,7 @@
1
1
  import { jsx as s, jsxs as t, Fragment as L } from "react/jsx-runtime";
2
2
  import { z as h, B as F } from "./register-chai-top-bar-D6GjnauV.js";
3
- import { D as T, e as z, f as O, g as q, p as B, q as f, r as H } from "./index-DsQXiNA_.js";
4
- import { ar as I, as as M, A as E, az as R } from "./index-DtMksfXx.js";
3
+ import { D as T, e as O, f as q, g as z, o as B, p as f, q as H } from "./index-C7bidKtE.js";
4
+ import { as as I, at as M, A as E, aA as R } from "./index-BDrc0HJQ.js";
5
5
  import { useMutation as U } from "@tanstack/react-query";
6
6
  import { Loader2 as W } from "lucide-react";
7
7
  import { useState as c, useCallback as S, useEffect as G } from "react";
@@ -76,12 +76,12 @@ const K = () => {
76
76
  }
77
77
  );
78
78
  };
79
- return /* @__PURE__ */ s(T, { open: a, onOpenChange: l, children: /* @__PURE__ */ s(z, { className: "sm:max-w-[425px]", children: w ? /* @__PURE__ */ s("div", { className: "flex h-[340px] items-center justify-center", children: /* @__PURE__ */ s(W, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }) : u ? /* @__PURE__ */ t("div", { className: "flex h-[340px] flex-col items-center justify-center gap-2", children: [
79
+ return /* @__PURE__ */ s(T, { open: a, onOpenChange: l, children: /* @__PURE__ */ s(O, { className: "sm:max-w-[425px]", children: w ? /* @__PURE__ */ s("div", { className: "flex h-[340px] items-center justify-center", children: /* @__PURE__ */ s(W, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }) : u ? /* @__PURE__ */ t("div", { className: "flex h-[340px] flex-col items-center justify-center gap-2", children: [
80
80
  /* @__PURE__ */ s("div", { className: "rounded-full bg-green-100 p-3", children: /* @__PURE__ */ s("svg", { className: "h-6 w-6 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ s("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }) }),
81
81
  /* @__PURE__ */ s("p", { className: "text-lg font-medium", children: e("Password updated successfully") })
82
82
  ] }) : /* @__PURE__ */ t(L, { children: [
83
- /* @__PURE__ */ t(O, { children: [
84
- /* @__PURE__ */ s(q, { children: e("Change Password") }),
83
+ /* @__PURE__ */ t(q, { children: [
84
+ /* @__PURE__ */ s(z, { children: e("Change Password") }),
85
85
  /* @__PURE__ */ s(B, { children: e("Enter your current password and a new password.") })
86
86
  ] }),
87
87
  /* @__PURE__ */ t("div", { className: "grid gap-4 py-4", children: [
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, jsxs as c } from "react/jsx-runtime";
2
- import { u as k, a as v, b as T, c as E, d as L, L as N, D as y, e as w, f as D, g as H, T as M } from "./index-DsQXiNA_.js";
2
+ import { u as k, a as v, b as T, c as E, d as L, L as N, D as y, e as w, f as D, g as H, T as M } from "./index-C7bidKtE.js";
3
3
  import { useThrottledCallback as P } from "@react-hookz/web";
4
4
  import { get as B } from "lodash-es";
5
5
  import { useState as p, useMemo as I, useCallback as S, useEffect as j } from "react";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("./index-mPCp0j2h.cjs"),j=require("@react-hookz/web"),v=require("lodash-es"),l=require("react"),T=require("react-i18next"),h=c=>{const o=document.createElement("div");return o.innerHTML=c,o.innerHTML};function y(){const{t:c}=T.useTranslation(),[o,p]=l.useState(!1),[r,f]=l.useState(""),[e,d]=t.useCodeEditor(),[u]=t.useSelectedBlockIds(),g=t.useUpdateBlocksProps(),b=t.useUpdateBlocksPropsRealtime(),{selectedLang:i}=t.useLanguages(),x=l.useMemo(()=>v.get(t.LANGUAGES,i,i),[i]),C=j.useThrottledCallback(n=>{if(!e)return;const a=h(n);b([e.blockId],{[e.blockProp]:a})},[],300),m=l.useCallback(()=>{if(o&&e){const n=h(r);g([e.blockId],{[e.blockProp]:n})}},[o,r,e]);l.useEffect(()=>{e&&!u.includes(e.blockId)&&(m(),d(null))},[u,e]);const k=()=>{m(),d(null)};return s.jsx(t.Dialog,{open:!0,onOpenChange:k,children:s.jsxs(t.DialogContent,{className:"flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black",children:[s.jsx(t.DialogHeader,{className:"shrink-0 pb-3",children:s.jsx(t.DialogTitle,{className:"flex items-center justify-between text-black",children:s.jsxs("div",{className:"space-x-3 text-sm font-semibold",children:[s.jsx("span",{children:c("HTML Code Editor")}),x&&s.jsxs("span",{className:"text-xs text-gray-400",children:["(",x,")"]}),s.jsx("span",{className:"text-xs text-gray-400",children:c("Scripts will be only executed in preview and live mode.")})]})})}),s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(t.Textarea,{className:"h-full w-full resize-none font-mono md:text-xs",value:e?r||e.initialCode:"",onChange:n=>{const a=n.target.value;p(!0),f(a),C(a)},rows:10,placeholder:"Enter your code here..."})})]})})}exports.default=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("./index-DKjYF53r.cjs"),j=require("@react-hookz/web"),v=require("lodash-es"),l=require("react"),T=require("react-i18next"),h=c=>{const o=document.createElement("div");return o.innerHTML=c,o.innerHTML};function y(){const{t:c}=T.useTranslation(),[o,p]=l.useState(!1),[r,f]=l.useState(""),[e,d]=t.useCodeEditor(),[u]=t.useSelectedBlockIds(),g=t.useUpdateBlocksProps(),b=t.useUpdateBlocksPropsRealtime(),{selectedLang:i}=t.useLanguages(),x=l.useMemo(()=>v.get(t.LANGUAGES,i,i),[i]),C=j.useThrottledCallback(n=>{if(!e)return;const a=h(n);b([e.blockId],{[e.blockProp]:a})},[],300),m=l.useCallback(()=>{if(o&&e){const n=h(r);g([e.blockId],{[e.blockProp]:n})}},[o,r,e]);l.useEffect(()=>{e&&!u.includes(e.blockId)&&(m(),d(null))},[u,e]);const k=()=>{m(),d(null)};return s.jsx(t.Dialog,{open:!0,onOpenChange:k,children:s.jsxs(t.DialogContent,{className:"flex max-h-[400px] min-h-[200px] max-w-4xl flex-col border-gray-700 text-black",children:[s.jsx(t.DialogHeader,{className:"shrink-0 pb-3",children:s.jsx(t.DialogTitle,{className:"flex items-center justify-between text-black",children:s.jsxs("div",{className:"space-x-3 text-sm font-semibold",children:[s.jsx("span",{children:c("HTML Code Editor")}),x&&s.jsxs("span",{className:"text-xs text-gray-400",children:["(",x,")"]}),s.jsx("span",{className:"text-xs text-gray-400",children:c("Scripts will be only executed in preview and live mode.")})]})})}),s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:s.jsx(t.Textarea,{className:"h-full w-full resize-none font-mono md:text-xs",value:e?r||e.initialCode:"",onChange:n=>{const a=n.target.value;p(!0),f(a),C(a)},rows:10,placeholder:"Enter your code here..."})})]})})}exports.default=y;
@@ -1,7 +1,7 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
2
  import { B as r } from "./register-chai-top-bar-D6GjnauV.js";
3
- import { G as o, H as c, I as i, J as l, K as m } from "./index-DsQXiNA_.js";
4
- import { b as d, B as h } from "./index-DtMksfXx.js";
3
+ import { F as o, G as c, H as i, I as l, J as m } from "./index-C7bidKtE.js";
4
+ import { b as d, B as h } from "./index-BDrc0HJQ.js";
5
5
  import { CheckCircle as u, Check as p } from "lucide-react";
6
6
  import { useTranslation as C } from "react-i18next";
7
7
  const y = () => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./register-chai-top-bar-DyW9GPzV.cjs"),s=require("./index-mPCp0j2h.cjs"),a=require("./index-CAhDwfHE.cjs"),n=require("lucide-react"),l=require("react-i18next"),o=()=>{const{setPageLockMeta:r}=a.usePageLockMeta(),{t}=l.useTranslation(),c=async()=>{r({})};return e.jsx(a.BlurContainer,{children:e.jsxs(s.Card,{className:"mx-auto w-full max-w-md",children:[e.jsx(s.CardHeader,{className:"space-y-1",children:e.jsxs(s.CardTitle,{className:"flex items-center gap-2 text-xl",children:[e.jsx(n.CheckCircle,{className:"h-6 w-6 text-green-500"}),t("You can edit the page now")]})}),e.jsx(s.CardContent,{className:"space-y-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:t("This page is released by other user you can continue editing now")})}),e.jsx(s.CardFooter,{className:"flex gap-2",children:e.jsxs(i.Button,{variant:"default",onClick:c,className:"flex-1 gap-2",children:[e.jsx(n.Check,{className:"h-4 w-4"}),t("Continue Editing")]})})]})})};exports.default=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./register-chai-top-bar-DyW9GPzV.cjs"),s=require("./index-DKjYF53r.cjs"),a=require("./index-BuXfCtgR.cjs"),n=require("lucide-react"),l=require("react-i18next"),o=()=>{const{setPageLockMeta:r}=a.usePageLockMeta(),{t}=l.useTranslation(),c=async()=>{r({})};return e.jsx(a.BlurContainer,{children:e.jsxs(s.Card,{className:"mx-auto w-full max-w-md",children:[e.jsx(s.CardHeader,{className:"space-y-1",children:e.jsxs(s.CardTitle,{className:"flex items-center gap-2 text-xl",children:[e.jsx(n.CheckCircle,{className:"h-6 w-6 text-green-500"}),t("You can edit the page now")]})}),e.jsx(s.CardContent,{className:"space-y-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:t("This page is released by other user you can continue editing now")})}),e.jsx(s.CardFooter,{className:"flex gap-2",children:e.jsxs(i.Button,{variant:"default",onClick:c,className:"flex-1 gap-2",children:[e.jsx(n.Check,{className:"h-4 w-4"}),t("Continue Editing")]})})]})})};exports.default=o;
@@ -1 +1 @@
1
- "use strict";const s=require("lodash-es"),d=require("react"),r={},P=()=>r,f=t=>d.useMemo(()=>s.get(r,t,null),[t]),a=t=>s.get(r,t),m=t=>(console.warn("getDefaultBlockProps is deprecated. Use getBlockDefaultProps instead."),h(t)),h=t=>{var l;const e=s.get(r,t),c=((l=e==null?void 0:e.props)==null?void 0:l.schema)||((e==null?void 0:e.schema)??{}),i=s.get(c,"properties",{}),o={};return s.each(i,(n,g)=>{s.has(n,"block")||s.set(o,g,n.default)}),o},C=t=>(console.warn("getI18nBlockProps is deprecated. Use getBlockI18nProps instead."),s.get(r,`${t}.i18nProps`,[])),y=t=>(console.warn("getAIBlockProps is deprecated. Use getBlockAIProps instead."),s.get(r,`${t}.aiProps`,[])),D=t=>{var B,k;const e=a(t);if(!e)return;const c=((B=e.props)==null?void 0:B.schema)||(e.schema??{}),i=((k=e.props)==null?void 0:k.uiSchema)||(e.uiSchema??{}),o=s.cloneDeep(c),l=s.get(o,"properties",{}),n=s.omitBy(l,u=>(u==null?void 0:u.styles)===!0);return s.set(o,"properties",n),{schema:o,uiSchema:i||{}}},S=t=>(console.warn("syncBlocksWithDefaults is deprecated. Use syncBlocksWithDefaultProps instead."),p(t)),p=t=>t.map(e=>s.has(r,e._type)?{...h(e._type),...e}:e),I=(t,e)=>{const c=s.get(r,e.type);c?s.set(r,e.type,{...c,component:t,...e}):s.set(r,e.type,{component:t,...e})},R=(t,e)=>{I(t,{...e,category:e.category||"core"})},v=(t,e)=>{const c=s.get(r,e.type);c?s.set(r,e.type,{...c,component:t,...e}):s.set(r,e.type,{component:t,...e})},W=(t,e)=>{const c=a(t);s.set(r,t,{...c,dataProvider:e})},w=(t,e)=>{const c=a(t);s.set(r,t,{...c,component:e})},A=(t,e)=>({type:"null",block:t,prop:e,default:null,runtime:!0,ui:{"ui:widget":"hidden"}});exports.closestBlockProp=A;exports.getAIBlockProps=y;exports.getBlockFormSchemas=D;exports.getDefaultBlockProps=m;exports.getI18nBlockProps=C;exports.getRegisteredChaiBlock=a;exports.registerChaiBlock=R;exports.registerChaiServerBlock=v;exports.setChaiBlockComponent=w;exports.setChaiServerBlockDataProvider=W;exports.syncBlocksWithDefaultProps=p;exports.syncBlocksWithDefaults=S;exports.useRegisteredChaiBlock=f;exports.useRegisteredChaiBlocks=P;
1
+ "use strict";const s=require("lodash-es"),d=require("react"),r={},P=()=>r,f=t=>d.useMemo(()=>s.get(r,t,null),[t]),a=t=>s.get(r,t),m=t=>(console.warn("getDefaultBlockProps is deprecated. Use getBlockDefaultProps instead."),g(t)),g=t=>{var l;const e=s.get(r,t),c=((l=e==null?void 0:e.props)==null?void 0:l.schema)||((e==null?void 0:e.schema)??{}),i=s.get(c,"properties",{}),o={};return s.each(i,(n,B)=>{s.has(n,"block")||s.set(o,B,n.default)}),o},C=t=>(console.warn("getI18nBlockProps is deprecated. Use getBlockI18nProps instead."),s.get(r,`${t}.i18nProps`,[])),y=t=>(console.warn("getAIBlockProps is deprecated. Use getBlockAIProps instead."),s.get(r,`${t}.aiProps`,[])),D=t=>{var k,h;const e=a(t);if(!e)return;const c=((k=e.props)==null?void 0:k.schema)||(e.schema??{}),i=((h=e.props)==null?void 0:h.uiSchema)||(e.uiSchema??{}),o=s.cloneDeep(c),l=s.get(o,"properties",{}),n=s.omitBy(l,u=>(u==null?void 0:u.styles)===!0);return s.set(o,"properties",n),{schema:o,uiSchema:i||{}}},S=t=>(console.warn("syncBlocksWithDefaults is deprecated. Use syncBlocksWithDefaultProps instead."),p(t)),p=t=>t.map(e=>s.has(r,e._type)?{...g(e._type),...e}:e),I=(t,e)=>{const c=s.get(r,e.type);c?s.set(r,e.type,{...c,component:t,...e}):s.set(r,e.type,{component:t,...e})},R=(t,e)=>{I(t,{...e,category:e.category||"core"})},v=(t,e)=>{const c=s.get(r,e.type);c?s.set(r,e.type,{...c,component:t,...e}):s.set(r,e.type,{component:t,...e})},W=(t,e)=>{const c=a(t);s.set(r,t,{...c,dataProvider:e})},w=(t,e)=>{const c=a(t);s.set(r,t,{...c,component:e})},A=(t,e)=>({type:"null",block:t,prop:e,default:null,runtime:!0,ui:{"ui:widget":"hidden"}});exports.closestBlockProp=A;exports.getAIBlockProps=y;exports.getBlockDefaultProps=g;exports.getBlockFormSchemas=D;exports.getDefaultBlockProps=m;exports.getI18nBlockProps=C;exports.getRegisteredChaiBlock=a;exports.registerChaiBlock=R;exports.registerChaiServerBlock=v;exports.setChaiBlockComponent=w;exports.setChaiServerBlockDataProvider=W;exports.syncBlocksWithDefaultProps=p;exports.syncBlocksWithDefaults=S;exports.useRegisteredChaiBlock=f;exports.useRegisteredChaiBlocks=P;
@@ -1,18 +1,18 @@
1
1
  import { get as c, each as f, has as d, set as o, cloneDeep as m, omitBy as P } from "lodash-es";
2
2
  import { useMemo as y } from "react";
3
3
  const t = {}, w = () => t, R = (s) => y(() => c(t, s, null), [s]), k = (s) => c(t, s), U = (s) => (console.warn("getDefaultBlockProps is deprecated. Use getBlockDefaultProps instead."), g(s)), g = (s) => {
4
- var a;
5
- const e = c(t, s), r = ((a = e == null ? void 0 : e.props) == null ? void 0 : a.schema) || ((e == null ? void 0 : e.schema) ?? {}), i = c(r, "properties", {}), n = {};
4
+ var n;
5
+ const e = c(t, s), r = ((n = e == null ? void 0 : e.props) == null ? void 0 : n.schema) || ((e == null ? void 0 : e.schema) ?? {}), i = c(r, "properties", {}), a = {};
6
6
  return f(i, (l, p) => {
7
- d(l, "block") || o(n, p, l.default);
8
- }), n;
7
+ d(l, "block") || o(a, p, l.default);
8
+ }), a;
9
9
  }, v = (s) => (console.warn("getI18nBlockProps is deprecated. Use getBlockI18nProps instead."), c(t, `${s}.i18nProps`, [])), A = (s) => (console.warn("getAIBlockProps is deprecated. Use getBlockAIProps instead."), c(t, `${s}.aiProps`, [])), W = (s) => {
10
10
  var B, h;
11
11
  const e = k(s);
12
12
  if (!e)
13
13
  return;
14
- const r = ((B = e.props) == null ? void 0 : B.schema) || (e.schema ?? {}), i = ((h = e.props) == null ? void 0 : h.uiSchema) || (e.uiSchema ?? {}), n = m(r), a = c(n, "properties", {}), l = P(a, (u) => (u == null ? void 0 : u.styles) === !0);
15
- return o(n, "properties", l), { schema: n, uiSchema: i || {} };
14
+ const r = ((B = e.props) == null ? void 0 : B.schema) || (e.schema ?? {}), i = ((h = e.props) == null ? void 0 : h.uiSchema) || (e.uiSchema ?? {}), a = m(r), n = c(a, "properties", {}), l = P(n, (u) => (u == null ? void 0 : u.styles) === !0);
15
+ return o(a, "properties", l), { schema: a, uiSchema: i || {} };
16
16
  }, _ = (s) => (console.warn("syncBlocksWithDefaults is deprecated. Use syncBlocksWithDefaultProps instead."), D(s)), D = (s) => s.map((e) => d(t, e._type) ? { ...g(e._type), ...e } : e), S = (s, e) => {
17
17
  const r = c(t, e.type);
18
18
  r ? o(t, e.type, { ...r, component: s, ...e }) : o(t, e.type, { component: s, ...e });
@@ -36,17 +36,18 @@ const t = {}, w = () => t, R = (s) => y(() => c(t, s, null), [s]), k = (s) => c(
36
36
  ui: { "ui:widget": "hidden" }
37
37
  });
38
38
  export {
39
- W as a,
40
- U as b,
39
+ g as a,
40
+ W as b,
41
41
  j as c,
42
- v as d,
43
- k as e,
44
- E as f,
42
+ U as d,
43
+ v as e,
44
+ k as f,
45
45
  A as g,
46
- $ as h,
47
- D as i,
48
- _ as j,
49
- w as k,
46
+ E as h,
47
+ $ as i,
48
+ D as j,
49
+ _ as k,
50
+ w as l,
50
51
  x as r,
51
52
  b as s,
52
53
  R as u
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-mPCp0j2h.cjs"),r=require("./common-functions-B3a4xKt_.cjs"),i=require("./apply-binding-9XSrYzAE.cjs"),a=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("react-i18next"),o=require("i18next");exports.ChaiAddBlocksDialog=e.AddBlocksDialog;exports.ChaiAddBlocksPanel=e.AddBlocksPanel;exports.ChaiAskAiUserPrompt=e.AIUserPrompt;exports.ChaiBlockAttributesEditor=e.BlockAttributesEditor;exports.ChaiBlockPropsEditor=e.BlockSettings;exports.ChaiBlockStyleEditor=e.BlockStyling;exports.ChaiBuilderCanvas=e.CanvasArea;exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiDarkModeSwitcher=e.DarkMode;exports.ChaiDefaultBlocks=e.DefaultChaiBlocks;exports.ChaiDraggableBlock=e.ChaiDraggableBlock;exports.ChaiExportCodeModal=e.ExportCodeModal;exports.ChaiImportHTML=e.ImportHTML;exports.ChaiOutline=e.ListTree;exports.ChaiScreenSizes=e.Breakpoints;exports.ChaiThemeConfigPanel=e.ThemeConfigPanel;exports.ChaiUILibrariesPanel=e.UILibrariesPanel;exports.ChaiUndoRedo=e.UndoRedo;exports.PERMISSIONS=e.PERMISSIONS;exports.defaultChaiLibrary=e.defaultChaiLibrary;exports.getClassValueAndUnit=e.getClassValueAndUnit;exports.useAddBlock=e.useAddBlock;exports.useBlocksHtmlForAi=e.useBlocksHtmlForAi;exports.useHtmlToBlocks=e.useHtmlToBlocks;exports.useI18nBlocks=e.useI18nBlocks;exports.useLanguages=e.useLanguages;exports.useReplaceBlock=e.useReplaceBlock;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useStreamMultipleBlocksProps=e.useStreamMultipleBlocksProps;exports.generateBlockId=r.generateUUID;exports.mergeClasses=r.cn;exports.convertHTMLToChaiBlocks=i.getBlocksFromHTML;exports.getBlocksFromHTML=i.getBlocksFromHTML;exports.ADD_BLOCK_TABS=a.ADD_BLOCK_TABS;exports.CHAI_BUILDER_PANELS=a.CHAI_BUILDER_PANELS;exports.IfChaiFeatureFlag=a.IfChaiFeatureFlag;exports.RJSF_EXTENSIONS=a.RJSF_EXTENSIONS;exports.getChaiLibrary=a.getChaiLibrary;exports.getPreImportHTML=a.getPreImportHTML;exports.registerChaiAddBlockTab=a.registerChaiAddBlockTab;exports.registerChaiBlockSettingField=a.registerChaiBlockSettingField;exports.registerChaiBlockSettingTemplate=a.registerChaiBlockSettingTemplate;exports.registerChaiBlockSettingWidget=a.registerChaiBlockSettingWidget;exports.registerChaiFeatureFlag=a.registerChaiFeatureFlag;exports.registerChaiFeatureFlags=a.registerChaiFeatureFlags;exports.registerChaiLibrary=a.registerChaiLibrary;exports.registerChaiMediaManager=a.registerChaiMediaManager;exports.registerChaiPreImportHTMLHook=a.registerChaiPreImportHTMLHook;exports.registerChaiSaveToLibrary=a.registerChaiSaveToLibrary;exports.registerChaiSidebarPanel=a.registerChaiSidebarPanel;exports.registerChaiTopBar=a.registerChaiTopBar;exports.resetSaveToLibrary=a.resetSaveToLibrary;exports.useChaiAddBlockTabs=a.useChaiAddBlockTabs;exports.useChaiBlockSettingComponents=a.useChaiBlockSettingComponents;exports.useChaiFeatureFlag=a.useChaiFeatureFlag;exports.useChaiFeatureFlags=a.useChaiFeatureFlags;exports.useChaiLibraries=a.useChaiLibraries;exports.useChaiSidebarPanels=a.useChaiSidebarPanels;exports.useMediaManagerComponent=a.useMediaManagerComponent;exports.useSaveToLibraryComponent=a.useSaveToLibraryComponent;exports.useToggleChaiFeatureFlag=a.useToggleChaiFeatureFlag;exports.useTopBarComponent=a.useTopBarComponent;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>t.useTranslation});exports.i18n=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DKjYF53r.cjs"),r=require("./common-functions-B3a4xKt_.cjs"),i=require("./apply-binding-xiigK7eK.cjs"),a=require("./register-chai-top-bar-DyW9GPzV.cjs"),t=require("react-i18next"),o=require("i18next");exports.ChaiAddBlocksDialog=e.AddBlocksDialog;exports.ChaiAddBlocksPanel=e.AddBlocksPanel;exports.ChaiAskAiUserPrompt=e.AIUserPrompt;exports.ChaiBlockAttributesEditor=e.BlockAttributesEditor;exports.ChaiBlockPropsEditor=e.BlockSettings;exports.ChaiBlockStyleEditor=e.BlockStyling;exports.ChaiBuilderCanvas=e.CanvasArea;exports.ChaiBuilderEditor=e.ChaiBuilderEditor;exports.ChaiDarkModeSwitcher=e.DarkMode;exports.ChaiDefaultBlocks=e.DefaultChaiBlocks;exports.ChaiDraggableBlock=e.ChaiDraggableBlock;exports.ChaiExportCodeModal=e.ExportCodeModal;exports.ChaiImportHTML=e.ImportHTML;exports.ChaiOutline=e.ListTree;exports.ChaiScreenSizes=e.Breakpoints;exports.ChaiThemeConfigPanel=e.ThemeConfigPanel;exports.ChaiUILibrariesPanel=e.UILibrariesPanel;exports.ChaiUndoRedo=e.UndoRedo;exports.PERMISSIONS=e.PERMISSIONS;exports.defaultChaiLibrary=e.defaultChaiLibrary;exports.getClassValueAndUnit=e.getClassValueAndUnit;exports.useAddBlock=e.useAddBlock;exports.useBlocksHtmlForAi=e.useBlocksHtmlForAi;exports.useHtmlToBlocks=e.useHtmlToBlocks;exports.useI18nBlocks=e.useI18nBlocks;exports.useLanguages=e.useLanguages;exports.useReplaceBlock=e.useReplaceBlock;exports.useSavePage=e.useSavePage;exports.useSelectedBlock=e.useSelectedBlock;exports.useStreamMultipleBlocksProps=e.useStreamMultipleBlocksProps;exports.generateBlockId=r.generateUUID;exports.mergeClasses=r.cn;exports.convertHTMLToChaiBlocks=i.getBlocksFromHTML;exports.getBlocksFromHTML=i.getBlocksFromHTML;exports.ADD_BLOCK_TABS=a.ADD_BLOCK_TABS;exports.CHAI_BUILDER_PANELS=a.CHAI_BUILDER_PANELS;exports.IfChaiFeatureFlag=a.IfChaiFeatureFlag;exports.RJSF_EXTENSIONS=a.RJSF_EXTENSIONS;exports.getChaiLibrary=a.getChaiLibrary;exports.getPreImportHTML=a.getPreImportHTML;exports.registerChaiAddBlockTab=a.registerChaiAddBlockTab;exports.registerChaiBlockSettingField=a.registerChaiBlockSettingField;exports.registerChaiBlockSettingTemplate=a.registerChaiBlockSettingTemplate;exports.registerChaiBlockSettingWidget=a.registerChaiBlockSettingWidget;exports.registerChaiFeatureFlag=a.registerChaiFeatureFlag;exports.registerChaiFeatureFlags=a.registerChaiFeatureFlags;exports.registerChaiLibrary=a.registerChaiLibrary;exports.registerChaiMediaManager=a.registerChaiMediaManager;exports.registerChaiPreImportHTMLHook=a.registerChaiPreImportHTMLHook;exports.registerChaiSaveToLibrary=a.registerChaiSaveToLibrary;exports.registerChaiSidebarPanel=a.registerChaiSidebarPanel;exports.registerChaiTopBar=a.registerChaiTopBar;exports.resetSaveToLibrary=a.resetSaveToLibrary;exports.useChaiAddBlockTabs=a.useChaiAddBlockTabs;exports.useChaiBlockSettingComponents=a.useChaiBlockSettingComponents;exports.useChaiFeatureFlag=a.useChaiFeatureFlag;exports.useChaiFeatureFlags=a.useChaiFeatureFlags;exports.useChaiLibraries=a.useChaiLibraries;exports.useChaiSidebarPanels=a.useChaiSidebarPanels;exports.useMediaManagerComponent=a.useMediaManagerComponent;exports.useSaveToLibraryComponent=a.useSaveToLibraryComponent;exports.useToggleChaiFeatureFlag=a.useToggleChaiFeatureFlag;exports.useTopBarComponent=a.useTopBarComponent;Object.defineProperty(exports,"useTranslation",{enumerable:!0,get:()=>t.useTranslation});exports.i18n=o;
package/dist/core.d.ts CHANGED
@@ -200,7 +200,12 @@ export declare interface ChaiBuilderEditorProps {
200
200
  * onSave callback function
201
201
  * @param saveData
202
202
  */
203
- onSave?: ({ blocks, theme, autoSave }: ChaiSavePageData) => Promise<boolean | Error>;
203
+ onSave?: ({ blocks, autoSave }: ChaiSavePageData) => Promise<boolean | Error>;
204
+ /**
205
+ * onSaveWebsiteData callback function for theme and design tokens
206
+ * @param saveData
207
+ */
208
+ onSaveWebsiteData?: (data: ChaiSaveWebsiteData) => Promise<boolean | Error>;
204
209
  /**
205
210
  * onSaveStateChange callback function
206
211
  * @param syncStatus
@@ -480,13 +485,20 @@ declare type ChaiPageType = {
480
485
  declare type ChaiSavePageData = {
481
486
  autoSave: boolean;
482
487
  blocks: ChaiBlock[];
483
- theme?: ChaiTheme;
484
488
  needTranslations?: boolean;
485
489
  designTokens: ChaiDesignTokens;
486
490
  partialIds?: string[];
487
491
  linkPageIds?: string[];
488
492
  };
489
493
 
494
+ declare type ChaiSaveWebsiteData = {
495
+ type: "THEME";
496
+ data: ChaiTheme;
497
+ } | {
498
+ type: "DESIGN_TOKENS";
499
+ data: ChaiDesignTokens;
500
+ };
501
+
490
502
  export declare const ChaiScreenSizes: ({ openDelay, canvas, tooltip, buttonClass, activeButtonClass, }: {
491
503
  openDelay?: number;
492
504
  canvas?: boolean;
package/dist/core.js CHANGED
@@ -1,9 +1,9 @@
1
- import { b1 as s, aR as r, aZ as i, b2 as o, aS as t, aT as l, aU as C, aP as h, a$ as g, b3 as u, b4 as d, b5 as n, aV as c, aW as B, a_ as k, aX as S, aY as b, b0 as p, aH as m, b7 as T, b6 as F, ah as L, ak as A, b8 as P, V as I, d as M, ai as f, F as E, U as H, W as x } from "./index-DsQXiNA_.js";
1
+ import { b2 as s, aS as r, a_ as i, b3 as o, aT as t, aU as l, aV as C, aQ as h, b0 as g, b4 as u, b5 as d, b6 as n, aW as c, aX as B, a$ as k, aY as b, aZ as S, b1 as p, aI as m, b8 as T, b7 as L, ah as F, ak as A, b9 as I, U as M, d as P, ai as f, E, R as H, V as x } from "./index-C7bidKtE.js";
2
2
  import { g as v, c as D } from "./common-functions-D2lMFR6K.js";
3
- import { g as U, g as _ } from "./apply-binding-chfbBKi2.js";
4
- import { A as O, C as V, I as W, R as w, k as X, o as j, c as q, a as z, b as J, r as K, e as Y, f as Z, j as $, m as G, p as Q, q as aa, v as ea, x as sa, t as ra, d as ia, u as oa, h as ta, g as la, l as Ca, w as ha, n as ga, s as ua, i as da, y as na } from "./register-chai-top-bar-D6GjnauV.js";
3
+ import { g as U, g as _ } from "./apply-binding-BYCW1k2l.js";
4
+ import { A as O, C as V, I as w, R as W, k as X, o as j, c as q, a as z, b as J, r as K, e as Q, f as Y, j as Z, m as $, p as G, q as aa, v as ea, x as sa, t as ra, d as ia, u as oa, h as ta, g as la, l as Ca, w as ha, n as ga, s as ua, i as da, y as na } from "./register-chai-top-bar-D6GjnauV.js";
5
5
  import { useTranslation as Ba } from "react-i18next";
6
- import { default as Sa } from "i18next";
6
+ import { default as ba } from "i18next";
7
7
  export {
8
8
  O as ADD_BLOCK_TABS,
9
9
  V as CHAI_BUILDER_PANELS,
@@ -22,35 +22,35 @@ export {
22
22
  c as ChaiImportHTML,
23
23
  B as ChaiOutline,
24
24
  k as ChaiScreenSizes,
25
- S as ChaiThemeConfigPanel,
26
- b as ChaiUILibrariesPanel,
25
+ b as ChaiThemeConfigPanel,
26
+ S as ChaiUILibrariesPanel,
27
27
  p as ChaiUndoRedo,
28
- W as IfChaiFeatureFlag,
28
+ w as IfChaiFeatureFlag,
29
29
  m as PERMISSIONS,
30
- w as RJSF_EXTENSIONS,
30
+ W as RJSF_EXTENSIONS,
31
31
  U as convertHTMLToChaiBlocks,
32
32
  T as defaultChaiLibrary,
33
33
  v as generateBlockId,
34
34
  _ as getBlocksFromHTML,
35
35
  X as getChaiLibrary,
36
- F as getClassValueAndUnit,
36
+ L as getClassValueAndUnit,
37
37
  j as getPreImportHTML,
38
- Sa as i18n,
38
+ ba as i18n,
39
39
  D as mergeClasses,
40
40
  q as registerChaiAddBlockTab,
41
41
  z as registerChaiBlockSettingField,
42
42
  J as registerChaiBlockSettingTemplate,
43
43
  K as registerChaiBlockSettingWidget,
44
- Y as registerChaiFeatureFlag,
45
- Z as registerChaiFeatureFlags,
46
- $ as registerChaiLibrary,
47
- G as registerChaiMediaManager,
48
- Q as registerChaiPreImportHTMLHook,
44
+ Q as registerChaiFeatureFlag,
45
+ Y as registerChaiFeatureFlags,
46
+ Z as registerChaiLibrary,
47
+ $ as registerChaiMediaManager,
48
+ G as registerChaiPreImportHTMLHook,
49
49
  aa as registerChaiSaveToLibrary,
50
50
  ea as registerChaiSidebarPanel,
51
51
  sa as registerChaiTopBar,
52
52
  ra as resetSaveToLibrary,
53
- L as useAddBlock,
53
+ F as useAddBlock,
54
54
  A as useBlocksHtmlForAi,
55
55
  ia as useChaiAddBlockTabs,
56
56
  oa as useChaiBlockSettingComponents,
@@ -58,9 +58,9 @@ export {
58
58
  la as useChaiFeatureFlags,
59
59
  Ca as useChaiLibraries,
60
60
  ha as useChaiSidebarPanels,
61
- P as useHtmlToBlocks,
62
- I as useI18nBlocks,
63
- M as useLanguages,
61
+ I as useHtmlToBlocks,
62
+ M as useI18nBlocks,
63
+ P as useLanguages,
64
64
  ga as useMediaManagerComponent,
65
65
  f as useReplaceBlock,
66
66
  E as useSavePage,
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),y=require("./register-chai-top-bar-DyW9GPzV.cjs"),f=require("./index-mPCp0j2h.cjs");require("lodash-es");const T=require("culori"),V=require("./fonts-D5fTqvSS.cjs"),N=require("react"),R=require("react-i18next");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=j(T),C=j(N),d=e=>e?e%1===0?e:e.toFixed(4):"0",q=e=>`hsl(${d(e.h)} ${d(e.s*100)}% ${d(e.l*100)}%)`,E=(e,o="hsl",t="4")=>{try{const r=b.parse(e);if(!r)throw new Error("Invalid color input");switch(o){case"hsl":{const s=b.converter("hsl")(r);return t==="4"?q(s):`${d(s.h)} ${d(s.s*100)}% ${d(s.l*100)}%`}case"rgb":return b.formatRgb(r);case"oklch":{const s=b.converter("oklch")(r);return`oklch(${d(s.l)} ${d(s.c)} ${d(s.h)})`}case"hex":return b.formatHex(r);default:return e}}catch(r){return console.error(`Failed to convert color: ${e}`,r),e}},x=e=>E(e,"hex"),I=e=>{const o={fontFamily:{heading:"",body:""},borderRadius:"",colors:{}};try{const t=w(e);if(!t.isValid)return console.warn("CSS validation failed:",t.error),$();const r=v(e,":root"),s=v(e,".dark"),c=u(r,"--font-sans")||u(r,"--font-family")||u(r,"--font-heading")||u(r,"--font-body"),a=D(c);o.fontFamily={heading:a,body:a};const h=u(r,"--radius")||u(r,"--border-radius")||"0.5rem";o.borderRadius=P(h),["background","foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","destructive","destructive-foreground","border","input","ring","card","card-foreground","popover","popover-foreground"].forEach(i=>{const p=u(r,`--${i}`),g=u(s,`--${i}`);if(p||g){const l=p?k(p):"#000000",S=g?k(g):l;o.colors[i]=[l,S]}})}catch(t){return console.error("Error parsing CSS to ChaiThemeValues:",t),$()}return o},v=(e,o)=>{var r,s;const t=new RegExp(`${F(o)}\\s*{([^}]+)}`);return((s=(r=e.match(t))==null?void 0:r[1])==null?void 0:s.trim())||null},u=(e,o)=>{var s;if(!e)return null;const t=new RegExp(`${F(o)}\\s*:\\s*([^;]+)`),r=e.match(t);return((s=r==null?void 0:r[1])==null?void 0:s.trim())||null},k=e=>{if(!e||typeof e!="string")return"#000000";try{const o=e.replace(/var\([^)]+\)/g,"").trim();if(!o)return"#000000";if(/^[a-z]+$/i.test(o))return x(o)||"#000000";if(/^#?([0-9A-F]{3,4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(o.replace(/#/g,""))){const r=o.startsWith("#")?o:`#${o}`;return r.length<=5?`#${r.slice(1).split("").map(s=>s+s).join("")}`.slice(0,7):r.length>7?r.slice(0,7):r}if(/^(rgb|hsl|oklch)a?\(/i.test(o))return x(o)||"#000000";const t=o.match(/^(\d+\.?\d*)\s+(\d+\.?\d*)%\s+(\d+\.?\d*)%$/);if(t){const[,r,s,c]=t,a=`hsl(${r} ${s}% ${c}%)`;return x(a)||"#000000"}if(/^[\d.]+[\s,]+[\d.]+[\s,]+[\d.]+(?:[\s,/]+[\d.]+)?$/.test(o)){const r=o.split(/[\s,]+/).filter(Boolean);if(r.length>=3){const c=r.some(a=>a.includes("%"))?`hsl(${r[0]} ${r[1]} ${r[2]})`:`rgb(${r[0]}, ${r[1]}, ${r[2]})`;return x(c)||"#000000"}}return x(o)||"#000000"}catch(o){return console.warn("Failed to process color:",e,o),"#000000"}},D=e=>{const o=V.getAllRegisteredFonts();if(!e)return"ui-sans-serif, system-ui, sans-serif";try{const r=e.replace(/["']/g,"").trim().split(",")[0].trim(),s=o.find(c=>c.family.toLowerCase()===r.toLowerCase());return(s==null?void 0:s.family)||"ui-sans-serif, system-ui, sans-serif"}catch(t){return console.warn("Error processing font family:",e,t),"ui-sans-serif, system-ui, sans-serif"}},P=e=>{try{const o=e.trim();if(o.endsWith("px"))return o;if(o.endsWith("rem")){const r=parseFloat(o.replace("rem",""));if(!isNaN(r))return`${Math.round(r*16)}px`}if(o.endsWith("em")){const r=parseFloat(o.replace("em",""));if(!isNaN(r))return`${Math.round(r*16)}px`}const t=parseFloat(o);return isNaN(t)?"8px":`${Math.round(t)}px`}catch(o){return console.warn("Error converting border radius to px:",e,o),"8px"}},$=()=>({fontFamily:{heading:"ui-sans-serif, system-ui, sans-serif",body:"ui-sans-serif, system-ui, sans-serif"},borderRadius:"8px",colors:{background:["#ffffff","#000000"],foreground:["#000000","#ffffff"],primary:["#3b82f6","#60a5fa"],"primary-foreground":["#ffffff","#1e293b"],secondary:["#f1f5f9","#334155"],"secondary-foreground":["#0f172a","#f8fafc"],muted:["#f8fafc","#1e293b"],"muted-foreground":["#64748b","#94a3b8"],accent:["#f1f5f9","#334155"],"accent-foreground":["#0f172a","#f8fafc"],destructive:["#ef4444","#f87171"],"destructive-foreground":["#ffffff","#1e293b"],border:["#e2e8f0","#475569"],input:["#e2e8f0","#475569"],ring:["#3b82f6","#60a5fa"],card:["#ffffff","#0f172a"],"card-foreground":["#000000","#f8fafc"],popover:["#ffffff","#0f172a"],"popover-foreground":["#000000","#f8fafc"]}}),F=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),B=e=>["background","foreground","primary","primary-foreground"].every(r=>e.colors[r]&&Array.isArray(e.colors[r])&&e.colors[r].length>=2)&&!!e.fontFamily.heading&&!!e.fontFamily.body&&!!e.borderRadius,w=e=>{if(!e||typeof e!="string")return{isValid:!1,error:"Please enter valid CSS content"};const o=e.trim();if(!o)return{isValid:!1,error:"Please enter CSS content"};try{if(!o.includes("{")||!o.includes("}"))return{isValid:!1,error:"Invalid CSS format. CSS should contain proper block structure with { }"};const t=(o.match(/{/g)||[]).length,r=(o.match(/}/g)||[]).length;return t!==r?{isValid:!1,error:"Invalid CSS format. Unmatched braces detected"}:!o.includes("--")||!o.includes(":")?{isValid:!1,error:"Invalid CSS format. CSS should contain variable definitions like --primary: #color"}:!o.includes(":root")&&!o.includes(".dark")?{isValid:!1,error:"CSS should contain at least :root or .dark selector with theme variables"}:{isValid:!0}}catch(t){return console.error("CSS validation error:",t),{isValid:!1,error:"Failed to parse CSS. Please check your syntax."}}},M=`:root {
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),y=require("./register-chai-top-bar-DyW9GPzV.cjs"),f=require("./index-DKjYF53r.cjs");require("lodash-es");const T=require("culori"),V=require("./fonts-D5fTqvSS.cjs"),N=require("react"),R=require("react-i18next");function j(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const b=j(T),C=j(N),d=e=>e?e%1===0?e:e.toFixed(4):"0",q=e=>`hsl(${d(e.h)} ${d(e.s*100)}% ${d(e.l*100)}%)`,E=(e,o="hsl",t="4")=>{try{const r=b.parse(e);if(!r)throw new Error("Invalid color input");switch(o){case"hsl":{const s=b.converter("hsl")(r);return t==="4"?q(s):`${d(s.h)} ${d(s.s*100)}% ${d(s.l*100)}%`}case"rgb":return b.formatRgb(r);case"oklch":{const s=b.converter("oklch")(r);return`oklch(${d(s.l)} ${d(s.c)} ${d(s.h)})`}case"hex":return b.formatHex(r);default:return e}}catch(r){return console.error(`Failed to convert color: ${e}`,r),e}},x=e=>E(e,"hex"),I=e=>{const o={fontFamily:{heading:"",body:""},borderRadius:"",colors:{}};try{const t=w(e);if(!t.isValid)return console.warn("CSS validation failed:",t.error),$();const r=v(e,":root"),s=v(e,".dark"),c=u(r,"--font-sans")||u(r,"--font-family")||u(r,"--font-heading")||u(r,"--font-body"),a=D(c);o.fontFamily={heading:a,body:a};const h=u(r,"--radius")||u(r,"--border-radius")||"0.5rem";o.borderRadius=P(h),["background","foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","destructive","destructive-foreground","border","input","ring","card","card-foreground","popover","popover-foreground"].forEach(i=>{const p=u(r,`--${i}`),g=u(s,`--${i}`);if(p||g){const l=p?k(p):"#000000",S=g?k(g):l;o.colors[i]=[l,S]}})}catch(t){return console.error("Error parsing CSS to ChaiThemeValues:",t),$()}return o},v=(e,o)=>{var r,s;const t=new RegExp(`${F(o)}\\s*{([^}]+)}`);return((s=(r=e.match(t))==null?void 0:r[1])==null?void 0:s.trim())||null},u=(e,o)=>{var s;if(!e)return null;const t=new RegExp(`${F(o)}\\s*:\\s*([^;]+)`),r=e.match(t);return((s=r==null?void 0:r[1])==null?void 0:s.trim())||null},k=e=>{if(!e||typeof e!="string")return"#000000";try{const o=e.replace(/var\([^)]+\)/g,"").trim();if(!o)return"#000000";if(/^[a-z]+$/i.test(o))return x(o)||"#000000";if(/^#?([0-9A-F]{3,4}|[0-9A-F]{6}|[0-9A-F]{8})$/i.test(o.replace(/#/g,""))){const r=o.startsWith("#")?o:`#${o}`;return r.length<=5?`#${r.slice(1).split("").map(s=>s+s).join("")}`.slice(0,7):r.length>7?r.slice(0,7):r}if(/^(rgb|hsl|oklch)a?\(/i.test(o))return x(o)||"#000000";const t=o.match(/^(\d+\.?\d*)\s+(\d+\.?\d*)%\s+(\d+\.?\d*)%$/);if(t){const[,r,s,c]=t,a=`hsl(${r} ${s}% ${c}%)`;return x(a)||"#000000"}if(/^[\d.]+[\s,]+[\d.]+[\s,]+[\d.]+(?:[\s,/]+[\d.]+)?$/.test(o)){const r=o.split(/[\s,]+/).filter(Boolean);if(r.length>=3){const c=r.some(a=>a.includes("%"))?`hsl(${r[0]} ${r[1]} ${r[2]})`:`rgb(${r[0]}, ${r[1]}, ${r[2]})`;return x(c)||"#000000"}}return x(o)||"#000000"}catch(o){return console.warn("Failed to process color:",e,o),"#000000"}},D=e=>{const o=V.getAllRegisteredFonts();if(!e)return"ui-sans-serif, system-ui, sans-serif";try{const r=e.replace(/["']/g,"").trim().split(",")[0].trim(),s=o.find(c=>c.family.toLowerCase()===r.toLowerCase());return(s==null?void 0:s.family)||"ui-sans-serif, system-ui, sans-serif"}catch(t){return console.warn("Error processing font family:",e,t),"ui-sans-serif, system-ui, sans-serif"}},P=e=>{try{const o=e.trim();if(o.endsWith("px"))return o;if(o.endsWith("rem")){const r=parseFloat(o.replace("rem",""));if(!isNaN(r))return`${Math.round(r*16)}px`}if(o.endsWith("em")){const r=parseFloat(o.replace("em",""));if(!isNaN(r))return`${Math.round(r*16)}px`}const t=parseFloat(o);return isNaN(t)?"8px":`${Math.round(t)}px`}catch(o){return console.warn("Error converting border radius to px:",e,o),"8px"}},$=()=>({fontFamily:{heading:"ui-sans-serif, system-ui, sans-serif",body:"ui-sans-serif, system-ui, sans-serif"},borderRadius:"8px",colors:{background:["#ffffff","#000000"],foreground:["#000000","#ffffff"],primary:["#3b82f6","#60a5fa"],"primary-foreground":["#ffffff","#1e293b"],secondary:["#f1f5f9","#334155"],"secondary-foreground":["#0f172a","#f8fafc"],muted:["#f8fafc","#1e293b"],"muted-foreground":["#64748b","#94a3b8"],accent:["#f1f5f9","#334155"],"accent-foreground":["#0f172a","#f8fafc"],destructive:["#ef4444","#f87171"],"destructive-foreground":["#ffffff","#1e293b"],border:["#e2e8f0","#475569"],input:["#e2e8f0","#475569"],ring:["#3b82f6","#60a5fa"],card:["#ffffff","#0f172a"],"card-foreground":["#000000","#f8fafc"],popover:["#ffffff","#0f172a"],"popover-foreground":["#000000","#f8fafc"]}}),F=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),B=e=>["background","foreground","primary","primary-foreground"].every(r=>e.colors[r]&&Array.isArray(e.colors[r])&&e.colors[r].length>=2)&&!!e.fontFamily.heading&&!!e.fontFamily.body&&!!e.borderRadius,w=e=>{if(!e||typeof e!="string")return{isValid:!1,error:"Please enter valid CSS content"};const o=e.trim();if(!o)return{isValid:!1,error:"Please enter CSS content"};try{if(!o.includes("{")||!o.includes("}"))return{isValid:!1,error:"Invalid CSS format. CSS should contain proper block structure with { }"};const t=(o.match(/{/g)||[]).length,r=(o.match(/}/g)||[]).length;return t!==r?{isValid:!1,error:"Invalid CSS format. Unmatched braces detected"}:!o.includes("--")||!o.includes(":")?{isValid:!1,error:"Invalid CSS format. CSS should contain variable definitions like --primary: #color"}:!o.includes(":root")&&!o.includes(".dark")?{isValid:!1,error:"CSS should contain at least :root or .dark selector with theme variables"}:{isValid:!0}}catch(t){return console.error("CSS validation error:",t),{isValid:!1,error:"Failed to parse CSS. Please check your syntax."}}},M=`:root {
2
2
  --background: 0 0% 100%;
3
3
  --foreground: oklch(0.52 0.13 144.17);
4
4
  --primary: #3e2723;
@@ -1,6 +1,6 @@
1
1
  import { jsx as i, jsxs as u } from "react/jsx-runtime";
2
2
  import { B as y } from "./register-chai-top-bar-D6GjnauV.js";
3
- import { D as T, e as V, f as N, g as R, p as E, q as D, T as I, r as A } from "./index-DsQXiNA_.js";
3
+ import { D as T, e as V, f as N, g as R, o as E, p as D, T as I, q as A } from "./index-C7bidKtE.js";
4
4
  import "lodash-es";
5
5
  import * as b from "culori";
6
6
  import { a as P } from "./fonts-B3UYxuJI.js";
@@ -0,0 +1,22 @@
1
+ "use strict";const a=require("lodash-es"),$=require("./fonts-D5fTqvSS.cjs"),b=require("./_commonjsHelpers-DwGv2jUC.cjs"),B=e=>({fontFamily:e.fontFamily?a.keys(e.fontFamily).reduce((r,t)=>({...r,[t.replace("font-","")]:`var(--${t})`}),{}):{},borderRadius:e.borderRadius?{lg:"var(--radius)",md:"calc(var(--radius) - 2px)",sm:"calc(var(--radius) - 4px)"}:{},colors:e.colors?a.flatten(e.colors.map(r=>Object.entries(r.items))).reduce((r,[t])=>({...r,[t]:`hsl(var(--${t}))`}),{}):{}});function m(e){const n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);let r=parseInt(n[1],16),t=parseInt(n[2],16),F=parseInt(n[3],16);r/=255,t/=255,F/=255;const o=Math.max(r,t,F),u=Math.min(r,t,F);let i=0,l=0;const g=(o+u)/2;if(o==u)i=l=0;else{const s=o-u;switch(l=g>.5?s/(2-o-u):s/(o+u),o){case r:i=(t-F)/s+(t<F?6:0);break;case t:i=(F-r)/s+2;break;case F:i=(r-t)/s+4;break}i/=6}return`${Math.round(i*360)} ${Math.round(l*100)}% ${Math.round(g*100)}%`}const v=e=>{const r=$.getAllRegisteredFonts().find(t=>t.family===e);return`"${e}", ${a.get(r,"fallback","")}`},_=({theme:e})=>{const n=e;return`:root {
2
+ ${e.fontFamily?Object.entries(e.fontFamily).map(([r,t])=>`--font-${r}: ${v(t)};`).join(`
3
+ `):""}
4
+ ${n.borderRadius?`--radius: ${n.borderRadius};`:""}
5
+ ${n.colors?Object.entries(n.colors).map(([r,t])=>`--${r}: ${m(t[0])};`).join(`
6
+ `):""}
7
+ }
8
+ .dark {
9
+ ${n.colors?Object.entries(n.colors).map(([r,t])=>`--${r}: ${m(t[1])};`).join(`
10
+ `):""}
11
+ }`},E=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(n=>`<link rel="stylesheet" href="${n.url}" />`).join(`
12
+ `),A=e=>!e||e.length===0?[]:a.uniqBy(e,"family").map(n=>n.url),C=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(n=>`@import url("${n.url}");`).join(`
13
+ `),P=e=>!e||e.length===0?"":a.uniqBy(e,"family").map(n=>n.src.map(r=>`@font-face {
14
+ font-family: "${n.family}";
15
+ src: url("${r.url}") format("${r.format}");
16
+ font-display: swap;
17
+ ${r.fontWeight?`font-weight: ${r.fontWeight};`:""}
18
+ ${r.fontStyle?`font-style: ${r.fontStyle};`:""}
19
+ ${r.fontStretch?`font-stretch: ${r.fontStretch};`:""}
20
+ }`).join(`
21
+ `)).join(`
22
+ `);var d={},c={},p;function j(){return p||(p=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});function n(t,F){return{handler:t,config:F}}n.withOptions=function(t,F=()=>({})){const o=function(u){return{__options:u,handler:t(u),config:F(u)}};return o.__isOptionsFunction=!0,o.__pluginFunction=t,o.__configFunction=F,o};const r=n})(c)),c}var h;function q(){return h||(h=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});const n=r(j());function r(F){return F&&F.__esModule?F:{default:F}}const t=n.default})(d)),d}var f,y;function T(){if(y)return f;y=1;let e=q();return f=(e.__esModule?e:{default:e}).default,f}var M=T();const k=b.getDefaultExportFromCjs(M),R={fontFamily:{"font-heading":"Arial","font-body":"Arial"},borderRadius:"10px",colors:[{group:"Body",items:{background:["#FFFFFF","#121212"],foreground:["#121212","#FFFFFF"]}},{group:"Primary",items:{primary:["#2563EB","#3B82F6"],"primary-foreground":["#FFFFFF","#FFFFFF"]}},{group:"Secondary",items:{secondary:["#F3F4F6","#374151"],"secondary-foreground":["#1F2937","#F9FAFB"]}},{group:"Border, Input & Ring",items:{border:["#E5E7EB","#374151"],input:["#E5E7EB","#374151"],ring:["#2563EB","#3B82F6"]}},{group:"Card",items:{card:["#FFFFFF","#1F2937"],"card-foreground":["#121212","#FFFFFF"]}},{group:"Popover",items:{popover:["#FFFFFF","#1F2937"],"popover-foreground":["#121212","#FFFFFF"]}},{group:"Muted",items:{muted:["#F3F4F6","#374151"],"muted-foreground":["#6B7280","#9CA3AF"]}},{group:"Accent",items:{accent:["#F3F4F6","#374151"],"accent-foreground":["#1F2937","#FFFFFF"]}},{group:"Destructive",items:{destructive:["#DC2626","#EF4444"],"destructive-foreground":["#FFFFFF","#FFFFFF"]}}]},O={fontFamily:{heading:"Arial",body:"Arial"},borderRadius:"6px",colors:{background:["#FFFFFF","#09090B"],foreground:["#09090B","#FFFFFF"],primary:["#2563EB","#3B82F6"],"primary-foreground":["#FFFFFF","#FFFFFF"],secondary:["#F4F4F5","#27272A"],"secondary-foreground":["#09090B","#FFFFFF"],muted:["#F4F4F5","#27272A"],"muted-foreground":["#71717A","#A1A1AA"],accent:["#F4F4F5","#27272A"],"accent-foreground":["#09090B","#FFFFFF"],destructive:["#EF4444","#7F1D1D"],"destructive-foreground":["#FFFFFF","#FFFFFF"],border:["#E4E4E7","#27272A"],input:["#E4E4E7","#27272A"],ring:["#2563EB","#3B82F6"],card:["#FFFFFF","#09090B"],"card-foreground":["#09090B","#FFFFFF"],popover:["#FFFFFF","#09090B"],"popover-foreground":["#09090B","#FFFFFF"]}};exports.defaultThemeOptions=R;exports.defaultThemeValues=O;exports.getChaiThemeCssVariables=_;exports.getChaiThemeOptions=B;exports.getThemeCustomFontFace=P;exports.getThemeFontsCSSImport=C;exports.getThemeFontsLinkMarkup=E;exports.getThemeFontsUrls=A;exports.plugin=k;