@creaditor/web-starterkit 1.0.28 → 1.0.29

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.
@@ -1749,7 +1749,7 @@
1749
1749
  border: 1.5px solid rgba(0, 0, 0, 0.1);
1750
1750
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
1751
1751
  }
1752
- `},35962(t,e,n){"use strict";n.d(e,{n:()=>g});var r=n(84488),o=n.n(r),i=n(15604),a=n(79071);class s extends HTMLElement{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),t&&(this.props=t||{})}connectedCallback(){if(!this.isConnected)return null;const{props:t}=this;t.children instanceof HTMLElement&&this.appendChild(t.children),"string"==typeof t.children&&(this.innerHTML=t.children),"function"==typeof t.children&&this.appendChild(t.children()),"function"==typeof t.onUpdate&&t.onUpdate(this),"function"!=typeof t.onMount||this.isLoaded||(this.isLoaded=!0,t.onMount(this))}disconnectedCallback(){const{props:t}=this;"function"==typeof t.onUnMount&&t.onUnMount(this)}}customElements.define("cdtr-life-cycle-dom-element",s);const l=s;var c=n(89531),d=n(52529),p=n(67549),h=n(86319),u=n(3832),f=n(83965);function m(t){const e=void 0!==t.paddingTop||void 0!==t.paddingBottom||void 0!==t.paddingLeft||void 0!==t.paddingRight;t.padding&&e&&delete t.padding;const n=void 0!==t.marginTop||void 0!==t.marginBottom||void 0!==t.marginLeft||void 0!==t.marginRight;t.margin&&n&&delete t.margin}const g=t=>{let{name:e,id:n,onSelect:r,focus:s,onDeselect:g,atomElement:b,droppable:y,draggable:w,allowSortable:A,childrenHolder:x,render:_,onChanges:v,resize:k,remove:C,handleBar:E,nameTab:S,destroy:M,template:B,schema:T,createEditor:L,getRenderedHTML:O,elementProps:I,resizeable:N,commands:R={},defaultProps:z={},globalCommands:H={},validator:P}=t;if(!P)throw new Error("validator is required");if(!e)throw new Error("name is required");if(H&&"object"==typeof H&&(i.Ay.globalCommands={...i.Ay.globalCommands,...H}),z&&"object"==typeof z&&function(t,e){for(const n of Object.keys(e)){const r=e[n],o=t.props[n];if(void 0!==o){if(null!=o&&"object"==typeof o&&null!=r&&"object"==typeof r){for(const e of Object.keys(r))void 0===t.props[n][e]&&(t.props[n][e]=r[e]);"style"===n&&t.props[n]&&m(t.props[n])}}else t.props[n]=r}}(I,z),"function"==typeof b&&(b=b({props:I.props,data:I})),b&&!0===N)b.setAttribute("cdtr-resizable","true");else if("function"==typeof N){const t=N();t instanceof Element&&t.setAttribute("cdtr-resizable","true")}if("function"==typeof B&&(B=B({props:I.props})),!B)throw new Error("template is required");if(w?.group&&(B.setAttribute("draggable-element",w.group),w.direction&&B.setAttribute("draggable-direction",w.direction)),y?.group&&B.setAttribute("droppable-element",y.group),!0===E){const t=document.createElement("cdtr-move-handle-bar");t.for=n,B.appendChild(t)}B.setAttribute("data-type",e),n?B.setAttribute("data-id",n):console.warn("There is no id on this element",e),b||(b=B),B.classList.add(`${e}-component`),b.dataset.id=n;const D=(0,a.A)(B,I,P);if(D.editor=i.Ay,D.commands={...R},D.onSelect=r,D.nameTab=!1!==S,D.childrenHolder=x??B,D.allowSortable=A,D.onDeselect=g,D.remove=C,D.destroy=M,D.focus=s,D.atomElement=b,D.type=e,D.schema=T,D.getRenderedHTML=O,D.render=_,D.resize=k,D.app=i.Ay,D.commands.execCommand=(t,e)=>i.Ay.store().execCommand2({transactions:[{key:t,value:e}],update:[D]}),D.commands.remove=()=>{const t=[],e=h.M.get("components",D.id),n=e.closest("block"),r=e.parent(),o=(0,d.iI)(r,e.id),a=(2===o?r.elements:r.children).findIndex(t=>t===e.id);t.push(new c.A({componentId:e.id,parentId:r.id,index:a,layer:o})),i.Ay.removeComponent({componentId:e.id}),2!==o&&(0,f.i)(r).forEach(e=>t.push(e)),n&&(0,p.s)(n).forEach(e=>t.push(e));const s=n?document.querySelector(`.block-component[data-id="${n.id}"]`):document.querySelector(".block-component[data-id]"),l=s?.dataset?.id;l&&i.Ay.clean().selectComponent(h.M.get("components",l)),t.length>0&&(0,u.Ay)({steps:t,force:!0,update:!0})},"function"==typeof _){const t=new l({onMount:()=>{t.remove(),_()}});B.appendChild(t)}return"function"==typeof v&&i.Ay.on("change",v),"function"==typeof L&&(D.createEditor=t=>L({component:D,props:D.props,commands:R,tools:{textEditor:o()},...t}),D.editor={render:()=>{const t=L({component:D,props:D.props,commands:R});return t?.layout??t??null}}),D}},159(t,e,n){"use strict";n.d(e,{G:()=>Pt,X:()=>Ht});var r=n(89575),o=n(5441),i=n(29482),a=n(36166),s=n(18057),l=n(86319),c=n(72591),d=n.n(c),p=n(88639),h=n.n(p),u=n(88128),f=n.n(u),m=n(30855),g=n.n(m),b=n(93051),y=n.n(b),w=n(57566),A={};A.setAttributes=g(),A.insert=f().bind(null,"head"),A.domAPI=h(),A.insertStyleElement=y();d()(w.A,A);const x=w.A&&w.A.locals?w.A.locals:void 0;var _=n(80120),v=n(75068),k=n.n(v),C=n(23571),E=n(15604),S=n(81139),M=n(49937),B=n(35962);let T;const L="is_resize_on_proggress",O="undefined"!=typeof navigator&&(/Chrome|Chromium|Edg/.test(navigator.userAgent)||(navigator.userAgentData?.brands?.some(t=>/Chromium|Chrome|Edge/.test(t.brand))??!1));let I=null;const N=async t=>{const e=l.M.get(L);if(e)return;T&&!e&&(T.destroy(),T=null);let r=l.M.get("components",t.id).children.map(t=>l.M.get("components",t)).filter(t=>"col"===t.type);if(r=r.map(t=>t.element),r.length<2)return;let o=0,i=[],a=[];for(let t=0;t<r.length;t++){const e=r[t];o+=parseInt(e.getAttribute("lg"))}if(o>12)return;const s=t.element.getBoundingClientRect().width;Array.from(r).forEach(t=>{const e=t.getBoundingClientRect();i.push(e.width)}),i=i.map(t=>Math.floor(function(t,e,n){const r=Math.abs((e-t)/e*100-100);return n?Math.round(r):r}(t,s)));if(i.reduce((t,e)=>t+e,0)>100){const t=100/r.length;i=i.map(e=>t)}const c=await(I||(I=O?n.e(2298).then(n.bind(n,52298)).then(t=>t.default):n.e(1396).then(n.bind(n,41396)).then(t=>t.default)),I);return T=new c(r,{sizes:i,minSize:100,gutterSize:0,dragInterval:2,snapOffset:10,onDrag:(t,e)=>{if((t=t.map(t=>Math.round(t/8))).reduce((t,e)=>t+e,0)>12){let e=t[0],r=0;for(var n=0;n<t.length;n++)r<t[n]&&(e=n,r=t[n]);t[e]=t[e]-1}r.forEach((e,n)=>{e.setAttribute("lg",t[n])}),a=t},onDragStart:function(){l.M.set({[L]:!0})},onDragEnd:function(t){if(l.M.set({[L]:!1}),T&&(T.destroy(),T=null),!a)return;const e=[];Array.from(r).forEach(t=>{const n=l.M.get("components",t.dataset.id);n&&e.push(n)});if(e.length!==r.length)return void console.error("cant find all the components,..");const n=[];E.Ay.clean(),e.forEach((t,e)=>{var r=a[e];n.push(new S.A({componentId:t.id,key:"lg",value:r}))}),E.Ay.store().execCommands(n)}}),{split:T,destroy:()=>{T&&(T.destroy(),T=null)}}};let R;const z=t=>{const e=new s.A;t.props.justify||(t.props.justify="center"),t?.props?.style?.backgroundImage&&delete t.props.style.backgroundImage,t?.props?.lg?.style&&(t.props.style={...t.props.style,...t.props.lg.style}),t.props.style.margin="0 auto";const c=(0,i.A)("block-component",t.classList,x.main),d={type:t.type,"data-type":t.type,"data-id":t.id,"data-modalable":t.props.modalable?"true":"false","data-modal-name":t.props.modalName||""},p=(0,o.A)("div",{style:{position:"absolute",left:0,top:0,height:"100%",width:"100%",overflow:"hidden",opacity:t.opacity||1,zIndex:-1}}),h=(0,o.A)("div",{"data-for":t.id,"data-type":t.type,className:(0,i.A)(x.container),style:{width:"100%",justifyContent:t.props.justify}},t.children);function u(t){const e=()=>{const e=document.createElement(t.component);p.appendChild(e),(0,a.A)(e,t.properties)};for(;p.firstChild;)p.firstChild.remove();t&&(t.installed?e():t.component&&("cdtr-media-player"===t.component&&(t.component="cdtr-background-video"),"images-preset"===t.component&&(t.component="cdtr-images-preset"),n(604)(`./${t.component}`).then(t=>{e()})))}t.background?u(t.background):t.background={};const f=()=>{h.classList.add(x.dragging)};M.A.subscribe("elements:draggable:start",f),M.A.subscribe("elements:draggable:end",()=>{h.classList.remove(x.dragging)});const m=(0,o.A)("div",(0,r.A)({},d,{"droppable-element":t.type,"droppable-direction":"top,bottom",className:c,"data-type":t.type,"data-id":t.id}),h,t.elements,p);if("menu"===t.as){const e=(0,o.A)("div",{className:x.draggableHeightTitle},(0,o.A)("span",null,t.style.marginBottom||0)),n=(0,o.A)("div",{className:x.draggableHolder},e);m.appendChild(n),m.classList.add(x.menu),t.style.marginBottom&&(n.style.height=t.style.marginBottom)}const g=new C.Ay(h,{handle:".col-handle",draggable:".col-component",animation:300,onChoose:()=>{R&&(R.destroy(),R=null),l.M.set({isResizeBlockOn:!0}),E.Ay.getEditor().filter(t=>"text"===t.type).forEach(t=>"function"==typeof t.editor.setEditable&&t.editor.setEditable(!1))},onEnd:t=>{const e=t.item,n=e.dataset.id,r=t.to.dataset.for,o=t.from.dataset.for,i=t.oldIndex,a=t.newIndex;l.M.set({isResizeBlockOn:!1}),E.Ay.getEditor().filter(t=>"text"===t.type).forEach(t=>"function"==typeof t.editor.setEditable&&t.editor.setEditable(!0));const s={componentId:n,newParentId:r,oldParentId:o,newAfterElId:e.nextSibling?.dataset.id,newPreviousElId:e.previousSibling?.dataset.id,oldIndex:i,newIndex:a,type:_.d.MOVE};E.Ay.moveComponent(s)}}),b=()=>{N(w).then(t=>{R=t}).catch(t=>{console.error(t)})};m.addEventListener("mouseover",b);m.addEventListener("mouseleave",()=>{l.M.get("isResizeBlockOn")||R&&R.destroy()});const y={set:(t,e,n)=>{switch(e){case"expand_image_for_outlook":case"noResponsive":return t[e]=n,!0;case"modalable":return t[e]=n,m.setAttribute("data-modalable",n?"true":"false"),!0;case"modalName":return t[e]=n,m.setAttribute("data-modal-name",n||""),!0;case"popupTrigger":return t[e]=n,m.setAttribute("data-popup-trigger",n||"button"),!0;case"popupDelay":return t[e]=n,m.setAttribute("data-popup-delay",null==n?"":String(n)),!0;case"background":return t[e]=n,u(n),!0;case"style":return t[e]=k()(t[e],n),!0;default:return!1}}};E.Ay.on("update",()=>{e.run(()=>{})});const w=(0,B.n)({id:t.id,name:t.type,globalCommands:{},schema:t.schema,validator:y,allowSortable:!0,childrenHolder:h,template:m,elementProps:t,defaultProps:{justify:"center"},commands:{compareCols:()=>{e.run(()=>{(()=>{const t=w.get();if(!t)return;if(!Array.isArray(t.children))return;const e=t.children,n=[];e.forEach(t=>{const e=l.M.get("components",t);if(e){const t=e.find("card");t&&(t.element.style.minHeight=null,n.push(t))}});let r,o=0;n.forEach(t=>{const e=t.element.getBoundingClientRect();e.height>o&&(o=e.height,r=t)}),1!==n.length||"none"===n[0].props.style.minHeight?n.forEach(t=>{if(r){const e=r.element.getBoundingClientRect(),n=t.element.getBoundingClientRect(),i=o-n.height,a=Math.round(n.height+i)+"px";t.props.lg||(t.props.lg={}),t.props.lg.style||(t.props.lg.style={}),t.props.lg.style.minHeight!==a&&e.top===n.top&&E.Ay.updateComponent(t,"lg",{style:{minHeight:a}}),t.element.style.minHeight=a}}):E.Ay.updateComponent(n[0],"lg",{style:{minHeight:"none"}})})()})},fixCols:()=>{const t=[],e=[];Array.from(w.childrenHolder.children).forEach(e=>{e.classList.contains("col-component")&&t.push(e)});const n=Math.floor(12/t.length);return t.forEach((t,r)=>{const o=l.M.get("components",t.dataset.id);o&&e.push(new S.A({componentId:o.id,key:"lg",value:n}))}),R&&(R.destroy(),R=null,b()),{sizes:e}}},destroy:()=>{g&&g.destroy(),M.A.unSubscribe("elements:draggable:start",f),m.removeEventListener("mouseover",b)},remove:()=>{m.remove()},onSelect:t=>{m.classList.add(t)},onDeselect:t=>{m.classList.remove(t)},onChanges:()=>{w.isInDom()&&function t(){const e=w.get().props;if(e.expand_image_for_outlook)if(e.background&&e.background.properties&&e.background.properties.src){const n=document.createElement("img"),r=m.getBoundingClientRect();n.width=r.width,n.style.height="auto",n.src=e.background.properties.src,document.body.appendChild(n),n.addEventListener("load",()=>{if(0===n.height)return t();const e=n.height;m.style.minHeight=e+"px",n.remove()})}else m.style.minHeight="auto"}()},render:()=>{if((0,a.A)(m,{style:w.props.style}),w.props.expand_image_for_outlook){const t=document.createElement("img");t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.width=w.props.style.width,t.style.height="auto",t.src=w.props.background.properties.src,document.body.appendChild(t),t.onload=()=>{const e=window.getComputedStyle(t);m.style.minHeight=e.height,t.remove()}}else m.style.minHeight="auto"}});return w};var H=n(40156),P=n(66358),D={};D.setAttributes=g(),D.insert=f().bind(null,"head"),D.domAPI=h(),D.insertStyleElement=y();d()(P.A,D);const $=P.A&&P.A.locals?P.A.locals:void 0,j=t=>{let e;new s.A;const n=(0,i.A)(t.classList,$.template),l=(0,o.A)("div",(0,r.A)({},t,{className:n})),c=(0,o.A)("div",{className:`html-component ${$.codeBlock}`,lg:t.props.lg||null,"data-id":t.id},l);const d=(0,o.A)("paper-button",{onClick:function(){document.fullscreenElement!==c?c.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},className:$.fullScreenBtn},(0,o.A)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},(0,o.A)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,o.A)("path",{d:"M20 3h2v6h-2V5h-4V3h4zM4 3h4v2H4v4H2V3h2zm16 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z"})));!function n(){(0,H.A)("https://ace.c9.io/build/src/ace.js",()=>{(0,H.A)("https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.11/ext-language_tools.js",()=>{if(!window.ace||window.ace&&"function"!=typeof window.ace.edit)return console.error("Cant load code component"),setTimeout(()=>{n()},500),null;e=window.ace.edit(l,{theme:"ace/theme/monokai",mode:"ace/mode/html",showPrintMargin:!0,wrap:!0,autoScrollEditorIntoView:!0,enableSnippets:!0,allowFullscreen:!0}),e.getSession().setUndoManager(null),e.setValue(t.props.code.html.replace(/&lt;/g,"<"),t.props.code.html.lengths),e.getSession().on("change",function(t){var n=e.getSession().getValue();E.Ay.store().execCommand("code",{html:n},{find:"html"})}),l.appendChild(d)})})}();const p={set:(t,n,r)=>{switch(n){case"code":return document.activeElement.closest(".html-component")||(e.setValue(r.html.replace(/&lt;/g,"<"),r.html.length),e.focus()),t[n]=r,!0;case"style":return t[n]=r,(0,a.A)(l,{style:t[n]}),!0;default:return!1}}},h=(0,B.n)({id:t.id,name:t.type,atomElement:l,destroy:()=>{"function"==typeof e.destroy&&e.destroy()},remove:()=>{c.remove()},onSelect:t=>{c.classList.add(t)},onDeselect:t=>{c.classList.remove(t)},draggable:{group:"element"},droppable:{group:"element"},handleBar:!0,elementProps:t,template:c,validator:p,schema:t.schema,defaultProps:{code:{html:""}}});return h};var F=n(11113),U={};U.setAttributes=g(),U.insert=f().bind(null,"head"),U.domAPI=h(),U.insertStyleElement=y();d()(F.A,U);const q=F.A&&F.A.locals?F.A.locals:void 0;var W=n(79071);const V=t=>{new s.A;const e=(0,i.A)("iframe-component",t.classList,q.main);t.style.display||(t.style.display="block"),t.style.margin||(t.style.margin="auto"),t.style.maxWidth||(t.style.maxWidth="100%");const n=()=>(0,o.A)("div",{className:(0,i.A)(q.emptyIframeHolder,"placeholder")},(0,o.A)("cdtr-col",{lg:"12",md:"12",sm:"12"},(0,o.A)("h1",{align:"center"},(0,o.A)("lang-text",{text:"this_is_empty_iframe_start_add_url_link"}))),(0,o.A)("cdtr-col",{sm:"12",lg:"12",md:"12"},(0,o.A)("cdtr-input",{onChange:t=>E.Ay.store().execCommand("src",t.target.value),style:"text-align:left;direction:ltr;width:290px;",placeholder:"https://",autoFocus:"true"}))),r=(0,o.A)("iframe",{src:t.src,style:t.style}),c=(0,o.A)("cdtr-row",{style:{height:"100%"},alignItems:t.props.alignItems,justify:t.justify||"center"},(0,o.A)("div",{style:{position:"relative",maxWidth:"100%",height:"100%",width:"100%"}},r,(0,o.A)("cdtr-move-handle-bar",{for:t.id}))),d=(0,o.A)("cdtr-col",{"data-id":t.id,"draggable-element":"element","droppable-element":"element",className:e},c,t.props.src?null:n()),p={set:(t,e,o)=>{switch(e){case"src":return t[e]=o,(0,a.A)(r,{src:o}),r.onload=()=>{const t=d.querySelector(".placeholder"),e=r.getBoundingClientRect();o&&!t&&e.width>500?d.appendChild(n()):o&&t?t.remove():!o&&t||!o&&!t&&e.width>500&&d.appendChild(n())},r.onerror=()=>{(0,a.A)(r,{src:""})},!0;case"style":return t[e]=k()(t[e],o),(0,a.A)(r,{style:t[e]}),!0;default:return!1}}},h=(0,W.A)(d,t,p);h.onSelect=t=>{d.classList.add(t)},h.remove=()=>{d.remove()},h.onDeselect=t=>{d.classList.remove(t)};const u={execCommand:(t,e)=>E.Ay.store().execCommand(t,e)};h.createEditor=t=>(t=>{let{component:e,commands:n}=t;const r=()=>e.props.style||{},o=t=>/[a-z%]/i.test(String(t))?String(t):`${t}px`;return{select:t=>{let{changeTab:e,tab:n}=t;n.text||e("style")},tabs:t=>{const e=[{text:"style"},{text:"settings"}];return e.forEach(e=>e.selected=e.text===(t||"style")),e},layout:t=>{let{tab:i}=t;const a=()=>"style"===i.text;return[{type:"input",title:"url",active:a,value:e.props.src||"",onChange:t=>n.execCommand("src",t.target.value)},{type:"slider",title:"width",unit:"px",min:100,max:1200,active:a,value:parseInt(r().width,10)||400,sizes:[{name:"100%",value:"100%"},{name:l.M.get("lang","fullscreen")||"Fullscreen",value:"100vw"}],onInput:t=>n.execCommand("style",{width:o(t.target.value)})},{type:"slider",title:"height",unit:"px",min:100,max:1e3,active:a,value:parseInt(r().height,10)||300,sizes:[{name:"100%",value:"100%"},{name:l.M.get("lang","fullscreen")||"Fullscreen",value:"100vh"}],onInput:t=>n.execCommand("style",{height:o(t.target.value)})},{type:"divider",active:a},{type:"input",title:"margin",active:()=>"settings"===i.text,value:r().margin||"",onChange:t=>n.execCommand("style",{margin:t.target.value})}]}}})({component:h,commands:u,...t});const f=l.M.get("config","editor","configure","plugins"),m=Array.isArray(f)?f.findIndex(e=>e.name===t.type):-1;return m>-1&&(f[m].createEditor=h.createEditor),h.commands={...h.commands||{},remove:()=>E.Ay.removeComponent({componentId:t.id})},h};var Y=n(59929);const X=t=>new Proxy(t,{});var Z=n(69172),K=n(82706);const J=(t,e,n)=>{const r={key:e,value:n};return(0,K.F6)(Z.XW.api_url+Z.JZ.components+`/${t}`,r)},G=t=>{const e=new s.A,n=(0,o.A)("cdtr-background-element",(0,r.A)({onDelete:()=>{(t=>{const e={id:t};return(0,K.bE)(`${Z.XW.api_url+Z.JZ.components}/getParent`,e)})(t.id).then(e=>{if(e&&e.data&&e.data.id){const i=n.closest(`[_id='${e.data.id}']`);i&&(r=t.id,o=i.id,(0,K.jd)(Z.XW.api_url+Z.JZ.components+`/${r}`,{parentId:o}))}var r,o})}},t));return{element:n,props:X(t,{set:(r,o,i)=>{switch(o){case"backgroundVideo":return r[o]=i,(0,a.A)(n,{backgroundVideo:i}),e.run(()=>{J(t.id,"backgroundVideo",i)}),!0;case"is_removed":return(0,a.A)(n,{is_removed:i}),!0;case"style":return r[o]=k()(r[o],i),(0,a.A)(n,{style:r[o]}),e.run(()=>{J(t.id,"style",r[o])}),!0;default:return!1}}})}};class Q extends Y.WF{constructor(){super(),this.items=[{text:l.M.get("lang","edit_background")},{text:l.M.get("lang","delete_bcakground"),value:"delete"}]}render(){return Y.qy`<vaadin-context-menu
1752
+ `},35962(t,e,n){"use strict";n.d(e,{n:()=>g});var r=n(84488),o=n.n(r),i=n(15604),a=n(79071);class s extends HTMLElement{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),t&&(this.props=t||{})}connectedCallback(){if(!this.isConnected)return null;const{props:t}=this;t.children instanceof HTMLElement&&this.appendChild(t.children),"string"==typeof t.children&&(this.innerHTML=t.children),"function"==typeof t.children&&this.appendChild(t.children()),"function"==typeof t.onUpdate&&t.onUpdate(this),"function"!=typeof t.onMount||this.isLoaded||(this.isLoaded=!0,t.onMount(this))}disconnectedCallback(){const{props:t}=this;"function"==typeof t.onUnMount&&t.onUnMount(this)}}customElements.define("cdtr-life-cycle-dom-element",s);const l=s;var c=n(89531),d=n(52529),p=n(67549),h=n(86319),u=n(3832),f=n(83965);function m(t){const e=void 0!==t.paddingTop||void 0!==t.paddingBottom||void 0!==t.paddingLeft||void 0!==t.paddingRight;t.padding&&e&&delete t.padding;const n=void 0!==t.marginTop||void 0!==t.marginBottom||void 0!==t.marginLeft||void 0!==t.marginRight;t.margin&&n&&delete t.margin}const g=t=>{let{name:e,id:n,onSelect:r,focus:s,onDeselect:g,atomElement:b,droppable:y,draggable:w,allowSortable:A,childrenHolder:x,render:_,onChanges:v,resize:k,remove:C,handleBar:E,nameTab:S,destroy:M,template:B,schema:T,createEditor:L,getRenderedHTML:O,elementProps:I,resizeable:N,commands:R={},defaultProps:z={},globalCommands:H={},validator:P}=t;if(!P)throw new Error("validator is required");if(!e)throw new Error("name is required");if(H&&"object"==typeof H&&(i.Ay.globalCommands={...i.Ay.globalCommands,...H}),z&&"object"==typeof z&&function(t,e){for(const n of Object.keys(e)){const r=e[n],o=t.props[n];if(void 0!==o){if(null!=o&&"object"==typeof o&&null!=r&&"object"==typeof r){for(const e of Object.keys(r))void 0===t.props[n][e]&&(t.props[n][e]=r[e]);"style"===n&&t.props[n]&&m(t.props[n])}}else t.props[n]=r}}(I,z),"function"==typeof b&&(b=b({props:I.props,data:I})),b&&!0===N)b.setAttribute("cdtr-resizable","true");else if("function"==typeof N){const t=N();t instanceof Element&&t.setAttribute("cdtr-resizable","true")}if("function"==typeof B&&(B=B({props:I.props})),!B)throw new Error("template is required");if(w?.group&&(B.setAttribute("draggable-element",w.group),w.direction&&B.setAttribute("draggable-direction",w.direction)),y?.group&&B.setAttribute("droppable-element",y.group),!0===E){const t=document.createElement("cdtr-move-handle-bar");t.for=n,B.appendChild(t)}B.setAttribute("data-type",e),n?B.setAttribute("data-id",n):console.warn("There is no id on this element",e),b||(b=B),B.classList.add(`${e}-component`),b.dataset.id=n;const D=(0,a.A)(B,I,P);if(D.editor=i.Ay,D.commands={...R},D.onSelect=r,D.nameTab=!1!==S,D.childrenHolder=x??B,D.allowSortable=A,D.onDeselect=g,D.remove=C,D.destroy=M,D.focus=s,D.atomElement=b,D.type=e,D.schema=T,D.getRenderedHTML=O,D.render=_,D.resize=k,D.app=i.Ay,D.commands.execCommand=(t,e)=>i.Ay.store().execCommand2({transactions:[{key:t,value:e}],update:[D]}),D.commands.remove=()=>{const t=[],e=h.M.get("components",D.id),n=e.closest("block"),r=e.parent(),o=(0,d.iI)(r,e.id),a=(2===o?r.elements:r.children).findIndex(t=>t===e.id);t.push(new c.A({componentId:e.id,parentId:r.id,index:a,layer:o})),i.Ay.removeComponent({componentId:e.id}),2!==o&&(0,f.i)(r).forEach(e=>t.push(e)),n&&(0,p.s)(n).forEach(e=>t.push(e));const s=n?document.querySelector(`.block-component[data-id="${n.id}"]`):document.querySelector(".block-component[data-id]"),l=s?.dataset?.id;l&&i.Ay.clean().selectComponent(h.M.get("components",l)),t.length>0&&(0,u.Ay)({steps:t,force:!0,update:!0})},"function"==typeof _){const t=new l({onMount:()=>{t.remove(),_()}});B.appendChild(t)}return"function"==typeof v&&i.Ay.on("change",v),"function"==typeof L&&(D.createEditor=t=>L({component:D,props:D.props,commands:R,tools:{textEditor:o()},...t}),D.editor={render:()=>{const t=L({component:D,props:D.props,commands:R});return t?.layout??t??null}}),D}},159(t,e,n){"use strict";n.d(e,{G:()=>Dt,X:()=>Pt});var r=n(89575),o=n(5441),i=n(29482),a=n(36166),s=n(18057),l=n(86319),c=n(72591),d=n.n(c),p=n(88639),h=n.n(p),u=n(88128),f=n.n(u),m=n(30855),g=n.n(m),b=n(93051),y=n.n(b),w=n(57566),A={};A.setAttributes=g(),A.insert=f().bind(null,"head"),A.domAPI=h(),A.insertStyleElement=y();d()(w.A,A);const x=w.A&&w.A.locals?w.A.locals:void 0;var _=n(80120),v=n(75068),k=n.n(v),C=n(23571),E=n(15604),S=n(81139),M=n(49937),B=n(35962);let T;const L="is_resize_on_proggress",O="undefined"!=typeof navigator&&(/Chrome|Chromium|Edg/.test(navigator.userAgent)||(navigator.userAgentData?.brands?.some(t=>/Chromium|Chrome|Edge/.test(t.brand))??!1));let I=null;const N=async t=>{const e=l.M.get(L);if(e)return;T&&!e&&(T.destroy(),T=null);let r=l.M.get("components",t.id).children.map(t=>l.M.get("components",t)).filter(t=>"col"===t.type);if(r=r.map(t=>t.element),r.length<2)return;let o=0,i=[],a=[];for(let t=0;t<r.length;t++){const e=r[t];o+=parseInt(e.getAttribute("lg"))}if(o>12)return;const s=t.element.getBoundingClientRect().width;Array.from(r).forEach(t=>{const e=t.getBoundingClientRect();i.push(e.width)}),i=i.map(t=>Math.floor(function(t,e,n){const r=Math.abs((e-t)/e*100-100);return n?Math.round(r):r}(t,s)));if(i.reduce((t,e)=>t+e,0)>100){const t=100/r.length;i=i.map(e=>t)}const c=await(I||(I=O?n.e(2298).then(n.bind(n,52298)).then(t=>t.default):n.e(1396).then(n.bind(n,41396)).then(t=>t.default)),I);return T=new c(r,{sizes:i,minSize:100,gutterSize:0,dragInterval:2,snapOffset:10,onDrag:(t,e)=>{if((t=t.map(t=>Math.round(t/8))).reduce((t,e)=>t+e,0)>12){let e=t[0],r=0;for(var n=0;n<t.length;n++)r<t[n]&&(e=n,r=t[n]);t[e]=t[e]-1}r.forEach((e,n)=>{e.setAttribute("lg",t[n])}),a=t},onDragStart:function(){l.M.set({[L]:!0})},onDragEnd:function(t){if(l.M.set({[L]:!1}),T&&(T.destroy(),T=null),!a)return;const e=[];Array.from(r).forEach(t=>{const n=l.M.get("components",t.dataset.id);n&&e.push(n)});if(e.length!==r.length)return void console.error("cant find all the components,..");const n=[];E.Ay.clean(),e.forEach((t,e)=>{var r=a[e];n.push(new S.A({componentId:t.id,key:"lg",value:r}))}),E.Ay.store().execCommands(n)}}),{split:T,destroy:()=>{T&&(T.destroy(),T=null)}}};let R;const z=t=>{const e=new s.A;t.props.justify||(t.props.justify="center"),t?.props?.style?.backgroundImage&&delete t.props.style.backgroundImage,t?.props?.lg?.style&&(t.props.style={...t.props.style,...t.props.lg.style}),t.props.style.margin="0 auto";const c=(0,i.A)("block-component",t.classList,x.main),d={type:t.type,"data-type":t.type,"data-id":t.id,"data-modalable":t.props.modalable?"true":"false","data-modal-name":t.props.modalName||""},p=(0,o.A)("div",{style:{position:"absolute",left:0,top:0,height:"100%",width:"100%",overflow:"hidden",opacity:t.opacity||1,zIndex:-1}}),h=(0,o.A)("div",{"data-for":t.id,"data-type":t.type,className:(0,i.A)(x.container),style:{width:"100%",justifyContent:t.props.justify}},t.children);function u(t){const e=()=>{const e=document.createElement(t.component);p.appendChild(e),(0,a.A)(e,t.properties)};for(;p.firstChild;)p.firstChild.remove();t&&(t.installed?e():t.component&&("cdtr-media-player"===t.component&&(t.component="cdtr-background-video"),"images-preset"===t.component&&(t.component="cdtr-images-preset"),n(604)(`./${t.component}`).then(t=>{e()})))}t.background?u(t.background):t.background={};const f=()=>{h.classList.add(x.dragging)};M.A.subscribe("elements:draggable:start",f),M.A.subscribe("elements:draggable:end",()=>{h.classList.remove(x.dragging)});const m=(0,o.A)("div",(0,r.A)({},d,{"droppable-element":t.type,"droppable-direction":"top,bottom",className:c,"data-type":t.type,"data-id":t.id}),h,t.elements,p);if("menu"===t.as){const e=(0,o.A)("div",{className:x.draggableHeightTitle},(0,o.A)("span",null,t.style.marginBottom||0)),n=(0,o.A)("div",{className:x.draggableHolder},e);m.appendChild(n),m.classList.add(x.menu),t.style.marginBottom&&(n.style.height=t.style.marginBottom)}const g=new C.Ay(h,{handle:".col-handle",draggable:".col-component",animation:300,onChoose:()=>{R&&(R.destroy(),R=null),l.M.set({isResizeBlockOn:!0}),E.Ay.getEditor().filter(t=>"text"===t.type).forEach(t=>"function"==typeof t.editor.setEditable&&t.editor.setEditable(!1))},onEnd:t=>{const e=t.item,n=e.dataset.id,r=t.to.dataset.for,o=t.from.dataset.for,i=t.oldIndex,a=t.newIndex;l.M.set({isResizeBlockOn:!1}),E.Ay.getEditor().filter(t=>"text"===t.type).forEach(t=>"function"==typeof t.editor.setEditable&&t.editor.setEditable(!0));const s={componentId:n,newParentId:r,oldParentId:o,newAfterElId:e.nextSibling?.dataset.id,newPreviousElId:e.previousSibling?.dataset.id,oldIndex:i,newIndex:a,type:_.d.MOVE};E.Ay.moveComponent(s)}}),b=()=>{N(w).then(t=>{R=t}).catch(t=>{console.error(t)})};m.addEventListener("mouseover",b);m.addEventListener("mouseleave",()=>{l.M.get("isResizeBlockOn")||R&&R.destroy()});const y={set:(t,e,n)=>{switch(e){case"expand_image_for_outlook":case"noResponsive":return t[e]=n,!0;case"modalable":return t[e]=n,m.setAttribute("data-modalable",n?"true":"false"),!0;case"modalName":return t[e]=n,m.setAttribute("data-modal-name",n||""),!0;case"popupTrigger":return t[e]=n,m.setAttribute("data-popup-trigger",n||"button"),!0;case"popupDelay":return t[e]=n,m.setAttribute("data-popup-delay",null==n?"":String(n)),!0;case"background":return t[e]=n,u(n),!0;case"style":return t[e]=k()(t[e],n),!0;default:return!1}}};E.Ay.on("update",()=>{e.run(()=>{})});const w=(0,B.n)({id:t.id,name:t.type,globalCommands:{},schema:t.schema,validator:y,allowSortable:!0,childrenHolder:h,template:m,elementProps:t,defaultProps:{justify:"center"},commands:{compareCols:()=>{e.run(()=>{(()=>{const t=w.get();if(!t)return;if(!Array.isArray(t.children))return;const e=t.children,n=[];e.forEach(t=>{const e=l.M.get("components",t);if(e){const t=e.find("card");t&&(t.element.style.minHeight=null,n.push(t))}});let r,o=0;n.forEach(t=>{const e=t.element.getBoundingClientRect();e.height>o&&(o=e.height,r=t)}),1!==n.length||"none"===n[0].props.style.minHeight?n.forEach(t=>{if(r){const e=r.element.getBoundingClientRect(),n=t.element.getBoundingClientRect(),i=o-n.height,a=Math.round(n.height+i)+"px";t.props.lg||(t.props.lg={}),t.props.lg.style||(t.props.lg.style={}),t.props.lg.style.minHeight!==a&&e.top===n.top&&E.Ay.updateComponent(t,"lg",{style:{minHeight:a}}),t.element.style.minHeight=a}}):E.Ay.updateComponent(n[0],"lg",{style:{minHeight:"none"}})})()})},fixCols:()=>{const t=[],e=[];Array.from(w.childrenHolder.children).forEach(e=>{e.classList.contains("col-component")&&t.push(e)});const n=Math.floor(12/t.length);return t.forEach((t,r)=>{const o=l.M.get("components",t.dataset.id);o&&e.push(new S.A({componentId:o.id,key:"lg",value:n}))}),R&&(R.destroy(),R=null,b()),{sizes:e}}},destroy:()=>{g&&g.destroy(),M.A.unSubscribe("elements:draggable:start",f),m.removeEventListener("mouseover",b)},remove:()=>{m.remove()},onSelect:t=>{m.classList.add(t)},onDeselect:t=>{m.classList.remove(t)},onChanges:()=>{w.isInDom()&&function t(){const e=w.get().props;if(e.expand_image_for_outlook)if(e.background&&e.background.properties&&e.background.properties.src){const n=document.createElement("img"),r=m.getBoundingClientRect();n.width=r.width,n.style.height="auto",n.src=e.background.properties.src,document.body.appendChild(n),n.addEventListener("load",()=>{if(0===n.height)return t();const e=n.height;m.style.minHeight=e+"px",n.remove()})}else m.style.minHeight="auto"}()},render:()=>{if((0,a.A)(m,{style:w.props.style}),w.props.expand_image_for_outlook){const t=document.createElement("img");t.style.position="fixed",t.style.top="-9999px",t.style.left="-9999px",t.style.width=w.props.style.width,t.style.height="auto",t.src=w.props.background.properties.src,document.body.appendChild(t),t.onload=()=>{const e=window.getComputedStyle(t);m.style.minHeight=e.height,t.remove()}}else m.style.minHeight="auto"}});return w};var H=n(40156),P=n(66358),D={};D.setAttributes=g(),D.insert=f().bind(null,"head"),D.domAPI=h(),D.insertStyleElement=y();d()(P.A,D);const $=P.A&&P.A.locals?P.A.locals:void 0,j=t=>{let e;new s.A;const n=(0,i.A)(t.classList,$.template),l=(0,o.A)("div",(0,r.A)({},t,{className:n})),c=(0,o.A)("div",{className:`html-component ${$.codeBlock}`,lg:t.props.lg||null,"data-id":t.id},l);const d=(0,o.A)("paper-button",{onClick:function(){document.fullscreenElement!==c?c.requestFullscreen():document.exitFullscreen&&document.exitFullscreen()},className:$.fullScreenBtn},(0,o.A)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"},(0,o.A)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,o.A)("path",{d:"M20 3h2v6h-2V5h-4V3h4zM4 3h4v2H4v4H2V3h2zm16 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z"})));!function n(){(0,H.A)("https://ace.c9.io/build/src/ace.js",()=>{(0,H.A)("https://cdnjs.cloudflare.com/ajax/libs/ace/1.4.11/ext-language_tools.js",()=>{if(!window.ace||window.ace&&"function"!=typeof window.ace.edit)return console.error("Cant load code component"),setTimeout(()=>{n()},500),null;e=window.ace.edit(l,{theme:"ace/theme/monokai",mode:"ace/mode/html",showPrintMargin:!0,wrap:!0,autoScrollEditorIntoView:!0,enableSnippets:!0,allowFullscreen:!0}),e.getSession().setUndoManager(null),e.setValue(t.props.code.html.replace(/&lt;/g,"<"),t.props.code.html.lengths),e.getSession().on("change",function(t){var n=e.getSession().getValue();E.Ay.store().execCommand("code",{html:n},{find:"html"})}),l.appendChild(d)})})}();const p={set:(t,n,r)=>{switch(n){case"code":return document.activeElement.closest(".html-component")||(e.setValue(r.html.replace(/&lt;/g,"<"),r.html.length),e.focus()),t[n]=r,!0;case"style":return t[n]=r,(0,a.A)(l,{style:t[n]}),!0;default:return!1}}},h=(0,B.n)({id:t.id,name:t.type,atomElement:l,destroy:()=>{"function"==typeof e.destroy&&e.destroy()},remove:()=>{c.remove()},onSelect:t=>{c.classList.add(t)},onDeselect:t=>{c.classList.remove(t)},draggable:{group:"element"},droppable:{group:"element"},handleBar:!0,elementProps:t,template:c,validator:p,schema:t.schema,defaultProps:{code:{html:""}}});return h};var F=n(11113),U={};U.setAttributes=g(),U.insert=f().bind(null,"head"),U.domAPI=h(),U.insertStyleElement=y();d()(F.A,U);const q=F.A&&F.A.locals?F.A.locals:void 0;var W=n(79071);const V=t=>{new s.A;const e=(0,i.A)("iframe-component",t.classList,q.main);t.style.display||(t.style.display="block"),t.style.margin||(t.style.margin="auto"),t.style.maxWidth||(t.style.maxWidth="100%");const n=()=>(0,o.A)("div",{className:(0,i.A)(q.emptyIframeHolder,"placeholder")},(0,o.A)("cdtr-col",{lg:"12",md:"12",sm:"12"},(0,o.A)("h1",{align:"center"},(0,o.A)("lang-text",{text:"this_is_empty_iframe_start_add_url_link"}))),(0,o.A)("cdtr-col",{sm:"12",lg:"12",md:"12"},(0,o.A)("cdtr-input",{onChange:t=>E.Ay.store().execCommand("src",t.target.value),style:"text-align:left;direction:ltr;width:290px;",placeholder:"https://",autoFocus:"true"}))),r=(0,o.A)("iframe",{src:t.src,style:t.style}),c=(0,o.A)("cdtr-row",{style:{height:"100%"},alignItems:t.props.alignItems,justify:t.justify||"center"},(0,o.A)("div",{style:{position:"relative",maxWidth:"100%",height:"100%",width:"100%"}},r,(0,o.A)("cdtr-move-handle-bar",{for:t.id}))),d=(0,o.A)("cdtr-col",{"data-id":t.id,"draggable-element":"element","droppable-element":"element",className:e},c,t.props.src?null:n()),p={set:(t,e,o)=>{switch(e){case"src":return t[e]=o,(0,a.A)(r,{src:o}),r.onload=()=>{const t=d.querySelector(".placeholder"),e=r.getBoundingClientRect();o&&!t&&e.width>500?d.appendChild(n()):o&&t?t.remove():!o&&t||!o&&!t&&e.width>500&&d.appendChild(n())},r.onerror=()=>{(0,a.A)(r,{src:""})},!0;case"style":return t[e]=k()(t[e],o),(0,a.A)(r,{style:t[e]}),!0;default:return!1}}},h=(0,W.A)(d,t,p);h.onSelect=t=>{d.classList.add(t)},h.remove=()=>{d.remove()},h.onDeselect=t=>{d.classList.remove(t)};const u={execCommand:(t,e)=>E.Ay.store().execCommand(t,e)};h.createEditor=t=>(t=>{let{component:e,commands:n}=t;const r=()=>e.props.style||{},o=t=>/[a-z%]/i.test(String(t))?String(t):`${t}px`;return{select:t=>{let{changeTab:e,tab:n}=t;n.text||e("style")},tabs:t=>{const e=[{text:"style"},{text:"settings"}];return e.forEach(e=>e.selected=e.text===(t||"style")),e},layout:t=>{let{tab:i}=t;const a=()=>"style"===i.text;return[{type:"input",title:"url",active:a,value:e.props.src||"",onChange:t=>n.execCommand("src",t.target.value)},{type:"slider",title:"width",unit:"px",min:100,max:1200,active:a,value:parseInt(r().width,10)||400,sizes:[{name:"100%",value:"100%"},{name:l.M.get("lang","fullscreen")||"Fullscreen",value:"100vw"}],onInput:t=>n.execCommand("style",{width:o(t.target.value)})},{type:"slider",title:"height",unit:"px",min:100,max:1e3,active:a,value:parseInt(r().height,10)||300,sizes:[{name:"100%",value:"100%"},{name:l.M.get("lang","fullscreen")||"Fullscreen",value:"100vh"}],onInput:t=>n.execCommand("style",{height:o(t.target.value)})},{type:"divider",active:a},{type:"input",title:"margin",active:()=>"settings"===i.text,value:r().margin||"",onChange:t=>n.execCommand("style",{margin:t.target.value})}]}}})({component:h,commands:u,...t});const f=l.M.get("config","editor","configure","plugins"),m=Array.isArray(f)?f.findIndex(e=>e.name===t.type):-1;return m>-1&&(f[m].createEditor=h.createEditor),h.commands={...h.commands||{},remove:()=>E.Ay.removeComponent({componentId:t.id})},h};var Y=n(59929);const X=t=>new Proxy(t,{});var Z=n(69172),K=n(82706);const J=(t,e,n)=>{const r={key:e,value:n};return(0,K.F6)(Z.XW.api_url+Z.JZ.components+`/${t}`,r)},G=t=>{const e=new s.A,n=(0,o.A)("cdtr-background-element",(0,r.A)({onDelete:()=>{(t=>{const e={id:t};return(0,K.bE)(`${Z.XW.api_url+Z.JZ.components}/getParent`,e)})(t.id).then(e=>{if(e&&e.data&&e.data.id){const i=n.closest(`[_id='${e.data.id}']`);i&&(r=t.id,o=i.id,(0,K.jd)(Z.XW.api_url+Z.JZ.components+`/${r}`,{parentId:o}))}var r,o})}},t));return{element:n,props:X(t,{set:(r,o,i)=>{switch(o){case"backgroundVideo":return r[o]=i,(0,a.A)(n,{backgroundVideo:i}),e.run(()=>{J(t.id,"backgroundVideo",i)}),!0;case"is_removed":return(0,a.A)(n,{is_removed:i}),!0;case"style":return r[o]=k()(r[o],i),(0,a.A)(n,{style:r[o]}),e.run(()=>{J(t.id,"style",r[o])}),!0;default:return!1}}})}};class Q extends Y.WF{constructor(){super(),this.items=[{text:l.M.get("lang","edit_background")},{text:l.M.get("lang","delete_bcakground"),value:"delete"}]}render(){return Y.qy`<vaadin-context-menu
1753
1753
  @item-selected=${t=>{"delete"===t.detail.value.value&&this.dispatchEvent(new CustomEvent("delete"),{})}}
