@chaibuilder/sdk 4.0.0-beta.43 → 4.0.0-beta.45

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 (125) hide show
  1. package/dist/{2SSKDMRQ-hQZti_AG.js → 2SSKDMRQ-CqsUj10r.js} +2 -2
  2. package/dist/{2SSKDMRQ-BZmyXysb.cjs → 2SSKDMRQ-D12irKaV.cjs} +1 -1
  3. package/dist/{AP7HFJJL-DhBHON6w.js → AP7HFJJL-CEMjieq8.js} +1 -1
  4. package/dist/{AP7HFJJL-DZJbtGey.cjs → AP7HFJJL-CQ1kBXlH.cjs} +1 -1
  5. package/dist/{IconPicker-y7ijQESM.js → IconPicker-CGtjTiWr.js} +1 -1
  6. package/dist/{IconPicker-BTC6tZZE.cjs → IconPicker-CeAu6O-X.cjs} +1 -1
  7. package/dist/{WDYDFRGG-BQXNJif4.cjs → WDYDFRGG-BGBMGOXn.cjs} +1 -1
  8. package/dist/{WDYDFRGG-DT73rUAi.js → WDYDFRGG-Djk7UWh1.js} +2 -2
  9. package/dist/{actions-registery-CqhNZFV3.cjs → actions-registery-B6tt904t.cjs} +18 -18
  10. package/dist/{actions-registery-CMKfEXxX.js → actions-registery-D1v8fvDh.js} +712 -709
  11. package/dist/actions.cjs +1 -1
  12. package/dist/actions.d.ts +135 -0
  13. package/dist/actions.js +7 -6
  14. package/dist/{active-in-another-tab-B_b2Wl-l.cjs → active-in-another-tab-BWn6jTeo.cjs} +1 -1
  15. package/dist/{active-in-another-tab-D5Wsc7po.js → active-in-another-tab-b3dtgwXA.js} +4 -4
  16. package/dist/{add-new-language-page-B37NvHcc.cjs → add-new-language-page-CJgeCgQ_.cjs} +1 -1
  17. package/dist/{add-new-language-page-DgYUSlvF.js → add-new-language-page-DLSJWwTI.js} +3 -3
  18. package/dist/{add-new-page-BLPSZY8N.js → add-new-page-CS8dEOhg.js} +2 -2
  19. package/dist/{add-new-page-CMkPeRMc.cjs → add-new-page-IRS1Ft0d.cjs} +1 -1
  20. package/dist/{ai-panel-default-lang-BJPZtqTZ.cjs → ai-panel-default-lang-BTjr4pC6.cjs} +2 -2
  21. package/dist/{ai-panel-default-lang-q7ibfHDa.js → ai-panel-default-lang-NdhYzpxN.js} +11 -11
  22. package/dist/{ai-panel-other-lang-DO2Pq3eM.js → ai-panel-other-lang-Bj2wYIfM.js} +14 -14
  23. package/dist/{ai-panel-other-lang-CqThrEnR.cjs → ai-panel-other-lang-BpjPfSPX.cjs} +1 -1
  24. package/dist/ai-prompt-input-B8SFfk6N.cjs +1 -0
  25. package/dist/ai-prompt-input-bleYNRnH.js +650 -0
  26. package/dist/{ai-translation-prompt-Ch54mM08.cjs → ai-translation-prompt-D1rNu8P-.cjs} +1 -1
  27. package/dist/{ai-translation-prompt-TUVm5MgK.js → ai-translation-prompt-DHfe6Wzy.js} +1 -1
  28. package/dist/apply-binding-CBSjMYSk.cjs +41 -0
  29. package/dist/{apply-binding-RQRSIe56.js → apply-binding-vAuN-TGV.js} +3 -2
  30. package/dist/{change-password-modal-Cet5GebC.js → change-password-modal-OPNVgWPf.js} +4 -4
  31. package/dist/{change-password-modal-xBIyXsLV.cjs → change-password-modal-pr1urpGi.cjs} +1 -1
  32. package/dist/{code-editor-C8oMJmY_.cjs → code-editor-BVmpIZOt.cjs} +1 -1
  33. package/dist/{code-editor-DvxiAjP6.js → code-editor-BfGHceIq.js} +1 -1
  34. package/dist/{continue-editing-in-this-client-B19gkD98.cjs → continue-editing-in-this-client-B0fhkHm9.cjs} +1 -1
  35. package/dist/{continue-editing-in-this-client-CGd_nIXe.js → continue-editing-in-this-client-BM6Ru46L.js} +2 -2
  36. package/dist/core.cjs +1 -1
  37. package/dist/core.js +18 -18
  38. package/dist/{css-import-modal-JsnFEHuT.cjs → css-import-modal-C9G5pbFd.cjs} +1 -1
  39. package/dist/{css-import-modal-DLLriSUJ.js → css-import-modal-CEQccCmc.js} +1 -1
  40. package/dist/{delete-page-Cc5Z537o.cjs → delete-page-CXRD2fUG.cjs} +1 -1
  41. package/dist/{delete-page-CjdSwdRR.js → delete-page-YGXD04Z1.js} +2 -2
  42. package/dist/{design-token-usage-DCEQ0nFH.cjs → design-token-usage-C5WfKLj-.cjs} +1 -1
  43. package/dist/{design-token-usage-hGL4vi4W.js → design-token-usage-CVPBTF21.js} +8 -8
  44. package/dist/{digital-asset-manager-l1HTU_vW.cjs → digital-asset-manager-BLnvpLiu.cjs} +1 -1
  45. package/dist/{digital-asset-manager-Bb7ESXoQ.js → digital-asset-manager-CC02mA_u.js} +3 -3
  46. package/dist/{duplicate-page-oxFQeRmn.js → duplicate-page-Df3_zMuR.js} +12 -12
  47. package/dist/{duplicate-page-cFYp-bAb.cjs → duplicate-page-N6d80CFF.cjs} +1 -1
  48. package/dist/{dynamic-page-selector-CEHpm0rg.cjs → dynamic-page-selector-CehQLxyZ.cjs} +1 -1
  49. package/dist/{dynamic-page-selector-Brj1zNHl.js → dynamic-page-selector-DDUtutYp.js} +12 -12
  50. package/dist/{image-editor-DhgFpSAR.js → image-editor-CzxSXo-u.js} +1 -1
  51. package/dist/{image-editor-D0A_xctQ.cjs → image-editor-DQ8mQonU.cjs} +1 -1
  52. package/dist/index-DAJ9bufO.cjs +5 -0
  53. package/dist/{index-ZaKz5cWo.cjs → index-DrzR7vXl.cjs} +2 -2
  54. package/dist/{index-CGZjCAyz.js → index-RwAuF_BE.js} +40 -40
  55. package/dist/{index-D2xHSM7d.js → index-nVkLHaAS.js} +1344 -1289
  56. package/dist/{json-diff-viewer-C-H_IWJx.js → json-diff-viewer-CgWyab6R.js} +6 -6
  57. package/dist/{json-diff-viewer-LIr31DRU.cjs → json-diff-viewer-DgcLmglp.cjs} +1 -1
  58. package/dist/{lang-panel-CAcPc81E.js → lang-panel-B95Qvr7o.js} +22 -22
  59. package/dist/{lang-panel-xrs5AMiU.cjs → lang-panel-D1usAgp_.cjs} +1 -1
  60. package/dist/{manage-design-tokens-CT5v3zQJ.js → manage-design-tokens-D2Oz-jVp.js} +2 -2
  61. package/dist/{manage-design-tokens-modal-Rh86m84s.cjs → manage-design-tokens-modal-Gufu9nHL.cjs} +1 -1
  62. package/dist/{manage-design-tokens-modal-C6ZCrth8.js → manage-design-tokens-modal-ZR8PuhWC.js} +2 -2
  63. package/dist/{manage-design-tokens-D2zeiRpA.cjs → manage-design-tokens-sDi2Pdec.cjs} +1 -1
  64. package/dist/{mark-as-template-RDZ4zAWY.cjs → mark-as-template-BN3Ao9n8.cjs} +1 -1
  65. package/dist/{mark-as-template-4VtOICqJ.js → mark-as-template-CzBJQ_nj.js} +2 -2
  66. package/dist/{models-D95ZYr_x.js → models-BCu-p_QK.js} +4 -4
  67. package/dist/{models-5gOsRC56.cjs → models-D0RH2u4C.cjs} +1 -1
  68. package/dist/{nested-path-selector-content-uXvLlVet.js → nested-path-selector-content-Ct80kFX-.js} +1 -1
  69. package/dist/{nested-path-selector-content-CvV4iQ6y.cjs → nested-path-selector-content-DhNCvKp3.cjs} +1 -1
  70. package/dist/{no-language-page-content-SqCm12wz.js → no-language-page-content-CGyfOtV3.js} +4 -4
  71. package/dist/{no-language-page-content-DX7R8GnY.cjs → no-language-page-content-DMxN5AZK.cjs} +1 -1
  72. package/dist/{no-language-page-dialog-BqVCx1Ow.cjs → no-language-page-dialog-5I_REfoR.cjs} +1 -1
  73. package/dist/{no-language-page-dialog-s43OupLf.js → no-language-page-dialog-DJXWLTYK.js} +2 -2
  74. package/dist/{page-creator-6A0cANfE.cjs → page-creator-CGOumc-z.cjs} +1 -1
  75. package/dist/{page-creator-hKMxWP7u.js → page-creator-IQs478pG.js} +3 -3
  76. package/dist/{page-lock-CDP4IhJN.cjs → page-lock-CLZ_Oj1q.cjs} +1 -1
  77. package/dist/{page-lock-CSRmpKr0.js → page-lock-Dx3unkMc.js} +2 -2
  78. package/dist/{page-locked-dialog-Js9XDigU.js → page-locked-dialog-C_JgymA0.js} +15 -15
  79. package/dist/{page-locked-dialog-BOAalIT3.cjs → page-locked-dialog-fTJsy11q.cjs} +1 -1
  80. package/dist/{page-manager-new-BvVol7j6.js → page-manager-new-Cdt2NoSS.js} +29 -29
  81. package/dist/{page-manager-new-DhK74o43.cjs → page-manager-new-yyjdahAJ.cjs} +1 -1
  82. package/dist/{page-manager-search-and-filter-CGZnfZIg.cjs → page-manager-search-and-filter-BQ6yd7_7.cjs} +1 -1
  83. package/dist/{page-manager-search-and-filter-D7aoAp1N.js → page-manager-search-and-filter-kF_V1Kw5.js} +26 -26
  84. package/dist/{page-revisions-content-zatAssu9.js → page-revisions-content-Cf1Cn0wo.js} +24 -24
  85. package/dist/{page-revisions-content-BP1wghI_.cjs → page-revisions-content-DfDZS2ME.cjs} +1 -1
  86. package/dist/pages.cjs +1 -1
  87. package/dist/pages.d.ts +2 -0
  88. package/dist/pages.js +24 -23
  89. package/dist/{publish-pages-content-BvWEkJis.js → publish-pages-content-BLXYr2sJ.js} +23 -23
  90. package/dist/{publish-pages-content-BCkzDZSc.cjs → publish-pages-content-BYPD6vxL.cjs} +1 -1
  91. package/dist/render.cjs +1 -1
  92. package/dist/render.js +2 -2
  93. package/dist/{rte-widget-modal-CQazv0bz.cjs → rte-widget-modal-BwE5wIZa.cjs} +1 -1
  94. package/dist/{rte-widget-modal-D0YHscUT.js → rte-widget-modal-Tj_pS3ql.js} +1 -1
  95. package/dist/{save-to-lib-BBvjMM3Z.cjs → save-to-lib-BZvVC0bb.cjs} +1 -1
  96. package/dist/{save-to-lib-CnKWpb9U.js → save-to-lib-DGONzxBC.js} +62 -62
  97. package/dist/{selected-block-display-BdWPYwVr.js → selected-block-display-CoWqh7BT.js} +11 -11
  98. package/dist/{selected-block-display-D9bDLuNV.cjs → selected-block-display-D1p8khWb.cjs} +1 -1
  99. package/dist/{seo-panel-C2NUYfBh.js → seo-panel-C5_war2g.js} +25 -25
  100. package/dist/{seo-panel-BxN785dG.cjs → seo-panel-DTxo0HRg.cjs} +1 -1
  101. package/dist/{shared-json-ld-DUBQa4Td.js → shared-json-ld-CDQKtky3.js} +46 -46
  102. package/dist/{shared-json-ld-Wgwndrv1.cjs → shared-json-ld-CgF2Si7b.cjs} +1 -1
  103. package/dist/{slug-input-BwWsAZWy.cjs → slug-input-BvIplRdd.cjs} +1 -1
  104. package/dist/{slug-input-Dpgn_HRd.js → slug-input-P-CLfUrw.js} +1 -1
  105. package/dist/supabase-actions.cjs +1 -1
  106. package/dist/supabase-actions.js +1 -1
  107. package/dist/{take-over-request-477jyIub.cjs → take-over-request-BDHFsfIR.cjs} +1 -1
  108. package/dist/{take-over-request-Cla8KuMu.js → take-over-request-mIiTaYST.js} +5 -5
  109. package/dist/{translation-warning-modal-CiXMjMs-.cjs → translation-warning-modal-Bc2i-0YG.cjs} +1 -1
  110. package/dist/{translation-warning-modal-Blylw0Uc.js → translation-warning-modal-BdkToZwn.js} +1 -1
  111. package/dist/{unmark-as-template-Co-3oGGQ.cjs → unmark-as-template-Bf9f4L0-.cjs} +1 -1
  112. package/dist/{unmark-as-template-TjtqlqKG.js → unmark-as-template-D1o7Vm_F.js} +2 -2
  113. package/dist/{unpublish-page-VTYcfZO9.js → unpublish-page-BWnyAdo3.js} +2 -2
  114. package/dist/{unpublish-page-C4v2-E5K.cjs → unpublish-page-YPMIqjta.cjs} +1 -1
  115. package/dist/{unpublished-partials-modal-D1HuPwGr.cjs → unpublished-partials-modal-i1oOnrgA.cjs} +1 -1
  116. package/dist/{unpublished-partials-modal-D6rkb_MK.js → unpublished-partials-modal-p_0N6V23.js} +1 -1
  117. package/dist/{web-preview-DjkWh678.js → web-preview-DN7QMzca.js} +1 -1
  118. package/dist/{web-preview-DNCFZBu2.cjs → web-preview-gmOwlKZr.cjs} +1 -1
  119. package/package.json +1 -1
  120. package/dist/ai-panel-content-C39F2hj1.cjs +0 -1
  121. package/dist/ai-panel-content-tDE696c-.js +0 -62
  122. package/dist/ai-prompt-input-Dcekb4u6.js +0 -652
  123. package/dist/ai-prompt-input-V0noWeHd.cjs +0 -1
  124. package/dist/apply-binding-BuwI_Uf5.cjs +0 -41
  125. package/dist/index-tI1JCogc.cjs +0 -5
