veo-sdk 0.6.0 → 0.6.1

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.
@@ -1,7 +1,7 @@
1
- var veoBuilder=(function(exports){'use strict';var bn="application/x-veo-block";function yn(t){let{host:e,stepIndex:o,onDrop:n}=t,i=e.ownerDocument,r=null,s=null,l=()=>e.shadowRoot?.querySelector(".veo-guide-content")??null,a=b=>Array.from(b.children).filter(C=>C instanceof HTMLElement&&C.dataset.veoIdx!==void 0),c=()=>{r?.remove(),r=null,s=null;},p=b=>{r||(r=i.createElement("div"),r.style.cssText="position:fixed;height:3px;border-radius:2px;background:#FF5B35;box-shadow:0 0 0 1px rgba(255,255,255,0.65);pointer-events:none;z-index:2147483647;",e.shadowRoot?.appendChild(r)),r.style.left=`${b.rect.left+4}px`,r.style.width=`${Math.max(0,b.rect.width-8)}px`,r.style.top=`${b.y-1.5}px`;},m=b=>{let C=b.dataTransfer?.types;return !!C&&Array.from(C).includes(bn)},u=48,d=b=>{let C=l();if(!C)return null;let L=C.getBoundingClientRect(),A=a(C),D=null,O=A.length===0?L.top+L.height/2:0;for(let ee of A){let B=ee.getBoundingClientRect();if(b<B.top+B.height/2){let te=Number(ee.dataset.veoIdx);D=Number.isFinite(te)?te:null,O=B.top;break}O=B.bottom;}return {beforeIndex:D,y:O,rect:L}},h=(b,C,L)=>b>=L.left-u&&b<=L.right+u&&C>=L.top-u&&C<=L.bottom+u,f=(b,C)=>{let L=d(C);return !L||!h(b,C,L.rect)?(c(),false):(s=L,p(L),true)},v=(b,C)=>{let L=d(C);return c(),!L||!h(b,C,L.rect)?null:{beforeIndex:L.beforeIndex}},x=b=>{if(!m(b))return;let C=d(b.clientY);C&&(b.preventDefault(),b.dataTransfer&&(b.dataTransfer.dropEffect="copy"),s=C,p(C));},y=b=>{if(!m(b))return;b.preventDefault();let C=b.dataTransfer?.getData(bn)??"",L=s??d(b.clientY);c(),!(!C||!L)&&n({stepIndex:o,blockType:C,beforeIndex:L.beforeIndex});},w=b=>{let C=b.relatedTarget;C instanceof Node&&(C===e||e.contains(C))||c();};return e.addEventListener("dragover",x),e.addEventListener("drop",y),e.addEventListener("dragleave",w),{hoverAt:f,dropAt:v,cancelHover:c,detach(){e.removeEventListener("dragover",x),e.removeEventListener("drop",y),e.removeEventListener("dragleave",w),c();}}}function ye(){return typeof window<"u"}function Ce(){return typeof document<"u"}var Qe="veoBuilder",yt="veoBuilderOrigin",xn="veoBuilderPanel",wn="veoBuilderPanelPath",En="veoGuide";var pr="veoPreview",kn="veo:preview_token";function ur(){try{return window.sessionStorage}catch{return null}}function mr(){if(!ye())return null;let t=null;try{let o=new URLSearchParams(window.location.search).get(pr);t=o||null;}catch{t=null;}let e=ur();if(t){try{e?.setItem(kn,t);}catch{}return t}try{return e?.getItem(kn)||null}catch{return null}}function Cn(){return mr()!==null}var Dt="veo:builder_ctx",Sn="veo:builder_ctx:",fr=1800*1e3;function _t(){try{return window.sessionStorage}catch{return null}}function No(){try{return window.localStorage}catch{return null}}function Ln(t){return Sn+(t||"default")}function hr(t){try{_t()?.setItem(Dt,JSON.stringify(t));}catch{}try{let e={...t,savedAt:Date.now()};No()?.setItem(Ln(t.guide),JSON.stringify(e));}catch{}}function gr(){let t=No();if(!t)return null;let e=null;try{for(let i=0;i<t.length;i++){let r=t.key(i);if(!r?.startsWith(Sn))continue;let s=t.getItem(r);if(!s)continue;let l=null;try{l=JSON.parse(s);}catch{continue}if(typeof l?.savedAt!="number"||Date.now()-l.savedAt>fr){try{t.removeItem(r);}catch{}continue}(!e||l.savedAt>e.savedAt)&&(e=l);}}catch{return null}if(!e)return null;let{savedAt:o,...n}=e;return n}function vr(){try{let t=new URLSearchParams(window.location.search);if(t.get(Qe))return t;let e=window.location.hash.replace(/^#/,"");return e.includes(`${Qe}=`)?new URLSearchParams(e):t}catch{return null}}function Tn(){if(!ye())return null;let t=vr(),e=t?.get(Qe);if(e){let n={token:e,origin:t?.get(yt)??null,panel:t?.get(xn)==="1",guide:t?.get(En)??null,panelPath:t?.get(wn)??null};return hr(n),n}if(Cn())return null;try{let n=_t()?.getItem(Dt);if(n)return JSON.parse(n)}catch{}let o=gr();if(o)try{_t()?.setItem(Dt,JSON.stringify(o));}catch{}return o}function An(){if(!ye())return;let t=null;try{let e=_t()?.getItem(Dt);e&&(t=JSON.parse(e).guide??null);}catch{}try{_t()?.removeItem(Dt);}catch{}try{No()?.removeItem(Ln(t));}catch{}}function Rn(t,e=typeof window>"u"?1024:window.innerWidth){if(!t||t==="all")return true;let o=e<=767;return t==="mobile"?o:!o}function Ot(t){let e=t?.trigger??"immediate";return e==="immediate"||e==="delayed"?true:e==="on_click"||e==="on_hover"?t?.autoShow===true:false}function Mn(t){if(!Ot(t))return 0;let e=t?.delayMs??0;return Number.isFinite(e)&&e>0?e:0}var Pn=["http:","https:"],In="data-veo-guide";var br={P:"p",BR:"br",STRONG:"strong",B:"strong",EM:"em",I:"em",U:"u",S:"s",UL:"ul",OL:"ol",LI:"li",A:"a"},yr=new Set(["SCRIPT","STYLE","TEMPLATE","IFRAME","OBJECT","EMBED","NOSCRIPT","TITLE","TEXTAREA","SELECT","SVG","MATH"]),Bn=16*1024,xr=20,wr=1e3;function xt(t,e){let o=e.createDocumentFragment();if(typeof t!="string"||t.length===0)return o;let n;try{n=new DOMParser().parseFromString(t.length>Bn?t.slice(0,Bn):t,"text/html");}catch{return o.appendChild(e.createTextNode(t)),o}let i={nodes:0,exceeded:false};for(let r of Array.from(n.body.childNodes)){let s=Gt(r,e,0,i);s&&o.appendChild(s);}if(i.exceeded){let r=e.createDocumentFragment();return r.appendChild(e.createTextNode(n.body.textContent??"")),r}return o}function Gt(t,e,o,n){if(n.exceeded)return null;if(++n.nodes>wr||o>xr)return n.exceeded=true,null;if(t.nodeType===Node.TEXT_NODE)return e.createTextNode(t.textContent??"");if(t.nodeType!==Node.ELEMENT_NODE)return null;let i=t;if(yr.has(i.tagName))return null;let r=br[i.tagName];if(!r){let l=e.createDocumentFragment();for(let a of Array.from(i.childNodes)){let c=Gt(a,e,o+1,n);c&&l.appendChild(c);}return l}if(r==="a"){let l=i.getAttribute("href")??"";if(!me(l)){let c=e.createDocumentFragment();for(let p of Array.from(i.childNodes)){let m=Gt(p,e,o+1,n);m&&c.appendChild(m);}return c}let a=e.createElement("a");a.setAttribute("href",l),a.setAttribute("target","_blank"),a.setAttribute("rel","noopener noreferrer nofollow");for(let c of Array.from(i.childNodes)){let p=Gt(c,e,o+1,n);p&&a.appendChild(p);}return a}let s=e.createElement(r);for(let l of Array.from(i.childNodes)){let a=Gt(l,e,o+1,n);a&&s.appendChild(a);}return s}function Er(t,e){let o;try{o=new URL(e);}catch{return null}if(o.protocol!=="https:"&&o.protocol!=="http:")return null;let n=o.hostname.replace(/^www\./,"").replace(/^m\./,""),i=(r,s)=>s.match(r)?.[1]??null;switch(t){case "youtube":{let r=null;return n==="youtube.com"||n==="youtube-nocookie.com"?r=o.searchParams.get("v")??i(/^\/(?:embed|shorts|live)\/([A-Za-z0-9_-]{6,})/,o.pathname):n==="youtu.be"&&(r=i(/^\/([A-Za-z0-9_-]{6,})/,o.pathname)),!r||!/^[A-Za-z0-9_-]{6,}$/.test(r)?null:`https://www.youtube-nocookie.com/embed/${r}`}case "vimeo":{if(n!=="vimeo.com"&&n!=="player.vimeo.com")return null;let r=i(/(\d{6,})/,o.pathname);return r?`https://player.vimeo.com/video/${r}`:null}case "loom":{if(n!=="loom.com")return null;let r=i(/^\/(?:share|embed)\/([A-Za-z0-9]{16,})/,o.pathname);return r?`https://www.loom.com/embed/${r}`:null}case "wistia":{if(!wt(n,"wistia.com")&&!wt(n,"wistia.net"))return null;let r=i(/\/(?:medias|embed\/iframe)\/([A-Za-z0-9]{6,})/,o.pathname);return r?`https://fast.wistia.net/embed/iframe/${r}`:null}case "msstream":{if(!wt(n,"microsoftstream.com"))return null;let r=i(/\/(?:embed\/)?video\/([0-9a-f-]{36})/i,o.pathname);return r?`https://web.microsoftstream.com/embed/video/${r}?autoplay=false&showinfo=true`:null}case "vidyard":{if(!wt(n,"vidyard.com"))return null;let r=i(/\/watch\/([A-Za-z0-9_-]{8,})/,o.pathname)??(n==="play.vidyard.com"?i(/^\/([A-Za-z0-9_-]{8,})/,o.pathname):null);return r?`https://play.vidyard.com/${r}`:null}case "sharepoint":return o.protocol==="https:"&&wt(n,"sharepoint.com")?o.href:null;case "brightcove":return o.protocol==="https:"&&n==="players.brightcove.net"&&o.searchParams.get("videoId")?o.href:null;case "kaltura":return o.protocol==="https:"&&wt(n,"kaltura.com")&&o.pathname.startsWith("/p/")?o.href:null;default:return null}}function wt(t,e){return t===e||t.endsWith(`.${e}`)}function kr(t){try{let e=new URL(t);return e.protocol!=="https:"&&e.protocol!=="http:"?null:/\.(mp4|webm|mov)$/i.test(e.pathname)?e.href:null}catch{return null}}function Nn(t,e,o={}){let n=t.provider==="file",i=typeof t.url=="string"?n?kr(t.url):Er(t.provider,t.url):null;if(!i)return null;let r=t.style??{},s=e.createElement("div");s.className="veo-guide-video";let l=r.aspect==="4:3"?"4 / 3":"16 / 9";if(s.style.aspectRatio=l,r.widthMode==="fill")s.style.width="100%";else {let p=typeof r.width=="number"&&Number.isFinite(r.width)?r.width:400;s.style.width=`${Math.max(120,Math.min(1600,p))}px`,s.style.maxWidth="100%";}let a=r.align==="center"?"center":r.align==="right"?"flex-end":"flex-start";if(s.style.alignSelf=a,n){let p=e.createElement("video");return p.src=i,p.controls=true,p.setAttribute("playsinline",""),p.preload="metadata",p.setAttribute("aria-label",typeof t.alt=="string"&&t.alt.trim()?t.alt.trim():"Video"),o.editing&&(p.style.pointerEvents="none"),s.appendChild(p),s}let c=e.createElement("iframe");return c.src=i,c.title=typeof t.alt=="string"&&t.alt.trim()?t.alt.trim():"Video",c.setAttribute("loading","lazy"),c.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),c.setAttribute("allow",`accelerometer; autoplay; clipboard-write; encrypted-media; picture-in-picture${o.editing?"":"; fullscreen"}`),o.editing||c.setAttribute("allowfullscreen",""),o.editing&&(c.style.pointerEvents="none"),s.appendChild(c),s}function he(t,e,o){let n=e.createElement("div");n.className="veo-guide-content";let i=Dn(t);return i?Sr(n,i,e,o):Cr(n,t,e,o),n.appendChild(at(e,()=>o.onDismiss())),n}function $n(t,e){let o=Dn(t);if(o){let i=[];for(let{block:r,idx:s}of o){if(r.type==="button")continue;let l=Et(r,e);l&&(l.dataset.veoIdx=String(s),i.push(l));}return i}let n=[];if(typeof t.imageUrl=="string"&&t.imageUrl&&me(t.imageUrl)){let i=e.createElement("img");i.className="veo-guide-image",i.src=t.imageUrl,i.alt=typeof t.title=="string"?t.title:"",n.push(i);}if(typeof t.title=="string"&&t.title){let i=e.createElement("h2");i.className="veo-guide-title",i.textContent=t.title,n.push(i);}if(typeof t.content=="string"&&t.content){let i=e.createElement("p");i.className="veo-guide-text",i.textContent=t.content,n.push(i);}return n}function Cr(t,e,o,n){if(typeof e.imageUrl=="string"&&e.imageUrl&&me(e.imageUrl)){let r=o.createElement("img");r.className="veo-guide-image",r.src=e.imageUrl,r.alt=typeof e.title=="string"?e.title:"",t.appendChild(r);}if(typeof e.title=="string"&&e.title){let r=o.createElement("h2");r.className="veo-guide-title",r.textContent=e.title,t.appendChild(r);}if(typeof e.content=="string"&&e.content){let r=o.createElement("p");r.className="veo-guide-text",r.textContent=e.content,t.appendChild(r);}let i=o.createElement("div");if(i.className="veo-guide-actions",typeof e.ctaText=="string"&&e.ctaText){let r=o.createElement("button");r.type="button",r.className="veo-guide-cta",r.textContent=e.ctaText,r.addEventListener("click",()=>{let s=e.ctaAction??"dismiss",l=Rr(e);n.onCtaClick(s,l);}),i.appendChild(r);}t.appendChild(i);}function Dn(t){if(!Array.isArray(t.blocks)||t.blocks.length===0)return null;let e=t.blocks.map((o,n)=>({block:o,idx:n})).filter(o=>{let n=o.block;return !n||typeof n!="object"?false:n.type==="image"?typeof n.url=="string"&&me(n.url):n.type==="title"||n.type==="text"||n.type==="button"});return e.length>0?e:null}function Sr(t,e,o,n){let i=0;for(;i<e.length;){let r=e[i];if(r?.block.type==="button"){let l=o.createElement("div");l.className="veo-guide-actions",l.dataset.veoIdx=String(r.idx);let a;for(;i<e.length&&e[i]?.block.type==="button";){let c=e[i].block;if(!a){let p=c.style?.align;(p==="left"||p==="center"||p==="right")&&(a=p);}l.appendChild(Ar(c,o,n)),i++;}a&&(l.style.justifyContent=Ho[a]),t.appendChild(l);continue}let s=r?Et(r.block,o):null;s&&r&&(s.dataset.veoIdx=String(r.idx),t.appendChild(s)),i++;}}function Et(t,e,o={}){switch(t.type){case "video":return Nn(t,e,o);case "divider":return Tr(t,e);case "title":{let n=e.createElement("h2");return n.className="veo-guide-title",n.textContent=typeof t.text=="string"?t.text:"",Ae(n,t.style,"text"),n}case "text":{let n=e.createElement("div");return n.className="veo-guide-text",typeof t.html=="string"&&t.html?n.appendChild(xt(t.html,e)):n.textContent=typeof t.text=="string"?t.text:"",Ae(n,t.style,"text"),n}case "image":{if(typeof t.url!="string"||!me(t.url))return null;let n=e.createElement("img");return n.className="veo-guide-image",n.src=t.url,n.alt=typeof t.alt=="string"?t.alt:"",Ae(n,t.style,"image"),n}default:return null}}var Lr=new Set(["solid","dotted","dashed"]);function Tr(t,e){let o=t.style??{},n=e.createElement("div");n.className="veo-guide-divider",n.setAttribute("role","separator");let i=e.createElement("hr"),r=o.preset==="custom",s=r&&typeof o.color=="string"&&o.color?o.color:o.colorMode==="dark"?"rgba(255, 255, 255, 0.35)":"#e5e7eb",l=r&&typeof o.thickness=="number"&&Number.isFinite(o.thickness)?ue(Math.round(o.thickness),1,12):1,a=typeof o.lineStyle=="string"&&Lr.has(o.lineStyle)?o.lineStyle:"solid";i.style.borderTop=`${l}px ${a} ${s}`,n.appendChild(i);for(let[c,p]of [["marginTop","marginTop"],["marginRight","marginRight"],["marginBottom","marginBottom"],["marginLeft","marginLeft"]]){let m=o[c];typeof m=="number"&&Number.isFinite(m)&&(n.style[p]=`${ue(m,0,64)}px`);}return n}function Ar(t,e,o){let n=e.createElement("button");return n.type="button",n.className="veo-guide-cta",n.textContent=typeof t.text=="string"&&t.text?t.text:"OK",Ae(n,t.style,"button"),n.addEventListener("click",()=>{let i=t.action??"dismiss",r=i==="next"||i==="url"||i==="guide"?i:"dismiss",s=r==="url"&&typeof t.url=="string"&&me(t.url)?t.url:r==="guide"&&typeof t.targetGuideId=="string"&&t.targetGuideId?t.targetGuideId:void 0,l={...typeof t.id=="string"&&t.id?{buttonId:t.id}:{},...typeof t.text=="string"&&t.text?{buttonText:t.text}:{}};o.onCtaClick(r,s,Object.keys(l).length?l:void 0);}),n}var Ho={left:"flex-start",center:"center",right:"flex-end"};function ue(t,e,o){return Math.min(o,Math.max(e,t))}var Hn={title:{size:18,weight:600,lineHeight:1.3},subtitle:{size:16,weight:600,lineHeight:1.35},paragraph:{size:14,weight:400,lineHeight:1.5},small:{size:12,weight:400,lineHeight:1.5}};function Ae(t,e,o){if(!e||typeof e!="object")return;let n=e;if(o==="image"&&n.bleed===true){t.classList.add("veo-guide-image--bleed");return}let i=typeof n.align=="string"?n.align:null;if(i&&(i==="left"||i==="center"||i==="right")&&(o==="text"?(t.style.textAlign=i,t.style.alignSelf=Ho[i]):o==="image"&&(t.style.alignSelf=Ho[i])),o==="text"&&typeof n.preset=="string"&&n.preset in Hn){let r=Hn[n.preset];r&&(t.style.fontSize=`${r.size}px`,t.style.fontWeight=String(r.weight),t.style.lineHeight=String(r.lineHeight));}if(o!=="image"&&n.colorMode==="dark"&&(t.style.background="#1f1d1b",t.style.color="#f5f0eb",t.style.borderRadius=t.style.borderRadius||"8px"),o!=="image"&&typeof n.color=="string"&&(t.style.color=n.color),o==="text"&&typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&(t.style.fontSize=`${ue(n.fontSize,8,72)}px`),o==="image"&&n.naturalSize===true?(t.style.width="auto",t.style.maxWidth="100%",t.style.maxHeight="none",t.style.objectFit="contain"):o==="image"&&typeof n.width=="number"&&Number.isFinite(n.width)&&(t.style.width=`${ue(n.width,10,100)}%`),o==="image"&&typeof n.radius=="number"&&Number.isFinite(n.radius)&&(t.style.borderRadius=`${ue(n.radius,0,48)}px`),typeof n.marginTop=="number"&&Number.isFinite(n.marginTop)&&(t.style.marginTop=`${ue(n.marginTop,0,64)}px`),typeof n.marginBottom=="number"&&Number.isFinite(n.marginBottom)&&(t.style.marginBottom=`${ue(n.marginBottom,0,64)}px`),o!=="image"&&(typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&(t.style.fontSize=`${ue(n.fontSize,8,96)}px`),typeof n.fontFamily=="string"&&n.fontFamily&&n.fontFamily!=="inherit"&&(t.style.fontFamily=n.fontFamily),typeof n.fontWeight=="string"&&n.fontWeight&&(t.style.fontWeight=n.fontWeight),typeof n.textTransform=="string"&&n.textTransform&&n.textTransform!=="none"&&(t.style.textTransform=n.textTransform),typeof n.lineHeight=="number"&&Number.isFinite(n.lineHeight)&&(t.style.lineHeight=`${ue(n.lineHeight,50,300)}%`),typeof n.letterSpacing=="number"&&Number.isFinite(n.letterSpacing)&&(t.style.letterSpacing=`${ue(n.letterSpacing,-5,20)}px`)),typeof n.background=="string"&&n.background&&(t.style.background=n.background),typeof n.borderWidth=="number"&&n.borderWidth>0){let r=typeof n.borderColor=="string"&&n.borderColor?n.borderColor:"#bbbbbb";t.style.border=`${ue(n.borderWidth,0,20)}px solid ${r}`;}o!=="image"&&typeof n.radius=="number"&&Number.isFinite(n.radius)&&(t.style.borderRadius=`${ue(n.radius,0,64)}px`),typeof n.height=="number"&&Number.isFinite(n.height)&&n.height>0&&(t.style.height=`${ue(n.height,1,2e3)}px`),o!=="image"&&typeof n.width=="number"&&Number.isFinite(n.width)&&n.width>0&&(t.style.width=`${ue(n.width,1,2e3)}px`);for(let r of ["Top","Right","Bottom","Left"]){let s=n[`padding${r}`];typeof s=="number"&&Number.isFinite(s)&&t.style.setProperty(`padding-${r.toLowerCase()}`,`${ue(s,0,128)}px`);let l=n[`margin${r}`];typeof l=="number"&&Number.isFinite(l)&&t.style.setProperty(`margin-${r.toLowerCase()}`,`${ue(l,0,128)}px`);}}function at(t,e,o="veo-guide-close"){let n=t.createElement("button");return n.type="button",n.className=o,n.setAttribute("aria-label","Cerrar"),n.textContent="\xD7",n.addEventListener("click",e),n}function me(t){if(typeof t!="string"||t.length===0)return false;try{let e=typeof window<"u"?window.location.href:"http://localhost/",o=new URL(t,e);return Pn.includes(o.protocol)}catch{return false}}function Rr(t){let e=t.style?.ctaUrl;if(typeof e=="string")return me(e)?e:void 0}function _n(){let e=Date.now().toString(16).padStart(12,"0"),o=new Uint8Array(10);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(o);else for(let i=0;i<o.length;i++)o[i]=Math.floor(Math.random()*256);o[0]=(o[0]??0)&15|112,o[2]=(o[2]??0)&63|128;let n=Array.from(o,i=>i.toString(16).padStart(2,"0")).join("");return [e.slice(0,8),e.slice(8,12),n.slice(0,4),n.slice(4,8),n.slice(8,20)].join("-")}function kt(t,e,o,n){let i=t.createElement("iframe");i.className="veo-custom-frame",i.setAttribute("sandbox","allow-scripts"),i.setAttribute("title",o.guide.guideName||"OnUser"),i.style.width=n.width;let r=n.fixedHeight!==void 0&&n.fixedHeight!==null;r&&(i.style.height=Do(n.fixedHeight));let s=_n(),l=e.style?.tailwind===true;i.srcdoc=Nr(e.html??"",e.css??"",e.js??"",s,{hostCss:Pr(),htmlAttrs:Ir(),tailwind:l});let a=()=>o.onClose(),c=p=>{if(p.source!==i.contentWindow)return;let m=p.data;if(!(!m||typeof m!="object"||m.__veo!==s))switch(m.type){case "dismiss":o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:"dismissed"}),a();break;case "cta":o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:"cta_clicked"}),typeof m.url=="string"&&me(m.url)&&window.open(m.url,"_blank","noopener,noreferrer"),m.close!==false&&a();break;case "navigate":typeof m.url=="string"&&me(m.url)&&window.location.assign(m.url);break;case "track":typeof m.name=="string"&&o.onTrack&&o.onTrack(m.name,Br(m.props)?m.props:void 0);break;case "resize":!r&&typeof m.height=="number"&&m.height>0&&(i.style.height=`${Math.ceil(m.height)}px`);break}};return window.addEventListener("message",c),{iframe:i,cleanup:()=>window.removeEventListener("message",c)}}function Do(t){return typeof t=="number"?`${t}px`:t}var Mr=800*1024;function Pr(){if(typeof document>"u")return "";let t="";try{for(let e of Array.from(document.styleSheets)){let o=null;try{o=e.cssRules;}catch{continue}if(o){for(let n of Array.from(o))if(t+=`${n.cssText}
2
- `,t.length>Mr)return t}}}catch{return t}return t}function Ir(){if(typeof document>"u")return "";try{let t=document.documentElement,e=[];for(let o of ["class","style","data-theme","data-mode","data-color-mode"]){let n=t.getAttribute(o);n&&n.length<=1e3&&!/["<>]/.test(n)&&e.push(`${o}="${n}"`);}return e.join(" ")}catch{return ""}}function Br(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Nr(t,e,o,n,i){let r=`(function(){var T=${JSON.stringify(n)};function P(m){m.__veo=T;parent.postMessage(m,'*');}window.veo={dismiss:function(){P({type:'dismiss'});},cta:function(u){P({type:'cta',url:u});},track:function(n,p){P({type:'track',name:n,props:p||{}});},navigate:function(u){P({type:'navigate',url:u});}};document.addEventListener('click',function(e){var a=e.target&&e.target.closest?e.target.closest('a[href]'):null;if(!a)return;var h=a.getAttribute('href');if(!h||h.charAt(0)==='#'||/^(javascript|mailto|tel):/i.test(h))return;e.preventDefault();if(a.target==='_blank'){P({type:'cta',url:a.href,close:false});}else{P({type:'navigate',url:h});}},true);function H(){var r=document.getElementById('__veo_root');var h=r?r.getBoundingClientRect().height:document.documentElement.scrollHeight;P({type:'resize',height:Math.ceil(h)});}window.addEventListener('load',H);try{if(typeof ResizeObserver!=='undefined'){var _r=document.getElementById('__veo_root');new ResizeObserver(H).observe(_r||document.documentElement);}}catch(e){}})();`,s=i.hostCss?`<style>${$o(i.hostCss,"style")}</style>`:"",l=i.tailwind?'<script src="https://cdn.tailwindcss.com"></script>':"";return `<!DOCTYPE html><html ${i.htmlAttrs}><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;}body{font-family:system-ui,-apple-system,sans-serif;}</style>`+s+"<style>html,body{margin:0!important;padding:0!important;background:transparent!important;height:auto!important;min-height:0!important;max-height:none!important;width:auto!important;min-width:0!important;overflow:visible!important;color-scheme:normal!important;}</style>"+l+`<style>${$o(e,"style")}</style></head><body style="margin:0!important;background:transparent!important;min-height:0!important;height:auto!important;"><div id="__veo_root">${t}</div><script>${r}</script>`+(o?`<script>${$o(o,"script")}</script>`:"")+"</body></html>"}function $o(t,e){let o=e==="script"?/<\/script/gi:/<\/style/gi;return t.replace(o,`<\\/${e}`)}var _o="data-veo-raw-block";function Hr(t,e,o){let n=t.parentNode;if(o==="prepend"){let i=t.firstChild;for(let r of e)t.insertBefore(r,i);}else if(o==="append")for(let i of e)t.appendChild(i);else if(o==="before")for(let i of e)n?.insertBefore(i,t);else {let i=t;for(let r of e)n?.insertBefore(r,i.nextSibling),i=r;}}var $r=0;function Oo(t,e,o,n,i){if(t.sandboxed){let c={html:t.html??"",css:t.css,js:t.js},{iframe:p,cleanup:m}=kt(e,c,o,{width:"100%"}),u=e.createElement("div");return u.className="veo-code-sandbox",u.appendChild(p),{node:u,cleanup:m}}let r=e,s=[];if(typeof t.css=="string"&&t.css.trim()){let c=r.createElement("style");c.textContent=t.css,r.head.appendChild(c),s.push(c);}let l=null;if(typeof t.html=="string"&&t.html.trim()){let c=e.createElement("div");c.className="veo-code-html",c.innerHTML=t.html;for(let p of Array.from(c.querySelectorAll("script")))s.push(_r(p,r)),p.remove();if(i){let p=Array.from(c.childNodes);if(i.tagBlockId)for(let m of p)m instanceof Element&&m.setAttribute(_o,i.tagBlockId);Hr(i.anchor,p,i.pos),s.push(...p);}else if(n){let p=`veo-code-${++$r}`;c.slot=p,n.appendChild(c),s.push(c);let m=e.createElement("slot");m.setAttribute("name",p);let u=e.createElement("div");u.className="veo-code-host",u.appendChild(m),l=u;}else l=c;}let a=false;if(typeof t.js=="string"&&t.js.trim()){let c=t.js,p=()=>{if(a)return;let m=r.createElement("script");m.textContent=Dr(c),r.body.appendChild(m),s.push(m);};n&&!n.isConnected?queueMicrotask(p):p();}return {node:l,cleanup:()=>{a=true;for(let c of s)c.parentNode?.removeChild(c);}}}function Dr(t){return `(function(){try{
1
+ var veoBuilder=(function(exports){'use strict';var yn="application/x-veo-block";function xn(t){let{host:e,stepIndex:o,onDrop:n}=t,i=e.ownerDocument,r=null,s=null,l=()=>e.shadowRoot?.querySelector(".veo-guide-content")??null,a=b=>Array.from(b.children).filter(C=>C instanceof HTMLElement&&C.dataset.veoIdx!==void 0),c=()=>{r?.remove(),r=null,s=null;},p=b=>{r||(r=i.createElement("div"),r.style.cssText="position:fixed;height:3px;border-radius:2px;background:#FF5B35;box-shadow:0 0 0 1px rgba(255,255,255,0.65);pointer-events:none;z-index:2147483647;",e.shadowRoot?.appendChild(r)),r.style.left=`${b.rect.left+4}px`,r.style.width=`${Math.max(0,b.rect.width-8)}px`,r.style.top=`${b.y-1.5}px`;},m=b=>{let C=b.dataTransfer?.types;return !!C&&Array.from(C).includes(yn)},u=48,d=b=>{let C=l();if(!C)return null;let L=C.getBoundingClientRect(),A=a(C),D=null,O=A.length===0?L.top+L.height/2:0;for(let ee of A){let B=ee.getBoundingClientRect();if(b<B.top+B.height/2){let te=Number(ee.dataset.veoIdx);D=Number.isFinite(te)?te:null,O=B.top;break}O=B.bottom;}return {beforeIndex:D,y:O,rect:L}},g=(b,C,L)=>b>=L.left-u&&b<=L.right+u&&C>=L.top-u&&C<=L.bottom+u,f=(b,C)=>{let L=d(C);return !L||!g(b,C,L.rect)?(c(),false):(s=L,p(L),true)},v=(b,C)=>{let L=d(C);return c(),!L||!g(b,C,L.rect)?null:{beforeIndex:L.beforeIndex}},x=b=>{if(!m(b))return;let C=d(b.clientY);C&&(b.preventDefault(),b.dataTransfer&&(b.dataTransfer.dropEffect="copy"),s=C,p(C));},y=b=>{if(!m(b))return;b.preventDefault();let C=b.dataTransfer?.getData(yn)??"",L=s??d(b.clientY);c(),!(!C||!L)&&n({stepIndex:o,blockType:C,beforeIndex:L.beforeIndex});},w=b=>{let C=b.relatedTarget;C instanceof Node&&(C===e||e.contains(C))||c();};return e.addEventListener("dragover",x),e.addEventListener("drop",y),e.addEventListener("dragleave",w),{hoverAt:f,dropAt:v,cancelHover:c,detach(){e.removeEventListener("dragover",x),e.removeEventListener("drop",y),e.removeEventListener("dragleave",w),c();}}}function ye(){return typeof window<"u"}function Ce(){return typeof document<"u"}var Qe="veoBuilder",yt="veoBuilderOrigin",wn="veoBuilderPanel",En="veoBuilderPanelPath",kn="veoGuide";var ur="veoPreview",Cn="veo:preview_token";function mr(){try{return window.sessionStorage}catch{return null}}function fr(){if(!ye())return null;let t=null;try{let o=new URLSearchParams(window.location.search).get(ur);t=o||null;}catch{t=null;}let e=mr();if(t){try{e?.setItem(Cn,t);}catch{}return t}try{return e?.getItem(Cn)||null}catch{return null}}function Sn(){return fr()!==null}var Dt="veo:builder_ctx",Ln="veo:builder_ctx:",gr=1800*1e3;function _t(){try{return window.sessionStorage}catch{return null}}function No(){try{return window.localStorage}catch{return null}}function Tn(t){return Ln+(t||"default")}function hr(t){try{_t()?.setItem(Dt,JSON.stringify(t));}catch{}try{let e={...t,savedAt:Date.now()};No()?.setItem(Tn(t.guide),JSON.stringify(e));}catch{}}function vr(){let t=No();if(!t)return null;let e=null;try{for(let i=0;i<t.length;i++){let r=t.key(i);if(!r?.startsWith(Ln))continue;let s=t.getItem(r);if(!s)continue;let l=null;try{l=JSON.parse(s);}catch{continue}if(typeof l?.savedAt!="number"||Date.now()-l.savedAt>gr){try{t.removeItem(r);}catch{}continue}(!e||l.savedAt>e.savedAt)&&(e=l);}}catch{return null}if(!e)return null;let{savedAt:o,...n}=e;return n}function br(){try{let t=new URLSearchParams(window.location.search);if(t.get(Qe))return t;let e=window.location.hash.replace(/^#/,"");return e.includes(`${Qe}=`)?new URLSearchParams(e):t}catch{return null}}function An(){if(!ye())return null;let t=br(),e=t?.get(Qe);if(e){let n={token:e,origin:t?.get(yt)??null,panel:t?.get(wn)==="1",guide:t?.get(kn)??null,panelPath:t?.get(En)??null};return hr(n),n}if(Sn())return null;try{let n=_t()?.getItem(Dt);if(n)return JSON.parse(n)}catch{}let o=vr();if(o)try{_t()?.setItem(Dt,JSON.stringify(o));}catch{}return o}function Mn(){if(!ye())return;let t=null;try{let e=_t()?.getItem(Dt);e&&(t=JSON.parse(e).guide??null);}catch{}try{_t()?.removeItem(Dt);}catch{}try{No()?.removeItem(Tn(t));}catch{}}function Rn(t,e=typeof window>"u"?1024:window.innerWidth){if(!t||t==="all")return true;let o=e<=767;return t==="mobile"?o:!o}function Ot(t){let e=t?.trigger??"immediate";return e==="immediate"||e==="delayed"?true:e==="on_click"||e==="on_hover"?t?.autoShow===true:false}function Pn(t){if(!Ot(t))return 0;let e=t?.delayMs??0;return Number.isFinite(e)&&e>0?e:0}var In=["http:","https:"],Bn="data-veo-guide";var yr={P:"p",BR:"br",STRONG:"strong",B:"strong",EM:"em",I:"em",U:"u",S:"s",UL:"ul",OL:"ol",LI:"li",A:"a"},xr=new Set(["SCRIPT","STYLE","TEMPLATE","IFRAME","OBJECT","EMBED","NOSCRIPT","TITLE","TEXTAREA","SELECT","SVG","MATH"]),Nn=16*1024,wr=20,Er=1e3;function xt(t,e){let o=e.createDocumentFragment();if(typeof t!="string"||t.length===0)return o;let n;try{n=new DOMParser().parseFromString(t.length>Nn?t.slice(0,Nn):t,"text/html");}catch{return o.appendChild(e.createTextNode(t)),o}let i={nodes:0,exceeded:false};for(let r of Array.from(n.body.childNodes)){let s=Gt(r,e,0,i);s&&o.appendChild(s);}if(i.exceeded){let r=e.createDocumentFragment();return r.appendChild(e.createTextNode(n.body.textContent??"")),r}return o}function Gt(t,e,o,n){if(n.exceeded)return null;if(++n.nodes>Er||o>wr)return n.exceeded=true,null;if(t.nodeType===Node.TEXT_NODE)return e.createTextNode(t.textContent??"");if(t.nodeType!==Node.ELEMENT_NODE)return null;let i=t;if(xr.has(i.tagName))return null;let r=yr[i.tagName];if(!r){let l=e.createDocumentFragment();for(let a of Array.from(i.childNodes)){let c=Gt(a,e,o+1,n);c&&l.appendChild(c);}return l}if(r==="a"){let l=i.getAttribute("href")??"";if(!me(l)){let c=e.createDocumentFragment();for(let p of Array.from(i.childNodes)){let m=Gt(p,e,o+1,n);m&&c.appendChild(m);}return c}let a=e.createElement("a");a.setAttribute("href",l),a.setAttribute("target","_blank"),a.setAttribute("rel","noopener noreferrer nofollow");for(let c of Array.from(i.childNodes)){let p=Gt(c,e,o+1,n);p&&a.appendChild(p);}return a}let s=e.createElement(r);for(let l of Array.from(i.childNodes)){let a=Gt(l,e,o+1,n);a&&s.appendChild(a);}return s}function kr(t,e){let o;try{o=new URL(e);}catch{return null}if(o.protocol!=="https:"&&o.protocol!=="http:")return null;let n=o.hostname.replace(/^www\./,"").replace(/^m\./,""),i=(r,s)=>s.match(r)?.[1]??null;switch(t){case "youtube":{let r=null;return n==="youtube.com"||n==="youtube-nocookie.com"?r=o.searchParams.get("v")??i(/^\/(?:embed|shorts|live)\/([A-Za-z0-9_-]{6,})/,o.pathname):n==="youtu.be"&&(r=i(/^\/([A-Za-z0-9_-]{6,})/,o.pathname)),!r||!/^[A-Za-z0-9_-]{6,}$/.test(r)?null:`https://www.youtube-nocookie.com/embed/${r}`}case "vimeo":{if(n!=="vimeo.com"&&n!=="player.vimeo.com")return null;let r=i(/(\d{6,})/,o.pathname);return r?`https://player.vimeo.com/video/${r}`:null}case "loom":{if(n!=="loom.com")return null;let r=i(/^\/(?:share|embed)\/([A-Za-z0-9]{16,})/,o.pathname);return r?`https://www.loom.com/embed/${r}`:null}case "wistia":{if(!wt(n,"wistia.com")&&!wt(n,"wistia.net"))return null;let r=i(/\/(?:medias|embed\/iframe)\/([A-Za-z0-9]{6,})/,o.pathname);return r?`https://fast.wistia.net/embed/iframe/${r}`:null}case "msstream":{if(!wt(n,"microsoftstream.com"))return null;let r=i(/\/(?:embed\/)?video\/([0-9a-f-]{36})/i,o.pathname);return r?`https://web.microsoftstream.com/embed/video/${r}?autoplay=false&showinfo=true`:null}case "vidyard":{if(!wt(n,"vidyard.com"))return null;let r=i(/\/watch\/([A-Za-z0-9_-]{8,})/,o.pathname)??(n==="play.vidyard.com"?i(/^\/([A-Za-z0-9_-]{8,})/,o.pathname):null);return r?`https://play.vidyard.com/${r}`:null}case "sharepoint":return o.protocol==="https:"&&wt(n,"sharepoint.com")?o.href:null;case "brightcove":return o.protocol==="https:"&&n==="players.brightcove.net"&&o.searchParams.get("videoId")?o.href:null;case "kaltura":return o.protocol==="https:"&&wt(n,"kaltura.com")&&o.pathname.startsWith("/p/")?o.href:null;default:return null}}function wt(t,e){return t===e||t.endsWith(`.${e}`)}function Cr(t){try{let e=new URL(t);return e.protocol!=="https:"&&e.protocol!=="http:"?null:/\.(mp4|webm|mov)$/i.test(e.pathname)?e.href:null}catch{return null}}function Hn(t,e,o={}){let n=t.provider==="file",i=typeof t.url=="string"?n?Cr(t.url):kr(t.provider,t.url):null;if(!i)return null;let r=t.style??{},s=e.createElement("div");s.className="veo-guide-video";let l=r.aspect==="4:3"?"4 / 3":"16 / 9";if(s.style.aspectRatio=l,r.widthMode==="fill")s.style.width="100%";else {let p=typeof r.width=="number"&&Number.isFinite(r.width)?r.width:400;s.style.width=`${Math.max(120,Math.min(1600,p))}px`,s.style.maxWidth="100%";}let a=r.align==="center"?"center":r.align==="right"?"flex-end":"flex-start";if(s.style.alignSelf=a,n){let p=e.createElement("video");return p.src=i,p.controls=true,p.setAttribute("playsinline",""),p.preload="metadata",p.setAttribute("aria-label",typeof t.alt=="string"&&t.alt.trim()?t.alt.trim():"Video"),o.editing&&(p.style.pointerEvents="none"),s.appendChild(p),s}let c=e.createElement("iframe");return c.src=i,c.title=typeof t.alt=="string"&&t.alt.trim()?t.alt.trim():"Video",c.setAttribute("loading","lazy"),c.setAttribute("referrerpolicy","strict-origin-when-cross-origin"),c.setAttribute("allow",`accelerometer; autoplay; clipboard-write; encrypted-media; picture-in-picture${o.editing?"":"; fullscreen"}`),o.editing||c.setAttribute("allowfullscreen",""),o.editing&&(c.style.pointerEvents="none"),s.appendChild(c),s}function ge(t,e,o){let n=e.createElement("div");n.className="veo-guide-content";let i=_n(t);return i?Lr(n,i,e,o):Sr(n,t,e,o),n.appendChild(at(e,()=>o.onDismiss())),n}function Dn(t,e){let o=_n(t);if(o){let i=[];for(let{block:r,idx:s}of o){if(r.type==="button")continue;let l=Et(r,e);l&&(l.dataset.veoIdx=String(s),i.push(l));}return i}let n=[];if(typeof t.imageUrl=="string"&&t.imageUrl&&me(t.imageUrl)){let i=e.createElement("img");i.className="veo-guide-image",i.src=t.imageUrl,i.alt=typeof t.title=="string"?t.title:"",n.push(i);}if(typeof t.title=="string"&&t.title){let i=e.createElement("h2");i.className="veo-guide-title",i.textContent=t.title,n.push(i);}if(typeof t.content=="string"&&t.content){let i=e.createElement("p");i.className="veo-guide-text",i.textContent=t.content,n.push(i);}return n}function Sr(t,e,o,n){if(typeof e.imageUrl=="string"&&e.imageUrl&&me(e.imageUrl)){let r=o.createElement("img");r.className="veo-guide-image",r.src=e.imageUrl,r.alt=typeof e.title=="string"?e.title:"",t.appendChild(r);}if(typeof e.title=="string"&&e.title){let r=o.createElement("h2");r.className="veo-guide-title",r.textContent=e.title,t.appendChild(r);}if(typeof e.content=="string"&&e.content){let r=o.createElement("p");r.className="veo-guide-text",r.textContent=e.content,t.appendChild(r);}let i=o.createElement("div");if(i.className="veo-guide-actions",typeof e.ctaText=="string"&&e.ctaText){let r=o.createElement("button");r.type="button",r.className="veo-guide-cta",r.textContent=e.ctaText,r.addEventListener("click",()=>{let s=e.ctaAction??"dismiss",l=Rr(e);n.onCtaClick(s,l);}),i.appendChild(r);}t.appendChild(i);}function _n(t){if(!Array.isArray(t.blocks)||t.blocks.length===0)return null;let e=t.blocks.map((o,n)=>({block:o,idx:n})).filter(o=>{let n=o.block;return !n||typeof n!="object"?false:n.type==="image"?typeof n.url=="string"&&me(n.url):n.type==="title"||n.type==="text"||n.type==="button"});return e.length>0?e:null}function Lr(t,e,o,n){let i=0;for(;i<e.length;){let r=e[i];if(r?.block.type==="button"){let l=o.createElement("div");l.className="veo-guide-actions",l.dataset.veoIdx=String(r.idx);let a;for(;i<e.length&&e[i]?.block.type==="button";){let c=e[i].block;if(!a){let p=c.style?.align;(p==="left"||p==="center"||p==="right")&&(a=p);}l.appendChild(Mr(c,o,n)),i++;}a&&(l.style.justifyContent=Ho[a]),t.appendChild(l);continue}let s=r?Et(r.block,o):null;s&&r&&(s.dataset.veoIdx=String(r.idx),t.appendChild(s)),i++;}}function Et(t,e,o={}){switch(t.type){case "video":return Hn(t,e,o);case "divider":return Ar(t,e);case "title":{let n=e.createElement("h2");return n.className="veo-guide-title",n.textContent=typeof t.text=="string"?t.text:"",Ae(n,t.style,"text"),n}case "text":{let n=e.createElement("div");return n.className="veo-guide-text",typeof t.html=="string"&&t.html?n.appendChild(xt(t.html,e)):n.textContent=typeof t.text=="string"?t.text:"",Ae(n,t.style,"text"),n}case "image":{if(typeof t.url!="string"||!me(t.url))return null;let n=e.createElement("img");return n.className="veo-guide-image",n.src=t.url,n.alt=typeof t.alt=="string"?t.alt:"",Ae(n,t.style,"image"),n}default:return null}}var Tr=new Set(["solid","dotted","dashed"]);function Ar(t,e){let o=t.style??{},n=e.createElement("div");n.className="veo-guide-divider",n.setAttribute("role","separator");let i=e.createElement("hr"),r=o.preset==="custom",s=r&&typeof o.color=="string"&&o.color?o.color:o.colorMode==="dark"?"rgba(255, 255, 255, 0.35)":"#e5e7eb",l=r&&typeof o.thickness=="number"&&Number.isFinite(o.thickness)?ue(Math.round(o.thickness),1,12):1,a=typeof o.lineStyle=="string"&&Tr.has(o.lineStyle)?o.lineStyle:"solid";i.style.borderTop=`${l}px ${a} ${s}`,n.appendChild(i);for(let[c,p]of [["marginTop","marginTop"],["marginRight","marginRight"],["marginBottom","marginBottom"],["marginLeft","marginLeft"]]){let m=o[c];typeof m=="number"&&Number.isFinite(m)&&(n.style[p]=`${ue(m,0,64)}px`);}return n}function Mr(t,e,o){let n=e.createElement("button");return n.type="button",n.className="veo-guide-cta",n.textContent=typeof t.text=="string"&&t.text?t.text:"OK",Ae(n,t.style,"button"),n.addEventListener("click",()=>{let i=t.action??"dismiss",r=i==="next"||i==="url"||i==="guide"?i:"dismiss",s=r==="url"&&typeof t.url=="string"&&me(t.url)?t.url:r==="guide"&&typeof t.targetGuideId=="string"&&t.targetGuideId?t.targetGuideId:void 0,l={...typeof t.id=="string"&&t.id?{buttonId:t.id}:{},...typeof t.text=="string"&&t.text?{buttonText:t.text}:{}};o.onCtaClick(r,s,Object.keys(l).length?l:void 0);}),n}var Ho={left:"flex-start",center:"center",right:"flex-end"};function ue(t,e,o){return Math.min(o,Math.max(e,t))}var $n={title:{size:18,weight:600,lineHeight:1.3},subtitle:{size:16,weight:600,lineHeight:1.35},paragraph:{size:14,weight:400,lineHeight:1.5},small:{size:12,weight:400,lineHeight:1.5}};function Ae(t,e,o){if(!e||typeof e!="object")return;let n=e;if(o==="image"&&n.bleed===true){t.classList.add("veo-guide-image--bleed");return}let i=typeof n.align=="string"?n.align:null;if(i&&(i==="left"||i==="center"||i==="right")&&(o==="text"?(t.style.textAlign=i,t.style.alignSelf=Ho[i]):o==="image"&&(t.style.alignSelf=Ho[i])),o==="text"&&typeof n.preset=="string"&&n.preset in $n){let r=$n[n.preset];r&&(t.style.fontSize=`${r.size}px`,t.style.fontWeight=String(r.weight),t.style.lineHeight=String(r.lineHeight));}if(o!=="image"&&n.colorMode==="dark"&&(t.style.background="#1f1d1b",t.style.color="#f5f0eb",t.style.borderRadius=t.style.borderRadius||"8px"),o!=="image"&&typeof n.color=="string"&&(t.style.color=n.color),o==="text"&&typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&(t.style.fontSize=`${ue(n.fontSize,8,72)}px`),o==="image"&&n.naturalSize===true?(t.style.width="auto",t.style.maxWidth="100%",t.style.maxHeight="none",t.style.objectFit="contain"):o==="image"&&typeof n.width=="number"&&Number.isFinite(n.width)&&(t.style.width=`${ue(n.width,10,100)}%`),o==="image"&&typeof n.radius=="number"&&Number.isFinite(n.radius)&&(t.style.borderRadius=`${ue(n.radius,0,48)}px`),typeof n.marginTop=="number"&&Number.isFinite(n.marginTop)&&(t.style.marginTop=`${ue(n.marginTop,0,64)}px`),typeof n.marginBottom=="number"&&Number.isFinite(n.marginBottom)&&(t.style.marginBottom=`${ue(n.marginBottom,0,64)}px`),o!=="image"&&(typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&(t.style.fontSize=`${ue(n.fontSize,8,96)}px`),typeof n.fontFamily=="string"&&n.fontFamily&&n.fontFamily!=="inherit"&&(t.style.fontFamily=n.fontFamily),typeof n.fontWeight=="string"&&n.fontWeight&&(t.style.fontWeight=n.fontWeight),typeof n.textTransform=="string"&&n.textTransform&&n.textTransform!=="none"&&(t.style.textTransform=n.textTransform),typeof n.lineHeight=="number"&&Number.isFinite(n.lineHeight)&&(t.style.lineHeight=`${ue(n.lineHeight,50,300)}%`),typeof n.letterSpacing=="number"&&Number.isFinite(n.letterSpacing)&&(t.style.letterSpacing=`${ue(n.letterSpacing,-5,20)}px`)),typeof n.background=="string"&&n.background&&(t.style.background=n.background),typeof n.borderWidth=="number"&&n.borderWidth>0){let r=typeof n.borderColor=="string"&&n.borderColor?n.borderColor:"#bbbbbb";t.style.border=`${ue(n.borderWidth,0,20)}px solid ${r}`;}o!=="image"&&typeof n.radius=="number"&&Number.isFinite(n.radius)&&(t.style.borderRadius=`${ue(n.radius,0,64)}px`),typeof n.height=="number"&&Number.isFinite(n.height)&&n.height>0&&(t.style.height=`${ue(n.height,1,2e3)}px`),o!=="image"&&typeof n.width=="number"&&Number.isFinite(n.width)&&n.width>0&&(t.style.width=`${ue(n.width,1,2e3)}px`);for(let r of ["Top","Right","Bottom","Left"]){let s=n[`padding${r}`];typeof s=="number"&&Number.isFinite(s)&&t.style.setProperty(`padding-${r.toLowerCase()}`,`${ue(s,0,128)}px`);let l=n[`margin${r}`];typeof l=="number"&&Number.isFinite(l)&&t.style.setProperty(`margin-${r.toLowerCase()}`,`${ue(l,0,128)}px`);}}function at(t,e,o="veo-guide-close"){let n=t.createElement("button");return n.type="button",n.className=o,n.setAttribute("aria-label","Cerrar"),n.textContent="\xD7",n.addEventListener("click",e),n}function me(t){if(typeof t!="string"||t.length===0)return false;try{let e=typeof window<"u"?window.location.href:"http://localhost/",o=new URL(t,e);return In.includes(o.protocol)}catch{return false}}function Rr(t){let e=t.style?.ctaUrl;if(typeof e=="string")return me(e)?e:void 0}function On(){let e=Date.now().toString(16).padStart(12,"0"),o=new Uint8Array(10);if(typeof crypto<"u"&&typeof crypto.getRandomValues=="function")crypto.getRandomValues(o);else for(let i=0;i<o.length;i++)o[i]=Math.floor(Math.random()*256);o[0]=(o[0]??0)&15|112,o[2]=(o[2]??0)&63|128;let n=Array.from(o,i=>i.toString(16).padStart(2,"0")).join("");return [e.slice(0,8),e.slice(8,12),n.slice(0,4),n.slice(4,8),n.slice(8,20)].join("-")}function kt(t,e,o,n){let i=t.createElement("iframe");i.className="veo-custom-frame",i.setAttribute("sandbox","allow-scripts"),i.setAttribute("title",o.guide.guideName||"OnUser"),i.style.width=n.width;let r=n.fixedHeight!==void 0&&n.fixedHeight!==null;r&&(i.style.height=Do(n.fixedHeight));let s=On(),l=e.style?.tailwind===true;i.srcdoc=Hr(e.html??"",e.css??"",e.js??"",s,{hostCss:Ir(),htmlAttrs:Br(),tailwind:l});let a=()=>o.onClose(),c=p=>{if(p.source!==i.contentWindow)return;let m=p.data;if(!(!m||typeof m!="object"||m.__veo!==s))switch(m.type){case "dismiss":o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:"dismissed"}),a();break;case "cta":o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:"cta_clicked"}),typeof m.url=="string"&&me(m.url)&&window.open(m.url,"_blank","noopener,noreferrer"),m.close!==false&&a();break;case "navigate":typeof m.url=="string"&&me(m.url)&&window.location.assign(m.url);break;case "track":typeof m.name=="string"&&o.onTrack&&o.onTrack(m.name,Nr(m.props)?m.props:void 0);break;case "resize":!r&&typeof m.height=="number"&&m.height>0&&(i.style.height=`${Math.ceil(m.height)}px`);break}};return window.addEventListener("message",c),{iframe:i,cleanup:()=>window.removeEventListener("message",c)}}function Do(t){return typeof t=="number"?`${t}px`:t}var Pr=800*1024;function Ir(){if(typeof document>"u")return "";let t="";try{for(let e of Array.from(document.styleSheets)){let o=null;try{o=e.cssRules;}catch{continue}if(o){for(let n of Array.from(o))if(t+=`${n.cssText}
2
+ `,t.length>Pr)return t}}}catch{return t}return t}function Br(){if(typeof document>"u")return "";try{let t=document.documentElement,e=[];for(let o of ["class","style","data-theme","data-mode","data-color-mode"]){let n=t.getAttribute(o);n&&n.length<=1e3&&!/["<>]/.test(n)&&e.push(`${o}="${n}"`);}return e.join(" ")}catch{return ""}}function Nr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Hr(t,e,o,n,i){let r=`(function(){var T=${JSON.stringify(n)};function P(m){m.__veo=T;parent.postMessage(m,'*');}window.veo={dismiss:function(){P({type:'dismiss'});},cta:function(u){P({type:'cta',url:u});},track:function(n,p){P({type:'track',name:n,props:p||{}});},navigate:function(u){P({type:'navigate',url:u});}};document.addEventListener('click',function(e){var a=e.target&&e.target.closest?e.target.closest('a[href]'):null;if(!a)return;var h=a.getAttribute('href');if(!h||h.charAt(0)==='#'||/^(javascript|mailto|tel):/i.test(h))return;e.preventDefault();if(a.target==='_blank'){P({type:'cta',url:a.href,close:false});}else{P({type:'navigate',url:h});}},true);function H(){var r=document.getElementById('__veo_root');var h=r?r.getBoundingClientRect().height:document.documentElement.scrollHeight;P({type:'resize',height:Math.ceil(h)});}window.addEventListener('load',H);try{if(typeof ResizeObserver!=='undefined'){var _r=document.getElementById('__veo_root');new ResizeObserver(H).observe(_r||document.documentElement);}}catch(e){}})();`,s=i.hostCss?`<style>${$o(i.hostCss,"style")}</style>`:"",l=i.tailwind?'<script src="https://cdn.tailwindcss.com"></script>':"";return `<!DOCTYPE html><html ${i.htmlAttrs}><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;}body{font-family:system-ui,-apple-system,sans-serif;}</style>`+s+"<style>html,body{margin:0!important;padding:0!important;background:transparent!important;height:auto!important;min-height:0!important;max-height:none!important;width:auto!important;min-width:0!important;overflow:visible!important;color-scheme:normal!important;}</style>"+l+`<style>${$o(e,"style")}</style></head><body style="margin:0!important;background:transparent!important;min-height:0!important;height:auto!important;"><div id="__veo_root">${t}</div><script>${r}</script>`+(o?`<script>${$o(o,"script")}</script>`:"")+"</body></html>"}function $o(t,e){let o=e==="script"?/<\/script/gi:/<\/style/gi;return t.replace(o,`<\\/${e}`)}var _o="data-veo-raw-block";function $r(t,e,o){let n=t.parentNode;if(o==="prepend"){let i=t.firstChild;for(let r of e)t.insertBefore(r,i);}else if(o==="append")for(let i of e)t.appendChild(i);else if(o==="before")for(let i of e)n?.insertBefore(i,t);else {let i=t;for(let r of e)n?.insertBefore(r,i.nextSibling),i=r;}}var Dr=0;function Oo(t,e,o,n,i){if(t.sandboxed){let c={html:t.html??"",css:t.css,js:t.js},{iframe:p,cleanup:m}=kt(e,c,o,{width:"100%"}),u=e.createElement("div");return u.className="veo-code-sandbox",u.appendChild(p),{node:u,cleanup:m}}let r=e,s=[];if(typeof t.css=="string"&&t.css.trim()){let c=r.createElement("style");c.textContent=t.css,r.head.appendChild(c),s.push(c);}let l=null;if(typeof t.html=="string"&&t.html.trim()){let c=e.createElement("div");c.className="veo-code-html",c.innerHTML=t.html;for(let p of Array.from(c.querySelectorAll("script")))s.push(Or(p,r)),p.remove();if(i){let p=Array.from(c.childNodes);if(i.tagBlockId)for(let m of p)m instanceof Element&&m.setAttribute(_o,i.tagBlockId);$r(i.anchor,p,i.pos),s.push(...p);}else if(n){let p=`veo-code-${++Dr}`;c.slot=p,n.appendChild(c),s.push(c);let m=e.createElement("slot");m.setAttribute("name",p);let u=e.createElement("div");u.className="veo-code-host",u.appendChild(m),l=u;}else l=c;}let a=false;if(typeof t.js=="string"&&t.js.trim()){let c=t.js,p=()=>{if(a)return;let m=r.createElement("script");m.textContent=_r(c),r.body.appendChild(m),s.push(m);};n&&!n.isConnected?queueMicrotask(p):p();}return {node:l,cleanup:()=>{a=true;for(let c of s)c.parentNode?.removeChild(c);}}}function _r(t){return `(function(){try{
3
3
  ${t}
4
- }catch(e){console.error("[OnUser] Error en el bloque de c\xF3digo:",e)}})();`}function _r(t,e){let o=e.createElement("script");for(let n of Array.from(t.attributes))o.setAttribute(n.name,n.value);return t.src||(o.textContent=t.textContent),e.body.appendChild(o),o}var et=Math.min,Ue=Math.max,Ft=Math.round,Ut=Math.floor,Se=t=>({x:t,y:t}),Or={left:"right",right:"left",bottom:"top",top:"bottom"};function to(t,e,o){return Ue(t,et(e,o))}function Ct(t,e){return typeof t=="function"?t(e):t}function tt(t){return t.split("-")[0]}function St(t){return t.split("-")[1]}function Go(t){return t==="x"?"y":"x"}function oo(t){return t==="y"?"height":"width"}function We(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function no(t){return Go(We(t))}function zn(t,e,o){o===void 0&&(o=false);let n=St(t),i=no(t),r=oo(i),s=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=zt(s)),[s,zt(s)]}function Fn(t){let e=zt(t);return [eo(t),e,eo(e)]}function eo(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var On=["left","right"],Gn=["right","left"],Gr=["top","bottom"],zr=["bottom","top"];function Fr(t,e,o){switch(t){case "top":case "bottom":return o?e?Gn:On:e?On:Gn;case "left":case "right":return e?Gr:zr;default:return []}}function Un(t,e,o,n){let i=St(t),r=Fr(tt(t),o==="start",n);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(eo)))),r}function zt(t){let e=tt(t);return Or[e]+t.slice(e.length)}function Ur(t){return {top:0,right:0,bottom:0,left:0,...t}}function zo(t){return typeof t!="number"?Ur(t):{top:t,right:t,bottom:t,left:t}}function lt(t){let{x:e,y:o,width:n,height:i}=t;return {width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function Wn(t,e,o){let{reference:n,floating:i}=t,r=We(e),s=no(e),l=oo(s),a=tt(e),c=r==="y",p=n.x+n.width/2-i.width/2,m=n.y+n.height/2-i.height/2,u=n[l]/2-i[l]/2,d;switch(a){case "top":d={x:p,y:n.y-i.height};break;case "bottom":d={x:p,y:n.y+n.height};break;case "right":d={x:n.x+n.width,y:m};break;case "left":d={x:n.x-i.width,y:m};break;default:d={x:n.x,y:n.y};}switch(St(e)){case "start":d[s]-=u*(o&&c?-1:1);break;case "end":d[s]+=u*(o&&c?-1:1);break}return d}async function jn(t,e){var o;e===void 0&&(e={});let{x:n,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:u=false,padding:d=0}=Ct(e,t),h=zo(d),v=l[u?m==="floating"?"reference":"floating":m],x=lt(await r.getClippingRect({element:(o=await(r.isElement==null?void 0:r.isElement(v)))==null||o?v:v.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:p,strategy:a})),y=m==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),b=await(r.isElement==null?void 0:r.isElement(w))?await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1}:{x:1,y:1},C=lt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return {top:(x.top-C.top+h.top)/b.y,bottom:(C.bottom-x.bottom+h.bottom)/b.y,left:(x.left-C.left+h.left)/b.x,right:(C.right-x.right+h.right)/b.x}}var Wr=50,Vn=async(t,e,o)=>{let{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=o,l=s.detectOverflow?s:{...s,detectOverflow:jn},a=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:m}=Wn(c,n,a),u=n,d=0,h={};for(let f=0;f<r.length;f++){let v=r[f];if(!v)continue;let{name:x,fn:y}=v,{x:w,y:b,data:C,reset:L}=await y({x:p,y:m,initialPlacement:n,placement:u,strategy:i,middlewareData:h,rects:c,platform:l,elements:{reference:t,floating:e}});p=w??p,m=b??m,h[x]={...h[x],...C},L&&d<Wr&&(d++,typeof L=="object"&&(L.placement&&(u=L.placement),L.rects&&(c=L.rects===true?await s.getElementRects({reference:t,floating:e,strategy:i}):L.rects),{x:p,y:m}=Wn(c,u,a)),f=-1);}return {x:p,y:m,placement:u,strategy:i,middlewareData:h}},qn=t=>({name:"arrow",options:t,async fn(e){let{x:o,y:n,placement:i,rects:r,platform:s,elements:l,middlewareData:a}=e,{element:c,padding:p=0}=Ct(t,e)||{};if(c==null)return {};let m=zo(p),u={x:o,y:n},d=no(i),h=oo(d),f=await s.getDimensions(c),v=d==="y",x=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",b=r.reference[h]+r.reference[d]-u[d]-r.floating[h],C=u[d]-r.reference[d],L=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c)),A=L?L[w]:0;(!A||!await(s.isElement==null?void 0:s.isElement(L)))&&(A=l.floating[w]||r.floating[h]);let D=b/2-C/2,O=A/2-f[h]/2-1,ee=et(m[x],O),B=et(m[y],O),te=ee,se=A-f[h]-B,oe=A/2-f[h]/2+D,ie=to(te,oe,se),q=!a.arrow&&St(i)!=null&&oe!==ie&&r.reference[h]/2-(oe<te?ee:B)-f[h]/2<0,Z=q?oe<te?oe-te:oe-se:0;return {[d]:u[d]+Z,data:{[d]:ie,centerOffset:oe-ie-Z,...q&&{alignmentOffset:Z}},reset:q}}});var Kn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;let{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:p=true,crossAxis:m=true,fallbackPlacements:u,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=true,...v}=Ct(t,e);if((o=r.arrow)!=null&&o.alignmentOffset)return {};let x=tt(i),y=We(l),w=tt(l)===l,b=await(a.isRTL==null?void 0:a.isRTL(c.floating)),C=u||(w||!f?[zt(l)]:Fn(l)),L=h!=="none";!u&&L&&C.push(...Un(l,f,h,b));let A=[l,...C],D=await a.detectOverflow(e,v),O=[],ee=((n=r.flip)==null?void 0:n.overflows)||[];if(p&&O.push(D[x]),m){let oe=zn(i,s,b);O.push(D[oe[0]],D[oe[1]]);}if(ee=[...ee,{placement:i,overflows:O}],!O.every(oe=>oe<=0)){var B,te;let oe=(((B=r.flip)==null?void 0:B.index)||0)+1,ie=A[oe];if(ie&&(!(m==="alignment"?y!==We(ie):false)||ee.every(ne=>We(ne.placement)===y?ne.overflows[0]>0:true)))return {data:{index:oe,overflows:ee},reset:{placement:ie}};let q=(te=ee.filter(Z=>Z.overflows[0]<=0).sort((Z,ne)=>Z.overflows[1]-ne.overflows[1])[0])==null?void 0:te.placement;if(!q)switch(d){case "bestFit":{var se;let Z=(se=ee.filter(ne=>{if(L){let ae=We(ne.placement);return ae===y||ae==="y"}return true}).map(ne=>[ne.placement,ne.overflows.filter(ae=>ae>0).reduce((ae,be)=>ae+be,0)]).sort((ne,ae)=>ne[1]-ae[1])[0])==null?void 0:se[0];Z&&(q=Z);break}case "initialPlacement":q=l;break}if(i!==q)return {reset:{placement:q}}}return {}}}};var jr=new Set(["left","top"]);async function Vr(t,e){let{placement:o,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=tt(o),l=St(o),a=We(o)==="y",c=jr.has(s)?-1:1,p=r&&a?-1:1,m=Ct(e,t),{mainAxis:u,crossAxis:d,alignmentAxis:h}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof h=="number"&&(d=l==="end"?h*-1:h),a?{x:d*p,y:u*c}:{x:u*c,y:d*p}}var Xn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;let{x:i,y:r,placement:s,middlewareData:l}=e,a=await Vr(e,t);return s===((o=l.offset)==null?void 0:o.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},Yn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:o,y:n,placement:i,platform:r}=e,{mainAxis:s=true,crossAxis:l=false,limiter:a={fn:x=>{let{x:y,y:w}=x;return {x:y,y:w}}},...c}=Ct(t,e),p={x:o,y:n},m=await r.detectOverflow(e,c),u=We(tt(i)),d=Go(u),h=p[d],f=p[u];if(s){let x=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=h+m[x],b=h-m[y];h=to(w,h,b);}if(l){let x=u==="y"?"top":"left",y=u==="y"?"bottom":"right",w=f+m[x],b=f-m[y];f=to(w,f,b);}let v=a.fn({...e,[d]:h,[u]:f});return {...v,data:{x:v.x-o,y:v.y-n,enabled:{[d]:s,[u]:l}}}}}};function io(){return typeof window<"u"}function dt(t){return Jn(t)?(t.nodeName||"").toLowerCase():"#document"}function ge(t){var e;return (t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Le(t){var e;return (e=(Jn(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Jn(t){return io()?t instanceof Node||t instanceof ge(t).Node:false}function we(t){return io()?t instanceof Element||t instanceof ge(t).Element:false}function Re(t){return io()?t instanceof HTMLElement||t instanceof ge(t).HTMLElement:false}function Zn(t){return !io()||typeof ShadowRoot>"u"?false:t instanceof ShadowRoot||t instanceof ge(t).ShadowRoot}function Tt(t){let{overflow:e,overflowX:o,overflowY:n,display:i}=Ee(t);return /auto|scroll|overlay|hidden|clip/.test(e+n+o)&&i!=="inline"&&i!=="contents"}function Qn(t){return /^(table|td|th)$/.test(dt(t))}function Wt(t){try{if(t.matches(":popover-open"))return !0}catch{}try{return t.matches(":modal")}catch{return false}}var qr=/transform|translate|scale|rotate|perspective|filter/,Kr=/paint|layout|strict|content/,ct=t=>!!t&&t!=="none",Fo;function ro(t){let e=we(t)?Ee(t):t;return ct(e.transform)||ct(e.translate)||ct(e.scale)||ct(e.rotate)||ct(e.perspective)||!so()&&(ct(e.backdropFilter)||ct(e.filter))||qr.test(e.willChange||"")||Kr.test(e.contain||"")}function ei(t){let e=je(t);for(;Re(e)&&!pt(e);){if(ro(e))return e;if(Wt(e))return null;e=je(e);}return null}function so(){return Fo==null&&(Fo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Fo}function pt(t){return /^(html|body|#document)$/.test(dt(t))}function Ee(t){return ge(t).getComputedStyle(t)}function jt(t){return we(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function je(t){if(dt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Zn(t)&&t.host||Le(t);return Zn(e)?e.host:e}function ti(t){let e=je(t);return pt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Re(e)&&Tt(e)?e:ti(e)}function Lt(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=true);let i=ti(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=ge(i);if(r){let l=ao(s);return e.concat(s,s.visualViewport||[],Tt(i)?i:[],l&&o?Lt(l):[])}else return e.concat(i,Lt(i,[],o))}function ao(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ri(t){let e=Ee(t),o=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=Re(t),r=i?t.offsetWidth:o,s=i?t.offsetHeight:n,l=Ft(o)!==r||Ft(n)!==s;return l&&(o=r,n=s),{width:o,height:n,$:l}}function Wo(t){return we(t)?t:t.contextElement}function At(t){let e=Wo(t);if(!Re(e))return Se(1);let o=e.getBoundingClientRect(),{width:n,height:i,$:r}=ri(e),s=(r?Ft(o.width):o.width)/n,l=(r?Ft(o.height):o.height)/i;return (!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var Xr=Se(0);function si(t){let e=ge(t);return !so()||!e.visualViewport?Xr:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Yr(t,e,o){return e===void 0&&(e=false),!o||e&&o!==ge(t)?false:e}function ut(t,e,o,n){e===void 0&&(e=false),o===void 0&&(o=false);let i=t.getBoundingClientRect(),r=Wo(t),s=Se(1);e&&(n?we(n)&&(s=At(n)):s=At(t));let l=Yr(r,o,n)?si(r):Se(0),a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,p=i.width/s.x,m=i.height/s.y;if(r){let u=ge(r),d=n&&we(n)?ge(n):n,h=u,f=ao(h);for(;f&&n&&d!==h;){let v=At(f),x=f.getBoundingClientRect(),y=Ee(f),w=x.left+(f.clientLeft+parseFloat(y.paddingLeft))*v.x,b=x.top+(f.clientTop+parseFloat(y.paddingTop))*v.y;a*=v.x,c*=v.y,p*=v.x,m*=v.y,a+=w,c+=b,h=ge(f),f=ao(h);}}return lt({width:p,height:m,x:a,y:c})}function lo(t,e){let o=jt(t).scrollLeft;return e?e.left+o:ut(Le(t)).left+o}function ai(t,e){let o=t.getBoundingClientRect(),n=o.left+e.scrollLeft-lo(t,o),i=o.top+e.scrollTop;return {x:n,y:i}}function Zr(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t,r=i==="fixed",s=Le(n),l=e?Wt(e.floating):false;if(n===s||l&&r)return o;let a={scrollLeft:0,scrollTop:0},c=Se(1),p=Se(0),m=Re(n);if((m||!m&&!r)&&((dt(n)!=="body"||Tt(s))&&(a=jt(n)),m)){let d=ut(n);c=At(n),p.x=d.x+n.clientLeft,p.y=d.y+n.clientTop;}let u=s&&!m&&!r?ai(s,a):Se(0);return {width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-a.scrollLeft*c.x+p.x+u.x,y:o.y*c.y-a.scrollTop*c.y+p.y+u.y}}function Jr(t){return Array.from(t.getClientRects())}function Qr(t){let e=Le(t),o=jt(t),n=t.ownerDocument.body,i=Ue(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Ue(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),s=-o.scrollLeft+lo(t),l=-o.scrollTop;return Ee(n).direction==="rtl"&&(s+=Ue(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:l}}var oi=25;function es(t,e){let o=ge(t),n=Le(t),i=o.visualViewport,r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;let p=so();(!p||p&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop);}let c=lo(n);if(c<=0){let p=n.ownerDocument,m=p.body,u=getComputedStyle(m),d=p.compatMode==="CSS1Compat"&&parseFloat(u.marginLeft)+parseFloat(u.marginRight)||0,h=Math.abs(n.clientWidth-m.clientWidth-d);h<=oi&&(r-=h);}else c<=oi&&(r+=c);return {width:r,height:s,x:l,y:a}}function ts(t,e){let o=ut(t,true,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=Re(t)?At(t):Se(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,a=i*r.x,c=n*r.y;return {width:s,height:l,x:a,y:c}}function ni(t,e,o){let n;if(e==="viewport")n=es(t,o);else if(e==="document")n=Qr(Le(t));else if(we(e))n=ts(e,o);else {let i=si(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height};}return lt(n)}function li(t,e){let o=je(t);return o===e||!we(o)||pt(o)?false:Ee(o).position==="fixed"||li(o,e)}function os(t,e){let o=e.get(t);if(o)return o;let n=Lt(t,[],false).filter(l=>we(l)&&dt(l)!=="body"),i=null,r=Ee(t).position==="fixed",s=r?je(t):t;for(;we(s)&&!pt(s);){let l=Ee(s),a=ro(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Tt(s)&&!a&&li(t,s))?n=n.filter(p=>p!==s):i=l,s=je(s);}return e.set(t,n),n}function ns(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t,s=[...o==="clippingAncestors"?Wt(e)?[]:os(e,this._c):[].concat(o),n],l=ni(e,s[0],i),a=l.top,c=l.right,p=l.bottom,m=l.left;for(let u=1;u<s.length;u++){let d=ni(e,s[u],i);a=Ue(d.top,a),c=et(d.right,c),p=et(d.bottom,p),m=Ue(d.left,m);}return {width:c-m,height:p-a,x:m,y:a}}function is(t){let{width:e,height:o}=ri(t);return {width:e,height:o}}function rs(t,e,o){let n=Re(e),i=Le(e),r=o==="fixed",s=ut(t,true,r,e),l={scrollLeft:0,scrollTop:0},a=Se(0);function c(){a.x=lo(i);}if(n||!n&&!r)if((dt(e)!=="body"||Tt(i))&&(l=jt(e)),n){let d=ut(e,true,r,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop;}else i&&c();r&&!n&&i&&c();let p=i&&!n&&!r?ai(i,l):Se(0),m=s.left+l.scrollLeft-a.x-p.x,u=s.top+l.scrollTop-a.y-p.y;return {x:m,y:u,width:s.width,height:s.height}}function Uo(t){return Ee(t).position==="static"}function ii(t,e){if(!Re(t)||Ee(t).position==="fixed")return null;if(e)return e(t);let o=t.offsetParent;return Le(t)===o&&(o=o.ownerDocument.body),o}function ci(t,e){let o=ge(t);if(Wt(t))return o;if(!Re(t)){let i=je(t);for(;i&&!pt(i);){if(we(i)&&!Uo(i))return i;i=je(i);}return o}let n=ii(t,e);for(;n&&Qn(n)&&Uo(n);)n=ii(n,e);return n&&pt(n)&&Uo(n)&&!ro(n)?o:n||ei(t)||o}var ss=async function(t){let e=this.getOffsetParent||ci,o=this.getDimensions,n=await o(t.floating);return {reference:rs(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function as(t){return Ee(t).direction==="rtl"}var ls={convertOffsetParentRelativeRectToViewportRelativeRect:Zr,getDocumentElement:Le,getClippingRect:ns,getOffsetParent:ci,getElementRects:ss,getClientRects:Jr,getDimensions:is,getScale:At,isElement:we,isRTL:as};function di(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function cs(t,e){let o=null,n,i=Le(t);function r(){var l;clearTimeout(n),(l=o)==null||l.disconnect(),o=null;}function s(l,a){l===void 0&&(l=false),a===void 0&&(a=1),r();let c=t.getBoundingClientRect(),{left:p,top:m,width:u,height:d}=c;if(l||e(),!u||!d)return;let h=Ut(m),f=Ut(i.clientWidth-(p+u)),v=Ut(i.clientHeight-(m+d)),x=Ut(p),w={rootMargin:-h+"px "+-f+"px "+-v+"px "+-x+"px",threshold:Ue(0,et(1,a))||1},b=true;function C(L){let A=L[0].intersectionRatio;if(A!==a){if(!b)return s();A?s(false,A):n=setTimeout(()=>{s(false,1e-7);},1e3);}A===1&&!di(c,t.getBoundingClientRect())&&s(),b=false;}try{o=new IntersectionObserver(C,{...w,root:i.ownerDocument});}catch{o=new IntersectionObserver(C,w);}o.observe(t);}return s(true),r}function pi(t,e,o,n){n===void 0&&(n={});let{ancestorScroll:i=true,ancestorResize:r=true,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=false}=n,c=Wo(t),p=i||r?[...c?Lt(c):[],...e?Lt(e):[]]:[];p.forEach(x=>{i&&x.addEventListener("scroll",o,{passive:true}),r&&x.addEventListener("resize",o);});let m=c&&l?cs(c,o):null,u=-1,d=null;s&&(d=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&d&&e&&(d.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(e);})),o();}),c&&!a&&d.observe(c),e&&d.observe(e));let h,f=a?ut(t):null;a&&v();function v(){let x=ut(t);f&&!di(f,x)&&o(),f=x,h=requestAnimationFrame(v);}return o(),()=>{var x;p.forEach(y=>{i&&y.removeEventListener("scroll",o),r&&y.removeEventListener("resize",o);}),m?.(),(x=d)==null||x.disconnect(),d=null,a&&cancelAnimationFrame(h);}}var Me=Xn;var Pe=Yn,Ie=Kn;var ot=qn;var Be=(t,e,o)=>{let n=new Map,i={platform:ls,...o},r={...i.platform,_c:n};return Vn(t,e,{...i,platform:r})};var ds={"--veo-bg":"#1f2937","--veo-text":"#f9fafb","--veo-text-secondary":"#d1d5db","--veo-shadow":"0 20px 60px rgba(0, 0, 0, 0.55)"},Vo={left:"flex-start",center:"center",right:"flex-end"},ps={left:"flex-start",center:"center",right:"flex-end"},us={title:"text",text:"text",image:"self"},ui={none:"none",soft:"0 4px 14px rgba(0, 0, 0, 0.10)",medium:"0 8px 30px rgba(0, 0, 0, 0.18)",strong:"0 24px 60px rgba(0, 0, 0, 0.32)"},mi={center:[.5,.5],top:[.5,0],bottom:[.5,1],left:[0,.5],right:[1,.5],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},Ne=/^#[0-9a-f]{3,8}$|^(rgb|rgba|hsl|hsla)\([\d.,%/\sdeg]+\)$|^[a-z]{3,20}$/i;function fe(t,e,o){return Math.min(o,Math.max(e,t))}function fi(t,e){if(!e||typeof e!="object")return;let o=e;if(typeof o.accentColor=="string"&&Ne.test(o.accentColor.trim())&&t.style.setProperty("--veo-primary",o.accentColor.trim()),typeof o.fontFamily=="string"&&o.fontFamily.length<=200&&!/[<>{}]/.test(o.fontFamily)&&t.style.setProperty("--veo-font",o.fontFamily.trim()),o.theme==="dark")for(let[r,s]of Object.entries(ds))t.style.setProperty(r,s);typeof o.background=="string"&&Ne.test(o.background.trim())&&t.style.setProperty("--veo-bg",o.background.trim()),typeof o.textColor=="string"&&Ne.test(o.textColor.trim())&&t.style.setProperty("--veo-text",o.textColor.trim()),typeof o.textSecondaryColor=="string"&&Ne.test(o.textSecondaryColor.trim())&&t.style.setProperty("--veo-text-secondary",o.textSecondaryColor.trim()),typeof o.radius=="number"&&Number.isFinite(o.radius)&&t.style.setProperty("--veo-radius",`${fe(o.radius,0,48)}px`),typeof o.width=="number"&&Number.isFinite(o.width)&&t.style.setProperty("--veo-width",`${fe(o.width,220,720)}px`),typeof o.height=="number"&&Number.isFinite(o.height)&&t.style.setProperty("--veo-min-h",`${fe(o.height,120,900)}px`),(o.align==="left"||o.align==="center"||o.align==="right")&&t.style.setProperty("--veo-actions-justify",Vo[o.align]),typeof o.padding=="number"&&Number.isFinite(o.padding)&&t.style.setProperty("--veo-pad",`${fe(o.padding,0,64)}px`),typeof o.margin=="number"&&Number.isFinite(o.margin)&&t.style.setProperty("--veo-margin",`${fe(o.margin,0,64)}px`),typeof o.borderWidth=="number"&&Number.isFinite(o.borderWidth)&&t.style.setProperty("--veo-border-width",`${fe(o.borderWidth,0,16)}px`),typeof o.borderColor=="string"&&Ne.test(o.borderColor.trim())&&t.style.setProperty("--veo-border-color",o.borderColor.trim()),typeof o.shadow=="string"&&ui[o.shadow]&&t.style.setProperty("--veo-shadow",ui[o.shadow]);let n,i;if(typeof o.posX=="number"&&typeof o.posY=="number"?(n=fe(o.posX,0,1),i=fe(o.posY,0,1)):typeof o.overlayPosition=="string"&&mi[o.overlayPosition]&&([n,i]=mi[o.overlayPosition]),n!==void 0&&i!==void 0&&(t.style.setProperty("--veo-pos-x",`${n*100}%`),t.style.setProperty("--veo-pos-y",`${i*100}%`)),o.elements&&typeof o.elements=="object"){let r=o.elements;jo(t,"title",r.title),jo(t,"text",r.text),jo(t,"image",r.image),ms(t,r.cta);}}function ms(t,e){if(!e||typeof e!="object")return;let o=e;typeof o.align=="string"&&Vo[o.align]&&t.style.setProperty("--veo-actions-justify",Vo[o.align]),typeof o.background=="string"&&Ne.test(o.background.trim())&&t.style.setProperty("--veo-cta-bg",o.background.trim()),typeof o.color=="string"&&Ne.test(o.color.trim())&&t.style.setProperty("--veo-cta-color",o.color.trim()),typeof o.fontSize=="number"&&Number.isFinite(o.fontSize)&&t.style.setProperty("--veo-cta-size",`${fe(o.fontSize,10,24)}px`),typeof o.radius=="number"&&Number.isFinite(o.radius)&&t.style.setProperty("--veo-cta-radius",`${fe(o.radius,0,48)}px`);}function jo(t,e,o){if(!o||typeof o!="object")return;let n=o;if(typeof n.align=="string"&&(n.align==="left"||n.align==="center"||n.align==="right")){let r=(us[e]??"text")==="self"?ps[n.align]:n.align;t.style.setProperty(`--veo-${e}-align`,r);}typeof n.color=="string"&&Ne.test(n.color.trim())&&t.style.setProperty(`--veo-${e}-color`,n.color.trim()),typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&t.style.setProperty(`--veo-${e}-size`,`${fe(n.fontSize,8,72)}px`),typeof n.width=="number"&&Number.isFinite(n.width)&&t.style.setProperty(`--veo-${e}-width`,`${fe(n.width,10,100)}%`),typeof n.radius=="number"&&Number.isFinite(n.radius)&&t.style.setProperty(`--veo-${e}-radius`,`${fe(n.radius,0,48)}px`),typeof n.marginTop=="number"&&Number.isFinite(n.marginTop)&&t.style.setProperty(`--veo-${e}-mt`,`${fe(n.marginTop,0,64)}px`),typeof n.marginBottom=="number"&&Number.isFinite(n.marginBottom)&&t.style.setProperty(`--veo-${e}-mb`,`${fe(n.marginBottom,0,64)}px`);}function He(t){let e=t?.inlinePosition;return e==="before"||e==="prepend"||e==="append"?e:"after"}function ve(t,e,o){switch(o){case "before":t.before(e);break;case "after":t.after(e);break;case "prepend":t.prepend(e);break;case "append":t.append(e);break}}function xe(t,e,o){let n=window.setInterval(()=>{if(t.isConnected)return;let i=document.querySelector(e);i&&ve(i,t,o);},1e3);return ()=>window.clearInterval(n)}function re(t,e=5e3){return new Promise(o=>{let n=()=>{try{return document.querySelector(t)}catch{return null}},i=n();if(i){o(i);return}let r=false,s=c=>{r||(r=true,l.disconnect(),clearTimeout(a),o(c));},l=new MutationObserver(()=>{let c=n();c&&s(c);});l.observe(document.body,{childList:true,subtree:true});let a=setTimeout(()=>s(null),e);})}var co=`
4
+ }catch(e){console.error("[OnUser] Error en el bloque de c\xF3digo:",e)}})();`}function Or(t,e){let o=e.createElement("script");for(let n of Array.from(t.attributes))o.setAttribute(n.name,n.value);return t.src||(o.textContent=t.textContent),e.body.appendChild(o),o}var et=Math.min,We=Math.max,Ft=Math.round,Wt=Math.floor,Se=t=>({x:t,y:t}),Gr={left:"right",right:"left",bottom:"top",top:"bottom"};function to(t,e,o){return We(t,et(e,o))}function Ct(t,e){return typeof t=="function"?t(e):t}function tt(t){return t.split("-")[0]}function St(t){return t.split("-")[1]}function Go(t){return t==="x"?"y":"x"}function oo(t){return t==="y"?"height":"width"}function Ue(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function no(t){return Go(Ue(t))}function Fn(t,e,o){o===void 0&&(o=false);let n=St(t),i=no(t),r=oo(i),s=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=zt(s)),[s,zt(s)]}function Wn(t){let e=zt(t);return [eo(t),e,eo(e)]}function eo(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}var Gn=["left","right"],zn=["right","left"],zr=["top","bottom"],Fr=["bottom","top"];function Wr(t,e,o){switch(t){case "top":case "bottom":return o?e?zn:Gn:e?Gn:zn;case "left":case "right":return e?zr:Fr;default:return []}}function Un(t,e,o,n){let i=St(t),r=Wr(tt(t),o==="start",n);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(eo)))),r}function zt(t){let e=tt(t);return Gr[e]+t.slice(e.length)}function Ur(t){return {top:0,right:0,bottom:0,left:0,...t}}function zo(t){return typeof t!="number"?Ur(t):{top:t,right:t,bottom:t,left:t}}function lt(t){let{x:e,y:o,width:n,height:i}=t;return {width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function jn(t,e,o){let{reference:n,floating:i}=t,r=Ue(e),s=no(e),l=oo(s),a=tt(e),c=r==="y",p=n.x+n.width/2-i.width/2,m=n.y+n.height/2-i.height/2,u=n[l]/2-i[l]/2,d;switch(a){case "top":d={x:p,y:n.y-i.height};break;case "bottom":d={x:p,y:n.y+n.height};break;case "right":d={x:n.x+n.width,y:m};break;case "left":d={x:n.x-i.width,y:m};break;default:d={x:n.x,y:n.y};}switch(St(e)){case "start":d[s]-=u*(o&&c?-1:1);break;case "end":d[s]+=u*(o&&c?-1:1);break}return d}async function Vn(t,e){var o;e===void 0&&(e={});let{x:n,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:u=false,padding:d=0}=Ct(e,t),g=zo(d),v=l[u?m==="floating"?"reference":"floating":m],x=lt(await r.getClippingRect({element:(o=await(r.isElement==null?void 0:r.isElement(v)))==null||o?v:v.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:p,strategy:a})),y=m==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),b=await(r.isElement==null?void 0:r.isElement(w))?await(r.getScale==null?void 0:r.getScale(w))||{x:1,y:1}:{x:1,y:1},C=lt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return {top:(x.top-C.top+g.top)/b.y,bottom:(C.bottom-x.bottom+g.bottom)/b.y,left:(x.left-C.left+g.left)/b.x,right:(C.right-x.right+g.right)/b.x}}var jr=50,qn=async(t,e,o)=>{let{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=o,l=s.detectOverflow?s:{...s,detectOverflow:Vn},a=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:m}=jn(c,n,a),u=n,d=0,g={};for(let f=0;f<r.length;f++){let v=r[f];if(!v)continue;let{name:x,fn:y}=v,{x:w,y:b,data:C,reset:L}=await y({x:p,y:m,initialPlacement:n,placement:u,strategy:i,middlewareData:g,rects:c,platform:l,elements:{reference:t,floating:e}});p=w??p,m=b??m,g[x]={...g[x],...C},L&&d<jr&&(d++,typeof L=="object"&&(L.placement&&(u=L.placement),L.rects&&(c=L.rects===true?await s.getElementRects({reference:t,floating:e,strategy:i}):L.rects),{x:p,y:m}=jn(c,u,a)),f=-1);}return {x:p,y:m,placement:u,strategy:i,middlewareData:g}},Kn=t=>({name:"arrow",options:t,async fn(e){let{x:o,y:n,placement:i,rects:r,platform:s,elements:l,middlewareData:a}=e,{element:c,padding:p=0}=Ct(t,e)||{};if(c==null)return {};let m=zo(p),u={x:o,y:n},d=no(i),g=oo(d),f=await s.getDimensions(c),v=d==="y",x=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",b=r.reference[g]+r.reference[d]-u[d]-r.floating[g],C=u[d]-r.reference[d],L=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c)),A=L?L[w]:0;(!A||!await(s.isElement==null?void 0:s.isElement(L)))&&(A=l.floating[w]||r.floating[g]);let D=b/2-C/2,O=A/2-f[g]/2-1,ee=et(m[x],O),B=et(m[y],O),te=ee,se=A-f[g]-B,oe=A/2-f[g]/2+D,ie=to(te,oe,se),q=!a.arrow&&St(i)!=null&&oe!==ie&&r.reference[g]/2-(oe<te?ee:B)-f[g]/2<0,Z=q?oe<te?oe-te:oe-se:0;return {[d]:u[d]+Z,data:{[d]:ie,centerOffset:oe-ie-Z,...q&&{alignmentOffset:Z}},reset:q}}});var Xn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var o,n;let{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:p=true,crossAxis:m=true,fallbackPlacements:u,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:f=true,...v}=Ct(t,e);if((o=r.arrow)!=null&&o.alignmentOffset)return {};let x=tt(i),y=Ue(l),w=tt(l)===l,b=await(a.isRTL==null?void 0:a.isRTL(c.floating)),C=u||(w||!f?[zt(l)]:Wn(l)),L=g!=="none";!u&&L&&C.push(...Un(l,f,g,b));let A=[l,...C],D=await a.detectOverflow(e,v),O=[],ee=((n=r.flip)==null?void 0:n.overflows)||[];if(p&&O.push(D[x]),m){let oe=Fn(i,s,b);O.push(D[oe[0]],D[oe[1]]);}if(ee=[...ee,{placement:i,overflows:O}],!O.every(oe=>oe<=0)){var B,te;let oe=(((B=r.flip)==null?void 0:B.index)||0)+1,ie=A[oe];if(ie&&(!(m==="alignment"?y!==Ue(ie):false)||ee.every(ne=>Ue(ne.placement)===y?ne.overflows[0]>0:true)))return {data:{index:oe,overflows:ee},reset:{placement:ie}};let q=(te=ee.filter(Z=>Z.overflows[0]<=0).sort((Z,ne)=>Z.overflows[1]-ne.overflows[1])[0])==null?void 0:te.placement;if(!q)switch(d){case "bestFit":{var se;let Z=(se=ee.filter(ne=>{if(L){let ae=Ue(ne.placement);return ae===y||ae==="y"}return true}).map(ne=>[ne.placement,ne.overflows.filter(ae=>ae>0).reduce((ae,be)=>ae+be,0)]).sort((ne,ae)=>ne[1]-ae[1])[0])==null?void 0:se[0];Z&&(q=Z);break}case "initialPlacement":q=l;break}if(i!==q)return {reset:{placement:q}}}return {}}}};var Vr=new Set(["left","top"]);async function qr(t,e){let{placement:o,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=tt(o),l=St(o),a=Ue(o)==="y",c=Vr.has(s)?-1:1,p=r&&a?-1:1,m=Ct(e,t),{mainAxis:u,crossAxis:d,alignmentAxis:g}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof g=="number"&&(d=l==="end"?g*-1:g),a?{x:d*p,y:u*c}:{x:u*c,y:d*p}}var Yn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var o,n;let{x:i,y:r,placement:s,middlewareData:l}=e,a=await qr(e,t);return s===((o=l.offset)==null?void 0:o.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},Zn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:o,y:n,placement:i,platform:r}=e,{mainAxis:s=true,crossAxis:l=false,limiter:a={fn:x=>{let{x:y,y:w}=x;return {x:y,y:w}}},...c}=Ct(t,e),p={x:o,y:n},m=await r.detectOverflow(e,c),u=Ue(tt(i)),d=Go(u),g=p[d],f=p[u];if(s){let x=d==="y"?"top":"left",y=d==="y"?"bottom":"right",w=g+m[x],b=g-m[y];g=to(w,g,b);}if(l){let x=u==="y"?"top":"left",y=u==="y"?"bottom":"right",w=f+m[x],b=f-m[y];f=to(w,f,b);}let v=a.fn({...e,[d]:g,[u]:f});return {...v,data:{x:v.x-o,y:v.y-n,enabled:{[d]:s,[u]:l}}}}}};function io(){return typeof window<"u"}function dt(t){return Qn(t)?(t.nodeName||"").toLowerCase():"#document"}function he(t){var e;return (t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Le(t){var e;return (e=(Qn(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Qn(t){return io()?t instanceof Node||t instanceof he(t).Node:false}function we(t){return io()?t instanceof Element||t instanceof he(t).Element:false}function Me(t){return io()?t instanceof HTMLElement||t instanceof he(t).HTMLElement:false}function Jn(t){return !io()||typeof ShadowRoot>"u"?false:t instanceof ShadowRoot||t instanceof he(t).ShadowRoot}function Tt(t){let{overflow:e,overflowX:o,overflowY:n,display:i}=Ee(t);return /auto|scroll|overlay|hidden|clip/.test(e+n+o)&&i!=="inline"&&i!=="contents"}function ei(t){return /^(table|td|th)$/.test(dt(t))}function Ut(t){try{if(t.matches(":popover-open"))return !0}catch{}try{return t.matches(":modal")}catch{return false}}var Kr=/transform|translate|scale|rotate|perspective|filter/,Xr=/paint|layout|strict|content/,ct=t=>!!t&&t!=="none",Fo;function ro(t){let e=we(t)?Ee(t):t;return ct(e.transform)||ct(e.translate)||ct(e.scale)||ct(e.rotate)||ct(e.perspective)||!so()&&(ct(e.backdropFilter)||ct(e.filter))||Kr.test(e.willChange||"")||Xr.test(e.contain||"")}function ti(t){let e=je(t);for(;Me(e)&&!pt(e);){if(ro(e))return e;if(Ut(e))return null;e=je(e);}return null}function so(){return Fo==null&&(Fo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Fo}function pt(t){return /^(html|body|#document)$/.test(dt(t))}function Ee(t){return he(t).getComputedStyle(t)}function jt(t){return we(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function je(t){if(dt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||Jn(t)&&t.host||Le(t);return Jn(e)?e.host:e}function oi(t){let e=je(t);return pt(e)?t.ownerDocument?t.ownerDocument.body:t.body:Me(e)&&Tt(e)?e:oi(e)}function Lt(t,e,o){var n;e===void 0&&(e=[]),o===void 0&&(o=true);let i=oi(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=he(i);if(r){let l=ao(s);return e.concat(s,s.visualViewport||[],Tt(i)?i:[],l&&o?Lt(l):[])}else return e.concat(i,Lt(i,[],o))}function ao(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function si(t){let e=Ee(t),o=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=Me(t),r=i?t.offsetWidth:o,s=i?t.offsetHeight:n,l=Ft(o)!==r||Ft(n)!==s;return l&&(o=r,n=s),{width:o,height:n,$:l}}function Uo(t){return we(t)?t:t.contextElement}function At(t){let e=Uo(t);if(!Me(e))return Se(1);let o=e.getBoundingClientRect(),{width:n,height:i,$:r}=si(e),s=(r?Ft(o.width):o.width)/n,l=(r?Ft(o.height):o.height)/i;return (!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var Yr=Se(0);function ai(t){let e=he(t);return !so()||!e.visualViewport?Yr:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Zr(t,e,o){return e===void 0&&(e=false),!o||e&&o!==he(t)?false:e}function ut(t,e,o,n){e===void 0&&(e=false),o===void 0&&(o=false);let i=t.getBoundingClientRect(),r=Uo(t),s=Se(1);e&&(n?we(n)&&(s=At(n)):s=At(t));let l=Zr(r,o,n)?ai(r):Se(0),a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,p=i.width/s.x,m=i.height/s.y;if(r){let u=he(r),d=n&&we(n)?he(n):n,g=u,f=ao(g);for(;f&&n&&d!==g;){let v=At(f),x=f.getBoundingClientRect(),y=Ee(f),w=x.left+(f.clientLeft+parseFloat(y.paddingLeft))*v.x,b=x.top+(f.clientTop+parseFloat(y.paddingTop))*v.y;a*=v.x,c*=v.y,p*=v.x,m*=v.y,a+=w,c+=b,g=he(f),f=ao(g);}}return lt({width:p,height:m,x:a,y:c})}function lo(t,e){let o=jt(t).scrollLeft;return e?e.left+o:ut(Le(t)).left+o}function li(t,e){let o=t.getBoundingClientRect(),n=o.left+e.scrollLeft-lo(t,o),i=o.top+e.scrollTop;return {x:n,y:i}}function Jr(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t,r=i==="fixed",s=Le(n),l=e?Ut(e.floating):false;if(n===s||l&&r)return o;let a={scrollLeft:0,scrollTop:0},c=Se(1),p=Se(0),m=Me(n);if((m||!m&&!r)&&((dt(n)!=="body"||Tt(s))&&(a=jt(n)),m)){let d=ut(n);c=At(n),p.x=d.x+n.clientLeft,p.y=d.y+n.clientTop;}let u=s&&!m&&!r?li(s,a):Se(0);return {width:o.width*c.x,height:o.height*c.y,x:o.x*c.x-a.scrollLeft*c.x+p.x+u.x,y:o.y*c.y-a.scrollTop*c.y+p.y+u.y}}function Qr(t){return Array.from(t.getClientRects())}function es(t){let e=Le(t),o=jt(t),n=t.ownerDocument.body,i=We(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=We(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),s=-o.scrollLeft+lo(t),l=-o.scrollTop;return Ee(n).direction==="rtl"&&(s+=We(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:l}}var ni=25;function ts(t,e){let o=he(t),n=Le(t),i=o.visualViewport,r=n.clientWidth,s=n.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;let p=so();(!p||p&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop);}let c=lo(n);if(c<=0){let p=n.ownerDocument,m=p.body,u=getComputedStyle(m),d=p.compatMode==="CSS1Compat"&&parseFloat(u.marginLeft)+parseFloat(u.marginRight)||0,g=Math.abs(n.clientWidth-m.clientWidth-d);g<=ni&&(r-=g);}else c<=ni&&(r+=c);return {width:r,height:s,x:l,y:a}}function os(t,e){let o=ut(t,true,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=Me(t)?At(t):Se(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,a=i*r.x,c=n*r.y;return {width:s,height:l,x:a,y:c}}function ii(t,e,o){let n;if(e==="viewport")n=ts(t,o);else if(e==="document")n=es(Le(t));else if(we(e))n=os(e,o);else {let i=ai(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height};}return lt(n)}function ci(t,e){let o=je(t);return o===e||!we(o)||pt(o)?false:Ee(o).position==="fixed"||ci(o,e)}function ns(t,e){let o=e.get(t);if(o)return o;let n=Lt(t,[],false).filter(l=>we(l)&&dt(l)!=="body"),i=null,r=Ee(t).position==="fixed",s=r?je(t):t;for(;we(s)&&!pt(s);){let l=Ee(s),a=ro(s);!a&&l.position==="fixed"&&(i=null),(r?!a&&!i:!a&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Tt(s)&&!a&&ci(t,s))?n=n.filter(p=>p!==s):i=l,s=je(s);}return e.set(t,n),n}function is(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t,s=[...o==="clippingAncestors"?Ut(e)?[]:ns(e,this._c):[].concat(o),n],l=ii(e,s[0],i),a=l.top,c=l.right,p=l.bottom,m=l.left;for(let u=1;u<s.length;u++){let d=ii(e,s[u],i);a=We(d.top,a),c=et(d.right,c),p=et(d.bottom,p),m=We(d.left,m);}return {width:c-m,height:p-a,x:m,y:a}}function rs(t){let{width:e,height:o}=si(t);return {width:e,height:o}}function ss(t,e,o){let n=Me(e),i=Le(e),r=o==="fixed",s=ut(t,true,r,e),l={scrollLeft:0,scrollTop:0},a=Se(0);function c(){a.x=lo(i);}if(n||!n&&!r)if((dt(e)!=="body"||Tt(i))&&(l=jt(e)),n){let d=ut(e,true,r,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop;}else i&&c();r&&!n&&i&&c();let p=i&&!n&&!r?li(i,l):Se(0),m=s.left+l.scrollLeft-a.x-p.x,u=s.top+l.scrollTop-a.y-p.y;return {x:m,y:u,width:s.width,height:s.height}}function Wo(t){return Ee(t).position==="static"}function ri(t,e){if(!Me(t)||Ee(t).position==="fixed")return null;if(e)return e(t);let o=t.offsetParent;return Le(t)===o&&(o=o.ownerDocument.body),o}function di(t,e){let o=he(t);if(Ut(t))return o;if(!Me(t)){let i=je(t);for(;i&&!pt(i);){if(we(i)&&!Wo(i))return i;i=je(i);}return o}let n=ri(t,e);for(;n&&ei(n)&&Wo(n);)n=ri(n,e);return n&&pt(n)&&Wo(n)&&!ro(n)?o:n||ti(t)||o}var as=async function(t){let e=this.getOffsetParent||di,o=this.getDimensions,n=await o(t.floating);return {reference:ss(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function ls(t){return Ee(t).direction==="rtl"}var cs={convertOffsetParentRelativeRectToViewportRelativeRect:Jr,getDocumentElement:Le,getClippingRect:is,getOffsetParent:di,getElementRects:as,getClientRects:Qr,getDimensions:rs,getScale:At,isElement:we,isRTL:ls};function pi(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ds(t,e){let o=null,n,i=Le(t);function r(){var l;clearTimeout(n),(l=o)==null||l.disconnect(),o=null;}function s(l,a){l===void 0&&(l=false),a===void 0&&(a=1),r();let c=t.getBoundingClientRect(),{left:p,top:m,width:u,height:d}=c;if(l||e(),!u||!d)return;let g=Wt(m),f=Wt(i.clientWidth-(p+u)),v=Wt(i.clientHeight-(m+d)),x=Wt(p),w={rootMargin:-g+"px "+-f+"px "+-v+"px "+-x+"px",threshold:We(0,et(1,a))||1},b=true;function C(L){let A=L[0].intersectionRatio;if(A!==a){if(!b)return s();A?s(false,A):n=setTimeout(()=>{s(false,1e-7);},1e3);}A===1&&!pi(c,t.getBoundingClientRect())&&s(),b=false;}try{o=new IntersectionObserver(C,{...w,root:i.ownerDocument});}catch{o=new IntersectionObserver(C,w);}o.observe(t);}return s(true),r}function jo(t,e,o,n){n===void 0&&(n={});let{ancestorScroll:i=true,ancestorResize:r=true,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=false}=n,c=Uo(t),p=i||r?[...c?Lt(c):[],...e?Lt(e):[]]:[];p.forEach(x=>{i&&x.addEventListener("scroll",o,{passive:true}),r&&x.addEventListener("resize",o);});let m=c&&l?ds(c,o):null,u=-1,d=null;s&&(d=new ResizeObserver(x=>{let[y]=x;y&&y.target===c&&d&&e&&(d.unobserve(e),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(e);})),o();}),c&&!a&&d.observe(c),e&&d.observe(e));let g,f=a?ut(t):null;a&&v();function v(){let x=ut(t);f&&!pi(f,x)&&o(),f=x,g=requestAnimationFrame(v);}return o(),()=>{var x;p.forEach(y=>{i&&y.removeEventListener("scroll",o),r&&y.removeEventListener("resize",o);}),m?.(),(x=d)==null||x.disconnect(),d=null,a&&cancelAnimationFrame(g);}}var Re=Yn;var Pe=Zn,Ie=Xn;var ot=Kn;var Be=(t,e,o)=>{let n=new Map,i={platform:cs,...o},r={...i.platform,_c:n};return qn(t,e,{...i,platform:r})};var ps={"--veo-bg":"#1f2937","--veo-text":"#f9fafb","--veo-text-secondary":"#d1d5db","--veo-shadow":"0 20px 60px rgba(0, 0, 0, 0.55)"},qo={left:"flex-start",center:"center",right:"flex-end"},us={left:"flex-start",center:"center",right:"flex-end"},ms={title:"text",text:"text",image:"self"},ui={none:"none",soft:"0 4px 14px rgba(0, 0, 0, 0.10)",medium:"0 8px 30px rgba(0, 0, 0, 0.18)",strong:"0 24px 60px rgba(0, 0, 0, 0.32)"},mi={center:[.5,.5],top:[.5,0],bottom:[.5,1],left:[0,.5],right:[1,.5],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},Ne=/^#[0-9a-f]{3,8}$|^(rgb|rgba|hsl|hsla)\([\d.,%/\sdeg]+\)$|^[a-z]{3,20}$/i;function fe(t,e,o){return Math.min(o,Math.max(e,t))}function fi(t,e){if(!e||typeof e!="object")return;let o=e;if(typeof o.accentColor=="string"&&Ne.test(o.accentColor.trim())&&t.style.setProperty("--veo-primary",o.accentColor.trim()),typeof o.fontFamily=="string"&&o.fontFamily.length<=200&&!/[<>{}]/.test(o.fontFamily)&&t.style.setProperty("--veo-font",o.fontFamily.trim()),o.theme==="dark")for(let[r,s]of Object.entries(ps))t.style.setProperty(r,s);typeof o.background=="string"&&Ne.test(o.background.trim())&&t.style.setProperty("--veo-bg",o.background.trim()),typeof o.textColor=="string"&&Ne.test(o.textColor.trim())&&t.style.setProperty("--veo-text",o.textColor.trim()),typeof o.textSecondaryColor=="string"&&Ne.test(o.textSecondaryColor.trim())&&t.style.setProperty("--veo-text-secondary",o.textSecondaryColor.trim()),typeof o.radius=="number"&&Number.isFinite(o.radius)&&t.style.setProperty("--veo-radius",`${fe(o.radius,0,48)}px`),typeof o.width=="number"&&Number.isFinite(o.width)&&t.style.setProperty("--veo-width",`${fe(o.width,220,720)}px`),typeof o.height=="number"&&Number.isFinite(o.height)&&t.style.setProperty("--veo-min-h",`${fe(o.height,120,900)}px`),(o.align==="left"||o.align==="center"||o.align==="right")&&t.style.setProperty("--veo-actions-justify",qo[o.align]),typeof o.padding=="number"&&Number.isFinite(o.padding)&&t.style.setProperty("--veo-pad",`${fe(o.padding,0,64)}px`),typeof o.margin=="number"&&Number.isFinite(o.margin)&&t.style.setProperty("--veo-margin",`${fe(o.margin,0,64)}px`),typeof o.borderWidth=="number"&&Number.isFinite(o.borderWidth)&&t.style.setProperty("--veo-border-width",`${fe(o.borderWidth,0,16)}px`),typeof o.borderColor=="string"&&Ne.test(o.borderColor.trim())&&t.style.setProperty("--veo-border-color",o.borderColor.trim()),typeof o.shadow=="string"&&ui[o.shadow]&&t.style.setProperty("--veo-shadow",ui[o.shadow]);let n,i;if(typeof o.posX=="number"&&typeof o.posY=="number"?(n=fe(o.posX,0,1),i=fe(o.posY,0,1)):typeof o.overlayPosition=="string"&&mi[o.overlayPosition]&&([n,i]=mi[o.overlayPosition]),n!==void 0&&i!==void 0&&(t.style.setProperty("--veo-pos-x",`${n*100}%`),t.style.setProperty("--veo-pos-y",`${i*100}%`)),o.elements&&typeof o.elements=="object"){let r=o.elements;Vo(t,"title",r.title),Vo(t,"text",r.text),Vo(t,"image",r.image),fs(t,r.cta);}}function fs(t,e){if(!e||typeof e!="object")return;let o=e;typeof o.align=="string"&&qo[o.align]&&t.style.setProperty("--veo-actions-justify",qo[o.align]),typeof o.background=="string"&&Ne.test(o.background.trim())&&t.style.setProperty("--veo-cta-bg",o.background.trim()),typeof o.color=="string"&&Ne.test(o.color.trim())&&t.style.setProperty("--veo-cta-color",o.color.trim()),typeof o.fontSize=="number"&&Number.isFinite(o.fontSize)&&t.style.setProperty("--veo-cta-size",`${fe(o.fontSize,10,24)}px`),typeof o.radius=="number"&&Number.isFinite(o.radius)&&t.style.setProperty("--veo-cta-radius",`${fe(o.radius,0,48)}px`);}function Vo(t,e,o){if(!o||typeof o!="object")return;let n=o;if(typeof n.align=="string"&&(n.align==="left"||n.align==="center"||n.align==="right")){let r=(ms[e]??"text")==="self"?us[n.align]:n.align;t.style.setProperty(`--veo-${e}-align`,r);}typeof n.color=="string"&&Ne.test(n.color.trim())&&t.style.setProperty(`--veo-${e}-color`,n.color.trim()),typeof n.fontSize=="number"&&Number.isFinite(n.fontSize)&&t.style.setProperty(`--veo-${e}-size`,`${fe(n.fontSize,8,72)}px`),typeof n.width=="number"&&Number.isFinite(n.width)&&t.style.setProperty(`--veo-${e}-width`,`${fe(n.width,10,100)}%`),typeof n.radius=="number"&&Number.isFinite(n.radius)&&t.style.setProperty(`--veo-${e}-radius`,`${fe(n.radius,0,48)}px`),typeof n.marginTop=="number"&&Number.isFinite(n.marginTop)&&t.style.setProperty(`--veo-${e}-mt`,`${fe(n.marginTop,0,64)}px`),typeof n.marginBottom=="number"&&Number.isFinite(n.marginBottom)&&t.style.setProperty(`--veo-${e}-mb`,`${fe(n.marginBottom,0,64)}px`);}function He(t){let e=t?.inlinePosition;return e==="before"||e==="prepend"||e==="append"?e:"after"}function ve(t,e,o){switch(o){case "before":t.before(e);break;case "after":t.after(e);break;case "prepend":t.prepend(e);break;case "append":t.append(e);break}}function xe(t,e,o){let n=window.setInterval(()=>{if(t.isConnected)return;let i=document.querySelector(e);i&&ve(i,t,o);},1e3);return ()=>window.clearInterval(n)}function re(t,e=5e3){return new Promise(o=>{let n=()=>{try{return document.querySelector(t)}catch{return null}},i=n();if(i){o(i);return}let r=false,s=c=>{r||(r=true,l.disconnect(),clearTimeout(a),o(c));},l=new MutationObserver(()=>{let c=n();c&&s(c);});l.observe(document.body,{childList:true,subtree:true});let a=setTimeout(()=>s(null),e);})}var co=`
5
5
  :host {
6
6
  --veo-primary: #FF5B35;
7
7
  --veo-text: #1f2937;
@@ -635,7 +635,7 @@ ${t}
635
635
  from { transform: translateY(-10px); opacity: 0; }
636
636
  to { transform: translateY(0); opacity: 1; }
637
637
  }
638
- `;var J=class{constructor(){this.host=null;this.shadow=null;this.cleanups=[];this.liveContainer=null;this.liveContent=null;this.liveBuild=null;this.liveKey="";}liveKeyOf(e){return ""}onLiveUpdate(e){}updateStep(e){if(!this.host||!this.liveContainer||!this.liveContent||!this.liveBuild||this.liveKeyOf(e)!==this.liveKey)return false;let o=this.liveBuild(e);return this.liveContainer.replaceChild(o,this.liveContent),this.liveContent=o,this.applyDesign(e.style),this.onLiveUpdate(e),true}createHost(){let e=document.createElement("div");e.setAttribute(In,"");let o=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=co,o.appendChild(n);let i=document.createElement("div");return o.appendChild(i),document.body.appendChild(e),this.host=e,this.shadow=o,{host:e,shadow:o,root:i}}applyDesign(e){this.host&&fi(this.host,e);}registerCleanup(e){this.cleanups.push(e);}hostElement(){return this.host}destroy(){for(let e of this.cleanups)try{e();}catch{}this.cleanups=[],this.host?.parentNode&&this.host.parentNode.removeChild(this.host),this.host=null,this.shadow=null;}};var fs={top:"bottom",bottom:"top",left:"right",right:"left"};function nt(t,e,o){let n=fs[e.split("-")[0]??"bottom"]??"top";for(let i of ["top","bottom","left","right"])t.style.setProperty(i,"");o?.x!=null&&t.style.setProperty("left",`${o.x}px`),o?.y!=null&&t.style.setProperty("top",`${o.y}px`),t.style.setProperty(n,"-6px");}var hs=150,po=class extends J{constructor(){super(...arguments);this.tooltip=null;this.arrowEl=null;this.badgeBtn=null;this.open=false;this.shownEmitted=false;this.trigger="hover";this.side="top";this.closeTimer=null;this.stopFloat=null;}async render(o){let n=o.guide.guideSteps[0];if(!n)return;let i=n.selector??o.guide.activationRules.selector;if(typeof i!="string"||i.length===0)return;let r=await re(i);if(!r)return;let{host:s,root:l}=this.createHost(),a=l.ownerDocument??document;this.applyDesign(n.style);let c=n.style?.width;typeof c=="number"&&Number.isFinite(c)&&s.style.setProperty("--veo-badge-tip-width",`${Math.min(720,Math.max(220,c))}px`),this.trigger=n.style?.badgeTrigger==="click"?"click":"hover";let p=n.style?.tooltipPlacement;this.side=p==="bottom"||p==="left"||p==="right"?p:"top";let m=He(n.style);s.style.display="inline-flex",s.style.verticalAlign="middle";let u=gi(hi(n),a);l.appendChild(u),this.badgeBtn=u,ve(r,s,m),this.registerCleanup(xe(s,i,m));let d=a.createElement("div");d.className="veo-tooltip veo-badge-tooltip",d.style.display="none";let h=(b,C)=>{o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:b,...C?{metadata:C}:{}});},f=b=>he(b,a,{onCtaClick:(C,L,A)=>{h("cta_clicked",A),C==="url"&&L&&window.open(L,"_blank","noopener,noreferrer"),this.closeTooltip(),C==="guide"&&L&&o.onOpenGuide?.(L);},onDismiss:()=>this.closeTooltip()}),v=f(n);d.appendChild(v);let x=a.createElement("div");x.className="veo-tooltip-arrow",d.appendChild(x),l.appendChild(d),this.tooltip=d,this.arrowEl=x,this.liveContainer=d,this.liveContent=v,this.liveKey=this.liveKeyOf(n),this.liveBuild=f;let y=()=>{this.cancelClose(),this.open||(this.openTooltip(u),this.shownEmitted||(this.shownEmitted=true,h("shown")));};if(this.trigger==="hover"){let b=()=>{this.cancelClose(),this.closeTimer=window.setTimeout(()=>this.closeTooltip(),hs);};u.addEventListener("mouseenter",y),u.addEventListener("focus",y),u.addEventListener("mouseleave",b),u.addEventListener("blur",b),d.addEventListener("mouseenter",()=>this.cancelClose()),d.addEventListener("mouseleave",b);}else {u.addEventListener("click",()=>{this.open?this.closeTooltip():y();});let b=C=>{this.open&&(C.composedPath().includes(s)||this.closeTooltip());};document.addEventListener("click",b,true),this.registerCleanup(()=>document.removeEventListener("click",b,true));}let w=b=>{b.key==="Escape"&&this.open&&this.closeTooltip();};document.addEventListener("keydown",w),this.registerCleanup(()=>document.removeEventListener("keydown",w)),o.isPreview&&y();}liveKeyOf(o){let n=o.selector??"",i=He(o.style),r=o.style?.badgeTrigger==="click"?"click":"hover";return `${n}|${i}|${r}`}onLiveUpdate(o){if(this.badgeBtn){let i=this.badgeBtn.ownerDocument,r=gi(hi(o),i);this.badgeBtn.className=r.className,this.badgeBtn.setAttribute("style",r.getAttribute("style")??""),this.badgeBtn.replaceChildren(...Array.from(r.childNodes));}let n=o.style?.tooltipPlacement;this.side=n==="bottom"||n==="left"||n==="right"?n:"top",this.open&&this.badgeBtn&&this.position(this.badgeBtn);}destroy(){this.cancelClose(),this.stopFloat?.(),this.stopFloat=null,this.tooltip=null,this.arrowEl=null,this.badgeBtn=null,this.open=false,super.destroy();}openTooltip(o){if(!this.tooltip)return;this.tooltip.style.display="block",this.open=true,this.position(o);let n=()=>{this.position(o);};window.addEventListener("scroll",n,true),window.addEventListener("resize",n),this.stopFloat=()=>{window.removeEventListener("scroll",n,true),window.removeEventListener("resize",n);};}closeTooltip(){this.cancelClose(),!(!this.tooltip||!this.open)&&(this.tooltip.style.display="none",this.open=false,this.stopFloat?.(),this.stopFloat=null);}cancelClose(){this.closeTimer!==null&&(window.clearTimeout(this.closeTimer),this.closeTimer=null);}async position(o){let n=this.tooltip,i=this.arrowEl;if(!n||!i)return;let{x:r,y:s,placement:l,middlewareData:a}=await Be(o,n,{strategy:"fixed",placement:this.side,middleware:[Me(8),Ie(),Pe({padding:8}),ot({element:i})]});n.style.left=`${r}px`,n.style.top=`${s}px`,nt(i,l,a.arrow);}};function hi(t){let e=t.style?.badge;if(!e||typeof e!="object")return {kind:"icon"};let o=e;return {kind:o.kind==="dot"||o.kind==="pill"||o.kind==="text"||o.kind==="image"||o.kind==="icon"?o.kind:"icon",icon:typeof o.icon=="string"?o.icon:null,text:typeof o.text=="string"?o.text:null,imageUrl:typeof o.imageUrl=="string"?o.imageUrl:null,color:typeof o.color=="string"&&Ne.test(o.color.trim())?o.color.trim():null,size:typeof o.size=="number"&&Number.isFinite(o.size)?o.size:null}}function Vt(t,e,o){return Math.min(o,Math.max(e,t))}function gi(t,e){let o=e.createElement("button");o.type="button",o.className=`veo-badge veo-badge--${t.kind}`,o.setAttribute("aria-label","M\xE1s informaci\xF3n");let n=Vt(t.size??18,8,48);switch(t.kind){case "dot":o.style.width=`${n}px`,o.style.height=`${n}px`,t.color&&(o.style.background=t.color);break;case "pill":{o.textContent=t.text?.slice(0,24)||"Nuevo",o.style.fontSize=`${Vt(Math.round(n*.62),8,24)}px`,t.color&&(o.style.background=t.color);break}case "text":{o.textContent=t.text?.slice(0,32)||"Nuevo",o.style.fontSize=`${Vt(Math.round(n*.7),9,28)}px`,t.color&&(o.style.color=t.color);break}case "image":{if(t.imageUrl&&me(t.imageUrl)){let i=e.createElement("img");i.src=t.imageUrl,i.alt="",i.style.width=`${n}px`,i.style.height=`${n}px`,o.appendChild(i);}else o.className="veo-badge veo-badge--icon",o.textContent="?",o.style.width=`${n}px`,o.style.height=`${n}px`,o.style.fontSize=`${Vt(Math.round(n*.62),8,32)}px`;break}default:{o.textContent=(t.icon||"\u2139\uFE0F").slice(0,4),o.style.width=`${n}px`,o.style.height=`${n}px`,o.style.fontSize=`${Vt(Math.round(n*.62),8,32)}px`,t.color&&(o.style.color=t.color);break}}return o}function Rt(t,e,o,n,i){let r=n.createElement("div");r.className="veo-guide-content";let s=n.createElement("div");s.className="veo-walkthrough-counter",s.textContent=`Paso ${e+1} de ${o}`,r.appendChild(s);let l=n.createElement("div");l.className="veo-walkthrough-progress";for(let h=0;h<o;h++){let f=n.createElement("span");f.className="veo-walkthrough-progress-dot",h<e&&f.classList.add("completed"),h===e&&f.classList.add("active"),l.appendChild(f);}r.appendChild(l);for(let h of $n(t,n))r.appendChild(h);let a=n.createElement("div");a.className="veo-walkthrough-actions";let c=n.createElement("button");c.type="button",c.className="veo-walkthrough-skip",c.textContent="Omitir",c.addEventListener("click",()=>i.onSkip()),a.appendChild(c);let p=n.createElement("div");if(p.className="veo-walkthrough-actions-right",e>0){let h=n.createElement("button");h.type="button",h.className="veo-walkthrough-btn-secondary",h.textContent="Atr\xE1s",h.addEventListener("click",()=>i.onBack()),p.appendChild(h);}let m=e===o-1,u=n.createElement("button");u.type="button",u.className="veo-guide-cta";let d=m?"Finalizar":"Siguiente";return u.textContent=typeof t.ctaText=="string"&&t.ctaText?t.ctaText:d,u.addEventListener("click",()=>{m?i.onComplete():i.onNext();}),p.appendChild(u),a.appendChild(p),r.appendChild(a),r.appendChild(at(n,()=>i.onSkip())),r}var qt=class extends J{async render(e){let o=e.nav?.stepIndex??0,n=e.guide.guideSteps[o];if(!n)return;let i=n.style?.position==="bottom"?"bottom":"top",r=n.selector?.trim()||null,s=null;if(r&&(s=await re(r),!s))return;let{host:l,root:a}=this.createHost();this.applyDesign(n.style);let c=a.ownerDocument??document,p=c.createElement("div");p.className=vi(i,!!s);let m=(d,h,f)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:o,action:d,...f?{metadata:f}:{}}),h&&window.open(h,"_blank","noopener,noreferrer"),e.onClose();},u=e.nav?Rt(n,e.nav.stepIndex,e.nav.totalSteps,c,e.nav.callbacks):he(n,c,{onCtaClick:(d,h,f)=>{m("cta_clicked",d==="url"?h:void 0,f),d==="guide"&&h&&e.onOpenGuide?.(h);},onDismiss:()=>m("dismissed")});if(p.appendChild(u),a.appendChild(p),r&&s){l.style.display="block";let d=i==="top"?"prepend":"append";ve(s,l,d),this.registerCleanup(xe(l,r,d));}e.nav||(this.liveContainer=p,this.liveContent=u,this.liveBuild=d=>he(d,c,{onCtaClick:(h,f,v)=>{m("cta_clicked",h==="url"?f:void 0,v),h==="guide"&&f&&e.onOpenGuide?.(f);},onDismiss:()=>m("dismissed")}),this.liveKey=this.liveKeyOf(n),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"}));}liveKeyOf(e){let o=e.selector?.trim()??"";if(!o)return "";let n=e.style?.position==="bottom"?"bottom":"top";return `${o}|${n}`}onLiveUpdate(e){if(this.liveContainer){let o=e.style?.position==="bottom"?"bottom":"top",n=!!e.selector?.trim();this.liveContainer.className=vi(o,n);}}};function vi(t,e){return e?"veo-banner veo-banner-embedded":`veo-banner veo-banner-${t}`}var Ve={iconEmptyColor:"#e7e2de",iconFillColor:"#406a31",barColor:"#406a31",barHeight:8,fontSize:14,fontWeight:600,titleColor:"#2c2825",subtitleColor:"#8a8582",subtitleTemplate:"Completado <%= currentStep %> de <%= totalSteps %> pasos"},bi={regular:400,medium:500,semibold:600,bold:700};function gs(t){let e=t??{},o=(l,a)=>typeof e[l]=="string"&&e[l].trim()?e[l]:a,n=(l,a,c,p)=>typeof e[l]=="number"&&Number.isFinite(e[l])?Math.min(p,Math.max(c,e[l])):a,i=e.fontWeight,r=typeof i=="number"?Math.min(900,Math.max(100,i)):typeof i=="string"&&bi[i.toLowerCase()]?bi[i.toLowerCase()]:Ve.fontWeight,s=e.colorMode==="dark";return {colorMode:s?"dark":"light",iconEmptyColor:o("iconEmptyColor",s?"#3c3734":Ve.iconEmptyColor),iconFillColor:o("iconFillColor",Ve.iconFillColor),barColor:o("barColor",Ve.barColor),barHeight:n("barHeight",Ve.barHeight,2,40),fontSize:n("fontSize",Ve.fontSize,10,40),fontWeight:r,titleColor:o("titleColor",s?"#f5efeb":Ve.titleColor),subtitleColor:o("subtitleColor",s?"#b0a9a5":Ve.subtitleColor),subtitleTemplate:o("subtitleTemplate",Ve.subtitleTemplate)}}function vs(t,e){return t.replace(/<%=\s*currentStep\s*%>/g,String(e.currentStep)).replace(/<%=\s*totalSteps\s*%>/g,String(e.totalSteps))}var qo=10,yi=2*Math.PI*qo;function bs(t,e,o,n){let i="http://www.w3.org/2000/svg",r=t.createElementNS(i,"svg");r.setAttribute("viewBox","0 0 28 28"),r.setAttribute("class","veo-checklist-ring"),r.setAttribute("aria-hidden","true");let s=t.createElementNS(i,"circle");if(s.setAttribute("cx","14"),s.setAttribute("cy","14"),s.setAttribute("r",String(qo)),s.setAttribute("fill",o?n.iconFillColor:"none"),s.setAttribute("stroke",n.iconEmptyColor),s.setAttribute("stroke-width","4.5"),r.appendChild(s),o){let a=t.createElementNS(i,"path");return a.setAttribute("d","M9 14.5l3.2 3.2L19 11"),a.setAttribute("fill","none"),a.setAttribute("stroke","#fff"),a.setAttribute("stroke-width","2.4"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),r.appendChild(a),r}let l=Math.max(0,Math.min(1,e));if(l>0){let a=t.createElementNS(i,"circle");a.setAttribute("cx","14"),a.setAttribute("cy","14"),a.setAttribute("r",String(qo)),a.setAttribute("fill","none"),a.setAttribute("stroke",n.iconFillColor),a.setAttribute("stroke-width","4.5"),a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-dasharray",`${(yi*l).toFixed(2)} ${yi.toFixed(2)}`),a.setAttribute("transform","rotate(-90 14 14)"),r.appendChild(a);}return r}function xi(t,e,o){let n=gs(t.style),i=(t.items??[]).filter(h=>h&&typeof h.guideId=="string"&&h.guideId),r=e.createElement("div");if(r.className=`veo-checklist${n.colorMode==="dark"?" veo-checklist--dark":""}`,r.style.setProperty("--veo-cl-font-size",`${n.fontSize}px`),r.style.setProperty("--veo-cl-font-weight",String(n.fontWeight)),r.style.setProperty("--veo-cl-title",n.titleColor),r.style.setProperty("--veo-cl-subtitle",n.subtitleColor),r.style.setProperty("--veo-cl-bar",n.barColor),r.style.setProperty("--veo-cl-bar-h",`${n.barHeight}px`),typeof t.html=="string"&&t.html||typeof t.text=="string"&&t.text){let h=e.createElement("div");h.className="veo-checklist-title",typeof t.html=="string"&&t.html?h.appendChild(xt(t.html,e)):h.textContent=t.text,r.appendChild(h);}let s=e.createElement("div");s.className="veo-checklist-items",s.setAttribute("role","list"),r.appendChild(s);let l=e.createElement("div");l.className="veo-checklist-footer";let a=e.createElement("div");a.className="veo-checklist-summary";let c=e.createElement("span");c.className="veo-checklist-count";let p=e.createElement("span");p.className="veo-checklist-percent",a.append(c,p);let m=e.createElement("div");m.className="veo-checklist-bar";let u=e.createElement("div");u.className="veo-checklist-bar-fill",m.appendChild(u),l.append(a,m),r.appendChild(l);let d=h=>{s.textContent="";let f=h?i.filter(w=>h.has(w.guideId)):i,v=0;for(let w of f){let b=h?.get(w.guideId)??null;b?.completed&&v++;let C=e.createElement("button");C.type="button",C.className=`veo-checklist-item${b?.completed?" veo-checklist-item--done":""}`,C.setAttribute("role","listitem");let L=b&&b.totalSteps>0?b.currentStep/b.totalSteps:0;C.appendChild(bs(e,L,b?.completed===true,n));let A=e.createElement("span");A.className="veo-checklist-texts";let D=e.createElement("span");if(D.className="veo-checklist-label",D.textContent=(w.text??"").trim()||b?.guideName||"Gu\xEDa",b&&b.published===false&&(C.title="Gu\xEDa no publicada: los usuarios no la ver\xE1n"),A.appendChild(D),b){let O=e.createElement("span");O.className="veo-checklist-sub",O.textContent=vs(n.subtitleTemplate,b),A.appendChild(O);}C.appendChild(A),C.addEventListener("click",O=>{if(O.preventDefault(),O.stopPropagation(),o.isPreview)return;let ee=b&&!b.completed?Math.min(b.currentStep,b.totalSteps-1):0;o.onOpenGuideAt?o.onOpenGuideAt(w.guideId,ee):o.onOpenGuide?.(w.guideId);}),s.appendChild(C);}let x=f.length,y=x>0?Math.round(v/x*100):0;c.textContent=`${v} de ${x} ${x===1?"completada":"completadas"}`,p.textContent=`${y}%`,u.style.width=`${y}%`,l.hidden=x===0;};if(o.isPreview&&i.length===0){let h=new Map([["__sample_1",{guideId:"__sample_1",guideName:"Configura tu primer env\xEDo",totalSteps:2,currentStep:1,completed:false}],["__sample_2",{guideId:"__sample_2",guideName:"Conecta tu tienda",totalSteps:2,currentStep:2,completed:true}]]);i.push({guideId:"__sample_1",text:"Configura tu primer env\xEDo"},{guideId:"__sample_2",text:"Conecta tu tienda"}),d(h);let f=e.createElement("p");return f.className="veo-checklist-empty",f.textContent="Ejemplo: agrega gu\xEDas a la lista desde Opciones.",r.appendChild(f),r}return d(null),o.fetchProgress&&i.length>0&&o.fetchProgress(i.map(h=>h.guideId)).then(h=>d(new Map(h.map(f=>[f.guideId,f])))).catch(()=>{}),r}function uo(t,e,o){let n=e.guide.guideSteps[0];if(!n)return;let i=n.fields??[],r=()=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"dismissed"}),e.onClose();},s=o.createElement("div");if(s.className="veo-guide-content",n.title){let u=o.createElement("h2");u.className="veo-guide-title",u.textContent=n.title,s.appendChild(u);}if(n.content){let u=o.createElement("p");u.className="veo-guide-text",u.textContent=n.content,s.appendChild(u);}let l=[],a=o.createElement("form");a.className="veo-form",a.noValidate=true;for(let u of i){let{wrapper:d,read:h}=Ko(u,o);l.push({field:u,read:h}),a.appendChild(d);}let c=o.createElement("p");c.className="veo-form-error",c.style.display="none",a.appendChild(c);let p=o.createElement("div");p.className="veo-guide-actions";let m=o.createElement("button");m.type="submit",m.className="veo-guide-cta",m.textContent=n.ctaText||"Enviar",p.appendChild(m),a.appendChild(p),a.addEventListener("submit",u=>{u.preventDefault(),c.style.display="none";let d={};for(let{field:f,read:v}of l){let x=v();if(x==null||x===""){if(f.required){c.textContent=`Completa "${f.label}"`,c.style.display="block";return}continue}d[f.key]=x;}if(Object.keys(d).length===0){c.textContent="Responde al menos un campo",c.style.display="block";return}m.disabled=true,(e.onFormSubmit??(()=>Promise.resolve(true)))(d).then(f=>{if(!f){m.disabled=false,c.textContent="No se pudo enviar. Prueba de nuevo.",c.style.display="block";return}e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"completed"});let v=e.isPreview?e.previewNote??"Vista previa: la respuesta NO se guard\xF3.":null;ys(t,o,v),window.setTimeout(()=>e.onClose(),v?2200:1400);});}),s.appendChild(a),s.appendChild(at(o,r)),t.appendChild(s);}function ys(t,e,o){for(;t.firstChild;)t.removeChild(t.firstChild);let n=e.createElement("div");if(n.className="veo-form-thanks",n.textContent="\u2713 \xA1Gracias por tu respuesta!",t.appendChild(n),o){let i=e.createElement("p");i.className="veo-form-preview-note",i.textContent=o,t.appendChild(i);}}function Ko(t,e){let o=e.createElement("div");o.className="veo-form-field";let n=e.createElement("label");switch(n.className="veo-form-label",n.textContent=t.required?`${t.label} *`:t.label,o.appendChild(n),t.type){case "textarea":{let i=e.createElement("textarea");return i.className="veo-form-input",i.rows=3,t.placeholder&&(i.placeholder=t.placeholder),o.appendChild(i),{wrapper:o,read:()=>i.value.trim()}}case "number":{let i=e.createElement("input");return i.type="number",i.className="veo-form-input",t.placeholder&&(i.placeholder=t.placeholder),o.appendChild(i),{wrapper:o,read:()=>i.value.trim()===""?void 0:Number(i.value)}}case "select":{let i=e.createElement("select");i.className="veo-form-input";let r=e.createElement("option");r.value="",r.textContent=t.placeholder||"Elige una opci\xF3n\u2026",i.appendChild(r);for(let s of t.options??[]){let l=e.createElement("option");l.value=s,l.textContent=s,i.appendChild(l);}return o.appendChild(i),{wrapper:o,read:()=>i.value||void 0}}case "radio":{let i=e.createElement("div");i.className="veo-form-options";let r=`veo-${t.key}`,s=[];for(let l of t.options??[]){let a=e.createElement("label");a.className="veo-form-option";let c=e.createElement("input");c.type="radio",c.name=r,c.value=l,s.push(c);let p=e.createElement("span");p.textContent=l,a.appendChild(c),a.appendChild(p),i.appendChild(a);}return o.appendChild(i),{wrapper:o,read:()=>s.find(l=>l.checked)?.value}}case "multiselect":{let i=e.createElement("div");i.className="veo-form-options";let r=[];for(let s of t.options??[]){let l=e.createElement("label");l.className="veo-form-option";let a=e.createElement("input");a.type="checkbox",a.value=s,r.push(a);let c=e.createElement("span");c.textContent=s,l.appendChild(a),l.appendChild(c),i.appendChild(l);}return o.appendChild(i),{wrapper:o,read:()=>{let s=r.filter(l=>l.checked).map(l=>l.value);return s.length>0?s:void 0}}}case "checkbox":{let i=e.createElement("label");i.className="veo-form-option";let r=e.createElement("input");r.type="checkbox";let s=e.createElement("span");return s.textContent=t.placeholder||"S\xED",i.appendChild(r),i.appendChild(s),o.appendChild(i),{wrapper:o,read:()=>r.checked?true:t.required?"":false}}case "yesno":{let i=e.createElement("div");i.className="veo-form-options";let r=`veo-${t.key}`,[s,l]=t.options?.length===2?t.options:["S\xED","No"],a=[];for(let{label:c,value:p}of [{label:s,value:true},{label:l,value:false}]){let m=e.createElement("label");m.className="veo-form-option";let u=e.createElement("input");u.type="radio",u.name=r,a.push({input:u,value:p});let d=e.createElement("span");d.textContent=c,m.appendChild(u),m.appendChild(d),i.appendChild(m);}return o.appendChild(i),{wrapper:o,read:()=>a.find(c=>c.input.checked)?.value}}case "nps":{let i=typeof t.min=="number"?t.min:0,r=typeof t.max=="number"&&t.max>i?t.max:10;return wi(o,e,i,r,"veo-nps-btn",void 0,{labels:t.scaleLabels??[],showLabels:t.showLabels!==false})}case "rating":return wi(o,e,1,5,"veo-rating-btn","\u2605");default:{let i=e.createElement("input");return i.type="text",i.className="veo-form-input",t.placeholder&&(i.placeholder=t.placeholder),o.appendChild(i),{wrapper:o,read:()=>i.value.trim()}}}}function wi(t,e,o,n,i,r,s={labels:[],showLabels:false}){let l=e.createElement("div");l.className="veo-form-scale";let a,c=[],p=u=>s.labels[u-o]?.trim()??"",m=s.showLabels&&Array.from({length:n-o+1},(u,d)=>o+d).some(u=>p(u));for(let u=o;u<=n;u++){let d=e.createElement("button");d.type="button",d.className=i,d.textContent=r??String(u);let h=p(u);if(d.setAttribute("aria-label",h?`${u} \xB7 ${h}`:String(u)),h&&(d.title=h),d.addEventListener("click",()=>{a=u,c.forEach((x,y)=>{let w=r?y+o<=u:y+o===u;x.classList.toggle("veo-scale-active",w);});}),c.push(d),!m){l.appendChild(d);continue}let f=e.createElement("div");f.className=`veo-scale-item${u===o?" veo-scale-item--first":u===n?" veo-scale-item--last":""}`;let v=e.createElement("span");v.className="veo-scale-label",v.textContent=h,f.append(d,v),l.appendChild(f);}return t.appendChild(l),{wrapper:t,read:()=>a}}function Kt(t){let e=new Map,o=[],n=-1;return t.forEach((i,r)=>{if(!i)return;let s;typeof i.row=="number"&&Number.isFinite(i.row)?(s=i.row,n=s):(s=n+.5,n=s);let l=typeof i.col=="number"&&Number.isFinite(i.col)?i.col:0,a=e.get(s);a||(a={row:s,columns:[]},e.set(s,a),o.push(s));let c=a.columns.find(p=>p.col===l);c||(c={col:l,blocks:[]},a.columns.push(c)),c.blocks.push({block:i,index:r});}),o.sort((i,r)=>i-r).map(i=>{let r=e.get(i);return r.columns.sort((s,l)=>s.col-l.col),r})}var mo=new WeakMap;function ft(t=document){let e=t.documentElement,o=t.body;if(!e||!o)return ()=>{};let n=mo.get(t);if(!n){n={count:0,html:{overflow:e.style.overflow,paddingRight:e.style.paddingRight},body:{overflow:o.style.overflow,paddingRight:o.style.paddingRight}},mo.set(t,n);let r=t.defaultView,s=r?Math.max(0,r.innerWidth-e.clientWidth):0;s>0&&(o.style.paddingRight=`${s}px`),e.style.overflow="hidden",o.style.overflow="hidden";}n.count+=1;let i=false;return ()=>{if(i)return;i=true;let r=mo.get(t);r&&(r.count-=1,!(r.count>0)&&(mo.delete(t),e.style.overflow=r.html.overflow,e.style.paddingRight=r.html.paddingRight,o.style.overflow=r.body.overflow,o.style.paddingRight=r.body.paddingRight));}}var xs=t=>`veo:snooze:${t}`,Ei={hour:36e5,day:864e5,week:6048e5};function ws(t,e){return (Number.isFinite(t)&&t>0?Math.floor(t):1)*(Ei[e]??Ei.day)}function ki(t,e,o,n=Date.now()){try{localStorage.setItem(xs(t),String(n+ws(e,o)));}catch{}}var Ci="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021",Si="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75",Li="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",Xo="M21 12a9 9 0 11-18 0 9 9 0 0118 0z",Es="M7.5 3.75H6A2.25 2.25 0 0 0 3.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0 1 20.25 6v1.5m0 9V18A2.25 2.25 0 0 1 18 20.25h-1.5m-9 0H6A2.25 2.25 0 0 1 3.75 18v-1.5M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z",Yo={info:{paths:[Xo,Ci],dots:[[12,8.25]]},exclamation:{paths:[Xo,"M12 8v4.5"],dots:[[12,15.75]]},question:{paths:[Xo,Si],dots:[[12,17.25]]},star:{paths:[Li]},"info-solid":{paths:[Ci],dots:[[12,8.25]],solid:true,scale:.8},"exclamation-solid":{paths:["M12 8v4.5"],dots:[[12,15.75]],solid:true,scale:.8},"question-solid":{paths:[Si],dots:[[12,17.25]],solid:true,scale:.8},"star-solid":{paths:[Li],solid:true,scale:.55},"target-solid":{paths:[Es],solid:true,scale:.6},new:{paths:[],text:"New"}},ks=14,Cs=19e3,Ti=8;function it(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function Ai(t,e,o,n){let i=Yo[e]??Yo.info;if(i.text){let c=t.createElement("span");return c.textContent=i.text,c.style.font=`700 ${Math.round(o*.85)}px/1 system-ui, -apple-system, sans-serif`,c.style.color=n,c}let r="http://www.w3.org/2000/svg",s=t.createElementNS(r,"svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("width",String(o)),s.setAttribute("height",String(o)),s.setAttribute("fill","none"),s.setAttribute("aria-hidden","true");let l=i.solid?"#ffffff":n;if(i.solid){let c=t.createElementNS(r,"circle");c.setAttribute("cx","12"),c.setAttribute("cy","12"),c.setAttribute("r","12"),c.setAttribute("fill",n),s.appendChild(c);}let a=t.createElementNS(r,"g");if(a.setAttribute("stroke",l),a.setAttribute("stroke-width",i.solid?"2":"1.8"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),i.scale&&i.scale!==1){let c=i.scale,p=12-12*c;a.setAttribute("transform",`translate(${p} ${p}) scale(${c})`);}for(let c of i.paths){let p=t.createElementNS(r,"path");p.setAttribute("d",c),a.appendChild(p);}for(let[c,p]of i.dots??[]){let m=t.createElementNS(r,"circle");m.setAttribute("cx",String(c)),m.setAttribute("cy",String(p)),m.setAttribute("r","0.9"),m.setAttribute("fill",l),m.setAttribute("stroke","none"),a.appendChild(m);}return s.appendChild(a),s}function Ri(t,e){let o=it(e.size,ks),n=e.color||"#000000",i=t.createElement("span");if(i.className=`veo-badge-marker veo-badge-marker-${e.kind}`,i.style.display="inline-flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.boxSizing="border-box",i.style.lineHeight="1",e.kind==="image"){let r=t.createElement("img");return r.alt="",r.src=e.imageUrl||"",r.style.width=`${o}px`,r.style.height=`${o}px`,r.style.objectFit="contain",r.style.display="block",i.appendChild(r),i}if(e.kind==="icon-text"){i.style.gap="6px",i.style.color=n,i.style.fontSize=`${o}px`,i.style.fontFamily="inherit",i.style.fontWeight="600",i.style.whiteSpace="nowrap",i.style.background=e.bgColor||"transparent";let r=it(e.borderWidth,0);r>0&&(i.style.border=`${r}px solid ${e.borderColor||n}`),i.style.padding=`${it(e.paddingY,6)}px ${it(e.paddingX,10)}px`,i.style.borderRadius=`${it(e.radius,999)}px`,e.showIcon!==false&&i.appendChild(Ai(t,e.icon||"star",o,n));let s=t.createElement("span");return s.textContent=e.text||"",i.appendChild(s),i}return i.style.width=`${o}px`,i.style.height=`${o}px`,i.appendChild(Ai(t,e.icon||"info",o,n)),i}function Ss(t,e,o,n){let i=t.left+t.width,r=t.top+t.height,s=t.top+t.height/2-e.height/2,l=t.left+t.width/2-e.width/2,a,c;switch(o){case "top-left":a=t.left-e.width/2,c=t.top-e.height/2;break;case "bottom-left":a=t.left-e.width/2,c=r-e.height/2;break;case "bottom-right":a=i-e.width/2,c=r-e.height/2;break;case "left":a=t.left-e.width-Ti,c=s;break;case "right":a=i+Ti,c=s;break;case "center":a=l,c=s;break;default:a=i-e.width/2,c=t.top-e.height/2;}return {x:a+n.x,y:c+n.y}}function Mi(t,e,o){e.style.position="absolute",e.style.zIndex=String(it(o.zIndex,Cs)),e.style.margin="0";let n=()=>{let i=t.getBoundingClientRect(),r=e.getBoundingClientRect(),{x:s,y:l}=Ss({left:i.left+window.scrollX,top:i.top+window.scrollY,width:i.width,height:i.height},{width:r.width,height:r.height},o.position??"top-right",{x:it(o.offsetX,0),y:it(o.offsetY,0)});e.style.left=`${Math.round(s)}px`,e.style.top=`${Math.round(l)}px`;};return n(),pi(t,e,n)}var Jo={left:"flex-start",center:"center",right:"flex-end"},Pi={...Jo,distribute:"space-between"},Ii={top:"flex-start",center:"center",bottom:"flex-end"};function Ls(t,e){let o=t.style;typeof e.background=="string"&&e.background&&(o.background=e.background);for(let n of ["Top","Right","Bottom","Left"]){let i=e[`padding${n}`];typeof i=="number"&&Number.isFinite(i)&&o.setProperty(`padding-${n.toLowerCase()}`,`${i}px`);let r=e[`margin${n}`];typeof r=="number"&&Number.isFinite(r)&&o.setProperty(`margin-${n.toLowerCase()}`,`${r}px`);}typeof e.minHeight=="number"&&Number.isFinite(e.minHeight)&&e.minHeight>0&&(o.minHeight=`${e.minHeight}px`),e.align&&Pi[e.align]&&(o.justifyContent=Pi[e.align],t.classList.add("veo-row--aligned")),e.valign&&Ii[e.valign]&&(o.alignItems=Ii[e.valign]);}var fo=class extends J{async render(e){let o=e.nav?.stepIndex??0,n=e.guide.guideSteps[o];if(!n)return;let i=n.badge?.enabled===true,r=(n.position==="relative-to-element"||n.presentation==="inline"||i)&&n.anchorSelector?.trim()||void 0,s=null;if(r&&(s=await re(r),!s))return;let l=n.blocks??[],a=l.length===1&&l[0]?.type==="code"?l[0]:void 0;if(n.presentation==="inline"&&s&&a&&!a.sandboxed){let y=s.ownerDocument??document,{cleanup:w}=Oo(a,y,e,void 0,{anchor:s,pos:Zo(n.inlinePosition),...e.isPreview&&a.editorId?{tagBlockId:a.editorId}:{}});this.registerCleanup(w),e.onInteraction({guideId:e.guide.guideId,stepIndex:o,action:"shown"});return}let{host:c,root:p}=this.createHost(),m=p.ownerDocument??document,u=n.design??{};typeof u.zIndex=="number"&&(c.style.zIndex=String(u.zIndex));let d=m.createElement("div");d.className="veo-card",Hs(d,u),typeof u.ariaLabel=="string"&&u.ariaLabel.trim()&&(d.setAttribute("role","dialog"),d.setAttribute("aria-label",u.ariaLabel.trim()));let h=(y,w)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:o,action:y,...{}});},f=[];if(this.buildContent(d,n.blocks??[],m,e,o,f,c),l.length===0&&(d.classList.add("veo-card--empty"),e.isPreview)){let y=m.createElement("div");y.className="veo-card-empty-zone";let w=m.createElement("b");w.textContent="+";let b=m.createElement("span");b.textContent="Clic para agregar contenido",y.append(w,b),d.appendChild(y);let C=()=>{d.classList.toggle("veo-card--narrow",d.clientWidth<Ns);};if(typeof ResizeObserver<"u"){let L=new ResizeObserver(C);L.observe(d),this.registerCleanup(()=>L.disconnect());}C();}let v=d.lastElementChild;v&&!v.style.marginBottom&&(v.style.marginBottom="0");let x=null;if(u.closeButton!==false){let y=at(m,()=>{if(x){x();return}h("dismissed"),this.closeOrSkip(e);}),w=typeof u.closeColor=="string"?u.closeColor:null,b=typeof u.closeHoverColor=="string"?u.closeHoverColor:null;w&&(y.style.color=w);let C=typeof u.closePosition=="string"?u.closePosition:"top-right";Ps(y,C);for(let L of ["Top","Right","Bottom","Left"]){let A=u[`closePadding${L}`];typeof A=="number"&&y.style.setProperty(`padding-${L.toLowerCase()}`,`${A}px`);let D=u[`closeMargin${L}`];typeof D=="number"&&y.style.setProperty(`margin-${L.toLowerCase()}`,`${D}px`);}b&&(y.addEventListener("mouseenter",()=>{y.style.color=b;}),y.addEventListener("mouseleave",()=>{y.style.color=w??"";})),d.appendChild(y),Ms(d,l,C,u);}if(i&&s){x=this.renderBadgeMode(n,d,s,r,c,p,m,e,o,u);return}if(n.presentation==="inline"&&s){c.style.display="block";let y=Zo(n.inlinePosition);p.appendChild(d),ve(s,c,y),this.registerCleanup(xe(c,r,y));}else if(n.position==="relative-to-element"&&s){if(u.backdrop===true){let b=m.createElement("div");b.className="veo-composite-overlay veo-composite-overlay--dim",typeof u.backdropColor=="string"&&(b.style.background=u.backdropColor);let C=typeof u.backdropZIndex=="number"?u.backdropZIndex:2e5;b.style.zIndex=String(C),p.appendChild(b),this.registerCleanup(ft(m)),u.targetAbove===true&&this.registerCleanup(Is(s,C+1));}let y=m.createElement("div");y.className="veo-composite-anchored";let w=u.caret===false?null:Ni(m,u);w&&y.appendChild(w),y.appendChild(d),p.appendChild(y),this.registerCleanup(await Hi(s,y,w));}else {let y=m.createElement("div");y.className="veo-composite-overlay",u.backdrop!==false&&(y.classList.add("veo-composite-overlay--dim"),typeof u.backdropColor=="string"&&(y.style.background=u.backdropColor),typeof u.backdropZIndex=="number"&&(y.style.zIndex=String(u.backdropZIndex)),y.addEventListener("click",w=>{w.target===y&&(h("dismissed"),this.closeOrSkip(e));}),this.registerCleanup(ft(m))),Ts(d,n.position,u),y.appendChild(d),p.appendChild(y);}e.onInteraction({guideId:e.guide.guideId,stepIndex:o,action:"shown"});}buildContent(e,o,n,i,r,s,l){let a=d=>{i.onInteraction({guideId:i.guide.guideId,stepIndex:r,action:"cta_clicked",...d.id?{metadata:{buttonId:d.id}}:{}});},c=(d,h,f)=>(d.dataset.veoBlock=String(f),h.editorId&&(d.dataset.veoBlockId=h.editorId),d),p=(d,h)=>{if(!i.isPreview||!d.editorId)return null;let f=n.createElement("div");return f.className="veo-block-placeholder",f.textContent=h,f},m=(d,h)=>{let f=0;for(;f<h.length;){let{block:v,index:x}=h[f];if(v.type==="button"){let w=n.createElement("div");w.className="veo-guide-actions";let b;for(;f<h.length&&h[f]?.block.type==="button";){let{block:C,index:L}=h[f];if(!b){let A=C.style?.align;(A==="left"||A==="center"||A==="right")&&(b=A);}w.appendChild(c(this.buildButton(C,n,i,r,s,a),C,L)),f++;}b&&(w.style.justifyContent=Jo[b]??"flex-end"),d.appendChild(w);continue}if(v.type==="code"){let{node:w,cleanup:b}=Oo(v,n,i,l),C=w??p(v,"Bloque de c\xF3digo");C&&d.appendChild(c(C,v,x)),this.registerCleanup(b),f++;continue}if(v.type==="form"){d.appendChild(c(this.buildForm(v,n,i,r,s,a),v,x)),f++;continue}if(v.type==="checklist"){let w=xi(v,n,i);Ae(w,v.style,"text"),w.style.alignSelf="stretch",w.style.width="100%",d.appendChild(c(w,v,x)),f++;continue}let y=Et(v,n,{editing:i.isPreview===true})??p(v,v.type==="image"?"Imagen (sin URL)":v.type==="video"?"Video (elige proveedor y pega la URL)":"Bloque vac\xEDo");y&&d.appendChild(c(y,v,x)),f++;}},u=i.guide.guideSteps[r]?.rows;for(let d of Kt(o)){let h=Number.isInteger(d.row)?u?.[String(d.row)]:void 0;if(d.columns.length===1&&!h){m(e,d.columns[0].blocks);continue}let f=n.createElement("div");f.className="veo-row",Number.isInteger(d.row)&&(f.dataset.veoRow=String(d.row));for(let v of d.columns){let x=n.createElement("div");x.className="veo-col",m(x,v.blocks),f.appendChild(x);}h&&Ls(f,h),e.appendChild(f);}}buildForm(e,o,n,i,r,s){let l=o.createElement("div");l.className="veo-form";let a=e.style??{},{marginTop:c,marginBottom:p,...m}=a;for(let[f,v]of [["marginTop",c],["marginBottom",p]])typeof v=="number"&&Number.isFinite(v)&&(l.style[f]=`${v}px`);let u=null;(typeof e.html=="string"&&e.html||typeof e.text=="string"&&e.text)&&(u=o.createElement("div"),u.className="veo-form-question",typeof e.html=="string"&&e.html?u.appendChild(xt(e.html,o)):u.textContent=e.text,Ae(u,m,"text"),l.appendChild(u));let d=u?.textContent?.trim()??"",h=[];for(let f of e.fields??[]){let{wrapper:v,read:x}=Ko(f,o),y=e.style??{};if(typeof y.scaleColor=="string"&&y.scaleColor&&v.style.setProperty("--veo-scale-color",y.scaleColor),typeof y.scaleSize=="number"&&y.scaleSize>=24&&y.scaleSize<=96&&v.style.setProperty("--veo-scale-size",`${y.scaleSize}px`),u&&(v.querySelector(".veo-form-label")?.remove(),d))for(let b of v.querySelectorAll("input, textarea, select"))b.setAttribute("aria-label",d);let w={field:f,read:x,blockId:e.id??null};r.push(w),h.push(w),l.appendChild(v);}if(e.submit){let f=o.createElement("div");f.className="veo-guide-actions";let v={...e.submit,type:"button"},x=v.style?.align;(x==="left"||x==="center"||x==="right")&&(f.style.justifyContent=Jo[x]??"flex-end"),f.appendChild(this.buildButton(v,o,n,i,r,s,h)),l.appendChild(f);}return l}buildButton(e,o,n,i,r,s,l){let a=o.createElement("button");a.type="button",a.className="veo-guide-cta",a.textContent=e.text?.trim()||"OK";let c=e.style??{};(c.preset==="secondary"||c.preset==="link")&&a.classList.add(`veo-guide-cta--${c.preset}`),typeof c.ariaLabel=="string"&&c.ariaLabel.trim()&&a.setAttribute("aria-label",c.ariaLabel.trim()),Ae(a,e.style,"button");let p=n.nav?.callbacks,m=h=>{switch(h.action){case "next":p?p.onNext():n.onClose();break;case "prev":p?.onBack();break;case "goto":p?.onGoto&&typeof h.targetStep=="number"?p.onGoto(h.targetStep):n.onClose();break;case "snooze":ki(n.guide.guideId,typeof h.snoozeEvery=="number"?h.snoozeEvery:1,h.snoozeUnit??"day"),n.onClose();break;case "url":typeof h.url=="string"&&me(h.url)&&(h.newTab===false?window.location.assign(h.url):window.open(h.url,"_blank","noopener,noreferrer"));break;case "guide":h.targetGuideId&&n.onOpenGuide?.(h.targetGuideId),this.closeOrSkip(n);break;default:this.closeOrSkip(n);}},u=()=>{e.secondAction?.action&&m(e.secondAction);},d=()=>{switch(e.action){case "next":case "prev":case "goto":case "snooze":case "url":case "guide":s(e),m(e),u();break;case "submit-forms":case "submit-forms-advance":case "submit-forms-goto":this.submitForms(r,n,i,a,()=>{s(e),e.action==="submit-forms"||!p?n.onClose():e.action==="submit-forms-goto"&&typeof e.targetStep=="number"&&p.onGoto?p.onGoto(e.targetStep):p.onNext();});break;default:s(e),this.closeOrSkip(n),u();}};return a.addEventListener("click",()=>{l?this.submitForms(l,n,i,a,d):d();}),a}submitForms(e,o,n,i,r){let s={};for(let{field:p,read:m}of e){let u=m();if(u==null||u===""){if(p.required){i.textContent=`Completa "${p.label}"`;return}continue}s[p.key]=u;}if(Object.keys(s).length===0){r();return}i.disabled=true;let l=o.onFormSubmit??(()=>Promise.resolve(true)),a=new Set(e.filter(p=>s[p.field.key]!==void 0).map(p=>p.blockId??"")),c=a.size===1&&[...a][0]||void 0;l(s,{...c?{pollId:c}:{},stepIndex:n}).then(p=>{if(i.disabled=false,!p)return;(!o.nav||n>=o.nav.totalSteps-1)&&o.onInteraction({guideId:o.guide.guideId,stepIndex:n,action:"completed"}),r();});}closeOrSkip(e){e.nav?.callbacks?e.nav.callbacks.onSkip():e.onClose();}renderBadgeMode(e,o,n,i,r,s,l,a,c,p){let m=e.badge?.trigger==="click"?"click":"hover",u=e.badge?.placement==="top"||e.badge?.placement==="left"||e.badge?.placement==="right"?e.badge.placement:"bottom",d=l.createElement("div");d.className="veo-composite-badge",d.setAttribute("role","button"),d.tabIndex=0,d.style.cursor="pointer",d.style.display="inline-flex",d.style.alignItems="center";let h=e.badge?.marker??null;h?d.appendChild(Ri(l,h)):this.buildContent(d,e.badge?.blocks??[],l,a,c,[],r),s.appendChild(d),p.fullWidth===true?(o.style.width="auto",o.style.maxWidth="320px"):!o.style.width&&!o.style.maxWidth&&(o.style.maxWidth="320px");let f=l.createElement("div");f.className="veo-composite-anchored",f.style.display="none";let v=p.caret===false?null:Ni(l,p);if(v&&f.appendChild(v),f.appendChild(o),s.appendChild(f),h)r.style.display="inline-block",(n.ownerDocument??document).body.appendChild(r),this.registerCleanup(Mi(n,r,h)),this.registerCleanup(()=>r.remove());else {r.style.display="inline-block";let A=Zo(e.inlinePosition);ve(n,r,A),this.registerCleanup(xe(r,i,A));}let x=false,y=null,w=null,b=false,C=()=>{x||(x=true,f.style.display="block",Hi(d,f,v,u).then(A=>{x?y=A:A();}),b||(b=true,a.onInteraction({guideId:a.guide.guideId,stepIndex:c,action:"shown"})));},L=()=>{x=false,f.style.display="none",y?.(),y=null;};if(m==="hover"){let A=()=>{w!==null&&(clearTimeout(w),w=null);},D=()=>{A(),w=window.setTimeout(L,150);};d.addEventListener("mouseenter",()=>{A(),C();}),d.addEventListener("mouseleave",D),d.addEventListener("focus",C),f.addEventListener("mouseenter",A),f.addEventListener("mouseleave",D);}else d.addEventListener("click",()=>{x?L():C();});return this.registerCleanup(()=>{y?.(),w!==null&&clearTimeout(w);}),a.badgeOpen&&C(),L}};function Zo(t){return t==="before"||t==="prepend"||t==="append"?t:"after"}function Ts(t,e,o){let n=t.style;n.position="fixed";let i=16,r=d=>typeof o[d]=="number"&&Number.isFinite(o[d])?o[d]:0;n.margin="0";let s=o.hAlign==="left"?"left":o.hAlign==="right"?"right":null,l=e.includes("top")?"top":e.includes("bottom")?"bottom":"middle",a=s??(e.includes("left")?"left":e.includes("right")?"right":"middle");l==="top"?n.top=`${i+r("marginTop")}px`:l==="bottom"?n.bottom=`${i+r("marginBottom")}px`:n.top="50%",a==="left"?n.left=`${i+r("marginLeft")}px`:a==="right"?n.right=`${i+r("marginRight")}px`:n.left="50%";let c=r("marginLeft")-r("marginRight"),p=r("marginTop")-r("marginBottom"),m=a==="middle"?`calc(-50% + ${c}px)`:"0",u=l==="middle"?`calc(-50% + ${p}px)`:"0";n.transform=m==="0"&&u==="0"?"":`translate(${m}, ${u})`;}var Bi="10px",As=42,Rs=20;function Ms(t,e,o,n){if(e.length===0)return;let i=o.includes("bottom")?"Bottom":"Top";if((i==="Top"?e[0]:e[e.length-1])?.type==="image")return;let s=n[`closeMargin${i}`],l=As+(typeof s=="number"?s:0),a=n[`padding${i}`];(typeof a=="number"?a:Rs)<l&&t.style.setProperty(`padding-${i.toLowerCase()}`,`${l}px`);}function Ps(t,e){let o=t.style;o.top="auto",o.right="auto",o.bottom="auto",o.left="auto";let n=e.includes("bottom")?"bottom":"top",i=e.includes("left")?"left":"right";o.setProperty(n,Bi),o.setProperty(i,Bi);}function Ni(t,e){let o=t.createElement("div");o.className="veo-composite-caret";let n=typeof e.caretWidth=="number"?e.caretWidth:12,i=typeof e.caretHeight=="number"?e.caretHeight:12,r=o.style;if(r.position="absolute",r.width=`${n}px`,r.height=`${i}px`,r.transform="rotate(45deg)",r.background=typeof e.background=="string"?e.background:"#ffffff",typeof e.borderWidth=="number"&&e.borderWidth>0){let s=typeof e.borderColor=="string"?e.borderColor:"#bbbbbb";r.border=`${e.borderWidth}px solid ${s}`;}return o}function Is(t,e){let o=t,n=o.style.position,i=o.style.zIndex;return getComputedStyle(o).position==="static"&&(o.style.position="relative"),o.style.zIndex=String(e),()=>{o.style.position=n,o.style.zIndex=i;}}async function Hi(t,e,o,n="bottom"){let i=async()=>{let{x:s,y:l,placement:a,middlewareData:c}=await Be(t,e,{placement:n,strategy:"fixed",middleware:[Me(o?10:8),Ie(),Pe({padding:8}),...o?[ot({element:o})]:[]]});e.style.left=`${s}px`,e.style.top=`${l}px`,o&&nt(o,a,c.arrow);};await i();let r=()=>{i();};return window.addEventListener("scroll",r,true),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",r,true),window.removeEventListener("resize",r);}}var Bs=120,Ns=260;function Hs(t,e){let o=t.style,n=a=>typeof a=="number"&&Number.isFinite(a)?`${a}px`:null,i=a=>typeof a=="string"&&a?a:null;e.colorMode==="dark"&&(o.background="#1f1d1b",o.color="#f5f0eb",t.classList.add("veo-card--dark")),i(e.background)&&(o.background=e.background);let r=i(e.color)??i(e.textColor);r&&(o.color=r),n(e.fontSize)&&(o.fontSize=n(e.fontSize)),i(e.fontWeight)&&(o.fontWeight=e.fontWeight),i(e.fontFamily)&&e.fontFamily!=="inherit"&&(o.fontFamily=e.fontFamily),i(e.textTransform)&&e.textTransform!=="none"&&(o.textTransform=e.textTransform),typeof e.letterSpacing=="number"&&(o.letterSpacing=`${e.letterSpacing}px`),i(e.align)&&(o.textAlign=e.align),typeof e.lineHeight=="number"&&(o.lineHeight=`${e.lineHeight}%`),n(e.radius)&&(o.borderRadius=n(e.radius));let s=n(e.borderWidth);if(s&&(o.border=`${s} solid ${i(e.borderColor)??"#e5e5e5"}`),i(e.shadowColor)||typeof e.shadowBlur=="number"){let a=c=>typeof e[c]=="number"?e[c]:0;o.boxShadow=`${a("shadowX")}px ${a("shadowY")}px ${a("shadowBlur")}px ${a("shadowSpread")}px ${i(e.shadowColor)??"rgba(0,0,0,0.2)"}`;}let l=typeof e.width=="number"&&Number.isFinite(e.width)?`${Math.max(Bs,e.width)}px`:null;e.fullWidth===true?o.width="100%":e.widthType==="fluid"?(o.width="100%",l&&(o.maxWidth=l)):l&&(o.width=l);for(let a of ["Top","Right","Bottom","Left"]){let c=n(e[`padding${a}`]);c&&o.setProperty(`padding-${a.toLowerCase()}`,c);let p=n(e[`margin${a}`]);p&&o.setProperty(`margin-${a.toLowerCase()}`,p);}}var $s={mode:"floating",position:"bottom-right"},$i=16,Ds=360,ho=class extends J{async render(e){let o=e.guide.guideSteps[0];if(!o||typeof o.html!="string"||o.html.length===0)return;let n=o.placement??$s,i=null;if(n.mode==="anchored"){let p=n.selector??o.selector??e.guide.activationRules.selector;if(typeof p!="string"||p.length===0||(i=await re(p),!i))return}let{root:r}=this.createHost(),s=r.ownerDocument??document,l=s.createElement("div");l.className=n.mode==="anchored"?"veo-custom-anchored":"veo-custom-floating";let{iframe:a,cleanup:c}=kt(s,o,e,{width:Do(n.width??Ds),fixedHeight:n.height??null});this.registerCleanup(c),l.appendChild(a),r.appendChild(l),n.mode==="floating"?_s(l,n):i&&this.registerCleanup(await this.setupAnchoredPosition(i,l,n)),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}async setupAnchoredPosition(e,o,n){let i=n.side??"bottom",r=async()=>{let{x:l,y:a}=await Be(e,o,{placement:i,strategy:"fixed",middleware:[Me(n.offsetY??8),Ie(),Pe({padding:8})]});o.style.left=`${l}px`,o.style.top=`${a}px`;};await r();let s=()=>{r();};return window.addEventListener("scroll",s,true),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s,true),window.removeEventListener("resize",s);}}};function _s(t,e){let o=e.position??"bottom-right",n=`${e.offsetX??$i}px`,i=`${e.offsetY??$i}px`,r=t.style;if(o==="center"){r.top="50%",r.left="50%",r.transform="translate(-50%, -50%)";return}let[s,l]=o.split("-");s==="top"?r.top=i:r.bottom=i,l==="left"?r.left=n:l==="right"?r.right=n:(r.left="50%",r.transform="translateX(-50%)");}var go=class extends J{render(e){let o=e.guide.guideSteps[0];if(!o||(o.fields??[]).length===0)return;let{root:n}=this.createHost();this.applyDesign(o.style);let i=n.ownerDocument??document,r=i.createElement("div");r.className="veo-modal-overlay";let s=i.createElement("div");s.className="veo-modal-card",uo(s,e,i),r.appendChild(s),n.appendChild(r),this.registerCleanup(ft(i));let l=()=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"dismissed"}),e.onClose();};r.addEventListener("click",c=>{c.target===r&&l();});let a=c=>{c.key==="Escape"&&l();};document.addEventListener("keydown",a),this.registerCleanup(()=>document.removeEventListener("keydown",a)),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var vo=class extends J{async render(e){let o=e.guide.guideSteps[0];if(!o||typeof o.html!="string"||o.html.length===0)return;let n=o.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await re(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=He(o.style);ve(i,r,l),this.registerCleanup(xe(r,n,l));let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-custom-inline";let{iframe:p,cleanup:m}=kt(a,o,e,{width:"100%"});this.registerCleanup(m),c.appendChild(p),s.appendChild(c),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var bo=class extends J{async render(e){let o=e.guide.guideSteps[0];if(!o||(o.fields??[]).length===0)return;let n=o.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await re(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=He(o.style);ve(i,r,l),this.registerCleanup(xe(r,n,l)),this.applyDesign(o.style);let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-inline",uo(c,e,a),s.appendChild(c),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var yo=class extends J{async render(e){let o=e.guide.guideSteps[0];if(!o)return;let n=o.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await re(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=He(o.style);ve(i,r,l),this.registerCleanup(xe(r,n,l)),this.applyDesign(o.style);let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-inline";let p=(u,d,h)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:u,...h?{metadata:h}:{}}),d&&window.open(d,"_blank","noopener,noreferrer"),e.onClose();},m=he(o,a,{onCtaClick:(u,d,h)=>{p("cta_clicked",u==="url"?d:void 0,h),u==="guide"&&d&&e.onOpenGuide?.(d);},onDismiss:()=>p("dismissed")});c.appendChild(m),s.appendChild(c),this.liveContainer=c,this.liveContent=m,this.liveKey=`${n}|${l}`,this.liveBuild=u=>he(u,a,{onCtaClick:(d,h,f)=>{p("cta_clicked",d==="url"?h:void 0,f),d==="guide"&&h&&e.onOpenGuide?.(h);},onDismiss:()=>p("dismissed")}),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}liveKeyOf(e){return `${e.selector??""}|${He(e.style)}`}};function Di(t){return t.style?.backdrop===false?"veo-modal-overlay veo-modal-overlay--none":"veo-modal-overlay"}var Xt=class extends J{constructor(){super(...arguments);this.overlay=null;this.releaseScroll=null;}syncScrollLock(o){let n=o.style?.backdrop!==false;n&&!this.releaseScroll?this.releaseScroll=ft(this.host?.ownerDocument??document):!n&&this.releaseScroll&&(this.releaseScroll(),this.releaseScroll=null);}render(o){let n=o.nav?.stepIndex??0,i=o.guide.guideSteps[n];if(!i)return;let{root:r}=this.createHost();this.applyDesign(i.style);let s=r.ownerDocument??document,l=s.createElement("div");l.className=Di(i),this.overlay=l,this.syncScrollLock(i);let a=s.createElement("div");a.className="veo-modal-card";let c=(d,h,f)=>{o.onInteraction({guideId:o.guide.guideId,stepIndex:n,action:d,...f?{metadata:f}:{}}),h&&window.open(h,"_blank","noopener,noreferrer"),o.onClose();},p=()=>{o.nav?o.nav.callbacks.onSkip():c("dismissed");},m=o.nav?Rt(i,o.nav.stepIndex,o.nav.totalSteps,s,o.nav.callbacks):he(i,s,{onCtaClick:(d,h,f)=>{c("cta_clicked",d==="url"?h:void 0,f),d==="guide"&&h&&o.onOpenGuide?.(h);},onDismiss:()=>c("dismissed")});a.appendChild(m),l.appendChild(a),r.appendChild(l),o.nav||(this.liveContainer=a,this.liveContent=m,this.liveBuild=d=>he(d,s,{onCtaClick:(h,f,v)=>{c("cta_clicked",h==="url"?f:void 0,v),h==="guide"&&f&&o.onOpenGuide?.(f);},onDismiss:()=>c("dismissed")})),l.addEventListener("click",d=>{d.target===l&&p();});let u=d=>{d.key==="Escape"&&p();};document.addEventListener("keydown",u),this.registerCleanup(()=>document.removeEventListener("keydown",u)),o.nav||o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:"shown"});}onLiveUpdate(o){this.overlay&&(this.overlay.className=Di(o)),this.syncScrollLock(o);}destroy(){this.overlay=null,this.releaseScroll?.(),this.releaseScroll=null,super.destroy();}};var xo=class extends J{constructor(){super(...arguments);this.side="bottom";this.reposition=null;}async render(o){let n=o.guide.guideSteps[0];if(!n)return;let i=n.selector??o.guide.activationRules.selector;if(typeof i!="string"||i.length===0)return;let r=await re(i);if(!r)return;let s=n.style?.tooltipPlacement;this.side=s==="top"||s==="left"||s==="right"?s:"bottom";let{root:l}=this.createHost();this.applyDesign(n.style);let a=l.ownerDocument??document,c=a.createElement("div");c.className="veo-tooltip";let p=(f,v,x)=>{o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:f,...x?{metadata:x}:{}}),v&&window.open(v,"_blank","noopener,noreferrer"),o.onClose();},m=he(n,a,{onCtaClick:(f,v,x)=>{p("cta_clicked",f==="url"?v:void 0,x),f==="guide"&&v&&o.onOpenGuide?.(v);},onDismiss:()=>p("dismissed")});c.appendChild(m);let u=a.createElement("div");u.className="veo-tooltip-arrow",c.appendChild(u),l.appendChild(c);let d=async()=>{let{x:f,y:v,placement:x,middlewareData:y}=await Be(r,c,{placement:this.side,middleware:[Me(10),Ie(),Pe({padding:8}),ot({element:u})]});c.style.left=`${f}px`,c.style.top=`${v}px`,nt(u,x,y.arrow);};await d();let h=()=>{d();};this.reposition=h,window.addEventListener("scroll",h,true),window.addEventListener("resize",h),this.registerCleanup(()=>{window.removeEventListener("scroll",h,true),window.removeEventListener("resize",h);}),this.liveContainer=c,this.liveContent=m,this.liveKey=i,this.liveBuild=f=>he(f,a,{onCtaClick:(v,x,y)=>{p("cta_clicked",v==="url"?x:void 0,y),v==="guide"&&x&&o.onOpenGuide?.(x);},onDismiss:()=>p("dismissed")}),o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:"shown"});}liveKeyOf(o){return o.selector??""}onLiveUpdate(o){let n=o.style?.tooltipPlacement;this.side=n==="top"||n==="left"||n==="right"?n:"bottom",this.reposition?.();}};var wo=class extends J{async render(e){let o=e.guide.guideSteps[e.currentStepIndex];if(!o)return false;let n=o.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return false;let i=await re(n,5e3);if(!i)return false;let r=o.style?.tooltipPlacement,s=r==="top"||r==="left"||r==="right"?r:"bottom",{root:l}=this.createHost();this.applyDesign(o.style);let a=l.ownerDocument??document,c=a.createElement("div");c.className="veo-walkthrough";let p=Rt(o,e.currentStepIndex,e.guide.guideSteps.length,a,e.callbacks);c.appendChild(p);let m=a.createElement("div");m.className="veo-walkthrough-arrow",c.appendChild(m),l.appendChild(c);let u=async()=>{let{x:h,y:f,placement:v,middlewareData:x}=await Be(i,c,{placement:s,middleware:[Me(10),Ie(),Pe({padding:8}),ot({element:m})]});c.style.left=`${h}px`,c.style.top=`${f}px`,nt(m,v,x.arrow);};await u();let d=()=>{u();};return window.addEventListener("scroll",d,true),window.addEventListener("resize",d),this.registerCleanup(()=>{window.removeEventListener("scroll",d,true),window.removeEventListener("resize",d);}),true}};var Os="__veo_preview__",Qo=class{constructor(){this.singleStep=null;this.walkthrough=null;this.walkthroughGuide=null;this.walkthroughIndex=0;this.input=null;}preview(e){let o=e.guideSteps[0];if(this.singleStep&&this.input&&e.guideType===this.input.guideType&&e.guideType!=="walkthrough"&&e.badgeOpen===true==(this.input.badgeOpen===true)&&o&&this.singleStep.updateStep(o))return this.input=e,{close:()=>this.close(),ready:Promise.resolve({rendered:true}),host:()=>this.activeHost()};this.close(),this.input=e;let n=Gs(e),i=typeof e.startStepIndex=="number"?e.startStepIndex:0;if(n.guideType==="composite"){let s=Math.min(Math.max(0,i),n.guideSteps.length-1),l=n.guideSteps[s];l&&(n.guideSteps=[l]);let a=this.renderSingleStep(n);return {close:()=>this.close(),ready:a,host:()=>this.activeHost()}}let r=n.guideType==="walkthrough"?this.startWalkthrough(n,i):this.renderSingleStep(n);return {close:()=>this.close(),ready:r,host:()=>this.activeHost()}}activeHost(){return this.singleStep?this.singleStep.hostElement():this.walkthrough instanceof J?this.walkthrough.hostElement():null}close(e=false){let o=e?this.input?.onClosed:void 0;this.singleStep&&(ht(this.singleStep),this.singleStep=null),this.walkthrough&&(ht(this.walkthrough),this.walkthrough=null),this.walkthroughGuide=null,this.walkthroughIndex=0,this.input=null,o?.();}async renderSingleStep(e){let o=zs(e.guideType);if(!o)return {rendered:false};this.singleStep=o;let n=false;try{await o.render({guide:e,onInteraction:i=>{i.action==="shown"&&(n=!0);},onClose:()=>this.close(!0),badgeOpen:this.input?.badgeOpen??Ot(this.input?.activationRules),onTrack:()=>{},onOpenGuide:()=>{},onFormSubmit:this.input?.formSubmit??(()=>Promise.resolve(!0)),...this.input?.fetchProgress?{fetchProgress:this.input.fetchProgress}:{},isPreview:!0,...this.input?.formSubmit&&this.input.formSubmitNote!==void 0?{previewNote:this.input.formSubmitNote}:{}});}catch{return this.close(),{rendered:false}}return this.singleStep!==o?(ht(o),{rendered:false}):{rendered:n}}async startWalkthrough(e,o=0){if(e.guideSteps.length===0)return {rendered:false};this.walkthroughGuide=e;let n=Math.min(Math.max(0,Math.floor(o)),e.guideSteps.length-1);return this.walkthroughIndex=n,{rendered:await this.renderWalkthroughStep(n)}}async renderWalkthroughStep(e){let o=this.walkthroughGuide;if(!o)return false;this.walkthrough&&(ht(this.walkthrough),this.walkthrough=null);let n={onNext:()=>{let a=this.walkthroughIndex+1;if(a>=o.guideSteps.length){this.close();return}this.walkthroughIndex=a,this.renderWalkthroughStep(a);},onBack:()=>{let a=this.walkthroughIndex-1;a<0||(this.walkthroughIndex=a,this.renderWalkthroughStep(a));},onSkip:()=>this.close(),onComplete:()=>this.close()},r=o.guideSteps[e]?.style?.render;if(r==="modal"||r==="banner"){let a=r==="modal"?new Xt:new qt;try{a.render({guide:o,onInteraction:()=>{},onClose:()=>this.close(!0),nav:{stepIndex:e,totalSteps:o.guideSteps.length,callbacks:n}});}catch{return ht(a),false}return this.walkthroughGuide!==o?(ht(a),false):(this.walkthrough=a,true)}let s=new wo,l=false;try{l=await s.render({guide:o,currentStepIndex:e,callbacks:n});}catch{l=false;}return !l||this.walkthroughGuide!==o?(ht(s),false):(this.walkthrough=s,true)}},Eo=null;function ko(t){return Ce()?(Eo||(Eo=new Qo),Eo.preview(t)):{close:()=>{},ready:Promise.resolve({rendered:false}),host:()=>null}}function qe(){Eo?.close();}function Gs(t){let e=t.activationRules?.selector,o={url:t.activationRules?.url??{type:"prefix",pattern:"/"},trigger:"immediate",...e!==void 0?{selector:e}:{}};return {guideId:Os,guideName:t.guideName??"Preview",guideType:t.guideType,guideSteps:t.guideSteps,activationRules:o,displayFrequency:"always",displayPriority:0}}function zs(t){switch(t){case "modal":return new Xt;case "banner":return new qt;case "tooltip":return new xo;case "custom":return new ho;case "inline":return new yo;case "inline-custom":return new vo;case "form":return new go;case "inline-form":return new bo;case "badge":return new po;case "composite":return new fo;case "walkthrough":return null;default:return null}}function ht(t){try{t.destroy();}catch{}}function _i(t){let e=[t];try{let o=new URL(t);e.push(`${o.pathname}${o.search}${o.hash}`),o.hash.startsWith("#/")&&e.push(o.hash.slice(1));}catch{}return e}function Fs(t,e){let o=_i(e);switch(t.type){case "exact":return o.some(n=>n===t.pattern);case "prefix":return o.some(n=>n.startsWith(t.pattern));case "regex":try{let n=new RegExp(t.pattern);return o.some(i=>n.test(i))}catch{return false}}}function Oi(t,e){return !t||t.scope==="sitewide"?true:t.scope==="pages"?(t.rules??[]).some(n=>Us(n,e)):t.pattern?Fs({type:t.matchType??"prefix",pattern:t.pattern},e):true}function Us(t,e){let o=t.pattern.toLowerCase(),n=_i(e).map(i=>i.toLowerCase());switch(t.type){case "exact":return n.some(i=>i===o);case "prefix":return n.some(i=>i.startsWith(o));case "contains":return n.some(i=>i.includes(o));case "regex":try{let i=new RegExp(t.pattern,"i");return n.some(r=>i.test(r))}catch{return false}default:return false}}var Mt="veo-builder";var Co=64,So=128,Ws={bolt:'<path stroke-linecap="round" stroke-linejoin="round" d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"/>',desktop:'<path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"/>',updown:'<path stroke-linecap="round" stroke-linejoin="round" d="M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"/>',map:'<path stroke-linecap="round" stroke-linejoin="round" d="M9 6.75V15m6-6v8.25m.503 3.498 4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 0 0-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0Z"/>',eye:'<path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"/><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>',chevronDown:'<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>',chevronUp:'<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 15.75 7.5-7.5 7.5 7.5"/>',plus:'<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/>',pencil:'<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"/>',copy:'<path stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"/>',trash:'<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/>',cursor:'<path stroke-linecap="round" stroke-linejoin="round" d="M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59"/>',spinner:'<path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182"/>'};function ke(t,e=20){return `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true">${Ws[t]}</svg>`}function js(t){if(!t)return "";let e=new Date(t);return Number.isNaN(e.getTime())?"":e.toLocaleDateString("es",{day:"numeric",month:"short"}).replace(".","")}function Q(t,e,o){let n=document.createElement(t);return n.className=e,o!==void 0&&(n.innerHTML=o),n}function en(t,e,o=""){let n=Q("button",`veo-tb-icon ${o}`.trim(),ke(t));return n.type="button",n.title=e,n.setAttribute("aria-label",e),n}function zi(t){if(!ye()||!Ce())return {setState:()=>{},height:()=>0,dock:()=>"top",setPreview:()=>{},setHidden:()=>{},onHeightChange:()=>{},teardown:()=>{}};let e=document.createElement("div");e.setAttribute("data-veo-builder-chrome",""),e.setAttribute("data-veo-ignore","");let o=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=Vs;let i=Q("div","veo-chrome"),r=Q("div","veo-tb"),s=Q("div","veo-tb-brand",ke("bolt",18)),l=Q("div","veo-tb-name"),a=Q("span","veo-tb-status");a.hidden=true;let c=Q("span","veo-tb-sep"),p=Q("div","veo-tb-app",`${ke("desktop",16)}<span></span>`);p.querySelector("span").textContent=t.appLabel;let m=Q("div","veo-tb-left");m.append(s,l,a,c,p);let u=Q("div","veo-tb-right"),d=en("updown","Mover la barra abajo"),h=en("map","Mostrar el editor"),f=en("eye","Vista previa"),v=Q("button","veo-tb-text","Salir");v.type="button";let x=Q("div","veo-tb-save"),y=Q("button","veo-tb-save-main","<span>Guardar</span>");y.type="button";let w=Q("button","veo-tb-save-more",ke("chevronDown",16));w.type="button",w.title="M\xE1s opciones de guardado",w.setAttribute("aria-label","M\xE1s opciones de guardado");let b=Q("div","veo-tb-menu"),C=Q("button","veo-tb-menu-item","Guardar y salir");C.type="button",b.append(C),b.hidden=true,x.append(y,w,b),u.append(d,h,f,Q("span","veo-tb-vsep"),v,x),r.append(m,u);let L=Q("div","veo-steps"),A=Q("div","veo-steps-list");L.append(A);let D=Q("button","veo-steps-toggle");D.type="button",i.append(r,L,D);let O=Q("div","veo-preview-pill"),ee=Q("span","veo-preview-label",`${ke("eye",18)}<span>Est\xE1s en vista previa</span>`),B=Q("button","veo-preview-exit","Salir");B.type="button",O.append(ee,B),O.hidden=true,o.append(n,i,O),document.body.appendChild(e);let te=document.documentElement,se=te.style.marginTop,oe=te.style.marginBottom,ie=false,q="top",Z=false,ne=false,ae=null,be=()=>Co+(ie?0:So),$e=()=>{let _=Z||ne?0:be();te.style.marginTop=q==="top"?`${_}px`:se,te.style.marginBottom=q==="bottom"?`${_}px`:oe,i.style.setProperty("--veo-chrome-h",`${be()}px`),i.classList.toggle("is-bottom",q==="bottom"),L.hidden=ie;let rt=q==="top"?"chevronUp":"chevronDown",Oe=q==="top"?"chevronDown":"chevronUp";D.innerHTML=`<span>${ie?"Mostrar pasos":"Ocultar pasos"}</span>${ke(ie?Oe:rt,16)}`,d.title=q==="top"?"Mover la barra abajo":"Mover la barra arriba",d.setAttribute("aria-label",d.title),ae?.(_);},Bt=_=>{Z=_,i.hidden=_||ne,O.hidden=!_,$e();},De=_=>{ne=_,i.hidden=_||Z,$e();};D.addEventListener("click",()=>{ie=!ie,$e();});let le=_=>t.onAction(_);d.addEventListener("click",()=>{q=q==="top"?"bottom":"top",$e(),le({action:"dock",position:q});}),h.addEventListener("click",()=>le({action:"show-panel"})),f.addEventListener("click",()=>le({action:"preview"})),B.addEventListener("click",()=>le({action:"exit-preview"})),v.addEventListener("click",()=>le({action:"exit"})),y.addEventListener("click",()=>le({action:"save",exit:false})),w.addEventListener("click",_=>{_.stopPropagation(),b.hidden=!b.hidden;}),C.addEventListener("click",()=>{b.hidden=true,le({action:"save",exit:true});});let _e=()=>{b.hidden=true;};document.addEventListener("click",_e);let Nt=null,Po=()=>{let _=Nt;if(!_)return;let rt=js(_.createdAt);l.textContent=`${_.guideName.trim()||"Sin nombre"}${rt?` \xB7 ${rt}`:""}`,_.status?(a.hidden=false,a.textContent=_.status.label,a.dataset.tone=_.status.tone,a.title="Estado de la gu\xEDa (se cambia desde la lista de gu\xEDas)"):a.hidden=true,y.innerHTML=_.saving?`${ke("spinner",16)}<span>Guardando\u2026</span>`:"<span>Guardar</span>",y.disabled=_.saving,C.disabled=_.saving,A.replaceChildren();let Oe=Gi(ke("cursor",22),"Activaci\xF3n",_.section==="activation");Oe.addEventListener("click",()=>le({action:"select-activation"})),A.append(Oe),_.steps.forEach((Ht,ze)=>{let st=Ht.presentation==="inline"?'<div class="veo-thumb veo-thumb-inline"><i></i><i></i><i></i></div>':'<div class="veo-thumb"><i></i><i></i><b></b></div>',Zt=_.section==="step"||_.section==="block"||_.section==="add-block"||_.section==="row"||_.section==="structure",$t=Gi(st,Ht.label,Zt&&_.activeStep===ze,{canRemove:true,onEdit:()=>le({action:"select-step",index:ze}),onDuplicate:()=>le({action:"duplicate-step",index:ze}),onRemove:()=>le({action:"remove-step",index:ze})});A.append($t);});let Ge=Q("button","veo-step-add",`${ke("plus",18)}<span>Agregar paso</span>`);Ge.type="button",Ge.addEventListener("click",()=>le({action:"add-step"})),A.append(Ge);};return $e(),{setState:_=>{Nt=_,Po();},height:be,dock:()=>q,setPreview:Bt,setHidden:De,onHeightChange:_=>{ae=_;},teardown:()=>{document.removeEventListener("click",_e),te.style.marginTop=se,te.style.marginBottom=oe,e.remove();}}}function Gi(t,e,o,n){let i=`veo-step${o?" is-active":""}`;if(!n){let a=Q("button",i,`<div class="veo-step-box">${t}</div><span class="veo-step-label"></span>`);return a.type="button",a.querySelector(".veo-step-label").textContent=e,a.setAttribute("aria-pressed",o?"true":"false"),a}let r=Q("div",i,`<div class="veo-step-box">${t}<div class="veo-step-hover"><div class="veo-step-hover-top"><button type="button" class="veo-step-icon veo-step-remove" title="Eliminar paso" aria-label="Eliminar paso">${ke("trash",14)}</button><button type="button" class="veo-step-icon veo-step-duplicate" title="Duplicar paso" aria-label="Duplicar paso">${ke("copy",14)}</button></div><div class="veo-step-hover-main"><button type="button" class="veo-step-edit">${ke("pencil",14)}<span>Editar</span></button></div></div></div><span class="veo-step-label"></span>`);r.querySelector(".veo-step-label").textContent=e,r.setAttribute("aria-current",o?"step":"false");let s=r.querySelector(".veo-step-remove");s.disabled=!n.canRemove,n.canRemove||(s.title="La gu\xEDa necesita al menos un paso");let l=(a,c)=>{r.querySelector(a)?.addEventListener("click",p=>{p.stopPropagation(),c();});};return l(".veo-step-edit",n.onEdit),l(".veo-step-duplicate",n.onDuplicate),l(".veo-step-remove",n.onRemove),r.addEventListener("click",n.onEdit),r}var Vs=`
638
+ `;var J=class{constructor(){this.host=null;this.shadow=null;this.cleanups=[];this.liveContainer=null;this.liveContent=null;this.liveBuild=null;this.liveKey="";}liveKeyOf(e){return ""}onLiveUpdate(e){}updateStep(e){if(!this.host||!this.liveContainer||!this.liveContent||!this.liveBuild||this.liveKeyOf(e)!==this.liveKey)return false;let o=this.liveBuild(e);return this.liveContainer.replaceChild(o,this.liveContent),this.liveContent=o,this.applyDesign(e.style),this.onLiveUpdate(e),true}createHost(){let e=document.createElement("div");e.setAttribute(Bn,"");let o=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=co,o.appendChild(n);let i=document.createElement("div");return o.appendChild(i),document.body.appendChild(e),this.host=e,this.shadow=o,{host:e,shadow:o,root:i}}applyDesign(e){this.host&&fi(this.host,e);}registerCleanup(e){this.cleanups.push(e);}hostElement(){return this.host}destroy(){for(let e of this.cleanups)try{e();}catch{}this.cleanups=[],this.host?.parentNode&&this.host.parentNode.removeChild(this.host),this.host=null,this.shadow=null;}};var gs={top:"bottom",bottom:"top",left:"right",right:"left"};function nt(t,e,o){let n=gs[e.split("-")[0]??"bottom"]??"top";for(let i of ["top","bottom","left","right"])t.style.setProperty(i,"");o?.x!=null&&t.style.setProperty("left",`${o.x}px`),o?.y!=null&&t.style.setProperty("top",`${o.y}px`),t.style.setProperty(n,"-6px");}var hs=150,po=class extends J{constructor(){super(...arguments);this.tooltip=null;this.arrowEl=null;this.badgeBtn=null;this.open=false;this.shownEmitted=false;this.trigger="hover";this.side="top";this.closeTimer=null;this.stopFloat=null;}async render(o){let n=o.guide.guideSteps[0];if(!n)return;let i=n.selector??o.guide.activationRules.selector;if(typeof i!="string"||i.length===0)return;let r=await re(i);if(!r)return;let{host:s,root:l}=this.createHost(),a=l.ownerDocument??document;this.applyDesign(n.style);let c=n.style?.width;typeof c=="number"&&Number.isFinite(c)&&s.style.setProperty("--veo-badge-tip-width",`${Math.min(720,Math.max(220,c))}px`),this.trigger=n.style?.badgeTrigger==="click"?"click":"hover";let p=n.style?.tooltipPlacement;this.side=p==="bottom"||p==="left"||p==="right"?p:"top";let m=He(n.style);s.style.display="inline-flex",s.style.verticalAlign="middle";let u=hi(gi(n),a);l.appendChild(u),this.badgeBtn=u,ve(r,s,m),this.registerCleanup(xe(s,i,m));let d=a.createElement("div");d.className="veo-tooltip veo-badge-tooltip",d.style.display="none";let g=(b,C)=>{o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:b,...C?{metadata:C}:{}});},f=b=>ge(b,a,{onCtaClick:(C,L,A)=>{g("cta_clicked",A),C==="url"&&L&&window.open(L,"_blank","noopener,noreferrer"),this.closeTooltip(),C==="guide"&&L&&o.onOpenGuide?.(L);},onDismiss:()=>this.closeTooltip()}),v=f(n);d.appendChild(v);let x=a.createElement("div");x.className="veo-tooltip-arrow",d.appendChild(x),l.appendChild(d),this.tooltip=d,this.arrowEl=x,this.liveContainer=d,this.liveContent=v,this.liveKey=this.liveKeyOf(n),this.liveBuild=f;let y=()=>{this.cancelClose(),this.open||(this.openTooltip(u),this.shownEmitted||(this.shownEmitted=true,g("shown")));};if(this.trigger==="hover"){let b=()=>{this.cancelClose(),this.closeTimer=window.setTimeout(()=>this.closeTooltip(),hs);};u.addEventListener("mouseenter",y),u.addEventListener("focus",y),u.addEventListener("mouseleave",b),u.addEventListener("blur",b),d.addEventListener("mouseenter",()=>this.cancelClose()),d.addEventListener("mouseleave",b);}else {u.addEventListener("click",()=>{this.open?this.closeTooltip():y();});let b=C=>{this.open&&(C.composedPath().includes(s)||this.closeTooltip());};document.addEventListener("click",b,true),this.registerCleanup(()=>document.removeEventListener("click",b,true));}let w=b=>{b.key==="Escape"&&this.open&&this.closeTooltip();};document.addEventListener("keydown",w),this.registerCleanup(()=>document.removeEventListener("keydown",w)),o.isPreview&&y();}liveKeyOf(o){let n=o.selector??"",i=He(o.style),r=o.style?.badgeTrigger==="click"?"click":"hover";return `${n}|${i}|${r}`}onLiveUpdate(o){if(this.badgeBtn){let i=this.badgeBtn.ownerDocument,r=hi(gi(o),i);this.badgeBtn.className=r.className,this.badgeBtn.setAttribute("style",r.getAttribute("style")??""),this.badgeBtn.replaceChildren(...Array.from(r.childNodes));}let n=o.style?.tooltipPlacement;this.side=n==="bottom"||n==="left"||n==="right"?n:"top",this.open&&this.badgeBtn&&this.position(this.badgeBtn);}destroy(){this.cancelClose(),this.stopFloat?.(),this.stopFloat=null,this.tooltip=null,this.arrowEl=null,this.badgeBtn=null,this.open=false,super.destroy();}openTooltip(o){if(!this.tooltip)return;this.tooltip.style.display="block",this.open=true,this.position(o);let n=()=>{this.position(o);};window.addEventListener("scroll",n,true),window.addEventListener("resize",n),this.stopFloat=()=>{window.removeEventListener("scroll",n,true),window.removeEventListener("resize",n);};}closeTooltip(){this.cancelClose(),!(!this.tooltip||!this.open)&&(this.tooltip.style.display="none",this.open=false,this.stopFloat?.(),this.stopFloat=null);}cancelClose(){this.closeTimer!==null&&(window.clearTimeout(this.closeTimer),this.closeTimer=null);}async position(o){let n=this.tooltip,i=this.arrowEl;if(!n||!i)return;let{x:r,y:s,placement:l,middlewareData:a}=await Be(o,n,{strategy:"fixed",placement:this.side,middleware:[Re(8),Ie(),Pe({padding:8}),ot({element:i})]});n.style.left=`${r}px`,n.style.top=`${s}px`,nt(i,l,a.arrow);}};function gi(t){let e=t.style?.badge;if(!e||typeof e!="object")return {kind:"icon"};let o=e;return {kind:o.kind==="dot"||o.kind==="pill"||o.kind==="text"||o.kind==="image"||o.kind==="icon"?o.kind:"icon",icon:typeof o.icon=="string"?o.icon:null,text:typeof o.text=="string"?o.text:null,imageUrl:typeof o.imageUrl=="string"?o.imageUrl:null,color:typeof o.color=="string"&&Ne.test(o.color.trim())?o.color.trim():null,size:typeof o.size=="number"&&Number.isFinite(o.size)?o.size:null}}function Vt(t,e,o){return Math.min(o,Math.max(e,t))}function hi(t,e){let o=e.createElement("button");o.type="button",o.className=`veo-badge veo-badge--${t.kind}`,o.setAttribute("aria-label","M\xE1s informaci\xF3n");let n=Vt(t.size??18,8,48);switch(t.kind){case "dot":o.style.width=`${n}px`,o.style.height=`${n}px`,t.color&&(o.style.background=t.color);break;case "pill":{o.textContent=t.text?.slice(0,24)||"Nuevo",o.style.fontSize=`${Vt(Math.round(n*.62),8,24)}px`,t.color&&(o.style.background=t.color);break}case "text":{o.textContent=t.text?.slice(0,32)||"Nuevo",o.style.fontSize=`${Vt(Math.round(n*.7),9,28)}px`,t.color&&(o.style.color=t.color);break}case "image":{if(t.imageUrl&&me(t.imageUrl)){let i=e.createElement("img");i.src=t.imageUrl,i.alt="",i.style.width=`${n}px`,i.style.height=`${n}px`,o.appendChild(i);}else o.className="veo-badge veo-badge--icon",o.textContent="?",o.style.width=`${n}px`,o.style.height=`${n}px`,o.style.fontSize=`${Vt(Math.round(n*.62),8,32)}px`;break}default:{o.textContent=(t.icon||"\u2139\uFE0F").slice(0,4),o.style.width=`${n}px`,o.style.height=`${n}px`,o.style.fontSize=`${Vt(Math.round(n*.62),8,32)}px`,t.color&&(o.style.color=t.color);break}}return o}function Mt(t,e,o,n,i){let r=n.createElement("div");r.className="veo-guide-content";let s=n.createElement("div");s.className="veo-walkthrough-counter",s.textContent=`Paso ${e+1} de ${o}`,r.appendChild(s);let l=n.createElement("div");l.className="veo-walkthrough-progress";for(let g=0;g<o;g++){let f=n.createElement("span");f.className="veo-walkthrough-progress-dot",g<e&&f.classList.add("completed"),g===e&&f.classList.add("active"),l.appendChild(f);}r.appendChild(l);for(let g of Dn(t,n))r.appendChild(g);let a=n.createElement("div");a.className="veo-walkthrough-actions";let c=n.createElement("button");c.type="button",c.className="veo-walkthrough-skip",c.textContent="Omitir",c.addEventListener("click",()=>i.onSkip()),a.appendChild(c);let p=n.createElement("div");if(p.className="veo-walkthrough-actions-right",e>0){let g=n.createElement("button");g.type="button",g.className="veo-walkthrough-btn-secondary",g.textContent="Atr\xE1s",g.addEventListener("click",()=>i.onBack()),p.appendChild(g);}let m=e===o-1,u=n.createElement("button");u.type="button",u.className="veo-guide-cta";let d=m?"Finalizar":"Siguiente";return u.textContent=typeof t.ctaText=="string"&&t.ctaText?t.ctaText:d,u.addEventListener("click",()=>{m?i.onComplete():i.onNext();}),p.appendChild(u),a.appendChild(p),r.appendChild(a),r.appendChild(at(n,()=>i.onSkip())),r}var qt=class extends J{async render(e){let o=e.nav?.stepIndex??0,n=e.guide.guideSteps[o];if(!n)return;let i=n.style?.position==="bottom"?"bottom":"top",r=n.selector?.trim()||null,s=null;if(r&&(s=await re(r),!s))return;let{host:l,root:a}=this.createHost();this.applyDesign(n.style);let c=a.ownerDocument??document,p=c.createElement("div");p.className=vi(i,!!s);let m=(d,g,f)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:o,action:d,...f?{metadata:f}:{}}),g&&window.open(g,"_blank","noopener,noreferrer"),e.onClose();},u=e.nav?Mt(n,e.nav.stepIndex,e.nav.totalSteps,c,e.nav.callbacks):ge(n,c,{onCtaClick:(d,g,f)=>{m("cta_clicked",d==="url"?g:void 0,f),d==="guide"&&g&&e.onOpenGuide?.(g);},onDismiss:()=>m("dismissed")});if(p.appendChild(u),a.appendChild(p),r&&s){l.style.display="block";let d=i==="top"?"prepend":"append";ve(s,l,d),this.registerCleanup(xe(l,r,d));}e.nav||(this.liveContainer=p,this.liveContent=u,this.liveBuild=d=>ge(d,c,{onCtaClick:(g,f,v)=>{m("cta_clicked",g==="url"?f:void 0,v),g==="guide"&&f&&e.onOpenGuide?.(f);},onDismiss:()=>m("dismissed")}),this.liveKey=this.liveKeyOf(n),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"}));}liveKeyOf(e){let o=e.selector?.trim()??"";if(!o)return "";let n=e.style?.position==="bottom"?"bottom":"top";return `${o}|${n}`}onLiveUpdate(e){if(this.liveContainer){let o=e.style?.position==="bottom"?"bottom":"top",n=!!e.selector?.trim();this.liveContainer.className=vi(o,n);}}};function vi(t,e){return e?"veo-banner veo-banner-embedded":`veo-banner veo-banner-${t}`}var Ve={iconEmptyColor:"#e7e2de",iconFillColor:"#406a31",barColor:"#406a31",barHeight:8,fontSize:14,fontWeight:600,titleColor:"#2c2825",subtitleColor:"#8a8582",subtitleTemplate:"Completado <%= currentStep %> de <%= totalSteps %> pasos"},bi={regular:400,medium:500,semibold:600,bold:700};function vs(t){let e=t??{},o=(l,a)=>typeof e[l]=="string"&&e[l].trim()?e[l]:a,n=(l,a,c,p)=>typeof e[l]=="number"&&Number.isFinite(e[l])?Math.min(p,Math.max(c,e[l])):a,i=e.fontWeight,r=typeof i=="number"?Math.min(900,Math.max(100,i)):typeof i=="string"&&bi[i.toLowerCase()]?bi[i.toLowerCase()]:Ve.fontWeight,s=e.colorMode==="dark";return {colorMode:s?"dark":"light",iconEmptyColor:o("iconEmptyColor",s?"#3c3734":Ve.iconEmptyColor),iconFillColor:o("iconFillColor",Ve.iconFillColor),barColor:o("barColor",Ve.barColor),barHeight:n("barHeight",Ve.barHeight,2,40),fontSize:n("fontSize",Ve.fontSize,10,40),fontWeight:r,titleColor:o("titleColor",s?"#f5efeb":Ve.titleColor),subtitleColor:o("subtitleColor",s?"#b0a9a5":Ve.subtitleColor),subtitleTemplate:o("subtitleTemplate",Ve.subtitleTemplate)}}function bs(t,e){return t.replace(/<%=\s*currentStep\s*%>/g,String(e.currentStep)).replace(/<%=\s*totalSteps\s*%>/g,String(e.totalSteps))}var Ko=10,yi=2*Math.PI*Ko;function ys(t,e,o,n){let i="http://www.w3.org/2000/svg",r=t.createElementNS(i,"svg");r.setAttribute("viewBox","0 0 28 28"),r.setAttribute("class","veo-checklist-ring"),r.setAttribute("aria-hidden","true");let s=t.createElementNS(i,"circle");if(s.setAttribute("cx","14"),s.setAttribute("cy","14"),s.setAttribute("r",String(Ko)),s.setAttribute("fill",o?n.iconFillColor:"none"),s.setAttribute("stroke",n.iconEmptyColor),s.setAttribute("stroke-width","4.5"),r.appendChild(s),o){let a=t.createElementNS(i,"path");return a.setAttribute("d","M9 14.5l3.2 3.2L19 11"),a.setAttribute("fill","none"),a.setAttribute("stroke","#fff"),a.setAttribute("stroke-width","2.4"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),r.appendChild(a),r}let l=Math.max(0,Math.min(1,e));if(l>0){let a=t.createElementNS(i,"circle");a.setAttribute("cx","14"),a.setAttribute("cy","14"),a.setAttribute("r",String(Ko)),a.setAttribute("fill","none"),a.setAttribute("stroke",n.iconFillColor),a.setAttribute("stroke-width","4.5"),a.setAttribute("stroke-linecap","butt"),a.setAttribute("stroke-dasharray",`${(yi*l).toFixed(2)} ${yi.toFixed(2)}`),a.setAttribute("transform","rotate(-90 14 14)"),r.appendChild(a);}return r}function xi(t,e,o){let n=vs(t.style),i=(t.items??[]).filter(g=>g&&typeof g.guideId=="string"&&g.guideId),r=e.createElement("div");if(r.className=`veo-checklist${n.colorMode==="dark"?" veo-checklist--dark":""}`,r.style.setProperty("--veo-cl-font-size",`${n.fontSize}px`),r.style.setProperty("--veo-cl-font-weight",String(n.fontWeight)),r.style.setProperty("--veo-cl-title",n.titleColor),r.style.setProperty("--veo-cl-subtitle",n.subtitleColor),r.style.setProperty("--veo-cl-bar",n.barColor),r.style.setProperty("--veo-cl-bar-h",`${n.barHeight}px`),typeof t.html=="string"&&t.html||typeof t.text=="string"&&t.text){let g=e.createElement("div");g.className="veo-checklist-title",typeof t.html=="string"&&t.html?g.appendChild(xt(t.html,e)):g.textContent=t.text,r.appendChild(g);}let s=e.createElement("div");s.className="veo-checklist-items",s.setAttribute("role","list"),r.appendChild(s);let l=e.createElement("div");l.className="veo-checklist-footer";let a=e.createElement("div");a.className="veo-checklist-summary";let c=e.createElement("span");c.className="veo-checklist-count";let p=e.createElement("span");p.className="veo-checklist-percent",a.append(c,p);let m=e.createElement("div");m.className="veo-checklist-bar";let u=e.createElement("div");u.className="veo-checklist-bar-fill",m.appendChild(u),l.append(a,m),r.appendChild(l);let d=g=>{s.textContent="";let f=g?i.filter(w=>g.has(w.guideId)):i,v=0;for(let w of f){let b=g?.get(w.guideId)??null;b?.completed&&v++;let C=e.createElement("button");C.type="button",C.className=`veo-checklist-item${b?.completed?" veo-checklist-item--done":""}`,C.setAttribute("role","listitem");let L=b&&b.totalSteps>0?b.currentStep/b.totalSteps:0;C.appendChild(ys(e,L,b?.completed===true,n));let A=e.createElement("span");A.className="veo-checklist-texts";let D=e.createElement("span");if(D.className="veo-checklist-label",D.textContent=(w.text??"").trim()||b?.guideName||"Gu\xEDa",b&&b.published===false&&(C.title="Gu\xEDa no publicada: los usuarios no la ver\xE1n"),A.appendChild(D),b){let O=e.createElement("span");O.className="veo-checklist-sub",O.textContent=bs(n.subtitleTemplate,b),A.appendChild(O);}C.appendChild(A),C.addEventListener("click",O=>{if(O.preventDefault(),O.stopPropagation(),o.isPreview)return;let ee=b&&!b.completed?Math.min(b.currentStep,b.totalSteps-1):0;o.onOpenGuideAt?o.onOpenGuideAt(w.guideId,ee):o.onOpenGuide?.(w.guideId);}),s.appendChild(C);}let x=f.length,y=x>0?Math.round(v/x*100):0;c.textContent=`${v} de ${x} ${x===1?"completada":"completadas"}`,p.textContent=`${y}%`,u.style.width=`${y}%`,l.hidden=x===0;};if(o.isPreview&&i.length===0){let g=new Map([["__sample_1",{guideId:"__sample_1",guideName:"Configura tu primer env\xEDo",totalSteps:2,currentStep:1,completed:false}],["__sample_2",{guideId:"__sample_2",guideName:"Conecta tu tienda",totalSteps:2,currentStep:2,completed:true}]]);i.push({guideId:"__sample_1",text:"Configura tu primer env\xEDo"},{guideId:"__sample_2",text:"Conecta tu tienda"}),d(g);let f=e.createElement("p");return f.className="veo-checklist-empty",f.textContent="Ejemplo: agrega gu\xEDas a la lista desde Opciones.",r.appendChild(f),r}return d(null),o.fetchProgress&&i.length>0&&o.fetchProgress(i.map(g=>g.guideId)).then(g=>d(new Map(g.map(f=>[f.guideId,f])))).catch(()=>{}),r}function uo(t,e,o){let n=e.guide.guideSteps[0];if(!n)return;let i=n.fields??[],r=()=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"dismissed"}),e.onClose();},s=o.createElement("div");if(s.className="veo-guide-content",n.title){let u=o.createElement("h2");u.className="veo-guide-title",u.textContent=n.title,s.appendChild(u);}if(n.content){let u=o.createElement("p");u.className="veo-guide-text",u.textContent=n.content,s.appendChild(u);}let l=[],a=o.createElement("form");a.className="veo-form",a.noValidate=true;for(let u of i){let{wrapper:d,read:g}=Xo(u,o);l.push({field:u,read:g}),a.appendChild(d);}let c=o.createElement("p");c.className="veo-form-error",c.style.display="none",a.appendChild(c);let p=o.createElement("div");p.className="veo-guide-actions";let m=o.createElement("button");m.type="submit",m.className="veo-guide-cta",m.textContent=n.ctaText||"Enviar",p.appendChild(m),a.appendChild(p),a.addEventListener("submit",u=>{u.preventDefault(),c.style.display="none";let d={};for(let{field:f,read:v}of l){let x=v();if(x==null||x===""){if(f.required){c.textContent=`Completa "${f.label}"`,c.style.display="block";return}continue}d[f.key]=x;}if(Object.keys(d).length===0){c.textContent="Responde al menos un campo",c.style.display="block";return}m.disabled=true,(e.onFormSubmit??(()=>Promise.resolve(true)))(d).then(f=>{if(!f){m.disabled=false,c.textContent="No se pudo enviar. Prueba de nuevo.",c.style.display="block";return}e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"completed"});let v=e.isPreview?e.previewNote??"Vista previa: la respuesta NO se guard\xF3.":null;xs(t,o,v),window.setTimeout(()=>e.onClose(),v?2200:1400);});}),s.appendChild(a),s.appendChild(at(o,r)),t.appendChild(s);}function xs(t,e,o){for(;t.firstChild;)t.removeChild(t.firstChild);let n=e.createElement("div");if(n.className="veo-form-thanks",n.textContent="\u2713 \xA1Gracias por tu respuesta!",t.appendChild(n),o){let i=e.createElement("p");i.className="veo-form-preview-note",i.textContent=o,t.appendChild(i);}}function Xo(t,e){let o=e.createElement("div");o.className="veo-form-field";let n=e.createElement("label");switch(n.className="veo-form-label",n.textContent=t.required?`${t.label} *`:t.label,o.appendChild(n),t.type){case "textarea":{let i=e.createElement("textarea");return i.className="veo-form-input",i.rows=3,t.placeholder&&(i.placeholder=t.placeholder),o.appendChild(i),{wrapper:o,read:()=>i.value.trim()}}case "number":{let i=e.createElement("input");return i.type="number",i.className="veo-form-input",t.placeholder&&(i.placeholder=t.placeholder),o.appendChild(i),{wrapper:o,read:()=>i.value.trim()===""?void 0:Number(i.value)}}case "select":{let i=e.createElement("select");i.className="veo-form-input";let r=e.createElement("option");r.value="",r.textContent=t.placeholder||"Elige una opci\xF3n\u2026",i.appendChild(r);for(let s of t.options??[]){let l=e.createElement("option");l.value=s,l.textContent=s,i.appendChild(l);}return o.appendChild(i),{wrapper:o,read:()=>i.value||void 0}}case "radio":{let i=e.createElement("div");i.className="veo-form-options";let r=`veo-${t.key}`,s=[];for(let l of t.options??[]){let a=e.createElement("label");a.className="veo-form-option";let c=e.createElement("input");c.type="radio",c.name=r,c.value=l,s.push(c);let p=e.createElement("span");p.textContent=l,a.appendChild(c),a.appendChild(p),i.appendChild(a);}return o.appendChild(i),{wrapper:o,read:()=>s.find(l=>l.checked)?.value}}case "multiselect":{let i=e.createElement("div");i.className="veo-form-options";let r=[];for(let s of t.options??[]){let l=e.createElement("label");l.className="veo-form-option";let a=e.createElement("input");a.type="checkbox",a.value=s,r.push(a);let c=e.createElement("span");c.textContent=s,l.appendChild(a),l.appendChild(c),i.appendChild(l);}return o.appendChild(i),{wrapper:o,read:()=>{let s=r.filter(l=>l.checked).map(l=>l.value);return s.length>0?s:void 0}}}case "checkbox":{let i=e.createElement("label");i.className="veo-form-option";let r=e.createElement("input");r.type="checkbox";let s=e.createElement("span");return s.textContent=t.placeholder||"S\xED",i.appendChild(r),i.appendChild(s),o.appendChild(i),{wrapper:o,read:()=>r.checked?true:t.required?"":false}}case "yesno":{let i=e.createElement("div");i.className="veo-form-options";let r=`veo-${t.key}`,[s,l]=t.options?.length===2?t.options:["S\xED","No"],a=[];for(let{label:c,value:p}of [{label:s,value:true},{label:l,value:false}]){let m=e.createElement("label");m.className="veo-form-option";let u=e.createElement("input");u.type="radio",u.name=r,a.push({input:u,value:p});let d=e.createElement("span");d.textContent=c,m.appendChild(u),m.appendChild(d),i.appendChild(m);}return o.appendChild(i),{wrapper:o,read:()=>a.find(c=>c.input.checked)?.value}}case "nps":{let i=typeof t.min=="number"?t.min:0,r=typeof t.max=="number"&&t.max>i?t.max:10;return wi(o,e,i,r,"veo-nps-btn",void 0,{labels:t.scaleLabels??[],showLabels:t.showLabels!==false})}case "rating":return wi(o,e,1,5,"veo-rating-btn","\u2605");default:{let i=e.createElement("input");return i.type="text",i.className="veo-form-input",t.placeholder&&(i.placeholder=t.placeholder),o.appendChild(i),{wrapper:o,read:()=>i.value.trim()}}}}function wi(t,e,o,n,i,r,s={labels:[],showLabels:false}){let l=e.createElement("div");l.className="veo-form-scale";let a,c=[],p=u=>s.labels[u-o]?.trim()??"",m=s.showLabels&&Array.from({length:n-o+1},(u,d)=>o+d).some(u=>p(u));for(let u=o;u<=n;u++){let d=e.createElement("button");d.type="button",d.className=i,d.textContent=r??String(u);let g=p(u);if(d.setAttribute("aria-label",g?`${u} \xB7 ${g}`:String(u)),g&&(d.title=g),d.addEventListener("click",()=>{a=u,c.forEach((x,y)=>{let w=r?y+o<=u:y+o===u;x.classList.toggle("veo-scale-active",w);});}),c.push(d),!m){l.appendChild(d);continue}let f=e.createElement("div");f.className=`veo-scale-item${u===o?" veo-scale-item--first":u===n?" veo-scale-item--last":""}`;let v=e.createElement("span");v.className="veo-scale-label",v.textContent=g,f.append(d,v),l.appendChild(f);}return t.appendChild(l),{wrapper:t,read:()=>a}}function Kt(t){let e=new Map,o=[],n=-1;return t.forEach((i,r)=>{if(!i)return;let s;typeof i.row=="number"&&Number.isFinite(i.row)?(s=i.row,n=s):(s=n+.5,n=s);let l=typeof i.col=="number"&&Number.isFinite(i.col)?i.col:0,a=e.get(s);a||(a={row:s,columns:[]},e.set(s,a),o.push(s));let c=a.columns.find(p=>p.col===l);c||(c={col:l,blocks:[]},a.columns.push(c)),c.blocks.push({block:i,index:r});}),o.sort((i,r)=>i-r).map(i=>{let r=e.get(i);return r.columns.sort((s,l)=>s.col-l.col),r})}var mo=new WeakMap;function ft(t=document){let e=t.documentElement,o=t.body;if(!e||!o)return ()=>{};let n=mo.get(t);if(!n){n={count:0,html:{overflow:e.style.overflow,paddingRight:e.style.paddingRight},body:{overflow:o.style.overflow,paddingRight:o.style.paddingRight}},mo.set(t,n);let r=t.defaultView,s=r?Math.max(0,r.innerWidth-e.clientWidth):0;s>0&&(o.style.paddingRight=`${s}px`),e.style.overflow="hidden",o.style.overflow="hidden";}n.count+=1;let i=false;return ()=>{if(i)return;i=true;let r=mo.get(t);r&&(r.count-=1,!(r.count>0)&&(mo.delete(t),e.style.overflow=r.html.overflow,e.style.paddingRight=r.html.paddingRight,o.style.overflow=r.body.overflow,o.style.paddingRight=r.body.paddingRight));}}var ws=t=>`veo:snooze:${t}`,Ei={hour:36e5,day:864e5,week:6048e5};function Es(t,e){return (Number.isFinite(t)&&t>0?Math.floor(t):1)*(Ei[e]??Ei.day)}function ki(t,e,o,n=Date.now()){try{localStorage.setItem(ws(t),String(n+Es(e,o)));}catch{}}var Ci="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021",Si="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75",Li="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z",Yo="M21 12a9 9 0 11-18 0 9 9 0 0118 0z",ks="M7.5 3.75H6A2.25 2.25 0 0 0 3.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0 1 20.25 6v1.5m0 9V18A2.25 2.25 0 0 1 18 20.25h-1.5m-9 0H6A2.25 2.25 0 0 1 3.75 18v-1.5M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z",Zo={info:{paths:[Yo,Ci],dots:[[12,8.25]]},exclamation:{paths:[Yo,"M12 8v4.5"],dots:[[12,15.75]]},question:{paths:[Yo,Si],dots:[[12,17.25]]},star:{paths:[Li]},"info-solid":{paths:[Ci],dots:[[12,8.25]],solid:true,scale:.8},"exclamation-solid":{paths:["M12 8v4.5"],dots:[[12,15.75]],solid:true,scale:.8},"question-solid":{paths:[Si],dots:[[12,17.25]],solid:true,scale:.8},"star-solid":{paths:[Li],solid:true,scale:.55},"target-solid":{paths:[ks],solid:true,scale:.6},new:{paths:[],text:"New"}},Cs=14,Ss=19e3,Ti=8;function it(t,e){return typeof t=="number"&&Number.isFinite(t)?t:e}function Ai(t,e,o,n){let i=Zo[e]??Zo.info;if(i.text){let c=t.createElement("span");return c.textContent=i.text,c.style.font=`700 ${Math.round(o*.85)}px/1 system-ui, -apple-system, sans-serif`,c.style.color=n,c}let r="http://www.w3.org/2000/svg",s=t.createElementNS(r,"svg");s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("width",String(o)),s.setAttribute("height",String(o)),s.setAttribute("fill","none"),s.setAttribute("aria-hidden","true");let l=i.solid?"#ffffff":n;if(i.solid){let c=t.createElementNS(r,"circle");c.setAttribute("cx","12"),c.setAttribute("cy","12"),c.setAttribute("r","12"),c.setAttribute("fill",n),s.appendChild(c);}let a=t.createElementNS(r,"g");if(a.setAttribute("stroke",l),a.setAttribute("stroke-width",i.solid?"2":"1.8"),a.setAttribute("stroke-linecap","round"),a.setAttribute("stroke-linejoin","round"),i.scale&&i.scale!==1){let c=i.scale,p=12-12*c;a.setAttribute("transform",`translate(${p} ${p}) scale(${c})`);}for(let c of i.paths){let p=t.createElementNS(r,"path");p.setAttribute("d",c),a.appendChild(p);}for(let[c,p]of i.dots??[]){let m=t.createElementNS(r,"circle");m.setAttribute("cx",String(c)),m.setAttribute("cy",String(p)),m.setAttribute("r","0.9"),m.setAttribute("fill",l),m.setAttribute("stroke","none"),a.appendChild(m);}return s.appendChild(a),s}function Ri(t,e){let o=it(e.size,Cs),n=e.color||"#000000",i=t.createElement("span");if(i.className=`veo-badge-marker veo-badge-marker-${e.kind}`,i.style.display="inline-flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.boxSizing="border-box",i.style.lineHeight="1",e.kind==="image"){let r=t.createElement("img");return r.alt="",r.src=e.imageUrl||"",r.style.width=`${o}px`,r.style.height=`${o}px`,r.style.objectFit="contain",r.style.display="block",i.appendChild(r),i}if(e.kind==="icon-text"){i.style.gap="6px",i.style.color=n,i.style.fontSize=`${o}px`,i.style.fontFamily="inherit",i.style.fontWeight="600",i.style.whiteSpace="nowrap",i.style.background=e.bgColor||"transparent";let r=it(e.borderWidth,0);r>0&&(i.style.border=`${r}px solid ${e.borderColor||n}`),i.style.padding=`${it(e.paddingY,6)}px ${it(e.paddingX,10)}px`,i.style.borderRadius=`${it(e.radius,999)}px`,e.showIcon!==false&&i.appendChild(Ai(t,e.icon||"star",o,n));let s=t.createElement("span");return s.textContent=e.text||"",i.appendChild(s),i}return i.style.width=`${o}px`,i.style.height=`${o}px`,i.appendChild(Ai(t,e.icon||"info",o,n)),i}function Mi(t,e,o,n){let i=t.left+t.width,r=t.top+t.height,s=t.top+t.height/2-e.height/2,l=t.left+t.width/2-e.width/2,a,c;switch(o){case "top-left":a=t.left-e.width/2,c=t.top-e.height/2;break;case "bottom-left":a=t.left-e.width/2,c=r-e.height/2;break;case "bottom-right":a=i-e.width/2,c=r-e.height/2;break;case "left":a=t.left-e.width-Ti,c=s;break;case "right":a=i+Ti,c=s;break;case "center":a=l,c=s;break;default:a=i-e.width/2,c=t.top-e.height/2;}return {x:a+n.x,y:c+n.y}}var Ls=new Set(["img","input","textarea","select","iframe","video","audio","canvas","br","hr","svg","object","embed"]);function Ts(t){let e=t.ownerDocument.defaultView;if(!e||!(t instanceof e.HTMLElement)||Ls.has(t.tagName.toLowerCase()))return false;let o=e.getComputedStyle(t);return o.display==="contents"?false:`${o.overflow} ${o.overflowX} ${o.overflowY}`.split(/\s+/).filter(Boolean).every(i=>i==="visible")}function Pi(t,e,o){e.style.position="absolute",e.style.zIndex=String(it(o.zIndex,Ss)),e.style.margin="0";let n=o.position??"top-right",i={x:it(o.offsetX,0),y:it(o.offsetY,0)},r=()=>{let a=e.getBoundingClientRect();return {width:a.width,height:a.height}};if(Ts(t)){let a=t.ownerDocument.defaultView,c=t.style.position,p=a.getComputedStyle(t).position;(!p||p==="static")&&(t.style.position="relative"),t.appendChild(e);let m=f=>{f.preventDefault(),f.stopPropagation();},u=f=>f.stopPropagation();e.addEventListener("click",m),e.addEventListener("pointerdown",u),e.addEventListener("mousedown",u);let d=()=>{let{x:f,y:v}=Mi({left:-t.clientLeft,top:-t.clientTop,width:t.offsetWidth,height:t.offsetHeight},r(),n,i);e.style.left=`${Math.round(f)}px`,e.style.top=`${Math.round(v)}px`;};d();let g=jo(t,e,d,{ancestorScroll:false,layoutShift:false});return ()=>{g(),e.removeEventListener("click",m),e.removeEventListener("pointerdown",u),e.removeEventListener("mousedown",u),e.remove(),t.style.position=c;}}t.ownerDocument.body.appendChild(e);let s=()=>{let a=t.getBoundingClientRect(),{x:c,y:p}=Mi({left:a.left+window.scrollX,top:a.top+window.scrollY,width:a.width,height:a.height},r(),n,i);e.style.left=`${Math.round(c)}px`,e.style.top=`${Math.round(p)}px`;};s();let l=jo(t,e,s);return ()=>{l(),e.remove();}}var Qo={left:"flex-start",center:"center",right:"flex-end"},Ii={...Qo,distribute:"space-between"},Bi={top:"flex-start",center:"center",bottom:"flex-end"};function As(t,e){let o=t.style;typeof e.background=="string"&&e.background&&(o.background=e.background);for(let n of ["Top","Right","Bottom","Left"]){let i=e[`padding${n}`];typeof i=="number"&&Number.isFinite(i)&&o.setProperty(`padding-${n.toLowerCase()}`,`${i}px`);let r=e[`margin${n}`];typeof r=="number"&&Number.isFinite(r)&&o.setProperty(`margin-${n.toLowerCase()}`,`${r}px`);}typeof e.minHeight=="number"&&Number.isFinite(e.minHeight)&&e.minHeight>0&&(o.minHeight=`${e.minHeight}px`),e.align&&Ii[e.align]&&(o.justifyContent=Ii[e.align],t.classList.add("veo-row--aligned")),e.valign&&Bi[e.valign]&&(o.alignItems=Bi[e.valign]);}var fo=class extends J{async render(e){let o=e.nav?.stepIndex??0,n=e.guide.guideSteps[o];if(!n)return;let i=n.badge?.enabled===true,r=(n.position==="relative-to-element"||n.presentation==="inline"||i)&&n.anchorSelector?.trim()||void 0,s=null;if(r&&(s=await re(r),!s))return;let l=n.blocks??[],a=l.length===1&&l[0]?.type==="code"?l[0]:void 0;if(n.presentation==="inline"&&s&&a&&!a.sandboxed){let y=s.ownerDocument??document,{cleanup:w}=Oo(a,y,e,void 0,{anchor:s,pos:Jo(n.inlinePosition),...e.isPreview&&a.editorId?{tagBlockId:a.editorId}:{}});this.registerCleanup(w),e.onInteraction({guideId:e.guide.guideId,stepIndex:o,action:"shown"});return}let{host:c,root:p}=this.createHost(),m=p.ownerDocument??document,u=n.design??{};typeof u.zIndex=="number"&&(c.style.zIndex=String(u.zIndex));let d=m.createElement("div");d.className="veo-card",Ds(d,u),typeof u.ariaLabel=="string"&&u.ariaLabel.trim()&&(d.setAttribute("role","dialog"),d.setAttribute("aria-label",u.ariaLabel.trim()));let g=(y,w)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:o,action:y,...{}});},f=[];if(this.buildContent(d,n.blocks??[],m,e,o,f,c),l.length===0&&(d.classList.add("veo-card--empty"),e.isPreview)){let y=m.createElement("div");y.className="veo-card-empty-zone";let w=m.createElement("b");w.textContent="+";let b=m.createElement("span");b.textContent="Clic para agregar contenido",y.append(w,b),d.appendChild(y);let C=()=>{d.classList.toggle("veo-card--narrow",d.clientWidth<$s);};if(typeof ResizeObserver<"u"){let L=new ResizeObserver(C);L.observe(d),this.registerCleanup(()=>L.disconnect());}C();}let v=d.lastElementChild;v&&!v.style.marginBottom&&(v.style.marginBottom="0");let x=null;if(u.closeButton!==false){let y=at(m,()=>{if(x){x();return}g("dismissed"),this.closeOrSkip(e);}),w=typeof u.closeColor=="string"?u.closeColor:null,b=typeof u.closeHoverColor=="string"?u.closeHoverColor:null;w&&(y.style.color=w);let C=typeof u.closePosition=="string"?u.closePosition:"top-right";Bs(y,C);for(let L of ["Top","Right","Bottom","Left"]){let A=u[`closePadding${L}`];typeof A=="number"&&y.style.setProperty(`padding-${L.toLowerCase()}`,`${A}px`);let D=u[`closeMargin${L}`];typeof D=="number"&&y.style.setProperty(`margin-${L.toLowerCase()}`,`${D}px`);}b&&(y.addEventListener("mouseenter",()=>{y.style.color=b;}),y.addEventListener("mouseleave",()=>{y.style.color=w??"";})),d.appendChild(y),Is(d,l,C,u);}if(i&&s){x=this.renderBadgeMode(n,d,s,r,c,p,m,e,o,u);return}if(n.presentation==="inline"&&s){c.style.display="block";let y=Jo(n.inlinePosition);p.appendChild(d),ve(s,c,y),this.registerCleanup(xe(c,r,y));}else if(n.position==="relative-to-element"&&s){if(u.backdrop===true){let b=m.createElement("div");b.className="veo-composite-overlay veo-composite-overlay--dim",typeof u.backdropColor=="string"&&(b.style.background=u.backdropColor);let C=typeof u.backdropZIndex=="number"?u.backdropZIndex:2e5;b.style.zIndex=String(C),p.appendChild(b),this.registerCleanup(ft(m)),u.targetAbove===true&&this.registerCleanup(Ns(s,C+1));}let y=m.createElement("div");y.className="veo-composite-anchored";let w=u.caret===false?null:Hi(m,u);w&&y.appendChild(w),y.appendChild(d),p.appendChild(y),this.registerCleanup(await $i(s,y,w));}else {let y=m.createElement("div");y.className="veo-composite-overlay",u.backdrop!==false&&(y.classList.add("veo-composite-overlay--dim"),typeof u.backdropColor=="string"&&(y.style.background=u.backdropColor),typeof u.backdropZIndex=="number"&&(y.style.zIndex=String(u.backdropZIndex)),y.addEventListener("click",w=>{w.target===y&&(g("dismissed"),this.closeOrSkip(e));}),this.registerCleanup(ft(m))),Ms(d,n.position,u),y.appendChild(d),p.appendChild(y);}e.onInteraction({guideId:e.guide.guideId,stepIndex:o,action:"shown"});}buildContent(e,o,n,i,r,s,l){let a=d=>{i.onInteraction({guideId:i.guide.guideId,stepIndex:r,action:"cta_clicked",...d.id?{metadata:{buttonId:d.id}}:{}});},c=(d,g,f)=>(d.dataset.veoBlock=String(f),g.editorId&&(d.dataset.veoBlockId=g.editorId),d),p=(d,g)=>{if(!i.isPreview||!d.editorId)return null;let f=n.createElement("div");return f.className="veo-block-placeholder",f.textContent=g,f},m=(d,g)=>{let f=0;for(;f<g.length;){let{block:v,index:x}=g[f];if(v.type==="button"){let w=n.createElement("div");w.className="veo-guide-actions";let b;for(;f<g.length&&g[f]?.block.type==="button";){let{block:C,index:L}=g[f];if(!b){let A=C.style?.align;(A==="left"||A==="center"||A==="right")&&(b=A);}w.appendChild(c(this.buildButton(C,n,i,r,s,a),C,L)),f++;}b&&(w.style.justifyContent=Qo[b]??"flex-end"),d.appendChild(w);continue}if(v.type==="code"){let{node:w,cleanup:b}=Oo(v,n,i,l),C=w??p(v,"Bloque de c\xF3digo");C&&d.appendChild(c(C,v,x)),this.registerCleanup(b),f++;continue}if(v.type==="form"){d.appendChild(c(this.buildForm(v,n,i,r,s,a),v,x)),f++;continue}if(v.type==="checklist"){let w=xi(v,n,i);Ae(w,v.style,"text"),w.style.alignSelf="stretch",w.style.width="100%",d.appendChild(c(w,v,x)),f++;continue}let y=Et(v,n,{editing:i.isPreview===true})??p(v,v.type==="image"?"Imagen (sin URL)":v.type==="video"?"Video (elige proveedor y pega la URL)":"Bloque vac\xEDo");y&&d.appendChild(c(y,v,x)),f++;}},u=i.guide.guideSteps[r]?.rows;for(let d of Kt(o)){let g=Number.isInteger(d.row)?u?.[String(d.row)]:void 0;if(d.columns.length===1&&!g){m(e,d.columns[0].blocks);continue}let f=n.createElement("div");f.className="veo-row",Number.isInteger(d.row)&&(f.dataset.veoRow=String(d.row));for(let v of d.columns){let x=n.createElement("div");x.className="veo-col",m(x,v.blocks),f.appendChild(x);}g&&As(f,g),e.appendChild(f);}}buildForm(e,o,n,i,r,s){let l=o.createElement("div");l.className="veo-form";let a=e.style??{},{marginTop:c,marginBottom:p,...m}=a;for(let[f,v]of [["marginTop",c],["marginBottom",p]])typeof v=="number"&&Number.isFinite(v)&&(l.style[f]=`${v}px`);let u=null;(typeof e.html=="string"&&e.html||typeof e.text=="string"&&e.text)&&(u=o.createElement("div"),u.className="veo-form-question",typeof e.html=="string"&&e.html?u.appendChild(xt(e.html,o)):u.textContent=e.text,Ae(u,m,"text"),l.appendChild(u));let d=u?.textContent?.trim()??"",g=[];for(let f of e.fields??[]){let{wrapper:v,read:x}=Xo(f,o),y=e.style??{};if(typeof y.scaleColor=="string"&&y.scaleColor&&v.style.setProperty("--veo-scale-color",y.scaleColor),typeof y.scaleSize=="number"&&y.scaleSize>=24&&y.scaleSize<=96&&v.style.setProperty("--veo-scale-size",`${y.scaleSize}px`),u&&(v.querySelector(".veo-form-label")?.remove(),d))for(let b of v.querySelectorAll("input, textarea, select"))b.setAttribute("aria-label",d);let w={field:f,read:x,blockId:e.id??null};r.push(w),g.push(w),l.appendChild(v);}if(e.submit){let f=o.createElement("div");f.className="veo-guide-actions";let v={...e.submit,type:"button"},x=v.style?.align;(x==="left"||x==="center"||x==="right")&&(f.style.justifyContent=Qo[x]??"flex-end"),f.appendChild(this.buildButton(v,o,n,i,r,s,g)),l.appendChild(f);}return l}buildButton(e,o,n,i,r,s,l){let a=o.createElement("button");a.type="button",a.className="veo-guide-cta",a.textContent=e.text?.trim()||"OK";let c=e.style??{};(c.preset==="secondary"||c.preset==="link")&&a.classList.add(`veo-guide-cta--${c.preset}`),typeof c.ariaLabel=="string"&&c.ariaLabel.trim()&&a.setAttribute("aria-label",c.ariaLabel.trim()),Ae(a,e.style,"button");let p=n.nav?.callbacks,m=g=>{switch(g.action){case "next":p?p.onNext():n.onClose();break;case "prev":p?.onBack();break;case "goto":p?.onGoto&&typeof g.targetStep=="number"?p.onGoto(g.targetStep):n.onClose();break;case "snooze":ki(n.guide.guideId,typeof g.snoozeEvery=="number"?g.snoozeEvery:1,g.snoozeUnit??"day"),n.onClose();break;case "url":typeof g.url=="string"&&me(g.url)&&(g.newTab===false?window.location.assign(g.url):window.open(g.url,"_blank","noopener,noreferrer"));break;case "guide":g.targetGuideId&&n.onOpenGuide?.(g.targetGuideId),this.closeOrSkip(n);break;default:this.closeOrSkip(n);}},u=()=>{e.secondAction?.action&&m(e.secondAction);},d=()=>{switch(e.action){case "next":case "prev":case "goto":case "snooze":case "url":case "guide":s(e),m(e),u();break;case "submit-forms":case "submit-forms-advance":case "submit-forms-goto":this.submitForms(r,n,i,a,()=>{s(e),e.action==="submit-forms"||!p?n.onClose():e.action==="submit-forms-goto"&&typeof e.targetStep=="number"&&p.onGoto?p.onGoto(e.targetStep):p.onNext();});break;default:s(e),this.closeOrSkip(n),u();}};return a.addEventListener("click",()=>{l?this.submitForms(l,n,i,a,d):d();}),a}submitForms(e,o,n,i,r){let s={};for(let{field:p,read:m}of e){let u=m();if(u==null||u===""){if(p.required){i.textContent=`Completa "${p.label}"`;return}continue}s[p.key]=u;}if(Object.keys(s).length===0){r();return}i.disabled=true;let l=o.onFormSubmit??(()=>Promise.resolve(true)),a=new Set(e.filter(p=>s[p.field.key]!==void 0).map(p=>p.blockId??"")),c=a.size===1&&[...a][0]||void 0;l(s,{...c?{pollId:c}:{},stepIndex:n}).then(p=>{if(i.disabled=false,!p)return;(!o.nav||n>=o.nav.totalSteps-1)&&o.onInteraction({guideId:o.guide.guideId,stepIndex:n,action:"completed"}),r();});}closeOrSkip(e){e.nav?.callbacks?e.nav.callbacks.onSkip():e.onClose();}renderBadgeMode(e,o,n,i,r,s,l,a,c,p){let m=e.badge?.trigger==="click"?"click":"hover",u=e.badge?.placement==="top"||e.badge?.placement==="left"||e.badge?.placement==="right"?e.badge.placement:"bottom",d=l.createElement("div");d.className="veo-composite-badge",d.setAttribute("role","button"),d.tabIndex=0,d.style.cursor="pointer",d.style.display="inline-flex",d.style.alignItems="center";let g=e.badge?.marker??null;g?d.appendChild(Ri(l,g)):this.buildContent(d,e.badge?.blocks??[],l,a,c,[],r),s.appendChild(d),p.fullWidth===true?(o.style.width="auto",o.style.maxWidth="320px"):!o.style.width&&!o.style.maxWidth&&(o.style.maxWidth="320px");let f=l.createElement("div");f.className="veo-composite-anchored",f.style.display="none";let v=p.caret===false?null:Hi(l,p);if(v&&f.appendChild(v),f.appendChild(o),s.appendChild(f),g)r.style.display="inline-block",this.registerCleanup(Pi(n,r,g));else {r.style.display="inline-block";let A=Jo(e.inlinePosition);ve(n,r,A),this.registerCleanup(xe(r,i,A));}let x=false,y=null,w=null,b=false,C=()=>{x||(x=true,f.style.display="block",$i(d,f,v,u).then(A=>{x?y=A:A();}),b||(b=true,a.onInteraction({guideId:a.guide.guideId,stepIndex:c,action:"shown"})));},L=()=>{x=false,f.style.display="none",y?.(),y=null;};if(m==="hover"){let A=()=>{w!==null&&(clearTimeout(w),w=null);},D=()=>{A(),w=window.setTimeout(L,150);};d.addEventListener("mouseenter",()=>{A(),C();}),d.addEventListener("mouseleave",D),d.addEventListener("focus",C),f.addEventListener("mouseenter",A),f.addEventListener("mouseleave",D);}else d.addEventListener("click",()=>{x?L():C();});return this.registerCleanup(()=>{y?.(),w!==null&&clearTimeout(w);}),a.badgeOpen&&C(),L}};function Jo(t){return t==="before"||t==="prepend"||t==="append"?t:"after"}function Ms(t,e,o){let n=t.style;n.position="fixed";let i=16,r=d=>typeof o[d]=="number"&&Number.isFinite(o[d])?o[d]:0;n.margin="0";let s=o.hAlign==="left"?"left":o.hAlign==="right"?"right":null,l=e.includes("top")?"top":e.includes("bottom")?"bottom":"middle",a=s??(e.includes("left")?"left":e.includes("right")?"right":"middle");l==="top"?n.top=`${i+r("marginTop")}px`:l==="bottom"?n.bottom=`${i+r("marginBottom")}px`:n.top="50%",a==="left"?n.left=`${i+r("marginLeft")}px`:a==="right"?n.right=`${i+r("marginRight")}px`:n.left="50%";let c=r("marginLeft")-r("marginRight"),p=r("marginTop")-r("marginBottom"),m=a==="middle"?`calc(-50% + ${c}px)`:"0",u=l==="middle"?`calc(-50% + ${p}px)`:"0";n.transform=m==="0"&&u==="0"?"":`translate(${m}, ${u})`;}var Ni="10px",Rs=42,Ps=20;function Is(t,e,o,n){if(e.length===0)return;let i=o.includes("bottom")?"Bottom":"Top";if((i==="Top"?e[0]:e[e.length-1])?.type==="image")return;let s=n[`closeMargin${i}`],l=Rs+(typeof s=="number"?s:0),a=n[`padding${i}`];(typeof a=="number"?a:Ps)<l&&t.style.setProperty(`padding-${i.toLowerCase()}`,`${l}px`);}function Bs(t,e){let o=t.style;o.top="auto",o.right="auto",o.bottom="auto",o.left="auto";let n=e.includes("bottom")?"bottom":"top",i=e.includes("left")?"left":"right";o.setProperty(n,Ni),o.setProperty(i,Ni);}function Hi(t,e){let o=t.createElement("div");o.className="veo-composite-caret";let n=typeof e.caretWidth=="number"?e.caretWidth:12,i=typeof e.caretHeight=="number"?e.caretHeight:12,r=o.style;if(r.position="absolute",r.width=`${n}px`,r.height=`${i}px`,r.transform="rotate(45deg)",r.background=typeof e.background=="string"?e.background:"#ffffff",typeof e.borderWidth=="number"&&e.borderWidth>0){let s=typeof e.borderColor=="string"?e.borderColor:"#bbbbbb";r.border=`${e.borderWidth}px solid ${s}`;}return o}function Ns(t,e){let o=t,n=o.style.position,i=o.style.zIndex;return getComputedStyle(o).position==="static"&&(o.style.position="relative"),o.style.zIndex=String(e),()=>{o.style.position=n,o.style.zIndex=i;}}async function $i(t,e,o,n="bottom"){let i=async()=>{let{x:s,y:l,placement:a,middlewareData:c}=await Be(t,e,{placement:n,strategy:"fixed",middleware:[Re(o?10:8),Ie(),Pe({padding:8}),...o?[ot({element:o})]:[]]});e.style.left=`${s}px`,e.style.top=`${l}px`,o&&nt(o,a,c.arrow);};await i();let r=()=>{i();};return window.addEventListener("scroll",r,true),window.addEventListener("resize",r),()=>{window.removeEventListener("scroll",r,true),window.removeEventListener("resize",r);}}var Hs=120,$s=260;function Ds(t,e){let o=t.style,n=a=>typeof a=="number"&&Number.isFinite(a)?`${a}px`:null,i=a=>typeof a=="string"&&a?a:null;e.colorMode==="dark"&&(o.background="#1f1d1b",o.color="#f5f0eb",t.classList.add("veo-card--dark")),i(e.background)&&(o.background=e.background);let r=i(e.color)??i(e.textColor);r&&(o.color=r),n(e.fontSize)&&(o.fontSize=n(e.fontSize)),i(e.fontWeight)&&(o.fontWeight=e.fontWeight),i(e.fontFamily)&&e.fontFamily!=="inherit"&&(o.fontFamily=e.fontFamily),i(e.textTransform)&&e.textTransform!=="none"&&(o.textTransform=e.textTransform),typeof e.letterSpacing=="number"&&(o.letterSpacing=`${e.letterSpacing}px`),i(e.align)&&(o.textAlign=e.align),typeof e.lineHeight=="number"&&(o.lineHeight=`${e.lineHeight}%`),n(e.radius)&&(o.borderRadius=n(e.radius));let s=n(e.borderWidth);if(s&&(o.border=`${s} solid ${i(e.borderColor)??"#e5e5e5"}`),i(e.shadowColor)||typeof e.shadowBlur=="number"){let a=c=>typeof e[c]=="number"?e[c]:0;o.boxShadow=`${a("shadowX")}px ${a("shadowY")}px ${a("shadowBlur")}px ${a("shadowSpread")}px ${i(e.shadowColor)??"rgba(0,0,0,0.2)"}`;}let l=typeof e.width=="number"&&Number.isFinite(e.width)?`${Math.max(Hs,e.width)}px`:null;e.fullWidth===true?o.width="100%":e.widthType==="fluid"?(o.width="100%",l&&(o.maxWidth=l)):l&&(o.width=l);for(let a of ["Top","Right","Bottom","Left"]){let c=n(e[`padding${a}`]);c&&o.setProperty(`padding-${a.toLowerCase()}`,c);let p=n(e[`margin${a}`]);p&&o.setProperty(`margin-${a.toLowerCase()}`,p);}}var _s={mode:"floating",position:"bottom-right"},Di=16,Os=360,go=class extends J{async render(e){let o=e.guide.guideSteps[0];if(!o||typeof o.html!="string"||o.html.length===0)return;let n=o.placement??_s,i=null;if(n.mode==="anchored"){let p=n.selector??o.selector??e.guide.activationRules.selector;if(typeof p!="string"||p.length===0||(i=await re(p),!i))return}let{root:r}=this.createHost(),s=r.ownerDocument??document,l=s.createElement("div");l.className=n.mode==="anchored"?"veo-custom-anchored":"veo-custom-floating";let{iframe:a,cleanup:c}=kt(s,o,e,{width:Do(n.width??Os),fixedHeight:n.height??null});this.registerCleanup(c),l.appendChild(a),r.appendChild(l),n.mode==="floating"?Gs(l,n):i&&this.registerCleanup(await this.setupAnchoredPosition(i,l,n)),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}async setupAnchoredPosition(e,o,n){let i=n.side??"bottom",r=async()=>{let{x:l,y:a}=await Be(e,o,{placement:i,strategy:"fixed",middleware:[Re(n.offsetY??8),Ie(),Pe({padding:8})]});o.style.left=`${l}px`,o.style.top=`${a}px`;};await r();let s=()=>{r();};return window.addEventListener("scroll",s,true),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s,true),window.removeEventListener("resize",s);}}};function Gs(t,e){let o=e.position??"bottom-right",n=`${e.offsetX??Di}px`,i=`${e.offsetY??Di}px`,r=t.style;if(o==="center"){r.top="50%",r.left="50%",r.transform="translate(-50%, -50%)";return}let[s,l]=o.split("-");s==="top"?r.top=i:r.bottom=i,l==="left"?r.left=n:l==="right"?r.right=n:(r.left="50%",r.transform="translateX(-50%)");}var ho=class extends J{render(e){let o=e.guide.guideSteps[0];if(!o||(o.fields??[]).length===0)return;let{root:n}=this.createHost();this.applyDesign(o.style);let i=n.ownerDocument??document,r=i.createElement("div");r.className="veo-modal-overlay";let s=i.createElement("div");s.className="veo-modal-card",uo(s,e,i),r.appendChild(s),n.appendChild(r),this.registerCleanup(ft(i));let l=()=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"dismissed"}),e.onClose();};r.addEventListener("click",c=>{c.target===r&&l();});let a=c=>{c.key==="Escape"&&l();};document.addEventListener("keydown",a),this.registerCleanup(()=>document.removeEventListener("keydown",a)),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var vo=class extends J{async render(e){let o=e.guide.guideSteps[0];if(!o||typeof o.html!="string"||o.html.length===0)return;let n=o.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await re(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=He(o.style);ve(i,r,l),this.registerCleanup(xe(r,n,l));let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-custom-inline";let{iframe:p,cleanup:m}=kt(a,o,e,{width:"100%"});this.registerCleanup(m),c.appendChild(p),s.appendChild(c),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var bo=class extends J{async render(e){let o=e.guide.guideSteps[0];if(!o||(o.fields??[]).length===0)return;let n=o.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await re(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=He(o.style);ve(i,r,l),this.registerCleanup(xe(r,n,l)),this.applyDesign(o.style);let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-inline",uo(c,e,a),s.appendChild(c),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}};var yo=class extends J{async render(e){let o=e.guide.guideSteps[0];if(!o)return;let n=o.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return;let i=await re(n);if(!i)return;let{host:r,root:s}=this.createHost();r.style.display="block";let l=He(o.style);ve(i,r,l),this.registerCleanup(xe(r,n,l)),this.applyDesign(o.style);let a=s.ownerDocument??document,c=a.createElement("div");c.className="veo-inline";let p=(u,d,g)=>{e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:u,...g?{metadata:g}:{}}),d&&window.open(d,"_blank","noopener,noreferrer"),e.onClose();},m=ge(o,a,{onCtaClick:(u,d,g)=>{p("cta_clicked",u==="url"?d:void 0,g),u==="guide"&&d&&e.onOpenGuide?.(d);},onDismiss:()=>p("dismissed")});c.appendChild(m),s.appendChild(c),this.liveContainer=c,this.liveContent=m,this.liveKey=`${n}|${l}`,this.liveBuild=u=>ge(u,a,{onCtaClick:(d,g,f)=>{p("cta_clicked",d==="url"?g:void 0,f),d==="guide"&&g&&e.onOpenGuide?.(g);},onDismiss:()=>p("dismissed")}),e.onInteraction({guideId:e.guide.guideId,stepIndex:0,action:"shown"});}liveKeyOf(e){return `${e.selector??""}|${He(e.style)}`}};function _i(t){return t.style?.backdrop===false?"veo-modal-overlay veo-modal-overlay--none":"veo-modal-overlay"}var Xt=class extends J{constructor(){super(...arguments);this.overlay=null;this.releaseScroll=null;}syncScrollLock(o){let n=o.style?.backdrop!==false;n&&!this.releaseScroll?this.releaseScroll=ft(this.host?.ownerDocument??document):!n&&this.releaseScroll&&(this.releaseScroll(),this.releaseScroll=null);}render(o){let n=o.nav?.stepIndex??0,i=o.guide.guideSteps[n];if(!i)return;let{root:r}=this.createHost();this.applyDesign(i.style);let s=r.ownerDocument??document,l=s.createElement("div");l.className=_i(i),this.overlay=l,this.syncScrollLock(i);let a=s.createElement("div");a.className="veo-modal-card";let c=(d,g,f)=>{o.onInteraction({guideId:o.guide.guideId,stepIndex:n,action:d,...f?{metadata:f}:{}}),g&&window.open(g,"_blank","noopener,noreferrer"),o.onClose();},p=()=>{o.nav?o.nav.callbacks.onSkip():c("dismissed");},m=o.nav?Mt(i,o.nav.stepIndex,o.nav.totalSteps,s,o.nav.callbacks):ge(i,s,{onCtaClick:(d,g,f)=>{c("cta_clicked",d==="url"?g:void 0,f),d==="guide"&&g&&o.onOpenGuide?.(g);},onDismiss:()=>c("dismissed")});a.appendChild(m),l.appendChild(a),r.appendChild(l),o.nav||(this.liveContainer=a,this.liveContent=m,this.liveBuild=d=>ge(d,s,{onCtaClick:(g,f,v)=>{c("cta_clicked",g==="url"?f:void 0,v),g==="guide"&&f&&o.onOpenGuide?.(f);},onDismiss:()=>c("dismissed")})),l.addEventListener("click",d=>{d.target===l&&p();});let u=d=>{d.key==="Escape"&&p();};document.addEventListener("keydown",u),this.registerCleanup(()=>document.removeEventListener("keydown",u)),o.nav||o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:"shown"});}onLiveUpdate(o){this.overlay&&(this.overlay.className=_i(o)),this.syncScrollLock(o);}destroy(){this.overlay=null,this.releaseScroll?.(),this.releaseScroll=null,super.destroy();}};var xo=class extends J{constructor(){super(...arguments);this.side="bottom";this.reposition=null;}async render(o){let n=o.guide.guideSteps[0];if(!n)return;let i=n.selector??o.guide.activationRules.selector;if(typeof i!="string"||i.length===0)return;let r=await re(i);if(!r)return;let s=n.style?.tooltipPlacement;this.side=s==="top"||s==="left"||s==="right"?s:"bottom";let{root:l}=this.createHost();this.applyDesign(n.style);let a=l.ownerDocument??document,c=a.createElement("div");c.className="veo-tooltip";let p=(f,v,x)=>{o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:f,...x?{metadata:x}:{}}),v&&window.open(v,"_blank","noopener,noreferrer"),o.onClose();},m=ge(n,a,{onCtaClick:(f,v,x)=>{p("cta_clicked",f==="url"?v:void 0,x),f==="guide"&&v&&o.onOpenGuide?.(v);},onDismiss:()=>p("dismissed")});c.appendChild(m);let u=a.createElement("div");u.className="veo-tooltip-arrow",c.appendChild(u),l.appendChild(c);let d=async()=>{let{x:f,y:v,placement:x,middlewareData:y}=await Be(r,c,{placement:this.side,middleware:[Re(10),Ie(),Pe({padding:8}),ot({element:u})]});c.style.left=`${f}px`,c.style.top=`${v}px`,nt(u,x,y.arrow);};await d();let g=()=>{d();};this.reposition=g,window.addEventListener("scroll",g,true),window.addEventListener("resize",g),this.registerCleanup(()=>{window.removeEventListener("scroll",g,true),window.removeEventListener("resize",g);}),this.liveContainer=c,this.liveContent=m,this.liveKey=i,this.liveBuild=f=>ge(f,a,{onCtaClick:(v,x,y)=>{p("cta_clicked",v==="url"?x:void 0,y),v==="guide"&&x&&o.onOpenGuide?.(x);},onDismiss:()=>p("dismissed")}),o.onInteraction({guideId:o.guide.guideId,stepIndex:0,action:"shown"});}liveKeyOf(o){return o.selector??""}onLiveUpdate(o){let n=o.style?.tooltipPlacement;this.side=n==="top"||n==="left"||n==="right"?n:"bottom",this.reposition?.();}};var wo=class extends J{async render(e){let o=e.guide.guideSteps[e.currentStepIndex];if(!o)return false;let n=o.selector??e.guide.activationRules.selector;if(typeof n!="string"||n.length===0)return false;let i=await re(n,5e3);if(!i)return false;let r=o.style?.tooltipPlacement,s=r==="top"||r==="left"||r==="right"?r:"bottom",{root:l}=this.createHost();this.applyDesign(o.style);let a=l.ownerDocument??document,c=a.createElement("div");c.className="veo-walkthrough";let p=Mt(o,e.currentStepIndex,e.guide.guideSteps.length,a,e.callbacks);c.appendChild(p);let m=a.createElement("div");m.className="veo-walkthrough-arrow",c.appendChild(m),l.appendChild(c);let u=async()=>{let{x:g,y:f,placement:v,middlewareData:x}=await Be(i,c,{placement:s,middleware:[Re(10),Ie(),Pe({padding:8}),ot({element:m})]});c.style.left=`${g}px`,c.style.top=`${f}px`,nt(m,v,x.arrow);};await u();let d=()=>{u();};return window.addEventListener("scroll",d,true),window.addEventListener("resize",d),this.registerCleanup(()=>{window.removeEventListener("scroll",d,true),window.removeEventListener("resize",d);}),true}};var zs="__veo_preview__",en=class{constructor(){this.singleStep=null;this.walkthrough=null;this.walkthroughGuide=null;this.walkthroughIndex=0;this.input=null;}preview(e){let o=e.guideSteps[0];if(this.singleStep&&this.input&&e.guideType===this.input.guideType&&e.guideType!=="walkthrough"&&e.badgeOpen===true==(this.input.badgeOpen===true)&&o&&this.singleStep.updateStep(o))return this.input=e,{close:()=>this.close(),ready:Promise.resolve({rendered:true}),host:()=>this.activeHost()};this.close(),this.input=e;let n=Fs(e),i=typeof e.startStepIndex=="number"?e.startStepIndex:0;if(n.guideType==="composite"){let s=Math.min(Math.max(0,i),n.guideSteps.length-1),l=n.guideSteps[s];l&&(n.guideSteps=[l]);let a=this.renderSingleStep(n);return {close:()=>this.close(),ready:a,host:()=>this.activeHost()}}let r=n.guideType==="walkthrough"?this.startWalkthrough(n,i):this.renderSingleStep(n);return {close:()=>this.close(),ready:r,host:()=>this.activeHost()}}activeHost(){return this.singleStep?this.singleStep.hostElement():this.walkthrough instanceof J?this.walkthrough.hostElement():null}close(e=false){let o=e?this.input?.onClosed:void 0;this.singleStep&&(gt(this.singleStep),this.singleStep=null),this.walkthrough&&(gt(this.walkthrough),this.walkthrough=null),this.walkthroughGuide=null,this.walkthroughIndex=0,this.input=null,o?.();}async renderSingleStep(e){let o=Ws(e.guideType);if(!o)return {rendered:false};this.singleStep=o;let n=false;try{await o.render({guide:e,onInteraction:i=>{i.action==="shown"&&(n=!0);},onClose:()=>this.close(!0),badgeOpen:this.input?.badgeOpen??Ot(this.input?.activationRules),onTrack:()=>{},onOpenGuide:()=>{},onFormSubmit:this.input?.formSubmit??(()=>Promise.resolve(!0)),...this.input?.fetchProgress?{fetchProgress:this.input.fetchProgress}:{},isPreview:!0,...this.input?.formSubmit&&this.input.formSubmitNote!==void 0?{previewNote:this.input.formSubmitNote}:{}});}catch{return this.close(),{rendered:false}}return this.singleStep!==o?(gt(o),{rendered:false}):{rendered:n}}async startWalkthrough(e,o=0){if(e.guideSteps.length===0)return {rendered:false};this.walkthroughGuide=e;let n=Math.min(Math.max(0,Math.floor(o)),e.guideSteps.length-1);return this.walkthroughIndex=n,{rendered:await this.renderWalkthroughStep(n)}}async renderWalkthroughStep(e){let o=this.walkthroughGuide;if(!o)return false;this.walkthrough&&(gt(this.walkthrough),this.walkthrough=null);let n={onNext:()=>{let a=this.walkthroughIndex+1;if(a>=o.guideSteps.length){this.close();return}this.walkthroughIndex=a,this.renderWalkthroughStep(a);},onBack:()=>{let a=this.walkthroughIndex-1;a<0||(this.walkthroughIndex=a,this.renderWalkthroughStep(a));},onSkip:()=>this.close(),onComplete:()=>this.close()},r=o.guideSteps[e]?.style?.render;if(r==="modal"||r==="banner"){let a=r==="modal"?new Xt:new qt;try{a.render({guide:o,onInteraction:()=>{},onClose:()=>this.close(!0),nav:{stepIndex:e,totalSteps:o.guideSteps.length,callbacks:n}});}catch{return gt(a),false}return this.walkthroughGuide!==o?(gt(a),false):(this.walkthrough=a,true)}let s=new wo,l=false;try{l=await s.render({guide:o,currentStepIndex:e,callbacks:n});}catch{l=false;}return !l||this.walkthroughGuide!==o?(gt(s),false):(this.walkthrough=s,true)}},Eo=null;function ko(t){return Ce()?(Eo||(Eo=new en),Eo.preview(t)):{close:()=>{},ready:Promise.resolve({rendered:false}),host:()=>null}}function qe(){Eo?.close();}function Fs(t){let e=t.activationRules?.selector,o={url:t.activationRules?.url??{type:"prefix",pattern:"/"},trigger:"immediate",...e!==void 0?{selector:e}:{}};return {guideId:zs,guideName:t.guideName??"Preview",guideType:t.guideType,guideSteps:t.guideSteps,activationRules:o,displayFrequency:"always",displayPriority:0}}function Ws(t){switch(t){case "modal":return new Xt;case "banner":return new qt;case "tooltip":return new xo;case "custom":return new go;case "inline":return new yo;case "inline-custom":return new vo;case "form":return new ho;case "inline-form":return new bo;case "badge":return new po;case "composite":return new fo;case "walkthrough":return null;default:return null}}function gt(t){try{t.destroy();}catch{}}function Oi(t){let e=[t];try{let o=new URL(t);e.push(`${o.pathname}${o.search}${o.hash}`),o.hash.startsWith("#/")&&e.push(o.hash.slice(1));}catch{}return e}function Us(t,e){let o=Oi(e);switch(t.type){case "exact":return o.some(n=>n===t.pattern);case "prefix":return o.some(n=>n.startsWith(t.pattern));case "regex":try{let n=new RegExp(t.pattern);return o.some(i=>n.test(i))}catch{return false}}}function Gi(t,e){return !t||t.scope==="sitewide"?true:t.scope==="pages"?(t.rules??[]).some(n=>js(n,e)):t.pattern?Us({type:t.matchType??"prefix",pattern:t.pattern},e):true}function js(t,e){let o=t.pattern.toLowerCase(),n=Oi(e).map(i=>i.toLowerCase());switch(t.type){case "exact":return n.some(i=>i===o);case "prefix":return n.some(i=>i.startsWith(o));case "contains":return n.some(i=>i.includes(o));case "regex":try{let i=new RegExp(t.pattern,"i");return n.some(r=>i.test(r))}catch{return false}default:return false}}var Rt="veo-builder";var Co=64,So=128,Vs={bolt:'<path stroke-linecap="round" stroke-linejoin="round" d="m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"/>',desktop:'<path stroke-linecap="round" stroke-linejoin="round" d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"/>',updown:'<path stroke-linecap="round" stroke-linejoin="round" d="M3 7.5 7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5"/>',map:'<path stroke-linecap="round" stroke-linejoin="round" d="M9 6.75V15m6-6v8.25m.503 3.498 4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-1.006l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 0 0-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628 1.006l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0Z"/>',eye:'<path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"/><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>',chevronDown:'<path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5"/>',chevronUp:'<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 15.75 7.5-7.5 7.5 7.5"/>',plus:'<path stroke-linecap="round" stroke-linejoin="round" d="M12 4.5v15m7.5-7.5h-15"/>',pencil:'<path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"/>',copy:'<path stroke-linecap="round" stroke-linejoin="round" d="M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"/>',trash:'<path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/>',cursor:'<path stroke-linecap="round" stroke-linejoin="round" d="M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59"/>',spinner:'<path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182"/>'};function ke(t,e=20){return `<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true">${Vs[t]}</svg>`}function qs(t){if(!t)return "";let e=new Date(t);return Number.isNaN(e.getTime())?"":e.toLocaleDateString("es",{day:"numeric",month:"short"}).replace(".","")}function Q(t,e,o){let n=document.createElement(t);return n.className=e,o!==void 0&&(n.innerHTML=o),n}function tn(t,e,o=""){let n=Q("button",`veo-tb-icon ${o}`.trim(),ke(t));return n.type="button",n.title=e,n.setAttribute("aria-label",e),n}function Fi(t){if(!ye()||!Ce())return {setState:()=>{},height:()=>0,dock:()=>"top",setPreview:()=>{},setHidden:()=>{},onHeightChange:()=>{},teardown:()=>{}};let e=document.createElement("div");e.setAttribute("data-veo-builder-chrome",""),e.setAttribute("data-veo-ignore","");let o=e.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=Ks;let i=Q("div","veo-chrome"),r=Q("div","veo-tb"),s=Q("div","veo-tb-brand",ke("bolt",18)),l=Q("div","veo-tb-name"),a=Q("span","veo-tb-status");a.hidden=true;let c=Q("span","veo-tb-sep"),p=Q("div","veo-tb-app",`${ke("desktop",16)}<span></span>`);p.querySelector("span").textContent=t.appLabel;let m=Q("div","veo-tb-left");m.append(s,l,a,c,p);let u=Q("div","veo-tb-right"),d=tn("updown","Mover la barra abajo"),g=tn("map","Mostrar el editor"),f=tn("eye","Vista previa"),v=Q("button","veo-tb-text","Salir");v.type="button";let x=Q("div","veo-tb-save"),y=Q("button","veo-tb-save-main","<span>Guardar</span>");y.type="button";let w=Q("button","veo-tb-save-more",ke("chevronDown",16));w.type="button",w.title="M\xE1s opciones de guardado",w.setAttribute("aria-label","M\xE1s opciones de guardado");let b=Q("div","veo-tb-menu"),C=Q("button","veo-tb-menu-item","Guardar y salir");C.type="button",b.append(C),b.hidden=true,x.append(y,w,b),u.append(d,g,f,Q("span","veo-tb-vsep"),v,x),r.append(m,u);let L=Q("div","veo-steps"),A=Q("div","veo-steps-list");L.append(A);let D=Q("button","veo-steps-toggle");D.type="button",i.append(r,L,D);let O=Q("div","veo-preview-pill"),ee=Q("span","veo-preview-label",`${ke("eye",18)}<span>Est\xE1s en vista previa</span>`),B=Q("button","veo-preview-exit","Salir");B.type="button",O.append(ee,B),O.hidden=true,o.append(n,i,O),document.body.appendChild(e);let te=document.documentElement,se=te.style.marginTop,oe=te.style.marginBottom,ie=false,q="top",Z=false,ne=false,ae=null,be=()=>Co+(ie?0:So),$e=()=>{let _=Z||ne?0:be();te.style.marginTop=q==="top"?`${_}px`:se,te.style.marginBottom=q==="bottom"?`${_}px`:oe,i.style.setProperty("--veo-chrome-h",`${be()}px`),i.classList.toggle("is-bottom",q==="bottom"),L.hidden=ie;let rt=q==="top"?"chevronUp":"chevronDown",Oe=q==="top"?"chevronDown":"chevronUp";D.innerHTML=`<span>${ie?"Mostrar pasos":"Ocultar pasos"}</span>${ke(ie?Oe:rt,16)}`,d.title=q==="top"?"Mover la barra abajo":"Mover la barra arriba",d.setAttribute("aria-label",d.title),ae?.(_);},Bt=_=>{Z=_,i.hidden=_||ne,O.hidden=!_,$e();},De=_=>{ne=_,i.hidden=_||Z,$e();};D.addEventListener("click",()=>{ie=!ie,$e();});let le=_=>t.onAction(_);d.addEventListener("click",()=>{q=q==="top"?"bottom":"top",$e(),le({action:"dock",position:q});}),g.addEventListener("click",()=>le({action:"show-panel"})),f.addEventListener("click",()=>le({action:"preview"})),B.addEventListener("click",()=>le({action:"exit-preview"})),v.addEventListener("click",()=>le({action:"exit"})),y.addEventListener("click",()=>le({action:"save",exit:false})),w.addEventListener("click",_=>{_.stopPropagation(),b.hidden=!b.hidden;}),C.addEventListener("click",()=>{b.hidden=true,le({action:"save",exit:true});});let _e=()=>{b.hidden=true;};document.addEventListener("click",_e);let Nt=null,Po=()=>{let _=Nt;if(!_)return;let rt=qs(_.createdAt);l.textContent=`${_.guideName.trim()||"Sin nombre"}${rt?` \xB7 ${rt}`:""}`,_.status?(a.hidden=false,a.textContent=_.status.label,a.dataset.tone=_.status.tone,a.title="Estado de la gu\xEDa (se cambia desde la lista de gu\xEDas)"):a.hidden=true,y.innerHTML=_.saving?`${ke("spinner",16)}<span>Guardando\u2026</span>`:"<span>Guardar</span>",y.disabled=_.saving,C.disabled=_.saving,A.replaceChildren();let Oe=zi(ke("cursor",22),"Activaci\xF3n",_.section==="activation");Oe.addEventListener("click",()=>le({action:"select-activation"})),A.append(Oe),_.steps.forEach((Ht,ze)=>{let st=Ht.presentation==="inline"?'<div class="veo-thumb veo-thumb-inline"><i></i><i></i><i></i></div>':'<div class="veo-thumb"><i></i><i></i><b></b></div>',Zt=_.section==="step"||_.section==="block"||_.section==="add-block"||_.section==="row"||_.section==="structure",$t=zi(st,Ht.label,Zt&&_.activeStep===ze,{canRemove:true,onEdit:()=>le({action:"select-step",index:ze}),onDuplicate:()=>le({action:"duplicate-step",index:ze}),onRemove:()=>le({action:"remove-step",index:ze})});A.append($t);});let Ge=Q("button","veo-step-add",`${ke("plus",18)}<span>Agregar paso</span>`);Ge.type="button",Ge.addEventListener("click",()=>le({action:"add-step"})),A.append(Ge);};return $e(),{setState:_=>{Nt=_,Po();},height:be,dock:()=>q,setPreview:Bt,setHidden:De,onHeightChange:_=>{ae=_;},teardown:()=>{document.removeEventListener("click",_e),te.style.marginTop=se,te.style.marginBottom=oe,e.remove();}}}function zi(t,e,o,n){let i=`veo-step${o?" is-active":""}`;if(!n){let a=Q("button",i,`<div class="veo-step-box">${t}</div><span class="veo-step-label"></span>`);return a.type="button",a.querySelector(".veo-step-label").textContent=e,a.setAttribute("aria-pressed",o?"true":"false"),a}let r=Q("div",i,`<div class="veo-step-box">${t}<div class="veo-step-hover"><div class="veo-step-hover-top"><button type="button" class="veo-step-icon veo-step-remove" title="Eliminar paso" aria-label="Eliminar paso">${ke("trash",14)}</button><button type="button" class="veo-step-icon veo-step-duplicate" title="Duplicar paso" aria-label="Duplicar paso">${ke("copy",14)}</button></div><div class="veo-step-hover-main"><button type="button" class="veo-step-edit">${ke("pencil",14)}<span>Editar</span></button></div></div></div><span class="veo-step-label"></span>`);r.querySelector(".veo-step-label").textContent=e,r.setAttribute("aria-current",o?"step":"false");let s=r.querySelector(".veo-step-remove");s.disabled=!n.canRemove,n.canRemove||(s.title="La gu\xEDa necesita al menos un paso");let l=(a,c)=>{r.querySelector(a)?.addEventListener("click",p=>{p.stopPropagation(),c();});};return l(".veo-step-edit",n.onEdit),l(".veo-step-duplicate",n.onDuplicate),l(".veo-step-remove",n.onRemove),r.addEventListener("click",n.onEdit),r}var Ks=`
639
639
  :host { all: initial; }
640
640
  .veo-chrome {
641
641
  position: fixed; top: 0; left: 0; right: 0;
@@ -762,11 +762,11 @@ ${t}
762
762
  display: inline-flex; align-items: center; gap: 8px;
763
763
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
764
764
  }
765
- `;var qs="/guides/design",Ks=484,Xs=660,Lo=320,on=320,Ke=16,nn=52;function Fi(t){if(!ye()||!Ce())return {target:()=>null,frameRect:()=>null,teardown:()=>{},setTitle:()=>{},setVisible:()=>{},isVisible:()=>false,setTopOffset:()=>{},setSize:()=>{}};let e=Qs(t),o=document.createElement("div");o.setAttribute("data-veo-builder-panel","");let n=o.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=ea;let r=document.createElement("div");r.className="veo-panel";let s=t.topOffset??0,l=40,a=s+Ke;r.style.left=`${l}px`,r.style.top=`${a}px`,r.style.width=`${Ks}px`,r.style.height=`${Xs}px`;let c=document.createElement("div");c.className="veo-panel-header";let p=document.createElement("span");p.className="veo-panel-grip",p.setAttribute("aria-hidden","true"),p.textContent="\xB7\xB7\xB7";let m=document.createElement("span");m.className="veo-panel-title",m.textContent="OnUser \xB7 Editor";let u=document.createElement("div");u.className="veo-panel-actions";let d=tn(Ys,"Abrir en ventana aparte"),h=tn(Zs,"Maximizar"),f=tn(Js,"Minimizar");u.append(d,h,f),c.append(p,m,u);let v=document.createElement("iframe");v.className="veo-panel-frame",v.title="Editor de Veo",v.src=e;let x=document.createElement("div");x.className="veo-panel-resize",x.setAttribute("aria-hidden","true"),r.append(c,v,x),n.append(i,r),document.body.appendChild(o);let y=true,w=false,b=null,C=B=>{y=B,r.style.display=B&&!(D&&!D.closed)?"":"none";};f.addEventListener("click",()=>C(false));let L=null,A=B=>{w||D&&!D.closed||(B?(L||(L={w:r.offsetWidth,h:r.offsetHeight}),r.style.minHeight="0",r.style.width=`${Pt(Math.round(B.width),Lo,window.innerWidth-Ke*2)}px`,r.style.height=`${Pt(Math.round(B.height)+nn,nn+80,window.innerHeight-a-Ke)}px`):L&&(r.style.minHeight="",r.style.width=`${L.w}px`,r.style.height=`${L.h}px`,L=null));};h.addEventListener("click",()=>{w=!w,w?(b={left:l,top:a,w:r.offsetWidth,h:r.offsetHeight},l=Ke,a=s+Ke,r.style.left=`${l}px`,r.style.top=`${a}px`,r.style.width=`${Math.max(Lo,window.innerWidth-Ke*2)}px`,r.style.height=`${Math.max(on,window.innerHeight-a-Ke)}px`,h.title="Restaurar"):b&&(l=b.left,a=b.top,r.style.left=`${l}px`,r.style.top=`${a}px`,r.style.width=`${b.w}px`,r.style.height=`${b.h}px`,h.title="Maximizar");});let D=null,O,ee=()=>{O!==void 0&&(clearInterval(O),O=void 0);};return d.addEventListener("click",()=>{let B=window.open(e,"veo-editor",`popup,width=${Math.round(r.offsetWidth)},height=${Math.round(r.offsetHeight)+60}`);B&&(D=B,r.style.display="none",O=setInterval(()=>{D?.closed&&(ee(),t.onClose());},600));}),c.addEventListener("mousedown",B=>{if(B.target?.closest(".veo-panel-btn"))return;B.preventDefault();let te=B.clientX,se=B.clientY,oe=l,ie=a;v.style.pointerEvents="none";let q=ne=>{l=Pt(oe+(ne.clientX-te),0,Math.max(0,window.innerWidth-r.offsetWidth)),a=Pt(ie+(ne.clientY-se),s,Math.max(s,window.innerHeight-40)),r.style.left=`${l}px`,r.style.top=`${a}px`;},Z=()=>{window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",Z),v.style.pointerEvents="";};window.addEventListener("mousemove",q),window.addEventListener("mouseup",Z);}),x.addEventListener("mousedown",B=>{B.preventDefault(),B.stopPropagation();let te=B.clientX,se=B.clientY,oe=r.offsetWidth,ie=r.offsetHeight;v.style.pointerEvents="none";let q=ne=>{r.style.width=`${Pt(oe+(ne.clientX-te),Lo,window.innerWidth)}px`,r.style.height=`${Pt(ie+(ne.clientY-se),on,window.innerHeight)}px`;},Z=()=>{window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",Z),v.style.pointerEvents="";};window.addEventListener("mousemove",q),window.addEventListener("mouseup",Z);}),{target:()=>D&&!D.closed?D:v.contentWindow,frameRect:()=>D&&!D.closed?null:v.getBoundingClientRect(),teardown:()=>{ee(),D&&!D.closed&&D.close(),o.remove();},setTitle:B=>{m.textContent=B;},setVisible:C,setSize:A,isVisible:()=>y,setTopOffset:B=>{s=B,a<s+Ke&&(a=s+Ke,r.style.top=`${a}px`);}}}var Ys='<path stroke-linecap="round" stroke-linejoin="round" d="m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"/>',Zs='<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"/>',Js='<path stroke-linecap="round" stroke-linejoin="round" d="M5 12h14"/>';function tn(t,e){let o=document.createElement("button");return o.className="veo-panel-btn",o.type="button",o.title=e,o.setAttribute("aria-label",e),o.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true">${t}</svg>`,o}function Pt(t,e,o){return Math.min(Math.max(t,e),o)}function Qs(t){let e=t.panelPath??qs,o=new URL(e,t.dashboardOrigin);return o.searchParams.set("veoToken",t.token),o.searchParams.set("veoApp",t.appOrigin),t.guide&&o.searchParams.set("veoGuide",t.guide),o.toString()}var ea=`
765
+ `;var Xs="/guides/design",Ys=484,Zs=660,Lo=320,nn=320,Ke=16,rn=52;function Wi(t){if(!ye()||!Ce())return {target:()=>null,frameRect:()=>null,teardown:()=>{},setTitle:()=>{},setVisible:()=>{},isVisible:()=>false,setTopOffset:()=>{},setSize:()=>{}};let e=ta(t),o=document.createElement("div");o.setAttribute("data-veo-builder-panel","");let n=o.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=oa;let r=document.createElement("div");r.className="veo-panel";let s=t.topOffset??0,l=40,a=s+Ke;r.style.left=`${l}px`,r.style.top=`${a}px`,r.style.width=`${Ys}px`,r.style.height=`${Zs}px`;let c=document.createElement("div");c.className="veo-panel-header";let p=document.createElement("span");p.className="veo-panel-grip",p.setAttribute("aria-hidden","true"),p.textContent="\xB7\xB7\xB7";let m=document.createElement("span");m.className="veo-panel-title",m.textContent="OnUser \xB7 Editor";let u=document.createElement("div");u.className="veo-panel-actions";let d=on(Js,"Abrir en ventana aparte"),g=on(Qs,"Maximizar"),f=on(ea,"Minimizar");u.append(d,g,f),c.append(p,m,u);let v=document.createElement("iframe");v.className="veo-panel-frame",v.title="Editor de Veo",v.src=e;let x=document.createElement("div");x.className="veo-panel-resize",x.setAttribute("aria-hidden","true"),r.append(c,v,x),n.append(i,r),document.body.appendChild(o);let y=true,w=false,b=null,C=B=>{y=B,r.style.display=B&&!(D&&!D.closed)?"":"none";};f.addEventListener("click",()=>C(false));let L=null,A=B=>{w||D&&!D.closed||(B?(L||(L={w:r.offsetWidth,h:r.offsetHeight}),r.style.minHeight="0",r.style.width=`${Pt(Math.round(B.width),Lo,window.innerWidth-Ke*2)}px`,r.style.height=`${Pt(Math.round(B.height)+rn,rn+80,window.innerHeight-a-Ke)}px`):L&&(r.style.minHeight="",r.style.width=`${L.w}px`,r.style.height=`${L.h}px`,L=null));};g.addEventListener("click",()=>{w=!w,w?(b={left:l,top:a,w:r.offsetWidth,h:r.offsetHeight},l=Ke,a=s+Ke,r.style.left=`${l}px`,r.style.top=`${a}px`,r.style.width=`${Math.max(Lo,window.innerWidth-Ke*2)}px`,r.style.height=`${Math.max(nn,window.innerHeight-a-Ke)}px`,g.title="Restaurar"):b&&(l=b.left,a=b.top,r.style.left=`${l}px`,r.style.top=`${a}px`,r.style.width=`${b.w}px`,r.style.height=`${b.h}px`,g.title="Maximizar");});let D=null,O,ee=()=>{O!==void 0&&(clearInterval(O),O=void 0);};return d.addEventListener("click",()=>{let B=window.open(e,"veo-editor",`popup,width=${Math.round(r.offsetWidth)},height=${Math.round(r.offsetHeight)+60}`);B&&(D=B,r.style.display="none",O=setInterval(()=>{D?.closed&&(ee(),t.onClose());},600));}),c.addEventListener("mousedown",B=>{if(B.target?.closest(".veo-panel-btn"))return;B.preventDefault();let te=B.clientX,se=B.clientY,oe=l,ie=a;v.style.pointerEvents="none";let q=ne=>{l=Pt(oe+(ne.clientX-te),0,Math.max(0,window.innerWidth-r.offsetWidth)),a=Pt(ie+(ne.clientY-se),s,Math.max(s,window.innerHeight-40)),r.style.left=`${l}px`,r.style.top=`${a}px`;},Z=()=>{window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",Z),v.style.pointerEvents="";};window.addEventListener("mousemove",q),window.addEventListener("mouseup",Z);}),x.addEventListener("mousedown",B=>{B.preventDefault(),B.stopPropagation();let te=B.clientX,se=B.clientY,oe=r.offsetWidth,ie=r.offsetHeight;v.style.pointerEvents="none";let q=ne=>{r.style.width=`${Pt(oe+(ne.clientX-te),Lo,window.innerWidth)}px`,r.style.height=`${Pt(ie+(ne.clientY-se),nn,window.innerHeight)}px`;},Z=()=>{window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",Z),v.style.pointerEvents="";};window.addEventListener("mousemove",q),window.addEventListener("mouseup",Z);}),{target:()=>D&&!D.closed?D:v.contentWindow,frameRect:()=>D&&!D.closed?null:v.getBoundingClientRect(),teardown:()=>{ee(),D&&!D.closed&&D.close(),o.remove();},setTitle:B=>{m.textContent=B;},setVisible:C,setSize:A,isVisible:()=>y,setTopOffset:B=>{s=B,a<s+Ke&&(a=s+Ke,r.style.top=`${a}px`);}}}var Js='<path stroke-linecap="round" stroke-linejoin="round" d="m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"/>',Qs='<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"/>',ea='<path stroke-linecap="round" stroke-linejoin="round" d="M5 12h14"/>';function on(t,e){let o=document.createElement("button");return o.className="veo-panel-btn",o.type="button",o.title=e,o.setAttribute("aria-label",e),o.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true">${t}</svg>`,o}function Pt(t,e,o){return Math.min(Math.max(t,e),o)}function ta(t){let e=t.panelPath??Xs,o=new URL(e,t.dashboardOrigin);return o.searchParams.set("veoToken",t.token),o.searchParams.set("veoApp",t.appOrigin),t.guide&&o.searchParams.set("veoGuide",t.guide),o.toString()}var oa=`
766
766
  :host { all: initial; }
767
767
  .veo-panel {
768
768
  position: fixed;
769
- min-width: ${Lo}px; min-height: ${on}px;
769
+ min-width: ${Lo}px; min-height: ${nn}px;
770
770
  max-width: 96vw; max-height: 94vh;
771
771
  display: flex; flex-direction: column;
772
772
  background: #fff;
@@ -777,7 +777,7 @@ ${t}
777
777
  font-family: system-ui, -apple-system, sans-serif;
778
778
  }
779
779
  .veo-panel-header {
780
- position: relative; flex: 0 0 auto; height: ${nn}px; box-sizing: border-box;
780
+ position: relative; flex: 0 0 auto; height: ${rn}px; box-sizing: border-box;
781
781
  display: flex; align-items: center; justify-content: space-between;
782
782
  padding: 10px 14px 0 22px;
783
783
  background: #fbf8f5; color: #1c1917; border-bottom: 1px solid #e8e2dc;
@@ -806,7 +806,7 @@ ${t}
806
806
  linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.25) 50%, rgba(0,0,0,0.25) 60%,
807
807
  transparent 60%, transparent 72%, rgba(0,0,0,0.25) 72%, rgba(0,0,0,0.25) 82%, transparent 82%);
808
808
  }
809
- `;var ta=["n","s","e","w","ne","nw","se","sw"],Wi=`
809
+ `;var na=["n","s","e","w","ne","nw","se","sw"],ji=`
810
810
  .veo-mnp-card {
811
811
  outline: 1.5px dashed rgba(255, 91, 53, 0.75);
812
812
  outline-offset: 2px;
@@ -841,11 +841,11 @@ ${t}
841
841
  .veo-mnp-sw { bottom: -4px; left: -4px; width: 12px; height: 12px; cursor: nesw-resize; }
842
842
  .veo-mnp-banner { outline: 1.5px dashed rgba(255, 91, 53, 0.75); outline-offset: -2px; cursor: grab; }
843
843
  .veo-mnp-banner:active { cursor: grabbing; }
844
- `;function It(t,e,o){return Math.min(Math.max(t,e),o)}function Ui(t){return Math.round(t*1e3)/1e3}function ji(t){return !!(t instanceof Element&&t.closest("button, a, input, textarea, select, label"))}function Vi(t){let e=t.host.shadowRoot;if(!e)return null;let o=e.querySelector(".veo-modal-card");if(o)return oa(t,e,o);let n=e.querySelector(".veo-banner");return n&&!n.classList.contains("veo-banner-embedded")?na(t,e,n):null}function oa(t,e,o){if(o.dataset.veoManipulated==="1")return null;o.dataset.veoManipulated="1",o.classList.add("veo-mnp-card");let n=o.ownerDocument,i=n.createElement("style");i.textContent=Wi,e.appendChild(i);let r=[];for(let f of ta){let v=n.createElement("div");v.className=`veo-mnp-handle veo-mnp-${f}`,v.dataset.veoDir=f,o.appendChild(v),r.push(v);}let s=false,l=false,a={},c=f=>{let v=t.host;f.px!==void 0&&v.style.setProperty("--veo-pos-x",`${f.px*100}%`),f.py!==void 0&&v.style.setProperty("--veo-pos-y",`${f.py*100}%`),f.w!==void 0&&v.style.setProperty("--veo-width",`${f.w}px`),f.h!==void 0&&v.style.setProperty("--veo-min-h",`${f.h}px`);},p=(f,v)=>{f.preventDefault(),f.stopPropagation(),s=true,a={};let x=o.getBoundingClientRect(),y=f.clientX,w=f.clientY,b=0,C=null,L=()=>{if(b=0,!C)return;let O=v(C.clientX-y,C.clientY-w,x);a={...a,...O},c({...O.posX!==void 0?{px:O.posX}:{},...O.posY!==void 0?{py:O.posY}:{},...O.width!==void 0?{w:O.width}:{},...O.height!==void 0?{h:O.height}:{}});},A=O=>{C=O,typeof window.requestAnimationFrame!="function"?L():b||(b=window.requestAnimationFrame(L));},D=()=>{window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",D),b&&window.cancelAnimationFrame(b),L(),s=false,Object.keys(a).length>0&&!l&&t.onCommit({stepIndex:t.stepIndex,style:a}),t.onGestureEnd?.();};window.addEventListener("mousemove",A),window.addEventListener("mouseup",D);},m=(f,v)=>{let x=window.innerWidth-v;return x<=0?.5:Ui(It(f/x,0,1))},u=(f,v)=>{let x=window.innerHeight-v;return x<=0?.5:Ui(It(f/x,0,1))},d=f=>{ji(f.target)||f.target instanceof Element&&f.target.closest(".veo-mnp-handle")||p(f,(v,x,y)=>({posX:m(y.left+v,y.width),posY:u(y.top+x,y.height)}));},h=f=>{let v=f.currentTarget.dataset.veoDir;p(f,(x,y,w)=>{let b={};return v.includes("e")&&(b.width=Math.round(It(w.width+x,220,720))),v.includes("w")&&(b.width=Math.round(It(w.width-x,220,720)),b.posX=m(w.right-b.width,b.width)),v.includes("s")&&(b.height=Math.round(It(w.height+y,120,900))),v.includes("n")&&(b.height=Math.round(It(w.height-y,120,900)),b.posY=u(w.bottom-b.height,b.height)),b});};o.addEventListener("mousedown",d);for(let f of r)f.addEventListener("mousedown",h);return {isDragging:()=>s,detach:()=>{if(!l){l=true,o.removeEventListener("mousedown",d);for(let f of r)f.remove();i.remove(),o.classList.remove("veo-mnp-card"),delete o.dataset.veoManipulated;}}}}function na(t,e,o){if(o.dataset.veoManipulated==="1")return null;o.dataset.veoManipulated="1",o.classList.add("veo-mnp-banner");let i=o.ownerDocument.createElement("style");i.textContent=Wi,e.appendChild(i);let r=false,s=false,l=()=>o.classList.contains("veo-banner-bottom")?"bottom":"top",a=c=>{if(ji(c.target))return;c.preventDefault(),r=true;let p=l(),m=p,u=h=>{let f=h.clientY<window.innerHeight/2?"top":"bottom";f!==m&&(m=f,o.classList.remove("veo-banner-top","veo-banner-bottom"),o.classList.add(`veo-banner-${f}`));},d=()=>{window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d),r=false,m!==p&&!s&&t.onCommit({stepIndex:t.stepIndex,style:{position:m}}),t.onGestureEnd?.();};window.addEventListener("mousemove",u),window.addEventListener("mouseup",d);};return o.addEventListener("mousedown",a),{isDragging:()=>r,detach:()=>{s||(s=true,o.removeEventListener("mousedown",a),i.remove(),o.classList.remove("veo-mnp-banner"),delete o.dataset.veoManipulated);}}}var qi=[/^css-[a-z0-9]{4,}$/i,/^_[a-z0-9]+_[a-z0-9]{4,}_\d+$/,/^[a-z]{2,4}-[a-z0-9]{6,}$/i,/^[a-f0-9]{6,}$/i,/^sc-[a-z0-9]+$/i];function ia(t){return qi.some(e=>e.test(t))}function To(t){return Array.from(t.classList).filter(e=>!ia(e)&&e.length<64)}var ra=["data-testid","data-test","data-cy","name","aria-label","placeholder","alt","title","href","role","type"],sa=100;function rn(t){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g,"\\$&")}function Ki(t){return t.replace(/[\\"]/g,"\\$&")}function aa(t,e){for(let o of ra){let n=t.getAttribute(o);if(n&&n.length>0&&n.length<=sa)return `${e}[${o}="${Ki(n)}"]`}return null}function la(t){let e=t.tagName.toLowerCase(),o=t.getAttribute("data-veo-tag");if(o)return `${e}[data-veo-tag="${Ki(o)}"]`;if(t.id){let s=To(t),l=s.length>0?`.${s.map(rn).join(".")}`:"";return `${e}#${rn(t.id)}${l}`}let n=aa(t,e);if(n)return n;let i=To(t),r=i.length>0?`.${i.map(rn).join(".")}`:"";return `${e}${r}`}function Ao(t,e=5){let o=[],n=t,i=0;for(;n&&n!==document.documentElement&&i<=e;)o.unshift(la(n)),n=n.parentElement,i++;return o.join(" > ")}var sn=2147483646,ca="data-veo-picker",Xi=5,da=`
844
+ `;function It(t,e,o){return Math.min(Math.max(t,e),o)}function Ui(t){return Math.round(t*1e3)/1e3}function Vi(t){return !!(t instanceof Element&&t.closest("button, a, input, textarea, select, label"))}function qi(t){let e=t.host.shadowRoot;if(!e)return null;let o=e.querySelector(".veo-modal-card");if(o)return ia(t,e,o);let n=e.querySelector(".veo-banner");return n&&!n.classList.contains("veo-banner-embedded")?ra(t,e,n):null}function ia(t,e,o){if(o.dataset.veoManipulated==="1")return null;o.dataset.veoManipulated="1",o.classList.add("veo-mnp-card");let n=o.ownerDocument,i=n.createElement("style");i.textContent=ji,e.appendChild(i);let r=[];for(let f of na){let v=n.createElement("div");v.className=`veo-mnp-handle veo-mnp-${f}`,v.dataset.veoDir=f,o.appendChild(v),r.push(v);}let s=false,l=false,a={},c=f=>{let v=t.host;f.px!==void 0&&v.style.setProperty("--veo-pos-x",`${f.px*100}%`),f.py!==void 0&&v.style.setProperty("--veo-pos-y",`${f.py*100}%`),f.w!==void 0&&v.style.setProperty("--veo-width",`${f.w}px`),f.h!==void 0&&v.style.setProperty("--veo-min-h",`${f.h}px`);},p=(f,v)=>{f.preventDefault(),f.stopPropagation(),s=true,a={};let x=o.getBoundingClientRect(),y=f.clientX,w=f.clientY,b=0,C=null,L=()=>{if(b=0,!C)return;let O=v(C.clientX-y,C.clientY-w,x);a={...a,...O},c({...O.posX!==void 0?{px:O.posX}:{},...O.posY!==void 0?{py:O.posY}:{},...O.width!==void 0?{w:O.width}:{},...O.height!==void 0?{h:O.height}:{}});},A=O=>{C=O,typeof window.requestAnimationFrame!="function"?L():b||(b=window.requestAnimationFrame(L));},D=()=>{window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",D),b&&window.cancelAnimationFrame(b),L(),s=false,Object.keys(a).length>0&&!l&&t.onCommit({stepIndex:t.stepIndex,style:a}),t.onGestureEnd?.();};window.addEventListener("mousemove",A),window.addEventListener("mouseup",D);},m=(f,v)=>{let x=window.innerWidth-v;return x<=0?.5:Ui(It(f/x,0,1))},u=(f,v)=>{let x=window.innerHeight-v;return x<=0?.5:Ui(It(f/x,0,1))},d=f=>{Vi(f.target)||f.target instanceof Element&&f.target.closest(".veo-mnp-handle")||p(f,(v,x,y)=>({posX:m(y.left+v,y.width),posY:u(y.top+x,y.height)}));},g=f=>{let v=f.currentTarget.dataset.veoDir;p(f,(x,y,w)=>{let b={};return v.includes("e")&&(b.width=Math.round(It(w.width+x,220,720))),v.includes("w")&&(b.width=Math.round(It(w.width-x,220,720)),b.posX=m(w.right-b.width,b.width)),v.includes("s")&&(b.height=Math.round(It(w.height+y,120,900))),v.includes("n")&&(b.height=Math.round(It(w.height-y,120,900)),b.posY=u(w.bottom-b.height,b.height)),b});};o.addEventListener("mousedown",d);for(let f of r)f.addEventListener("mousedown",g);return {isDragging:()=>s,detach:()=>{if(!l){l=true,o.removeEventListener("mousedown",d);for(let f of r)f.remove();i.remove(),o.classList.remove("veo-mnp-card"),delete o.dataset.veoManipulated;}}}}function ra(t,e,o){if(o.dataset.veoManipulated==="1")return null;o.dataset.veoManipulated="1",o.classList.add("veo-mnp-banner");let i=o.ownerDocument.createElement("style");i.textContent=ji,e.appendChild(i);let r=false,s=false,l=()=>o.classList.contains("veo-banner-bottom")?"bottom":"top",a=c=>{if(Vi(c.target))return;c.preventDefault(),r=true;let p=l(),m=p,u=g=>{let f=g.clientY<window.innerHeight/2?"top":"bottom";f!==m&&(m=f,o.classList.remove("veo-banner-top","veo-banner-bottom"),o.classList.add(`veo-banner-${f}`));},d=()=>{window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d),r=false,m!==p&&!s&&t.onCommit({stepIndex:t.stepIndex,style:{position:m}}),t.onGestureEnd?.();};window.addEventListener("mousemove",u),window.addEventListener("mouseup",d);};return o.addEventListener("mousedown",a),{isDragging:()=>r,detach:()=>{s||(s=true,o.removeEventListener("mousedown",a),i.remove(),o.classList.remove("veo-mnp-banner"),delete o.dataset.veoManipulated);}}}var Ki=[/^css-[a-z0-9]{4,}$/i,/^_[a-z0-9]+_[a-z0-9]{4,}_\d+$/,/^[a-z]{2,4}-[a-z0-9]{6,}$/i,/^[a-f0-9]{6,}$/i,/^sc-[a-z0-9]+$/i];function sa(t){return Ki.some(e=>e.test(t))}function To(t){return Array.from(t.classList).filter(e=>!sa(e)&&e.length<64)}var aa=["data-testid","data-test","data-cy","name","aria-label","placeholder","alt","title","href","role","type"],la=100;function sn(t){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g,"\\$&")}function Xi(t){return t.replace(/[\\"]/g,"\\$&")}function ca(t,e){for(let o of aa){let n=t.getAttribute(o);if(n&&n.length>0&&n.length<=la)return `${e}[${o}="${Xi(n)}"]`}return null}function da(t){let e=t.tagName.toLowerCase(),o=t.getAttribute("data-veo-tag");if(o)return `${e}[data-veo-tag="${Xi(o)}"]`;if(t.id){let s=To(t),l=s.length>0?`.${s.map(sn).join(".")}`:"";return `${e}#${sn(t.id)}${l}`}let n=ca(t,e);if(n)return n;let i=To(t),r=i.length>0?`.${i.map(sn).join(".")}`:"";return `${e}${r}`}function Ao(t,e=5){let o=[],n=t,i=0;for(;n&&n!==document.documentElement&&i<=e;)o.unshift(da(n)),n=n.parentElement,i++;return o.join(" > ")}var an=2147483646,pa="data-veo-picker",Yi=5,ua=`
845
845
  :host { all: initial; }
846
846
  .veo-pick-box {
847
847
  position: fixed;
848
- z-index: ${sn};
848
+ z-index: ${an};
849
849
  pointer-events: none;
850
850
  box-sizing: border-box;
851
851
  background: transparent;
@@ -855,7 +855,7 @@ ${t}
855
855
  }
856
856
  .veo-pick-label {
857
857
  position: fixed;
858
- z-index: ${sn};
858
+ z-index: ${an};
859
859
  pointer-events: none;
860
860
  max-width: 360px;
861
861
  background: #2b2623;
@@ -872,7 +872,7 @@ ${t}
872
872
  top: 28px;
873
873
  left: 50%;
874
874
  transform: translateX(-50%);
875
- z-index: ${sn};
875
+ z-index: ${an};
876
876
  pointer-events: none;
877
877
  display: flex; align-items: center; gap: 16px;
878
878
  max-width: min(760px, calc(100vw - 32px));
@@ -898,6 +898,6 @@ ${t}
898
898
  font: inherit; font-weight: 600; cursor: pointer;
899
899
  }
900
900
  .veo-pick-cancel:hover { background: rgba(255,255,255,0.24); }
901
- `,pa='<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 3.75H6A2.25 2.25 0 0 0 3.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0 1 20.25 6v1.5m0 9V18A2.25 2.25 0 0 1 18 20.25h-1.5m-9 0H6A2.25 2.25 0 0 1 3.75 18v-1.5M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>',an=class{constructor(){this.host=null;this.box=null;this.label=null;this.current=null;this.maxAncestors=Xi;this.onPick=null;this.onCancel=null;this.onMove=e=>{let o=e.target;!(o instanceof Element)||this.isOwn(o)||(this.current=o,this.draw(o));};this.onClick=e=>{if(e.altKey)return;let o=this.current??(e.target instanceof Element?e.target:null);if(!o||this.isOwn(o))return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();let n=this.describe(o),i=this.onPick;this.stop(),i?.(n);};this.onKey=e=>{if(e.key!=="Escape")return;e.preventDefault(),e.stopPropagation();let o=this.onCancel;this.stop(),o?.();};this.swallow=e=>{e.altKey||this.isOwn(e.target)||(e.preventDefault(),e.stopPropagation());};this.reposition=()=>{this.current&&this.draw(this.current);};}start(e){this.stop(),this.maxAncestors=e.maxAncestors??Xi,this.onPick=e.onPick,this.onCancel=e.onCancel??null;let o=document.createElement("div");o.setAttribute(ca,"");let n=o.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=da,this.box=document.createElement("div"),this.box.className="veo-pick-box",this.box.style.display="none",this.label=document.createElement("div"),this.label.className="veo-pick-label",this.label.style.display="none";let r=document.createElement("div");r.className="veo-pick-hint";let s=document.createElement("span");s.className="veo-pick-hint-icon",s.innerHTML=pa;let l=document.createElement("div");l.className="veo-pick-hint-text";let a=document.createElement("span");a.className="veo-pick-hint-title",a.textContent=e.hint??"Selecciona un elemento existente para colocar la gu\xEDa.";let c=document.createElement("span");c.className="veo-pick-hint-sub",c.textContent=e.subhint??"Usa Alt + clic u Opci\xF3n + clic para abrir men\xFAs y desplegables.",l.append(a,c);let p=document.createElement("button");p.className="veo-pick-cancel",p.type="button",p.textContent="Cancelar",p.addEventListener("click",m=>{m.stopPropagation();let u=this.onCancel;this.stop(),u?.();}),r.append(s,l,p),n.append(i,this.box,this.label,r),document.body.appendChild(o),this.host=o,document.addEventListener("mousemove",this.onMove,true),document.addEventListener("click",this.onClick,true),document.addEventListener("mousedown",this.swallow,true),document.addEventListener("mouseup",this.swallow,true),document.addEventListener("keydown",this.onKey,true),window.addEventListener("scroll",this.reposition,true),window.addEventListener("resize",this.reposition);}stop(){document.removeEventListener("mousemove",this.onMove,true),document.removeEventListener("click",this.onClick,true),document.removeEventListener("mousedown",this.swallow,true),document.removeEventListener("mouseup",this.swallow,true),document.removeEventListener("keydown",this.onKey,true),window.removeEventListener("scroll",this.reposition,true),window.removeEventListener("resize",this.reposition),this.host?.parentNode&&this.host.parentNode.removeChild(this.host),this.host=null,this.box=null,this.label=null,this.current=null,this.onPick=null,this.onCancel=null;}isOwn(e){return e instanceof Node&&this.host!==null&&this.host.contains(e)}draw(e){if(!this.box||!this.label)return;let o=e.getBoundingClientRect();this.box.style.display="block",this.box.style.top=`${o.top}px`,this.box.style.left=`${o.left}px`,this.box.style.width=`${o.width}px`,this.box.style.height=`${o.height}px`;let n=Ao(e,0);this.label.textContent="";let i=document.createElement("div");i.className="veo-pick-sel",i.textContent=n;let r=document.createElement("div");r.className="veo-pick-dim",r.textContent=`${Math.round(o.width)} \xD7 ${Math.round(o.height)}`,this.label.append(i,r),this.label.style.display="block";let s=48,l=o.bottom+8+s>window.innerHeight;this.label.style.top=l?`${Math.max(8,o.top-s-8)}px`:`${o.bottom+8}px`,this.label.style.left=`${Math.max(8,o.left)}px`;}describe(e){let o=e.getBoundingClientRect();return {selector:Ao(e,this.maxAncestors),shortSelector:Ao(e,0),tag:e.tagName.toLowerCase(),id:e.id||null,classes:To(e),text:(e.textContent??"").trim().slice(0,120),rect:{x:Math.round(o.left),y:Math.round(o.top),width:Math.round(o.width),height:Math.round(o.height)}}}},Yt=null;function Ro(t){return Ce()?(Yt||(Yt=new an),Yt.start(t),{stop:()=>Yt?.stop()}):{stop:()=>{}}}function Yi(){Yt?.stop();}function Mo(){if(!ye()||!Ce())return null;let t=Tn();if(!t)return null;let e=t.token,o=fa(t.origin);if(!o)return null;let n=null,i=null,r=null,s=null,l=null,a=null,c=null,p=null,m=null,u=null,d=0,h=null,f=null,v=false,x=null,y=false,w=null,b=false,C=true,L=()=>i?i.target():s,A=g=>{L()?.postMessage({source:Mt,token:e,...g},o);},D=g=>g.guide.guideSteps?.[g.guide.startStepIndex??0],O=g=>Oi(D(g)?.pageLocation,window.location.href),ee=g=>A({type:"preview-status",payload:g}),B=()=>{l?.detach(),l=null,a?.detach(),a=null,c?.(),c=null,Bt?.(),Bt=null,be=null,De=false,p?.detach(),p=null,_e=null;},te=()=>{B(),_e=null,qe();},se=4,oe=0,ie=30,q={pencil:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"/></svg>',copy:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"/></svg>',trash:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/></svg>'},Z={left:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M19.5 12h-15m0 0 6.75 6.75M4.5 12l6.75-6.75"/></svg>',right:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4.5 12h15m0 0-6.75-6.75M19.5 12l-6.75 6.75"/></svg>'},ne=(g,k)=>{for(let E of Kt(g))for(let S=0;S<E.columns.length;S++)if(E.columns[S].blocks.some(R=>R.block.editorId===k))return {left:S>0,right:S<E.columns.length-1};return {left:false,right:false}},ae=[],be=null,$e=null,Bt=null,De=false,le=null,_e=null,Nt=g=>{if(!g)return "";let{blocks:k,...E}=g;return JSON.stringify({rest:E,blocks:(k??[]).map(S=>{let{text:P,html:R,style:G,...z}=S;return z})})},Po=g=>{let k=_e;if(!k||g.guide.guideType!=="composite"||k.guide.guideType!=="composite")return false;let E=g.guide.startStepIndex??0;if((k.guide.startStepIndex??0)!==E)return false;let S=M=>JSON.stringify({...M,guideSteps:void 0});if(S(k.guide)!==S(g.guide)||k.editable!==g.editable)return false;let P=document.querySelector("[data-veo-guide]"),R=P?_(P):null;if(!P||!R)return false;let G=k.guide.guideSteps[E],z=g.guide.guideSteps[E];if(!G||!z||Nt(G)!==Nt(z))return false;let V=R.ownerDocument,F=G.blocks??[],T=z.blocks??[];for(let M=0;M<T.length;M++){let N=F[M],I=T[M];if(N.text===I.text&&N.html===I.html&&JSON.stringify(N.style)===JSON.stringify(I.style))continue;if(!I.editorId)return false;let H=R.querySelector(`[data-veo-block-id="${I.editorId}"]`);if(!H)return false;if(I.type==="button"){H.textContent=I.text?.trim()||"OK",H.removeAttribute("style"),H.classList.remove("veo-guide-cta--secondary","veo-guide-cta--link");let U=I.style??{};(U.preset==="secondary"||U.preset==="link")&&H.classList.add(`veo-guide-cta--${U.preset}`),typeof U.ariaLabel=="string"&&U.ariaLabel.trim()?H.setAttribute("aria-label",U.ariaLabel.trim()):H.removeAttribute("aria-label"),Ae(H,I.style,"button");continue}if(I.type==="code"||I.type==="form")return false;let K=Et(I,V,{editing:true})??(()=>{let U=V.createElement("div");return U.className="veo-block-placeholder",U.textContent=I.type==="image"?"Imagen (sin URL)":I.type==="video"?"Video (elige proveedor y pega la URL)":"Bloque vac\xEDo",U})();K.dataset.veoBlock=H.dataset.veoBlock??String(M),K.dataset.veoBlockId=I.editorId,H.replaceWith(K);}return _e=g,ae=T,Oe(P,E),ln(P,E,T),true},_=g=>g.shadowRoot?.querySelector(".veo-card")??null,rt=g=>{let k=_(g);if(k){for(let E of k.querySelectorAll(".veo-block--selected"))E.classList.remove("veo-block--selected");k.querySelector(".veo-block-toolbar")?.remove(),k.querySelector(".veo-block-frame")?.remove();}},Oe=(g,k)=>{rt(g);let E=_(g);if(!E)return;let S=m?E.querySelector(`[data-veo-block-id="${m}"]`):null;if(!S||!m){gt(g,k);return}S.classList.add("veo-block--selected");let P=E.ownerDocument,R=getComputedStyle(E),G=Number.parseFloat(R.paddingLeft)||0,z=Number.parseFloat(R.paddingTop)||0,V=Number.parseFloat(R.paddingRight)||0,F=Number.parseFloat(R.paddingBottom)||0,T=S.parentElement,M=T?.classList.contains("veo-col")?T:null,N=M?M.offsetLeft:G,I=M?M.offsetLeft+M.offsetWidth:E.clientWidth-V,H=z,K=E.clientHeight-F,U=Math.max(N,S.offsetLeft-se),de=Math.min(I,S.offsetLeft+S.offsetWidth+se),pe=Math.max(0,de-U),$=Math.max(H,S.offsetTop-se),W=Math.min(K,S.offsetTop+S.offsetHeight+se),X=Math.max(oe,W-$),Y=P.createElement("div");Y.className="veo-block-frame",Y.setAttribute("data-veo-builder-chrome",""),Y.style.left=`${U}px`,Y.style.top=`${$}px`,Y.style.width=`${pe}px`,Y.style.height=`${X}px`,E.appendChild(Y);let j=P.createElement("div");j.className="veo-block-toolbar",j.setAttribute("data-veo-builder-chrome","");let ce=m,Te=(hn,gn,cr,dr=true)=>{let Je=P.createElement("button");Je.type="button",Je.title=gn,Je.setAttribute("aria-label",gn),Je.className=`veo-block-toolbar-${hn}`,Je.innerHTML=cr,Je.disabled=!dr,Je.addEventListener("click",vn=>{vn.preventDefault(),vn.stopPropagation(),A({type:"block-action",payload:{stepIndex:k,blockId:ce,action:hn}});}),j.appendChild(Je);},bt=ne(ae,ce);Te("edit","Editar",q.pencil),Te("duplicate","Duplicar",q.copy),Te("remove","Eliminar",q.trash),Te("move-left","Mover a la izquierda",Z.left,bt.left),Te("move-right","Mover a la derecha",Z.right,bt.right),j.style.right=`${Math.max(0,E.clientWidth-de)}px`,E.appendChild(j);let Ze=j.offsetHeight||ie;j.dataset.veoTopAbove=String($-Ze-6),j.dataset.veoTopBelow=String(W+6),j.style.top=j.dataset.veoTopAbove,gt(g,k);},Ge=g=>({left:g.offsetLeft,top:g.offsetTop,right:g.offsetLeft+g.offsetWidth,bottom:g.offsetTop+g.offsetHeight}),Ht=(g,k)=>g.left<k.right&&k.left<g.right&&g.top<k.bottom&&k.top<g.bottom,ze=g=>{let k=g.querySelector(".veo-card-toolbar"),E=g.querySelector(".veo-block-toolbar"),S=g.querySelector(".veo-row-toolbar");if(E?.dataset.veoTopAbove&&(E.style.top=`${E.dataset.veoTopAbove}px`,k&&Ht(Ge(E),Ge(k))&&(E.style.top=`${E.dataset.veoTopBelow}px`)),S?.dataset.veoRight){S.style.left="",S.style.right=`${S.dataset.veoRight}px`,S.style.top=`${S.dataset.veoTopBelow}px`;let P=[k,E].filter(G=>!!G),R=()=>P.some(G=>Ht(Ge(S),Ge(G)));R()&&(S.style.right="",S.style.left=`${S.dataset.veoLeft}px`),R()&&E&&(S.style.left="",S.style.right=`${S.dataset.veoRight}px`,S.style.top=`${Ge(E).bottom+6}px`);}},st=g=>({left:g.offsetLeft,top:g.offsetTop,right:g.offsetLeft+g.offsetWidth,bottom:g.offsetTop+g.offsetHeight}),Zt=g=>g.length===0?null:g.reduce((k,E)=>({left:Math.min(k.left,E.left),top:Math.min(k.top,E.top),right:Math.max(k.right,E.right),bottom:Math.max(k.bottom,E.bottom)})),$t=(g,k)=>{let E=F=>F.editorId?g.querySelector(`[data-veo-block-id="${F.editorId}"]`):null,S=getComputedStyle(g),P=Number.parseFloat(S.paddingLeft)||0,R=Number.parseFloat(S.paddingRight)||0,G=P,z=g.clientWidth-R;return {rows:Kt(k).map(F=>{let T=F.columns.map(K=>{let U=K.blocks.map(({block:W})=>({block:W,el:E(W)})).filter(W=>!!W.el&&!!W.block.editorId),de=Zt(U.map(W=>st(W.el)));if(!de)return null;let pe=U[0]?.el.parentElement,$=pe?.classList.contains("veo-col")?st(pe):de;return {items:U,rect:$}}).filter(K=>K!==null),M=Zt(T.map(K=>K.rect));if(!M)return null;let N=T[0]?.items[0]?.el.parentElement?.parentElement,I=N?.classList.contains("veo-row")?st(N):{...M,left:G,right:z};return {id:T[0]?.items[0]?.block.editorId,row:F.row,columns:T,rect:I}}).filter(F=>F!==null),content:{left:G,right:z}}},Ji=g=>{g.querySelector(".veo-row-frame")?.remove(),g.querySelector(".veo-row-toolbar")?.remove();},gt=(g,k)=>{let E=_(g);if(!E)return;Ji(E),ze(E);let{rows:S}=$t(E,ae),P=m?S.find($=>$.columns.some(W=>W.items.some(X=>X.block.editorId===m))):void 0,R=($e?S.find($=>$.id===$e):void 0)??P??(be?S.find($=>$.id===be):void 0);if(!R)return;let G=E.ownerDocument,z=getComputedStyle(E),V=Number.parseFloat(z.paddingTop)||0,F=Number.parseFloat(z.paddingBottom)||0,T=6,M=Math.max(0,R.rect.left-T),N=Math.min(E.clientWidth,R.rect.right+T),I=Math.max(Math.min(V,R.rect.top),R.rect.top-T),H=Math.min(Math.max(E.clientHeight-F,R.rect.bottom),R.rect.bottom+T),K=G.createElement("div");K.className="veo-row-frame",K.setAttribute("data-veo-builder-chrome",""),K.style.left=`${M}px`,K.style.top=`${I}px`,K.style.width=`${Math.max(0,N-M)}px`,K.style.height=`${Math.max(0,H-I)}px`,E.appendChild(K);let U=G.createElement("div");U.className="veo-row-toolbar",U.setAttribute("data-veo-builder-chrome","");let de=R.id,pe=($,W,X,Y)=>{let j=G.createElement("button");j.type="button",j.title=W,j.setAttribute("aria-label",W),j.className=`veo-row-toolbar-${$}`,j.innerHTML=X,Y&&j.append(Y),j.addEventListener("click",ce=>{ce.preventDefault(),ce.stopPropagation(),A({type:"row-action",payload:{stepIndex:k,blockId:de,action:$}});}),U.appendChild(j);};pe("edit","Editar fila",q.pencil,"Editar fila"),pe("duplicate","Duplicar fila",q.copy),pe("remove","Eliminar fila",q.trash),E.appendChild(U),U.dataset.veoRight=String(Math.max(0,E.clientWidth-N)),U.dataset.veoLeft=String(M),U.dataset.veoTopBelow=String(H+6),ze(E);},Io=(g,k)=>{let E=_(g);if(!E)return;if(E.querySelector(".veo-card-frame")?.remove(),E.querySelector(".veo-card-toolbar")?.remove(),!De){ze(E);return}let S=E.ownerDocument,P=S.createElement("div");P.className="veo-card-frame",P.setAttribute("data-veo-builder-chrome",""),E.appendChild(P);let R=S.createElement("div");R.className="veo-card-toolbar",R.setAttribute("data-veo-builder-chrome","");let G=(z,V,F)=>{let T=S.createElement("button");T.type="button",T.className=`veo-card-toolbar-${z}${F?" is-active":""}`,T.setAttribute("aria-pressed",F?"true":"false"),T.textContent=V,T.addEventListener("click",M=>{M.preventDefault(),M.stopPropagation(),A({type:"card-action",payload:{stepIndex:k,action:z}});}),R.appendChild(T);};G("edit-container","Editar contenedor",le==="step"),G("edit-rows","Editar filas",le==="structure"),E.appendChild(R),R.style.top=`${-Math.round((R.offsetHeight||34)/2)}px`,ze(E);},Qi=(g,k)=>{let E=P=>{let R=_(g);if(!R)return;let G=P.composedPath().some(H=>H instanceof Element&&(H.classList.contains("veo-card")||H.classList.contains("veo-card-toolbar")));if(G!==De&&(De=G,Io(g,k)),P.composedPath().some(H=>H instanceof Element&&H.classList.contains("veo-row-toolbar")))return;let z=R.getBoundingClientRect(),V=P.clientX-z.left-R.clientLeft,F=P.clientY-z.top-R.clientTop,T=R.querySelector(".veo-row-toolbar");if(T&&V>=T.offsetLeft-10&&V<=T.offsetLeft+T.offsetWidth+10&&F>=T.offsetTop-14&&F<=T.offsetTop+T.offsetHeight+10)return;let M=6,I=$t(R,ae).rows.find(H=>V>=H.rect.left-M&&V<=H.rect.right+M&&F>=H.rect.top-M&&F<=H.rect.bottom+M)?.id??null;I!==be&&(be=I,gt(g,k));},S=()=>{De&&(De=false,Io(g,k)),be!==null&&(be=null,gt(g,k));};return g.addEventListener("mousemove",E),g.addEventListener("mouseleave",S),()=>{g.removeEventListener("mousemove",E),g.removeEventListener("mouseleave",S);}},ln=(g,k,E)=>{let S=_(g);if(!S)return;for(let M of S.querySelectorAll(".veo-gap"))M.remove();let P=S.ownerDocument,R=18,G=4,z=(M,N,I,H,K,U,de,pe)=>{let $=P.createElement("div");$.className=`veo-gap veo-gap--${M}`,$.setAttribute("data-veo-builder-chrome",""),$.dataset.veoGapAction=pe,$.style.left=`${N}px`,$.style.top=`${I}px`,$.style.width=`${Math.max(H,R)}px`,$.style.height=`${Math.max(K,R)}px`;let W=P.createElement("i"),X=P.createElement("button");X.type="button",X.title=U,X.setAttribute("aria-label",U),X.textContent="+",X.addEventListener("click",Y=>{Y.preventDefault(),Y.stopPropagation(),A({type:"block-layout",payload:{stepIndex:k,blockId:de,action:pe}});}),$.append(W,X),S.appendChild($);},{rows:V,content:F}=$t(S,E);if(V.length===0)return;let T=F.right-F.left;V.forEach((M,N)=>{let I=M.columns[0]?.items[0]?.block.editorId;if(N===0)z("h",F.left,M.rect.top-G-R,T,R,"Agregar fila",I,"row-before");else {let K=(V[N-1].rect.bottom+M.rect.top)/2-R/2;z("h",F.left,K,T,R,"Agregar fila",I,"row-before");}N===V.length-1&&z("h",F.left,M.rect.bottom+G,T,R,"Agregar fila",I,"row-after");});for(let M of V){let N=M.rect.bottom-M.rect.top;M.columns.forEach((I,H)=>{let K=I.items[0]?.block.editorId;if(H===0)z("v",M.rect.left-G-R,M.rect.top,R,N,"Agregar columna",K,"col-before");else {let de=(M.columns[H-1].rect.right+I.rect.left)/2-R/2;z("v",de,M.rect.top,R,N,"Agregar columna",K,"col-before");}H===M.columns.length-1&&z("v",M.rect.right+G,M.rect.top,R,N,"Agregar columna",K,"col-after");});}for(let M of V)for(let N of M.columns){let I=N.rect.right-N.rect.left;N.items.forEach((H,K)=>{let U=N.items[K+1];if(U){let de=st(H.el),pe=st(U.el),$=(de.bottom+pe.top)/2-R/2;z("h",N.rect.left,$,I,R,"Agregar bloque",H.block.editorId,"stack-after");}else M.columns.length>1&&N.rect.bottom<M.rect.bottom-R&&z("h",N.rect.left,N.rect.bottom+G,I,R,"Agregar bloque",H.block.editorId,"stack-after");});}},er=(g,k)=>{let E=null,S=R=>{E={x:R.clientX,y:R.clientY};},P=R=>{let G=R.composedPath();if(G.some(T=>T instanceof Element&&(T.classList.contains("veo-block-toolbar")||T.classList.contains("veo-row-toolbar")||T.classList.contains("veo-card-toolbar")||T.classList.contains("veo-gap")))||!G.some(T=>T instanceof Element&&T.classList.contains("veo-card"))||E&&Math.hypot(R.clientX-E.x,R.clientY-E.y)>4)return;let V=G.find(T=>T instanceof HTMLElement&&!!T.dataset.veoBlockId);if(V){G.some(T=>T instanceof Element&&T.matches("button, a"))&&(R.preventDefault(),R.stopPropagation()),m=V.dataset.veoBlockId??null,Oe(g,k),m&&A({type:"block-clicked",payload:{stepIndex:k,blockId:m}});return}G.some(T=>T instanceof Element&&T.matches("button, a, input, textarea, select, label, [contenteditable]"))||(m=null,rt(g),gt(g,k),A({type:"card-clicked",payload:{stepIndex:k}}));};return g.addEventListener("mousedown",S,true),g.addEventListener("click",P,true),()=>{g.removeEventListener("mousedown",S,true),g.removeEventListener("click",P,true);}},tr=(g,k)=>{let E=Array.from(document.querySelectorAll(`[${_o}="${k}"]`));if(E.length===0)return null;let S=document,P=S.createElement("div");P.setAttribute("data-veo-builder-chrome",""),P.style.cssText="position:fixed;left:0;top:0;width:0;height:0;z-index:2147483646;",P.style.display="none";let R=P.attachShadow({mode:"open"}),G=S.createElement("style");G.textContent=co,R.appendChild(G);let z=S.createElement("div");z.className="veo-block-frame",z.style.position="fixed";let V=S.createElement("div");V.className="veo-block-toolbar",V.style.position="fixed";let F=($,W,X,Y=true)=>{let j=S.createElement("button");j.type="button",j.title=W,j.setAttribute("aria-label",W),j.className=`veo-block-toolbar-${$}`,j.innerHTML=X,j.disabled=!Y,j.addEventListener("click",ce=>{ce.preventDefault(),ce.stopPropagation(),A({type:"block-action",payload:{stepIndex:g,blockId:k,action:$}});}),V.appendChild(j);};F("edit","Editar",q.pencil),F("duplicate","Duplicar",q.copy,false),F("remove","Eliminar",q.trash),F("move-left","Mover a la izquierda",Z.left,false),F("move-right","Mover a la derecha",Z.right,false),z.style.display="none",V.style.display="none";let T=18,M=4,N=($,W,X)=>{let Y=S.createElement("div");Y.className=`veo-gap veo-gap--${$}`,Y.style.position="fixed",Y.dataset.veoGapAction=X;let j=S.createElement("i"),ce=S.createElement("button");return ce.type="button",ce.title=W,ce.setAttribute("aria-label",W),ce.textContent="+",ce.addEventListener("click",Te=>{Te.preventDefault(),Te.stopPropagation(),A({type:"block-layout",payload:{stepIndex:g,blockId:k,action:X}});}),Y.append(j,ce),Y},I={top:N("h","Agregar fila","row-before"),bottom:N("h","Agregar fila","row-after"),left:N("v","Agregar columna","col-before"),right:N("v","Agregar columna","col-after")};R.append(z,V,I.top,I.bottom,I.left,I.right),S.body.appendChild(P),P.style.display="";let H=false,K=($,W,X,Y,j)=>{$.style.left=`${W}px`,$.style.top=`${X}px`,$.style.width=`${Y}px`,$.style.height=`${j}px`;},U=()=>{let $=E.filter(bt=>bt.isConnected);if($.length===0)return;let W=Number.POSITIVE_INFINITY,X=Number.POSITIVE_INFINITY,Y=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let bt of $){let Ze=bt.getBoundingClientRect();Ze.width===0&&Ze.height===0||(W=Math.min(W,Ze.left),X=Math.min(X,Ze.top),Y=Math.max(Y,Ze.right),j=Math.max(j,Ze.bottom));}if(!Number.isFinite(W)||(K(I.top,W,X-M-T,Y-W,T),K(I.bottom,W,j+M,Y-W,T),K(I.left,W-M-T,X,T,j-X),K(I.right,Y+M,X,T,j-X),!H))return;K(z,W,X,Y-W,j-X);let ce=V.offsetHeight||ie,Te=V.offsetWidth;V.style.left=`${Math.max(0,Y-Te)}px`,V.style.top=`${Math.max(0,X-ce-6)}px`;},de=$=>{H=$===k,z.style.display=H?"":"none",V.style.display=H?"":"none",U();};U();let pe=$=>{let W=$.composedPath();E.some(X=>W.includes(X))&&(W.some(X=>X instanceof Element&&X.matches("button, a"))&&($.preventDefault(),$.stopPropagation()),m=k,de(k),A({type:"block-clicked",payload:{stepIndex:g,blockId:k}}));};return S.addEventListener("click",pe,true),window.addEventListener("scroll",U,true),window.addEventListener("resize",U),{select:de,detach:()=>{S.removeEventListener("click",pe,true),window.removeEventListener("scroll",U,true),window.removeEventListener("resize",U),P.remove();}}},Xe=g=>{let k=!g.honorTrigger;if(k&&(Ye(),Fe(),y=true,b=false),f=k?{...g,honorTrigger:true}:g,!O(g)){Fe(),te(),ee({state:"page-mismatch",pattern:D(g)?.pageLocation?.pattern??""});return}let E=g.guide.activationRules?.devices;if(!k&&v&&E&&!Rn(E)){Fe(),te(),ee({state:"device-mismatch",devices:E});return}nr(f);},Ye=()=>{x?.(),x=null;},Fe=()=>{w&&clearTimeout(w),w=null;},cn=(g,k)=>{Ye();let E=S=>{let P=S.target;if(P instanceof Element&&!P.closest("[data-veo-builder-chrome],[data-veo-builder-panel],[data-veo-picker]")){try{if(!P.closest(g))return}catch{return}Ye(),y=true,b=false,f&&Xe(f);}};document.addEventListener("click",E,true),k==="on_hover"&&document.addEventListener("mouseover",E,true),x=()=>{document.removeEventListener("click",E,true),document.removeEventListener("mouseover",E,true);},ee({state:"waiting-trigger",trigger:k,selector:g});},or=g=>{Fe(),w=setTimeout(()=>{w=null,y=true,f&&Xe(f);},g),ee({state:"waiting-delay",delayMs:g});},nr=g=>{if(g.editable&&!v&&Po(g)){d=g.guide.startStepIndex??0;return}B(),d=g.guide.startStepIndex??0;let k=g.guide.activationRules,E=k?.trigger,S=k?.selector?.trim(),P=g.honorTrigger&&!y&&v,R=(E==="on_click"||E==="on_hover")&&(!Ot(k)||b);if(P&&R&&S){Fe(),qe(),cn(S,E);return}let G=Mn(k);if(P&&G>0){Ye(),qe(),w||or(G);return}Ye(),Fe();let z=ha(),V=ko({...g.guide,...z?{fetchProgress:z}:{},onClosed:()=>{if(B(),_e=null,y=false,b=true,v){let F=f?.guide.activationRules,T=F?.trigger,M=F?.selector?.trim();(T==="on_click"||T==="on_hover")&&M&&cn(M,T);}}});g.honorTrigger&&ee({state:"shown"}),!(!g.editable||v)&&V.ready.then(F=>{if(!F.rendered)return;let T=V.host();if(!T){let N=g.guide.startStepIndex??0,I=g.guide.guideSteps[N]?.blocks?.[0];I?.type==="code"&&I.editorId&&(p=tr(N,I.editorId),p?.select(m));return}T.classList.add("veo-no-anim"),_e=g,c=er(T,g.guide.startStepIndex??0);let M=g.guide.guideSteps[g.guide.startStepIndex??0]?.blocks??[];ae=M,Oe(T,g.guide.startStepIndex??0),ln(T,g.guide.startStepIndex??0,M),Bt=Qi(T,g.guide.startStepIndex??0),l=Vi({host:T,guideType:g.guide.guideType,stepIndex:g.guide.startStepIndex??0,onCommit:N=>A({type:"design-updated",payload:N}),onGestureEnd:()=>{if(!h)return;let N=h;h=null,Xe(N);}}),a=yn({host:T,stepIndex:g.guide.startStepIndex??0,onDrop:N=>A({type:"block-dropped",payload:N})});});},Jt=()=>{u?.remove(),u=null;},ir=(g,k,E)=>{u||(u=document.createElement("div"),u.style.cssText="position:fixed;padding:4px 10px;border-radius:999px;background:#1c1917;color:#fff;font:12px/1.4 system-ui,sans-serif;box-shadow:0 4px 14px rgba(0,0,0,0.35);border:1px solid rgba(255,255,255,0.25);pointer-events:none;z-index:2147483647;",document.body.appendChild(u)),u.textContent=E,u.style.left=`${g+14}px`,u.style.top=`${k+12}px`;},rr=g=>{let k=i?.frameRect();if(!k||!a){g.phase!=="move"&&Jt(),a?.cancelHover();return}let E=k.left+g.x,S=k.top+g.y;if(g.phase==="move"){ir(E,S,g.label||g.blockType),a.hoverAt(E,S);return}if(Jt(),g.phase==="cancel"){a.cancelHover();return}let P=a.dropAt(E,S);P&&A({type:"block-dropped",payload:{stepIndex:d,blockType:g.blockType,...P}});},sr=g=>{switch(g.type){case "panel-ready":A(r?{type:"ready",chrome:true}:{type:"ready"});break;case "editor-state":if(r?.setState(g.state),le!==g.state.section){le=g.state.section;let k=document.querySelector("[data-veo-guide]");k&&De&&!v&&Io(k,d);}i?.setTitle(g.state.section==="activation"?"Ajustes de activaci\xF3n":g.state.section==="badge"?"Ajustes de badge":g.state.section==="target"?"Ajustes del elemento objetivo":g.state.section==="row"?"Editar fila":g.state.blockLabel?`Editor \xB7 ${g.state.blockLabel}`:g.state.steps[g.state.activeStep]?.label??"Paso");break;case "panel-visibility":i?.setVisible(g.visible);break;case "panel-size":i?.setSize(g.size);break;case "start-picker":{n?.stop();let k=i?.isVisible()??false;k&&i?.setVisible(false),r?.setHidden(true);let E=f;E&&(B(),qe());let S=()=>{r?.setHidden(false),k&&i?.setVisible(true),E&&f===E&&Xe(E);};n=Ro({onPick:P=>{n=null,S(),A({type:"picked",payload:P});},onCancel:()=>{n=null,S(),A({type:"pick-cancelled"});},...g.maxAncestors!==void 0?{maxAncestors:g.maxAncestors}:{},...g.hint!==void 0?{hint:g.hint}:{}});break}case "stop-picker":n?.stop(),n=null,r?.setHidden(false);break;case "preview":if(!g.guide)break;l?.isDragging()?h=g:Xe(g);break;case "block-drag":rr(g);break;case "select-block":{m=g.blockId;let k=document.querySelector("[data-veo-guide]");k&&!v&&Oe(k,d),v||p?.select(g.blockId);break}case "select-row":{$e=g.blockId;let k=document.querySelector("[data-veo-guide]");k&&!v&&gt(k,d);break}case "close-preview":B(),Jt(),h=null,f=null,Ye(),Fe(),y=false,b=false,qe();break;case "teardown":Bo();break}},dn=g=>{if(g.origin!==o)return;let k=g.data;!k||k.source!==Mt||k.token!==e||sr(k);},pn=()=>A({type:"closed"}),vt=()=>{f&&!l?.isDragging()&&Xe(f);},un=window.history.pushState,mn=window.history.replaceState,ar=()=>{window.history.pushState=function(...k){let E=un.apply(this,k);return vt(),E},window.history.replaceState=function(...k){let E=mn.apply(this,k);return vt(),E},window.addEventListener("popstate",vt),window.addEventListener("hashchange",vt);},lr=()=>{window.history.pushState=un,window.history.replaceState=mn,window.removeEventListener("popstate",vt),window.removeEventListener("hashchange",vt);},Bo=()=>{window.removeEventListener("message",dn),window.removeEventListener("pagehide",pn),lr(),n?.stop(),n=null,B(),Jt(),h=null,Ye(),Fe(),qe(),A({type:"closed"}),i?.teardown(),i=null,r?.teardown(),r=null,An();};if(t.panel)r=zi({appLabel:window.location.hostname,onAction:g=>{switch(g.action){case "dock":i?.setTopOffset(g.position==="top"?r?.height()??0:0);return;case "show-panel":i?.setVisible(true);return;case "preview":if(v)return;v=true,y=false,b=false,C=i?.isVisible()??true,i?.setVisible(false),r?.setPreview(true),f&&Xe(f);return;case "exit-preview":if(!v)return;v=false,Ye(),Fe(),r?.setPreview(false),i?.setVisible(C),f&&Xe(f);return;case "select-activation":case "select-step":case "add-step":i?.setVisible(true);break}A({type:"chrome-action",payload:g});}}),i=Fi({dashboardOrigin:o,token:e,appOrigin:window.location.origin,guide:t.guide,panelPath:t.panelPath,onClose:()=>Bo(),topOffset:r.height()}),r.onHeightChange(g=>i?.setTopOffset(r?.dock()==="top"?g:0));else if(s=ma(),!s)return null;let fn=()=>{window.addEventListener("message",dn),window.addEventListener("pagehide",pn),ar(),t.panel||A({type:"ready"});},Qt=window.__veoBuilder;return !t.panel&&Qt?.apiKey&&Qt?.apiUrl?ua(Qt.apiUrl,Qt.apiKey,e).then(g=>{g?fn():window.console&&console.warn("[veo] token de builder inv\xE1lido \u2014 modo no activado");}):fn(),{teardown:Bo}}async function ua(t,e,o){try{let n=`${t.replace(/\/+$/,"")}/v1/builder/verify`,i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":e},body:JSON.stringify({token:o})});return i.ok?(await i.json().catch(()=>null))?.valid!==!1:!0}catch{return true}}function ma(){return window.opener&&window.opener!==window?window.opener:window.parent&&window.parent!==window?window.parent:null}function fa(t){if(t)try{return new URL(t).origin}catch{return null}if(Ce()&&document.referrer)try{return new URL(document.referrer).origin}catch{return null}return null}function ha(){let t=window.__veoBuilder;if(!t?.apiKey||!t?.apiUrl)return;let e=t.apiUrl.replace(/\/+$/,""),o=t.apiKey;return async n=>{let i=new URLSearchParams({endUserId:"veo_preview",guideIds:n.join(","),includeUnpublished:"1"}),r=await fetch(`${e}/v1/guides/progress?${i}`,{headers:{"X-Api-Key":o}});return r.ok?(await r.json()).items??[]:[]}}var ga="popup,width=1280,height=860",va=600;function Zi(t){if(!ye())return xa();let e=t.dashboardOrigin??window.location.origin,o=ya(t.appUrl),n=ba(t.appUrl,t.token,e),i=t.frame??null,r=i!==null,s=null;r?i.src=n:s=window.open(n,t.windowName??"veo-builder",t.windowFeatures??ga);let l=()=>r?i?.contentWindow??null:s,a=u=>{let d=l();d&&(!r&&s?.closed||d.postMessage({source:Mt,token:t.token,...u},o??"*"));},c,p=()=>{window.removeEventListener("message",m),c!==void 0&&(clearInterval(c),c=void 0);},m=u=>{if(o&&u.origin!==o)return;let d=u.data;if(!(!d||d.source!==Mt||d.token!==t.token))switch(d.type){case "ready":t.onReady?.();break;case "picked":d.payload&&t.onPicked?.(d.payload);break;case "pick-cancelled":t.onCancelled?.();break;case "closed":p(),t.onClosed?.();break}};return window.addEventListener("message",m),r||(c=setInterval(()=>{s?.closed&&(p(),t.onClosed?.());},va)),{startPicker:u=>a({type:"start-picker",...u?.maxAncestors!==void 0?{maxAncestors:u.maxAncestors}:{},...u?.hint!==void 0?{hint:u.hint}:{}}),stopPicker:()=>a({type:"stop-picker"}),preview:u=>a({type:"preview",guide:u}),closePreview:()=>a({type:"close-preview"}),close:()=>{a({type:"teardown"}),r?i&&(i.src="about:blank"):s&&!s.closed&&s.close(),p();}}}function ba(t,e,o){try{let n=new URL(t,window.location.href);return n.searchParams.set(Qe,e),n.searchParams.set(yt,o),n.toString()}catch{return t}}function ya(t){try{return new URL(t,window.location.href).origin}catch{return null}}function xa(){return {startPicker:()=>{},stopPicker:()=>{},preview:()=>{},closePreview:()=>{},close:()=>{}}}Mo();
902
- exports.closeGuidePreview=qe;exports.createBuilderSession=Zi;exports.initBuilderMode=Mo;exports.previewGuide=ko;exports.startElementPicker=Ro;exports.stopElementPicker=Yi;return exports;})({});//# sourceMappingURL=veo-builder.js.map
901
+ `,ma='<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" aria-hidden="true"><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 3.75H6A2.25 2.25 0 0 0 3.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0 1 20.25 6v1.5m0 9V18A2.25 2.25 0 0 1 18 20.25h-1.5m-9 0H6A2.25 2.25 0 0 1 3.75 18v-1.5M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>',ln=class{constructor(){this.host=null;this.box=null;this.label=null;this.current=null;this.maxAncestors=Yi;this.onPick=null;this.onCancel=null;this.onMove=e=>{let o=e.target;!(o instanceof Element)||this.isOwn(o)||(this.current=o,this.draw(o));};this.onClick=e=>{if(e.altKey)return;let o=this.current??(e.target instanceof Element?e.target:null);if(!o||this.isOwn(o))return;e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation();let n=this.describe(o),i=this.onPick;this.stop(),i?.(n);};this.onKey=e=>{if(e.key!=="Escape")return;e.preventDefault(),e.stopPropagation();let o=this.onCancel;this.stop(),o?.();};this.swallow=e=>{e.altKey||this.isOwn(e.target)||(e.preventDefault(),e.stopPropagation());};this.reposition=()=>{this.current&&this.draw(this.current);};}start(e){this.stop(),this.maxAncestors=e.maxAncestors??Yi,this.onPick=e.onPick,this.onCancel=e.onCancel??null;let o=document.createElement("div");o.setAttribute(pa,"");let n=o.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=ua,this.box=document.createElement("div"),this.box.className="veo-pick-box",this.box.style.display="none",this.label=document.createElement("div"),this.label.className="veo-pick-label",this.label.style.display="none";let r=document.createElement("div");r.className="veo-pick-hint";let s=document.createElement("span");s.className="veo-pick-hint-icon",s.innerHTML=ma;let l=document.createElement("div");l.className="veo-pick-hint-text";let a=document.createElement("span");a.className="veo-pick-hint-title",a.textContent=e.hint??"Selecciona un elemento existente para colocar la gu\xEDa.";let c=document.createElement("span");c.className="veo-pick-hint-sub",c.textContent=e.subhint??"Usa Alt + clic u Opci\xF3n + clic para abrir men\xFAs y desplegables.",l.append(a,c);let p=document.createElement("button");p.className="veo-pick-cancel",p.type="button",p.textContent="Cancelar",p.addEventListener("click",m=>{m.stopPropagation();let u=this.onCancel;this.stop(),u?.();}),r.append(s,l,p),n.append(i,this.box,this.label,r),document.body.appendChild(o),this.host=o,document.addEventListener("mousemove",this.onMove,true),document.addEventListener("click",this.onClick,true),document.addEventListener("mousedown",this.swallow,true),document.addEventListener("mouseup",this.swallow,true),document.addEventListener("keydown",this.onKey,true),window.addEventListener("scroll",this.reposition,true),window.addEventListener("resize",this.reposition);}stop(){document.removeEventListener("mousemove",this.onMove,true),document.removeEventListener("click",this.onClick,true),document.removeEventListener("mousedown",this.swallow,true),document.removeEventListener("mouseup",this.swallow,true),document.removeEventListener("keydown",this.onKey,true),window.removeEventListener("scroll",this.reposition,true),window.removeEventListener("resize",this.reposition),this.host?.parentNode&&this.host.parentNode.removeChild(this.host),this.host=null,this.box=null,this.label=null,this.current=null,this.onPick=null,this.onCancel=null;}isOwn(e){return e instanceof Node&&this.host!==null&&this.host.contains(e)}draw(e){if(!this.box||!this.label)return;let o=e.getBoundingClientRect();this.box.style.display="block",this.box.style.top=`${o.top}px`,this.box.style.left=`${o.left}px`,this.box.style.width=`${o.width}px`,this.box.style.height=`${o.height}px`;let n=Ao(e,0);this.label.textContent="";let i=document.createElement("div");i.className="veo-pick-sel",i.textContent=n;let r=document.createElement("div");r.className="veo-pick-dim",r.textContent=`${Math.round(o.width)} \xD7 ${Math.round(o.height)}`,this.label.append(i,r),this.label.style.display="block";let s=48,l=o.bottom+8+s>window.innerHeight;this.label.style.top=l?`${Math.max(8,o.top-s-8)}px`:`${o.bottom+8}px`,this.label.style.left=`${Math.max(8,o.left)}px`;}describe(e){let o=e.getBoundingClientRect();return {selector:Ao(e,this.maxAncestors),shortSelector:Ao(e,0),tag:e.tagName.toLowerCase(),id:e.id||null,classes:To(e),text:(e.textContent??"").trim().slice(0,120),rect:{x:Math.round(o.left),y:Math.round(o.top),width:Math.round(o.width),height:Math.round(o.height)}}}},Yt=null;function Mo(t){return Ce()?(Yt||(Yt=new ln),Yt.start(t),{stop:()=>Yt?.stop()}):{stop:()=>{}}}function Zi(){Yt?.stop();}function Ro(){if(!ye()||!Ce())return null;let t=An();if(!t)return null;let e=t.token,o=ha(t.origin);if(!o)return null;let n=null,i=null,r=null,s=null,l=null,a=null,c=null,p=null,m=null,u=null,d=0,g=null,f=null,v=false,x=null,y=false,w=null,b=false,C=true,L=()=>i?i.target():s,A=h=>{L()?.postMessage({source:Rt,token:e,...h},o);},D=h=>h.guide.guideSteps?.[h.guide.startStepIndex??0],O=h=>Gi(D(h)?.pageLocation,window.location.href),ee=h=>A({type:"preview-status",payload:h}),B=()=>{l?.detach(),l=null,a?.detach(),a=null,c?.(),c=null,Bt?.(),Bt=null,be=null,De=false,p?.detach(),p=null,_e=null;},te=()=>{B(),_e=null,qe();},se=4,oe=0,ie=30,q={pencil:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"/></svg>',copy:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"/></svg>',trash:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/></svg>'},Z={left:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M19.5 12h-15m0 0 6.75 6.75M4.5 12l6.75-6.75"/></svg>',right:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4.5 12h15m0 0-6.75-6.75M19.5 12l-6.75 6.75"/></svg>'},ne=(h,k)=>{for(let E of Kt(h))for(let S=0;S<E.columns.length;S++)if(E.columns[S].blocks.some(M=>M.block.editorId===k))return {left:S>0,right:S<E.columns.length-1};return {left:false,right:false}},ae=[],be=null,$e=null,Bt=null,De=false,le=null,_e=null,Nt=h=>{if(!h)return "";let{blocks:k,...E}=h;return JSON.stringify({rest:E,blocks:(k??[]).map(S=>{let{text:P,html:M,style:G,...z}=S;return z})})},Po=h=>{let k=_e;if(!k||h.guide.guideType!=="composite"||k.guide.guideType!=="composite")return false;let E=h.guide.startStepIndex??0;if((k.guide.startStepIndex??0)!==E)return false;let S=R=>JSON.stringify({...R,guideSteps:void 0});if(S(k.guide)!==S(h.guide)||k.editable!==h.editable)return false;let P=document.querySelector("[data-veo-guide]"),M=P?_(P):null;if(!P||!M)return false;let G=k.guide.guideSteps[E],z=h.guide.guideSteps[E];if(!G||!z||Nt(G)!==Nt(z))return false;let V=M.ownerDocument,F=G.blocks??[],T=z.blocks??[];for(let R=0;R<T.length;R++){let N=F[R],I=T[R];if(N.text===I.text&&N.html===I.html&&JSON.stringify(N.style)===JSON.stringify(I.style))continue;if(!I.editorId)return false;let H=M.querySelector(`[data-veo-block-id="${I.editorId}"]`);if(!H)return false;if(I.type==="button"){H.textContent=I.text?.trim()||"OK",H.removeAttribute("style"),H.classList.remove("veo-guide-cta--secondary","veo-guide-cta--link");let W=I.style??{};(W.preset==="secondary"||W.preset==="link")&&H.classList.add(`veo-guide-cta--${W.preset}`),typeof W.ariaLabel=="string"&&W.ariaLabel.trim()?H.setAttribute("aria-label",W.ariaLabel.trim()):H.removeAttribute("aria-label"),Ae(H,I.style,"button");continue}if(I.type==="code"||I.type==="form")return false;let K=Et(I,V,{editing:true})??(()=>{let W=V.createElement("div");return W.className="veo-block-placeholder",W.textContent=I.type==="image"?"Imagen (sin URL)":I.type==="video"?"Video (elige proveedor y pega la URL)":"Bloque vac\xEDo",W})();K.dataset.veoBlock=H.dataset.veoBlock??String(R),K.dataset.veoBlockId=I.editorId,H.replaceWith(K);}return _e=h,ae=T,Oe(P,E),cn(P,E,T),true},_=h=>h.shadowRoot?.querySelector(".veo-card")??null,rt=h=>{let k=_(h);if(k){for(let E of k.querySelectorAll(".veo-block--selected"))E.classList.remove("veo-block--selected");k.querySelector(".veo-block-toolbar")?.remove(),k.querySelector(".veo-block-frame")?.remove();}},Oe=(h,k)=>{rt(h);let E=_(h);if(!E)return;let S=m?E.querySelector(`[data-veo-block-id="${m}"]`):null;if(!S||!m){ht(h,k);return}S.classList.add("veo-block--selected");let P=E.ownerDocument,M=getComputedStyle(E),G=Number.parseFloat(M.paddingLeft)||0,z=Number.parseFloat(M.paddingTop)||0,V=Number.parseFloat(M.paddingRight)||0,F=Number.parseFloat(M.paddingBottom)||0,T=S.parentElement,R=T?.classList.contains("veo-col")?T:null,N=R?R.offsetLeft:G,I=R?R.offsetLeft+R.offsetWidth:E.clientWidth-V,H=z,K=E.clientHeight-F,W=Math.max(N,S.offsetLeft-se),de=Math.min(I,S.offsetLeft+S.offsetWidth+se),pe=Math.max(0,de-W),$=Math.max(H,S.offsetTop-se),U=Math.min(K,S.offsetTop+S.offsetHeight+se),X=Math.max(oe,U-$),Y=P.createElement("div");Y.className="veo-block-frame",Y.setAttribute("data-veo-builder-chrome",""),Y.style.left=`${W}px`,Y.style.top=`${$}px`,Y.style.width=`${pe}px`,Y.style.height=`${X}px`,E.appendChild(Y);let j=P.createElement("div");j.className="veo-block-toolbar",j.setAttribute("data-veo-builder-chrome","");let ce=m,Te=(hn,vn,dr,pr=true)=>{let Je=P.createElement("button");Je.type="button",Je.title=vn,Je.setAttribute("aria-label",vn),Je.className=`veo-block-toolbar-${hn}`,Je.innerHTML=dr,Je.disabled=!pr,Je.addEventListener("click",bn=>{bn.preventDefault(),bn.stopPropagation(),A({type:"block-action",payload:{stepIndex:k,blockId:ce,action:hn}});}),j.appendChild(Je);},bt=ne(ae,ce);Te("edit","Editar",q.pencil),Te("duplicate","Duplicar",q.copy),Te("remove","Eliminar",q.trash),Te("move-left","Mover a la izquierda",Z.left,bt.left),Te("move-right","Mover a la derecha",Z.right,bt.right),j.style.right=`${Math.max(0,E.clientWidth-de)}px`,E.appendChild(j);let Ze=j.offsetHeight||ie;j.dataset.veoTopAbove=String($-Ze-6),j.dataset.veoTopBelow=String(U+6),j.style.top=j.dataset.veoTopAbove,ht(h,k);},Ge=h=>({left:h.offsetLeft,top:h.offsetTop,right:h.offsetLeft+h.offsetWidth,bottom:h.offsetTop+h.offsetHeight}),Ht=(h,k)=>h.left<k.right&&k.left<h.right&&h.top<k.bottom&&k.top<h.bottom,ze=h=>{let k=h.querySelector(".veo-card-toolbar"),E=h.querySelector(".veo-block-toolbar"),S=h.querySelector(".veo-row-toolbar");if(E?.dataset.veoTopAbove&&(E.style.top=`${E.dataset.veoTopAbove}px`,k&&Ht(Ge(E),Ge(k))&&(E.style.top=`${E.dataset.veoTopBelow}px`)),S?.dataset.veoRight){S.style.left="",S.style.right=`${S.dataset.veoRight}px`,S.style.top=`${S.dataset.veoTopBelow}px`;let P=[k,E].filter(G=>!!G),M=()=>P.some(G=>Ht(Ge(S),Ge(G)));M()&&(S.style.right="",S.style.left=`${S.dataset.veoLeft}px`),M()&&E&&(S.style.left="",S.style.right=`${S.dataset.veoRight}px`,S.style.top=`${Ge(E).bottom+6}px`);}},st=h=>({left:h.offsetLeft,top:h.offsetTop,right:h.offsetLeft+h.offsetWidth,bottom:h.offsetTop+h.offsetHeight}),Zt=h=>h.length===0?null:h.reduce((k,E)=>({left:Math.min(k.left,E.left),top:Math.min(k.top,E.top),right:Math.max(k.right,E.right),bottom:Math.max(k.bottom,E.bottom)})),$t=(h,k)=>{let E=F=>F.editorId?h.querySelector(`[data-veo-block-id="${F.editorId}"]`):null,S=getComputedStyle(h),P=Number.parseFloat(S.paddingLeft)||0,M=Number.parseFloat(S.paddingRight)||0,G=P,z=h.clientWidth-M;return {rows:Kt(k).map(F=>{let T=F.columns.map(K=>{let W=K.blocks.map(({block:U})=>({block:U,el:E(U)})).filter(U=>!!U.el&&!!U.block.editorId),de=Zt(W.map(U=>st(U.el)));if(!de)return null;let pe=W[0]?.el.parentElement,$=pe?.classList.contains("veo-col")?st(pe):de;return {items:W,rect:$}}).filter(K=>K!==null),R=Zt(T.map(K=>K.rect));if(!R)return null;let N=T[0]?.items[0]?.el.parentElement?.parentElement,I=N?.classList.contains("veo-row")?st(N):{...R,left:G,right:z};return {id:T[0]?.items[0]?.block.editorId,row:F.row,columns:T,rect:I}}).filter(F=>F!==null),content:{left:G,right:z}}},Qi=h=>{h.querySelector(".veo-row-frame")?.remove(),h.querySelector(".veo-row-toolbar")?.remove();},ht=(h,k)=>{let E=_(h);if(!E)return;Qi(E),ze(E);let{rows:S}=$t(E,ae),P=m?S.find($=>$.columns.some(U=>U.items.some(X=>X.block.editorId===m))):void 0,M=($e?S.find($=>$.id===$e):void 0)??P??(be?S.find($=>$.id===be):void 0);if(!M)return;let G=E.ownerDocument,z=getComputedStyle(E),V=Number.parseFloat(z.paddingTop)||0,F=Number.parseFloat(z.paddingBottom)||0,T=6,R=Math.max(0,M.rect.left-T),N=Math.min(E.clientWidth,M.rect.right+T),I=Math.max(Math.min(V,M.rect.top),M.rect.top-T),H=Math.min(Math.max(E.clientHeight-F,M.rect.bottom),M.rect.bottom+T),K=G.createElement("div");K.className="veo-row-frame",K.setAttribute("data-veo-builder-chrome",""),K.style.left=`${R}px`,K.style.top=`${I}px`,K.style.width=`${Math.max(0,N-R)}px`,K.style.height=`${Math.max(0,H-I)}px`,E.appendChild(K);let W=G.createElement("div");W.className="veo-row-toolbar",W.setAttribute("data-veo-builder-chrome","");let de=M.id,pe=($,U,X,Y)=>{let j=G.createElement("button");j.type="button",j.title=U,j.setAttribute("aria-label",U),j.className=`veo-row-toolbar-${$}`,j.innerHTML=X,Y&&j.append(Y),j.addEventListener("click",ce=>{ce.preventDefault(),ce.stopPropagation(),A({type:"row-action",payload:{stepIndex:k,blockId:de,action:$}});}),W.appendChild(j);};pe("edit","Editar fila",q.pencil,"Editar fila"),pe("duplicate","Duplicar fila",q.copy),pe("remove","Eliminar fila",q.trash),E.appendChild(W),W.dataset.veoRight=String(Math.max(0,E.clientWidth-N)),W.dataset.veoLeft=String(R),W.dataset.veoTopBelow=String(H+6),ze(E);},Io=(h,k)=>{let E=_(h);if(!E)return;if(E.querySelector(".veo-card-frame")?.remove(),E.querySelector(".veo-card-toolbar")?.remove(),!De){ze(E);return}let S=E.ownerDocument,P=S.createElement("div");P.className="veo-card-frame",P.setAttribute("data-veo-builder-chrome",""),E.appendChild(P);let M=S.createElement("div");M.className="veo-card-toolbar",M.setAttribute("data-veo-builder-chrome","");let G=(z,V,F)=>{let T=S.createElement("button");T.type="button",T.className=`veo-card-toolbar-${z}${F?" is-active":""}`,T.setAttribute("aria-pressed",F?"true":"false"),T.textContent=V,T.addEventListener("click",R=>{R.preventDefault(),R.stopPropagation(),A({type:"card-action",payload:{stepIndex:k,action:z}});}),M.appendChild(T);};G("edit-container","Editar contenedor",le==="step"),G("edit-rows","Editar filas",le==="structure"),E.appendChild(M),M.style.top=`${-Math.round((M.offsetHeight||34)/2)}px`,ze(E);},er=(h,k)=>{let E=P=>{let M=_(h);if(!M)return;let G=P.composedPath().some(H=>H instanceof Element&&(H.classList.contains("veo-card")||H.classList.contains("veo-card-toolbar")));if(G!==De&&(De=G,Io(h,k)),P.composedPath().some(H=>H instanceof Element&&H.classList.contains("veo-row-toolbar")))return;let z=M.getBoundingClientRect(),V=P.clientX-z.left-M.clientLeft,F=P.clientY-z.top-M.clientTop,T=M.querySelector(".veo-row-toolbar");if(T&&V>=T.offsetLeft-10&&V<=T.offsetLeft+T.offsetWidth+10&&F>=T.offsetTop-14&&F<=T.offsetTop+T.offsetHeight+10)return;let R=6,I=$t(M,ae).rows.find(H=>V>=H.rect.left-R&&V<=H.rect.right+R&&F>=H.rect.top-R&&F<=H.rect.bottom+R)?.id??null;I!==be&&(be=I,ht(h,k));},S=()=>{De&&(De=false,Io(h,k)),be!==null&&(be=null,ht(h,k));};return h.addEventListener("mousemove",E),h.addEventListener("mouseleave",S),()=>{h.removeEventListener("mousemove",E),h.removeEventListener("mouseleave",S);}},cn=(h,k,E)=>{let S=_(h);if(!S)return;for(let R of S.querySelectorAll(".veo-gap"))R.remove();let P=S.ownerDocument,M=18,G=4,z=(R,N,I,H,K,W,de,pe)=>{let $=P.createElement("div");$.className=`veo-gap veo-gap--${R}`,$.setAttribute("data-veo-builder-chrome",""),$.dataset.veoGapAction=pe,$.style.left=`${N}px`,$.style.top=`${I}px`,$.style.width=`${Math.max(H,M)}px`,$.style.height=`${Math.max(K,M)}px`;let U=P.createElement("i"),X=P.createElement("button");X.type="button",X.title=W,X.setAttribute("aria-label",W),X.textContent="+",X.addEventListener("click",Y=>{Y.preventDefault(),Y.stopPropagation(),A({type:"block-layout",payload:{stepIndex:k,blockId:de,action:pe}});}),$.append(U,X),S.appendChild($);},{rows:V,content:F}=$t(S,E);if(V.length===0)return;let T=F.right-F.left;V.forEach((R,N)=>{let I=R.columns[0]?.items[0]?.block.editorId;if(N===0)z("h",F.left,R.rect.top-G-M,T,M,"Agregar fila",I,"row-before");else {let K=(V[N-1].rect.bottom+R.rect.top)/2-M/2;z("h",F.left,K,T,M,"Agregar fila",I,"row-before");}N===V.length-1&&z("h",F.left,R.rect.bottom+G,T,M,"Agregar fila",I,"row-after");});for(let R of V){let N=R.rect.bottom-R.rect.top;R.columns.forEach((I,H)=>{let K=I.items[0]?.block.editorId;if(H===0)z("v",R.rect.left-G-M,R.rect.top,M,N,"Agregar columna",K,"col-before");else {let de=(R.columns[H-1].rect.right+I.rect.left)/2-M/2;z("v",de,R.rect.top,M,N,"Agregar columna",K,"col-before");}H===R.columns.length-1&&z("v",R.rect.right+G,R.rect.top,M,N,"Agregar columna",K,"col-after");});}for(let R of V)for(let N of R.columns){let I=N.rect.right-N.rect.left;N.items.forEach((H,K)=>{let W=N.items[K+1];if(W){let de=st(H.el),pe=st(W.el),$=(de.bottom+pe.top)/2-M/2;z("h",N.rect.left,$,I,M,"Agregar bloque",H.block.editorId,"stack-after");}else R.columns.length>1&&N.rect.bottom<R.rect.bottom-M&&z("h",N.rect.left,N.rect.bottom+G,I,M,"Agregar bloque",H.block.editorId,"stack-after");});}},tr=(h,k)=>{let E=null,S=M=>{E={x:M.clientX,y:M.clientY};},P=M=>{let G=M.composedPath();if(G.some(T=>T instanceof Element&&(T.classList.contains("veo-block-toolbar")||T.classList.contains("veo-row-toolbar")||T.classList.contains("veo-card-toolbar")||T.classList.contains("veo-gap")))||!G.some(T=>T instanceof Element&&T.classList.contains("veo-card"))||E&&Math.hypot(M.clientX-E.x,M.clientY-E.y)>4)return;let V=G.find(T=>T instanceof HTMLElement&&!!T.dataset.veoBlockId);if(V){G.some(T=>T instanceof Element&&T.matches("button, a"))&&(M.preventDefault(),M.stopPropagation()),m=V.dataset.veoBlockId??null,Oe(h,k),m&&A({type:"block-clicked",payload:{stepIndex:k,blockId:m}});return}G.some(T=>T instanceof Element&&T.matches("button, a, input, textarea, select, label, [contenteditable]"))||(m=null,rt(h),ht(h,k),A({type:"card-clicked",payload:{stepIndex:k}}));};return h.addEventListener("mousedown",S,true),h.addEventListener("click",P,true),()=>{h.removeEventListener("mousedown",S,true),h.removeEventListener("click",P,true);}},or=(h,k)=>{let E=Array.from(document.querySelectorAll(`[${_o}="${k}"]`));if(E.length===0)return null;let S=document,P=S.createElement("div");P.setAttribute("data-veo-builder-chrome",""),P.style.cssText="position:fixed;left:0;top:0;width:0;height:0;z-index:2147483646;",P.style.display="none";let M=P.attachShadow({mode:"open"}),G=S.createElement("style");G.textContent=co,M.appendChild(G);let z=S.createElement("div");z.className="veo-block-frame",z.style.position="fixed";let V=S.createElement("div");V.className="veo-block-toolbar",V.style.position="fixed";let F=($,U,X,Y=true)=>{let j=S.createElement("button");j.type="button",j.title=U,j.setAttribute("aria-label",U),j.className=`veo-block-toolbar-${$}`,j.innerHTML=X,j.disabled=!Y,j.addEventListener("click",ce=>{ce.preventDefault(),ce.stopPropagation(),A({type:"block-action",payload:{stepIndex:h,blockId:k,action:$}});}),V.appendChild(j);};F("edit","Editar",q.pencil),F("duplicate","Duplicar",q.copy,false),F("remove","Eliminar",q.trash),F("move-left","Mover a la izquierda",Z.left,false),F("move-right","Mover a la derecha",Z.right,false),z.style.display="none",V.style.display="none";let T=18,R=4,N=($,U,X)=>{let Y=S.createElement("div");Y.className=`veo-gap veo-gap--${$}`,Y.style.position="fixed",Y.dataset.veoGapAction=X;let j=S.createElement("i"),ce=S.createElement("button");return ce.type="button",ce.title=U,ce.setAttribute("aria-label",U),ce.textContent="+",ce.addEventListener("click",Te=>{Te.preventDefault(),Te.stopPropagation(),A({type:"block-layout",payload:{stepIndex:h,blockId:k,action:X}});}),Y.append(j,ce),Y},I={top:N("h","Agregar fila","row-before"),bottom:N("h","Agregar fila","row-after"),left:N("v","Agregar columna","col-before"),right:N("v","Agregar columna","col-after")};M.append(z,V,I.top,I.bottom,I.left,I.right),S.body.appendChild(P),P.style.display="";let H=false,K=($,U,X,Y,j)=>{$.style.left=`${U}px`,$.style.top=`${X}px`,$.style.width=`${Y}px`,$.style.height=`${j}px`;},W=()=>{let $=E.filter(bt=>bt.isConnected);if($.length===0)return;let U=Number.POSITIVE_INFINITY,X=Number.POSITIVE_INFINITY,Y=Number.NEGATIVE_INFINITY,j=Number.NEGATIVE_INFINITY;for(let bt of $){let Ze=bt.getBoundingClientRect();Ze.width===0&&Ze.height===0||(U=Math.min(U,Ze.left),X=Math.min(X,Ze.top),Y=Math.max(Y,Ze.right),j=Math.max(j,Ze.bottom));}if(!Number.isFinite(U)||(K(I.top,U,X-R-T,Y-U,T),K(I.bottom,U,j+R,Y-U,T),K(I.left,U-R-T,X,T,j-X),K(I.right,Y+R,X,T,j-X),!H))return;K(z,U,X,Y-U,j-X);let ce=V.offsetHeight||ie,Te=V.offsetWidth;V.style.left=`${Math.max(0,Y-Te)}px`,V.style.top=`${Math.max(0,X-ce-6)}px`;},de=$=>{H=$===k,z.style.display=H?"":"none",V.style.display=H?"":"none",W();};W();let pe=$=>{let U=$.composedPath();E.some(X=>U.includes(X))&&(U.some(X=>X instanceof Element&&X.matches("button, a"))&&($.preventDefault(),$.stopPropagation()),m=k,de(k),A({type:"block-clicked",payload:{stepIndex:h,blockId:k}}));};return S.addEventListener("click",pe,true),window.addEventListener("scroll",W,true),window.addEventListener("resize",W),{select:de,detach:()=>{S.removeEventListener("click",pe,true),window.removeEventListener("scroll",W,true),window.removeEventListener("resize",W),P.remove();}}},Xe=h=>{let k=!h.honorTrigger;if(k&&(Ye(),Fe(),y=true,b=false),f=k?{...h,honorTrigger:true}:h,!O(h)){Fe(),te(),ee({state:"page-mismatch",pattern:D(h)?.pageLocation?.pattern??""});return}let E=h.guide.activationRules?.devices;if(!k&&v&&E&&!Rn(E)){Fe(),te(),ee({state:"device-mismatch",devices:E});return}ir(f);},Ye=()=>{x?.(),x=null;},Fe=()=>{w&&clearTimeout(w),w=null;},dn=(h,k)=>{Ye();let E=S=>{let P=S.target;if(P instanceof Element&&!P.closest("[data-veo-builder-chrome],[data-veo-builder-panel],[data-veo-picker]")){try{if(!P.closest(h))return}catch{return}Ye(),y=true,b=false,f&&Xe(f);}};document.addEventListener("click",E,true),k==="on_hover"&&document.addEventListener("mouseover",E,true),x=()=>{document.removeEventListener("click",E,true),document.removeEventListener("mouseover",E,true);},ee({state:"waiting-trigger",trigger:k,selector:h});},nr=h=>{Fe(),w=setTimeout(()=>{w=null,y=true,f&&Xe(f);},h),ee({state:"waiting-delay",delayMs:h});},ir=h=>{if(h.editable&&!v&&Po(h)){d=h.guide.startStepIndex??0;return}B(),d=h.guide.startStepIndex??0;let k=h.guide.activationRules,E=k?.trigger,S=k?.selector?.trim(),P=h.honorTrigger&&!y&&v,M=(E==="on_click"||E==="on_hover")&&(!Ot(k)||b);if(P&&M&&S){Fe(),qe(),dn(S,E);return}let G=Pn(k);if(P&&G>0){Ye(),qe(),w||nr(G);return}Ye(),Fe();let z=va(),V=ko({...h.guide,...z?{fetchProgress:z}:{},onClosed:()=>{if(B(),_e=null,y=false,b=true,v){let F=f?.guide.activationRules,T=F?.trigger,R=F?.selector?.trim();(T==="on_click"||T==="on_hover")&&R&&dn(R,T);}}});h.honorTrigger&&ee({state:"shown"}),!(!h.editable||v)&&V.ready.then(F=>{if(!F.rendered)return;let T=V.host();if(!T){let N=h.guide.startStepIndex??0,I=h.guide.guideSteps[N]?.blocks?.[0];I?.type==="code"&&I.editorId&&(p=or(N,I.editorId),p?.select(m));return}T.classList.add("veo-no-anim"),_e=h,c=tr(T,h.guide.startStepIndex??0);let R=h.guide.guideSteps[h.guide.startStepIndex??0]?.blocks??[];ae=R,Oe(T,h.guide.startStepIndex??0),cn(T,h.guide.startStepIndex??0,R),Bt=er(T,h.guide.startStepIndex??0),l=qi({host:T,guideType:h.guide.guideType,stepIndex:h.guide.startStepIndex??0,onCommit:N=>A({type:"design-updated",payload:N}),onGestureEnd:()=>{if(!g)return;let N=g;g=null,Xe(N);}}),a=xn({host:T,stepIndex:h.guide.startStepIndex??0,onDrop:N=>A({type:"block-dropped",payload:N})});});},Jt=()=>{u?.remove(),u=null;},rr=(h,k,E)=>{u||(u=document.createElement("div"),u.style.cssText="position:fixed;padding:4px 10px;border-radius:999px;background:#1c1917;color:#fff;font:12px/1.4 system-ui,sans-serif;box-shadow:0 4px 14px rgba(0,0,0,0.35);border:1px solid rgba(255,255,255,0.25);pointer-events:none;z-index:2147483647;",document.body.appendChild(u)),u.textContent=E,u.style.left=`${h+14}px`,u.style.top=`${k+12}px`;},sr=h=>{let k=i?.frameRect();if(!k||!a){h.phase!=="move"&&Jt(),a?.cancelHover();return}let E=k.left+h.x,S=k.top+h.y;if(h.phase==="move"){rr(E,S,h.label||h.blockType),a.hoverAt(E,S);return}if(Jt(),h.phase==="cancel"){a.cancelHover();return}let P=a.dropAt(E,S);P&&A({type:"block-dropped",payload:{stepIndex:d,blockType:h.blockType,...P}});},ar=h=>{switch(h.type){case "panel-ready":A(r?{type:"ready",chrome:true}:{type:"ready"});break;case "editor-state":if(r?.setState(h.state),le!==h.state.section){le=h.state.section;let k=document.querySelector("[data-veo-guide]");k&&De&&!v&&Io(k,d);}i?.setTitle(h.state.section==="activation"?"Ajustes de activaci\xF3n":h.state.section==="badge"?"Ajustes de badge":h.state.section==="target"?"Ajustes del elemento objetivo":h.state.section==="row"?"Editar fila":h.state.blockLabel?`Editor \xB7 ${h.state.blockLabel}`:h.state.steps[h.state.activeStep]?.label??"Paso");break;case "panel-visibility":i?.setVisible(h.visible);break;case "panel-size":i?.setSize(h.size);break;case "start-picker":{n?.stop();let k=i?.isVisible()??false;k&&i?.setVisible(false),r?.setHidden(true);let E=f;E&&(B(),qe());let S=()=>{r?.setHidden(false),k&&i?.setVisible(true),E&&f===E&&Xe(E);};n=Mo({onPick:P=>{n=null,S(),A({type:"picked",payload:P});},onCancel:()=>{n=null,S(),A({type:"pick-cancelled"});},...h.maxAncestors!==void 0?{maxAncestors:h.maxAncestors}:{},...h.hint!==void 0?{hint:h.hint}:{}});break}case "stop-picker":n?.stop(),n=null,r?.setHidden(false);break;case "preview":if(!h.guide)break;l?.isDragging()?g=h:Xe(h);break;case "block-drag":sr(h);break;case "select-block":{m=h.blockId;let k=document.querySelector("[data-veo-guide]");k&&!v&&Oe(k,d),v||p?.select(h.blockId);break}case "select-row":{$e=h.blockId;let k=document.querySelector("[data-veo-guide]");k&&!v&&ht(k,d);break}case "close-preview":B(),Jt(),g=null,f=null,Ye(),Fe(),y=false,b=false,qe();break;case "teardown":Bo();break}},pn=h=>{if(h.origin!==o)return;let k=h.data;!k||k.source!==Rt||k.token!==e||ar(k);},un=()=>A({type:"closed"}),vt=()=>{f&&!l?.isDragging()&&Xe(f);},mn=window.history.pushState,fn=window.history.replaceState,lr=()=>{window.history.pushState=function(...k){let E=mn.apply(this,k);return vt(),E},window.history.replaceState=function(...k){let E=fn.apply(this,k);return vt(),E},window.addEventListener("popstate",vt),window.addEventListener("hashchange",vt);},cr=()=>{window.history.pushState=mn,window.history.replaceState=fn,window.removeEventListener("popstate",vt),window.removeEventListener("hashchange",vt);},Bo=()=>{window.removeEventListener("message",pn),window.removeEventListener("pagehide",un),cr(),n?.stop(),n=null,B(),Jt(),g=null,Ye(),Fe(),qe(),A({type:"closed"}),i?.teardown(),i=null,r?.teardown(),r=null,Mn();};if(t.panel)r=Fi({appLabel:window.location.hostname,onAction:h=>{switch(h.action){case "dock":i?.setTopOffset(h.position==="top"?r?.height()??0:0);return;case "show-panel":i?.setVisible(true);return;case "preview":if(v)return;v=true,y=false,b=false,C=i?.isVisible()??true,i?.setVisible(false),r?.setPreview(true),f&&Xe(f);return;case "exit-preview":if(!v)return;v=false,Ye(),Fe(),r?.setPreview(false),i?.setVisible(C),f&&Xe(f);return;case "select-activation":case "select-step":case "add-step":i?.setVisible(true);break}A({type:"chrome-action",payload:h});}}),i=Wi({dashboardOrigin:o,token:e,appOrigin:window.location.origin,guide:t.guide,panelPath:t.panelPath,onClose:()=>Bo(),topOffset:r.height()}),r.onHeightChange(h=>i?.setTopOffset(r?.dock()==="top"?h:0));else if(s=ga(),!s)return null;let gn=()=>{window.addEventListener("message",pn),window.addEventListener("pagehide",un),lr(),t.panel||A({type:"ready"});},Qt=window.__veoBuilder;return !t.panel&&Qt?.apiKey&&Qt?.apiUrl?fa(Qt.apiUrl,Qt.apiKey,e).then(h=>{h?gn():window.console&&console.warn("[veo] token de builder inv\xE1lido \u2014 modo no activado");}):gn(),{teardown:Bo}}async function fa(t,e,o){try{let n=`${t.replace(/\/+$/,"")}/v1/builder/verify`,i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Api-Key":e},body:JSON.stringify({token:o})});return i.ok?(await i.json().catch(()=>null))?.valid!==!1:!0}catch{return true}}function ga(){return window.opener&&window.opener!==window?window.opener:window.parent&&window.parent!==window?window.parent:null}function ha(t){if(t)try{return new URL(t).origin}catch{return null}if(Ce()&&document.referrer)try{return new URL(document.referrer).origin}catch{return null}return null}function va(){let t=window.__veoBuilder;if(!t?.apiKey||!t?.apiUrl)return;let e=t.apiUrl.replace(/\/+$/,""),o=t.apiKey;return async n=>{let i=new URLSearchParams({endUserId:"veo_preview",guideIds:n.join(","),includeUnpublished:"1"}),r=await fetch(`${e}/v1/guides/progress?${i}`,{headers:{"X-Api-Key":o}});return r.ok?(await r.json()).items??[]:[]}}var ba="popup,width=1280,height=860",ya=600;function Ji(t){if(!ye())return Ea();let e=t.dashboardOrigin??window.location.origin,o=wa(t.appUrl),n=xa(t.appUrl,t.token,e),i=t.frame??null,r=i!==null,s=null;r?i.src=n:s=window.open(n,t.windowName??"veo-builder",t.windowFeatures??ba);let l=()=>r?i?.contentWindow??null:s,a=u=>{let d=l();d&&(!r&&s?.closed||d.postMessage({source:Rt,token:t.token,...u},o??"*"));},c,p=()=>{window.removeEventListener("message",m),c!==void 0&&(clearInterval(c),c=void 0);},m=u=>{if(o&&u.origin!==o)return;let d=u.data;if(!(!d||d.source!==Rt||d.token!==t.token))switch(d.type){case "ready":t.onReady?.();break;case "picked":d.payload&&t.onPicked?.(d.payload);break;case "pick-cancelled":t.onCancelled?.();break;case "closed":p(),t.onClosed?.();break}};return window.addEventListener("message",m),r||(c=setInterval(()=>{s?.closed&&(p(),t.onClosed?.());},ya)),{startPicker:u=>a({type:"start-picker",...u?.maxAncestors!==void 0?{maxAncestors:u.maxAncestors}:{},...u?.hint!==void 0?{hint:u.hint}:{}}),stopPicker:()=>a({type:"stop-picker"}),preview:u=>a({type:"preview",guide:u}),closePreview:()=>a({type:"close-preview"}),close:()=>{a({type:"teardown"}),r?i&&(i.src="about:blank"):s&&!s.closed&&s.close(),p();}}}function xa(t,e,o){try{let n=new URL(t,window.location.href);return n.searchParams.set(Qe,e),n.searchParams.set(yt,o),n.toString()}catch{return t}}function wa(t){try{return new URL(t,window.location.href).origin}catch{return null}}function Ea(){return {startPicker:()=>{},stopPicker:()=>{},preview:()=>{},closePreview:()=>{},close:()=>{}}}Ro();
902
+ exports.closeGuidePreview=qe;exports.createBuilderSession=Ji;exports.initBuilderMode=Ro;exports.previewGuide=ko;exports.startElementPicker=Mo;exports.stopElementPicker=Zi;return exports;})({});//# sourceMappingURL=veo-builder.js.map
903
903
  //# sourceMappingURL=veo-builder.js.map