1754
1754
  .items=${this.items}
1755
1755
  >
@@ -1769,7 +1769,7 @@
1769
1769
  width: 100%;
1770
1770
  position: absolute;
1771
1771
  }
1772
- `,customElements.define("cdtr-background-element",Q);var tt=n(90069),et={};et.setAttributes=g(),et.insert=f().bind(null,"head"),et.domAPI=h(),et.insertStyleElement=y();d()(tt.A,et);const nt=tt.A&&tt.A.locals?tt.A.locals:void 0,rt=t=>{new s.A;const e=(0,i.A)("row-component",t.classList,nt.root),n=(0,o.A)("cdtr-row",{justify:"center",style:t.props.style,"data-type":t.type,"data-id":t.id,className:e},t.children),r={set:(t,e,r)=>"style"===e&&(t[e]=r,(0,a.A)(n,{style:t[e]}),!0)};return(0,B.n)({id:t.id,name:t.type,allowSortable:!0,validator:r,template:n,childrenHolder:n,elementProps:t,destroy:()=>{},remove:()=>{n.remove()},onSelect:t=>{},onDeselect:t=>{}})};var ot=n(60932),it={};it.setAttributes=g(),it.insert=f().bind(null,"head"),it.domAPI=h(),it.insertStyleElement=y();d()(ot.A,it);const at=ot.A&&ot.A.locals?ot.A.locals:void 0,st=t=>{let{event:e,compose:n}=t;const{key:r,target:o,ctrlKey:i}=e;if(i){const t=n.closest("col");if(!t)return;const e=t.props.justify;"ArrowLeft"===r?"flex-end"===e?E.EN.store().execCommand("justify","center",{find:"col"}):E.EN.store().execCommand("justify","flex-start",{find:"col"}):"ArrowRight"===r&&("flex-start"===e?E.EN.store().execCommand("justify","center",{find:"col"}):E.EN.store().execCommand("justify","flex-end",{find:"col"}));const o=E.EN.getEditor().find(t=>"resizeable"===t.name);o&&o.editor.rePosition()}},lt=t=>{let{component:e,commands:n}=t;const r=()=>Array.isArray(e.props.items)?e.props.items:[],o=()=>r()[0]?.style||{},i=t=>{const e=r().map(e=>({...e,style:{...e.style||{},...t}}));n.execCommand("items",e)};return{select:t=>{let{changeTab:e,tab:n}=t;n.text||e("style")},tabs:t=>{const e=[{text:"style"},{text:"links"},{text:"settings"}];return e.forEach(e=>e.selected=e.text===(t||"style")),e},layout:t=>{let{tab:a}=t;const s=()=>"style"===a.text,l=()=>"settings"===a.text,c=()=>"links"===a.text;return[...r().flatMap((t,e)=>[{type:"info",text:t.text||`#${e+1}`,active:c},{type:"linkpicker",active:c,href:t.onClick?.link,protocol:t.onClick?.link?.protocol,target:t.onClick?.link?.target,onChange:t=>((t,e)=>{const o=r().map((n,r)=>r===t?{...n,onClick:{...n.onClick||{},link:e}}:{...n});n.execCommand("items",o)})(e,t.target.value)},{type:"divider",active:c}]),{type:"dropdown",title:"alignment",active:s,selected:e.props.justify||"flex-start",value:e.props.justify||"flex-start",items:[{value:"flex-start"},{value:"center"},{value:"flex-end"}],onChange:t=>n.execCommand("justify",t.target.value)},{type:"colorpicker",title:"textColor",active:s,value:o().color||"#000000",onChange:t=>i({color:t.target.value})},{type:"colorpicker",title:"background",active:s,value:o().backgroundColor||"transparent",onChange:t=>i({backgroundColor:t.target.value})},{type:"slider",title:"fontSize",min:10,max:48,active:s,value:parseInt(o().fontSize,10)||16,onInput:t=>i({fontSize:`${t.target.value}px`})},{type:"fontFamily",active:s,value:o().fontFamily,weight:!0,weightValue:o().fontWeight,onChange:t=>i({fontFamily:t.target.value}),onWeightChange:t=>i({fontWeight:t.detail.value})},{type:"divider",active:s},{type:"slider",title:"width",unit:"px",min:100,max:1200,active:l,value:parseInt(e.props.style?.width,10)||300,onInput:t=>n.execCommand("style",{width:t.target.value+"px"})},{type:"input",title:"marginBottom",active:l,value:e.props.style?.marginBottom||"",onChange:t=>n.execCommand("style",{marginBottom:t.target.value})}]}}},ct=t=>{const{children:e,bottomSpacing:a="20px",editor:c}=t,d=(new s.A,(0,i.A)("menu-component",t.classList,at.main)),p=(t.props,(0,o.A)("cdtr-menu-editor",{style:{width:"100%"}}));p.onChangeText=(e,n,r)=>{const o=p.items.findIndex(t=>t.id===r.id);if(r){const n=JSON.parse(JSON.stringify(p.items));n[o].text=e,c.store().execCommand2({transactions:[{key:"items",value:n,type:t.type}]})}};const h=e=>{if(e&&e.editor&&Array.isArray(e.editor.components)){if(!e.editor.components.find(e=>e.id===t.id)&&Array.isArray(p.items)){const t=[...p.items];t.forEach(t=>t.selected=!1),p.items=t}}};n.e(4109).then(n.t.bind(n,14109,23)).then(()=>{c.on("select",h),p.spacing="20px",p.translates={add:l.M.get("lang","add"),placeholder:"...",remove:l.M.get("lang","remove"),info:l.M.get("lang","drag_to_move_click_to_options")},p.onFocus=()=>{p.focused=!0},p.onBlur=(t,e)=>{p.focused=!1},p.justify=t.justify,p.items=t.props.items,p.onAdd=(t,e)=>{if(p.items.length>8)throw new Error("now the limit is 8");t.text="";const n=[...p.items];n.forEach(t=>t.selected=!1),n.length>0&&(t.style=n[0].style,t.selected=!0),n.unshift(t),c.store().execCommand("items",n)},p.onRemove=t=>{const e=JSON.parse(JSON.stringify(p.items)),n=e.findIndex(e=>e.id===t.id);-1!==n&&(e.splice(n,1),c.store().execCommand("items",e))},p.onSort=t=>{c.store().execCommand("items",t)},p.onSelect=t=>{const e=[...p.items],n=e.find(e=>e.id===t.id);n&&(e.forEach(t=>t.selected=!1),n.selected=!0),p.items=e,A.props.items=e}});const u=(0,o.A)("cdtr-move-handle-bar",{className:(0,i.A)(at.handle)}),f=(0,o.A)("div",{className:at.burger,"aria-hidden":"true"},(0,o.A)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"35",height:"35"},(0,o.A)("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"}))),m=t=>{const e=Array.isArray(t)?t[0]?.style?.color:null;f.querySelector("path")?.setAttribute("fill",e||"#000000")};m(t.props.items);const g=(0,o.A)("div",{className:at.menuWrap,style:{width:"100%"}},p,f),b=(0,o.A)("cdtr-row",{alignItems:"center",style:{height:"100%"},justify:"flex-start"},g),y=(0,o.A)("div",{"data-type":t.type,"data-id":t.id,"draggable-element":"element",style:{width:"100%"}},u,(0,o.A)("nav",(0,r.A)({},t,{className:d}),b)),w={set:(e,n,r)=>{switch(n){case"style":return e[n]=k()(e[n],r),t.props.style=r,!0;case"items":return p.items=r,e[n]=r,m(r),!0;case"justify":return e[n]=r,p.justify=r,!0;default:return!1}}},A=(0,W.A)(y,t,w),x={execCommand:(t,e)=>c.store().execCommand(t,e)};A.createEditor=t=>lt({component:A,commands:x,...t});const _=l.M.get("config","editor","configure","plugins"),v=Array.isArray(_)?_.findIndex(e=>e.name===t.type):-1;return v>-1&&(_[v].createEditor=A.createEditor),A.onKeyUp=st,A.onSelect=e=>{y.classList.add(e),u.setAttribute("for",t.id)},A.destroy=()=>{c.off("select",h)},A.remove=()=>{y.remove()},A.onDeselect=t=>{y.classList.remove(t)},A.commands={...A.commands||{},remove:()=>c.removeComponent({componentId:t.id})},A};var dt=n(40120),pt=n(15035);const ht=t=>{let{item:e,index:n}=t;E.Ay.components.forEach(t=>{if("form"===t.type){const r=t.props.items;t.props.items[n]&&"button"!==t.props.items[n].type&&n++;let o=null,i={},a={};const s=r.find(t=>"input"===t.type),l=r.find(t=>t?.props?.label_field);switch(s&&s.props.style&&(a=s.props.style),l&&l&&l?.props?.label_field?.props.style&&(i=l.props.label_field.props.style),e.type){case"input":["type","id","name","paramName","inputType"].forEach(t=>{if(!e[t])throw new Error(`'${t}' is required`)}),o=(0,pt.v)(e,{fieldStyle:a,labelStyle:i});break;case"textarea":["type","id","name","paramName"].forEach(t=>{if(!e[t])throw new Error(`'${t}' is required`)}),o=(0,pt.v)(e,{labelStyle:i,fieldStyle:a});break;case"checkbox":case"toggle":["type","id","name","paramName"].forEach(t=>{if(!e[t])throw new Error(`'${t}' is required`)}),o=(0,pt.v)(e,{labelStyle:i});break;case"radio-group":if(["type","id","name","paramName","items"].forEach(t=>{if(!e[t])throw new Error(`'${t}' is required`)}),!Array.isArray(e.items))throw new Error("'array of items' is required");if(e.items.length>10)throw new Error("'items' should not be more than 10");e.items.forEach(t=>{["label","value"].forEach(e=>{if(!t[e])throw new Error(`'${e}' is required`)}),t={id:t.id||null,label:t.label||t.name,value:t.value}}),o=(0,pt.v)(e,{labelStyle:i});break;case"menu":case"dropdown":if(["type","id","name","paramName","items"].forEach(t=>{if(!e[t])throw new Error(`'${t}' is required`)}),!Array.isArray(e.items))throw new Error("'array of items' is required");if(e.items.length>150)throw new Error("'items' should not be more than 10");e.items.forEach(t=>{["value"].forEach(e=>{if(!t[e])throw new Error(`'${e}' is required`)}),t={id:t.id||null,name:t.label||t.name,value:t.value}}),o=(0,pt.v)(e,{labelStyle:i});break;default:return void console.warn("unknown type in form creator.")}r.splice(n>r.length?r.length-1:n,0,o),E.Ay.store().updateComponent(t,"items",r)}})};function ut(t,e){E.Ay.dispatch(`form:field:${t}`,{field:e,action:t})}var ft=n(32325),mt=n(50220),gt=n(25879);const bt=["input","textarea","checkbox","toggle","radio-group","dropdown"],yt=["text","email","tel","number","url"],wt=new Set(["radio-group","dropdown"]),At=t=>t.map(t=>({value:t,label:t})),xt=t=>String(t||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"");function _t(){let{target:t,field:e=null,onSubmit:n,onCancel:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=!!e;let i=null;const a={id:e?.id||null,type:e?.type||"input",label:e?.label||"",name:e?.name||"",paramName:e?.paramName||`field_${Math.random().toString(36).slice(2,8)}`,inputType:e?.inputType||"text",items:e?.items?.length?e.items.map(t=>({label:t.label,value:t.value})):[{label:"",value:""}]};t&&(t.headerText=o?"edit_field":"add_field");const s="rtl"===l.M.get("theme")?.direction?"arrowRight":"arrowLeft",c=()=>{const t=a.name||xt(a.label),r=xt(a.paramName)||t,s={id:a.id||`${t||"field"}_${Date.now()}`,type:a.type,name:t,label:a.label||t,paramName:r};"input"===a.type&&(s.inputType=a.inputType),wt.has(a.type)&&(s.items=a.items.filter(t=>t.label&&t.value).map(t=>({label:t.label,value:t.value})));const l=(c=s).name?c.paramName?"input"!==c.type||c.inputType?!wt.has(c.type)||c.items&&c.items.length?null:"field_options_required":"field_input_type_required":"field_param_required":"field_name_required";var c;if(l)return i=l,void d();i=null,n?.(s,o?e:null)},d=()=>(0,Y.XX)(b(),t),p=t=>e=>{a[t]=e.target.value},h=(t,e)=>n=>{a.items[t][e]=n.target.value},u=t=>{a.type=t.target.value,d()},f=t=>{a.inputType=t.target.value},m=()=>{a.items.push({label:"",value:""}),d()},g=()=>Y.qy`
1772
+ `,customElements.define("cdtr-background-element",Q);var tt=n(90069),et={};et.setAttributes=g(),et.insert=f().bind(null,"head"),et.domAPI=h(),et.insertStyleElement=y();d()(tt.A,et);const nt=tt.A&&tt.A.locals?tt.A.locals:void 0,rt=t=>{new s.A;const e=(0,i.A)("row-component",t.classList,nt.root),n=(0,o.A)("cdtr-row",{justify:"center",style:t.props.style,"data-type":t.type,"data-id":t.id,className:e},t.children),r={set:(t,e,r)=>"style"===e&&(t[e]=r,(0,a.A)(n,{style:t[e]}),!0)};return(0,B.n)({id:t.id,name:t.type,allowSortable:!0,validator:r,template:n,childrenHolder:n,elementProps:t,destroy:()=>{},remove:()=>{n.remove()},onSelect:t=>{},onDeselect:t=>{}})};var ot=n(60932),it={};it.setAttributes=g(),it.insert=f().bind(null,"head"),it.domAPI=h(),it.insertStyleElement=y();d()(ot.A,it);const at=ot.A&&ot.A.locals?ot.A.locals:void 0,st=t=>{let{event:e,compose:n}=t;const{key:r,target:o,ctrlKey:i}=e;if(i){const t=n.closest("col");if(!t)return;const e=t.props.justify;"ArrowLeft"===r?"flex-end"===e?E.EN.store().execCommand("justify","center",{find:"col"}):E.EN.store().execCommand("justify","flex-start",{find:"col"}):"ArrowRight"===r&&("flex-start"===e?E.EN.store().execCommand("justify","center",{find:"col"}):E.EN.store().execCommand("justify","flex-end",{find:"col"}));const o=E.EN.getEditor().find(t=>"resizeable"===t.name);o&&o.editor.rePosition()}},lt=t=>{let{component:e,commands:n}=t;const r=()=>Array.isArray(e.props.items)?e.props.items:[],o=()=>r()[0]?.style||{},i=t=>{const e=r().map(e=>({...e,style:{...e.style||{},...t}}));n.execCommand("items",e)};return{select:t=>{let{changeTab:e,tab:n}=t;n.text||e("style")},tabs:t=>{const e=[{text:"style"},{text:"links"},{text:"settings"}];return e.forEach(e=>e.selected=e.text===(t||"style")),e},layout:t=>{let{tab:a}=t;const s=()=>"style"===a.text,l=()=>"settings"===a.text,c=()=>"links"===a.text;return[...r().flatMap((t,e)=>[{type:"info",text:t.text||`#${e+1}`,active:c},{type:"linkpicker",active:c,href:t.onClick?.link,protocol:t.onClick?.link?.protocol,target:t.onClick?.link?.target,onChange:t=>((t,e)=>{const o=r().map((n,r)=>r===t?{...n,onClick:{...n.onClick||{},link:e}}:{...n});n.execCommand("items",o)})(e,t.target.value)},{type:"divider",active:c}]),{type:"dropdown",title:"alignment",active:s,selected:e.props.justify||"flex-start",value:e.props.justify||"flex-start",items:[{value:"flex-start"},{value:"center"},{value:"flex-end"}],onChange:t=>n.execCommand("justify",t.target.value)},{type:"colorpicker",title:"textColor",active:s,value:o().color||"#000000",onChange:t=>i({color:t.target.value})},{type:"colorpicker",title:"background",active:s,value:o().backgroundColor||"transparent",onChange:t=>i({backgroundColor:t.target.value})},{type:"slider",title:"fontSize",min:10,max:48,active:s,value:parseInt(o().fontSize,10)||16,onInput:t=>i({fontSize:`${t.target.value}px`})},{type:"fontFamily",active:s,value:o().fontFamily,weight:!0,weightValue:o().fontWeight,onChange:t=>i({fontFamily:t.target.value}),onWeightChange:t=>i({fontWeight:t.detail.value})},{type:"divider",active:s},{type:"slider",title:"width",unit:"px",min:100,max:1200,active:l,value:parseInt(e.props.style?.width,10)||300,onInput:t=>n.execCommand("style",{width:t.target.value+"px"})},{type:"input",title:"marginBottom",active:l,value:e.props.style?.marginBottom||"",onChange:t=>n.execCommand("style",{marginBottom:t.target.value})}]}}},ct=t=>{const{children:e,bottomSpacing:a="20px",editor:c}=t,d=(new s.A,(0,i.A)("menu-component",t.classList,at.main)),p=(t.props,(0,o.A)("cdtr-menu-editor",{style:{width:"100%"}}));p.onChangeText=(e,n,r)=>{const o=p.items.findIndex(t=>t.id===r.id);if(r){const n=JSON.parse(JSON.stringify(p.items));n[o].text=e,c.store().execCommand2({transactions:[{key:"items",value:n,type:t.type}]})}};const h=e=>{if(e&&e.editor&&Array.isArray(e.editor.components)){if(!e.editor.components.find(e=>e.id===t.id)&&Array.isArray(p.items)){const t=[...p.items];t.forEach(t=>t.selected=!1),p.items=t}}};n.e(4109).then(n.t.bind(n,14109,23)).then(()=>{c.on("select",h),p.spacing="20px",p.translates={add:l.M.get("lang","add"),placeholder:"...",remove:l.M.get("lang","remove"),info:l.M.get("lang","drag_to_move_click_to_options")},p.onFocus=()=>{p.focused=!0},p.onBlur=(t,e)=>{p.focused=!1},p.justify=t.justify,p.items=t.props.items,p.onAdd=(t,e)=>{if(p.items.length>8)throw new Error("now the limit is 8");t.text="";const n=[...p.items];n.forEach(t=>t.selected=!1),n.length>0&&(t.style=n[0].style,t.selected=!0),n.unshift(t),c.store().execCommand("items",n)},p.onRemove=t=>{const e=JSON.parse(JSON.stringify(p.items)),n=e.findIndex(e=>e.id===t.id);-1!==n&&(e.splice(n,1),c.store().execCommand("items",e))},p.onSort=t=>{c.store().execCommand("items",t)},p.onSelect=t=>{const e=[...p.items],n=e.find(e=>e.id===t.id);n&&(e.forEach(t=>t.selected=!1),n.selected=!0),p.items=e,A.props.items=e}});const u=(0,o.A)("cdtr-move-handle-bar",{className:(0,i.A)(at.handle)}),f=(0,o.A)("div",{className:at.burger,"aria-hidden":"true"},(0,o.A)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"35",height:"35"},(0,o.A)("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"}))),m=t=>{const e=Array.isArray(t)?t[0]?.style?.color:null;f.querySelector("path")?.setAttribute("fill",e||"#000000")};m(t.props.items);const g=(0,o.A)("div",{className:at.menuWrap,style:{width:"100%"}},p,f),b=(0,o.A)("cdtr-row",{alignItems:"center",style:{height:"100%"},justify:"flex-start"},g),y=(0,o.A)("div",{"data-type":t.type,"data-id":t.id,"draggable-element":"element",style:{width:"100%"}},u,(0,o.A)("nav",(0,r.A)({},t,{className:d}),b)),w={set:(e,n,r)=>{switch(n){case"style":return e[n]=k()(e[n],r),t.props.style=r,!0;case"items":return p.items=r,e[n]=r,m(r),!0;case"justify":return e[n]=r,p.justify=r,!0;default:return!1}}},A=(0,W.A)(y,t,w),x={execCommand:(t,e)=>c.store().execCommand(t,e)};A.createEditor=t=>lt({component:A,commands:x,...t});const _=l.M.get("config","editor","configure","plugins"),v=Array.isArray(_)?_.findIndex(e=>e.name===t.type):-1;return v>-1&&(_[v].createEditor=A.createEditor),A.onKeyUp=st,A.onSelect=e=>{y.classList.add(e),u.setAttribute("for",t.id)},A.destroy=()=>{c.off("select",h)},A.remove=()=>{y.remove()},A.onDeselect=t=>{y.classList.remove(t)},A.commands={...A.commands||{},remove:()=>c.removeComponent({componentId:t.id})},A};var dt=n(40120),pt=n(15035);const ht=t=>{let{item:e,index:n}=t;E.Ay.components.forEach(t=>{if("form"===t.type){const r=t.props.items;t.props.items[n]&&"button"!==t.props.items[n].type&&n++;let o=null,i={},a={};const s=r.find(t=>"input"===t.type),l=r.find(t=>t?.props?.label_field);switch(s&&s.props.style&&(a=s.props.style),l&&l&&l?.props?.label_field?.props.style&&(i=l.props.label_field.props.style),e.type){case"input":["type","id","name","paramName","inputType"].forEach(t=>{if(!e[t])throw new Error(`'${t}' is required`)}),o=(0,pt.v)(e,{fieldStyle:a,labelStyle:i});break;case"textarea":["type","id","name","paramName"].forEach(t=>{if(!e[t])throw new Error(`'${t}' is required`)}),o=(0,pt.v)(e,{labelStyle:i,fieldStyle:a});break;case"checkbox":case"toggle":["type","id","name","paramName"].forEach(t=>{if(!e[t])throw new Error(`'${t}' is required`)}),o=(0,pt.v)(e,{labelStyle:i});break;case"radio-group":if(["type","id","name","paramName","items"].forEach(t=>{if(!e[t])throw new Error(`'${t}' is required`)}),!Array.isArray(e.items))throw new Error("'array of items' is required");if(e.items.length>10)throw new Error("'items' should not be more than 10");e.items.forEach(t=>{["label","value"].forEach(e=>{if(!t[e])throw new Error(`'${e}' is required`)}),t={id:t.id||null,label:t.label||t.name,value:t.value}}),o=(0,pt.v)(e,{labelStyle:i});break;case"menu":case"dropdown":if(["type","id","name","paramName","items"].forEach(t=>{if(!e[t])throw new Error(`'${t}' is required`)}),!Array.isArray(e.items))throw new Error("'array of items' is required");if(e.items.length>150)throw new Error("'items' should not be more than 10");e.items.forEach(t=>{["value"].forEach(e=>{if(!t[e])throw new Error(`'${e}' is required`)}),t={id:t.id||null,name:t.label||t.name,value:t.value}}),o=(0,pt.v)(e,{labelStyle:i});break;default:return void console.warn("unknown type in form creator.")}r.splice(n>r.length?r.length-1:n,0,o),E.Ay.store().updateComponent(t,"items",r)}})};function ut(t,e){E.Ay.dispatch(`form:field:${t}`,{field:e,action:t})}var ft=n(32325),mt=n(50220),gt=n(25879);const bt=["input","textarea","checkbox","toggle","radio-group","dropdown"],yt=["text","email","tel","number","url"],wt=new Set(["radio-group","dropdown"]),At=t=>t.map(t=>({value:t,label:t})),xt=t=>String(t||"").trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,""),_t=()=>`field_${Math.random().toString(36).slice(2,8)}`;function vt(){let{target:t,field:e=null,onSubmit:n,onCancel:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const o=!!e;let i=null;const a={id:e?.id||null,type:e?.type||"input",label:e?.label||"",name:e?.name||"",paramName:e?.paramName||_t(),inputType:e?.inputType||"text",items:e?.items?.length?e.items.map(t=>({label:t.label,value:t.value})):[{label:"",value:""}]};t&&(t.headerText=o?"edit_field":"add_field");const s="rtl"===l.M.get("theme")?.direction?"arrowRight":"arrowLeft",c=()=>{const t=xt(a.paramName)||xt(a.label)||_t(),r=a.name||xt(a.label)||t,s={id:a.id||`${r||"field"}_${Date.now()}`,type:a.type,name:r,label:a.label||r,paramName:t};"input"===a.type&&(s.inputType=a.inputType),wt.has(a.type)&&(s.items=a.items.filter(t=>t.label&&t.value).map(t=>({label:t.label,value:t.value})));const l=(c=s).name?c.paramName?"input"!==c.type||c.inputType?!wt.has(c.type)||c.items&&c.items.length?null:"field_options_required":"field_input_type_required":"field_param_required":"field_name_required";var c;if(l)return i=l,void d();i=null,n?.(s,o?e:null)},d=()=>(0,Y.XX)(b(),t),p=t=>e=>{a[t]=e.target.value},h=(t,e)=>n=>{a.items[t][e]=n.target.value},u=t=>{a.type=t.target.value,d()},f=t=>{a.inputType=t.target.value},m=()=>{a.items.push({label:"",value:""}),d()},g=()=>Y.qy`
1773
1773
  ${(0,gt.A)({level:6,text:"field_options"})}