@@ -0,0 +1,41 @@
1
+ "use strict";var ut=Object.defineProperty;var pt=(t,s,e)=>s in t?ut(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var _=(t,s,e)=>pt(t,typeof s!="symbol"?s+"":s,e);const k=require("./STRINGS-FNnfjF5H.cjs"),N=require("./common-functions-B3a4xKt_.cjs"),a=require("lodash-es"),$=require("himalaya"),z=require("./core-czmLeR0h.cjs"),dt=require("tailwind-merge"),X=t=>{if(t=t.replace(k.STYLES_KEY,""),!t)return{baseClasses:"",classes:""};const s=t.split(/,(?![^\[]*\])/);if(s.length===1)return{baseClasses:"",classes:s[0].trim()};const[e,...n]=s;return{baseClasses:e.trim(),classes:n.join(",").trim().replace(/ +(?= )/g,"")}};function ht(t,s,e){const n=a.get(e,"i18nProps",[]);if(a.isEmpty(s)||a.isEmpty(n))return t;const i=a.cloneDeep(t);return a.forEach(a.keys(i),r=>{if(a.includes(n,r)&&!a.isEmpty(s)){const o=a.get(i,r),l=a.get(i,`${r}-${s}`,"");a.isString(o)?i[r]=a.isString(l)&&!a.isEmpty(l.trim())&&l.trimStart()||o:i[r]=a.isEmpty(l)?o:l}}),i}const Z=(t,s)=>{const{baseClasses:e,classes:n}=X(t),r=n.split(" ").filter(l=>l.startsWith(k.DESIGN_TOKEN_PREFIX)).map(l=>{var p;return(p=s[l])==null?void 0:p.value}),o=n.split(" ").filter(l=>!l.startsWith(k.DESIGN_TOKEN_PREFIX)).join(" ");return dt.twMerge.apply(null,[e,...r,o])};function gt(t,s){return a.get(t,`${s}_attrs`,{})}function yt(t,s=!0,e={}){const n={};return Object.keys(t).forEach(i=>{if(a.isString(t[i])&&t[i].startsWith(k.STYLES_KEY)){const r=Z(t[i],e),o=gt(t,i);n[i]={...!a.isEmpty(r)&&{className:r},...o,...s?{"data-style-prop":i,"data-block-parent":t._id,"data-style-id":`${i}-${t._id}`}:{}}}}),n}const ft=a.memoize(t=>{var i;const s=z.getRegisteredChaiBlock(t),e=((i=s==null?void 0:s.props)==null?void 0:i.schema)||((s==null?void 0:s.schema)??{}),n=a.get(e,"properties",{});return Object.fromEntries(Object.entries(n).filter(([,r])=>a.get(r,"runtime",!1)))}),mt=(t,s)=>{if(!a.isArray(t))return t;let e=t,n;return typeof s.limit=="number"&&s.limit>0&&(n=s.limit),n!==void 0&&(e=e.slice(0,n)),e},_t=(t,s)=>{const e=a.cloneDeep(t);return a.forEach(a.keys(e),n=>{if(a.isString(e[n])&&!a.startsWith(n,"_")){let i=e[n];n==="repeaterItems"&&(e.repeaterItemsBinding=i);const r=/\{\{(.*?)\}\}/g,o=i.match(r);o&&o.forEach(l=>{let p=l.slice(2,-2);const c=a.get(s,p,l);i=a.isArray(c)?c:i.replace(l,c)}),e[n]=i}}),e},xt=t=>{const s=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,e=/(?:https?:\/\/)?(?:www\.)?(player)?.vimeo\.com/;return s.test(t)||e.test(t)},bt=t=>{if(a.isEmpty(t))return t;const s=/<video[^>]+src=['"]([^'">]+)['"]/,e=/<iframe[^>]+src=['"]([^'">]+)['"]/,n=t.match(s),i=t.match(e),r=n?n[1]:i?i[1]:null,o=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,l=/(?:https?:\/\/)?(?:www\.)?player.vimeo\.com/;return r&&(o.test(r)||l.test(r))?r:t},J=["chai-name","data-chai-name"],kt={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"}},Tt=(t,s)=>{var e;return((e=t.children)==null?void 0:e.length)===1&&a.includes(["Heading","Paragraph","Span","ListItem","Button","Label","TableCell","Link","RichText"],s._type)},A=t=>t.map(s=>s.type==="text"?a.get(s,"content",""):a.isEmpty(s.children)?"":A(s.children||[])).join(""),D=t=>t===null?"":t,Q=t=>{const s=a.compact(a.map(t.split(/\s+/),a.trim)),e=a.find(s,l=>/^w-/.test(l)),n=a.find(s,l=>/^h-/.test(l));if(!n||!e)return{height:"",width:""};const i=l=>{if(!l)return;const p=l.match(/^[wh]-(?:\[(.*?)\]|(.+))$/);if(!p)return;if(p[1])return p[1];const c=p[2];return/^\d+(\.\d+)?$/.test(c)?`${Number(c)*4}px`:c==="auto"||a.includes(c,"%")?c:"16px"},r=i(e),o=i(n);return{width:a.includes(r,"px")?r:"16px",height:a.includes(o,"px")?o:"16px"}},G=t=>{if(t.tagName==="svg")return{};const s={},e=kt[t.tagName||""]||{},n=t.attributes||[];return a.forEach(n,({key:i,value:r})=>{var o;if(!a.includes(J,i))if(i==="bid"&&(s._bid=D(r)),e[i]){if(t.tagName==="img"&&i==="src"&&!r.startsWith("http")){const l=a.find(t.attributes,{key:"width"}),p=a.find(t.attributes,{key:"height"});l&&p?r=`https://picsum.photos/${l==null?void 0:l.value}x${p==null?void 0:p.value}`:r="https://picsum.photos/150x150"}else if(t.tagName==="a"){const l=a.find(t.attributes,{key:"href"});l&&typeof(l==null?void 0:l.value)=="string"&&((o=l==null?void 0:l.value)!=null&&o.startsWith("pageType:"))&&a.set(s,"link.type","pageType")}a.set(s,e[i],D(r))}else a.includes(["style","class","srcset","bid"],i)||(s.styles_attrs=s.styles_attrs||{},a.startsWith(i,"@")&&(i=i.replace("@","x-on:")),s.styles_attrs[`${i}`]=D(r))}),delete s.class,s},St=(t,s="styles")=>{if(!t.attributes)return{[s]:`${k.STYLES_KEY},`};const e=a.find(t.attributes,{key:"class"});if(e){const n=e.value;return{[s]:`${k.STYLES_KEY},${n}`}}return{[s]:`${k.STYLES_KEY},`}},vt=t=>{const s=a.get(t,"attributes",[]),e=s.find(c=>c.key==="data-chai-richtext"||c.key==="chai-richtext"),n=s.find(c=>c.key==="data-chai-lightbox"||c.key==="chai-lightbox"),i=s.find(c=>c.key==="data-chai-dropdown"||c.key==="chai-dropdown"),r=s.find(c=>c.key==="data-chai-dropdown-button"||c.key==="chai-dropdown-button"),o=s.find(c=>c.key==="data-chai-dropdown-content"||c.key==="chai-dropdown-content"),l=s.find(c=>c.key==="class"),p=l&&l.value.split(/\s+/).includes("rte");if(i)return{_type:"Dropdown"};if(r)return{_type:"DropdownButton"};if(o)return{_type:"DropdownContent"};if(e||p)return{_type:"Paragraph"};if(n)return{_type:"LightBoxLink"};switch(t.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:t.tagName,_listType:t.tagName==="ol"?"list-decimal":"list-none"};case"li":case"dt":return{_type:"ListItem",tag:t.tagName};case"span":case"figcaption":case"legend":return{_type:"Span",tag:t.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:t.tagName};case"table":return{_type:"Table"};case"tr":return{_type:"TableRow"};case"td":case"th":return{_type:"TableCell",tag:t.tagName};case"thead":return{_type:"TableHead"};case"tbody":return{_type:"TableBody"};case"tfoot":return{_type:"TableFooter"};default:{const c=a.get(t,"children",[]).length>0?"Box":"EmptyBox";return{_type:c,tag:t.tagName,_name:c=="EmptyBox"||t.tagName==="div"?c:a.capitalize(t.tagName)}}}},P=(t,s=null)=>a.flatMapDeep(t,e=>{var v,x,S,T,w,Y,M,q,H,O;if(e.type==="comment")return[];let n={_id:N.generateUUID()};if(s&&(n._parent=s.block._id),e.type==="text")return a.isEmpty(a.get(e,"content",""))?[]:s&&Tt(s.node,s.block)?(a.set(s,"block.content",a.get(e,"content","")),[]):{...n,_type:"Text",content:a.get(e,"content","")};if(a.startsWith(e.tagName,"chai-")){const u=e.attributes||[],d=a.find(u,{key:"chai-type"}),g=(d==null?void 0:d.value)||a.startCase(a.camelCase(e.tagName||"")).replace(/ /g,"").replace(/\s+/g,"");n._type=g,a.forEach(u,({key:b,value:V})=>{if(b==="about-this-component"||b==="chai-type"||b==="can-move"||b==="can-delete")return;if(b==="id"){n._id=V;return}const ct=a.startsWith(b,"_")?b:a.camelCase(b);let B=D(V);typeof B=="string"&&a.startsWith(B,"#styles:")&&(B=B.replace("#styles:","#styles:,")),n[ct]=B});const m=P(e.children||[],{block:n,node:e});return[n,...m]}const i=a.get(e,"attributes",[]),r=e.tagName==="p"||i.find(u=>u.key==="data-chai-richtext"||u.key==="chai-richtext"),o=i.find(u=>u.key==="class"),l=o&&o.value.split(/\s+/).includes("rte"),p=i.find(u=>u.key==="data-chai-lightbox"||u.key==="chai-lightbox"),c=i.find(u=>u.key==="data-chai-dropdown"||u.key==="chai-dropdown"),f=i.find(u=>u.key==="data-chai-dropdown-button"||u.key==="chai-dropdown-button"),h=i.find(u=>u.key==="data-chai-dropdown-content"||u.key==="chai-dropdown-content");if(n={...n,...vt(e),...G(e),...St(e)},e.attributes){const u=e.attributes.find(d=>a.includes(J,d.key));u&&(n._name=u.value)}if(r||l)return n.content=`<p>${$.stringify(e.children||[])}</p>`,a.has(n,"styles_attrs.data-chai-richtext")&&delete n.styles_attrs["data-chai-richtext"],a.has(n,"styles_attrs.chai-richtext")&&delete n.styles_attrs["chai-richtext"],[n];if(p){const u=["data-chai-lightbox","chai-lightbox","data-vbtype","data-autoplay","data-maxwidth","data-overlay","data-gall","href"];n={...n,href:((v=i.find(d=>d.key==="href"))==null?void 0:v.value)||"",hrefType:((x=i.find(d=>d.key==="data-vbtype"))==null?void 0:x.value)||"video",autoplay:((S=i.find(d=>d.key==="data-autoplay"))==null?void 0:S.value)==="true"?"true":"false",maxWidth:((w=(T=i.find(d=>d.key==="data-maxwidth"))==null?void 0:T.value)==null?void 0:w.replace("px",""))||"",backdropColor:((Y=i.find(d=>d.key==="data-overlay"))==null?void 0:Y.value)||"",galleryName:((M=i.find(d=>d.key==="data-gall"))==null?void 0:M.value)||""},a.forEach(u,d=>{a.has(n,`styles_attrs.${d}`)&&delete n.styles_attrs[d]})}if(c&&(delete n.styles_attrs,n.showDropdown=!1),h&&delete n.styles_attrs,f){delete n.styles_attrs;const u=a.filter(e.children||[],g=>(g==null?void 0:g.tagName)!=="span");n.content=A(u);const d=a.find(e.children||[],g=>(g==null?void 0:g.tagName)==="span"&&a.some(g.children||[],m=>(m==null?void 0:m.tagName)==="svg"));if(d){const g=a.find(d.children||[],m=>(m==null?void 0:m.tagName)==="svg");if(g){n.icon=$.stringify([g]);const{height:m,width:b}=wt(g,"16px","16px");n.iconHeight=m,n.iconWidth=b}}return[n]}if(n._type==="Input"){const u=n.inputType||"text";u==="checkbox"?a.set(n,"_type","Checkbox"):u==="radio"&&a.set(n,"_type","Radio")}else if(e.tagName==="video"||e.tagName==="iframe"){const u=$.stringify([e]);return xt(u)&&(a.set(n,"_type","Video"),a.set(n,"url",bt(u)),a.set(n,"styles",`${k.STYLES_KEY},`),a.set(n,"controls",{autoPlay:!1,muted:!0,loop:!1,controls:!1})),n.content=u,[n]}else if(e.tagName==="svg"){const u=a.get(a.find(e.attributes,{key:"class"}),"value",""),{height:d,width:g}=Q(u);if(d&&g)n.styles=`${k.STYLES_KEY}, ${N.cn(`w-${g} h-${d}`,u)}`.trim(),n.height=d==null?void 0:d.replace("px",""),n.width=g==null?void 0:g.replace("px","");else{const m=(q=a.find(e.attributes,{key:"height"}))==null?void 0:q.value,b=(H=a.find(e.attributes,{key:"width"}))==null?void 0:H.value;m&&b?(n.styles=`${k.STYLES_KEY}, ${N.cn(`w-[${b}px] h-[${m}px]`,u)}`.trim(),n.height=m,n.width=b):n.styles=`${k.STYLES_KEY}, ${N.cn("w-full h-full",u)}`.trim()}return e.attributes=a.filter(e.attributes,m=>!a.includes(["style","width","height","class"],m.key)),n.icon=$.stringify([e]),[n]}else if(e.tagName=="option"&&s&&((O=s.block)==null?void 0:O._type)==="Select")return s.block.options.push({label:A(e.children||[]),...G(e)}),[];const y=P(e.children||[],{block:n,node:e});return[n,...y]}),wt=(t,s,e)=>{var p,c;const n=a.get(t,"attributes",[]),{height:i,width:r}=Q(a.get(a.find(n,{key:"class"}),"value",""));if(i&&r)return{height:`[${i}px]`,width:`[${r}px]`};const o=(p=a.find(n,{key:"height"}))==null?void 0:p.value,l=(c=a.find(n,{key:"width"}))==null?void 0:c.value;return{height:o?`[${o}px]`:e,width:l?`[${l}px]`:s}},Bt=t=>{t=t.replace(/(\w+)=\\?"(.*?)\\?"/g,(n,i,r)=>{let o=r.replace(/\\"/g,'"');return o=o.replace(/{([^}]+)}/g,l=>l.replace(/"/g,'\\"')),`${i}="${o.replace(/\\"/g,'"')}"`}),t=t.replace(/\\n/g," ").replace(/\\\\/g,"").replace(/\\([/<>])/g,"$1").replace(/\\./g,"").replace(/[\n\r\t\f\v]/g," "),t=t.replace(/\$name="[^"]*"/g,"");const s=t.match(/<body[^>]*>[\s\S]*?<\/body>/);return(s&&s.length>0?s[0].replace(/<body/,"<div").replace(/<\/body>/,"</div>"):t).replace(/\s+/g," ").replaceAll("> <","><").replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").trim()},Et=(t,s)=>a.find(t,{_id:s}),$t=(t,s)=>a.isEmpty(s)?t.map(e=>(a.unset(e,"_bid"),e)):a.map(t,e=>{const n=a.isEmpty(e._bid)?void 0:Et(s,e._bid);if(n){n._type==="Icon"&&a.get(e,"icon","").match(/chai-default-svg/)&&delete e.icon;const i={...n,...e};return a.unset(i,"_bid"),i}return a.unset(e,"_bid"),e}),Nt=t=>{const s=$.parse(Bt(t));if(a.isEmpty(t))return[];const e=a.flatten(P(s));return z.syncBlocksWithDefaultProps(e)},It=(t,s)=>t.map(e=>{const n=a.keys(e).filter(i=>a.isString(e[i])&&e[i].startsWith(k.STYLES_KEY));return a.each(n,i=>{e[i]=`${k.STYLES_KEY},${Z(e[i],s)}`}),e}),Ct=t=>{const s=a.last(t);return t.map(e=>{const n=Object.keys(e);for(let i=0;i<n.length;i++)if(a.isString(e[n[i]])&&a.startsWith(n[i],"content")){const r=e===s?"":" ";e[n[i]]=`${e[n[i]].trim()}${r}`}return e})};var j=class extends Error{constructor(t){super(t),this.name="Eta Error"}},tt=class extends j{constructor(t){super(t),this.name="EtaParser Error"}},Lt=class extends j{constructor(t){super(t),this.name="EtaRuntime Error"}},Wt=class extends j{constructor(t){super(t),this.name="EtaNameResolution Error"}};function E(t,s,e){let n=s.slice(0,e).split(/\n/),i=n.length,r=n[i-1].length+1;throw t+=" at line "+i+" col "+r+`:
2
+
3
+ `+s.split(/\n/)[i-1]+`
4
+ `+Array(r).join(" ")+"^",new tt(t)}function Dt(t,s,e,n){let i=s.split(`
5
+ `),r=Math.max(e-3,0),o=Math.min(i.length,e+3),l=n,p=i.slice(r,o).map((f,h)=>{let y=h+r+1;return(y===e?" >> ":" ")+y+"| "+f}).join(`
6
+ `),c=new Lt((l?l+":"+e+`
7
+ `:"line "+e+`
8
+ `)+p+`
9
+
10
+ `+t.message);throw c.name=t.name,c.cause=t,c}const At=(async()=>{}).constructor;function Pt(t,s){let e=this.config,n=s!=null&&s.async?At:Function;try{return new n(e.varName,"options",this.compileToString.call(this,t,s))}catch(i){throw i instanceof SyntaxError?new tt(`Bad template syntax
11
+
12
+ `+i.message+`
13
+ `+Array(i.message.length+1).join("=")+`
14
+ `+this.compileToString.call(this,t,s)+`
15
+ `):i}}function Ft(t,s){let e=this.config,n=s==null?void 0:s.async,i=this.compileBody,r=this.parse.call(this,t),o=`${e.functionHeader}
16
+ let include = (__eta_t, __eta_d) => this.render(__eta_t, {...${e.varName}, ...(__eta_d ?? {})}, options);
17
+ let includeAsync = (__eta_t, __eta_d) => this.renderAsync(__eta_t, {...${e.varName}, ...(__eta_d ?? {})}, options);
18
+
19
+ let __eta = {res: "", e: this.config.escapeFunction, f: this.config.filterFunction${e.debug?', line: 1, templateStr: "'+t.replace(/\\|"/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n")+'"':""}};
20
+
21
+ function layout(path, data) {
22
+ __eta.layout = path;
23
+ __eta.layoutData = data;
24
+ }${e.debug?"try {":""}${e.useWith?"with("+e.varName+"||{}){":""}
25
+
26
+ function ${e.outputFunctionName}(s){__eta.res+=s;}
27
+
28
+ ${i.call(this,r)}
29
+ if (__eta.layout) {
30
+ __eta.res = ${n?"await includeAsync":"include"} (__eta.layout, {...${e.varName}, body: __eta.res, ...__eta.layoutData});
31
+ }
32
+ ${e.useWith?"}":""}${e.debug?"} catch (e) { this.RuntimeErr(e, __eta.templateStr, __eta.line, options.filepath) }":""}
33
+ return __eta.res;
34
+ `;if(e.plugins)for(let l=0;l<e.plugins.length;l++){let p=e.plugins[l];p.processFnString&&(o=p.processFnString(o,e))}return o}function Rt(t){let s=this.config,e=0,n=t.length,i="";for(;e<n;e++){let r=t[e];if(typeof r=="string")i+="__eta.res+='"+r+`';
35
+ `;else{let o=r.t,l=r.val||"";s.debug&&(i+="__eta.line="+r.lineNo+`
36
+ `),o==="r"?(s.autoFilter&&(l="__eta.f("+l+")"),i+="__eta.res+="+l+`;
37
+ `):o==="i"?(s.autoFilter&&(l="__eta.f("+l+")"),s.autoEscape&&(l="__eta.e("+l+")"),i+="__eta.res+="+l+`;
38
+ `):o==="e"&&(i+=l+`
39
+ `)}}return i}function jt(t,s,e,n){let i,r;return Array.isArray(s.autoTrim)?(i=s.autoTrim[1],r=s.autoTrim[0]):i=r=s.autoTrim,(e||e===!1)&&(i=e),(n||n===!1)&&(r=n),!r&&!i?t:i==="slurp"&&r==="slurp"?t.trim():(i==="_"||i==="slurp"?t=t.trimStart():(i==="-"||i==="nl")&&(t=t.replace(/^(?:\r\n|\n|\r)/,"")),r==="_"||r==="slurp"?t=t.trimEnd():(r==="-"||r==="nl")&&(t=t.replace(/(?:\r\n|\n|\r)$/,"")),t)}const Yt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Mt(t){return Yt[t]}function qt(t){let s=String(t);return/[&<>"']/.test(s)?s.replace(/[&<>"']/g,Mt):s}const K={autoEscape:!0,autoFilter:!1,autoTrim:[!1,"nl"],cache:!1,cacheFilepaths:!0,debug:!1,escapeFunction:qt,filterFunction:t=>String(t),outputFunctionName:"output",functionHeader:"",parse:{exec:"",interpolate:"=",raw:"~"},plugins:[],rmWhitespace:!1,tags:["<%","%>"],useWith:!1,varName:"it",defaultExtension:".eta"},I=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,C=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,L=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g;function W(t){return t.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&")}function Ht(t,s){return t.slice(0,s).split(`
40
+ `).length}function Ot(t){let s=this.config,e=[],n=!1,i=0,r=s.parse;if(s.plugins)for(let h=0;h<s.plugins.length;h++){let y=s.plugins[h];y.processTemplate&&(t=y.processTemplate(t,s))}s.rmWhitespace&&(t=t.replace(/[\r\n]+/g,`
41
+ `).replace(/^\s+|\s+$/gm,"")),I.lastIndex=0,C.lastIndex=0,L.lastIndex=0;function o(h,y){h&&(h=jt(h,s,n,y),h&&(h=h.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),e.push(h)))}let l=[r.exec,r.interpolate,r.raw].reduce((h,y)=>h&&y?h+"|"+W(y):y?W(y):h,""),p=RegExp(W(s.tags[0])+"(-|_)?\\s*("+l+")?\\s*","g"),c=RegExp("'|\"|`|\\/\\*|(\\s*(-|_)?"+W(s.tags[1])+")","g"),f;for(;f=p.exec(t);){let h=t.slice(i,f.index);i=f[0].length+f.index;let y=f[1],v=f[2]||"";o(h,y),c.lastIndex=i;let x,S=!1;for(;x=c.exec(t);)if(x[1]){let T=t.slice(i,x.index);p.lastIndex=i=c.lastIndex,n=x[2],S={t:v===r.exec?"e":v===r.raw?"r":v===r.interpolate?"i":"",val:T};break}else{let T=x[0];if(T==="/*"){let w=t.indexOf("*/",c.lastIndex);w===-1&&E("unclosed comment",t,x.index),c.lastIndex=w}else T==="'"?(C.lastIndex=x.index,C.exec(t)?c.lastIndex=C.lastIndex:E("unclosed string",t,x.index)):T==='"'?(L.lastIndex=x.index,L.exec(t)?c.lastIndex=L.lastIndex:E("unclosed string",t,x.index)):T==="`"&&(I.lastIndex=x.index,I.exec(t)?c.lastIndex=I.lastIndex:E("unclosed string",t,x.index))}S?(s.debug&&(S.lineNo=Ht(t,f.index)),e.push(S)):E("unclosed tag",t,f.index)}if(o(t.slice(i,t.length),!1),s.plugins)for(let h=0;h<s.plugins.length;h++){let y=s.plugins[h];y.processAST&&(e=y.processAST(e,s))}return e}function et(t,s){let e=s!=null&&s.async?this.templatesAsync:this.templatesSync;if(this.resolvePath&&this.readFile&&!t.startsWith("@")){let n=s.filepath,i=e.get(n);if(this.config.cache&&i)return i;{let r=this.readFile(n),o=this.compile(r,s);return this.config.cache&&e.define(n,o),o}}else{let n=e.get(t);if(n)return n;throw new Wt(`Failed to get template '${t}'`)}}function st(t,s,e){let n,i={...e,async:!1};return typeof t=="string"?(this.resolvePath&&this.readFile&&!t.startsWith("@")&&(i.filepath=this.resolvePath(t,i)),n=et.call(this,t,i)):n=t,n.call(this,s,i)}function nt(t,s,e){let n,i={...e,async:!0};typeof t=="string"?(this.resolvePath&&this.readFile&&!t.startsWith("@")&&(i.filepath=this.resolvePath(t,i)),n=et.call(this,t,i)):n=t;let r=n.call(this,s,i);return Promise.resolve(r)}function Vt(t,s){let e=this.compile(t,{async:!1});return st.call(this,e,s)}function Gt(t,s){let e=this.compile(t,{async:!0});return nt.call(this,e,s)}var U=class{constructor(t){this.cache=t}define(t,s){this.cache[t]=s}get(t){return this.cache[t]}remove(t){delete this.cache[t]}reset(){this.cache={}}load(t){this.cache={...this.cache,...t}}},Kt=class{constructor(t){_(this,"config");_(this,"RuntimeErr",Dt);_(this,"compile",Pt);_(this,"compileToString",Ft);_(this,"compileBody",Rt);_(this,"parse",Ot);_(this,"render",st);_(this,"renderAsync",nt);_(this,"renderString",Vt);_(this,"renderStringAsync",Gt);_(this,"filepathCache",{});_(this,"templatesSync",new U({}));_(this,"templatesAsync",new U({}));_(this,"resolvePath",null);_(this,"readFile",null);t?this.config={...K,...t}:this.config={...K}}configure(t){this.config={...this.config,...t}}withConfig(t){return{...this,config:{...this.config,...t}}}loadTemplate(t,s,e){if(typeof s=="string")(e!=null&&e.async?this.templatesAsync:this.templatesSync).define(t,this.compile(s,e));else{let n=this.templatesSync;(s.constructor.name==="AsyncFunction"||e!=null&&e.async)&&(n=this.templatesAsync),n.define(t,s)}}},at=class extends Kt{};const F=/\{\{(.*?)\}\}/g,rt=/^[\w$][\w$.]*$/,Ut=new at({tags:["{{","}}"],autoEscape:!0,autoTrim:!1,useWith:!0,parse:{interpolate:"",exec:"~",raw:"~"},functionHeader:'const safeGet = (obj, path) => { const parts = path.split("."); let val = obj; for (const p of parts) { if (val == null) return undefined; val = val[p]; } return val; };'}),lt=(t,s,e)=>{const n=e.slice(2,-2).trim();return s!==-1&&a.startsWith(t,"$index.")?`${n}.${s}.${t.slice(7)}`:s!==-1&&a.startsWith(t,"$index")?`${n}.${s}`:t},zt=(t,s,e)=>{if(s===-1||!e)return t;const n=e.slice(2,-2).trim();return t.replace(/\$index\./g,`safeGet(it, "${n}.${s}").`).replace(/\$index/g,`safeGet(it, "${n}.${s}")`)},Xt=(t,s,e)=>t.replace(F,(n,i)=>{const r=i.trim();return r?rt.test(r)?`{{safeGet(it, "${lt(r,s,e)}") ?? ""}}`:`{{${zt(r,s,e)}}}`:'{{""}}'}),Zt=(t,s,e,n)=>{try{return Ut.renderString(Xt(t,e,n),s)}catch{return""}},ot=(t,s,e,n,i)=>{F.lastIndex=0;const r=t.match(F);if(!r)return t;const o=i==="image"||i==="mobileImage";for(const l of r){const p=l.slice(2,-2).trim();if(!rt.test(p))continue;const c=lt(p,e,n),f=a.get(s,c);if(a.isArray(f)||o&&f!==void 0)return f}return Zt(t,s,e,n)},Jt=(t,s)=>ot(t,s,-1,""),R=(t,s,{index:e,key:n},i)=>{if(a.isString(t))return ot(t,s,e,n,i);if(a.isArray(t))return t.map(r=>R(r,s,{index:e,key:n},i));if(t&&typeof t=="object"){const r={};return a.forEach(a.keys(t),o=>{!a.startsWith(o,"_")&&o!=="$repeaterItemsKey"?r[o]=R(t[o],s,{index:e,key:n},o):r[o]=t[o]}),r}return t},Qt=(t,s,{index:e,key:n})=>{let i=a.cloneDeep(t);return i.repeaterItems&&(i.$repeaterItemsKey=i.repeaterItems,a.startsWith(i.repeaterItems,`{{${k.COLLECTION_PREFIX}`)&&(i.$repeaterItemsKey=i.repeaterItems=`${i.repeaterItems.replace("}}",`/${i._id}}}`)}`),!a.isEmpty(i.repeaterItems)&&i.pagination&&(i.repeaterTotalItems=`${i.repeaterItems.replace("}}",`/${i._id}/totalItems}}`)}`)),R(i,s,{index:e,key:n})};exports.adjustSpacingInContentBlocks=Ct;exports.applyBindingToBlockProps=Qt;exports.applyChaiDataBinding=_t;exports.applyDesignTokens=It;exports.applyLanguage=ht;exports.applyLimit=mt;exports.getBlockRuntimeProps=ft;exports.getBlockTagAttributes=yt;exports.getBlocksFromHTML=Nt;exports.getSplitChaiClasses=X;exports.k=at;exports.mergeBlocksWithExisting=$t;exports.resolveBinding=Jt;
@@ -89,8 +89,9 @@ function Ee(t, s = !0, e = {}) {
89
89
  }), a;
90
90
  }
91
91
  const Ie = It((t) => {
92
- const s = Ht(t), e = y(s, "schema.properties", {});
93
- return Object.fromEntries(Object.entries(e).filter(([, a]) => y(a, "runtime", !1)));
92
+ var n;
93
+ const s = Ht(t), e = ((n = s == null ? void 0 : s.props) == null ? void 0 : n.schema) || ((s == null ? void 0 : s.schema) ?? {}), a = y(e, "properties", {});
94
+ return Object.fromEntries(Object.entries(a).filter(([, r]) => y(r, "runtime", !1)));
94
95
  }), Ce = (t, s) => {
95
96
  if (!q(t)) return t;
96
97
  let e = t, a;
@@ -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 q, f as O, g as z, o as B, p as f, q as H } from "./index-CGZjCAyz.js";
4
- import { ap as I, aq as M, A as E, ax as R } from "./index-D2xHSM7d.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-RwAuF_BE.js";
4
+ import { ao as I, ap as M, A as E, aw as R } from "./index-nVkLHaAS.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,11 +76,11 @@ const K = () => {
76
76
  }
77
77
  );
78
78
  };
79
- return /* @__PURE__ */ s(T, { open: a, onOpenChange: l, children: /* @__PURE__ */ s(q, { 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: [
83
+ /* @__PURE__ */ t(q, { children: [
84
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
  ] }),
@@ -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-ZaKz5cWo.cjs"),u=require("./index-tI1JCogc.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-DrzR7vXl.cjs"),u=require("./index-DAJ9bufO.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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("./index-ZaKz5cWo.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-DrzR7vXl.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,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-CGZjCAyz.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-RwAuF_BE.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 e=require("react/jsx-runtime"),i=require("./register-chai-top-bar-DyW9GPzV.cjs"),s=require("./index-ZaKz5cWo.cjs"),a=require("./index-tI1JCogc.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-DrzR7vXl.cjs"),a=require("./index-DAJ9bufO.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,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-CGZjCAyz.js";
4
- import { b as d, B as h } from "./index-D2xHSM7d.js";
3
+ import { J as o, K as c, M as i, O as l, Q as m } from "./index-RwAuF_BE.js";
4
+ import { b as d, B as h } from "./index-nVkLHaAS.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 = () => {
package/dist/core.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-ZaKz5cWo.cjs"),r=require("./common-functions-B3a4xKt_.cjs"),i=require("./apply-binding-BuwI_Uf5.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-DrzR7vXl.cjs"),r=require("./common-functions-B3a4xKt_.cjs"),i=require("./apply-binding-CBSjMYSk.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.js CHANGED
@@ -1,7 +1,7 @@
1
- import { b6 as s, aZ as r, b5 as i, b7 as o, a_ as t, a$ as l, b0 as C, aX as h, aK as g, b8 as u, b9 as d, ba as n, b1 as c, b2 as b, aL as B, b3 as k, b4 as S, aM as p, aO as m, bc as T, bb as L, ah as F, ak as A, bd as M, V as I, d as P, ai as f, F as E, U as H, W as x } from "./index-CGZjCAyz.js";
1
+ import { b6 as s, aZ as r, b5 as i, b7 as o, a_ as t, a$ as l, b0 as C, aX as g, aK as h, b8 as u, b9 as d, ba as n, b1 as c, b2 as b, aL as B, b3 as k, b4 as S, aM as p, aO as m, bc as T, bb as L, ab as F, ae as A, bd as I, s as M, d as P, ac as f, I as E, r as H, t as x } from "./index-RwAuF_BE.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-RQRSIe56.js";
4
- import { A as N, C as w, I as K, R as V, k as W, o as X, c as j, a as q, b as z, r as J, e as Z, f as $, j as G, m as Q, p as Y, 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 _, g as O } from "./apply-binding-vAuN-TGV.js";
4
+ import { A as N, C as w, I as K, R as X, k as j, o as q, c as z, a as J, b as V, r as W, e as Z, f as $, j as G, m as Q, p as Y, 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 ga, n as ha, 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
6
  import { default as ka } from "i18next";
7
7
  export {
@@ -14,8 +14,8 @@ export {
14
14
  t as ChaiBlockPropsEditor,
15
15
  l as ChaiBlockStyleEditor,
16
16
  C as ChaiBuilderCanvas,
17
- h as ChaiBuilderEditor,
18
- g as ChaiDarkModeSwitcher,
17
+ g as ChaiBuilderEditor,
18
+ h as ChaiDarkModeSwitcher,
19
19
  u as ChaiDefaultBlocks,
20
20
  d as ChaiDraggableBlock,
21
21
  n as ChaiExportCodeModal,
@@ -27,20 +27,20 @@ export {
27
27
  p as ChaiUndoRedo,
28
28
  K as IfChaiFeatureFlag,
29
29
  m as PERMISSIONS,
30
- V as RJSF_EXTENSIONS,
31
- U as convertHTMLToChaiBlocks,
30
+ X as RJSF_EXTENSIONS,
31
+ _ as convertHTMLToChaiBlocks,
32
32
  T as defaultChaiLibrary,
33
33
  v as generateBlockId,
34
- _ as getBlocksFromHTML,
35
- W as getChaiLibrary,
34
+ O as getBlocksFromHTML,
35
+ j as getChaiLibrary,
36
36
  L as getClassValueAndUnit,
37
- X as getPreImportHTML,
37
+ q as getPreImportHTML,
38
38
  ka as i18n,
39
39
  D as mergeClasses,
40
- j as registerChaiAddBlockTab,
41
- q as registerChaiBlockSettingField,
42
- z as registerChaiBlockSettingTemplate,
43
- J as registerChaiBlockSettingWidget,
40
+ z as registerChaiAddBlockTab,
41
+ J as registerChaiBlockSettingField,
42
+ V as registerChaiBlockSettingTemplate,
43
+ W as registerChaiBlockSettingWidget,
44
44
  Z as registerChaiFeatureFlag,
45
45
  $ as registerChaiFeatureFlags,
46
46
  G as registerChaiLibrary,
@@ -57,11 +57,11 @@ export {
57
57
  ta as useChaiFeatureFlag,
58
58
  la as useChaiFeatureFlags,
59
59
  Ca as useChaiLibraries,
60
- ha as useChaiSidebarPanels,
61
- M as useHtmlToBlocks,
62
- I as useI18nBlocks,
60
+ ga as useChaiSidebarPanels,
61
+ I as useHtmlToBlocks,
62
+ M as useI18nBlocks,
63
63
  P as useLanguages,
64
- ga as useMediaManagerComponent,
64
+ ha as useMediaManagerComponent,
65
65
  f as useReplaceBlock,
66
66
  E as useSavePage,
67
67
  ua as useSaveToLibraryComponent,
@@ -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-ZaKz5cWo.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-DrzR7vXl.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, o as E, p as D, T as I, q as A } from "./index-CGZjCAyz.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-RwAuF_BE.js";
4
4
  import "lodash-es";
5
5
  import * as b from "culori";
6
6
  import { a as P } from "./fonts-B3UYxuJI.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),b=require("./register-chai-top-bar-DyW9GPzV.cjs"),n=require("./index-ZaKz5cWo.cjs"),l=require("./index-tI1JCogc.cjs"),C=require("lodash-es"),f=require("react"),g=require("react-i18next"),S=(e,d)=>{const t=d.filter(m=>m.parent===e);if(t.length===0)return 0;let u=t.length;return t.forEach(m=>{u+=S(m.id,d)}),u};function U({page:e,onClose:d}){const{t}=g.useTranslation(),[,u]=l.useSearchParams(),{mutate:m,isPending:P}=l.useDeletePage(),{data:j}=l.usePageTypes(),{data:h=[]}=l.useWebsitePrimaryPages(),{setSelectedLang:E,fallbackLang:L}=n.useLanguages(),[,q]=n.useSidebarActivePanel(),c=!(e!=null&&e.primaryPage),{data:r=[]}=l.useLanguagePages(c?e==null?void 0:e.id:void 0),{data:y}=l.useSiteWideUsage(),v=f.useMemo(()=>C.isEmpty(e==null?void 0:e.slug),[e==null?void 0:e.slug]),w=f.useMemo(()=>{if(!v||!(e!=null&&e.id)||!y)return[];const i=[];return Object.entries(y).forEach(([o,D])=>{D.partialBlocks.includes(e.id)&&!D.isPartial&&i.push({id:o,name:D.name})}),i},[v,e.id,y]),N=f.useMemo(()=>!c||!r?0:r.filter(i=>i.id!==e.id).length,[c,r,e.id]),x=f.useMemo(()=>{if(!(e!=null&&e.id)||!h.length)return 0;let i=S(e.id,h);return c&&r&&r.length>0&&r.forEach(o=>{o.id!==e.id&&(i+=S(o.id,h))}),i},[e.id,h,c,r]),A=()=>{P||m(e,{onSuccess:()=>{e!=null&&e.primaryPage?(window.history.replaceState({},"",`/?page=${e.primaryPage}`),u(new URLSearchParams({page:e.primaryPage}))):(window.history.replaceState({},"","/"),u(new URLSearchParams)),window.dispatchEvent(new PopStateEvent("popstate")),E(L),q("outline"),d()}})},a=j==null?void 0:j.find(i=>i.key===(e==null?void 0:e.pageType));return s.jsx(n.Dialog,{open:!!e,onOpenChange:d,children:s.jsxs(n.DialogContent,{children:[s.jsxs(n.DialogHeader,{children:[s.jsx(n.DialogTitle,{children:t("Confirm Deletion")}),s.jsxs(n.DialogDescription,{className:"py-4 text-slate-500",children:[s.jsxs("div",{children:[t("Are you sure you want to remove")," ",s.jsx("b",{children:(e==null?void 0:e.name)??(e==null?void 0:e.slug)})," ",a!=null&&a.hasSlug?(a==null?void 0:a.name)+"?":t("page?")]}),c&&(N>0||x>0)&&s.jsxs("div",{className:"mt-3 rounded-md bg-red-50 p-3 text-sm",children:[s.jsxs("div",{className:"font-semibold text-red-800",children:[t("Warning: Deleting this primary page will also delete"),":"]}),s.jsxs("ul",{className:"mt-2 list-inside list-disc space-y-1 text-red-700",children:[x>0&&s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:x})," ",t(x===1?"nested child page":"nested child pages")]}),N>0&&s.jsx("li",{children:t("All associated language pages")})]})]}),v&&w.length>0&&s.jsxs("div",{className:"mt-3 rounded-md bg-red-50 p-3 text-sm",children:[s.jsxs("div",{className:"font-semibold text-red-800",children:[t("Warning: This partial is currently used in the following pages"),":"]}),s.jsx("ul",{className:"mt-2 list-inside list-disc space-y-1 text-red-700",children:w.map(({id:i,name:o})=>s.jsx("li",{children:s.jsx("span",{className:"font-medium",children:o})},i))})]}),e.lang&&s.jsxs("div",{className:"py-2 text-sm",children:[t("Language"),":"," ",s.jsx("span",{className:"font-medium text-gray-500",children:C.get(l.LANGUAGES,e.lang,e.lang)})]})]})]}),s.jsxs(n.DialogFooter,{children:[s.jsx(b.Button,{variant:"outline",onClick:d,children:t("Cancel")}),s.jsx(b.Button,{variant:"destructive",disabled:P,onClick:A,children:t(P?"Deleting...":"Delete")})]})]})})}exports.default=U;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),b=require("./register-chai-top-bar-DyW9GPzV.cjs"),n=require("./index-DrzR7vXl.cjs"),l=require("./index-DAJ9bufO.cjs"),C=require("lodash-es"),f=require("react"),g=require("react-i18next"),S=(e,d)=>{const t=d.filter(m=>m.parent===e);if(t.length===0)return 0;let u=t.length;return t.forEach(m=>{u+=S(m.id,d)}),u};function U({page:e,onClose:d}){const{t}=g.useTranslation(),[,u]=l.useSearchParams(),{mutate:m,isPending:P}=l.useDeletePage(),{data:j}=l.usePageTypes(),{data:h=[]}=l.useWebsitePrimaryPages(),{setSelectedLang:E,fallbackLang:L}=n.useLanguages(),[,q]=n.useSidebarActivePanel(),c=!(e!=null&&e.primaryPage),{data:r=[]}=l.useLanguagePages(c?e==null?void 0:e.id:void 0),{data:y}=l.useSiteWideUsage(),v=f.useMemo(()=>C.isEmpty(e==null?void 0:e.slug),[e==null?void 0:e.slug]),w=f.useMemo(()=>{if(!v||!(e!=null&&e.id)||!y)return[];const i=[];return Object.entries(y).forEach(([o,D])=>{D.partialBlocks.includes(e.id)&&!D.isPartial&&i.push({id:o,name:D.name})}),i},[v,e.id,y]),N=f.useMemo(()=>!c||!r?0:r.filter(i=>i.id!==e.id).length,[c,r,e.id]),x=f.useMemo(()=>{if(!(e!=null&&e.id)||!h.length)return 0;let i=S(e.id,h);return c&&r&&r.length>0&&r.forEach(o=>{o.id!==e.id&&(i+=S(o.id,h))}),i},[e.id,h,c,r]),A=()=>{P||m(e,{onSuccess:()=>{e!=null&&e.primaryPage?(window.history.replaceState({},"",`/?page=${e.primaryPage}`),u(new URLSearchParams({page:e.primaryPage}))):(window.history.replaceState({},"","/"),u(new URLSearchParams)),window.dispatchEvent(new PopStateEvent("popstate")),E(L),q("outline"),d()}})},a=j==null?void 0:j.find(i=>i.key===(e==null?void 0:e.pageType));return s.jsx(n.Dialog,{open:!!e,onOpenChange:d,children:s.jsxs(n.DialogContent,{children:[s.jsxs(n.DialogHeader,{children:[s.jsx(n.DialogTitle,{children:t("Confirm Deletion")}),s.jsxs(n.DialogDescription,{className:"py-4 text-slate-500",children:[s.jsxs("div",{children:[t("Are you sure you want to remove")," ",s.jsx("b",{children:(e==null?void 0:e.name)??(e==null?void 0:e.slug)})," ",a!=null&&a.hasSlug?(a==null?void 0:a.name)+"?":t("page?")]}),c&&(N>0||x>0)&&s.jsxs("div",{className:"mt-3 rounded-md bg-red-50 p-3 text-sm",children:[s.jsxs("div",{className:"font-semibold text-red-800",children:[t("Warning: Deleting this primary page will also delete"),":"]}),s.jsxs("ul",{className:"mt-2 list-inside list-disc space-y-1 text-red-700",children:[x>0&&s.jsxs("li",{children:[s.jsx("span",{className:"font-medium",children:x})," ",t(x===1?"nested child page":"nested child pages")]}),N>0&&s.jsx("li",{children:t("All associated language pages")})]})]}),v&&w.length>0&&s.jsxs("div",{className:"mt-3 rounded-md bg-red-50 p-3 text-sm",children:[s.jsxs("div",{className:"font-semibold text-red-800",children:[t("Warning: This partial is currently used in the following pages"),":"]}),s.jsx("ul",{className:"mt-2 list-inside list-disc space-y-1 text-red-700",children:w.map(({id:i,name:o})=>s.jsx("li",{children:s.jsx("span",{className:"font-medium",children:o})},i))})]}),e.lang&&s.jsxs("div",{className:"py-2 text-sm",children:[t("Language"),":"," ",s.jsx("span",{className:"font-medium text-gray-500",children:C.get(l.LANGUAGES,e.lang,e.lang)})]})]})]}),s.jsxs(n.DialogFooter,{children:[s.jsx(b.Button,{variant:"outline",onClick:d,children:t("Cancel")}),s.jsx(b.Button,{variant:"destructive",disabled:P,onClick:A,children:t(P?"Deleting...":"Delete")})]})]})})}exports.default=U;
@@ -1,7 +1,7 @@
1
1
  import { jsx as s, jsxs as t } from "react/jsx-runtime";
2
2
  import { B as L } from "./register-chai-top-bar-D6GjnauV.js";
3
- import { d as k, n as U, D as W, e as g, f as B, g as G, o as R, q as j } from "./index-CGZjCAyz.js";
4
- import { c as q, m as F, k as H, e as M, j as Q, n as T, L as $ } from "./index-D2xHSM7d.js";
3
+ import { d as k, n as U, D as W, e as g, f as B, g as G, o as R, q as j } from "./index-RwAuF_BE.js";
4
+ import { c as q, m as F, k as H, e as M, j as Q, n as T, L as $ } from "./index-nVkLHaAS.js";
5
5
  import { isEmpty as z, get as I } from "lodash-es";
6
6
  import { useMemo as f } from "react";
7
7
  import { useTranslation as J } from "react-i18next";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index-ZaKz5cWo.cjs"),L=require("./register-chai-top-bar-DyW9GPzV.cjs"),p=require("@radix-ui/react-icons"),q=require("lodash-es"),d=require("react"),w=require("react-i18next"),x=({title:n,items:a,emptyLabel:r,onSelect:t,icon:i})=>s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:n}),a.length>0?s.jsx("div",{className:"space-y-1",children:a.map(l=>s.jsx("button",{type:"button",onClick:()=>t(l.id),className:L.cn("group flex w-full items-center justify-between rounded-md border border-transparent bg-muted/40 px-3 py-1 text-left text-xs transition","hover:border-muted-foreground/20 hover:bg-muted/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1",l.isSelected&&"border-primary/40 bg-primary/10 text-primary"),children:s.jsxs("span",{className:"flex items-center space-x-2",children:[i&&i,s.jsx("span",{className:"truncate",children:l.label})]})},l.id))}):s.jsx("div",{className:"rounded border border-dashed border-muted px-3 py-1 text-xs text-muted-foreground",children:r})]}),C="#styles:",M=n=>{const r=[typeof n._name=="string"?n._name:void 0,typeof n._type=="string"?n._type:void 0].filter(Boolean).find(t=>t.trim().length>0);return r?r.length>40?`${r.slice(0,37)}...`:r:n._id},_=(n,a)=>{const r=`${a}`;return n.filter(t=>Object.values(t).some(i=>typeof i!="string"||!i.startsWith(C)?!1:i.includes(r))).map(t=>({id:t._id,label:M(t)}))},O=({tokenId:n,tokenName:a,children:r})=>{const{t}=w.useTranslation(),[i]=o.useBlocksStore(),[l,b]=o.useSelectedBlockIds(),g=o.useBuilderProp("pageId",""),m=o.useBuilderProp("siteWideUsage",{}),h=d.useMemo(()=>_(i,n),[i,n]),P=d.useMemo(()=>h.map(e=>({id:e.id,label:e.label,isSelected:l.includes(e.id)})),[h,l]),u=d.useMemo(()=>m?Object.entries(m).reduce((e,[f,c])=>(f===g||!(c!=null&&c.designTokens)||!Object.keys(c.designTokens).some(j=>typeof j!="string"?!1:j===n)||e.push({id:f,name:c.name||f,isPartial:!!c.isPartial}),e),[]):[],[m,a,n,g]),S=d.useMemo(()=>u.filter(e=>!e.isPartial).map(e=>({id:e.id,label:e.name})),[u]),k=d.useMemo(()=>u.filter(e=>e.isPartial).map(e=>({id:e.id,label:e.name})),[u]),v=d.useCallback(e=>{b([e])},[b]),B=o.useBuilderProp("gotoPage",q.noop),{selectedLang:N,fallbackLang:T}=o.useLanguages(),{savePageAsync:I}=o.useSavePage(),y=async e=>{e&&(await I(!0),B({pageId:e,lang:N||T}))};return s.jsxs(o.Popover,{children:[s.jsx(o.PopoverTrigger,{asChild:!0,children:r}),s.jsxs(o.PopoverContent,{side:"bottom",align:"end",className:"w-80 p-0",children:[s.jsxs("div",{className:"space-y-1 px-4 py-3",children:[s.jsx("p",{className:"text-xs font-semibold",children:a}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("Usage summary for this design token across your site.")})]}),s.jsxs("div",{className:"no-scrollbar max-h-64 space-y-4 overflow-y-auto px-4 pb-4",children:[s.jsx(x,{title:t("Blocks affected on this page"),items:P,emptyLabel:t("None"),onSelect:v,icon:s.jsx(p.ArrowRightIcon,{fontSize:4})}),s.jsx(x,{title:t("Blocks affected on other pages"),items:S,emptyLabel:t("None"),onSelect:y,icon:s.jsx(p.FileIcon,{fontSize:8})}),s.jsx(x,{title:t("Blocks affected on partial blocks"),items:k,emptyLabel:t("None"),onSelect:y,icon:s.jsx(p.GlobeIcon,{fontSize:8})})]})]})]})};exports.default=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),o=require("./index-DrzR7vXl.cjs"),L=require("./register-chai-top-bar-DyW9GPzV.cjs"),p=require("@radix-ui/react-icons"),q=require("lodash-es"),d=require("react"),w=require("react-i18next"),x=({title:n,items:a,emptyLabel:r,onSelect:t,icon:i})=>s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:n}),a.length>0?s.jsx("div",{className:"space-y-1",children:a.map(l=>s.jsx("button",{type:"button",onClick:()=>t(l.id),className:L.cn("group flex w-full items-center justify-between rounded-md border border-transparent bg-muted/40 px-3 py-1 text-left text-xs transition","hover:border-muted-foreground/20 hover:bg-muted/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1",l.isSelected&&"border-primary/40 bg-primary/10 text-primary"),children:s.jsxs("span",{className:"flex items-center space-x-2",children:[i&&i,s.jsx("span",{className:"truncate",children:l.label})]})},l.id))}):s.jsx("div",{className:"rounded border border-dashed border-muted px-3 py-1 text-xs text-muted-foreground",children:r})]}),C="#styles:",M=n=>{const r=[typeof n._name=="string"?n._name:void 0,typeof n._type=="string"?n._type:void 0].filter(Boolean).find(t=>t.trim().length>0);return r?r.length>40?`${r.slice(0,37)}...`:r:n._id},_=(n,a)=>{const r=`${a}`;return n.filter(t=>Object.values(t).some(i=>typeof i!="string"||!i.startsWith(C)?!1:i.includes(r))).map(t=>({id:t._id,label:M(t)}))},O=({tokenId:n,tokenName:a,children:r})=>{const{t}=w.useTranslation(),[i]=o.useBlocksStore(),[l,b]=o.useSelectedBlockIds(),g=o.useBuilderProp("pageId",""),m=o.useBuilderProp("siteWideUsage",{}),h=d.useMemo(()=>_(i,n),[i,n]),P=d.useMemo(()=>h.map(e=>({id:e.id,label:e.label,isSelected:l.includes(e.id)})),[h,l]),u=d.useMemo(()=>m?Object.entries(m).reduce((e,[f,c])=>(f===g||!(c!=null&&c.designTokens)||!Object.keys(c.designTokens).some(j=>typeof j!="string"?!1:j===n)||e.push({id:f,name:c.name||f,isPartial:!!c.isPartial}),e),[]):[],[m,a,n,g]),S=d.useMemo(()=>u.filter(e=>!e.isPartial).map(e=>({id:e.id,label:e.name})),[u]),k=d.useMemo(()=>u.filter(e=>e.isPartial).map(e=>({id:e.id,label:e.name})),[u]),v=d.useCallback(e=>{b([e])},[b]),B=o.useBuilderProp("gotoPage",q.noop),{selectedLang:N,fallbackLang:T}=o.useLanguages(),{savePageAsync:I}=o.useSavePage(),y=async e=>{e&&(await I(!0),B({pageId:e,lang:N||T}))};return s.jsxs(o.Popover,{children:[s.jsx(o.PopoverTrigger,{asChild:!0,children:r}),s.jsxs(o.PopoverContent,{side:"bottom",align:"end",className:"w-80 p-0",children:[s.jsxs("div",{className:"space-y-1 px-4 py-3",children:[s.jsx("p",{className:"text-xs font-semibold",children:a}),s.jsx("p",{className:"text-[11px] text-muted-foreground",children:t("Usage summary for this design token across your site.")})]}),s.jsxs("div",{className:"no-scrollbar max-h-64 space-y-4 overflow-y-auto px-4 pb-4",children:[s.jsx(x,{title:t("Blocks affected on this page"),items:P,emptyLabel:t("None"),onSelect:v,icon:s.jsx(p.ArrowRightIcon,{fontSize:4})}),s.jsx(x,{title:t("Blocks affected on other pages"),items:S,emptyLabel:t("None"),onSelect:y,icon:s.jsx(p.FileIcon,{fontSize:8})}),s.jsx(x,{title:t("Blocks affected on partial blocks"),items:k,emptyLabel:t("None"),onSelect:y,icon:s.jsx(p.GlobeIcon,{fontSize:8})})]})]})]})};exports.default=O;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as c, jsx as n } from "react/jsx-runtime";
2
- import { ag as _, a as j, a0 as p, d as C, F as I, X as O, Y as z, P as E } from "./index-CGZjCAyz.js";
3
- import { E as F } from "./register-chai-top-bar-D6GjnauV.js";
4
- import { ArrowRightIcon as W, FileIcon as A, GlobeIcon as M } from "@radix-ui/react-icons";
2
+ import { ak as I, a as _, a0 as p, d as j, I as C, X as O, Y as z, P as E } from "./index-RwAuF_BE.js";
3
+ import { E as W } from "./register-chai-top-bar-D6GjnauV.js";
4
+ import { ArrowRightIcon as A, FileIcon as F, GlobeIcon as M } from "@radix-ui/react-icons";
5
5
  import { noop as R } from "lodash-es";
6
6
  import { useMemo as d, useCallback as X } from "react";
7
7
  import { useTranslation as Y } from "react-i18next";
@@ -12,7 +12,7 @@ const b = ({ title: s, items: i, emptyLabel: r, onSelect: t, icon: o }) => /* @_
12
12
  {
13
13
  type: "button",
14
14
  onClick: () => t(a.id),
15
- className: F(
15
+ className: W(
16
16
  "group flex w-full items-center justify-between rounded-md border border-transparent bg-muted/40 px-3 py-1 text-left text-xs transition",
17
17
  "hover:border-muted-foreground/20 hover:bg-muted/70 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-offset-1",
18
18
  a.isSelected && "border-primary/40 bg-primary/10 text-primary"
@@ -37,7 +37,7 @@ const b = ({ title: s, items: i, emptyLabel: r, onSelect: t, icon: o }) => /* @_
37
37
  label: D(t)
38
38
  }));
39
39
  }, ee = ({ tokenId: s, tokenName: i, children: r }) => {
40
- const { t } = Y(), [o] = _(), [a, g] = j(), h = p("pageId", ""), u = p("siteWideUsage", {}), y = d(() => G(o, s), [o, s]), k = d(
40
+ const { t } = Y(), [o] = I(), [a, g] = _(), h = p("pageId", ""), u = p("siteWideUsage", {}), y = d(() => G(o, s), [o, s]), k = d(
41
41
  () => y.map((e) => ({
42
42
  id: e.id,
43
43
  label: e.label,
@@ -64,7 +64,7 @@ const b = ({ title: s, items: i, emptyLabel: r, onSelect: t, icon: o }) => /* @_
64
64
  g([e]);
65
65
  },
66
66
  [g]
67
- ), B = p("gotoPage", R), { selectedLang: T, fallbackLang: L } = C(), { savePageAsync: w } = I(), x = async (e) => {
67
+ ), B = p("gotoPage", R), { selectedLang: T, fallbackLang: L } = j(), { savePageAsync: w } = C(), x = async (e) => {
68
68
  e && (await w(!0), B({ pageId: e, lang: T || L }));
69
69
  };
70
70
  return /* @__PURE__ */ c(O, { children: [
@@ -82,7 +82,7 @@ const b = ({ title: s, items: i, emptyLabel: r, onSelect: t, icon: o }) => /* @_
82
82
  items: k,
83
83
  emptyLabel: t("None"),
84
84
  onSelect: N,
85
- icon: /* @__PURE__ */ n(W, { fontSize: 4 })
85
+ icon: /* @__PURE__ */ n(A, { fontSize: 4 })
86
86
  }
87
87
  ),
88
88
  /* @__PURE__ */ n(
@@ -92,7 +92,7 @@ const b = ({ title: s, items: i, emptyLabel: r, onSelect: t, icon: o }) => /* @_
92
92
  items: v,
93
93
  emptyLabel: t("None"),
94
94
  onSelect: x,
95
- icon: /* @__PURE__ */ n(A, { fontSize: 8 })
95
+ icon: /* @__PURE__ */ n(F, { fontSize: 8 })
96
96
  }
97
97
  ),
98
98
  /* @__PURE__ */ n(