1import{aR as D,aU as w,bm as g,bc as r,a_ as h,cy as E,c9 as U,ca as M,aV as R,aW as j,bg as K}from"./c-index-C7aDQtMU.js";import{Z as N,u as S,s as $,i as _}from"./c-ZeroBlock-CV4n845L.js";/* empty css */import"./c-el-checkbox-yCtUXoWo.js";import"./c-MonacoEditor-Da_ANU1I.js";import"./c-vuedraggable.umd-CphuF5Dz.js";/* empty css *//* empty css *//* empty css */import{l as x}from"./e-front-BYMFT9Ax.js";import{l as J}from"./c-lodash-9MuaAKnG.js";import"./c-merge-B_kft1BI.js";import"./c-isArrayLikeObject-B68eDwjp.js";import"./c-_baseOrderBy-DHaiweXL.js";import"./c-_baseMap-Cu2k9MJB.js";import"./c-animations-BseF7QIQ.js";import"./c-index-uU8wUeO9.js";import"./c-debounce-C9zzGgaU.js";import"./c-index-BVAx5QAs.js";import"./c-HelperTool-Rf0okt4A.js";import"./c-index-Ch9JQuqs.js";import"./c-index-CQD-eyPW.js";import"./c-el-form-item-lGG0C5Mp.js";const P=D({name:"ZeroBlockDemo",components:{ZeroBlock:N},setup(){const o=new BroadcastChannel("zb_destination_channel"),e=S(),c=r(()=>e.elements),i=r(()=>e.cpCanUndo),l=r(()=>e.cpCanRedo),n=h(null),a=h(""),y=[{name:"Roboto",value:"Roboto, sans-serif"},{name:"Montserrat",value:"Montserrat, sans-serif"},{name:"Open Sans",value:"Open Sans, sans-serif"}],k=()=>{e.addElement("text",{text:"ÐÑÐ¸Ð¼ÐµÑ ÑекÑÑового блока",color:"#444444",fontsize:"24",fontweight:"500",align:"center",top:"100",left:"100",width:"400",bgcolor:"#f8f8f8",opacity:"0.9",borderradiu
1s:"4"})},C=p=>{},B=()=>{e.savePage(),E({message:"ÐÑÐ¾ÐµÐºÑ ÑоÑ
Ñанен! СмоÑÑиÑе деÑали в конÑоли.",type:"success"})},O=p=>{E({message:"ÐÑÐ¾ÐµÐºÑ ÑоÑ
Ñанен ÑеÑез ÑобÑÑие!",type:"success"})},Z=()=>{e.undo()},z=()=>{e.redo()};w(()=>{var d;new BroadcastChannel("zb_source_channel").addEventListener("message",u=>{if(u.data.type==="updateElements"){const f=JSON.parse(u.data.data),v=JSON.stringify(J.omit(f,["timestamp"]));if(a.value!==v){n.value=f,a.value=v;for(const t of $(Object.keys(n.value)))if(_(t)){const b=n.value[t];b.elem_type&&e.addOrUpdateElement(b,!0)}for(const t of Object.keys(n.value))!_(t)&&t.includes("ab_")&&(s.artboardSettings[t]=n.value[t])}}}),(d=x)==null||d.close("zeroblockdemo-mounted")});const s=S(),m=()=>{o.postMessage({type:"updateElements",data:JSON.stringify(s.buildZBData())})};return g(()=>s.elements,m,{deep:!0}),g(()=>s.artboardSettings,m,{deep:!0}),{elements:c,fonts:y,cpCanUndo:i,cpCanRedo:l,addTextElement:k,updateElements:C,handleSave:O,saveProject:B,undo:Z,redo:z}}}),V={class:"zeroblock-demo-container"};function q(o,e,c,i,l,n){const a=M("ZeroBlock");return R(),j("div",V,[K(a,{initialElements:o.elements,fonts:o.fonts,height:"calc(100vh)",onUpdate:o.updateElements,onSave:o.handleSave},null,8,["initialElements","fonts","onUpdate","onSave"])])}const de=U(P,[["render",q],["__scopeId","data-v-4eff0d0d"]]);export{de as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.