veo-sdk 0.5.3 → 0.5.4
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.
- package/dist/builder-MFTOJV6F.mjs +5 -0
- package/dist/{builder-QNMXYF4U.mjs.map → builder-MFTOJV6F.mjs.map} +1 -1
- package/dist/builder.cjs +118 -8
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.d.cts +12 -0
- package/dist/builder.d.ts +12 -0
- package/dist/builder.mjs +4 -4
- package/dist/{chunk-HQ6HMWX7.mjs → chunk-GKJW5TOZ.mjs} +3 -3
- package/dist/{chunk-HQ6HMWX7.mjs.map → chunk-GKJW5TOZ.mjs.map} +1 -1
- package/dist/{chunk-QIILQDSA.mjs → chunk-JPA46JBS.mjs} +23 -10
- package/dist/chunk-JPA46JBS.mjs.map +1 -0
- package/dist/{chunk-JSNDOWF5.mjs → chunk-SBNT464M.mjs} +101 -4
- package/dist/chunk-SBNT464M.mjs.map +1 -0
- package/dist/index.cjs +127 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/veo-builder.js +7 -7
- package/dist/veo-builder.js.map +1 -1
- package/dist/veo-guides.js +1 -1
- package/dist/veo-guides.js.map +1 -1
- package/package.json +1 -1
- package/dist/builder-QNMXYF4U.mjs +0 -5
- package/dist/chunk-JSNDOWF5.mjs.map +0 -1
- package/dist/chunk-QIILQDSA.mjs.map +0 -1
package/dist/veo-guides.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var veoGuides=(function(exports){'use strict';function gt(){return typeof window<"u"}function Be(){return typeof document<"u"}var vt=["http:","https:"],yt="data-veo-guide",wt="veo:freq:";var bt="veo:walkthrough_state:";var Ct={shown:1,dismissed:2,completed:2};function kt(n){return n.slice(-16)||"default"}var Fe=class{constructor(e){this.storageKey=`${wt}${e}`,this.cache=this.load(),this.prune();}shouldFilter(e,t){if(t==="every_visit"||t==="always")return false;let o=this.cache.get(e);return o?t==="once"?true:t==="until_dismissed"?o.status==="dismissed"||o.status==="completed":t==="until_answered"?o.status==="completed":false:false}record(e,t){let o=this.cache.get(e);o&&Ct[t]<Ct[o.status]||(this.cache.set(e,{guideId:e,status:t,lastInteractionAt:Date.now()}),this.persist());}clear(){this.cache.clear(),this.persist();}snapshot(){return Array.from(this.cache.values())}prune(){let e=Date.now(),t=false;for(let[o,i]of this.cache)e-i.lastInteractionAt>7776e6&&(this.cache.delete(o),t=true);if(this.cache.size>500){let o=Array.from(this.cache.entries()).sort((r,s)=>r[1].lastInteractionAt-s[1].lastInteractionAt),i=this.cache.size-500;for(let r=0;r<i;r++){let s=o[r];s&&this.cache.delete(s[0]);}t=true;}t&&this.persist();}load(){if(typeof localStorage>"u")return new Map;try{let e=localStorage.getItem(this.storageKey);if(!e)return new Map;let t=JSON.parse(e);if(!Array.isArray(t))return new Map;let o=[];for(let i of t)if(i&&typeof i=="object"&&typeof i.guideId=="string"&&typeof i.lastInteractionAt=="number"&&["shown","dismissed","completed"].includes(i.status)){let r=i;o.push([r.guideId,r]);}return new Map(o)}catch{return new Map}}persist(){if(!(typeof localStorage>"u"))try{let e=JSON.stringify(Array.from(this.cache.values()));localStorage.setItem(this.storageKey,e);}catch{}}};var He=class{constructor(e,t,o=false){this.apiUrl=e;this.apiKey=t;this.debug=o;}async resolve(e,t){let o=new URLSearchParams({endUserId:e,pageUrl:t}),i;try{i=await fetch(`${this.apiUrl}/v1/guides/resolve?${o.toString()}`,{method:"GET",headers:{"X-Api-Key":this.apiKey},credentials:"omit"});}catch(r){return this.debug&&console.error("[veo] guides resolve fetch failed:",r),[]}if(!i.ok)return this.debug&&console.warn("[veo] guides resolve HTTP",i.status),[];try{let r=await i.json();return Array.isArray(r.guides)?r.guides:[]}catch(r){return this.debug&&console.error("[veo] guides resolve parse failed:",r),[]}}async fetchById(e){let t;try{t=await fetch(`${this.apiUrl}/v1/guides/${encodeURIComponent(e)}`,{method:"GET",headers:{"X-Api-Key":this.apiKey},credentials:"omit"});}catch(o){return this.debug&&console.error("[veo] guides fetchById network failed:",o),null}if(!t.ok)return this.debug&&console.warn("[veo] guides fetchById HTTP",t.status),null;try{let o=await t.json();return typeof o.guideId!="string"||typeof o.guideName!="string"||typeof o.guideType!="string"||!Array.isArray(o.guideSteps)||!o.activationRules||typeof o.displayFrequency!="string"||typeof o.displayPriority!="number"?(this.debug&&console.warn("[veo] guides fetchById: unexpected shape"),null):{guideId:o.guideId,guideName:o.guideName,guideType:o.guideType,guideSteps:o.guideSteps,activationRules:o.activationRules,displayFrequency:o.displayFrequency,displayPriority:o.displayPriority}}catch(o){return this.debug&&console.error("[veo] guides fetchById parse failed:",o),null}}};function Et(n){let e={endUserId:n.endUserId,interactionType:n.action};return n.sessionId&&(e.sessionId=n.sessionId),typeof n.stepIndex=="number"&&(e.stepPosition=n.stepIndex),n.pageUrl&&(e.pageUrl=n.pageUrl),n.pagePath&&(e.pagePath=n.pagePath),n.metadata&&(e.metadata=n.metadata),e}var $e=class{constructor(e,t){this.apiUrl=e;this.apiKey=t;}async send(e){let t=this.buildUrl(e.guideId),o=await fetch(t,{method:"POST",headers:{"X-Api-Key":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(Et(e.payload)),credentials:"omit"});if(!o.ok)throw new Error(`guide interaction send failed: HTTP ${o.status}`)}sendBeacon(e){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function")return false;let t=`${this.buildUrl(e.guideId)}?key=${encodeURIComponent(this.apiKey)}`,o=new Blob([JSON.stringify(Et(e.payload))],{type:"application/json"});try{return navigator.sendBeacon(t,o)}catch{return false}}buildUrl(e){return `${this.apiUrl}/v1/guides/${encodeURIComponent(e)}/interactions`}};var We=class{constructor(e){this.config=e;this.buffer=[];this.timer=null;this.flushing=false;this.unloadCleanup=null;this.startTimer(),this.installUnloadHandler();}get size(){return this.buffer.length}enqueue(e){this.buffer.push({guideId:e.guideId,payload:e.payload,attempts:0,enqueuedAt:Date.now()}),this.buffer.length>=this.config.batchSize&&this.flush();}async flush(){if(this.flushing||this.buffer.length===0)return;let e=Date.now(),t=this.buffer.filter(r=>(r.nextRetryAt??0)<=e);if(t.length===0)return;this.flushing=true;let o=new Set(t);this.buffer=this.buffer.filter(r=>!o.has(r));let i=await Promise.allSettled(t.map(r=>this.config.client.send({guideId:r.guideId,payload:r.payload})));for(let r=0;r<i.length;r++){let s=i[r],a=t[r];!s||!a||s.status!=="fulfilled"&&(a.attempts+=1,a.attempts<this.config.maxRetries?(a.nextRetryAt=Date.now()+this.retryDelayMs(a.attempts),this.buffer.push(a)):this.safeOnError(s.reason,a));}this.flushing=false;}retryDelayMs(e){let t=Math.min(3e3*2**(e-1),3e4);return t/2+Math.random()*(t/2)}flushBeacon(){if(this.buffer.length===0)return;let e=this.buffer.splice(0,this.buffer.length);for(let t of e)this.config.client.sendBeacon({guideId:t.guideId,payload:t.payload});}destroy(){this.timer&&clearInterval(this.timer),this.timer=null,this.unloadCleanup?.(),this.unloadCleanup=null;}startTimer(){typeof window>"u"||(this.timer=setInterval(()=>{this.flush();},this.config.flushIntervalMs));}installUnloadHandler(){if(typeof window>"u")return;let e=()=>this.flushBeacon(),t=()=>{document.visibilityState==="hidden"&&this.flushBeacon();};window.addEventListener("pagehide",e),window.addEventListener("visibilitychange",t),this.unloadCleanup=()=>{window.removeEventListener("pagehide",e),window.removeEventListener("visibilitychange",t);};}safeOnError(e,t){if(!this.config.onError)return;let o=e instanceof Error?e:new Error(String(e));try{this.config.onError(o,t);}catch{}}};var ie=Math.min,j=Math.max,Ae=Math.round;var _=n=>({x:n,y:n}),bn={left:"right",right:"left",bottom:"top",top:"bottom"};function ze(n,e,t){return j(n,ie(e,t))}function ce(n,e){return typeof n=="function"?n(e):n}function V(n){return n.split("-")[0]}function ue(n){return n.split("-")[1]}function at(n){return n==="x"?"y":"x"}function Ke(n){return n==="y"?"height":"width"}function z(n){let e=n[0];return e==="t"||e==="b"?"y":"x"}function qe(n){return at(z(n))}function It(n,e,t){t===void 0&&(t=false);let o=ue(n),i=qe(n),r=Ke(i),s=i==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=Te(s)),[s,Te(s)]}function Tt(n){let e=Te(n);return [Ue(n),e,Ue(e)]}function Ue(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}var St=["left","right"],Rt=["right","left"],xn=["top","bottom"],Cn=["bottom","top"];function kn(n,e,t){switch(n){case "top":case "bottom":return t?e?Rt:St:e?St:Rt;case "left":case "right":return e?xn:Cn;default:return []}}function At(n,e,t,o){let i=ue(n),r=kn(V(n),t==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(Ue)))),r}function Te(n){let e=V(n);return bn[e]+n.slice(e.length)}function En(n){return {top:0,right:0,bottom:0,left:0,...n}}function lt(n){return typeof n!="number"?En(n):{top:n,right:n,bottom:n,left:n}}function re(n){let{x:e,y:t,width:o,height:i}=n;return {width:o,height:i,top:t,left:e,right:e+o,bottom:t+i,x:e,y:t}}function Pt(n,e,t){let{reference:o,floating:i}=n,r=z(e),s=qe(e),a=Ke(s),l=V(e),d=r==="y",c=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,f=o[a]/2-i[a]/2,p;switch(l){case "top":p={x:c,y:o.y-i.height};break;case "bottom":p={x:c,y:o.y+o.height};break;case "right":p={x:o.x+o.width,y:u};break;case "left":p={x:o.x-i.width,y:u};break;default:p={x:o.x,y:o.y};}switch(ue(e)){case "start":p[s]-=f*(t&&d?-1:1);break;case "end":p[s]+=f*(t&&d?-1:1);break}return p}async function Lt(n,e){var t;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=n,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:u="floating",altBoundary:f=false,padding:p=0}=ce(e,n),h=lt(p),g=a[f?u==="floating"?"reference":"floating":u],v=re(await r.getClippingRect({element:(t=await(r.isElement==null?void 0:r.isElement(g)))==null||t?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),w=u==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),y=await(r.isElement==null?void 0:r.isElement(x))?await(r.getScale==null?void 0:r.getScale(x))||{x:1,y:1}:{x:1,y:1},C=re(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return {top:(v.top-C.top+h.top)/y.y,bottom:(C.bottom-v.bottom+h.bottom)/y.y,left:(v.left-C.left+h.left)/y.x,right:(C.right-v.right+h.right)/y.x}}var Sn=50,Gt=async(n,e,t)=>{let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=t,a=s.detectOverflow?s:{...s,detectOverflow:Lt},l=await(s.isRTL==null?void 0:s.isRTL(e)),d=await s.getElementRects({reference:n,floating:e,strategy:i}),{x:c,y:u}=Pt(d,o,l),f=o,p=0,h={};for(let m=0;m<r.length;m++){let g=r[m];if(!g)continue;let{name:v,fn:w}=g,{x,y,data:C,reset:k}=await w({x:c,y:u,initialPlacement:o,placement:f,strategy:i,middlewareData:h,rects:d,platform:a,elements:{reference:n,floating:e}});c=x??c,u=y??u,h[v]={...h[v],...C},k&&p<Sn&&(p++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(d=k.rects===true?await s.getElementRects({reference:n,floating:e,strategy:i}):k.rects),{x:c,y:u}=Pt(d,f,l)),m=-1);}return {x:c,y:u,placement:f,strategy:i,middlewareData:h}},Nt=n=>({name:"arrow",options:n,async fn(e){let{x:t,y:o,placement:i,rects:r,platform:s,elements:a,middlewareData:l}=e,{element:d,padding:c=0}=ce(n,e)||{};if(d==null)return {};let u=lt(c),f={x:t,y:o},p=qe(i),h=Ke(p),m=await s.getDimensions(d),g=p==="y",v=g?"top":"left",w=g?"bottom":"right",x=g?"clientHeight":"clientWidth",y=r.reference[h]+r.reference[p]-f[p]-r.floating[h],C=f[p]-r.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d)),$=k?k[x]:0;(!$||!await(s.isElement==null?void 0:s.isElement(k)))&&($=a.floating[x]||r.floating[h]);let Se=y/2-C/2,te=$/2-m[h]/2-1,W=ie(u[v],te),Re=ie(u[w],te),ne=W,Ie=$-m[h]-Re,S=$/2-m[h]/2+Se,oe=ze(ne,S,Ie),U=!l.arrow&&ue(i)!=null&&S!==oe&&r.reference[h]/2-(S<ne?W:Re)-m[h]/2<0,G=U?S<ne?S-ne:S-Ie:0;return {[p]:f[p]+G,data:{[p]:oe,centerOffset:S-oe-G,...U&&{alignmentOffset:G}},reset:U}}});var _t=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,o;let{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=true,crossAxis:u=true,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=true,...g}=ce(n,e);if((t=r.arrow)!=null&&t.alignmentOffset)return {};let v=V(i),w=z(a),x=V(a)===a,y=await(l.isRTL==null?void 0:l.isRTL(d.floating)),C=f||(x||!m?[Te(a)]:Tt(a)),k=h!=="none";!f&&k&&C.push(...At(a,m,h,y));let $=[a,...C],Se=await l.detectOverflow(e,g),te=[],W=((o=r.flip)==null?void 0:o.overflows)||[];if(c&&te.push(Se[v]),u){let S=It(i,s,y);te.push(Se[S[0]],Se[S[1]]);}if(W=[...W,{placement:i,overflows:te}],!te.every(S=>S<=0)){var Re,ne;let S=(((Re=r.flip)==null?void 0:Re.index)||0)+1,oe=$[S];if(oe&&(!(u==="alignment"?w!==z(oe):false)||W.every(N=>z(N.placement)===w?N.overflows[0]>0:true)))return {data:{index:S,overflows:W},reset:{placement:oe}};let U=(ne=W.filter(G=>G.overflows[0]<=0).sort((G,N)=>G.overflows[1]-N.overflows[1])[0])==null?void 0:ne.placement;if(!U)switch(p){case "bestFit":{var Ie;let G=(Ie=W.filter(N=>{if(k){let q=z(N.placement);return q===w||q==="y"}return true}).map(N=>[N.placement,N.overflows.filter(q=>q>0).reduce((q,yn)=>q+yn,0)]).sort((N,q)=>N[1]-q[1])[0])==null?void 0:Ie[0];G&&(U=G);break}case "initialPlacement":U=a;break}if(i!==U)return {reset:{placement:U}}}return {}}}};var Rn=new Set(["left","top"]);async function In(n,e){let{placement:t,platform:o,elements:i}=n,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=V(t),a=ue(t),l=z(t)==="y",d=Rn.has(s)?-1:1,c=r&&l?-1:1,u=ce(e,n),{mainAxis:f,crossAxis:p,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof h=="number"&&(p=a==="end"?h*-1:h),l?{x:p*c,y:f*d}:{x:f*d,y:p*c}}var Ot=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,o;let{x:i,y:r,placement:s,middlewareData:a}=e,l=await In(e,n);return s===((t=a.offset)==null?void 0:t.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Mt=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){let{x:t,y:o,placement:i,platform:r}=e,{mainAxis:s=true,crossAxis:a=false,limiter:l={fn:v=>{let{x:w,y:x}=v;return {x:w,y:x}}},...d}=ce(n,e),c={x:t,y:o},u=await r.detectOverflow(e,d),f=z(V(i)),p=at(f),h=c[p],m=c[f];if(s){let v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",x=h+u[v],y=h-u[w];h=ze(x,h,y);}if(a){let v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=m+u[v],y=m-u[w];m=ze(x,m,y);}let g=l.fn({...e,[p]:h,[f]:m});return {...g,data:{x:g.x-t,y:g.y-o,enabled:{[p]:s,[f]:a}}}}}};function Ve(){return typeof window<"u"}function ae(n){return Bt(n)?(n.nodeName||"").toLowerCase():"#document"}function I(n){var e;return (n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function M(n){var e;return (e=(Bt(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Bt(n){return Ve()?n instanceof Node||n instanceof I(n).Node:false}function P(n){return Ve()?n instanceof Element||n instanceof I(n).Element:false}function D(n){return Ve()?n instanceof HTMLElement||n instanceof I(n).HTMLElement:false}function Dt(n){return !Ve()||typeof ShadowRoot>"u"?false:n instanceof ShadowRoot||n instanceof I(n).ShadowRoot}function pe(n){let{overflow:e,overflowX:t,overflowY:o,display:i}=L(n);return /auto|scroll|overlay|hidden|clip/.test(e+o+t)&&i!=="inline"&&i!=="contents"}function Ft(n){return /^(table|td|th)$/.test(ae(n))}function Pe(n){try{if(n.matches(":popover-open"))return !0}catch{}try{return n.matches(":modal")}catch{return false}}var Tn=/transform|translate|scale|rotate|perspective|filter/,An=/paint|layout|strict|content/,se=n=>!!n&&n!=="none",dt;function Ye(n){let e=P(n)?L(n):n;return se(e.transform)||se(e.translate)||se(e.scale)||se(e.rotate)||se(e.perspective)||!Xe()&&(se(e.backdropFilter)||se(e.filter))||Tn.test(e.willChange||"")||An.test(e.contain||"")}function Ht(n){let e=K(n);for(;D(e)&&!le(e);){if(Ye(e))return e;if(Pe(e))return null;e=K(e);}return null}function Xe(){return dt==null&&(dt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),dt}function le(n){return /^(html|body|#document)$/.test(ae(n))}function L(n){return I(n).getComputedStyle(n)}function Le(n){return P(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function K(n){if(ae(n)==="html")return n;let e=n.assignedSlot||n.parentNode||Dt(n)&&n.host||M(n);return Dt(e)?e.host:e}function $t(n){let e=K(n);return le(e)?n.ownerDocument?n.ownerDocument.body:n.body:D(e)&&pe(e)?e:$t(e)}function je(n,e,t){var o;e===void 0&&(e=[]);let i=$t(n),r=i===((o=n.ownerDocument)==null?void 0:o.body),s=I(i);if(r){Qe(s);return e.concat(s,s.visualViewport||[],pe(i)?i:[],[])}else return e.concat(i,je(i,[]))}function Qe(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Kt(n){let e=L(n),t=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=D(n),r=i?n.offsetWidth:t,s=i?n.offsetHeight:o,a=Ae(t)!==r||Ae(o)!==s;return a&&(t=r,o=s),{width:t,height:o,$:a}}function qt(n){return P(n)?n:n.contextElement}function fe(n){let e=qt(n);if(!D(e))return _(1);let t=e.getBoundingClientRect(),{width:o,height:i,$:r}=Kt(e),s=(r?Ae(t.width):t.width)/o,a=(r?Ae(t.height):t.height)/i;return (!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var Pn=_(0);function jt(n){let e=I(n);return !Xe()||!e.visualViewport?Pn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ln(n,e,t){return e===void 0&&(e=false),!t||e&&t!==I(n)?false:e}function Ge(n,e,t,o){e===void 0&&(e=false),t===void 0&&(t=false);let i=n.getBoundingClientRect(),r=qt(n),s=_(1);e&&(o?P(o)&&(s=fe(o)):s=fe(n));let a=Ln(r,t,o)?jt(r):_(0),l=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,c=i.width/s.x,u=i.height/s.y;if(r){let f=I(r),p=o&&P(o)?I(o):o,h=f,m=Qe(h);for(;m&&o&&p!==h;){let g=fe(m),v=m.getBoundingClientRect(),w=L(m),x=v.left+(m.clientLeft+parseFloat(w.paddingLeft))*g.x,y=v.top+(m.clientTop+parseFloat(w.paddingTop))*g.y;l*=g.x,d*=g.y,c*=g.x,u*=g.y,l+=x,d+=y,h=I(m),m=Qe(h);}}return re({width:c,height:u,x:l,y:d})}function Je(n,e){let t=Le(n).scrollLeft;return e?e.left+t:Ge(M(n)).left+t}function Vt(n,e){let t=n.getBoundingClientRect(),o=t.left+e.scrollLeft-Je(n,t),i=t.top+e.scrollTop;return {x:o,y:i}}function Gn(n){let{elements:e,rect:t,offsetParent:o,strategy:i}=n,r=i==="fixed",s=M(o),a=e?Pe(e.floating):false;if(o===s||a&&r)return t;let l={scrollLeft:0,scrollTop:0},d=_(1),c=_(0),u=D(o);if((u||!u&&!r)&&((ae(o)!=="body"||pe(s))&&(l=Le(o)),u)){let p=Ge(o);d=fe(o),c.x=p.x+o.clientLeft,c.y=p.y+o.clientTop;}let f=s&&!u&&!r?Vt(s,l):_(0);return {width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-l.scrollLeft*d.x+c.x+f.x,y:t.y*d.y-l.scrollTop*d.y+c.y+f.y}}function Nn(n){return Array.from(n.getClientRects())}function _n(n){let e=M(n),t=Le(n),o=n.ownerDocument.body,i=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),s=-t.scrollLeft+Je(n),a=-t.scrollTop;return L(o).direction==="rtl"&&(s+=j(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}var Wt=25;function On(n,e){let t=I(n),o=M(n),i=t.visualViewport,r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;let c=Xe();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop);}let d=Je(o);if(d<=0){let c=o.ownerDocument,u=c.body,f=getComputedStyle(u),p=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(o.clientWidth-u.clientWidth-p);h<=Wt&&(r-=h);}else d<=Wt&&(r+=d);return {width:r,height:s,x:a,y:l}}function Mn(n,e){let t=Ge(n,true,e==="fixed"),o=t.top+n.clientTop,i=t.left+n.clientLeft,r=D(n)?fe(n):_(1),s=n.clientWidth*r.x,a=n.clientHeight*r.y,l=i*r.x,d=o*r.y;return {width:s,height:a,x:l,y:d}}function Ut(n,e,t){let o;if(e==="viewport")o=On(n,t);else if(e==="document")o=_n(M(n));else if(P(e))o=Mn(e,t);else {let i=jt(n);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height};}return re(o)}function Yt(n,e){let t=K(n);return t===e||!P(t)||le(t)?false:L(t).position==="fixed"||Yt(t,e)}function Dn(n,e){let t=e.get(n);if(t)return t;let o=je(n,[]).filter(a=>P(a)&&ae(a)!=="body"),i=null,r=L(n).position==="fixed",s=r?K(n):n;for(;P(s)&&!le(s);){let a=L(s),l=Ye(s);!l&&a.position==="fixed"&&(i=null),(r?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||pe(s)&&!l&&Yt(n,s))?o=o.filter(c=>c!==s):i=a,s=K(s);}return e.set(n,o),o}function Bn(n){let{element:e,boundary:t,rootBoundary:o,strategy:i}=n,s=[...t==="clippingAncestors"?Pe(e)?[]:Dn(e,this._c):[].concat(t),o],a=Ut(e,s[0],i),l=a.top,d=a.right,c=a.bottom,u=a.left;for(let f=1;f<s.length;f++){let p=Ut(e,s[f],i);l=j(p.top,l),d=ie(p.right,d),c=ie(p.bottom,c),u=j(p.left,u);}return {width:d-u,height:c-l,x:u,y:l}}function Fn(n){let{width:e,height:t}=Kt(n);return {width:e,height:t}}function Hn(n,e,t){let o=D(e),i=M(e),r=t==="fixed",s=Ge(n,true,r,e),a={scrollLeft:0,scrollTop:0},l=_(0);function d(){l.x=Je(i);}if(o||!o&&!r)if((ae(e)!=="body"||pe(i))&&(a=Le(e)),o){let p=Ge(e,true,r,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop;}else i&&d();r&&!o&&i&&d();let c=i&&!o&&!r?Vt(i,a):_(0),u=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return {x:u,y:f,width:s.width,height:s.height}}function ct(n){return L(n).position==="static"}function zt(n,e){if(!D(n)||L(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return M(n)===t&&(t=t.ownerDocument.body),t}function Xt(n,e){let t=I(n);if(Pe(n))return t;if(!D(n)){let i=K(n);for(;i&&!le(i);){if(P(i)&&!ct(i))return i;i=K(i);}return t}let o=zt(n,e);for(;o&&Ft(o)&&ct(o);)o=zt(o,e);return o&&le(o)&&ct(o)&&!Ye(o)?t:o||Ht(n)||t}var $n=async function(n){let e=this.getOffsetParent||Xt,t=this.getDimensions,o=await t(n.floating);return {reference:Hn(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Wn(n){return L(n).direction==="rtl"}var Un={convertOffsetParentRelativeRectToViewportRelativeRect:Gn,getDocumentElement:M,getClippingRect:Bn,getOffsetParent:Xt,getElementRects:$n,getClientRects:Nn,getDimensions:Fn,getScale:fe,isElement:P,isRTL:Wn};var Y=Ot;var X=Mt,Q=_t;var he=Nt;var J=(n,e,t)=>{let o=new Map,i={platform:Un,...t},r={...i.platform,_c:o};return Gt(n,e,{...i,platform:r})};var zn={P:"p",BR:"br",STRONG:"strong",B:"strong",EM:"em",I:"em",U:"u",S:"s",UL:"ul",OL:"ol",LI:"li",A:"a"},Kn=new Set(["SCRIPT","STYLE","TEMPLATE","IFRAME","OBJECT","EMBED","NOSCRIPT","TITLE","TEXTAREA","SELECT","SVG","MATH"]),Qt=16*1024,qn=20,jn=1e3;function Jt(n,e){let t=e.createDocumentFragment();if(typeof n!="string"||n.length===0)return t;let o;try{o=new DOMParser().parseFromString(n.length>Qt?n.slice(0,Qt):n,"text/html");}catch{return t.appendChild(e.createTextNode(n)),t}let i={nodes:0,exceeded:false};for(let r of Array.from(o.body.childNodes)){let s=Ne(r,e,0,i);s&&t.appendChild(s);}if(i.exceeded){let r=e.createDocumentFragment();return r.appendChild(e.createTextNode(o.body.textContent??"")),r}return t}function Ne(n,e,t,o){if(o.exceeded)return null;if(++o.nodes>jn||t>qn)return o.exceeded=true,null;if(n.nodeType===Node.TEXT_NODE)return e.createTextNode(n.textContent??"");if(n.nodeType!==Node.ELEMENT_NODE)return null;let i=n;if(Kn.has(i.tagName))return null;let r=zn[i.tagName];if(!r){let a=e.createDocumentFragment();for(let l of Array.from(i.childNodes)){let d=Ne(l,e,t+1,o);d&&a.appendChild(d);}return a}if(r==="a"){let a=i.getAttribute("href")??"";if(!A(a)){let d=e.createDocumentFragment();for(let c of Array.from(i.childNodes)){let u=Ne(c,e,t+1,o);u&&d.appendChild(u);}return d}let l=e.createElement("a");l.setAttribute("href",a),l.setAttribute("target","_blank"),l.setAttribute("rel","noopener noreferrer nofollow");for(let d of Array.from(i.childNodes)){let c=Ne(d,e,t+1,o);c&&l.appendChild(c);}return l}let s=e.createElement(r);for(let a of Array.from(i.childNodes)){let l=Ne(a,e,t+1,o);l&&s.appendChild(l);}return s}function T(n,e,t){let o=e.createElement("div");o.className="veo-guide-content";let i=en(n);return i?Yn(o,i,e,t):Vn(o,n,e,t),o.appendChild(Oe(e,()=>t.onDismiss())),o}function Zt(n,e){let t=en(n);if(t)return t.filter(i=>i.type!=="button").map(i=>tn(i,e)).filter(i=>i!==null);let o=[];if(typeof n.imageUrl=="string"&&n.imageUrl&&A(n.imageUrl)){let i=e.createElement("img");i.className="veo-guide-image",i.src=n.imageUrl,i.alt=typeof n.title=="string"?n.title:"",o.push(i);}if(typeof n.title=="string"&&n.title){let i=e.createElement("h2");i.className="veo-guide-title",i.textContent=n.title,o.push(i);}if(typeof n.content=="string"&&n.content){let i=e.createElement("p");i.className="veo-guide-text",i.textContent=n.content,o.push(i);}return o}function Vn(n,e,t,o){if(typeof e.imageUrl=="string"&&e.imageUrl&&A(e.imageUrl)){let r=t.createElement("img");r.className="veo-guide-image",r.src=e.imageUrl,r.alt=typeof e.title=="string"?e.title:"",n.appendChild(r);}if(typeof e.title=="string"&&e.title){let r=t.createElement("h2");r.className="veo-guide-title",r.textContent=e.title,n.appendChild(r);}if(typeof e.content=="string"&&e.content){let r=t.createElement("p");r.className="veo-guide-text",r.textContent=e.content,n.appendChild(r);}let i=t.createElement("div");if(i.className="veo-guide-actions",typeof e.ctaText=="string"&&e.ctaText){let r=t.createElement("button");r.type="button",r.className="veo-guide-cta",r.textContent=e.ctaText,r.addEventListener("click",()=>{let s=e.ctaAction??"dismiss",a=Qn(e);o.onCtaClick(s,a);}),i.appendChild(r);}n.appendChild(i);}function en(n){if(!Array.isArray(n.blocks)||n.blocks.length===0)return null;let e=n.blocks.filter(t=>!t||typeof t!="object"?false:t.type==="image"?typeof t.url=="string"&&A(t.url):t.type==="title"||t.type==="text"||t.type==="button");return e.length>0?e:null}function Yn(n,e,t,o){let i=0;for(;i<e.length;){let r=e[i];if(r?.type==="button"){let a=t.createElement("div");a.className="veo-guide-actions";let l;for(;i<e.length&&e[i]?.type==="button";){let d=e[i];if(!l){let c=d.style?.align;(c==="left"||c==="center"||c==="right")&&(l=c);}a.appendChild(Xn(d,t,o)),i++;}l&&(a.style.justifyContent=nn[l]),n.appendChild(a);continue}let s=tn(r,t);s&&n.appendChild(s),i++;}}function tn(n,e){switch(n.type){case "title":{let t=e.createElement("h2");return t.className="veo-guide-title",t.textContent=typeof n.text=="string"?n.text:"",Ze(t,n.style,"text"),t}case "text":{let t=e.createElement("div");return t.className="veo-guide-text",typeof n.html=="string"&&n.html?t.appendChild(Jt(n.html,e)):t.textContent=typeof n.text=="string"?n.text:"",Ze(t,n.style,"text"),t}case "image":{if(typeof n.url!="string"||!A(n.url))return null;let t=e.createElement("img");return t.className="veo-guide-image",t.src=n.url,t.alt="",Ze(t,n.style,"image"),t}default:return null}}function Xn(n,e,t){let o=e.createElement("button");return o.type="button",o.className="veo-guide-cta",o.textContent=typeof n.text=="string"&&n.text?n.text:"OK",Ze(o,n.style,"button"),o.addEventListener("click",()=>{let i=n.action??"dismiss",r=i==="url"&&typeof n.url=="string"&&A(n.url)?n.url:i==="guide"&&typeof n.targetGuideId=="string"&&n.targetGuideId?n.targetGuideId:void 0,s={...typeof n.id=="string"&&n.id?{buttonId:n.id}:{},...typeof n.text=="string"&&n.text?{buttonText:n.text}:{}};t.onCtaClick(i,r,Object.keys(s).length?s:void 0);}),o}var nn={left:"flex-start",center:"center",right:"flex-end"};function _e(n,e,t){return Math.min(t,Math.max(e,n))}function Ze(n,e,t){if(!e||typeof e!="object")return;let o=e;if(t==="image"&&o.bleed===true){n.classList.add("veo-guide-image--bleed");return}let i=typeof o.align=="string"?o.align:null;i&&(i==="left"||i==="center"||i==="right")&&(t==="text"?n.style.textAlign=i:t==="image"&&(n.style.alignSelf=nn[i])),t!=="image"&&typeof o.color=="string"&&(n.style.color=o.color),t==="text"&&typeof o.fontSize=="number"&&Number.isFinite(o.fontSize)&&(n.style.fontSize=`${_e(o.fontSize,8,72)}px`),t==="image"&&typeof o.width=="number"&&Number.isFinite(o.width)&&(n.style.width=`${_e(o.width,10,100)}%`),t==="image"&&typeof o.radius=="number"&&Number.isFinite(o.radius)&&(n.style.borderRadius=`${_e(o.radius,0,48)}px`),typeof o.marginTop=="number"&&Number.isFinite(o.marginTop)&&(n.style.marginTop=`${_e(o.marginTop,0,64)}px`),typeof o.marginBottom=="number"&&Number.isFinite(o.marginBottom)&&(n.style.marginBottom=`${_e(o.marginBottom,0,64)}px`);}function Oe(n,e,t="veo-guide-close"){let o=n.createElement("button");return o.type="button",o.className=t,o.setAttribute("aria-label","Cerrar"),o.textContent="\xD7",o.addEventListener("click",e),o}function A(n){if(typeof n!="string"||n.length===0)return false;try{let e=typeof window<"u"?window.location.href:"http://localhost/",t=new URL(n,e);return vt.includes(t.protocol)}catch{return false}}function Qn(n){let e=n.style?.ctaUrl;if(typeof e=="string")return A(e)?e:void 0}var Jn={"--veo-bg":"#1f2937","--veo-text":"#f9fafb","--veo-text-secondary":"#d1d5db","--veo-shadow":"0 20px 60px rgba(0, 0, 0, 0.55)"},pt={left:"flex-start",center:"center",right:"flex-end"},Zn={left:"flex-start",center:"center",right:"flex-end"},eo={title:"text",text:"text",image:"self"},on={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)"},rn={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]},B=/^#[0-9a-f]{3,8}$|^(rgb|rgba|hsl|hsla)\([\d.,%/\sdeg]+\)$|^[a-z]{3,20}$/i;function R(n,e,t){return Math.min(t,Math.max(e,n))}function sn(n,e){if(!e||typeof e!="object")return;let t=e;if(typeof t.accentColor=="string"&&B.test(t.accentColor.trim())&&n.style.setProperty("--veo-primary",t.accentColor.trim()),typeof t.fontFamily=="string"&&t.fontFamily.length<=200&&!/[<>{}]/.test(t.fontFamily)&&n.style.setProperty("--veo-font",t.fontFamily.trim()),t.theme==="dark")for(let[r,s]of Object.entries(Jn))n.style.setProperty(r,s);typeof t.background=="string"&&B.test(t.background.trim())&&n.style.setProperty("--veo-bg",t.background.trim()),typeof t.textColor=="string"&&B.test(t.textColor.trim())&&n.style.setProperty("--veo-text",t.textColor.trim()),typeof t.textSecondaryColor=="string"&&B.test(t.textSecondaryColor.trim())&&n.style.setProperty("--veo-text-secondary",t.textSecondaryColor.trim()),typeof t.radius=="number"&&Number.isFinite(t.radius)&&n.style.setProperty("--veo-radius",`${R(t.radius,0,48)}px`),typeof t.width=="number"&&Number.isFinite(t.width)&&n.style.setProperty("--veo-width",`${R(t.width,220,720)}px`),typeof t.height=="number"&&Number.isFinite(t.height)&&n.style.setProperty("--veo-min-h",`${R(t.height,120,900)}px`),(t.align==="left"||t.align==="center"||t.align==="right")&&n.style.setProperty("--veo-actions-justify",pt[t.align]),typeof t.padding=="number"&&Number.isFinite(t.padding)&&n.style.setProperty("--veo-pad",`${R(t.padding,0,64)}px`),typeof t.margin=="number"&&Number.isFinite(t.margin)&&n.style.setProperty("--veo-margin",`${R(t.margin,0,64)}px`),typeof t.borderWidth=="number"&&Number.isFinite(t.borderWidth)&&n.style.setProperty("--veo-border-width",`${R(t.borderWidth,0,16)}px`),typeof t.borderColor=="string"&&B.test(t.borderColor.trim())&&n.style.setProperty("--veo-border-color",t.borderColor.trim()),typeof t.shadow=="string"&&on[t.shadow]&&n.style.setProperty("--veo-shadow",on[t.shadow]);let o,i;if(typeof t.posX=="number"&&typeof t.posY=="number"?(o=R(t.posX,0,1),i=R(t.posY,0,1)):typeof t.overlayPosition=="string"&&rn[t.overlayPosition]&&([o,i]=rn[t.overlayPosition]),o!==void 0&&i!==void 0&&(n.style.setProperty("--veo-pos-x",`${o*100}%`),n.style.setProperty("--veo-pos-y",`${i*100}%`)),t.elements&&typeof t.elements=="object"){let r=t.elements;ut(n,"title",r.title),ut(n,"text",r.text),ut(n,"image",r.image),to(n,r.cta);}}function to(n,e){if(!e||typeof e!="object")return;let t=e;typeof t.align=="string"&&pt[t.align]&&n.style.setProperty("--veo-actions-justify",pt[t.align]),typeof t.background=="string"&&B.test(t.background.trim())&&n.style.setProperty("--veo-cta-bg",t.background.trim()),typeof t.color=="string"&&B.test(t.color.trim())&&n.style.setProperty("--veo-cta-color",t.color.trim()),typeof t.fontSize=="number"&&Number.isFinite(t.fontSize)&&n.style.setProperty("--veo-cta-size",`${R(t.fontSize,10,24)}px`),typeof t.radius=="number"&&Number.isFinite(t.radius)&&n.style.setProperty("--veo-cta-radius",`${R(t.radius,0,48)}px`);}function ut(n,e,t){if(!t||typeof t!="object")return;let o=t;if(typeof o.align=="string"&&(o.align==="left"||o.align==="center"||o.align==="right")){let r=(eo[e]??"text")==="self"?Zn[o.align]:o.align;n.style.setProperty(`--veo-${e}-align`,r);}typeof o.color=="string"&&B.test(o.color.trim())&&n.style.setProperty(`--veo-${e}-color`,o.color.trim()),typeof o.fontSize=="number"&&Number.isFinite(o.fontSize)&&n.style.setProperty(`--veo-${e}-size`,`${R(o.fontSize,8,72)}px`),typeof o.width=="number"&&Number.isFinite(o.width)&&n.style.setProperty(`--veo-${e}-width`,`${R(o.width,10,100)}%`),typeof o.radius=="number"&&Number.isFinite(o.radius)&&n.style.setProperty(`--veo-${e}-radius`,`${R(o.radius,0,48)}px`),typeof o.marginTop=="number"&&Number.isFinite(o.marginTop)&&n.style.setProperty(`--veo-${e}-mt`,`${R(o.marginTop,0,64)}px`),typeof o.marginBottom=="number"&&Number.isFinite(o.marginBottom)&&n.style.setProperty(`--veo-${e}-mb`,`${R(o.marginBottom,0,64)}px`);}function F(n){let e=n?.inlinePosition;return e==="before"||e==="prepend"||e==="append"?e:"after"}function O(n,e,t){switch(t){case "before":n.before(e);break;case "after":n.after(e);break;case "prepend":n.prepend(e);break;case "append":n.append(e);break}}function H(n,e,t){let o=window.setInterval(()=>{if(n.isConnected)return;let i=document.querySelector(e);i&&O(i,n,t);},1e3);return ()=>window.clearInterval(o)}function E(n,e=5e3){return new Promise(t=>{let o=()=>{try{return document.querySelector(n)}catch{return null}},i=o();if(i){t(i);return}let r=false,s=d=>{r||(r=true,a.disconnect(),clearTimeout(l),t(d));},a=new MutationObserver(()=>{let d=o();d&&s(d);});a.observe(document.body,{childList:true,subtree:true});let l=setTimeout(()=>s(null),e);})}var an=`
|
|
1
|
+
var veoGuides=(function(exports){'use strict';function gt(){return typeof window<"u"}function Be(){return typeof document<"u"}var vt=["http:","https:"],yt="data-veo-guide",wt="veo:freq:";var bt="veo:walkthrough_state:";var Ct={shown:1,dismissed:2,completed:2};function kt(n){return n.slice(-16)||"default"}var Fe=class{constructor(e){this.storageKey=`${wt}${e}`,this.cache=this.load(),this.prune();}shouldFilter(e,t){if(t==="every_visit"||t==="always")return false;let o=this.cache.get(e);return o?t==="once"?true:t==="until_dismissed"?o.status==="dismissed"||o.status==="completed":t==="until_answered"?o.status==="completed":false:false}record(e,t){let o=this.cache.get(e);o&&Ct[t]<Ct[o.status]||(this.cache.set(e,{guideId:e,status:t,lastInteractionAt:Date.now()}),this.persist());}clear(){this.cache.clear(),this.persist();}snapshot(){return Array.from(this.cache.values())}prune(){let e=Date.now(),t=false;for(let[o,i]of this.cache)e-i.lastInteractionAt>7776e6&&(this.cache.delete(o),t=true);if(this.cache.size>500){let o=Array.from(this.cache.entries()).sort((r,s)=>r[1].lastInteractionAt-s[1].lastInteractionAt),i=this.cache.size-500;for(let r=0;r<i;r++){let s=o[r];s&&this.cache.delete(s[0]);}t=true;}t&&this.persist();}load(){if(typeof localStorage>"u")return new Map;try{let e=localStorage.getItem(this.storageKey);if(!e)return new Map;let t=JSON.parse(e);if(!Array.isArray(t))return new Map;let o=[];for(let i of t)if(i&&typeof i=="object"&&typeof i.guideId=="string"&&typeof i.lastInteractionAt=="number"&&["shown","dismissed","completed"].includes(i.status)){let r=i;o.push([r.guideId,r]);}return new Map(o)}catch{return new Map}}persist(){if(!(typeof localStorage>"u"))try{let e=JSON.stringify(Array.from(this.cache.values()));localStorage.setItem(this.storageKey,e);}catch{}}};var He=class{constructor(e,t,o=false){this.apiUrl=e;this.apiKey=t;this.debug=o;}async resolve(e,t){let o=new URLSearchParams({endUserId:e,pageUrl:t}),i;try{i=await fetch(`${this.apiUrl}/v1/guides/resolve?${o.toString()}`,{method:"GET",headers:{"X-Api-Key":this.apiKey},credentials:"omit"});}catch(r){return this.debug&&console.error("[veo] guides resolve fetch failed:",r),[]}if(!i.ok)return this.debug&&console.warn("[veo] guides resolve HTTP",i.status),[];try{let r=await i.json();return Array.isArray(r.guides)?r.guides:[]}catch(r){return this.debug&&console.error("[veo] guides resolve parse failed:",r),[]}}async fetchById(e){let t;try{t=await fetch(`${this.apiUrl}/v1/guides/${encodeURIComponent(e)}`,{method:"GET",headers:{"X-Api-Key":this.apiKey},credentials:"omit"});}catch(o){return this.debug&&console.error("[veo] guides fetchById network failed:",o),null}if(!t.ok)return this.debug&&console.warn("[veo] guides fetchById HTTP",t.status),null;try{let o=await t.json();return typeof o.guideId!="string"||typeof o.guideName!="string"||typeof o.guideType!="string"||!Array.isArray(o.guideSteps)||!o.activationRules||typeof o.displayFrequency!="string"||typeof o.displayPriority!="number"?(this.debug&&console.warn("[veo] guides fetchById: unexpected shape"),null):{guideId:o.guideId,guideName:o.guideName,guideType:o.guideType,guideSteps:o.guideSteps,activationRules:o.activationRules,displayFrequency:o.displayFrequency,displayPriority:o.displayPriority}}catch(o){return this.debug&&console.error("[veo] guides fetchById parse failed:",o),null}}};function Et(n){let e={endUserId:n.endUserId,interactionType:n.action};return n.sessionId&&(e.sessionId=n.sessionId),typeof n.stepIndex=="number"&&(e.stepPosition=n.stepIndex),n.pageUrl&&(e.pageUrl=n.pageUrl),n.pagePath&&(e.pagePath=n.pagePath),n.metadata&&(e.metadata=n.metadata),e}var $e=class{constructor(e,t){this.apiUrl=e;this.apiKey=t;}async send(e){let t=this.buildUrl(e.guideId),o=await fetch(t,{method:"POST",headers:{"X-Api-Key":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(Et(e.payload)),credentials:"omit"});if(!o.ok)throw new Error(`guide interaction send failed: HTTP ${o.status}`)}sendBeacon(e){if(typeof navigator>"u"||typeof navigator.sendBeacon!="function")return false;let t=`${this.buildUrl(e.guideId)}?key=${encodeURIComponent(this.apiKey)}`,o=new Blob([JSON.stringify(Et(e.payload))],{type:"application/json"});try{return navigator.sendBeacon(t,o)}catch{return false}}buildUrl(e){return `${this.apiUrl}/v1/guides/${encodeURIComponent(e)}/interactions`}};var We=class{constructor(e){this.config=e;this.buffer=[];this.timer=null;this.flushing=false;this.unloadCleanup=null;this.startTimer(),this.installUnloadHandler();}get size(){return this.buffer.length}enqueue(e){this.buffer.push({guideId:e.guideId,payload:e.payload,attempts:0,enqueuedAt:Date.now()}),this.buffer.length>=this.config.batchSize&&this.flush();}async flush(){if(this.flushing||this.buffer.length===0)return;let e=Date.now(),t=this.buffer.filter(r=>(r.nextRetryAt??0)<=e);if(t.length===0)return;this.flushing=true;let o=new Set(t);this.buffer=this.buffer.filter(r=>!o.has(r));let i=await Promise.allSettled(t.map(r=>this.config.client.send({guideId:r.guideId,payload:r.payload})));for(let r=0;r<i.length;r++){let s=i[r],a=t[r];!s||!a||s.status!=="fulfilled"&&(a.attempts+=1,a.attempts<this.config.maxRetries?(a.nextRetryAt=Date.now()+this.retryDelayMs(a.attempts),this.buffer.push(a)):this.safeOnError(s.reason,a));}this.flushing=false;}retryDelayMs(e){let t=Math.min(3e3*2**(e-1),3e4);return t/2+Math.random()*(t/2)}flushBeacon(){if(this.buffer.length===0)return;let e=this.buffer.splice(0,this.buffer.length);for(let t of e)this.config.client.sendBeacon({guideId:t.guideId,payload:t.payload});}destroy(){this.timer&&clearInterval(this.timer),this.timer=null,this.unloadCleanup?.(),this.unloadCleanup=null;}startTimer(){typeof window>"u"||(this.timer=setInterval(()=>{this.flush();},this.config.flushIntervalMs));}installUnloadHandler(){if(typeof window>"u")return;let e=()=>this.flushBeacon(),t=()=>{document.visibilityState==="hidden"&&this.flushBeacon();};window.addEventListener("pagehide",e),window.addEventListener("visibilitychange",t),this.unloadCleanup=()=>{window.removeEventListener("pagehide",e),window.removeEventListener("visibilitychange",t);};}safeOnError(e,t){if(!this.config.onError)return;let o=e instanceof Error?e:new Error(String(e));try{this.config.onError(o,t);}catch{}}};var ie=Math.min,j=Math.max,Ae=Math.round;var _=n=>({x:n,y:n}),bn={left:"right",right:"left",bottom:"top",top:"bottom"};function ze(n,e,t){return j(n,ie(e,t))}function ce(n,e){return typeof n=="function"?n(e):n}function V(n){return n.split("-")[0]}function ue(n){return n.split("-")[1]}function at(n){return n==="x"?"y":"x"}function Ke(n){return n==="y"?"height":"width"}function z(n){let e=n[0];return e==="t"||e==="b"?"y":"x"}function qe(n){return at(z(n))}function It(n,e,t){t===void 0&&(t=false);let o=ue(n),i=qe(n),r=Ke(i),s=i==="x"?o===(t?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=Te(s)),[s,Te(s)]}function Tt(n){let e=Te(n);return [Ue(n),e,Ue(e)]}function Ue(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}var St=["left","right"],Rt=["right","left"],xn=["top","bottom"],Cn=["bottom","top"];function kn(n,e,t){switch(n){case "top":case "bottom":return t?e?Rt:St:e?St:Rt;case "left":case "right":return e?xn:Cn;default:return []}}function At(n,e,t,o){let i=ue(n),r=kn(V(n),t==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(Ue)))),r}function Te(n){let e=V(n);return bn[e]+n.slice(e.length)}function En(n){return {top:0,right:0,bottom:0,left:0,...n}}function lt(n){return typeof n!="number"?En(n):{top:n,right:n,bottom:n,left:n}}function re(n){let{x:e,y:t,width:o,height:i}=n;return {width:o,height:i,top:t,left:e,right:e+o,bottom:t+i,x:e,y:t}}function Pt(n,e,t){let{reference:o,floating:i}=n,r=z(e),s=qe(e),a=Ke(s),l=V(e),d=r==="y",c=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,f=o[a]/2-i[a]/2,p;switch(l){case "top":p={x:c,y:o.y-i.height};break;case "bottom":p={x:c,y:o.y+o.height};break;case "right":p={x:o.x+o.width,y:u};break;case "left":p={x:o.x-i.width,y:u};break;default:p={x:o.x,y:o.y};}switch(ue(e)){case "start":p[s]-=f*(t&&d?-1:1);break;case "end":p[s]+=f*(t&&d?-1:1);break}return p}async function Lt(n,e){var t;e===void 0&&(e={});let{x:o,y:i,platform:r,rects:s,elements:a,strategy:l}=n,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:u="floating",altBoundary:f=false,padding:p=0}=ce(e,n),h=lt(p),g=a[f?u==="floating"?"reference":"floating":u],v=re(await r.getClippingRect({element:(t=await(r.isElement==null?void 0:r.isElement(g)))==null||t?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:d,rootBoundary:c,strategy:l})),w=u==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),y=await(r.isElement==null?void 0:r.isElement(x))?await(r.getScale==null?void 0:r.getScale(x))||{x:1,y:1}:{x:1,y:1},C=re(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:x,strategy:l}):w);return {top:(v.top-C.top+h.top)/y.y,bottom:(C.bottom-v.bottom+h.bottom)/y.y,left:(v.left-C.left+h.left)/y.x,right:(C.right-v.right+h.right)/y.x}}var Sn=50,Gt=async(n,e,t)=>{let{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=t,a=s.detectOverflow?s:{...s,detectOverflow:Lt},l=await(s.isRTL==null?void 0:s.isRTL(e)),d=await s.getElementRects({reference:n,floating:e,strategy:i}),{x:c,y:u}=Pt(d,o,l),f=o,p=0,h={};for(let m=0;m<r.length;m++){let g=r[m];if(!g)continue;let{name:v,fn:w}=g,{x,y,data:C,reset:k}=await w({x:c,y:u,initialPlacement:o,placement:f,strategy:i,middlewareData:h,rects:d,platform:a,elements:{reference:n,floating:e}});c=x??c,u=y??u,h[v]={...h[v],...C},k&&p<Sn&&(p++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(d=k.rects===true?await s.getElementRects({reference:n,floating:e,strategy:i}):k.rects),{x:c,y:u}=Pt(d,f,l)),m=-1);}return {x:c,y:u,placement:f,strategy:i,middlewareData:h}},Nt=n=>({name:"arrow",options:n,async fn(e){let{x:t,y:o,placement:i,rects:r,platform:s,elements:a,middlewareData:l}=e,{element:d,padding:c=0}=ce(n,e)||{};if(d==null)return {};let u=lt(c),f={x:t,y:o},p=qe(i),h=Ke(p),m=await s.getDimensions(d),g=p==="y",v=g?"top":"left",w=g?"bottom":"right",x=g?"clientHeight":"clientWidth",y=r.reference[h]+r.reference[p]-f[p]-r.floating[h],C=f[p]-r.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d)),$=k?k[x]:0;(!$||!await(s.isElement==null?void 0:s.isElement(k)))&&($=a.floating[x]||r.floating[h]);let Se=y/2-C/2,te=$/2-m[h]/2-1,W=ie(u[v],te),Re=ie(u[w],te),ne=W,Ie=$-m[h]-Re,S=$/2-m[h]/2+Se,oe=ze(ne,S,Ie),U=!l.arrow&&ue(i)!=null&&S!==oe&&r.reference[h]/2-(S<ne?W:Re)-m[h]/2<0,G=U?S<ne?S-ne:S-Ie:0;return {[p]:f[p]+G,data:{[p]:oe,centerOffset:S-oe-G,...U&&{alignmentOffset:G}},reset:U}}});var _t=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,o;let{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:c=true,crossAxis:u=true,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=true,...g}=ce(n,e);if((t=r.arrow)!=null&&t.alignmentOffset)return {};let v=V(i),w=z(a),x=V(a)===a,y=await(l.isRTL==null?void 0:l.isRTL(d.floating)),C=f||(x||!m?[Te(a)]:Tt(a)),k=h!=="none";!f&&k&&C.push(...At(a,m,h,y));let $=[a,...C],Se=await l.detectOverflow(e,g),te=[],W=((o=r.flip)==null?void 0:o.overflows)||[];if(c&&te.push(Se[v]),u){let S=It(i,s,y);te.push(Se[S[0]],Se[S[1]]);}if(W=[...W,{placement:i,overflows:te}],!te.every(S=>S<=0)){var Re,ne;let S=(((Re=r.flip)==null?void 0:Re.index)||0)+1,oe=$[S];if(oe&&(!(u==="alignment"?w!==z(oe):false)||W.every(N=>z(N.placement)===w?N.overflows[0]>0:true)))return {data:{index:S,overflows:W},reset:{placement:oe}};let U=(ne=W.filter(G=>G.overflows[0]<=0).sort((G,N)=>G.overflows[1]-N.overflows[1])[0])==null?void 0:ne.placement;if(!U)switch(p){case "bestFit":{var Ie;let G=(Ie=W.filter(N=>{if(k){let q=z(N.placement);return q===w||q==="y"}return true}).map(N=>[N.placement,N.overflows.filter(q=>q>0).reduce((q,yn)=>q+yn,0)]).sort((N,q)=>N[1]-q[1])[0])==null?void 0:Ie[0];G&&(U=G);break}case "initialPlacement":U=a;break}if(i!==U)return {reset:{placement:U}}}return {}}}};var Rn=new Set(["left","top"]);async function In(n,e){let{placement:t,platform:o,elements:i}=n,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=V(t),a=ue(t),l=z(t)==="y",d=Rn.has(s)?-1:1,c=r&&l?-1:1,u=ce(e,n),{mainAxis:f,crossAxis:p,alignmentAxis:h}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof h=="number"&&(p=a==="end"?h*-1:h),l?{x:p*c,y:f*d}:{x:f*d,y:p*c}}var Ot=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,o;let{x:i,y:r,placement:s,middlewareData:a}=e,l=await In(e,n);return s===((t=a.offset)==null?void 0:t.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:s}}}}},Mt=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){let{x:t,y:o,placement:i,platform:r}=e,{mainAxis:s=true,crossAxis:a=false,limiter:l={fn:v=>{let{x:w,y:x}=v;return {x:w,y:x}}},...d}=ce(n,e),c={x:t,y:o},u=await r.detectOverflow(e,d),f=z(V(i)),p=at(f),h=c[p],m=c[f];if(s){let v=p==="y"?"top":"left",w=p==="y"?"bottom":"right",x=h+u[v],y=h-u[w];h=ze(x,h,y);}if(a){let v=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=m+u[v],y=m-u[w];m=ze(x,m,y);}let g=l.fn({...e,[p]:h,[f]:m});return {...g,data:{x:g.x-t,y:g.y-o,enabled:{[p]:s,[f]:a}}}}}};function Ve(){return typeof window<"u"}function ae(n){return Bt(n)?(n.nodeName||"").toLowerCase():"#document"}function I(n){var e;return (n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function M(n){var e;return (e=(Bt(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Bt(n){return Ve()?n instanceof Node||n instanceof I(n).Node:false}function P(n){return Ve()?n instanceof Element||n instanceof I(n).Element:false}function D(n){return Ve()?n instanceof HTMLElement||n instanceof I(n).HTMLElement:false}function Dt(n){return !Ve()||typeof ShadowRoot>"u"?false:n instanceof ShadowRoot||n instanceof I(n).ShadowRoot}function pe(n){let{overflow:e,overflowX:t,overflowY:o,display:i}=L(n);return /auto|scroll|overlay|hidden|clip/.test(e+o+t)&&i!=="inline"&&i!=="contents"}function Ft(n){return /^(table|td|th)$/.test(ae(n))}function Pe(n){try{if(n.matches(":popover-open"))return !0}catch{}try{return n.matches(":modal")}catch{return false}}var Tn=/transform|translate|scale|rotate|perspective|filter/,An=/paint|layout|strict|content/,se=n=>!!n&&n!=="none",dt;function Ye(n){let e=P(n)?L(n):n;return se(e.transform)||se(e.translate)||se(e.scale)||se(e.rotate)||se(e.perspective)||!Xe()&&(se(e.backdropFilter)||se(e.filter))||Tn.test(e.willChange||"")||An.test(e.contain||"")}function Ht(n){let e=K(n);for(;D(e)&&!le(e);){if(Ye(e))return e;if(Pe(e))return null;e=K(e);}return null}function Xe(){return dt==null&&(dt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),dt}function le(n){return /^(html|body|#document)$/.test(ae(n))}function L(n){return I(n).getComputedStyle(n)}function Le(n){return P(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function K(n){if(ae(n)==="html")return n;let e=n.assignedSlot||n.parentNode||Dt(n)&&n.host||M(n);return Dt(e)?e.host:e}function $t(n){let e=K(n);return le(e)?n.ownerDocument?n.ownerDocument.body:n.body:D(e)&&pe(e)?e:$t(e)}function je(n,e,t){var o;e===void 0&&(e=[]);let i=$t(n),r=i===((o=n.ownerDocument)==null?void 0:o.body),s=I(i);if(r){Qe(s);return e.concat(s,s.visualViewport||[],pe(i)?i:[],[])}else return e.concat(i,je(i,[]))}function Qe(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Kt(n){let e=L(n),t=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=D(n),r=i?n.offsetWidth:t,s=i?n.offsetHeight:o,a=Ae(t)!==r||Ae(o)!==s;return a&&(t=r,o=s),{width:t,height:o,$:a}}function qt(n){return P(n)?n:n.contextElement}function fe(n){let e=qt(n);if(!D(e))return _(1);let t=e.getBoundingClientRect(),{width:o,height:i,$:r}=Kt(e),s=(r?Ae(t.width):t.width)/o,a=(r?Ae(t.height):t.height)/i;return (!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var Pn=_(0);function jt(n){let e=I(n);return !Xe()||!e.visualViewport?Pn:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ln(n,e,t){return e===void 0&&(e=false),!t||e&&t!==I(n)?false:e}function Ge(n,e,t,o){e===void 0&&(e=false),t===void 0&&(t=false);let i=n.getBoundingClientRect(),r=qt(n),s=_(1);e&&(o?P(o)&&(s=fe(o)):s=fe(n));let a=Ln(r,t,o)?jt(r):_(0),l=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,c=i.width/s.x,u=i.height/s.y;if(r){let f=I(r),p=o&&P(o)?I(o):o,h=f,m=Qe(h);for(;m&&o&&p!==h;){let g=fe(m),v=m.getBoundingClientRect(),w=L(m),x=v.left+(m.clientLeft+parseFloat(w.paddingLeft))*g.x,y=v.top+(m.clientTop+parseFloat(w.paddingTop))*g.y;l*=g.x,d*=g.y,c*=g.x,u*=g.y,l+=x,d+=y,h=I(m),m=Qe(h);}}return re({width:c,height:u,x:l,y:d})}function Je(n,e){let t=Le(n).scrollLeft;return e?e.left+t:Ge(M(n)).left+t}function Vt(n,e){let t=n.getBoundingClientRect(),o=t.left+e.scrollLeft-Je(n,t),i=t.top+e.scrollTop;return {x:o,y:i}}function Gn(n){let{elements:e,rect:t,offsetParent:o,strategy:i}=n,r=i==="fixed",s=M(o),a=e?Pe(e.floating):false;if(o===s||a&&r)return t;let l={scrollLeft:0,scrollTop:0},d=_(1),c=_(0),u=D(o);if((u||!u&&!r)&&((ae(o)!=="body"||pe(s))&&(l=Le(o)),u)){let p=Ge(o);d=fe(o),c.x=p.x+o.clientLeft,c.y=p.y+o.clientTop;}let f=s&&!u&&!r?Vt(s,l):_(0);return {width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-l.scrollLeft*d.x+c.x+f.x,y:t.y*d.y-l.scrollTop*d.y+c.y+f.y}}function Nn(n){return Array.from(n.getClientRects())}function _n(n){let e=M(n),t=Le(n),o=n.ownerDocument.body,i=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),s=-t.scrollLeft+Je(n),a=-t.scrollTop;return L(o).direction==="rtl"&&(s+=j(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:a}}var Wt=25;function On(n,e){let t=I(n),o=M(n),i=t.visualViewport,r=o.clientWidth,s=o.clientHeight,a=0,l=0;if(i){r=i.width,s=i.height;let c=Xe();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop);}let d=Je(o);if(d<=0){let c=o.ownerDocument,u=c.body,f=getComputedStyle(u),p=c.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,h=Math.abs(o.clientWidth-u.clientWidth-p);h<=Wt&&(r-=h);}else d<=Wt&&(r+=d);return {width:r,height:s,x:a,y:l}}function Mn(n,e){let t=Ge(n,true,e==="fixed"),o=t.top+n.clientTop,i=t.left+n.clientLeft,r=D(n)?fe(n):_(1),s=n.clientWidth*r.x,a=n.clientHeight*r.y,l=i*r.x,d=o*r.y;return {width:s,height:a,x:l,y:d}}function Ut(n,e,t){let o;if(e==="viewport")o=On(n,t);else if(e==="document")o=_n(M(n));else if(P(e))o=Mn(e,t);else {let i=jt(n);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height};}return re(o)}function Yt(n,e){let t=K(n);return t===e||!P(t)||le(t)?false:L(t).position==="fixed"||Yt(t,e)}function Dn(n,e){let t=e.get(n);if(t)return t;let o=je(n,[]).filter(a=>P(a)&&ae(a)!=="body"),i=null,r=L(n).position==="fixed",s=r?K(n):n;for(;P(s)&&!le(s);){let a=L(s),l=Ye(s);!l&&a.position==="fixed"&&(i=null),(r?!l&&!i:!l&&a.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||pe(s)&&!l&&Yt(n,s))?o=o.filter(c=>c!==s):i=a,s=K(s);}return e.set(n,o),o}function Bn(n){let{element:e,boundary:t,rootBoundary:o,strategy:i}=n,s=[...t==="clippingAncestors"?Pe(e)?[]:Dn(e,this._c):[].concat(t),o],a=Ut(e,s[0],i),l=a.top,d=a.right,c=a.bottom,u=a.left;for(let f=1;f<s.length;f++){let p=Ut(e,s[f],i);l=j(p.top,l),d=ie(p.right,d),c=ie(p.bottom,c),u=j(p.left,u);}return {width:d-u,height:c-l,x:u,y:l}}function Fn(n){let{width:e,height:t}=Kt(n);return {width:e,height:t}}function Hn(n,e,t){let o=D(e),i=M(e),r=t==="fixed",s=Ge(n,true,r,e),a={scrollLeft:0,scrollTop:0},l=_(0);function d(){l.x=Je(i);}if(o||!o&&!r)if((ae(e)!=="body"||pe(i))&&(a=Le(e)),o){let p=Ge(e,true,r,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop;}else i&&d();r&&!o&&i&&d();let c=i&&!o&&!r?Vt(i,a):_(0),u=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return {x:u,y:f,width:s.width,height:s.height}}function ct(n){return L(n).position==="static"}function zt(n,e){if(!D(n)||L(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return M(n)===t&&(t=t.ownerDocument.body),t}function Xt(n,e){let t=I(n);if(Pe(n))return t;if(!D(n)){let i=K(n);for(;i&&!le(i);){if(P(i)&&!ct(i))return i;i=K(i);}return t}let o=zt(n,e);for(;o&&Ft(o)&&ct(o);)o=zt(o,e);return o&&le(o)&&ct(o)&&!Ye(o)?t:o||Ht(n)||t}var $n=async function(n){let e=this.getOffsetParent||Xt,t=this.getDimensions,o=await t(n.floating);return {reference:Hn(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Wn(n){return L(n).direction==="rtl"}var Un={convertOffsetParentRelativeRectToViewportRelativeRect:Gn,getDocumentElement:M,getClippingRect:Bn,getOffsetParent:Xt,getElementRects:$n,getClientRects:Nn,getDimensions:Fn,getScale:fe,isElement:P,isRTL:Wn};var Y=Ot;var X=Mt,Q=_t;var he=Nt;var J=(n,e,t)=>{let o=new Map,i={platform:Un,...t},r={...i.platform,_c:o};return Gt(n,e,{...i,platform:r})};var zn={P:"p",BR:"br",STRONG:"strong",B:"strong",EM:"em",I:"em",U:"u",S:"s",UL:"ul",OL:"ol",LI:"li",A:"a"},Kn=new Set(["SCRIPT","STYLE","TEMPLATE","IFRAME","OBJECT","EMBED","NOSCRIPT","TITLE","TEXTAREA","SELECT","SVG","MATH"]),Qt=16*1024,qn=20,jn=1e3;function Jt(n,e){let t=e.createDocumentFragment();if(typeof n!="string"||n.length===0)return t;let o;try{o=new DOMParser().parseFromString(n.length>Qt?n.slice(0,Qt):n,"text/html");}catch{return t.appendChild(e.createTextNode(n)),t}let i={nodes:0,exceeded:false};for(let r of Array.from(o.body.childNodes)){let s=Ne(r,e,0,i);s&&t.appendChild(s);}if(i.exceeded){let r=e.createDocumentFragment();return r.appendChild(e.createTextNode(o.body.textContent??"")),r}return t}function Ne(n,e,t,o){if(o.exceeded)return null;if(++o.nodes>jn||t>qn)return o.exceeded=true,null;if(n.nodeType===Node.TEXT_NODE)return e.createTextNode(n.textContent??"");if(n.nodeType!==Node.ELEMENT_NODE)return null;let i=n;if(Kn.has(i.tagName))return null;let r=zn[i.tagName];if(!r){let a=e.createDocumentFragment();for(let l of Array.from(i.childNodes)){let d=Ne(l,e,t+1,o);d&&a.appendChild(d);}return a}if(r==="a"){let a=i.getAttribute("href")??"";if(!A(a)){let d=e.createDocumentFragment();for(let c of Array.from(i.childNodes)){let u=Ne(c,e,t+1,o);u&&d.appendChild(u);}return d}let l=e.createElement("a");l.setAttribute("href",a),l.setAttribute("target","_blank"),l.setAttribute("rel","noopener noreferrer nofollow");for(let d of Array.from(i.childNodes)){let c=Ne(d,e,t+1,o);c&&l.appendChild(c);}return l}let s=e.createElement(r);for(let a of Array.from(i.childNodes)){let l=Ne(a,e,t+1,o);l&&s.appendChild(l);}return s}function T(n,e,t){let o=e.createElement("div");o.className="veo-guide-content";let i=en(n);return i?Yn(o,i,e,t):Vn(o,n,e,t),o.appendChild(Oe(e,()=>t.onDismiss())),o}function Zt(n,e){let t=en(n);if(t){let i=[];for(let{block:r,idx:s}of t){if(r.type==="button")continue;let a=tn(r,e);a&&(a.dataset.veoIdx=String(s),i.push(a));}return i}let o=[];if(typeof n.imageUrl=="string"&&n.imageUrl&&A(n.imageUrl)){let i=e.createElement("img");i.className="veo-guide-image",i.src=n.imageUrl,i.alt=typeof n.title=="string"?n.title:"",o.push(i);}if(typeof n.title=="string"&&n.title){let i=e.createElement("h2");i.className="veo-guide-title",i.textContent=n.title,o.push(i);}if(typeof n.content=="string"&&n.content){let i=e.createElement("p");i.className="veo-guide-text",i.textContent=n.content,o.push(i);}return o}function Vn(n,e,t,o){if(typeof e.imageUrl=="string"&&e.imageUrl&&A(e.imageUrl)){let r=t.createElement("img");r.className="veo-guide-image",r.src=e.imageUrl,r.alt=typeof e.title=="string"?e.title:"",n.appendChild(r);}if(typeof e.title=="string"&&e.title){let r=t.createElement("h2");r.className="veo-guide-title",r.textContent=e.title,n.appendChild(r);}if(typeof e.content=="string"&&e.content){let r=t.createElement("p");r.className="veo-guide-text",r.textContent=e.content,n.appendChild(r);}let i=t.createElement("div");if(i.className="veo-guide-actions",typeof e.ctaText=="string"&&e.ctaText){let r=t.createElement("button");r.type="button",r.className="veo-guide-cta",r.textContent=e.ctaText,r.addEventListener("click",()=>{let s=e.ctaAction??"dismiss",a=Qn(e);o.onCtaClick(s,a);}),i.appendChild(r);}n.appendChild(i);}function en(n){if(!Array.isArray(n.blocks)||n.blocks.length===0)return null;let e=n.blocks.map((t,o)=>({block:t,idx:o})).filter(t=>{let o=t.block;return !o||typeof o!="object"?false:o.type==="image"?typeof o.url=="string"&&A(o.url):o.type==="title"||o.type==="text"||o.type==="button"});return e.length>0?e:null}function Yn(n,e,t,o){let i=0;for(;i<e.length;){let r=e[i];if(r?.block.type==="button"){let a=t.createElement("div");a.className="veo-guide-actions",a.dataset.veoIdx=String(r.idx);let l;for(;i<e.length&&e[i]?.block.type==="button";){let d=e[i].block;if(!l){let c=d.style?.align;(c==="left"||c==="center"||c==="right")&&(l=c);}a.appendChild(Xn(d,t,o)),i++;}l&&(a.style.justifyContent=nn[l]),n.appendChild(a);continue}let s=r?tn(r.block,t):null;s&&r&&(s.dataset.veoIdx=String(r.idx),n.appendChild(s)),i++;}}function tn(n,e){switch(n.type){case "title":{let t=e.createElement("h2");return t.className="veo-guide-title",t.textContent=typeof n.text=="string"?n.text:"",Ze(t,n.style,"text"),t}case "text":{let t=e.createElement("div");return t.className="veo-guide-text",typeof n.html=="string"&&n.html?t.appendChild(Jt(n.html,e)):t.textContent=typeof n.text=="string"?n.text:"",Ze(t,n.style,"text"),t}case "image":{if(typeof n.url!="string"||!A(n.url))return null;let t=e.createElement("img");return t.className="veo-guide-image",t.src=n.url,t.alt="",Ze(t,n.style,"image"),t}default:return null}}function Xn(n,e,t){let o=e.createElement("button");return o.type="button",o.className="veo-guide-cta",o.textContent=typeof n.text=="string"&&n.text?n.text:"OK",Ze(o,n.style,"button"),o.addEventListener("click",()=>{let i=n.action??"dismiss",r=i==="url"&&typeof n.url=="string"&&A(n.url)?n.url:i==="guide"&&typeof n.targetGuideId=="string"&&n.targetGuideId?n.targetGuideId:void 0,s={...typeof n.id=="string"&&n.id?{buttonId:n.id}:{},...typeof n.text=="string"&&n.text?{buttonText:n.text}:{}};t.onCtaClick(i,r,Object.keys(s).length?s:void 0);}),o}var nn={left:"flex-start",center:"center",right:"flex-end"};function _e(n,e,t){return Math.min(t,Math.max(e,n))}function Ze(n,e,t){if(!e||typeof e!="object")return;let o=e;if(t==="image"&&o.bleed===true){n.classList.add("veo-guide-image--bleed");return}let i=typeof o.align=="string"?o.align:null;i&&(i==="left"||i==="center"||i==="right")&&(t==="text"?n.style.textAlign=i:t==="image"&&(n.style.alignSelf=nn[i])),t!=="image"&&typeof o.color=="string"&&(n.style.color=o.color),t==="text"&&typeof o.fontSize=="number"&&Number.isFinite(o.fontSize)&&(n.style.fontSize=`${_e(o.fontSize,8,72)}px`),t==="image"&&typeof o.width=="number"&&Number.isFinite(o.width)&&(n.style.width=`${_e(o.width,10,100)}%`),t==="image"&&typeof o.radius=="number"&&Number.isFinite(o.radius)&&(n.style.borderRadius=`${_e(o.radius,0,48)}px`),typeof o.marginTop=="number"&&Number.isFinite(o.marginTop)&&(n.style.marginTop=`${_e(o.marginTop,0,64)}px`),typeof o.marginBottom=="number"&&Number.isFinite(o.marginBottom)&&(n.style.marginBottom=`${_e(o.marginBottom,0,64)}px`);}function Oe(n,e,t="veo-guide-close"){let o=n.createElement("button");return o.type="button",o.className=t,o.setAttribute("aria-label","Cerrar"),o.textContent="\xD7",o.addEventListener("click",e),o}function A(n){if(typeof n!="string"||n.length===0)return false;try{let e=typeof window<"u"?window.location.href:"http://localhost/",t=new URL(n,e);return vt.includes(t.protocol)}catch{return false}}function Qn(n){let e=n.style?.ctaUrl;if(typeof e=="string")return A(e)?e:void 0}var Jn={"--veo-bg":"#1f2937","--veo-text":"#f9fafb","--veo-text-secondary":"#d1d5db","--veo-shadow":"0 20px 60px rgba(0, 0, 0, 0.55)"},pt={left:"flex-start",center:"center",right:"flex-end"},Zn={left:"flex-start",center:"center",right:"flex-end"},eo={title:"text",text:"text",image:"self"},on={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)"},rn={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]},B=/^#[0-9a-f]{3,8}$|^(rgb|rgba|hsl|hsla)\([\d.,%/\sdeg]+\)$|^[a-z]{3,20}$/i;function R(n,e,t){return Math.min(t,Math.max(e,n))}function sn(n,e){if(!e||typeof e!="object")return;let t=e;if(typeof t.accentColor=="string"&&B.test(t.accentColor.trim())&&n.style.setProperty("--veo-primary",t.accentColor.trim()),typeof t.fontFamily=="string"&&t.fontFamily.length<=200&&!/[<>{}]/.test(t.fontFamily)&&n.style.setProperty("--veo-font",t.fontFamily.trim()),t.theme==="dark")for(let[r,s]of Object.entries(Jn))n.style.setProperty(r,s);typeof t.background=="string"&&B.test(t.background.trim())&&n.style.setProperty("--veo-bg",t.background.trim()),typeof t.textColor=="string"&&B.test(t.textColor.trim())&&n.style.setProperty("--veo-text",t.textColor.trim()),typeof t.textSecondaryColor=="string"&&B.test(t.textSecondaryColor.trim())&&n.style.setProperty("--veo-text-secondary",t.textSecondaryColor.trim()),typeof t.radius=="number"&&Number.isFinite(t.radius)&&n.style.setProperty("--veo-radius",`${R(t.radius,0,48)}px`),typeof t.width=="number"&&Number.isFinite(t.width)&&n.style.setProperty("--veo-width",`${R(t.width,220,720)}px`),typeof t.height=="number"&&Number.isFinite(t.height)&&n.style.setProperty("--veo-min-h",`${R(t.height,120,900)}px`),(t.align==="left"||t.align==="center"||t.align==="right")&&n.style.setProperty("--veo-actions-justify",pt[t.align]),typeof t.padding=="number"&&Number.isFinite(t.padding)&&n.style.setProperty("--veo-pad",`${R(t.padding,0,64)}px`),typeof t.margin=="number"&&Number.isFinite(t.margin)&&n.style.setProperty("--veo-margin",`${R(t.margin,0,64)}px`),typeof t.borderWidth=="number"&&Number.isFinite(t.borderWidth)&&n.style.setProperty("--veo-border-width",`${R(t.borderWidth,0,16)}px`),typeof t.borderColor=="string"&&B.test(t.borderColor.trim())&&n.style.setProperty("--veo-border-color",t.borderColor.trim()),typeof t.shadow=="string"&&on[t.shadow]&&n.style.setProperty("--veo-shadow",on[t.shadow]);let o,i;if(typeof t.posX=="number"&&typeof t.posY=="number"?(o=R(t.posX,0,1),i=R(t.posY,0,1)):typeof t.overlayPosition=="string"&&rn[t.overlayPosition]&&([o,i]=rn[t.overlayPosition]),o!==void 0&&i!==void 0&&(n.style.setProperty("--veo-pos-x",`${o*100}%`),n.style.setProperty("--veo-pos-y",`${i*100}%`)),t.elements&&typeof t.elements=="object"){let r=t.elements;ut(n,"title",r.title),ut(n,"text",r.text),ut(n,"image",r.image),to(n,r.cta);}}function to(n,e){if(!e||typeof e!="object")return;let t=e;typeof t.align=="string"&&pt[t.align]&&n.style.setProperty("--veo-actions-justify",pt[t.align]),typeof t.background=="string"&&B.test(t.background.trim())&&n.style.setProperty("--veo-cta-bg",t.background.trim()),typeof t.color=="string"&&B.test(t.color.trim())&&n.style.setProperty("--veo-cta-color",t.color.trim()),typeof t.fontSize=="number"&&Number.isFinite(t.fontSize)&&n.style.setProperty("--veo-cta-size",`${R(t.fontSize,10,24)}px`),typeof t.radius=="number"&&Number.isFinite(t.radius)&&n.style.setProperty("--veo-cta-radius",`${R(t.radius,0,48)}px`);}function ut(n,e,t){if(!t||typeof t!="object")return;let o=t;if(typeof o.align=="string"&&(o.align==="left"||o.align==="center"||o.align==="right")){let r=(eo[e]??"text")==="self"?Zn[o.align]:o.align;n.style.setProperty(`--veo-${e}-align`,r);}typeof o.color=="string"&&B.test(o.color.trim())&&n.style.setProperty(`--veo-${e}-color`,o.color.trim()),typeof o.fontSize=="number"&&Number.isFinite(o.fontSize)&&n.style.setProperty(`--veo-${e}-size`,`${R(o.fontSize,8,72)}px`),typeof o.width=="number"&&Number.isFinite(o.width)&&n.style.setProperty(`--veo-${e}-width`,`${R(o.width,10,100)}%`),typeof o.radius=="number"&&Number.isFinite(o.radius)&&n.style.setProperty(`--veo-${e}-radius`,`${R(o.radius,0,48)}px`),typeof o.marginTop=="number"&&Number.isFinite(o.marginTop)&&n.style.setProperty(`--veo-${e}-mt`,`${R(o.marginTop,0,64)}px`),typeof o.marginBottom=="number"&&Number.isFinite(o.marginBottom)&&n.style.setProperty(`--veo-${e}-mb`,`${R(o.marginBottom,0,64)}px`);}function F(n){let e=n?.inlinePosition;return e==="before"||e==="prepend"||e==="append"?e:"after"}function O(n,e,t){switch(t){case "before":n.before(e);break;case "after":n.after(e);break;case "prepend":n.prepend(e);break;case "append":n.append(e);break}}function H(n,e,t){let o=window.setInterval(()=>{if(n.isConnected)return;let i=document.querySelector(e);i&&O(i,n,t);},1e3);return ()=>window.clearInterval(o)}function E(n,e=5e3){return new Promise(t=>{let o=()=>{try{return document.querySelector(n)}catch{return null}},i=o();if(i){t(i);return}let r=false,s=d=>{r||(r=true,a.disconnect(),clearTimeout(l),t(d));},a=new MutationObserver(()=>{let d=o();d&&s(d);});a.observe(document.body,{childList:true,subtree:true});let l=setTimeout(()=>s(null),e);})}var an=`
|
|
2
2
|
:host {
|
|
3
3
|
--veo-primary: #FF5B35;
|
|
4
4
|
--veo-text: #1f2937;
|