1774
1774
  <cdtr-editor-container>
1775
1775
  ${a.items.map((t,e)=>Y.qy`<div
@@ -1854,7 +1854,7 @@
1854
1854
  </div>`:null}
1855
1855
  </div>
1856
1856
  </div>
1857
- `;d()}var vt=n(29811),kt={};kt.setAttributes=g(),kt.insert=f().bind(null,"head"),kt.domAPI=h(),kt.insertStyleElement=y();d()(vt.A,kt);const Ct=vt.A&&vt.A.locals?vt.A.locals:void 0;var Et=n(73890);function St(t){const{props:e,commands:r,justify:i,items:a,editor:s,store:l,schema:c}=t,{style:d,classList:p=[]}=e;t.automations||(t.automations={});const h=(0,o.A)("div",null,(0,o.A)("cdtr-block-loader",null),(0,o.A)("cdtr-title",null,(0,o.A)("lang-text",{text:"please_wait_downloading_new_version"}))),u=(0,o.A)("cdtr-form-builder",{className:Ct.form},h);n.e(2550).then(n.t.bind(n,12550,23)).then(()=>{h.remove(),u.style.outlineOffset="10px",u.style.display="block",u.language=l.get("config","language"),u.autoComplete="off",u.spacing=2,u.theme={palette:{primary:{main:"#845EC2"}}},u.formStyle=t.style,u.onSelectField=(t,e)=>{const n=[...u.items];l.get("ctrlKey")?n[t].selected=!n[t].selected:(n.forEach(t=>t.selected=!1),n[t].selected=!0),u.items=n,s.dispatch("update")},u.onSortEnd=t=>{let{items:e}=t;s.store().updateComponent(x,"items",e)},u.items=t.items});const f=(0,o.A)("cdtr-move-handle-bar",null),m=(0,o.A)("cdtr-editor-bar",{opened:!1,direction:"left",offsetY:60,componentId:t.id},(0,o.A)("cdtr-tooltip",{content:"form:manage_fields"},(0,o.A)("paper-button",{class:Ct.button,onClick:()=>y()},(0,o.A)("cdtr-icon",{width:"36",height:"36",icon:"createField"}))),(0,o.A)("cdtr-tooltip",{content:"design_form"},(0,o.A)("paper-button",{onClick:()=>{const t=x.closest("card");t&&s.clean().selectComponent(t)},class:Ct.button},(0,o.A)("cdtr-icon",{width:"36",height:"36",icon:"designForm"})))),g=(0,o.A)("div",{"data-type":t.type,"data-id":t.id,"draggable-element":"element","droppable-element":"element",style:{width:"100%"},className:p.concat("form-component").join(" ")},u,f,m),b={set:(t,e,n)=>{switch(e){case"onSubmit":return u.onSubmit=t[e],!0;case"items:v":return u.items=[],t[e]=r.cloneDeep(n),u.items=t[e],!0;case"items":return r.debounce(()=>{u.items=[],t[e]=r.cloneDeep(n),u.items=t[e]},10),!0;case"automations":return t[e]=r.deepMerge(t[e],n),!0;case"display":return t[e]=r.deepMerge(t[e]||{},n),!0;case"style":return t[e]=r.deepMerge(t[e],n),u.formStyle=t[e],!0;default:return!0}}};m.opened=!1;const y=()=>{const e=t.schema??(l.get("config","editor","configure","plugins")||[]).find(t=>t&&"form"===t.name),n=e?.configure?.fields;if(!n)return void console.warn("[form] manage fields: no form plugin schema available (fields missing)");const r=(0,o.A)("cdtr-drawer",{backdropColor:"#000000a1",width:"400px",style:{direction:"var(--direction-locale)"}});r.opened=!0,r.headerText="available_fields",document.body.appendChild(r);const i={fields:n.map(t=>{const e=u.items.find(e=>e.id===t.id);return t.inserted=!!e,t}),onChange:(t,e,n)=>{const r=u.items.findIndex(e=>e.id===t.id);if(e&&-1===r){const e=u.items.findIndex(t=>t.selected)||u.items.length-1;ht({item:t,index:e}),ut("insert",t)}else if(!e&&-1!==r){if("button"===u.items[r]?.type)return t.inserted=!0,void d(i.fields);const e=[...u.items];e.splice(r,1),s.updateComponent(x,"items",e),ut("remove",t)}},onCreate:async(t,e)=>{const r=e?"update":"create",o=await async function(t,e){E.Ay.dispatch(`form:field:${t}`,{field:e,action:t});const n=E.Ay.formHooks||{},r="create"===t?n.onFieldCreate:"update"===t?n.onFieldUpdate:"delete"===t?n.onFieldDelete:null;if("function"!=typeof r)return e;try{const n="delete"===t?e.id:e,o=await r(n);return"delete"===t?e:o&&"object"==typeof o?o:e}catch(t){return M.A.dispatch("snackbar",{text:t&&t.message||"field_change_rejected"}),null}}(r,t);if(!o)return;const a=i.fields.find(t=>t.id===o.id);a?Object.assign(a,o):(o.inserted=!0,i.fields.push(o),n.push(o));const l=u.items.findIndex(t=>t.id===o.id);if(-1===l){const t=u.items.findIndex(t=>t.selected)||u.items.length-1;ht({item:o,index:t})}else{const t=[...u.items];t.splice(l,1),s.updateComponent(x,"items",t),ht({item:o,index:l})}a&&(a.inserted=!0),d(i.fields)}},a=()=>d(i.fields),c=function(){return _t({target:r,field:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,onSubmit:i.onCreate,onCancel:a})},d=t=>{r.headerText="available_fields";(0,Y.XX)((0,Et.A)({items:t,onChange:i.onChange,debounce:t=>{let{target:e}=t;const n=e.value,r=i.fields.filter(t=>-1!==t.name.indexOf(n));d(r)},onAdd:()=>c(),onEdit:t=>c(t)}),r)};d(i.fields),r.addEventListener("close",()=>{r.remove()},{once:!0})},w=function(t){let{debounce:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s.components.forEach(e=>{if("form"===e.type){const n=JSON.parse(JSON.stringify(e.props.items));let r=0;const o=()=>{r=n.length};for(;r<n.length;r++){const i=n[r];i.props.label_field||(i.props.label_field={props:{inline:!1,style:{},text:""}}),i.props.label_field.props||(i.props.label_field={props:{inline:!1,style:{},text:""}}),i.props.label_field.props.style||(i.props.label_field.props.style={}),"menu"!==i.type&&"dropdown"!==i.type||(i.props.triggerProps||(i.props.triggerProps={}),i.props.triggerProps.style||(i.props.triggerProps.style={})),t(i,{stop:o,items:n,compose:e})}s.store().updateComponent(e,"items",n)}})};let A=!1;const x=(0,B.n)({name:"form",id:t.id,template:g,atomElement:u,defaultProps:{style:{},classList:[],items:[]},schema:c,onSelect:e=>{m.opened=!0,m.componentId=x.closest("card")?.id||t.id},onDeselect:t=>{m.opened=!1},elementProps:t,createEditor:t=>{let{component:e,props:n,commands:r,helpers:o}=t;const i={BUTTONS:["button"],INPUTS:["input","textarea"],TOGGLES:["radio-group","checkbox","toggle"],MENUS:["dropdown","menu"]},a=e.props.items?.find(t=>t.selected);if(!a)return{};function l(){return c?.configure?.mailingLists.map(t=>({...t,value:t.label}))}return{select:t=>{let{changeTab:e,tab:n}=t;"style"!==n.text&&e("style")},tabs:t=>{const e=[{text:"style"},{text:"list-settings"},{text:"automations"},{text:"settings"}];return e.forEach(e=>e.selected=e.text===t),e},layout:t=>{let{tab:n,changeTab:r,tabs:d}=t;if("automations"!==n.text){const t=e?.props?.automations?.when?.submitted?.then?.sendMail;if(t?.to?.length){const e=t.to.filter(t=>"string"==typeof t&&""!==t.trim());e.length!==t.to.length&&s.store().execCommands({key:"automations",value:n=>o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:{...t,to:e}}}}}),options:{find:"form"}})}}const p=e?.props?.display||{},h=p.mode||"inline",u=t=>s.store().execCommands({key:"display",value:e=>o.deepMerge(e.props.display||{},t),options:{find:"form"}}),f=[{type:"heading",level:6,text:"form_behavior",active:"style"===n.text},{type:"dropdown",title:"display_mode",active:"style"===n.text,value:h,selected:h,items:[{key:"display_inline",value:"inline"},{key:"display_modal",value:"modal"}],onChange:t=>{u({mode:t.target.value}),r("style")}},{type:"slider",title:"open_delay_seconds",inputType:"number",min:0,max:60,active:"style"===n.text&&"modal"===h,value:p.delaySeconds??3,onInput:t=>{u({delaySeconds:parseFloat(t.target.value)})}},{type:"heading",level:6,text:"settings",active:"style"===n.text&&"button"===a.type},{type:"input",title:"text:button",active:"style"===n.text&&"button"===a.type,value:a.props.text,onInput:t=>{const e=t.target.value;w(t=>{t.selected&&"button"===t.type&&(t.props.text=e)},{debounce:!0})}},{type:"heading",level:6,text:"field_settings",active:"list-settings"===n.text&&"button"!==a.type},{type:"input",title:"label",active:"button"!==a.type&&"list-settings"===n.text,value:a?.props?.label_field?.props?.text,onInput:t=>{const e=t.target.value;w(t=>{t.selected&&"button"!==t.type&&(t.props.label_field.props.text=e)},{debounce:!0})}},{type:"input",title:"placeholder",active:i.INPUTS.includes(a.type)&&"list-settings"===n.text,value:a.props.placeholder,onInput:t=>{const e=t.target.value;w(t=>{i.INPUTS.includes(t.type)&&t.selected&&"button"!==t.type&&(t.props.placeholder=e)},{debounce:!0})}},{type:"checkbox",title:"checkbox_checked_as_default",checked:a.props.checked,active:["toggle","checkbox"].includes(a.type)&&"list-settings"===n.text,onChange:t=>{const e=t.target.checked;w(t=>{t.selected&&i.TOGGLES.includes(t.type)&&(t.props.checked=e)})}},{type:"checkbox",title:"checkbox_on_right_side",checked:!0===a.props.labelPlacement,active:"checkbox"===a.type&&"list-settings"===n.text,onChange:t=>{const e=t.target.checked;w(t=>{t.selected&&"checkbox"===t.type&&(t.props.labelPlacement=e?"start":"end")})}},{type:"stringListBuilder",title:"items_in_menu",active:(i.MENUS.includes(a.type)||"radio-group"===a.type)&&"list-settings"===n.text,items:a.props.items,changeItemValue:(t,e,n)=>{w(n=>{n!==a&&n.id!==a.id||(n.props.items[t].label=e)})}},{type:"heading",level:6,text:"typography",active:"style"===n.text},{type:"fontFamily",active:"style"===n.text,value:a?.props?.style?.fontFamily||a?.props?.label_field?.props?.style.fontFamily,weight:!0,weightValue:a?.props?.style?.fontWeight||a?.props?.label_field?.props?.style.fontWeight,onChange:t=>{const e=t.target.value;(0,dt.sw)({cssRule:e}),e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.fontFamily=e:i.TOGGLES.includes(a.type)&&a.id===t.id?(t.props.label_field.props.style.fontFamily=e,t.props.style.fontFamily=e):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type)&&(i.MENUS.includes(t.type)?t.props.triggerProps.style.fontFamily=e:(t.props.label_field.props.style.fontFamily=e,t.props.style.fontFamily=e))},{debounce:!0})},onWeightChange:t=>{const e=t.detail.value;e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.fontWeight=e:i.TOGGLES.includes(a.type)&&a.id===t.id?(t.props.label_field.props.style.fontWeight=e,t.props.style.fontWeight=e):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type)&&(i.MENUS.includes(t.type)?t.props.triggerProps.style.fontWeight=e:(t.props.label_field.props.style.fontWeight=e,t.props.style.fontWeight=e))},{debounce:!0})}},{type:"slider",title:"fontSize",max:30,min:8,active:"style"===n.text,value:parseInt(a.props?.style.fontSize)||parseInt(a?.props?.label_field?.props?.style.fontSize)||16,onInput:t=>{const e=t.target.value+"px";e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.fontSize=e:(i.TOGGLES.includes(a.type)&&a.id===t.id||[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type))&&(t.props.label_field.props.style.fontSize=e)},{debounce:!0})}},{type:"typography",active:"style"===n.text,bold:700===a.props?.style?.fontWeight||700===a.props?.label_field?.props?.style?.fontWeight,italic:"italic"===a.props?.style?.fontStyle||"italic"===a.props?.label_field?.props.style?.fontStyle,underline:"underline"===a.props?.style?.textDecoration||"underline"===a.props?.label_field?.props?.style?.textDecoration,onChange:t=>{function e(e){switch(t){case"bold":e.fontWeight=null===e.fontWeight?700:null;break;case"italic":e.fontStyle=null===e.fontStyle?"italic":null;break;case"underline":e.textDecoration="underline"===e.textDecoration?null:"underline"}}w(t=>{"checkbox"===a.type?t.selected&&"checkbox"===t.type&&e(t.props.label_field.props.style):t.selected&&"button"===a.type&&"button"===t.type?e(t.props.style):"button"!==a.type&&"button"!==t.type&&(!t.selected||"menu"!==t.type&&"dropdown"!==t.type?t.selected&&e(t.props.label_field.props.style):e(t.props.label_field.props.style))},{debounce:!0})}},{type:"heading",level:6,text:"colors",active:"style"===n.text},{type:"colorpicker",title:"color:label",active:"style"===n.text,value:a.props?.label_field?.props?.style?.color||a.props?.style.color,onChange:t=>{const e=t.target.value;e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.color=e:(i.TOGGLES.includes(a.type)&&a.id===t.id||[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type))&&(t.props.label_field.props.style.color=e)},{debounce:!0})}},{type:"colorpicker",title:"component_color",active:()=>"style"===n.text&&i.TOGGLES.includes(a?.type),value:a.props?.style.color,onChange:t=>{const e=t.target.value;e&&w(t=>{i.TOGGLES.includes(a.type)&&a.id===t.id&&(t.props.style.color=e)},{debounce:!0})}},{type:"colorpicker",title:"button"===a.type?"background":"form:background",active:"style"===n.text&&-1!==[...i.BUTTONS,...i.INPUTS,...i.MENUS].indexOf(a.type),value:a.props?.triggerProps?.style?.background||a.props?.style?.background,onChange:t=>{const e=t.target.value;e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.background=e:[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type)&&(i.MENUS.includes(t.type)?t.props.triggerProps.style.background=e:t.props.style.background=e)})}},{type:"colorpicker",title:"form:placeholder_color",active:"style"===n.text&&-1!==[...i.INPUTS,...i.MENUS].indexOf(a.type),value:a.props?.style?.color,onChange:t=>{const e=t.target.value;e&&w(t=>{i.INPUTS.includes(t.type)&&i.INPUTS.includes(a.type)?t.props.style.color=e:i.MENUS.includes(t.type)&&i.MENUS.includes(a.type)&&(t.props.triggerProps.style.color=e)},{debounce:!0})}},{type:"heading",level:6,text:"dimensions",active:"style"===n.text},{type:"slider",title:"height",max:70,min:20,active:"style"===n.text&&["input",...i.MENUS,...i.BUTTONS].includes(a.type),value:parseInt(a.props.style.minHeight)||parseInt(a?.props?.triggerProps?.style.minHeight)||40,onInput:t=>{const e=t.target.value+"px";e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?(delete t.props.style.height,t.props.style.minHeight=e):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type)&&(i.MENUS.includes(t.type)?t.props.triggerProps.style.minHeight=e:delete t.props.style.height,t.props.style.minHeight=e)},{debounce:!0})}},{type:"slider",title:"radius",max:50,min:0,active:"style"===n.text&&[...i.INPUTS,...i.MENUS,...i.BUTTONS].includes(a.type),value:parseInt(a?.props?.style.borderRadius)||parseInt(a?.props?.triggerProps?.style?.borderRadius)||0,onInput:t=>{const e=t.target.value+"px";e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.borderRadius=e:[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type)&&(i.MENUS.includes(t.type)?t.props.triggerProps.style.borderRadius=e:t.props.style.borderRadius=e)},{debounce:!0})}},{type:"dropdown",title:"type",value:a.props.type,active:()=>"input"===a.type&&"list-settings"===n.text,selected:a.props.type,items:c.types.find(t=>"input"===t.name)?.types.map(t=>new Object({key:t,value:t})),onChange:t=>{const e=t.target.value;w(t=>{"input"===a.type&&t.selected&&"input"===t.type&&(t.props.type=e)},{debounce:!0})}},{type:"input",title:"default_value",active:()=>"input"===a.type&&"list-settings"===n.text,value:a.props.value,onInput:t=>{const e=t.target.value;w(t=>{!t.selected||"input"!==t.type&&"menu"!==t.type&&"dropdown"!==t.type&&"textarea"!==t.type||(t.props.value=e)},{debounce:!0})}},{type:"heading",level:6,text:"properties",active:"list-settings"===n.text&&"button"!==a.type},{type:"checkbox",title:"required",info:"required_form_field_info",checked:a.props.isRequired,controlled:!1,active:"list-settings"===n.text&&"button"!==a.type,onChange:t=>{const e=t.target.checked;w(t=>{t.selected&&(t.props.isRequired=e)})}},{type:"checkbox",title:"hidden_field",info:"hidden_form_field_info",checked:a.props.isHidden,controlled:!1,active:"list-settings"===n.text&&"button"!==a.type,onChange:t=>{const e=t.target.checked;w(t=>{t.selected&&(t.props.isHidden=e)})}},{type:"input",max:1024,title:"url_param",active:"list-settings"===n.text&&"button"!==a.type,value:a.props.paramName,onInput:t=>{let{target:e}=t,n=e.value;n=n.trim().replace(/\s/g,"_"),n=n.replace(/\//g,""),n=n.replace(/\\/g,""),n=n.replace(/[^a-zA-Z0-9_\-]/g,"");w((t,r)=>{let{stop:o,items:i}=r;i.find(t=>t.paramName===n)||t.selected&&"button"!==t.type&&(t.props.paramName=e.value=n,o())})}},{type:"heading",level:6,text:"after_submission",active:"automations"===n.text},{type:"dropdown",title:"after_submission",active:()=>(A=!!e?.props?.automations?.when?.submitted?.then?.redirect?.url,"automations"===n.text),selected:e?.props?.automations?.when?.submitted?.then?.redirect?.url?"redirect":"stay_at_page",value:A?"redirect":"stay_at_page",items:[{value:"stay_at_page",key:"stay_at_page"},{value:"redirect",key:"redirect",selected:!!e?.props?.automations?.when?.submitted?.then?.redirect?.url}],onChange:t=>{"redirect"===t.target.value?(A=!0,r("automations")):(A=!1,s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{redirect:{url:null}}}}}),options:{find:"form"}}),r("automations"))}},{type:"input",title:"where_to_redirect",max:1024,value:e?.props?.automations?.when?.submitted?.then?.redirect?.url||"",active:!0===A&&"automations"===n.text,autofocus:!1==!!e?.props?.automations?.when?.submitted?.then?.redirect?.url,onChange:t=>{let{target:e}=t;const n=e.value,r=new o.Url(n);if(""===r.href)return A=!1,s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{redirect:{url:null}}}}}),options:{find:"form"}});A=!0,s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{redirect:{url:r.href}}}}}),options:{find:"form"}})}},{type:"checkbox",title:"forward_params",checked:e?.props?.automations?.when?.submitted?.then?.redirect?.forward_params||!1,active:!0===A&&"automations"===n.text,onChange:t=>{let{target:e}=t;const n=e.checked;s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{redirect:{forward_params:n}}}}}),options:{find:"form"}})}},{type:"heading",level:6,text:"select_mailing_lists",active:"automations"===n.text},{type:"chipsInput",removeable:!1,active:"automations"===n.text,title:"add_user_from_mailinglist_after_subscribed",onCreate:()=>{c?.configure?.mailingListEvents?.create({name:"hello",resolve:()=>{},reject:()=>{}})},onChange:t=>{const n=e.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const n=e.props.automations?.when?.submitted?.then?.add?.to?.mailingLists,r=n.findIndex(e=>e.key===t.key);-1!==r?n.splice(r,1):n.push({key:t.key}),s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{add:{to:{mailingLists:n}}}}}}),options:{find:"form"}})}else s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{add:{to:{mailingLists:[{key:t.key}]}}}}}}),options:{find:"form"}})},list:function(){const t=l(),n=e.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const e=t;return n.forEach(t=>{const n=e.find(e=>e.key===t.key);n&&(n.inserted=!0)}),e}return[...t]}(),items:function(){const t=l(),n=e.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const e=[];return n.forEach(n=>{const r=t.find(t=>t.key===n.key);r&&(r.inserted=!0,e.push(r))}),e}return[]}()},{type:"chipsInput",removeable:!1,active:"automations"===n.text,title:"remove_user_from_mailinglist_after_subscribed",onChange:t=>{const n=e.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const n=e.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists,r=n.findIndex(e=>e.key===t.key);-1!==r?n.splice(r,1):n.push({key:t.key}),s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{remove:{from:{mailingLists:n}}}}}}),options:{find:"form"}})}else s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{remove:{from:{mailingLists:[{key:t.key}]}}}}}}),options:{find:"form"}})},list:function(){const t=l(),n=e.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const e=t;return n.forEach(t=>{const n=e.find(e=>e.key===t.key);n&&(n.inserted=!0)}),e}return t}(),items:function(){const t=l(),n=e.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const e=[];return n.forEach(n=>{const r=t.find(t=>t.key===n.key);r&&(r.inserted=!0,e.push(r))}),e}return[]}()},{type:"heading",level:6,text:"automations",active:"automations"===n.text},{type:"input",max:1024,active:"automations"===n.text,value:e?.props?.automations?.when?.submitted?.then?.sendParams?.url,placeholder:"URL...",title:"send_the_data_to",onInput:t=>{let{target:e}=t;const n=e.value,r={method:"post",url:new o.Url(n).href,type:"http"};s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{sendParams:r}}}}),options:{find:"form"}})}},{type:"stringListBuilder",title:"send_mail_on_submitted",active:"automations"===n.text,placeholder:"example@email.com",inputType:"email",items:e?.props?.automations?.when?.submitted?.then?.sendMail?.to||[""],changeItemValue:(t,e,n)=>{s.store().execCommands({key:"automations",value:n=>{let r=n?.props?.automations?.when?.submitted?.then?.sendMail;if(r)return r.to[t]=e,o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:r}}}})},options:{find:"form"}})},onRemove:(t,e)=>{s.store().execCommands({key:"automations",value:e=>{let n=e?.props?.automations?.when?.submitted?.then?.sendMail;if(n)return n.to.splice(t,1),o.deepMerge(e.props.automations,{when:{submitted:{then:{sendMail:n}}}})},options:{find:"form"}})},onAddItem:()=>{s.store().execCommands({key:"automations",value:t=>{let e=t?.props?.automations?.when?.submitted?.then?.sendMail;return e||(e={to:[],html:"",text:"",subject:"",from:""}),e.to.push(""),o.deepMerge(t.props.automations,{when:{submitted:{then:{sendMail:e}}}})},options:{find:"form"}})},onChange:(t,e,n)=>{s.store().execCommands({key:"automations",value:n=>{const r=n.props.automations.when.submitted.then.sendMail;return r.to[t]=e,o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:r}}}})},options:{find:"form"}})}}];return f}}},commands:{select:t=>{m.opened=!0},deSelect:t=>{m.opened=!1},deSelectedField:()=>{u.items.forEach(t=>{t.selected=!1}),x.props.items=u.items}},globalCommands:{},remove:()=>{g.remove()},destroy:()=>{},validator:b});return x}var Mt=n(21663),Bt=n(98352),Tt=n.n(Bt),Lt=n(83235),Ot=n(4982),It=n.n(Ot);const Nt={deepMerge:k(),mergeDiff:a.A,deepEqual:It(),cloneDeep:Tt(),arrayToString:i.A},Rt=t=>{const{type:e,children:n,props:c}=t,d={mergeDiff:a.A,deepMerge:k(),isRtl:Mt.A,arrayToString:i.A,cloneDeep:Tt(),isImage:Lt.A,debounce:(new s.A).run,snackbar:t=>M.A.dispatch("snackbar",{text:t})},p={...t,...c,commands:d,editor:E.Ay,store:l.M},h={block:()=>(0,o.A)(z,p,n),row:()=>(0,o.A)(rt,p,n),"menu-widget":()=>(0,o.A)(ct,p,n),background:()=>(0,o.A)(G,p),form:()=>{const t=l.M.get("config","editor"),e=t?.configure?.plugins;if(!e)return;const i=e.find(t=>"form"===t.name),a=(0,o.A)(St,(0,r.A)({schema:i},p),n);return a&&"function"==typeof a.createEditor&&i&&(i.createEditor=a.createEditor),a},iframe:()=>(0,o.A)(V,p),html:()=>(0,o.A)(j,p)};if(h[e])return"function"==typeof h[e]?h[e]():h[e];{const n=l.M.get("config","editor","configure","plugins")||[],r=l.M.get("config","channel"),o=n.find(t=>t.name===e);if(o&&o.name&&o.lazy&&"function"==typeof o.lazy){const i=o=>{const i=n.findIndex(t=>t.name===e);if(-1===i)return void console.error("scheme not found when resolving component",e);const a=o.create({compose:p,createElement:B.n,helpers:Nt,channel:r});a.type=e,a.createEditor&&(n[i].createEditor=a.createEditor),"function"==typeof o.menu&&(n[i].menu=o.menu);try{const h=l.M.get("components",t.id);if(!h)return console.error("element not found during lazy load","#8l#$f"),null;function u(){h.element.parentElement&&h.element.parentElement.replaceChild(a.element,h.element),h.element.remove()}"cdtr-block-loader"===h.element.localName&&(h.element.onLoad=()=>{u()},h.element.isConnected&&u())}catch(f){console.error("lazy load replace failed",f,e)}const s=l.M.get("components"),c=s[t.id],d=t=>Array.isArray(t)&&t.length>0&&t.every(t=>"string"==typeof t);c&&(d(c.children)&&!d(a.children)&&(a.children=c.children),d(c.elements)&&!d(a.elements)&&(a.elements=c.elements)),s[t.id]=a,l.M.set({components:s})};return o.lazy(i),{name:o.name,id:t.id,element:(()=>{const e=document.createElement("cdtr-block-loader");return e.setAttribute("data-component-type",t.type),e})()}}if(o&&o.create){const t=o.create({compose:p,createElement:B.n,helpers:Nt,channel:r});return t.type=e,t&&"object"==typeof t&&"function"==typeof t.createEditor&&(o.createEditor=t.createEditor),t}}};var zt=n(98829);const Ht=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=n=>{if(!n||n.is_removed)return;if(n.props||(n.props={}),"string"==typeof n)return n;n._id&&(n.id=n._id),t.id&&(n.parentId=t.id),n.children&&(n.__children=[...n.children].map(t=>{if(t)return t.id||t._id})),n.elements&&(n.__elements=[...n.elements].map(t=>{if(t)return t.id||t._id}));const{children:i,elements:a}=Ht(n,e);n.props.style&&"object"==typeof n.props.style&&Object.keys(n.props.style).forEach(t=>{null!==n.props.style[t]&&void 0!==n.props.style[t]||delete n.props.style[t]});const s=(0,o.A)(Rt,(0,r.A)({},n,{elements:a,"data-id":n.id,"data-type":n.type,silent:e.silent}),i);if(s&&!0!==e.silent)(t=>{(t=>{t.props&&(t.props.interactions||(t.props.interactions=[]),void 0===t.props.show_on_desktop&&(t.props.show_on_desktop=!0),void 0===t.props.show_on_tablet&&(t.props.show_on_tablet=!0),void 0===t.props.show_on_mobile&&(t.props.show_on_mobile=!0))})(t);const{props:e,element:n,id:r,extend:o,parentId:i,__children:a,__elements:s}=t,c=l.M.get("components");window.location.href.includes("localhost")&&(window.components=c);const d={id:r,...t,props:e,children:a||[],elements:s||[]};c[r]=d})({...n,...s});else if(!s)return console.error("unresolved compose",n,n.type),null;return s.element};return"object"==typeof t&&(t=JSON.parse(JSON.stringify(t))),t.children&&(t.children=t.children.map(n)),t.elements&&(t.elements=t.elements.map(n)),t};const Pt=t=>{!function(t){t.forEach(t=>{t.props||(t.props={}),t.props.style||(t.props.style={}),t.id||(t._id?t.id=t._id:console.error("component must have id")),t._id||(t._id=t.id)})}(t);let e,n=t.findIndex(t=>"root"===t.type);-1===n&&(n=t.findIndex(t=>"section"===t.type)),-1!==n&&([e]=t.splice(n,1),e.props.datasetId||(e.props.datasetId=crypto.randomUUID()));const r=e=>{if(e)return Array.isArray(e.children)&&e.children.length>0&&(e.children_ids=e.children,e.children=e.children.map(o=>{if(Array.isArray(o))return;if(!o)return;const i=t.find(t=>t._id===o);if(!i)return void console.error(`[buildComponentTree] MISSING child "${o}" referenced by ${e.type} ${e._id} — it exists as a child-id but not as a component in the loaded doc, so it will not render.`);n(i);const a=r(i);return a&&a.children&&(i.children=a.children),a&&a.elements&&(i.elements=a.elements),i})),Array.isArray(e.elements)&&e.elements.length>0&&(e.elements=e.elements.map(o=>{const i=t.find(t=>t._id===o);if(!i)return void console.error(`[buildComponentTree] MISSING element "${o}" referenced by ${e.type} ${e._id} — layer-2 element id has no matching component, so it will not render.`);n(i);const a=r(i);return a&&a.elements&&(i.elements=a.elements),a&&a.children&&Array.isArray(e.children)&&e.children.length>0&&(i.children=a.children),i})),e;function n(t){if(!t)return;"text"===t.type&&t.props?.text&&"string"==typeof t.props.text&&(t.props.text=((t,e)=>{if("text"===t&&"string"==typeof e)try{return JSON.parse(e)}catch(t){(0,zt.v)({error_code:"#11jhb",info:t,msg:"could not parse text in transformValues",s:"E"})}return e})("text",t.props.text)),"form"===t.type&&Array.isArray(t.props?.items)&&t.props.items.forEach(t=>{const e=t?.props?.style?.fontFamily;e&&(0,dt.sw)({cssRule:e})});const e=t.props?.style?.fontFamily;e&&(0,dt.sw)({cssRule:e})}};if(e){const t=r(e);t.children&&(e.children=t.children)}return e}},83860(t,e,n){"use strict";n.d(e,{D$:()=>s});var r=n(86319);const o={mobile:"sm"};function i(){if("web"!==r.M.get("config","channel"))return null;const t=r.M.get("deviceFilter")||"all";return o[t]||null}function a(t,e,n){const r=i();if(!r)return null;if("style"!==e&&"text"!==e)return null;const o=t?.props?.breakpoints||{},a=o[r]||{};let s;return s="style"===e?{...a,style:{...a.style||{},...n}}:{...a,text:n},{key:"breakpoints",value:{...o,[r]:s}}}function s(t,e,n){return a(t,e,n)||{key:e,value:n}}},15604(t,e,n){"use strict";n.d(e,{Ay:()=>B,EN:()=>M});var r=n(81840),o=n(4952),i=n(86319),a=n(12106),s=n(18057),l=n(29780),c=n(98829),d=n(93432);const p=class{constructor(t,e,n,r,o){this.component=t,this.color=e,this.userId=n,this.name=r,this.componentId=o,this.borderElement=null,this.isDestroyed=!1,this.createBorder(),this.updatePosition(),this.attachListeners()}createBorder(){this.borderElement=document.createElement("div"),this.borderElement.style.position="absolute",this.borderElement.style.pointerEvents="none",this.borderElement.style.border=`2px solid ${this.color}`,this.borderElement.style.zIndex="0",this.borderElement.style.transition="all 0.01s ease-out",document.body.appendChild(this.borderElement),this.labelElement=document.createElement("div"),this.labelElement.textContent=this.name,this.labelElement.style.position="absolute",this.labelElement.style.pointerEvents="none",this.labelElement.style.backgroundColor=this.color,this.labelElement.style.color="#fff",this.labelElement.style.padding="2px 6px",this.labelElement.style.fontSize="11px",this.labelElement.style.fontWeight="500",this.labelElement.style.borderRadius="3px",this.labelElement.style.zIndex="0",this.labelElement.style.whiteSpace="nowrap",this.labelElement.style.transition="all 0.01s ease-out",this.labelElement.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.labelElement),this.updatePosition()}updatePosition(){if(this.isDestroyed||!this.component.element)return;const t=this.component.element.getBoundingClientRect();if(this.borderElement.style.top=t.top+"px",this.borderElement.style.left=t.left+"px",this.borderElement.style.width=t.width+"px",this.borderElement.style.height=t.height+"px",this.labelElement){const e=t.top-20,n=e<0?t.top+2:e;this.labelElement.style.top=n+"px",this.labelElement.style.left=t.left+t.width/6+"px"}}attachListeners(){this.boundUpdatePosition=this.updatePosition.bind(this),window.addEventListener("scroll",this.boundUpdatePosition,!0),window.addEventListener("resize",this.boundUpdatePosition),this.mutationObserver=new MutationObserver(this.boundUpdatePosition),this.component.element&&this.mutationObserver.observe(this.component.element,{attributes:!0,attributeFilter:["style","class"]})}remove(){this.isDestroyed=!0,window.removeEventListener("scroll",this.boundUpdatePosition,!0),window.removeEventListener("resize",this.boundUpdatePosition),this.mutationObserver&&this.mutationObserver.disconnect(),this.borderElement&&this.borderElement.parentNode&&this.borderElement.parentNode.removeChild(this.borderElement),this.labelElement&&this.labelElement.parentNode&&this.labelElement.parentNode.removeChild(this.labelElement),this.borderElement=null,this.labelElement=null,this.component=null}},h=[];function u(){return h}function f(t){h.push(t)}function m(t){const e=h.findIndex(e=>e?.userId===t);-1!==e&&(h[e].borderSelected.remove(),h.splice(e,1))}function g(){h.forEach(t=>{t.borderSelected.updatePosition()})}var b=n(4217),y=n(69172);function w(t){const{type:e,componentId:n,parentId:r,newParentId:o}=t,a=i.M.get("components",n);if(!a)return!0;if("MOVE"===e)return a.parentId===o;const s=i.M.get("components",r);if(!s)return!0;const l=Array.isArray(s.children)&&s.children.includes(n)||Array.isArray(s.elements)&&s.elements.includes(n);return"ADD"===e?l:!l}function A(t){if(t.disconnectedAt){if(Date.now()-t.disconnectedAt>t.maxDisconnectTime)return console.error("%cDisconnected too long, reload required","color:red"),t.isReconnecting=!1,i.M.set({wsConnection:{status:"failed",message:"Disconnected for too long. Please reload the page to ensure data sync."}}),void(0,l.U)("updateNeeded")}if(t.reconnectAttempts>=t.maxReconnectAttempts)return console.error("%cMax reconnection attempts reached","color:red"),t.isReconnecting=!1,i.M.set({wsConnection:{status:"failed",message:"Unable to reconnect to server"}}),void(0,l.U)(500);t.reconnectAttempts++;const e=1===t.reconnectAttempts?0:Math.min(t.reconnectDelay*Math.pow(2,t.reconnectAttempts-2),3e4);0===e?console.log(`%cAttempting to reconnect immediately (${t.reconnectAttempts}/${t.maxReconnectAttempts})`,"color:orange"):console.log(`%cAttempting to reconnect (${t.reconnectAttempts}/${t.maxReconnectAttempts}) in ${e}ms`,"color:orange"),i.M.set({wsConnection:{status:"reconnecting",attempts:t.reconnectAttempts,nextAttemptIn:e}}),t.reconnectTimer=setTimeout(()=>{t.wsConnectionProps&&(console.log("%cReconnecting...","color:orange"),v(t,t.wsConnectionProps))},e)}function x(t){t.reconnectTimer&&(clearTimeout(t.reconnectTimer),t.reconnectTimer=null),t.isReconnecting=!1}function _(t,e){try{console.log("WS MESSAGE RECEIVED:",e.data);const n=JSON.parse(e.data);u();if(n.transactions)return n.transactions.forEach(e=>{switch(e.type){case"SELECT_ELEMENT":{const r=t.getComponent(e.componentId);if(r){m(n.user.id);const t=function(t,e,n,r,o){return new p(t,e,n,r,o)}(r,n.user.color,n.user.id,n.user.name,e.componentId);f({userId:n.user.id,componentId:e.componentId,borderSelected:t})}break}case"USER_JOINED":{const t=i.M.get("connectedUsers")||[];i.M.set({connectedUsers:[...t,e.user]});break}case"USER_LEFT":{const t=i.M.get("connectedUsers")||[];i.M.set({connectedUsers:t.filter(t=>t.userId!==e.user.userId)}),m(e.user.userId);break}case"SESSION_INITIALIZED":{const n=t.wsConnectionProps?.userId,r=e.users.filter(t=>t.userId!==n);i.M.set({connectedUsers:r});break}case"PATCH":t.updateComponent(e.componentId,e.key,e.value,{silent:!0,sync:!1});break;case"MOVE":if(w(e))break;t.moveComponent({componentId:e.componentId,newParentId:e.newParentId,newIndex:e.newIndex,oldIndex:e.oldIndex,oldParentId:e.oldParentId,direction:e.direction,fromLayer:e.fromLayer,toLayer:e.toLayer},{sync:!1});break;case"CREATE":t.createComponent({componentId:e.componentId,parentId:e.parentId,index:e.index,body:e.body},{sync:!1,clone:!0});break;case"ADD":if(w(e))break;t.addComponent({componentId:e.componentId,parentId:e.parentId,index:e.index,layer:e.layer},{sync:!1});break;case"REMOVE":if(w(e))break;t.removeComponent({componentId:e.componentId,parentId:e.parentId,index:e.index},{sync:!1})}}),void g();if("transaction:complete"===n.type){const e=n.completed;if(!t.transactions[n.transactionId])return(0,c.v)({msg:"transaction not found to mark as completed",s:"E",info:{tasks:e},error_code:"#c4ca2"}),void console.error("transaction not found to mark as completed");let r=!0;Array.isArray(e)&&e.forEach(t=>{"completed"!==t.status&&(r=!1)}),r?(delete t.transactions[n.transactionId],t.lastSyncTimestamp=Date.now()):((0,c.v)({msg:"some of tasks not completed",s:"E",info:{tasks:e},error_code:"#c4222"}),(0,l.U)(500),console.error("some of tasks not completed",n))}else"notification:reset"===n.type&&(0,l.U)("updateNeeded")}catch(t){(0,c.v)({msg:t.message,s:"E",info:{data:t.stack},error_code:"#c4222"}),console.error(t)}}function v(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{onOpen:n,access:r,userId:o,sessionId:a,avatar:s,name:c}=e;let d;r?d=`app:${r}`:(o||(0,l.U)(401),a||(0,l.U)(401),d=`freesolo?userId=${o}&sessionId=${a}&avatar=${s}&name=${c}`),t.wsConnectionProps=e,x(t),i.M.set({wsConnection:{status:t.isReconnecting?"reconnecting":"connecting",attempts:t.reconnectAttempts}});const p=t.wsService=new b.w3cwebsocket(`${y.XW.ws_url}/${d}`);p.onopen=()=>{console.log("%cConnected","color:green"),t.wasConnected=!0,t.reconnectAttempts=0,t.isReconnecting=!1,t.disconnectedAt=null,i.M.set({wsConnection:{status:"connected",attempts:0}}),"function"==typeof n&&n()},p.onmessage=e=>_(t,e),p.onclose=e=>{if(console.log("%cWebSocket connection closed","color:orange",e),i.M.set({wsConnection:{status:"disconnected",code:e.code,reason:e.reason}}),!t.wasConnected)return console.error("%cInitial connection failed, not attempting reconnection","color:red"),void(0,l.U)(500);t.disconnectedAt||(t.disconnectedAt=Date.now());[1e3,1008,4401].includes(e.code)?(0,l.U)(500):t.isReconnecting||(t.isReconnecting=!0,A(t))},p.onerror=t=>{console.error("%cWebSocket error:","color:red",t),i.M.set({wsConnection:{status:"error",error:t.message||"WebSocket error occurred"}})}}var k=n(52529),C=n(3832),E=n(81139),S=n(83860);"undefined"!=typeof window&&(window.location?.href?.includes("DEBUG=1"),1)&&(window.__trace__=[]);const M=new class{constructor(t){let{editors:e}=t;this.debounder=new s.A,this.configure={},this.app=new r.A,this.pendingTransactions=[],this.undoRedo=o.A,this.templates={},this.commands={goToError:l.U,logError:c.v},this.wsService={send:t=>console.warn("ws not connected yet, please wait..",t)},window.transactions=this.transactions={},this.withSnapshot=!1,this.editors=[],this.__elements={},this.changes=[],this.globalCommands={bodyWalk:l.S},this.isRealtimeConnected=!1,this.reconnectAttempts=0,this.maxReconnectAttempts=10,this.reconnectDelay=1e3,this.reconnectTimer=null,this.wsConnectionProps=null,this.isReconnecting=!1,this.wasConnected=!1,this.lastSyncTimestamp=Date.now(),this.disconnectedAt=null,this.maxDisconnectTime=3e5,this.connectOnline=t=>{"string"==typeof t&&0!==t.length?v(this,{access:t,onOpen:()=>{this.isRealtimeConnected=!0,this.app.dispatch("ws-loaded",{editor:this})}}):(0,l.U)(401)},this.connectRealtime=t=>{if(t&&"object"==typeof t){const{sessionId:e,avatar:n,name:r}=t,o=(0,a.A)();e||(0,l.U)(401),v(this,{userId:o,sessionId:e,avatar:n,name:r,onOpen:()=>{this.isRealtimeConnected=!0,this.app.dispatch("ws-loaded",{editor:this})}})}},e&&e.forEach(t=>this.addEditor(t)),this.type=null,this.components=[],this.undoRedo.on("ON_REDO",()=>setTimeout(()=>this.updateAll(),200)),this.undoRedo.on("ON_UNDO",()=>setTimeout(()=>this.updateAll(),200)),this.undoRedo.on("ON_SNAPSHOT",t=>{let{deletedSteps:e}=t;Array.isArray(e)&&e.forEach(t=>{t?.stack&&t.stack.forEach(t=>{"CREATE"!==t.type&&"REMOVE"!==t.type||(t.__type=t.type)})})}),this.commitEdits=t=>function(t,e){i.M.get("config","savedDebounce"),t.pendingTransactions.push(...e),t.debounder.run(()=>{t.updateAll([...t.pendingTransactions]),Array.isArray(window.__trace__)&&window.__trace__.push({transactions:[...t.pendingTransactions]}),t.pendingTransactions.forEach(t=>{delete t.newValue,delete t.oldValue});const e={transactions:[...t.pendingTransactions],transactionId:(0,a.A)(),created_at:Date.now()};if(t.transactions[e.transactionId]=[...t.pendingTransactions],t.isRealtimeConnected){const n=JSON.stringify(e);if(t.wsService.readyState===WebSocket.OPEN)try{t.wsService.send(n),console.trace("transactions sent",e.transactions.length),t.pendingTransactions=[],t.transactions[e.transactionId]=[]}catch(t){(0,c.v)({msg:"There is Error on sync data with the server",info:n,error_code:"#c4ca4",s:"E"}),console.warn("error on syncing, sent:",n),(0,l.U)()}else(0,c.v)({msg:"ws not connected",s:"E",info:{connection:t.wsService.readyState},error_code:"#c4ca9"}),console.warn("ws not connected"),(0,l.U)()}})}(this,t),this.updateAll=t=>function(t,e){e&&e.forEach(e=>{const n=t.getComponent(e.componentId);if(n){const t=(n.atomElement||n.element).getBoundingClientRect();n.props.rect=t,n.props.width=t.width,n.props.height=t.height}else console.error("component not found in updateAll",e)}),t.app.dispatch("update",{editor:t}),g();const n=i.M.get("config","editor","props","onSave");"function"==typeof n&&n({transactions:e,toJson:d.U2,toJSON:d.U2,toHTML:d.FE})}(this,t),this.attemptReconnect=()=>A(this),this.cancelReconnect=()=>x(this),this.connectToWSServer=t=>v(this,t),this.addComponent=(t,e)=>(0,k.X8)(this,t,e),this.removeComponent=(t,e)=>(0,k.o$)(this,t,e),this.moveComponent=(t,e)=>(0,k.pp)(this,t,e),this.createComponent=(t,e)=>(0,k.a0)(this,t,e),this.cloneComponent=t=>(0,k.ty)(this,t),this.updateComponent=(t,e,n,r)=>(0,k.ZP)(this,t,e,n,r),this.silentPatch=(t,e,n)=>(0,k.c_)(this,t,e,n),this.selectComponent=(t,e)=>(0,k.Cs)(this,t,e),this.clean=()=>(0,k.uH)(this),this.execCommand2=t=>function(t,e){let{transactions:n,update:r=t.components}=e;const o=[];Array.isArray(r)||(r=[r]),n.forEach(t=>{let{type:e,key:n,value:i}=t;r.forEach(t=>{const r=e?t.closest(e):t;if(r){const t=(0,S.D$)(r,n,i);o.push(new E.A({componentId:r.id,key:t.key,value:t.value}))}})}),t.withSnapshot&&o.length>0?(0,C.Ay)({steps:o,onEnd:e=>{let{steps:n}=e;t.withSnapshot=!1,t.commitEdits(n)}}):o.forEach(e=>{let{componentId:n,key:r,value:a}=e;const s=i.M.get("components",n);s&&(s.props[r]=a,t.commitEdits(o))})}(this,t),this.execCommands=(t,e)=>function(t,e,n){let{components:r=[...t.components],silent:o=!1}=n||{};Array.isArray(r)||(r=[r]),Array.isArray(e)||(e=[e]);const a=[];return e.forEach(e=>{let{componentId:n,key:o,value:i,options:s={}}=e;const{find:l}=s;if(n){let e=i;if("function"==typeof i){const r=t.getComponent(n);e=i(r)}const r=t.getComponent(n),s=r?(0,S.D$)(r,o,e):{key:o,value:e};a.push(new E.A({componentId:n,key:s.key,value:s.value}))}else r.forEach(e=>{if(l){let t=e.closest(l);if(t||(t=e.find(l)),!t)return void console.log("component not found on execCommands",l);e=t}let n=i;if("function"==typeof i&&(n=i(e),null===n))return t;const r=(0,S.D$)(e,o,n);a.push(new E.A({componentId:e.id,key:r.key,value:r.value}))})}),t.withSnapshot&&a.length>0?((0,C.Ay)({steps:a,onEnd:()=>{t.withSnapshot=!1}}),t.commitEdits(a)):a.forEach(e=>{let{componentId:n,key:r,value:o}=e;const s=i.M.get("components",n);s&&(s.props[r]=o,t.commitEdits(a))}),t}(this,t,e)}dispatch(t,e){return this.app.dispatch(t,e),this}on(t,e){this.app.subscribe(t,e)}off(t,e){switch(t){case"update":this.app.unSubscribe("update",e);break;case"select":this.app.unSubscribe("select",e)}}addEditor(t){let{id:e,type:n,name:r,editor:o}=t;this.editors.push({id:e,type:n,name:r,editor:o})}removeEditor(t){let{id:e,name:n,type:r}=t;e&&(this.editors=this.editors.filter(t=>t.id!==e)),n&&(this.editors=this.editors.filter(t=>t.name!==n)),r&&(this.editors=this.editors.filter(t=>t.type!==r))}getComponents(){return i.M.get("components")}getComponent(t){return t?i.M.get("components",t):null}getEditor(t){if(t){const e=this.editors.find(e=>e.name===t);return e?e.editor:null}return this.editors}getSelectedComponent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{find:e=null}=t;if(!e)return this.components;const n=[],r=t=>{t&&t.forEach(t=>{const o=this.getComponent(t);o&&(e?.equalWith(o.type)&&n.push(o),r(o.children))})};return this.components.forEach(t=>{e?.equalWith(t.type)&&n.push(t),t.children&&r(t.children)}),n}saveTemplate(t,e){this.templates[t]=e}getTemplate(t){return this.templates[`style:${t}`]}store(){return this.withSnapshot=!0,this}execCommand(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.execCommands({key:t,value:e,options:n}),this}createschema(t,e){this.__elements[t]=e}getschema(t){return this.__elements[t]}}({}),B=M},52529(t,e,n){"use strict";n.d(e,{X8:()=>b,uH:()=>w,ty:()=>A,a0:()=>v,pp:()=>_,o$:()=>x,iI:()=>g,Cs:()=>y,c_:()=>C,ZP:()=>k});var r=n(86319),o=n(12106),i=n(159),a=n(3832),s=n(98829),l=n(67549);class c{constructor(t){let{componentId:e,parentId:n,index:r,layer:o}=t;this.componentId=e,this.parentId=n,this.index=r,this.type="ADD",this.layer=o}}var d=n(4807),p=n(89531),h=n(3474),u=n(81139),f=n(29780),m=n(83860);function g(t,e){return Array.isArray(t?.elements)&&t.elements.includes(e)?2:1}function b(t,e){let{componentId:n,parentId:o,index:i,layer:s}=e,{sync:l=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const d=r.M.get("components",n),p=r.M.get("components",o);if(!d||!p)return;const h=[new c({componentId:n,parentId:o,index:i,layer:s})];d.parentId=o,2===s?(Array.isArray(p.elements)||(p.elements=[]),p.elements.splice("number"==typeof i?i:p.elements.length,0,n),p.element.appendChild(d.element)):(p.children.splice(i,0,n),p.appendChild(d.element,i)),t.withSnapshot&&h.length>0&&(0,a.Ay)({steps:h,onEnd:()=>t.withSnapshot=!1}),l&&t.commitEdits(h)}function y(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e?(-1!==t.components.findIndex(t=>t.id===e.id)||(e.isSelected=!0,t.type=n.type||e.type,"function"==typeof e.onSelect&&e.onSelect("selected"),t.wsService.send(JSON.stringify({transactions:[{type:"SELECT_ELEMENT",componentId:e.id}]})),t.components.push(e),t.app.dispatch("update",{editor:t,props:n}),t.app.dispatch("select",{editor:t,props:n,component:e,components:t.components})),t):t}function w(t){return t.components.forEach(t=>{t.isSelected=!1,"function"==typeof t.onDeselect&&t.onDeselect("selected")}),t.components=[],t}function A(t,e){let{componentId:n,parentId:i,index:c}=e;const p=[];let h=null;const u=r.M.get("components",n),f=r.M.get("components",i);if(!u||!f)return console.error("component not found");const m=(e,n,i)=>{const a=JSON.parse(JSON.stringify(e.props)),s={id:`cdtr-${(0,o.A)()}`,type:e.type,parentId:n.id,index:i,props:a,children:[]};delete s._id;const l=t.createComponent({body:s,parentId:n.id,index:i,layer:e.layer||1});null===h&&(h=l.id),p.push(new d.A({componentId:l.id,parentId:n.id,index:i,body:s})),e.children&&e.children.forEach((t,e)=>{const n=r.M.get("components",t),o=r.M.get("components",l.id);n&&m(n,o,e)})};if(m(u,f,c),"card"===u.type||"col"===u.type){const t=u.closest("block");if(t){(0,l.s)(t).forEach(t=>{r.M.get("components",t.componentId)?p.push(t):(console.error("col not found for resize on clone"),(0,s.v)({s:"E",error_code:"#ggbbk$",info:{},msg:"col not found for resize on clone"}))})}}(0,a.Ay)({steps:p,update:!0})}function x(t,e){let{componentId:n}=e,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const{sync:e=!0}=o,i=r.M.get("components",n);if(!i)return(0,s.v)({msg:"component not found",error_code:"#e44lk",info:{},s:"E"}),void(0,f.U)();const l=i.parent();if(!l)return t;if(2!==g(l,i.id)){const r=l.children.findIndex(t=>t===i.id);if(r<0)return(0,s.v)({msg:`children index not found for parent ${i.id}: ${r}`,error_code:"#e24lmvD3",info:{data:{componentId:n,parentId:l.id,children:l.children,layer:1}},s:"E"}),(0,f.U)(),t;l.children.splice(r,1);const o=[new p.A({componentId:n,parentId:l.id,index:r,layer:1})];i.remove(),t.withSnapshot&&o.length>0&&(0,a.Ay)({steps:o,onEnd:()=>t.withSnapshot=!1}),e&&t.commitEdits(o)}else{const e=l.elements.findIndex(t=>t===i.id);if(e<0)return(0,s.v)({msg:`parent index not found: ${e}`,error_code:"#eggf4",info:{data:{componentId:n,parentId:l.id,elements:l.elements,layer:2}},s:"E"}),(0,f.U)(),t;l.elements.splice(e,1);const r=[new p.A({componentId:n,parentId:l.id,index:e,layer:2})];i.remove(),t.withSnapshot&&r.length>0&&(0,a.Ay)({steps:r,onEnd:()=>t.withSnapshot=!1}),t.commitEdits(r)}return t}catch(t){(0,s.v)({error_code:"#eggf!!4",msg:t.message,info:{data:t.stack},s:"E"}),(0,f.U)(),console.error(t)}}function _(t,e){let{componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,fromLayer:d,toLayer:p,direction:u}=e,{sync:m=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(-1===c||-1===l)return(0,s.v)({error_code:"#eggf$^4",msg:"invalid index on moveComponent",info:{componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,fromLayer:d,toLayer:p},s:"E"}),(0,f.U)(),null;const g=[new h.A({componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,direction:u,fromLayer:d,toLayer:p})],b=r.M.get("components",i),y=r.M.get("components",o),w=r.M.get("components",n);if(!w||!y||!b)return console.error("component not found on move",`\n componentId: ${n},\n newParentId: ${o},\n oldParentId: ${i},\n newIndex: ${l},\n oldIndex: ${c},\n fromLayer: ${d},\n toLayer: ${p}`),t;try{if(2===d&&2===p)Array.isArray(y.elements)||(y.elements=[]),b.elements.splice(c,1),y.elements.splice(l,0,w.id),y.element.appendChild(w.element);else{let t;b.children.splice(c,1),y.children.splice(l,0,w.id),b.id===y.id&&"block"===y.type&&(t={direction:l>c?"bottom":"top"}),y.appendChild(w.element,l,t)}}catch(t){console.error("appendChild method required for move",y)}return t.withSnapshot&&g.length>0&&(0,a.Ay)({steps:g,onEnd:()=>t.withSnapshot=!1}),w.parentId=o,m&&t.commitEdits(g),t}function v(t,e){let{body:n,parentId:l,index:c,layer:p}=e,{sync:h=!0,clone:u=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const m=r.M.get("components",l);if(!m)return(0,f.U)(),void(0,s.v)({msg:"component not found on create",error_code:"#c49vk",info:{data:{body:n,parentId:l,index:c,layer:p}},s:"E"});n.layer=p||1;const g=t=>{t.id=t._id=u?t.id:`cdtr-${(0,o.A)()}`,t.children&&t.children.forEach(e=>{e.parentId=t.id,g(e)})};g(n),n.children||(n.children=[]),2===p?(Array.isArray(m.elements)||(m.elements=[]),m.elements.splice(c,0,n.id)):m.children.splice(c,0,n.id);const{children:b}=(0,i.X)({children:[n],id:l});requestAnimationFrame(()=>{b[0].scrollIntoView({behavior:"smooth",block:"nearest"})}),m.appendChild(b[0],c);const y=[new d.A({componentId:n.id,parentId:l,body:n,index:c,layer:p})];return h&&t.commitEdits(y),t.withSnapshot&&y.length>0&&(0,a.Ay)({steps:y,onEnd:()=>t.withSnapshot=!1}),r.M.get("components",n.id)}function k(t,e,n,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{sync:l=!0}=i;if("string"==typeof e&&(e=r.M.get("components",e)),!e)return console.error("component not found on update"),(0,s.v)({error_code:"#e@lld",msg:"component not found on update",info:{},s:"E"}),null;const c=(0,m.D$)(e,n,o),d=[new u.A({componentId:e.id,key:c.key,value:c.value&&"object"==typeof c.value?JSON.parse(JSON.stringify(c.value)):c.value})];return t.withSnapshot&&d.length>0?((0,a.Ay)({steps:d,onEnd:()=>{t.withSnapshot=!1}}),l&&t.commitEdits(d)):(e.props[c.key]=c.value,l?t.commitEdits(d):t.updateAll()),t}function C(t,e,n,r){const o=[new u.A({componentId:e.id,key:n,value:r})];t.commitEdits(o)}},29780(t,e,n){"use strict";n.d(e,{S:()=>o,U:()=>i});var r=n(86319);const o=(t,e)=>{t&&(e(t),t.children&&t.children.forEach(t=>{o(t,e)}))},i=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;r.M.get("error","status")||n(50629)(`./${t}`).then(()=>{r.M.set({error:{status:t}}),window.__show_errors=!0;const e=document.createElement(`cdtr-${t}`);document.body.appendChild(e)})}},67549(t,e,n){"use strict";function r(t){const e=[];if(t&&"function"==typeof t.commands.fixCols){t.commands.fixCols().sizes.forEach(t=>e.push(t))}return e}n.d(e,{s:()=>r})},83965(t,e,n){"use strict";n.d(e,{i:()=>i});var r=n(15604),o=n(89531);function i(t){let e=[],n=t;for(;n&&(!n||"section"!==n.type&&"root"!==n.type);){if(0===n.children.length){const t=n.parent(),i=t.children.findIndex(t=>t===n.id);-1!==i&&(e.push(new o.A({componentId:n.id,parentId:t.id,index:i})),r.Ay.removeComponent({componentId:n.id}))}n=n.parent()}return e}},50220(t,e,n){"use strict";n.d(e,{A:()=>o});var r=n(59929);const o=t=>{let e="function"==typeof t.value?t.value(t):t.value;return e||(e=""),r.qy`<cdtr-editor-container>
1857
+ `;d()}var kt=n(29811),Ct={};Ct.setAttributes=g(),Ct.insert=f().bind(null,"head"),Ct.domAPI=h(),Ct.insertStyleElement=y();d()(kt.A,Ct);const Et=kt.A&&kt.A.locals?kt.A.locals:void 0;var St=n(73890);function Mt(t){const{props:e,commands:r,justify:i,items:a,editor:s,store:l,schema:c}=t,{style:d,classList:p=[]}=e;t.automations||(t.automations={});const h=(0,o.A)("div",null,(0,o.A)("cdtr-block-loader",null),(0,o.A)("cdtr-title",null,(0,o.A)("lang-text",{text:"please_wait_downloading_new_version"}))),u=(0,o.A)("cdtr-form-builder",{className:Et.form},h);n.e(2550).then(n.t.bind(n,12550,23)).then(()=>{h.remove(),u.style.outlineOffset="10px",u.style.display="block",u.language=l.get("config","language"),u.autoComplete="off",u.spacing=2,u.theme={palette:{primary:{main:"#845EC2"}}},u.formStyle=t.style,u.onSelectField=(t,e)=>{const n=[...u.items];l.get("ctrlKey")?n[t].selected=!n[t].selected:(n.forEach(t=>t.selected=!1),n[t].selected=!0),u.items=n,s.dispatch("update")},u.onSortEnd=t=>{let{items:e}=t;s.store().updateComponent(x,"items",e)},u.items=t.items});const f=(0,o.A)("cdtr-move-handle-bar",null),m=(0,o.A)("cdtr-editor-bar",{opened:!1,direction:"left",offsetY:60,componentId:t.id},(0,o.A)("cdtr-tooltip",{content:"form:manage_fields"},(0,o.A)("paper-button",{class:Et.button,onClick:()=>y()},(0,o.A)("cdtr-icon",{width:"36",height:"36",icon:"createField"}))),(0,o.A)("cdtr-tooltip",{content:"design_form"},(0,o.A)("paper-button",{onClick:()=>{const t=x.closest("card");t&&s.clean().selectComponent(t)},class:Et.button},(0,o.A)("cdtr-icon",{width:"36",height:"36",icon:"designForm"})))),g=(0,o.A)("div",{"data-type":t.type,"data-id":t.id,"draggable-element":"element","droppable-element":"element",style:{width:"100%"},className:p.concat("form-component").join(" ")},u,f,m),b={set:(t,e,n)=>{switch(e){case"onSubmit":return u.onSubmit=t[e],!0;case"items:v":return u.items=[],t[e]=r.cloneDeep(n),u.items=t[e],!0;case"items":return r.debounce(()=>{u.items=[],t[e]=r.cloneDeep(n),u.items=t[e]},10),!0;case"automations":return t[e]=r.deepMerge(t[e],n),!0;case"display":return t[e]=r.deepMerge(t[e]||{},n),!0;case"style":return t[e]=r.deepMerge(t[e],n),u.formStyle=t[e],!0;default:return!0}}};m.opened=!1;const y=()=>{const e=t.schema??(l.get("config","editor","configure","plugins")||[]).find(t=>t&&"form"===t.name),n=e?.configure?.fields;if(!n)return void console.warn("[form] manage fields: no form plugin schema available (fields missing)");const r=(0,o.A)("cdtr-drawer",{backdropColor:"#000000a1",width:"400px",style:{direction:"var(--direction-locale)"}});r.opened=!0,r.headerText="available_fields",document.body.appendChild(r);const i={fields:n.map(t=>{const e=u.items.find(e=>e.id===t.id);return t.inserted=!!e,t}),onChange:(t,e,n)=>{const r=u.items.findIndex(e=>e.id===t.id);if(e&&-1===r){const e=u.items.findIndex(t=>t.selected)||u.items.length-1;ht({item:t,index:e}),ut("insert",t)}else if(!e&&-1!==r){if("button"===u.items[r]?.type)return t.inserted=!0,void d(i.fields);const e=[...u.items];e.splice(r,1),s.updateComponent(x,"items",e),ut("remove",t)}},onCreate:async(t,e)=>{const r=e?"update":"create",o=await async function(t,e){E.Ay.dispatch(`form:field:${t}`,{field:e,action:t});const n=E.Ay.formHooks||{},r="create"===t?n.onFieldCreate:"update"===t?n.onFieldUpdate:"delete"===t?n.onFieldDelete:null;if("function"!=typeof r)return e;try{const n="delete"===t?e.id:e,o=await r(n);return"delete"===t?e:o&&"object"==typeof o?o:e}catch(t){return M.A.dispatch("snackbar",{text:t&&t.message||"field_change_rejected"}),null}}(r,t);if(!o)return;const a=i.fields.find(t=>t.id===o.id);a?Object.assign(a,o):(o.inserted=!0,i.fields.push(o),n.push(o));const l=u.items.findIndex(t=>t.id===o.id);if(-1===l){const t=u.items.findIndex(t=>t.selected)||u.items.length-1;ht({item:o,index:t})}else{const t=[...u.items];t.splice(l,1),s.updateComponent(x,"items",t),ht({item:o,index:l})}a&&(a.inserted=!0),d(i.fields)}},a=()=>d(i.fields),c=function(){return vt({target:r,field:arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,onSubmit:i.onCreate,onCancel:a})},d=t=>{r.headerText="available_fields";(0,Y.XX)((0,St.A)({items:t,onChange:i.onChange,debounce:t=>{let{target:e}=t;const n=e.value,r=i.fields.filter(t=>-1!==t.name.indexOf(n));d(r)},onAdd:()=>c(),onEdit:t=>c(t)}),r)};d(i.fields),r.addEventListener("close",()=>{r.remove()},{once:!0})},w=function(t){let{debounce:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s.components.forEach(e=>{if("form"===e.type){const n=JSON.parse(JSON.stringify(e.props.items));let r=0;const o=()=>{r=n.length};for(;r<n.length;r++){const i=n[r];i.props.label_field||(i.props.label_field={props:{inline:!1,style:{},text:""}}),i.props.label_field.props||(i.props.label_field={props:{inline:!1,style:{},text:""}}),i.props.label_field.props.style||(i.props.label_field.props.style={}),i.props.style||(i.props.style={}),"menu"!==i.type&&"dropdown"!==i.type||(i.props.triggerProps||(i.props.triggerProps={}),i.props.triggerProps.style||(i.props.triggerProps.style={})),t(i,{stop:o,items:n,compose:e})}s.store().updateComponent(e,"items",n)}})};let A=!1;const x=(0,B.n)({name:"form",id:t.id,template:g,atomElement:u,defaultProps:{style:{},classList:[],items:[]},schema:c,onSelect:e=>{m.opened=!0,m.componentId=x.closest("card")?.id||t.id},onDeselect:t=>{m.opened=!1},elementProps:t,createEditor:t=>{let{component:e,props:n,commands:r,helpers:o}=t;const i={BUTTONS:["button"],INPUTS:["input","textarea"],TOGGLES:["radio-group","checkbox","toggle"],MENUS:["dropdown","menu"]},a=e.props.items?.find(t=>t.selected);if(!a)return{};function l(){return c?.configure?.mailingLists.map(t=>({...t,value:t.label}))}return{select:t=>{let{changeTab:e,tab:n}=t;"style"!==n.text&&e("style")},tabs:t=>{const e=[{text:"style"},{text:"list-settings"},{text:"automations"},{text:"settings"}];return e.forEach(e=>e.selected=e.text===t),e},layout:t=>{let{tab:n,changeTab:r,tabs:d}=t;if("automations"!==n.text){const t=e?.props?.automations?.when?.submitted?.then?.sendMail;if(t?.to?.length){const e=t.to.filter(t=>"string"==typeof t&&""!==t.trim());e.length!==t.to.length&&s.store().execCommands({key:"automations",value:n=>o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:{...t,to:e}}}}}),options:{find:"form"}})}}const p=e?.props?.display||{},h=p.mode||"inline",u=t=>s.store().execCommands({key:"display",value:e=>o.deepMerge(e.props.display||{},t),options:{find:"form"}}),f=[{type:"heading",level:6,text:"form_behavior",active:"style"===n.text},{type:"dropdown",title:"display_mode",active:"style"===n.text,value:h,selected:h,items:[{key:"display_inline",value:"inline"},{key:"display_modal",value:"modal"}],onChange:t=>{u({mode:t.target.value}),r("style")}},{type:"slider",title:"open_delay_seconds",inputType:"number",min:0,max:60,active:"style"===n.text&&"modal"===h,value:p.delaySeconds??3,onInput:t=>{u({delaySeconds:parseFloat(t.target.value)})}},{type:"heading",level:6,text:"settings",active:"style"===n.text&&"button"===a.type},{type:"input",title:"text:button",active:"style"===n.text&&"button"===a.type,value:a.props.text,onInput:t=>{const e=t.target.value;w(t=>{t.selected&&"button"===t.type&&(t.props.text=e)},{debounce:!0})}},{type:"heading",level:6,text:"field_settings",active:"list-settings"===n.text&&"button"!==a.type},{type:"input",title:"label",active:"button"!==a.type&&"list-settings"===n.text,value:a?.props?.label_field?.props?.text,onInput:t=>{const e=t.target.value;w(t=>{t.selected&&"button"!==t.type&&(t.props.label_field.props.text=e)},{debounce:!0})}},{type:"input",title:"placeholder",active:i.INPUTS.includes(a.type)&&"list-settings"===n.text,value:a.props.placeholder,onInput:t=>{const e=t.target.value;w(t=>{i.INPUTS.includes(t.type)&&t.selected&&"button"!==t.type&&(t.props.placeholder=e)},{debounce:!0})}},{type:"checkbox",title:"checkbox_checked_as_default",checked:a.props.checked,active:["toggle","checkbox"].includes(a.type)&&"list-settings"===n.text,onChange:t=>{const e=t.target.checked;w(t=>{t.selected&&i.TOGGLES.includes(t.type)&&(t.props.checked=e)})}},{type:"checkbox",title:"checkbox_on_right_side",checked:!0===a.props.labelPlacement,active:"checkbox"===a.type&&"list-settings"===n.text,onChange:t=>{const e=t.target.checked;w(t=>{t.selected&&"checkbox"===t.type&&(t.props.labelPlacement=e?"start":"end")})}},{type:"stringListBuilder",title:"items_in_menu",active:(i.MENUS.includes(a.type)||"radio-group"===a.type)&&"list-settings"===n.text,items:a.props.items,changeItemValue:(t,e,n)=>{w(n=>{n!==a&&n.id!==a.id||(n.props.items[t].label=e)})}},{type:"heading",level:6,text:"typography",active:"style"===n.text},{type:"fontFamily",active:"style"===n.text,value:a?.props?.style?.fontFamily||a?.props?.label_field?.props?.style?.fontFamily,weight:!0,weightValue:a?.props?.style?.fontWeight||a?.props?.label_field?.props?.style?.fontWeight,onChange:t=>{const e=t.target.value;(0,dt.sw)({cssRule:e}),e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.fontFamily=e:i.TOGGLES.includes(a.type)&&a.id===t.id?(t.props.label_field.props.style.fontFamily=e,t.props.style.fontFamily=e):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type)&&(i.MENUS.includes(t.type)?t.props.triggerProps.style.fontFamily=e:(t.props.label_field.props.style.fontFamily=e,t.props.style.fontFamily=e))},{debounce:!0})},onWeightChange:t=>{const e=t.detail.value;e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.fontWeight=e:i.TOGGLES.includes(a.type)&&a.id===t.id?(t.props.label_field.props.style.fontWeight=e,t.props.style.fontWeight=e):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type)&&(i.MENUS.includes(t.type)?t.props.triggerProps.style.fontWeight=e:(t.props.label_field.props.style.fontWeight=e,t.props.style.fontWeight=e))},{debounce:!0})}},{type:"slider",title:"fontSize",max:30,min:8,active:"style"===n.text,value:parseInt(a.props?.style?.fontSize)||parseInt(a?.props?.label_field?.props?.style?.fontSize)||16,onInput:t=>{const e=t.target.value+"px";e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.fontSize=e:(i.TOGGLES.includes(a.type)&&a.id===t.id||[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type))&&(t.props.label_field.props.style.fontSize=e)},{debounce:!0})}},{type:"typography",active:"style"===n.text,bold:700===a.props?.style?.fontWeight||700===a.props?.label_field?.props?.style?.fontWeight,italic:"italic"===a.props?.style?.fontStyle||"italic"===a.props?.label_field?.props?.style?.fontStyle,underline:"underline"===a.props?.style?.textDecoration||"underline"===a.props?.label_field?.props?.style?.textDecoration,onChange:t=>{function e(e){switch(t){case"bold":e.fontWeight=null===e.fontWeight?700:null;break;case"italic":e.fontStyle=null===e.fontStyle?"italic":null;break;case"underline":e.textDecoration="underline"===e.textDecoration?null:"underline"}}w(t=>{"checkbox"===a.type?t.selected&&"checkbox"===t.type&&e(t.props.label_field.props.style):t.selected&&"button"===a.type&&"button"===t.type?e(t.props.style):"button"!==a.type&&"button"!==t.type&&(!t.selected||"menu"!==t.type&&"dropdown"!==t.type?t.selected&&e(t.props.label_field.props.style):e(t.props.label_field.props.style))},{debounce:!0})}},{type:"heading",level:6,text:"colors",active:"style"===n.text},{type:"colorpicker",title:"color:label",active:"style"===n.text,value:a.props?.label_field?.props?.style?.color||a.props?.style?.color,onChange:t=>{const e=t.target.value;e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.color=e:(i.TOGGLES.includes(a.type)&&a.id===t.id||[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type))&&(t.props.label_field.props.style.color=e)},{debounce:!0})}},{type:"colorpicker",title:"component_color",active:()=>"style"===n.text&&i.TOGGLES.includes(a?.type),value:a.props?.style?.color,onChange:t=>{const e=t.target.value;e&&w(t=>{i.TOGGLES.includes(a.type)&&a.id===t.id&&(t.props.style.color=e)},{debounce:!0})}},{type:"colorpicker",title:"button"===a.type?"background":"form:background",active:"style"===n.text&&-1!==[...i.BUTTONS,...i.INPUTS,...i.MENUS].indexOf(a.type),value:a.props?.triggerProps?.style?.background||a.props?.style?.background,onChange:t=>{const e=t.target.value;e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.background=e:[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type)&&(i.MENUS.includes(t.type)?t.props.triggerProps.style.background=e:t.props.style.background=e)})}},{type:"colorpicker",title:"form:placeholder_color",active:"style"===n.text&&-1!==[...i.INPUTS,...i.MENUS].indexOf(a.type),value:a.props?.style?.color,onChange:t=>{const e=t.target.value;e&&w(t=>{i.INPUTS.includes(t.type)&&i.INPUTS.includes(a.type)?t.props.style.color=e:i.MENUS.includes(t.type)&&i.MENUS.includes(a.type)&&(t.props.triggerProps.style.color=e)},{debounce:!0})}},{type:"heading",level:6,text:"dimensions",active:"style"===n.text},{type:"slider",title:"height",max:70,min:20,active:"style"===n.text&&["input",...i.MENUS,...i.BUTTONS].includes(a.type),value:parseInt(a.props?.style?.minHeight)||parseInt(a?.props?.triggerProps?.style?.minHeight)||40,onInput:t=>{const e=t.target.value+"px";e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?(delete t.props.style.height,t.props.style.minHeight=e):[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type)&&(i.MENUS.includes(t.type)?t.props.triggerProps.style.minHeight=e:delete t.props.style.height,t.props.style.minHeight=e)},{debounce:!0})}},{type:"slider",title:"radius",max:50,min:0,active:"style"===n.text&&[...i.INPUTS,...i.MENUS,...i.BUTTONS].includes(a.type),value:parseInt(a?.props?.style?.borderRadius)||parseInt(a?.props?.triggerProps?.style?.borderRadius)||0,onInput:t=>{const e=t.target.value+"px";e&&w(t=>{i.BUTTONS.includes(a.type)&&i.BUTTONS.includes(t.type)?t.props.style.borderRadius=e:[...i.INPUTS,...i.MENUS].includes(a.type)&&[...i.INPUTS,...i.MENUS].includes(t.type)&&(i.MENUS.includes(t.type)?t.props.triggerProps.style.borderRadius=e:t.props.style.borderRadius=e)},{debounce:!0})}},{type:"dropdown",title:"type",value:a.props.type,active:()=>"input"===a.type&&"list-settings"===n.text,selected:a.props.type,items:c.types.find(t=>"input"===t.name)?.types.map(t=>new Object({key:t,value:t})),onChange:t=>{const e=t.target.value;w(t=>{"input"===a.type&&t.selected&&"input"===t.type&&(t.props.type=e)},{debounce:!0})}},{type:"input",title:"default_value",active:()=>"input"===a.type&&"list-settings"===n.text,value:a.props.value,onInput:t=>{const e=t.target.value;w(t=>{!t.selected||"input"!==t.type&&"menu"!==t.type&&"dropdown"!==t.type&&"textarea"!==t.type||(t.props.value=e)},{debounce:!0})}},{type:"heading",level:6,text:"properties",active:"list-settings"===n.text&&"button"!==a.type},{type:"checkbox",title:"required",info:"required_form_field_info",checked:a.props.isRequired,controlled:!1,active:"list-settings"===n.text&&"button"!==a.type,onChange:t=>{const e=t.target.checked;w(t=>{t.selected&&(t.props.isRequired=e)})}},{type:"checkbox",title:"hidden_field",info:"hidden_form_field_info",checked:a.props.isHidden,controlled:!1,active:"list-settings"===n.text&&"button"!==a.type,onChange:t=>{const e=t.target.checked;w(t=>{t.selected&&(t.props.isHidden=e)})}},{type:"input",max:1024,title:"url_param",active:"list-settings"===n.text&&"button"!==a.type,value:a.props.paramName,onInput:t=>{let{target:e}=t,n=e.value;n=n.trim().replace(/\s/g,"_"),n=n.replace(/\//g,""),n=n.replace(/\\/g,""),n=n.replace(/[^a-zA-Z0-9_\-]/g,"");w((t,r)=>{let{stop:o,items:i}=r;i.find(t=>t.paramName===n)||t.selected&&"button"!==t.type&&(t.props.paramName=e.value=n,o())})}},{type:"heading",level:6,text:"after_submission",active:"automations"===n.text},{type:"dropdown",title:"after_submission",active:()=>(A=!!e?.props?.automations?.when?.submitted?.then?.redirect?.url,"automations"===n.text),selected:e?.props?.automations?.when?.submitted?.then?.redirect?.url?"redirect":"stay_at_page",value:A?"redirect":"stay_at_page",items:[{value:"stay_at_page",key:"stay_at_page"},{value:"redirect",key:"redirect",selected:!!e?.props?.automations?.when?.submitted?.then?.redirect?.url}],onChange:t=>{"redirect"===t.target.value?(A=!0,r("automations")):(A=!1,s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{redirect:{url:null}}}}}),options:{find:"form"}}),r("automations"))}},{type:"input",title:"where_to_redirect",max:1024,value:e?.props?.automations?.when?.submitted?.then?.redirect?.url||"",active:!0===A&&"automations"===n.text,autofocus:!1==!!e?.props?.automations?.when?.submitted?.then?.redirect?.url,onChange:t=>{let{target:e}=t;const n=e.value,r=new o.Url(n);if(""===r.href)return A=!1,s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{redirect:{url:null}}}}}),options:{find:"form"}});A=!0,s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{redirect:{url:r.href}}}}}),options:{find:"form"}})}},{type:"checkbox",title:"forward_params",checked:e?.props?.automations?.when?.submitted?.then?.redirect?.forward_params||!1,active:!0===A&&"automations"===n.text,onChange:t=>{let{target:e}=t;const n=e.checked;s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{redirect:{forward_params:n}}}}}),options:{find:"form"}})}},{type:"heading",level:6,text:"select_mailing_lists",active:"automations"===n.text},{type:"chipsInput",removeable:!1,active:"automations"===n.text,title:"add_user_from_mailinglist_after_subscribed",onCreate:()=>{c?.configure?.mailingListEvents?.create({name:"hello",resolve:()=>{},reject:()=>{}})},onChange:t=>{const n=e.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const n=e.props.automations?.when?.submitted?.then?.add?.to?.mailingLists,r=n.findIndex(e=>e.key===t.key);-1!==r?n.splice(r,1):n.push({key:t.key}),s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{add:{to:{mailingLists:n}}}}}}),options:{find:"form"}})}else s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{add:{to:{mailingLists:[{key:t.key}]}}}}}}),options:{find:"form"}})},list:function(){const t=l(),n=e.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const e=t;return n.forEach(t=>{const n=e.find(e=>e.key===t.key);n&&(n.inserted=!0)}),e}return[...t]}(),items:function(){const t=l(),n=e.props.automations?.when?.submitted?.then?.add?.to?.mailingLists;if(n){const e=[];return n.forEach(n=>{const r=t.find(t=>t.key===n.key);r&&(r.inserted=!0,e.push(r))}),e}return[]}()},{type:"chipsInput",removeable:!1,active:"automations"===n.text,title:"remove_user_from_mailinglist_after_subscribed",onChange:t=>{const n=e.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const n=e.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists,r=n.findIndex(e=>e.key===t.key);-1!==r?n.splice(r,1):n.push({key:t.key}),s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{remove:{from:{mailingLists:n}}}}}}),options:{find:"form"}})}else s.store().execCommands({key:"automations",value:e=>o.deepMerge(e.props.automations,{when:{submitted:{then:{remove:{from:{mailingLists:[{key:t.key}]}}}}}}),options:{find:"form"}})},list:function(){const t=l(),n=e.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const e=t;return n.forEach(t=>{const n=e.find(e=>e.key===t.key);n&&(n.inserted=!0)}),e}return t}(),items:function(){const t=l(),n=e.props.automations?.when?.submitted?.then?.remove?.from?.mailingLists;if(n){const e=[];return n.forEach(n=>{const r=t.find(t=>t.key===n.key);r&&(r.inserted=!0,e.push(r))}),e}return[]}()},{type:"heading",level:6,text:"automations",active:"automations"===n.text},{type:"input",max:1024,active:"automations"===n.text,value:e?.props?.automations?.when?.submitted?.then?.sendParams?.url,placeholder:"URL...",title:"send_the_data_to",onInput:t=>{let{target:e}=t;const n=e.value,r={method:"post",url:new o.Url(n).href,type:"http"};s.store().execCommands({key:"automations",value:t=>o.deepMerge(t.props.automations,{when:{submitted:{then:{sendParams:r}}}}),options:{find:"form"}})}},{type:"stringListBuilder",title:"send_mail_on_submitted",active:"automations"===n.text,placeholder:"example@email.com",inputType:"email",items:e?.props?.automations?.when?.submitted?.then?.sendMail?.to||[""],changeItemValue:(t,e,n)=>{s.store().execCommands({key:"automations",value:n=>{let r=n?.props?.automations?.when?.submitted?.then?.sendMail;if(r)return r.to[t]=e,o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:r}}}})},options:{find:"form"}})},onRemove:(t,e)=>{s.store().execCommands({key:"automations",value:e=>{let n=e?.props?.automations?.when?.submitted?.then?.sendMail;if(n)return n.to.splice(t,1),o.deepMerge(e.props.automations,{when:{submitted:{then:{sendMail:n}}}})},options:{find:"form"}})},onAddItem:()=>{s.store().execCommands({key:"automations",value:t=>{let e=t?.props?.automations?.when?.submitted?.then?.sendMail;return e||(e={to:[],html:"",text:"",subject:"",from:""}),e.to.push(""),o.deepMerge(t.props.automations,{when:{submitted:{then:{sendMail:e}}}})},options:{find:"form"}})},onChange:(t,e,n)=>{s.store().execCommands({key:"automations",value:n=>{const r=n.props.automations.when.submitted.then.sendMail;return r.to[t]=e,o.deepMerge(n.props.automations,{when:{submitted:{then:{sendMail:r}}}})},options:{find:"form"}})}}];return f}}},commands:{select:t=>{m.opened=!0},deSelect:t=>{m.opened=!1},deSelectedField:()=>{u.items.forEach(t=>{t.selected=!1}),x.props.items=u.items}},globalCommands:{},remove:()=>{g.remove()},destroy:()=>{},validator:b});return x}var Bt=n(21663),Tt=n(98352),Lt=n.n(Tt),Ot=n(83235),It=n(4982),Nt=n.n(It);const Rt={deepMerge:k(),mergeDiff:a.A,deepEqual:Nt(),cloneDeep:Lt(),arrayToString:i.A},zt=t=>{const{type:e,children:n,props:c}=t,d={mergeDiff:a.A,deepMerge:k(),isRtl:Bt.A,arrayToString:i.A,cloneDeep:Lt(),isImage:Ot.A,debounce:(new s.A).run,snackbar:t=>M.A.dispatch("snackbar",{text:t})},p={...t,...c,commands:d,editor:E.Ay,store:l.M},h={block:()=>(0,o.A)(z,p,n),row:()=>(0,o.A)(rt,p,n),"menu-widget":()=>(0,o.A)(ct,p,n),background:()=>(0,o.A)(G,p),form:()=>{const t=l.M.get("config","editor"),e=t?.configure?.plugins;if(!e)return;const i=e.find(t=>"form"===t.name),a=(0,o.A)(Mt,(0,r.A)({schema:i},p),n);return a&&"function"==typeof a.createEditor&&i&&(i.createEditor=a.createEditor),a},iframe:()=>(0,o.A)(V,p),html:()=>(0,o.A)(j,p)};if(h[e])return"function"==typeof h[e]?h[e]():h[e];{const n=l.M.get("config","editor","configure","plugins")||[],r=l.M.get("config","channel"),o=n.find(t=>t.name===e);if(o&&o.name&&o.lazy&&"function"==typeof o.lazy){const i=o=>{const i=n.findIndex(t=>t.name===e);if(-1===i)return void console.error("scheme not found when resolving component",e);const a=o.create({compose:p,createElement:B.n,helpers:Rt,channel:r});a.type=e,a.createEditor&&(n[i].createEditor=a.createEditor),"function"==typeof o.menu&&(n[i].menu=o.menu);try{const h=l.M.get("components",t.id);if(!h)return console.error("element not found during lazy load","#8l#$f"),null;function u(){h.element.parentElement&&h.element.parentElement.replaceChild(a.element,h.element),h.element.remove()}"cdtr-block-loader"===h.element.localName&&(h.element.onLoad=()=>{u()},h.element.isConnected&&u())}catch(f){console.error("lazy load replace failed",f,e)}const s=l.M.get("components"),c=s[t.id],d=t=>Array.isArray(t)&&t.length>0&&t.every(t=>"string"==typeof t);c&&(d(c.children)&&!d(a.children)&&(a.children=c.children),d(c.elements)&&!d(a.elements)&&(a.elements=c.elements)),s[t.id]=a,l.M.set({components:s})};return o.lazy(i),{name:o.name,id:t.id,element:(()=>{const e=document.createElement("cdtr-block-loader");return e.setAttribute("data-component-type",t.type),e})()}}if(o&&o.create){const t=o.create({compose:p,createElement:B.n,helpers:Rt,channel:r});return t.type=e,t&&"object"==typeof t&&"function"==typeof t.createEditor&&(o.createEditor=t.createEditor),t}}};var Ht=n(98829);const Pt=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=n=>{if(!n||n.is_removed)return;if(n.props||(n.props={}),"string"==typeof n)return n;n._id&&(n.id=n._id),t.id&&(n.parentId=t.id),n.children&&(n.__children=[...n.children].map(t=>{if(t)return t.id||t._id})),n.elements&&(n.__elements=[...n.elements].map(t=>{if(t)return t.id||t._id}));const{children:i,elements:a}=Pt(n,e);n.props.style&&"object"==typeof n.props.style&&Object.keys(n.props.style).forEach(t=>{null!==n.props.style[t]&&void 0!==n.props.style[t]||delete n.props.style[t]});const s=(0,o.A)(zt,(0,r.A)({},n,{elements:a,"data-id":n.id,"data-type":n.type,silent:e.silent}),i);if(s&&!0!==e.silent)(t=>{(t=>{t.props&&(t.props.interactions||(t.props.interactions=[]),void 0===t.props.show_on_desktop&&(t.props.show_on_desktop=!0),void 0===t.props.show_on_tablet&&(t.props.show_on_tablet=!0),void 0===t.props.show_on_mobile&&(t.props.show_on_mobile=!0))})(t);const{props:e,element:n,id:r,extend:o,parentId:i,__children:a,__elements:s}=t,c=l.M.get("components");window.location.href.includes("localhost")&&(window.components=c);const d={id:r,...t,props:e,children:a||[],elements:s||[]};c[r]=d})({...n,...s});else if(!s)return console.error("unresolved compose",n,n.type),null;return s.element};return"object"==typeof t&&(t=JSON.parse(JSON.stringify(t))),t.children&&(t.children=t.children.map(n)),t.elements&&(t.elements=t.elements.map(n)),t};const Dt=t=>{!function(t){t.forEach(t=>{t.props||(t.props={}),t.props.style||(t.props.style={}),t.id||(t._id?t.id=t._id:console.error("component must have id")),t._id||(t._id=t.id)})}(t);let e,n=t.findIndex(t=>"root"===t.type);-1===n&&(n=t.findIndex(t=>"section"===t.type)),-1!==n&&([e]=t.splice(n,1),e.props.datasetId||(e.props.datasetId=crypto.randomUUID()));const r=e=>{if(e)return Array.isArray(e.children)&&e.children.length>0&&(e.children_ids=e.children,e.children=e.children.map(o=>{if(Array.isArray(o))return;if(!o)return;const i=t.find(t=>t._id===o);if(!i)return void console.error(`[buildComponentTree] MISSING child "${o}" referenced by ${e.type} ${e._id} — it exists as a child-id but not as a component in the loaded doc, so it will not render.`);n(i);const a=r(i);return a&&a.children&&(i.children=a.children),a&&a.elements&&(i.elements=a.elements),i})),Array.isArray(e.elements)&&e.elements.length>0&&(e.elements=e.elements.map(o=>{const i=t.find(t=>t._id===o);if(!i)return void console.error(`[buildComponentTree] MISSING element "${o}" referenced by ${e.type} ${e._id} — layer-2 element id has no matching component, so it will not render.`);n(i);const a=r(i);return a&&a.elements&&(i.elements=a.elements),a&&a.children&&Array.isArray(e.children)&&e.children.length>0&&(i.children=a.children),i})),e;function n(t){if(!t)return;"text"===t.type&&t.props?.text&&"string"==typeof t.props.text&&(t.props.text=((t,e)=>{if("text"===t&&"string"==typeof e)try{return JSON.parse(e)}catch(t){(0,Ht.v)({error_code:"#11jhb",info:t,msg:"could not parse text in transformValues",s:"E"})}return e})("text",t.props.text)),"form"===t.type&&Array.isArray(t.props?.items)&&t.props.items.forEach(t=>{const e=t?.props?.style?.fontFamily;e&&(0,dt.sw)({cssRule:e})});const e=t.props?.style?.fontFamily;e&&(0,dt.sw)({cssRule:e})}};if(e){const t=r(e);t.children&&(e.children=t.children)}return e}},83860(t,e,n){"use strict";n.d(e,{D$:()=>s});var r=n(86319);const o={mobile:"sm"};function i(){if("web"!==r.M.get("config","channel"))return null;const t=r.M.get("deviceFilter")||"all";return o[t]||null}function a(t,e,n){const r=i();if(!r)return null;if("style"!==e&&"text"!==e)return null;const o=t?.props?.breakpoints||{},a=o[r]||{};let s;return s="style"===e?{...a,style:{...a.style||{},...n}}:{...a,text:n},{key:"breakpoints",value:{...o,[r]:s}}}function s(t,e,n){return a(t,e,n)||{key:e,value:n}}},15604(t,e,n){"use strict";n.d(e,{Ay:()=>B,EN:()=>M});var r=n(81840),o=n(4952),i=n(86319),a=n(12106),s=n(18057),l=n(29780),c=n(98829),d=n(93432);const p=class{constructor(t,e,n,r,o){this.component=t,this.color=e,this.userId=n,this.name=r,this.componentId=o,this.borderElement=null,this.isDestroyed=!1,this.createBorder(),this.updatePosition(),this.attachListeners()}createBorder(){this.borderElement=document.createElement("div"),this.borderElement.style.position="absolute",this.borderElement.style.pointerEvents="none",this.borderElement.style.border=`2px solid ${this.color}`,this.borderElement.style.zIndex="0",this.borderElement.style.transition="all 0.01s ease-out",document.body.appendChild(this.borderElement),this.labelElement=document.createElement("div"),this.labelElement.textContent=this.name,this.labelElement.style.position="absolute",this.labelElement.style.pointerEvents="none",this.labelElement.style.backgroundColor=this.color,this.labelElement.style.color="#fff",this.labelElement.style.padding="2px 6px",this.labelElement.style.fontSize="11px",this.labelElement.style.fontWeight="500",this.labelElement.style.borderRadius="3px",this.labelElement.style.zIndex="0",this.labelElement.style.whiteSpace="nowrap",this.labelElement.style.transition="all 0.01s ease-out",this.labelElement.style.boxShadow="0 1px 3px rgba(0,0,0,0.2)",document.body.appendChild(this.labelElement),this.updatePosition()}updatePosition(){if(this.isDestroyed||!this.component.element)return;const t=this.component.element.getBoundingClientRect();if(this.borderElement.style.top=t.top+"px",this.borderElement.style.left=t.left+"px",this.borderElement.style.width=t.width+"px",this.borderElement.style.height=t.height+"px",this.labelElement){const e=t.top-20,n=e<0?t.top+2:e;this.labelElement.style.top=n+"px",this.labelElement.style.left=t.left+t.width/6+"px"}}attachListeners(){this.boundUpdatePosition=this.updatePosition.bind(this),window.addEventListener("scroll",this.boundUpdatePosition,!0),window.addEventListener("resize",this.boundUpdatePosition),this.mutationObserver=new MutationObserver(this.boundUpdatePosition),this.component.element&&this.mutationObserver.observe(this.component.element,{attributes:!0,attributeFilter:["style","class"]})}remove(){this.isDestroyed=!0,window.removeEventListener("scroll",this.boundUpdatePosition,!0),window.removeEventListener("resize",this.boundUpdatePosition),this.mutationObserver&&this.mutationObserver.disconnect(),this.borderElement&&this.borderElement.parentNode&&this.borderElement.parentNode.removeChild(this.borderElement),this.labelElement&&this.labelElement.parentNode&&this.labelElement.parentNode.removeChild(this.labelElement),this.borderElement=null,this.labelElement=null,this.component=null}},h=[];function u(){return h}function f(t){h.push(t)}function m(t){const e=h.findIndex(e=>e?.userId===t);-1!==e&&(h[e].borderSelected.remove(),h.splice(e,1))}function g(){h.forEach(t=>{t.borderSelected.updatePosition()})}var b=n(4217),y=n(69172);function w(t){const{type:e,componentId:n,parentId:r,newParentId:o}=t,a=i.M.get("components",n);if(!a)return!0;if("MOVE"===e)return a.parentId===o;const s=i.M.get("components",r);if(!s)return!0;const l=Array.isArray(s.children)&&s.children.includes(n)||Array.isArray(s.elements)&&s.elements.includes(n);return"ADD"===e?l:!l}function A(t){if(t.disconnectedAt){if(Date.now()-t.disconnectedAt>t.maxDisconnectTime)return console.error("%cDisconnected too long, reload required","color:red"),t.isReconnecting=!1,i.M.set({wsConnection:{status:"failed",message:"Disconnected for too long. Please reload the page to ensure data sync."}}),void(0,l.U)("updateNeeded")}if(t.reconnectAttempts>=t.maxReconnectAttempts)return console.error("%cMax reconnection attempts reached","color:red"),t.isReconnecting=!1,i.M.set({wsConnection:{status:"failed",message:"Unable to reconnect to server"}}),void(0,l.U)(500);t.reconnectAttempts++;const e=1===t.reconnectAttempts?0:Math.min(t.reconnectDelay*Math.pow(2,t.reconnectAttempts-2),3e4);0===e?console.log(`%cAttempting to reconnect immediately (${t.reconnectAttempts}/${t.maxReconnectAttempts})`,"color:orange"):console.log(`%cAttempting to reconnect (${t.reconnectAttempts}/${t.maxReconnectAttempts}) in ${e}ms`,"color:orange"),i.M.set({wsConnection:{status:"reconnecting",attempts:t.reconnectAttempts,nextAttemptIn:e}}),t.reconnectTimer=setTimeout(()=>{t.wsConnectionProps&&(console.log("%cReconnecting...","color:orange"),v(t,t.wsConnectionProps))},e)}function x(t){t.reconnectTimer&&(clearTimeout(t.reconnectTimer),t.reconnectTimer=null),t.isReconnecting=!1}function _(t,e){try{console.log("WS MESSAGE RECEIVED:",e.data);const n=JSON.parse(e.data);u();if(n.transactions)return n.transactions.forEach(e=>{switch(e.type){case"SELECT_ELEMENT":{const r=t.getComponent(e.componentId);if(r){m(n.user.id);const t=function(t,e,n,r,o){return new p(t,e,n,r,o)}(r,n.user.color,n.user.id,n.user.name,e.componentId);f({userId:n.user.id,componentId:e.componentId,borderSelected:t})}break}case"USER_JOINED":{const t=i.M.get("connectedUsers")||[];i.M.set({connectedUsers:[...t,e.user]});break}case"USER_LEFT":{const t=i.M.get("connectedUsers")||[];i.M.set({connectedUsers:t.filter(t=>t.userId!==e.user.userId)}),m(e.user.userId);break}case"SESSION_INITIALIZED":{const n=t.wsConnectionProps?.userId,r=e.users.filter(t=>t.userId!==n);i.M.set({connectedUsers:r});break}case"PATCH":t.updateComponent(e.componentId,e.key,e.value,{silent:!0,sync:!1});break;case"MOVE":if(w(e))break;t.moveComponent({componentId:e.componentId,newParentId:e.newParentId,newIndex:e.newIndex,oldIndex:e.oldIndex,oldParentId:e.oldParentId,direction:e.direction,fromLayer:e.fromLayer,toLayer:e.toLayer},{sync:!1});break;case"CREATE":t.createComponent({componentId:e.componentId,parentId:e.parentId,index:e.index,body:e.body},{sync:!1,clone:!0});break;case"ADD":if(w(e))break;t.addComponent({componentId:e.componentId,parentId:e.parentId,index:e.index,layer:e.layer},{sync:!1});break;case"REMOVE":if(w(e))break;t.removeComponent({componentId:e.componentId,parentId:e.parentId,index:e.index},{sync:!1})}}),void g();if("transaction:complete"===n.type){const e=n.completed;if(!t.transactions[n.transactionId])return(0,c.v)({msg:"transaction not found to mark as completed",s:"E",info:{tasks:e},error_code:"#c4ca2"}),void console.error("transaction not found to mark as completed");let r=!0;Array.isArray(e)&&e.forEach(t=>{"completed"!==t.status&&(r=!1)}),r?(delete t.transactions[n.transactionId],t.lastSyncTimestamp=Date.now()):((0,c.v)({msg:"some of tasks not completed",s:"E",info:{tasks:e},error_code:"#c4222"}),(0,l.U)(500),console.error("some of tasks not completed",n))}else"notification:reset"===n.type&&(0,l.U)("updateNeeded")}catch(t){(0,c.v)({msg:t.message,s:"E",info:{data:t.stack},error_code:"#c4222"}),console.error(t)}}function v(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{onOpen:n,access:r,userId:o,sessionId:a,avatar:s,name:c}=e;let d;r?d=`app:${r}`:(o||(0,l.U)(401),a||(0,l.U)(401),d=`freesolo?userId=${o}&sessionId=${a}&avatar=${s}&name=${c}`),t.wsConnectionProps=e,x(t),i.M.set({wsConnection:{status:t.isReconnecting?"reconnecting":"connecting",attempts:t.reconnectAttempts}});const p=t.wsService=new b.w3cwebsocket(`${y.XW.ws_url}/${d}`);p.onopen=()=>{console.log("%cConnected","color:green"),t.wasConnected=!0,t.reconnectAttempts=0,t.isReconnecting=!1,t.disconnectedAt=null,i.M.set({wsConnection:{status:"connected",attempts:0}}),"function"==typeof n&&n()},p.onmessage=e=>_(t,e),p.onclose=e=>{if(console.log("%cWebSocket connection closed","color:orange",e),i.M.set({wsConnection:{status:"disconnected",code:e.code,reason:e.reason}}),!t.wasConnected)return console.error("%cInitial connection failed, not attempting reconnection","color:red"),void(0,l.U)(500);t.disconnectedAt||(t.disconnectedAt=Date.now());[1e3,1008,4401].includes(e.code)?(0,l.U)(500):t.isReconnecting||(t.isReconnecting=!0,A(t))},p.onerror=t=>{console.error("%cWebSocket error:","color:red",t),i.M.set({wsConnection:{status:"error",error:t.message||"WebSocket error occurred"}})}}var k=n(52529),C=n(3832),E=n(81139),S=n(83860);"undefined"!=typeof window&&(window.location?.href?.includes("DEBUG=1"),1)&&(window.__trace__=[]);const M=new class{constructor(t){let{editors:e}=t;this.debounder=new s.A,this.configure={},this.app=new r.A,this.pendingTransactions=[],this.undoRedo=o.A,this.templates={},this.commands={goToError:l.U,logError:c.v},this.wsService={send:t=>console.warn("ws not connected yet, please wait..",t)},window.transactions=this.transactions={},this.withSnapshot=!1,this.editors=[],this.__elements={},this.changes=[],this.globalCommands={bodyWalk:l.S},this.isRealtimeConnected=!1,this.reconnectAttempts=0,this.maxReconnectAttempts=10,this.reconnectDelay=1e3,this.reconnectTimer=null,this.wsConnectionProps=null,this.isReconnecting=!1,this.wasConnected=!1,this.lastSyncTimestamp=Date.now(),this.disconnectedAt=null,this.maxDisconnectTime=3e5,this.connectOnline=t=>{"string"==typeof t&&0!==t.length?v(this,{access:t,onOpen:()=>{this.isRealtimeConnected=!0,this.app.dispatch("ws-loaded",{editor:this})}}):(0,l.U)(401)},this.connectRealtime=t=>{if(t&&"object"==typeof t){const{sessionId:e,avatar:n,name:r}=t,o=(0,a.A)();e||(0,l.U)(401),v(this,{userId:o,sessionId:e,avatar:n,name:r,onOpen:()=>{this.isRealtimeConnected=!0,this.app.dispatch("ws-loaded",{editor:this})}})}},e&&e.forEach(t=>this.addEditor(t)),this.type=null,this.components=[],this.undoRedo.on("ON_REDO",()=>setTimeout(()=>this.updateAll(),200)),this.undoRedo.on("ON_UNDO",()=>setTimeout(()=>this.updateAll(),200)),this.undoRedo.on("ON_SNAPSHOT",t=>{let{deletedSteps:e}=t;Array.isArray(e)&&e.forEach(t=>{t?.stack&&t.stack.forEach(t=>{"CREATE"!==t.type&&"REMOVE"!==t.type||(t.__type=t.type)})})}),this.commitEdits=t=>function(t,e){i.M.get("config","savedDebounce"),t.pendingTransactions.push(...e),t.debounder.run(()=>{t.updateAll([...t.pendingTransactions]),Array.isArray(window.__trace__)&&window.__trace__.push({transactions:[...t.pendingTransactions]}),t.pendingTransactions.forEach(t=>{delete t.newValue,delete t.oldValue});const e={transactions:[...t.pendingTransactions],transactionId:(0,a.A)(),created_at:Date.now()};if(t.transactions[e.transactionId]=[...t.pendingTransactions],t.isRealtimeConnected){const n=JSON.stringify(e);if(t.wsService.readyState===WebSocket.OPEN)try{t.wsService.send(n),console.trace("transactions sent",e.transactions.length),t.pendingTransactions=[],t.transactions[e.transactionId]=[]}catch(t){(0,c.v)({msg:"There is Error on sync data with the server",info:n,error_code:"#c4ca4",s:"E"}),console.warn("error on syncing, sent:",n),(0,l.U)()}else(0,c.v)({msg:"ws not connected",s:"E",info:{connection:t.wsService.readyState},error_code:"#c4ca9"}),console.warn("ws not connected"),(0,l.U)()}})}(this,t),this.updateAll=t=>function(t,e){e&&e.forEach(e=>{const n=t.getComponent(e.componentId);if(n){const t=(n.atomElement||n.element).getBoundingClientRect();n.props.rect=t,n.props.width=t.width,n.props.height=t.height}else console.error("component not found in updateAll",e)}),t.app.dispatch("update",{editor:t}),g();const n=i.M.get("config","editor","props","onSave");"function"==typeof n&&n({transactions:e,toJson:d.U2,toJSON:d.U2,toHTML:d.FE})}(this,t),this.attemptReconnect=()=>A(this),this.cancelReconnect=()=>x(this),this.connectToWSServer=t=>v(this,t),this.addComponent=(t,e)=>(0,k.X8)(this,t,e),this.removeComponent=(t,e)=>(0,k.o$)(this,t,e),this.moveComponent=(t,e)=>(0,k.pp)(this,t,e),this.createComponent=(t,e)=>(0,k.a0)(this,t,e),this.cloneComponent=t=>(0,k.ty)(this,t),this.updateComponent=(t,e,n,r)=>(0,k.ZP)(this,t,e,n,r),this.silentPatch=(t,e,n)=>(0,k.c_)(this,t,e,n),this.selectComponent=(t,e)=>(0,k.Cs)(this,t,e),this.clean=()=>(0,k.uH)(this),this.execCommand2=t=>function(t,e){let{transactions:n,update:r=t.components}=e;const o=[];Array.isArray(r)||(r=[r]),n.forEach(t=>{let{type:e,key:n,value:i}=t;r.forEach(t=>{const r=e?t.closest(e):t;if(r){const t=(0,S.D$)(r,n,i);o.push(new E.A({componentId:r.id,key:t.key,value:t.value}))}})}),t.withSnapshot&&o.length>0?(0,C.Ay)({steps:o,onEnd:e=>{let{steps:n}=e;t.withSnapshot=!1,t.commitEdits(n)}}):o.forEach(e=>{let{componentId:n,key:r,value:a}=e;const s=i.M.get("components",n);s&&(s.props[r]=a,t.commitEdits(o))})}(this,t),this.execCommands=(t,e)=>function(t,e,n){let{components:r=[...t.components],silent:o=!1}=n||{};Array.isArray(r)||(r=[r]),Array.isArray(e)||(e=[e]);const a=[];return e.forEach(e=>{let{componentId:n,key:o,value:i,options:s={}}=e;const{find:l}=s;if(n){let e=i;if("function"==typeof i){const r=t.getComponent(n);e=i(r)}const r=t.getComponent(n),s=r?(0,S.D$)(r,o,e):{key:o,value:e};a.push(new E.A({componentId:n,key:s.key,value:s.value}))}else r.forEach(e=>{if(l){let t=e.closest(l);if(t||(t=e.find(l)),!t)return void console.log("component not found on execCommands",l);e=t}let n=i;if("function"==typeof i&&(n=i(e),null===n))return t;const r=(0,S.D$)(e,o,n);a.push(new E.A({componentId:e.id,key:r.key,value:r.value}))})}),t.withSnapshot&&a.length>0?((0,C.Ay)({steps:a,onEnd:()=>{t.withSnapshot=!1}}),t.commitEdits(a)):a.forEach(e=>{let{componentId:n,key:r,value:o}=e;const s=i.M.get("components",n);s&&(s.props[r]=o,t.commitEdits(a))}),t}(this,t,e)}dispatch(t,e){return this.app.dispatch(t,e),this}on(t,e){this.app.subscribe(t,e)}off(t,e){switch(t){case"update":this.app.unSubscribe("update",e);break;case"select":this.app.unSubscribe("select",e)}}addEditor(t){let{id:e,type:n,name:r,editor:o}=t;this.editors.push({id:e,type:n,name:r,editor:o})}removeEditor(t){let{id:e,name:n,type:r}=t;e&&(this.editors=this.editors.filter(t=>t.id!==e)),n&&(this.editors=this.editors.filter(t=>t.name!==n)),r&&(this.editors=this.editors.filter(t=>t.type!==r))}getComponents(){return i.M.get("components")}getComponent(t){return t?i.M.get("components",t):null}getEditor(t){if(t){const e=this.editors.find(e=>e.name===t);return e?e.editor:null}return this.editors}getSelectedComponent(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{find:e=null}=t;if(!e)return this.components;const n=[],r=t=>{t&&t.forEach(t=>{const o=this.getComponent(t);o&&(e?.equalWith(o.type)&&n.push(o),r(o.children))})};return this.components.forEach(t=>{e?.equalWith(t.type)&&n.push(t),t.children&&r(t.children)}),n}saveTemplate(t,e){this.templates[t]=e}getTemplate(t){return this.templates[`style:${t}`]}store(){return this.withSnapshot=!0,this}execCommand(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.execCommands({key:t,value:e,options:n}),this}createschema(t,e){this.__elements[t]=e}getschema(t){return this.__elements[t]}}({}),B=M},52529(t,e,n){"use strict";n.d(e,{X8:()=>b,uH:()=>w,ty:()=>A,a0:()=>v,pp:()=>_,o$:()=>x,iI:()=>g,Cs:()=>y,c_:()=>C,ZP:()=>k});var r=n(86319),o=n(12106),i=n(159),a=n(3832),s=n(98829),l=n(67549);class c{constructor(t){let{componentId:e,parentId:n,index:r,layer:o}=t;this.componentId=e,this.parentId=n,this.index=r,this.type="ADD",this.layer=o}}var d=n(4807),p=n(89531),h=n(3474),u=n(81139),f=n(29780),m=n(83860);function g(t,e){return Array.isArray(t?.elements)&&t.elements.includes(e)?2:1}function b(t,e){let{componentId:n,parentId:o,index:i,layer:s}=e,{sync:l=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const d=r.M.get("components",n),p=r.M.get("components",o);if(!d||!p)return;const h=[new c({componentId:n,parentId:o,index:i,layer:s})];d.parentId=o,2===s?(Array.isArray(p.elements)||(p.elements=[]),p.elements.splice("number"==typeof i?i:p.elements.length,0,n),p.element.appendChild(d.element)):(p.children.splice(i,0,n),p.appendChild(d.element,i)),t.withSnapshot&&h.length>0&&(0,a.Ay)({steps:h,onEnd:()=>t.withSnapshot=!1}),l&&t.commitEdits(h)}function y(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e?(-1!==t.components.findIndex(t=>t.id===e.id)||(e.isSelected=!0,t.type=n.type||e.type,"function"==typeof e.onSelect&&e.onSelect("selected"),t.wsService.send(JSON.stringify({transactions:[{type:"SELECT_ELEMENT",componentId:e.id}]})),t.components.push(e),t.app.dispatch("update",{editor:t,props:n}),t.app.dispatch("select",{editor:t,props:n,component:e,components:t.components})),t):t}function w(t){return t.components.forEach(t=>{t.isSelected=!1,"function"==typeof t.onDeselect&&t.onDeselect("selected")}),t.components=[],t}function A(t,e){let{componentId:n,parentId:i,index:c}=e;const p=[];let h=null;const u=r.M.get("components",n),f=r.M.get("components",i);if(!u||!f)return console.error("component not found");const m=(e,n,i)=>{const a=JSON.parse(JSON.stringify(e.props)),s={id:`cdtr-${(0,o.A)()}`,type:e.type,parentId:n.id,index:i,props:a,children:[]};delete s._id;const l=t.createComponent({body:s,parentId:n.id,index:i,layer:e.layer||1});null===h&&(h=l.id),p.push(new d.A({componentId:l.id,parentId:n.id,index:i,body:s})),e.children&&e.children.forEach((t,e)=>{const n=r.M.get("components",t),o=r.M.get("components",l.id);n&&m(n,o,e)})};if(m(u,f,c),"card"===u.type||"col"===u.type){const t=u.closest("block");if(t){(0,l.s)(t).forEach(t=>{r.M.get("components",t.componentId)?p.push(t):(console.error("col not found for resize on clone"),(0,s.v)({s:"E",error_code:"#ggbbk$",info:{},msg:"col not found for resize on clone"}))})}}(0,a.Ay)({steps:p,update:!0})}function x(t,e){let{componentId:n}=e,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{const{sync:e=!0}=o,i=r.M.get("components",n);if(!i)return(0,s.v)({msg:"component not found",error_code:"#e44lk",info:{},s:"E"}),void(0,f.U)();const l=i.parent();if(!l)return t;if(2!==g(l,i.id)){const r=l.children.findIndex(t=>t===i.id);if(r<0)return(0,s.v)({msg:`children index not found for parent ${i.id}: ${r}`,error_code:"#e24lmvD3",info:{data:{componentId:n,parentId:l.id,children:l.children,layer:1}},s:"E"}),(0,f.U)(),t;l.children.splice(r,1);const o=[new p.A({componentId:n,parentId:l.id,index:r,layer:1})];i.remove(),t.withSnapshot&&o.length>0&&(0,a.Ay)({steps:o,onEnd:()=>t.withSnapshot=!1}),e&&t.commitEdits(o)}else{const e=l.elements.findIndex(t=>t===i.id);if(e<0)return(0,s.v)({msg:`parent index not found: ${e}`,error_code:"#eggf4",info:{data:{componentId:n,parentId:l.id,elements:l.elements,layer:2}},s:"E"}),(0,f.U)(),t;l.elements.splice(e,1);const r=[new p.A({componentId:n,parentId:l.id,index:e,layer:2})];i.remove(),t.withSnapshot&&r.length>0&&(0,a.Ay)({steps:r,onEnd:()=>t.withSnapshot=!1}),t.commitEdits(r)}return t}catch(t){(0,s.v)({error_code:"#eggf!!4",msg:t.message,info:{data:t.stack},s:"E"}),(0,f.U)(),console.error(t)}}function _(t,e){let{componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,fromLayer:d,toLayer:p,direction:u}=e,{sync:m=!0}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(-1===c||-1===l)return(0,s.v)({error_code:"#eggf$^4",msg:"invalid index on moveComponent",info:{componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,fromLayer:d,toLayer:p},s:"E"}),(0,f.U)(),null;const g=[new h.A({componentId:n,newParentId:o,oldParentId:i,newIndex:l,oldIndex:c,direction:u,fromLayer:d,toLayer:p})],b=r.M.get("components",i),y=r.M.get("components",o),w=r.M.get("components",n);if(!w||!y||!b)return console.error("component not found on move",`\n componentId: ${n},\n newParentId: ${o},\n oldParentId: ${i},\n newIndex: ${l},\n oldIndex: ${c},\n fromLayer: ${d},\n toLayer: ${p}`),t;try{if(2===d&&2===p)Array.isArray(y.elements)||(y.elements=[]),b.elements.splice(c,1),y.elements.splice(l,0,w.id),y.element.appendChild(w.element);else{let t;b.children.splice(c,1),y.children.splice(l,0,w.id),b.id===y.id&&"block"===y.type&&(t={direction:l>c?"bottom":"top"}),y.appendChild(w.element,l,t)}}catch(t){console.error("appendChild method required for move",y)}return t.withSnapshot&&g.length>0&&(0,a.Ay)({steps:g,onEnd:()=>t.withSnapshot=!1}),w.parentId=o,m&&t.commitEdits(g),t}function v(t,e){let{body:n,parentId:l,index:c,layer:p}=e,{sync:h=!0,clone:u=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const m=r.M.get("components",l);if(!m)return(0,f.U)(),void(0,s.v)({msg:"component not found on create",error_code:"#c49vk",info:{data:{body:n,parentId:l,index:c,layer:p}},s:"E"});n.layer=p||1;const g=t=>{t.id=t._id=u?t.id:`cdtr-${(0,o.A)()}`,t.children&&t.children.forEach(e=>{e.parentId=t.id,g(e)})};g(n),n.children||(n.children=[]),2===p?(Array.isArray(m.elements)||(m.elements=[]),m.elements.splice(c,0,n.id)):m.children.splice(c,0,n.id);const{children:b}=(0,i.X)({children:[n],id:l});requestAnimationFrame(()=>{b[0].scrollIntoView({behavior:"smooth",block:"nearest"})}),m.appendChild(b[0],c);const y=[new d.A({componentId:n.id,parentId:l,body:n,index:c,layer:p})];return h&&t.commitEdits(y),t.withSnapshot&&y.length>0&&(0,a.Ay)({steps:y,onEnd:()=>t.withSnapshot=!1}),r.M.get("components",n.id)}function k(t,e,n,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{sync:l=!0}=i;if("string"==typeof e&&(e=r.M.get("components",e)),!e)return console.error("component not found on update"),(0,s.v)({error_code:"#e@lld",msg:"component not found on update",info:{},s:"E"}),null;const c=(0,m.D$)(e,n,o),d=[new u.A({componentId:e.id,key:c.key,value:c.value&&"object"==typeof c.value?JSON.parse(JSON.stringify(c.value)):c.value})];return t.withSnapshot&&d.length>0?((0,a.Ay)({steps:d,onEnd:()=>{t.withSnapshot=!1}}),l&&t.commitEdits(d)):(e.props[c.key]=c.value,l?t.commitEdits(d):t.updateAll()),t}function C(t,e,n,r){const o=[new u.A({componentId:e.id,key:n,value:r})];t.commitEdits(o)}},29780(t,e,n){"use strict";n.d(e,{S:()=>o,U:()=>i});var r=n(86319);const o=(t,e)=>{t&&(e(t),t.children&&t.children.forEach(t=>{o(t,e)}))},i=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;r.M.get("error","status")||n(50629)(`./${t}`).then(()=>{r.M.set({error:{status:t}}),window.__show_errors=!0;const e=document.createElement(`cdtr-${t}`);document.body.appendChild(e)})}},67549(t,e,n){"use strict";function r(t){const e=[];if(t&&"function"==typeof t.commands.fixCols){t.commands.fixCols().sizes.forEach(t=>e.push(t))}return e}n.d(e,{s:()=>r})},83965(t,e,n){"use strict";n.d(e,{i:()=>i});var r=n(15604),o=n(89531);function i(t){let e=[],n=t;for(;n&&(!n||"section"!==n.type&&"root"!==n.type);){if(0===n.children.length){const t=n.parent(),i=t.children.findIndex(t=>t===n.id);-1!==i&&(e.push(new o.A({componentId:n.id,parentId:t.id,index:i})),r.Ay.removeComponent({componentId:n.id}))}n=n.parent()}return e}},50220(t,e,n){"use strict";n.d(e,{A:()=>o});var r=n(59929);const o=t=>{let e="function"==typeof t.value?t.value(t):t.value;return e||(e=""),r.qy`<cdtr-editor-container>
1858
1858
  <cdtr-title><lang-text text="${t.title}"></lang-text></cdtr-title>
1859
1859
  <cdtr-dropdown
1860
1860
  style="width:100%;"
Binary file
@@ -1 +1 @@
1
- if(!self.define){let e,d={};const r=(r,c)=>(r=new URL(r+".js",c).href,d[r]||new Promise(d=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=d,document.head.appendChild(e)}else e=r,importScripts(r),d()}).then(()=>{let e=d[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e}));self.define=(c,b)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(d[i])return;let a={};const n=e=>r(e,i),o={module:{uri:i},exports:a,require:n};d[i]=Promise.all(c.map(e=>o[e]||n(e))).then(e=>(b(...e),a))}}define(["./workbox-f3063069"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"112.creaditor.bundle.js",revision:"cecb35ee28609df9dfede4e6a01ab32b"},{url:"1142.creaditor.bundle.js",revision:"d39cafc88e6aea1556c82cb620e1a2ff"},{url:"1204.creaditor.bundle.js",revision:"ab63276f69accdc65901b80e8b0f6c94"},{url:"1260.creaditor.bundle.js",revision:"f42d16f28b2b5c855e5cc7ebe317ae8c"},{url:"1271.creaditor.bundle.js",revision:"cb64a53a41e39bd79f80e2c3cd0e16d9"},{url:"1317.creaditor.bundle.js",revision:"8f6674ecb348b5f3e5fca58cd4771c20"},{url:"1317.creaditor.bundle.js.LICENSE.txt",revision:"c8a750975849f68cc5261bff5b7597b4"},{url:"1334.creaditor.bundle.js",revision:"3d94fa72808bafc3c2e3a12c03004daf"},{url:"1396.creaditor.bundle.js",revision:"b28c7f0fbfc65927d08924655f5a0264"},{url:"1403.creaditor.bundle.js",revision:"b965b1cc3e11e4c46736fbc855524349"},{url:"1456.creaditor.bundle.js",revision:"3811b6097041da788cbf61ea03601784"},{url:"1529.creaditor.bundle.js",revision:"7961204004317491e920dbad90d56277"},{url:"168.creaditor.bundle.js",revision:"8b292ba3e21f73726da0a30307da11ed"},{url:"168.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"170.creaditor.bundle.js",revision:"ee3f12bc30f67cc8951daf483c248a15"},{url:"175.creaditor.bundle.js",revision:"a887a17fd0554975b3c18dbadc204f4c"},{url:"1972.creaditor.bundle.js",revision:"6a5534c86003dbf4ab66c8dbbcde71b2"},{url:"2001.creaditor.bundle.js",revision:"90dc6d5a0eb2684dda8082606bd259bd"},{url:"2001.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"211.creaditor.bundle.js",revision:"28e0be495a3c39a902b5983ddb9f4cbb"},{url:"2112.creaditor.bundle.js",revision:"f3d613a97be1c80e79325d7ccfc636b5"},{url:"2154.creaditor.bundle.js",revision:"f006afa17111e96496716d901e2cc2ac"},{url:"2234.creaditor.bundle.js",revision:"cd27ac5f566b304d4f1eece81ddc83bd"},{url:"2298.creaditor.bundle.js",revision:"acf2a7dd09e917ea4c4bac7853cca6bc"},{url:"235.creaditor.bundle.js",revision:"63204b1ff18d337dc64bb47970a9ae06"},{url:"235.creaditor.bundle.js.LICENSE.txt",revision:"5a0e25bacaf347bc90cf875c3e0944e7"},{url:"2350.creaditor.bundle.js",revision:"ad4b40d4c824ea45be38cdb38ec2811b"},{url:"2377.creaditor.bundle.js",revision:"e81b1dd02afb539702685ebbd241656f"},{url:"2384.creaditor.bundle.js",revision:"df77aad53bb57322953dc61708c7de8d"},{url:"2397.creaditor.bundle.js",revision:"de8115961695c5d83c5de95e2c1fa68a"},{url:"2409.creaditor.bundle.js",revision:"8014a9970419e80d12c5bb615a6637bb"},{url:"2547.creaditor.bundle.js",revision:"33e5789379606491dcd127470fe7375a"},{url:"2550.creaditor.bundle.js",revision:"3aa264f6eaef0bb9fee6bd767fb4c787"},{url:"2550.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"2590.creaditor.bundle.js",revision:"b10991e68aa92f461d2b43cb976c3f6c"},{url:"2706.creaditor.bundle.js",revision:"a095008b0a296f92f2a6bbc9833de233"},{url:"2706.creaditor.bundle.js.LICENSE.txt",revision:"c8a750975849f68cc5261bff5b7597b4"},{url:"271.creaditor.bundle.js",revision:"cbe05e76796bcbdb423a068052189278"},{url:"2717.creaditor.bundle.js",revision:"a56e0f09b3e93d1253c843d93258a88c"},{url:"2717.creaditor.bundle.js.LICENSE.txt",revision:"c9ae65c215fbf97b96bce384781c89ea"},{url:"2765.creaditor.bundle.js",revision:"f0e39e725576c544bacd5840af704572"},{url:"2773.creaditor.bundle.js",revision:"b66aacd479b264d24a3c839ce092631c"},{url:"2833.creaditor.bundle.js",revision:"ad5632253d9435d7fa06a40151ebabcf"},{url:"2837.creaditor.bundle.js",revision:"9c4554c1d38e36fec1ced22636be7892"},{url:"2837.creaditor.bundle.js.LICENSE.txt",revision:"6f9811cbe6a9564f96a78a4add5a5bc9"},{url:"2956.creaditor.bundle.js",revision:"a3f3bd46f723e9ad76a9d07f1bd73759"},{url:"2963.creaditor.bundle.js",revision:"a9d74c704253bb5d900740cd7b77c91d"},{url:"3105.creaditor.bundle.js",revision:"fcb21b9ac1bd11953529a83c8afad526"},{url:"3233.creaditor.bundle.js",revision:"d00041d99bfc950eacc5a7d2bec2a61b"},{url:"3418.creaditor.bundle.js",revision:"3d3f04a17dbefafede870514754e0dda"},{url:"3521.creaditor.bundle.js",revision:"2ce287377f3ce8f0194f3177cec6b082"},{url:"353.creaditor.bundle.js",revision:"89b04a79885687acdc202fa12d9f9ea2"},{url:"3545.creaditor.bundle.js",revision:"9118195e3eacd5124658abbe4ae8853e"},{url:"3553.creaditor.bundle.js",revision:"23972b3cdf3710236936e452841cb809"},{url:"3606.creaditor.bundle.js",revision:"ce9c2afb795a55c1146ff701e3547766"},{url:"3778.creaditor.bundle.js",revision:"e60261afd6f21eb92d53c296ae11ad14"},{url:"3792.creaditor.bundle.js",revision:"25d633b36dba6f8a8c0605c30a3d6444"},{url:"380.creaditor.bundle.js",revision:"fc5ff56d0e3b666fe174df4b2a66515e"},{url:"3827.creaditor.bundle.js",revision:"4af63258ddbfc5c46e5a5280e0653f5b"},{url:"3847.creaditor.bundle.js",revision:"2d87cc44c4ea2b23cb2ded98a5634b7c"},{url:"3875.creaditor.bundle.js",revision:"f40afe8e0a5e2a398e76b26830f967b8"},{url:"3932.creaditor.bundle.js",revision:"e3fe488729414d17edcf150bfbce5bfb"},{url:"3971.creaditor.bundle.js",revision:"f73ae68bb1bf498268c61ae19cc4c8f2"},{url:"4061.creaditor.bundle.js",revision:"9ce194af11399c096808d065c6cb4d84"},{url:"407.creaditor.bundle.js",revision:"3dd332a7512da4854694091607a03d24"},{url:"4074.creaditor.bundle.js",revision:"2639150e66dc341573cb6b3687bbc54b"},{url:"4100.creaditor.bundle.js",revision:"35fe1f1ac5cda4b570654afda2d2018b"},{url:"4109.creaditor.bundle.js",revision:"73fc250ad1b4a805b32ee61e87c2af53"},{url:"4109.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"4114.creaditor.bundle.js",revision:"8b3a3dfa4d9aea25e8124c4a085aa951"},{url:"4161.creaditor.bundle.js",revision:"4993026497ada2ac97d716cb2f4c0a64"},{url:"4186.creaditor.bundle.js",revision:"85d24c06f787aea1bcc096aaa4d00092"},{url:"4186.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"4217.creaditor.bundle.js",revision:"25247666bb66e190c8825cb07fa44198"},{url:"4288.creaditor.bundle.js",revision:"5d721b24f58a69f2e35dc8e62171f0e2"},{url:"4413.creaditor.bundle.js",revision:"b054be84ed2994e2b938641e9d3fab19"},{url:"4475.creaditor.bundle.js",revision:"3ecfd6de644933d2e31e2146a7b2ad9f"},{url:"453.creaditor.bundle.js",revision:"f250f77957b9b5412c3849e98cb22fe9"},{url:"4615.creaditor.bundle.js",revision:"0203064be05b359b62fe87b0a6495ad3"},{url:"4639.creaditor.bundle.js",revision:"0528c60b84f726b8aa5a2071195d2194"},{url:"467.creaditor.bundle.js",revision:"989e6b4d31dfbcfc6890330cd0894aa5"},{url:"4762.creaditor.bundle.js",revision:"82e589852084bb8277653bdf659ae567"},{url:"4770.creaditor.bundle.js",revision:"b060bafc940465b48c98d16f5dbe47b4"},{url:"4819.creaditor.bundle.js",revision:"70c235283f0650f7505cb07b2dedd19a"},{url:"4947.creaditor.bundle.js",revision:"077e60d7a64d257c8eed1ee081869184"},{url:"4987.creaditor.bundle.js",revision:"406826ae5f86e0a1541cef5471bf0609"},{url:"4987.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"4988.creaditor.bundle.js",revision:"3609437bf3e31dd856209c6988b0628f"},{url:"5119.creaditor.bundle.js",revision:"a71d7ea78a3810b4a94ba71ed61e32e7"},{url:"5133.creaditor.bundle.js",revision:"0dbb4e24ccdd657592b8370551debaa5"},{url:"5156.creaditor.bundle.js",revision:"01fc24bdaf55f14f36c2d8a5bd9950d7"},{url:"5284.creaditor.bundle.js",revision:"5d5f0b484b6a732671f63db0cb0d2fcc"},{url:"5284.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"5379.creaditor.bundle.js",revision:"5c482b14889b9355b41b884905c8b3cc"},{url:"5391.creaditor.bundle.js",revision:"f01d8de1d661b87a991d7c1f3579bc6d"},{url:"5411.creaditor.bundle.js",revision:"eae48b84ccfddff3ff4a616cbf1443c9"},{url:"5501.creaditor.bundle.js",revision:"4d0e717d93b6fadc54ff28f95a0d0517"},{url:"5530.creaditor.bundle.js",revision:"aea2b33b71d2aad5c5ccc7db288e2141"},{url:"5666.creaditor.bundle.js",revision:"fcc31fe060abf5475603bdd21052c7b2"},{url:"567.creaditor.bundle.js",revision:"f7907ceb7cdcec2b38a3a6faa45baed3"},{url:"5713.creaditor.bundle.js",revision:"ccc2bba0ee89f84aa5a8078b8b004677"},{url:"5713.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"574.creaditor.bundle.js",revision:"048702a59ceddd07abec85beb96c99e8"},{url:"574.creaditor.bundle.js.LICENSE.txt",revision:"7e87622d8f6027cbd50a87a2a0160d32"},{url:"578.creaditor.bundle.js",revision:"eea5a718ca8ccd7b81746c89529da3ab"},{url:"5791.creaditor.bundle.js",revision:"afcc2f40cd9dd357f205014f7aaba4f8"},{url:"5839.creaditor.bundle.js",revision:"02193ff7580fc12e262dbebc29e89401"},{url:"5849.creaditor.bundle.js",revision:"d530a38500cdeff163b19e8aaedc590d"},{url:"5850.creaditor.bundle.js",revision:"3b6d2c073ba4418cacc65ca7006ab3e7"},{url:"5884.creaditor.bundle.js",revision:"6f797f632f2589d56fa616ea41e1540c"},{url:"59.creaditor.bundle.js",revision:"bebc52161360d22d5867b5bc83c61353"},{url:"59.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"5909.creaditor.bundle.js",revision:"0962a466d2eee8d7eba23bb5dada9853"},{url:"5926.creaditor.bundle.js",revision:"c08dfb2f6974766a8e50d7b86f10d09e"},{url:"6036.creaditor.bundle.js",revision:"d8cc62bcfd4c4bf1b6e12b82daa9dd12"},{url:"6216.creaditor.bundle.js",revision:"f7d61056194ed8d16d95da665714c11c"},{url:"6216.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"638.creaditor.bundle.js",revision:"0805c65662d7b96ee150b7865da7cca6"},{url:"6442.creaditor.bundle.js",revision:"eb69361a34c99ebae2dbddcb32a9581c"},{url:"6442.creaditor.bundle.js.LICENSE.txt",revision:"c9ae65c215fbf97b96bce384781c89ea"},{url:"6496.creaditor.bundle.js",revision:"338b9529acf47bdc601be968cdeaad9e"},{url:"653.creaditor.bundle.js",revision:"52b9de427f192150b4b3c3b9725aad72"},{url:"6751.creaditor.bundle.js",revision:"365c1f0cd5c99801f035606282a231c7"},{url:"6814.creaditor.bundle.js",revision:"a7f323c08e346ec2b1c68cf81ff47333"},{url:"6937.creaditor.bundle.js",revision:"097f6c719d82a9352f396b0facc6df61"},{url:"7051.creaditor.bundle.js",revision:"d65dbbbd2541ea4cb4b42d89da193b3b"},{url:"7051.creaditor.bundle.js.LICENSE.txt",revision:"07b9ce85d65b059fc522aa29a4819489"},{url:"7055.creaditor.bundle.js",revision:"f31fc847732490920b65b45e7d7875b8"},{url:"7055.creaditor.bundle.js.LICENSE.txt",revision:"1299004e20f2ce6cb16d4370129c3cec"},{url:"715.creaditor.bundle.js",revision:"fa1475c83830889b0000781f4b8ae27f"},{url:"715.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"7155.creaditor.bundle.js",revision:"5d2854bb436f39fcb0a60c7e8cb5b42c"},{url:"7209.creaditor.bundle.js",revision:"d2ae86ade358a5e2dd0d81bccf01fc34"},{url:"7238.creaditor.bundle.js",revision:"06ab3510e2ccb95663f42f30b935cbeb"},{url:"7255.creaditor.bundle.js",revision:"4bd8abfce57c30fc2354b9a0833c8e3a"},{url:"738.creaditor.bundle.js",revision:"69f421253b26ef5d11d6c08abbc1d886"},{url:"7380.creaditor.bundle.js",revision:"fddb1138256dfd180b1edcf12d95f832"},{url:"7463.creaditor.bundle.js",revision:"dbbb9bb5df85208a7892eeeb73a547ee"},{url:"7463.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"7466.creaditor.bundle.js",revision:"71a436e7a7948c51c98758e223ec6ca5"},{url:"752.creaditor.bundle.js",revision:"7e38754a782c4b33b80310aad0957d5b"},{url:"7523.creaditor.bundle.js",revision:"9c97d67cf0ded1acc2df043abd0c5b41"},{url:"7564.creaditor.bundle.js",revision:"8d335e8846f544d305c1df15bce3e32e"},{url:"7654.creaditor.bundle.js",revision:"5cac40177715bf4c40b4b0aa0436d71a"},{url:"767.creaditor.bundle.js",revision:"a793f4e09d2155124a22a35579a3f046"},{url:"7789.creaditor.bundle.js",revision:"6634d5299fde0509aeae0aebbe607366"},{url:"7789.creaditor.bundle.js.LICENSE.txt",revision:"4c52c7161b2e22ac40ee29b327ab651b"},{url:"7838.creaditor.bundle.js",revision:"35a256e66c57b40d7245bff92cc1c4f8"},{url:"7918.creaditor.bundle.js",revision:"c8c365ab3942a7980aaf4fb2d63455af"},{url:"7937.creaditor.bundle.js",revision:"c68a91978a2c5ae0624fe54e9bd7e4a3"},{url:"7997.creaditor.bundle.js",revision:"a3b7ec234aa6407ae509b1f1df616793"},{url:"8042.creaditor.bundle.js",revision:"a24e3dabf0262b9c8a71fa68d1d9c023"},{url:"8064.creaditor.bundle.js",revision:"48839022909f72bb9163ecf18f8c1677"},{url:"8141.creaditor.bundle.js",revision:"b6221648d5f82dc59a50d4ce1074b936"},{url:"8173.creaditor.bundle.js",revision:"ea7cc21cb8903648ecd2c4b07debfbec"},{url:"8173.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"8196.creaditor.bundle.js",revision:"2cda0ae749ee093108f8b38b18faa6ff"},{url:"8250.creaditor.bundle.js",revision:"e29a6bedf8a2b93c561353211f8993ef"},{url:"8251.creaditor.bundle.js",revision:"76d697c599d8455348dc0b137600d5b1"},{url:"8315.creaditor.bundle.js",revision:"87577f0aafca067de3c1cbc776e28f4b"},{url:"8443.creaditor.bundle.js",revision:"800ba70473831238aee9cd5310516e1e"},{url:"8516.creaditor.bundle.js",revision:"ef7a9c47677772b41857e5bb1e1adb99"},{url:"8533.creaditor.bundle.js",revision:"3b3fb333cb7c06cabc493abcc80cefdf"},{url:"8547.creaditor.bundle.js",revision:"c0188bc59c4424aab2bf1b9a39da45cd"},{url:"8570.creaditor.bundle.js",revision:"2003dfcb0e758be45e0bdb85456d0dbb"},{url:"8646.creaditor.bundle.js",revision:"c415822f4a39c3845363d78fa7e1a1ea"},{url:"8654.creaditor.bundle.js",revision:"3618798ef21e495e600ecbafc4fdd2ec"},{url:"8854.creaditor.bundle.js",revision:"a462f451c2ef5c1242108a613a419433"},{url:"8916.creaditor.bundle.js",revision:"8d4ec7b7a7d17c38bb9e7b8bc3d5663b"},{url:"8921.creaditor.bundle.js",revision:"905f21a5c96ace0384c6e3b2ec8a5959"},{url:"898.creaditor.bundle.js",revision:"a024646e3ca480fcfce29ed8cbd0b55b"},{url:"898.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"8983.creaditor.bundle.js",revision:"374fb7bb4bb76d97a4a4d4249db0ae5b"},{url:"9041.creaditor.bundle.js",revision:"c9bc970d0ce04d3d0995e5a40b7c74fb"},{url:"9158.creaditor.bundle.js",revision:"71f0e38cb7b0ea1ec0ebc2c1ad03983b"},{url:"9158.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"9250.creaditor.bundle.js",revision:"40b6399127ffdf51b74a8761f7d73c56"},{url:"9386.creaditor.bundle.js",revision:"cbd8b350e5cfcf88cad16c4574369c9d"},{url:"9431.creaditor.bundle.js",revision:"69e69ea14b6f6c22d2c2af901627f6bf"},{url:"9453.creaditor.bundle.js",revision:"ebda05d2c346ee6cb7a5885ad311e8fc"},{url:"9570.creaditor.bundle.js",revision:"40da6756ba5727d76ae8087aad6c86ee"},{url:"9694.creaditor.bundle.js",revision:"15bff01cd425f84f1a26208336a83238"},{url:"975.creaditor.bundle.js",revision:"b60acccab2d53d47f49522a884c6c289"},{url:"976.creaditor.bundle.js",revision:"bf2738d19d647728b3c2c5ee01f75796"},{url:"9986.creaditor.bundle.js",revision:"adb41b5fe860ad2b59c43457d61f9641"},{url:"9990.creaditor.bundle.js",revision:"27083e0439ea303348c0d17ae7aea2de"},{url:"9994.creaditor.bundle.js",revision:"26e6c210fe02e1f9b0287290011655e3"},{url:"creaditor.bundle.js",revision:"2538f764a34c9467a33a395d8cc10e74"},{url:"creaditor.bundle.js.LICENSE.txt",revision:"794f185f21d34a033895e911c0658217"},{url:"dca9330af07325d31ab04d60838684cd.png",revision:null},{url:"index.html",revision:"633997b83db73351ce2c09a40bc5dd2f"}],{})});
1
+ if(!self.define){let e,d={};const r=(r,c)=>(r=new URL(r+".js",c).href,d[r]||new Promise(d=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=d,document.head.appendChild(e)}else e=r,importScripts(r),d()}).then(()=>{let e=d[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e}));self.define=(c,b)=>{const i=e||("document"in self?document.currentScript.src:"")||location.href;if(d[i])return;let a={};const n=e=>r(e,i),o={module:{uri:i},exports:a,require:n};d[i]=Promise.all(c.map(e=>o[e]||n(e))).then(e=>(b(...e),a))}}define(["./workbox-f3063069"],function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"112.creaditor.bundle.js",revision:"cecb35ee28609df9dfede4e6a01ab32b"},{url:"1142.creaditor.bundle.js",revision:"d39cafc88e6aea1556c82cb620e1a2ff"},{url:"1204.creaditor.bundle.js",revision:"ab63276f69accdc65901b80e8b0f6c94"},{url:"1260.creaditor.bundle.js",revision:"f42d16f28b2b5c855e5cc7ebe317ae8c"},{url:"1271.creaditor.bundle.js",revision:"cb64a53a41e39bd79f80e2c3cd0e16d9"},{url:"1317.creaditor.bundle.js",revision:"8f6674ecb348b5f3e5fca58cd4771c20"},{url:"1317.creaditor.bundle.js.LICENSE.txt",revision:"c8a750975849f68cc5261bff5b7597b4"},{url:"1334.creaditor.bundle.js",revision:"3d94fa72808bafc3c2e3a12c03004daf"},{url:"1396.creaditor.bundle.js",revision:"b28c7f0fbfc65927d08924655f5a0264"},{url:"1403.creaditor.bundle.js",revision:"b965b1cc3e11e4c46736fbc855524349"},{url:"1456.creaditor.bundle.js",revision:"3811b6097041da788cbf61ea03601784"},{url:"1529.creaditor.bundle.js",revision:"7961204004317491e920dbad90d56277"},{url:"168.creaditor.bundle.js",revision:"8b292ba3e21f73726da0a30307da11ed"},{url:"168.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"170.creaditor.bundle.js",revision:"ee3f12bc30f67cc8951daf483c248a15"},{url:"175.creaditor.bundle.js",revision:"a887a17fd0554975b3c18dbadc204f4c"},{url:"1972.creaditor.bundle.js",revision:"6a5534c86003dbf4ab66c8dbbcde71b2"},{url:"2001.creaditor.bundle.js",revision:"90dc6d5a0eb2684dda8082606bd259bd"},{url:"2001.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"211.creaditor.bundle.js",revision:"28e0be495a3c39a902b5983ddb9f4cbb"},{url:"2112.creaditor.bundle.js",revision:"f3d613a97be1c80e79325d7ccfc636b5"},{url:"2154.creaditor.bundle.js",revision:"f006afa17111e96496716d901e2cc2ac"},{url:"2234.creaditor.bundle.js",revision:"cd27ac5f566b304d4f1eece81ddc83bd"},{url:"2298.creaditor.bundle.js",revision:"acf2a7dd09e917ea4c4bac7853cca6bc"},{url:"235.creaditor.bundle.js",revision:"63204b1ff18d337dc64bb47970a9ae06"},{url:"235.creaditor.bundle.js.LICENSE.txt",revision:"5a0e25bacaf347bc90cf875c3e0944e7"},{url:"2350.creaditor.bundle.js",revision:"ad4b40d4c824ea45be38cdb38ec2811b"},{url:"2377.creaditor.bundle.js",revision:"e81b1dd02afb539702685ebbd241656f"},{url:"2384.creaditor.bundle.js",revision:"df77aad53bb57322953dc61708c7de8d"},{url:"2397.creaditor.bundle.js",revision:"de8115961695c5d83c5de95e2c1fa68a"},{url:"2409.creaditor.bundle.js",revision:"8014a9970419e80d12c5bb615a6637bb"},{url:"2547.creaditor.bundle.js",revision:"33e5789379606491dcd127470fe7375a"},{url:"2550.creaditor.bundle.js",revision:"3aa264f6eaef0bb9fee6bd767fb4c787"},{url:"2550.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"2590.creaditor.bundle.js",revision:"b10991e68aa92f461d2b43cb976c3f6c"},{url:"2706.creaditor.bundle.js",revision:"a095008b0a296f92f2a6bbc9833de233"},{url:"2706.creaditor.bundle.js.LICENSE.txt",revision:"c8a750975849f68cc5261bff5b7597b4"},{url:"271.creaditor.bundle.js",revision:"cbe05e76796bcbdb423a068052189278"},{url:"2717.creaditor.bundle.js",revision:"a56e0f09b3e93d1253c843d93258a88c"},{url:"2717.creaditor.bundle.js.LICENSE.txt",revision:"c9ae65c215fbf97b96bce384781c89ea"},{url:"2765.creaditor.bundle.js",revision:"f0e39e725576c544bacd5840af704572"},{url:"2773.creaditor.bundle.js",revision:"b66aacd479b264d24a3c839ce092631c"},{url:"2833.creaditor.bundle.js",revision:"ad5632253d9435d7fa06a40151ebabcf"},{url:"2837.creaditor.bundle.js",revision:"9c4554c1d38e36fec1ced22636be7892"},{url:"2837.creaditor.bundle.js.LICENSE.txt",revision:"6f9811cbe6a9564f96a78a4add5a5bc9"},{url:"2956.creaditor.bundle.js",revision:"a3f3bd46f723e9ad76a9d07f1bd73759"},{url:"2963.creaditor.bundle.js",revision:"a9d74c704253bb5d900740cd7b77c91d"},{url:"3105.creaditor.bundle.js",revision:"fcb21b9ac1bd11953529a83c8afad526"},{url:"3233.creaditor.bundle.js",revision:"d00041d99bfc950eacc5a7d2bec2a61b"},{url:"3418.creaditor.bundle.js",revision:"3d3f04a17dbefafede870514754e0dda"},{url:"3521.creaditor.bundle.js",revision:"2ce287377f3ce8f0194f3177cec6b082"},{url:"353.creaditor.bundle.js",revision:"89b04a79885687acdc202fa12d9f9ea2"},{url:"3545.creaditor.bundle.js",revision:"9118195e3eacd5124658abbe4ae8853e"},{url:"3553.creaditor.bundle.js",revision:"23972b3cdf3710236936e452841cb809"},{url:"3606.creaditor.bundle.js",revision:"ce9c2afb795a55c1146ff701e3547766"},{url:"3778.creaditor.bundle.js",revision:"e60261afd6f21eb92d53c296ae11ad14"},{url:"3792.creaditor.bundle.js",revision:"25d633b36dba6f8a8c0605c30a3d6444"},{url:"380.creaditor.bundle.js",revision:"fc5ff56d0e3b666fe174df4b2a66515e"},{url:"3827.creaditor.bundle.js",revision:"4af63258ddbfc5c46e5a5280e0653f5b"},{url:"3847.creaditor.bundle.js",revision:"2d87cc44c4ea2b23cb2ded98a5634b7c"},{url:"3875.creaditor.bundle.js",revision:"f40afe8e0a5e2a398e76b26830f967b8"},{url:"3932.creaditor.bundle.js",revision:"e3fe488729414d17edcf150bfbce5bfb"},{url:"3971.creaditor.bundle.js",revision:"f73ae68bb1bf498268c61ae19cc4c8f2"},{url:"4061.creaditor.bundle.js",revision:"9ce194af11399c096808d065c6cb4d84"},{url:"407.creaditor.bundle.js",revision:"3dd332a7512da4854694091607a03d24"},{url:"4074.creaditor.bundle.js",revision:"2639150e66dc341573cb6b3687bbc54b"},{url:"4100.creaditor.bundle.js",revision:"35fe1f1ac5cda4b570654afda2d2018b"},{url:"4109.creaditor.bundle.js",revision:"73fc250ad1b4a805b32ee61e87c2af53"},{url:"4109.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"4114.creaditor.bundle.js",revision:"8b3a3dfa4d9aea25e8124c4a085aa951"},{url:"4161.creaditor.bundle.js",revision:"4993026497ada2ac97d716cb2f4c0a64"},{url:"4186.creaditor.bundle.js",revision:"85d24c06f787aea1bcc096aaa4d00092"},{url:"4186.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"4217.creaditor.bundle.js",revision:"25247666bb66e190c8825cb07fa44198"},{url:"4288.creaditor.bundle.js",revision:"5d721b24f58a69f2e35dc8e62171f0e2"},{url:"4413.creaditor.bundle.js",revision:"b054be84ed2994e2b938641e9d3fab19"},{url:"4475.creaditor.bundle.js",revision:"3ecfd6de644933d2e31e2146a7b2ad9f"},{url:"453.creaditor.bundle.js",revision:"f250f77957b9b5412c3849e98cb22fe9"},{url:"4615.creaditor.bundle.js",revision:"0203064be05b359b62fe87b0a6495ad3"},{url:"4639.creaditor.bundle.js",revision:"0528c60b84f726b8aa5a2071195d2194"},{url:"467.creaditor.bundle.js",revision:"989e6b4d31dfbcfc6890330cd0894aa5"},{url:"4762.creaditor.bundle.js",revision:"82e589852084bb8277653bdf659ae567"},{url:"4770.creaditor.bundle.js",revision:"b060bafc940465b48c98d16f5dbe47b4"},{url:"4819.creaditor.bundle.js",revision:"70c235283f0650f7505cb07b2dedd19a"},{url:"4947.creaditor.bundle.js",revision:"077e60d7a64d257c8eed1ee081869184"},{url:"4987.creaditor.bundle.js",revision:"406826ae5f86e0a1541cef5471bf0609"},{url:"4987.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"4988.creaditor.bundle.js",revision:"3609437bf3e31dd856209c6988b0628f"},{url:"5119.creaditor.bundle.js",revision:"a71d7ea78a3810b4a94ba71ed61e32e7"},{url:"5133.creaditor.bundle.js",revision:"0dbb4e24ccdd657592b8370551debaa5"},{url:"5156.creaditor.bundle.js",revision:"01fc24bdaf55f14f36c2d8a5bd9950d7"},{url:"5284.creaditor.bundle.js",revision:"5d5f0b484b6a732671f63db0cb0d2fcc"},{url:"5284.creaditor.bundle.js.LICENSE.txt",revision:"e6c501582fc5069d08decdc04d4ea11f"},{url:"5379.creaditor.bundle.js",revision:"5c482b14889b9355b41b884905c8b3cc"},{url:"5391.creaditor.bundle.js",revision:"f01d8de1d661b87a991d7c1f3579bc6d"},{url:"5411.creaditor.bundle.js",revision:"eae48b84ccfddff3ff4a616cbf1443c9"},{url:"5501.creaditor.bundle.js",revision:"4d0e717d93b6fadc54ff28f95a0d0517"},{url:"5530.creaditor.bundle.js",revision:"aea2b33b71d2aad5c5ccc7db288e2141"},{url:"5666.creaditor.bundle.js",revision:"fcc31fe060abf5475603bdd21052c7b2"},{url:"567.creaditor.bundle.js",revision:"f7907ceb7cdcec2b38a3a6faa45baed3"},{url:"5713.creaditor.bundle.js",revision:"ccc2bba0ee89f84aa5a8078b8b004677"},{url:"5713.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"574.creaditor.bundle.js",revision:"048702a59ceddd07abec85beb96c99e8"},{url:"574.creaditor.bundle.js.LICENSE.txt",revision:"7e87622d8f6027cbd50a87a2a0160d32"},{url:"578.creaditor.bundle.js",revision:"eea5a718ca8ccd7b81746c89529da3ab"},{url:"5791.creaditor.bundle.js",revision:"afcc2f40cd9dd357f205014f7aaba4f8"},{url:"5839.creaditor.bundle.js",revision:"02193ff7580fc12e262dbebc29e89401"},{url:"5849.creaditor.bundle.js",revision:"d530a38500cdeff163b19e8aaedc590d"},{url:"5850.creaditor.bundle.js",revision:"3b6d2c073ba4418cacc65ca7006ab3e7"},{url:"5884.creaditor.bundle.js",revision:"6f797f632f2589d56fa616ea41e1540c"},{url:"59.creaditor.bundle.js",revision:"bebc52161360d22d5867b5bc83c61353"},{url:"59.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"5909.creaditor.bundle.js",revision:"0962a466d2eee8d7eba23bb5dada9853"},{url:"5926.creaditor.bundle.js",revision:"c08dfb2f6974766a8e50d7b86f10d09e"},{url:"6036.creaditor.bundle.js",revision:"d8cc62bcfd4c4bf1b6e12b82daa9dd12"},{url:"6216.creaditor.bundle.js",revision:"f7d61056194ed8d16d95da665714c11c"},{url:"6216.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"638.creaditor.bundle.js",revision:"0805c65662d7b96ee150b7865da7cca6"},{url:"6442.creaditor.bundle.js",revision:"eb69361a34c99ebae2dbddcb32a9581c"},{url:"6442.creaditor.bundle.js.LICENSE.txt",revision:"c9ae65c215fbf97b96bce384781c89ea"},{url:"6496.creaditor.bundle.js",revision:"338b9529acf47bdc601be968cdeaad9e"},{url:"653.creaditor.bundle.js",revision:"52b9de427f192150b4b3c3b9725aad72"},{url:"6751.creaditor.bundle.js",revision:"365c1f0cd5c99801f035606282a231c7"},{url:"6814.creaditor.bundle.js",revision:"a7f323c08e346ec2b1c68cf81ff47333"},{url:"6937.creaditor.bundle.js",revision:"097f6c719d82a9352f396b0facc6df61"},{url:"7051.creaditor.bundle.js",revision:"d65dbbbd2541ea4cb4b42d89da193b3b"},{url:"7051.creaditor.bundle.js.LICENSE.txt",revision:"07b9ce85d65b059fc522aa29a4819489"},{url:"7055.creaditor.bundle.js",revision:"f31fc847732490920b65b45e7d7875b8"},{url:"7055.creaditor.bundle.js.LICENSE.txt",revision:"1299004e20f2ce6cb16d4370129c3cec"},{url:"715.creaditor.bundle.js",revision:"fa1475c83830889b0000781f4b8ae27f"},{url:"715.creaditor.bundle.js.LICENSE.txt",revision:"ddaef1761da9718367006e6a051e587c"},{url:"7155.creaditor.bundle.js",revision:"5d2854bb436f39fcb0a60c7e8cb5b42c"},{url:"7209.creaditor.bundle.js",revision:"d2ae86ade358a5e2dd0d81bccf01fc34"},{url:"7238.creaditor.bundle.js",revision:"06ab3510e2ccb95663f42f30b935cbeb"},{url:"7255.creaditor.bundle.js",revision:"4bd8abfce57c30fc2354b9a0833c8e3a"},{url:"738.creaditor.bundle.js",revision:"69f421253b26ef5d11d6c08abbc1d886"},{url:"7380.creaditor.bundle.js",revision:"fddb1138256dfd180b1edcf12d95f832"},{url:"7463.creaditor.bundle.js",revision:"dbbb9bb5df85208a7892eeeb73a547ee"},{url:"7463.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"7466.creaditor.bundle.js",revision:"71a436e7a7948c51c98758e223ec6ca5"},{url:"752.creaditor.bundle.js",revision:"7e38754a782c4b33b80310aad0957d5b"},{url:"7523.creaditor.bundle.js",revision:"9c97d67cf0ded1acc2df043abd0c5b41"},{url:"7564.creaditor.bundle.js",revision:"8d335e8846f544d305c1df15bce3e32e"},{url:"7654.creaditor.bundle.js",revision:"5cac40177715bf4c40b4b0aa0436d71a"},{url:"767.creaditor.bundle.js",revision:"a793f4e09d2155124a22a35579a3f046"},{url:"7789.creaditor.bundle.js",revision:"6634d5299fde0509aeae0aebbe607366"},{url:"7789.creaditor.bundle.js.LICENSE.txt",revision:"4c52c7161b2e22ac40ee29b327ab651b"},{url:"7838.creaditor.bundle.js",revision:"35a256e66c57b40d7245bff92cc1c4f8"},{url:"7918.creaditor.bundle.js",revision:"c8c365ab3942a7980aaf4fb2d63455af"},{url:"7937.creaditor.bundle.js",revision:"c68a91978a2c5ae0624fe54e9bd7e4a3"},{url:"7997.creaditor.bundle.js",revision:"a3b7ec234aa6407ae509b1f1df616793"},{url:"8042.creaditor.bundle.js",revision:"a24e3dabf0262b9c8a71fa68d1d9c023"},{url:"8064.creaditor.bundle.js",revision:"48839022909f72bb9163ecf18f8c1677"},{url:"8141.creaditor.bundle.js",revision:"b6221648d5f82dc59a50d4ce1074b936"},{url:"8173.creaditor.bundle.js",revision:"ea7cc21cb8903648ecd2c4b07debfbec"},{url:"8173.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"8196.creaditor.bundle.js",revision:"2cda0ae749ee093108f8b38b18faa6ff"},{url:"8250.creaditor.bundle.js",revision:"e29a6bedf8a2b93c561353211f8993ef"},{url:"8251.creaditor.bundle.js",revision:"76d697c599d8455348dc0b137600d5b1"},{url:"8315.creaditor.bundle.js",revision:"87577f0aafca067de3c1cbc776e28f4b"},{url:"8443.creaditor.bundle.js",revision:"800ba70473831238aee9cd5310516e1e"},{url:"8516.creaditor.bundle.js",revision:"ef7a9c47677772b41857e5bb1e1adb99"},{url:"8533.creaditor.bundle.js",revision:"3b3fb333cb7c06cabc493abcc80cefdf"},{url:"8547.creaditor.bundle.js",revision:"c0188bc59c4424aab2bf1b9a39da45cd"},{url:"8570.creaditor.bundle.js",revision:"2003dfcb0e758be45e0bdb85456d0dbb"},{url:"8646.creaditor.bundle.js",revision:"c415822f4a39c3845363d78fa7e1a1ea"},{url:"8654.creaditor.bundle.js",revision:"3618798ef21e495e600ecbafc4fdd2ec"},{url:"8854.creaditor.bundle.js",revision:"a462f451c2ef5c1242108a613a419433"},{url:"8916.creaditor.bundle.js",revision:"8d4ec7b7a7d17c38bb9e7b8bc3d5663b"},{url:"8921.creaditor.bundle.js",revision:"905f21a5c96ace0384c6e3b2ec8a5959"},{url:"898.creaditor.bundle.js",revision:"a024646e3ca480fcfce29ed8cbd0b55b"},{url:"898.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"8983.creaditor.bundle.js",revision:"374fb7bb4bb76d97a4a4d4249db0ae5b"},{url:"9041.creaditor.bundle.js",revision:"c9bc970d0ce04d3d0995e5a40b7c74fb"},{url:"9158.creaditor.bundle.js",revision:"71f0e38cb7b0ea1ec0ebc2c1ad03983b"},{url:"9158.creaditor.bundle.js.LICENSE.txt",revision:"bdcb4366d129e6ce322401c2c0a6f680"},{url:"9250.creaditor.bundle.js",revision:"40b6399127ffdf51b74a8761f7d73c56"},{url:"9386.creaditor.bundle.js",revision:"cbd8b350e5cfcf88cad16c4574369c9d"},{url:"9431.creaditor.bundle.js",revision:"69e69ea14b6f6c22d2c2af901627f6bf"},{url:"9453.creaditor.bundle.js",revision:"ebda05d2c346ee6cb7a5885ad311e8fc"},{url:"9570.creaditor.bundle.js",revision:"40da6756ba5727d76ae8087aad6c86ee"},{url:"9694.creaditor.bundle.js",revision:"15bff01cd425f84f1a26208336a83238"},{url:"975.creaditor.bundle.js",revision:"b60acccab2d53d47f49522a884c6c289"},{url:"976.creaditor.bundle.js",revision:"bf2738d19d647728b3c2c5ee01f75796"},{url:"9986.creaditor.bundle.js",revision:"adb41b5fe860ad2b59c43457d61f9641"},{url:"9990.creaditor.bundle.js",revision:"27083e0439ea303348c0d17ae7aea2de"},{url:"9994.creaditor.bundle.js",revision:"26e6c210fe02e1f9b0287290011655e3"},{url:"creaditor.bundle.js",revision:"5b94b2af729e26471a90f155732993c3"},{url:"creaditor.bundle.js.LICENSE.txt",revision:"794f185f21d34a033895e911c0658217"},{url:"dca9330af07325d31ab04d60838684cd.png",revision:null},{url:"index.html",revision:"633997b83db73351ce2c09a40bc5dd2f"}],{})});
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creaditor/web-starterkit",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Creaditor Web Editor - Starterkit for building beautiful web pages",
5
5
  "main": "dist/creaditor.bundle.js",
6
6
  "files": [